Files
discord-decomp/sources/modules/expression_picker/native/ExpressionPickerKeyboard.tsx
T
2026-07-28 01:06:53 +03:00

159 lines
11 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] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import GetEmojiText from '../../emojis/utils/getEmojiText.tsx'; /* Metro dependency 11208 */
import UseKeyboardActionSheetHeight from '../../action_sheet/native/useKeyboardActionSheetHeight.tsx'; /* Metro dependency 11577 */
import PortalKeyboardBottomSheet from '../../keyboard/native/PortalKeyboardBottomSheet.tsx'; /* Metro dependency 11620 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as KeyboardTypesModule from '../../keyboard/native/KeyboardTypes.tsx'; /* Metro dependency 1583 */
import * as KeyboardManagerUtilsModule from '../../../utils/native/KeyboardManagerUtils.tsx'; /* Metro dependency 1848 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as UseKeyboardTypeModule from '../../keyboard/native/useKeyboardType.tsx'; /* Metro dependency 4022 */
import * as PortalKeyboardUIStoreNativeModule from '../../keyboard/native/PortalKeyboardUIStore.native.tsx'; /* Metro dependency 4023 */
import * as UseIsScreenReaderEnabledNativeModule from '../../a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
import * as GiftIntentExpressionPickerStateModule from '../../premium/gifting/native/GiftIntentExpressionPickerState.tsx'; /* Metro dependency 11433 */
import * as PortalKeyboardConstantsModule from '../../keyboard/native/PortalKeyboardConstants.tsx'; /* Metro dependency 11576 */
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});
let value = ReactModule;
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);
(FileImportTrackerModule).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 transitionState2 = transitionState;
const value3 = (ReanimatedRexportModule).useSharedValue(-1);
const env0_4 = value3;
const value4 = (ReanimatedRexportModule).useSharedValue(0);
const binding = env0_4;
const value5 = binding.useRef(null);
const value6 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
const value8 = transitionState2(binding.useState(false), 2);
const property = value8[0];
const property2 = property;
const env0_8 = value8[1];
const value9 = (GiftIntentExpressionPickerStateModule).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 useKeyboardContextForType = UseKeyboardTypeModule.useKeyboardContextForType;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const EXPRESSION = KeyboardTypes.EXPRESSION;
const value14 = Reflect.apply(useKeyboardContextForType, UseKeyboardTypeModule, [EXPRESSION]);
const {minimum, maximum} = (UseKeyboardActionSheetHeight)();
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
let closure = ExpressionPickerKeyboardB;
closure.__closure = {bottomSheetIndex: value3};
closure.__workletHash = 1982988107352;
closure.__initData = property2;
const value16 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = ExpressionPickerKeyboardY;
closure.__closure = {bottomSheetExpandingOrExpanded: value16, maximum: maximum, minimum: minimum};
closure.__workletHash = 13253776832356;
closure.__initData = env0_8;
const value17 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const value18 = binding.useCallback(_fun115561, [channel.id, value6, chatInputRef]);
binding.useEffect(_fun115562, [property, onClose, transitionState]);
const View = (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((GetEmojiText)(a0), null, true);
(KeyboardManagerUtilsModule).dismissGlobalKeyboard();
current = chatInputRefBinding.current;
const openCustomKeyboard = current.openCustomKeyboard;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const EXPRESSION = KeyboardTypes.EXPRESSION;
Reflect.apply(openCustomKeyboard, current, [{type: EXPRESSION}]);
current = PortalKeyboardConstantsModule.KEYBOARD_ANIMATION_CONFIG.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);
if (!PortalKeyboardUIStoreNativeModule.isPortalKeyboardOpenForChannel(channel.id)) {
moduleValue2 = require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */;
moduleValue2.clearGiftIntentExpressionPickerConfig(channel.id);
}
if (JsxRuntimeModule.jsx) {
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();
}
}
}
}
}
global.__d(_fun115553, 15152, [57, 31, 11576, 33, 4017, 4559, 11433, 11208, 1848, 1583, 4022, 11577, 4023, 4508,
11620, 11030,
2]) /* metro module 15152, dependencies: [57, 31, 11576, 33, 4017, 4559, 11433, 11208, 1848, 1583, 4022, 11577, 4023, 4508, 11620, 11030, 2] */;