@tamagui/babel-plugin 1.89.26 → 1.89.27-1708112217600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.native.js +199 -188
- package/dist/cjs/index.native.js.map +3 -3
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/index.native.js +200 -194
- package/dist/esm/index.native.js.map +3 -3
- package/package.json +3 -3
package/dist/cjs/index.native.js
CHANGED
|
@@ -27,41 +27,107 @@ __export(src_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(src_exports);
|
|
29
29
|
var import_path = require("path"), import_generator = __toESM(require("@babel/generator")), import_helper_plugin_utils = require("@babel/helper-plugin-utils"), import_template = __toESM(require("@babel/template")), t = __toESM(require("@babel/types")), import_static = require("@tamagui/static");
|
|
30
|
-
|
|
30
|
+
function _array_like_to_array(arr, len) {
|
|
31
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
32
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
33
|
+
arr2[i] = arr[i];
|
|
34
|
+
return arr2;
|
|
35
|
+
}
|
|
36
|
+
function _array_without_holes(arr) {
|
|
37
|
+
if (Array.isArray(arr))
|
|
38
|
+
return _array_like_to_array(arr);
|
|
39
|
+
}
|
|
40
|
+
function _define_property(obj, key, value) {
|
|
41
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
42
|
+
value,
|
|
43
|
+
enumerable: !0,
|
|
44
|
+
configurable: !0,
|
|
45
|
+
writable: !0
|
|
46
|
+
}) : obj[key] = value, obj;
|
|
47
|
+
}
|
|
48
|
+
function _instanceof(left, right) {
|
|
49
|
+
return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
|
|
50
|
+
}
|
|
51
|
+
function _iterable_to_array(iter) {
|
|
52
|
+
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
53
|
+
return Array.from(iter);
|
|
54
|
+
}
|
|
55
|
+
function _non_iterable_spread() {
|
|
56
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
57
|
+
}
|
|
58
|
+
function _object_spread(target) {
|
|
59
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
60
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
61
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
62
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
63
|
+
}))), ownKeys2.forEach(function(key) {
|
|
64
|
+
_define_property(target, key, source[key]);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
function ownKeys(object, enumerableOnly) {
|
|
70
|
+
var keys = Object.keys(object);
|
|
71
|
+
if (Object.getOwnPropertySymbols) {
|
|
72
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
73
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
74
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
75
|
+
})), keys.push.apply(keys, symbols);
|
|
76
|
+
}
|
|
77
|
+
return keys;
|
|
78
|
+
}
|
|
79
|
+
function _object_spread_props(target, source) {
|
|
80
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
81
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
82
|
+
}), target;
|
|
83
|
+
}
|
|
84
|
+
function _to_consumable_array(arr) {
|
|
85
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
86
|
+
}
|
|
87
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
88
|
+
if (o) {
|
|
89
|
+
if (typeof o == "string")
|
|
90
|
+
return _array_like_to_array(o, minLen);
|
|
91
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
92
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
93
|
+
return Array.from(n);
|
|
94
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
95
|
+
return _array_like_to_array(o, minLen);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
var importNativeView = (0, import_template.default)(`
|
|
31
99
|
const __ReactNativeView = require('react-native').View;
|
|
32
100
|
const __ReactNativeText = require('react-native').Text;
|
|
33
101
|
`), importStyleSheet = (0, import_template.default)(`
|
|
34
102
|
const __ReactNativeStyleSheet = require('react-native').StyleSheet;
|
|
35
103
|
`), importWithStyle = (0, import_template.default)(`
|
|
36
104
|
const __withStableStyle = require('@tamagui/core')._withStableStyle;
|
|
37
|
-
`), extractor = (0, import_static.createExtractor)({
|
|
38
|
-
|
|
105
|
+
`), extractor = (0, import_static.createExtractor)({
|
|
106
|
+
platform: "native"
|
|
107
|
+
}), src_default = (0, import_helper_plugin_utils.declare)(function(api, options) {
|
|
39
108
|
return api.assertVersion(7), {
|
|
40
109
|
name: "tamagui",
|
|
41
110
|
visitor: {
|
|
42
111
|
Program: {
|
|
43
|
-
enter(root) {
|
|
44
|
-
var
|
|
45
|
-
let sourcePath = this.file.opts.filename;
|
|
112
|
+
enter: function(root) {
|
|
113
|
+
var _process_env_SOURCE_ROOT, _root_node_body__leadingComments, _root_node_body_, sourcePath = this.file.opts.filename;
|
|
46
114
|
if (sourcePath != null && sourcePath.includes("node_modules") || !(sourcePath != null && sourcePath.endsWith(".jsx")) && !(sourcePath != null && sourcePath.endsWith(".tsx")))
|
|
47
115
|
return;
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
((_c = (_b = root.node.body[0]) == null ? void 0 : _b.leadingComments) == null ? void 0 : _c.map((comment) => (comment == null ? void 0 : comment.value) || " ").join(" ")) ?? ""
|
|
53
|
-
), { shouldPrintDebug, shouldDisable } = (0, import_static.getPragmaOptions)({
|
|
116
|
+
!((_process_env_SOURCE_ROOT = process.env.SOURCE_ROOT) === null || _process_env_SOURCE_ROOT === void 0) && _process_env_SOURCE_ROOT.endsWith("ios") && (sourcePath = sourcePath.replace("/ios", ""));
|
|
117
|
+
var hasImportedView = !1, hasImportedViewWrapper = !1, sheetStyles = {}, sheetIdentifier = root.scope.generateUidIdentifier("sheet"), _root_node_body__leadingComments_map_join, firstComment = (_root_node_body__leadingComments_map_join = (_root_node_body_ = root.node.body[0]) === null || _root_node_body_ === void 0 || (_root_node_body__leadingComments = _root_node_body_.leadingComments) === null || _root_node_body__leadingComments === void 0 ? void 0 : _root_node_body__leadingComments.map(function(comment) {
|
|
118
|
+
return (comment == null ? void 0 : comment.value) || " ";
|
|
119
|
+
}).join(" ")) !== null && _root_node_body__leadingComments_map_join !== void 0 ? _root_node_body__leadingComments_map_join : "", _getPragmaOptions = (0, import_static.getPragmaOptions)({
|
|
54
120
|
disableCommentCheck: !0,
|
|
55
121
|
source: firstComment,
|
|
56
122
|
path: sourcePath
|
|
57
|
-
});
|
|
123
|
+
}), shouldPrintDebug = _getPragmaOptions.shouldPrintDebug, shouldDisable = _getPragmaOptions.shouldDisable;
|
|
58
124
|
if (shouldDisable)
|
|
59
125
|
return;
|
|
60
126
|
function addSheetStyle(style, node) {
|
|
61
|
-
|
|
127
|
+
var styleIndex = "".concat(Object.keys(sheetStyles).length), key = "".concat(styleIndex);
|
|
62
128
|
if (process.env.NODE_ENV === "development") {
|
|
63
|
-
|
|
64
|
-
key +=
|
|
129
|
+
var lineNumbers = node.loc ? node.loc.start.line + (node.loc.start.line !== node.loc.end.line ? "-".concat(node.loc.end.line) : "") : "";
|
|
130
|
+
key += ":".concat((0, import_path.basename)(sourcePath), ":").concat(lineNumbers);
|
|
65
131
|
}
|
|
66
132
|
return sheetStyles[key] = style, readStyleExpr(key);
|
|
67
133
|
}
|
|
@@ -72,11 +138,14 @@ var src_default = (0, import_helper_plugin_utils.declare)(function(api, options)
|
|
|
72
138
|
}).expression;
|
|
73
139
|
}
|
|
74
140
|
try {
|
|
75
|
-
extractor.parseSync(root, {
|
|
141
|
+
extractor.parseSync(root, _object_spread_props(_object_spread({
|
|
76
142
|
// @ts-expect-error in case they leave it out
|
|
77
143
|
platform: "native",
|
|
78
144
|
shouldPrintDebug,
|
|
79
|
-
importsWhitelist: [
|
|
145
|
+
importsWhitelist: [
|
|
146
|
+
"constants.js",
|
|
147
|
+
"colors.js"
|
|
148
|
+
],
|
|
80
149
|
extractStyledDefinitions: options.forceExtractStyleDefinitions,
|
|
81
150
|
excludeProps: /* @__PURE__ */ new Set([
|
|
82
151
|
"className",
|
|
@@ -85,8 +154,8 @@ var src_default = (0, import_helper_plugin_utils.declare)(function(api, options)
|
|
|
85
154
|
"textOverflow",
|
|
86
155
|
"cursor",
|
|
87
156
|
"contain"
|
|
88
|
-
])
|
|
89
|
-
|
|
157
|
+
])
|
|
158
|
+
}, options), {
|
|
90
159
|
// disable this extraction for now at least, need to figure out merging theme vs non-theme
|
|
91
160
|
// because theme need to stay in render(), whereas non-theme can be extracted
|
|
92
161
|
// for now just turn it off entirely at a small perf loss
|
|
@@ -99,179 +168,117 @@ var src_default = (0, import_helper_plugin_utils.declare)(function(api, options)
|
|
|
99
168
|
// thinking it's not really worth the effort to do much compilation on native
|
|
100
169
|
// for now just disable flatten as it can only run in narrow places on native
|
|
101
170
|
// disableFlattening: 'styled',
|
|
102
|
-
getFlattenedNode(
|
|
171
|
+
getFlattenedNode: function(param) {
|
|
172
|
+
var isTextView = param.isTextView;
|
|
103
173
|
return hasImportedView || (hasImportedView = !0, root.unshiftContainer("body", importNativeView())), isTextView ? "__ReactNativeText" : "__ReactNativeView";
|
|
104
174
|
},
|
|
105
|
-
onExtractTag(props) {
|
|
106
|
-
|
|
175
|
+
onExtractTag: function(props) {
|
|
176
|
+
var isFlattened = props.isFlattened;
|
|
107
177
|
if (!isFlattened)
|
|
108
178
|
return;
|
|
109
179
|
assertValidTag(props.node);
|
|
110
|
-
|
|
180
|
+
var stylesExpr = t.arrayExpression([]), hocStylesExpr = t.arrayExpression([]), expressions = [], finalAttrs = [], themeKeysUsed = /* @__PURE__ */ new Set();
|
|
111
181
|
function getStyleExpression(style) {
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
182
|
+
if (style) {
|
|
183
|
+
var _splitThemeStyles = splitThemeStyles(style), plain = _splitThemeStyles.plain, themed = _splitThemeStyles.themed, themeExpr = null;
|
|
184
|
+
if (themed && options.experimentalFlattenThemesOnNative) {
|
|
185
|
+
for (var key in themed)
|
|
186
|
+
themeKeysUsed.add(themed[key].split("$")[1]);
|
|
187
|
+
themeExpr = getThemedStyleExpression(themed);
|
|
188
|
+
}
|
|
189
|
+
var ident = addSheetStyle(plain, props.node);
|
|
190
|
+
return themeExpr ? (addStyleExpression(ident), addStyleExpression(ident, !0), themeExpr) : ident;
|
|
120
191
|
}
|
|
121
|
-
const ident = addSheetStyle(plain, props.node);
|
|
122
|
-
return themeExpr ? (addStyleExpression(ident), addStyleExpression(ident, !0), themeExpr) : ident;
|
|
123
192
|
}
|
|
124
|
-
function addStyleExpression(expr
|
|
125
|
-
|
|
193
|
+
function addStyleExpression(expr) {
|
|
194
|
+
var HOC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
195
|
+
if (Array.isArray(expr)) {
|
|
196
|
+
var _elements;
|
|
197
|
+
(_elements = (HOC ? hocStylesExpr : stylesExpr).elements).push.apply(_elements, _to_consumable_array(expr));
|
|
198
|
+
} else
|
|
199
|
+
(HOC ? hocStylesExpr : stylesExpr).elements.push(expr);
|
|
126
200
|
}
|
|
127
201
|
function getThemedStyleExpression(styles) {
|
|
128
|
-
|
|
129
|
-
return themedStylesAst.properties.forEach((_)
|
|
130
|
-
|
|
131
|
-
prop.value.type === "StringLiteral" && (prop.value = t.memberExpression(
|
|
132
|
-
t.identifier("theme"),
|
|
133
|
-
t.identifier(prop.value.value.slice(1))
|
|
134
|
-
));
|
|
202
|
+
var themedStylesAst = (0, import_static.literalToAst)(styles);
|
|
203
|
+
return themedStylesAst.properties.forEach(function(_) {
|
|
204
|
+
var prop = _;
|
|
205
|
+
prop.value.type === "StringLiteral" && (prop.value = t.memberExpression(t.identifier("theme"), t.identifier(prop.value.value.slice(1))));
|
|
135
206
|
}), themedStylesAst;
|
|
136
207
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
case "dynamic-style": {
|
|
168
|
-
hasDynamicStyle = !0, expressions.push(attr.value), options.experimentalFlattenDynamicValues ? addStyleExpression(
|
|
169
|
-
t.objectExpression([
|
|
170
|
-
t.objectProperty(
|
|
171
|
-
t.identifier(attr.name),
|
|
172
|
-
t.identifier(`_expressions[${expressions.length - 1}]`)
|
|
173
|
-
)
|
|
174
|
-
]),
|
|
175
|
-
!0
|
|
176
|
-
) : addStyleExpression(
|
|
177
|
-
t.objectExpression([
|
|
178
|
-
t.objectProperty(
|
|
179
|
-
t.identifier(attr.name),
|
|
180
|
-
attr.value
|
|
181
|
-
)
|
|
182
|
-
])
|
|
183
|
-
);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
case "attr": {
|
|
187
|
-
t.isJSXSpreadAttribute(attr.value) && (0, import_static.isSimpleSpread)(attr.value) && (stylesExpr.elements.push(
|
|
188
|
-
t.memberExpression(attr.value.argument, t.identifier("style"))
|
|
189
|
-
), options.experimentalFlattenThemesOnNative && hocStylesExpr.elements.push(
|
|
190
|
-
t.memberExpression(
|
|
191
|
-
attr.value.argument,
|
|
192
|
-
t.identifier("style")
|
|
193
|
-
)
|
|
194
|
-
)), finalAttrs.push(attr.value);
|
|
195
|
-
break;
|
|
208
|
+
var hasDynamicStyle = !1, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
209
|
+
try {
|
|
210
|
+
for (var _iterator = props.attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
211
|
+
var attr = _step.value;
|
|
212
|
+
switch (attr.type) {
|
|
213
|
+
case "style": {
|
|
214
|
+
var styleExpr = getStyleExpression(attr.value);
|
|
215
|
+
addStyleExpression(styleExpr), options.experimentalFlattenThemesOnNative && addStyleExpression(styleExpr, !0);
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
case "ternary": {
|
|
219
|
+
var _attr_value = attr.value, consequent = _attr_value.consequent, alternate = _attr_value.alternate, consExpr = getStyleExpression(consequent), altExpr = getStyleExpression(alternate);
|
|
220
|
+
options.experimentalFlattenThemesOnNative && (expressions.push(attr.value.test), addStyleExpression(t.conditionalExpression(t.identifier("_expressions[".concat(expressions.length - 1, "]")), consExpr || t.nullLiteral(), altExpr || t.nullLiteral()), !0));
|
|
221
|
+
var styleExpr1 = t.conditionalExpression(attr.value.test, consExpr || t.nullLiteral(), altExpr || t.nullLiteral());
|
|
222
|
+
addStyleExpression(styleExpr1);
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
case "dynamic-style": {
|
|
226
|
+
hasDynamicStyle = !0, expressions.push(attr.value), options.experimentalFlattenDynamicValues ? addStyleExpression(t.objectExpression([
|
|
227
|
+
t.objectProperty(t.identifier(attr.name), t.identifier("_expressions[".concat(expressions.length - 1, "]")))
|
|
228
|
+
]), !0) : addStyleExpression(t.objectExpression([
|
|
229
|
+
t.objectProperty(t.identifier(attr.name), attr.value)
|
|
230
|
+
]));
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
case "attr": {
|
|
234
|
+
t.isJSXSpreadAttribute(attr.value) && (0, import_static.isSimpleSpread)(attr.value) && (stylesExpr.elements.push(t.memberExpression(attr.value.argument, t.identifier("style"))), options.experimentalFlattenThemesOnNative && hocStylesExpr.elements.push(t.memberExpression(attr.value.argument, t.identifier("style")))), finalAttrs.push(attr.value);
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
196
237
|
}
|
|
197
238
|
}
|
|
239
|
+
} catch (err) {
|
|
240
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
241
|
+
} finally {
|
|
242
|
+
try {
|
|
243
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
244
|
+
} finally {
|
|
245
|
+
if (_didIteratorError)
|
|
246
|
+
throw _iteratorError;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
198
249
|
if (props.node.attributes = finalAttrs, props.isFlattened)
|
|
199
250
|
if (options.experimentalFlattenThemesOnNative && (themeKeysUsed.size || hocStylesExpr.elements.length > 1 || hasDynamicStyle)) {
|
|
200
251
|
hasImportedViewWrapper || (root.unshiftContainer("body", importWithStyle()), hasImportedViewWrapper = !0);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
t.callExpression(t.identifier("
|
|
210
|
-
t.
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
t.returnStatement(
|
|
225
|
-
t.callExpression(
|
|
226
|
-
t.memberExpression(
|
|
227
|
-
t.identifier("Object"),
|
|
228
|
-
t.identifier("assign")
|
|
229
|
-
),
|
|
230
|
-
[
|
|
231
|
-
t.objectExpression([]),
|
|
232
|
-
...hocStylesExpr.elements
|
|
233
|
-
]
|
|
234
|
-
)
|
|
235
|
-
)
|
|
236
|
-
])
|
|
237
|
-
),
|
|
238
|
-
t.arrayExpression([
|
|
239
|
-
...[...themeKeysUsed].map(
|
|
240
|
-
(k) => t.memberExpression(
|
|
241
|
-
t.identifier("theme"),
|
|
242
|
-
t.identifier(k)
|
|
243
|
-
)
|
|
244
|
-
),
|
|
245
|
-
t.spreadElement(t.identifier("_expressions"))
|
|
246
|
-
])
|
|
247
|
-
]
|
|
248
|
-
)
|
|
249
|
-
)
|
|
250
|
-
])
|
|
251
|
-
)
|
|
252
|
-
])
|
|
253
|
-
)
|
|
254
|
-
])
|
|
255
|
-
), props.node.name = WrapperIdentifier, expressions.length && props.node.attributes.push(
|
|
256
|
-
t.jsxAttribute(
|
|
257
|
-
t.jsxIdentifier("expressions"),
|
|
258
|
-
t.jsxExpressionContainer(t.arrayExpression(expressions))
|
|
259
|
-
)
|
|
260
|
-
);
|
|
252
|
+
var name = props.node.name.name, WrapperIdentifier = root.scope.generateUidIdentifier(name + "Wrapper");
|
|
253
|
+
root.pushContainer("body", t.variableDeclaration("const", [
|
|
254
|
+
t.variableDeclarator(WrapperIdentifier, t.callExpression(t.identifier("__withStableStyle"), [
|
|
255
|
+
t.identifier(name),
|
|
256
|
+
t.arrowFunctionExpression([
|
|
257
|
+
t.identifier("theme"),
|
|
258
|
+
t.identifier("_expressions")
|
|
259
|
+
], t.blockStatement([
|
|
260
|
+
t.returnStatement(t.callExpression(t.memberExpression(t.identifier("React"), t.identifier("useMemo")), [
|
|
261
|
+
t.arrowFunctionExpression([], t.blockStatement([
|
|
262
|
+
t.returnStatement(t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("assign")), [
|
|
263
|
+
t.objectExpression([])
|
|
264
|
+
].concat(_to_consumable_array(hocStylesExpr.elements), _to_consumable_array([]))))
|
|
265
|
+
])),
|
|
266
|
+
t.arrayExpression(_to_consumable_array(_to_consumable_array(themeKeysUsed).map(function(k) {
|
|
267
|
+
return t.memberExpression(t.identifier("theme"), t.identifier(k));
|
|
268
|
+
})).concat([
|
|
269
|
+
t.spreadElement(t.identifier("_expressions"))
|
|
270
|
+
]))
|
|
271
|
+
]))
|
|
272
|
+
]))
|
|
273
|
+
]))
|
|
274
|
+
])), props.node.name = WrapperIdentifier, expressions.length && props.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("expressions"), t.jsxExpressionContainer(t.arrayExpression(expressions))));
|
|
261
275
|
} else
|
|
262
|
-
props.node.attributes.push(
|
|
263
|
-
t.jsxAttribute(
|
|
264
|
-
t.jsxIdentifier("style"),
|
|
265
|
-
t.jsxExpressionContainer(
|
|
266
|
-
stylesExpr.elements.length === 1 ? stylesExpr.elements[0] : stylesExpr
|
|
267
|
-
)
|
|
268
|
-
)
|
|
269
|
-
);
|
|
276
|
+
props.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("style"), t.jsxExpressionContainer(stylesExpr.elements.length === 1 ? stylesExpr.elements[0] : stylesExpr)));
|
|
270
277
|
}
|
|
271
|
-
});
|
|
278
|
+
}));
|
|
272
279
|
} catch (err) {
|
|
273
|
-
if (err
|
|
274
|
-
|
|
280
|
+
if (_instanceof(err, Error)) {
|
|
281
|
+
var message = "".concat(shouldPrintDebug === "verbose" ? err : err.message);
|
|
275
282
|
message.includes("Unexpected return value from visitor method") && (message = "Unexpected return value from visitor method"), console.warn("Error in Tamagui parse, skipping", message, err.stack);
|
|
276
283
|
return;
|
|
277
284
|
}
|
|
@@ -280,34 +287,38 @@ var src_default = (0, import_helper_plugin_utils.declare)(function(api, options)
|
|
|
280
287
|
shouldPrintDebug && console.info("END no styles");
|
|
281
288
|
return;
|
|
282
289
|
}
|
|
283
|
-
|
|
284
|
-
"const SHEET = __ReactNativeStyleSheet.create(null)"
|
|
285
|
-
)({
|
|
290
|
+
var sheetObject = (0, import_static.literalToAst)(sheetStyles), sheetOuter = (0, import_template.default)("const SHEET = __ReactNativeStyleSheet.create(null)")({
|
|
286
291
|
SHEET: sheetIdentifier.name
|
|
287
292
|
});
|
|
288
293
|
sheetOuter.declarations[0].init.arguments[0] = sheetObject, root.unshiftContainer("body", sheetOuter), root.unshiftContainer("body", importStyleSheet()), shouldPrintDebug && (console.info(`
|
|
289
294
|
-------- output code -------
|
|
290
|
-
`), console.info(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
`
|
|
294
|
-
|
|
295
|
+
`), console.info((0, import_generator.default)(root.parent).code.split(`
|
|
296
|
+
`).filter(function(x) {
|
|
297
|
+
return !x.startsWith("//");
|
|
298
|
+
}).join(`
|
|
299
|
+
`)));
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
302
|
}
|
|
298
303
|
};
|
|
299
304
|
});
|
|
300
305
|
function assertValidTag(node) {
|
|
301
|
-
|
|
302
|
-
|
|
306
|
+
if (node.attributes.find(function(x) {
|
|
307
|
+
return x.type === "JSXAttribute" && x.name.name === "style";
|
|
308
|
+
})) {
|
|
309
|
+
var _process_env_DEBUG;
|
|
310
|
+
!((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui") && console.warn("\u26A0\uFE0F Cannot pass style attribute to extracted style");
|
|
311
|
+
}
|
|
303
312
|
}
|
|
304
313
|
function splitThemeStyles(style) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const val = style[key];
|
|
314
|
+
var themed = {}, plain = {}, noTheme = !0;
|
|
315
|
+
for (var key in style) {
|
|
316
|
+
var val = style[key];
|
|
309
317
|
val && val[0] === "$" ? (themed[key] = val, noTheme = !1) : plain[key] = val;
|
|
310
318
|
}
|
|
311
|
-
return {
|
|
319
|
+
return {
|
|
320
|
+
themed: noTheme ? null : themed,
|
|
321
|
+
plain
|
|
322
|
+
};
|
|
312
323
|
}
|
|
313
324
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["template", "generator"]
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/babel-plugin/src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAyB,iBAEzB,mBAAsB,sCACtB,6BAAwB,uCACxB,kBAAqB,qCAErB,IAAmB,kCAEnB,gBAKO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,IAAMA,uBAAmBC,gBAAAA,SAAU;;;CAAA,GAK7BC,uBAAmBD,gBAAAA,SAAU;;CAAA,GAI7BE,sBAAkBF,gBAAAA,SAAU;;CAAA,GAI5BG,gBAAYC,+BAAgB;EAAEC,UAAU;AAAS,CAAA,GAEvD,kBAAeC,oCAAQ,SACrBC,KACAC,SAAuB;AAKvBD,aAAIE,cAAc,CAAA,GAEX;IACLC,MAAM;IAENC,SAAS;MACPC,SAAS;QACPC,OAAAA,SAAiBC,MAAI;cAafC,0BAUFD,kCAAAA,kBAtBEE,aAAa,KAAKC,KAAKC,KAAKC;AAMhC,cAJIH,cAAAA,QAAAA,WAAYI,SAAS,cAAA,KAIrB,EAACJ,cAAAA,QAAAA,WAAYK,SAAS,MAAA,MAAW,EAACL,cAAAA,QAAAA,WAAYK,SAAS,MAAA;AACzD;AAKF,UAAIN,8BAAAA,QAAQO,IAAIC,iBAAW,QAAvBR,6BAAAA,WAAAA,yBAAyBM,SAAS,KAAA,MACpCL,aAAaA,WAAWQ,QAAQ,QAAQ,EAAA;AAG1C,cAAIC,kBAAkB,IAClBC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EAClBC,KAAKnE,MAAM;CAAA,EACXoE,OAAO,SAACC,GAAAA;mBAAM,CAACA,EAAEC,WAAW,IAAA;aAC5B3H,KAAK;CAAA,CAAA;QAGd;MACF;IACF;EACF;AACF,CAAA;AAEA,SAASuC,eAAe7C,MAAyB;AAC/C,MAAIA,KAAKiG,WAAWiC,KAAK,SAACF,GAAAA;WAAMA,EAAEpD,SAAS,kBAAkBoD,EAAEtJ,KAAKA,SAAS;MAAU;QAGjFK;AAAJ,IAAIA,wBAAAA,QAAQO,IAAI6I,WAAK,QAAjBpJ,uBAAAA,WAAAA,mBAAmBkJ,WAAW,SAAA,KAChCd,QAAQC,KAAK,6DAAA;EAEjB;AACF;AAEA,SAAS9D,iBAAiBxC,OAAa;AACrC,MAAM0C,SAAiB,CAAC,GAClBD,QAAgB,CAAC,GACnB6E,UAAU;AACd,WAAWjH,OAAOL,OAAO;AACvB,QAAMuH,MAAMvH,MAAMK,GAAAA;AAClB,IAAIkH,OAAOA,IAAI,CAAA,MAAO,OACpB7E,OAAOrC,GAAAA,IAAOkH,KACdD,UAAU,MAEV7E,MAAMpC,GAAAA,IAAOkH;EAEjB;AACA,SAAO;IAAE7E,QAAQ4E,UAAU,OAAO5E;IAAQD;EAAM;AAClD;",
|
|
5
|
+
"names": ["importNativeView", "template", "importStyleSheet", "importWithStyle", "extractor", "createExtractor", "platform", "declare", "api", "options", "assertVersion", "name", "visitor", "Program", "enter", "root", "process", "sourcePath", "file", "opts", "filename", "includes", "endsWith", "env", "SOURCE_ROOT", "replace", "hasImportedView", "hasImportedViewWrapper", "sheetStyles", "sheetIdentifier", "scope", "generateUidIdentifier", "firstComment", "node", "body", "leadingComments", "map", "comment", "value", "join", "getPragmaOptions", "disableCommentCheck", "source", "path", "shouldPrintDebug", "shouldDisable", "addSheetStyle", "style", "styleIndex", "Object", "keys", "length", "key", "NODE_ENV", "lineNumbers", "loc", "start", "line", "end", "basename", "readStyleExpr", "SHEET", "KEY", "parseSync", "importsWhitelist", "extractStyledDefinitions", "forceExtractStyleDefinitions", "excludeProps", "Set", "disableExtractInlineMedia", "disableExtractVariables", "experimentalFlattenThemesOnNative", "getFlattenedNode", "isTextView", "unshiftContainer", "onExtractTag", "props", "isFlattened", "assertValidTag", "stylesExpr", "t", "arrayExpression", "hocStylesExpr", "expressions", "finalAttrs", "themeKeysUsed", "getStyleExpression", "splitThemeStyles", "plain", "themed", "themeExpr", "add", "split", "getThemedStyleExpression", "ident", "addStyleExpression", "expr", "HOC", "Array", "isArray", "elements", "push", "styles", "themedStylesAst", "literalToAst", "properties", "forEach", "_", "prop", "type", "memberExpression", "identifier", "slice", "hasDynamicStyle", "attrs", "attr", "styleExpr", "consequent", "alternate", "consExpr", "altExpr", "test", "conditionalExpression", "nullLiteral", "experimentalFlattenDynamicValues", "objectExpression", "objectProperty", "isJSXSpreadAttribute", "isSimpleSpread", "argument", "attributes", "size", "WrapperIdentifier", "pushContainer", "variableDeclaration", "variableDeclarator", "callExpression", "arrowFunctionExpression", "blockStatement", "returnStatement", "k", "spreadElement", "jsxAttribute", "jsxIdentifier", "jsxExpressionContainer", "err", "Error", "message", "console", "warn", "stack", "info", "sheetObject", "sheetOuter", "declarations", "init", "arguments", "generator", "parent", "code", "filter", "x", "startsWith", "find", "DEBUG", "noTheme", "val"]
|
|
6
6
|
}
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.native.js
CHANGED
|
@@ -3,47 +3,108 @@ import generator from "@babel/generator";
|
|
|
3
3
|
import { declare } from "@babel/helper-plugin-utils";
|
|
4
4
|
import template from "@babel/template";
|
|
5
5
|
import * as t from "@babel/types";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { createExtractor, getPragmaOptions, isSimpleSpread, literalToAst } from "@tamagui/static";
|
|
7
|
+
function _array_like_to_array(arr, len) {
|
|
8
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
9
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
10
|
+
arr2[i] = arr[i];
|
|
11
|
+
return arr2;
|
|
12
|
+
}
|
|
13
|
+
function _array_without_holes(arr) {
|
|
14
|
+
if (Array.isArray(arr))
|
|
15
|
+
return _array_like_to_array(arr);
|
|
16
|
+
}
|
|
17
|
+
function _define_property(obj, key, value) {
|
|
18
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
19
|
+
value,
|
|
20
|
+
enumerable: !0,
|
|
21
|
+
configurable: !0,
|
|
22
|
+
writable: !0
|
|
23
|
+
}) : obj[key] = value, obj;
|
|
24
|
+
}
|
|
25
|
+
function _instanceof(left, right) {
|
|
26
|
+
return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
|
|
27
|
+
}
|
|
28
|
+
function _iterable_to_array(iter) {
|
|
29
|
+
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
30
|
+
return Array.from(iter);
|
|
31
|
+
}
|
|
32
|
+
function _non_iterable_spread() {
|
|
33
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
34
|
+
}
|
|
35
|
+
function _object_spread(target) {
|
|
36
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
37
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
38
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
39
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
40
|
+
}))), ownKeys2.forEach(function(key) {
|
|
41
|
+
_define_property(target, key, source[key]);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return target;
|
|
45
|
+
}
|
|
46
|
+
function ownKeys(object, enumerableOnly) {
|
|
47
|
+
var keys = Object.keys(object);
|
|
48
|
+
if (Object.getOwnPropertySymbols) {
|
|
49
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
50
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
51
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
52
|
+
})), keys.push.apply(keys, symbols);
|
|
53
|
+
}
|
|
54
|
+
return keys;
|
|
55
|
+
}
|
|
56
|
+
function _object_spread_props(target, source) {
|
|
57
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
58
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
59
|
+
}), target;
|
|
60
|
+
}
|
|
61
|
+
function _to_consumable_array(arr) {
|
|
62
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
63
|
+
}
|
|
64
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
65
|
+
if (o) {
|
|
66
|
+
if (typeof o == "string")
|
|
67
|
+
return _array_like_to_array(o, minLen);
|
|
68
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
69
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
70
|
+
return Array.from(n);
|
|
71
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
72
|
+
return _array_like_to_array(o, minLen);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
var importNativeView = template(`
|
|
13
76
|
const __ReactNativeView = require('react-native').View;
|
|
14
77
|
const __ReactNativeText = require('react-native').Text;
|
|
15
78
|
`), importStyleSheet = template(`
|
|
16
79
|
const __ReactNativeStyleSheet = require('react-native').StyleSheet;
|
|
17
80
|
`), importWithStyle = template(`
|
|
18
81
|
const __withStableStyle = require('@tamagui/core')._withStableStyle;
|
|
19
|
-
`), extractor = createExtractor({
|
|
20
|
-
|
|
82
|
+
`), extractor = createExtractor({
|
|
83
|
+
platform: "native"
|
|
84
|
+
}), src_default = declare(function(api, options) {
|
|
21
85
|
return api.assertVersion(7), {
|
|
22
86
|
name: "tamagui",
|
|
23
87
|
visitor: {
|
|
24
88
|
Program: {
|
|
25
|
-
enter(root) {
|
|
26
|
-
var
|
|
27
|
-
let sourcePath = this.file.opts.filename;
|
|
89
|
+
enter: function(root) {
|
|
90
|
+
var _process_env_SOURCE_ROOT, _root_node_body__leadingComments, _root_node_body_, sourcePath = this.file.opts.filename;
|
|
28
91
|
if (sourcePath != null && sourcePath.includes("node_modules") || !(sourcePath != null && sourcePath.endsWith(".jsx")) && !(sourcePath != null && sourcePath.endsWith(".tsx")))
|
|
29
92
|
return;
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
((_c = (_b = root.node.body[0]) == null ? void 0 : _b.leadingComments) == null ? void 0 : _c.map((comment) => (comment == null ? void 0 : comment.value) || " ").join(" ")) ?? ""
|
|
35
|
-
), { shouldPrintDebug, shouldDisable } = getPragmaOptions({
|
|
93
|
+
!((_process_env_SOURCE_ROOT = process.env.SOURCE_ROOT) === null || _process_env_SOURCE_ROOT === void 0) && _process_env_SOURCE_ROOT.endsWith("ios") && (sourcePath = sourcePath.replace("/ios", ""));
|
|
94
|
+
var hasImportedView = !1, hasImportedViewWrapper = !1, sheetStyles = {}, sheetIdentifier = root.scope.generateUidIdentifier("sheet"), _root_node_body__leadingComments_map_join, firstComment = (_root_node_body__leadingComments_map_join = (_root_node_body_ = root.node.body[0]) === null || _root_node_body_ === void 0 || (_root_node_body__leadingComments = _root_node_body_.leadingComments) === null || _root_node_body__leadingComments === void 0 ? void 0 : _root_node_body__leadingComments.map(function(comment) {
|
|
95
|
+
return (comment == null ? void 0 : comment.value) || " ";
|
|
96
|
+
}).join(" ")) !== null && _root_node_body__leadingComments_map_join !== void 0 ? _root_node_body__leadingComments_map_join : "", _getPragmaOptions = getPragmaOptions({
|
|
36
97
|
disableCommentCheck: !0,
|
|
37
98
|
source: firstComment,
|
|
38
99
|
path: sourcePath
|
|
39
|
-
});
|
|
100
|
+
}), shouldPrintDebug = _getPragmaOptions.shouldPrintDebug, shouldDisable = _getPragmaOptions.shouldDisable;
|
|
40
101
|
if (shouldDisable)
|
|
41
102
|
return;
|
|
42
103
|
function addSheetStyle(style, node) {
|
|
43
|
-
|
|
104
|
+
var styleIndex = "".concat(Object.keys(sheetStyles).length), key = "".concat(styleIndex);
|
|
44
105
|
if (process.env.NODE_ENV === "development") {
|
|
45
|
-
|
|
46
|
-
key +=
|
|
106
|
+
var lineNumbers = node.loc ? node.loc.start.line + (node.loc.start.line !== node.loc.end.line ? "-".concat(node.loc.end.line) : "") : "";
|
|
107
|
+
key += ":".concat(basename(sourcePath), ":").concat(lineNumbers);
|
|
47
108
|
}
|
|
48
109
|
return sheetStyles[key] = style, readStyleExpr(key);
|
|
49
110
|
}
|
|
@@ -54,11 +115,14 @@ var src_default = declare(function(api, options) {
|
|
|
54
115
|
}).expression;
|
|
55
116
|
}
|
|
56
117
|
try {
|
|
57
|
-
extractor.parseSync(root, {
|
|
118
|
+
extractor.parseSync(root, _object_spread_props(_object_spread({
|
|
58
119
|
// @ts-expect-error in case they leave it out
|
|
59
120
|
platform: "native",
|
|
60
121
|
shouldPrintDebug,
|
|
61
|
-
importsWhitelist: [
|
|
122
|
+
importsWhitelist: [
|
|
123
|
+
"constants.js",
|
|
124
|
+
"colors.js"
|
|
125
|
+
],
|
|
62
126
|
extractStyledDefinitions: options.forceExtractStyleDefinitions,
|
|
63
127
|
excludeProps: /* @__PURE__ */ new Set([
|
|
64
128
|
"className",
|
|
@@ -67,8 +131,8 @@ var src_default = declare(function(api, options) {
|
|
|
67
131
|
"textOverflow",
|
|
68
132
|
"cursor",
|
|
69
133
|
"contain"
|
|
70
|
-
])
|
|
71
|
-
|
|
134
|
+
])
|
|
135
|
+
}, options), {
|
|
72
136
|
// disable this extraction for now at least, need to figure out merging theme vs non-theme
|
|
73
137
|
// because theme need to stay in render(), whereas non-theme can be extracted
|
|
74
138
|
// for now just turn it off entirely at a small perf loss
|
|
@@ -81,179 +145,117 @@ var src_default = declare(function(api, options) {
|
|
|
81
145
|
// thinking it's not really worth the effort to do much compilation on native
|
|
82
146
|
// for now just disable flatten as it can only run in narrow places on native
|
|
83
147
|
// disableFlattening: 'styled',
|
|
84
|
-
getFlattenedNode(
|
|
148
|
+
getFlattenedNode: function(param) {
|
|
149
|
+
var isTextView = param.isTextView;
|
|
85
150
|
return hasImportedView || (hasImportedView = !0, root.unshiftContainer("body", importNativeView())), isTextView ? "__ReactNativeText" : "__ReactNativeView";
|
|
86
151
|
},
|
|
87
|
-
onExtractTag(props) {
|
|
88
|
-
|
|
152
|
+
onExtractTag: function(props) {
|
|
153
|
+
var isFlattened = props.isFlattened;
|
|
89
154
|
if (!isFlattened)
|
|
90
155
|
return;
|
|
91
156
|
assertValidTag(props.node);
|
|
92
|
-
|
|
157
|
+
var stylesExpr = t.arrayExpression([]), hocStylesExpr = t.arrayExpression([]), expressions = [], finalAttrs = [], themeKeysUsed = /* @__PURE__ */ new Set();
|
|
93
158
|
function getStyleExpression(style) {
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
159
|
+
if (style) {
|
|
160
|
+
var _splitThemeStyles = splitThemeStyles(style), plain = _splitThemeStyles.plain, themed = _splitThemeStyles.themed, themeExpr = null;
|
|
161
|
+
if (themed && options.experimentalFlattenThemesOnNative) {
|
|
162
|
+
for (var key in themed)
|
|
163
|
+
themeKeysUsed.add(themed[key].split("$")[1]);
|
|
164
|
+
themeExpr = getThemedStyleExpression(themed);
|
|
165
|
+
}
|
|
166
|
+
var ident = addSheetStyle(plain, props.node);
|
|
167
|
+
return themeExpr ? (addStyleExpression(ident), addStyleExpression(ident, !0), themeExpr) : ident;
|
|
102
168
|
}
|
|
103
|
-
const ident = addSheetStyle(plain, props.node);
|
|
104
|
-
return themeExpr ? (addStyleExpression(ident), addStyleExpression(ident, !0), themeExpr) : ident;
|
|
105
169
|
}
|
|
106
|
-
function addStyleExpression(expr
|
|
107
|
-
|
|
170
|
+
function addStyleExpression(expr) {
|
|
171
|
+
var HOC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
172
|
+
if (Array.isArray(expr)) {
|
|
173
|
+
var _elements;
|
|
174
|
+
(_elements = (HOC ? hocStylesExpr : stylesExpr).elements).push.apply(_elements, _to_consumable_array(expr));
|
|
175
|
+
} else
|
|
176
|
+
(HOC ? hocStylesExpr : stylesExpr).elements.push(expr);
|
|
108
177
|
}
|
|
109
178
|
function getThemedStyleExpression(styles) {
|
|
110
|
-
|
|
111
|
-
return themedStylesAst.properties.forEach((_)
|
|
112
|
-
|
|
113
|
-
prop.value.type === "StringLiteral" && (prop.value = t.memberExpression(
|
|
114
|
-
t.identifier("theme"),
|
|
115
|
-
t.identifier(prop.value.value.slice(1))
|
|
116
|
-
));
|
|
179
|
+
var themedStylesAst = literalToAst(styles);
|
|
180
|
+
return themedStylesAst.properties.forEach(function(_) {
|
|
181
|
+
var prop = _;
|
|
182
|
+
prop.value.type === "StringLiteral" && (prop.value = t.memberExpression(t.identifier("theme"), t.identifier(prop.value.value.slice(1))));
|
|
117
183
|
}), themedStylesAst;
|
|
118
184
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
case "dynamic-style": {
|
|
150
|
-
hasDynamicStyle = !0, expressions.push(attr.value), options.experimentalFlattenDynamicValues ? addStyleExpression(
|
|
151
|
-
t.objectExpression([
|
|
152
|
-
t.objectProperty(
|
|
153
|
-
t.identifier(attr.name),
|
|
154
|
-
t.identifier(`_expressions[${expressions.length - 1}]`)
|
|
155
|
-
)
|
|
156
|
-
]),
|
|
157
|
-
!0
|
|
158
|
-
) : addStyleExpression(
|
|
159
|
-
t.objectExpression([
|
|
160
|
-
t.objectProperty(
|
|
161
|
-
t.identifier(attr.name),
|
|
162
|
-
attr.value
|
|
163
|
-
)
|
|
164
|
-
])
|
|
165
|
-
);
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
case "attr": {
|
|
169
|
-
t.isJSXSpreadAttribute(attr.value) && isSimpleSpread(attr.value) && (stylesExpr.elements.push(
|
|
170
|
-
t.memberExpression(attr.value.argument, t.identifier("style"))
|
|
171
|
-
), options.experimentalFlattenThemesOnNative && hocStylesExpr.elements.push(
|
|
172
|
-
t.memberExpression(
|
|
173
|
-
attr.value.argument,
|
|
174
|
-
t.identifier("style")
|
|
175
|
-
)
|
|
176
|
-
)), finalAttrs.push(attr.value);
|
|
177
|
-
break;
|
|
185
|
+
var hasDynamicStyle = !1, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
186
|
+
try {
|
|
187
|
+
for (var _iterator = props.attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
188
|
+
var attr = _step.value;
|
|
189
|
+
switch (attr.type) {
|
|
190
|
+
case "style": {
|
|
191
|
+
var styleExpr = getStyleExpression(attr.value);
|
|
192
|
+
addStyleExpression(styleExpr), options.experimentalFlattenThemesOnNative && addStyleExpression(styleExpr, !0);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
case "ternary": {
|
|
196
|
+
var _attr_value = attr.value, consequent = _attr_value.consequent, alternate = _attr_value.alternate, consExpr = getStyleExpression(consequent), altExpr = getStyleExpression(alternate);
|
|
197
|
+
options.experimentalFlattenThemesOnNative && (expressions.push(attr.value.test), addStyleExpression(t.conditionalExpression(t.identifier("_expressions[".concat(expressions.length - 1, "]")), consExpr || t.nullLiteral(), altExpr || t.nullLiteral()), !0));
|
|
198
|
+
var styleExpr1 = t.conditionalExpression(attr.value.test, consExpr || t.nullLiteral(), altExpr || t.nullLiteral());
|
|
199
|
+
addStyleExpression(styleExpr1);
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
case "dynamic-style": {
|
|
203
|
+
hasDynamicStyle = !0, expressions.push(attr.value), options.experimentalFlattenDynamicValues ? addStyleExpression(t.objectExpression([
|
|
204
|
+
t.objectProperty(t.identifier(attr.name), t.identifier("_expressions[".concat(expressions.length - 1, "]")))
|
|
205
|
+
]), !0) : addStyleExpression(t.objectExpression([
|
|
206
|
+
t.objectProperty(t.identifier(attr.name), attr.value)
|
|
207
|
+
]));
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
case "attr": {
|
|
211
|
+
t.isJSXSpreadAttribute(attr.value) && isSimpleSpread(attr.value) && (stylesExpr.elements.push(t.memberExpression(attr.value.argument, t.identifier("style"))), options.experimentalFlattenThemesOnNative && hocStylesExpr.elements.push(t.memberExpression(attr.value.argument, t.identifier("style")))), finalAttrs.push(attr.value);
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
178
214
|
}
|
|
179
215
|
}
|
|
216
|
+
} catch (err) {
|
|
217
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
218
|
+
} finally {
|
|
219
|
+
try {
|
|
220
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
221
|
+
} finally {
|
|
222
|
+
if (_didIteratorError)
|
|
223
|
+
throw _iteratorError;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
180
226
|
if (props.node.attributes = finalAttrs, props.isFlattened)
|
|
181
227
|
if (options.experimentalFlattenThemesOnNative && (themeKeysUsed.size || hocStylesExpr.elements.length > 1 || hasDynamicStyle)) {
|
|
182
228
|
hasImportedViewWrapper || (root.unshiftContainer("body", importWithStyle()), hasImportedViewWrapper = !0);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
t.callExpression(t.identifier("
|
|
192
|
-
t.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
t.returnStatement(
|
|
207
|
-
t.callExpression(
|
|
208
|
-
t.memberExpression(
|
|
209
|
-
t.identifier("Object"),
|
|
210
|
-
t.identifier("assign")
|
|
211
|
-
),
|
|
212
|
-
[
|
|
213
|
-
t.objectExpression([]),
|
|
214
|
-
...hocStylesExpr.elements
|
|
215
|
-
]
|
|
216
|
-
)
|
|
217
|
-
)
|
|
218
|
-
])
|
|
219
|
-
),
|
|
220
|
-
t.arrayExpression([
|
|
221
|
-
...[...themeKeysUsed].map(
|
|
222
|
-
(k) => t.memberExpression(
|
|
223
|
-
t.identifier("theme"),
|
|
224
|
-
t.identifier(k)
|
|
225
|
-
)
|
|
226
|
-
),
|
|
227
|
-
t.spreadElement(t.identifier("_expressions"))
|
|
228
|
-
])
|
|
229
|
-
]
|
|
230
|
-
)
|
|
231
|
-
)
|
|
232
|
-
])
|
|
233
|
-
)
|
|
234
|
-
])
|
|
235
|
-
)
|
|
236
|
-
])
|
|
237
|
-
), props.node.name = WrapperIdentifier, expressions.length && props.node.attributes.push(
|
|
238
|
-
t.jsxAttribute(
|
|
239
|
-
t.jsxIdentifier("expressions"),
|
|
240
|
-
t.jsxExpressionContainer(t.arrayExpression(expressions))
|
|
241
|
-
)
|
|
242
|
-
);
|
|
229
|
+
var name = props.node.name.name, WrapperIdentifier = root.scope.generateUidIdentifier(name + "Wrapper");
|
|
230
|
+
root.pushContainer("body", t.variableDeclaration("const", [
|
|
231
|
+
t.variableDeclarator(WrapperIdentifier, t.callExpression(t.identifier("__withStableStyle"), [
|
|
232
|
+
t.identifier(name),
|
|
233
|
+
t.arrowFunctionExpression([
|
|
234
|
+
t.identifier("theme"),
|
|
235
|
+
t.identifier("_expressions")
|
|
236
|
+
], t.blockStatement([
|
|
237
|
+
t.returnStatement(t.callExpression(t.memberExpression(t.identifier("React"), t.identifier("useMemo")), [
|
|
238
|
+
t.arrowFunctionExpression([], t.blockStatement([
|
|
239
|
+
t.returnStatement(t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("assign")), [
|
|
240
|
+
t.objectExpression([])
|
|
241
|
+
].concat(_to_consumable_array(hocStylesExpr.elements), _to_consumable_array([]))))
|
|
242
|
+
])),
|
|
243
|
+
t.arrayExpression(_to_consumable_array(_to_consumable_array(themeKeysUsed).map(function(k) {
|
|
244
|
+
return t.memberExpression(t.identifier("theme"), t.identifier(k));
|
|
245
|
+
})).concat([
|
|
246
|
+
t.spreadElement(t.identifier("_expressions"))
|
|
247
|
+
]))
|
|
248
|
+
]))
|
|
249
|
+
]))
|
|
250
|
+
]))
|
|
251
|
+
])), props.node.name = WrapperIdentifier, expressions.length && props.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("expressions"), t.jsxExpressionContainer(t.arrayExpression(expressions))));
|
|
243
252
|
} else
|
|
244
|
-
props.node.attributes.push(
|
|
245
|
-
t.jsxAttribute(
|
|
246
|
-
t.jsxIdentifier("style"),
|
|
247
|
-
t.jsxExpressionContainer(
|
|
248
|
-
stylesExpr.elements.length === 1 ? stylesExpr.elements[0] : stylesExpr
|
|
249
|
-
)
|
|
250
|
-
)
|
|
251
|
-
);
|
|
253
|
+
props.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("style"), t.jsxExpressionContainer(stylesExpr.elements.length === 1 ? stylesExpr.elements[0] : stylesExpr)));
|
|
252
254
|
}
|
|
253
|
-
});
|
|
255
|
+
}));
|
|
254
256
|
} catch (err) {
|
|
255
|
-
if (err
|
|
256
|
-
|
|
257
|
+
if (_instanceof(err, Error)) {
|
|
258
|
+
var message = "".concat(shouldPrintDebug === "verbose" ? err : err.message);
|
|
257
259
|
message.includes("Unexpected return value from visitor method") && (message = "Unexpected return value from visitor method"), console.warn("Error in Tamagui parse, skipping", message, err.stack);
|
|
258
260
|
return;
|
|
259
261
|
}
|
|
@@ -262,35 +264,39 @@ var src_default = declare(function(api, options) {
|
|
|
262
264
|
shouldPrintDebug && console.info("END no styles");
|
|
263
265
|
return;
|
|
264
266
|
}
|
|
265
|
-
|
|
266
|
-
"const SHEET = __ReactNativeStyleSheet.create(null)"
|
|
267
|
-
)({
|
|
267
|
+
var sheetObject = literalToAst(sheetStyles), sheetOuter = template("const SHEET = __ReactNativeStyleSheet.create(null)")({
|
|
268
268
|
SHEET: sheetIdentifier.name
|
|
269
269
|
});
|
|
270
270
|
sheetOuter.declarations[0].init.arguments[0] = sheetObject, root.unshiftContainer("body", sheetOuter), root.unshiftContainer("body", importStyleSheet()), shouldPrintDebug && (console.info(`
|
|
271
271
|
-------- output code -------
|
|
272
|
-
`), console.info(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
`
|
|
276
|
-
|
|
272
|
+
`), console.info(generator(root.parent).code.split(`
|
|
273
|
+
`).filter(function(x) {
|
|
274
|
+
return !x.startsWith("//");
|
|
275
|
+
}).join(`
|
|
276
|
+
`)));
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
function assertValidTag(node) {
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
if (node.attributes.find(function(x) {
|
|
284
|
+
return x.type === "JSXAttribute" && x.name.name === "style";
|
|
285
|
+
})) {
|
|
286
|
+
var _process_env_DEBUG;
|
|
287
|
+
!((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui") && console.warn("\u26A0\uFE0F Cannot pass style attribute to extracted style");
|
|
288
|
+
}
|
|
285
289
|
}
|
|
286
290
|
function splitThemeStyles(style) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
const val = style[key];
|
|
291
|
+
var themed = {}, plain = {}, noTheme = !0;
|
|
292
|
+
for (var key in style) {
|
|
293
|
+
var val = style[key];
|
|
291
294
|
val && val[0] === "$" ? (themed[key] = val, noTheme = !1) : plain[key] = val;
|
|
292
295
|
}
|
|
293
|
-
return {
|
|
296
|
+
return {
|
|
297
|
+
themed: noTheme ? null : themed,
|
|
298
|
+
plain
|
|
299
|
+
};
|
|
294
300
|
}
|
|
295
301
|
export {
|
|
296
302
|
src_default as default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/babel-plugin/src/index.ts"],
|
|
4
|
+
"mappings": "AAAA,SAASA,gBAAgB;AAEzB,OAAOC,eAAe;AACtB,SAASC,eAAe;AACxB,OAAOC,cAAc;AAErB,YAAYC,OAAO;AAEnB,SACEC,iBACAC,kBACAC,gBACAC,oBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,IAAMC,mBAAmBN,SAAU;;;CAAA,GAK7BO,mBAAmBP,SAAU;;CAAA,GAI7BQ,kBAAkBR,SAAU;;CAAA,GAI5BS,YAAYP,gBAAgB;EAAEQ,UAAU;AAAS,CAAA,GAEvD,cAAeX,QAAQ,SACrBY,KACAC,SAAuB;AAKvBD,aAAIE,cAAc,CAAA,GAEX;IACLC,MAAM;IAENC,SAAS;MACPC,SAAS;QACPC,OAAAA,SAAiB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A;AAEf;UACF;AAEA,cAAMC,cAAcjJ,aAAa0B,WAAAA,GAC3BwH,aAAavJ,SACjB,oDAAA,EACA;YACA8D,OAAO9B,gBAAgBlB;UACzB,CAAA;AAGAyI,qBAAWC,aAAa,CAAA,EAAGC,KAAKC,UAAU,CAAA,IAAKJ,aAC/CpI,KAAKyD,iBAAiB,QAAQ4E,UAAAA,GAE9BrI,KAAKyD,iBAAiB,QAAQpE,iBAAAA,CAAAA,GAE1BuC,qBACFoG,QAAQG,KAAK;;CAAA,GACbH,QAAQG,KACNvJ,UAAUoB,KAAKyI,MAAM,EAClBC,KAAKhE,MAAM;CAAA,EACXiE,OAAO,SAACC,GAAAA;mBAAM,CAACA,EAAEC,WAAW,IAAA;aAC5BrH,KAAK;CAAA,CAAA;QAGd;MACF;IACF;EACF;AACF,CAAA;AAEA,SAASqC,eAAe3C,MAAyB;AAC/C,MAAIA,KAAK4F,WAAWgC,KAAK,SAACF,GAAAA;WAAMA,EAAElD,SAAS,kBAAkBkD,EAAEhJ,KAAKA,SAAS;MAAU;QAGjFK;AAAJ,IAAIA,wBAAAA,QAAQO,IAAIuI,WAAK,QAAjB9I,uBAAAA,WAAAA,mBAAmB4I,WAAW,SAAA,KAChCb,QAAQC,KAAK,6DAAA;EAEjB;AACF;AAEA,SAAS5D,iBAAiBtC,OAAa;AACrC,MAAMwC,SAAiB,CAAC,GAClBD,QAAgB,CAAC,GACnB0E,UAAU;AACd,WAAW5G,OAAOL,OAAO;AACvB,QAAMkH,MAAMlH,MAAMK,GAAAA;AAClB,IAAI6G,OAAOA,IAAI,CAAA,MAAO,OACpB1E,OAAOnC,GAAAA,IAAO6G,KACdD,UAAU,MAEV1E,MAAMlC,GAAAA,IAAO6G;EAEjB;AACA,SAAO;IAAE1E,QAAQyE,UAAU,OAAOzE;IAAQD;EAAM;AAClD;",
|
|
5
|
+
"names": ["basename", "generator", "declare", "template", "t", "createExtractor", "getPragmaOptions", "isSimpleSpread", "literalToAst", "importNativeView", "importStyleSheet", "importWithStyle", "extractor", "platform", "api", "options", "assertVersion", "name", "visitor", "Program", "enter", "root", "process", "sourcePath", "file", "opts", "filename", "includes", "endsWith", "env", "SOURCE_ROOT", "replace", "hasImportedView", "hasImportedViewWrapper", "sheetStyles", "sheetIdentifier", "scope", "generateUidIdentifier", "firstComment", "node", "body", "leadingComments", "map", "comment", "value", "join", "disableCommentCheck", "source", "path", "shouldPrintDebug", "shouldDisable", "addSheetStyle", "style", "styleIndex", "Object", "keys", "length", "key", "NODE_ENV", "lineNumbers", "loc", "start", "line", "end", "readStyleExpr", "SHEET", "KEY", "parseSync", "importsWhitelist", "extractStyledDefinitions", "forceExtractStyleDefinitions", "excludeProps", "Set", "disableExtractInlineMedia", "disableExtractVariables", "experimentalFlattenThemesOnNative", "getFlattenedNode", "isTextView", "unshiftContainer", "onExtractTag", "props", "isFlattened", "assertValidTag", "stylesExpr", "arrayExpression", "hocStylesExpr", "expressions", "finalAttrs", "themeKeysUsed", "getStyleExpression", "splitThemeStyles", "plain", "themed", "themeExpr", "add", "split", "getThemedStyleExpression", "ident", "addStyleExpression", "expr", "HOC", "Array", "isArray", "elements", "push", "styles", "themedStylesAst", "properties", "forEach", "_", "prop", "type", "memberExpression", "identifier", "slice", "hasDynamicStyle", "attrs", "attr", "styleExpr", "consequent", "alternate", "consExpr", "altExpr", "test", "conditionalExpression", "nullLiteral", "experimentalFlattenDynamicValues", "objectExpression", "objectProperty", "isJSXSpreadAttribute", "argument", "attributes", "size", "WrapperIdentifier", "pushContainer", "variableDeclaration", "variableDeclarator", "callExpression", "arrowFunctionExpression", "blockStatement", "returnStatement", "k", "spreadElement", "jsxAttribute", "jsxIdentifier", "jsxExpressionContainer", "err", "Error", "message", "console", "warn", "stack", "info", "sheetObject", "sheetOuter", "declarations", "init", "arguments", "parent", "code", "filter", "x", "startsWith", "find", "DEBUG", "noTheme", "val"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/babel-plugin",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.27-1708112217600",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"@babel/helper-plugin-utils": "^7.22.5",
|
|
28
28
|
"@babel/template": "^7.22.15",
|
|
29
29
|
"@babel/traverse": "^7.23.3",
|
|
30
|
-
"@tamagui/static": "1.89.
|
|
30
|
+
"@tamagui/static": "1.89.27-1708112217600"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/types": "^7.23.3",
|
|
34
|
-
"@tamagui/build": "1.89.
|
|
34
|
+
"@tamagui/build": "1.89.27-1708112217600"
|
|
35
35
|
},
|
|
36
36
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
|
|
37
37
|
}
|