92 lines
4.8 KiB
TypeScript
92 lines
4.8 KiB
TypeScript
// Metro module 16026 (f16027).
|
|
import { memo, useContext, useCallback } from "react";
|
|
import { BACKDROP_OPAQUE_MAX_OPACITY } from "../../../../design/components/Backdrop/native/BackdropConstants";
|
|
import { PANEL_CONTROLS_HEIGHT_PHYSICS, VoicePanelModes } from "../../VoicePanelConstants";
|
|
import { VoicePanelControlsModes } from "./VoicePanelControlsConstants";
|
|
import VoicePanelStateContext from "../VoicePanelStateContext";
|
|
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
|
|
import { useDerivedValue, useAnimatedStyle, useAnimatedProps } from "../../../reanimated/ReanimatedRexport";
|
|
import * as _VoicePanelControlUtils from "./utils/VoicePanelControlUtils";
|
|
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
|
|
import * as _AccessibilityPreferencesSharedValue from "../../../a11y/native/AccessibilityPreferencesSharedValue";
|
|
import { Backdrop } from "../../../../design/components/Backdrop/native/Backdrop.native";
|
|
const __initData = {
|
|
code: "function VoicePanelControlsDimOverlayTsx1(){const{windowDimensions,getDrawerSpec,safeArea,controlsSpecs,VoicePanelControlsModes,mode,VoicePanelModes,interpolate,wrapperSpecs,BACKDROP_OPAQUE_MAX_OPACITY}=this.__closure;const{height:height}=windowDimensions.get();const{minHeight:minHeight,maxHeight:maxHeight}=getDrawerSpec(height,safeArea.get().top);if(controlsSpecs.get().mode!==VoicePanelControlsModes.DRAWER||mode.get()!==VoicePanelModes.PANEL){return 0;}return interpolate(wrapperSpecs.get().height,[minHeight,maxHeight],[0,BACKDROP_OPAQUE_MAX_OPACITY],'clamp');}"
|
|
};
|
|
const __initData2 = {
|
|
code: "function VoicePanelControlsDimOverlayTsx2(){const{overlayOpacity}=this.__closure;return overlayOpacity.get()>=0.35;}"
|
|
};
|
|
const __initData3 = {
|
|
code: "function VoicePanelControlsDimOverlayTsx3(){const{withSpring,overlayOpacity,PANEL_CONTROLS_HEIGHT_PHYSICS,accessibilityPreferencesSharedValue,overlayActive}=this.__closure;return{zIndex:1,opacity:withSpring(overlayOpacity.get(),PANEL_CONTROLS_HEIGHT_PHYSICS),display:accessibilityPreferencesSharedValue.get().screenReaderEnabled&&!overlayActive.get()?'none':'flex'};}"
|
|
};
|
|
const __initData4 = {
|
|
code: "function VoicePanelControlsDimOverlayTsx4(){const{overlayActive}=this.__closure;return{pointerEvents:!overlayActive.get()?'none':'auto'};}"
|
|
};
|
|
const r34 = memo(function VoicePanelControlsDimOverlay(props) {
|
|
let derivedValue, derivedValue2;
|
|
const wrapperSpecs = props.wrapperSpecs;
|
|
derivedValue = void 0;
|
|
derivedValue2 = void 0;
|
|
const context = useContext(VoicePanelStateContext);
|
|
const { windowDimensions, setControlsMode, controlsSpecs, safeArea, mode } = context;
|
|
const A = function A() {
|
|
const drawerSpec = _VoicePanelControlUtils.getDrawerSpec(windowDimensions.get().height, safeArea.get().top);
|
|
const { minHeight, maxHeight } = drawerSpec;
|
|
return controlsSpecs.get().mode === VoicePanelControlsModes.DRAWER ? mode.get() === VoicePanelModes.PANEL ? _ReanimatedRexport.interpolate(wrapperSpecs.get().height, [minHeight, maxHeight], [0, BACKDROP_OPAQUE_MAX_OPACITY], "clamp") : 0 : 0;
|
|
};
|
|
A.__closure = {
|
|
windowDimensions,
|
|
getDrawerSpec: _VoicePanelControlUtils.getDrawerSpec,
|
|
safeArea,
|
|
controlsSpecs,
|
|
VoicePanelControlsModes,
|
|
mode,
|
|
VoicePanelModes,
|
|
interpolate: _ReanimatedRexport.interpolate,
|
|
wrapperSpecs,
|
|
BACKDROP_OPAQUE_MAX_OPACITY
|
|
};
|
|
A.__workletHash = 17386741533055;
|
|
A.__initData = __initData;
|
|
derivedValue = useDerivedValue(A);
|
|
const y = () => derivedValue.get() >= 0.35;
|
|
y.__closure = {
|
|
overlayOpacity: derivedValue
|
|
};
|
|
y.__workletHash = 733654137262;
|
|
y.__initData = __initData2;
|
|
derivedValue2 = useDerivedValue(y);
|
|
const S = function S() {
|
|
return {
|
|
zIndex: 1,
|
|
opacity: _spring.withSpring(derivedValue.get(), PANEL_CONTROLS_HEIGHT_PHYSICS),
|
|
display: _AccessibilityPreferencesSharedValue.accessibilityPreferencesSharedValue.get().screenReaderEnabled ? derivedValue2.get() ? "flex" : "none" : "flex"
|
|
};
|
|
};
|
|
S.__closure = {
|
|
withSpring: _spring.withSpring,
|
|
overlayOpacity: derivedValue,
|
|
PANEL_CONTROLS_HEIGHT_PHYSICS,
|
|
accessibilityPreferencesSharedValue: _AccessibilityPreferencesSharedValue.accessibilityPreferencesSharedValue,
|
|
overlayActive: derivedValue2
|
|
};
|
|
S.__workletHash = 7500180433000;
|
|
S.__initData = __initData3;
|
|
const animatedStyle = useAnimatedStyle(S);
|
|
const v = () => ({
|
|
pointerEvents: derivedValue2.get() ? "auto" : "none"
|
|
});
|
|
v.__closure = {
|
|
overlayActive: derivedValue2
|
|
};
|
|
v.__workletHash = 873976025930;
|
|
v.__initData = __initData4;
|
|
const animatedProps = useAnimatedProps(v);
|
|
return <Backdrop onDismiss={useCallback(() => {
|
|
setControlsMode({
|
|
mode: VoicePanelControlsModes.FLOATING_DEFAULT
|
|
});
|
|
}, [setControlsMode])} style={animatedStyle} animatedProps={animatedProps} opaque aria-hidden />;
|
|
});
|
|
export default r34;
|