@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.
@@ -1,198 +1,203 @@
1
1
  function _type_of(obj) {
2
- "@swc/helpers - typeof";
3
-
4
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
2
+ "@swc/helpers - typeof";
3
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5
4
  }
6
- var SPRING_CONFIG_KEYS = /* @__PURE__ */new Set(["stiffness", "damping", "mass", "tension", "friction", "velocity", "overshootClamping", "duration", "bounciness", "speed"]);
5
+ var SPRING_CONFIG_KEYS = /* @__PURE__ */ new Set([
6
+ "stiffness",
7
+ "damping",
8
+ "mass",
9
+ "tension",
10
+ "friction",
11
+ "velocity",
12
+ "overshootClamping",
13
+ "duration",
14
+ "bounciness",
15
+ "speed"
16
+ ]);
7
17
  function isSpringConfigKey(key) {
8
- return SPRING_CONFIG_KEYS.has(key);
18
+ return SPRING_CONFIG_KEYS.has(key);
9
19
  }
10
20
  function normalizeTransition(transition) {
11
- if (!transition) {
12
- return {
13
- default: null,
14
- enter: null,
15
- exit: null,
16
- delay: void 0,
17
- properties: {}
18
- };
19
- }
20
- if (typeof transition === "string") {
21
- return {
22
- default: transition,
23
- enter: null,
24
- exit: null,
25
- delay: void 0,
26
- properties: {}
27
- };
28
- }
29
- if (Array.isArray(transition)) {
30
- var [defaultAnimation, configObj] = transition;
31
- var properties = {};
32
- var springConfig = {};
33
- var delay;
34
- var enter = null;
35
- var exit = null;
36
- if (configObj && (typeof configObj === "undefined" ? "undefined" : _type_of(configObj)) === "object") {
37
- var _iteratorNormalCompletion = true,
38
- _didIteratorError = false,
39
- _iteratorError = void 0;
40
- try {
41
- for (var _iterator = Object.entries(configObj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
42
- var [key, value] = _step.value;
43
- if (key === "delay" && typeof value === "number") {
44
- delay = value;
45
- } else if (key === "enter" && typeof value === "string") {
46
- enter = value;
47
- } else if (key === "exit" && typeof value === "string") {
48
- exit = value;
49
- } else if (isSpringConfigKey(key) && value !== void 0) {
50
- springConfig[key] = value;
51
- } else if (value !== void 0) {
52
- properties[key] = value;
53
- }
54
- }
55
- } catch (err) {
56
- _didIteratorError = true;
57
- _iteratorError = err;
58
- } finally {
59
- try {
60
- if (!_iteratorNormalCompletion && _iterator.return != null) {
61
- _iterator.return();
62
- }
63
- } finally {
64
- if (_didIteratorError) {
65
- throw _iteratorError;
66
- }
67
- }
68
- }
69
- }
70
- return {
71
- default: defaultAnimation,
72
- enter,
73
- exit,
74
- delay,
75
- properties,
76
- config: Object.keys(springConfig).length > 0 ? springConfig : void 0
77
- };
78
- }
79
- if ((typeof transition === "undefined" ? "undefined" : _type_of(transition)) === "object") {
80
- var properties1 = {};
81
- var springConfig1 = {};
82
- var defaultAnimation1 = null;
83
- var enter1 = null;
84
- var exit1 = null;
85
- var delay1;
86
- var _iteratorNormalCompletion1 = true,
87
- _didIteratorError1 = false,
88
- _iteratorError1 = void 0;
89
- try {
90
- for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
91
- var [key1, value1] = _step1.value;
92
- if (key1 === "default" && typeof value1 === "string") {
93
- defaultAnimation1 = value1;
94
- } else if (key1 === "enter" && typeof value1 === "string") {
95
- enter1 = value1;
96
- } else if (key1 === "exit" && typeof value1 === "string") {
97
- exit1 = value1;
98
- } else if (key1 === "delay" && typeof value1 === "number") {
99
- delay1 = value1;
100
- } else if (isSpringConfigKey(key1) && value1 !== void 0) {
101
- springConfig1[key1] = value1;
102
- } else if (value1 !== void 0) {
103
- properties1[key1] = value1;
104
- }
105
- }
106
- } catch (err) {
107
- _didIteratorError1 = true;
108
- _iteratorError1 = err;
109
- } finally {
110
- try {
111
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
112
- _iterator1.return();
113
- }
114
- } finally {
115
- if (_didIteratorError1) {
116
- throw _iteratorError1;
117
- }
118
- }
119
- }
120
- return {
121
- default: defaultAnimation1,
122
- enter: enter1,
123
- exit: exit1,
124
- delay: delay1,
125
- properties: properties1,
126
- config: Object.keys(springConfig1).length > 0 ? springConfig1 : void 0
127
- };
128
- }
129
- return {
130
- default: null,
131
- enter: null,
132
- exit: null,
133
- delay: void 0,
134
- properties: {}
135
- };
21
+ if (!transition) {
22
+ return {
23
+ default: null,
24
+ enter: null,
25
+ exit: null,
26
+ delay: void 0,
27
+ properties: {}
28
+ };
29
+ }
30
+ if (typeof transition === "string") {
31
+ return {
32
+ default: transition,
33
+ enter: null,
34
+ exit: null,
35
+ delay: void 0,
36
+ properties: {}
37
+ };
38
+ }
39
+ if (Array.isArray(transition)) {
40
+ var [defaultAnimation, configObj] = transition;
41
+ var properties = {};
42
+ var springConfig = {};
43
+ var delay;
44
+ var enter = null;
45
+ var exit = null;
46
+ if (configObj && (typeof configObj === "undefined" ? "undefined" : _type_of(configObj)) === "object") {
47
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
48
+ try {
49
+ for (var _iterator = Object.entries(configObj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
50
+ var [key, value] = _step.value;
51
+ if (key === "delay" && typeof value === "number") {
52
+ delay = value;
53
+ } else if (key === "enter" && typeof value === "string") {
54
+ enter = value;
55
+ } else if (key === "exit" && typeof value === "string") {
56
+ exit = value;
57
+ } else if (isSpringConfigKey(key) && value !== void 0) {
58
+ springConfig[key] = value;
59
+ } else if (value !== void 0) {
60
+ properties[key] = value;
61
+ }
62
+ }
63
+ } catch (err) {
64
+ _didIteratorError = true;
65
+ _iteratorError = err;
66
+ } finally {
67
+ try {
68
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
69
+ _iterator.return();
70
+ }
71
+ } finally {
72
+ if (_didIteratorError) {
73
+ throw _iteratorError;
74
+ }
75
+ }
76
+ }
77
+ }
78
+ return {
79
+ default: defaultAnimation,
80
+ enter,
81
+ exit,
82
+ delay,
83
+ properties,
84
+ config: Object.keys(springConfig).length > 0 ? springConfig : void 0
85
+ };
86
+ }
87
+ if ((typeof transition === "undefined" ? "undefined" : _type_of(transition)) === "object") {
88
+ var properties1 = {};
89
+ var springConfig1 = {};
90
+ var defaultAnimation1 = null;
91
+ var enter1 = null;
92
+ var exit1 = null;
93
+ var delay1;
94
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
95
+ try {
96
+ for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
97
+ var [key1, value1] = _step1.value;
98
+ if (key1 === "default" && typeof value1 === "string") {
99
+ defaultAnimation1 = value1;
100
+ } else if (key1 === "enter" && typeof value1 === "string") {
101
+ enter1 = value1;
102
+ } else if (key1 === "exit" && typeof value1 === "string") {
103
+ exit1 = value1;
104
+ } else if (key1 === "delay" && typeof value1 === "number") {
105
+ delay1 = value1;
106
+ } else if (isSpringConfigKey(key1) && value1 !== void 0) {
107
+ springConfig1[key1] = value1;
108
+ } else if (value1 !== void 0) {
109
+ properties1[key1] = value1;
110
+ }
111
+ }
112
+ } catch (err) {
113
+ _didIteratorError1 = true;
114
+ _iteratorError1 = err;
115
+ } finally {
116
+ try {
117
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
118
+ _iterator1.return();
119
+ }
120
+ } finally {
121
+ if (_didIteratorError1) {
122
+ throw _iteratorError1;
123
+ }
124
+ }
125
+ }
126
+ return {
127
+ default: defaultAnimation1,
128
+ enter: enter1,
129
+ exit: exit1,
130
+ delay: delay1,
131
+ properties: properties1,
132
+ config: Object.keys(springConfig1).length > 0 ? springConfig1 : void 0
133
+ };
134
+ }
135
+ return {
136
+ default: null,
137
+ enter: null,
138
+ exit: null,
139
+ delay: void 0,
140
+ properties: {}
141
+ };
136
142
  }
137
143
  function getAnimationForProperty(normalized, property) {
138
- var propertyAnimation = normalized.properties[property];
139
- if (propertyAnimation !== void 0) {
140
- return propertyAnimation;
141
- }
142
- return normalized.default;
144
+ var propertyAnimation = normalized.properties[property];
145
+ if (propertyAnimation !== void 0) {
146
+ return propertyAnimation;
147
+ }
148
+ return normalized.default;
143
149
  }
144
150
  function hasAnimation(normalized) {
145
- return normalized.default !== null || normalized.enter !== null || normalized.exit !== null || Object.keys(normalized.properties).length > 0;
151
+ return normalized.default !== null || normalized.enter !== null || normalized.exit !== null || Object.keys(normalized.properties).length > 0;
146
152
  }
147
153
  function getAnimatedProperties(normalized) {
148
- return Object.keys(normalized.properties);
154
+ return Object.keys(normalized.properties);
149
155
  }
150
156
  function getEffectiveAnimation(normalized, state) {
151
- if (state === "enter" && normalized.enter) {
152
- return normalized.enter;
153
- }
154
- if (state === "exit" && normalized.exit) {
155
- return normalized.exit;
156
- }
157
- return normalized.default;
157
+ if (state === "enter" && normalized.enter) {
158
+ return normalized.enter;
159
+ }
160
+ if (state === "exit" && normalized.exit) {
161
+ return normalized.exit;
162
+ }
163
+ return normalized.default;
158
164
  }
159
165
  function getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation) {
160
- var result = /* @__PURE__ */new Map();
161
- var _iteratorNormalCompletion = true,
162
- _didIteratorError = false,
163
- _iteratorError = void 0;
164
- try {
165
- for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
166
- var key = _step.value;
167
- var propAnimation = normalized.properties[key];
168
- var animationValue = null;
169
- if (typeof propAnimation === "string") {
170
- var _animations_propAnimation;
171
- animationValue = (_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : null;
172
- } else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object" && propAnimation.type) {
173
- var _animations_propAnimation_type;
174
- animationValue = (_animations_propAnimation_type = animations[propAnimation.type]) !== null && _animations_propAnimation_type !== void 0 ? _animations_propAnimation_type : null;
175
- }
176
- if (animationValue === null) {
177
- animationValue = defaultAnimation;
178
- }
179
- result.set(key, animationValue);
180
- }
181
- } catch (err) {
182
- _didIteratorError = true;
183
- _iteratorError = err;
184
- } finally {
185
- try {
186
- if (!_iteratorNormalCompletion && _iterator.return != null) {
187
- _iterator.return();
188
- }
189
- } finally {
190
- if (_didIteratorError) {
191
- throw _iteratorError;
192
- }
193
- }
194
- }
195
- return result;
166
+ var result = /* @__PURE__ */ new Map();
167
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
168
+ try {
169
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
170
+ var key = _step.value;
171
+ var propAnimation = normalized.properties[key];
172
+ var animationValue = null;
173
+ if (typeof propAnimation === "string") {
174
+ var _animations_propAnimation;
175
+ animationValue = (_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : null;
176
+ } else if (propAnimation && (typeof propAnimation === "undefined" ? "undefined" : _type_of(propAnimation)) === "object" && propAnimation.type) {
177
+ var _animations_propAnimation_type;
178
+ animationValue = (_animations_propAnimation_type = animations[propAnimation.type]) !== null && _animations_propAnimation_type !== void 0 ? _animations_propAnimation_type : null;
179
+ }
180
+ if (animationValue === null) {
181
+ animationValue = defaultAnimation;
182
+ }
183
+ result.set(key, animationValue);
184
+ }
185
+ } catch (err) {
186
+ _didIteratorError = true;
187
+ _iteratorError = err;
188
+ } finally {
189
+ try {
190
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
191
+ _iterator.return();
192
+ }
193
+ } finally {
194
+ if (_didIteratorError) {
195
+ throw _iteratorError;
196
+ }
197
+ }
198
+ }
199
+ return result;
196
200
  }
201
+
197
202
  export { getAnimatedProperties, getAnimationConfigsForKeys, getAnimationForProperty, getEffectiveAnimation, hasAnimation, normalizeTransition };
198
203
  //# sourceMappingURL=normalizeTransition.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_type_of","obj","Symbol","constructor","SPRING_CONFIG_KEYS","Set","isSpringConfigKey","key","has","normalizeTransition","transition","default","enter","exit","delay","properties","Array","isArray","defaultAnimation","configObj","springConfig","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","value","err","return","config","keys","length","properties1","springConfig1","defaultAnimation1","enter1","exit1","delay1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","value1","getAnimationForProperty","normalized","property"],"sources":["../../src/normalizeTransition.ts"],"sourcesContent":[null],"mappings":"AAOA,SAAMA,SAAAC,GAAA;EACJ;;EACA,OAAAA,GAAA,WAAAC,MAAA,oBAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAAA;AACA,IACAG,kBAAA,sBAAAC,GAAA,EACA,aACA,WACA,QACA,WACA,YACA,YACD,qBAKD,UAAS,EACP,YAAO,EACT,QAcO;AAIL,SAAKC,iBAAYA,CAAAC,GAAA;EACf,OAAAH,kBAAO,CAAAI,GAAA,CAAAD,GAAA;AAAA;AACI,SACTE,mBAAOA,CAAAC,UAAA;EAAA,IACP,CAAAA,UAAM;IAAA,OACN;MACAC,OAAA,MAAa;MACfC,KAAA;MACFC,IAAA;MAGIC,KAAA,EAAO;MACTC,UAAO;IAAA;EACI;EACF,IACP,OAAML,UAAA;IAAA,OACN;MACAC,OAAA,EAAAD,UAAa;MACfE,KAAA;MACFC,IAAA;MAIIC,KAAA,EAAM;MACRC,UAAO;IACP;EACA;EACA,IAAAC,KAAI,CAAAC,OAAA,CAAAP,UAAA;IACJ,IAAI,CAAAQ,gBAAuB,EAAAC,SAAA,IAAAT,UAAA;IAC3B,IAAIK,UAAsB;IAE1B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,IAAA,EAAA4B,KAAW;MACT3B,KAAM,EAAA4B,MAAA;MACN3B,UAAI,EAAAsB,WAA2B;MAE/BH,MAAI,EAAAT,MAAO,CAAAU,IAAA,CAAAG,aAAkB,EAAAF,MAAU,OAAAE,aAAA;IACrC;EAA8C;EAM9C;IACF3B,OAAA;IAGAC,KAAI;IACFC,IAAA;IACFC,KAAA;IAEAC,UAAO,EAAI;EACb;AAEA;AACF,SAAAmC,wBAAAC,UAAA,EAAAC,QAAA","ignoreList":[]}
1
+ {"version":3,"file":"normalizeTransition.native.js","names":[],"sources":["esm/normalizeTransition.native.js"],"sourcesContent":["function _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar SPRING_CONFIG_KEYS = /* @__PURE__ */ new Set([\n \"stiffness\",\n \"damping\",\n \"mass\",\n \"tension\",\n \"friction\",\n \"velocity\",\n \"overshootClamping\",\n \"duration\",\n \"bounciness\",\n \"speed\"\n]);\nfunction isSpringConfigKey(key) {\n return SPRING_CONFIG_KEYS.has(key);\n}\nfunction normalizeTransition(transition) {\n if (!transition) {\n return {\n default: null,\n enter: null,\n exit: null,\n delay: void 0,\n properties: {}\n };\n }\n if (typeof transition === \"string\") {\n return {\n default: transition,\n enter: null,\n exit: null,\n delay: void 0,\n properties: {}\n };\n }\n if (Array.isArray(transition)) {\n var [defaultAnimation, configObj] = transition;\n var properties = {};\n var springConfig = {};\n var delay;\n var enter = null;\n var exit = null;\n if (configObj && (typeof configObj === \"undefined\" ? \"undefined\" : _type_of(configObj)) === \"object\") {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(configObj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, value] = _step.value;\n if (key === \"delay\" && typeof value === \"number\") {\n delay = value;\n } else if (key === \"enter\" && typeof value === \"string\") {\n enter = value;\n } else if (key === \"exit\" && typeof value === \"string\") {\n exit = value;\n } else if (isSpringConfigKey(key) && value !== void 0) {\n springConfig[key] = value;\n } else if (value !== void 0) {\n properties[key] = value;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n return {\n default: defaultAnimation,\n enter,\n exit,\n delay,\n properties,\n config: Object.keys(springConfig).length > 0 ? springConfig : void 0\n };\n }\n if ((typeof transition === \"undefined\" ? \"undefined\" : _type_of(transition)) === \"object\") {\n var properties1 = {};\n var springConfig1 = {};\n var defaultAnimation1 = null;\n var enter1 = null;\n var exit1 = null;\n var delay1;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [key1, value1] = _step1.value;\n if (key1 === \"default\" && typeof value1 === \"string\") {\n defaultAnimation1 = value1;\n } else if (key1 === \"enter\" && typeof value1 === \"string\") {\n enter1 = value1;\n } else if (key1 === \"exit\" && typeof value1 === \"string\") {\n exit1 = value1;\n } else if (key1 === \"delay\" && typeof value1 === \"number\") {\n delay1 = value1;\n } else if (isSpringConfigKey(key1) && value1 !== void 0) {\n springConfig1[key1] = value1;\n } else if (value1 !== void 0) {\n properties1[key1] = value1;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return {\n default: defaultAnimation1,\n enter: enter1,\n exit: exit1,\n delay: delay1,\n properties: properties1,\n config: Object.keys(springConfig1).length > 0 ? springConfig1 : void 0\n };\n }\n return {\n default: null,\n enter: null,\n exit: null,\n delay: void 0,\n properties: {}\n };\n}\nfunction getAnimationForProperty(normalized, property) {\n var propertyAnimation = normalized.properties[property];\n if (propertyAnimation !== void 0) {\n return propertyAnimation;\n }\n return normalized.default;\n}\nfunction hasAnimation(normalized) {\n return normalized.default !== null || normalized.enter !== null || normalized.exit !== null || Object.keys(normalized.properties).length > 0;\n}\nfunction getAnimatedProperties(normalized) {\n return Object.keys(normalized.properties);\n}\nfunction getEffectiveAnimation(normalized, state) {\n if (state === \"enter\" && normalized.enter) {\n return normalized.enter;\n }\n if (state === \"exit\" && normalized.exit) {\n return normalized.exit;\n }\n return normalized.default;\n}\nfunction getAnimationConfigsForKeys(normalized, animations, keys, defaultAnimation) {\n var result = /* @__PURE__ */ new Map();\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n var propAnimation = normalized.properties[key];\n var animationValue = null;\n if (typeof propAnimation === \"string\") {\n var _animations_propAnimation;\n animationValue = (_animations_propAnimation = animations[propAnimation]) !== null && _animations_propAnimation !== void 0 ? _animations_propAnimation : null;\n } else if (propAnimation && (typeof propAnimation === \"undefined\" ? \"undefined\" : _type_of(propAnimation)) === \"object\" && propAnimation.type) {\n var _animations_propAnimation_type;\n animationValue = (_animations_propAnimation_type = animations[propAnimation.type]) !== null && _animations_propAnimation_type !== void 0 ? _animations_propAnimation_type : null;\n }\n if (animationValue === null) {\n animationValue = defaultAnimation;\n }\n result.set(key, animationValue);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return result;\n}\nexport {\n getAnimatedProperties,\n getAnimationConfigsForKeys,\n getAnimationForProperty,\n getEffectiveAnimation,\n hasAnimation,\n normalizeTransition\n};\n//# sourceMappingURL=normalizeTransition.js.map\n"],"mappings":";AAAA,SAAS,SAAS,KAAK;CACrB;CACA,OAAO,OAAO,OAAO,WAAW,eAAe,IAAI,gBAAgB,SAAS,WAAW,OAAO;AAChG;AACA,IAAI,qCAAqC,IAAI,IAAI;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,kBAAkB,KAAK;CAC9B,OAAO,mBAAmB,IAAI,GAAG;AACnC;AACA,SAAS,oBAAoB,YAAY;CACvC,IAAI,CAAC,YAAY;EACf,OAAO;GACL,SAAS;GACT,OAAO;GACP,MAAM;GACN,OAAO,KAAK;GACZ,YAAY,CAAC;EACf;CACF;CACA,IAAI,OAAO,eAAe,UAAU;EAClC,OAAO;GACL,SAAS;GACT,OAAO;GACP,MAAM;GACN,OAAO,KAAK;GACZ,YAAY,CAAC;EACf;CACF;CACA,IAAI,MAAM,QAAQ,UAAU,GAAG;EAC7B,IAAI,CAAC,kBAAkB,aAAa;EACpC,IAAI,aAAa,CAAC;EAClB,IAAI,eAAe,CAAC;EACpB,IAAI;EACJ,IAAI,QAAQ;EACZ,IAAI,OAAO;EACX,IAAI,cAAc,OAAO,cAAc,cAAc,cAAc,SAAS,SAAS,OAAO,UAAU;GACpG,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;GACvF,IAAI;IACF,KAAK,IAAI,YAAY,OAAO,QAAQ,SAAS,EAAE,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;KAC1K,IAAI,CAAC,KAAK,SAAS,MAAM;KACzB,IAAI,QAAQ,WAAW,OAAO,UAAU,UAAU;MAChD,QAAQ;KACV,OAAO,IAAI,QAAQ,WAAW,OAAO,UAAU,UAAU;MACvD,QAAQ;KACV,OAAO,IAAI,QAAQ,UAAU,OAAO,U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rJ,IAAI,MAAM,MAAM;GAChB,IAAI,gBAAgB,WAAW,WAAW;GAC1C,IAAI,iBAAiB;GACrB,IAAI,OAAO,kBAAkB,UAAU;IACrC,IAAI;IACJ,kBAAkB,4BAA4B,WAAW,oBAAoB,QAAQ,8BAA8B,KAAK,IAAI,4BAA4B;GAC1J,OAAO,IAAI,kBAAkB,OAAO,kBAAkB,cAAc,cAAc,SAAS,aAAa,OAAO,YAAY,cAAc,MAAM;IAC7I,IAAI;IACJ,kBAAkB,iCAAiC,WAAW,cAAc,WAAW,QAAQ,mCAAmC,KAAK,IAAI,iCAAiC;GAC9K;GACA,IAAI,mBAAmB,MAAM;IAC3B,iBAAiB;GACnB;GACA,OAAO,IAAI,KAAK,cAAc;EAChC;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO;AACT"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.mjs.map
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.native.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/animation-helpers",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.643.1",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",
@@ -36,7 +36,7 @@
36
36
  "clean:build": "tamagui-build clean:build"
37
37
  },
38
38
  "devDependencies": {
39
- "@tamagui/build": "2.7.7"
39
+ "@tamagui/build": "3.0.0-beta.643.1"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",
@@ -1 +0,0 @@
1
- {"version":3,"names":["normalizeTransition","getAnimationForProperty","hasAnimation","getAnimatedProperties","getEffectiveAnimation","getAnimationConfigsForKeys"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,mBAAA,EACAC,uBAAA,EACAC,YAAA,EACAC,qBAAA,EACAC,qBAAA,EACAC,0BAAA,QACK","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["normalizeTransition","getAnimationForProperty","hasAnimation","getAnimatedProperties","getEffectiveAnimation","getAnimationConfigsForKeys"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,mBAAA,EACAC,uBAAA,EACAC,YAAA,EACAC,qBAAA,EACAC,qBAAA,EACAC,0BAAA,QACK","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["normalizeTransition","getAnimationForProperty","hasAnimation","getAnimatedProperties","getEffectiveAnimation","getAnimationConfigsForKeys"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,mBAAA,EAAAC,uBAAA,EAAAC,YAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,0BAAA;AAAA,SAEEF,qBAAA,EACAE,0BAAA,EACAJ,uBAAA,EACAG,qBAAA,EACAF,YAAA,EAAAF,mBACK","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}