decord/source/modules/media_viewer/native/useEntranceAnimation.tsx

69 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 12132
// Function ID: 12133
2026-07-20 16:05:17 +00:00
// Name: setUseEntranceAnimationState
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 1297, 644, 705, 4671, 4119, 2]
2026-07-20 16:05:17 +00:00
// Exports: useEntranceAnimation
2026-08-24 06:08:38 +00:00
// Module 12132 (setUseEntranceAnimationState)
import closure_2 from "_slicedToArray" /* 32 */;
import closure_3 from "noop" /* 19 */;
import keys from "keys" /* 644 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function setUseEntranceAnimationState(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
_require(705).batchUpdates(() => closure_1_5.setState(closure_0));
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = { duration: 300, easing: require("Button").STANDARD_EASING };
obj = keys.create(() => ({ isComplete: false }));
2026-07-29 08:29:29 +00:00
let closure_7 = { code: "function useEntranceAnimationTsx1(){const{runOnJS,setUseEntranceAnimationState}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});}" };
let closure_8 = { code: "function useEntranceAnimationTsx2(){const{runOnJS,setUseEntranceAnimationState,incrementLoads}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});runOnJS(incrementLoads)();}" };
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/media_viewer/native/useEntranceAnimation.tsx");
2026-07-20 16:05:17 +00:00
export const useEntranceAnimationState = obj;
export const useEntranceAnimation = function useEntranceAnimation(entranceAnimationDriver) {
2026-08-24 06:08:38 +00:00
closure_0 = entranceAnimationDriver;
2026-07-23 10:11:24 +00:00
[tmp2, dependencyMap] = callback(React.useState(0), 2);
callback = React.useCallback(() => {
2026-07-20 16:05:17 +00:00
callback((arg0) => arg0 + 1);
}, []);
const items = [entranceAnimationDriver];
const items1 = [callback, entranceAnimationDriver];
const handleLoadStart = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
obj = entranceAnimationDriver(closure_1_1[4]);
2026-07-29 08:29:29 +00:00
obj.batchUpdates(() => state.setState({ isComplete: false }));
2026-07-20 16:05:17 +00:00
const fn = function t() {
2026-07-29 08:29:29 +00:00
callback(table[6]).runOnJS(closure_6)({ isComplete: true });
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
obj = { runOnJS: entranceAnimationDriver(closure_1_1[6]).runOnJS, setUseEntranceAnimationState: closure_1_6 };
2026-07-20 16:05:17 +00:00
fn.__closure = obj;
fn.__workletHash = 7427534745615;
2026-08-24 06:08:38 +00:00
fn.__initData = closure_1_7;
const result = entranceAnimationDriver.set(entranceAnimationDriver(closure_1_1[5]).withTiming(1, closure_1_4, "respect-motion-settings", fn));
2026-07-20 16:05:17 +00:00
}, items);
2026-07-23 10:11:24 +00:00
const handleError = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
obj = entranceAnimationDriver;
2026-07-23 10:11:24 +00:00
if (1 !== entranceAnimationDriver.get()) {
2026-08-24 06:08:38 +00:00
entranceAnimationDriver(closure_1_1[4]).batchUpdates(() => state.setState({ isComplete: false }));
const obj3 = entranceAnimationDriver(closure_1_1[5]);
2026-07-20 16:05:17 +00:00
const fn = function t() {
2026-08-24 06:08:38 +00:00
closure_1_0(closure_1_1[6]).runOnJS(closure_1_6)({ isComplete: true });
obj = closure_1_0(closure_1_1[6]);
closure_1_0(closure_1_1[6]).runOnJS(closure_2)();
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj = { runOnJS: null, setUseEntranceAnimationState: null, incrementLoads: null };
2026-08-24 06:08:38 +00:00
obj[0] = entranceAnimationDriver(closure_1_1[6]).runOnJS;
obj[1] = closure_1_6;
2026-07-29 08:29:29 +00:00
obj[2] = callback;
2026-07-20 16:05:17 +00:00
fn.__closure = obj;
fn.__workletHash = 9904090637386;
2026-08-24 06:08:38 +00:00
fn.__initData = closure_1_8;
const result = obj.set(obj3.withTiming(1, closure_1_4, "respect-motion-settings", fn));
const obj2 = entranceAnimationDriver(closure_1_1[4]);
2026-07-20 16:05:17 +00:00
} else {
callback();
}
}, items1);
return { loads, handleLoadStart, handleError, handleLoad: handleError };
};