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