@hanzogui/animations-reanimated 3.0.5 → 4.3.1

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.
@@ -1,188 +1,218 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { normalizeTransition, getEffectiveAnimation } from "@hanzogui/animation-helpers";
2
+ import { getEffectiveAnimation, normalizeTransition } from "@hanzogui/animation-helpers";
3
3
  import { getSplitStyles, hooks, isWeb, Text, useComposedRefs, useEvent, useIsomorphicLayoutEffect, useThemeWithState, View } from "@hanzogui/core";
4
4
  import { ResetPresence, usePresence } from "@hanzogui/use-presence";
5
5
  import React, { forwardRef, useMemo, useRef } from "react";
6
- import Animated_, { cancelAnimation, runOnJS, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withDelay, withSpring, withTiming } from "react-native-reanimated";
6
+ import Animated_, { cancelAnimation, runOnJS, runOnUI, useAnimatedReaction, useAnimatedStyle, useSharedValue, withDelay, withSpring, withTiming } from "react-native-reanimated";
7
7
  function _type_of(obj) {
8
8
  "@swc/helpers - typeof";
9
9
 
10
- return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
10
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
11
11
  }
12
12
  var getDefaultExport = function (module) {
13
- var mod = module;
14
- return (mod.__esModule || mod[Symbol.toStringTag] === "Module") && mod.default || mod;
15
- },
16
- Animated = getDefaultExport(Animated_),
17
- resolveDynamicValue = function (value, isDark) {
18
- if (value !== null && (typeof value > "u" ? "undefined" : _type_of(value)) === "object" && "dynamic" in value && _type_of(value.dynamic) === "object") {
19
- var dynamic = value.dynamic;
20
- return isDark ? dynamic.dark : dynamic.light;
21
- }
22
- return value;
23
- },
24
- applyAnimation = function (targetValue, config, callback) {
25
- "worklet";
13
+ var mod = module;
14
+ if (mod.__esModule || mod[Symbol.toStringTag] === "Module") {
15
+ return mod.default || mod;
16
+ }
17
+ return mod;
18
+ };
19
+ var Animated = getDefaultExport(Animated_);
20
+ var resolveDynamicValue = function (value, isDark) {
21
+ if (value !== null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "dynamic" in value && _type_of(value.dynamic) === "object") {
22
+ var dynamic = value.dynamic;
23
+ return isDark ? dynamic.dark : dynamic.light;
24
+ }
25
+ return value;
26
+ };
27
+ var applyAnimation = function (targetValue, config, callback) {
28
+ "worklet";
26
29
 
27
- var delay = config.delay,
28
- animatedValue;
29
- return config.type === "timing" ? animatedValue = withTiming(targetValue, config, callback) : animatedValue = withSpring(targetValue, config, callback), delay && delay > 0 && (animatedValue = withDelay(delay, animatedValue)), animatedValue;
30
- },
31
- ANIMATABLE_PROPERTIES = {
32
- // Transform
33
- transform: !0,
34
- // Opacity
35
- opacity: !0,
36
- // Dimensions
37
- height: !0,
38
- width: !0,
39
- minWidth: !0,
40
- minHeight: !0,
41
- maxWidth: !0,
42
- maxHeight: !0,
43
- // Background
44
- backgroundColor: !0,
45
- // Border colors
46
- borderColor: !0,
47
- borderLeftColor: !0,
48
- borderRightColor: !0,
49
- borderTopColor: !0,
50
- borderBottomColor: !0,
51
- // Border radius
52
- borderRadius: !0,
53
- borderTopLeftRadius: !0,
54
- borderTopRightRadius: !0,
55
- borderBottomLeftRadius: !0,
56
- borderBottomRightRadius: !0,
57
- // Border width
58
- borderWidth: !0,
59
- borderLeftWidth: !0,
60
- borderRightWidth: !0,
61
- borderTopWidth: !0,
62
- borderBottomWidth: !0,
63
- // Text
64
- color: !0,
65
- fontSize: !0,
66
- fontWeight: !0,
67
- lineHeight: !0,
68
- letterSpacing: !0,
69
- // Position
70
- left: !0,
71
- right: !0,
72
- top: !0,
73
- bottom: !0,
74
- // Margin
75
- margin: !0,
76
- marginTop: !0,
77
- marginBottom: !0,
78
- marginLeft: !0,
79
- marginRight: !0,
80
- marginHorizontal: !0,
81
- marginVertical: !0,
82
- // Padding
83
- padding: !0,
84
- paddingTop: !0,
85
- paddingBottom: !0,
86
- paddingLeft: !0,
87
- paddingRight: !0,
88
- paddingHorizontal: !0,
89
- paddingVertical: !0,
90
- // Flex/Gap
91
- gap: !0,
92
- rowGap: !0,
93
- columnGap: !0,
94
- flex: !0,
95
- flexGrow: !0,
96
- flexShrink: !0
97
- },
98
- canAnimateProperty = function (key, value, animateOnly) {
99
- return !(!ANIMATABLE_PROPERTIES[key] || value === "auto" || typeof value == "string" && value.startsWith("calc") || animateOnly && !animateOnly.includes(key));
100
- };
30
+ var delay = config.delay;
31
+ var animatedValue;
32
+ if (config.type === "timing") {
33
+ animatedValue = withTiming(targetValue, config, callback);
34
+ } else {
35
+ animatedValue = withSpring(targetValue, config, callback);
36
+ }
37
+ if (delay && delay > 0) {
38
+ animatedValue = withDelay(delay, animatedValue);
39
+ }
40
+ return animatedValue;
41
+ };
42
+ var ANIMATABLE_PROPERTIES = {
43
+ // Transform
44
+ transform: true,
45
+ // Opacity
46
+ opacity: true,
47
+ // Dimensions
48
+ height: true,
49
+ width: true,
50
+ minWidth: true,
51
+ minHeight: true,
52
+ maxWidth: true,
53
+ maxHeight: true,
54
+ // Background
55
+ backgroundColor: true,
56
+ // Border colors
57
+ borderColor: true,
58
+ borderLeftColor: true,
59
+ borderRightColor: true,
60
+ borderTopColor: true,
61
+ borderBottomColor: true,
62
+ // Border radius
63
+ borderRadius: true,
64
+ borderTopLeftRadius: true,
65
+ borderTopRightRadius: true,
66
+ borderBottomLeftRadius: true,
67
+ borderBottomRightRadius: true,
68
+ // Border width
69
+ borderWidth: true,
70
+ borderLeftWidth: true,
71
+ borderRightWidth: true,
72
+ borderTopWidth: true,
73
+ borderBottomWidth: true,
74
+ // Text
75
+ color: true,
76
+ fontSize: true,
77
+ fontWeight: true,
78
+ lineHeight: true,
79
+ letterSpacing: true,
80
+ // Position
81
+ left: true,
82
+ right: true,
83
+ top: true,
84
+ bottom: true,
85
+ // Margin
86
+ margin: true,
87
+ marginTop: true,
88
+ marginBottom: true,
89
+ marginLeft: true,
90
+ marginRight: true,
91
+ marginHorizontal: true,
92
+ marginVertical: true,
93
+ // Padding
94
+ padding: true,
95
+ paddingTop: true,
96
+ paddingBottom: true,
97
+ paddingLeft: true,
98
+ paddingRight: true,
99
+ paddingHorizontal: true,
100
+ paddingVertical: true,
101
+ // Flex/Gap
102
+ gap: true,
103
+ rowGap: true,
104
+ columnGap: true,
105
+ flex: true,
106
+ flexGrow: true,
107
+ flexShrink: true
108
+ };
109
+ var canAnimateProperty = function (key, value, animateOnly) {
110
+ if (!ANIMATABLE_PROPERTIES[key]) return false;
111
+ if (value === "auto") return false;
112
+ if (typeof value === "string" && value.startsWith("calc")) return false;
113
+ if (animateOnly && !animateOnly.includes(key)) return false;
114
+ return true;
115
+ };
101
116
  function createWebAnimatedComponent(defaultTag) {
102
- var isText = defaultTag === "span",
103
- Component = Animated.createAnimatedComponent(/* @__PURE__ */forwardRef(function (propsIn, ref) {
104
- var _hooks_usePropsTransform,
105
- {
106
- forwardedRef,
107
- render = defaultTag,
108
- ...rest
109
- } = propsIn,
110
- hostRef = useRef(null),
111
- composedRefs = useComposedRefs(forwardedRef, ref, hostRef),
112
- stateRef = useRef({
113
- get host() {
114
- return hostRef.current;
115
- }
116
- }),
117
- [, themeState] = useThemeWithState({}),
118
- _themeState_theme,
119
- _themeState_name,
120
- result = getSplitStyles(rest, isText ? Text.staticConfig : View.staticConfig, (_themeState_theme = themeState?.theme) !== null && _themeState_theme !== void 0 ? _themeState_theme : {}, (_themeState_name = themeState?.name) !== null && _themeState_name !== void 0 ? _themeState_name : "", {
121
- unmounted: !1
122
- }, {
123
- isAnimated: !1,
124
- noClass: !0
125
- }),
126
- _result_viewProps,
127
- viewProps = (_result_viewProps = result?.viewProps) !== null && _result_viewProps !== void 0 ? _result_viewProps : {},
128
- Element = render,
129
- transformedProps = (_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, render, viewProps, stateRef, !1);
130
- return /* @__PURE__ */_jsx(Element, {
131
- ...transformedProps,
132
- ref: composedRefs
133
- });
134
- }));
135
- return Component.acceptRenderProp = !0, Component;
117
+ var isText = defaultTag === "span";
118
+ var Component = Animated.createAnimatedComponent(/* @__PURE__ */forwardRef(function (propsIn, ref) {
119
+ var _hooks_usePropsTransform;
120
+ var {
121
+ forwardedRef,
122
+ render = defaultTag,
123
+ ...rest
124
+ } = propsIn;
125
+ var hostRef = useRef(null);
126
+ var composedRefs = useComposedRefs(forwardedRef, ref, hostRef);
127
+ var stateRef = useRef({
128
+ get host() {
129
+ return hostRef.current;
130
+ }
131
+ });
132
+ var [, themeState] = useThemeWithState({});
133
+ var _themeState_theme, _themeState_name;
134
+ var result = getSplitStyles(rest, isText ? Text.staticConfig : View.staticConfig, (_themeState_theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme) !== null && _themeState_theme !== void 0 ? _themeState_theme : {}, (_themeState_name = themeState === null || themeState === void 0 ? void 0 : themeState.name) !== null && _themeState_name !== void 0 ? _themeState_name : "", {
135
+ unmounted: false
136
+ }, {
137
+ isAnimated: false,
138
+ noClass: true
139
+ });
140
+ var _result_viewProps;
141
+ var viewProps = (_result_viewProps = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _result_viewProps !== void 0 ? _result_viewProps : {};
142
+ var Element = render;
143
+ var transformedProps = (_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, render, viewProps, stateRef, false);
144
+ return /* @__PURE__ */_jsx(Element, {
145
+ ...transformedProps,
146
+ ref: composedRefs
147
+ });
148
+ }));
149
+ Component.acceptRenderProp = true;
150
+ return Component;
136
151
  }
137
- var AnimatedView = createWebAnimatedComponent("div"),
138
- AnimatedText = createWebAnimatedComponent("span");
152
+ var AnimatedView = createWebAnimatedComponent("div");
153
+ var AnimatedText = createWebAnimatedComponent("span");
139
154
  function buildTransitionConfig(transition, animations, animationState, styleKeys) {
140
- var normalized = normalizeTransition(transition),
141
- effectiveKey = getEffectiveAnimation(normalized, animationState),
142
- _animations_effectiveKey,
143
- base = effectiveKey ? (_animations_effectiveKey = animations[effectiveKey]) !== null && _animations_effectiveKey !== void 0 ? _animations_effectiveKey : {
144
- type: "spring"
145
- } : {
146
- type: "spring"
155
+ var normalized = normalizeTransition(transition);
156
+ var effectiveKey = getEffectiveAnimation(normalized, animationState);
157
+ var _animations_effectiveKey;
158
+ var base = effectiveKey ? (_animations_effectiveKey = animations[effectiveKey]) !== null && _animations_effectiveKey !== void 0 ? _animations_effectiveKey : {
159
+ type: "spring"
160
+ } : {
161
+ type: "spring"
162
+ };
163
+ if (normalized.delay) {
164
+ base = {
165
+ ...base,
166
+ delay: normalized.delay
147
167
  };
148
- normalized.delay && (base = {
149
- ...base,
150
- delay: normalized.delay
151
- }), normalized.config && (base = {
152
- ...base,
153
- ...normalized.config
154
- }, base.type !== "timing" && normalized.config.duration !== void 0 && normalized.config.damping === void 0 && normalized.config.stiffness === void 0 && normalized.config.mass === void 0 && (base = {
155
- ...base,
156
- type: "timing"
157
- }));
158
- var propertyConfigs = {},
159
- _iteratorNormalCompletion = !0,
160
- _didIteratorError = !1,
168
+ }
169
+ if (normalized.config) {
170
+ base = {
171
+ ...base,
172
+ ...normalized.config
173
+ };
174
+ if (base.type !== "timing" && normalized.config.duration !== void 0 && normalized.config.damping === void 0 && normalized.config.stiffness === void 0 && normalized.config.mass === void 0) {
175
+ base = {
176
+ ...base,
177
+ type: "timing"
178
+ };
179
+ }
180
+ }
181
+ var propertyConfigs = {};
182
+ var _iteratorNormalCompletion = true,
183
+ _didIteratorError = false,
161
184
  _iteratorError = void 0;
162
185
  try {
163
- for (var _iterator = styleKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
164
- var key = _step.value,
165
- propAnimation = normalized.properties[key];
166
- if (typeof propAnimation == "string") {
186
+ for (var _iterator = styleKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
187
+ var key = _step.value;
188
+ var propAnimation = normalized.properties[key];
189
+ if (typeof propAnimation === "string") {
167
190
  var _animations_propAnimation;
168
191
  propertyConfigs[key] = (_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : base;
169
- } else if (propAnimation && (typeof propAnimation > "u" ? "undefined" : _type_of(propAnimation)) === "object") {
170
- var configType = propAnimation.type,
171
- _animations_configType,
172
- baseForProp = configType && (_animations_configType = animations[configType]) !== null && _animations_configType !== void 0 ? _animations_configType : base;
192
+ } else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object") {
193
+ var configType = propAnimation.type;
194
+ var _animations_configType;
195
+ var baseForProp = configType ? (_animations_configType = animations[configType]) !== null && _animations_configType !== void 0 ? _animations_configType : base : base;
173
196
  propertyConfigs[key] = {
174
197
  ...baseForProp,
175
198
  ...propAnimation
176
199
  };
177
- } else propertyConfigs[key] = base;
200
+ } else {
201
+ propertyConfigs[key] = base;
202
+ }
178
203
  }
179
204
  } catch (err) {
180
- _didIteratorError = !0, _iteratorError = err;
205
+ _didIteratorError = true;
206
+ _iteratorError = err;
181
207
  } finally {
182
208
  try {
183
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
209
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
210
+ _iterator.return();
211
+ }
184
212
  } finally {
185
- if (_didIteratorError) throw _iteratorError;
213
+ if (_didIteratorError) {
214
+ throw _iteratorError;
215
+ }
186
216
  }
187
217
  }
188
218
  return {
@@ -193,21 +223,28 @@ function buildTransitionConfig(transition, animations, animationState, styleKeys
193
223
  function getStyleKeys(style) {
194
224
  var keys = new Set(Object.keys(style));
195
225
  if (style.transform && Array.isArray(style.transform)) {
196
- var _iteratorNormalCompletion = !0,
197
- _didIteratorError = !1,
226
+ var _iteratorNormalCompletion = true,
227
+ _didIteratorError = false,
198
228
  _iteratorError = void 0;
199
229
  try {
200
- for (var _iterator = style.transform[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
230
+ for (var _iterator = style.transform[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
201
231
  var t = _step.value;
202
- t && (typeof t > "u" ? "undefined" : _type_of(t)) === "object" && keys.add(Object.keys(t)[0]);
232
+ if (t && (typeof t === "undefined" ? "undefined" : _type_of(t)) === "object") {
233
+ keys.add(Object.keys(t)[0]);
234
+ }
203
235
  }
204
236
  } catch (err) {
205
- _didIteratorError = !0, _iteratorError = err;
237
+ _didIteratorError = true;
238
+ _iteratorError = err;
206
239
  } finally {
207
240
  try {
208
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
241
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
242
+ _iterator.return();
243
+ }
209
244
  } finally {
210
- if (_didIteratorError) throw _iteratorError;
245
+ if (_didIteratorError) {
246
+ throw _iteratorError;
247
+ }
211
248
  }
212
249
  }
213
250
  }
@@ -215,18 +252,20 @@ function getStyleKeys(style) {
215
252
  }
216
253
  function createAnimations(animationsConfig) {
217
254
  var animations = {};
218
- for (var key in animationsConfig) animations[key] = {
219
- type: "spring",
220
- ...animationsConfig[key]
221
- };
255
+ for (var key in animationsConfig) {
256
+ animations[key] = {
257
+ type: "spring",
258
+ ...animationsConfig[key]
259
+ };
260
+ }
222
261
  return {
223
- needsCustomComponent: !0,
262
+ needsCustomComponent: true,
224
263
  View: isWeb ? AnimatedView : Animated.View,
225
264
  Text: isWeb ? AnimatedText : Animated.Text,
226
- isReactNative: !0,
265
+ isReactNative: true,
227
266
  inputStyle: "value",
228
267
  outputStyle: "inline",
229
- avoidReRenders: !0,
268
+ avoidReRenders: true,
230
269
  animations,
231
270
  usePresence,
232
271
  ResetPresence,
@@ -248,22 +287,31 @@ function createAnimations(animationsConfig) {
248
287
  return sharedValue.value;
249
288
  },
250
289
  setValue(next) {
251
- "worklet";
252
-
253
290
  var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
254
291
  type: "spring"
255
292
  },
256
- onFinish = arguments.length > 2 ? arguments[2] : void 0,
257
- handleFinish = onFinish ? function () {
293
+ onFinish = arguments.length > 2 ? arguments[2] : void 0;
294
+ if (config.type === "direct") {
295
+ sharedValue.value = next;
296
+ onFinish === null || onFinish === void 0 ? void 0 : onFinish();
297
+ } else {
298
+ var cb = onFinish ? function () {
258
299
  "worklet";
259
300
 
260
301
  runOnJS(onFinish)();
261
302
  } : void 0;
262
- config.type === "direct" ? (sharedValue.value = next, onFinish?.()) : config.type === "spring" ? sharedValue.value = withSpring(next, config, handleFinish) : sharedValue.value = withTiming(next, config, handleFinish);
303
+ if (isWeb) {
304
+ sharedValue.value = config.type === "spring" ? withSpring(next, config, cb) : withTiming(next, config, cb);
305
+ } else {
306
+ runOnUI(function () {
307
+ "worklet";
308
+
309
+ sharedValue.value = config.type === "spring" ? withSpring(next, config, cb) : withTiming(next, config, cb);
310
+ })();
311
+ }
312
+ }
263
313
  },
264
314
  stop() {
265
- "worklet";
266
-
267
315
  cancelAnimation(sharedValue);
268
316
  }
269
317
  };
@@ -274,119 +322,179 @@ function createAnimations(animationsConfig) {
274
322
  // =========================================================================
275
323
  useAnimatedNumberReaction(param, onValue) {
276
324
  var {
277
- value
278
- } = param,
279
- instance = value.getInstance();
325
+ value
326
+ } = param;
327
+ var instance = value.getInstance();
280
328
  return useAnimatedReaction(function () {
281
329
  return instance.value;
282
330
  }, function (next, prev) {
283
- prev !== next && runOnJS(onValue)(next);
331
+ if (prev !== next) {
332
+ runOnJS(onValue)(next);
333
+ }
284
334
  }, [onValue, instance]);
285
335
  },
286
336
  // =========================================================================
287
337
  // useAnimatedNumberStyle - Create animated styles from values
288
338
  // =========================================================================
289
339
  useAnimatedNumberStyle(val, getStyle) {
290
- var instance = val.getInstance(),
291
- derivedValue = useDerivedValue(function () {
292
- return instance.value;
340
+ var instance = val.getInstance();
341
+ if (isWeb) {
342
+ return useAnimatedStyle(function () {
343
+ "worklet";
344
+
345
+ return getStyle(instance.value);
293
346
  }, [instance, getStyle]);
347
+ }
348
+ var styleVal = useSharedValue(getStyle(instance.value));
349
+ useAnimatedReaction(function () {
350
+ "worklet";
351
+
352
+ return instance.value;
353
+ }, function (current, previous) {
354
+ "worklet";
355
+
356
+ if (current !== previous) {
357
+ styleVal.value = getStyle(current);
358
+ }
359
+ });
294
360
  return useAnimatedStyle(function () {
295
- return getStyle(derivedValue.value);
296
- }, [val, getStyle, derivedValue, instance]);
361
+ "worklet";
362
+
363
+ return styleVal.value;
364
+ });
365
+ },
366
+ useAnimatedNumbersStyle(vals, getStyle) {
367
+ var instances = vals.map(function (v) {
368
+ return v.getInstance();
369
+ });
370
+ return useAnimatedStyle(function () {
371
+ "worklet";
372
+
373
+ var currentValues = instances.map(function (inst) {
374
+ return inst.value;
375
+ });
376
+ return getStyle(...currentValues);
377
+ }, isWeb ? [getStyle, ...instances] : void 0);
297
378
  },
298
379
  // =========================================================================
299
380
  // useAnimations - Main animation hook for components
300
381
  // =========================================================================
301
382
  useAnimations(animationProps) {
302
383
  var {
303
- props,
304
- presence,
305
- style,
306
- componentState,
307
- useStyleEmitter,
308
- themeName,
309
- stateRef,
310
- styleState
311
- } = animationProps,
312
- isHydrating = componentState.unmounted === !0,
313
- isMounting = componentState.unmounted === "should-enter",
314
- isEntering = !!componentState.unmounted,
315
- isExiting = presence?.[0] === !1,
316
- wasEnteringRef = useRef(isEntering),
317
- justFinishedEntering = wasEnteringRef.current && !isEntering;
384
+ props,
385
+ presence,
386
+ style,
387
+ componentState,
388
+ useStyleEmitter,
389
+ themeName,
390
+ stateRef,
391
+ styleState
392
+ } = animationProps;
393
+ var isHydrating = componentState.unmounted === true;
394
+ var isMounting = componentState.unmounted === "should-enter";
395
+ var isEntering = !!componentState.unmounted;
396
+ var isExiting = (presence === null || presence === void 0 ? void 0 : presence[0]) === false;
397
+ var wasEnteringRef = useRef(isEntering);
398
+ var justFinishedEntering = wasEnteringRef.current && !isEntering;
318
399
  React.useEffect(function () {
319
400
  wasEnteringRef.current = isEntering;
320
401
  });
321
- var _styleState_effectiveTransition,
322
- effectiveTransition = (_styleState_effectiveTransition = styleState?.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition,
323
- normalized = normalizeTransition(effectiveTransition),
324
- animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default",
325
- animationKey = getEffectiveAnimation(normalized, animationState),
326
- disableAnimation = isHydrating || !animationKey,
327
- isDark = themeName?.startsWith("dark") || !1,
328
- sendExitComplete = presence?.[1],
329
- exitCycleIdRef = useRef(0),
330
- pendingExitKeysRef = useRef(/* @__PURE__ */new Set()),
331
- exitCompletedRef = useRef(!1),
332
- wasExitingRef = useRef(!1),
333
- justStartedExiting = isExiting && !wasExitingRef.current,
334
- justStoppedExiting = !isExiting && wasExitingRef.current,
335
- markExitKeyDone = useEvent(function (key3, cycleId, finished) {
336
- cycleId === exitCycleIdRef.current && (exitCompletedRef.current || (pendingExitKeysRef.current.delete(key3), pendingExitKeysRef.current.size === 0 && (exitCompletedRef.current = !0, sendExitComplete?.())));
337
- }),
338
- isExitingRef = useSharedValue(isExiting),
339
- exitCycleIdShared = useSharedValue(exitCycleIdRef.current);
340
- justStartedExiting && (exitCycleIdRef.current++, exitCompletedRef.current = !1, pendingExitKeysRef.current.clear()), justStoppedExiting && (exitCycleIdRef.current++, pendingExitKeysRef.current.clear()), useIsomorphicLayoutEffect(function () {
341
- isExitingRef.value = isExiting, exitCycleIdShared.value = exitCycleIdRef.current;
342
- }, [isExiting, exitCycleIdRef.current]), React.useEffect(function () {
402
+ var _styleState_effectiveTransition;
403
+ var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
404
+ var normalized = normalizeTransition(effectiveTransition);
405
+ var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
406
+ var animationKey = getEffectiveAnimation(normalized, animationState);
407
+ var disableAnimation = isHydrating || !animationKey;
408
+ var isDark = (themeName === null || themeName === void 0 ? void 0 : themeName.startsWith("dark")) || false;
409
+ var sendExitComplete = presence === null || presence === void 0 ? void 0 : presence[1];
410
+ var exitCycleIdRef = useRef(0);
411
+ var pendingExitKeysRef = useRef(/* @__PURE__ */new Set());
412
+ var exitCompletedRef = useRef(false);
413
+ var wasExitingRef = useRef(false);
414
+ var justStartedExiting = isExiting && !wasExitingRef.current;
415
+ var justStoppedExiting = !isExiting && wasExitingRef.current;
416
+ var markExitKeyDone = useEvent(function (key3, cycleId, finished) {
417
+ if (cycleId !== exitCycleIdRef.current) return;
418
+ if (exitCompletedRef.current) return;
419
+ pendingExitKeysRef.current.delete(key3);
420
+ if (pendingExitKeysRef.current.size === 0) {
421
+ exitCompletedRef.current = true;
422
+ sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();
423
+ }
424
+ });
425
+ var isExitingRef = useSharedValue(isExiting);
426
+ var exitCycleIdShared = useSharedValue(exitCycleIdRef.current);
427
+ if (justStartedExiting) {
428
+ exitCycleIdRef.current++;
429
+ exitCompletedRef.current = false;
430
+ pendingExitKeysRef.current.clear();
431
+ }
432
+ if (justStoppedExiting) {
433
+ exitCycleIdRef.current++;
434
+ pendingExitKeysRef.current.clear();
435
+ }
436
+ useIsomorphicLayoutEffect(function () {
437
+ isExitingRef.value = isExiting;
438
+ exitCycleIdShared.value = exitCycleIdRef.current;
439
+ }, [isExiting, exitCycleIdRef.current]);
440
+ React.useEffect(function () {
343
441
  wasExitingRef.current = isExiting;
344
442
  });
345
- var animatedTargetsRef = useSharedValue(null),
346
- staticTargetsRef = useSharedValue(null),
347
- transformTargetsRef = useSharedValue(null),
348
- {
349
- animatedStyles,
350
- staticStyles
351
- } = useMemo(function () {
352
- var animated = {},
353
- staticStyles2 = {},
354
- animateOnly2 = props.animateOnly;
355
- for (var key3 in style) {
356
- var rawValue = style[key3],
357
- value = resolveDynamicValue(rawValue, isDark);
358
- if (value !== void 0) {
359
- if (disableAnimation) {
360
- staticStyles2[key3] = value;
361
- continue;
362
- }
363
- canAnimateProperty(key3, value, animateOnly2) ? animated[key3] = value : staticStyles2[key3] = value;
364
- }
443
+ var animatedTargetsRef = useSharedValue(null);
444
+ var staticTargetsRef = useSharedValue(null);
445
+ var transformTargetsRef = useSharedValue(null);
446
+ var {
447
+ animatedStyles,
448
+ staticStyles
449
+ } = useMemo(function () {
450
+ var animated = {};
451
+ var staticStyles2 = {};
452
+ var animateOnly2 = props.animateOnly;
453
+ for (var key3 in style) {
454
+ var rawValue = style[key3];
455
+ var value = resolveDynamicValue(rawValue, isDark);
456
+ if (value === void 0) continue;
457
+ if (disableAnimation) {
458
+ staticStyles2[key3] = value;
459
+ continue;
460
+ }
461
+ if (canAnimateProperty(key3, value, animateOnly2)) {
462
+ animated[key3] = value;
463
+ } else {
464
+ staticStyles2[key3] = value;
365
465
  }
366
- if (isMounting) for (var key1 in animated) staticStyles2[key1] = animated[key1];
466
+ }
467
+ if (isMounting) {
468
+ for (var key1 in animated) {
469
+ staticStyles2[key1] = animated[key1];
470
+ }
471
+ }
472
+ return {
473
+ animatedStyles: animated,
474
+ staticStyles: staticStyles2
475
+ };
476
+ }, [disableAnimation, style, isDark, isMounting, props.animateOnly]);
477
+ var {
478
+ baseConfig,
479
+ propertyConfigs
480
+ } = useMemo(function () {
481
+ if (isHydrating) {
367
482
  return {
368
- animatedStyles: animated,
369
- staticStyles: staticStyles2
370
- };
371
- }, [disableAnimation, style, isDark, isMounting, props.animateOnly]),
372
- {
373
- baseConfig,
374
- propertyConfigs
375
- } = useMemo(function () {
376
- return isHydrating ? {
377
483
  baseConfig: {
378
484
  type: "timing",
379
485
  duration: 0
380
486
  },
381
487
  propertyConfigs: {}
382
- } : buildTransitionConfig(props.transition, animations, animationState, getStyleKeys(animatedStyles));
383
- }, [isHydrating, props.transition, animatedStyles, animationState]),
384
- configRef = useSharedValue({
385
- baseConfig,
386
- propertyConfigs,
387
- disableAnimation,
388
- isHydrating
389
- });
488
+ };
489
+ }
490
+ return buildTransitionConfig(props.transition, animations, animationState, getStyleKeys(animatedStyles));
491
+ }, [isHydrating, props.transition, animatedStyles, animationState]);
492
+ var configRef = useSharedValue({
493
+ baseConfig,
494
+ propertyConfigs,
495
+ disableAnimation,
496
+ isHydrating
497
+ });
390
498
  useIsomorphicLayoutEffect(function () {
391
499
  configRef.set({
392
500
  baseConfig,
@@ -394,16 +502,17 @@ function createAnimations(animationsConfig) {
394
502
  disableAnimation,
395
503
  isHydrating
396
504
  });
397
- }, [baseConfig, propertyConfigs, disableAnimation, isHydrating]), useStyleEmitter?.(function (nextStyle, effectiveTransition2) {
398
- var animateOnly2 = props.animateOnly,
399
- animated = {},
400
- statics = {},
401
- transforms2 = [],
402
- transitionToUse = effectiveTransition2 ?? props.transition,
403
- {
404
- baseConfig: newBase,
405
- propertyConfigs: newPropertyConfigs
406
- } = buildTransitionConfig(transitionToUse, animations, animationState, getStyleKeys(nextStyle));
505
+ }, [baseConfig, propertyConfigs, disableAnimation, isHydrating]);
506
+ useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function (nextStyle, effectiveTransition2) {
507
+ var animateOnly2 = props.animateOnly;
508
+ var animated = {};
509
+ var statics = {};
510
+ var transforms2 = [];
511
+ var transitionToUse = effectiveTransition2 !== null && effectiveTransition2 !== void 0 ? effectiveTransition2 : props.transition;
512
+ var {
513
+ baseConfig: newBase,
514
+ propertyConfigs: newPropertyConfigs
515
+ } = buildTransitionConfig(transitionToUse, animations, animationState, getStyleKeys(nextStyle));
407
516
  configRef.set({
408
517
  baseConfig: newBase,
409
518
  propertyConfigs: newPropertyConfigs,
@@ -411,172 +520,220 @@ function createAnimations(animationsConfig) {
411
520
  isHydrating: configRef.get().isHydrating
412
521
  });
413
522
  for (var key3 in nextStyle) {
414
- var rawValue = nextStyle[key3],
415
- value = resolveDynamicValue(rawValue, isDark);
416
- if (value != null) {
417
- if (configRef.get().disableAnimation) {
418
- statics[key3] = value;
419
- continue;
420
- }
421
- if (key3 === "transform" && Array.isArray(value)) {
422
- var _iteratorNormalCompletion2 = !0,
423
- _didIteratorError2 = !1,
424
- _iteratorError2 = void 0;
425
- try {
426
- for (var _iterator2 = value[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
427
- var t2 = _step2.value;
428
- if (t2 && (typeof t2 > "u" ? "undefined" : _type_of(t2)) === "object") {
429
- var tKey2 = Object.keys(t2)[0],
430
- tVal = t2[tKey2];
431
- (typeof tVal == "number" || typeof tVal == "string") && transforms2.push(t2);
523
+ var rawValue = nextStyle[key3];
524
+ var value = resolveDynamicValue(rawValue, isDark);
525
+ if (value == void 0) continue;
526
+ if (configRef.get().disableAnimation) {
527
+ statics[key3] = value;
528
+ continue;
529
+ }
530
+ if (key3 === "transform" && Array.isArray(value)) {
531
+ var _iteratorNormalCompletion2 = true,
532
+ _didIteratorError2 = false,
533
+ _iteratorError2 = void 0;
534
+ try {
535
+ for (var _iterator2 = value[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
536
+ var t2 = _step2.value;
537
+ if (t2 && (typeof t2 === "undefined" ? "undefined" : _type_of(t2)) === "object") {
538
+ var tKey2 = Object.keys(t2)[0];
539
+ var tVal = t2[tKey2];
540
+ if (typeof tVal === "number" || typeof tVal === "string") {
541
+ transforms2.push(t2);
432
542
  }
433
543
  }
434
- } catch (err) {
435
- _didIteratorError2 = !0, _iteratorError2 = err;
544
+ }
545
+ } catch (err) {
546
+ _didIteratorError2 = true;
547
+ _iteratorError2 = err;
548
+ } finally {
549
+ try {
550
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
551
+ _iterator2.return();
552
+ }
436
553
  } finally {
437
- try {
438
- !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
439
- } finally {
440
- if (_didIteratorError2) throw _iteratorError2;
554
+ if (_didIteratorError2) {
555
+ throw _iteratorError2;
441
556
  }
442
557
  }
443
- continue;
444
558
  }
445
- canAnimateProperty(key3, value, animateOnly2) ? animated[key3] = value : statics[key3] = value;
559
+ continue;
560
+ }
561
+ if (canAnimateProperty(key3, value, animateOnly2)) {
562
+ animated[key3] = value;
563
+ } else {
564
+ statics[key3] = value;
446
565
  }
447
566
  }
448
- animatedTargetsRef.set(animated), staticTargetsRef.set(statics), transformTargetsRef.set(transforms2), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.info("[animations-reanimated] useStyleEmitter update", {
449
- animated,
450
- statics,
451
- transforms: transforms2
452
- });
567
+ animatedTargetsRef.set(animated);
568
+ staticTargetsRef.set(statics);
569
+ transformTargetsRef.set(transforms2);
570
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
571
+ console.info("[animations-reanimated] useStyleEmitter update", {
572
+ animated,
573
+ statics,
574
+ transforms: transforms2
575
+ });
576
+ }
453
577
  });
454
- var exitKeysRegistered = useRef(!1);
578
+ var exitKeysRegistered = useRef(false);
455
579
  if (justStartedExiting && sendExitComplete) {
456
- var exitKeys = [],
457
- animateOnly = props.animateOnly;
458
- for (var key2 in animatedStyles) key2 !== "transform" && canAnimateProperty(key2, animatedStyles[key2], animateOnly) && exitKeys.push(key2);
580
+ var exitKeys = [];
581
+ var animateOnly = props.animateOnly;
582
+ for (var key2 in animatedStyles) {
583
+ if (key2 === "transform") continue;
584
+ if (canAnimateProperty(key2, animatedStyles[key2], animateOnly)) {
585
+ exitKeys.push(key2);
586
+ }
587
+ }
459
588
  var transforms = animatedStyles.transform;
460
589
  if (transforms && Array.isArray(transforms)) {
461
- var _iteratorNormalCompletion = !0,
462
- _didIteratorError = !1,
590
+ var _iteratorNormalCompletion = true,
591
+ _didIteratorError = false,
463
592
  _iteratorError = void 0;
464
593
  try {
465
- for (var _iterator = transforms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
594
+ for (var _iterator = transforms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
466
595
  var t = _step.value;
467
- if (t) {
468
- var tKey = Object.keys(t)[0];
469
- if (tKey) {
470
- if (animateOnly && !animateOnly.includes(tKey)) continue;
471
- exitKeys.push(`transform:${tKey}`);
596
+ if (!t) continue;
597
+ var tKey = Object.keys(t)[0];
598
+ if (tKey) {
599
+ if (animateOnly && !animateOnly.includes(tKey)) {
600
+ continue;
472
601
  }
602
+ exitKeys.push(`transform:${tKey}`);
473
603
  }
474
604
  }
475
605
  } catch (err) {
476
- _didIteratorError = !0, _iteratorError = err;
606
+ _didIteratorError = true;
607
+ _iteratorError = err;
477
608
  } finally {
478
609
  try {
479
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
610
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
611
+ _iterator.return();
612
+ }
480
613
  } finally {
481
- if (_didIteratorError) throw _iteratorError;
614
+ if (_didIteratorError) {
615
+ throw _iteratorError;
616
+ }
482
617
  }
483
618
  }
484
619
  }
485
- pendingExitKeysRef.current = new Set(exitKeys), exitKeysRegistered.current = exitKeys.length > 0;
620
+ pendingExitKeysRef.current = new Set(exitKeys);
621
+ exitKeysRegistered.current = exitKeys.length > 0;
486
622
  }
487
623
  React.useEffect(function () {
488
- !justStartedExiting || !sendExitComplete || !exitKeysRegistered.current && pendingExitKeysRef.current.size === 0 && (exitCompletedRef.current || (exitCompletedRef.current = !0, sendExitComplete()));
624
+ if (!justStartedExiting || !sendExitComplete) return;
625
+ if (!exitKeysRegistered.current && pendingExitKeysRef.current.size === 0) {
626
+ if (!exitCompletedRef.current) {
627
+ exitCompletedRef.current = true;
628
+ sendExitComplete();
629
+ }
630
+ }
489
631
  }, [justStartedExiting, sendExitComplete]);
490
632
  var animatedStyle = useAnimatedStyle(function () {
491
633
  "worklet";
492
634
 
493
635
  var _loop = function (key12) {
494
636
  if (key12 === "transform") return "continue";
495
- var targetValue = animatedValues[key12],
496
- _config_propertyConfigs_key,
497
- propConfig = (_config_propertyConfigs_key = config.propertyConfigs[key12]) !== null && _config_propertyConfigs_key !== void 0 ? _config_propertyConfigs_key : config.baseConfig,
498
- callback = void 0;
637
+ var targetValue = animatedValues[key12];
638
+ var _config_propertyConfigs_key;
639
+ var propConfig = (_config_propertyConfigs_key = config.propertyConfigs[key12]) !== null && _config_propertyConfigs_key !== void 0 ? _config_propertyConfigs_key : config.baseConfig;
640
+ var callback = void 0;
499
641
  if (currentlyExiting) {
500
- var capturedKey = key12,
501
- capturedCycleId = currentCycleId;
642
+ var capturedKey = key12;
643
+ var capturedCycleId = currentCycleId;
502
644
  callback = function (finished) {
503
645
  "worklet";
504
646
 
505
- runOnJS(markExitKeyDone)(capturedKey, capturedCycleId, finished ?? !1);
647
+ runOnJS(markExitKeyDone)(capturedKey, capturedCycleId, finished !== null && finished !== void 0 ? finished : false);
506
648
  };
507
649
  }
508
650
  result[key12] = applyAnimation(targetValue, propConfig, callback);
509
651
  };
510
- if (disableAnimation || isHydrating) return {};
511
- var result = {},
512
- config = configRef.get(),
513
- emitterAnimated = animatedTargetsRef.value,
514
- emitterStatic = staticTargetsRef.value,
515
- emitterTransforms = transformTargetsRef.value,
516
- hasEmitterUpdates = emitterAnimated !== null,
517
- animatedValues = hasEmitterUpdates ? emitterAnimated : animatedStyles,
518
- staticValues = hasEmitterUpdates ? emitterStatic : {},
519
- currentlyExiting = isExitingRef.value,
520
- currentCycleId = exitCycleIdShared.value;
521
- for (var key3 in staticValues) result[key3] = staticValues[key3];
652
+ if (disableAnimation || isHydrating) {
653
+ return {};
654
+ }
655
+ var result = {};
656
+ var config = configRef.get();
657
+ var emitterAnimated = animatedTargetsRef.value;
658
+ var emitterStatic = staticTargetsRef.value;
659
+ var emitterTransforms = transformTargetsRef.value;
660
+ var hasEmitterUpdates = emitterAnimated !== null;
661
+ var animatedValues = hasEmitterUpdates ? emitterAnimated : animatedStyles;
662
+ var staticValues = hasEmitterUpdates ? emitterStatic : {};
663
+ var currentlyExiting = isExitingRef.value;
664
+ var currentCycleId = exitCycleIdShared.value;
665
+ for (var key3 in staticValues) {
666
+ result[key3] = staticValues[key3];
667
+ }
522
668
  for (var key1 in animatedValues) _loop(key1);
523
669
  var transforms2 = hasEmitterUpdates ? emitterTransforms : animatedStyles.transform;
524
670
  if (transforms2 && Array.isArray(transforms2)) {
525
- var validTransforms = [],
526
- _iteratorNormalCompletion2 = !0,
527
- _didIteratorError2 = !1,
671
+ var validTransforms = [];
672
+ var _iteratorNormalCompletion2 = true,
673
+ _didIteratorError2 = false,
528
674
  _iteratorError2 = void 0;
529
675
  try {
530
- for (var _loop1 = function () {
531
- var t2 = _step2.value;
532
- if (!t2) return "continue";
533
- var keys = Object.keys(t2);
534
- if (keys.length === 0) return "continue";
535
- var value = t2[keys[0]];
536
- if (typeof value == "number" || typeof value == "string") {
537
- var transformKey = Object.keys(t2)[0],
538
- targetValue = t2[transformKey],
539
- _config_propertyConfigs_transformKey,
540
- propConfig = (_config_propertyConfigs_transformKey = config.propertyConfigs[transformKey]) !== null && _config_propertyConfigs_transformKey !== void 0 ? _config_propertyConfigs_transformKey : config.baseConfig,
541
- callback = void 0;
542
- if (currentlyExiting) {
543
- var capturedKey = `transform:${transformKey}`,
544
- capturedCycleId = currentCycleId;
545
- callback = function (finished) {
546
- "worklet";
676
+ var _loop1 = function () {
677
+ var t2 = _step2.value;
678
+ if (!t2) return "continue";
679
+ var keys = Object.keys(t2);
680
+ if (keys.length === 0) return "continue";
681
+ var value = t2[keys[0]];
682
+ if (typeof value === "number" || typeof value === "string") {
683
+ var transformKey = Object.keys(t2)[0];
684
+ var targetValue = t2[transformKey];
685
+ var _config_propertyConfigs_transformKey;
686
+ var propConfig = (_config_propertyConfigs_transformKey = config.propertyConfigs[transformKey]) !== null && _config_propertyConfigs_transformKey !== void 0 ? _config_propertyConfigs_transformKey : config.baseConfig;
687
+ var callback = void 0;
688
+ if (currentlyExiting) {
689
+ var capturedKey = `transform:${transformKey}`;
690
+ var capturedCycleId = currentCycleId;
691
+ callback = function (finished) {
692
+ "worklet";
547
693
 
548
- runOnJS(markExitKeyDone)(capturedKey, capturedCycleId, finished ?? !1);
549
- };
550
- }
551
- validTransforms.push({
552
- [transformKey]: applyAnimation(targetValue, propConfig, callback)
553
- });
694
+ runOnJS(markExitKeyDone)(capturedKey, capturedCycleId, finished !== null && finished !== void 0 ? finished : false);
695
+ };
554
696
  }
555
- }, _iterator2 = transforms2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) _loop1();
697
+ validTransforms.push({
698
+ [transformKey]: applyAnimation(targetValue, propConfig, callback)
699
+ });
700
+ }
701
+ };
702
+ for (var _iterator2 = transforms2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) _loop1();
556
703
  } catch (err) {
557
- _didIteratorError2 = !0, _iteratorError2 = err;
704
+ _didIteratorError2 = true;
705
+ _iteratorError2 = err;
558
706
  } finally {
559
707
  try {
560
- !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
708
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
709
+ _iterator2.return();
710
+ }
561
711
  } finally {
562
- if (_didIteratorError2) throw _iteratorError2;
712
+ if (_didIteratorError2) {
713
+ throw _iteratorError2;
714
+ }
563
715
  }
564
716
  }
565
- validTransforms.length > 0 && (result.transform = validTransforms);
717
+ if (validTransforms.length > 0) {
718
+ result.transform = validTransforms;
719
+ }
566
720
  }
567
721
  return result;
568
- }, [animatedStyles, baseConfig, propertyConfigs, disableAnimation, isHydrating,
569
- // Pass SharedValues so the mapper watches them on web (see useAnimatedStyle.ts line 470-472)
570
- animatedTargetsRef, staticTargetsRef, transformTargetsRef, isExitingRef, exitCycleIdShared, markExitKeyDone]);
571
- return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.info("[animations-reanimated] useAnimations", {
572
- animationKey,
573
- componentState,
574
- isExiting,
575
- animatedStyles,
576
- staticStyles,
577
- baseConfig,
578
- propertyConfigs
579
- }), {
722
+ }, isWeb ? [animatedStyles, baseConfig, propertyConfigs, disableAnimation, isHydrating,
723
+ // pass SharedValues so the mapper watches them on web (no babel plugin)
724
+ animatedTargetsRef, staticTargetsRef, transformTargetsRef, isExitingRef, exitCycleIdShared, markExitKeyDone] : void 0);
725
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
726
+ console.info("[animations-reanimated] useAnimations", {
727
+ animationKey,
728
+ componentState,
729
+ isExiting,
730
+ animatedStyles,
731
+ staticStyles,
732
+ baseConfig,
733
+ propertyConfigs
734
+ });
735
+ }
736
+ return {
580
737
  style: [staticStyles, animatedStyle]
581
738
  };
582
739
  }