@tamagui/static 1.110.5 → 1.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/cjs/checkDeps.native.js +3 -131
  2. package/dist/cjs/checkDeps.native.js.map +1 -1
  3. package/dist/cjs/extractor/babelParse.native.js +3 -3
  4. package/dist/cjs/extractor/babelParse.native.js.map +1 -1
  5. package/dist/cjs/extractor/buildClassName.native.js +5 -5
  6. package/dist/cjs/extractor/buildClassName.native.js.map +1 -1
  7. package/dist/cjs/extractor/bundle.native.js +35 -260
  8. package/dist/cjs/extractor/bundle.native.js.map +2 -2
  9. package/dist/cjs/extractor/bundleConfig.native.js +153 -429
  10. package/dist/cjs/extractor/bundleConfig.native.js.map +2 -2
  11. package/dist/cjs/extractor/createEvaluator.native.js +2 -2
  12. package/dist/cjs/extractor/createEvaluator.native.js.map +1 -1
  13. package/dist/cjs/extractor/createExtractor.native.js +488 -730
  14. package/dist/cjs/extractor/createExtractor.native.js.map +2 -2
  15. package/dist/cjs/extractor/createLogger.native.js +2 -2
  16. package/dist/cjs/extractor/createLogger.native.js.map +1 -1
  17. package/dist/cjs/extractor/esbuildAliasPlugin.native.js +3 -3
  18. package/dist/cjs/extractor/esbuildAliasPlugin.native.js.map +1 -1
  19. package/dist/cjs/extractor/extractHelpers.native.js +17 -71
  20. package/dist/cjs/extractor/extractHelpers.native.js.map +2 -2
  21. package/dist/cjs/extractor/extractMediaStyle.native.js +21 -73
  22. package/dist/cjs/extractor/extractMediaStyle.native.js.map +2 -2
  23. package/dist/cjs/extractor/extractToClassNames.native.js +243 -423
  24. package/dist/cjs/extractor/extractToClassNames.native.js.map +2 -2
  25. package/dist/cjs/extractor/extractToNative.native.js +30 -93
  26. package/dist/cjs/extractor/extractToNative.native.js.map +2 -2
  27. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +43 -365
  28. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
  29. package/dist/cjs/extractor/generatedUid.native.js +1 -5
  30. package/dist/cjs/extractor/generatedUid.native.js.map +1 -1
  31. package/dist/cjs/extractor/getPrefixLogs.native.js +1 -1
  32. package/dist/cjs/extractor/getPrefixLogs.native.js.map +1 -1
  33. package/dist/cjs/extractor/getPropValueFromAttributes.native.js +2 -1
  34. package/dist/cjs/extractor/getPropValueFromAttributes.native.js.map +2 -2
  35. package/dist/cjs/extractor/getStaticBindingsForScope.native.js +91 -292
  36. package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +2 -2
  37. package/dist/cjs/extractor/hoistClassNames.native.js +1 -1
  38. package/dist/cjs/extractor/hoistClassNames.native.js.map +1 -1
  39. package/dist/cjs/extractor/literalToAst.native.js +15 -69
  40. package/dist/cjs/extractor/literalToAst.native.js.map +1 -1
  41. package/dist/cjs/extractor/loadFile.native.js +5 -8
  42. package/dist/cjs/extractor/loadFile.native.js.map +1 -1
  43. package/dist/cjs/extractor/loadTamagui.native.js +155 -574
  44. package/dist/cjs/extractor/loadTamagui.native.js.map +2 -2
  45. package/dist/cjs/extractor/logLines.native.js +1 -1
  46. package/dist/cjs/extractor/logLines.native.js.map +1 -1
  47. package/dist/cjs/extractor/normalizeTernaries.native.js +4 -59
  48. package/dist/cjs/extractor/normalizeTernaries.native.js.map +1 -1
  49. package/dist/cjs/extractor/propsToFontFamilyCache.native.js +1 -1
  50. package/dist/cjs/extractor/propsToFontFamilyCache.native.js.map +1 -1
  51. package/dist/cjs/extractor/removeUnusedHooks.native.js +1 -1
  52. package/dist/cjs/extractor/removeUnusedHooks.native.js.map +1 -1
  53. package/dist/cjs/extractor/timer.native.js +2 -2
  54. package/dist/cjs/extractor/timer.native.js.map +1 -1
  55. package/dist/cjs/extractor/watchTamaguiConfig.native.js +25 -166
  56. package/dist/cjs/extractor/watchTamaguiConfig.native.js.map +2 -2
  57. package/dist/cjs/getPragmaOptions.native.js +1 -1
  58. package/dist/cjs/getPragmaOptions.native.js.map +1 -1
  59. package/dist/cjs/helpers/requireTamaguiCore.native.js.map +1 -1
  60. package/dist/cjs/minifyCSS.native.js +1 -1
  61. package/dist/cjs/minifyCSS.native.js.map +2 -2
  62. package/dist/cjs/registerRequire.native.js +18 -37
  63. package/dist/cjs/registerRequire.native.js.map +1 -1
  64. package/dist/cjs/server.native.js +21 -163
  65. package/dist/cjs/server.native.js.map +2 -2
  66. package/dist/esm/checkDeps.native.js +3 -131
  67. package/dist/esm/checkDeps.native.js.map +1 -1
  68. package/dist/esm/checkDeps.native.mjs +10 -0
  69. package/dist/esm/checkDeps.native.mjs.map +1 -0
  70. package/dist/esm/constants.native.mjs +12 -0
  71. package/dist/esm/constants.native.mjs.map +1 -0
  72. package/dist/esm/exports.native.mjs +16 -0
  73. package/dist/esm/exports.native.mjs.map +1 -0
  74. package/dist/esm/extractor/accessSafe.native.mjs +12 -0
  75. package/dist/esm/extractor/accessSafe.native.mjs.map +1 -0
  76. package/dist/esm/extractor/babelParse.native.js +3 -3
  77. package/dist/esm/extractor/babelParse.native.js.map +1 -1
  78. package/dist/esm/extractor/babelParse.native.mjs +19 -0
  79. package/dist/esm/extractor/babelParse.native.mjs.map +1 -0
  80. package/dist/esm/extractor/buildClassName.native.js +5 -5
  81. package/dist/esm/extractor/buildClassName.native.js.map +1 -1
  82. package/dist/esm/extractor/buildClassName.native.mjs +30 -0
  83. package/dist/esm/extractor/buildClassName.native.mjs.map +1 -0
  84. package/dist/esm/extractor/bundle.native.js +34 -258
  85. package/dist/esm/extractor/bundle.native.js.map +2 -2
  86. package/dist/esm/extractor/bundle.native.mjs +132 -0
  87. package/dist/esm/extractor/bundle.native.mjs.map +1 -0
  88. package/dist/esm/extractor/bundleConfig.native.js +154 -429
  89. package/dist/esm/extractor/bundleConfig.native.js.map +2 -2
  90. package/dist/esm/extractor/bundleConfig.native.mjs +322 -0
  91. package/dist/esm/extractor/bundleConfig.native.mjs.map +1 -0
  92. package/dist/esm/extractor/createEvaluator.native.js +2 -2
  93. package/dist/esm/extractor/createEvaluator.native.js.map +1 -1
  94. package/dist/esm/extractor/createEvaluator.native.mjs +38 -0
  95. package/dist/esm/extractor/createEvaluator.native.mjs.map +1 -0
  96. package/dist/esm/extractor/createExtractor.native.js +498 -739
  97. package/dist/esm/extractor/createExtractor.native.js.map +2 -2
  98. package/dist/esm/extractor/createExtractor.native.mjs +1140 -0
  99. package/dist/esm/extractor/createExtractor.native.mjs.map +1 -0
  100. package/dist/esm/extractor/createLogger.native.js +2 -2
  101. package/dist/esm/extractor/createLogger.native.js.map +1 -1
  102. package/dist/esm/extractor/createLogger.native.mjs +25 -0
  103. package/dist/esm/extractor/createLogger.native.mjs.map +1 -0
  104. package/dist/esm/extractor/ensureImportingConcat.native.mjs +20 -0
  105. package/dist/esm/extractor/ensureImportingConcat.native.mjs.map +1 -0
  106. package/dist/esm/extractor/esbuildAliasPlugin.native.js +3 -3
  107. package/dist/esm/extractor/esbuildAliasPlugin.native.js.map +1 -1
  108. package/dist/esm/extractor/esbuildAliasPlugin.native.mjs +29 -0
  109. package/dist/esm/extractor/esbuildAliasPlugin.native.mjs.map +1 -0
  110. package/dist/esm/extractor/evaluateAstNode.native.mjs +49 -0
  111. package/dist/esm/extractor/evaluateAstNode.native.mjs.map +1 -0
  112. package/dist/esm/extractor/extractHelpers.native.js +18 -72
  113. package/dist/esm/extractor/extractHelpers.native.js.map +2 -2
  114. package/dist/esm/extractor/extractHelpers.native.mjs +122 -0
  115. package/dist/esm/extractor/extractHelpers.native.mjs.map +1 -0
  116. package/dist/esm/extractor/extractMediaStyle.native.js +21 -73
  117. package/dist/esm/extractor/extractMediaStyle.native.js.map +1 -1
  118. package/dist/esm/extractor/extractMediaStyle.native.mjs +125 -0
  119. package/dist/esm/extractor/extractMediaStyle.native.mjs.map +1 -0
  120. package/dist/esm/extractor/extractToClassNames.native.js +242 -421
  121. package/dist/esm/extractor/extractToClassNames.native.js.map +2 -2
  122. package/dist/esm/extractor/extractToClassNames.native.mjs +315 -0
  123. package/dist/esm/extractor/extractToClassNames.native.mjs.map +1 -0
  124. package/dist/esm/extractor/extractToNative.native.js +31 -93
  125. package/dist/esm/extractor/extractToNative.native.js.map +2 -2
  126. package/dist/esm/extractor/extractToNative.native.mjs +268 -0
  127. package/dist/esm/extractor/extractToNative.native.mjs.map +1 -0
  128. package/dist/esm/extractor/findTopmostFunction.native.mjs +11 -0
  129. package/dist/esm/extractor/findTopmostFunction.native.mjs.map +1 -0
  130. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +43 -364
  131. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
  132. package/dist/esm/extractor/generateTamaguiStudioConfig.native.mjs +139 -0
  133. package/dist/esm/extractor/generateTamaguiStudioConfig.native.mjs.map +1 -0
  134. package/dist/esm/extractor/generatedUid.native.js +1 -5
  135. package/dist/esm/extractor/generatedUid.native.js.map +1 -1
  136. package/dist/esm/extractor/generatedUid.native.mjs +13 -0
  137. package/dist/esm/extractor/generatedUid.native.mjs.map +1 -0
  138. package/dist/esm/extractor/getPrefixLogs.native.js +1 -1
  139. package/dist/esm/extractor/getPrefixLogs.native.js.map +1 -1
  140. package/dist/esm/extractor/getPrefixLogs.native.mjs +6 -0
  141. package/dist/esm/extractor/getPrefixLogs.native.mjs.map +1 -0
  142. package/dist/esm/extractor/getPropValueFromAttributes.native.js +2 -1
  143. package/dist/esm/extractor/getPropValueFromAttributes.native.js.map +1 -1
  144. package/dist/esm/extractor/getPropValueFromAttributes.native.mjs +35 -0
  145. package/dist/esm/extractor/getPropValueFromAttributes.native.mjs.map +1 -0
  146. package/dist/esm/extractor/getSourceModule.native.mjs +50 -0
  147. package/dist/esm/extractor/getSourceModule.native.mjs.map +1 -0
  148. package/dist/esm/extractor/getStaticBindingsForScope.native.js +91 -292
  149. package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +2 -2
  150. package/dist/esm/extractor/getStaticBindingsForScope.native.mjs +159 -0
  151. package/dist/esm/extractor/getStaticBindingsForScope.native.mjs.map +1 -0
  152. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.mjs +6 -0
  153. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.mjs.map +1 -0
  154. package/dist/esm/extractor/hoistClassNames.native.js +1 -1
  155. package/dist/esm/extractor/hoistClassNames.native.js.map +1 -1
  156. package/dist/esm/extractor/hoistClassNames.native.mjs +30 -0
  157. package/dist/esm/extractor/hoistClassNames.native.mjs.map +1 -0
  158. package/dist/esm/extractor/literalToAst.native.js +15 -69
  159. package/dist/esm/extractor/literalToAst.native.js.map +1 -1
  160. package/dist/esm/extractor/literalToAst.native.mjs +55 -0
  161. package/dist/esm/extractor/literalToAst.native.mjs.map +1 -0
  162. package/dist/esm/extractor/loadFile.native.js +5 -8
  163. package/dist/esm/extractor/loadFile.native.js.map +1 -1
  164. package/dist/esm/extractor/loadFile.native.mjs +20 -0
  165. package/dist/esm/extractor/loadFile.native.mjs.map +1 -0
  166. package/dist/esm/extractor/loadTamagui.native.js +155 -573
  167. package/dist/esm/extractor/loadTamagui.native.js.map +2 -2
  168. package/dist/esm/extractor/loadTamagui.native.mjs +284 -0
  169. package/dist/esm/extractor/loadTamagui.native.mjs.map +1 -0
  170. package/dist/esm/extractor/logLines.native.js +1 -1
  171. package/dist/esm/extractor/logLines.native.js.map +1 -1
  172. package/dist/esm/extractor/logLines.native.mjs +31 -0
  173. package/dist/esm/extractor/logLines.native.mjs.map +1 -0
  174. package/dist/esm/extractor/normalizeTernaries.native.js +4 -59
  175. package/dist/esm/extractor/normalizeTernaries.native.js.map +1 -1
  176. package/dist/esm/extractor/normalizeTernaries.native.mjs +38 -0
  177. package/dist/esm/extractor/normalizeTernaries.native.mjs.map +1 -0
  178. package/dist/esm/extractor/propsToFontFamilyCache.native.js +1 -1
  179. package/dist/esm/extractor/propsToFontFamilyCache.native.js.map +1 -1
  180. package/dist/esm/extractor/propsToFontFamilyCache.native.mjs +13 -0
  181. package/dist/esm/extractor/propsToFontFamilyCache.native.mjs.map +1 -0
  182. package/dist/esm/extractor/removeUnusedHooks.native.js +2 -2
  183. package/dist/esm/extractor/removeUnusedHooks.native.js.map +1 -1
  184. package/dist/esm/extractor/removeUnusedHooks.native.mjs +83 -0
  185. package/dist/esm/extractor/removeUnusedHooks.native.mjs.map +1 -0
  186. package/dist/esm/extractor/timer.native.js +2 -2
  187. package/dist/esm/extractor/timer.native.js.map +1 -1
  188. package/dist/esm/extractor/timer.native.mjs +22 -0
  189. package/dist/esm/extractor/timer.native.mjs.map +1 -0
  190. package/dist/esm/extractor/validHTMLAttributes.native.mjs +50 -0
  191. package/dist/esm/extractor/validHTMLAttributes.native.mjs.map +1 -0
  192. package/dist/esm/extractor/watchTamaguiConfig.native.js +25 -166
  193. package/dist/esm/extractor/watchTamaguiConfig.native.js.map +2 -2
  194. package/dist/esm/extractor/watchTamaguiConfig.native.mjs +33 -0
  195. package/dist/esm/extractor/watchTamaguiConfig.native.mjs.map +1 -0
  196. package/dist/esm/getPragmaOptions.native.js +1 -1
  197. package/dist/esm/getPragmaOptions.native.js.map +1 -1
  198. package/dist/esm/getPragmaOptions.native.mjs +51 -0
  199. package/dist/esm/getPragmaOptions.native.mjs.map +1 -0
  200. package/dist/esm/helpers/memoize.native.mjs +15 -0
  201. package/dist/esm/helpers/memoize.native.mjs.map +1 -0
  202. package/dist/esm/helpers/requireTamaguiCore.native.js.map +1 -1
  203. package/dist/esm/helpers/requireTamaguiCore.native.mjs +13 -0
  204. package/dist/esm/helpers/requireTamaguiCore.native.mjs.map +1 -0
  205. package/dist/esm/index.native.mjs +5 -0
  206. package/dist/esm/index.native.mjs.map +1 -0
  207. package/dist/esm/minifyCSS.native.js +1 -1
  208. package/dist/esm/minifyCSS.native.js.map +2 -2
  209. package/dist/esm/minifyCSS.native.mjs +16 -0
  210. package/dist/esm/minifyCSS.native.mjs.map +1 -0
  211. package/dist/esm/registerRequire.native.js +17 -35
  212. package/dist/esm/registerRequire.native.js.map +1 -1
  213. package/dist/esm/registerRequire.native.mjs +86 -0
  214. package/dist/esm/registerRequire.native.mjs.map +1 -0
  215. package/dist/esm/server.native.js +21 -163
  216. package/dist/esm/server.native.js.map +2 -2
  217. package/dist/esm/server.native.mjs +44 -0
  218. package/dist/esm/server.native.mjs.map +1 -0
  219. package/dist/esm/setup.native.mjs +2 -0
  220. package/dist/esm/setup.native.mjs.map +1 -0
  221. package/dist/esm/types.native.mjs +2 -0
  222. package/dist/esm/types.native.mjs.map +1 -0
  223. package/package.json +14 -14
@@ -19,224 +19,6 @@ import { setPropsToFontFamily } from "./propsToFontFamilyCache";
19
19
  import { removeUnusedHooks } from "./removeUnusedHooks";
20
20
  import { timer } from "./timer";
21
21
  import { validHTMLAttributes } from "./validHTMLAttributes";
22
- function _array_like_to_array(arr, len) {
23
- (len == null || len > arr.length) && (len = arr.length);
24
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
25
- return arr2;
26
- }
27
- function _array_with_holes(arr) {
28
- if (Array.isArray(arr)) return arr;
29
- }
30
- function _array_without_holes(arr) {
31
- if (Array.isArray(arr)) return _array_like_to_array(arr);
32
- }
33
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
34
- try {
35
- var info = gen[key](arg), value = info.value;
36
- } catch (error) {
37
- reject(error);
38
- return;
39
- }
40
- info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
41
- }
42
- function _async_to_generator(fn) {
43
- return function() {
44
- var self = this, args = arguments;
45
- return new Promise(function(resolve, reject) {
46
- var gen = fn.apply(self, args);
47
- function _next(value) {
48
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
49
- }
50
- function _throw(err) {
51
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
52
- }
53
- _next(void 0);
54
- });
55
- };
56
- }
57
- function _define_property(obj, key, value) {
58
- return key in obj ? Object.defineProperty(obj, key, {
59
- value,
60
- enumerable: !0,
61
- configurable: !0,
62
- writable: !0
63
- }) : obj[key] = value, obj;
64
- }
65
- function _iterable_to_array(iter) {
66
- if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
67
- }
68
- function _iterable_to_array_limit(arr, i) {
69
- var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
70
- if (_i != null) {
71
- var _arr = [], _n = !0, _d = !1, _s, _e;
72
- try {
73
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
74
- ;
75
- } catch (err) {
76
- _d = !0, _e = err;
77
- } finally {
78
- try {
79
- !_n && _i.return != null && _i.return();
80
- } finally {
81
- if (_d) throw _e;
82
- }
83
- }
84
- return _arr;
85
- }
86
- }
87
- function _non_iterable_rest() {
88
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
89
- }
90
- function _non_iterable_spread() {
91
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
92
- }
93
- function _object_spread(target) {
94
- for (var i = 1; i < arguments.length; i++) {
95
- var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
96
- typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
97
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
98
- }))), ownKeys2.forEach(function(key) {
99
- _define_property(target, key, source[key]);
100
- });
101
- }
102
- return target;
103
- }
104
- function ownKeys(object, enumerableOnly) {
105
- var keys = Object.keys(object);
106
- if (Object.getOwnPropertySymbols) {
107
- var symbols = Object.getOwnPropertySymbols(object);
108
- enumerableOnly && (symbols = symbols.filter(function(sym) {
109
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
110
- })), keys.push.apply(keys, symbols);
111
- }
112
- return keys;
113
- }
114
- function _object_spread_props(target, source) {
115
- return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
116
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
117
- }), target;
118
- }
119
- function _object_without_properties(source, excluded) {
120
- if (source == null) return {};
121
- var target = _object_without_properties_loose(source, excluded), key, i;
122
- if (Object.getOwnPropertySymbols) {
123
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
124
- for (i = 0; i < sourceSymbolKeys.length; i++)
125
- key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
126
- }
127
- return target;
128
- }
129
- function _object_without_properties_loose(source, excluded) {
130
- if (source == null) return {};
131
- var target = {}, sourceKeys = Object.keys(source), key, i;
132
- for (i = 0; i < sourceKeys.length; i++)
133
- key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
134
- return target;
135
- }
136
- function _sliced_to_array(arr, i) {
137
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
138
- }
139
- function _to_consumable_array(arr) {
140
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
141
- }
142
- function _type_of(obj) {
143
- "@swc/helpers - typeof";
144
- return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
145
- }
146
- function _unsupported_iterable_to_array(o, minLen) {
147
- if (o) {
148
- if (typeof o == "string") return _array_like_to_array(o, minLen);
149
- var n = Object.prototype.toString.call(o).slice(8, -1);
150
- if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
151
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
152
- }
153
- }
154
- function _ts_generator(thisArg, body) {
155
- var f, y, t2, g, _ = {
156
- label: 0,
157
- sent: function() {
158
- if (t2[0] & 1) throw t2[1];
159
- return t2[1];
160
- },
161
- trys: [],
162
- ops: []
163
- };
164
- return g = {
165
- next: verb(0),
166
- throw: verb(1),
167
- return: verb(2)
168
- }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
169
- return this;
170
- }), g;
171
- function verb(n) {
172
- return function(v) {
173
- return step([
174
- n,
175
- v
176
- ]);
177
- };
178
- }
179
- function step(op) {
180
- if (f) throw new TypeError("Generator is already executing.");
181
- for (; _; ) try {
182
- if (f = 1, y && (t2 = op[0] & 2 ? y.return : op[0] ? y.throw || ((t2 = y.return) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done) return t2;
183
- switch (y = 0, t2 && (op = [
184
- op[0] & 2,
185
- t2.value
186
- ]), op[0]) {
187
- case 0:
188
- case 1:
189
- t2 = op;
190
- break;
191
- case 4:
192
- return _.label++, {
193
- value: op[1],
194
- done: !1
195
- };
196
- case 5:
197
- _.label++, y = op[1], op = [
198
- 0
199
- ];
200
- continue;
201
- case 7:
202
- op = _.ops.pop(), _.trys.pop();
203
- continue;
204
- default:
205
- if (t2 = _.trys, !(t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
206
- _ = 0;
207
- continue;
208
- }
209
- if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
210
- _.label = op[1];
211
- break;
212
- }
213
- if (op[0] === 6 && _.label < t2[1]) {
214
- _.label = t2[1], t2 = op;
215
- break;
216
- }
217
- if (t2 && _.label < t2[2]) {
218
- _.label = t2[2], _.ops.push(op);
219
- break;
220
- }
221
- t2[2] && _.ops.pop(), _.trys.pop();
222
- continue;
223
- }
224
- op = body.call(thisArg, _);
225
- } catch (e) {
226
- op = [
227
- 6,
228
- e
229
- ], y = 0;
230
- } finally {
231
- f = t2 = 0;
232
- }
233
- if (op[0] & 5) throw op[1];
234
- return {
235
- value: op[0] ? op[1] : void 0,
236
- done: !0
237
- };
238
- }
239
- }
240
22
  var UNTOUCHED_PROPS = {
241
23
  key: !0,
242
24
  style: !0,
@@ -248,18 +30,19 @@ function isFullyDisabled(props) {
248
30
  return props.disableExtraction && props.disableDebugAttr;
249
31
  }
250
32
  function createExtractor() {
251
- var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
33
+ var { logger = console, platform = "web" } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
252
34
  logger: console
253
- }, _ref_logger = _ref.logger, logger = _ref_logger === void 0 ? console : _ref_logger, _ref_platform = _ref.platform, platform = _ref_platform === void 0 ? "web" : _ref_platform, INLINE_EXTRACTABLE = _object_spread({
35
+ }, INLINE_EXTRACTABLE = {
254
36
  ref: "ref",
255
- key: "key"
256
- }, platform === "web" && {
257
- onPress: "onClick",
258
- onHoverIn: "onMouseEnter",
259
- onHoverOut: "onMouseLeave",
260
- onPressIn: "onMouseDown",
261
- onPressOut: "onMouseUp"
262
- }), componentState = {
37
+ key: "key",
38
+ ...platform === "web" && {
39
+ onPress: "onClick",
40
+ onHoverIn: "onMouseEnter",
41
+ onHoverOut: "onMouseLeave",
42
+ onPressIn: "onMouseDown",
43
+ onPressOut: "onMouseUp"
44
+ }
45
+ }, componentState = {
263
46
  focus: !1,
264
47
  focusVisible: !1,
265
48
  hover: !1,
@@ -278,35 +61,8 @@ function createExtractor() {
278
61
  function loadSync(props) {
279
62
  return isFullyDisabled(props) ? null : projectInfo || (projectInfo = loadTamaguiSync(props));
280
63
  }
281
- function load(props) {
282
- return _load.apply(this, arguments);
283
- }
284
- function _load() {
285
- return _load = _async_to_generator(function(props) {
286
- var _tmp;
287
- return _ts_generator(this, function(_state) {
288
- switch (_state.label) {
289
- case 0:
290
- return isFullyDisabled(props) ? [
291
- 2,
292
- null
293
- ] : (_tmp = projectInfo, _tmp ? [
294
- 3,
295
- 2
296
- ] : [
297
- 4,
298
- loadTamagui(props)
299
- ]);
300
- case 1:
301
- _tmp = projectInfo = _state.sent(), _state.label = 2;
302
- case 2:
303
- return [
304
- 2,
305
- _tmp
306
- ];
307
- }
308
- });
309
- }), _load.apply(this, arguments);
64
+ async function load(props) {
65
+ return isFullyDisabled(props) ? null : projectInfo || (projectInfo = await loadTamagui(props));
310
66
  }
311
67
  return {
312
68
  options: {
@@ -315,70 +71,32 @@ function createExtractor() {
315
71
  cleanupBeforeExit,
316
72
  loadTamagui: load,
317
73
  loadTamaguiSync: loadSync,
318
- getTamagui: function() {
319
- return projectInfo == null ? void 0 : projectInfo.tamaguiConfig;
74
+ getTamagui() {
75
+ return projectInfo?.tamaguiConfig;
320
76
  },
321
77
  parseSync: function(f, props) {
322
78
  var projectInfo2 = loadSync(props);
323
79
  return parseWithConfig(projectInfo2 || {}, f, props);
324
80
  },
325
- parse: /* @__PURE__ */ function() {
326
- var _ref2 = _async_to_generator(function(f, props) {
327
- var projectInfo2;
328
- return _ts_generator(this, function(_state) {
329
- switch (_state.label) {
330
- case 0:
331
- return [
332
- 4,
333
- load(props)
334
- ];
335
- case 1:
336
- return projectInfo2 = _state.sent(), [
337
- 2,
338
- parseWithConfig(projectInfo2 || {}, f, props)
339
- ];
340
- }
341
- });
342
- });
343
- return function(f, props) {
344
- return _ref2.apply(this, arguments);
345
- };
346
- }()
81
+ parse: async function(f, props) {
82
+ var projectInfo2 = await load(props);
83
+ return parseWithConfig(projectInfo2 || {}, f, props);
84
+ }
347
85
  };
348
86
  function parseWithConfig(param, fileOrPath, options) {
349
- var components = param.components, tamaguiConfig = param.tamaguiConfig, _options_config = options.config, config = _options_config === void 0 ? "tamagui.config.ts" : _options_config, _options_importsWhitelist = options.importsWhitelist, importsWhitelist = _options_importsWhitelist === void 0 ? [
87
+ var { components, tamaguiConfig } = param, { config = "tamagui.config.ts", importsWhitelist = [
350
88
  "constants.js"
351
- ] : _options_importsWhitelist, _options_evaluateVars = options.evaluateVars, evaluateVars = _options_evaluateVars === void 0 ? !0 : _options_evaluateVars, _options_sourcePath = options.sourcePath, sourcePath = _options_sourcePath === void 0 ? "" : _options_sourcePath, onExtractTag = options.onExtractTag, onStyleRule = options.onStyleRule, getFlattenedNode = options.getFlattenedNode, disable = options.disable, disableExtraction = options.disableExtraction, disableExtractInlineMedia = options.disableExtractInlineMedia, disableExtractVariables = options.disableExtractVariables, disableDebugAttr = options.disableDebugAttr, _options_enableDynamicEvaluation = options.enableDynamicEvaluation, enableDynamicEvaluation = _options_enableDynamicEvaluation === void 0 ? !1 : _options_enableDynamicEvaluation, disableOptimizeHooks = options.disableOptimizeHooks, _options_includeExtensions = options.includeExtensions, includeExtensions = _options_includeExtensions === void 0 ? [
89
+ ], evaluateVars = !0, sourcePath = "", onExtractTag, onStyleRule, getFlattenedNode, disable, disableExtraction, disableExtractInlineMedia, disableExtractVariables, disableDebugAttr, enableDynamicEvaluation = !1, disableOptimizeHooks, includeExtensions = [
352
90
  ".ts",
353
91
  ".tsx",
354
92
  ".jsx"
355
- ] : _options_includeExtensions, _options_extractStyledDefinitions = options.extractStyledDefinitions, extractStyledDefinitions = _options_extractStyledDefinitions === void 0 ? !1 : _options_extractStyledDefinitions, prefixLogs = options.prefixLogs, excludeProps = options.excludeProps, platform2 = options.platform, restProps = _object_without_properties(options, [
356
- "config",
357
- "importsWhitelist",
358
- "evaluateVars",
359
- "sourcePath",
360
- "onExtractTag",
361
- "onStyleRule",
362
- "getFlattenedNode",
363
- "disable",
364
- "disableExtraction",
365
- "disableExtractInlineMedia",
366
- "disableExtractVariables",
367
- "disableDebugAttr",
368
- "enableDynamicEvaluation",
369
- "disableOptimizeHooks",
370
- "includeExtensions",
371
- "extractStyledDefinitions",
372
- "prefixLogs",
373
- "excludeProps",
374
- "platform"
375
- ]), validHooks = disableOptimizeHooks ? {} : {
93
+ ], extractStyledDefinitions = !1, prefixLogs, excludeProps, platform: platform2, ...restProps } = options, validHooks = disableOptimizeHooks ? {} : {
376
94
  useMedia: !0,
377
95
  useTheme: !0
378
96
  };
379
97
  if (sourcePath.includes(".tamagui-dynamic-eval"))
380
98
  return null;
381
- var _requireTamaguiCore = requireTamaguiCore(platform2), normalizeStyle = _requireTamaguiCore.normalizeStyle, getSplitStyles = _requireTamaguiCore.getSplitStyles, mediaQueryConfig = _requireTamaguiCore.mediaQueryConfig, propMapper = _requireTamaguiCore.propMapper, proxyThemeVariables = _requireTamaguiCore.proxyThemeVariables, pseudoDescriptors = _requireTamaguiCore.pseudoDescriptors, shouldPrintDebug = options.shouldPrintDebug || !1;
99
+ var { normalizeStyle, getSplitStyles, mediaQueryConfig, propMapper, proxyThemeVariables, pseudoDescriptors } = requireTamaguiCore(platform2), shouldPrintDebug = options.shouldPrintDebug || !1;
382
100
  if (disable === !0 || Array.isArray(disable) && disable.includes(sourcePath))
383
101
  return null;
384
102
  if (!isFullyDisabled(options) && !components)
@@ -386,17 +104,20 @@ function createExtractor() {
386
104
  if (sourcePath && includeExtensions && !includeExtensions.some(function(ext) {
387
105
  return sourcePath.endsWith(ext);
388
106
  }))
389
- return shouldPrintDebug && logger.info("Ignoring file due to includeExtensions: ".concat(sourcePath, ", includeExtensions: ").concat(includeExtensions.join(", "))), null;
107
+ return shouldPrintDebug && logger.info(`Ignoring file due to includeExtensions: ${sourcePath}, includeExtensions: ${includeExtensions.join(", ")}`), null;
390
108
  function isValidStyleKey(name, staticConfig) {
391
109
  var _staticConfig_validStyles, _staticConfig_variants, _projectInfo_tamaguiConfig;
392
110
  if (!projectInfo)
393
111
  throw new Error("Tamagui extractor not loaded yet");
394
112
  return platform2 === "native" && name[0] === "$" && mediaQueryConfig[name.slice(1)] ? !1 : !!(!((_staticConfig_validStyles = staticConfig.validStyles) === null || _staticConfig_validStyles === void 0) && _staticConfig_validStyles[name] || pseudoDescriptors[name] || !((_staticConfig_variants = staticConfig.variants) === null || _staticConfig_variants === void 0) && _staticConfig_variants[name] || !(projectInfo == null || (_projectInfo_tamaguiConfig = projectInfo.tamaguiConfig) === null || _projectInfo_tamaguiConfig === void 0) && _projectInfo_tamaguiConfig.shorthands[name] || name[0] === "$" && mediaQueryConfig[name.slice(1)]);
395
113
  }
396
- var isTargetingHTML = platform2 === "web", ogDebug = shouldPrintDebug, tm = timer(), propsWithFileInfo = _object_spread_props(_object_spread({}, options), {
114
+ var isTargetingHTML = platform2 === "web", ogDebug = shouldPrintDebug, tm = timer(), propsWithFileInfo = {
115
+ ...options,
397
116
  sourcePath,
398
- allLoadedComponents: components ? _to_consumable_array(components) : []
399
- });
117
+ allLoadedComponents: components ? [
118
+ ...components
119
+ ] : []
120
+ };
400
121
  if (!hasLoggedBaseInfo) {
401
122
  var _process_env_DEBUG;
402
123
  hasLoggedBaseInfo = !0, shouldPrintDebug && logger.info([
@@ -412,7 +133,7 @@ function createExtractor() {
412
133
  ].join(`
413
134
  `));
414
135
  }
415
- tm.mark("load-tamagui", !!shouldPrintDebug), isFullyDisabled(options) || tamaguiConfig != null && tamaguiConfig.themes || (console.error(`\u26D4\uFE0F Error: Missing "themes" in your tamagui.config file:
136
+ tm.mark("load-tamagui", !!shouldPrintDebug), isFullyDisabled(options) || tamaguiConfig?.themes || (console.error(`\u26D4\uFE0F Error: Missing "themes" in your tamagui.config file:
416
137
 
417
138
  You may not need the compiler! Remember you can run Tamagui with no configuration at all.
418
139
 
@@ -422,28 +143,28 @@ function createExtractor() {
422
143
  - try out https://github.com/bmish/check-dependency-version-consistency to see if there are mis-matches.
423
144
  - or search your lockfile for mis-matches.
424
145
  `), console.info(" Got config:", tamaguiConfig), process.exit(0));
425
- var firstThemeName = Object.keys((tamaguiConfig == null ? void 0 : tamaguiConfig.themes) || {})[0], firstTheme = (tamaguiConfig == null ? void 0 : tamaguiConfig.themes[firstThemeName]) || {};
426
- if (!firstTheme || (typeof firstTheme > "u" ? "undefined" : _type_of(firstTheme)) !== "object") {
427
- var _$err = "Missing theme ".concat(firstThemeName, ", an error occurred when importing your config");
146
+ var firstThemeName = Object.keys(tamaguiConfig?.themes || {})[0], firstTheme = tamaguiConfig?.themes[firstThemeName] || {};
147
+ if (!firstTheme || typeof firstTheme != "object") {
148
+ var _$err = `Missing theme ${firstThemeName}, an error occurred when importing your config`;
428
149
  throw console.info(_$err, "Got config:", tamaguiConfig), console.info("Looking for theme:", firstThemeName), new Error(_$err);
429
150
  }
430
151
  var proxiedTheme = proxyThemeVariables(firstTheme), themeAccessListeners = /* @__PURE__ */ new Set(), defaultTheme = new Proxy(proxiedTheme, {
431
- get: function(target, key) {
152
+ get(target, key) {
432
153
  return Reflect.has(target, key) && themeAccessListeners.forEach(function(cb) {
433
154
  return cb(String(key));
434
155
  }), Reflect.get(target, key);
435
156
  }
436
157
  }), body = fileOrPath.type === "Program" ? fileOrPath.get("body") : fileOrPath.program.body;
437
- isFullyDisabled(options) || Object.keys(components || []).length === 0 && (console.warn("Warning: Tamagui didn't find any valid components (DEBUG=tamagui for more)"), process.env.DEBUG === "tamagui" && console.info("components", Object.keys(components || []), components)), shouldPrintDebug === "verbose" && (logger.info("allLoadedComponent modules ".concat(propsWithFileInfo.allLoadedComponents.map(function(k) {
158
+ isFullyDisabled(options) || Object.keys(components || []).length === 0 && (console.warn("Warning: Tamagui didn't find any valid components (DEBUG=tamagui for more)"), process.env.DEBUG === "tamagui" && console.info("components", Object.keys(components || []), components)), shouldPrintDebug === "verbose" && (logger.info(`allLoadedComponent modules ${propsWithFileInfo.allLoadedComponents.map(function(k) {
438
159
  return k.moduleName;
439
- }).join(", "))), logger.info("valid import paths: ".concat(JSON.stringify(getValidComponentsPaths(propsWithFileInfo)))));
160
+ }).join(", ")}`), logger.info(`valid import paths: ${JSON.stringify(getValidComponentsPaths(propsWithFileInfo))}`));
440
161
  var doesUseValidImport = !1, hasImportedTheme = !1, importDeclarations = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
441
162
  try {
442
163
  for (var _loop = function() {
443
164
  var bodyPath = _step.value;
444
165
  if (bodyPath.type !== "ImportDeclaration") return "continue";
445
166
  var node = "node" in bodyPath ? bodyPath.node : bodyPath, moduleName = node.source.value, valid = isValidImport(propsWithFileInfo, moduleName);
446
- if (valid && importDeclarations.push(node), shouldPrintDebug === "verbose" && logger.info(" - import ".concat(moduleName, " ").concat(valid)), extractStyledDefinitions && valid && node.specifiers.some(function(specifier) {
167
+ if (valid && importDeclarations.push(node), shouldPrintDebug === "verbose" && logger.info(` - import ${moduleName} ${valid}`), extractStyledDefinitions && valid && node.specifiers.some(function(specifier) {
447
168
  return specifier.local.name === "styled";
448
169
  }))
449
170
  return doesUseValidImport = !0, "break";
@@ -453,7 +174,7 @@ function createExtractor() {
453
174
  }), isValidComponent = names.some(function(name) {
454
175
  return !!(isValidImport(propsWithFileInfo, moduleName, name) || validHooks[name]);
455
176
  });
456
- if (shouldPrintDebug === "verbose" && logger.info(" - import ".concat(isValidComponent ? "\u2705" : "\u21E3", " - ").concat(names.join(", "), " from '").concat(moduleName, "' - (valid: ").concat(JSON.stringify(getValidComponentsPaths(propsWithFileInfo)), ")")), isValidComponent)
177
+ if (shouldPrintDebug === "verbose" && logger.info(` - import ${isValidComponent ? "\u2705" : "\u21E3"} - ${names.join(", ")} from '${moduleName}' - (valid: ${JSON.stringify(getValidComponentsPaths(propsWithFileInfo))})`), isValidComponent)
457
178
  return doesUseValidImport = !0, "break";
458
179
  }
459
180
  }, _iterator = body[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
@@ -470,11 +191,11 @@ function createExtractor() {
470
191
  throw _iteratorError;
471
192
  }
472
193
  }
473
- if (shouldPrintDebug && logger.info("".concat(JSON.stringify({
194
+ if (shouldPrintDebug && logger.info(`${JSON.stringify({
474
195
  doesUseValidImport,
475
196
  hasImportedTheme
476
- }, null, 2), `
477
- `)), !doesUseValidImport)
197
+ }, null, 2)}
198
+ `), !doesUseValidImport)
478
199
  return null;
479
200
  function getValidImportedComponent(componentName) {
480
201
  var importDeclaration = importDeclarations.find(function(dec) {
@@ -493,16 +214,16 @@ function createExtractor() {
493
214
  optimized: 0,
494
215
  modified: 0,
495
216
  found: 0
496
- }, version = "".concat(Math.random());
217
+ }, version = `${Math.random()}`;
497
218
  if (callTraverse({
498
219
  // @ts-ignore
499
220
  Program: {
500
- enter: function(path) {
221
+ enter(path) {
501
222
  programPath = path;
502
223
  }
503
224
  },
504
225
  // styled() calls
505
- CallExpression: function(path) {
226
+ CallExpression(path) {
506
227
  if (!(disable || shouldDisableExtraction || extractStyledDefinitions === !1) && !(!t.isIdentifier(path.node.callee) || path.node.callee.name !== "styled")) {
507
228
  var variableName = t.isVariableDeclarator(path.parent) && t.isIdentifier(path.parent.id) ? path.parent.id.name : "unknown", parentNode = path.node.arguments[0];
508
229
  if (t.isIdentifier(parentNode)) {
@@ -513,7 +234,7 @@ function createExtractor() {
513
234
  if (enableDynamicEvaluation !== !0)
514
235
  return;
515
236
  try {
516
- shouldPrintDebug && logger.info("Unknown component: ".concat(variableName, " = styled(").concat(parentName, ") attempting dynamic load: ").concat(sourcePath));
237
+ shouldPrintDebug && logger.info(`Unknown component: ${variableName} = styled(${parentName}) attempting dynamic load: ${sourcePath}`);
517
238
  var out = loadTamaguiSync({
518
239
  forceExports: !0,
519
240
  components: [
@@ -521,28 +242,33 @@ function createExtractor() {
521
242
  ],
522
243
  cacheKey: version
523
244
  });
524
- if (!(out != null && out.components)) {
525
- shouldPrintDebug && logger.info("Couldn't load, got ".concat(out));
245
+ if (!out?.components) {
246
+ shouldPrintDebug && logger.info(`Couldn't load, got ${out}`);
526
247
  return;
527
248
  }
528
- if (propsWithFileInfo.allLoadedComponents = _to_consumable_array(propsWithFileInfo.allLoadedComponents).concat(_to_consumable_array(out.components)), Component = out.components.flatMap(function(x) {
249
+ if (propsWithFileInfo.allLoadedComponents = [
250
+ ...propsWithFileInfo.allLoadedComponents,
251
+ ...out.components
252
+ ], Component = out.components.flatMap(function(x) {
529
253
  var _x_nameToInfo_variableName;
530
254
  return (_x_nameToInfo_variableName = x.nameToInfo[variableName]) !== null && _x_nameToInfo_variableName !== void 0 ? _x_nameToInfo_variableName : [];
531
255
  })[0], !out.cached) {
532
256
  var _out_components, foundNames = (_out_components = out.components) === null || _out_components === void 0 ? void 0 : _out_components.map(function(x) {
533
257
  return Object.keys(x.nameToInfo).join(", ");
534
258
  }).join(", ").trim();
535
- foundNames && colorLog(Color.FgYellow, " | Tamagui found dynamic components: ".concat(foundNames));
259
+ foundNames && colorLog(Color.FgYellow, ` | Tamagui found dynamic components: ${foundNames}`);
536
260
  }
537
261
  } catch {
538
- shouldPrintDebug && logger.info("skip optimize styled(".concat(variableName, "), unable to pre-process (DEBUG=tamagui for more)"));
262
+ shouldPrintDebug && logger.info(`skip optimize styled(${variableName}), unable to pre-process (DEBUG=tamagui for more)`);
539
263
  }
540
264
  }
541
265
  if (!Component) {
542
266
  shouldPrintDebug && logger.info(" No component found");
543
267
  return;
544
268
  }
545
- var componentSkipProps = new Set(_to_consumable_array(Component.staticConfig.inlineWhenUnflattened || []).concat(_to_consumable_array(Component.staticConfig.inlineProps || []), [
269
+ var componentSkipProps = /* @__PURE__ */ new Set([
270
+ ...Component.staticConfig.inlineWhenUnflattened || [],
271
+ ...Component.staticConfig.inlineProps || [],
546
272
  // for now skip variants, will return to them
547
273
  "variants",
548
274
  "defaultVariants",
@@ -554,7 +280,7 @@ function createExtractor() {
554
280
  "disabledStyle",
555
281
  "hoverStyle",
556
282
  "pressStyle"
557
- ])), skipped = /* @__PURE__ */ new Set(), styles = {}, staticNamespace = getStaticBindingsForScope(path.scope, importsWhitelist, sourcePath, bindingCache, shouldPrintDebug), attemptEval = evaluateVars ? createEvaluator({
283
+ ]), skipped = /* @__PURE__ */ new Set(), styles = {}, staticNamespace = getStaticBindingsForScope(path.scope, importsWhitelist, sourcePath, bindingCache, shouldPrintDebug), attemptEval = evaluateVars ? createEvaluator({
558
284
  props: propsWithFileInfo,
559
285
  staticNamespace,
560
286
  sourcePath,
@@ -582,10 +308,12 @@ function createExtractor() {
582
308
  throw _iteratorError2;
583
309
  }
584
310
  }
585
- var out2 = getSplitStyles(styles, Component.staticConfig, defaultTheme, "", componentState, styleProps, void 0, void 0, void 0, shouldPrintDebug), classNames = _object_spread({}, out2.classNames);
311
+ var out2 = getSplitStyles(styles, Component.staticConfig, defaultTheme, "", componentState, styleProps, void 0, void 0, void 0, shouldPrintDebug), classNames = {
312
+ ...out2.classNames
313
+ };
586
314
  if (shouldPrintDebug && logger.info([
587
- "Extracted styled(".concat(variableName, `)
588
- `),
315
+ `Extracted styled(${variableName})
316
+ `,
589
317
  JSON.stringify(styles, null, 2),
590
318
  `
591
319
  classNames:`,
@@ -601,58 +329,330 @@ function createExtractor() {
601
329
  }), out2.rulesToInsert)
602
330
  for (var key in out2.rulesToInsert) {
603
331
  var styleObject = out2.rulesToInsert[key];
604
- onStyleRule == null || onStyleRule(styleObject[StyleObjectIdentifier], styleObject[StyleObjectRules]);
332
+ onStyleRule?.(styleObject[StyleObjectIdentifier], styleObject[StyleObjectRules]);
605
333
  }
606
- res.styled++, shouldPrintDebug && logger.info("Extracted styled(".concat(variableName, ")"));
334
+ res.styled++, shouldPrintDebug && logger.info(`Extracted styled(${variableName})`);
607
335
  }
608
336
  }
609
337
  }
610
338
  },
611
- JSXElement: function(traversePath) {
339
+ JSXElement(traversePath) {
612
340
  tm.mark("jsx-element", !!shouldPrintDebug);
613
341
  var node = traversePath.node.openingElement, ogAttributes = node.attributes.map(function(attr3) {
614
- return _object_spread({}, attr3);
342
+ return {
343
+ ...attr3
344
+ };
615
345
  }), componentName = findComponentName(traversePath.scope), closingElement = traversePath.node.closingElement;
616
- if (closingElement && t.isJSXMemberExpression(closingElement == null ? void 0 : closingElement.name) || !t.isJSXIdentifier(node.name)) {
346
+ if (closingElement && t.isJSXMemberExpression(closingElement?.name) || !t.isJSXIdentifier(node.name)) {
617
347
  shouldPrintDebug && logger.info(" skip non-identifier element");
618
348
  return;
619
349
  }
620
350
  var binding = traversePath.scope.getBinding(node.name.name), moduleName = "";
621
351
  if (binding && t.isImportDeclaration(binding.path.parent) && (moduleName = binding.path.parent.source.value, !isValidImport(propsWithFileInfo, moduleName, binding.identifier.name))) {
622
- shouldPrintDebug && logger.info(" - Binding in component ".concat(componentName, ' not valid import: "').concat(binding.identifier.name, `" isn't in `).concat(moduleName, `
623
- `));
352
+ shouldPrintDebug && logger.info(` - Binding in component ${componentName} not valid import: "${binding.identifier.name}" isn't in ${moduleName}
353
+ `);
624
354
  return;
625
355
  }
626
356
  var component = getValidComponent(propsWithFileInfo, moduleName, node.name.name);
627
357
  if (!component || !component.staticConfig) {
628
358
  shouldPrintDebug && logger.info(`
629
- - No Tamagui conf for: `.concat(node.name.name, `
630
- `));
359
+ - No Tamagui conf for: ${node.name.name}
360
+ `);
631
361
  return;
632
362
  }
633
363
  var originalNodeName = node.name.name;
634
364
  res.found++;
635
- var filePath = "./".concat(relative(process.cwd(), sourcePath)), lineNumbers = node.loc ? node.loc.start.line + (node.loc.start.line !== node.loc.end.line ? "-".concat(node.loc.end.line) : "") : "", codePosition = "".concat(filePath, ":").concat(lineNumbers), debugPropValue = node.attributes.filter(function(n) {
365
+ var filePath = `./${relative(process.cwd(), sourcePath)}`, lineNumbers = node.loc ? node.loc.start.line + (node.loc.start.line !== node.loc.end.line ? `-${node.loc.end.line}` : "") : "", codePosition = `${filePath}:${lineNumbers}`, debugPropValue = node.attributes.filter(function(n) {
636
366
  return t.isJSXAttribute(n) && t.isJSXIdentifier(n.name) && n.name.name === "debug";
637
367
  }).map(function(n) {
638
368
  return n.value === null ? !0 : t.isStringLiteral(n.value) ? n.value.value : !1;
639
369
  })[0];
640
- if (debugPropValue && (shouldPrintDebug = debugPropValue), shouldPrintDebug && (logger.info("\x1B[33m\x1B[0m " + "".concat(componentName, " | ").concat(codePosition, " -------------------")), logger.info([
370
+ if (debugPropValue && (shouldPrintDebug = debugPropValue), shouldPrintDebug && (logger.info(`\x1B[33m\x1B[0m ${componentName} | ${codePosition} -------------------`), logger.info([
641
371
  "\x1B[1m",
642
372
  "\x1B[32m",
643
- "<".concat(originalNodeName, " />"),
373
+ `<${originalNodeName} />`,
644
374
  disableDebugAttr ? "" : "\u{1F41B}"
645
- ].join(" "))), shouldAddDebugProp && !disableDebugAttr && (res.modified++, node.attributes.unshift(t.jsxAttribute(t.jsxIdentifier("data-is"), t.stringLiteral(node.name.name))), componentName && node.attributes.unshift(t.jsxAttribute(t.jsxIdentifier("data-in"), t.stringLiteral(componentName))), node.attributes.unshift(t.jsxAttribute(t.jsxIdentifier("data-at"), t.stringLiteral("".concat(basename(filePath), ":").concat(lineNumbers))))), shouldDisableExtraction) {
646
- shouldPrintDebug === "verbose" && logger.info(" \u274C Extraction disabled: ".concat(JSON.stringify(disableExtraction), `
647
- `));
375
+ ].join(" "))), shouldAddDebugProp && !disableDebugAttr && (res.modified++, node.attributes.unshift(t.jsxAttribute(t.jsxIdentifier("data-is"), t.stringLiteral(node.name.name))), componentName && node.attributes.unshift(t.jsxAttribute(t.jsxIdentifier("data-in"), t.stringLiteral(componentName))), node.attributes.unshift(t.jsxAttribute(t.jsxIdentifier("data-at"), t.stringLiteral(`${basename(filePath)}:${lineNumbers}`)))), shouldDisableExtraction) {
376
+ shouldPrintDebug === "verbose" && logger.info(` \u274C Extraction disabled: ${JSON.stringify(disableExtraction)}
377
+ `);
648
378
  return;
649
379
  }
650
380
  try {
651
- let createTernariesFromObjectProperties2 = function(test, side) {
381
+ let evaluateAttribute2 = function(path) {
382
+ var attribute = path.node, attr3 = {
383
+ type: "attr",
384
+ value: attribute
385
+ };
386
+ if (t.isJSXSpreadAttribute(attribute)) {
387
+ var arg = attribute.argument, conditional = t.isConditionalExpression(arg) ? (
388
+ // <YStack {...isSmall ? { color: 'red } : { color: 'blue }}
389
+ [
390
+ arg.test,
391
+ arg.consequent,
392
+ arg.alternate
393
+ ]
394
+ ) : t.isLogicalExpression(arg) && arg.operator === "&&" ? (
395
+ // <YStack {...isSmall && { color: 'red }}
396
+ [
397
+ arg.left,
398
+ arg.right,
399
+ null
400
+ ]
401
+ ) : null;
402
+ if (conditional) {
403
+ var [test, alt, cons] = conditional;
404
+ if (!test) throw new Error("no test");
405
+ return [
406
+ alt,
407
+ cons
408
+ ].some(function(side) {
409
+ return side && !isStaticObject2(side);
410
+ }) ? (shouldPrintDebug && logger.info(`not extractable ${alt} ${cons}`), attr3) : [
411
+ ...createTernariesFromObjectProperties2(test, alt) || [],
412
+ ...cons && createTernariesFromObjectProperties2(t.unaryExpression("!", test), cons) || []
413
+ ].map(function(ternary2) {
414
+ return {
415
+ type: "ternary",
416
+ value: ternary2
417
+ };
418
+ });
419
+ }
420
+ }
421
+ if (t.isJSXSpreadAttribute(attribute) || !attribute.name || typeof attribute.name.name != "string")
422
+ return shouldPrintDebug && logger.info(" ! inlining, spread attr"), inlined.set(`${Math.random()}`, "spread"), attr3;
423
+ var name2 = attribute.name.name;
424
+ if (excludeProps?.has(name2))
425
+ return shouldPrintDebug && logger.info([
426
+ " excluding prop",
427
+ name2
428
+ ].join(" ")), null;
429
+ if (inlineProps.has(name2))
430
+ return inlined.set(name2, name2), shouldPrintDebug && logger.info([
431
+ " ! inlining, inline prop",
432
+ name2
433
+ ].join(" ")), attr3;
434
+ if (UNTOUCHED_PROPS[name2])
435
+ return attr3;
436
+ if (INLINE_EXTRACTABLE[name2])
437
+ return inlined.set(name2, INLINE_EXTRACTABLE[name2]), attr3;
438
+ if (name2.startsWith("data-"))
439
+ return attr3;
440
+ if ((name2 === "enterStyle" || name2 === "exitStyle") && t.isJSXExpressionContainer(attribute?.value))
441
+ return shouldDeopt = !0, attr3;
442
+ if (name2[0] === "$" && t.isJSXExpressionContainer(attribute?.value)) {
443
+ var shortname = name2.slice(1);
444
+ if (mediaQueryConfig[shortname]) {
445
+ if (platform2 === "native" && (shouldDeopt = !0), disableExtractInlineMedia)
446
+ return attr3;
447
+ var expression = attribute.value.expression;
448
+ if (!t.isJSXEmptyExpression(expression)) {
449
+ var ternaries2 = createTernariesFromObjectProperties2(t.stringLiteral(shortname), expression, {
450
+ inlineMediaQuery: shortname
451
+ });
452
+ if (ternaries2)
453
+ return ternaries2.map(function(value3) {
454
+ return {
455
+ type: "ternary",
456
+ value: value3
457
+ };
458
+ });
459
+ }
460
+ }
461
+ }
462
+ var [value2, valuePath] = function() {
463
+ return t.isJSXExpressionContainer(attribute?.value) ? [
464
+ attribute.value.expression,
465
+ path.get("value")
466
+ ] : [
467
+ attribute.value,
468
+ path.get("value")
469
+ ];
470
+ }(), remove = function() {
471
+ Array.isArray(valuePath) ? valuePath.map(function(p) {
472
+ return p.remove();
473
+ }) : valuePath.remove();
474
+ };
475
+ if (name2 === "ref")
476
+ return shouldPrintDebug && logger.info([
477
+ " ! inlining, ref",
478
+ name2
479
+ ].join(" ")), inlined.set("ref", "ref"), attr3;
480
+ if (name2 === "tag")
481
+ return {
482
+ type: "attr",
483
+ value: path.node
484
+ };
485
+ if (disableExtractVariables === !0 && value2 && value2.type === "StringLiteral" && value2.value[0] === "$")
486
+ return shouldPrintDebug && logger.info([
487
+ ` ! inlining, native disable extract: ${name2} =`,
488
+ value2.value
489
+ ].join(" ")), inlined.set(name2, !0), attr3;
490
+ if (name2 === "theme")
491
+ return inlined.set("theme", attr3.value), attr3;
492
+ var styleValue = attemptEvalSafe(value2);
493
+ if (!variants[name2] && !isValidStyleKey(name2, staticConfig)) {
494
+ var keys = [
495
+ name2
496
+ ], out = null;
497
+ out = propMapper(name2, styleValue, propMapperStyleState), out && (Array.isArray(out) ? (out = Object.fromEntries(out), keys = Object.keys(out)) : (logger.warn("Error expected array but got", out), couldntParse = !0, shouldDeopt = !0)), out && (isTargetingHTML && (out = reactNativeWebInternals.createDOMProps(isTextView ? "span" : "div", out), delete out.className), keys = Object.keys(out));
498
+ var didInline = !1, attributes = keys.map(function(key9) {
499
+ var val2 = out[key9], isStyle = isValidStyleKey(key9, staticConfig);
500
+ return isStyle ? {
501
+ type: "style",
502
+ value: {
503
+ [key9]: styleValue
504
+ },
505
+ name: key9,
506
+ attr: path.node
507
+ } : validHTMLAttributes[key9] || key9.startsWith("aria-") || key9.startsWith("data-") || // this is debug stuff added by vite / new jsx transform
508
+ key9 === "__source" || key9 === "__self" ? attr3 : (shouldPrintDebug && logger.info(" ! inlining, non-static " + key9), didInline = !0, inlined.set(key9, val2), val2);
509
+ });
510
+ return didInline ? (shouldPrintDebug && logger.info(` bailing flattening due to attributes ${attributes.map(function(x) {
511
+ return x.toString();
512
+ })}`), attr3) : attributes;
513
+ }
514
+ if (styleValue !== FAILED_EVAL)
515
+ return inlineWhenUnflattened.has(name2) && (inlineWhenUnflattenedOGVals[name2] = {
516
+ styleValue,
517
+ attr: attr3
518
+ }), isValidStyleKey(name2, staticConfig) ? (shouldPrintDebug && logger.info(` style: ${name2} = ${styleValue}`), name2 in defaultProps || hasSetOptimized || (res.optimized++, hasSetOptimized = !0), {
519
+ type: "style",
520
+ value: {
521
+ [name2]: styleValue
522
+ },
523
+ name: name2,
524
+ attr: path.node
525
+ }) : (variants[name2] && variantValues.set(name2, styleValue), inlined.set(name2, !0), attr3);
526
+ if (t.isBinaryExpression(value2)) {
527
+ shouldPrintDebug && logger.info(` binary expression ${name2} = ${value2}`);
528
+ var { operator, left, right } = value2, lVal = attemptEvalSafe(left), rVal = attemptEvalSafe(right);
529
+ if (shouldPrintDebug && logger.info(` evalBinaryExpression lVal ${String(lVal)}, rVal ${String(rVal)}`), lVal !== FAILED_EVAL && t.isConditionalExpression(right)) {
530
+ var ternary = addBinaryConditional(operator, left, right);
531
+ if (ternary) return ternary;
532
+ }
533
+ if (rVal !== FAILED_EVAL && t.isConditionalExpression(left)) {
534
+ var ternary1 = addBinaryConditional(operator, right, left);
535
+ if (ternary1) return ternary1;
536
+ }
537
+ return shouldPrintDebug && logger.info(" evalBinaryExpression cant extract"), inlined.set(name2, !0), attr3;
538
+ }
539
+ var staticConditional = getStaticConditional(value2);
540
+ if (staticConditional)
541
+ return shouldPrintDebug === "verbose" && logger.info(` static conditional ${name2} ${value2}`), {
542
+ type: "ternary",
543
+ value: staticConditional
544
+ };
545
+ var staticLogical = getStaticLogical(value2);
546
+ if (staticLogical)
547
+ return shouldPrintDebug === "verbose" && logger.info(` static ternary ${name2} = ${value2}`), {
548
+ type: "ternary",
549
+ value: staticLogical
550
+ };
551
+ if (options.experimentalFlattenDynamicValues && isValidStyleKey(name2, staticConfig))
552
+ return {
553
+ type: "dynamic-style",
554
+ value: value2,
555
+ name: tamaguiConfig?.shorthands[name2] || name2
556
+ };
557
+ return inlined.set(name2, !0), shouldPrintDebug && logger.info(` ! inline no match ${name2} ${value2}`), attr3;
558
+ function addBinaryConditional(operator2, staticExpr, cond) {
559
+ if (getStaticConditional(cond)) {
560
+ var alt2 = attemptEval(t.binaryExpression(operator2, staticExpr, cond.alternate)), cons2 = attemptEval(t.binaryExpression(operator2, staticExpr, cond.consequent));
561
+ return shouldPrintDebug && logger.info([
562
+ " binaryConditional",
563
+ cond.test,
564
+ cons2,
565
+ alt2
566
+ ].join(" ")), {
567
+ type: "ternary",
568
+ value: {
569
+ test: cond.test,
570
+ remove,
571
+ alternate: {
572
+ [name2]: alt2
573
+ },
574
+ consequent: {
575
+ [name2]: cons2
576
+ }
577
+ }
578
+ };
579
+ }
580
+ return null;
581
+ }
582
+ function getStaticConditional(value3) {
583
+ if (t.isConditionalExpression(value3))
584
+ try {
585
+ var aVal = attemptEval(value3.alternate), cVal = attemptEval(value3.consequent);
586
+ if (shouldPrintDebug) {
587
+ var type = value3.test.type;
588
+ logger.info([
589
+ " static ternary",
590
+ type,
591
+ cVal,
592
+ aVal
593
+ ].join(" "));
594
+ }
595
+ return {
596
+ test: value3.test,
597
+ remove,
598
+ consequent: {
599
+ [name2]: cVal
600
+ },
601
+ alternate: {
602
+ [name2]: aVal
603
+ }
604
+ };
605
+ } catch (err) {
606
+ shouldPrintDebug && logger.info([
607
+ " cant eval ternary",
608
+ err.message
609
+ ].join(" "));
610
+ }
611
+ return null;
612
+ }
613
+ function getStaticLogical(value3) {
614
+ if (t.isLogicalExpression(value3) && value3.operator === "&&")
615
+ try {
616
+ var val2 = attemptEval(value3.right);
617
+ return shouldPrintDebug && logger.info([
618
+ " staticLogical",
619
+ value3.left,
620
+ name2,
621
+ val2
622
+ ].join(" ")), {
623
+ test: value3.left,
624
+ remove,
625
+ consequent: {
626
+ [name2]: val2
627
+ },
628
+ alternate: null
629
+ };
630
+ } catch (err) {
631
+ shouldPrintDebug && logger.info([
632
+ " cant static eval logical",
633
+ err
634
+ ].join(" "));
635
+ }
636
+ return null;
637
+ }
638
+ }, isStaticObject2 = function(obj) {
639
+ return t.isObjectExpression(obj) && obj.properties.every(function(prop) {
640
+ if (!t.isObjectProperty(prop))
641
+ return logger.info([
642
+ "not object prop",
643
+ prop
644
+ ].join(" ")), !1;
645
+ var propName = prop.key.name;
646
+ return !isValidStyleKey(propName, staticConfig) && propName !== "tag" ? (shouldPrintDebug && logger.info([
647
+ " not a valid style prop!",
648
+ propName
649
+ ].join(" ")), !1) : !0;
650
+ });
651
+ }, createTernariesFromObjectProperties2 = function(test, side) {
652
652
  var ternaryPartial = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
653
653
  if (!side)
654
654
  return null;
655
- if (!isStaticObject(side))
655
+ if (!isStaticObject2(side))
656
656
  throw new Error("not extractable");
657
657
  return side.properties.flatMap(function(property) {
658
658
  if (!t.isObjectProperty(property))
@@ -666,10 +666,12 @@ function createExtractor() {
666
666
  });
667
667
  if (ternaries2)
668
668
  return ternaries2.map(function(value2) {
669
- return _object_spread_props(_object_spread({}, ternaryPartial, value2), {
669
+ return {
670
+ ...ternaryPartial,
671
+ ...value2,
670
672
  // ensure media query test stays on left side (see getMediaQueryTernary)
671
673
  test: t.logicalExpression("&&", value2.test, test)
672
- });
674
+ };
673
675
  });
674
676
  logger.info([
675
677
  "\u26A0\uFE0F no ternaries?",
@@ -682,7 +684,7 @@ function createExtractor() {
682
684
  ].join(" "));
683
685
  }
684
686
  if (t.isConditionalExpression(property.value)) {
685
- var _map = _sliced_to_array([
687
+ var [truthy, falsy] = [
686
688
  t.objectExpression([
687
689
  t.objectProperty(property.key, property.value.consequent)
688
690
  ]),
@@ -691,356 +693,102 @@ function createExtractor() {
691
693
  ])
692
694
  ].map(function(x) {
693
695
  return attemptEval(x);
694
- }), 2), truthy = _map[0], falsy = _map[1];
696
+ });
695
697
  return [
696
- createTernary(_object_spread_props(_object_spread({
697
- remove: function() {
698
- }
699
- }, ternaryPartial), {
698
+ createTernary({
699
+ remove() {
700
+ },
701
+ ...ternaryPartial,
700
702
  test: t.logicalExpression("&&", test, property.value.test),
701
703
  consequent: truthy,
702
704
  alternate: null
703
- })),
704
- createTernary(_object_spread_props(_object_spread({}, ternaryPartial), {
705
+ }),
706
+ createTernary({
707
+ ...ternaryPartial,
705
708
  test: t.logicalExpression("&&", test, t.unaryExpression("!", property.value.test)),
706
709
  consequent: falsy,
707
710
  alternate: null,
708
- remove: function() {
711
+ remove() {
709
712
  }
710
- }))
713
+ })
711
714
  ];
712
715
  }
713
716
  var obj = t.objectExpression([
714
717
  t.objectProperty(property.key, property.value)
715
718
  ]), consequent = attemptEval(obj);
716
- return createTernary(_object_spread_props(_object_spread({
717
- remove: function() {
718
- }
719
- }, ternaryPartial), {
719
+ return createTernary({
720
+ remove() {
721
+ },
722
+ ...ternaryPartial,
720
723
  test,
721
724
  consequent,
722
725
  alternate: null
723
- }));
724
- });
725
- };
726
- var createTernariesFromObjectProperties = createTernariesFromObjectProperties2, evaluateAttribute = (
727
- // START function evaluateAttribute
728
- function(path) {
729
- var attribute = path.node, attr3 = {
730
- type: "attr",
731
- value: attribute
732
- };
733
- if (t.isJSXSpreadAttribute(attribute)) {
734
- var arg = attribute.argument, conditional = t.isConditionalExpression(arg) ? (
735
- // <YStack {...isSmall ? { color: 'red } : { color: 'blue }}
736
- [
737
- arg.test,
738
- arg.consequent,
739
- arg.alternate
740
- ]
741
- ) : t.isLogicalExpression(arg) && arg.operator === "&&" ? (
742
- // <YStack {...isSmall && { color: 'red }}
743
- [
744
- arg.left,
745
- arg.right,
746
- null
747
- ]
748
- ) : null;
749
- if (conditional) {
750
- var _conditional = _sliced_to_array(conditional, 3), test = _conditional[0], alt = _conditional[1], cons = _conditional[2];
751
- if (!test) throw new Error("no test");
752
- return [
753
- alt,
754
- cons
755
- ].some(function(side) {
756
- return side && !isStaticObject(side);
757
- }) ? (shouldPrintDebug && logger.info("not extractable ".concat(alt, " ").concat(cons)), attr3) : _to_consumable_array(createTernariesFromObjectProperties2(test, alt) || []).concat(_to_consumable_array(cons && createTernariesFromObjectProperties2(t.unaryExpression("!", test), cons) || [])).map(function(ternary2) {
758
- return {
759
- type: "ternary",
760
- value: ternary2
761
- };
762
- });
763
- }
764
- }
765
- if (t.isJSXSpreadAttribute(attribute) || !attribute.name || typeof attribute.name.name != "string")
766
- return shouldPrintDebug && logger.info(" ! inlining, spread attr"), inlined.set("".concat(Math.random()), "spread"), attr3;
767
- var name2 = attribute.name.name;
768
- if (excludeProps != null && excludeProps.has(name2))
769
- return shouldPrintDebug && logger.info([
770
- " excluding prop",
771
- name2
772
- ].join(" ")), null;
773
- if (inlineProps.has(name2))
774
- return inlined.set(name2, name2), shouldPrintDebug && logger.info([
775
- " ! inlining, inline prop",
776
- name2
777
- ].join(" ")), attr3;
778
- if (UNTOUCHED_PROPS[name2])
779
- return attr3;
780
- if (INLINE_EXTRACTABLE[name2])
781
- return inlined.set(name2, INLINE_EXTRACTABLE[name2]), attr3;
782
- if (name2.startsWith("data-"))
783
- return attr3;
784
- if ((name2 === "enterStyle" || name2 === "exitStyle") && t.isJSXExpressionContainer(attribute == null ? void 0 : attribute.value))
785
- return shouldDeopt = !0, attr3;
786
- if (name2[0] === "$" && t.isJSXExpressionContainer(attribute == null ? void 0 : attribute.value)) {
787
- var shortname = name2.slice(1);
788
- if (mediaQueryConfig[shortname]) {
789
- if (platform2 === "native" && (shouldDeopt = !0), disableExtractInlineMedia)
790
- return attr3;
791
- var expression = attribute.value.expression;
792
- if (!t.isJSXEmptyExpression(expression)) {
793
- var ternaries2 = createTernariesFromObjectProperties2(t.stringLiteral(shortname), expression, {
794
- inlineMediaQuery: shortname
795
- });
796
- if (ternaries2)
797
- return ternaries2.map(function(value3) {
798
- return {
799
- type: "ternary",
800
- value: value3
801
- };
802
- });
803
- }
804
- }
805
- }
806
- var _ref2 = _sliced_to_array(function() {
807
- return t.isJSXExpressionContainer(attribute == null ? void 0 : attribute.value) ? [
808
- attribute.value.expression,
809
- path.get("value")
810
- ] : [
811
- attribute.value,
812
- path.get("value")
813
- ];
814
- }(), 2), value2 = _ref2[0], valuePath = _ref2[1], remove = function() {
815
- Array.isArray(valuePath) ? valuePath.map(function(p) {
816
- return p.remove();
817
- }) : valuePath.remove();
818
- };
819
- if (name2 === "ref")
820
- return shouldPrintDebug && logger.info([
821
- " ! inlining, ref",
822
- name2
823
- ].join(" ")), inlined.set("ref", "ref"), attr3;
824
- if (name2 === "tag")
825
- return {
826
- type: "attr",
827
- value: path.node
828
- };
829
- if (disableExtractVariables === !0 && value2 && value2.type === "StringLiteral" && value2.value[0] === "$")
830
- return shouldPrintDebug && logger.info([
831
- " ! inlining, native disable extract: ".concat(name2, " ="),
832
- value2.value
833
- ].join(" ")), inlined.set(name2, !0), attr3;
834
- if (name2 === "theme")
835
- return inlined.set("theme", attr3.value), attr3;
836
- var styleValue = attemptEvalSafe(value2);
837
- if (!variants[name2] && !isValidStyleKey(name2, staticConfig)) {
838
- var keys = [
839
- name2
840
- ], out = null;
841
- out = propMapper(name2, styleValue, propMapperStyleState), out && (Array.isArray(out) ? (out = Object.fromEntries(out), keys = Object.keys(out)) : (logger.warn("Error expected array but got", out), couldntParse = !0, shouldDeopt = !0)), out && (isTargetingHTML && (out = reactNativeWebInternals.createDOMProps(isTextView ? "span" : "div", out), delete out.className), keys = Object.keys(out));
842
- var didInline = !1, attributes = keys.map(function(key9) {
843
- var val2 = out[key9], isStyle = isValidStyleKey(key9, staticConfig);
844
- return isStyle ? {
845
- type: "style",
846
- value: _define_property({}, key9, styleValue),
847
- name: key9,
848
- attr: path.node
849
- } : validHTMLAttributes[key9] || key9.startsWith("aria-") || key9.startsWith("data-") || // this is debug stuff added by vite / new jsx transform
850
- key9 === "__source" || key9 === "__self" ? attr3 : (shouldPrintDebug && logger.info(" ! inlining, non-static " + key9), didInline = !0, inlined.set(key9, val2), val2);
851
- });
852
- return didInline ? (shouldPrintDebug && logger.info(" bailing flattening due to attributes ".concat(attributes.map(function(x) {
853
- return x.toString();
854
- }))), attr3) : attributes;
855
- }
856
- if (styleValue !== FAILED_EVAL)
857
- return inlineWhenUnflattened.has(name2) && (inlineWhenUnflattenedOGVals[name2] = {
858
- styleValue,
859
- attr: attr3
860
- }), isValidStyleKey(name2, staticConfig) ? (shouldPrintDebug && logger.info(" style: ".concat(name2, " = ").concat(styleValue)), name2 in defaultProps || hasSetOptimized || (res.optimized++, hasSetOptimized = !0), {
861
- type: "style",
862
- value: _define_property({}, name2, styleValue),
863
- name: name2,
864
- attr: path.node
865
- }) : (variants[name2] && variantValues.set(name2, styleValue), inlined.set(name2, !0), attr3);
866
- if (t.isBinaryExpression(value2)) {
867
- shouldPrintDebug && logger.info(" binary expression ".concat(name2, " = ").concat(value2));
868
- var operator = value2.operator, left = value2.left, right = value2.right, lVal = attemptEvalSafe(left), rVal = attemptEvalSafe(right);
869
- if (shouldPrintDebug && logger.info(" evalBinaryExpression lVal ".concat(String(lVal), ", rVal ").concat(String(rVal))), lVal !== FAILED_EVAL && t.isConditionalExpression(right)) {
870
- var ternary = addBinaryConditional(operator, left, right);
871
- if (ternary) return ternary;
872
- }
873
- if (rVal !== FAILED_EVAL && t.isConditionalExpression(left)) {
874
- var ternary1 = addBinaryConditional(operator, right, left);
875
- if (ternary1) return ternary1;
876
- }
877
- return shouldPrintDebug && logger.info(" evalBinaryExpression cant extract"), inlined.set(name2, !0), attr3;
878
- }
879
- var staticConditional = getStaticConditional(value2);
880
- if (staticConditional)
881
- return shouldPrintDebug === "verbose" && logger.info(" static conditional ".concat(name2, " ").concat(value2)), {
882
- type: "ternary",
883
- value: staticConditional
884
- };
885
- var staticLogical = getStaticLogical(value2);
886
- if (staticLogical)
887
- return shouldPrintDebug === "verbose" && logger.info(" static ternary ".concat(name2, " = ").concat(value2)), {
888
- type: "ternary",
889
- value: staticLogical
890
- };
891
- if (options.experimentalFlattenDynamicValues && isValidStyleKey(name2, staticConfig))
892
- return {
893
- type: "dynamic-style",
894
- value: value2,
895
- name: (tamaguiConfig == null ? void 0 : tamaguiConfig.shorthands[name2]) || name2
896
- };
897
- return inlined.set(name2, !0), shouldPrintDebug && logger.info(" ! inline no match ".concat(name2, " ").concat(value2)), attr3;
898
- function addBinaryConditional(operator2, staticExpr, cond) {
899
- if (getStaticConditional(cond)) {
900
- var alt2 = attemptEval(t.binaryExpression(operator2, staticExpr, cond.alternate)), cons2 = attemptEval(t.binaryExpression(operator2, staticExpr, cond.consequent));
901
- return shouldPrintDebug && logger.info([
902
- " binaryConditional",
903
- cond.test,
904
- cons2,
905
- alt2
906
- ].join(" ")), {
907
- type: "ternary",
908
- value: {
909
- test: cond.test,
910
- remove,
911
- alternate: _define_property({}, name2, alt2),
912
- consequent: _define_property({}, name2, cons2)
913
- }
914
- };
915
- }
916
- return null;
917
- }
918
- function getStaticConditional(value3) {
919
- if (t.isConditionalExpression(value3))
920
- try {
921
- var aVal = attemptEval(value3.alternate), cVal = attemptEval(value3.consequent);
922
- if (shouldPrintDebug) {
923
- var type = value3.test.type;
924
- logger.info([
925
- " static ternary",
926
- type,
927
- cVal,
928
- aVal
929
- ].join(" "));
930
- }
931
- return {
932
- test: value3.test,
933
- remove,
934
- consequent: _define_property({}, name2, cVal),
935
- alternate: _define_property({}, name2, aVal)
936
- };
937
- } catch (err) {
938
- shouldPrintDebug && logger.info([
939
- " cant eval ternary",
940
- err.message
941
- ].join(" "));
942
- }
943
- return null;
944
- }
945
- function getStaticLogical(value3) {
946
- if (t.isLogicalExpression(value3) && value3.operator === "&&")
947
- try {
948
- var val2 = attemptEval(value3.right);
949
- return shouldPrintDebug && logger.info([
950
- " staticLogical",
951
- value3.left,
952
- name2,
953
- val2
954
- ].join(" ")), {
955
- test: value3.left,
956
- remove,
957
- consequent: _define_property({}, name2, val2),
958
- alternate: null
959
- };
960
- } catch (err) {
961
- shouldPrintDebug && logger.info([
962
- " cant static eval logical",
963
- err
964
- ].join(" "));
965
- }
966
- return null;
967
- }
968
- }
969
- ), isStaticObject = (
970
- // END function evaluateAttribute
971
- function(obj) {
972
- return t.isObjectExpression(obj) && obj.properties.every(function(prop) {
973
- if (!t.isObjectProperty(prop))
974
- return logger.info([
975
- "not object prop",
976
- prop
977
- ].join(" ")), !1;
978
- var propName = prop.key.name;
979
- return !isValidStyleKey(propName, staticConfig) && propName !== "tag" ? (shouldPrintDebug && logger.info([
980
- " not a valid style prop!",
981
- propName
982
- ].join(" ")), !1) : !0;
983
726
  });
984
- }
985
- ), mergeToEnd = function(obj, key9, val2) {
727
+ });
728
+ }, mergeToEnd2 = function(obj, key9, val2) {
986
729
  key9 in obj && delete obj[key9], obj[key9] = val2;
987
- }, normalizeStyleWithoutVariants = (
988
- // preserves order
989
- function(style) {
990
- var res2 = {};
991
- for (var key9 in style)
992
- if (staticConfig.variants && key9 in staticConfig.variants)
993
- mergeToEnd(res2, key9, style[key9]);
994
- else {
995
- var expanded2 = normalizeStyle(_define_property({}, key9, style[key9]), !0);
996
- for (var key12 in expanded2)
997
- mergeToEnd(res2, key12, expanded2[key12]);
998
- }
999
- return res2;
1000
- }
1001
- ), mergeStyles = function(prev2, next) {
730
+ }, normalizeStyleWithoutVariants2 = function(style) {
731
+ var res2 = {};
732
+ for (var key9 in style)
733
+ if (staticConfig.variants && key9 in staticConfig.variants)
734
+ mergeToEnd2(res2, key9, style[key9]);
735
+ else {
736
+ var expanded2 = normalizeStyle({
737
+ [key9]: style[key9]
738
+ }, !0);
739
+ for (var key12 in expanded2)
740
+ mergeToEnd2(res2, key12, expanded2[key12]);
741
+ }
742
+ return res2;
743
+ }, mergeStyles2 = function(prev2, next) {
1002
744
  for (var key9 in next)
1003
- pseudoDescriptors[key9] ? (prev2[key9] = prev2[key9] || {}, Object.assign(prev2[key9], next[key9])) : mergeToEnd(prev2, key9, next[key9]);
1004
- }, staticConfig = component.staticConfig, defaultProps = _object_spread({}, staticConfig.defaultProps || {}), variants = staticConfig.variants || {}, isTextView = staticConfig.isText || !1, _staticConfig_validStyles, validStyles = (_staticConfig_validStyles = staticConfig == null ? void 0 : staticConfig.validStyles) !== null && _staticConfig_validStyles !== void 0 ? _staticConfig_validStyles : {}, _defaultProps_tag, tagName = (_defaultProps_tag = defaultProps.tag) !== null && _defaultProps_tag !== void 0 ? _defaultProps_tag : isTextView ? "span" : "div";
745
+ pseudoDescriptors[key9] ? (prev2[key9] = prev2[key9] || {}, Object.assign(prev2[key9], next[key9])) : mergeToEnd2(prev2, key9, next[key9]);
746
+ };
747
+ var evaluateAttribute = evaluateAttribute2, isStaticObject = isStaticObject2, createTernariesFromObjectProperties = createTernariesFromObjectProperties2, mergeToEnd = mergeToEnd2, normalizeStyleWithoutVariants = normalizeStyleWithoutVariants2, mergeStyles = mergeStyles2, { staticConfig } = component, defaultProps = {
748
+ ...staticConfig.defaultProps || {}
749
+ }, variants = staticConfig.variants || {}, isTextView = staticConfig.isText || !1, _staticConfig_validStyles, validStyles = (_staticConfig_validStyles = staticConfig?.validStyles) !== null && _staticConfig_validStyles !== void 0 ? _staticConfig_validStyles : {}, _defaultProps_tag, tagName = (_defaultProps_tag = defaultProps.tag) !== null && _defaultProps_tag !== void 0 ? _defaultProps_tag : isTextView ? "span" : "div";
1005
750
  traversePath.get("openingElement").get("attributes").forEach(function(path) {
1006
751
  var attr3 = path.node;
1007
752
  if (!t.isJSXSpreadAttribute(attr3) && attr3.name.name === "tag") {
1008
753
  var val2 = attr3.value;
1009
754
  t.isStringLiteral(val2) && (tagName = val2.value);
1010
755
  }
1011
- }), shouldPrintDebug === "verbose" && console.info(" Start tag ".concat(tagName));
1012
- var flatNode = getFlattenedNode == null ? void 0 : getFlattenedNode({
756
+ }), shouldPrintDebug === "verbose" && console.info(` Start tag ${tagName}`);
757
+ var flatNode = getFlattenedNode?.({
1013
758
  isTextView,
1014
759
  tag: tagName
1015
- }), inlineProps = new Set([
760
+ }), inlineProps = /* @__PURE__ */ new Set([
1016
761
  // adding some always inline props
1017
- "dataSet"
1018
- ].concat(_to_consumable_array(restProps.inlineProps || []), _to_consumable_array(staticConfig.inlineProps || []))), deoptProps = new Set([
762
+ "dataSet",
763
+ ...restProps.inlineProps || [],
764
+ ...staticConfig.inlineProps || []
765
+ ]), deoptProps = /* @__PURE__ */ new Set([
1019
766
  // always de-opt animation these
1020
767
  "animation",
1021
768
  "animateOnly",
1022
769
  "animatePresence",
1023
- "disableOptimization"
1024
- ].concat(
1025
- _to_consumable_array(isTargetingHTML ? [] : [
770
+ "disableOptimization",
771
+ ...isTargetingHTML ? [] : [
1026
772
  "pressStyle",
1027
773
  "focusStyle",
1028
774
  "focusVisibleStyle",
1029
775
  "disabledStyle"
1030
- ]),
776
+ ],
1031
777
  // when using a non-CSS driver, de-opt on enterStyle/exitStyle
1032
- _to_consumable_array(tamaguiConfig != null && tamaguiConfig.animations.isReactNative ? [
778
+ ...tamaguiConfig?.animations.isReactNative ? [
1033
779
  "enterStyle",
1034
780
  "exitStyle"
1035
- ] : [])
1036
- )), inlineWhenUnflattened = new Set(_to_consumable_array(staticConfig.inlineWhenUnflattened || [])), staticNamespace = getStaticBindingsForScope(traversePath.scope, importsWhitelist, sourcePath, bindingCache, shouldPrintDebug), attemptEval = evaluateVars ? createEvaluator({
781
+ ] : []
782
+ ]), inlineWhenUnflattened = /* @__PURE__ */ new Set([
783
+ ...staticConfig.inlineWhenUnflattened || []
784
+ ]), staticNamespace = getStaticBindingsForScope(traversePath.scope, importsWhitelist, sourcePath, bindingCache, shouldPrintDebug), attemptEval = evaluateVars ? createEvaluator({
1037
785
  props: propsWithFileInfo,
1038
786
  staticNamespace,
1039
787
  sourcePath,
1040
788
  traversePath,
1041
789
  shouldPrintDebug
1042
790
  }) : evaluateAstNode, attemptEvalSafe = createSafeEvaluator(attemptEval);
1043
- if (shouldPrintDebug && logger.info(" staticNamespace ".concat(Object.keys(staticNamespace).join(", "))), couldntParse)
791
+ if (shouldPrintDebug && logger.info(` staticNamespace ${Object.keys(staticNamespace).join(", ")}`), couldntParse)
1044
792
  return;
1045
793
  tm.mark("jsx-element-flattened", !!shouldPrintDebug);
1046
794
  var attrs = [], shouldDeopt = !1, inlined = /* @__PURE__ */ new Map(), variantValues = /* @__PURE__ */ new Map(), hasSetOptimized = !1, inlineWhenUnflattenedOGVals = {}, propMapperStyleState = {
@@ -1053,14 +801,15 @@ function createExtractor() {
1053
801
  conf: tamaguiConfig,
1054
802
  props: defaultProps,
1055
803
  componentState,
1056
- styleProps: _object_spread_props(_object_spread({}, styleProps), {
804
+ styleProps: {
805
+ ...styleProps,
1057
806
  resolveValues: "auto"
1058
- }),
807
+ },
1059
808
  debug: shouldPrintDebug
1060
809
  };
1061
810
  if (attrs = traversePath.get("openingElement").get("attributes").flatMap(function(path) {
1062
811
  try {
1063
- var res2 = evaluateAttribute(path);
812
+ var res2 = evaluateAttribute2(path);
1064
813
  return tm.mark("jsx-element-evaluate-attr", !!shouldPrintDebug), res2 || path.remove(), res2;
1065
814
  } catch (err) {
1066
815
  if (shouldPrintDebug && (logger.info([
@@ -1069,9 +818,9 @@ function createExtractor() {
1069
818
  shouldPrintDebug === "verbose" ? err.stack : ""
1070
819
  ].join(" ")), shouldPrintDebug === "verbose")) {
1071
820
  var _path_node;
1072
- logger.info("node ".concat((_path_node = path.node) === null || _path_node === void 0 ? void 0 : _path_node.type));
821
+ logger.info(`node ${(_path_node = path.node) === null || _path_node === void 0 ? void 0 : _path_node.type}`);
1073
822
  }
1074
- return inlined.set("".concat(Math.random()), "spread"), {
823
+ return inlined.set(`${Math.random()}`, "spread"), {
1075
824
  type: "attr",
1076
825
  value: path.node
1077
826
  };
@@ -1098,21 +847,11 @@ function createExtractor() {
1098
847
  return x.type === "JSXText";
1099
848
  })), themeVal = inlined.get("theme");
1100
849
  platform2 !== "native" && inlined.delete("theme");
1101
- var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
1102
- try {
1103
- for (var _iterator2 = _to_consumable_array(inlined)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
1104
- var _step_value = _sliced_to_array(_step2.value, 1), key = _step_value[0], _staticConfig_variants, isStaticObjectVariant = ((_staticConfig_variants = staticConfig.variants) === null || _staticConfig_variants === void 0 ? void 0 : _staticConfig_variants[key]) && variantValues.has(key);
1105
- (INLINE_EXTRACTABLE[key] || isStaticObjectVariant) && inlined.delete(key);
1106
- }
1107
- } catch (err) {
1108
- _didIteratorError2 = !0, _iteratorError2 = err;
1109
- } finally {
1110
- try {
1111
- !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
1112
- } finally {
1113
- if (_didIteratorError2)
1114
- throw _iteratorError2;
1115
- }
850
+ for (var _i = 0, _iter = [
851
+ ...inlined
852
+ ]; _i < _iter.length; _i++) {
853
+ var [key] = _iter[_i], _staticConfig_variants, isStaticObjectVariant = ((_staticConfig_variants = staticConfig.variants) === null || _staticConfig_variants === void 0 ? void 0 : _staticConfig_variants[key]) && variantValues.has(key);
854
+ (INLINE_EXTRACTABLE[key] || isStaticObjectVariant) && inlined.delete(key);
1116
855
  }
1117
856
  var canFlattenProps = inlined.size === 0, shouldFlatten = !!(flatNode && !shouldDeopt && canFlattenProps && !hasSpread && !staticConfig.isStyledHOC && !staticConfig.isHOC && !staticConfig.isReactNative && staticConfig.neverFlatten !== !0 && (staticConfig.neverFlatten !== "jsx" || hasOnlyStringChildren)), usedThemeKeys = /* @__PURE__ */ new Set();
1118
857
  if (themeAccessListeners.add(function(key9) {
@@ -1132,13 +871,13 @@ function createExtractor() {
1132
871
  }, [];
1133
872
  if (!isValidStyleKey(key9, staticConfig))
1134
873
  return [];
1135
- var name2 = (tamaguiConfig == null ? void 0 : tamaguiConfig.shorthands[key9]) || key9;
874
+ var name2 = tamaguiConfig?.shorthands[key9] || key9;
1136
875
  if (value2 === void 0) {
1137
- logger.warn("\u26A0\uFE0F Error evaluating default style for component, prop ".concat(key9, " ").concat(value2)), shouldDeopt = !0;
876
+ logger.warn(`\u26A0\uFE0F Error evaluating default style for component, prop ${key9} ${value2}`), shouldDeopt = !0;
1138
877
  return;
1139
878
  }
1140
879
  if (name2[0] === "$" && mediaQueryConfig[name2.slice(1)])
1141
- return defaultProps[key9] = void 0, evaluateAttribute({
880
+ return defaultProps[key9] = void 0, evaluateAttribute2({
1142
881
  node: t.jsxAttribute(t.jsxIdentifier(name2), t.jsxExpressionContainer(t.objectExpression(Object.keys(value2).filter(function(k) {
1143
882
  return typeof value2[k] < "u";
1144
883
  }).map(function(k) {
@@ -1148,33 +887,39 @@ function createExtractor() {
1148
887
  var attr3 = {
1149
888
  type: "style",
1150
889
  name: name2,
1151
- value: _define_property({}, name2, value2)
890
+ value: {
891
+ [name2]: value2
892
+ }
1152
893
  };
1153
894
  return attr3;
1154
895
  });
1155
- skipMap || defaultStyleAttrs.length && (attrs = _to_consumable_array(defaultStyleAttrs).concat(_to_consumable_array(attrs)));
896
+ skipMap || defaultStyleAttrs.length && (attrs = [
897
+ ...defaultStyleAttrs,
898
+ ...attrs
899
+ ]);
1156
900
  }
1157
901
  var ternaries = [];
1158
902
  attrs = attrs.reduce(function(out, cur2) {
1159
903
  var next = attrs[attrs.indexOf(cur2) + 1];
1160
904
  if (cur2.type === "ternary" && ternaries.push(cur2.value), (!next || next.type !== "ternary") && ternaries.length) {
1161
- var normalized = normalizeTernaries(ternaries).map(function(_param) {
1162
- var alternate = _param.alternate, consequent = _param.consequent, rest = _object_without_properties(_param, [
1163
- "alternate",
1164
- "consequent"
1165
- ]);
905
+ var normalized = normalizeTernaries(ternaries).map(function(param2) {
906
+ var { alternate, consequent, ...rest } = param2;
1166
907
  return {
1167
908
  type: "ternary",
1168
- value: _object_spread_props(_object_spread({}, rest), {
909
+ value: {
910
+ ...rest,
1169
911
  alternate: alternate || null,
1170
912
  consequent: consequent || null
1171
- })
913
+ }
1172
914
  };
1173
915
  });
1174
916
  try {
1175
- return _to_consumable_array(out).concat(_to_consumable_array(normalized));
917
+ return [
918
+ ...out,
919
+ ...normalized
920
+ ];
1176
921
  } finally {
1177
- shouldPrintDebug && logger.info(" normalizeTernaries (".concat(ternaries.length, " => ").concat(normalized.length, ")")), ternaries = [];
922
+ shouldPrintDebug && logger.info(` normalizeTernaries (${ternaries.length} => ${normalized.length})`), ternaries = [];
1178
923
  }
1179
924
  }
1180
925
  return cur2.type === "ternary" || out.push(cur2), out;
@@ -1191,7 +936,7 @@ function createExtractor() {
1191
936
  t.jsxAttribute(t.jsxIdentifier("name"), themeVal.value)
1192
937
  ]), t.jsxClosingElement(t.jsxIdentifier("_TamaguiTheme")), [
1193
938
  traversePath.node
1194
- ]))) : console.warn("No program path found, avoiding importing flattening / importing theme in ".concat(sourcePath))), shouldPrintDebug)
939
+ ]))) : console.warn(`No program path found, avoiding importing flattening / importing theme in ${sourcePath}`)), shouldPrintDebug)
1195
940
  try {
1196
941
  logger.info([
1197
942
  " flatten?",
@@ -1205,12 +950,14 @@ function createExtractor() {
1205
950
  }),
1206
951
  "inlined",
1207
952
  inlined.size,
1208
- _to_consumable_array(inlined)
953
+ [
954
+ ...inlined
955
+ ]
1209
956
  ].join(" "));
1210
957
  } catch {
1211
958
  }
1212
959
  if (shouldDeopt || !shouldFlatten) {
1213
- shouldPrintDebug && logger.info("Deopting ".concat(shouldDeopt, " ").concat(shouldFlatten)), node.attributes = ogAttributes;
960
+ shouldPrintDebug && logger.info(`Deopting ${shouldDeopt} ${shouldFlatten}`), node.attributes = ogAttributes;
1214
961
  return;
1215
962
  }
1216
963
  shouldPrintDebug && logger.info([
@@ -1222,16 +969,16 @@ function createExtractor() {
1222
969
  for (var key1 in attrs) {
1223
970
  var cur = attrs[key1];
1224
971
  if (cur.type === "style") {
1225
- var expanded = normalizeStyleWithoutVariants(cur.value);
972
+ var expanded = normalizeStyleWithoutVariants2(cur.value);
1226
973
  for (var key2 in expanded)
1227
- mergeToEnd(foundStaticProps, key2, expanded[key2]);
974
+ mergeToEnd2(foundStaticProps, key2, expanded[key2]);
1228
975
  continue;
1229
976
  }
1230
977
  if (cur.type === "attr") {
1231
978
  if (t.isJSXSpreadAttribute(cur.value) || !t.isJSXIdentifier(cur.value.name))
1232
979
  continue;
1233
980
  var key3 = cur.value.name.name, value = attemptEvalSafe(cur.value.value || t.booleanLiteral(!0));
1234
- value !== FAILED_EVAL && mergeToEnd(foundStaticProps, key3, value);
981
+ value !== FAILED_EVAL && mergeToEnd2(foundStaticProps, key3, value);
1235
982
  }
1236
983
  }
1237
984
  var completeProps = {};
@@ -1247,9 +994,10 @@ function createExtractor() {
1247
994
  if (name2 === "tag")
1248
995
  return acc;
1249
996
  if (variants[name2] && variantValues.has(name2)) {
1250
- var styleState = _object_spread_props(_object_spread({}, propMapperStyleState), {
997
+ var styleState = {
998
+ ...propMapperStyleState,
1251
999
  props: completeProps
1252
- }), out = Object.fromEntries(propMapper(name2, variantValues.get(name2), styleState) || []);
1000
+ }, out = Object.fromEntries(propMapper(name2, variantValues.get(name2), styleState) || []);
1253
1001
  if (out && isTargetingHTML) {
1254
1002
  var cn = out.className;
1255
1003
  out = reactNativeWebInternals.createDOMProps(isTextView ? "span" : "div", out), out.className = cn;
@@ -1263,7 +1011,9 @@ function createExtractor() {
1263
1011
  var value2 = out[key9];
1264
1012
  isValidStyleKey(key9, staticConfig) ? acc.push({
1265
1013
  type: "style",
1266
- value: _define_property({}, key9, value2),
1014
+ value: {
1015
+ [key9]: value2
1016
+ },
1267
1017
  name: key9,
1268
1018
  attr: cur2.value
1269
1019
  }) : acc.push({
@@ -1276,9 +1026,11 @@ function createExtractor() {
1276
1026
  }
1277
1027
  if (cur2.type !== "style")
1278
1028
  return acc.push(cur2), acc;
1279
- var key12 = Object.keys(cur2.value)[0], value12 = cur2.value[key12], fullKey = tamaguiConfig == null ? void 0 : tamaguiConfig.shorthands[key12];
1280
- return fullKey && (cur2.value = _define_property({}, fullKey, value12), key12 = fullKey), disableExtractVariables && value12[0] === "$" && (usedThemeKeys.has(key12) || usedThemeKeys.has(fullKey)) ? (shouldPrintDebug && logger.info([
1281
- " keeping variable inline: ".concat(key12, " ="),
1029
+ var key12 = Object.keys(cur2.value)[0], value12 = cur2.value[key12], fullKey = tamaguiConfig?.shorthands[key12];
1030
+ return fullKey && (cur2.value = {
1031
+ [fullKey]: value12
1032
+ }, key12 = fullKey), disableExtractVariables && value12[0] === "$" && (usedThemeKeys.has(key12) || usedThemeKeys.has(fullKey)) ? (shouldPrintDebug && logger.info([
1033
+ ` keeping variable inline: ${key12} =`,
1282
1034
  value12
1283
1035
  ].join(" ")), acc.push({
1284
1036
  type: "attr",
@@ -1295,23 +1047,28 @@ function createExtractor() {
1295
1047
  return shouldPrintDebug && logger.info([
1296
1048
  " getProps() no props"
1297
1049
  ].join(" ")), {};
1298
- if (excludeProps != null && excludeProps.size)
1050
+ if (excludeProps?.size)
1299
1051
  for (var key9 in props)
1300
1052
  excludeProps.has(key9) && (shouldPrintDebug && logger.info([
1301
1053
  " delete excluded",
1302
1054
  key9
1303
1055
  ].join(" ")), delete props[key9]);
1304
1056
  try {
1305
- var out = getSplitStyles(props, staticConfig, defaultTheme, "", componentState, _object_spread_props(_object_spread({}, styleProps), {
1057
+ var out = getSplitStyles(props, staticConfig, defaultTheme, "", componentState, {
1058
+ ...styleProps,
1306
1059
  noClassNames: !0,
1307
1060
  fallbackProps: completeProps
1308
- }), void 0, void 0, void 0, debugPropValue || shouldPrintDebug, options.experimentalFlattenThemesOnNative), outProps2 = _object_spread({}, includeProps ? out.viewProps : {}, out.style, out.pseudos);
1061
+ }, void 0, void 0, void 0, debugPropValue || shouldPrintDebug, options.experimentalFlattenThemesOnNative), outProps2 = {
1062
+ ...includeProps ? out.viewProps : {},
1063
+ ...out.style,
1064
+ ...out.pseudos
1065
+ };
1309
1066
  for (var key12 in outProps2)
1310
1067
  deoptProps.has(key12) && (shouldFlatten = !1);
1311
- return shouldPrintDebug && (logger.info("(".concat(debugName, ")")), logger.info(`
1312
- getProps (props in): `.concat(logLines(objToStr(props)))), logger.info(`
1313
- getProps (outProps): `.concat(logLines(objToStr(outProps2))))), out.fontFamily && (setPropsToFontFamily(outProps2, out.fontFamily), shouldPrintDebug && logger.info(`
1314
- \u{1F4AC} new font fam: `.concat(out.fontFamily))), outProps2;
1068
+ return shouldPrintDebug && (logger.info(`(${debugName})`), logger.info(`
1069
+ getProps (props in): ${logLines(objToStr(props))}`), logger.info(`
1070
+ getProps (outProps): ${logLines(objToStr(outProps2))}`)), out.fontFamily && (setPropsToFontFamily(outProps2, out.fontFamily), shouldPrintDebug && logger.info(`
1071
+ \u{1F4AC} new font fam: ${out.fontFamily}`)), outProps2;
1315
1072
  } catch (err) {
1316
1073
  return logger.info([
1317
1074
  "error",
@@ -1338,8 +1095,8 @@ function createExtractor() {
1338
1095
  type: "attr",
1339
1096
  value: t.jsxAttribute(t.jsxIdentifier(key9), t.jsxExpressionContainer(typeof value2 == "string" ? t.stringLiteral(value2) : literalToAst(value2)))
1340
1097
  }), acc.push(cur2), acc;
1341
- if ((prev == null ? void 0 : prev.type) === "style")
1342
- return mergeStyles(prev.value, cur2.value), acc;
1098
+ if (prev?.type === "style")
1099
+ return mergeStyles2(prev.value, cur2.value), acc;
1343
1100
  }
1344
1101
  return cur2.type === "style" && (prev = cur2), acc.push(cur2), acc;
1345
1102
  }, []), shouldPrintDebug && logger.info([
@@ -1347,12 +1104,12 @@ function createExtractor() {
1347
1104
  `,
1348
1105
  logLines(attrs.map(attrStr).join(", "))
1349
1106
  ].join(" "));
1350
- var getStyleError = null, _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
1107
+ var getStyleError = null, _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
1351
1108
  try {
1352
- for (var _iterator12 = attrs[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
1353
- var attr = _step12.value;
1109
+ for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
1110
+ var attr = _step2.value;
1354
1111
  try {
1355
- switch (shouldPrintDebug && console.info(" Processing ".concat(attr.type, ":")), attr.type) {
1112
+ switch (shouldPrintDebug && console.info(` Processing ${attr.type}:`), attr.type) {
1356
1113
  case "ternary": {
1357
1114
  var a = getProps(attr.value.alternate, !1, "ternary.alternate"), c = getProps(attr.value.consequent, !1, "ternary.consequent");
1358
1115
  a && (attr.value.alternate = a), c && (attr.value.consequent = c), shouldPrintDebug && logger.info([
@@ -1379,7 +1136,9 @@ function createExtractor() {
1379
1136
  continue;
1380
1137
  var value1 = attemptEvalSafe(attr.value.value || t.booleanLiteral(!0));
1381
1138
  if (value1 !== FAILED_EVAL) {
1382
- var outProps = getProps(_define_property({}, key6, value1), !0, "attr.".concat(key6)), outKey = Object.keys(outProps)[0];
1139
+ var outProps = getProps({
1140
+ [key6]: value1
1141
+ }, !0, `attr.${key6}`), outKey = Object.keys(outProps)[0];
1383
1142
  if (outKey) {
1384
1143
  var outVal = outProps[outKey];
1385
1144
  attr.value = t.jsxAttribute(t.jsxIdentifier(outKey), t.jsxExpressionContainer(typeof outVal == "string" ? t.stringLiteral(outVal) : literalToAst(outVal)));
@@ -1392,13 +1151,13 @@ function createExtractor() {
1392
1151
  }
1393
1152
  }
1394
1153
  } catch (err) {
1395
- _didIteratorError12 = !0, _iteratorError12 = err;
1154
+ _didIteratorError2 = !0, _iteratorError2 = err;
1396
1155
  } finally {
1397
1156
  try {
1398
- !_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
1157
+ !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
1399
1158
  } finally {
1400
- if (_didIteratorError12)
1401
- throw _iteratorError12;
1159
+ if (_didIteratorError2)
1160
+ throw _iteratorError2;
1402
1161
  }
1403
1162
  }
1404
1163
  if (shouldPrintDebug && logger.info([
@@ -1419,15 +1178,15 @@ function createExtractor() {
1419
1178
  if (attr1.type === "style")
1420
1179
  for (var key7 in attr1.value)
1421
1180
  existingStyleKeys.has(key7) ? (shouldPrintDebug && logger.info([
1422
- " >> delete existing ".concat(key7)
1181
+ ` >> delete existing ${key7}`
1423
1182
  ].join(" ")), delete attr1.value[key7]) : existingStyleKeys.add(key7);
1424
1183
  attr1.type === "dynamic-style" && (existingStyleKeys.has(attr1.name) ? attrs[i] = void 0 : existingStyleKeys.add(attr1.name));
1425
1184
  }
1426
1185
  if (options.experimentalFlattenThemesOnNative && (attrs = attrs.filter(Boolean)), !shouldFlatten && inlineWhenUnflattened.size) {
1427
- var _iteratorNormalCompletion22 = !0, _didIteratorError22 = !1, _iteratorError22 = void 0;
1186
+ var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
1428
1187
  try {
1429
- for (var _iterator22 = attrs.entries()[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = !0) {
1430
- var _step_value1 = _sliced_to_array(_step22.value, 2), index = _step_value1[0], attr2 = _step_value1[1];
1188
+ for (var _iterator12 = attrs.entries()[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
1189
+ var [index, attr2] = _step12.value;
1431
1190
  if (attr2.type === "style") {
1432
1191
  for (var key8 in attr2.value)
1433
1192
  if (inlineWhenUnflattened.has(key8)) {
@@ -1437,13 +1196,13 @@ function createExtractor() {
1437
1196
  }
1438
1197
  }
1439
1198
  } catch (err) {
1440
- _didIteratorError22 = !0, _iteratorError22 = err;
1199
+ _didIteratorError12 = !0, _iteratorError12 = err;
1441
1200
  } finally {
1442
1201
  try {
1443
- !_iteratorNormalCompletion22 && _iterator22.return != null && _iterator22.return();
1202
+ !_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
1444
1203
  } finally {
1445
- if (_didIteratorError22)
1446
- throw _iteratorError22;
1204
+ if (_didIteratorError12)
1205
+ throw _iteratorError12;
1447
1206
  }
1448
1207
  }
1449
1208
  }
@@ -1456,7 +1215,7 @@ function createExtractor() {
1456
1215
  ].join(" ")), node.name.name = flatNode, res.flattened++, closingElement && (closingElement.name.name = flatNode));
1457
1216
  var isNativeNotFlat = !shouldFlatten && platform2 === "native";
1458
1217
  if (isNativeNotFlat)
1459
- return shouldPrintDebug && logger.info("Disabled flattening except for simple cases on native for now: ".concat(JSON.stringify({
1218
+ return shouldPrintDebug && logger.info(`Disabled flattening except for simple cases on native for now: ${JSON.stringify({
1460
1219
  flatNode,
1461
1220
  shouldDeopt,
1462
1221
  canFlattenProps,
@@ -1465,14 +1224,14 @@ function createExtractor() {
1465
1224
  "!staticConfig.isHOC": !staticConfig.isHOC,
1466
1225
  "staticConfig.isReactNative": staticConfig.isReactNative,
1467
1226
  "staticConfig.neverFlatten": staticConfig.neverFlatten
1468
- }, null, 2))), node.attributes = ogAttributes, null;
1227
+ }, null, 2)}`), node.attributes = ogAttributes, null;
1469
1228
  shouldPrintDebug && (logger.info([
1470
- " - inlined props (".concat(inlined.size, "):"),
1229
+ ` - inlined props (${inlined.size}):`,
1471
1230
  shouldDeopt ? " deopted" : "",
1472
1231
  hasSpread ? " has spread" : "",
1473
1232
  staticConfig.neverFlatten ? "neverFlatten" : ""
1474
- ].join(" ")), logger.info(" - shouldFlatten/isFlattened: ".concat(shouldFlatten)), logger.info(` - attrs (end):
1475
- `.concat(logLines(attrs.map(attrStr).join(", "))))), onExtractTag({
1233
+ ].join(" ")), logger.info(` - shouldFlatten/isFlattened: ${shouldFlatten}`), logger.info(` - attrs (end):
1234
+ ${logLines(attrs.map(attrStr).join(", "))}`)), onExtractTag({
1476
1235
  parserProps: propsWithFileInfo,
1477
1236
  attrs,
1478
1237
  node,
@@ -1488,14 +1247,14 @@ function createExtractor() {
1488
1247
  staticConfig
1489
1248
  });
1490
1249
  } catch (err) {
1491
- node.attributes = ogAttributes, console.error("@tamagui/static error, reverting optimization. In ".concat(filePath, " ").concat(lineNumbers, " on ").concat(originalNodeName, ": ").concat(err.message, ". For stack trace set environment TAMAGUI_DEBUG=1")), process.env.TAMAGUI_DEBUG === "1" && console.error(err.stack);
1250
+ node.attributes = ogAttributes, console.error(`@tamagui/static error, reverting optimization. In ${filePath} ${lineNumbers} on ${originalNodeName}: ${err.message}. For stack trace set environment TAMAGUI_DEBUG=1`), process.env.TAMAGUI_DEBUG === "1" && console.error(err.stack);
1492
1251
  } finally {
1493
1252
  debugPropValue && (shouldPrintDebug = ogDebug);
1494
1253
  }
1495
1254
  }
1496
1255
  }), tm.mark("jsx-done", !!shouldPrintDebug), modifiedComponents.size) {
1497
1256
  var all = Array.from(modifiedComponents);
1498
- shouldPrintDebug && logger.info(" [\u{1FA9D}] hook check ".concat(all.length));
1257
+ shouldPrintDebug && logger.info(` [\u{1FA9D}] hook check ${all.length}`);
1499
1258
  var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
1500
1259
  try {
1501
1260
  for (var _iterator1 = all[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {