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

164 lines
6.5 KiB
TypeScript
Raw Normal View History

2026-08-14 17:33:39 +00:00
// Module ID: 9984
// Function ID: 9985
// Dependencies: [19, 17, 1338, 676, 1925, 21, 4342, 712, 9985, 8706, 9019, 1497, 1626, 4549, 8740, 9986, 4763, 9205, 9987, 9988, 10011, 2]
2026-07-23 10:11:24 +00:00
2026-08-14 17:33:39 +00:00
// Module 9984
import importAllResult from "module_9988";
2026-07-29 08:29:29 +00:00
import { View } from "SegmentedControl";
2026-07-23 10:11:24 +00:00
import ExpressionPickerViewType from "ExpressionPickerViewType";
import { AnalyticEvents } from "ME";
import { EmojiIntention } from "set";
2026-07-29 08:29:29 +00:00
import jsxProd from "set";
import createCacheKey from "createCacheKey";
2026-07-20 16:05:17 +00:00
let PADDING_HORIZONTAL;
2026-07-29 08:29:29 +00:00
let c10;
let c5;
let c9;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
({ ExpressionPickerViewType: c5, ExpressionPickerOrder: closure_6, PADDING_HORIZONTAL } = ExpressionPickerViewType);
({ jsx: c9, jsxs: c10 } = jsxProd);
let obj = { expressionPickerContainer: null, expressionPickerContent: null, segmentedControl: null, segmentedControlUnpadded: null };
obj = { flex: 1, overflow: "hidden", backgroundColor: require("Themes").colors.MOBILE_EXPRESSION_PICKER_BACKGROUND_DEFAULT, position: "relative", paddingHorizontal: PADDING_HORIZONTAL };
obj[0] = obj;
obj[1] = { flex: 1 };
createCacheKey = { paddingTop: 2 * PADDING_HORIZONTAL, paddingHorizontal: 0 };
obj[2] = createCacheKey;
obj[3] = { paddingHorizontal: 0 };
let closure_11 = createCacheKey.createStyles(obj);
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function ExpressionPicker(expressionType) {
let bottomSheetIndex;
let bottomSheetRef;
let channel;
let height;
let inPortalKeyboard;
let initialGifQuery;
let onBackspace;
let onPressEmoji;
let onPressGIF;
let onPressSticker;
let stickerFormats;
let visibleTabs;
({ bottomSheetRef, bottomSheetIndex, channel } = expressionType);
let flag = expressionType.hideGifFavorites;
if (flag === undefined) {
flag = false;
}
({ visibleTabs, onPressEmoji, onPressSticker, onPressGIF, onBackspace } = expressionType);
if (visibleTabs === undefined) {
visibleTabs = closure_6;
}
({ height, inPortalKeyboard } = expressionType);
let importDefault;
2026-07-23 10:11:24 +00:00
let expressionPickerViewType;
let memo;
2026-07-20 16:05:17 +00:00
({ initialGifQuery, stickerFormats } = expressionType);
2026-07-29 08:29:29 +00:00
const tmp = callback();
2026-07-23 10:11:24 +00:00
importDefault = memo.useRef(false);
2026-07-29 08:29:29 +00:00
const tmp4 = importDefault(expressionPickerViewType[8])({ expressionType: expressionType.expressionType, expressionPickerTabs: visibleTabs });
expressionPickerViewType = tmp4.expressionPickerViewType;
const prop = tmp4.expressionPickerTabStrings;
2026-07-20 16:05:17 +00:00
const items = [channel];
2026-07-23 10:11:24 +00:00
memo = memo.useMemo(() => channel.getGuildId(), items);
2026-07-20 16:05:17 +00:00
const items1 = [memo];
2026-07-23 10:11:24 +00:00
const effect = memo.useEffect(() => {
2026-07-20 16:05:17 +00:00
const result = channel(expressionPickerViewType[9]).maybeFetchTopEmojisByGuild(memo);
}, items1);
2026-07-29 08:29:29 +00:00
let obj = channel(expressionPickerViewType[10]);
2026-07-20 16:05:17 +00:00
obj = {
pageWidth: 0,
2026-07-29 08:29:29 +00:00
defaultIndex: tmp4.expressionPickerSelectedIndex,
2026-07-20 16:05:17 +00:00
onSetActiveIndex(arg0) {
2026-08-11 06:20:06 +00:00
channel(expressionPickerViewType[11]).setKeyboardContext(channel(expressionPickerViewType[12]).KeyboardTypes.EXPRESSION, table[arg0]);
2026-07-20 16:05:17 +00:00
},
items: prop.map((id) => ({ id, label: id, page: null }))
};
const items2 = [expressionPickerViewType];
2026-07-29 08:29:29 +00:00
const segmentedControlState = obj.useSegmentedControlState(obj);
2026-07-23 10:11:24 +00:00
const effect1 = memo.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (ref.current) {
2026-07-29 08:29:29 +00:00
let obj = { tab: null, badged: false };
obj[0] = expressionPickerViewType;
2026-07-23 10:11:24 +00:00
ref(expressionPickerViewType[13]).trackWithMetadata(outer1_7.EXPRESSION_PICKER_TAB_CLICKED, obj);
2026-07-20 16:05:17 +00:00
const obj4 = ref(expressionPickerViewType[13]);
2026-07-23 10:11:24 +00:00
} else if (expressionPickerViewType === outer1_5.EMOJI) {
2026-07-29 08:29:29 +00:00
obj = { intention: null };
obj[0] = outer1_8.CHAT;
2026-07-20 16:05:17 +00:00
ref(expressionPickerViewType[14])(obj);
2026-07-29 08:29:29 +00:00
tmp.current = true;
2026-07-20 16:05:17 +00:00
} else {
obj = ref(expressionPickerViewType[13]);
2026-07-29 08:29:29 +00:00
const obj1 = { tab: null, badged: false };
obj1[0] = tmp2;
2026-07-23 10:11:24 +00:00
obj.trackWithMetadata(outer1_7.EXPRESSION_PICKER_OPENED, obj1);
2026-07-29 08:29:29 +00:00
tmp.current = true;
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-07-29 08:29:29 +00:00
let tmp12 = expressionPickerViewType === constants.EMOJI;
if (!tmp12) {
tmp12 = expressionPickerViewType === tmp11.STICKER;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp10 = importDefault(expressionPickerViewType[15]);
const tmp10Result = importDefault(expressionPickerViewType[15])({ hasCategories: tmp12 });
if (tmp7Result.useIsScreenReaderEnabled()) {
obj = { marginBottom: null };
obj[0] = tmp10Result.safeAreaBottomKeyboardAware;
let obj1 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj1 = {};
2026-07-20 16:05:17 +00:00
}
const items3 = [tmp.expressionPickerContainer, ];
2026-07-29 08:29:29 +00:00
let tmp16 = null != height;
if (tmp16) {
const obj2 = { height: null };
obj2[0] = height;
tmp16 = obj2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj3 = { style: items3, children: null };
items3[1] = tmp16;
const tmp14 = closure_10;
tmp7Result = channel(expressionPickerViewType[16]);
const items4 = [closure_9(View, { style: inPortalKeyboard ? tmp.segmentedControl : tmp.segmentedControlUnpadded, children: closure_9(channel(expressionPickerViewType[17]).SegmentedControl, { state: segmentedControlState }) }), ];
const obj5 = { style: items5, children: null };
items5 = [tmp.expressionPickerContent, obj1];
2026-07-20 16:05:17 +00:00
if (expressionPickerViewType === constants.EMOJI) {
2026-07-29 08:29:29 +00:00
const obj6 = { bottomSheetIndex: null, bottomSheetRef: null, channel: null, onPressEmoji: null, onBackspace: null, inPortalKeyboard: null };
obj6[0] = bottomSheetIndex;
obj6[1] = bottomSheetRef;
obj6[2] = channel;
obj6[3] = onPressEmoji;
obj6[4] = onBackspace;
obj6[5] = inPortalKeyboard;
let tmp17Result = tmp17(tmp2(tmp3[18]), obj6);
} else if (expressionPickerViewType === tmp11.GIF) {
const obj7 = { bottomSheetRef: null, channelId: null, guildId: null, hideFavorites: null, initialQuery: null, onPressGIF: null };
obj7[0] = bottomSheetRef;
({ id: obj11[1], guild_id: obj11[2] } = channel);
obj7[3] = flag;
obj7[4] = initialGifQuery;
obj7[5] = onPressGIF;
tmp17Result = tmp17(tmp2(tmp3[19]), obj7);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp17Result = null;
if (expressionPickerViewType === tmp11.STICKER) {
const obj8 = { bottomSheetRef: null, bottomSheetIndex: null, channel: null, onPressSticker: null, stickerFormats: null, inPortalKeyboard: null };
obj8[0] = bottomSheetRef;
obj8[1] = bottomSheetIndex;
obj8[2] = channel;
obj8[3] = onPressSticker;
obj8[4] = stickerFormats;
obj8[5] = inPortalKeyboard;
tmp17Result = tmp17(tmp2(tmp3[20]), obj8);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj5[1] = tmp17Result;
items4[1] = closure_9(View, obj5);
obj3[1] = items4;
return tmp14(View, obj3);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
let result = require("ExpressionPickerViewType").fileFinishedImporting("modules/expression_picker/native/ExpressionPicker.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;