@tamagui/static 1.101.0 → 1.101.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/extractor/createExtractor.js +21 -12
- package/dist/cjs/extractor/createExtractor.js.map +1 -1
- package/dist/cjs/extractor/createExtractor.native.js +18 -12
- package/dist/cjs/extractor/createExtractor.native.js.map +2 -2
- package/dist/cjs/extractor/extractMediaStyle.js +2 -2
- package/dist/cjs/extractor/extractMediaStyle.js.map +1 -1
- package/dist/cjs/extractor/extractMediaStyle.native.js +2 -2
- package/dist/cjs/extractor/extractMediaStyle.native.js.map +2 -2
- package/dist/cjs/extractor/extractToClassNames.js +17 -15
- package/dist/cjs/extractor/extractToClassNames.js.map +1 -1
- package/dist/cjs/extractor/extractToClassNames.native.js +12 -14
- package/dist/cjs/extractor/extractToClassNames.native.js.map +2 -2
- package/dist/esm/extractor/createExtractor.js +24 -11
- package/dist/esm/extractor/createExtractor.js.map +1 -1
- package/dist/esm/extractor/createExtractor.mjs +16 -12
- package/dist/esm/extractor/createExtractor.native.js +18 -11
- package/dist/esm/extractor/createExtractor.native.js.map +2 -2
- package/dist/esm/extractor/extractMediaStyle.js +2 -2
- package/dist/esm/extractor/extractMediaStyle.js.map +1 -1
- package/dist/esm/extractor/extractMediaStyle.mjs +2 -2
- package/dist/esm/extractor/extractMediaStyle.native.js +2 -2
- package/dist/esm/extractor/extractMediaStyle.native.js.map +2 -2
- package/dist/esm/extractor/extractToClassNames.js +16 -15
- package/dist/esm/extractor/extractToClassNames.js.map +1 -1
- package/dist/esm/extractor/extractToClassNames.mjs +14 -16
- package/dist/esm/extractor/extractToClassNames.native.js +11 -14
- package/dist/esm/extractor/extractToClassNames.native.js.map +2 -2
- package/package.json +15 -15
- package/src/extractor/createExtractor.ts +23 -22
- package/src/extractor/extractMediaStyle.ts +2 -2
- package/src/extractor/extractToClassNames.ts +30 -16
- package/types/extractor/babelParse.d.ts +0 -1
- package/types/extractor/babelParse.d.ts.map +1 -1
- package/types/extractor/createEvaluator.d.ts.map +1 -1
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/extractToClassNames.d.ts +0 -1
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/getStaticBindingsForScope.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts.map +1 -1
@@ -50,7 +50,7 @@ function extractMediaStyle(props, ternary, jsxPath, tamaguiConfig, sourcePath, i
|
|
50
50
|
tamaguiConfig.media,
|
51
51
|
!0,
|
52
52
|
negate
|
53
|
-
), className = `.${mediaStyle.
|
53
|
+
), className = `.${mediaStyle[core.StyleObjectIdentifier]}`;
|
54
54
|
return {
|
55
55
|
...mediaStyle,
|
56
56
|
className
|
@@ -60,7 +60,7 @@ function extractMediaStyle(props, ternary, jsxPath, tamaguiConfig, sourcePath, i
|
|
60
60
|
" media styles:",
|
61
61
|
importance,
|
62
62
|
styleObj,
|
63
|
-
singleMediaStyles.map((x) => x.
|
63
|
+
singleMediaStyles.map((x) => x[core.StyleObjectIdentifier]).join(", ")
|
64
64
|
), mediaStyles = [...mediaStyles, ...singleMediaStyles];
|
65
65
|
}
|
66
66
|
return ternary.remove(), { mediaStyles, ternaryWithoutMedia: mt.ternaryWithoutMedia };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/extractMediaStyle.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,QAAmB,kCAEnB,OAAsB,mCAGtB,4BAAmC,0CAEnC,wBAAyC;AAElC,SAAS,kBACd,OACA,SACA,SACA,eACA,YACA,aAAa,GACb,mBAAwC,IACxC;AACA,QAAM,EAAE,iBAAiB,oBAAoB,QAAI,8CAAmB,KAAK,GACnE,KAAK,qBAAqB,OAAO,SAAS,SAAS,UAAU;AACnE,MAAI,CAAC;AACH,WAAO;AAET,QAAM,EAAE,IAAI,IAAI;AAEhB,MAAI,CADO,cAAc,MAAM,GAA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AHI,CAAC,QAAQ,CAAC,EAAE,iBAAiB,IAAI,KACjC,CAAC,EAAE,aAAa,KAAK,MAAM,KAE3B,KAAK,OAAO,SAAS,WAAY,QAAO;AAE5C,QAAM,eADW,QAAQ,MAAM,eAAe,EAChB;AAC9B,MAAI,CAAC,aAAc,QAAO;AAC1B,QAAM,iBAAiB,aAAa,KAAK;AAEzC,SADI,GAAC,EAAE,oBAAoB,cAAc,KACrC,KAAC,qCAAc,OAAO,UAAU;AAItC;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -112,13 +112,13 @@ function extractMediaStyle(props, ternary, jsxPath, tamaguiConfig, sourcePath) {
|
|
112
112
|
try {
|
113
113
|
for (var _loop = function() {
|
114
114
|
var _step_value = _step.value, styleObj = _step_value.styleObj, negate = _step_value.negate, styles = getStylesAtomic(styleObj), singleMediaStyles = styles.map(function(style) {
|
115
|
-
var mediaStyle = core.createMediaStyle(style, key, tamaguiConfig.media, !0, negate), className = ".".concat(mediaStyle.
|
115
|
+
var mediaStyle = core.createMediaStyle(style, key, tamaguiConfig.media, !0, negate), className = ".".concat(mediaStyle[core.StyleObjectIdentifier]);
|
116
116
|
return _object_spread_props(_object_spread({}, mediaStyle), {
|
117
117
|
className
|
118
118
|
});
|
119
119
|
});
|
120
120
|
shouldPrintDebug === "verbose" && console.info(" media styles:", importance, styleObj, singleMediaStyles.map(function(x) {
|
121
|
-
return x.
|
121
|
+
return x[core.StyleObjectIdentifier];
|
122
122
|
}).join(", ")), mediaStyles = _to_consumable_array(mediaStyles).concat(_to_consumable_array(singleMediaStyles));
|
123
123
|
}, _iterator = styleOpts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
124
124
|
} catch (err) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/extractMediaStyle.ts"],
|
4
|
-
"m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A,IAAO,IAAIE,MAAM9B,aAAa,CAAA,EAAG+B,KAAK,OAAA,EAASC,KAAK,EAAA,GACjDL;EACT,GAAG,CAAC,CAAA,GACAM,cAA6B,CAAA,GAK5B,4BAAA,IAAA,oBAAA,IAAA,iBAAA;;AAAL;AAAK,UAAA,cAAA,MAAA,OAAQlB,WAAAA,YAAAA,UAAUC,SAAAA,YAAAA,QACfkB,SAAS/B,gBAAgBY,QAAAA,GAEzBoB,oBAAoBD,OAAOE,IAAI,SAACC,OAAAA;AACpC,YAAMC,aAAaC,KAAKC,iBACtBH,OACA9B,KACAT,cAAcW,OACd,IACAO,MAAAA,GAEIyB,YAAa,
|
5
|
-
"names": ["extractMediaStyle", "props", "ternary", "jsxPath", "tamaguiConfig", "sourcePath", "importance", "shouldPrintDebug", "requireTamaguiCore", "getStylesAtomic", "mediaObjectToString", "mt", "getMediaQueryTernary", "key", "mq", "media", "console", "error", "Object", "keys", "getStyleObj", "styleObj", "negate", "styleOpts", "consequent", "alternate", "filter", "isPresent", "length", "info", "mediaKeys", "mediaKeyPrecendence", "reduce", "acc", "cur", "i", "Array", "fill", "join", "mediaStyles", "styles", "singleMediaStyles", "map", "style", "mediaStyle", "core", "createMediaStyle", "className", "
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,QAAmB,kCAEnB,OAAsB,mCAGtB,4BAAmC,0CAEnC,wBAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,SAASA,kBACdC,OACAC,SACAC,SACAC,eACAC,YAAkB;MAClBC,aAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAa,GACbC,mBAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAwC,IAESC,0BAAAA,8CAAmB,KAAA,GAA5DC,kBAAyCD,oBAAzCC,iBAAiBC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S;AAC9B,MAAI,CAACY,aAAc,QAAO;AAC1B,MAAMC,iBAAiBD,aAAaR,KAAKU;AAEzC,SADI,GAAC/B,EAAEgC,oBAAoBF,cAAAA,KACvB,KAACG,qCAAcpF,OAAOI,UAAAA;AAI5B;",
|
5
|
+
"names": ["extractMediaStyle", "props", "ternary", "jsxPath", "tamaguiConfig", "sourcePath", "importance", "shouldPrintDebug", "requireTamaguiCore", "getStylesAtomic", "mediaObjectToString", "mt", "getMediaQueryTernary", "key", "mq", "media", "console", "error", "Object", "keys", "getStyleObj", "styleObj", "negate", "styleOpts", "consequent", "alternate", "filter", "isPresent", "length", "info", "mediaKeys", "mediaKeyPrecendence", "reduce", "acc", "cur", "i", "Array", "fill", "join", "mediaStyles", "styles", "singleMediaStyles", "map", "style", "mediaStyle", "core", "createMediaStyle", "className", "StyleObjectIdentifier", "x", "remove", "ternaryWithoutMedia", "t", "isLogicalExpression", "test", "operator", "mediaLeft", "getMediaInfoFromExpression", "left", "inlineMediaQuery", "right", "result", "bindingName", "isMemberExpression", "isIdentifier", "object", "property", "binding", "name", "bindings", "scope", "getAllBindings", "bindingNode", "path", "node", "isVariableDeclarator", "init", "isValidMediaCall", "getBinding", "isCallExpression", "callee", "mediaBinding", "useMediaImport", "parent", "isImportDeclaration", "isValidImport"]
|
6
6
|
}
|
@@ -25,7 +25,7 @@ __export(extractToClassNames_exports, {
|
|
25
25
|
extractToClassNames: () => extractToClassNames
|
26
26
|
});
|
27
27
|
module.exports = __toCommonJS(extractToClassNames_exports);
|
28
|
-
var path = __toESM(require("node:path")), util = __toESM(require("node:util")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), helpers = __toESM(require("@tamagui/helpers")), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_babelParse = require("./babelParse"), import_buildClassName = require("./buildClassName"), import_ensureImportingConcat = require("./ensureImportingConcat"), import_extractHelpers = require("./extractHelpers"), import_extractMediaStyle = require("./extractMediaStyle"), import_hoistClassNames = require("./hoistClassNames"),
|
28
|
+
var path = __toESM(require("node:path")), util = __toESM(require("node:util")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), helpers = __toESM(require("@tamagui/helpers")), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_babelParse = require("./babelParse"), import_buildClassName = require("./buildClassName"), import_ensureImportingConcat = require("./ensureImportingConcat"), import_extractHelpers = require("./extractHelpers"), import_extractMediaStyle = require("./extractMediaStyle"), import_hoistClassNames = require("./hoistClassNames"), import_propsToFontFamilyCache = require("./propsToFontFamilyCache"), import_timer = require("./timer"), import_createLogger = require("./createLogger");
|
29
29
|
const mergeStyleGroups = {
|
30
30
|
shadowOpacity: !0,
|
31
31
|
shadowRadius: !0,
|
@@ -116,7 +116,7 @@ async function extractToClassNames({
|
|
116
116
|
case "style": {
|
117
117
|
if (isFlattened) {
|
118
118
|
const styles2 = addStyles(attr.value), newFontFamily = (0, import_propsToFontFamilyCache.getFontFamilyClassNameFromProps)(attr.value) || "", newClassNames = helpers.concatClassName(
|
119
|
-
styles2.map((x) => x.
|
119
|
+
styles2.map((x) => x[helpers.StyleObjectIdentifier]).join(" ") + newFontFamily
|
120
120
|
), existing = finalClassNames.find(
|
121
121
|
(x) => x.type == "StringLiteral"
|
122
122
|
);
|
@@ -129,9 +129,12 @@ async function extractToClassNames({
|
|
129
129
|
const styles2 = getStylesAtomic(attr.value);
|
130
130
|
finalStyles = [...finalStyles, ...styles2];
|
131
131
|
for (const style of styles2) {
|
132
|
-
const prop = style.
|
132
|
+
const prop = style[helpers.StyleObjectPseudo] ? `${style[helpers.StyleObjectProperty]}-${style[helpers.StyleObjectPseudo]}` : style[helpers.StyleObjectProperty];
|
133
133
|
finalAttrs.push(
|
134
|
-
t.jsxAttribute(
|
134
|
+
t.jsxAttribute(
|
135
|
+
t.jsxIdentifier(prop),
|
136
|
+
t.stringLiteral(style[helpers.StyleObjectIdentifier])
|
137
|
+
)
|
135
138
|
);
|
136
139
|
}
|
137
140
|
}
|
@@ -174,9 +177,9 @@ async function extractToClassNames({
|
|
174
177
|
if (shouldPrintDebug && mediaExtraction && console.info(
|
175
178
|
"ternary (mediaStyles)",
|
176
179
|
mediaExtraction.ternaryWithoutMedia?.inlineMediaQuery ?? "",
|
177
|
-
mediaExtraction.mediaStyles.map((x) => x.
|
180
|
+
mediaExtraction.mediaStyles.map((x) => x[helpers.StyleObjectIdentifier]).join(".")
|
178
181
|
), !mediaExtraction) {
|
179
|
-
addTernaryStyle(
|
182
|
+
shouldPrintDebug && mediaExtraction && console.info("add ternary"), addTernaryStyle(
|
180
183
|
attr.value,
|
181
184
|
addStyles(attr.value.consequent),
|
182
185
|
addStyles(attr.value.alternate)
|
@@ -189,13 +192,15 @@ async function extractToClassNames({
|
|
189
192
|
[]
|
190
193
|
) : finalClassNames = [
|
191
194
|
...finalClassNames,
|
192
|
-
...mediaExtraction.mediaStyles.map(
|
195
|
+
...mediaExtraction.mediaStyles.map(
|
196
|
+
(x) => t.stringLiteral(x[helpers.StyleObjectIdentifier])
|
197
|
+
)
|
193
198
|
];
|
194
199
|
break;
|
195
200
|
}
|
196
201
|
}
|
197
202
|
function addTernaryStyle(ternary, a, b) {
|
198
|
-
const cCN = a.map((x) => x.
|
203
|
+
const cCN = a.map((x) => x[helpers.StyleObjectIdentifier]).join(" "), aCN = b.map((x) => x[helpers.StyleObjectIdentifier]).join(" ");
|
199
204
|
a.length && b.length ? finalClassNames.push(
|
200
205
|
t.conditionalExpression(
|
201
206
|
ternary.test,
|
@@ -210,11 +215,8 @@ async function extractToClassNames({
|
|
210
215
|
)
|
211
216
|
);
|
212
217
|
}
|
213
|
-
if (shouldPrintDebug && console.info(
|
214
|
-
|
215
|
-
`,
|
216
|
-
(0, import_logLines.logLines)(finalClassNames.map((x) => x.value).join(" "))
|
217
|
-
), node.attributes = finalAttrs, finalClassNames.length) {
|
218
|
+
if (shouldPrintDebug === "verbose" && console.info(` finalClassNames AST
|
219
|
+
`, JSON.stringify(finalClassNames, null, 2)), node.attributes = finalAttrs, finalClassNames.length) {
|
218
220
|
const extraClassNames = (() => {
|
219
221
|
let value = "";
|
220
222
|
return isFlattened && (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS && (value += "is_tamagui_flattened"), staticConfig.componentName && (value += ` is_${staticConfig.componentName}`)), value;
|
@@ -238,8 +240,8 @@ async function extractToClassNames({
|
|
238
240
|
lineNumbers,
|
239
241
|
originalNodeName
|
240
242
|
);
|
241
|
-
for (const
|
242
|
-
const className = `.${identifier}`;
|
243
|
+
for (const styleObject of finalStyles) {
|
244
|
+
const identifier = styleObject[helpers.StyleObjectIdentifier], rules = styleObject[helpers.StyleObjectRules], className = `.${identifier}`;
|
243
245
|
if (cssMap.has(className)) {
|
244
246
|
if (comment) {
|
245
247
|
const val = cssMap.get(className);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/extractToClassNames.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB,+BACtB,OAAsB,+BAEtB,mBAAqB,sCACrB,IAAmB,kCACnB,UAAyB,sCAGzB,4BAAmC,0CAEnC,oBAA2B,yBAC3B,wBAA+B,6BAE/B,+BAAsC,oCACtC,wBAA+B,6BAC/B,2BAAkC,gCAClC,yBAAgC,
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB,+BACtB,OAAsB,+BAEtB,mBAAqB,sCACrB,IAAmB,kCACnB,UAAyB,sCAGzB,4BAAmC,0CAEnC,oBAA2B,yBAC3B,wBAA+B,6BAE/B,+BAAsC,oCACtC,wBAA+B,6BAC/B,2BAAkC,gCAClC,yBAAgC,8BAEhC,gCAAgD,qCAChD,eAAsB,oBACtB,sBAA6B;AAE7B,MAAM,mBAAmB;AAAA,EACvB,eAAe;AAAA,EACf,cAAc;AAAA,EACd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/D,SAAS,GAAG,GAEL;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,OAAO;AAAA,IACX,KAAK,OAAO;AAAA,EACd;AACF;",
|
5
5
|
"names": ["res", "styles", "generate"]
|
6
6
|
}
|
@@ -26,7 +26,7 @@ __export(extractToClassNames_exports, {
|
|
26
26
|
extractToClassNames: () => extractToClassNames
|
27
27
|
});
|
28
28
|
module.exports = __toCommonJS(extractToClassNames_exports);
|
29
|
-
var path = __toESM(require("node:path")), util = __toESM(require("node:util")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), helpers = __toESM(require("@tamagui/helpers")), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_babelParse = require("./babelParse"), import_buildClassName = require("./buildClassName"), import_ensureImportingConcat = require("./ensureImportingConcat"), import_extractHelpers = require("./extractHelpers"), import_extractMediaStyle = require("./extractMediaStyle"), import_hoistClassNames = require("./hoistClassNames"),
|
29
|
+
var path = __toESM(require("node:path")), util = __toESM(require("node:util")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), helpers = __toESM(require("@tamagui/helpers")), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_babelParse = require("./babelParse"), import_buildClassName = require("./buildClassName"), import_ensureImportingConcat = require("./ensureImportingConcat"), import_extractHelpers = require("./extractHelpers"), import_extractMediaStyle = require("./extractMediaStyle"), import_hoistClassNames = require("./hoistClassNames"), import_propsToFontFamilyCache = require("./propsToFontFamilyCache"), import_timer = require("./timer"), import_createLogger = require("./createLogger");
|
30
30
|
function _array_like_to_array(arr, len) {
|
31
31
|
(len == null || len > arr.length) && (len = arr.length);
|
32
32
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
@@ -260,9 +260,9 @@ function _extractToClassNames() {
|
|
260
260
|
onExtractTag: function(param2) {
|
261
261
|
var parserProps = param2.parserProps, attrs = param2.attrs, node = param2.node, attemptEval = param2.attemptEval, jsxPath = param2.jsxPath, originalNodeName = param2.originalNodeName, filePath = param2.filePath, lineNumbers = param2.lineNumbers, programPath = param2.programPath, isFlattened = param2.isFlattened, staticConfig = param2.staticConfig, addTernaryStyle = function(ternary, a, b) {
|
262
262
|
var cCN = a.map(function(x) {
|
263
|
-
return x.
|
263
|
+
return x[helpers.StyleObjectIdentifier];
|
264
264
|
}).join(" "), aCN = b.map(function(x) {
|
265
|
-
return x.
|
265
|
+
return x[helpers.StyleObjectIdentifier];
|
266
266
|
}).join(" ");
|
267
267
|
a.length && b.length ? finalClassNames.push(t.conditionalExpression(ternary.test, t.stringLiteral(cCN), t.stringLiteral(aCN))) : finalClassNames.push(t.conditionalExpression(ternary.test, t.stringLiteral(" " + cCN), t.stringLiteral(" " + aCN)));
|
268
268
|
};
|
@@ -312,7 +312,7 @@ function _extractToClassNames() {
|
|
312
312
|
case "style": {
|
313
313
|
if (isFlattened) {
|
314
314
|
var styles1 = addStyles(attr1.value), newFontFamily = (0, import_propsToFontFamilyCache.getFontFamilyClassNameFromProps)(attr1.value) || "", newClassNames = helpers.concatClassName(styles1.map(function(x) {
|
315
|
-
return x.
|
315
|
+
return x[helpers.StyleObjectIdentifier];
|
316
316
|
}).join(" ") + newFontFamily), existing = finalClassNames.find(function(x) {
|
317
317
|
return x.type == "StringLiteral";
|
318
318
|
});
|
@@ -329,8 +329,8 @@ function _extractToClassNames() {
|
|
329
329
|
var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
330
330
|
try {
|
331
331
|
for (var _iterator2 = styles2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
332
|
-
var style = _step2.value, prop = style.
|
333
|
-
finalAttrs.push(t.jsxAttribute(t.jsxIdentifier(prop), t.stringLiteral(style.
|
332
|
+
var style = _step2.value, prop = style[helpers.StyleObjectPseudo] ? "".concat(style[helpers.StyleObjectProperty], "-").concat(style[helpers.StyleObjectPseudo]) : style[helpers.StyleObjectProperty];
|
333
|
+
finalAttrs.push(t.jsxAttribute(t.jsxIdentifier(prop), t.stringLiteral(style[helpers.StyleObjectIdentifier])));
|
334
334
|
}
|
335
335
|
} catch (err) {
|
336
336
|
_didIteratorError2 = !0, _iteratorError2 = err;
|
@@ -368,15 +368,15 @@ function _extractToClassNames() {
|
|
368
368
|
if (shouldPrintDebug && mediaExtraction) {
|
369
369
|
var _mediaExtraction_ternaryWithoutMedia, _mediaExtraction_ternaryWithoutMedia_inlineMediaQuery;
|
370
370
|
console.info("ternary (mediaStyles)", (_mediaExtraction_ternaryWithoutMedia_inlineMediaQuery = (_mediaExtraction_ternaryWithoutMedia = mediaExtraction.ternaryWithoutMedia) === null || _mediaExtraction_ternaryWithoutMedia === void 0 ? void 0 : _mediaExtraction_ternaryWithoutMedia.inlineMediaQuery) !== null && _mediaExtraction_ternaryWithoutMedia_inlineMediaQuery !== void 0 ? _mediaExtraction_ternaryWithoutMedia_inlineMediaQuery : "", mediaExtraction.mediaStyles.map(function(x) {
|
371
|
-
return x.
|
371
|
+
return x[helpers.StyleObjectIdentifier];
|
372
372
|
}).join("."));
|
373
373
|
}
|
374
374
|
if (!mediaExtraction) {
|
375
|
-
addTernaryStyle(attr1.value, addStyles(attr1.value.consequent), addStyles(attr1.value.alternate));
|
375
|
+
shouldPrintDebug && mediaExtraction && console.info("add ternary"), addTernaryStyle(attr1.value, addStyles(attr1.value.consequent), addStyles(attr1.value.alternate));
|
376
376
|
continue;
|
377
377
|
}
|
378
378
|
lastMediaImportance++, mediaExtraction.mediaStyles && (finalStyles = _to_consumable_array(finalStyles).concat(_to_consumable_array(mediaExtraction.mediaStyles))), mediaExtraction.ternaryWithoutMedia ? addTernaryStyle(mediaExtraction.ternaryWithoutMedia, mediaExtraction.mediaStyles, []) : finalClassNames = _to_consumable_array(finalClassNames).concat(_to_consumable_array(mediaExtraction.mediaStyles.map(function(x) {
|
379
|
-
return t.stringLiteral(x.
|
379
|
+
return t.stringLiteral(x[helpers.StyleObjectIdentifier]);
|
380
380
|
})));
|
381
381
|
break;
|
382
382
|
}
|
@@ -392,10 +392,8 @@ function _extractToClassNames() {
|
|
392
392
|
throw _iteratorError1;
|
393
393
|
}
|
394
394
|
}
|
395
|
-
if (shouldPrintDebug && console.info(` finalClassNames
|
396
|
-
`, (
|
397
|
-
return x.value;
|
398
|
-
}).join(" "))), node.attributes = finalAttrs, finalClassNames.length) {
|
395
|
+
if (shouldPrintDebug === "verbose" && console.info(` finalClassNames AST
|
396
|
+
`, JSON.stringify(finalClassNames, null, 2)), node.attributes = finalAttrs, finalClassNames.length) {
|
399
397
|
var extraClassNames = function() {
|
400
398
|
var value2 = "";
|
401
399
|
return isFlattened && (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS && (value2 += "is_tamagui_flattened"), staticConfig.componentName && (value2 += " is_".concat(staticConfig.componentName))), value2;
|
@@ -416,7 +414,7 @@ function _extractToClassNames() {
|
|
416
414
|
var comment = util.format("/* %s:%s (%s) */", filePath, lineNumbers, originalNodeName), _iteratorNormalCompletion3 = !0, _didIteratorError3 = !1, _iteratorError3 = void 0;
|
417
415
|
try {
|
418
416
|
for (var _iterator3 = finalStyles[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
|
419
|
-
var
|
417
|
+
var styleObject = _step3.value, identifier = styleObject[helpers.StyleObjectIdentifier], rules = styleObject[helpers.StyleObjectRules], className = ".".concat(identifier);
|
420
418
|
if (cssMap.has(className)) {
|
421
419
|
if (comment) {
|
422
420
|
var val1 = cssMap.get(className);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/extractToClassNames.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAsB,+BACtB,OAAsB,+BAEtB,mBAAqB,sCACrB,IAAmB,kCACnB,UAAyB,sCAGzB,4BAAmC,0CAEnC,oBAA2B,yBAC3B,wBAA+B,6BAE/B,+BAAsC,oCACtC,wBAA+B,6BAC/B,2BAAkC,gCAClC,yBAAgC,
|
5
|
-
"names": ["mergeStyleGroups", "shadowOpacity", "shadowRadius", "shadowColor", "shadowOffset", "extractToClassNames", "extractor", "source", "sourcePath", "options", "shouldPrintDebug", "tm", "getStylesAtomic", "printLog", "ast", "cssMap", "existingHoists", "hasFlattened", "res", "styles", "result", "timer", "requireTamaguiCore", "includes", "console", "warn", "Error", "path", "isAbsolute", "test", "slice", "disableExtraction", "loadTamagui", "createLogger", "babelParse", "err", "error", "mark", "Map", "parse", "platform", "extractStyledDefinitions", "onStyleRule", "identifier", "rules", "css", "join", "info", "set", "commentTexts", "getFlattenedNode", "param", "tag", "onExtractTag", "parserProps", "attrs", "node", "attemptEval", "jsxPath", "originalNodeName", "filePath", "lineNumbers", "programPath", "isFlattened", "staticConfig", "addTernaryStyle", "ternary", "a", "b", "cCN", "map", "x", "aCN", "length", "finalClassNames", "push", "t", "conditionalExpression", "stringLiteral", "acceptsClassName", "didFlattenThisTag", "finalAttrs", "finalStyles", "viewStyles", "attr", "type", "value", "ensureNeededPrevStyle", "style", "keys", "Object", "some", "key", "k", "addStyles", "styleWithPrev", "lastMediaImportance", "newFontFamily", "getFontFamilyClassNameFromProps", "newClassNames", "
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAsB,+BACtB,OAAsB,+BAEtB,mBAAqB,sCACrB,IAAmB,kCACnB,UAAyB,sCAGzB,4BAAmC,0CAEnC,oBAA2B,yBAC3B,wBAA+B,6BAE/B,+BAAsC,oCACtC,wBAA+B,6BAC/B,2BAAkC,gCAClC,yBAAgC,8BAEhC,gCAAgD,qCAChD,eAAsB,oBACtB,sBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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owRadius", "shadowColor", "shadowOffset", "extractToClassNames", "extractor", "source", "sourcePath", "options", "shouldPrintDebug", "tm", "getStylesAtomic", "printLog", "ast", "cssMap", "existingHoists", "hasFlattened", "res", "styles", "result", "timer", "requireTamaguiCore", "includes", "console", "warn", "Error", "path", "isAbsolute", "test", "slice", "disableExtraction", "loadTamagui", "createLogger", "babelParse", "err", "error", "mark", "Map", "parse", "platform", "extractStyledDefinitions", "onStyleRule", "identifier", "rules", "css", "join", "info", "set", "commentTexts", "getFlattenedNode", "param", "tag", "onExtractTag", "parserProps", "attrs", "node", "attemptEval", "jsxPath", "originalNodeName", "filePath", "lineNumbers", "programPath", "isFlattened", "staticConfig", "addTernaryStyle", "ternary", "a", "b", "cCN", "map", "x", "helpers", "StyleObjectIdentifier", "aCN", "length", "finalClassNames", "push", "t", "conditionalExpression", "stringLiteral", "acceptsClassName", "didFlattenThisTag", "finalAttrs", "finalStyles", "viewStyles", "attr", "type", "value", "ensureNeededPrevStyle", "style", "keys", "Object", "some", "key", "k", "addStyles", "styleWithPrev", "lastMediaImportance", "newFontFamily", "getFontFamilyClassNameFromProps", "newClassNames", "concatClassName", "existing", "find", "previous", "replace", "prop", "StyleObjectPseudo", "StyleObjectProperty", "jsxAttribute", "jsxIdentifier", "val", "isJSXSpreadAttribute", "isSimpleSpread", "logicalExpression", "argument", "memberExpression", "name", "evaluatedValue", "mediaExtraction", "extractMediaStyle", "getTamagui", "ternaryWithoutMedia", "inlineMediaQuery", "mediaStyles", "consequent", "alternate", "JSON", "stringify", "attributes", "extraClassNames", "process", "env", "TAMAGUI_DEBUG_OPTIMIZATIONS", "componentName", "names", "buildClassName", "nameExpr", "hoistClassNames", "expr", "isIdentifier", "ensureImportingConcat", "simpleSpreads", "filter", "callExpression", "jsxExpressionContainer", "comment", "util", "format", "styleObject", "StyleObjectRules", "className", "has", "get", "modified", "optimized", "flattened", "styled", "Array", "from", "values", "trim", "generate", "concise", "filename", "retainLines", "sourceFileName", "sourceMaps", "code", "split", "startsWith", "js"]
|
6
6
|
}
|
@@ -2,6 +2,10 @@ import { basename, relative } from "node:path";
|
|
2
2
|
import traverse from "@babel/traverse";
|
3
3
|
import * as t from "@babel/types";
|
4
4
|
import { Color, colorLog } from "@tamagui/cli-color";
|
5
|
+
import {
|
6
|
+
StyleObjectIdentifier,
|
7
|
+
StyleObjectRules
|
8
|
+
} from "@tamagui/web";
|
5
9
|
import * as reactNativeWebInternals from "react-native-web-internals";
|
6
10
|
import { FAILED_EVAL } from "../constants";
|
7
11
|
import { requireTamaguiCore } from "../helpers/requireTamaguiCore";
|
@@ -170,7 +174,10 @@ function createExtractor({ logger = console, platform = "web" } = { logger: cons
|
|
170
174
|
`
|
171
175
|
), console.info(" Got config:", tamaguiConfig), process.exit(0));
|
172
176
|
const firstThemeName = Object.keys(tamaguiConfig?.themes || {})[0], firstTheme = tamaguiConfig?.themes[firstThemeName] || {};
|
173
|
-
(!firstTheme || typeof firstTheme != "object")
|
177
|
+
if (!firstTheme || typeof firstTheme != "object") {
|
178
|
+
const err = `Missing theme ${firstThemeName}, an error occurred when importing your config`;
|
179
|
+
throw console.info(err, "Got config:", tamaguiConfig), console.info("Looking for theme:", firstThemeName), new Error(err);
|
180
|
+
}
|
174
181
|
const proxiedTheme = proxyThemeVariables(firstTheme), themeAccessListeners = /* @__PURE__ */ new Set(), defaultTheme = new Proxy(proxiedTheme, {
|
175
182
|
get(target, key) {
|
176
183
|
return Reflect.has(target, key) && themeAccessListeners.forEach((cb) => cb(String(key))), Reflect.get(target, key);
|
@@ -351,7 +358,7 @@ function createExtractor({ logger = console, platform = "web" } = { logger: cons
|
|
351
358
|
JSON.stringify(classNames, null, 2),
|
352
359
|
`
|
353
360
|
rulesToInsert:`,
|
354
|
-
out.rulesToInsert.flatMap((
|
361
|
+
out.rulesToInsert.flatMap((styleObject) => styleObject[StyleObjectRules]).join(`
|
355
362
|
`)
|
356
363
|
].join(" ")
|
357
364
|
), definition.properties = definition.properties.map((prop) => {
|
@@ -360,14 +367,17 @@ function createExtractor({ logger = console, platform = "web" } = { logger: cons
|
|
360
367
|
const key = prop.key.name, value = classNames[key];
|
361
368
|
return value ? t.objectProperty(t.stringLiteral(key), t.stringLiteral(value)) : prop;
|
362
369
|
}), out.rulesToInsert)
|
363
|
-
for (const
|
364
|
-
onStyleRule?.(
|
370
|
+
for (const styleObject of out.rulesToInsert)
|
371
|
+
onStyleRule?.(
|
372
|
+
styleObject[StyleObjectIdentifier],
|
373
|
+
styleObject[StyleObjectRules]
|
374
|
+
);
|
365
375
|
res.styled++, shouldPrintDebug && logger.info(`Extracted styled(${variableName})`);
|
366
376
|
},
|
367
377
|
JSXElement(traversePath) {
|
368
378
|
tm.mark("jsx-element", !!shouldPrintDebug);
|
369
379
|
const node = traversePath.node.openingElement, ogAttributes = node.attributes.map((attr) => ({ ...attr })), componentName = findComponentName(traversePath.scope), closingElement = traversePath.node.closingElement;
|
370
|
-
if (
|
380
|
+
if (closingElement && t.isJSXMemberExpression(closingElement?.name) || !t.isJSXIdentifier(node.name)) {
|
371
381
|
shouldPrintDebug && logger.info(" skip non-identifier element");
|
372
382
|
return;
|
373
383
|
}
|
@@ -375,13 +385,16 @@ function createExtractor({ logger = console, platform = "web" } = { logger: cons
|
|
375
385
|
let moduleName = "";
|
376
386
|
if (binding && t.isImportDeclaration(binding.path.parent) && (moduleName = binding.path.parent.source.value, !isValidImport(propsWithFileInfo, moduleName, binding.identifier.name))) {
|
377
387
|
shouldPrintDebug && logger.info(
|
378
|
-
` - Binding
|
388
|
+
` - Binding in component ${componentName} not valid import: "${binding.identifier.name}" isn't in ${moduleName}
|
389
|
+
`
|
379
390
|
);
|
380
391
|
return;
|
381
392
|
}
|
382
393
|
const component = getValidComponent(propsWithFileInfo, moduleName, node.name.name);
|
383
394
|
if (!component || !component.staticConfig) {
|
384
|
-
shouldPrintDebug && logger.info(`
|
395
|
+
shouldPrintDebug && logger.info(`
|
396
|
+
- No Tamagui conf for: ${node.name.name}
|
397
|
+
`);
|
385
398
|
return;
|
386
399
|
}
|
387
400
|
const originalNodeName = node.name.name;
|
@@ -389,9 +402,8 @@ function createExtractor({ logger = console, platform = "web" } = { logger: cons
|
|
389
402
|
const filePath = `./${relative(process.cwd(), sourcePath)}`, lineNumbers = node.loc ? node.loc.start.line + (node.loc.start.line !== node.loc.end.line ? `-${node.loc.end.line}` : "") : "", codePosition = `${filePath}:${lineNumbers}`, debugPropValue = node.attributes.filter(
|
390
403
|
(n) => t.isJSXAttribute(n) && t.isJSXIdentifier(n.name) && n.name.name === "debug"
|
391
404
|
).map((n) => n.value === null ? !0 : t.isStringLiteral(n.value) ? n.value.value : !1)[0];
|
392
|
-
if (debugPropValue && (shouldPrintDebug = debugPropValue), shouldPrintDebug && (logger.info(
|
393
|
-
|
394
|
-
`\x1B[33m%s\x1B[0m ${componentName} | ${codePosition} -------------------`
|
405
|
+
if (debugPropValue && (shouldPrintDebug = debugPropValue), shouldPrintDebug && (logger.info(
|
406
|
+
`\x1B[33m\x1B[0m ${componentName} | ${codePosition} -------------------`
|
395
407
|
), logger.info(
|
396
408
|
[
|
397
409
|
"\x1B[1m",
|
@@ -409,7 +421,8 @@ function createExtractor({ logger = console, platform = "web" } = { logger: cons
|
|
409
421
|
t.stringLiteral(`${basename(filePath)}:${lineNumbers}`)
|
410
422
|
)
|
411
423
|
)), shouldDisableExtraction) {
|
412
|
-
shouldPrintDebug === "verbose" &&
|
424
|
+
shouldPrintDebug === "verbose" && logger.info(` \u274C Extraction disabled: ${JSON.stringify(disableExtraction)}
|
425
|
+
`);
|
413
426
|
return;
|
414
427
|
}
|
415
428
|
try {
|