decord/source/modules/keyboard/native/PortalKeyboardRenderer.tsx

138 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 16570
// Function ID: 16571
2026-07-20 16:05:17 +00:00
// Name: transitionGroupGetItemKey
2026-09-02 09:53:35 +00:00
// Dependencies: [19, 1494, 21, 4204, 4342, 1625, 1234, 16571, 4343, 4333, 6076, 10194, 1496, 4346, 9174, 2]
2026-07-20 16:05:17 +00:00
// Exports: PortalKeyboardRenderer
2026-09-02 09:53:35 +00:00
// Module 16570 (transitionGroupGetItemKey)
2026-09-01 10:26:29 +00:00
import ManaContext from "ManaContext" /* 4204 */;
2026-09-02 09:53:35 +00:00
import _modDef16571 from "module_16571" /* 16571 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-09-02 09:53:35 +00:00
import closure_4 from "subscribeToKeyboardUIStore" /* 1494 */;
2026-08-24 06:08:38 +00:00
import { jsx } from "jsxProd" /* 21 */;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function transitionGroupGetItemKey(id) {
return id.id;
}
let closure_6 = [];
2026-07-29 08:29:29 +00:00
function transitionGroupRenderItem(arg0, arg1, arg2, arg3) {
2026-08-24 06:08:38 +00:00
let isAndroidResult = arg2 === ManaContext.TransitionStates.YEETED;
2026-07-20 16:05:17 +00:00
if (isAndroidResult) {
2026-09-01 10:26:29 +00:00
let tmpResult = tmp(4342);
2026-07-29 08:29:29 +00:00
const keyboardType = tmpResult.getKeyboardType();
2026-09-02 09:53:35 +00:00
isAndroidResult = keyboardType === tmp(1625).KeyboardTypes.SYSTEM;
2026-07-20 16:05:17 +00:00
}
if (isAndroidResult) {
2026-09-02 09:53:35 +00:00
tmpResult = tmp(1234);
2026-07-29 08:29:29 +00:00
isAndroidResult = tmpResult.isAndroid();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-07-20 16:05:17 +00:00
if (!isAndroidResult) {
2026-07-29 08:29:29 +00:00
const obj = { item: null, state: null, cleanUp: null };
obj[0] = arg1;
obj[1] = arg2;
obj[2] = arg3;
2026-09-02 09:53:35 +00:00
tmp5 = jsx(_modDef16571, { item: null, state: null, cleanUp: null }, arg0);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/keyboard/native/PortalKeyboardRenderer.tsx");
2026-07-20 16:05:17 +00:00
export const PortalKeyboardRenderer = function PortalKeyboardRenderer(portal) {
let flag = portal.portal;
if (flag === undefined) {
flag = true;
}
2026-07-23 10:11:24 +00:00
let id;
let field;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let obj = React;
2026-07-23 10:11:24 +00:00
id = React.useId();
let items = [id];
2026-09-01 10:26:29 +00:00
const layoutEffect = React.useLayoutEffect(() => id(4343).registerPortalKeyboardRenderer(id), items);
2026-07-20 16:05:17 +00:00
const layoutEffect1 = React.useLayoutEffect(() => {
2026-08-24 06:08:38 +00:00
closure_0 = callback(() => {
2026-09-01 10:26:29 +00:00
const PortalKeyboardUIStore = callback(4343).PortalKeyboardUIStore;
2026-08-24 06:08:38 +00:00
field = PortalKeyboardUIStore.getField("keyboard");
2026-09-01 10:26:29 +00:00
callback(4342);
2026-07-29 08:29:29 +00:00
if (tmp6) {
2026-09-01 10:26:29 +00:00
const result = callback(4343).closePortalKeyboardIfUnhandled();
const tmpResult = callback(4343);
2026-07-20 16:05:17 +00:00
}
});
return () => {
callback();
2026-08-24 06:08:38 +00:00
const result = callback(closure_1_2[8]).closePortalKeyboardIfUnhandled();
2026-07-20 16:05:17 +00:00
};
}, []);
const layoutEffect2 = React.useLayoutEffect(() => {
2026-07-29 08:29:29 +00:00
function onNavigationStateChange() {
const PortalKeyboardUIStore = rootNavigationRef(table[8]).PortalKeyboardUIStore;
2026-08-24 06:08:38 +00:00
field = PortalKeyboardUIStore.getField("keyboard");
2026-07-29 08:29:29 +00:00
let tmp4 = null != field;
if (tmp4) {
tmp4 = field.channelId !== tmp(tmp2[10]).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
let tmpResult = tmp(tmp2[11]);
tmp4 = tmpResult.getFocusedChannelId() !== field.channelId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
tmpResult = tmp(tmp2[4]);
const keyboardType = tmpResult.getKeyboardType();
if (keyboardType !== tmp(tmp2[5]).KeyboardTypes.SYSTEM) {
const obj = { type: null };
obj[0] = tmp(tmp2[5]).KeyboardTypes.SYSTEM;
tmp(tmp2[12]).setKeyboardType(obj);
const tmpResult1 = tmp(tmp2[12]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const result = tmp(tmp2[8]).closePortalKeyboardIfUnhandled();
const tmpResult2 = tmp(tmp2[8]);
2026-07-20 16:05:17 +00:00
}
}
if (obj.isAndroid()) {
2026-09-01 10:26:29 +00:00
rootNavigationRef = rootNavigationRef(4333).getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
rootNavigationRef.addListener("state", onNavigationStateChange);
return () => {
rootNavigationRef.removeListener("state", onNavigationStateChange);
};
}
2026-09-01 10:26:29 +00:00
let tmpResult = rootNavigationRef(4333);
2026-07-20 16:05:17 +00:00
}
}, []);
2026-09-01 10:26:29 +00:00
let PortalKeyboardUIStore = id(4343).PortalKeyboardUIStore;
2026-07-23 10:11:24 +00:00
field = PortalKeyboardUIStore.useField("keyboard");
2026-09-01 10:26:29 +00:00
const PortalKeyboardUIStore2 = id(4343).PortalKeyboardUIStore;
2026-07-20 16:05:17 +00:00
const field1 = PortalKeyboardUIStore2.useField("renderers");
2026-07-29 08:29:29 +00:00
let tmp8 = 0 === field1.length;
if (!tmp8) {
tmp8 = field1[field1.length - 1] === id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
dependencyMap = tmp8;
const items1 = [tmp8, field];
const memo = obj.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null != field) {
2026-08-24 06:08:38 +00:00
if (closure_2) {
2026-07-29 08:29:29 +00:00
const items = [tmp];
let tmp3 = items;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
tmp3 = closure_1_6;
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-29 08:29:29 +00:00
obj = { items: memo, getItemKey: transitionGroupGetItemKey, renderItem: transitionGroupRenderItem };
2026-09-01 10:26:29 +00:00
const tmp11 = jsx(id(4204).TransitionGroup, { items: memo, getItemKey: transitionGroupGetItemKey, renderItem: transitionGroupRenderItem });
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
obj = { children: null };
obj[0] = tmp11;
2026-09-01 10:26:29 +00:00
let tmp10Result = tmp10(tmp5(4346).PortalKeyboard, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = { value: true, children: null };
2026-07-29 08:29:29 +00:00
obj1[1] = tmp11;
2026-09-02 09:53:35 +00:00
tmp10Result = tmp10(tmp5(9174).PortalKeyboardInModalContext.Provider, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp10Result;
2026-07-20 16:05:17 +00:00
};