decord/source/modules/freeze/native/NativeFreezeScreens.tsx
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

97 lines
2.8 KiB
TypeScript

// Module ID: 16089
// Function ID: 16090
// Name: NativeFreezeScreens
// Dependencies: [32, 19, 17, 21, 38, 4958, 4606, 2]
// Exports: NativeFreezeScreens
// Module 16089 (NativeFreezeScreens)
import enableScreens from "enableScreens" /* 4958 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
require = fn;
const StyleSheet = fn(17).StyleSheet;
const jsx = fn(21).jsx;
const createStyles = fn(4606);
let closure_7 = createStyles.createStyles({ screens: { flex: 1, overflow: "hidden" } });
const size = fn(2);
const result = size.fileFinishedImporting("modules/freeze/native/NativeFreezeScreens.tsx");
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 = [];
}
let first;
let tmp4 = activeIndex >= 0;
const tmp = closure_7();
const tmp2 = flag2;
if (tmp4) {
const _Array = Array;
let num = 1;
if (Array.isArray(children)) {
num = children.length;
}
tmp4 = activeIndex < num;
}
flag(flag2[4])(tmp4, "NativeFreezeScreens: invalid activeIndex");
let items = [activeIndex];
const tmp7 = flag3(flag4.useState(items), 2);
first = tmp7[0];
if (!first.includes(activeIndex)) {
const items1 = [];
items1[HermesBuiltin.arraySpread(first, 0)] = activeIndex;
tmp7[1](items1);
}
const obj = { enabled: flag, hasTwoStates: true, style: tmp.screens, nativeID: "native-freeze-screens-container", children: null };
let arr4 = children;
if (!Array.isArray(children)) {
const items2 = [children];
arr4 = items2;
}
obj.children = arr4.map((children, index) => {
if (flag3) {
if (!tmp) {
return null;
}
}
if (flag2) {
if (!first.includes(index)) {
if (!tmp) {
if (!preloadIndices.includes(index)) {
return null;
}
}
}
}
let num = 0;
if (activeIndex === index) {
num = 2;
}
const items = [StyleSheet.absoluteFill, ];
let num2 = -1;
if (activeIndex === index) {
num2 = 0;
}
items[1] = { zIndex: num2 };
return jsx(enableScreens.Screen, { style: items, activityState: num, enabled: flag, freezeOnBlur: flag4, children }, index);
});
return first(activeIndex(tmp2[5]).ScreenContainer, obj);
};