@tamagui/static 1.89.26 → 1.89.27-1708113113238

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/dist/cjs/constants.native.js +4 -4
  2. package/dist/cjs/constants.native.js.map +3 -3
  3. package/dist/cjs/extractor/accessSafe.native.js +1 -5
  4. package/dist/cjs/extractor/accessSafe.native.js.map +3 -3
  5. package/dist/cjs/extractor/babelParse.native.js +5 -8
  6. package/dist/cjs/extractor/babelParse.native.js.map +3 -3
  7. package/dist/cjs/extractor/buildClassName.native.js +31 -42
  8. package/dist/cjs/extractor/buildClassName.native.js.map +3 -3
  9. package/dist/cjs/extractor/bundle.js +6 -4
  10. package/dist/cjs/extractor/bundle.js.map +1 -1
  11. package/dist/cjs/extractor/bundle.native.js +321 -56
  12. package/dist/cjs/extractor/bundle.native.js.map +3 -3
  13. package/dist/cjs/extractor/bundleConfig.native.js +499 -187
  14. package/dist/cjs/extractor/bundleConfig.native.js.map +3 -3
  15. package/dist/cjs/extractor/createEvaluator.native.js +9 -11
  16. package/dist/cjs/extractor/createEvaluator.native.js.map +3 -3
  17. package/dist/cjs/extractor/createExtractor.native.js +1240 -906
  18. package/dist/cjs/extractor/createExtractor.native.js.map +3 -3
  19. package/dist/cjs/extractor/ensureImportingConcat.native.js +11 -17
  20. package/dist/cjs/extractor/ensureImportingConcat.native.js.map +3 -3
  21. package/dist/cjs/extractor/esbuildAliasPlugin.native.js +22 -11
  22. package/dist/cjs/extractor/esbuildAliasPlugin.native.js.map +3 -3
  23. package/dist/cjs/extractor/evaluateAstNode.native.js +15 -21
  24. package/dist/cjs/extractor/evaluateAstNode.native.js.map +3 -3
  25. package/dist/cjs/extractor/extractHelpers.native.js +146 -38
  26. package/dist/cjs/extractor/extractHelpers.native.js.map +3 -3
  27. package/dist/cjs/extractor/extractMediaStyle.native.js +127 -54
  28. package/dist/cjs/extractor/extractMediaStyle.native.js.map +3 -3
  29. package/dist/cjs/extractor/extractToClassNames.native.js +449 -252
  30. package/dist/cjs/extractor/extractToClassNames.native.js.map +3 -3
  31. package/dist/cjs/extractor/findTopmostFunction.native.js +4 -4
  32. package/dist/cjs/extractor/findTopmostFunction.native.js.map +3 -3
  33. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +415 -54
  34. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
  35. package/dist/cjs/extractor/generatedUid.native.js +2 -2
  36. package/dist/cjs/extractor/generatedUid.native.js.map +3 -3
  37. package/dist/cjs/extractor/getPrefixLogs.native.js +2 -1
  38. package/dist/cjs/extractor/getPrefixLogs.native.js.map +3 -3
  39. package/dist/cjs/extractor/getPropValueFromAttributes.native.js +16 -19
  40. package/dist/cjs/extractor/getPropValueFromAttributes.native.js.map +3 -3
  41. package/dist/cjs/extractor/getSourceModule.native.js +20 -7
  42. package/dist/cjs/extractor/getSourceModule.native.js.map +3 -3
  43. package/dist/cjs/extractor/getStaticBindingsForScope.native.js +336 -94
  44. package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +3 -3
  45. package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
  46. package/dist/cjs/extractor/hoistClassNames.native.js +8 -10
  47. package/dist/cjs/extractor/hoistClassNames.native.js.map +3 -3
  48. package/dist/cjs/extractor/literalToAst.native.js +89 -19
  49. package/dist/cjs/extractor/literalToAst.native.js.map +3 -3
  50. package/dist/cjs/extractor/loadFile.native.js +16 -8
  51. package/dist/cjs/extractor/loadFile.native.js.map +3 -3
  52. package/dist/cjs/extractor/loadTamagui.js +3 -3
  53. package/dist/cjs/extractor/loadTamagui.js.map +1 -1
  54. package/dist/cjs/extractor/loadTamagui.native.js +667 -192
  55. package/dist/cjs/extractor/loadTamagui.native.js.map +3 -3
  56. package/dist/cjs/extractor/logLines.native.js +24 -6
  57. package/dist/cjs/extractor/logLines.native.js.map +3 -3
  58. package/dist/cjs/extractor/normalizeTernaries.native.js +71 -20
  59. package/dist/cjs/extractor/normalizeTernaries.native.js.map +3 -3
  60. package/dist/cjs/extractor/propsToFontFamilyCache.native.js +3 -3
  61. package/dist/cjs/extractor/propsToFontFamilyCache.native.js.map +3 -3
  62. package/dist/cjs/extractor/removeUnusedHooks.native.js +69 -36
  63. package/dist/cjs/extractor/removeUnusedHooks.native.js.map +3 -3
  64. package/dist/cjs/extractor/timer.native.js +10 -9
  65. package/dist/cjs/extractor/timer.native.js.map +3 -3
  66. package/dist/cjs/extractor/validHTMLAttributes.native.js +1 -1
  67. package/dist/cjs/extractor/validHTMLAttributes.native.js.map +3 -3
  68. package/dist/cjs/getPragmaOptions.native.js +4 -9
  69. package/dist/cjs/getPragmaOptions.native.js.map +3 -3
  70. package/dist/cjs/helpers/memoize.native.js +5 -3
  71. package/dist/cjs/helpers/memoize.native.js.map +3 -3
  72. package/dist/cjs/helpers/requireTamaguiCore.native.js +2 -1
  73. package/dist/cjs/helpers/requireTamaguiCore.native.js.map +3 -3
  74. package/dist/cjs/index.native.js.map +2 -2
  75. package/dist/cjs/minifyCSS.native.js.map +3 -3
  76. package/dist/cjs/registerRequire.native.js +56 -28
  77. package/dist/cjs/registerRequire.native.js.map +3 -3
  78. package/dist/cjs/server.native.js +175 -21
  79. package/dist/cjs/server.native.js.map +3 -3
  80. package/dist/cjs/setup.native.js.map +3 -3
  81. package/dist/cjs/static.native.js.map +2 -2
  82. package/dist/cjs/types.native.js.map +2 -2
  83. package/dist/cjs/webpackPlugin.native.js +26 -5
  84. package/dist/cjs/webpackPlugin.native.js.map +3 -3
  85. package/dist/esm/constants.native.js +4 -3
  86. package/dist/esm/constants.native.js.map +3 -3
  87. package/dist/esm/extractor/accessSafe.native.js +1 -5
  88. package/dist/esm/extractor/accessSafe.native.js.map +3 -3
  89. package/dist/esm/extractor/babelParse.native.js +5 -7
  90. package/dist/esm/extractor/babelParse.native.js.map +3 -3
  91. package/dist/esm/extractor/buildClassName.native.js +31 -41
  92. package/dist/esm/extractor/buildClassName.native.js.map +3 -3
  93. package/dist/esm/extractor/bundle.js +6 -4
  94. package/dist/esm/extractor/bundle.js.map +1 -1
  95. package/dist/esm/extractor/bundle.mjs +7 -5
  96. package/dist/esm/extractor/bundle.native.js +321 -56
  97. package/dist/esm/extractor/bundle.native.js.map +3 -3
  98. package/dist/esm/extractor/bundleConfig.native.js +499 -187
  99. package/dist/esm/extractor/bundleConfig.native.js.map +3 -3
  100. package/dist/esm/extractor/createEvaluator.native.js +9 -11
  101. package/dist/esm/extractor/createEvaluator.native.js.map +3 -3
  102. package/dist/esm/extractor/createExtractor.native.js +1241 -916
  103. package/dist/esm/extractor/createExtractor.native.js.map +3 -3
  104. package/dist/esm/extractor/ensureImportingConcat.native.js +11 -16
  105. package/dist/esm/extractor/ensureImportingConcat.native.js.map +3 -3
  106. package/dist/esm/extractor/esbuildAliasPlugin.native.js +22 -11
  107. package/dist/esm/extractor/esbuildAliasPlugin.native.js.map +3 -3
  108. package/dist/esm/extractor/evaluateAstNode.native.js +15 -21
  109. package/dist/esm/extractor/evaluateAstNode.native.js.map +3 -3
  110. package/dist/esm/extractor/extractHelpers.native.js +146 -38
  111. package/dist/esm/extractor/extractHelpers.native.js.map +3 -3
  112. package/dist/esm/extractor/extractMediaStyle.native.js +127 -54
  113. package/dist/esm/extractor/extractMediaStyle.native.js.map +3 -3
  114. package/dist/esm/extractor/extractToClassNames.native.js +449 -252
  115. package/dist/esm/extractor/extractToClassNames.native.js.map +3 -3
  116. package/dist/esm/extractor/findTopmostFunction.native.js +4 -4
  117. package/dist/esm/extractor/findTopmostFunction.native.js.map +3 -3
  118. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +415 -54
  119. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
  120. package/dist/esm/extractor/generatedUid.native.js +2 -2
  121. package/dist/esm/extractor/generatedUid.native.js.map +3 -3
  122. package/dist/esm/extractor/getPrefixLogs.native.js +2 -1
  123. package/dist/esm/extractor/getPrefixLogs.native.js.map +3 -3
  124. package/dist/esm/extractor/getPropValueFromAttributes.native.js +16 -19
  125. package/dist/esm/extractor/getPropValueFromAttributes.native.js.map +3 -3
  126. package/dist/esm/extractor/getSourceModule.native.js +20 -7
  127. package/dist/esm/extractor/getSourceModule.native.js.map +3 -3
  128. package/dist/esm/extractor/getStaticBindingsForScope.native.js +336 -94
  129. package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +3 -3
  130. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
  131. package/dist/esm/extractor/hoistClassNames.native.js +8 -10
  132. package/dist/esm/extractor/hoistClassNames.native.js.map +3 -3
  133. package/dist/esm/extractor/literalToAst.native.js +89 -19
  134. package/dist/esm/extractor/literalToAst.native.js.map +3 -3
  135. package/dist/esm/extractor/loadFile.native.js +16 -8
  136. package/dist/esm/extractor/loadFile.native.js.map +3 -3
  137. package/dist/esm/extractor/loadTamagui.js +1 -2
  138. package/dist/esm/extractor/loadTamagui.js.map +1 -1
  139. package/dist/esm/extractor/loadTamagui.mjs +5 -3
  140. package/dist/esm/extractor/loadTamagui.native.js +668 -203
  141. package/dist/esm/extractor/loadTamagui.native.js.map +3 -3
  142. package/dist/esm/extractor/logLines.native.js +24 -6
  143. package/dist/esm/extractor/logLines.native.js.map +3 -3
  144. package/dist/esm/extractor/normalizeTernaries.native.js +71 -20
  145. package/dist/esm/extractor/normalizeTernaries.native.js.map +3 -3
  146. package/dist/esm/extractor/propsToFontFamilyCache.native.js +3 -3
  147. package/dist/esm/extractor/propsToFontFamilyCache.native.js.map +3 -3
  148. package/dist/esm/extractor/removeUnusedHooks.native.js +69 -35
  149. package/dist/esm/extractor/removeUnusedHooks.native.js.map +3 -3
  150. package/dist/esm/extractor/timer.native.js +10 -9
  151. package/dist/esm/extractor/timer.native.js.map +3 -3
  152. package/dist/esm/extractor/validHTMLAttributes.native.js +1 -1
  153. package/dist/esm/extractor/validHTMLAttributes.native.js.map +3 -3
  154. package/dist/esm/getPragmaOptions.native.js +4 -9
  155. package/dist/esm/getPragmaOptions.native.js.map +3 -3
  156. package/dist/esm/helpers/memoize.native.js +5 -3
  157. package/dist/esm/helpers/memoize.native.js.map +3 -3
  158. package/dist/esm/helpers/requireTamaguiCore.native.js +2 -1
  159. package/dist/esm/helpers/requireTamaguiCore.native.js.map +3 -3
  160. package/dist/esm/index.native.js.map +1 -1
  161. package/dist/esm/minifyCSS.native.js.map +3 -3
  162. package/dist/esm/registerRequire.native.js +56 -28
  163. package/dist/esm/registerRequire.native.js.map +3 -3
  164. package/dist/esm/server.native.js +175 -21
  165. package/dist/esm/server.native.js.map +3 -3
  166. package/dist/esm/setup.native.js.map +3 -3
  167. package/dist/esm/static.native.js.map +3 -3
  168. package/dist/esm/webpackPlugin.native.js +26 -5
  169. package/dist/esm/webpackPlugin.native.js.map +3 -3
  170. package/package.json +14 -15
  171. package/src/extractor/bundle.ts +5 -2
  172. package/src/extractor/loadTamagui.ts +3 -2
  173. package/types/extractor/bundle.d.ts.map +1 -1
  174. package/types/extractor/loadTamagui.d.ts.map +1 -1
  175. package/tamagui.tsconfig.json +0 -5
@@ -10,7 +10,240 @@ import { registerRequire, setRequireResult } from "../registerRequire";
10
10
  import { babelParse } from "./babelParse";
11
11
  import { bundle, esbuildLoaderConfig } from "./bundle";
12
12
  import { getTamaguiConfigPathFromOptionsConfig } from "./getTamaguiConfigPathFromOptionsConfig";
13
- const external = [
13
+ function _array_like_to_array(arr, len) {
14
+ (len == null || len > arr.length) && (len = arr.length);
15
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
16
+ arr2[i] = arr[i];
17
+ return arr2;
18
+ }
19
+ function _array_with_holes(arr) {
20
+ if (Array.isArray(arr))
21
+ return arr;
22
+ }
23
+ function _array_without_holes(arr) {
24
+ if (Array.isArray(arr))
25
+ return _array_like_to_array(arr);
26
+ }
27
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
28
+ try {
29
+ var info = gen[key](arg), value = info.value;
30
+ } catch (error) {
31
+ reject(error);
32
+ return;
33
+ }
34
+ info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
35
+ }
36
+ function _async_to_generator(fn) {
37
+ return function() {
38
+ var self = this, args = arguments;
39
+ return new Promise(function(resolve, reject) {
40
+ var gen = fn.apply(self, args);
41
+ function _next(value) {
42
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
43
+ }
44
+ function _throw(err) {
45
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
46
+ }
47
+ _next(void 0);
48
+ });
49
+ };
50
+ }
51
+ function _define_property(obj, key, value) {
52
+ return key in obj ? Object.defineProperty(obj, key, {
53
+ value,
54
+ enumerable: !0,
55
+ configurable: !0,
56
+ writable: !0
57
+ }) : obj[key] = value, obj;
58
+ }
59
+ function _iterable_to_array(iter) {
60
+ if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
61
+ return Array.from(iter);
62
+ }
63
+ function _iterable_to_array_limit(arr, i) {
64
+ var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
65
+ if (_i != null) {
66
+ var _arr = [], _n = !0, _d = !1, _s, _e;
67
+ try {
68
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
69
+ ;
70
+ } catch (err) {
71
+ _d = !0, _e = err;
72
+ } finally {
73
+ try {
74
+ !_n && _i.return != null && _i.return();
75
+ } finally {
76
+ if (_d)
77
+ throw _e;
78
+ }
79
+ }
80
+ return _arr;
81
+ }
82
+ }
83
+ function _non_iterable_rest() {
84
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85
+ }
86
+ function _non_iterable_spread() {
87
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
88
+ }
89
+ function _object_spread(target) {
90
+ for (var i = 1; i < arguments.length; i++) {
91
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
92
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
93
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
94
+ }))), ownKeys2.forEach(function(key) {
95
+ _define_property(target, key, source[key]);
96
+ });
97
+ }
98
+ return target;
99
+ }
100
+ function ownKeys(object, enumerableOnly) {
101
+ var keys = Object.keys(object);
102
+ if (Object.getOwnPropertySymbols) {
103
+ var symbols = Object.getOwnPropertySymbols(object);
104
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
105
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
106
+ })), keys.push.apply(keys, symbols);
107
+ }
108
+ return keys;
109
+ }
110
+ function _object_spread_props(target, source) {
111
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
112
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
113
+ }), target;
114
+ }
115
+ function _object_without_properties(source, excluded) {
116
+ if (source == null)
117
+ return {};
118
+ var target = _object_without_properties_loose(source, excluded), key, i;
119
+ if (Object.getOwnPropertySymbols) {
120
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
121
+ for (i = 0; i < sourceSymbolKeys.length; i++)
122
+ key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
123
+ }
124
+ return target;
125
+ }
126
+ function _object_without_properties_loose(source, excluded) {
127
+ if (source == null)
128
+ return {};
129
+ var target = {}, sourceKeys = Object.keys(source), key, i;
130
+ for (i = 0; i < sourceKeys.length; i++)
131
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
132
+ return target;
133
+ }
134
+ function _sliced_to_array(arr, i) {
135
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
136
+ }
137
+ function _to_consumable_array(arr) {
138
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
139
+ }
140
+ function _type_of(obj) {
141
+ "@swc/helpers - typeof";
142
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
143
+ }
144
+ function _unsupported_iterable_to_array(o, minLen) {
145
+ if (o) {
146
+ if (typeof o == "string")
147
+ return _array_like_to_array(o, minLen);
148
+ var n = Object.prototype.toString.call(o).slice(8, -1);
149
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
150
+ return Array.from(n);
151
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
152
+ return _array_like_to_array(o, minLen);
153
+ }
154
+ }
155
+ function _ts_generator(thisArg, body) {
156
+ var f, y, t2, g, _ = {
157
+ label: 0,
158
+ sent: function() {
159
+ if (t2[0] & 1)
160
+ throw t2[1];
161
+ return t2[1];
162
+ },
163
+ trys: [],
164
+ ops: []
165
+ };
166
+ return g = {
167
+ next: verb(0),
168
+ throw: verb(1),
169
+ return: verb(2)
170
+ }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
171
+ return this;
172
+ }), g;
173
+ function verb(n) {
174
+ return function(v) {
175
+ return step([
176
+ n,
177
+ v
178
+ ]);
179
+ };
180
+ }
181
+ function step(op) {
182
+ if (f)
183
+ throw new TypeError("Generator is already executing.");
184
+ for (; _; )
185
+ try {
186
+ 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)
187
+ return t2;
188
+ switch (y = 0, t2 && (op = [
189
+ op[0] & 2,
190
+ t2.value
191
+ ]), op[0]) {
192
+ case 0:
193
+ case 1:
194
+ t2 = op;
195
+ break;
196
+ case 4:
197
+ return _.label++, {
198
+ value: op[1],
199
+ done: !1
200
+ };
201
+ case 5:
202
+ _.label++, y = op[1], op = [
203
+ 0
204
+ ];
205
+ continue;
206
+ case 7:
207
+ op = _.ops.pop(), _.trys.pop();
208
+ continue;
209
+ default:
210
+ if (t2 = _.trys, !(t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
211
+ _ = 0;
212
+ continue;
213
+ }
214
+ if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
215
+ _.label = op[1];
216
+ break;
217
+ }
218
+ if (op[0] === 6 && _.label < t2[1]) {
219
+ _.label = t2[1], t2 = op;
220
+ break;
221
+ }
222
+ if (t2 && _.label < t2[2]) {
223
+ _.label = t2[2], _.ops.push(op);
224
+ break;
225
+ }
226
+ t2[2] && _.ops.pop(), _.trys.pop();
227
+ continue;
228
+ }
229
+ op = body.call(thisArg, _);
230
+ } catch (e) {
231
+ op = [
232
+ 6,
233
+ e
234
+ ], y = 0;
235
+ } finally {
236
+ f = t2 = 0;
237
+ }
238
+ if (op[0] & 5)
239
+ throw op[1];
240
+ return {
241
+ value: op[0] ? op[1] : void 0,
242
+ done: !0
243
+ };
244
+ }
245
+ }
246
+ var external = [
14
247
  "@tamagui/core",
15
248
  "@tamagui/web",
16
249
  "react",
@@ -18,155 +251,228 @@ const external = [
18
251
  "react-native-svg"
19
252
  ], esbuildExtraOptions = {
20
253
  define: {
21
- __DEV__: `${process.env.NODE_ENV === "development"}`
254
+ __DEV__: "".concat(process.env.NODE_ENV === "development")
22
255
  }
23
- }, esbuildOptions = {
256
+ }, esbuildOptions = _object_spread({
24
257
  target: "es2018",
25
258
  format: "cjs",
26
259
  jsx: "automatic",
27
- platform: "node",
28
- ...esbuildExtraOptions
29
- };
30
- let currentBundle = null, isBundling = !1, lastBundle = null;
31
- const waitForBundle = /* @__PURE__ */ new Set();
260
+ platform: "node"
261
+ }, esbuildExtraOptions), currentBundle = null, isBundling = !1, lastBundle = null, waitForBundle = /* @__PURE__ */ new Set();
32
262
  function hasBundledConfigChanged() {
33
263
  return lastBundle === currentBundle ? !1 : (lastBundle = currentBundle, !0);
34
264
  }
35
- async function getBundledConfig(props, rebuild = !1) {
36
- if (isBundling)
37
- await new Promise((res) => {
38
- waitForBundle.add(res);
265
+ function getBundledConfig(props) {
266
+ return _getBundledConfig.apply(this, arguments);
267
+ }
268
+ function _getBundledConfig() {
269
+ return _getBundledConfig = _async_to_generator(function(props) {
270
+ var rebuild, _arguments = arguments;
271
+ return _ts_generator(this, function(_state) {
272
+ switch (_state.label) {
273
+ case 0:
274
+ return rebuild = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : !1, isBundling ? [
275
+ 4,
276
+ new Promise(function(res) {
277
+ waitForBundle.add(res);
278
+ })
279
+ ] : [
280
+ 3,
281
+ 2
282
+ ];
283
+ case 1:
284
+ return _state.sent(), [
285
+ 3,
286
+ 4
287
+ ];
288
+ case 2:
289
+ return !currentBundle || rebuild ? [
290
+ 4,
291
+ bundleConfig(props)
292
+ ] : [
293
+ 3,
294
+ 4
295
+ ];
296
+ case 3:
297
+ return [
298
+ 2,
299
+ _state.sent()
300
+ ];
301
+ case 4:
302
+ return [
303
+ 2,
304
+ currentBundle
305
+ ];
306
+ }
39
307
  });
40
- else if (!currentBundle || rebuild)
41
- return await bundleConfig(props);
42
- return currentBundle;
308
+ }), _getBundledConfig.apply(this, arguments);
43
309
  }
44
- async function bundleConfig(props) {
45
- var _a, _b, _c, _d;
46
- try {
47
- isBundling = !0;
48
- const configEntry = props.config ? getTamaguiConfigPathFromOptionsConfig(props.config) : "", tmpDir = join(process.cwd(), ".tamagui"), configOutPath = join(tmpDir, "tamagui.config.cjs"), baseComponents = props.components.filter((x) => x !== "@tamagui/core"), componentOutPaths = baseComponents.map(
49
- (componentModule) => join(
50
- tmpDir,
51
- `${componentModule.split(sep).join("-").replace(/[^a-z0-9]+/gi, "")}-components.config.cjs`
52
- )
53
- );
54
- if (process.env.NODE_ENV === "development" && ((_a = process.env.DEBUG) != null && _a.startsWith("tamagui")) && console.info("Building config entry", configEntry), !props.disableInitialBuild) {
55
- try {
56
- await ensureDir(tmpDir);
57
- } catch {
310
+ function bundleConfig(props) {
311
+ return _bundleConfig.apply(this, arguments);
312
+ }
313
+ function _bundleConfig() {
314
+ return _bundleConfig = _async_to_generator(function(props) {
315
+ var _process_env_DEBUG, _process_env_DEBUG1, configEntry, tmpDir, configOutPath, baseComponents, componentOutPaths, e, start, out, unregister, config, components, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, component, _process_env_DEBUG2, res, err, _process_env_DEBUG3;
316
+ return _ts_generator(this, function(_state) {
317
+ switch (_state.label) {
318
+ case 0:
319
+ if (_state.trys.push([
320
+ 0,
321
+ 7,
322
+ 8,
323
+ 9
324
+ ]), isBundling = !0, configEntry = props.config ? getTamaguiConfigPathFromOptionsConfig(props.config) : "", tmpDir = join(process.cwd(), ".tamagui"), configOutPath = join(tmpDir, "tamagui.config.cjs"), baseComponents = props.components.filter(function(x) {
325
+ return x !== "@tamagui/core";
326
+ }), componentOutPaths = baseComponents.map(function(componentModule) {
327
+ return join(tmpDir, "".concat(componentModule.split(sep).join("-").replace(/[^a-z0-9]+/gi, ""), "-components.config.cjs"));
328
+ }), process.env.NODE_ENV === "development" && (!((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui")) && console.info("Building config entry", configEntry), props.disableInitialBuild)
329
+ return [
330
+ 3,
331
+ 6
332
+ ];
333
+ _state.label = 1;
334
+ case 1:
335
+ return _state.trys.push([
336
+ 1,
337
+ 3,
338
+ ,
339
+ 4
340
+ ]), [
341
+ 4,
342
+ ensureDir(tmpDir)
343
+ ];
344
+ case 2:
345
+ return _state.sent(), [
346
+ 3,
347
+ 4
348
+ ];
349
+ case 3:
350
+ return e = _state.sent(), [
351
+ 3,
352
+ 4
353
+ ];
354
+ case 4:
355
+ return start = Date.now(), [
356
+ 4,
357
+ Promise.all([
358
+ props.config ? bundle(_object_spread({
359
+ entryPoints: [
360
+ configEntry
361
+ ],
362
+ external,
363
+ outfile: configOutPath,
364
+ target: "node16"
365
+ }, esbuildExtraOptions), props.platform) : null
366
+ ].concat(_to_consumable_array(baseComponents.map(function(componentModule, i) {
367
+ return bundle(_object_spread({
368
+ entryPoints: [
369
+ componentModule
370
+ ],
371
+ resolvePlatformSpecificEntries: !0,
372
+ external,
373
+ outfile: componentOutPaths[i],
374
+ target: "node16"
375
+ }, esbuildExtraOptions), props.platform);
376
+ }))))
377
+ ];
378
+ case 5:
379
+ _state.sent(), colorLog(Color.FgYellow, `
380
+ \u27A1 [tamagui] built config and components (`.concat(Date.now() - start, "ms):")), colorLog(Color.Dim, `
381
+ Config .`.concat(sep).concat(relative(process.cwd(), configOutPath), `
382
+ Components `).concat(_to_consumable_array(componentOutPaths.map(function(p) {
383
+ return ".".concat(sep).concat(relative(process.cwd(), p));
384
+ })).join(`
385
+ `), `
386
+ `)), _state.label = 6;
387
+ case 6:
388
+ unregister = registerRequire(props.platform).unregister;
389
+ try {
390
+ out = require(configOutPath);
391
+ } catch (err2) {
392
+ throw err2;
393
+ } finally {
394
+ unregister();
395
+ }
396
+ if (config = out.default || out || out.config, config && config.config && !config.tokens && (config = config.config), !config)
397
+ throw new Error("No config: ".concat(config));
398
+ if (components = loadComponents(_object_spread_props(_object_spread({}, props), {
399
+ components: componentOutPaths
400
+ })), !components)
401
+ throw new Error("No components found: ".concat(componentOutPaths.join(", ")));
402
+ _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
403
+ try {
404
+ for (_iterator = components[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
405
+ component = _step.value, component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName, component.moduleName || (!((_process_env_DEBUG2 = process.env.DEBUG) === null || _process_env_DEBUG2 === void 0) && _process_env_DEBUG2.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("\u26A0\uFE0F no module name found: ".concat(component.moduleName, " ").concat(JSON.stringify(baseComponents), " in ").concat(JSON.stringify(componentOutPaths)));
406
+ } catch (err2) {
407
+ _didIteratorError = !0, _iteratorError = err2;
408
+ } finally {
409
+ try {
410
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
411
+ } finally {
412
+ if (_didIteratorError)
413
+ throw _iteratorError;
414
+ }
415
+ }
416
+ return process.env.NODE_ENV === "development" && (!((_process_env_DEBUG1 = process.env.DEBUG) === null || _process_env_DEBUG1 === void 0) && _process_env_DEBUG1.startsWith("tamagui")) && console.info("Loaded components", components), res = {
417
+ components,
418
+ nameToPaths: {},
419
+ tamaguiConfig: config
420
+ }, currentBundle = res, [
421
+ 2,
422
+ res
423
+ ];
424
+ case 7:
425
+ return err = _state.sent(), console.error("Error bundling tamagui config: ".concat(err == null ? void 0 : err.message, " (run with DEBUG=tamagui to see stack)")), !((_process_env_DEBUG3 = process.env.DEBUG) === null || _process_env_DEBUG3 === void 0) && _process_env_DEBUG3.includes("tamagui") && console.error(err.stack), [
426
+ 3,
427
+ 9
428
+ ];
429
+ case 8:
430
+ return isBundling = !1, waitForBundle.forEach(function(cb) {
431
+ return cb();
432
+ }), waitForBundle.clear(), [
433
+ 7
434
+ ];
435
+ case 9:
436
+ return [
437
+ 2
438
+ ];
58
439
  }
59
- const start = Date.now();
60
- await Promise.all([
61
- props.config ? bundle(
62
- {
63
- entryPoints: [configEntry],
64
- external,
65
- outfile: configOutPath,
66
- target: "node16",
67
- ...esbuildExtraOptions
68
- },
69
- props.platform
70
- ) : null,
71
- ...baseComponents.map((componentModule, i) => bundle(
72
- {
73
- entryPoints: [componentModule],
74
- resolvePlatformSpecificEntries: !0,
75
- external,
76
- outfile: componentOutPaths[i],
77
- target: "node16",
78
- ...esbuildExtraOptions
79
- },
80
- props.platform
81
- ))
82
- ]), colorLog(
83
- Color.FgYellow,
84
- `
85
- \u27A1 [tamagui] built config and components (${Date.now() - start}ms):`
86
- ), colorLog(
87
- Color.Dim,
88
- `
89
- Config .${sep}${relative(process.cwd(), configOutPath)}
90
- Components ${[
91
- ...componentOutPaths.map((p) => `.${sep}${relative(process.cwd(), p)}`)
92
- ].join(`
93
- `)}
94
- `
95
- );
96
- }
97
- let out;
98
- const { unregister } = registerRequire(props.platform);
99
- try {
100
- out = require(configOutPath);
101
- } catch (err) {
102
- throw err;
103
- } finally {
104
- unregister();
105
- }
106
- let config = out.default || out || out.config;
107
- if (config && config.config && !config.tokens && (config = config.config), !config)
108
- throw new Error(`No config: ${config}`);
109
- let components = loadComponents({
110
- ...props,
111
- components: componentOutPaths
112
440
  });
113
- if (!components)
114
- throw new Error(`No components found: ${componentOutPaths.join(", ")}`);
115
- for (const component of components)
116
- component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName, component.moduleName || ((_b = process.env.DEBUG) != null && _b.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn(
117
- `\u26A0\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(
118
- baseComponents
119
- )} in ${JSON.stringify(componentOutPaths)}`
120
- );
121
- process.env.NODE_ENV === "development" && ((_c = process.env.DEBUG) != null && _c.startsWith("tamagui")) && console.info("Loaded components", components);
122
- const res = {
123
- components,
124
- nameToPaths: {},
125
- tamaguiConfig: config
126
- };
127
- return currentBundle = res, res;
128
- } catch (err) {
129
- console.error(
130
- `Error bundling tamagui config: ${err == null ? void 0 : err.message} (run with DEBUG=tamagui to see stack)`
131
- ), (_d = process.env.DEBUG) != null && _d.includes("tamagui") && console.error(err.stack);
132
- } finally {
133
- isBundling = !1, waitForBundle.forEach((cb) => cb()), waitForBundle.clear();
134
- }
441
+ }), _bundleConfig.apply(this, arguments);
135
442
  }
136
- function loadComponents(props, forceExports = !1) {
137
- const coreComponents = getCoreComponents(props), otherComponents = loadComponentsInner(props, forceExports);
138
- return [...coreComponents, ...otherComponents || []];
443
+ function loadComponents(props) {
444
+ var forceExports = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, coreComponents = getCoreComponents(props), otherComponents = loadComponentsInner(props, forceExports);
445
+ return _to_consumable_array(coreComponents).concat(_to_consumable_array(otherComponents || []));
139
446
  }
140
447
  function getCoreComponents(props) {
141
- const loaded = loadComponentsInner({
142
- ...props,
143
- components: ["@tamagui/core"]
144
- });
448
+ var loaded = loadComponentsInner(_object_spread_props(_object_spread({}, props), {
449
+ components: [
450
+ "@tamagui/core"
451
+ ]
452
+ }));
145
453
  if (!loaded)
146
454
  throw new Error("Core should always load");
147
455
  return [
148
- {
149
- ...loaded[0],
456
+ _object_spread_props(_object_spread({}, loaded[0]), {
150
457
  moduleName: "@tamagui/core"
151
- }
458
+ })
152
459
  ];
153
460
  }
154
- function loadComponentsInner(props, forceExports = !1) {
155
- const componentsModules = props.components, key = componentsModules.join("");
461
+ function loadComponentsInner(props) {
462
+ var forceExports = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, componentsModules = props.components, key = componentsModules.join("");
156
463
  if (!forceExports && cacheComponents[key])
157
464
  return cacheComponents[key];
158
- const { unregister } = registerRequire(props.platform, {
465
+ var unregister = registerRequire(props.platform, {
159
466
  proxyWormImports: forceExports
160
- });
467
+ }).unregister;
161
468
  try {
162
- const info = componentsModules.flatMap((name) => {
163
- var _a;
164
- const isDynamic = !!extname(name) && forceExports, fileContents = isDynamic ? readFileSync(name, "utf-8") : "", loadModule = isDynamic ? join(dirname(name), `.tamagui-dynamic-eval-${basename(name)}.tsx`) : name;
165
- let writtenContents = fileContents, didBabel = !1;
166
- function attemptLoad({ forceExports: forceExports2 = !1 } = {}) {
167
- isDynamic && (writtenContents = forceExports2 ? transformAddExports(babelParse(esbuildit(fileContents, "modern"), name)) : fileContents, writeFileSync(loadModule, writtenContents), esbuild.buildSync({
168
- ...esbuildOptions,
169
- entryPoints: [loadModule],
469
+ var info = componentsModules.flatMap(function(name) {
470
+ var attemptLoad = function() {
471
+ var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_forceExports = _ref.forceExports, forceExports2 = _ref_forceExports === void 0 ? !1 : _ref_forceExports;
472
+ isDynamic && (writtenContents = forceExports2 ? transformAddExports(babelParse(esbuildit(fileContents, "modern"), name)) : fileContents, writeFileSync(loadModule, writtenContents), esbuild.buildSync(_object_spread_props(_object_spread({}, esbuildOptions), {
473
+ entryPoints: [
474
+ loadModule
475
+ ],
170
476
  outfile: loadModule,
171
477
  alias: {
172
478
  "react-native": require.resolve("react-native-web-lite")
@@ -177,28 +483,25 @@ function loadComponentsInner(props, forceExports = !1) {
177
483
  // logLevel: 'silent',
178
484
  sourcemap: !1,
179
485
  loader: esbuildLoaderConfig
180
- })), process.env.DEBUG === "tamagui" && console.info("loadModule", loadModule, require.resolve(loadModule));
181
- const moduleResult = require(loadModule);
486
+ }))), process.env.DEBUG === "tamagui" && console.info("loadModule", loadModule, require.resolve(loadModule));
487
+ var moduleResult = require(loadModule);
182
488
  forceExports2 || setRequireResult(name, moduleResult);
183
- const nameToInfo = getComponentStaticConfigByName(
184
- name,
185
- interopDefaultExport(moduleResult)
186
- );
489
+ var nameToInfo = getComponentStaticConfigByName(name, interopDefaultExport(moduleResult));
187
490
  return {
188
491
  moduleName: name,
189
492
  nameToInfo
190
493
  };
191
- }
192
- const dispose = () => {
494
+ }, extension = extname(name), isLocal = !!extension, isDynamic = isLocal && forceExports, fileContents = isDynamic ? readFileSync(name, "utf-8") : "", loadModule = isDynamic ? join(dirname(name), ".tamagui-dynamic-eval-".concat(basename(name), ".tsx")) : name, writtenContents = fileContents, didBabel = !1, dispose = function() {
193
495
  isDynamic && removeSync(loadModule);
194
496
  };
195
497
  try {
196
- const res = attemptLoad({
498
+ var res = attemptLoad({
197
499
  forceExports: !0
198
500
  });
199
501
  return didBabel = !0, res;
200
502
  } catch (err) {
201
- console.info("babel err", err, writtenContents), writtenContents = fileContents, (_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.info("Error parsing babel likely", err);
503
+ var _process_env_DEBUG;
504
+ console.info("babel err", err, writtenContents), writtenContents = fileContents, !((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui") && console.info("Error parsing babel likely", err);
202
505
  } finally {
203
506
  dispose();
204
507
  }
@@ -210,18 +513,11 @@ function loadComponentsInner(props, forceExports = !1) {
210
513
  return process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.info(`
211
514
 
212
515
  Tamagui attempted but failed to dynamically optimize components in:
213
- ${name}
214
- `), console.info(err), console.info(
215
- `At: ${loadModule}`,
216
- `
217
- didBabel: ${didBabel}`,
218
- `
219
- In:`,
220
- writtenContents,
221
- `
222
- isDynamic: `,
223
- isDynamic
224
- )), [];
516
+ `.concat(name, `
517
+ `)), console.info(err), console.info("At: ".concat(loadModule), `
518
+ didBabel: `.concat(didBabel), `
519
+ In:`, writtenContents, `
520
+ isDynamic: `, isDynamic)), [];
225
521
  } finally {
226
522
  dispose();
227
523
  }
@@ -233,68 +529,84 @@ isDynamic: `,
233
529
  unregister();
234
530
  }
235
531
  }
236
- const esbuildit = (src, target) => esbuild.transformSync(src, {
237
- ...esbuildOptions,
238
- ...target === "modern" && {
532
+ var esbuildit = function(src, target) {
533
+ return esbuild.transformSync(src, _object_spread({}, esbuildOptions, target === "modern" && {
239
534
  target: "es2022",
240
535
  jsx: "automatic",
241
536
  loader: "tsx",
242
537
  platform: "neutral",
243
538
  format: "esm"
244
- }
245
- }).code;
539
+ })).code;
540
+ };
246
541
  function getComponentStaticConfigByName(name, exported) {
247
- const components = {};
542
+ var components = {};
248
543
  try {
249
544
  if (!exported || typeof exported != "object" || Array.isArray(exported))
250
- throw new Error(`Invalid export from package ${name}: ${typeof exported}`);
251
- for (const key in exported) {
252
- const found = getTamaguiComponent(key, exported[key]);
545
+ throw new Error("Invalid export from package ".concat(name, ": ").concat(typeof exported > "u" ? "undefined" : _type_of(exported)));
546
+ for (var _ref in exported) {
547
+ var key = _ref, found = getTamaguiComponent(key, exported[key]);
253
548
  if (found) {
254
- const { Component, ...sc } = found.staticConfig;
255
- components[key] = { staticConfig: sc };
549
+ var _found_staticConfig = found.staticConfig, Component = _found_staticConfig.Component, sc = _object_without_properties(_found_staticConfig, [
550
+ "Component"
551
+ ]);
552
+ components[key] = {
553
+ staticConfig: sc
554
+ };
256
555
  }
257
556
  }
258
557
  } catch (err) {
259
- process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.error(
260
- `Tamagui failed getting components from ${name} (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)`
261
- ), console.error(err));
558
+ process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.error("Tamagui failed getting components from ".concat(name, " (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)")), console.error(err));
262
559
  }
263
560
  return components;
264
561
  }
265
562
  function getTamaguiComponent(name, Component) {
266
- if (name[0].toUpperCase() !== name[0])
267
- return;
268
- if (Component == null ? void 0 : Component.staticConfig)
269
- return Component;
563
+ if (name[0].toUpperCase() === name[0]) {
564
+ var staticConfig = Component == null ? void 0 : Component.staticConfig;
565
+ if (staticConfig)
566
+ return Component;
567
+ }
270
568
  }
271
569
  function interopDefaultExport(mod) {
272
- return (mod == null ? void 0 : mod.default) ?? mod;
570
+ var _mod_default;
571
+ return (_mod_default = mod == null ? void 0 : mod.default) !== null && _mod_default !== void 0 ? _mod_default : mod;
273
572
  }
274
- const cacheComponents = {};
573
+ var cacheComponents = {};
275
574
  function transformAddExports(ast) {
276
- const usedNames = /* @__PURE__ */ new Set();
575
+ var usedNames = /* @__PURE__ */ new Set();
277
576
  return traverse(ast, {
278
- ExportNamedDeclaration(nodePath) {
279
- if (nodePath.node.specifiers)
280
- for (const spec of nodePath.node.specifiers)
281
- usedNames.add(
282
- t.isIdentifier(spec.exported) ? spec.exported.name : spec.exported.value
283
- );
577
+ ExportNamedDeclaration: function(nodePath) {
578
+ if (nodePath.node.specifiers) {
579
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
580
+ try {
581
+ for (var _iterator = nodePath.node.specifiers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
582
+ var spec = _step.value;
583
+ usedNames.add(t.isIdentifier(spec.exported) ? spec.exported.name : spec.exported.value);
584
+ }
585
+ } catch (err) {
586
+ _didIteratorError = !0, _iteratorError = err;
587
+ } finally {
588
+ try {
589
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
590
+ } finally {
591
+ if (_didIteratorError)
592
+ throw _iteratorError;
593
+ }
594
+ }
595
+ }
284
596
  }
285
597
  }), traverse(ast, {
286
- VariableDeclaration(nodePath) {
287
- if (!t.isProgram(nodePath.parent))
288
- return;
289
- const decs = nodePath.node.declarations;
290
- if (decs.length > 1)
291
- return;
292
- const [dec] = decs;
293
- t.isIdentifier(dec.id) && dec.init && (usedNames.has(dec.id.name) || (usedNames.add(dec.id.name), nodePath.replaceWith(
294
- t.exportNamedDeclaration(t.variableDeclaration("let", [dec]), [
295
- t.exportSpecifier(t.identifier(dec.id.name), t.identifier(dec.id.name))
296
- ])
297
- )));
598
+ VariableDeclaration: function(nodePath) {
599
+ if (t.isProgram(nodePath.parent)) {
600
+ var decs = nodePath.node.declarations;
601
+ if (!(decs.length > 1)) {
602
+ var _decs = _sliced_to_array(decs, 1), dec = _decs[0];
603
+ t.isIdentifier(dec.id) && dec.init && (usedNames.has(dec.id.name) || (usedNames.add(dec.id.name), nodePath.replaceWith(t.exportNamedDeclaration(t.variableDeclaration("let", [
604
+ dec
605
+ ]), [
606
+ t.exportSpecifier(t.identifier(dec.id.name), t.identifier(dec.id.name))
607
+ ]))));
608
+ }
609
+ }
298
610
  }
299
611
  }), generate(ast, {
300
612
  concise: !1,