@tamagui/animation-helpers 2.0.0-1768427228811

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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/index.cjs +29 -0
  3. package/dist/cjs/index.js +24 -0
  4. package/dist/cjs/index.js.map +6 -0
  5. package/dist/cjs/index.native.js +32 -0
  6. package/dist/cjs/index.native.js.map +1 -0
  7. package/dist/cjs/normalizeTransition.cjs +76 -0
  8. package/dist/cjs/normalizeTransition.js +75 -0
  9. package/dist/cjs/normalizeTransition.js.map +6 -0
  10. package/dist/cjs/normalizeTransition.native.js +118 -0
  11. package/dist/cjs/normalizeTransition.native.js.map +1 -0
  12. package/dist/cjs/types.cjs +16 -0
  13. package/dist/cjs/types.js +14 -0
  14. package/dist/cjs/types.js.map +6 -0
  15. package/dist/cjs/types.native.js +19 -0
  16. package/dist/cjs/types.native.js.map +1 -0
  17. package/dist/esm/index.js +13 -0
  18. package/dist/esm/index.js.map +6 -0
  19. package/dist/esm/index.mjs +3 -0
  20. package/dist/esm/index.mjs.map +1 -0
  21. package/dist/esm/index.native.js +3 -0
  22. package/dist/esm/index.native.js.map +1 -0
  23. package/dist/esm/normalizeTransition.js +59 -0
  24. package/dist/esm/normalizeTransition.js.map +6 -0
  25. package/dist/esm/normalizeTransition.mjs +50 -0
  26. package/dist/esm/normalizeTransition.mjs.map +1 -0
  27. package/dist/esm/normalizeTransition.native.js +89 -0
  28. package/dist/esm/normalizeTransition.native.js.map +1 -0
  29. package/dist/esm/types.js +1 -0
  30. package/dist/esm/types.js.map +6 -0
  31. package/dist/esm/types.mjs +2 -0
  32. package/dist/esm/types.mjs.map +1 -0
  33. package/dist/esm/types.native.js +2 -0
  34. package/dist/esm/types.native.js.map +1 -0
  35. package/package.json +46 -0
  36. package/src/index.ts +12 -0
  37. package/src/normalizeTransition.ts +123 -0
  38. package/src/types.ts +33 -0
  39. package/types/index.d.ts +4 -0
  40. package/types/index.d.ts.map +11 -0
  41. package/types/normalizeTransition.d.ts +33 -0
  42. package/types/normalizeTransition.d.ts.map +11 -0
  43. package/types/types.d.ts +33 -0
  44. package/types/types.d.ts.map +11 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,
24
+ getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,
25
+ hasAnimation: () => import_normalizeTransition.hasAnimation,
26
+ normalizeTransition: () => import_normalizeTransition.normalizeTransition
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+ var import_normalizeTransition = require("./normalizeTransition.cjs");
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var index_exports = {};
16
+ __export(index_exports, {
17
+ getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,
18
+ getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,
19
+ hasAnimation: () => import_normalizeTransition.hasAnimation,
20
+ normalizeTransition: () => import_normalizeTransition.normalizeTransition
21
+ });
22
+ module.exports = __toCommonJS(index_exports);
23
+ var import_normalizeTransition = require("./normalizeTransition");
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKO;",
5
+ "names": []
6
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var index_exports = {};
24
+ __export(index_exports, {
25
+ getAnimatedProperties: () => import_normalizeTransition.getAnimatedProperties,
26
+ getAnimationForProperty: () => import_normalizeTransition.getAnimationForProperty,
27
+ hasAnimation: () => import_normalizeTransition.hasAnimation,
28
+ normalizeTransition: () => import_normalizeTransition.normalizeTransition
29
+ });
30
+ module.exports = __toCommonJS(index_exports);
31
+ var import_normalizeTransition = require("./normalizeTransition.native.js");
32
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","getAnimatedProperties","import_normalizeTransition","getAnimationForProperty","hasAnimation","normalizeTransition","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAC,0BAAA,CAAAD,qBAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAD,0BAAA,CAAAC,uBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAF,0BAAA,CAAAE,YAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAH,0BAAA,CAAAG;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAb,YAAA,CAAAK,aAKO","ignoreList":[]}
@@ -0,0 +1,76 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var normalizeTransition_exports = {};
22
+ __export(normalizeTransition_exports, {
23
+ getAnimatedProperties: () => getAnimatedProperties,
24
+ getAnimationForProperty: () => getAnimationForProperty,
25
+ hasAnimation: () => hasAnimation,
26
+ normalizeTransition: () => normalizeTransition
27
+ });
28
+ module.exports = __toCommonJS(normalizeTransition_exports);
29
+ function normalizeTransition(transition) {
30
+ if (!transition) return {
31
+ default: null,
32
+ delay: void 0,
33
+ properties: {}
34
+ };
35
+ if (typeof transition == "string") return {
36
+ default: transition,
37
+ delay: void 0,
38
+ properties: {}
39
+ };
40
+ if (Array.isArray(transition)) {
41
+ const [defaultAnimation, config] = transition,
42
+ properties = {};
43
+ let delay;
44
+ if (config && typeof config == "object") for (const [key, value] of Object.entries(config)) key === "delay" && typeof value == "number" ? delay = value : value !== void 0 && (properties[key] = value);
45
+ return {
46
+ default: defaultAnimation,
47
+ delay,
48
+ properties
49
+ };
50
+ }
51
+ if (typeof transition == "object") {
52
+ const properties = {};
53
+ let defaultAnimation = null;
54
+ for (const [key, value] of Object.entries(transition)) key === "default" && typeof value == "string" ? defaultAnimation = value : value !== void 0 && (properties[key] = value);
55
+ return {
56
+ default: defaultAnimation,
57
+ delay: void 0,
58
+ properties
59
+ };
60
+ }
61
+ return {
62
+ default: null,
63
+ delay: void 0,
64
+ properties: {}
65
+ };
66
+ }
67
+ function getAnimationForProperty(normalized, property) {
68
+ const propertyAnimation = normalized.properties[property];
69
+ return propertyAnimation !== void 0 ? propertyAnimation : normalized.default;
70
+ }
71
+ function hasAnimation(normalized) {
72
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0;
73
+ }
74
+ function getAnimatedProperties(normalized) {
75
+ return Object.keys(normalized.properties);
76
+ }
@@ -0,0 +1,75 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var normalizeTransition_exports = {};
16
+ __export(normalizeTransition_exports, {
17
+ getAnimatedProperties: () => getAnimatedProperties,
18
+ getAnimationForProperty: () => getAnimationForProperty,
19
+ hasAnimation: () => hasAnimation,
20
+ normalizeTransition: () => normalizeTransition
21
+ });
22
+ module.exports = __toCommonJS(normalizeTransition_exports);
23
+ function normalizeTransition(transition) {
24
+ if (!transition)
25
+ return {
26
+ default: null,
27
+ delay: void 0,
28
+ properties: {}
29
+ };
30
+ if (typeof transition == "string")
31
+ return {
32
+ default: transition,
33
+ delay: void 0,
34
+ properties: {}
35
+ };
36
+ if (Array.isArray(transition)) {
37
+ const [defaultAnimation, config] = transition, properties = {};
38
+ let delay;
39
+ if (config && typeof config == "object")
40
+ for (const [key, value] of Object.entries(config))
41
+ key === "delay" && typeof value == "number" ? delay = value : value !== void 0 && (properties[key] = value);
42
+ return {
43
+ default: defaultAnimation,
44
+ delay,
45
+ properties
46
+ };
47
+ }
48
+ if (typeof transition == "object") {
49
+ const properties = {};
50
+ let defaultAnimation = null;
51
+ for (const [key, value] of Object.entries(transition))
52
+ key === "default" && typeof value == "string" ? defaultAnimation = value : value !== void 0 && (properties[key] = value);
53
+ return {
54
+ default: defaultAnimation,
55
+ delay: void 0,
56
+ properties
57
+ };
58
+ }
59
+ return {
60
+ default: null,
61
+ delay: void 0,
62
+ properties: {}
63
+ };
64
+ }
65
+ function getAnimationForProperty(normalized, property) {
66
+ const propertyAnimation = normalized.properties[property];
67
+ return propertyAnimation !== void 0 ? propertyAnimation : normalized.default;
68
+ }
69
+ function hasAnimation(normalized) {
70
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0;
71
+ }
72
+ function getAnimatedProperties(normalized) {
73
+ return Object.keys(normalized.properties);
74
+ }
75
+ //# sourceMappingURL=normalizeTransition.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/normalizeTransition.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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O,OAAO,KAAK,WAAW,UAAU;AAC1C;",
5
+ "names": []
6
+ }
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var normalizeTransition_exports = {};
24
+ __export(normalizeTransition_exports, {
25
+ getAnimatedProperties: () => getAnimatedProperties,
26
+ getAnimationForProperty: () => getAnimationForProperty,
27
+ hasAnimation: () => hasAnimation,
28
+ normalizeTransition: () => normalizeTransition
29
+ });
30
+ module.exports = __toCommonJS(normalizeTransition_exports);
31
+ function _type_of(obj) {
32
+ "@swc/helpers - typeof";
33
+
34
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
35
+ }
36
+ function normalizeTransition(transition) {
37
+ if (!transition) return {
38
+ default: null,
39
+ delay: void 0,
40
+ properties: {}
41
+ };
42
+ if (typeof transition == "string") return {
43
+ default: transition,
44
+ delay: void 0,
45
+ properties: {}
46
+ };
47
+ if (Array.isArray(transition)) {
48
+ var [defaultAnimation, config] = transition,
49
+ properties = {},
50
+ delay;
51
+ if (config && (typeof config > "u" ? "undefined" : _type_of(config)) === "object") {
52
+ var _iteratorNormalCompletion = !0,
53
+ _didIteratorError = !1,
54
+ _iteratorError = void 0;
55
+ try {
56
+ for (var _iterator = Object.entries(config)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
57
+ var [key, value] = _step.value;
58
+ key === "delay" && typeof value == "number" ? delay = value : value !== void 0 && (properties[key] = value);
59
+ }
60
+ } catch (err) {
61
+ _didIteratorError = !0, _iteratorError = err;
62
+ } finally {
63
+ try {
64
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
65
+ } finally {
66
+ if (_didIteratorError) throw _iteratorError;
67
+ }
68
+ }
69
+ }
70
+ return {
71
+ default: defaultAnimation,
72
+ delay,
73
+ properties
74
+ };
75
+ }
76
+ if ((typeof transition > "u" ? "undefined" : _type_of(transition)) === "object") {
77
+ var properties1 = {},
78
+ defaultAnimation1 = null,
79
+ _iteratorNormalCompletion1 = !0,
80
+ _didIteratorError1 = !1,
81
+ _iteratorError1 = void 0;
82
+ try {
83
+ for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
84
+ var [key1, value1] = _step1.value;
85
+ key1 === "default" && typeof value1 == "string" ? defaultAnimation1 = value1 : value1 !== void 0 && (properties1[key1] = value1);
86
+ }
87
+ } catch (err) {
88
+ _didIteratorError1 = !0, _iteratorError1 = err;
89
+ } finally {
90
+ try {
91
+ !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
92
+ } finally {
93
+ if (_didIteratorError1) throw _iteratorError1;
94
+ }
95
+ }
96
+ return {
97
+ default: defaultAnimation1,
98
+ delay: void 0,
99
+ properties: properties1
100
+ };
101
+ }
102
+ return {
103
+ default: null,
104
+ delay: void 0,
105
+ properties: {}
106
+ };
107
+ }
108
+ function getAnimationForProperty(normalized, property) {
109
+ var propertyAnimation = normalized.properties[property];
110
+ return propertyAnimation !== void 0 ? propertyAnimation : normalized.default;
111
+ }
112
+ function hasAnimation(normalized) {
113
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0;
114
+ }
115
+ function getAnimatedProperties(normalized) {
116
+ return Object.keys(normalized.properties);
117
+ }
118
+ //# sourceMappingURL=normalizeTransition.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","normalizeTransition_exports","__export","getAnimatedProperties","getAnimationForProperty","hasAnimation","normalizeTransition","module","exports","_type_of","obj","Symbol","constructor","transition","default","delay","properties","Array","isArray","defaultAnimation","config","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","key","err","return","properties1","defaultAnimation1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","value1"],"sources":["../../src/normalizeTransition.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAA,qBAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAaOC,MAAA,CAAAC,OAAS,GAAAZ,YACd,CAAAK,2BACsB;AAEtB,SAAKQ,SAAAC,GAAA;EACH,uBAAO;;EAAA,OACLA,GAAA,IAAS,OAAAC,MAAA,UAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAAA;AACF,SACPJ,mBAAaA,CAAAO,UAAA;EAAA,IACf,CAAAA,UAAA,EAIF,OAAI;IACFC,OAAO;IACLC,KAAA,OAAS;IACTC,UAAO;EAAA;EACM,IACf,OAAAH,UAAA,cAIF,OAAI;IACFC,OAAO,EAAAD,UAAA;IAEPE,KAAI;IAEJC,UAAI,EAAU;EACZ;EAC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,GAAAM,0BAAA;QACpF,KAAAK,IAAA,EAAAC,MAAA,IAAAF,MAAA,CAAAxC,KAAA;QAMOyC,IAAS,yBAAsBC,MAA4C,eAAAP,iBAAA,GAAAO,MAAA,GAAAA,MAAA,gBAAAR,WAAA,CAAAO,IAAA,IAAAC,MAAA;MAChF;IACF,SAAAV,GAAA","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
+ get: () => from[key],
8
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
+ });
10
+ return to;
11
+ };
12
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
13
+ value: !0
14
+ }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,14 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function")
7
+ for (let key of __getOwnPropNames(from))
8
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
+ return to;
10
+ };
11
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
+ var types_exports = {};
13
+ module.exports = __toCommonJS(types_exports);
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/types.ts"],
4
+ "mappings": ";;;;;;;;;;;AAAA;AAAA;",
5
+ "names": []
6
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ return to;
13
+ };
14
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
+ value: !0
16
+ }), mod);
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import {
2
+ normalizeTransition,
3
+ getAnimationForProperty,
4
+ hasAnimation,
5
+ getAnimatedProperties
6
+ } from "./normalizeTransition";
7
+ export {
8
+ getAnimatedProperties,
9
+ getAnimationForProperty,
10
+ hasAnimation,
11
+ normalizeTransition
12
+ };
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
5
+ "names": []
6
+ }
@@ -0,0 +1,3 @@
1
+ import { normalizeTransition, getAnimationForProperty, hasAnimation, getAnimatedProperties } from "./normalizeTransition.mjs";
2
+ export { getAnimatedProperties, getAnimationForProperty, hasAnimation, normalizeTransition };
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeTransition","getAnimationForProperty","hasAnimation","getAnimatedProperties"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,mBAAA,EACAC,uBAAA,EACAC,YAAA,EACAC,qBAAA,QACK","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { normalizeTransition, getAnimationForProperty, hasAnimation, getAnimatedProperties } from "./normalizeTransition.native.js";
2
+ export { getAnimatedProperties, getAnimationForProperty, hasAnimation, normalizeTransition };
3
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeTransition","getAnimationForProperty","hasAnimation","getAnimatedProperties"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,mBAAA,EAAAC,uBAAA,EAAAC,YAAA,EAAAC,qBAAA;AAAA,SAEEA,qBAAA,EACAF,uBAAA,EACAC,YAAA,EAAAF,mBACK","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ function normalizeTransition(transition) {
2
+ if (!transition)
3
+ return {
4
+ default: null,
5
+ delay: void 0,
6
+ properties: {}
7
+ };
8
+ if (typeof transition == "string")
9
+ return {
10
+ default: transition,
11
+ delay: void 0,
12
+ properties: {}
13
+ };
14
+ if (Array.isArray(transition)) {
15
+ const [defaultAnimation, config] = transition, properties = {};
16
+ let delay;
17
+ if (config && typeof config == "object")
18
+ for (const [key, value] of Object.entries(config))
19
+ key === "delay" && typeof value == "number" ? delay = value : value !== void 0 && (properties[key] = value);
20
+ return {
21
+ default: defaultAnimation,
22
+ delay,
23
+ properties
24
+ };
25
+ }
26
+ if (typeof transition == "object") {
27
+ const properties = {};
28
+ let defaultAnimation = null;
29
+ for (const [key, value] of Object.entries(transition))
30
+ key === "default" && typeof value == "string" ? defaultAnimation = value : value !== void 0 && (properties[key] = value);
31
+ return {
32
+ default: defaultAnimation,
33
+ delay: void 0,
34
+ properties
35
+ };
36
+ }
37
+ return {
38
+ default: null,
39
+ delay: void 0,
40
+ properties: {}
41
+ };
42
+ }
43
+ function getAnimationForProperty(normalized, property) {
44
+ const propertyAnimation = normalized.properties[property];
45
+ return propertyAnimation !== void 0 ? propertyAnimation : normalized.default;
46
+ }
47
+ function hasAnimation(normalized) {
48
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0;
49
+ }
50
+ function getAnimatedProperties(normalized) {
51
+ return Object.keys(normalized.properties);
52
+ }
53
+ export {
54
+ getAnimatedProperties,
55
+ getAnimationForProperty,
56
+ hasAnimation,
57
+ normalizeTransition
58
+ };
59
+ //# sourceMappingURL=normalizeTransition.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/normalizeTransition.ts"],
4
+ "mappings": "AAaO,SAAS,oBACd,YACsB;AAEtB,MAAI,CAAC;AACH,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,MACP,YAAY,CAAC;AAAA,IACf;AAIF,MAAI,OAAO,cAAe;AACxB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,MACP,YAAY,CAAC;AAAA,IACf;AAIF,MAAI,MAAM,QAAQ,UAAU,GAAG;AAC7B,UAAM,CAAC,kBAAkB,MAAM,IAAI,YAC7B,aAAuD,CAAC;AAC9D,QAAI;AAEJ,QAAI,UAAU,OAAO,UAAW;AAC9B,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM;AAC9C,QAAI,QAAQ,WAAW,OAAO,SAAU,WACtC,QAAQ,QACC,UAAU,WAEnB,WAAW,GAAG,IAAI;AAKxB,WAAO;AAAA,MACL,SAAS;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAGA,MAAI,OAAO,cAAe,UAAU;AAClC,UAAM,aAAuD,CAAC;AAC9D,QAAI,mBAAkC;AAEtC,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,UAAU;AAClD,MAAI,QAAQ,aAAa,OAAO,SAAU,WACxC,mBAAmB,QACV,UAAU,WAEnB,WAAW,GAAG,IAAI;AAItB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAGA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,IACP,YAAY,CAAC;AAAA,EACf;AACF;AAUO,SAAS,wBACd,YACA,UACiC;AAEjC,QAAM,oBAAoB,WAAW,WAAW,QAAQ;AACxD,SAAI,sBAAsB,SACjB,oBAIF,WAAW;AACpB;AAKO,SAAS,aAAa,YAA2C;AACtE,SAAO,WAAW,YAAY,QAAQ,OAAO,KAAK,WAAW,UAAU,EAAE,SAAS;AACpF;AAMO,SAAS,sBAAsB,YAA4C;AAChF,SAAO,OAAO,KAAK,WAAW,UAAU;AAC1C;",
5
+ "names": []
6
+ }
@@ -0,0 +1,50 @@
1
+ function normalizeTransition(transition) {
2
+ if (!transition) return {
3
+ default: null,
4
+ delay: void 0,
5
+ properties: {}
6
+ };
7
+ if (typeof transition == "string") return {
8
+ default: transition,
9
+ delay: void 0,
10
+ properties: {}
11
+ };
12
+ if (Array.isArray(transition)) {
13
+ const [defaultAnimation, config] = transition,
14
+ properties = {};
15
+ let delay;
16
+ if (config && typeof config == "object") for (const [key, value] of Object.entries(config)) key === "delay" && typeof value == "number" ? delay = value : value !== void 0 && (properties[key] = value);
17
+ return {
18
+ default: defaultAnimation,
19
+ delay,
20
+ properties
21
+ };
22
+ }
23
+ if (typeof transition == "object") {
24
+ const properties = {};
25
+ let defaultAnimation = null;
26
+ for (const [key, value] of Object.entries(transition)) key === "default" && typeof value == "string" ? defaultAnimation = value : value !== void 0 && (properties[key] = value);
27
+ return {
28
+ default: defaultAnimation,
29
+ delay: void 0,
30
+ properties
31
+ };
32
+ }
33
+ return {
34
+ default: null,
35
+ delay: void 0,
36
+ properties: {}
37
+ };
38
+ }
39
+ function getAnimationForProperty(normalized, property) {
40
+ const propertyAnimation = normalized.properties[property];
41
+ return propertyAnimation !== void 0 ? propertyAnimation : normalized.default;
42
+ }
43
+ function hasAnimation(normalized) {
44
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0;
45
+ }
46
+ function getAnimatedProperties(normalized) {
47
+ return Object.keys(normalized.properties);
48
+ }
49
+ export { getAnimatedProperties, getAnimationForProperty, hasAnimation, normalizeTransition };
50
+ //# sourceMappingURL=normalizeTransition.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeTransition","transition","default","delay","properties","Array","isArray","defaultAnimation","config","key","value","Object","entries","getAnimationForProperty","normalized","property","propertyAnimation","hasAnimation","keys","length","getAnimatedProperties"],"sources":["../../src/normalizeTransition.ts"],"sourcesContent":[null],"mappings":"AAaO,SAASA,oBACdC,UAAA,EACsB;EAEtB,IAAI,CAACA,UAAA,EACH,OAAO;IACLC,OAAA,EAAS;IACTC,KAAA,EAAO;IACPC,UAAA,EAAY,CAAC;EACf;EAIF,IAAI,OAAOH,UAAA,IAAe,UACxB,OAAO;IACLC,OAAA,EAASD,UAAA;IACTE,KAAA,EAAO;IACPC,UAAA,EAAY,CAAC;EACf;EAIF,IAAIC,KAAA,CAAMC,OAAA,CAAQL,UAAU,GAAG;IAC7B,MAAM,CAACM,gBAAA,EAAkBC,MAAM,IAAIP,UAAA;MAC7BG,UAAA,GAAuD,CAAC;IAC9D,IAAID,KAAA;IAEJ,IAAIK,MAAA,IAAU,OAAOA,MAAA,IAAW,UAC9B,WAAW,CAACC,GAAA,EAAKC,KAAK,KAAKC,MAAA,CAAOC,OAAA,CAAQJ,MAAM,GAC1CC,GAAA,KAAQ,WAAW,OAAOC,KAAA,IAAU,WACtCP,KAAA,GAAQO,KAAA,GACCA,KAAA,KAAU,WAEnBN,UAAA,CAAWK,GAAG,IAAIC,KAAA;IAKxB,OAAO;MACLR,OAAA,EAASK,gBAAA;MACTJ,KAAA;MACAC;IACF;EACF;EAGA,IAAI,OAAOH,UAAA,IAAe,UAAU;IAClC,MAAMG,UAAA,GAAuD,CAAC;IAC9D,IAAIG,gBAAA,GAAkC;IAEtC,WAAW,CAACE,GAAA,EAAKC,KAAK,KAAKC,MAAA,CAAOC,OAAA,CAAQX,UAAU,GAC9CQ,GAAA,KAAQ,aAAa,OAAOC,KAAA,IAAU,WACxCH,gBAAA,GAAmBG,KAAA,GACVA,KAAA,KAAU,WAEnBN,UAAA,CAAWK,GAAG,IAAIC,KAAA;IAItB,OAAO;MACLR,OAAA,EAASK,gBAAA;MACTJ,KAAA,EAAO;MACPC;IACF;EACF;EAGA,OAAO;IACLF,OAAA,EAAS;IACTC,KAAA,EAAO;IACPC,UAAA,EAAY,CAAC;EACf;AACF;AAUO,SAASS,wBACdC,UAAA,EACAC,QAAA,EACiC;EAEjC,MAAMC,iBAAA,GAAoBF,UAAA,CAAWV,UAAA,CAAWW,QAAQ;EACxD,OAAIC,iBAAA,KAAsB,SACjBA,iBAAA,GAIFF,UAAA,CAAWZ,OAAA;AACpB;AAKO,SAASe,aAAaH,UAAA,EAA2C;EACtE,OAAOA,UAAA,CAAWZ,OAAA,KAAY,QAAQS,MAAA,CAAOO,IAAA,CAAKJ,UAAA,CAAWV,UAAU,EAAEe,MAAA,GAAS;AACpF;AAMO,SAASC,sBAAsBN,UAAA,EAA4C;EAChF,OAAOH,MAAA,CAAOO,IAAA,CAAKJ,UAAA,CAAWV,UAAU;AAC1C","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ function _type_of(obj) {
2
+ "@swc/helpers - typeof";
3
+
4
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
5
+ }
6
+ function normalizeTransition(transition) {
7
+ if (!transition) return {
8
+ default: null,
9
+ delay: void 0,
10
+ properties: {}
11
+ };
12
+ if (typeof transition == "string") return {
13
+ default: transition,
14
+ delay: void 0,
15
+ properties: {}
16
+ };
17
+ if (Array.isArray(transition)) {
18
+ var [defaultAnimation, config] = transition,
19
+ properties = {},
20
+ delay;
21
+ if (config && (typeof config > "u" ? "undefined" : _type_of(config)) === "object") {
22
+ var _iteratorNormalCompletion = !0,
23
+ _didIteratorError = !1,
24
+ _iteratorError = void 0;
25
+ try {
26
+ for (var _iterator = Object.entries(config)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
27
+ var [key, value] = _step.value;
28
+ key === "delay" && typeof value == "number" ? delay = value : value !== void 0 && (properties[key] = value);
29
+ }
30
+ } catch (err) {
31
+ _didIteratorError = !0, _iteratorError = err;
32
+ } finally {
33
+ try {
34
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
35
+ } finally {
36
+ if (_didIteratorError) throw _iteratorError;
37
+ }
38
+ }
39
+ }
40
+ return {
41
+ default: defaultAnimation,
42
+ delay,
43
+ properties
44
+ };
45
+ }
46
+ if ((typeof transition > "u" ? "undefined" : _type_of(transition)) === "object") {
47
+ var properties1 = {},
48
+ defaultAnimation1 = null,
49
+ _iteratorNormalCompletion1 = !0,
50
+ _didIteratorError1 = !1,
51
+ _iteratorError1 = void 0;
52
+ try {
53
+ for (var _iterator1 = Object.entries(transition)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
54
+ var [key1, value1] = _step1.value;
55
+ key1 === "default" && typeof value1 == "string" ? defaultAnimation1 = value1 : value1 !== void 0 && (properties1[key1] = value1);
56
+ }
57
+ } catch (err) {
58
+ _didIteratorError1 = !0, _iteratorError1 = err;
59
+ } finally {
60
+ try {
61
+ !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
62
+ } finally {
63
+ if (_didIteratorError1) throw _iteratorError1;
64
+ }
65
+ }
66
+ return {
67
+ default: defaultAnimation1,
68
+ delay: void 0,
69
+ properties: properties1
70
+ };
71
+ }
72
+ return {
73
+ default: null,
74
+ delay: void 0,
75
+ properties: {}
76
+ };
77
+ }
78
+ function getAnimationForProperty(normalized, property) {
79
+ var propertyAnimation = normalized.properties[property];
80
+ return propertyAnimation !== void 0 ? propertyAnimation : normalized.default;
81
+ }
82
+ function hasAnimation(normalized) {
83
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0;
84
+ }
85
+ function getAnimatedProperties(normalized) {
86
+ return Object.keys(normalized.properties);
87
+ }
88
+ export { getAnimatedProperties, getAnimationForProperty, hasAnimation, normalizeTransition };
89
+ //# sourceMappingURL=normalizeTransition.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_type_of","obj","Symbol","constructor","normalizeTransition","transition","default","delay","properties","Array","isArray","defaultAnimation","config","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","key","value","err","return","properties1","defaultAnimation1","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_iterator1","_step1","key1","value1"],"sources":["../../src/normalizeTransition.ts"],"sourcesContent":[null],"mappings":"AAaO,SAASA,SAAAC,GAAA;EAId,uBAAK;;EACH,OAAAA,GAAO,WAAAC,MAAA,UAAAD,GAAA,CAAAE,WAAA,KAAAD,MAAA,qBAAAD,GAAA;AAAA;AACI,SACTG,mBAAOA,CAAAC,UAAA;EAAA,IACP,CAAAA,UAAA,EACF;IAIEC,OAAO;IACTC,KAAO;IACLC,UAAS;EAAA;EACF,IACP,OAAAH,UAAa,cACf;IAIEC,OAAM,EAAAD,UAAQ;IAChBE,KAAO;IAEPC,UAAI;EAEJ;EACE,IAAAC,KAAA,CAAAC,OAAY,CAAAL,UAAU,GAAK;IACzB,IAAI,CAAAM,gBAAQ,EAAWC,MAAA,CAAO,GAAAP,UAAU;MAAAG,UACtC,GAAQ;MAAAD,KACC;IAOf,IAAAK,MAAO,YAAAA,MAAA,uBAAAZ,QAAA,CAAAY,MAAA;MACL,IAAAC,yBAAS;QAAAC,iBAA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A","ignoreList":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=types.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@tamagui/animation-helpers",
3
+ "version": "2.0.0-1768427228811",
4
+ "type": "module",
5
+ "source": "src/index.ts",
6
+ "sideEffects": false,
7
+ "license": "MIT",
8
+ "types": "./types/index.d.ts",
9
+ "main": "dist/cjs",
10
+ "module": "dist/esm",
11
+ "files": [
12
+ "src",
13
+ "types",
14
+ "dist"
15
+ ],
16
+ "exports": {
17
+ "./package.json": "./package.json",
18
+ ".": {
19
+ "react-native": {
20
+ "module": "./dist/esm/index.native.js",
21
+ "import": "./dist/esm/index.native.js",
22
+ "require": "./dist/cjs/index.native.js"
23
+ },
24
+ "types": "./types/index.d.ts",
25
+ "module": "./dist/esm/index.mjs",
26
+ "import": "./dist/esm/index.mjs",
27
+ "require": "./dist/cjs/index.cjs",
28
+ "default": "./dist/cjs/index.native.js"
29
+ }
30
+ },
31
+ "devDependencies": {
32
+ "@tamagui/build": "2.0.0-1768427228811"
33
+ },
34
+ "scripts": {
35
+ "build": "tamagui-build",
36
+ "watch": "tamagui-build --watch",
37
+ "clean": "tamagui-build clean",
38
+ "lint": "biome check src",
39
+ "lint:fix": "biome check --write src",
40
+ "clean:build": "tamagui-build clean:build"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
46
+ }
package/src/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ export {
2
+ normalizeTransition,
3
+ getAnimationForProperty,
4
+ hasAnimation,
5
+ getAnimatedProperties,
6
+ } from './normalizeTransition'
7
+
8
+ export type {
9
+ AnimationConfig,
10
+ NormalizedTransition,
11
+ TransitionPropInput,
12
+ } from './types'
@@ -0,0 +1,123 @@
1
+ import type { AnimationConfig, NormalizedTransition, TransitionPropInput } from './types'
2
+
3
+ /**
4
+ * Normalizes the various transition prop formats into a consistent structure.
5
+ *
6
+ * Supported input formats:
7
+ * - String: "bouncy" -> { default: "bouncy", properties: {} }
8
+ * - Object: { x: 'quick', default: 'slow' } -> { default: "slow", properties: { x: "quick" } }
9
+ * - Array: ['bouncy', { delay: 100, x: 'quick' }] -> { default: "bouncy", delay: 100, properties: { x: "quick" } }
10
+ *
11
+ * @param transition - The transition prop value in any supported format
12
+ * @returns Normalized transition object with consistent structure
13
+ */
14
+ export function normalizeTransition(
15
+ transition: TransitionPropInput
16
+ ): NormalizedTransition {
17
+ // Handle null/undefined
18
+ if (!transition) {
19
+ return {
20
+ default: null,
21
+ delay: undefined,
22
+ properties: {},
23
+ }
24
+ }
25
+
26
+ // String format: "bouncy"
27
+ if (typeof transition === 'string') {
28
+ return {
29
+ default: transition,
30
+ delay: undefined,
31
+ properties: {},
32
+ }
33
+ }
34
+
35
+ // Array format: ['bouncy', { delay: 100, x: 'quick' }]
36
+ if (Array.isArray(transition)) {
37
+ const [defaultAnimation, config] = transition
38
+ const properties: Record<string, string | AnimationConfig> = {}
39
+ let delay: number | undefined
40
+
41
+ if (config && typeof config === 'object') {
42
+ for (const [key, value] of Object.entries(config)) {
43
+ if (key === 'delay' && typeof value === 'number') {
44
+ delay = value
45
+ } else if (value !== undefined) {
46
+ // Property-specific animation: string or config object
47
+ properties[key] = value as string | AnimationConfig
48
+ }
49
+ }
50
+ }
51
+
52
+ return {
53
+ default: defaultAnimation,
54
+ delay,
55
+ properties,
56
+ }
57
+ }
58
+
59
+ // Object format: { x: 'quick', y: 'bouncy', default: 'slow' }
60
+ if (typeof transition === 'object') {
61
+ const properties: Record<string, string | AnimationConfig> = {}
62
+ let defaultAnimation: string | null = null
63
+
64
+ for (const [key, value] of Object.entries(transition)) {
65
+ if (key === 'default' && typeof value === 'string') {
66
+ defaultAnimation = value
67
+ } else if (value !== undefined) {
68
+ // Property-specific animation: string or config object
69
+ properties[key] = value as string | AnimationConfig
70
+ }
71
+ }
72
+
73
+ return {
74
+ default: defaultAnimation,
75
+ delay: undefined,
76
+ properties,
77
+ }
78
+ }
79
+
80
+ // Fallback
81
+ return {
82
+ default: null,
83
+ delay: undefined,
84
+ properties: {},
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Gets the animation key for a specific property from a normalized transition.
90
+ * Falls back to the default animation if no property-specific one is defined.
91
+ *
92
+ * @param normalized - The normalized transition object
93
+ * @param property - The property name to get animation for (e.g., 'x', 'opacity')
94
+ * @returns The animation key/config or null if none defined
95
+ */
96
+ export function getAnimationForProperty(
97
+ normalized: NormalizedTransition,
98
+ property: string
99
+ ): string | AnimationConfig | null {
100
+ // Check for property-specific animation
101
+ const propertyAnimation = normalized.properties[property]
102
+ if (propertyAnimation !== undefined) {
103
+ return propertyAnimation
104
+ }
105
+
106
+ // Fall back to default
107
+ return normalized.default
108
+ }
109
+
110
+ /**
111
+ * Checks if the normalized transition has any animations defined.
112
+ */
113
+ export function hasAnimation(normalized: NormalizedTransition): boolean {
114
+ return normalized.default !== null || Object.keys(normalized.properties).length > 0
115
+ }
116
+
117
+ /**
118
+ * Gets all property names that have specific animations defined.
119
+ * Does not include 'default' in the list.
120
+ */
121
+ export function getAnimatedProperties(normalized: NormalizedTransition): string[] {
122
+ return Object.keys(normalized.properties)
123
+ }
package/src/types.ts ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Animation configuration that can include additional properties
3
+ * like delay, duration, stiffness, damping, etc.
4
+ */
5
+ export type AnimationConfig = {
6
+ type?: string
7
+ [key: string]: any
8
+ }
9
+
10
+ /**
11
+ * Input format for the transition prop - supports multiple syntaxes:
12
+ *
13
+ * 1. String: "bouncy"
14
+ * 2. Object with property mappings: { x: 'quick', y: 'bouncy', default: 'slow' }
15
+ * 3. Array with config: ['bouncy', { delay: 100, x: 'quick' }]
16
+ *
17
+ * Note: Uses `any` to be compatible with the TransitionProp type from @tamagui/web
18
+ * which has more complex union types.
19
+ */
20
+ export type TransitionPropInput = any
21
+
22
+ /**
23
+ * Normalized output format that all animation drivers consume.
24
+ * Provides a consistent structure regardless of input format.
25
+ */
26
+ export type NormalizedTransition = {
27
+ /** Default animation key for properties not explicitly listed */
28
+ default: string | null
29
+ /** Global delay in ms */
30
+ delay: number | undefined
31
+ /** Per-property animation configs: propertyName -> animationKey or config */
32
+ properties: Record<string, string | AnimationConfig>
33
+ }
@@ -0,0 +1,4 @@
1
+ export { normalizeTransition, getAnimationForProperty, hasAnimation, getAnimatedProperties } from "./normalizeTransition";
2
+ export type { AnimationConfig, NormalizedTransition, TransitionPropInput } from "./types";
3
+
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,SACE,qBACA,yBACA,cACA,6BACK;AAEP,cACE,iBACA,sBACA,2BACK",
3
+ "names": [],
4
+ "sources": [
5
+ "src/index.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "export {\n normalizeTransition,\n getAnimationForProperty,\n hasAnimation,\n getAnimatedProperties,\n} from './normalizeTransition'\n\nexport type {\n AnimationConfig,\n NormalizedTransition,\n TransitionPropInput,\n} from './types'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,33 @@
1
+ import type { AnimationConfig, NormalizedTransition, TransitionPropInput } from "./types";
2
+ /**
3
+ * Normalizes the various transition prop formats into a consistent structure.
4
+ *
5
+ * Supported input formats:
6
+ * - String: "bouncy" -> { default: "bouncy", properties: {} }
7
+ * - Object: { x: 'quick', default: 'slow' } -> { default: "slow", properties: { x: "quick" } }
8
+ * - Array: ['bouncy', { delay: 100, x: 'quick' }] -> { default: "bouncy", delay: 100, properties: { x: "quick" } }
9
+ *
10
+ * @param transition - The transition prop value in any supported format
11
+ * @returns Normalized transition object with consistent structure
12
+ */
13
+ export declare function normalizeTransition(transition: TransitionPropInput): NormalizedTransition;
14
+ /**
15
+ * Gets the animation key for a specific property from a normalized transition.
16
+ * Falls back to the default animation if no property-specific one is defined.
17
+ *
18
+ * @param normalized - The normalized transition object
19
+ * @param property - The property name to get animation for (e.g., 'x', 'opacity')
20
+ * @returns The animation key/config or null if none defined
21
+ */
22
+ export declare function getAnimationForProperty(normalized: NormalizedTransition, property: string): string | AnimationConfig | null;
23
+ /**
24
+ * Checks if the normalized transition has any animations defined.
25
+ */
26
+ export declare function hasAnimation(normalized: NormalizedTransition): boolean;
27
+ /**
28
+ * Gets all property names that have specific animations defined.
29
+ * Does not include 'default' in the list.
30
+ */
31
+ export declare function getAnimatedProperties(normalized: NormalizedTransition): string[];
32
+
33
+ //# sourceMappingURL=normalizeTransition.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,iBAAiB,sBAAsB,2BAA2B;;;;;;;;;;;;AAahF,OAAO,iBAAS,oBACd,YAAY,sBACX;;;;;;;;;AAgFH,OAAO,iBAAS,wBACd,YAAY,sBACZ,4BACU;;;;AAcZ,OAAO,iBAAS,aAAa,YAAY;;;;;AAQzC,OAAO,iBAAS,sBAAsB,YAAY",
3
+ "names": [],
4
+ "sources": [
5
+ "src/normalizeTransition.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "import type { AnimationConfig, NormalizedTransition, TransitionPropInput } from './types'\n\n/**\n * Normalizes the various transition prop formats into a consistent structure.\n *\n * Supported input formats:\n * - String: \"bouncy\" -> { default: \"bouncy\", properties: {} }\n * - Object: { x: 'quick', default: 'slow' } -> { default: \"slow\", properties: { x: \"quick\" } }\n * - Array: ['bouncy', { delay: 100, x: 'quick' }] -> { default: \"bouncy\", delay: 100, properties: { x: \"quick\" } }\n *\n * @param transition - The transition prop value in any supported format\n * @returns Normalized transition object with consistent structure\n */\nexport function normalizeTransition(\n transition: TransitionPropInput\n): NormalizedTransition {\n // Handle null/undefined\n if (!transition) {\n return {\n default: null,\n delay: undefined,\n properties: {},\n }\n }\n\n // String format: \"bouncy\"\n if (typeof transition === 'string') {\n return {\n default: transition,\n delay: undefined,\n properties: {},\n }\n }\n\n // Array format: ['bouncy', { delay: 100, x: 'quick' }]\n if (Array.isArray(transition)) {\n const [defaultAnimation, config] = transition\n const properties: Record<string, string | AnimationConfig> = {}\n let delay: number | undefined\n\n if (config && typeof config === 'object') {\n for (const [key, value] of Object.entries(config)) {\n if (key === 'delay' && typeof value === 'number') {\n delay = value\n } else if (value !== undefined) {\n // Property-specific animation: string or config object\n properties[key] = value as string | AnimationConfig\n }\n }\n }\n\n return {\n default: defaultAnimation,\n delay,\n properties,\n }\n }\n\n // Object format: { x: 'quick', y: 'bouncy', default: 'slow' }\n if (typeof transition === 'object') {\n const properties: Record<string, string | AnimationConfig> = {}\n let defaultAnimation: string | null = null\n\n for (const [key, value] of Object.entries(transition)) {\n if (key === 'default' && typeof value === 'string') {\n defaultAnimation = value\n } else if (value !== undefined) {\n // Property-specific animation: string or config object\n properties[key] = value as string | AnimationConfig\n }\n }\n\n return {\n default: defaultAnimation,\n delay: undefined,\n properties,\n }\n }\n\n // Fallback\n return {\n default: null,\n delay: undefined,\n properties: {},\n }\n}\n\n/**\n * Gets the animation key for a specific property from a normalized transition.\n * Falls back to the default animation if no property-specific one is defined.\n *\n * @param normalized - The normalized transition object\n * @param property - The property name to get animation for (e.g., 'x', 'opacity')\n * @returns The animation key/config or null if none defined\n */\nexport function getAnimationForProperty(\n normalized: NormalizedTransition,\n property: string\n): string | AnimationConfig | null {\n // Check for property-specific animation\n const propertyAnimation = normalized.properties[property]\n if (propertyAnimation !== undefined) {\n return propertyAnimation\n }\n\n // Fall back to default\n return normalized.default\n}\n\n/**\n * Checks if the normalized transition has any animations defined.\n */\nexport function hasAnimation(normalized: NormalizedTransition): boolean {\n return normalized.default !== null || Object.keys(normalized.properties).length > 0\n}\n\n/**\n * Gets all property names that have specific animations defined.\n * Does not include 'default' in the list.\n */\nexport function getAnimatedProperties(normalized: NormalizedTransition): string[] {\n return Object.keys(normalized.properties)\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Animation configuration that can include additional properties
3
+ * like delay, duration, stiffness, damping, etc.
4
+ */
5
+ export type AnimationConfig = {
6
+ type?: string;
7
+ [key: string]: any;
8
+ };
9
+ /**
10
+ * Input format for the transition prop - supports multiple syntaxes:
11
+ *
12
+ * 1. String: "bouncy"
13
+ * 2. Object with property mappings: { x: 'quick', y: 'bouncy', default: 'slow' }
14
+ * 3. Array with config: ['bouncy', { delay: 100, x: 'quick' }]
15
+ *
16
+ * Note: Uses `any` to be compatible with the TransitionProp type from @tamagui/web
17
+ * which has more complex union types.
18
+ */
19
+ export type TransitionPropInput = any;
20
+ /**
21
+ * Normalized output format that all animation drivers consume.
22
+ * Provides a consistent structure regardless of input format.
23
+ */
24
+ export type NormalizedTransition = {
25
+ /** Default animation key for properties not explicitly listed */
26
+ default: string | null;
27
+ /** Global delay in ms */
28
+ delay: number | undefined;
29
+ /** Per-property animation configs: propertyName -> animationKey or config */
30
+ properties: Record<string, string | AnimationConfig>;
31
+ };
32
+
33
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": ";;;;AAIA,YAAY,kBAAkB;CAC5B;;;;;;;;;;;;;AAcF,YAAY;;;;;AAMZ,YAAY,uBAAuB;;CAEjC;;CAEA;;CAEA,YAAY,wBAAwB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/types.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "/**\n * Animation configuration that can include additional properties\n * like delay, duration, stiffness, damping, etc.\n */\nexport type AnimationConfig = {\n type?: string\n [key: string]: any\n}\n\n/**\n * Input format for the transition prop - supports multiple syntaxes:\n *\n * 1. String: \"bouncy\"\n * 2. Object with property mappings: { x: 'quick', y: 'bouncy', default: 'slow' }\n * 3. Array with config: ['bouncy', { delay: 100, x: 'quick' }]\n *\n * Note: Uses `any` to be compatible with the TransitionProp type from @tamagui/web\n * which has more complex union types.\n */\nexport type TransitionPropInput = any\n\n/**\n * Normalized output format that all animation drivers consume.\n * Provides a consistent structure regardless of input format.\n */\nexport type NormalizedTransition = {\n /** Default animation key for properties not explicitly listed */\n default: string | null\n /** Global delay in ms */\n delay: number | undefined\n /** Per-property animation configs: propertyName -> animationKey or config */\n properties: Record<string, string | AnimationConfig>\n}\n"
9
+ ],
10
+ "version": 3
11
+ }