@hanzogui/animations-moti 8.3.0 → 8.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/createAnimations.js +304 -0
  2. package/dist/cjs/createAnimations.js.map +1 -0
  3. package/dist/cjs/index.js +6 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/package.json +1 -0
  6. package/dist/cjs/polyfill.js +10 -0
  7. package/dist/cjs/polyfill.js.map +1 -0
  8. package/dist/esm/createAnimations.js +300 -0
  9. package/dist/esm/createAnimations.js.map +1 -0
  10. package/dist/esm/index.js +3 -3
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/polyfill.js +10 -0
  13. package/dist/esm/polyfill.js.map +1 -0
  14. package/package.json +17 -17
  15. package/src/index.ts +2 -2
  16. package/types/createAnimations.d.ts +2 -3
  17. package/types/createAnimations.d.ts.map +1 -11
  18. package/types/index.d.ts +2 -3
  19. package/types/index.d.ts.map +1 -11
  20. package/types/polyfill.d.ts +0 -1
  21. package/types/polyfill.d.ts.map +1 -11
  22. package/dist/cjs/createAnimations.cjs +0 -308
  23. package/dist/cjs/createAnimations.native.js +0 -328
  24. package/dist/cjs/createAnimations.native.js.map +0 -1
  25. package/dist/cjs/index.cjs +0 -21
  26. package/dist/cjs/index.native.js +0 -24
  27. package/dist/cjs/index.native.js.map +0 -1
  28. package/dist/cjs/polyfill.cjs +0 -6
  29. package/dist/cjs/polyfill.native.js +0 -9
  30. package/dist/cjs/polyfill.native.js.map +0 -1
  31. package/dist/esm/createAnimations.mjs +0 -272
  32. package/dist/esm/createAnimations.mjs.map +0 -1
  33. package/dist/esm/createAnimations.native.js +0 -289
  34. package/dist/esm/createAnimations.native.js.map +0 -1
  35. package/dist/esm/index.mjs +0 -3
  36. package/dist/esm/index.mjs.map +0 -1
  37. package/dist/esm/index.native.js +0 -3
  38. package/dist/esm/index.native.js.map +0 -1
  39. package/dist/esm/polyfill.mjs +0 -7
  40. package/dist/esm/polyfill.mjs.map +0 -1
  41. package/dist/esm/polyfill.native.js +0 -7
  42. package/dist/esm/polyfill.native.js.map +0 -1
@@ -1,272 +0,0 @@
1
- import { PresenceContext, ResetPresence, usePresence } from "@hanzogui/use-presence";
2
- import { getSplitStyles, hooks, isWeb, Text, useComposedRefs, useThemeWithState, View } from "@hanzogui/core";
3
- import { useMotify } from "moti/author";
4
- import React, { forwardRef, useMemo, useRef } from "react";
5
- import Animated_, { cancelAnimation, runOnJS, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
6
- import { jsx } from "react/jsx-runtime";
7
- const resolveDynamicValue = (value, isDark) => {
8
- if (value && typeof value === "object" && "dynamic" in value) {
9
- const dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;
10
- return dynamicValue;
11
- }
12
- return value;
13
- };
14
- const safeESModule = a => {
15
- const b = a;
16
- const out = b.__esModule || b[Symbol.toStringTag] === "Module" ? b.default : b;
17
- return out || a;
18
- };
19
- const Animated = safeESModule(Animated_);
20
- function createGuiAnimatedComponent(defaultTag = "div") {
21
- const isText = defaultTag === "span";
22
- const Component = Animated.createAnimatedComponent(forwardRef((propsIn, ref) => {
23
- const {
24
- forwardedRef,
25
- animation,
26
- render = defaultTag,
27
- ...propsRest
28
- } = propsIn;
29
- const hostRef = useRef(null);
30
- const composedRefs = useComposedRefs(forwardedRef, ref, hostRef);
31
- const stateRef = useRef(null);
32
- if (!stateRef.current) {
33
- stateRef.current = {
34
- get host() {
35
- return hostRef.current;
36
- }
37
- };
38
- }
39
- const [_, state] = useThemeWithState({});
40
- const result = getSplitStyles(propsRest, isText ? Text.staticConfig : View.staticConfig, state?.theme, state?.name, {
41
- unmounted: false
42
- }, {
43
- isAnimated: false,
44
- noClass: true
45
- });
46
- const props = result?.viewProps || {};
47
- const Element = render;
48
- const transformedProps = hooks.usePropsTransform?.(render, props, stateRef, false);
49
- return /* @__PURE__ */jsx(Element, {
50
- ...transformedProps,
51
- ref: composedRefs
52
- });
53
- }));
54
- Component["acceptRenderProp"] = true;
55
- return Component;
56
- }
57
- const AnimatedView = createGuiAnimatedComponent("div");
58
- const AnimatedText = createGuiAnimatedComponent("span");
59
- const onlyAnimateKeys = {
60
- transform: true,
61
- opacity: true,
62
- height: true,
63
- width: true,
64
- backgroundColor: true,
65
- borderColor: true,
66
- borderLeftColor: true,
67
- borderRightColor: true,
68
- borderTopColor: true,
69
- borderBottomColor: true,
70
- borderRadius: true,
71
- borderTopLeftRadius: true,
72
- borderTopRightRadius: true,
73
- borderBottomLeftRadius: true,
74
- borderBottomRightRadius: true,
75
- borderLeftWidth: true,
76
- borderRightWidth: true,
77
- borderTopWidth: true,
78
- borderBottomWidth: true,
79
- color: true,
80
- left: true,
81
- right: true,
82
- top: true,
83
- bottom: true,
84
- fontSize: true,
85
- fontWeight: true,
86
- lineHeight: true,
87
- letterSpacing: true
88
- };
89
- function createAnimations(animations) {
90
- return {
91
- needsCustomComponent: true,
92
- View: isWeb ? AnimatedView : Animated.View,
93
- Text: isWeb ? AnimatedText : Animated.Text,
94
- // View: Animated.View,
95
- // Text: Animated.Text,
96
- isReactNative: true,
97
- inputStyle: "value",
98
- outputStyle: "inline",
99
- animations,
100
- usePresence,
101
- ResetPresence,
102
- useAnimatedNumber(initial) {
103
- const sharedValue = useSharedValue(initial);
104
- return React.useMemo(() => ({
105
- getInstance() {
106
- "worklet";
107
-
108
- return sharedValue;
109
- },
110
- getValue() {
111
- "worklet";
112
-
113
- return sharedValue.value;
114
- },
115
- setValue(next, config = {
116
- type: "spring"
117
- }, onFinish) {
118
- "worklet";
119
-
120
- if (config.type === "direct") {
121
- sharedValue.value = next;
122
- onFinish?.();
123
- } else if (config.type === "spring") {
124
- sharedValue.value = withSpring(next, config, onFinish ? () => {
125
- "worklet";
126
-
127
- runOnJS(onFinish)();
128
- } : void 0);
129
- } else {
130
- sharedValue.value = withTiming(next, config, onFinish ? () => {
131
- "worklet";
132
-
133
- runOnJS(onFinish)();
134
- } : void 0);
135
- }
136
- },
137
- stop() {
138
- "worklet";
139
-
140
- cancelAnimation(sharedValue);
141
- }
142
- }), [sharedValue]);
143
- },
144
- useAnimatedNumberReaction({
145
- value
146
- }, onValue) {
147
- const instance = value.getInstance();
148
- return useAnimatedReaction(() => {
149
- return instance.value;
150
- }, (next, prev) => {
151
- if (prev !== next) {
152
- runOnJS(onValue)(next);
153
- }
154
- },
155
- // dependency array is very important here
156
- [onValue, instance]);
157
- },
158
- /**
159
- * `getStyle` must be a worklet
160
- */
161
- useAnimatedNumberStyle(val, getStyle) {
162
- const instance = val.getInstance();
163
- const derivedValue = useDerivedValue(() => {
164
- return instance.value;
165
- }, [instance, getStyle]);
166
- return useAnimatedStyle(() => {
167
- return getStyle(derivedValue.value);
168
- }, [val, getStyle, derivedValue, instance]);
169
- },
170
- useAnimations: animationProps => {
171
- const {
172
- props,
173
- presence,
174
- style,
175
- componentState
176
- } = animationProps;
177
- const animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition;
178
- const isHydrating = componentState.unmounted === true;
179
- const disableAnimation = isHydrating || !animationKey;
180
- const presenceContext = React.useContext(PresenceContext);
181
- const [, themeState] = useThemeWithState({});
182
- const isDark = themeState?.scheme === "dark" || themeState?.name?.startsWith("dark");
183
- const {
184
- dontAnimate,
185
- motiProps
186
- } = useMemo(() => {
187
- let animate = {};
188
- let dontAnimate2 = {};
189
- if (disableAnimation) {
190
- for (const key in style) {
191
- const rawValue = style[key];
192
- const value = resolveDynamicValue(rawValue, isDark);
193
- if (value === void 0) continue;
194
- dontAnimate2[key] = value;
195
- }
196
- } else {
197
- const animateOnly = props.animateOnly;
198
- for (const key in style) {
199
- const rawValue = style[key];
200
- const value = resolveDynamicValue(rawValue, isDark);
201
- if (value === void 0) continue;
202
- if (!onlyAnimateKeys[key] || value === "auto" || typeof value === "string" && value.startsWith("calc") || animateOnly && !animateOnly.includes(key)) {
203
- dontAnimate2[key] = value;
204
- } else {
205
- animate[key] = value;
206
- }
207
- }
208
- }
209
- if (componentState.unmounted === "should-enter") {
210
- for (const key in style) {
211
- const rawValue = style[key];
212
- const value = resolveDynamicValue(rawValue, isDark);
213
- if (value === void 0) continue;
214
- dontAnimate2[key] = value;
215
- }
216
- }
217
- const styles = animate;
218
- const isExiting = Boolean(presence?.[1]);
219
- const usePresenceValue = presence || void 0;
220
- let transition = isHydrating ? {
221
- type: "transition",
222
- duration: 0
223
- } : animations[animationKey];
224
- let hasClonedTransition = false;
225
- if (Array.isArray(props.transition)) {
226
- const config = props.transition[1];
227
- if (config && typeof config === "object") {
228
- for (const key in config) {
229
- const val = config[key];
230
- if (!hasClonedTransition) {
231
- transition = Object.assign({}, transition);
232
- hasClonedTransition = true;
233
- }
234
- if (typeof val === "string") {
235
- transition[key] = animations[val];
236
- } else {
237
- transition[key] = val;
238
- }
239
- }
240
- }
241
- }
242
- return {
243
- dontAnimate: dontAnimate2,
244
- motiProps: {
245
- animate: isExiting || componentState.unmounted === true ? {} : styles,
246
- transition: componentState.unmounted ? {
247
- duration: 0
248
- } : transition,
249
- usePresenceValue,
250
- presenceContext,
251
- exit: isExiting ? styles : void 0
252
- }
253
- };
254
- }, [presenceContext, presence, animationKey, componentState.unmounted, JSON.stringify(style), presenceContext, isDark]);
255
- const moti = useMotify(motiProps);
256
- if (process.env.NODE_ENV === "development" && props["debug"] && props["debug"] !== "profile") {
257
- console.info(`useMotify(`, JSON.stringify(motiProps, null, 2) + ")", {
258
- "componentState.unmounted": componentState.unmounted,
259
- animationProps,
260
- motiProps,
261
- moti,
262
- style: [dontAnimate, moti.style]
263
- });
264
- }
265
- return {
266
- style: [dontAnimate, moti.style]
267
- };
268
- }
269
- };
270
- }
271
- export { createAnimations };
272
- //# sourceMappingURL=createAnimations.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PresenceContext","ResetPresence","usePresence","getSplitStyles","hooks","isWeb","Text","useComposedRefs","useThemeWithState","View","useMotify","React","forwardRef","useMemo","useRef","Animated_","cancelAnimation","runOnJS","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","withTiming","jsx","resolveDynamicValue","value","isDark","dynamicValue","dynamic","dark","light","safeESModule","a","b","out","__esModule","Symbol","toStringTag","default","Animated","createGuiAnimatedComponent","defaultTag","isText","Component","createAnimatedComponent","propsIn","ref","forwardedRef","animation","render","propsRest","hostRef","composedRefs","stateRef","current","host","_","state","result","staticConfig","theme","name","unmounted","isAnimated","noClass","props","viewProps","Element","transformedProps","usePropsTransform","AnimatedView","AnimatedText","onlyAnimateKeys","transform","opacity","height","width","backgroundColor","borderColor","borderLeftColor","borderRightColor","borderTopColor","borderBottomColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","color","left","right","top","bottom","fontSize","fontWeight","lineHeight","letterSpacing","createAnimations","animations","needsCustomComponent","isReactNative","inputStyle","outputStyle","useAnimatedNumber","initial","sharedValue","getInstance","getValue","setValue","next","config","type","onFinish","stop","useAnimatedNumberReaction","onValue","instance","prev","useAnimatedNumberStyle","val","getStyle","derivedValue","useAnimations","animationProps","presence","style","componentState","animationKey","Array","isArray","transition","isHydrating","disableAnimation","presenceContext","useContext","themeState","scheme","startsWith","dontAnimate","motiProps","animate","key","rawValue","animateOnly","includes","styles","isExiting","Boolean","usePresenceValue","duration","hasClonedTransition","Object","assign","dontAnimate2","exit","JSON","stringify","moti","process","env","NODE_ENV","console","info"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,eAAA,EAAiBC,aAAA,EAAeC,WAAA,QAAmB;AAE5D,SACEC,cAAA,EACAC,KAAA,EACAC,KAAA,EACAC,IAAA,EACAC,eAAA,EACAC,iBAAA,EACAC,IAAA,QAGK;AAWP,SAASC,SAAA,QAAiB;AAE1B,OAAOC,KAAA,IAASC,UAAA,EAAYC,OAAA,EAASC,MAAA,QAA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AA,EAASM,SAAA,IAAapB,cAAA,CAAepE,SAAA,KAAc,OAAO,CAAC,IAAIuF,MAAA;YAC/Df,UAAA,EAAYJ,cAAA,CAAepE,SAAA,GAAY;cAAE2F,QAAA,EAAU;YAAE,IAAInB,UAAA;YACzDkB,gBAAA;YACAf,eAAA;YACAqB,IAAA,EAAMR,SAAA,GAAYD,MAAA,GAAS;UAC7B;QACF;MACF,GAAG,CACDZ,eAAA,EACAT,QAAA,EACAG,YAAA,EACAD,cAAA,CAAepE,SAAA,EACfiG,IAAA,CAAKC,SAAA,CAAU/B,KAAK,GACpBQ,eAAA,EACA/G,MAAA,CACD;MAED,MAAMuI,IAAA,GAAOxJ,SAAA,CAAUsI,SAAS;MAEhC,IACEmB,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBACzBnG,KAAA,CAAM,OAAO,KACbA,KAAA,CAAM,OAAO,MAAM,WACnB;QACAoG,OAAA,CAAQC,IAAA,CAAK,cAAcP,IAAA,CAAKC,SAAA,CAAUjB,SAAA,EAAW,MAAM,CAAC,IAAI,KAAK;UACnE,4BAA4Bb,cAAA,CAAepE,SAAA;UAC3CiE,cAAA;UACAgB,SAAA;UACAkB,IAAA;UACAhC,KAAA,EAAO,CAACa,WAAA,EAAamB,IAAA,CAAKhC,KAAK;QACjC,CAAC;MACH;MAEA,OAAO;QACLA,KAAA,EAAO,CAACa,WAAA,EAAamB,IAAA,CAAKhC,KAAK;MACjC;IACF;EACF;AACF","ignoreList":[]}
@@ -1,289 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PresenceContext, ResetPresence, usePresence } from "@hanzogui/use-presence";
3
- import { getSplitStyles, hooks, isWeb, Text, useComposedRefs, useThemeWithState, View } from "@hanzogui/core";
4
- import { useMotify } from "moti/author";
5
- import React, { forwardRef, useMemo, useRef } from "react";
6
- import Animated_, { cancelAnimation, runOnJS, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
7
- function _type_of(obj) {
8
- "@swc/helpers - typeof";
9
-
10
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
11
- }
12
- var resolveDynamicValue = function (value, isDark) {
13
- if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "dynamic" in value) {
14
- var dynamicValue = isDark ? value.dynamic.dark : value.dynamic.light;
15
- return dynamicValue;
16
- }
17
- return value;
18
- };
19
- var safeESModule = function (a) {
20
- var b = a;
21
- var out = b.__esModule || b[Symbol.toStringTag] === "Module" ? b.default : b;
22
- return out || a;
23
- };
24
- var Animated = safeESModule(Animated_);
25
- function createGuiAnimatedComponent() {
26
- var defaultTag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "div";
27
- var isText = defaultTag === "span";
28
- var Component = Animated.createAnimatedComponent(/* @__PURE__ */forwardRef(function (propsIn, ref) {
29
- var _hooks_usePropsTransform;
30
- var {
31
- forwardedRef,
32
- animation,
33
- render = defaultTag,
34
- ...propsRest
35
- } = propsIn;
36
- var hostRef = useRef(null);
37
- var composedRefs = useComposedRefs(forwardedRef, ref, hostRef);
38
- var stateRef = useRef(null);
39
- if (!stateRef.current) {
40
- stateRef.current = {
41
- get host() {
42
- return hostRef.current;
43
- }
44
- };
45
- }
46
- var [_, state] = useThemeWithState({});
47
- var result = getSplitStyles(propsRest, isText ? Text.staticConfig : View.staticConfig, state === null || state === void 0 ? void 0 : state.theme, state === null || state === void 0 ? void 0 : state.name, {
48
- unmounted: false
49
- }, {
50
- isAnimated: false,
51
- noClass: true
52
- });
53
- var props = (result === null || result === void 0 ? void 0 : result.viewProps) || {};
54
- var Element = render;
55
- var transformedProps = (_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, render, props, stateRef, false);
56
- return /* @__PURE__ */_jsx(Element, {
57
- ...transformedProps,
58
- ref: composedRefs
59
- });
60
- }));
61
- Component["acceptRenderProp"] = true;
62
- return Component;
63
- }
64
- var AnimatedView = createGuiAnimatedComponent("div");
65
- var AnimatedText = createGuiAnimatedComponent("span");
66
- var onlyAnimateKeys = {
67
- transform: true,
68
- opacity: true,
69
- height: true,
70
- width: true,
71
- backgroundColor: true,
72
- borderColor: true,
73
- borderLeftColor: true,
74
- borderRightColor: true,
75
- borderTopColor: true,
76
- borderBottomColor: true,
77
- borderRadius: true,
78
- borderTopLeftRadius: true,
79
- borderTopRightRadius: true,
80
- borderBottomLeftRadius: true,
81
- borderBottomRightRadius: true,
82
- borderLeftWidth: true,
83
- borderRightWidth: true,
84
- borderTopWidth: true,
85
- borderBottomWidth: true,
86
- color: true,
87
- left: true,
88
- right: true,
89
- top: true,
90
- bottom: true,
91
- fontSize: true,
92
- fontWeight: true,
93
- lineHeight: true,
94
- letterSpacing: true
95
- };
96
- function createAnimations(animations) {
97
- return {
98
- needsCustomComponent: true,
99
- View: isWeb ? AnimatedView : Animated.View,
100
- Text: isWeb ? AnimatedText : Animated.Text,
101
- // View: Animated.View,
102
- // Text: Animated.Text,
103
- isReactNative: true,
104
- inputStyle: "value",
105
- outputStyle: "inline",
106
- animations,
107
- usePresence,
108
- ResetPresence,
109
- useAnimatedNumber(initial) {
110
- var sharedValue = useSharedValue(initial);
111
- return React.useMemo(function () {
112
- return {
113
- getInstance() {
114
- "worklet";
115
-
116
- return sharedValue;
117
- },
118
- getValue() {
119
- "worklet";
120
-
121
- return sharedValue.value;
122
- },
123
- setValue(next) {
124
- "worklet";
125
-
126
- var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
127
- type: "spring"
128
- },
129
- onFinish = arguments.length > 2 ? arguments[2] : void 0;
130
- if (config.type === "direct") {
131
- sharedValue.value = next;
132
- onFinish === null || onFinish === void 0 ? void 0 : onFinish();
133
- } else if (config.type === "spring") {
134
- sharedValue.value = withSpring(next, config, onFinish ? function () {
135
- "worklet";
136
-
137
- runOnJS(onFinish)();
138
- } : void 0);
139
- } else {
140
- sharedValue.value = withTiming(next, config, onFinish ? function () {
141
- "worklet";
142
-
143
- runOnJS(onFinish)();
144
- } : void 0);
145
- }
146
- },
147
- stop() {
148
- "worklet";
149
-
150
- cancelAnimation(sharedValue);
151
- }
152
- };
153
- }, [sharedValue]);
154
- },
155
- useAnimatedNumberReaction(param, onValue) {
156
- var {
157
- value
158
- } = param;
159
- var instance = value.getInstance();
160
- return useAnimatedReaction(function () {
161
- return instance.value;
162
- }, function (next, prev) {
163
- if (prev !== next) {
164
- runOnJS(onValue)(next);
165
- }
166
- },
167
- // dependency array is very important here
168
- [onValue, instance]);
169
- },
170
- /**
171
- * `getStyle` must be a worklet
172
- */
173
- useAnimatedNumberStyle(val, getStyle) {
174
- var instance = val.getInstance();
175
- var derivedValue = useDerivedValue(function () {
176
- return instance.value;
177
- },
178
- // dependency array is very important here
179
- [instance, getStyle]);
180
- return useAnimatedStyle(function () {
181
- return getStyle(derivedValue.value);
182
- },
183
- // dependency array is very important here
184
- [val, getStyle, derivedValue, instance]);
185
- },
186
- useAnimations: function (animationProps) {
187
- var _themeState_name;
188
- var {
189
- props,
190
- presence,
191
- style,
192
- componentState
193
- } = animationProps;
194
- var animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition;
195
- var isHydrating = componentState.unmounted === true;
196
- var disableAnimation = isHydrating || !animationKey;
197
- var presenceContext = React.useContext(PresenceContext);
198
- var [, themeState] = useThemeWithState({});
199
- var isDark = (themeState === null || themeState === void 0 ? void 0 : themeState.scheme) === "dark" || (themeState === null || themeState === void 0 ? void 0 : (_themeState_name = themeState.name) === null || _themeState_name === void 0 ? void 0 : _themeState_name.startsWith("dark"));
200
- var {
201
- dontAnimate,
202
- motiProps
203
- } = useMemo(function () {
204
- var animate = {};
205
- var dontAnimate2 = {};
206
- if (disableAnimation) {
207
- for (var key in style) {
208
- var rawValue = style[key];
209
- var value = resolveDynamicValue(rawValue, isDark);
210
- if (value === void 0) continue;
211
- dontAnimate2[key] = value;
212
- }
213
- } else {
214
- var animateOnly = props.animateOnly;
215
- for (var key1 in style) {
216
- var rawValue1 = style[key1];
217
- var value1 = resolveDynamicValue(rawValue1, isDark);
218
- if (value1 === void 0) continue;
219
- if (!onlyAnimateKeys[key1] || value1 === "auto" || typeof value1 === "string" && value1.startsWith("calc") || animateOnly && !animateOnly.includes(key1)) {
220
- dontAnimate2[key1] = value1;
221
- } else {
222
- animate[key1] = value1;
223
- }
224
- }
225
- }
226
- if (componentState.unmounted === "should-enter") {
227
- for (var key2 in style) {
228
- var rawValue2 = style[key2];
229
- var value2 = resolveDynamicValue(rawValue2, isDark);
230
- if (value2 === void 0) continue;
231
- dontAnimate2[key2] = value2;
232
- }
233
- }
234
- var styles = animate;
235
- var isExiting = Boolean(presence === null || presence === void 0 ? void 0 : presence[1]);
236
- var usePresenceValue = presence || void 0;
237
- var transition = isHydrating ? {
238
- type: "transition",
239
- duration: 0
240
- } : animations[animationKey];
241
- var hasClonedTransition = false;
242
- if (Array.isArray(props.transition)) {
243
- var config = props.transition[1];
244
- if (config && (typeof config === "undefined" ? "undefined" : _type_of(config)) === "object") {
245
- for (var key3 in config) {
246
- var val = config[key3];
247
- if (!hasClonedTransition) {
248
- transition = Object.assign({}, transition);
249
- hasClonedTransition = true;
250
- }
251
- if (typeof val === "string") {
252
- transition[key3] = animations[val];
253
- } else {
254
- transition[key3] = val;
255
- }
256
- }
257
- }
258
- }
259
- return {
260
- dontAnimate: dontAnimate2,
261
- motiProps: {
262
- animate: isExiting || componentState.unmounted === true ? {} : styles,
263
- transition: componentState.unmounted ? {
264
- duration: 0
265
- } : transition,
266
- usePresenceValue,
267
- presenceContext,
268
- exit: isExiting ? styles : void 0
269
- }
270
- };
271
- }, [presenceContext, presence, animationKey, componentState.unmounted, JSON.stringify(style), presenceContext, isDark]);
272
- var moti = useMotify(motiProps);
273
- if (process.env.NODE_ENV === "development" && props["debug"] && props["debug"] !== "profile") {
274
- console.info(`useMotify(`, JSON.stringify(motiProps, null, 2) + ")", {
275
- "componentState.unmounted": componentState.unmounted,
276
- animationProps,
277
- motiProps,
278
- moti,
279
- style: [dontAnimate, moti.style]
280
- });
281
- }
282
- return {
283
- style: [dontAnimate, moti.style]
284
- };
285
- }
286
- };
287
- }
288
- export { createAnimations };
289
- //# sourceMappingURL=createAnimations.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["jsx","_jsx","PresenceContext","ResetPresence","usePresence","getSplitStyles","hooks","isWeb","Text","useComposedRefs","useThemeWithState","View","useMotify","React","forwardRef","useMemo","useRef","Animated_","cancelAnimation","runOnJS","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","withTiming","_type_of","obj","Symbol","constructor","resolveDynamicValue","value","isDark","dynamicValue","dynamic","dark","light","safeESModule","a","b","out","__esModule","toStringTag","default","Animated","createGuiAnimatedComponent","defaultTag","arguments","length","isText","Component","createAnimatedComponent","propsIn","ref","_hooks_usePropsTransform","forwardedRef","animation","render","propsRest","hostRef","composedRefs","stateRef","current","host","_","state","result","staticConfig","theme","name","unmounted","isAnimated","noClass","props","viewProps","Element","transformedProps","usePropsTransform","call","AnimatedView","AnimatedText","onlyAnimateKeys","transform","opacity","height","width","backgroundColor","borderColor","borderLeftColor","borderRightColor","borderTopColor","borderBottomColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","color","left","right","top","bottom","fontSize","fontWeight","lineHeight","letterSpacing","createAnimations","animations","needsCustomComponent","isReactNative","inputStyle","outputStyle","useAnimatedNumber","initial","sharedValue","getInstance","getValue","setValue","next","config","type","onFinish","stop","useAnimatedNumberReaction","param","onValue","instance","prev","useAnimatedNumberStyle","val","getStyle","derivedValue","useAnimations","animationProps","_themeState_name","presence","style","componentState","animationKey","Array","isArray","transition","isHydrating","disableAnimation","presenceContext","useContext","themeState","scheme","startsWith","dontAnimate","motiProps","animate","key","rawValue","animateOnly","key1","rawValue1","value1","includes","key2","rawValue2","value2","styles","isExiting","Boolean","usePresenceValue","duration","hasClonedTransition","key3","Object","assign","dontAnimate2","exit","JSON","stringify","moti","process","env","NODE_ENV","console","info"],"sources":["../../src/createAnimations.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,QAAiB,mBAAe;AAEzC,SAAAC,eAAA,EAAAC,aAAA,EAAAC,WAAA;AAAA,SACEC,cAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,IAAA,EAAAC,eAAA,EAAAC,iBAAA,EAAAC,IAAA;AAAA,SACAC,SAAA;AAAA,OACAC,KAAA,IAAAC,UAAA,EAAAC,OAAA,EAAAC,MAAA;AAAA,OACAC,SAAA,IAAAC,eAAA,EAAAC,OAAA,EAAAC,mBAAA,EAAAC,gBAAA,EAAAC,eAAA,EAAAC,cAAA,EAAAC,UAAA,EAAAC,UAAA;AAAA,SACAC,SAAAC,GAAA;EACA;;EACA,OAAAA,GAAA,WAAAC,MAAA,oBAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAAA;AAcF,IAAAG,mBAAS,GAAiB,SAAAA,CAAAC,KAAA,EAAAC,MAAA;EAE1B,IAAAD,KAAO,KAAS,OAAAA,KAAY,gBAAS,cAAc,GAAAL,QAAA,CAAAK,KAAA,gCAAAA,KAAA;IAGnD,IAAOE,YAAA,GAAAD,MAAA,GAAAD,KAAA,CAAAG,OAAA,CAAAC,IAAA,GAAAJ,KAAA,CAAAG,OAAA,CAAAE,KAAA;IACL,OAAAH,YAAA;EACA;EACA,OAAAF,KAAA;AAAA;AACA,IACAM,YAAA,YAAAA,CAAAC,CAAA;EACA,IAAAC,CAAA,GAAAD,CAAA;EACA,IAAAE,GAAA,GAAAD,CAAA,CAAAE,UAAA,IAAAF,CAAA,CAAAX,MAAA,CAAAc,WAAA,iBAAAH,CAAA,CAAAI,OAAA,GAAAJ,CAAA;EACA,OAAAC,GAAA,IAAAF,CAAA;AAAA;AAyDW,IAAAM,QAAA,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A,EACF0B,IAAA,CAAAvC,KAAA","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import "./polyfill.mjs";
2
- export * from "./createAnimations.mjs";
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO;AAEP,cAAc","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import "./polyfill.native.js";
2
- export * from "./createAnimations.native.js";
3
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO;AAEP,cAAc","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- if (typeof requestAnimationFrame === "undefined") {
2
- globalThis["requestAnimationFrame"] = setTimeout;
3
- }
4
- if (typeof global === "undefined") {
5
- globalThis["global"] = globalThis;
6
- }
7
- //# sourceMappingURL=polyfill.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["requestAnimationFrame","globalThis","setTimeout","global"],"sources":["../../src/polyfill.ts"],"sourcesContent":[null],"mappings":"AACA,IAAI,OAAOA,qBAAA,KAA0B,aAAa;EAChDC,UAAA,CAAW,uBAAuB,IAAIC,UAAA;AACxC;AAGA,IAAI,OAAOC,MAAA,KAAW,aAAa;EACjCF,UAAA,CAAW,QAAQ,IAAIA,UAAA;AACzB","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- if (typeof requestAnimationFrame === "undefined") {
2
- globalThis["requestAnimationFrame"] = setTimeout;
3
- }
4
- if (typeof global === "undefined") {
5
- globalThis["global"] = globalThis;
6
- }
7
- //# sourceMappingURL=polyfill.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["requestAnimationFrame","globalThis","setTimeout","global"],"sources":["../../src/polyfill.ts"],"sourcesContent":[null],"mappings":"AACA,IAAI,OAAOA,qBAAA,KAA0B,aAAa;EAChDC,UAAA,CAAW,uBAAuB,IAAIC,UAAA;AACxC;AAGA,IAAI,OAAOC,MAAA,KAAW,aAAa;EACjCF,UAAA,CAAW,QAAQ,IAAIA,UAAA;AACzB","ignoreList":[]}