147 lines
9.0 KiB
TypeScript
147 lines
9.0 KiB
TypeScript
/* Metro module 15152; source: modules/expression_picker/native/ExpressionPickerKeyboard.tsx; dependencies: [57, 31, 11576, 33, 4017, 4559, 11433, 11208, 1848, 1583, 4022, 11577, 4023, 4508, 11620, 11030, 2] */
|
|
function _fun115553(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:6, offset: 0x02464bc8, size: 222 bytes, params: 8, frame: 19
|
|
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 env0_5 = (require(11576) /* metro dependency 11576: PortalKeyboardConstants */).KEYBOARD_ANIMATION_CONFIG;
|
|
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
|
|
object = {code: 'function ExpressionPickerKeyboardTsx1(){const{bottomSheetIndex}=this.__closure;return Math.max(bottomSheetIndex.get(),0)>0;}'};
|
|
object = {code: 'function ExpressionPickerKeyboardTsx2(){const{bottomSheetExpandingOrExpanded,maximum,minimum}=this.__closure;return{height:bottomSheetExpandingOrExpanded.get()?maximum:minimum};}'};
|
|
value = value.memo(ExpressionPickerKeyboard);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/expression_picker/native/ExpressionPickerKeyboard.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function ExpressionPickerKeyboard({channel, chatInputRef, onClose, transitionState}) { // fn#115554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:506, offset: 0x02464ca6, size: 889 bytes, params: 2, frame: 41
|
|
const env0_3 = transitionState;
|
|
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
|
|
const env0_4 = value3;
|
|
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
|
|
const binding = env0_4;
|
|
const value5 = binding.useRef(null);
|
|
const value6 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled();
|
|
const value8 = env0_3(binding.useState(false), 2);
|
|
const property = value8[0];
|
|
const env0_7 = property;
|
|
const env0_8 = value8[1];
|
|
const value9 = (require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */).useGiftIntentExpressionPickerConfig(channel.id);
|
|
const value10 = binding.useCallback(_fun115555, [chatInputRef]);
|
|
const value11 = binding.useCallback(_fun115556, [channel.id, chatInputRef, value9]);
|
|
const value12 = binding.useCallback(function(a0) {
|
|
var chatInputRefBinding = chatInputRef;
|
|
chatInputRefBinding.current.handleSelectSticker(a0);
|
|
chatInputRefBinding.current.openSystemKeyboard();
|
|
chatInputRefBinding.current.setText('');
|
|
}, [chatInputRef]);
|
|
const value13 = binding.useCallback(function() {
|
|
chatInputRef.current.backspace();
|
|
}, [chatInputRef]);
|
|
const useKeyboardTypeModule = require(4022) /* metro dependency 4022: useKeyboardType */;
|
|
const useKeyboardContextForType = useKeyboardTypeModule.useKeyboardContextForType;
|
|
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
|
|
const EXPRESSION = KeyboardTypes.EXPRESSION;
|
|
const value14 = Reflect.apply(useKeyboardContextForType, useKeyboardTypeModule, [EXPRESSION]);
|
|
const {minimum, maximum} = (importDefault(11577) /* metro dependency 11577: useKeyboardActionSheetHeight */)();
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useDerivedValue = reanimatedRexportModule.useDerivedValue;
|
|
let closure = ExpressionPickerKeyboardB;
|
|
closure.__closure = {bottomSheetIndex: value3};
|
|
closure.__workletHash = 1982988107352;
|
|
closure.__initData = env0_7;
|
|
const value16 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
|
|
const moduleValue7 = reanimatedRexportModule;
|
|
const useAnimatedStyle = moduleValue7.useAnimatedStyle;
|
|
closure = ExpressionPickerKeyboardY;
|
|
closure.__closure = {bottomSheetExpandingOrExpanded: value16, maximum: maximum, minimum: minimum};
|
|
closure.__workletHash = 13253776832356;
|
|
closure.__initData = env0_8;
|
|
const value17 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
|
|
const value18 = binding.useCallback(_fun115561, [channel.id, value6, chatInputRef]);
|
|
binding.useEffect(_fun115562, [property, onClose, transitionState]);
|
|
const PortalKeyboardBottomSheet = importDefault(11620) /* metro dependency 11620: PortalKeyboardBottomSheet */;
|
|
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
return (
|
|
<PortalKeyboardBottomSheet
|
|
ref={value5}
|
|
animatedIndex={value3}
|
|
animatedPosition={value4}
|
|
forceMaxHeight={value6}
|
|
chatInputRef={chatInputRef}
|
|
animationConfigs={KEYBOARD_ANIMATION_CONFIG}
|
|
onClose={value18}
|
|
renderExpressionFooter
|
|
transitionState={transitionState}
|
|
key={'expression-picker-' + value6}
|
|
>
|
|
<View nativeID="expression-picker-sheet" style={value17}>
|
|
{((Component) => <Component bottomSheetRef={value5} bottomSheetIndex={value3} onBackspace={value13} onPressEmoji={value10} onPressGIF={value11} onPressSticker={value12} channel={channel} expressionType={value14} initialGifQuery={value9?.initialGifQuery} inPortalKeyboard />)(importDefault(11030) /* metro dependency 11030: ExpressionPicker */)}
|
|
</View>
|
|
</PortalKeyboardBottomSheet>
|
|
);
|
|
}
|
|
|
|
function _fun115555(a0) { // fn#115555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:824, offset: 0x0246501f, size: 162 bytes, params: 2, frame: 20
|
|
const chatInputRefBinding = chatInputRef;
|
|
let current = chatInputRefBinding.current;
|
|
current.insertText((importDefault(11208) /* metro dependency 11208: getEmojiText */)(a0), null, true);
|
|
(require(1848) /* metro dependency 1848: KeyboardManagerUtils */).dismissGlobalKeyboard();
|
|
current = chatInputRefBinding.current;
|
|
const openCustomKeyboard = current.openCustomKeyboard;
|
|
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
|
|
const EXPRESSION = KeyboardTypes.EXPRESSION;
|
|
Reflect.apply(openCustomKeyboard, current, [{type: EXPRESSION}]);
|
|
current = env0_5.current;
|
|
if (current != null) {
|
|
current.snapToIndex(0);
|
|
}
|
|
}
|
|
|
|
function _fun115556(a0) { // fn#115556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:1039, offset: 0x024650c1, size: 121 bytes, params: 2, frame: 12
|
|
var value2;
|
|
var moduleValue;
|
|
if (env0_9 != null) {
|
|
env0_9.onPressGIF(a0);
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */;
|
|
moduleValue.clearGiftIntentExpressionPickerConfig(channel.id);
|
|
} else {
|
|
chatInputRef.current.handleSelectGIF(a0);
|
|
}
|
|
chatInputRef.current.openSystemKeyboard();
|
|
}
|
|
|
|
function ExpressionPickerKeyboardB() { // fn#115559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:1498, owner: ExpressionPickerKeyboard.b, offset: 0x02465195, size: 43 bytes, params: 1, frame: 13
|
|
const Math = global.Math;
|
|
return Math.max(env0_4.get(), 0) > 0;
|
|
}
|
|
|
|
function ExpressionPickerKeyboardY() { // fn#115560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:1636, owner: ExpressionPickerKeyboard.y, offset: 0x024651c0, size: 37 bytes, params: 1, frame: 11
|
|
const binding = env0_12;
|
|
const get = binding.get;
|
|
return {height: Reflect.apply(get, binding, []) ? maximum : minimum};
|
|
}
|
|
|
|
function _fun115561() { // fn#115561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:1795, offset: 0x024651e5, size: 130 bytes, params: 1, frame: 14
|
|
var moduleValue2;
|
|
env0_8(true);
|
|
const portalKeyboardUIStoreNativeModule = require(4023) /* metro dependency 4023: PortalKeyboardUIStoreNative */;
|
|
if (!portalKeyboardUIStoreNativeModule.isPortalKeyboardOpenForChannel(channel.id)) {
|
|
moduleValue2 = require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */;
|
|
moduleValue2.clearGiftIntentExpressionPickerConfig(channel.id);
|
|
}
|
|
if (env0_6) {
|
|
chatInputRef.current.openSystemKeyboard();
|
|
}
|
|
}
|
|
|
|
function _fun115562() { // fn#115562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15349:1973, offset: 0x02465267, size: 82 bytes, params: 1, frame: 14
|
|
if (env0_7 && transitionState === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED) {
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
}
|
|
}
|
|
|