@tamagui/animations-reanimated 2.7.7 → 3.0.0-beta.643.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,1136 +1,1168 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { getEffectiveAnimation, normalizeTransition } from "@tamagui/animation-helpers";
3
- import { getSplitStyles, hooks, isWeb, Text, useComposedRefs, useEvent, useIsomorphicLayoutEffect, useThemeWithState, View } from "@tamagui/core";
3
+ import { Text, View, createRefComponent, getSplitStyles, hooks, isWeb, useComposedRefs, useEvent, useIsomorphicLayoutEffect, useThemeWithState } from "@tamagui/core";
4
4
  import { ResetPresence, usePresence } from "@tamagui/use-presence";
5
5
  import normalizeColor from "@react-native/normalize-colors";
6
- import React, { forwardRef, useMemo, useRef } from "react";
6
+ import React, { useMemo, useRef } from "react";
7
7
  import Animated_, { cancelAnimation, runOnJS, runOnUI, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withDelay, withSpring, withTiming } from "react-native-reanimated";
8
- function _type_of(obj) {
9
- "@swc/helpers - typeof";
10
8
 
11
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9
+ function _type_of(obj) {
10
+ "@swc/helpers - typeof";
11
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
12
12
  }
13
- var getDefaultExport = function (module) {
14
- var mod = module;
15
- if (mod.__esModule || mod[Symbol.toStringTag] === "Module") {
16
- return mod.default || mod;
17
- }
18
- return mod;
13
+ var getDefaultExport = function(module) {
14
+ var mod = module;
15
+ if (mod.__esModule || mod[Symbol.toStringTag] === "Module") {
16
+ return mod.default || mod;
17
+ }
18
+ return mod;
19
19
  };
20
20
  var Animated = getDefaultExport(Animated_);
21
- var silenceAnimatedComponentDevCheck = function (style) {
22
- if (process.env.NODE_ENV !== "development" || isWeb || !style || (typeof style === "undefined" ? "undefined" : _type_of(style)) !== "object") {
23
- return;
24
- }
25
- Object.defineProperty(style, "_requiresAnimatedComponent", {
26
- configurable: true,
27
- enumerable: false,
28
- value: true
29
- });
21
+ var silenceAnimatedComponentDevCheck = function(style) {
22
+ if (process.env.NODE_ENV !== "development" || isWeb || !style || (typeof style === "undefined" ? "undefined" : _type_of(style)) !== "object") {
23
+ return;
24
+ }
25
+ Object.defineProperty(style, "_requiresAnimatedComponent", {
26
+ configurable: true,
27
+ enumerable: false,
28
+ value: true
29
+ });
30
30
  };
31
- var resolveDynamicValue = function (value, isDark) {
32
- if (value !== null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "dynamic" in value && _type_of(value.dynamic) === "object") {
33
- var dynamic = value.dynamic;
34
- return isDark ? dynamic.dark : dynamic.light;
35
- }
36
- return value;
31
+ var resolveDynamicValue = function(value, isDark) {
32
+ if (value !== null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "dynamic" in value && _type_of(value.dynamic) === "object") {
33
+ var dynamic = value.dynamic;
34
+ return isDark ? dynamic.dark : dynamic.light;
35
+ }
36
+ return value;
37
37
  };
38
- var updateMapperState = isWeb ? function (state, emitted) {
39
- state.value.emitted = emitted;
40
- } : function (state, emitted) {
41
- "worklet";
42
-
43
- if (!globalThis._WORKLET) return;
44
- state.modify(function (current) {
45
- current.emitted = emitted;
46
- return current;
47
- }, false);
38
+ var updateMapperState = isWeb ? function(state, emitted) {
39
+ state.value.emitted = emitted;
40
+ } : function(state, emitted) {
41
+ "worklet";
42
+ if (!globalThis._WORKLET) return;
43
+ state.modify(function(current) {
44
+ current.emitted = emitted;
45
+ return current;
46
+ }, false);
48
47
  };
49
- var cloneAnimationValue = function (value) {
50
- if (Array.isArray(value)) {
51
- return value.map(cloneAnimationValue);
52
- }
53
- if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object") {
54
- var next = {};
55
- for (var key in value) {
56
- next[key] = cloneAnimationValue(value[key]);
57
- }
58
- return next;
59
- }
60
- return value;
48
+ var cloneAnimationValue = function(value) {
49
+ if (Array.isArray(value)) {
50
+ return value.map(cloneAnimationValue);
51
+ }
52
+ if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object") {
53
+ var next = {};
54
+ for (var key in value) {
55
+ next[key] = cloneAnimationValue(value[key]);
56
+ }
57
+ return next;
58
+ }
59
+ return value;
61
60
  };
62
- var cloneStyleRecord = function (style) {
63
- var next = {};
64
- for (var key in style) {
65
- next[key] = cloneAnimationValue(style[key]);
66
- }
67
- return next;
61
+ var cloneStyleRecord = function(style) {
62
+ var next = {};
63
+ for (var key in style) {
64
+ next[key] = cloneAnimationValue(style[key]);
65
+ }
66
+ return next;
68
67
  };
69
- var cloneTransitionConfig = function (config) {
70
- return cloneAnimationValue(config);
68
+ var cloneTransitionConfig = function(config) {
69
+ return cloneAnimationValue(config);
71
70
  };
72
- var getAnimatedTransforms = function (value) {
73
- if (!Array.isArray(value)) return [];
74
- return value.filter(function (item) {
75
- return item !== null && (typeof item === "undefined" ? "undefined" : _type_of(item)) === "object" && !Array.isArray(item);
76
- });
71
+ var getAnimatedTransforms = function(value) {
72
+ if (!Array.isArray(value)) return [];
73
+ return value.filter(function(item) {
74
+ return item !== null && (typeof item === "undefined" ? "undefined" : _type_of(item)) === "object" && !Array.isArray(item);
75
+ });
77
76
  };
78
- var getRemovedAnimatedKeys = function (current, previous) {
79
- var removedKeys = {};
80
- var _iteratorNormalCompletion = true,
81
- _didIteratorError = false,
82
- _iteratorError = void 0;
83
- try {
84
- for (var _iterator = previous[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
85
- var key = _step.value;
86
- if (!current.has(key)) removedKeys[key] = true;
87
- }
88
- } catch (err) {
89
- _didIteratorError = true;
90
- _iteratorError = err;
91
- } finally {
92
- try {
93
- if (!_iteratorNormalCompletion && _iterator.return != null) {
94
- _iterator.return();
95
- }
96
- } finally {
97
- if (_didIteratorError) {
98
- throw _iteratorError;
99
- }
100
- }
101
- }
102
- return removedKeys;
77
+ var getRemovedAnimatedKeys = function(current, previous) {
78
+ var removedKeys = {};
79
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
80
+ try {
81
+ for (var _iterator = previous[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
82
+ var key = _step.value;
83
+ if (!current.has(key)) removedKeys[key] = true;
84
+ }
85
+ } catch (err) {
86
+ _didIteratorError = true;
87
+ _iteratorError = err;
88
+ } finally {
89
+ try {
90
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
91
+ _iterator.return();
92
+ }
93
+ } finally {
94
+ if (_didIteratorError) {
95
+ throw _iteratorError;
96
+ }
97
+ }
98
+ }
99
+ return removedKeys;
103
100
  };
104
- var getImplicitDefault = function (key, targetValue) {
105
- "worklet";
106
-
107
- var value = key === "opacity" || key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
108
- if (typeof targetValue !== "string") return value;
109
- var suffixIndex = 0;
110
- while (suffixIndex < targetValue.length) {
111
- var character = targetValue[suffixIndex];
112
- var code = character.charCodeAt(0);
113
- if (code >= 48 && code <= 57 || character === "." || character === "-" || character === "+") {
114
- suffixIndex++;
115
- } else {
116
- break;
117
- }
118
- }
119
- return suffixIndex > 0 ? `${value}${targetValue.slice(suffixIndex)}` : value;
101
+ var getImplicitDefault = function(key, targetValue) {
102
+ "worklet";
103
+ var value = key === "opacity" || key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
104
+ if (typeof targetValue !== "string") return value;
105
+ var suffixIndex = 0;
106
+ while (suffixIndex < targetValue.length) {
107
+ var character = targetValue[suffixIndex];
108
+ var code = character.charCodeAt(0);
109
+ if (code >= 48 && code <= 57 || character === "." || character === "-" || character === "+") {
110
+ suffixIndex++;
111
+ } else {
112
+ break;
113
+ }
114
+ }
115
+ return suffixIndex > 0 ? `${value}${targetValue.slice(suffixIndex)}` : value;
120
116
  };
121
117
  var COLOR_STYLE_KEYS = {
122
- backgroundColor: true,
123
- borderColor: true,
124
- borderLeftColor: true,
125
- borderRightColor: true,
126
- borderTopColor: true,
127
- borderBottomColor: true,
128
- color: true
118
+ backgroundColor: true,
119
+ borderColor: true,
120
+ borderLeftColor: true,
121
+ borderRightColor: true,
122
+ borderTopColor: true,
123
+ borderBottomColor: true,
124
+ color: true
129
125
  };
130
- var toReanimatedColor = function (value) {
131
- "worklet";
132
-
133
- if (typeof value === "number") {
134
- var color = value >>> 0;
135
- var alpha = (color >>> 24 & 255) / 255;
136
- var red = color >>> 16 & 255;
137
- var green = color >>> 8 & 255;
138
- var blue = color & 255;
139
- return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
140
- }
141
- if (typeof value !== "string") return value;
142
- var trimmed = value.trim();
143
- if (trimmed === "transparent") return "rgba(0, 0, 0, 0)";
144
- return trimmed;
126
+ var toReanimatedColor = function(value) {
127
+ "worklet";
128
+ if (typeof value === "number") {
129
+ var color = value >>> 0;
130
+ var alpha = (color >>> 24 & 255) / 255;
131
+ var red = color >>> 16 & 255;
132
+ var green = color >>> 8 & 255;
133
+ var blue = color & 255;
134
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
135
+ }
136
+ if (typeof value !== "string") return value;
137
+ var trimmed = value.trim();
138
+ if (trimmed === "transparent") return "rgba(0, 0, 0, 0)";
139
+ return trimmed;
145
140
  };
146
- var isReanimatedColorHistory = function (value) {
147
- "worklet";
148
-
149
- var normalized = toReanimatedColor(value);
150
- return typeof normalized === "string" && normalized.startsWith("rgba(");
141
+ var isReanimatedColorHistory = function(value) {
142
+ "worklet";
143
+ var normalized = toReanimatedColor(value);
144
+ return typeof normalized === "string" && normalized.startsWith("rgba(");
151
145
  };
152
- var normalizeAnimationColor = function (value) {
153
- if (typeof value === "number") {
154
- return toReanimatedColor(value);
155
- }
156
- if (typeof value !== "string") return;
157
- var color = normalizeColor(value);
158
- if (color == null) return;
159
- var red = Math.round((color & 4278190080) >>> 24);
160
- var green = Math.round((color & 16711680) >>> 16);
161
- var blue = Math.round((color & 65280) >>> 8);
162
- var alpha = (color & 255) / 255;
163
- return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
146
+ var normalizeAnimationColor = function(value) {
147
+ if (typeof value === "number") {
148
+ return toReanimatedColor(value);
149
+ }
150
+ if (typeof value !== "string") return;
151
+ var color = normalizeColor(value);
152
+ if (color == null) return;
153
+ var red = Math.round((color & 4278190080) >>> 24);
154
+ var green = Math.round((color & 16711680) >>> 16);
155
+ var blue = Math.round((color & 65280) >>> 8);
156
+ var alpha = (color & 255) / 255;
157
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
164
158
  };
165
- var buildSnapshot = function (animated, statics, transforms, previousKeys, lastPainted) {
166
- var snapshotAnimated = {};
167
- var snapshotStatics = cloneStyleRecord(statics);
168
- for (var key in snapshotStatics) {
169
- if (!COLOR_STYLE_KEYS[key]) continue;
170
- var normalized = normalizeAnimationColor(snapshotStatics[key]);
171
- if (normalized !== void 0) snapshotStatics[key] = normalized;
172
- }
173
- for (var key1 in animated) {
174
- if (key1 === "transform") continue;
175
- var value = animated[key1];
176
- if (COLOR_STYLE_KEYS[key1]) {
177
- var normalized1 = normalizeAnimationColor(value);
178
- if (normalized1 === void 0) {
179
- snapshotStatics[key1] = cloneAnimationValue(value);
180
- continue;
181
- }
182
- snapshotAnimated[key1] = normalized1;
183
- } else {
184
- snapshotAnimated[key1] = cloneAnimationValue(value);
185
- }
186
- }
187
- var snapshotTransforms = transforms.map(cloneStyleRecord);
188
- var keys = new Set(Object.keys(snapshotAnimated));
189
- var _iteratorNormalCompletion = true,
190
- _didIteratorError = false,
191
- _iteratorError = void 0;
192
- try {
193
- for (var _iterator = snapshotTransforms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
194
- var transform = _step.value;
195
- var key2 = Object.keys(transform)[0];
196
- var value1 = key2 ? transform[key2] : void 0;
197
- if (key2 && (typeof value1 === "number" || typeof value1 === "string")) {
198
- keys.add(`transform:${key2}`);
199
- }
200
- }
201
- } catch (err) {
202
- _didIteratorError = true;
203
- _iteratorError = err;
204
- } finally {
205
- try {
206
- if (!_iteratorNormalCompletion && _iterator.return != null) {
207
- _iterator.return();
208
- }
209
- } finally {
210
- if (_didIteratorError) {
211
- throw _iteratorError;
212
- }
213
- }
214
- }
215
- var seeds = {};
216
- var _iteratorNormalCompletion1 = true,
217
- _didIteratorError1 = false,
218
- _iteratorError1 = void 0;
219
- try {
220
- for (var _iterator1 = keys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
221
- var key3 = _step1.value;
222
- var value2 = lastPainted[key3];
223
- if (typeof value2 !== "number" && typeof value2 !== "string") continue;
224
- if (value2 === "auto" || typeof value2 === "string" && value2.startsWith("calc")) {
225
- continue;
226
- }
227
- if (COLOR_STYLE_KEYS[key3]) value2 = normalizeAnimationColor(value2);
228
- if (value2 !== void 0) seeds[key3] = value2;
229
- }
230
- } catch (err) {
231
- _didIteratorError1 = true;
232
- _iteratorError1 = err;
233
- } finally {
234
- try {
235
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
236
- _iterator1.return();
237
- }
238
- } finally {
239
- if (_didIteratorError1) {
240
- throw _iteratorError1;
241
- }
242
- }
243
- }
244
- var gatedKeys = {};
245
- var _iteratorNormalCompletion2 = true,
246
- _didIteratorError2 = false,
247
- _iteratorError2 = void 0;
248
- try {
249
- for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
250
- var key4 = _step2.value;
251
- gatedKeys[key4] = true;
252
- }
253
- } catch (err) {
254
- _didIteratorError2 = true;
255
- _iteratorError2 = err;
256
- } finally {
257
- try {
258
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
259
- _iterator2.return();
260
- }
261
- } finally {
262
- if (_didIteratorError2) {
263
- throw _iteratorError2;
264
- }
265
- }
266
- }
267
- var removedKeys = getRemovedAnimatedKeys(keys, previousKeys);
268
- var painted = {
269
- ...snapshotStatics,
270
- ...snapshotAnimated
271
- };
272
- var staticTransforms = getAnimatedTransforms(snapshotStatics.transform);
273
- delete painted.transform;
274
- var _iteratorNormalCompletion3 = true,
275
- _didIteratorError3 = false,
276
- _iteratorError3 = void 0;
277
- try {
278
- for (var _iterator3 = staticTransforms[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
279
- var transform1 = _step3.value;
280
- var key5 = Object.keys(transform1)[0];
281
- if (key5) painted[`transform:${key5}`] = transform1[key5];
282
- }
283
- } catch (err) {
284
- _didIteratorError3 = true;
285
- _iteratorError3 = err;
286
- } finally {
287
- try {
288
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
289
- _iterator3.return();
290
- }
291
- } finally {
292
- if (_didIteratorError3) {
293
- throw _iteratorError3;
294
- }
295
- }
296
- }
297
- var _iteratorNormalCompletion4 = true,
298
- _didIteratorError4 = false,
299
- _iteratorError4 = void 0;
300
- try {
301
- for (var _iterator4 = snapshotTransforms[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
302
- var transform2 = _step4.value;
303
- var key6 = Object.keys(transform2)[0];
304
- if (key6) painted[`transform:${key6}`] = transform2[key6];
305
- }
306
- } catch (err) {
307
- _didIteratorError4 = true;
308
- _iteratorError4 = err;
309
- } finally {
310
- try {
311
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
312
- _iterator4.return();
313
- }
314
- } finally {
315
- if (_didIteratorError4) {
316
- throw _iteratorError4;
317
- }
318
- }
319
- }
320
- return {
321
- value: {
322
- animated: snapshotAnimated,
323
- statics: snapshotStatics,
324
- transforms: snapshotTransforms,
325
- gatedKeys,
326
- seeds,
327
- removedKeys,
328
- removeTransform: Object.keys(removedKeys).some(function (key7) {
329
- return key7.startsWith("transform:");
330
- }),
331
- clearValue: isWeb ? "" : null
332
- },
333
- painted,
334
- keys
335
- };
159
+ var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPainted) {
160
+ var snapshotAnimated = {};
161
+ var snapshotStatics = cloneStyleRecord(statics);
162
+ for (var key in snapshotStatics) {
163
+ if (!COLOR_STYLE_KEYS[key]) continue;
164
+ var normalized = normalizeAnimationColor(snapshotStatics[key]);
165
+ if (normalized !== void 0) snapshotStatics[key] = normalized;
166
+ }
167
+ for (var key1 in animated) {
168
+ if (key1 === "transform") continue;
169
+ var value = animated[key1];
170
+ if (COLOR_STYLE_KEYS[key1]) {
171
+ var normalized1 = normalizeAnimationColor(value);
172
+ if (normalized1 === void 0) {
173
+ snapshotStatics[key1] = cloneAnimationValue(value);
174
+ continue;
175
+ }
176
+ snapshotAnimated[key1] = normalized1;
177
+ } else {
178
+ snapshotAnimated[key1] = cloneAnimationValue(value);
179
+ }
180
+ }
181
+ var snapshotTransforms = transforms.map(cloneStyleRecord);
182
+ var keys = new Set(Object.keys(snapshotAnimated));
183
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
184
+ try {
185
+ for (var _iterator = snapshotTransforms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
186
+ var transform = _step.value;
187
+ var key2 = Object.keys(transform)[0];
188
+ var value1 = key2 ? transform[key2] : void 0;
189
+ if (key2 && (typeof value1 === "number" || typeof value1 === "string")) {
190
+ keys.add(`transform:${key2}`);
191
+ }
192
+ }
193
+ } catch (err) {
194
+ _didIteratorError = true;
195
+ _iteratorError = err;
196
+ } finally {
197
+ try {
198
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
199
+ _iterator.return();
200
+ }
201
+ } finally {
202
+ if (_didIteratorError) {
203
+ throw _iteratorError;
204
+ }
205
+ }
206
+ }
207
+ var seeds = {};
208
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
209
+ try {
210
+ for (var _iterator1 = keys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
211
+ var key3 = _step1.value;
212
+ var value2 = lastPainted[key3];
213
+ if (typeof value2 !== "number" && typeof value2 !== "string") continue;
214
+ if (value2 === "auto" || typeof value2 === "string" && value2.startsWith("calc")) {
215
+ continue;
216
+ }
217
+ if (COLOR_STYLE_KEYS[key3]) value2 = normalizeAnimationColor(value2);
218
+ if (value2 !== void 0) seeds[key3] = value2;
219
+ }
220
+ } catch (err) {
221
+ _didIteratorError1 = true;
222
+ _iteratorError1 = err;
223
+ } finally {
224
+ try {
225
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
226
+ _iterator1.return();
227
+ }
228
+ } finally {
229
+ if (_didIteratorError1) {
230
+ throw _iteratorError1;
231
+ }
232
+ }
233
+ }
234
+ var gatedKeys = {};
235
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
236
+ try {
237
+ for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
238
+ var key4 = _step2.value;
239
+ gatedKeys[key4] = true;
240
+ }
241
+ } catch (err) {
242
+ _didIteratorError2 = true;
243
+ _iteratorError2 = err;
244
+ } finally {
245
+ try {
246
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
247
+ _iterator2.return();
248
+ }
249
+ } finally {
250
+ if (_didIteratorError2) {
251
+ throw _iteratorError2;
252
+ }
253
+ }
254
+ }
255
+ var removedKeys = getRemovedAnimatedKeys(keys, previousKeys);
256
+ var painted = {
257
+ ...snapshotStatics,
258
+ ...snapshotAnimated
259
+ };
260
+ var staticTransforms = getAnimatedTransforms(snapshotStatics.transform);
261
+ delete painted.transform;
262
+ var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
263
+ try {
264
+ for (var _iterator3 = staticTransforms[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
265
+ var transform1 = _step3.value;
266
+ var key5 = Object.keys(transform1)[0];
267
+ if (key5) painted[`transform:${key5}`] = transform1[key5];
268
+ }
269
+ } catch (err) {
270
+ _didIteratorError3 = true;
271
+ _iteratorError3 = err;
272
+ } finally {
273
+ try {
274
+ if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
275
+ _iterator3.return();
276
+ }
277
+ } finally {
278
+ if (_didIteratorError3) {
279
+ throw _iteratorError3;
280
+ }
281
+ }
282
+ }
283
+ var _iteratorNormalCompletion4 = true, _didIteratorError4 = false, _iteratorError4 = void 0;
284
+ try {
285
+ for (var _iterator4 = snapshotTransforms[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
286
+ var transform2 = _step4.value;
287
+ var key6 = Object.keys(transform2)[0];
288
+ if (key6) painted[`transform:${key6}`] = transform2[key6];
289
+ }
290
+ } catch (err) {
291
+ _didIteratorError4 = true;
292
+ _iteratorError4 = err;
293
+ } finally {
294
+ try {
295
+ if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
296
+ _iterator4.return();
297
+ }
298
+ } finally {
299
+ if (_didIteratorError4) {
300
+ throw _iteratorError4;
301
+ }
302
+ }
303
+ }
304
+ return {
305
+ value: {
306
+ animated: snapshotAnimated,
307
+ statics: snapshotStatics,
308
+ transforms: snapshotTransforms,
309
+ gatedKeys,
310
+ seeds,
311
+ removedKeys,
312
+ removeTransform: Object.keys(removedKeys).some(function(key7) {
313
+ return key7.startsWith("transform:");
314
+ }),
315
+ clearValue: isWeb ? "" : null
316
+ },
317
+ painted,
318
+ keys
319
+ };
336
320
  };
337
- var getGatedKeys = function (snapshot) {
338
- return Object.keys(snapshot.gatedKeys);
321
+ var getGatedKeys = function(snapshot) {
322
+ return Object.keys(snapshot.gatedKeys);
339
323
  };
340
- var createReanimatedConfig = function (config) {
341
- "worklet";
342
-
343
- var next = {};
344
- var source = config;
345
- for (var key in source) {
346
- if (key === "type" || key === "delay") continue;
347
- var value = source[key];
348
- if (value !== void 0) {
349
- next[key] = value;
350
- }
351
- }
352
- return next;
324
+ var createReanimatedConfig = function(config) {
325
+ "worklet";
326
+ var next = {};
327
+ var source = config;
328
+ for (var key in source) {
329
+ if (key === "type" || key === "delay") continue;
330
+ var value = source[key];
331
+ if (value !== void 0) {
332
+ next[key] = value;
333
+ }
334
+ }
335
+ return next;
353
336
  };
354
- var applyAnimation = function (targetValue, config, callback, seedValue) {
355
- "worklet";
356
-
357
- var validateStartAsColor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
358
- var delay = config.delay;
359
- var reanimatedConfig = createReanimatedConfig(config);
360
- var animatedValue;
361
- if (config.type === "timing") {
362
- animatedValue = withTiming(targetValue, reanimatedConfig, callback);
363
- } else {
364
- animatedValue = withSpring(targetValue, reanimatedConfig, callback);
365
- }
366
- if (seedValue !== void 0 || validateStartAsColor) {
367
- var innerOnStart = animatedValue.onStart;
368
- animatedValue.onStart = function (animation, value, timestamp, previousAnimation) {
369
- "worklet";
370
-
371
- var startValue = validateStartAsColor ? isReanimatedColorHistory(value) ? toReanimatedColor(value) : seedValue !== null && seedValue !== void 0 ? seedValue : targetValue : seedValue;
372
- innerOnStart(animation, startValue, timestamp, previousAnimation);
373
- };
374
- }
375
- if (delay && delay > 0) {
376
- animatedValue = withDelay(delay, animatedValue);
377
- }
378
- return animatedValue;
337
+ var applyAnimation = function(targetValue, config, callback, seedValue) {
338
+ "worklet";
339
+ var validateStartAsColor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
340
+ var delay = config.delay;
341
+ var reanimatedConfig = createReanimatedConfig(config);
342
+ var animatedValue;
343
+ if (config.type === "timing") {
344
+ animatedValue = withTiming(targetValue, reanimatedConfig, callback);
345
+ } else {
346
+ animatedValue = withSpring(targetValue, reanimatedConfig, callback);
347
+ var innerOnFrame = animatedValue.onFrame;
348
+ animatedValue.onFrame = function(animation, now) {
349
+ "worklet";
350
+ return innerOnFrame(animation, now < animation.lastTimestamp ? animation.lastTimestamp : now);
351
+ };
352
+ }
353
+ if (seedValue !== void 0 || validateStartAsColor) {
354
+ var innerOnStart = animatedValue.onStart;
355
+ animatedValue.onStart = function(animation, value, timestamp, previousAnimation) {
356
+ "worklet";
357
+ var startValue = validateStartAsColor ? isReanimatedColorHistory(value) ? toReanimatedColor(value) : seedValue !== null && seedValue !== void 0 ? seedValue : targetValue : seedValue;
358
+ innerOnStart(animation, startValue, timestamp, previousAnimation);
359
+ };
360
+ }
361
+ if (delay && delay > 0) {
362
+ animatedValue = withDelay(delay, animatedValue);
363
+ }
364
+ return animatedValue;
379
365
  };
380
- var animateSnapshotValue = function (key, implicitKey, targetValue, config, previouslyEmitted, seedValue, gated, currentlyExiting, exitCycleId, currentlyCompletingAnimation, didAnimateCycleId, markExitKeyDone, markDidAnimateKeyDone) {
381
- "worklet";
382
-
383
- var validateStartAsColor = arguments.length > 13 && arguments[13] !== void 0 ? arguments[13] : false;
384
- var cycleGated = gated && (currentlyExiting || currentlyCompletingAnimation);
385
- if (!previouslyEmitted && seedValue === void 0 && !cycleGated) {
386
- return targetValue;
387
- }
388
- var callback;
389
- if (gated && currentlyExiting) {
390
- callback = function (finished) {
391
- "worklet";
392
-
393
- runOnJS(markExitKeyDone)(key, exitCycleId, finished !== null && finished !== void 0 ? finished : false);
394
- };
395
- } else if (gated && currentlyCompletingAnimation) {
396
- callback = function (finished) {
397
- "worklet";
398
-
399
- runOnJS(markDidAnimateKeyDone)(key, didAnimateCycleId, finished !== null && finished !== void 0 ? finished : false);
400
- };
401
- }
402
- return applyAnimation(targetValue, config, callback, previouslyEmitted ? void 0 : seedValue !== null && seedValue !== void 0 ? seedValue : getImplicitDefault(implicitKey, targetValue), validateStartAsColor);
366
+ var animateSnapshotValue = function(key, implicitKey, targetValue, config, previouslyEmitted, seedValue, gated, currentlyExiting, exitCycleId, currentlyCompletingEnter, enterCycleId, currentlyCompletingUpdate, updateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone) {
367
+ "worklet";
368
+ var validateStartAsColor = arguments.length > 16 && arguments[16] !== void 0 ? arguments[16] : false;
369
+ var cycleGated = gated && (currentlyExiting || currentlyCompletingEnter || currentlyCompletingUpdate);
370
+ if (!previouslyEmitted && seedValue === void 0 && !cycleGated) {
371
+ return targetValue;
372
+ }
373
+ var callback;
374
+ if (gated && currentlyExiting) {
375
+ callback = function(finished) {
376
+ "worklet";
377
+ runOnJS(markExitKeyDone)(key, exitCycleId, finished !== null && finished !== void 0 ? finished : false);
378
+ };
379
+ } else if (gated && currentlyCompletingEnter) {
380
+ callback = function() {
381
+ "worklet";
382
+ runOnJS(markEnterKeyDone)(key, enterCycleId);
383
+ };
384
+ } else if (gated && currentlyCompletingUpdate) {
385
+ callback = function(finished) {
386
+ "worklet";
387
+ runOnJS(markUpdateKeyDone)(key, updateCycleId, finished !== null && finished !== void 0 ? finished : false);
388
+ };
389
+ }
390
+ return applyAnimation(targetValue, config, callback, previouslyEmitted ? void 0 : seedValue !== null && seedValue !== void 0 ? seedValue : getImplicitDefault(implicitKey, targetValue), validateStartAsColor);
403
391
  };
404
392
  var ANIMATABLE_PROPERTIES = {
405
- // Transform
406
- transform: true,
407
- // Opacity
408
- opacity: true,
409
- // Dimensions
410
- height: true,
411
- width: true,
412
- minWidth: true,
413
- minHeight: true,
414
- maxWidth: true,
415
- maxHeight: true,
416
- // Background
417
- backgroundColor: true,
418
- // Border colors
419
- borderColor: true,
420
- borderLeftColor: true,
421
- borderRightColor: true,
422
- borderTopColor: true,
423
- borderBottomColor: true,
424
- // Border radius
425
- borderRadius: true,
426
- borderTopLeftRadius: true,
427
- borderTopRightRadius: true,
428
- borderBottomLeftRadius: true,
429
- borderBottomRightRadius: true,
430
- // Border width
431
- borderWidth: true,
432
- borderLeftWidth: true,
433
- borderRightWidth: true,
434
- borderTopWidth: true,
435
- borderBottomWidth: true,
436
- // Text
437
- color: true,
438
- fontSize: true,
439
- fontWeight: true,
440
- lineHeight: true,
441
- letterSpacing: true,
442
- // Position
443
- left: true,
444
- right: true,
445
- top: true,
446
- bottom: true,
447
- // Margin
448
- margin: true,
449
- marginTop: true,
450
- marginBottom: true,
451
- marginLeft: true,
452
- marginRight: true,
453
- marginHorizontal: true,
454
- marginVertical: true,
455
- // Padding
456
- padding: true,
457
- paddingTop: true,
458
- paddingBottom: true,
459
- paddingLeft: true,
460
- paddingRight: true,
461
- paddingHorizontal: true,
462
- paddingVertical: true,
463
- // Flex/Gap
464
- gap: true,
465
- rowGap: true,
466
- columnGap: true,
467
- flex: true,
468
- flexGrow: true,
469
- flexShrink: true
393
+ transform: true,
394
+ opacity: true,
395
+ height: true,
396
+ width: true,
397
+ minWidth: true,
398
+ minHeight: true,
399
+ maxWidth: true,
400
+ maxHeight: true,
401
+ backgroundColor: true,
402
+ borderColor: true,
403
+ borderLeftColor: true,
404
+ borderRightColor: true,
405
+ borderTopColor: true,
406
+ borderBottomColor: true,
407
+ borderRadius: true,
408
+ borderTopLeftRadius: true,
409
+ borderTopRightRadius: true,
410
+ borderBottomLeftRadius: true,
411
+ borderBottomRightRadius: true,
412
+ borderWidth: true,
413
+ borderLeftWidth: true,
414
+ borderRightWidth: true,
415
+ borderTopWidth: true,
416
+ borderBottomWidth: true,
417
+ color: true,
418
+ fontSize: true,
419
+ fontWeight: true,
420
+ lineHeight: true,
421
+ letterSpacing: true,
422
+ left: true,
423
+ right: true,
424
+ top: true,
425
+ bottom: true,
426
+ margin: true,
427
+ marginTop: true,
428
+ marginBottom: true,
429
+ marginLeft: true,
430
+ marginRight: true,
431
+ marginHorizontal: true,
432
+ marginVertical: true,
433
+ padding: true,
434
+ paddingTop: true,
435
+ paddingBottom: true,
436
+ paddingLeft: true,
437
+ paddingRight: true,
438
+ paddingHorizontal: true,
439
+ paddingVertical: true,
440
+ gap: true,
441
+ rowGap: true,
442
+ columnGap: true,
443
+ flex: true,
444
+ flexGrow: true,
445
+ flexShrink: true
470
446
  };
471
- var canAnimateProperty = function (key, value, animateOnly) {
472
- if (!ANIMATABLE_PROPERTIES[key]) return false;
473
- if (value === "auto") return false;
474
- if (typeof value === "string" && value.startsWith("calc")) return false;
475
- if (animateOnly && !animateOnly.includes(key)) return false;
476
- return true;
447
+ var canAnimateProperty = function(key, value, animateOnly) {
448
+ if (!ANIMATABLE_PROPERTIES[key]) return false;
449
+ if (value === "auto") return false;
450
+ if (typeof value === "string" && value.startsWith("calc")) return false;
451
+ if (animateOnly && !animateOnly.includes(key)) return false;
452
+ return true;
477
453
  };
478
- var splitAnimationStyles = function (style, isDark, disableAnimation, animateOnly) {
479
- var animated = {};
480
- var statics = {};
481
- for (var key in style) {
482
- var value = resolveDynamicValue(style[key], isDark);
483
- if (value === void 0) continue;
484
- if (!disableAnimation && canAnimateProperty(key, value, animateOnly)) {
485
- animated[key] = cloneAnimationValue(value);
486
- } else {
487
- statics[key] = cloneAnimationValue(value);
488
- }
489
- }
490
- return {
491
- animated,
492
- statics
493
- };
454
+ var splitAnimationStyles = function(style, isDark, disableAnimation, animateOnly) {
455
+ var animated = {};
456
+ var statics = {};
457
+ for (var key in style) {
458
+ var value = resolveDynamicValue(style[key], isDark);
459
+ if (value === void 0) continue;
460
+ if (!disableAnimation && canAnimateProperty(key, value, animateOnly)) {
461
+ animated[key] = cloneAnimationValue(value);
462
+ } else {
463
+ statics[key] = cloneAnimationValue(value);
464
+ }
465
+ }
466
+ return {
467
+ animated,
468
+ statics
469
+ };
494
470
  };
495
471
  function createWebAnimatedComponent(defaultTag) {
496
- var isText = defaultTag === "span";
497
- var Component = Animated.createAnimatedComponent(/* @__PURE__ */forwardRef(function (propsIn, ref) {
498
- var _hooks_usePropsTransform;
499
- var {
500
- forwardedRef,
501
- render = defaultTag,
502
- ...rest
503
- } = propsIn;
504
- var hostRef = useRef(null);
505
- var composedRefs = useComposedRefs(forwardedRef, ref, hostRef);
506
- var stateRef = useRef({
507
- get host() {
508
- return hostRef.current;
509
- }
510
- });
511
- var [, themeState] = useThemeWithState({});
512
- var _themeState_theme, _themeState_name;
513
- 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 : "", {
514
- unmounted: false
515
- }, {
516
- isAnimated: false,
517
- noClass: true
518
- });
519
- var _result_viewProps;
520
- var viewProps = (_result_viewProps = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _result_viewProps !== void 0 ? _result_viewProps : {};
521
- var Element = render;
522
- var transformedProps = (_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, render, viewProps, stateRef, false);
523
- return /* @__PURE__ */_jsx(Element, {
524
- ...transformedProps,
525
- ref: composedRefs
526
- });
527
- }));
528
- Component.acceptRenderProp = true;
529
- return Component;
472
+ var isText = defaultTag === "span";
473
+ var Component = Animated.createAnimatedComponent(createRefComponent(function(propsIn, ref) {
474
+ var _hooks_usePropsTransform;
475
+ var { forwardedRef, render = defaultTag, ...rest } = propsIn;
476
+ var hostRef = useRef(null);
477
+ var composedRefs = useComposedRefs(forwardedRef, ref, hostRef);
478
+ var stateRef = useRef({ get host() {
479
+ return hostRef.current;
480
+ } });
481
+ var [, themeState] = useThemeWithState({});
482
+ var _themeState_theme, _themeState_name;
483
+ 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 : "", { unmounted: false }, {
484
+ isAnimated: false,
485
+ noClass: true
486
+ });
487
+ var _result_viewProps;
488
+ var viewProps = (_result_viewProps = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _result_viewProps !== void 0 ? _result_viewProps : {};
489
+ var Element = render;
490
+ var transformedProps = (_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, render, viewProps, stateRef, false);
491
+ var { nativeID, ...webProps } = transformedProps !== null && transformedProps !== void 0 ? transformedProps : viewProps;
492
+ return /* @__PURE__ */ jsx(Element, {
493
+ ...webProps,
494
+ ref: composedRefs
495
+ });
496
+ }));
497
+ Component.acceptRenderProp = true;
498
+ return Component;
530
499
  }
531
500
  var AnimatedView = createWebAnimatedComponent("div");
532
501
  var AnimatedText = createWebAnimatedComponent("span");
533
502
  function buildTransitionConfig(transition, animations, animationState, styleKeys) {
534
- var normalized = normalizeTransition(transition);
535
- var effectiveKey = getEffectiveAnimation(normalized, animationState);
536
- var _animations_effectiveKey;
537
- var base = cloneTransitionConfig(effectiveKey ? (_animations_effectiveKey = animations[effectiveKey]) !== null && _animations_effectiveKey !== void 0 ? _animations_effectiveKey : {
538
- type: "spring"
539
- } : {
540
- type: "spring"
541
- });
542
- if (normalized.delay) {
543
- base = cloneTransitionConfig({
544
- ...base,
545
- delay: normalized.delay
546
- });
547
- }
548
- if (normalized.config) {
549
- base = cloneTransitionConfig({
550
- ...base,
551
- ...normalized.config
552
- });
553
- if (base.type !== "timing" && normalized.config.duration !== void 0 && normalized.config.damping === void 0 && normalized.config.stiffness === void 0 && normalized.config.mass === void 0) {
554
- base = cloneTransitionConfig({
555
- ...base,
556
- type: "timing"
557
- });
558
- }
559
- }
560
- var propertyConfigs = {};
561
- var _iteratorNormalCompletion = true,
562
- _didIteratorError = false,
563
- _iteratorError = void 0;
564
- try {
565
- for (var _iterator = styleKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
566
- var key = _step.value;
567
- var propAnimation = normalized.properties[key];
568
- if (typeof propAnimation === "string") {
569
- var _animations_propAnimation;
570
- propertyConfigs[key] = cloneTransitionConfig((_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : base);
571
- } else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object") {
572
- var configType = propAnimation.type;
573
- var _animations_configType;
574
- var baseForProp = configType ? (_animations_configType = animations[configType]) !== null && _animations_configType !== void 0 ? _animations_configType : base : base;
575
- propertyConfigs[key] = cloneTransitionConfig({
576
- ...baseForProp,
577
- ...propAnimation
578
- });
579
- } else {
580
- propertyConfigs[key] = cloneTransitionConfig(base);
581
- }
582
- }
583
- } catch (err) {
584
- _didIteratorError = true;
585
- _iteratorError = err;
586
- } finally {
587
- try {
588
- if (!_iteratorNormalCompletion && _iterator.return != null) {
589
- _iterator.return();
590
- }
591
- } finally {
592
- if (_didIteratorError) {
593
- throw _iteratorError;
594
- }
595
- }
596
- }
597
- return {
598
- baseConfig: base,
599
- propertyConfigs
600
- };
503
+ var normalized = normalizeTransition(transition);
504
+ var effectiveKey = getEffectiveAnimation(normalized, animationState);
505
+ var _animations_effectiveKey;
506
+ var base = cloneTransitionConfig(effectiveKey ? (_animations_effectiveKey = animations[effectiveKey]) !== null && _animations_effectiveKey !== void 0 ? _animations_effectiveKey : { type: "spring" } : { type: "spring" });
507
+ if (normalized.delay) {
508
+ base = cloneTransitionConfig({
509
+ ...base,
510
+ delay: normalized.delay
511
+ });
512
+ }
513
+ if (normalized.config) {
514
+ base = cloneTransitionConfig({
515
+ ...base,
516
+ ...normalized.config
517
+ });
518
+ if (base.type !== "timing" && normalized.config.duration !== void 0 && normalized.config.damping === void 0 && normalized.config.stiffness === void 0 && normalized.config.mass === void 0) {
519
+ base = cloneTransitionConfig({
520
+ ...base,
521
+ type: "timing"
522
+ });
523
+ }
524
+ }
525
+ var propertyConfigs = {};
526
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
527
+ try {
528
+ for (var _iterator = styleKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
529
+ var key = _step.value;
530
+ var propAnimation = normalized.properties[key];
531
+ if (typeof propAnimation === "string") {
532
+ var _animations_propAnimation;
533
+ propertyConfigs[key] = cloneTransitionConfig((_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : base);
534
+ } else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object") {
535
+ var configType = propAnimation.type;
536
+ var _animations_configType;
537
+ var baseForProp = configType ? (_animations_configType = animations[configType]) !== null && _animations_configType !== void 0 ? _animations_configType : base : base;
538
+ propertyConfigs[key] = cloneTransitionConfig({
539
+ ...baseForProp,
540
+ ...propAnimation
541
+ });
542
+ } else {
543
+ propertyConfigs[key] = cloneTransitionConfig(base);
544
+ }
545
+ }
546
+ } catch (err) {
547
+ _didIteratorError = true;
548
+ _iteratorError = err;
549
+ } finally {
550
+ try {
551
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
552
+ _iterator.return();
553
+ }
554
+ } finally {
555
+ if (_didIteratorError) {
556
+ throw _iteratorError;
557
+ }
558
+ }
559
+ }
560
+ return {
561
+ baseConfig: base,
562
+ propertyConfigs
563
+ };
601
564
  }
602
565
  function getStyleKeys(style) {
603
- var keys = new Set(Object.keys(style));
604
- if (style.transform && Array.isArray(style.transform)) {
605
- var _iteratorNormalCompletion = true,
606
- _didIteratorError = false,
607
- _iteratorError = void 0;
608
- try {
609
- for (var _iterator = style.transform[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
610
- var t = _step.value;
611
- if (t && (typeof t === "undefined" ? "undefined" : _type_of(t)) === "object") {
612
- keys.add(Object.keys(t)[0]);
613
- }
614
- }
615
- } catch (err) {
616
- _didIteratorError = true;
617
- _iteratorError = err;
618
- } finally {
619
- try {
620
- if (!_iteratorNormalCompletion && _iterator.return != null) {
621
- _iterator.return();
622
- }
623
- } finally {
624
- if (_didIteratorError) {
625
- throw _iteratorError;
626
- }
627
- }
628
- }
629
- }
630
- return keys;
566
+ var keys = new Set(Object.keys(style));
567
+ if (style.transform && Array.isArray(style.transform)) {
568
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
569
+ try {
570
+ for (var _iterator = style.transform[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
571
+ var t = _step.value;
572
+ if (t && (typeof t === "undefined" ? "undefined" : _type_of(t)) === "object") {
573
+ keys.add(Object.keys(t)[0]);
574
+ }
575
+ }
576
+ } catch (err) {
577
+ _didIteratorError = true;
578
+ _iteratorError = err;
579
+ } finally {
580
+ try {
581
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
582
+ _iterator.return();
583
+ }
584
+ } finally {
585
+ if (_didIteratorError) {
586
+ throw _iteratorError;
587
+ }
588
+ }
589
+ }
590
+ }
591
+ return keys;
631
592
  }
632
593
  function createAnimations(animationsConfig) {
633
- var animations = {};
634
- for (var key in animationsConfig) {
635
- animations[key] = cloneTransitionConfig({
636
- type: "spring",
637
- ...animationsConfig[key]
638
- });
639
- }
640
- return {
641
- needsCustomComponent: true,
642
- View: isWeb ? AnimatedView : Animated.View,
643
- Text: isWeb ? AnimatedText : Animated.Text,
644
- isReactNative: true,
645
- inputStyle: "value",
646
- outputStyle: "inline",
647
- avoidReRenders: true,
648
- animations,
649
- usePresence,
650
- ResetPresence,
651
- // =========================================================================
652
- // useAnimatedNumber - For imperative animated values
653
- // =========================================================================
654
- useAnimatedNumber(initial) {
655
- var sharedValue = useSharedValue(initial);
656
- return useMemo(function () {
657
- return {
658
- getInstance() {
659
- "worklet";
660
-
661
- return sharedValue;
662
- },
663
- getValue() {
664
- "worklet";
665
-
666
- return sharedValue.value;
667
- },
668
- setValue(next) {
669
- var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
670
- type: "spring"
671
- },
672
- onFinish = arguments.length > 2 ? arguments[2] : void 0;
673
- if (config.type === "direct") {
674
- sharedValue.value = next;
675
- onFinish === null || onFinish === void 0 ? void 0 : onFinish();
676
- } else {
677
- var cb = onFinish ? function (finished) {
678
- "worklet";
679
-
680
- if (finished !== false) {
681
- runOnJS(onFinish)();
682
- }
683
- } : void 0;
684
- var animationConfig = cloneTransitionConfig(config);
685
- if (isWeb) {
686
- sharedValue.value = applyAnimation(next, animationConfig, cb);
687
- } else {
688
- runOnUI(function (targetValue, animationConfig2) {
689
- "worklet";
690
-
691
- sharedValue.value = applyAnimation(targetValue, animationConfig2, cb);
692
- })(next, animationConfig);
693
- }
694
- }
695
- },
696
- stop() {
697
- cancelAnimation(sharedValue);
698
- }
699
- };
700
- }, [sharedValue]);
701
- },
702
- // =========================================================================
703
- // useAnimatedNumberReaction - React to animated value changes
704
- // =========================================================================
705
- useAnimatedNumberReaction(param, onValue) {
706
- var {
707
- value
708
- } = param;
709
- var instance = value.getInstance();
710
- return useAnimatedReaction(function () {
711
- return instance.value;
712
- }, function (next, prev) {
713
- if (prev !== next) {
714
- runOnJS(onValue)(next);
715
- }
716
- }, [onValue, instance]);
717
- },
718
- // =========================================================================
719
- // useAnimatedNumberStyle - Create animated styles from values
720
- // =========================================================================
721
- useAnimatedNumberStyle(val, getStyle) {
722
- var instance = val.getInstance();
723
- if (isWeb) {
724
- return useAnimatedStyle(function () {
725
- "worklet";
726
-
727
- return getStyle(instance.value);
728
- }, [instance, getStyle]);
729
- }
730
- var styleVal = useDerivedValue(function () {
731
- "worklet";
732
-
733
- return getStyle(instance.value);
734
- });
735
- var animatedStyle = useAnimatedStyle(function () {
736
- "worklet";
737
-
738
- return styleVal.value;
739
- });
740
- silenceAnimatedComponentDevCheck(animatedStyle);
741
- return animatedStyle;
742
- },
743
- useAnimatedNumbersStyle(vals, getStyle) {
744
- var instances = vals.map(function (v) {
745
- return v.getInstance();
746
- });
747
- var animatedStyle = useAnimatedStyle(function () {
748
- "worklet";
749
-
750
- var currentValues = instances.map(function (inst) {
751
- return inst.value;
752
- });
753
- return getStyle(...currentValues);
754
- }, isWeb ? [getStyle, ...instances] : void 0);
755
- silenceAnimatedComponentDevCheck(animatedStyle);
756
- return animatedStyle;
757
- },
758
- // =========================================================================
759
- // useAnimations - Main animation hook for components
760
- // =========================================================================
761
- useAnimations(animationProps) {
762
- var {
763
- props,
764
- presence,
765
- style,
766
- componentState,
767
- useStyleEmitter,
768
- themeName,
769
- stateRef,
770
- styleState,
771
- onDidAnimate
772
- } = animationProps;
773
- var isHydrating = componentState.unmounted === true;
774
- var isMounting = componentState.unmounted === "should-enter";
775
- var isEntering = !!componentState.unmounted;
776
- var isExiting = (presence === null || presence === void 0 ? void 0 : presence[0]) === false;
777
- var wasEnteringRef = useRef(isEntering);
778
- var justFinishedEntering = wasEnteringRef.current && !isEntering;
779
- React.useEffect(function () {
780
- wasEnteringRef.current = isEntering;
781
- });
782
- var _styleState_effectiveTransition;
783
- var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
784
- var normalized = normalizeTransition(effectiveTransition);
785
- var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
786
- var animationKey = getEffectiveAnimation(normalized, animationState);
787
- var disableAnimation = isHydrating || !animationKey;
788
- var isDark = (themeName === null || themeName === void 0 ? void 0 : themeName.startsWith("dark")) || false;
789
- var sendExitComplete = presence === null || presence === void 0 ? void 0 : presence[1];
790
- var onDidAnimateRef = useRef(onDidAnimate);
791
- useIsomorphicLayoutEffect(function () {
792
- onDidAnimateRef.current = onDidAnimate;
793
- }, [onDidAnimate]);
794
- var didAnimateCycleIdRef = useRef(0);
795
- var pendingDidAnimateKeysRef = useRef(/* @__PURE__ */new Set());
796
- var didAnimateCompletedRef = useRef(false);
797
- var isCompletingAnimationRef = useSharedValue(false);
798
- var didAnimateCycleIdShared = useSharedValue(0);
799
- var markDidAnimateKeyDone = useEvent(function (key2, cycleId, finished) {
800
- if (!finished || cycleId !== didAnimateCycleIdRef.current) return;
801
- if (didAnimateCompletedRef.current) return;
802
- pendingDidAnimateKeysRef.current.delete(key2);
803
- if (pendingDidAnimateKeysRef.current.size === 0) {
804
- var _onDidAnimateRef_current;
805
- didAnimateCompletedRef.current = true;
806
- isCompletingAnimationRef.value = false;
807
- (_onDidAnimateRef_current = onDidAnimateRef.current) === null || _onDidAnimateRef_current === void 0 ? void 0 : _onDidAnimateRef_current.call(onDidAnimateRef);
808
- }
809
- });
810
- var exitCycleIdRef = useRef(0);
811
- var pendingExitKeysRef = useRef(/* @__PURE__ */new Set());
812
- var exitCompletedRef = useRef(false);
813
- var wasExitingRef = useRef(false);
814
- var justStartedExiting = isExiting && !wasExitingRef.current;
815
- var justStoppedExiting = !isExiting && wasExitingRef.current;
816
- var markExitKeyDone = useEvent(function (key2, cycleId, finished) {
817
- if (cycleId !== exitCycleIdRef.current) return;
818
- if (exitCompletedRef.current) return;
819
- pendingExitKeysRef.current.delete(key2);
820
- if (pendingExitKeysRef.current.size === 0) {
821
- exitCompletedRef.current = true;
822
- sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();
823
- }
824
- });
825
- var isExitingRef = useSharedValue(isExiting);
826
- var exitCycleIdShared = useSharedValue(exitCycleIdRef.current);
827
- if (justStartedExiting) {
828
- exitCycleIdRef.current++;
829
- exitCompletedRef.current = false;
830
- pendingExitKeysRef.current.clear();
831
- didAnimateCycleIdRef.current++;
832
- pendingDidAnimateKeysRef.current.clear();
833
- didAnimateCompletedRef.current = true;
834
- }
835
- if (justStoppedExiting) {
836
- exitCycleIdRef.current++;
837
- pendingExitKeysRef.current.clear();
838
- }
839
- useIsomorphicLayoutEffect(function () {
840
- isExitingRef.value = isExiting;
841
- exitCycleIdShared.value = exitCycleIdRef.current;
842
- if (justStartedExiting) {
843
- isCompletingAnimationRef.value = false;
844
- didAnimateCycleIdShared.value = didAnimateCycleIdRef.current;
845
- }
846
- }, [isExiting, exitCycleIdRef.current, justStartedExiting]);
847
- React.useEffect(function () {
848
- wasExitingRef.current = isExiting;
849
- });
850
- var committedRenderKeysRef = useRef(/* @__PURE__ */new Set());
851
- var lastPaintedRef = useRef({});
852
- var carryRef = useRef({});
853
- var {
854
- animatedStyles,
855
- staticStyles,
856
- nextCarry
857
- } = useMemo(function () {
858
- var animateOnly = props.animateOnly;
859
- var {
860
- animated,
861
- statics
862
- } = splitAnimationStyles(style, isDark, disableAnimation, animateOnly);
863
- var nextCarry2 = cloneStyleRecord(carryRef.current);
864
- for (var key2 in nextCarry2) {
865
- if (!(key2 in animated)) delete nextCarry2[key2];
866
- }
867
- for (var key1 in animated) {
868
- if (!(key1 in nextCarry2)) {
869
- nextCarry2[key1] = cloneAnimationValue(animated[key1]);
870
- }
871
- statics[key1] = nextCarry2[key1];
872
- }
873
- return {
874
- animatedStyles: animated,
875
- staticStyles: statics,
876
- nextCarry: nextCarry2
877
- };
878
- }, [disableAnimation, style, isDark, props.animateOnly]);
879
- var renderSnapshot = useMemo(function () {
880
- return buildSnapshot(animatedStyles, staticStyles, getAnimatedTransforms(animatedStyles.transform), committedRenderKeysRef.current, lastPaintedRef.current);
881
- }, [animatedStyles, staticStyles]);
882
- var renderSnapshotRef = useSharedValue({
883
- animated: {},
884
- statics: {},
885
- transforms: [],
886
- gatedKeys: {},
887
- seeds: {},
888
- removedKeys: {},
889
- removeTransform: false,
890
- clearValue: isWeb ? "" : null
891
- });
892
- var emitterSnapshotRef = useSharedValue(null);
893
- var emitterKeysRef = useRef(null);
894
- useIsomorphicLayoutEffect(function () {
895
- carryRef.current = nextCarry;
896
- committedRenderKeysRef.current = renderSnapshot.keys;
897
- lastPaintedRef.current = renderSnapshot.painted;
898
- }, [nextCarry, renderSnapshot]);
899
- var pseudoActiveRef = useRef(false);
900
- var isExitingJSRef = useRef(false);
901
- isExitingJSRef.current = isExiting;
902
- var publishedSnapshotRef = useRef(null);
903
- useIsomorphicLayoutEffect(function () {
904
- var droppingLatch = (isExiting || !pseudoActiveRef.current) && emitterSnapshotRef.value !== null;
905
- var emitterKeys = droppingLatch ? emitterKeysRef.current : null;
906
- if (droppingLatch || publishedSnapshotRef.current !== renderSnapshot.value) {
907
- var removedKeys = emitterKeys ? {
908
- ...renderSnapshot.value.removedKeys,
909
- ...getRemovedAnimatedKeys(renderSnapshot.keys, emitterKeys)
910
- } : renderSnapshot.value.removedKeys;
911
- renderSnapshotRef.value = {
912
- ...renderSnapshot.value,
913
- removedKeys,
914
- removeTransform: Object.keys(removedKeys).some(function (key2) {
915
- return key2.startsWith("transform:");
916
- })
917
- };
918
- publishedSnapshotRef.current = renderSnapshot.value;
919
- }
920
- if (droppingLatch) {
921
- emitterSnapshotRef.value = null;
922
- emitterKeysRef.current = null;
923
- }
924
- });
925
- var {
926
- baseConfig,
927
- propertyConfigs
928
- } = useMemo(function () {
929
- if (isHydrating) {
930
- return {
931
- baseConfig: {
932
- type: "timing",
933
- duration: 0
934
- },
935
- propertyConfigs: {}
936
- };
937
- }
938
- return buildTransitionConfig(effectiveTransition, animations, animationState, getStyleKeys(animatedStyles));
939
- }, [isHydrating, effectiveTransition, animatedStyles, animationState]);
940
- var configRef = useSharedValue({
941
- baseConfig,
942
- propertyConfigs,
943
- disableAnimation,
944
- isHydrating
945
- });
946
- useIsomorphicLayoutEffect(function () {
947
- configRef.value = {
948
- baseConfig,
949
- propertyConfigs,
950
- disableAnimation,
951
- isHydrating
952
- };
953
- }, [baseConfig, propertyConfigs, disableAnimation, isHydrating]);
954
- useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function (nextStyle, effectiveTransition2, pseudoActive) {
955
- if (isExitingJSRef.current) return;
956
- pseudoActiveRef.current = pseudoActive === true;
957
- var animateOnly = props.animateOnly;
958
- var transitionToUse = effectiveTransition2 !== null && effectiveTransition2 !== void 0 ? effectiveTransition2 : props.transition;
959
- var {
960
- baseConfig: newBase,
961
- propertyConfigs: newPropertyConfigs
962
- } = buildTransitionConfig(transitionToUse, animations, animationState, getStyleKeys(nextStyle));
963
- configRef.value = {
964
- baseConfig: newBase,
965
- propertyConfigs: newPropertyConfigs,
966
- disableAnimation: configRef.value.disableAnimation,
967
- isHydrating: configRef.value.isHydrating
968
- };
969
- var _emitterKeysRef_current;
970
- var previousKeys = (_emitterKeysRef_current = emitterKeysRef.current) !== null && _emitterKeysRef_current !== void 0 ? _emitterKeysRef_current : committedRenderKeysRef.current;
971
- var {
972
- animated,
973
- statics
974
- } = splitAnimationStyles(nextStyle, isDark, configRef.value.disableAnimation, animateOnly);
975
- var snapshot = buildSnapshot(animated, statics, getAnimatedTransforms(animated.transform), previousKeys, lastPaintedRef.current);
976
- emitterSnapshotRef.value = snapshot.value;
977
- emitterKeysRef.current = snapshot.keys;
978
- lastPaintedRef.current = snapshot.painted;
979
- if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
980
- console.info("[animations-reanimated] useStyleEmitter update", {
981
- animated,
982
- statics,
983
- transforms: snapshot.value.transforms
984
- });
985
- }
986
- });
987
- var exitKeysRegistered = useRef(false);
988
- if (justStartedExiting && sendExitComplete) {
989
- var exitKeys = getGatedKeys(renderSnapshot.value);
990
- pendingExitKeysRef.current = new Set(exitKeys);
991
- exitKeysRegistered.current = exitKeys.length > 0;
992
- }
993
- var previousDidAnimateStyleRef = useRef(null);
994
- var didAnimateStyle = onDidAnimate ? JSON.stringify(style) : null;
995
- var previousDidAnimateStyle = previousDidAnimateStyleRef.current;
996
- var shouldRegisterDidAnimate = didAnimateStyle !== null && previousDidAnimateStyle !== null && previousDidAnimateStyle !== didAnimateStyle && !isExiting && !isEntering && !justFinishedEntering;
997
- var didAnimateKeys = shouldRegisterDidAnimate ? getGatedKeys(renderSnapshot.value) : [];
998
- useIsomorphicLayoutEffect(function () {
999
- if (didAnimateStyle === null) {
1000
- previousDidAnimateStyleRef.current = null;
1001
- isCompletingAnimationRef.value = false;
1002
- return;
1003
- }
1004
- var previousStyleStillCurrent = previousDidAnimateStyleRef.current === previousDidAnimateStyle;
1005
- previousDidAnimateStyleRef.current = didAnimateStyle;
1006
- if (!shouldRegisterDidAnimate || !previousStyleStillCurrent) return;
1007
- var cycleId = ++didAnimateCycleIdRef.current;
1008
- pendingDidAnimateKeysRef.current = new Set(didAnimateKeys);
1009
- didAnimateCompletedRef.current = didAnimateKeys.length === 0;
1010
- isCompletingAnimationRef.value = didAnimateKeys.length > 0;
1011
- didAnimateCycleIdShared.value = cycleId;
1012
- if (didAnimateKeys.length === 0) {
1013
- var _onDidAnimateRef_current;
1014
- (_onDidAnimateRef_current = onDidAnimateRef.current) === null || _onDidAnimateRef_current === void 0 ? void 0 : _onDidAnimateRef_current.call(onDidAnimateRef);
1015
- }
1016
- }, [didAnimateStyle, shouldRegisterDidAnimate]);
1017
- React.useEffect(function () {
1018
- if (!justStartedExiting || !sendExitComplete) return;
1019
- if (!exitKeysRegistered.current && pendingExitKeysRef.current.size === 0) {
1020
- if (!exitCompletedRef.current) {
1021
- exitCompletedRef.current = true;
1022
- sendExitComplete();
1023
- }
1024
- }
1025
- }, [justStartedExiting, sendExitComplete]);
1026
- var mapperStateRef = useSharedValue({
1027
- emitted: {}
1028
- });
1029
- var animatedStyle = useAnimatedStyle(function () {
1030
- "worklet";
1031
-
1032
- var mapperState = mapperStateRef.value;
1033
- var config = configRef.value;
1034
- if (config.disableAnimation || config.isHydrating) {
1035
- updateMapperState(mapperStateRef, {});
1036
- return {};
1037
- }
1038
- var previouslyEmitted = mapperState.emitted;
1039
- var emitted = {};
1040
- var result = {};
1041
- var emitterSnapshot = emitterSnapshotRef.value;
1042
- var snapshot = emitterSnapshot !== null && emitterSnapshot !== void 0 ? emitterSnapshot : renderSnapshotRef.value;
1043
- var animatedValues = snapshot.animated;
1044
- var staticValues = snapshot.statics;
1045
- var currentlyExiting = isExitingRef.value;
1046
- var currentCycleId = exitCycleIdShared.value;
1047
- var currentlyCompletingAnimation = isCompletingAnimationRef.value;
1048
- var currentDidAnimateCycleId = didAnimateCycleIdShared.value;
1049
- for (var key2 in staticValues) {
1050
- result[key2] = staticValues[key2];
1051
- }
1052
- for (var key1 in snapshot.removedKeys) {
1053
- if (!key1.startsWith("transform:") && !(key1 in staticValues)) {
1054
- result[key1] = snapshot.clearValue;
1055
- }
1056
- }
1057
- for (var key22 in animatedValues) {
1058
- if (key22 === "transform") continue;
1059
- var targetValue = animatedValues[key22];
1060
- emitted[key22] = true;
1061
- if (typeof targetValue !== "number" && typeof targetValue !== "string") {
1062
- result[key22] = targetValue;
1063
- continue;
1064
- }
1065
- var _config_propertyConfigs_key;
1066
- result[key22] = animateSnapshotValue(key22, key22, targetValue, (_config_propertyConfigs_key = config.propertyConfigs[key22]) !== null && _config_propertyConfigs_key !== void 0 ? _config_propertyConfigs_key : config.baseConfig, !!previouslyEmitted[key22], snapshot.seeds[key22], !!snapshot.gatedKeys[key22], currentlyExiting, currentCycleId, currentlyCompletingAnimation, currentDidAnimateCycleId, markExitKeyDone, markDidAnimateKeyDone, !!COLOR_STYLE_KEYS[key22]);
1067
- }
1068
- var transforms = snapshot.transforms;
1069
- if (transforms.length > 0 || snapshot.removeTransform) {
1070
- var validTransforms = [];
1071
- var _iteratorNormalCompletion = true,
1072
- _didIteratorError = false,
1073
- _iteratorError = void 0;
1074
- try {
1075
- for (var _iterator = transforms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1076
- var t = _step.value;
1077
- if (!t) continue;
1078
- var keys = Object.keys(t);
1079
- if (keys.length === 0) continue;
1080
- var transformKey = keys[0];
1081
- var value = t[transformKey];
1082
- if (typeof value === "number" || typeof value === "string") {
1083
- var _config_propertyConfigs_transformKey;
1084
- var propConfig = (_config_propertyConfigs_transformKey = config.propertyConfigs[transformKey]) !== null && _config_propertyConfigs_transformKey !== void 0 ? _config_propertyConfigs_transformKey : config.baseConfig;
1085
- var subKey = `transform:${transformKey}`;
1086
- emitted[subKey] = true;
1087
- validTransforms.push({
1088
- [transformKey]: animateSnapshotValue(subKey, transformKey, value, propConfig, !!previouslyEmitted[subKey], snapshot.seeds[subKey], !!snapshot.gatedKeys[subKey], currentlyExiting, currentCycleId, currentlyCompletingAnimation, currentDidAnimateCycleId, markExitKeyDone, markDidAnimateKeyDone)
1089
- });
1090
- } else {
1091
- validTransforms.push(t);
1092
- }
1093
- }
1094
- } catch (err) {
1095
- _didIteratorError = true;
1096
- _iteratorError = err;
1097
- } finally {
1098
- try {
1099
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1100
- _iterator.return();
1101
- }
1102
- } finally {
1103
- if (_didIteratorError) {
1104
- throw _iteratorError;
1105
- }
1106
- }
1107
- }
1108
- if (validTransforms.length > 0 || !("transform" in staticValues)) {
1109
- result.transform = validTransforms;
1110
- }
1111
- }
1112
- updateMapperState(mapperStateRef, emitted);
1113
- return result;
1114
- }, isWeb ? [
1115
- // pass SharedValues so the stable mapper watches them on web (no babel plugin)
1116
- renderSnapshotRef, emitterSnapshotRef, configRef, isExitingRef, exitCycleIdShared, markExitKeyDone, isCompletingAnimationRef, didAnimateCycleIdShared, markDidAnimateKeyDone] : void 0);
1117
- silenceAnimatedComponentDevCheck(animatedStyle);
1118
- if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
1119
- console.info("[animations-reanimated] useAnimations", {
1120
- animationKey,
1121
- componentState,
1122
- isExiting,
1123
- animatedStyles,
1124
- staticStyles,
1125
- baseConfig,
1126
- propertyConfigs
1127
- });
1128
- }
1129
- return {
1130
- style: [staticStyles, animatedStyle]
1131
- };
1132
- }
1133
- };
594
+ var animations = {};
595
+ for (var key in animationsConfig) {
596
+ animations[key] = cloneTransitionConfig({
597
+ type: "spring",
598
+ ...animationsConfig[key]
599
+ });
600
+ }
601
+ return {
602
+ needsCustomComponent: true,
603
+ View: isWeb ? AnimatedView : Animated.View,
604
+ Text: isWeb ? AnimatedText : Animated.Text,
605
+ isReactNative: true,
606
+ inputStyle: "value",
607
+ outputStyle: "inline",
608
+ avoidReRenders: true,
609
+ animations,
610
+ usePresence,
611
+ ResetPresence,
612
+ useAnimatedNumber(initial) {
613
+ var sharedValue = useSharedValue(initial);
614
+ return useMemo(function() {
615
+ return {
616
+ getInstance() {
617
+ "worklet";
618
+ return sharedValue;
619
+ },
620
+ getValue() {
621
+ "worklet";
622
+ return sharedValue.value;
623
+ },
624
+ setValue(next) {
625
+ var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { type: "spring" }, onFinish = arguments.length > 2 ? arguments[2] : void 0;
626
+ if (config.type === "direct") {
627
+ sharedValue.value = next;
628
+ onFinish === null || onFinish === void 0 ? void 0 : onFinish();
629
+ } else {
630
+ var cb = onFinish ? function(finished) {
631
+ "worklet";
632
+ if (finished !== false) {
633
+ runOnJS(onFinish)();
634
+ }
635
+ } : void 0;
636
+ var animationConfig = cloneTransitionConfig(config);
637
+ if (isWeb) {
638
+ sharedValue.value = applyAnimation(next, animationConfig, cb);
639
+ } else {
640
+ runOnUI(function(targetValue, animationConfig2) {
641
+ "worklet";
642
+ sharedValue.value = applyAnimation(targetValue, animationConfig2, cb);
643
+ })(next, animationConfig);
644
+ }
645
+ }
646
+ },
647
+ stop() {
648
+ cancelAnimation(sharedValue);
649
+ }
650
+ };
651
+ }, [sharedValue]);
652
+ },
653
+ useAnimatedNumberReaction(param, onValue) {
654
+ var { value } = param;
655
+ var instance = value.getInstance();
656
+ return useAnimatedReaction(function() {
657
+ return instance.value;
658
+ }, function(next, prev) {
659
+ if (prev !== next) {
660
+ runOnJS(onValue)(next);
661
+ }
662
+ }, [onValue, instance]);
663
+ },
664
+ useAnimatedNumberStyle(val, getStyle) {
665
+ var instance = val.getInstance();
666
+ if (isWeb) {
667
+ return useAnimatedStyle(function() {
668
+ "worklet";
669
+ return getStyle(instance.value);
670
+ }, [instance, getStyle]);
671
+ }
672
+ var styleVal = useDerivedValue(function() {
673
+ "worklet";
674
+ return getStyle(instance.value);
675
+ });
676
+ var animatedStyle = useAnimatedStyle(function() {
677
+ "worklet";
678
+ return styleVal.value;
679
+ });
680
+ silenceAnimatedComponentDevCheck(animatedStyle);
681
+ return animatedStyle;
682
+ },
683
+ useAnimatedNumbersStyle(vals, getStyle) {
684
+ var instances = vals.map(function(v) {
685
+ return v.getInstance();
686
+ });
687
+ var animatedStyle = useAnimatedStyle(function() {
688
+ "worklet";
689
+ var currentValues = instances.map(function(inst) {
690
+ return inst.value;
691
+ });
692
+ return getStyle(...currentValues);
693
+ }, isWeb ? [getStyle, ...instances] : void 0);
694
+ silenceAnimatedComponentDevCheck(animatedStyle);
695
+ return animatedStyle;
696
+ },
697
+ useAnimations(animationProps) {
698
+ var { props, presence, style, componentState, useStyleEmitter, themeName, stateRef, styleState, onTransition } = animationProps;
699
+ var isHydrating = componentState.unmounted === true;
700
+ var isMounting = componentState.unmounted === "should-enter";
701
+ var isEntering = !!componentState.unmounted;
702
+ var isExiting = (presence === null || presence === void 0 ? void 0 : presence[0]) === false;
703
+ var wasEnteringRef = useRef(isEntering);
704
+ var justFinishedEntering = wasEnteringRef.current && !isEntering;
705
+ React.useEffect(function() {
706
+ wasEnteringRef.current = isEntering;
707
+ });
708
+ var _styleState_effectiveTransition;
709
+ var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
710
+ var normalized = normalizeTransition(effectiveTransition);
711
+ var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
712
+ var animationKey = getEffectiveAnimation(normalized, animationState);
713
+ var disableAnimation = isHydrating || !animationKey;
714
+ var isDark = (themeName === null || themeName === void 0 ? void 0 : themeName.startsWith("dark")) || false;
715
+ var sendExitComplete = presence === null || presence === void 0 ? void 0 : presence[1];
716
+ var onTransitionRef = useRef(onTransition);
717
+ onTransitionRef.current = onTransition;
718
+ var emit = function(phase, cause, finished) {
719
+ var _onTransitionRef_current;
720
+ (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === "end" ? {
721
+ phase,
722
+ cause,
723
+ finished
724
+ } : {
725
+ phase,
726
+ cause
727
+ });
728
+ };
729
+ var enterStartedRef = useRef(false);
730
+ var exitStartedRef = useRef(false);
731
+ var updateStartedRef = useRef(false);
732
+ var isExitingJSRef = useRef(false);
733
+ isExitingJSRef.current = isExiting;
734
+ var updateCycleIdRef = useRef(0);
735
+ var pendingUpdateKeysRef = useRef(/* @__PURE__ */ new Set());
736
+ var updateCompletedRef = useRef(false);
737
+ var isCompletingUpdateRef = useSharedValue(false);
738
+ var updateCycleIdShared = useSharedValue(0);
739
+ var markUpdateKeyDone = useEvent(function(key2, cycleId, finished) {
740
+ if (!finished || cycleId !== updateCycleIdRef.current) return;
741
+ if (updateCompletedRef.current) return;
742
+ pendingUpdateKeysRef.current.delete(key2);
743
+ if (pendingUpdateKeysRef.current.size === 0) {
744
+ updateCompletedRef.current = true;
745
+ isCompletingUpdateRef.value = false;
746
+ if (updateStartedRef.current) {
747
+ updateStartedRef.current = false;
748
+ emit("end", "update", true);
749
+ }
750
+ }
751
+ });
752
+ var exitCycleIdRef = useRef(0);
753
+ var pendingExitKeysRef = useRef(/* @__PURE__ */ new Set());
754
+ var exitCompletedRef = useRef(false);
755
+ var wasExitingRef = useRef(false);
756
+ var justStartedExiting = isExiting && !wasExitingRef.current;
757
+ var justStoppedExiting = !isExiting && wasExitingRef.current;
758
+ var markExitKeyDone = useEvent(function(key2, cycleId, finished) {
759
+ if (cycleId !== exitCycleIdRef.current) return;
760
+ if (exitCompletedRef.current) return;
761
+ pendingExitKeysRef.current.delete(key2);
762
+ if (pendingExitKeysRef.current.size === 0) {
763
+ exitCompletedRef.current = true;
764
+ if (exitStartedRef.current) {
765
+ exitStartedRef.current = false;
766
+ emit("end", "exit", true);
767
+ }
768
+ sendExitComplete === null || sendExitComplete === void 0 ? void 0 : sendExitComplete();
769
+ }
770
+ });
771
+ var enterCycleIdRef = useRef(0);
772
+ var pendingEnterKeysRef = useRef(/* @__PURE__ */ new Set());
773
+ var enterCompletedRef = useRef(false);
774
+ var markEnterKeyDone = useEvent(function(key2, cycleId) {
775
+ if (cycleId !== enterCycleIdRef.current) return;
776
+ if (enterCompletedRef.current) return;
777
+ if (isExitingJSRef.current) return;
778
+ pendingEnterKeysRef.current.delete(key2);
779
+ if (pendingEnterKeysRef.current.size === 0) {
780
+ enterCompletedRef.current = true;
781
+ if (enterStartedRef.current) {
782
+ enterStartedRef.current = false;
783
+ emit("end", "enter", true);
784
+ }
785
+ }
786
+ });
787
+ var isExitingRef = useSharedValue(isExiting);
788
+ var exitCycleIdShared = useSharedValue(exitCycleIdRef.current);
789
+ var isCompletingEnterRef = useSharedValue(false);
790
+ var enterCycleIdShared = useSharedValue(enterCycleIdRef.current);
791
+ if (justStartedExiting) {
792
+ exitCycleIdRef.current++;
793
+ exitCompletedRef.current = false;
794
+ pendingExitKeysRef.current.clear();
795
+ enterCycleIdRef.current++;
796
+ pendingEnterKeysRef.current.clear();
797
+ updateCycleIdRef.current++;
798
+ pendingUpdateKeysRef.current.clear();
799
+ updateCompletedRef.current = true;
800
+ }
801
+ if (justStoppedExiting) {
802
+ exitCycleIdRef.current++;
803
+ pendingExitKeysRef.current.clear();
804
+ }
805
+ useIsomorphicLayoutEffect(function() {
806
+ isExitingRef.value = isExiting;
807
+ exitCycleIdShared.value = exitCycleIdRef.current;
808
+ isCompletingEnterRef.value = !isExiting && justFinishedEntering && Boolean(onTransitionRef.current);
809
+ enterCycleIdShared.value = enterCycleIdRef.current;
810
+ if (justStartedExiting) {
811
+ isCompletingUpdateRef.value = false;
812
+ updateCycleIdShared.value = updateCycleIdRef.current;
813
+ }
814
+ }, [
815
+ isExiting,
816
+ justFinishedEntering,
817
+ exitCycleIdRef.current,
818
+ enterCycleIdRef.current,
819
+ justStartedExiting
820
+ ]);
821
+ useIsomorphicLayoutEffect(function() {
822
+ if (justStoppedExiting && exitStartedRef.current && !exitCompletedRef.current) {
823
+ exitStartedRef.current = false;
824
+ emit("end", "exit", false);
825
+ }
826
+ }, [justStoppedExiting]);
827
+ React.useEffect(function() {
828
+ wasExitingRef.current = isExiting;
829
+ });
830
+ var committedRenderKeysRef = useRef(/* @__PURE__ */ new Set());
831
+ var lastPaintedRef = useRef({});
832
+ var carryRef = useRef({});
833
+ var { animatedStyles, staticStyles, nextCarry } = useMemo(function() {
834
+ var animateOnly = props.animateOnly;
835
+ var { animated, statics } = splitAnimationStyles(style, isDark, disableAnimation, animateOnly);
836
+ var nextCarry2 = cloneStyleRecord(carryRef.current);
837
+ for (var key2 in nextCarry2) {
838
+ if (!(key2 in animated)) delete nextCarry2[key2];
839
+ }
840
+ for (var key1 in animated) {
841
+ if (!(key1 in nextCarry2)) {
842
+ nextCarry2[key1] = cloneAnimationValue(animated[key1]);
843
+ }
844
+ statics[key1] = nextCarry2[key1];
845
+ }
846
+ return {
847
+ animatedStyles: animated,
848
+ staticStyles: statics,
849
+ nextCarry: nextCarry2
850
+ };
851
+ }, [
852
+ disableAnimation,
853
+ style,
854
+ isDark,
855
+ props.animateOnly
856
+ ]);
857
+ var renderSnapshot = useMemo(function() {
858
+ return buildSnapshot(animatedStyles, staticStyles, getAnimatedTransforms(animatedStyles.transform), committedRenderKeysRef.current, lastPaintedRef.current);
859
+ }, [animatedStyles, staticStyles]);
860
+ var renderSnapshotRef = useSharedValue({
861
+ animated: {},
862
+ statics: {},
863
+ transforms: [],
864
+ gatedKeys: {},
865
+ seeds: {},
866
+ removedKeys: {},
867
+ removeTransform: false,
868
+ clearValue: isWeb ? "" : null
869
+ });
870
+ var emitterSnapshotRef = useSharedValue(null);
871
+ var emitterKeysRef = useRef(null);
872
+ useIsomorphicLayoutEffect(function() {
873
+ carryRef.current = nextCarry;
874
+ committedRenderKeysRef.current = renderSnapshot.keys;
875
+ lastPaintedRef.current = renderSnapshot.painted;
876
+ }, [nextCarry, renderSnapshot]);
877
+ var pseudoActiveRef = useRef(false);
878
+ var publishedSnapshotRef = useRef(null);
879
+ useIsomorphicLayoutEffect(function() {
880
+ var renderChanged = publishedSnapshotRef.current !== renderSnapshot.value;
881
+ var droppingLatch = (isExiting || !pseudoActiveRef.current && publishedSnapshotRef.current !== null && renderChanged) && emitterSnapshotRef.value !== null;
882
+ var emitterKeys = droppingLatch ? emitterKeysRef.current : null;
883
+ if (droppingLatch || renderChanged) {
884
+ var removedKeys = emitterKeys ? {
885
+ ...renderSnapshot.value.removedKeys,
886
+ ...getRemovedAnimatedKeys(renderSnapshot.keys, emitterKeys)
887
+ } : renderSnapshot.value.removedKeys;
888
+ renderSnapshotRef.value = {
889
+ ...renderSnapshot.value,
890
+ removedKeys,
891
+ removeTransform: Object.keys(removedKeys).some(function(key2) {
892
+ return key2.startsWith("transform:");
893
+ })
894
+ };
895
+ publishedSnapshotRef.current = renderSnapshot.value;
896
+ }
897
+ if (droppingLatch) {
898
+ emitterSnapshotRef.value = null;
899
+ emitterKeysRef.current = null;
900
+ }
901
+ });
902
+ var { baseConfig, propertyConfigs } = useMemo(function() {
903
+ if (isHydrating) {
904
+ return {
905
+ baseConfig: {
906
+ type: "timing",
907
+ duration: 0
908
+ },
909
+ propertyConfigs: {}
910
+ };
911
+ }
912
+ return buildTransitionConfig(effectiveTransition, animations, animationState, getStyleKeys(animatedStyles));
913
+ }, [
914
+ isHydrating,
915
+ effectiveTransition,
916
+ animatedStyles,
917
+ animationState
918
+ ]);
919
+ var configRef = useSharedValue({
920
+ baseConfig,
921
+ propertyConfigs,
922
+ disableAnimation,
923
+ isHydrating
924
+ });
925
+ useIsomorphicLayoutEffect(function() {
926
+ configRef.value = {
927
+ baseConfig,
928
+ propertyConfigs,
929
+ disableAnimation,
930
+ isHydrating
931
+ };
932
+ }, [
933
+ baseConfig,
934
+ propertyConfigs,
935
+ disableAnimation,
936
+ isHydrating
937
+ ]);
938
+ useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, effectiveTransition2, pseudoActive) {
939
+ if (isExitingJSRef.current) return;
940
+ pseudoActiveRef.current = pseudoActive === true;
941
+ var animateOnly = props.animateOnly;
942
+ var transitionToUse = effectiveTransition2 !== null && effectiveTransition2 !== void 0 ? effectiveTransition2 : props.transition;
943
+ var { baseConfig: newBase, propertyConfigs: newPropertyConfigs } = buildTransitionConfig(transitionToUse, animations, animationState, getStyleKeys(nextStyle));
944
+ configRef.value = {
945
+ baseConfig: newBase,
946
+ propertyConfigs: newPropertyConfigs,
947
+ disableAnimation: configRef.value.disableAnimation,
948
+ isHydrating: configRef.value.isHydrating
949
+ };
950
+ var _emitterKeysRef_current;
951
+ var previousKeys = (_emitterKeysRef_current = emitterKeysRef.current) !== null && _emitterKeysRef_current !== void 0 ? _emitterKeysRef_current : committedRenderKeysRef.current;
952
+ var { animated, statics } = splitAnimationStyles(nextStyle, isDark, configRef.value.disableAnimation, animateOnly);
953
+ var snapshot = buildSnapshot(animated, statics, getAnimatedTransforms(animated.transform), previousKeys, lastPaintedRef.current);
954
+ emitterSnapshotRef.value = snapshot.value;
955
+ emitterKeysRef.current = snapshot.keys;
956
+ lastPaintedRef.current = snapshot.painted;
957
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
958
+ console.info("[animations-reanimated] useStyleEmitter update", {
959
+ animated,
960
+ statics,
961
+ transforms: snapshot.value.transforms
962
+ });
963
+ }
964
+ });
965
+ var exitKeysRegistered = useRef(false);
966
+ var enterKeysRegistered = useRef(false);
967
+ if (!isExiting && justFinishedEntering && onTransition) {
968
+ var enterKeys = getGatedKeys(renderSnapshot.value);
969
+ enterCycleIdRef.current++;
970
+ enterCompletedRef.current = false;
971
+ pendingEnterKeysRef.current = new Set(enterKeys);
972
+ enterKeysRegistered.current = enterKeys.length > 0;
973
+ }
974
+ if (justStartedExiting && sendExitComplete) {
975
+ var exitKeys = getGatedKeys(renderSnapshot.value);
976
+ pendingExitKeysRef.current = new Set(exitKeys);
977
+ exitKeysRegistered.current = exitKeys.length > 0;
978
+ }
979
+ var previousUpdateStyleRef = useRef(null);
980
+ var updateStyle = onTransition ? JSON.stringify(style) : null;
981
+ var previousUpdateStyle = previousUpdateStyleRef.current;
982
+ var shouldRegisterUpdate = updateStyle !== null && previousUpdateStyle !== null && previousUpdateStyle !== updateStyle && !isExiting && !isEntering && !justFinishedEntering;
983
+ var updateKeys = shouldRegisterUpdate ? getGatedKeys(renderSnapshot.value) : [];
984
+ useIsomorphicLayoutEffect(function() {
985
+ if (updateStyle === null) {
986
+ previousUpdateStyleRef.current = null;
987
+ isCompletingUpdateRef.value = false;
988
+ return;
989
+ }
990
+ var previousStyleStillCurrent = previousUpdateStyleRef.current === previousUpdateStyle;
991
+ previousUpdateStyleRef.current = updateStyle;
992
+ if (!shouldRegisterUpdate || !previousStyleStillCurrent) return;
993
+ var cycleId = ++updateCycleIdRef.current;
994
+ pendingUpdateKeysRef.current = new Set(updateKeys);
995
+ updateCompletedRef.current = updateKeys.length === 0;
996
+ isCompletingUpdateRef.value = updateKeys.length > 0;
997
+ updateCycleIdShared.value = cycleId;
998
+ if (updateStartedRef.current) {
999
+ emit("end", "update", false);
1000
+ }
1001
+ updateStartedRef.current = true;
1002
+ emit("start", "update");
1003
+ if (updateKeys.length === 0) {
1004
+ updateStartedRef.current = false;
1005
+ emit("end", "update", true);
1006
+ }
1007
+ }, [updateStyle, shouldRegisterUpdate]);
1008
+ React.useEffect(function() {
1009
+ if (!justStartedExiting || !sendExitComplete) return;
1010
+ if (enterStartedRef.current) {
1011
+ enterStartedRef.current = false;
1012
+ emit("end", "enter", false);
1013
+ }
1014
+ if (updateStartedRef.current) {
1015
+ updateStartedRef.current = false;
1016
+ emit("end", "update", false);
1017
+ }
1018
+ if (onTransitionRef.current && !exitStartedRef.current) {
1019
+ exitStartedRef.current = true;
1020
+ emit("start", "exit");
1021
+ }
1022
+ if (!exitKeysRegistered.current && pendingExitKeysRef.current.size === 0) {
1023
+ if (!exitCompletedRef.current) {
1024
+ exitCompletedRef.current = true;
1025
+ if (exitStartedRef.current) {
1026
+ exitStartedRef.current = false;
1027
+ emit("end", "exit", true);
1028
+ }
1029
+ sendExitComplete();
1030
+ }
1031
+ }
1032
+ }, [justStartedExiting, sendExitComplete]);
1033
+ React.useEffect(function() {
1034
+ if (isExiting || !justFinishedEntering || !onTransition) return;
1035
+ if (!enterStartedRef.current) {
1036
+ enterStartedRef.current = true;
1037
+ emit("start", "enter");
1038
+ }
1039
+ if (!enterKeysRegistered.current && pendingEnterKeysRef.current.size === 0) {
1040
+ if (!enterCompletedRef.current) {
1041
+ enterCompletedRef.current = true;
1042
+ if (enterStartedRef.current) {
1043
+ enterStartedRef.current = false;
1044
+ emit("end", "enter", true);
1045
+ }
1046
+ }
1047
+ }
1048
+ }, [
1049
+ isExiting,
1050
+ justFinishedEntering,
1051
+ onTransition
1052
+ ]);
1053
+ var mapperStateRef = useSharedValue({ emitted: {} });
1054
+ var animatedStyle = useAnimatedStyle(function() {
1055
+ "worklet";
1056
+ var mapperState = mapperStateRef.value;
1057
+ var config = configRef.value;
1058
+ if (config.disableAnimation || config.isHydrating) {
1059
+ updateMapperState(mapperStateRef, {});
1060
+ return {};
1061
+ }
1062
+ var previouslyEmitted = mapperState.emitted;
1063
+ var emitted = {};
1064
+ var result = {};
1065
+ var emitterSnapshot = emitterSnapshotRef.value;
1066
+ var snapshot = emitterSnapshot !== null && emitterSnapshot !== void 0 ? emitterSnapshot : renderSnapshotRef.value;
1067
+ var animatedValues = snapshot.animated;
1068
+ var staticValues = snapshot.statics;
1069
+ var currentlyExiting = isExitingRef.value;
1070
+ var currentCycleId = exitCycleIdShared.value;
1071
+ var currentlyCompletingEnter = isCompletingEnterRef.value;
1072
+ var currentEnterCycleId = enterCycleIdShared.value;
1073
+ var currentlyCompletingUpdate = isCompletingUpdateRef.value;
1074
+ var currentUpdateCycleId = updateCycleIdShared.value;
1075
+ for (var key2 in staticValues) {
1076
+ result[key2] = staticValues[key2];
1077
+ }
1078
+ for (var key1 in snapshot.removedKeys) {
1079
+ if (!key1.startsWith("transform:") && !(key1 in staticValues)) {
1080
+ result[key1] = snapshot.clearValue;
1081
+ }
1082
+ }
1083
+ for (var key22 in animatedValues) {
1084
+ if (key22 === "transform") continue;
1085
+ var targetValue = animatedValues[key22];
1086
+ emitted[key22] = true;
1087
+ if (typeof targetValue !== "number" && typeof targetValue !== "string") {
1088
+ result[key22] = targetValue;
1089
+ continue;
1090
+ }
1091
+ var _config_propertyConfigs_key;
1092
+ result[key22] = animateSnapshotValue(key22, key22, targetValue, (_config_propertyConfigs_key = config.propertyConfigs[key22]) !== null && _config_propertyConfigs_key !== void 0 ? _config_propertyConfigs_key : config.baseConfig, !!previouslyEmitted[key22], snapshot.seeds[key22], !!snapshot.gatedKeys[key22], currentlyExiting, currentCycleId, currentlyCompletingEnter, currentEnterCycleId, currentlyCompletingUpdate, currentUpdateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone, !!COLOR_STYLE_KEYS[key22]);
1093
+ }
1094
+ var transforms = snapshot.transforms;
1095
+ if (transforms.length > 0 || snapshot.removeTransform) {
1096
+ var validTransforms = [];
1097
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1098
+ try {
1099
+ for (var _iterator = transforms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1100
+ var t = _step.value;
1101
+ if (!t) continue;
1102
+ var keys = Object.keys(t);
1103
+ if (keys.length === 0) continue;
1104
+ var transformKey = keys[0];
1105
+ var value = t[transformKey];
1106
+ if (typeof value === "number" || typeof value === "string") {
1107
+ var _config_propertyConfigs_transformKey;
1108
+ var propConfig = (_config_propertyConfigs_transformKey = config.propertyConfigs[transformKey]) !== null && _config_propertyConfigs_transformKey !== void 0 ? _config_propertyConfigs_transformKey : config.baseConfig;
1109
+ var subKey = `transform:${transformKey}`;
1110
+ emitted[subKey] = true;
1111
+ validTransforms.push({ [transformKey]: animateSnapshotValue(subKey, transformKey, value, propConfig, !!previouslyEmitted[subKey], snapshot.seeds[subKey], !!snapshot.gatedKeys[subKey], currentlyExiting, currentCycleId, currentlyCompletingEnter, currentEnterCycleId, currentlyCompletingUpdate, currentUpdateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone) });
1112
+ } else {
1113
+ validTransforms.push(t);
1114
+ }
1115
+ }
1116
+ } catch (err) {
1117
+ _didIteratorError = true;
1118
+ _iteratorError = err;
1119
+ } finally {
1120
+ try {
1121
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1122
+ _iterator.return();
1123
+ }
1124
+ } finally {
1125
+ if (_didIteratorError) {
1126
+ throw _iteratorError;
1127
+ }
1128
+ }
1129
+ }
1130
+ if (validTransforms.length > 0 || !("transform" in staticValues)) {
1131
+ result.transform = validTransforms;
1132
+ }
1133
+ }
1134
+ updateMapperState(mapperStateRef, emitted);
1135
+ return result;
1136
+ }, isWeb ? [
1137
+ renderSnapshotRef,
1138
+ emitterSnapshotRef,
1139
+ configRef,
1140
+ isExitingRef,
1141
+ exitCycleIdShared,
1142
+ markExitKeyDone,
1143
+ isCompletingEnterRef,
1144
+ enterCycleIdShared,
1145
+ markEnterKeyDone,
1146
+ isCompletingUpdateRef,
1147
+ updateCycleIdShared,
1148
+ markUpdateKeyDone
1149
+ ] : void 0);
1150
+ silenceAnimatedComponentDevCheck(animatedStyle);
1151
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
1152
+ console.info("[animations-reanimated] useAnimations", {
1153
+ animationKey,
1154
+ componentState,
1155
+ isExiting,
1156
+ animatedStyles,
1157
+ staticStyles,
1158
+ baseConfig,
1159
+ propertyConfigs
1160
+ });
1161
+ }
1162
+ return { style: [staticStyles, animatedStyle] };
1163
+ }
1164
+ };
1134
1165
  }
1166
+
1135
1167
  export { createAnimations };
1136
1168
  //# sourceMappingURL=createAnimations.native.js.map