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

138 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16104
// Function ID: 16105
2026-07-20 16:05:17 +00:00
// Name: transitionGroupGetItemKey
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 1496, 21, 4108, 4244, 1627, 500, 16105, 4245, 4235, 5949, 9918, 1498, 4248, 8868, 2]
2026-07-20 16:05:17 +00:00
// Exports: PortalKeyboardRenderer
2026-08-25 06:04:03 +00:00
// Module 16104 (transitionGroupGetItemKey)
import ManaContext from "ManaContext" /* 4108 */;
import _modDef16105 from "module_16105" /* 16105 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import closure_4 from "subscribeToKeyboardUIStore" /* 1496 */;
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-08-25 06:04:03 +00:00
let tmpResult = tmp(4244);
2026-07-29 08:29:29 +00:00
const keyboardType = tmpResult.getKeyboardType();
2026-08-15 05:55:55 +00:00
isAndroidResult = keyboardType === tmp(1627).KeyboardTypes.SYSTEM;
2026-07-20 16:05:17 +00:00
}
if (isAndroidResult) {
2026-07-29 08:29:29 +00:00
tmpResult = tmp(500);
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-08-25 06:04:03 +00:00
tmp5 = jsx(_modDef16105, { 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-08-25 06:04:03 +00:00
const layoutEffect = React.useLayoutEffect(() => id(4245).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-08-25 06:04:03 +00:00
const PortalKeyboardUIStore = callback(4245).PortalKeyboardUIStore;
2026-08-24 06:08:38 +00:00
field = PortalKeyboardUIStore.getField("keyboard");
2026-08-25 06:04:03 +00:00
callback(4244);
2026-07-29 08:29:29 +00:00
if (tmp6) {
2026-08-25 06:04:03 +00:00
const result = callback(4245).closePortalKeyboardIfUnhandled();
const tmpResult = callback(4245);
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-08-25 06:04:03 +00:00
rootNavigationRef = rootNavigationRef(4235).getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
rootNavigationRef.addListener("state", onNavigationStateChange);
return () => {
rootNavigationRef.removeListener("state", onNavigationStateChange);
};
}
2026-08-25 06:04:03 +00:00
let tmpResult = rootNavigationRef(4235);
2026-07-20 16:05:17 +00:00
}
}, []);
2026-08-25 06:04:03 +00:00
let PortalKeyboardUIStore = id(4245).PortalKeyboardUIStore;
2026-07-23 10:11:24 +00:00
field = PortalKeyboardUIStore.useField("keyboard");
2026-08-25 06:04:03 +00:00
const PortalKeyboardUIStore2 = id(4245).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-08-25 06:04:03 +00:00
const tmp11 = jsx(id(4108).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-08-25 06:04:03 +00:00
let tmp10Result = tmp10(tmp5(4248).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-08-25 06:04:03 +00:00
tmp10Result = tmp10(tmp5(8868).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
};