@tamagui/animation-helpers 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/index.cjs +20 -21
- package/dist/cjs/index.native.cjs +34 -0
- package/dist/cjs/index.native.js +20 -20
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/normalizeTransition.cjs +149 -139
- package/dist/cjs/normalizeTransition.native.cjs +233 -0
- package/dist/cjs/normalizeTransition.native.js +204 -200
- package/dist/cjs/normalizeTransition.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/index.native.js +3 -3
- package/dist/esm/normalizeTransition.mjs +130 -118
- package/dist/esm/normalizeTransition.mjs.map +1 -1
- package/dist/esm/normalizeTransition.native.js +185 -180
- package/dist/esm/normalizeTransition.native.js.map +1 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/package.json +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
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var normalizeTransition_exports = {};
|
|
25
|
+
__export(normalizeTransition_exports, {
|
|
26
|
+
getAnimatedProperties: () => getAnimatedProperties,
|
|
27
|
+
getAnimationConfigsForKeys: () => getAnimationConfigsForKeys,
|
|
28
|
+
getAnimationForProperty: () => getAnimationForProperty,
|
|
29
|
+
getEffectiveAnimation: () => getEffectiveAnimation,
|
|
30
|
+
hasAnimation: () => hasAnimation,
|
|
31
|
+
normalizeTransition: () => normalizeTransition
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(normalizeTransition_exports);
|
|
34
|
+
function _type_of(obj) {
|
|
35
|
+
"@swc/helpers - typeof";
|
|
36
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
37
|
+
}
|
|
38
|
+
var SPRING_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
39
|
+
"stiffness",
|
|
40
|
+
"damping",
|
|
41
|
+
"mass",
|
|
42
|
+
"tension",
|
|
43
|
+
"friction",
|
|
44
|
+
"velocity",
|
|
45
|
+
"overshootClamping",
|
|
46
|
+
"duration",
|
|
47
|
+
"bounciness",
|
|
48
|
+
"speed"
|
|
49
|
+
]);
|
|
50
|
+
function isSpringConfigKey(key) {
|
|
51
|
+
return SPRING_CONFIG_KEYS.has(key);
|
|
52
|
+
}
|
|
53
|
+
function normalizeTransition(transition) {
|
|
54
|
+
if (!transition) {
|
|
55
|
+
return {
|
|
56
|
+
default: null,
|
|
57
|
+
enter: null,
|
|
58
|
+
exit: null,
|
|
59
|
+
delay: void 0,
|
|
60
|
+
properties: {}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (typeof transition === "string") {
|
|
64
|
+
return {
|
|
65
|
+
default: transition,
|
|
66
|
+
enter: null,
|
|
67
|
+
exit: null,
|
|
68
|
+
delay: void 0,
|
|
69
|
+
properties: {}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(transition)) {
|
|
73
|
+
var [defaultAnimation, configObj] = transition;
|
|
74
|
+
var properties = {};
|
|
75
|
+
var springConfig = {};
|
|
76
|
+
var delay;
|
|
77
|
+
var enter = null;
|
|
78
|
+
var exit = null;
|
|
79
|
+
if (configObj && (typeof configObj === "undefined" ? "undefined" : _type_of(configObj)) === "object") {
|
|
80
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
81
|
+
try {
|
|
82
|
+
for (var _iterator = Object.entries(configObj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
83
|
+
var [key, value] = _step.value;
|
|
84
|
+
if (key === "delay" && typeof value === "number") {
|
|
85
|
+
delay = value;
|
|
86
|
+
} else if (key === "enter" && typeof value === "string") {
|
|
87
|
+
enter = value;
|
|
88
|
+
} else if (key === "exit" && typeof value === "string") {
|
|
89
|
+
exit = value;
|
|
90
|
+
} else if (isSpringConfigKey(key) && value !== void 0) {
|
|
91
|
+
springConfig[key] = value;
|
|
92
|
+
} else if (value !== void 0) {
|
|
93
|
+
properties[key] = value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
_didIteratorError = true;
|
|
98
|
+
_iteratorError = err;
|
|
99
|
+
} finally {
|
|
100
|
+
try {
|
|
101
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
102
|
+
_iterator.return();
|
|
103
|
+
}
|
|
104
|
+
} finally {
|
|
105
|
+
if (_didIteratorError) {
|
|
106
|
+
throw _iteratorError;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
default: defaultAnimation,
|
|
113
|
+
enter,
|
|
114
|
+
exit,
|
|
115
|
+
delay,
|
|
116
|
+
properties,
|
|
117
|
+
config: Object.keys(springConfig).length > 0 ? springConfig : void 0
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if ((typeof transition === "undefined" ? "undefined" : _type_of(transition)) === "object") {
|
|
121
|
+
var properties1 = {};
|
|
122
|
+
var springConfig1 = {};
|
|
123
|
+
var defaultAnimation1 = null;
|
|
124
|
+
var enter1 = null;
|
|
125
|
+
var exit1 = null;
|
|
126
|
+
var delay1;
|
|
127
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
128
|
+
try {
|
|
129
|
+
for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
130
|
+
var [key1, value1] = _step1.value;
|
|
131
|
+
if (key1 === "default" && typeof value1 === "string") {
|
|
132
|
+
defaultAnimation1 = value1;
|
|
133
|
+
} else if (key1 === "enter" && typeof value1 === "string") {
|
|
134
|
+
enter1 = value1;
|
|
135
|
+
} else if (key1 === "exit" && typeof value1 === "string") {
|
|
136
|
+
exit1 = value1;
|
|
137
|
+
} else if (key1 === "delay" && typeof value1 === "number") {
|
|
138
|
+
delay1 = value1;
|
|
139
|
+
} else if (isSpringConfigKey(key1) && value1 !== void 0) {
|
|
140
|
+
springConfig1[key1] = value1;
|
|
141
|
+
} else if (value1 !== void 0) {
|
|
142
|
+
properties1[key1] = value1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} catch (err) {
|
|
146
|
+
_didIteratorError1 = true;
|
|
147
|
+
_iteratorError1 = err;
|
|
148
|
+
} finally {
|
|
149
|
+
try {
|
|
150
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
151
|
+
_iterator1.return();
|
|
152
|
+
}
|
|
153
|
+
} finally {
|
|
154
|
+
if (_didIteratorError1) {
|
|
155
|
+
throw _iteratorError1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
default: defaultAnimation1,
|
|
161
|
+
enter: enter1,
|
|
162
|
+
exit: exit1,
|
|
163
|
+
delay: delay1,
|
|
164
|
+
properties: properties1,
|
|
165
|
+
config: Object.keys(springConfig1).length > 0 ? springConfig1 : void 0
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
default: null,
|
|
170
|
+
enter: null,
|
|
171
|
+
exit: null,
|
|
172
|
+
delay: void 0,
|
|
173
|
+
properties: {}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function getAnimationForProperty(normalized, property) {
|
|
177
|
+
var propertyAnimation = normalized.properties[property];
|
|
178
|
+
if (propertyAnimation !== void 0) {
|
|
179
|
+
return propertyAnimation;
|
|
180
|
+
}
|
|
181
|
+
return normalized.default;
|
|
182
|
+
}
|
|
183
|
+
function hasAnimation(normalized) {
|
|
184
|
+
return normalized.default !== null || normalized.enter !== null || normalized.exit !== null || Object.keys(normalized.properties).length > 0;
|
|
185
|
+
}
|
|
186
|
+
function getAnimatedProperties(normalized) {
|
|
187
|
+
return Object.keys(normalized.properties);
|
|
188
|
+
}
|
|
189
|
+
function getEffectiveAnimation(normalized, state) {
|
|
190
|
+
if (state === "enter" && normalized.enter) {
|
|
191
|
+
return normalized.enter;
|
|
192
|
+
}
|
|
193
|
+
if (state === "exit" && normalized.exit) {
|
|
194
|
+
return normalized.exit;
|
|
195
|
+
}
|
|
196
|
+
return normalized.default;
|
|
197
|
+
}
|
|
198
|
+
function getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation) {
|
|
199
|
+
var result = /* @__PURE__ */ new Map();
|
|
200
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
201
|
+
try {
|
|
202
|
+
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
203
|
+
var key = _step.value;
|
|
204
|
+
var propAnimation = normalized.properties[key];
|
|
205
|
+
var animationValue = null;
|
|
206
|
+
if (typeof propAnimation === "string") {
|
|
207
|
+
var _animations_propAnimation;
|
|
208
|
+
animationValue = (_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : null;
|
|
209
|
+
} else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object" && propAnimation.type) {
|
|
210
|
+
var _animations_propAnimation_type;
|
|
211
|
+
animationValue = (_animations_propAnimation_type = animations[propAnimation.type]) !== null && _animations_propAnimation_type !== void 0 ? _animations_propAnimation_type : null;
|
|
212
|
+
}
|
|
213
|
+
if (animationValue === null) {
|
|
214
|
+
animationValue = defaultAnimation;
|
|
215
|
+
}
|
|
216
|
+
result.set(key, animationValue);
|
|
217
|
+
}
|
|
218
|
+
} catch (err) {
|
|
219
|
+
_didIteratorError = true;
|
|
220
|
+
_iteratorError = err;
|
|
221
|
+
} finally {
|
|
222
|
+
try {
|
|
223
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
224
|
+
_iterator.return();
|
|
225
|
+
}
|
|
226
|
+
} finally {
|
|
227
|
+
if (_didIteratorError) {
|
|
228
|
+
throw _iteratorError;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
@@ -1,231 +1,235 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var normalizeTransition_exports = {};
|
|
26
25
|
__export(normalizeTransition_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
getAnimatedProperties: () => getAnimatedProperties,
|
|
27
|
+
getAnimationConfigsForKeys: () => getAnimationConfigsForKeys,
|
|
28
|
+
getAnimationForProperty: () => getAnimationForProperty,
|
|
29
|
+
getEffectiveAnimation: () => getEffectiveAnimation,
|
|
30
|
+
hasAnimation: () => hasAnimation,
|
|
31
|
+
normalizeTransition: () => normalizeTransition
|
|
33
32
|
});
|
|
34
33
|
module.exports = __toCommonJS(normalizeTransition_exports);
|
|
35
34
|
function _type_of(obj) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
35
|
+
"@swc/helpers - typeof";
|
|
36
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
39
37
|
}
|
|
40
|
-
var SPRING_CONFIG_KEYS = /* @__PURE__ */new Set([
|
|
38
|
+
var SPRING_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
39
|
+
"stiffness",
|
|
40
|
+
"damping",
|
|
41
|
+
"mass",
|
|
42
|
+
"tension",
|
|
43
|
+
"friction",
|
|
44
|
+
"velocity",
|
|
45
|
+
"overshootClamping",
|
|
46
|
+
"duration",
|
|
47
|
+
"bounciness",
|
|
48
|
+
"speed"
|
|
49
|
+
]);
|
|
41
50
|
function isSpringConfigKey(key) {
|
|
42
|
-
|
|
51
|
+
return SPRING_CONFIG_KEYS.has(key);
|
|
43
52
|
}
|
|
44
53
|
function normalizeTransition(transition) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
exit: null,
|
|
167
|
-
delay: void 0,
|
|
168
|
-
properties: {}
|
|
169
|
-
};
|
|
54
|
+
if (!transition) {
|
|
55
|
+
return {
|
|
56
|
+
default: null,
|
|
57
|
+
enter: null,
|
|
58
|
+
exit: null,
|
|
59
|
+
delay: void 0,
|
|
60
|
+
properties: {}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (typeof transition === "string") {
|
|
64
|
+
return {
|
|
65
|
+
default: transition,
|
|
66
|
+
enter: null,
|
|
67
|
+
exit: null,
|
|
68
|
+
delay: void 0,
|
|
69
|
+
properties: {}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(transition)) {
|
|
73
|
+
var [defaultAnimation, configObj] = transition;
|
|
74
|
+
var properties = {};
|
|
75
|
+
var springConfig = {};
|
|
76
|
+
var delay;
|
|
77
|
+
var enter = null;
|
|
78
|
+
var exit = null;
|
|
79
|
+
if (configObj && (typeof configObj === "undefined" ? "undefined" : _type_of(configObj)) === "object") {
|
|
80
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
81
|
+
try {
|
|
82
|
+
for (var _iterator = Object.entries(configObj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
83
|
+
var [key, value] = _step.value;
|
|
84
|
+
if (key === "delay" && typeof value === "number") {
|
|
85
|
+
delay = value;
|
|
86
|
+
} else if (key === "enter" && typeof value === "string") {
|
|
87
|
+
enter = value;
|
|
88
|
+
} else if (key === "exit" && typeof value === "string") {
|
|
89
|
+
exit = value;
|
|
90
|
+
} else if (isSpringConfigKey(key) && value !== void 0) {
|
|
91
|
+
springConfig[key] = value;
|
|
92
|
+
} else if (value !== void 0) {
|
|
93
|
+
properties[key] = value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
_didIteratorError = true;
|
|
98
|
+
_iteratorError = err;
|
|
99
|
+
} finally {
|
|
100
|
+
try {
|
|
101
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
102
|
+
_iterator.return();
|
|
103
|
+
}
|
|
104
|
+
} finally {
|
|
105
|
+
if (_didIteratorError) {
|
|
106
|
+
throw _iteratorError;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
default: defaultAnimation,
|
|
113
|
+
enter,
|
|
114
|
+
exit,
|
|
115
|
+
delay,
|
|
116
|
+
properties,
|
|
117
|
+
config: Object.keys(springConfig).length > 0 ? springConfig : void 0
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if ((typeof transition === "undefined" ? "undefined" : _type_of(transition)) === "object") {
|
|
121
|
+
var properties1 = {};
|
|
122
|
+
var springConfig1 = {};
|
|
123
|
+
var defaultAnimation1 = null;
|
|
124
|
+
var enter1 = null;
|
|
125
|
+
var exit1 = null;
|
|
126
|
+
var delay1;
|
|
127
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
128
|
+
try {
|
|
129
|
+
for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
130
|
+
var [key1, value1] = _step1.value;
|
|
131
|
+
if (key1 === "default" && typeof value1 === "string") {
|
|
132
|
+
defaultAnimation1 = value1;
|
|
133
|
+
} else if (key1 === "enter" && typeof value1 === "string") {
|
|
134
|
+
enter1 = value1;
|
|
135
|
+
} else if (key1 === "exit" && typeof value1 === "string") {
|
|
136
|
+
exit1 = value1;
|
|
137
|
+
} else if (key1 === "delay" && typeof value1 === "number") {
|
|
138
|
+
delay1 = value1;
|
|
139
|
+
} else if (isSpringConfigKey(key1) && value1 !== void 0) {
|
|
140
|
+
springConfig1[key1] = value1;
|
|
141
|
+
} else if (value1 !== void 0) {
|
|
142
|
+
properties1[key1] = value1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} catch (err) {
|
|
146
|
+
_didIteratorError1 = true;
|
|
147
|
+
_iteratorError1 = err;
|
|
148
|
+
} finally {
|
|
149
|
+
try {
|
|
150
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
151
|
+
_iterator1.return();
|
|
152
|
+
}
|
|
153
|
+
} finally {
|
|
154
|
+
if (_didIteratorError1) {
|
|
155
|
+
throw _iteratorError1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
default: defaultAnimation1,
|
|
161
|
+
enter: enter1,
|
|
162
|
+
exit: exit1,
|
|
163
|
+
delay: delay1,
|
|
164
|
+
properties: properties1,
|
|
165
|
+
config: Object.keys(springConfig1).length > 0 ? springConfig1 : void 0
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
default: null,
|
|
170
|
+
enter: null,
|
|
171
|
+
exit: null,
|
|
172
|
+
delay: void 0,
|
|
173
|
+
properties: {}
|
|
174
|
+
};
|
|
170
175
|
}
|
|
171
176
|
function getAnimationForProperty(normalized, property) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
+
var propertyAnimation = normalized.properties[property];
|
|
178
|
+
if (propertyAnimation !== void 0) {
|
|
179
|
+
return propertyAnimation;
|
|
180
|
+
}
|
|
181
|
+
return normalized.default;
|
|
177
182
|
}
|
|
178
183
|
function hasAnimation(normalized) {
|
|
179
|
-
|
|
184
|
+
return normalized.default !== null || normalized.enter !== null || normalized.exit !== null || Object.keys(normalized.properties).length > 0;
|
|
180
185
|
}
|
|
181
186
|
function getAnimatedProperties(normalized) {
|
|
182
|
-
|
|
187
|
+
return Object.keys(normalized.properties);
|
|
183
188
|
}
|
|
184
189
|
function getEffectiveAnimation(normalized, state) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
if (state === "enter" && normalized.enter) {
|
|
191
|
+
return normalized.enter;
|
|
192
|
+
}
|
|
193
|
+
if (state === "exit" && normalized.exit) {
|
|
194
|
+
return normalized.exit;
|
|
195
|
+
}
|
|
196
|
+
return normalized.default;
|
|
192
197
|
}
|
|
193
198
|
function getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
return result;
|
|
199
|
+
var result = /* @__PURE__ */ new Map();
|
|
200
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
201
|
+
try {
|
|
202
|
+
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
203
|
+
var key = _step.value;
|
|
204
|
+
var propAnimation = normalized.properties[key];
|
|
205
|
+
var animationValue = null;
|
|
206
|
+
if (typeof propAnimation === "string") {
|
|
207
|
+
var _animations_propAnimation;
|
|
208
|
+
animationValue = (_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : null;
|
|
209
|
+
} else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object" && propAnimation.type) {
|
|
210
|
+
var _animations_propAnimation_type;
|
|
211
|
+
animationValue = (_animations_propAnimation_type = animations[propAnimation.type]) !== null && _animations_propAnimation_type !== void 0 ? _animations_propAnimation_type : null;
|
|
212
|
+
}
|
|
213
|
+
if (animationValue === null) {
|
|
214
|
+
animationValue = defaultAnimation;
|
|
215
|
+
}
|
|
216
|
+
result.set(key, animationValue);
|
|
217
|
+
}
|
|
218
|
+
} catch (err) {
|
|
219
|
+
_didIteratorError = true;
|
|
220
|
+
_iteratorError = err;
|
|
221
|
+
} finally {
|
|
222
|
+
try {
|
|
223
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
224
|
+
_iterator.return();
|
|
225
|
+
}
|
|
226
|
+
} finally {
|
|
227
|
+
if (_didIteratorError) {
|
|
228
|
+
throw _iteratorError;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
230
233
|
}
|
|
234
|
+
|
|
231
235
|
//# sourceMappingURL=normalizeTransition.native.js.map
|