127 lines
4.5 KiB
TypeScript
127 lines
4.5 KiB
TypeScript
// Metro module 8436 (f8437).
|
|
import { createElement, useEffect, useMemo } from "react";
|
|
import * as _ReanimatedRexport from "../../../../modules/reanimated/ReanimatedRexport";
|
|
import { useSharedValue, useAnimatedStyle, useAnimatedReaction } from "../../../../modules/reanimated/ReanimatedRexport";
|
|
import * as _TransitionGroup from "../../TransitionGroup/TransitionGroup";
|
|
import { TransitionItem } from "../../TransitionGroup/TransitionGroup";
|
|
let __initData, __initData2, __initData3, renderAnimatedItem;
|
|
const AnimatedRenderItem = function AnimatedRenderItem(props) {
|
|
let c16571_7;
|
|
const { renderItem: renderItem2, item: item2, shouldAnimate, entering, exiting, state, cleanUp, useReducedMotion } = props;
|
|
c16571_7 = void 0;
|
|
const sharedValue = useSharedValue(state === _TransitionGroup.TransitionStates.MOUNTED ? 1 : 0);
|
|
useEffect(() => {
|
|
if (state === _TransitionGroup.TransitionStates.YEETED) {
|
|
sharedValue.set(0);
|
|
} else {
|
|
sharedValue.set(1);
|
|
}
|
|
}, [state, sharedValue]);
|
|
const T = function T() {
|
|
let r20;
|
|
L13: {
|
|
if (!useReducedMotion) {
|
|
if ((shouldAnimate == null ? void 0 : shouldAnimate.get()) !== false) {
|
|
if (state === _TransitionGroup.TransitionStates.YEETED && exiting != null) {
|
|
r20 = exiting(sharedValue.get(), (a0) => {
|
|
if (a0) {
|
|
_ReanimatedRexport.runOnJS(cleanUp)();
|
|
}
|
|
});
|
|
break L13;
|
|
}
|
|
if (entering != null) {
|
|
r20 = entering(sharedValue.get());
|
|
break L13;
|
|
}
|
|
r20 = {};
|
|
} else {
|
|
r20 = {};
|
|
}
|
|
} else {
|
|
r20 = {};
|
|
}
|
|
}
|
|
return r20;
|
|
};
|
|
T.__closure = {
|
|
useReducedMotion,
|
|
shouldAnimate,
|
|
state,
|
|
TransitionStates: _TransitionGroup.TransitionStates,
|
|
exiting,
|
|
visible: sharedValue,
|
|
runOnJS: _ReanimatedRexport.runOnJS,
|
|
cleanUp,
|
|
entering
|
|
};
|
|
T.__workletHash = 2197269661090;
|
|
T.__initData = __initData;
|
|
const animatedStyle = useAnimatedStyle(T);
|
|
const hasExiting = exiting != null;
|
|
c16571_7 = hasExiting;
|
|
const I = () => {
|
|
let r11 = state === _TransitionGroup.TransitionStates.YEETED && sharedValue.get() === 0;
|
|
if (r11) {
|
|
r11 = c16571_7 ? useReducedMotion : !c16571_7;
|
|
}
|
|
return r11;
|
|
};
|
|
I.__closure = {
|
|
state,
|
|
TransitionStates: _TransitionGroup.TransitionStates,
|
|
visible: sharedValue,
|
|
hasExiting,
|
|
useReducedMotion
|
|
};
|
|
I.__workletHash = 11984384474891;
|
|
I.__initData = __initData2;
|
|
const v = function v(a0, a1) {
|
|
if (a0 ? a0 !== a1 : a0) {
|
|
_ReanimatedRexport.runOnJS(cleanUp)();
|
|
}
|
|
};
|
|
v.__closure = {
|
|
runOnJS: _ReanimatedRexport.runOnJS,
|
|
cleanUp
|
|
};
|
|
v.__workletHash = 2105667466259;
|
|
v.__initData = __initData3;
|
|
useAnimatedReaction(I, v);
|
|
return <>
|
|
{renderItem2(item2, animatedStyle)}
|
|
</>;
|
|
};
|
|
renderAnimatedItem = function renderAnimatedItem(a0, a1, a2, a3) {
|
|
return createElement(AnimatedRenderItem, {
|
|
...a1,
|
|
key: a0,
|
|
state: a2,
|
|
cleanUp: a3
|
|
});
|
|
};
|
|
__initData = {
|
|
code: "function AnimatedEnterExitItemTsx1(){const{useReducedMotion,shouldAnimate,state,TransitionStates,exiting,visible,runOnJS,cleanUp,entering}=this.__closure;var _shouldAnimate;if(useReducedMotion)return{};if(((_shouldAnimate=shouldAnimate)===null||_shouldAnimate===void 0?void 0:_shouldAnimate.get())===false)return{};if(state===TransitionStates.YEETED&&exiting!=null){return exiting(visible.get(),function(finished){if(finished){runOnJS(cleanUp)();}});}if(entering!=null){return entering(visible.get());}return{};}"
|
|
};
|
|
__initData2 = {
|
|
code: "function AnimatedEnterExitItemTsx2(){const{state,TransitionStates,visible,hasExiting,useReducedMotion}=this.__closure;return state===TransitionStates.YEETED&&visible.get()===0&&(!hasExiting||useReducedMotion);}"
|
|
};
|
|
__initData3 = {
|
|
code: "function AnimatedEnterExitItemTsx3(hasExited,previous){const{runOnJS,cleanUp}=this.__closure;if(!hasExited||hasExited===previous)return;runOnJS(cleanUp)();}"
|
|
};
|
|
export default function AnimatedEnterExitItem(props) {
|
|
const { useReducedMotion: useReducedMotion2, shouldAnimate: shouldAnimate2, entering: entering2, exiting: exiting2, item, renderItem } = props;
|
|
return <TransitionItem item={useMemo(() => {
|
|
if (item != null) {
|
|
return {
|
|
shouldAnimate: shouldAnimate2,
|
|
entering: entering2,
|
|
exiting: exiting2,
|
|
renderItem,
|
|
item,
|
|
useReducedMotion: useReducedMotion2
|
|
};
|
|
}
|
|
}, [item, shouldAnimate2, entering2, exiting2, renderItem, useReducedMotion2])} renderItem={renderAnimatedItem} />;
|
|
};
|