96 lines
3.5 KiB
TypeScript
96 lines
3.5 KiB
TypeScript
// Metro module 10037 (f10038).
|
|
import { createContext } from "react";
|
|
import { VoicePanelModes } from "../VoicePanelConstants";
|
|
import * as _VoicePanelControlsConstants from "./controls/VoicePanelControlsConstants";
|
|
import { MorphablePanelModes } from "../../panels/morphable/native/MorphablePanelConstants";
|
|
import { createFakeSharedValue } from "../../reanimated/ReanimatedHelperTypes";
|
|
import VoicePanelCardLayoutManager from "./card/VoicePanelCardLayoutManager";
|
|
import { EMPTY_SAFE_AREA_INSETS } from "../../safe_area/SafeAreaConstants.native";
|
|
const { CONTROLS_HEIGHT, VoicePanelControlsModes } = _VoicePanelControlsConstants;
|
|
const context = createContext({
|
|
channelId: "context-not-initialized",
|
|
channelType: void 0,
|
|
connected: createFakeSharedValue(false),
|
|
contentDimensions: createFakeSharedValue({
|
|
width: 0,
|
|
height: 0
|
|
}),
|
|
controlsSpecs: createFakeSharedValue({
|
|
mode: VoicePanelControlsModes.FLOATING_DEFAULT,
|
|
locked: false,
|
|
height: CONTROLS_HEIGHT,
|
|
pushToTalk: false
|
|
}),
|
|
dismissPanel: () => {
|
|
throw new Error("VoicePanelContextType.Provider.dismissDrawer: not called within a context provider");
|
|
},
|
|
dismissToPIPGestureRef: {
|
|
current: void 0
|
|
},
|
|
dragScrolling: createFakeSharedValue(false),
|
|
focused: createFakeSharedValue(null),
|
|
generateStateLocker: () => {
|
|
throw new Error("VoicePanelContextType.Provider.generateStateLocker: not called within a context provider");
|
|
},
|
|
guildId: void 0,
|
|
hideControls: () => {
|
|
throw new Error("VoicePanelContextType.Provider.hideControls: not called within a context provider");
|
|
},
|
|
isCall: false,
|
|
isFocusedVideoZoomed: createFakeSharedValue(false),
|
|
layoutManager: new VoicePanelCardLayoutManager("invalid"),
|
|
mode: createFakeSharedValue(VoicePanelModes.PANEL),
|
|
morphablePanelMode: createFakeSharedValue(MorphablePanelModes.PANEL),
|
|
mountedCards: new Set(),
|
|
pipAvoidanceSpecs: createFakeSharedValue({
|
|
top: 0,
|
|
bottom: 0
|
|
}),
|
|
preJoinContentSize: createFakeSharedValue(0),
|
|
safeArea: createFakeSharedValue(EMPTY_SAFE_AREA_INSETS),
|
|
scrollPosition: createFakeSharedValue(0),
|
|
setControlsMode: () => {
|
|
throw new Error("VoicePanelContextType.Provider.setControlsMode: not called within a context provider");
|
|
},
|
|
setFocused: () => {
|
|
throw new Error("VoicePanelContextType.Provider.setFocused: not called within a context provider");
|
|
},
|
|
setIsFocusedVideoZoomed: () => {
|
|
throw new Error("VoicePanelContextType.Provider.showControls: not called within a context provider");
|
|
},
|
|
setMode: () => {
|
|
throw new Error("VoicePanelContextType.Provider.setMode: not called within a context provider");
|
|
},
|
|
setShowFloatingCTA: () => {
|
|
throw new Error("VoicePanelContextType.Provider.showFloatingCTA: not called within a context provider");
|
|
},
|
|
showControls: () => {
|
|
throw new Error("VoicePanelContextType.Provider.showControls: not called within a context provider");
|
|
},
|
|
showFloatingCTA: createFakeSharedValue(null),
|
|
streamOutputSinkStack: {},
|
|
windowDimensions: createFakeSharedValue({
|
|
width: 0,
|
|
height: 0,
|
|
landscape: false
|
|
}),
|
|
wrapperDimensions: createFakeSharedValue({
|
|
drawerWidth: 0,
|
|
drawerHeight: 0,
|
|
drawerX: 0,
|
|
drawerY: 0,
|
|
pipX: 0,
|
|
pipY: 0,
|
|
animated: true,
|
|
mode: VoicePanelModes.PANEL
|
|
}),
|
|
useReducedMotion: createFakeSharedValue(false),
|
|
wrapperOffset: createFakeSharedValue({
|
|
gestureActive: false,
|
|
x: 0,
|
|
y: 0
|
|
}),
|
|
panelCardStillInPIP: createFakeSharedValue(false)
|
|
});
|
|
export default context;
|