decord/source/modules/expression_picker/native/ExpressionPickerKeyboard.tsx

119 lines
5.3 KiB
TypeScript
Raw Normal View History

// Module ID: 16916
// Function ID: 16917
// Name: ExpressionPickerKeyboard
// Dependencies: [32, 19, 12170, 21, 4376, 5046, 12563, 1875, 1610, 4507, 11494, 4350, 12213, 10407, 2]
2026-07-20 16:05:17 +00:00
// Module 16916 (ExpressionPickerKeyboard)
import KeyboardTypes from "KeyboardTypes" /* 1610 */;
import KeyboardManagerUtils from "KeyboardManagerUtils" /* 1875 */;
import native from "native" /* 4350 */;
import getEmojiTextDefault from "getEmojiText" /* 12563 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const KEYBOARD_ANIMATION_CONFIG = fn(12170).KEYBOARD_ANIMATION_CONFIG;
const jsx = fn(21).jsx;
let __initData = { code: "function ExpressionPickerKeyboardTsx1(){const{bottomSheetIndex}=this.__closure;return Math.max(bottomSheetIndex.get(),0)>0;}" };
2026-07-20 16:05:17 +00:00
let closure_8 = { code: "function ExpressionPickerKeyboardTsx2(){const{bottomSheetExpandingOrExpanded,maximum,minimum}=this.__closure;return{height:bottomSheetExpandingOrExpanded.get()?maximum:minimum};}" };
const size = fn(2);
let result = size.fileFinishedImporting("modules/expression_picker/native/ExpressionPickerKeyboard.tsx");
export default noop.memo(function ExpressionPickerKeyboard(channel) {
2026-07-20 16:05:17 +00:00
const chatInputRef = channel.chatInputRef;
const onClose = channel.onClose;
const transitionState = channel.transitionState;
2026-07-29 08:29:29 +00:00
let ref;
const sharedValue = chatInputRef(transitionState[4]).useSharedValue(-1);
2026-07-23 10:11:24 +00:00
let obj = chatInputRef(transitionState[4]);
const sharedValue1 = chatInputRef(transitionState[4]).useSharedValue(0);
ref = ref.useRef(null);
const obj2 = chatInputRef(transitionState[4]);
const isScreenReaderEnabled = chatInputRef(transitionState[5]).useIsScreenReaderEnabled();
2026-07-23 10:11:24 +00:00
const tmp5 = sharedValue(ref.useState(false), 2);
const first = tmp5[0];
__initData = tmp5[1];
2026-07-20 16:05:17 +00:00
const items = [chatInputRef];
const items1 = [chatInputRef];
2026-07-23 10:11:24 +00:00
const callback = ref.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
const current = chatInputRef.current;
current.insertText(getEmojiTextDefault(arg0), null, true);
const result = KeyboardManagerUtils.dismissGlobalKeyboard();
2026-07-20 16:05:17 +00:00
const current2 = chatInputRef.current;
current2.openCustomKeyboard({ type: KeyboardTypes.KeyboardTypes.EXPRESSION });
2026-07-20 16:05:17 +00:00
const current3 = ref.current;
2026-07-29 08:29:29 +00:00
if (current3 != null) {
2026-07-20 16:05:17 +00:00
current3.snapToIndex(0);
}
}, items);
const items2 = [chatInputRef];
2026-07-23 10:11:24 +00:00
const callback1 = ref.useCallback((url) => {
2026-07-20 16:05:17 +00:00
const current = chatInputRef.current;
current.handleSelectGIF(url);
const current2 = chatInputRef.current;
current2.openSystemKeyboard();
}, items1);
const items3 = [chatInputRef];
2026-07-23 10:11:24 +00:00
const callback2 = ref.useCallback((sticker) => {
2026-07-20 16:05:17 +00:00
const current = chatInputRef.current;
current.handleSelectSticker(sticker);
const current2 = chatInputRef.current;
current2.openSystemKeyboard();
const current3 = chatInputRef.current;
current3.setText("");
}, items2);
2026-07-23 10:11:24 +00:00
const callback3 = ref.useCallback(() => {
2026-07-20 16:05:17 +00:00
const current = chatInputRef.current;
current.backspace();
}, items3);
2026-07-23 10:11:24 +00:00
const obj3 = chatInputRef(transitionState[5]);
const keyboardContextForType = chatInputRef(transitionState[9]).useKeyboardContextForType(chatInputRef(transitionState[8]).KeyboardTypes.EXPRESSION);
const tmp12 = onClose(transitionState[10])();
const minimum = tmp12.minimum;
const maximum = tmp12.maximum;
2026-07-23 10:11:24 +00:00
const obj4 = chatInputRef(transitionState[9]);
2026-07-20 16:05:17 +00:00
const fn = function b() {
return Math.max(sharedValue.get(), 0) > 0;
};
fn.__closure = { bottomSheetIndex: sharedValue };
fn.__workletHash = 1982988107352;
fn.__initData = __initData;
const derivedValue = chatInputRef(transitionState[4]).useDerivedValue(fn);
2026-07-23 10:11:24 +00:00
const obj5 = chatInputRef(transitionState[4]);
2026-07-20 16:05:17 +00:00
class S {
constructor() {
2026-08-24 06:08:38 +00:00
obj = { height: closure_10.get() ? maximum : minimum };
2026-07-20 16:05:17 +00:00
return obj;
}
}
S.__closure = { bottomSheetExpandingOrExpanded: derivedValue, maximum, minimum };
S.__workletHash = 13253776832356;
2026-07-23 10:11:24 +00:00
S.__initData = minimum;
2026-07-20 16:05:17 +00:00
const items4 = [isScreenReaderEnabled, chatInputRef];
2026-07-23 10:11:24 +00:00
const animatedStyle = chatInputRef(transitionState[4]).useAnimatedStyle(S);
2026-07-20 16:05:17 +00:00
const items5 = [first, onClose, transitionState];
2026-07-23 10:11:24 +00:00
const callback4 = ref.useCallback(() => {
closure_7(true);
2026-07-20 16:05:17 +00:00
if (isScreenReaderEnabled) {
const current = chatInputRef.current;
current.openSystemKeyboard();
}
}, items4);
2026-07-23 10:11:24 +00:00
const effect = ref.useEffect(() => {
2026-07-20 16:05:17 +00:00
let tmp = first;
if (first) {
tmp = transitionState === native.TransitionStates.YEETED;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-29 08:29:29 +00:00
if (onClose != null) {
tmp5();
2026-07-20 16:05:17 +00:00
}
}
}, items5);
const obj7 = { ref, animatedIndex: sharedValue, animatedPosition: sharedValue1, forceMaxHeight: isScreenReaderEnabled, chatInputRef, animationConfigs: isScreenReaderEnabled, onClose: callback4, renderExpressionFooter: true, transitionState, children: null };
2026-07-23 10:11:24 +00:00
const obj6 = chatInputRef(transitionState[4]);
const tmp17 = onClose(transitionState[12]);
obj7.children = first(onClose(transitionState[4]).View, { nativeID: "expression-picker-sheet", style: animatedStyle, children: first(onClose(transitionState[13]), { bottomSheetRef: ref, bottomSheetIndex: sharedValue, onBackspace: callback3, onPressEmoji: callback, onPressGIF: callback1, onPressSticker: callback2, channel: channel.channel, expressionType: keyboardContextForType, inPortalKeyboard: true }) });
return first(tmp17, obj7, "expression-picker-" + isScreenReaderEnabled);
2026-07-20 16:05:17 +00:00
});