decord/source/modules/freeze/native/NativeFreezeScreens.tsx

96 lines
2.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15348
// Function ID: 15349
2026-07-20 16:05:17 +00:00
// Name: NativeFreezeScreens
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 21, 38, 4676, 4668, 2]
2026-07-20 16:05:17 +00:00
// Exports: NativeFreezeScreens
2026-08-24 06:08:38 +00:00
// Module 15348 (NativeFreezeScreens)
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { StyleSheet } from "get ActivityIndicator" /* 17 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let closure_7 = createCacheKey.createStyles({ screens: { flex: 1, overflow: "hidden" } });
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/freeze/native/NativeFreezeScreens.tsx");
2026-07-20 16:05:17 +00:00
export const NativeFreezeScreens = function NativeFreezeScreens(detachInactiveScreens) {
({ children, activeIndex } = detachInactiveScreens);
let flag = detachInactiveScreens.detachInactiveScreens;
if (flag === undefined) {
flag = true;
}
let flag2 = detachInactiveScreens.lazy;
if (flag2 === undefined) {
flag2 = true;
}
let flag3 = detachInactiveScreens.unmountOnBlur;
if (flag3 === undefined) {
flag3 = false;
}
let flag4 = detachInactiveScreens.freezeOnBlur;
if (flag4 === undefined) {
flag4 = true;
}
let preloadIndices = detachInactiveScreens.preloadIndices;
if (preloadIndices === undefined) {
preloadIndices = [];
}
2026-07-23 10:11:24 +00:00
let first;
2026-07-29 08:29:29 +00:00
let tmp4 = activeIndex >= 0;
2026-07-23 10:11:24 +00:00
const tmp = callback();
2026-07-29 08:29:29 +00:00
const tmp2 = flag2;
if (tmp4) {
2026-07-20 16:05:17 +00:00
const _Array = Array;
let num = 1;
if (Array.isArray(children)) {
num = children.length;
}
2026-07-29 08:29:29 +00:00
tmp4 = activeIndex < num;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
flag(flag2[4])(tmp4, "NativeFreezeScreens: invalid activeIndex");
2026-07-23 10:11:24 +00:00
let items = [activeIndex];
2026-07-29 08:29:29 +00:00
const tmp7 = flag3(flag4.useState(items), 2);
first = tmp7[0];
2026-07-20 16:05:17 +00:00
if (!first.includes(activeIndex)) {
const items1 = [];
2026-07-29 08:29:29 +00:00
items1[HermesBuiltin.arraySpread(first, 0)] = activeIndex;
tmp7[1](items1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj = { enabled: flag, hasTwoStates: true, style: tmp.screens, nativeID: "native-freeze-screens-container", children: null };
2026-07-20 16:05:17 +00:00
let arr4 = children;
if (!Array.isArray(children)) {
const items2 = [children];
arr4 = items2;
}
2026-07-29 08:29:29 +00:00
obj[4] = arr4.map((children) => {
2026-07-20 16:05:17 +00:00
if (flag3) {
if (!tmp) {
return null;
}
}
if (flag2) {
if (!first.includes(arg1)) {
if (!tmp) {
if (!preloadIndices.includes(arg1)) {
return null;
}
}
}
}
let num = 0;
if (activeIndex === arg1) {
num = 2;
}
const items = [preloadIndices.absoluteFill, ];
let num2 = -1;
if (activeIndex === arg1) {
num2 = 0;
}
2026-07-29 08:29:29 +00:00
items[1] = { zIndex: num2 };
return first(activeIndex(flag2[5]).Screen, { style: items, activityState: num, enabled: flag, freezeOnBlur: flag4, children }, arg1);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
return first(activeIndex(tmp2[5]).ScreenContainer, obj);
2026-07-20 16:05:17 +00:00
};