@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
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
19
20
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var index_exports = {};
|
|
24
23
|
__export(index_exports, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,
|
|
25
|
+
getAnimationConfigsForKeys: () => import_normalizeTransition.getAnimationConfigsForKeys,
|
|
26
|
+
getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,
|
|
27
|
+
getEffectiveAnimation: () => import_normalizeTransition.getEffectiveAnimation,
|
|
28
|
+
hasAnimation: () => import_normalizeTransition.hasAnimation,
|
|
29
|
+
normalizeTransition: () => import_normalizeTransition.normalizeTransition
|
|
31
30
|
});
|
|
32
31
|
module.exports = __toCommonJS(index_exports);
|
|
33
|
-
var import_normalizeTransition = require("./normalizeTransition.cjs");
|
|
32
|
+
var import_normalizeTransition = require("./normalizeTransition.cjs");
|
|
@@ -0,0 +1,34 @@
|
|
|
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 index_exports = {};
|
|
25
|
+
__export(index_exports, {
|
|
26
|
+
getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,
|
|
27
|
+
getAnimationConfigsForKeys: () => import_normalizeTransition.getAnimationConfigsForKeys,
|
|
28
|
+
getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,
|
|
29
|
+
getEffectiveAnimation: () => import_normalizeTransition.getEffectiveAnimation,
|
|
30
|
+
hasAnimation: () => import_normalizeTransition.hasAnimation,
|
|
31
|
+
normalizeTransition: () => import_normalizeTransition.normalizeTransition
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(index_exports);
|
|
34
|
+
var import_normalizeTransition = require("./normalizeTransition.native.js");
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
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 index_exports = {};
|
|
26
25
|
__export(index_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,
|
|
27
|
+
getAnimationConfigsForKeys: () => import_normalizeTransition.getAnimationConfigsForKeys,
|
|
28
|
+
getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,
|
|
29
|
+
getEffectiveAnimation: () => import_normalizeTransition.getEffectiveAnimation,
|
|
30
|
+
hasAnimation: () => import_normalizeTransition.hasAnimation,
|
|
31
|
+
normalizeTransition: () => import_normalizeTransition.normalizeTransition
|
|
33
32
|
});
|
|
34
33
|
module.exports = __toCommonJS(index_exports);
|
|
35
34
|
var import_normalizeTransition = require("./normalizeTransition.native.js");
|
|
35
|
+
|
|
36
36
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,\n getAnimationConfigsForKeys: () => import_normalizeTransition.getAnimationConfigsForKeys,\n getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,\n getEffectiveAnimation: () => import_normalizeTransition.getEffectiveAnimation,\n hasAnimation: () => import_normalizeTransition.hasAnimation,\n normalizeTransition: () => import_normalizeTransition.normalizeTransition\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_normalizeTransition = require(\"./normalizeTransition\");\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACtB,6BAA6B,2BAA2B;CACxD,kCAAkC,2BAA2B;CAC7D,+BAA+B,2BAA2B;CAC1D,6BAA6B,2BAA2B;CACxD,oBAAoB,2BAA2B;CAC/C,2BAA2B,2BAA2B;AACxD,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,6BAA6B,QAAQ,iCAAuB"}
|
|
@@ -1,164 +1,174 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
19
20
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var normalizeTransition_exports = {};
|
|
24
23
|
__export(normalizeTransition_exports, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
getAnimatedProperties: () => getAnimatedProperties,
|
|
25
|
+
getAnimationConfigsForKeys: () => getAnimationConfigsForKeys,
|
|
26
|
+
getAnimationForProperty: () => getAnimationForProperty,
|
|
27
|
+
getEffectiveAnimation: () => getEffectiveAnimation,
|
|
28
|
+
hasAnimation: () => hasAnimation,
|
|
29
|
+
normalizeTransition: () => normalizeTransition
|
|
31
30
|
});
|
|
32
31
|
module.exports = __toCommonJS(normalizeTransition_exports);
|
|
33
|
-
const SPRING_CONFIG_KEYS = /* @__PURE__ */new Set([
|
|
32
|
+
const SPRING_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
33
|
+
"stiffness",
|
|
34
|
+
"damping",
|
|
35
|
+
"mass",
|
|
36
|
+
"tension",
|
|
37
|
+
"friction",
|
|
38
|
+
"velocity",
|
|
39
|
+
"overshootClamping",
|
|
40
|
+
"duration",
|
|
41
|
+
"bounciness",
|
|
42
|
+
"speed"
|
|
43
|
+
]);
|
|
34
44
|
function isSpringConfigKey(key) {
|
|
35
|
-
|
|
45
|
+
return SPRING_CONFIG_KEYS.has(key);
|
|
36
46
|
}
|
|
37
47
|
function normalizeTransition(transition) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
+
if (!transition) {
|
|
49
|
+
return {
|
|
50
|
+
default: null,
|
|
51
|
+
enter: null,
|
|
52
|
+
exit: null,
|
|
53
|
+
delay: void 0,
|
|
54
|
+
properties: {}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (typeof transition === "string") {
|
|
58
|
+
return {
|
|
59
|
+
default: transition,
|
|
60
|
+
enter: null,
|
|
61
|
+
exit: null,
|
|
62
|
+
delay: void 0,
|
|
63
|
+
properties: {}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(transition)) {
|
|
67
|
+
const [defaultAnimation, configObj] = transition;
|
|
68
|
+
const properties = {};
|
|
69
|
+
const springConfig = {};
|
|
70
|
+
let delay;
|
|
71
|
+
let enter = null;
|
|
72
|
+
let exit = null;
|
|
73
|
+
if (configObj && typeof configObj === "object") {
|
|
74
|
+
for (const [key, value] of Object.entries(configObj)) {
|
|
75
|
+
if (key === "delay" && typeof value === "number") {
|
|
76
|
+
delay = value;
|
|
77
|
+
} else if (key === "enter" && typeof value === "string") {
|
|
78
|
+
enter = value;
|
|
79
|
+
} else if (key === "exit" && typeof value === "string") {
|
|
80
|
+
exit = value;
|
|
81
|
+
} else if (isSpringConfigKey(key) && value !== void 0) {
|
|
82
|
+
springConfig[key] = value;
|
|
83
|
+
} else if (value !== void 0) {
|
|
84
|
+
properties[key] = value;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
default: defaultAnimation,
|
|
90
|
+
enter,
|
|
91
|
+
exit,
|
|
92
|
+
delay,
|
|
93
|
+
properties,
|
|
94
|
+
config: Object.keys(springConfig).length > 0 ? springConfig : void 0
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (typeof transition === "object") {
|
|
98
|
+
const properties = {};
|
|
99
|
+
const springConfig = {};
|
|
100
|
+
let defaultAnimation = null;
|
|
101
|
+
let enter = null;
|
|
102
|
+
let exit = null;
|
|
103
|
+
let delay;
|
|
104
|
+
for (const [key, value] of Object.entries(transition)) {
|
|
105
|
+
if (key === "default" && typeof value === "string") {
|
|
106
|
+
defaultAnimation = value;
|
|
107
|
+
} else if (key === "enter" && typeof value === "string") {
|
|
108
|
+
enter = value;
|
|
109
|
+
} else if (key === "exit" && typeof value === "string") {
|
|
110
|
+
exit = value;
|
|
111
|
+
} else if (key === "delay" && typeof value === "number") {
|
|
112
|
+
delay = value;
|
|
113
|
+
} else if (isSpringConfigKey(key) && value !== void 0) {
|
|
114
|
+
springConfig[key] = value;
|
|
115
|
+
} else if (value !== void 0) {
|
|
116
|
+
properties[key] = value;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
default: defaultAnimation,
|
|
121
|
+
enter,
|
|
122
|
+
exit,
|
|
123
|
+
delay,
|
|
124
|
+
properties,
|
|
125
|
+
config: Object.keys(springConfig).length > 0 ? springConfig : void 0
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
default: null,
|
|
130
|
+
enter: null,
|
|
131
|
+
exit: null,
|
|
132
|
+
delay: void 0,
|
|
133
|
+
properties: {}
|
|
134
|
+
};
|
|
125
135
|
}
|
|
126
136
|
function getAnimationForProperty(normalized, property) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
const propertyAnimation = normalized.properties[property];
|
|
138
|
+
if (propertyAnimation !== void 0) {
|
|
139
|
+
return propertyAnimation;
|
|
140
|
+
}
|
|
141
|
+
return normalized.default;
|
|
132
142
|
}
|
|
133
143
|
function hasAnimation(normalized) {
|
|
134
|
-
|
|
144
|
+
return normalized.default !== null || normalized.enter !== null || normalized.exit !== null || Object.keys(normalized.properties).length > 0;
|
|
135
145
|
}
|
|
136
146
|
function getAnimatedProperties(normalized) {
|
|
137
|
-
|
|
147
|
+
return Object.keys(normalized.properties);
|
|
138
148
|
}
|
|
139
149
|
function getEffectiveAnimation(normalized, state) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
if (state === "enter" && normalized.enter) {
|
|
151
|
+
return normalized.enter;
|
|
152
|
+
}
|
|
153
|
+
if (state === "exit" && normalized.exit) {
|
|
154
|
+
return normalized.exit;
|
|
155
|
+
}
|
|
156
|
+
return normalized.default;
|
|
147
157
|
}
|
|
148
158
|
function getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
159
|
+
const result = /* @__PURE__ */ new Map();
|
|
160
|
+
for (const key of keys) {
|
|
161
|
+
const propAnimation = normalized.properties[key];
|
|
162
|
+
let animationValue = null;
|
|
163
|
+
if (typeof propAnimation === "string") {
|
|
164
|
+
animationValue = animations[propAnimation] ?? null;
|
|
165
|
+
} else if (propAnimation && typeof propAnimation === "object" && propAnimation.type) {
|
|
166
|
+
animationValue = animations[propAnimation.type] ?? null;
|
|
167
|
+
}
|
|
168
|
+
if (animationValue === null) {
|
|
169
|
+
animationValue = defaultAnimation;
|
|
170
|
+
}
|
|
171
|
+
result.set(key, animationValue);
|
|
172
|
+
}
|
|
173
|
+
return result;
|
|
174
|
+
}
|