344 lines
20 KiB
TypeScript
344 lines
20 KiB
TypeScript
/* Metro module 11620; source: modules/keyboard/native/PortalKeyboardBottomSheet.tsx; dependencies: [57, 31, 27, 10738, 33, 477, 4501, 697, 8554, 4559, 11621, 4508, 6514, 566, 6277, 4081, 10915, 4017, 1848, 4594, 1585, 1478, 4027, 4556, 8575, 5462, 2] */
|
|
function _fun89063(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:6, offset: 0x01ffd372, size: 630 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
value2.Platform;
|
|
const env0_5 = value2.View;
|
|
const nativeMenuStore = importDefault(10738) /* metro dependency 10738: NativeMenuStore */;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value3.jsx;
|
|
const env0_8 = value3.jsxs;
|
|
const env0_9 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS();
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {container: {'position': 'absolute', 'top': 0, 'left': 0}};
|
|
let MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
|
|
object2.background = {backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND, overflow: 'hidden'};
|
|
const object4 = {};
|
|
object4.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.none;
|
|
object4.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.none;
|
|
object4.width = '100%';
|
|
const ACTION_SHEET_DRAG_HANDLE_HEIGHT = (require(8554) /* metro dependency 8554: native */).ACTION_SHEET_DRAG_HANDLE_HEIGHT;
|
|
object4.height = ACTION_SHEET_DRAG_HANDLE_HEIGHT;
|
|
object4.marginBottom = -ACTION_SHEET_DRAG_HANDLE_HEIGHT;
|
|
object2.headerContainer = object4;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.headerContainerScreenReaderEnabled = {marginBottom: -PX_8};
|
|
MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
|
|
object2.roundingView = {'overflow': 'hidden', 'display': 'flex', backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND};
|
|
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
object2 = {code: 'function PortalKeyboardBottomSheetTsx1(){const{animatedIndex}=this.__closure;return animatedIndex.get()>0.975;}'};
|
|
object2 = {code: 'function PortalKeyboardBottomSheetTsx2(){const{isFullyExpanded}=this.__closure;return isFullyExpanded.get();}'};
|
|
object2 = {code: 'function PortalKeyboardBottomSheetTsx3(isFullyExpanded,isFullExpandedPrevious){const{forceMaxHeight,runOnJS,dismissGlobalKeyboard}=this.__closure;if(isFullExpandedPrevious==null){return;}if(!isFullyExpanded&&!forceMaxHeight){runOnJS(dismissGlobalKeyboard)();}}'};
|
|
object2 = {code: "function PortalKeyboardBottomSheetTsx4(){const{interpolate,animatedIndex}=this.__closure;return{borderTopLeftRadius:interpolate(animatedIndex.get(),[0,1],[0,15],'clamp'),borderTopRightRadius:interpolate(animatedIndex.get(),[0,1],[0,15],'clamp')};}"};
|
|
object2 = {code: 'function PortalKeyboardBottomSheetTsx5(){const{animatedIndex}=this.__closure;return Math.max(animatedIndex.get(),0)>0;}'};
|
|
object2 = {code: 'function PortalKeyboardBottomSheetTsx6(result,previous){const{runOnJS,setAccessibilityViewIsModal}=this.__closure;if(result===previous)return;runOnJS(setAccessibilityViewIsModal)(result);}'};
|
|
value = value.forwardRef(PortalKeyboardBottomSheet);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/keyboard/native/PortalKeyboardBottomSheet.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function PortalKeyboardBottomSheetHeader({style, handleCollapse}) { // fn#89064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:762, offset: 0x01ffd5e8, size: 158 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
const value3 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled();
|
|
const items2 = [styles.headerContainer];
|
|
items2[1] = value3 ? styles.headerContainerScreenReaderEnabled : undefined;
|
|
items2[2] = style;
|
|
const ActionSheetDragHandle = (require(8554) /* metro dependency 8554: native */).ActionSheetDragHandle;
|
|
return (
|
|
<View style={items2}>
|
|
<ActionSheetDragHandle onPress={handleCollapse} />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function PortalKeyboardBottomSheet({animatedIndex, animatedPosition, chatInputRef, children, isAppsKeyboard, animationConfigs, onClose, transitionState, backdropComponent, headerStyle, disableHeaderRoundingAnimation, roundingViewStyle, onAnimate, rendersHandle, width, forceMaxHeight, enablePanDownToClose, renderExpressionFooter}, a1) { // fn#89065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:2150, offset: 0x01ffd686, size: 1749 bytes, params: 3, frame: 51
|
|
var object3;
|
|
isAppsKeyboard = !(isAppsKeyboard === undefined) && isAppsKeyboard;
|
|
const env0_3 = onClose;
|
|
const env0_4 = headerStyle;
|
|
rendersHandle = rendersHandle === undefined || rendersHandle;
|
|
forceMaxHeight = !(forceMaxHeight === undefined) && forceMaxHeight;
|
|
enablePanDownToClose = !(enablePanDownToClose === undefined) && enablePanDownToClose;
|
|
renderExpressionFooter = !(renderExpressionFooter === undefined) && renderExpressionFooter;
|
|
const env0_11 = undefined;
|
|
const env0_12 = undefined;
|
|
const styles = useStyles();
|
|
let binding = env0_4;
|
|
const value8 = binding.useRef(null);
|
|
const value9 = (importDefault(11621) /* metro dependency 11621: useCustomKeyboardBottomSheetConfig */)({forceMaxHeight: forceMaxHeight,
|
|
enablePanDownToClose: enablePanDownToClose});
|
|
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
|
|
const YEETED = TransitionStates.YEETED;
|
|
const value10 = transitionState === YEETED;
|
|
const env0_9 = value10;
|
|
(require(6514) /* metro dependency 6514: BottomSheetHandle */).useBottomSheetImperativeHandle(a1, value8);
|
|
binding.useLayoutEffect(_fun89066, [value8, value10]);
|
|
const value11 = (require(566) /* metro dependency 566: flux */).useStateFromStores([NativeMenuStore], function() {
|
|
return NativeMenuStore.isOpen();
|
|
});
|
|
const r7 = renderExpressionFooter && !value10;
|
|
const value13 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled();
|
|
binding = env0_4;
|
|
const value14 = binding.useCallback(_fun89068, [chatInputRef, value10, onAnimate, onClose, isAppsKeyboard]);
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useDerivedValue = reanimatedRexportModule.useDerivedValue;
|
|
let closure = PortalKeyboardBottomSheetJ;
|
|
closure.__closure = {animatedIndex: animatedIndex};
|
|
closure.__workletHash = 2001839633402;
|
|
closure.__initData = env0_11;
|
|
const value15 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
|
|
const moduleValue5 = reanimatedRexportModule;
|
|
let useAnimatedReaction = moduleValue5.useAnimatedReaction;
|
|
closure = PortalKeyboardBottomSheetJ_89070;
|
|
closure.__closure = {isFullyExpanded: value15};
|
|
closure.__workletHash = 9531298805666;
|
|
closure.__initData = env0_12;
|
|
const closure2 = PortalKeyboardBottomSheetY;
|
|
object3 = {forceMaxHeight: forceMaxHeight};
|
|
object3.runOnJS = reanimatedRexportModule.runOnJS;
|
|
object3.dismissGlobalKeyboard = (require(1848) /* metro dependency 1848: KeyboardManagerUtils */).dismissGlobalKeyboard;
|
|
closure2.__closure = object3;
|
|
closure2.__workletHash = 14649856286006;
|
|
closure2.__initData = env0_13;
|
|
Reflect.apply(useAnimatedReaction, moduleValue5, [closure, closure2]);
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
|
|
return _fun89073;
|
|
});
|
|
const value16 = binding.useCallback(_fun89074, []);
|
|
const value17 = binding.useCallback(_fun89075, [headerStyle, value8, rendersHandle, value15, value13]);
|
|
const moduleValue6 = reanimatedRexportModule;
|
|
const useAnimatedStyle = moduleValue6.useAnimatedStyle;
|
|
closure = PortalKeyboardBottomSheetW;
|
|
closure.__closure = {interpolate: reanimatedRexportModule.interpolate, animatedIndex: animatedIndex};
|
|
closure.__workletHash = 13716272266662;
|
|
closure.__initData = env0_14;
|
|
const value18 = Reflect.apply(useAnimatedStyle, moduleValue6, [closure]);
|
|
const {left, right} = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
|
|
const value20 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true});
|
|
const height = value20.height;
|
|
const width2 = value20.width;
|
|
const value21 = binding.useCallback(_fun89078, []);
|
|
const [property, property2] = env0_3(binding.useState(false), 2);
|
|
const moduleValue7 = reanimatedRexportModule;
|
|
useAnimatedReaction = moduleValue7.useAnimatedReaction;
|
|
closure = PortalKeyboardBottomSheet$;
|
|
closure.__closure = {animatedIndex: animatedIndex};
|
|
closure.__workletHash = 8952872079740;
|
|
closure.__initData = env0_15;
|
|
const closure3 = PortalKeyboardBottomSheetZ;
|
|
closure3.__closure = {runOnJS: reanimatedRexportModule.runOnJS, setAccessibilityViewIsModal: property2};
|
|
closure3.__workletHash = 16051387075966;
|
|
closure3.__initData = env0_16;
|
|
Reflect.apply(useAnimatedReaction, moduleValue7, [closure, closure3]);
|
|
const r26 = value13 || value10;
|
|
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
const r4 = value11 ? 'no-hide-descendants' : undefined;
|
|
const items2 = [styles.container];
|
|
items2[1] = {marginLeft: left, marginRight: right};
|
|
const Math = global.Math;
|
|
items2[2] = {width: Math.min(width ?? global.Number.MAX_SAFE_INTEGER, width2 - left - right), height: height};
|
|
const defaultImport4 = importDefault(6277) /* metro dependency 6277 */;
|
|
const object2 = {ref: value8, animatedIndex: animatedIndex, animatedPosition: animatedPosition,
|
|
animationConfigs: animationConfigs, onClose: onClose, onAnimate: value14};
|
|
const value26 = !r26;
|
|
object2.enableContentPanningGesture = value26;
|
|
object2.enableHandlePanningGesture = value26;
|
|
object2.handleComponent = value17;
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
object2.renderFooter = platformUtilsModule.isAndroid() && r7 ? value21 : undefined;
|
|
object2.backgroundStyle = styles.background;
|
|
object2.backdropComponent = backdropComponent ?? value16;
|
|
object2.activeOffsetY = [-10, 10];
|
|
const ACTION_SHEET_DRAG_HANDLE_HEIGHT = rendersHandle ? (require(8554) /* metro dependency 8554: native */).ACTION_SHEET_DRAG_HANDLE_HEIGHT : 0;
|
|
object2.handleHeight = ACTION_SHEET_DRAG_HANDLE_HEIGHT;
|
|
copyDataProperties(object2, value9, require);
|
|
const AccessibilityViewAnimated = (require(4556) /* metro dependency 4556: AccessibilityViewNative */).AccessibilityViewAnimated;
|
|
const defaultImport42 = ((Component) => <Component {...object2}><AccessibilityViewAnimated nativeID="portal-keyboard-sheet" style={[styles.roundingView,
|
|
!disableHeaderRoundingAnimation && value18,
|
|
roundingViewStyle]} onAccessibilityEscape={onAccessibilityEscape_89081} accessibilityViewIsModal={property}>{children}</AccessibilityViewAnimated></Component>)(defaultImport4);
|
|
const r6 = env0_9 && r7 && ((Component) => <Component animatedSheetIndex={animatedIndex} />)(importDefault(8575) /* metro dependency 8575: PortalKeyboardFooterIOSIos */);
|
|
const NavScrim = (require(5462) /* metro dependency 5462: NavScrimAndroid */).NavScrim;
|
|
return (
|
|
<View
|
|
importantForAccessibility={r4}
|
|
style={items2}
|
|
pointerEvents="box-none"
|
|
>
|
|
{defaultImport42}
|
|
{r6}
|
|
<NavScrim />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun89066() { // fn#89066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:2702, offset: 0x01ffdd5b, size: 39 bytes, params: 1, frame: 9
|
|
var current;
|
|
if (env0_9) {
|
|
current = env0_8.current;
|
|
if (current != null) {
|
|
current.forceClose();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun89068(a0, a1, a2) { // fn#89068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:2887, offset: 0x01ffdd95, size: 296 bytes, params: 4, frame: 17
|
|
var value2;
|
|
var moduleValue;
|
|
var current;
|
|
const ANIMATION_SOURCE = (require(6277) /* metro dependency 6277 */).ANIMATION_SOURCE;
|
|
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
|
|
var value;
|
|
if (env0_9) {
|
|
if (a1 !== -1) {
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
} else if (a0 !== a1) {
|
|
if (a1 !== -1) {
|
|
if (onAnimate != null) {
|
|
onAnimate(a0, a1, a2);
|
|
}
|
|
if (a0 === 0) {
|
|
value = environment.__proto__;
|
|
if (a2 !== ANIMATION_SOURCE.KEYBOARD) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
|
|
}
|
|
} else if (a0 === 1) {
|
|
if (a1 === 0) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
|
|
if (!moduleValue.isChannelFocused()) {
|
|
if (isAppsKeyboard) {
|
|
current = chatInputRef.current;
|
|
if (current != null) {
|
|
current.closeCustomKeyboard();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (a0 !== a1) {
|
|
if (a1 !== -1) {
|
|
if (onAnimate != null) {
|
|
onAnimate(a0, a1, a2);
|
|
}
|
|
if (a0 === 0) {
|
|
value = environment.__proto__;
|
|
if (a2 !== ANIMATION_SOURCE.KEYBOARD) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
|
|
}
|
|
} else if (a0 === 1) {
|
|
if (a1 === 0) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
|
|
if (!moduleValue.isChannelFocused()) {
|
|
if (isAppsKeyboard) {
|
|
current = chatInputRef.current;
|
|
if (current != null) {
|
|
current.closeCustomKeyboard();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function PortalKeyboardBottomSheetJ() { // fn#89069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3241, owner: PortalKeyboardBottomSheet.J, offset: 0x01ffdebd, size: 32 bytes, params: 1, frame: 9
|
|
return animatedIndex.get() > 0.975;
|
|
}
|
|
|
|
function PortalKeyboardBottomSheetY(a0, a1) { // fn#89071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3479, owner: PortalKeyboardBottomSheet.Y, offset: 0x01ffdeef, size: 86 bytes, params: 3, frame: 14
|
|
let value = a0;
|
|
if (a1 != null) {
|
|
if (!(value || forceMaxHeight)) {
|
|
value = environment.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value.runOnJS((require(1848) /* metro dependency 1848: KeyboardManagerUtils */).dismissGlobalKeyboard)();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun89072() { // fn#89072, offset: 0x01ffdf45, size: 11 bytes, params: 1, frame: 1
|
|
return function() {
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
};
|
|
}
|
|
|
|
function _fun89074(a0) { // fn#89074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3782, offset: 0x01ffdf6b, size: 68 bytes, params: 2, frame: 15
|
|
const BottomSheetBackdrop = (require(6277) /* metro dependency 6277 */).BottomSheetBackdrop;
|
|
return <BottomSheetBackdrop {...a0} {...{['pressBehavior']: 'collapse'}} />;
|
|
}
|
|
|
|
function _fun89075() { // fn#89075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3872, offset: 0x01ffdfaf, size: 69 bytes, params: 1, frame: 15
|
|
return rendersHandle === false ? null : <PortalKeyboardBottomSheetHeader style={headerStyle} handleCollapse={handleCollapse_89076} isFullyExpanded={env0_11} />;
|
|
}
|
|
|
|
function PortalKeyboardBottomSheetW() { // fn#89077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4104, owner: PortalKeyboardBottomSheet.W, offset: 0x01ffe032, size: 146 bytes, params: 1, frame: 23
|
|
const object2 = {};
|
|
let value = environment.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const interpolate = value.interpolate;
|
|
const animatedIndexBinding = animatedIndex;
|
|
object2.borderTopLeftRadius = Reflect.apply(interpolate, value, [animatedIndexBinding.get(), [0, 1], [0, 15],
|
|
'clamp']);
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
object2.borderTopRightRadius = value.interpolate(animatedIndexBinding.get(), [0, 1], [0, 15], 'clamp');
|
|
return object2;
|
|
}
|
|
|
|
function _fun89078(a0) { // fn#89078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4479, offset: 0x01ffe0c4, size: 104 bytes, params: 2, frame: 17
|
|
const value = environment.__proto__;
|
|
const BottomSheetFooter = (require(6277) /* metro dependency 6277 */).BottomSheetFooter;
|
|
const bottomSheetFooterProps = {...a0};
|
|
const PortalHost = (require(4027) /* metro dependency 4027 */).PortalHost;
|
|
return (
|
|
<BottomSheetFooter {...bottomSheetFooterProps}>
|
|
<PortalHost name="expression-footer" />
|
|
</BottomSheetFooter>
|
|
);
|
|
}
|
|
|
|
function PortalKeyboardBottomSheetZ(a0, a1) { // fn#89080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4770, owner: PortalKeyboardBottomSheet.Z, offset: 0x01ffe157, size: 61 bytes, params: 3, frame: 13
|
|
var value;
|
|
if (a0 !== a1) {
|
|
value = environment.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value.runOnJS(env0_12)(a0);
|
|
}
|
|
}
|
|
|
|
function PortalKeyboardBottomSheetOnAccessibilityEscape() { // fn#89081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:5685, owner: PortalKeyboardBottomSheet.onAccessibilityEscape, offset: 0x01ffe194, size: 32 bytes, params: 1, frame: 9
|
|
const current = env0_8.current;
|
|
if (current != null) {
|
|
current.collapse();
|
|
}
|
|
}
|
|
|
|
function handleCollapse_89076() { // fn#89076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3946, offset: 0x01ffdff4, size: 62 bytes, params: 1, frame: 11
|
|
let current = env1_8.current;
|
|
if (current != null) {
|
|
current.collapse();
|
|
}
|
|
if (env1_10) {
|
|
current = env1_8.current;
|
|
if (current != null) {
|
|
current.forceClose();
|
|
}
|
|
}
|
|
}
|
|
|