@tamagui/animations-react-native 1.110.4 → 1.111.0
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.native.js +92 -184
- package/dist/cjs/createAnimations.native.js.map +2 -2
- package/dist/esm/createAnimations.native.js +94 -185
- package/dist/esm/createAnimations.native.js.map +2 -2
- package/dist/esm/createAnimations.native.mjs +327 -0
- package/dist/esm/createAnimations.native.mjs.map +1 -0
- package/dist/esm/index.native.js +1 -1
- package/dist/esm/index.native.mjs +2 -0
- package/dist/esm/index.native.mjs.map +1 -0
- package/dist/esm/polyfill.native.mjs +2 -0
- package/dist/esm/polyfill.native.mjs.map +1 -0
- package/package.json +5 -5
|
@@ -31,112 +31,7 @@ __export(createAnimations_exports, {
|
|
|
31
31
|
useAnimatedNumberStyle: () => useAnimatedNumberStyle
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(createAnimations_exports);
|
|
34
|
-
var import_react = __toESM(require("react")), import_use_presence = require("@tamagui/use-presence"), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react_native = require("react-native")
|
|
35
|
-
function _array_like_to_array(arr, len) {
|
|
36
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
37
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
38
|
-
return arr2;
|
|
39
|
-
}
|
|
40
|
-
function _array_with_holes(arr) {
|
|
41
|
-
if (Array.isArray(arr)) return arr;
|
|
42
|
-
}
|
|
43
|
-
function _array_without_holes(arr) {
|
|
44
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
45
|
-
}
|
|
46
|
-
function _define_property(obj, key, value) {
|
|
47
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
48
|
-
value,
|
|
49
|
-
enumerable: !0,
|
|
50
|
-
configurable: !0,
|
|
51
|
-
writable: !0
|
|
52
|
-
}) : obj[key] = value, obj;
|
|
53
|
-
}
|
|
54
|
-
function _iterable_to_array(iter) {
|
|
55
|
-
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
56
|
-
}
|
|
57
|
-
function _iterable_to_array_limit(arr, i) {
|
|
58
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
59
|
-
if (_i != null) {
|
|
60
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
61
|
-
try {
|
|
62
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
63
|
-
;
|
|
64
|
-
} catch (err) {
|
|
65
|
-
_d = !0, _e = err;
|
|
66
|
-
} finally {
|
|
67
|
-
try {
|
|
68
|
-
!_n && _i.return != null && _i.return();
|
|
69
|
-
} finally {
|
|
70
|
-
if (_d) throw _e;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return _arr;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function _non_iterable_rest() {
|
|
77
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
78
|
-
}
|
|
79
|
-
function _non_iterable_spread() {
|
|
80
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
81
|
-
}
|
|
82
|
-
function _object_spread(target) {
|
|
83
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
84
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
85
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
86
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
87
|
-
}))), ownKeys2.forEach(function(key) {
|
|
88
|
-
_define_property(target, key, source[key]);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
return target;
|
|
92
|
-
}
|
|
93
|
-
function ownKeys(object, enumerableOnly) {
|
|
94
|
-
var keys = Object.keys(object);
|
|
95
|
-
if (Object.getOwnPropertySymbols) {
|
|
96
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
97
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
98
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
99
|
-
})), keys.push.apply(keys, symbols);
|
|
100
|
-
}
|
|
101
|
-
return keys;
|
|
102
|
-
}
|
|
103
|
-
function _object_spread_props(target, source) {
|
|
104
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
105
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
106
|
-
}), target;
|
|
107
|
-
}
|
|
108
|
-
function _object_without_properties(source, excluded) {
|
|
109
|
-
if (source == null) return {};
|
|
110
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
111
|
-
if (Object.getOwnPropertySymbols) {
|
|
112
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
113
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
114
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
115
|
-
}
|
|
116
|
-
return target;
|
|
117
|
-
}
|
|
118
|
-
function _object_without_properties_loose(source, excluded) {
|
|
119
|
-
if (source == null) return {};
|
|
120
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
121
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
122
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
123
|
-
return target;
|
|
124
|
-
}
|
|
125
|
-
function _sliced_to_array(arr, i) {
|
|
126
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
127
|
-
}
|
|
128
|
-
function _to_consumable_array(arr) {
|
|
129
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
130
|
-
}
|
|
131
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
132
|
-
if (o) {
|
|
133
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
134
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
135
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
136
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
var animatedStyleKey = {
|
|
34
|
+
var import_react = __toESM(require("react")), import_use_presence = require("@tamagui/use-presence"), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react_native = require("react-native"), animatedStyleKey = {
|
|
140
35
|
transform: !0,
|
|
141
36
|
opacity: !0
|
|
142
37
|
}, colorStyleKey = {
|
|
@@ -147,7 +42,7 @@ var animatedStyleKey = {
|
|
|
147
42
|
borderRightColor: !0,
|
|
148
43
|
borderTopColor: !0,
|
|
149
44
|
borderBottomColor: !0
|
|
150
|
-
}, costlyToAnimateStyleKey =
|
|
45
|
+
}, costlyToAnimateStyleKey = {
|
|
151
46
|
borderRadius: !0,
|
|
152
47
|
borderTopLeftRadius: !0,
|
|
153
48
|
borderTopRightRadius: !0,
|
|
@@ -157,8 +52,9 @@ var animatedStyleKey = {
|
|
|
157
52
|
borderLeftWidth: !0,
|
|
158
53
|
borderRightWidth: !0,
|
|
159
54
|
borderTopWidth: !0,
|
|
160
|
-
borderBottomWidth: !0
|
|
161
|
-
|
|
55
|
+
borderBottomWidth: !0,
|
|
56
|
+
...colorStyleKey
|
|
57
|
+
}, AnimatedView = import_react_native.Animated.View, AnimatedText = import_react_native.Animated.Text;
|
|
162
58
|
function useAnimatedNumber(initial) {
|
|
163
59
|
var state = import_react.default.useRef(null);
|
|
164
60
|
return state.current || (state.current = {
|
|
@@ -168,23 +64,21 @@ function useAnimatedNumber(initial) {
|
|
|
168
64
|
type: "spring"
|
|
169
65
|
}
|
|
170
66
|
}), {
|
|
171
|
-
getInstance
|
|
67
|
+
getInstance() {
|
|
172
68
|
return state.current.val;
|
|
173
69
|
},
|
|
174
|
-
getValue
|
|
70
|
+
getValue() {
|
|
175
71
|
return state.current.val._value;
|
|
176
72
|
},
|
|
177
|
-
stop
|
|
73
|
+
stop() {
|
|
178
74
|
var _state_current_composite;
|
|
179
75
|
(_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 || _state_current_composite.stop(), state.current.composite = null;
|
|
180
76
|
},
|
|
181
|
-
setValue
|
|
182
|
-
var
|
|
77
|
+
setValue(next) {
|
|
78
|
+
var { type, ...config } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
183
79
|
type: "spring"
|
|
184
|
-
}, onFinish = arguments.length > 2 ? arguments[2] : void 0,
|
|
185
|
-
|
|
186
|
-
]), val = state.current.val, handleFinish = onFinish ? function(param) {
|
|
187
|
-
var finished = param.finished;
|
|
80
|
+
}, onFinish = arguments.length > 2 ? arguments[2] : void 0, val = state.current.val, handleFinish = onFinish ? function(param) {
|
|
81
|
+
var { finished } = param;
|
|
188
82
|
return finished ? onFinish() : null;
|
|
189
83
|
} : void 0;
|
|
190
84
|
if (type === "direct")
|
|
@@ -192,25 +86,27 @@ function useAnimatedNumber(initial) {
|
|
|
192
86
|
else if (type === "spring") {
|
|
193
87
|
var _state_current_composite;
|
|
194
88
|
(_state_current_composite = state.current.composite) === null || _state_current_composite === void 0 || _state_current_composite.stop();
|
|
195
|
-
var composite = import_react_native.Animated.spring(val,
|
|
89
|
+
var composite = import_react_native.Animated.spring(val, {
|
|
90
|
+
...config,
|
|
196
91
|
toValue: next,
|
|
197
92
|
useNativeDriver: !import_constants.isWeb
|
|
198
|
-
})
|
|
93
|
+
});
|
|
199
94
|
composite.start(handleFinish), state.current.composite = composite;
|
|
200
95
|
} else {
|
|
201
96
|
var _state_current_composite1;
|
|
202
97
|
(_state_current_composite1 = state.current.composite) === null || _state_current_composite1 === void 0 || _state_current_composite1.stop();
|
|
203
|
-
var composite1 = import_react_native.Animated.timing(val,
|
|
98
|
+
var composite1 = import_react_native.Animated.timing(val, {
|
|
99
|
+
...config,
|
|
204
100
|
toValue: next,
|
|
205
101
|
useNativeDriver: !import_constants.isWeb
|
|
206
|
-
})
|
|
102
|
+
});
|
|
207
103
|
composite1.start(handleFinish), state.current.composite = composite1;
|
|
208
104
|
}
|
|
209
105
|
}
|
|
210
106
|
};
|
|
211
107
|
}
|
|
212
108
|
function useAnimatedNumberReaction(param, onValue) {
|
|
213
|
-
var value = param
|
|
109
|
+
var { value } = param, onChange = (0, import_web.useEvent)(function(current) {
|
|
214
110
|
onValue(current.value);
|
|
215
111
|
});
|
|
216
112
|
import_react.default.useEffect(function() {
|
|
@@ -238,7 +134,7 @@ function createAnimations(animations) {
|
|
|
238
134
|
usePresence: import_use_presence.usePresence,
|
|
239
135
|
ResetPresence: import_use_presence.ResetPresence,
|
|
240
136
|
useAnimations: function(param) {
|
|
241
|
-
var
|
|
137
|
+
var { props, onDidAnimate, style, componentState, presence } = param, isExiting = (presence == null ? void 0 : presence[0]) === !1, sendExitComplete = presence == null ? void 0 : presence[1], animateStyles = import_react.default.useRef({}), animatedTranforms = import_react.default.useRef([]), animationsState = import_react.default.useRef(/* @__PURE__ */ new WeakMap()), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [
|
|
242
138
|
JSON.stringify(style),
|
|
243
139
|
componentState,
|
|
244
140
|
isExiting,
|
|
@@ -248,51 +144,7 @@ function createAnimations(animations) {
|
|
|
248
144
|
return animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key];
|
|
249
145
|
});
|
|
250
146
|
}, args), res = import_react.default.useMemo(function() {
|
|
251
|
-
var
|
|
252
|
-
var isColorStyleKey = colorStyleKey[key2], _ref = _sliced_to_array(isColorStyleKey ? [
|
|
253
|
-
0,
|
|
254
|
-
void 0
|
|
255
|
-
] : getValue(valIn), 2), val2 = _ref[0], type = _ref[1], animateToValue = val2, value = animated || new import_react_native.Animated.Value(val2), curInterpolation = animationsState.current.get(value), interpolateArgs;
|
|
256
|
-
if (type) {
|
|
257
|
-
var _curInterpolation_current;
|
|
258
|
-
interpolateArgs = getInterpolated((_curInterpolation_current = curInterpolation == null ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value._value, val2, type), animationsState.current.set(value, {
|
|
259
|
-
interpolation: value.interpolate(interpolateArgs),
|
|
260
|
-
current: val2
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
if (isColorStyleKey && (animateToValue = curInterpolation != null && curInterpolation.animateToValue ? 0 : 1, interpolateArgs = getColorInterpolated(
|
|
264
|
-
curInterpolation == null ? void 0 : curInterpolation.current,
|
|
265
|
-
// valIn is the next color
|
|
266
|
-
valIn,
|
|
267
|
-
animateToValue
|
|
268
|
-
), animationsState.current.set(value, {
|
|
269
|
-
current: valIn,
|
|
270
|
-
interpolation: value.interpolate(interpolateArgs),
|
|
271
|
-
animateToValue: curInterpolation != null && curInterpolation.animateToValue ? 0 : 1
|
|
272
|
-
})), value) {
|
|
273
|
-
var animationConfig = getAnimationConfig(key2, animations, props.animation), resolve, promise = new Promise(function(res2) {
|
|
274
|
-
resolve = res2;
|
|
275
|
-
});
|
|
276
|
-
completions.push(promise), runners.push(function() {
|
|
277
|
-
var getAnimation = function() {
|
|
278
|
-
return import_react_native.Animated[animationConfig.type || "spring"](value, _object_spread({
|
|
279
|
-
toValue: animateToValue,
|
|
280
|
-
useNativeDriver: !import_constants.isWeb && !isThereNoNativeStyleKeys
|
|
281
|
-
}, animationConfig));
|
|
282
|
-
};
|
|
283
|
-
value.stopAnimation();
|
|
284
|
-
var animation = animationConfig.delay ? import_react_native.Animated.sequence([
|
|
285
|
-
import_react_native.Animated.delay(animationConfig.delay),
|
|
286
|
-
getAnimation()
|
|
287
|
-
]) : getAnimation();
|
|
288
|
-
animation.start(function(param2) {
|
|
289
|
-
var finished = param2.finished;
|
|
290
|
-
finished && resolve();
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
return process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F4A0} animate", key2, "from (".concat(value._value, ") to"), valIn, "(".concat(val2, ")"), "type", type, "interpolate", interpolateArgs), value;
|
|
295
|
-
}, runners = [], completions = [], nonAnimatedStyle = {};
|
|
147
|
+
var runners = [], completions = [], nonAnimatedStyle = {};
|
|
296
148
|
for (var key in style) {
|
|
297
149
|
var val = style[key];
|
|
298
150
|
if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key]) {
|
|
@@ -315,10 +167,14 @@ function createAnimations(animations) {
|
|
|
315
167
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
316
168
|
try {
|
|
317
169
|
for (var _iterator = val.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
318
|
-
var
|
|
170
|
+
var [index, transform] = _step.value, _animatedTranforms_current_index;
|
|
319
171
|
if (transform) {
|
|
320
172
|
var tkey = Object.keys(transform)[0], currentTransform = (_animatedTranforms_current_index = animatedTranforms.current[index]) === null || _animatedTranforms_current_index === void 0 ? void 0 : _animatedTranforms_current_index[tkey];
|
|
321
|
-
animatedTranforms.current[index] =
|
|
173
|
+
animatedTranforms.current[index] = {
|
|
174
|
+
[tkey]: update(tkey, currentTransform, transform[tkey])
|
|
175
|
+
}, animatedTranforms.current = [
|
|
176
|
+
...animatedTranforms.current
|
|
177
|
+
];
|
|
322
178
|
}
|
|
323
179
|
}
|
|
324
180
|
} catch (err) {
|
|
@@ -333,18 +189,21 @@ function createAnimations(animations) {
|
|
|
333
189
|
}
|
|
334
190
|
}
|
|
335
191
|
}
|
|
336
|
-
var animatedStyle =
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
192
|
+
var animatedStyle = {
|
|
193
|
+
...Object.fromEntries(Object.entries(animateStyles.current).map(function(param2) {
|
|
194
|
+
var [k, v] = param2, _animationsState_current_get;
|
|
195
|
+
return [
|
|
196
|
+
k,
|
|
197
|
+
((_animationsState_current_get = animationsState.current.get(v)) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || v
|
|
198
|
+
];
|
|
199
|
+
})),
|
|
343
200
|
transform: animatedTranforms.current.map(function(r) {
|
|
344
201
|
var _animationsState_current_get, key2 = Object.keys(r)[0], val2 = ((_animationsState_current_get = animationsState.current.get(r[key2])) === null || _animationsState_current_get === void 0 ? void 0 : _animationsState_current_get.interpolation) || r[key2];
|
|
345
|
-
return
|
|
202
|
+
return {
|
|
203
|
+
[key2]: val2
|
|
204
|
+
};
|
|
346
205
|
})
|
|
347
|
-
}
|
|
206
|
+
};
|
|
348
207
|
return {
|
|
349
208
|
runners,
|
|
350
209
|
completions,
|
|
@@ -353,6 +212,52 @@ function createAnimations(animations) {
|
|
|
353
212
|
animatedStyle
|
|
354
213
|
]
|
|
355
214
|
};
|
|
215
|
+
function update(key2, animated, valIn) {
|
|
216
|
+
var isColorStyleKey = colorStyleKey[key2], [val2, type] = isColorStyleKey ? [
|
|
217
|
+
0,
|
|
218
|
+
void 0
|
|
219
|
+
] : getValue(valIn), animateToValue = val2, value = animated || new import_react_native.Animated.Value(val2), curInterpolation = animationsState.current.get(value), interpolateArgs;
|
|
220
|
+
if (type) {
|
|
221
|
+
var _curInterpolation_current;
|
|
222
|
+
interpolateArgs = getInterpolated((_curInterpolation_current = curInterpolation == null ? void 0 : curInterpolation.current) !== null && _curInterpolation_current !== void 0 ? _curInterpolation_current : value._value, val2, type), animationsState.current.set(value, {
|
|
223
|
+
interpolation: value.interpolate(interpolateArgs),
|
|
224
|
+
current: val2
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (isColorStyleKey && (animateToValue = curInterpolation != null && curInterpolation.animateToValue ? 0 : 1, interpolateArgs = getColorInterpolated(
|
|
228
|
+
curInterpolation == null ? void 0 : curInterpolation.current,
|
|
229
|
+
// valIn is the next color
|
|
230
|
+
valIn,
|
|
231
|
+
animateToValue
|
|
232
|
+
), animationsState.current.set(value, {
|
|
233
|
+
current: valIn,
|
|
234
|
+
interpolation: value.interpolate(interpolateArgs),
|
|
235
|
+
animateToValue: curInterpolation != null && curInterpolation.animateToValue ? 0 : 1
|
|
236
|
+
})), value) {
|
|
237
|
+
var animationConfig = getAnimationConfig(key2, animations, props.animation), resolve, promise = new Promise(function(res2) {
|
|
238
|
+
resolve = res2;
|
|
239
|
+
});
|
|
240
|
+
completions.push(promise), runners.push(function() {
|
|
241
|
+
value.stopAnimation();
|
|
242
|
+
function getAnimation() {
|
|
243
|
+
return import_react_native.Animated[animationConfig.type || "spring"](value, {
|
|
244
|
+
toValue: animateToValue,
|
|
245
|
+
useNativeDriver: !import_constants.isWeb && !isThereNoNativeStyleKeys,
|
|
246
|
+
...animationConfig
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
var animation = animationConfig.delay ? import_react_native.Animated.sequence([
|
|
250
|
+
import_react_native.Animated.delay(animationConfig.delay),
|
|
251
|
+
getAnimation()
|
|
252
|
+
]) : getAnimation();
|
|
253
|
+
animation.start(function(param2) {
|
|
254
|
+
var { finished } = param2;
|
|
255
|
+
finished && resolve();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F4A0} animate", key2, `from (${value._value}) to`, valIn, `(${val2})`, "type", type, "interpolate", interpolateArgs), value;
|
|
260
|
+
}
|
|
356
261
|
}, args);
|
|
357
262
|
return (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
358
263
|
res.runners.forEach(function(r) {
|
|
@@ -392,8 +297,8 @@ function getInterpolated(current, next) {
|
|
|
392
297
|
current,
|
|
393
298
|
next
|
|
394
299
|
], outputRange = [
|
|
395
|
-
|
|
396
|
-
|
|
300
|
+
`${current}${postfix}`,
|
|
301
|
+
`${next}${postfix}`
|
|
397
302
|
];
|
|
398
303
|
return next < current && (inputRange.reverse(), outputRange.reverse()), {
|
|
399
304
|
inputRange,
|
|
@@ -414,7 +319,10 @@ function getAnimationConfig(key, animations, animation) {
|
|
|
414
319
|
type = val == null ? void 0 : val.type, extraConf = val;
|
|
415
320
|
}
|
|
416
321
|
var found = animations[type];
|
|
417
|
-
return
|
|
322
|
+
return {
|
|
323
|
+
...found,
|
|
324
|
+
...extraConf
|
|
325
|
+
};
|
|
418
326
|
}
|
|
419
327
|
var transformShorthands = {
|
|
420
328
|
x: "translateX",
|
|
@@ -428,7 +336,7 @@ function getValue(input) {
|
|
|
428
336
|
return [
|
|
429
337
|
input
|
|
430
338
|
];
|
|
431
|
-
var _input_match,
|
|
339
|
+
var _input_match, [_, number, after] = (_input_match = input.match(/([-0-9]+)(deg|%|px)/)) !== null && _input_match !== void 0 ? _input_match : [];
|
|
432
340
|
return [
|
|
433
341
|
+number,
|
|
434
342
|
after
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/core/animations-react-native/src/createAnimations.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["animatedStyleKey", "transform", "opacity", "colorStyleKey", "backgroundColor", "color", "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor", "costlyToAnimateStyleKey", "borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth", "AnimatedView", "Animated", "View", "AnimatedText", "Text", "useAnimatedNumber", "initial", "state", "React", "useRef", "current", "composite", "val", "Value", "strategy", "type", "getInstance", "getValue", "stop", "setValue", "next", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;mBAAkB,2BAClB,sBAA2C,kCAC3C,mBAAiD,+BAOjD,aAAyB,yBAEzB,sBAAyB,yBAwBnBA,mBAAmB;EACvBC,WAAW;EACXC,SAAS;AACX,GAEMC,gBAAgB;EACpBC,iBAAiB;EACjBC,OAAO;EACPC,aAAa;EACbC,iBAAiB;EACjBC,kBAAkB;EAClBC,gBAAgB;EAChBC,mBAAmB;AACrB,GAGMC,0BAA0B;EAC9BC,cAAc;EACdC,qBAAqB;EACrBC,sBAAsB;EACtBC,wBAAwB;EACxBC,yBAAyB;EACzBC,aAAa;EACbC,iBAAiB;EACjBC,kBAAkB;EAClBC,gBAAgB;EAChBC,mBAAmB;EACnB,GAAGlB;AAEL,GAEamB,eAAeC,6BAASC,MACxBC,eAAeF,6BAASG;AAE9B,SAASC,kBACdC,SAAe;AAEf,MAAMC,QAAQC,aAAAA,QAAMC,OAClB,IAAA;AAMF,SAAKF,MAAMG,YACTH,MAAMG,UAAU;IACdC,WAAW;IACXC,KAAK,IAAIX,6BAASY,MAAMP,OAAAA;IACxBQ,UAAU;MAAEC,MAAM;IAAS;EAC7B,IAGK;IACLC,cAAAA;AACE,aAAOT,MAAMG,QAAQE;IACvB;IACAK,WAAAA;AACE,aAAOV,MAAMG,QAAQE,IAAI;IAC3B;IACAM,OAAAA;UACEX;OAAAA,2BAAAA,MAAMG,QAAQC,eAAS,QAAvBJ,6BAAAA,UAAAA,yBAAyBW,KAAI,GAC7BX,MAAMG,QAAQC,YAAY;IAC5B;IACAQ,SAASC,MAAY;UAAE,EAAEL,MAAM,GAAGM,OAAAA,IA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CAAA,OAAE,QAAZA,iBAAAA,SAAAA,SAAAA,aAAe2B,QAAAA;AACnD,IAAII,SACE,OAAOA,QAAS,WAClB1H,OAAO0H,QAEP1H,OAAQ0H,KAAa1H,QAAQA,MAC7BqH,YAAYK;EAGlB,OAAO;QACO/B,gBAAN9F,OAAM8F,iBAAAA,aAAAA,OAAAA,SAAAA,UAAYpC,GAAAA,OAAI,QAAhBoC,mBAAAA,SAAAA,iBAAoBA,aAAAA,OAAAA,SAAAA,UAAY2B,QAAAA;AAC5CtH,WAAOH,OAAAA,OAAAA,SAAAA,IAAKG,MACZqH,YAAYxH;EACd;AACA,MAAM8H,QAAQ9F,WAAW7B,IAAAA;AACzB,SAAO;IACL,GAAG2H;IACH,GAAGN;EACL;AACF;AAGA,IAAME,sBAAsB;EAC1BK,GAAG;EACHC,GAAG;EACHC,YAAY;EACZC,YAAY;AACd;AAEA,SAAS7H,SAAS8H,OAAsB;MAAEC,UAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAU;AAClD,MAAI,OAAOD,SAAU;AACnB,WAAO;MAACA;;MAEiBA,cAArB,CAACE,GAAGC,QAAQC,KAAAA,KAASJ,eAAAA,MAAMK,MAAM,qBAAA,OAAA,QAAZL,iBAAAA,SAAAA,eAAsC,CAAA;AACjE,SAAO;IAAC,CAACG;IAAQC;;AACnB;",
|
|
5
|
+
"names": ["animatedStyleKey", "transform", "opacity", "colorStyleKey", "backgroundColor", "color", "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor", "costlyToAnimateStyleKey", "borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth", "AnimatedView", "Animated", "View", "AnimatedText", "Text", "useAnimatedNumber", "initial", "state", "React", "useRef", "current", "composite", "val", "Value", "strategy", "type", "getInstance", "getValue", "stop", "setValue", "next", "config", "onFinish", "handleFinish", "finished", "undefined", "spring", "toValue", "useNativeDriver", "isWeb", "start", "timing", "useAnimatedNumberReaction", "onValue", "value", "onChange", "useEvent", "useEffect", "id", "addListener", "removeListener", "useAnimatedNumberStyle", "getStyle", "createAnimations", "animations", "isReactNative", "usePresence", "ResetPresence", "useAnimations", "props", "onDidAnimate", "style", "componentState", "presence", "isExiting", "sendExitComplete", "animateStyles", "animatedTranforms", "animationsState", "WeakMap", "animateOnly", "hasAnimateOnly", "args", "JSON", "stringify", "isThereNoNativeStyleKeys", "useMemo", "Object", "keys", "some", "key", "length", "indexOf", "res", "runners", "completions", "nonAnimatedStyle", "includes", "update", "console", "warn", "entries", "index", "tkey", "currentTransform", "animatedStyle", "fromEntries", "map", "param", "k", "v", "get", "interpolation", "r", "animated", "valIn", "isColorStyleKey", "animateToValue", "curInterpolation", "interpolateArgs", "getInterpolated", "set", "interpolate", "getColorInterpolated", "animationConfig", "getAnimationConfig", "animation", "resolve", "promise", "Promise", "push", "stopAnimation", "getAnimation", "delay", "sequence", "process", "env", "NODE_ENV", "info", "useIsomorphicLayoutEffect", "forEach", "cancel", "all", "then", "response", "inputStyle", "currentColor", "nextColor", "inputRange", "outputRange", "reverse", "postfix", "extraConf", "shortKey", "transformShorthands", "Array", "isArray", "conf", "found", "x", "y", "translateX", "translateY", "input", "isColor", "_", "number", "after", "match"]
|
|
6
6
|
}
|