@tamagui/animations-react-native 1.61.2 → 1.62.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.js +106 -214
- package/dist/cjs/createAnimations.js.map +2 -2
- package/dist/cjs/createAnimations.native.js +282 -0
- package/dist/cjs/createAnimations.native.js.map +6 -0
- package/dist/cjs/index.js +4 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +21 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/polyfill.js +1 -4
- package/dist/cjs/polyfill.js.map +1 -1
- package/dist/cjs/polyfill.native.js +3 -0
- package/dist/cjs/polyfill.native.js.map +6 -0
- package/dist/esm/createAnimations.js +100 -201
- package/dist/esm/createAnimations.js.map +2 -2
- package/dist/esm/polyfill.js +1 -3
- package/dist/esm/polyfill.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var createAnimations_exports = {};
|
|
20
16
|
__export(createAnimations_exports, {
|
|
21
17
|
AnimatedText: () => AnimatedText,
|
|
@@ -26,86 +22,70 @@ __export(createAnimations_exports, {
|
|
|
26
22
|
useAnimatedNumberStyle: () => useAnimatedNumberStyle
|
|
27
23
|
});
|
|
28
24
|
module.exports = __toCommonJS(createAnimations_exports);
|
|
29
|
-
var import_use_presence = require("@tamagui/use-presence");
|
|
30
|
-
var import_web = require("@tamagui/web");
|
|
31
|
-
var import_react = require("react");
|
|
32
|
-
var import_react_native = require("react-native");
|
|
25
|
+
var import_use_presence = require("@tamagui/use-presence"), import_web = require("@tamagui/web"), import_react = require("react"), import_react_native = require("react-native");
|
|
33
26
|
const animatedStyleKey = {
|
|
34
|
-
transform:
|
|
35
|
-
opacity:
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
borderTopWidth: true,
|
|
56
|
-
borderBottomWidth: true,
|
|
27
|
+
transform: !0,
|
|
28
|
+
opacity: !0
|
|
29
|
+
}, colorStyleKey = {
|
|
30
|
+
backgroundColor: !0,
|
|
31
|
+
color: !0,
|
|
32
|
+
borderColor: !0,
|
|
33
|
+
borderLeftColor: !0,
|
|
34
|
+
borderRightColor: !0,
|
|
35
|
+
borderTopColor: !0,
|
|
36
|
+
borderBottomColor: !0
|
|
37
|
+
}, costlyToAnimateStyleKey = {
|
|
38
|
+
borderRadius: !0,
|
|
39
|
+
borderTopLeftRadius: !0,
|
|
40
|
+
borderTopRightRadius: !0,
|
|
41
|
+
borderBottomLeftRadius: !0,
|
|
42
|
+
borderBottomRightRadius: !0,
|
|
43
|
+
borderWidth: !0,
|
|
44
|
+
borderLeftWidth: !0,
|
|
45
|
+
borderRightWidth: !0,
|
|
46
|
+
borderTopWidth: !0,
|
|
47
|
+
borderBottomWidth: !0,
|
|
57
48
|
...colorStyleKey
|
|
58
49
|
// TODO for other keys like height or width, it's better to not add them here till layout animations are ready
|
|
59
|
-
};
|
|
60
|
-
const AnimatedView = import_react_native.Animated.View;
|
|
61
|
-
const AnimatedText = import_react_native.Animated.Text;
|
|
50
|
+
}, AnimatedView = import_react_native.Animated.View, AnimatedText = import_react_native.Animated.Text;
|
|
62
51
|
function useAnimatedNumber(initial) {
|
|
63
52
|
const state = (0, import_react.useRef)(
|
|
64
53
|
null
|
|
65
54
|
);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
55
|
+
return state.current || (state.current = {
|
|
56
|
+
composite: null,
|
|
57
|
+
val: new import_react_native.Animated.Value(initial),
|
|
58
|
+
strategy: { type: "spring" }
|
|
59
|
+
}), {
|
|
74
60
|
getInstance() {
|
|
75
61
|
return state.current.val;
|
|
76
62
|
},
|
|
77
63
|
getValue() {
|
|
78
|
-
return state.current.val
|
|
64
|
+
return state.current.val._value;
|
|
79
65
|
},
|
|
80
66
|
stop() {
|
|
81
|
-
|
|
82
|
-
(_a = state.current.composite) == null ? void 0 : _a.stop();
|
|
83
|
-
state.current.composite = null;
|
|
67
|
+
state.current.composite?.stop(), state.current.composite = null;
|
|
84
68
|
},
|
|
85
69
|
setValue(next, { type, ...config } = { type: "spring" }, onFinish) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const handleFinish = onFinish ? ({ finished }) => finished ? onFinish() : null : void 0;
|
|
89
|
-
if (type === "direct") {
|
|
70
|
+
const val = state.current.val, handleFinish = onFinish ? ({ finished }) => finished ? onFinish() : null : void 0;
|
|
71
|
+
if (type === "direct")
|
|
90
72
|
val.setValue(next);
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
else if (type === "spring") {
|
|
74
|
+
state.current.composite?.stop();
|
|
93
75
|
const composite = import_react_native.Animated.spring(val, {
|
|
94
76
|
...config,
|
|
95
77
|
toValue: next,
|
|
96
78
|
useNativeDriver: !import_web.isWeb
|
|
97
79
|
});
|
|
98
|
-
composite.start(handleFinish);
|
|
99
|
-
state.current.composite = composite;
|
|
80
|
+
composite.start(handleFinish), state.current.composite = composite;
|
|
100
81
|
} else {
|
|
101
|
-
|
|
82
|
+
state.current.composite?.stop();
|
|
102
83
|
const composite = import_react_native.Animated.timing(val, {
|
|
103
84
|
...config,
|
|
104
85
|
toValue: next,
|
|
105
86
|
useNativeDriver: !import_web.isWeb
|
|
106
87
|
});
|
|
107
|
-
composite.start(handleFinish);
|
|
108
|
-
state.current.composite = composite;
|
|
88
|
+
composite.start(handleFinish), state.current.composite = composite;
|
|
109
89
|
}
|
|
110
90
|
}
|
|
111
91
|
};
|
|
@@ -127,10 +107,8 @@ function useAnimatedNumberStyle(value, getStyle) {
|
|
|
127
107
|
return getStyle(value.getInstance());
|
|
128
108
|
}
|
|
129
109
|
function createAnimations(animations) {
|
|
130
|
-
AnimatedView
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
isReactNative: true,
|
|
110
|
+
return AnimatedView.displayName = "AnimatedView", AnimatedText.displayName = "AnimatedText", {
|
|
111
|
+
isReactNative: !0,
|
|
134
112
|
animations,
|
|
135
113
|
View: AnimatedView,
|
|
136
114
|
Text: AnimatedText,
|
|
@@ -139,32 +117,10 @@ function createAnimations(animations) {
|
|
|
139
117
|
useAnimatedNumberStyle,
|
|
140
118
|
usePresence: import_use_presence.usePresence,
|
|
141
119
|
useAnimations: ({ props, onDidAnimate, style, componentState, presence }) => {
|
|
142
|
-
const isExiting =
|
|
143
|
-
const sendExitComplete = presence == null ? void 0 : presence[1];
|
|
144
|
-
const animateStyles = (0, import_react.useRef)({});
|
|
145
|
-
const animatedTranforms = (0, import_react.useRef)([]);
|
|
146
|
-
const animationsState = (0, import_react.useRef)(
|
|
120
|
+
const isExiting = presence?.[0] === !1, sendExitComplete = presence?.[1], animateStyles = (0, import_react.useRef)({}), animatedTranforms = (0, import_react.useRef)([]), animationsState = (0, import_react.useRef)(
|
|
147
121
|
/* @__PURE__ */ new WeakMap()
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
const hasAnimateOnly = !!props.animateOnly;
|
|
151
|
-
const args = [JSON.stringify(style), componentState, isExiting, !!onDidAnimate];
|
|
152
|
-
const isThereNoNativeStyleKeys = (0, import_react.useMemo)(() => {
|
|
153
|
-
if (import_web.isWeb)
|
|
154
|
-
return true;
|
|
155
|
-
return Object.keys(style).some((key) => {
|
|
156
|
-
if (animateOnly.length) {
|
|
157
|
-
return !animatedStyleKey[key] && animateOnly.indexOf(key) === -1;
|
|
158
|
-
} else {
|
|
159
|
-
return !animatedStyleKey[key];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}, args);
|
|
163
|
-
const res = (0, import_react.useMemo)(() => {
|
|
164
|
-
var _a;
|
|
165
|
-
const runners = [];
|
|
166
|
-
const completions = [];
|
|
167
|
-
const nonAnimatedStyle = {};
|
|
122
|
+
), animateOnly = props.animateOnly || [], hasAnimateOnly = !!props.animateOnly, args = [JSON.stringify(style), componentState, isExiting, !!onDidAnimate], isThereNoNativeStyleKeys = (0, import_react.useMemo)(() => import_web.isWeb ? !0 : Object.keys(style).some((key) => animateOnly.length ? !animatedStyleKey[key] && animateOnly.indexOf(key) === -1 : !animatedStyleKey[key]), args), res = (0, import_react.useMemo)(() => {
|
|
123
|
+
const runners = [], completions = [], nonAnimatedStyle = {};
|
|
168
124
|
for (const key in style) {
|
|
169
125
|
const val = style[key];
|
|
170
126
|
if (animatedStyleKey[key] == null && !costlyToAnimateStyleKey[key]) {
|
|
@@ -179,33 +135,25 @@ function createAnimations(animations) {
|
|
|
179
135
|
animateStyles.current[key] = update(key, animateStyles.current[key], val);
|
|
180
136
|
continue;
|
|
181
137
|
}
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
};
|
|
192
|
-
animatedTranforms.current = [...animatedTranforms.current];
|
|
193
|
-
}
|
|
138
|
+
if (val)
|
|
139
|
+
for (const [index, transform] of val.entries()) {
|
|
140
|
+
if (!transform)
|
|
141
|
+
continue;
|
|
142
|
+
const tkey = Object.keys(transform)[0], currentTransform = animatedTranforms.current[index]?.[tkey];
|
|
143
|
+
animatedTranforms.current[index] = {
|
|
144
|
+
[tkey]: update(tkey, currentTransform, transform[tkey])
|
|
145
|
+
}, animatedTranforms.current = [...animatedTranforms.current];
|
|
146
|
+
}
|
|
194
147
|
}
|
|
195
148
|
const animatedStyle = {
|
|
196
149
|
...Object.fromEntries(
|
|
197
|
-
Object.entries(animateStyles.current).map(([k, v]) =>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
((_a2 = animationsState.current.get(v)) == null ? void 0 : _a2.interpolation) || v
|
|
202
|
-
];
|
|
203
|
-
})
|
|
150
|
+
Object.entries(animateStyles.current).map(([k, v]) => [
|
|
151
|
+
k,
|
|
152
|
+
animationsState.current.get(v)?.interpolation || v
|
|
153
|
+
])
|
|
204
154
|
),
|
|
205
155
|
transform: animatedTranforms.current.map((r) => {
|
|
206
|
-
|
|
207
|
-
const key = Object.keys(r)[0];
|
|
208
|
-
const val = ((_a2 = animationsState.current.get(r[key])) == null ? void 0 : _a2.interpolation) || r[key];
|
|
156
|
+
const key = Object.keys(r)[0], val = animationsState.current.get(r[key])?.interpolation || r[key];
|
|
209
157
|
return { [key]: val };
|
|
210
158
|
})
|
|
211
159
|
};
|
|
@@ -215,45 +163,33 @@ function createAnimations(animations) {
|
|
|
215
163
|
style: [nonAnimatedStyle, animatedStyle]
|
|
216
164
|
};
|
|
217
165
|
function update(key, animated, valIn) {
|
|
218
|
-
const isColorStyleKey = colorStyleKey[key];
|
|
219
|
-
const [val, type] = isColorStyleKey ? [0, void 0] : getValue(valIn);
|
|
166
|
+
const isColorStyleKey = colorStyleKey[key], [val, type] = isColorStyleKey ? [0, void 0] : getValue(valIn);
|
|
220
167
|
let animateToValue = val;
|
|
221
|
-
const value = animated || new import_react_native.Animated.Value(val);
|
|
222
|
-
const curInterpolation = animationsState.current.get(value);
|
|
168
|
+
const value = animated || new import_react_native.Animated.Value(val), curInterpolation = animationsState.current.get(value);
|
|
223
169
|
let interpolateArgs;
|
|
224
|
-
if (type
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
animateToValue
|
|
242
|
-
);
|
|
243
|
-
animationsState.current.set(value, {
|
|
244
|
-
current: valIn,
|
|
245
|
-
interpolation: value.interpolate(interpolateArgs),
|
|
246
|
-
animateToValue: (curInterpolation == null ? void 0 : curInterpolation.animateToValue) ? 0 : 1
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
if (value) {
|
|
170
|
+
if (type && (interpolateArgs = getInterpolated(
|
|
171
|
+
curInterpolation?.current ?? value._value,
|
|
172
|
+
val,
|
|
173
|
+
type
|
|
174
|
+
), animationsState.current.set(value, {
|
|
175
|
+
interpolation: value.interpolate(interpolateArgs),
|
|
176
|
+
current: val
|
|
177
|
+
})), isColorStyleKey && (animateToValue = curInterpolation?.animateToValue ? 0 : 1, interpolateArgs = getColorInterpolated(
|
|
178
|
+
curInterpolation?.current,
|
|
179
|
+
// valIn is the next color
|
|
180
|
+
valIn,
|
|
181
|
+
animateToValue
|
|
182
|
+
), animationsState.current.set(value, {
|
|
183
|
+
current: valIn,
|
|
184
|
+
interpolation: value.interpolate(interpolateArgs),
|
|
185
|
+
animateToValue: curInterpolation?.animateToValue ? 0 : 1
|
|
186
|
+
})), value) {
|
|
250
187
|
const animationConfig = getAnimationConfig(key, animations, props.animation);
|
|
251
188
|
let resolve;
|
|
252
189
|
const promise = new Promise((res2) => {
|
|
253
190
|
resolve = res2;
|
|
254
191
|
});
|
|
255
|
-
completions.push(promise)
|
|
256
|
-
runners.push(() => {
|
|
192
|
+
completions.push(promise), runners.push(() => {
|
|
257
193
|
value.stopAnimation();
|
|
258
194
|
function getAnimation() {
|
|
259
195
|
return import_react_native.Animated[animationConfig.type || "spring"](value, {
|
|
@@ -262,103 +198,60 @@ function createAnimations(animations) {
|
|
|
262
198
|
...animationConfig
|
|
263
199
|
});
|
|
264
200
|
}
|
|
265
|
-
|
|
201
|
+
(animationConfig.delay ? import_react_native.Animated.sequence([
|
|
266
202
|
import_react_native.Animated.delay(animationConfig.delay),
|
|
267
203
|
getAnimation()
|
|
268
|
-
]) : getAnimation()
|
|
269
|
-
|
|
270
|
-
if (finished) {
|
|
271
|
-
resolve();
|
|
272
|
-
}
|
|
204
|
+
]) : getAnimation()).start(({ finished }) => {
|
|
205
|
+
finished && resolve();
|
|
273
206
|
});
|
|
274
207
|
});
|
|
275
208
|
}
|
|
276
|
-
|
|
277
|
-
if (props["debug"] === "verbose") {
|
|
278
|
-
console.log(" \u{1F4A0} animate", key, `from (${value["_value"]}) to`, valIn, `(${val})`, "type", type, "interpolate", interpolateArgs);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return value;
|
|
209
|
+
return process.env.NODE_ENV === "development" && props.debug === "verbose" && console.log(" \u{1F4A0} animate", key, `from (${value._value}) to`, valIn, `(${val})`, "type", type, "interpolate", interpolateArgs), value;
|
|
282
210
|
}
|
|
283
211
|
}, args);
|
|
284
|
-
(0, import_web.useIsomorphicLayoutEffect)(() => {
|
|
212
|
+
return (0, import_web.useIsomorphicLayoutEffect)(() => {
|
|
285
213
|
res.runners.forEach((r) => r());
|
|
286
|
-
let cancel =
|
|
287
|
-
Promise.all(res.completions).then(() => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
if (isExiting) {
|
|
292
|
-
sendExitComplete == null ? void 0 : sendExitComplete();
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
return () => {
|
|
296
|
-
cancel = true;
|
|
214
|
+
let cancel = !1;
|
|
215
|
+
return Promise.all(res.completions).then(() => {
|
|
216
|
+
cancel || (onDidAnimate?.(), isExiting && sendExitComplete?.());
|
|
217
|
+
}), () => {
|
|
218
|
+
cancel = !0;
|
|
297
219
|
};
|
|
298
|
-
}, args);
|
|
299
|
-
if (process.env.NODE_ENV === "development") {
|
|
300
|
-
if (props["debug"] === "verbose") {
|
|
301
|
-
console.log(`Returning animated`, res, "given style", style);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
return res;
|
|
220
|
+
}, args), process.env.NODE_ENV === "development" && props.debug === "verbose" && console.log("Returning animated", res, "given style", style), res;
|
|
305
221
|
}
|
|
306
222
|
};
|
|
307
223
|
}
|
|
308
224
|
function getColorInterpolated(currentColor, nextColor, animateToValue) {
|
|
309
|
-
const inputRange = [0, 1];
|
|
310
|
-
|
|
311
|
-
if (animateToValue === 0) {
|
|
312
|
-
outputRange.reverse();
|
|
313
|
-
}
|
|
314
|
-
return {
|
|
225
|
+
const inputRange = [0, 1], outputRange = [currentColor || nextColor, nextColor];
|
|
226
|
+
return animateToValue === 0 && outputRange.reverse(), {
|
|
315
227
|
inputRange,
|
|
316
228
|
outputRange
|
|
317
229
|
};
|
|
318
230
|
}
|
|
319
231
|
function getInterpolated(current, next, postfix = "deg") {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const inputRange = [current, next];
|
|
324
|
-
const outputRange = [`${current}${postfix}`, `${next}${postfix}`];
|
|
325
|
-
if (next < current) {
|
|
326
|
-
inputRange.reverse();
|
|
327
|
-
outputRange.reverse();
|
|
328
|
-
}
|
|
329
|
-
return {
|
|
232
|
+
next === current && (current = next - 1e-9);
|
|
233
|
+
const inputRange = [current, next], outputRange = [`${current}${postfix}`, `${next}${postfix}`];
|
|
234
|
+
return next < current && (inputRange.reverse(), outputRange.reverse()), {
|
|
330
235
|
inputRange,
|
|
331
236
|
outputRange
|
|
332
237
|
};
|
|
333
238
|
}
|
|
334
239
|
function getAnimationConfig(key, animations, animation) {
|
|
335
|
-
|
|
336
|
-
if (typeof animation === "string") {
|
|
240
|
+
if (typeof animation == "string")
|
|
337
241
|
return animations[animation];
|
|
338
|
-
|
|
339
|
-
let type = "";
|
|
340
|
-
let extraConf;
|
|
242
|
+
let type = "", extraConf;
|
|
341
243
|
const shortKey = transformShorthands[key];
|
|
342
244
|
if (Array.isArray(animation)) {
|
|
343
245
|
type = animation[0];
|
|
344
|
-
const conf =
|
|
345
|
-
|
|
346
|
-
if (typeof conf === "string") {
|
|
347
|
-
type = conf;
|
|
348
|
-
} else {
|
|
349
|
-
type = conf.type || type;
|
|
350
|
-
extraConf = conf;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
246
|
+
const conf = animation[1]?.[key] ?? animation[1]?.[shortKey];
|
|
247
|
+
conf && (typeof conf == "string" ? type = conf : (type = conf.type || type, extraConf = conf));
|
|
353
248
|
} else {
|
|
354
|
-
const val =
|
|
355
|
-
type = val
|
|
356
|
-
extraConf = val;
|
|
249
|
+
const val = animation?.[key] ?? animation?.[shortKey];
|
|
250
|
+
type = val?.type, extraConf = val;
|
|
357
251
|
}
|
|
358
252
|
const found = animations[type];
|
|
359
|
-
if (!found)
|
|
253
|
+
if (!found)
|
|
360
254
|
throw new Error(`No animation of type "${type}" for key "${key}"`);
|
|
361
|
-
}
|
|
362
255
|
return {
|
|
363
256
|
...found,
|
|
364
257
|
...extraConf
|
|
@@ -370,10 +263,9 @@ const transformShorthands = {
|
|
|
370
263
|
translateX: "x",
|
|
371
264
|
translateY: "y"
|
|
372
265
|
};
|
|
373
|
-
function getValue(input, isColor =
|
|
374
|
-
if (typeof input
|
|
266
|
+
function getValue(input, isColor = !1) {
|
|
267
|
+
if (typeof input != "string")
|
|
375
268
|
return [input];
|
|
376
|
-
}
|
|
377
269
|
const [_, number, after] = input.match(/([-0-9]+)(deg|%|px)/) ?? [];
|
|
378
270
|
return [+number, after];
|
|
379
271
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createAnimations.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B,kCAC5B,aAQO,yBACP,eAA2C,kBAC3C,sBAAyB;AA0BzB,MAAM,mBAAmB;AAAA,EACvB,WAAW;AAAA,EACX,SAAS;AACX,GAEM,gBAAgB;AAAA,EACpB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,mBAAmB;AACrB,GAGM,0BAA0B;AAAA,EAC9B,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,GAAG;AAAA;AAEL,GAEa,eAAe,6BAAS,MACxB,eAAe,6BAAS;AAE9B,SAAS,kBACd,SACyC;AACzC,QAAM,YAAQ;AAAA,IACZ;AAAA,EAKF;AACA,SA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