@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
@@ -61,7 +61,7 @@ export function extractMediaStyle(
|
|
61
61
|
true,
|
62
62
|
negate
|
63
63
|
)
|
64
|
-
const className = `.${mediaStyle.
|
64
|
+
const className = `.${mediaStyle[core.StyleObjectIdentifier]}`
|
65
65
|
return {
|
66
66
|
...mediaStyle,
|
67
67
|
className,
|
@@ -73,7 +73,7 @@ export function extractMediaStyle(
|
|
73
73
|
' media styles:',
|
74
74
|
importance,
|
75
75
|
styleObj,
|
76
|
-
singleMediaStyles.map((x) => x.
|
76
|
+
singleMediaStyles.map((x) => x[core.StyleObjectIdentifier]).join(', ')
|
77
77
|
)
|
78
78
|
}
|
79
79
|
// add to output
|
@@ -190,18 +190,24 @@ export async function extractToClassNames({
|
|
190
190
|
|
191
191
|
for (const style of styles) {
|
192
192
|
// leave them as attributes
|
193
|
-
const prop = style.
|
194
|
-
? `${style.
|
195
|
-
|
193
|
+
const prop = style[helpers.StyleObjectPseudo]
|
194
|
+
? `${style[helpers.StyleObjectProperty]}-${
|
195
|
+
style[helpers.StyleObjectPseudo]
|
196
|
+
}`
|
197
|
+
: style[helpers.StyleObjectProperty]
|
196
198
|
finalAttrs.push(
|
197
|
-
t.jsxAttribute(
|
199
|
+
t.jsxAttribute(
|
200
|
+
t.jsxIdentifier(prop),
|
201
|
+
t.stringLiteral(style[helpers.StyleObjectIdentifier])
|
202
|
+
)
|
198
203
|
)
|
199
204
|
}
|
200
205
|
} else {
|
201
206
|
const styles = addStyles(attr.value)
|
202
207
|
const newFontFamily = getFontFamilyClassNameFromProps(attr.value) || ''
|
203
208
|
const newClassNames = helpers.concatClassName(
|
204
|
-
styles.map((x) => x.
|
209
|
+
styles.map((x) => x[helpers.StyleObjectIdentifier]).join(' ') +
|
210
|
+
newFontFamily
|
205
211
|
)
|
206
212
|
const existing = finalClassNames.find(
|
207
213
|
(x) => x.type == 'StringLiteral'
|
@@ -266,11 +272,18 @@ export async function extractToClassNames({
|
|
266
272
|
console.info(
|
267
273
|
'ternary (mediaStyles)',
|
268
274
|
mediaExtraction.ternaryWithoutMedia?.inlineMediaQuery ?? '',
|
269
|
-
mediaExtraction.mediaStyles
|
275
|
+
mediaExtraction.mediaStyles
|
276
|
+
.map((x) => x[helpers.StyleObjectIdentifier])
|
277
|
+
.join('.')
|
270
278
|
)
|
271
279
|
}
|
272
280
|
}
|
273
281
|
if (!mediaExtraction) {
|
282
|
+
if (shouldPrintDebug) {
|
283
|
+
if (mediaExtraction) {
|
284
|
+
console.info('add ternary')
|
285
|
+
}
|
286
|
+
}
|
274
287
|
addTernaryStyle(
|
275
288
|
attr.value,
|
276
289
|
addStyles(attr.value.consequent),
|
@@ -291,7 +304,9 @@ export async function extractToClassNames({
|
|
291
304
|
} else {
|
292
305
|
finalClassNames = [
|
293
306
|
...finalClassNames,
|
294
|
-
...mediaExtraction.mediaStyles.map((x) =>
|
307
|
+
...mediaExtraction.mediaStyles.map((x) =>
|
308
|
+
t.stringLiteral(x[helpers.StyleObjectIdentifier])
|
309
|
+
),
|
295
310
|
]
|
296
311
|
}
|
297
312
|
break
|
@@ -299,9 +314,9 @@ export async function extractToClassNames({
|
|
299
314
|
}
|
300
315
|
}
|
301
316
|
|
302
|
-
function addTernaryStyle(ternary: Ternary, a:
|
303
|
-
const cCN = a.map((x) => x.
|
304
|
-
const aCN = b.map((x) => x.
|
317
|
+
function addTernaryStyle(ternary: Ternary, a: StyleObject[], b: StyleObject[]) {
|
318
|
+
const cCN = a.map((x) => x[helpers.StyleObjectIdentifier]).join(' ')
|
319
|
+
const aCN = b.map((x) => x[helpers.StyleObjectIdentifier]).join(' ')
|
305
320
|
|
306
321
|
if (a.length && b.length) {
|
307
322
|
finalClassNames.push(
|
@@ -322,11 +337,8 @@ export async function extractToClassNames({
|
|
322
337
|
}
|
323
338
|
}
|
324
339
|
|
325
|
-
if (shouldPrintDebug) {
|
326
|
-
console.info(
|
327
|
-
' finalClassNames\n',
|
328
|
-
logLines(finalClassNames.map((x) => x['value']).join(' '))
|
329
|
-
)
|
340
|
+
if (shouldPrintDebug === 'verbose') {
|
341
|
+
console.info(' finalClassNames AST\n', JSON.stringify(finalClassNames, null, 2))
|
330
342
|
}
|
331
343
|
|
332
344
|
node.attributes = finalAttrs
|
@@ -389,7 +401,9 @@ export async function extractToClassNames({
|
|
389
401
|
originalNodeName
|
390
402
|
)
|
391
403
|
|
392
|
-
for (const
|
404
|
+
for (const styleObject of finalStyles) {
|
405
|
+
const identifier = styleObject[helpers.StyleObjectIdentifier]
|
406
|
+
const rules = styleObject[helpers.StyleObjectRules]
|
393
407
|
const className = `.${identifier}`
|
394
408
|
if (cssMap.has(className)) {
|
395
409
|
if (comment) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"babelParse.d.ts","sourceRoot":"","sources":["../../src/extractor/babelParse.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"babelParse.d.ts","sourceRoot":"","sources":["../../src/extractor/babelParse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAA;AAiBtC,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,aAGtC,CAAA;AAIF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,CAW3E"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createEvaluator.d.ts","sourceRoot":"","sources":["../../src/extractor/createEvaluator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAG1D,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,0BAA0B,CAAA;IACjC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACrC,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,OAoBY,
|
1
|
+
{"version":3,"file":"createEvaluator.d.ts","sourceRoot":"","sources":["../../src/extractor/createEvaluator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAG1D,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,0BAA0B,CAAA;IACjC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACrC,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,OAoBY,CAAC,CAAC,IAAI,SAGlB;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,OACtD,CAAC,CAAC,IAAI,SAOlB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;
|
1
|
+
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAgBjC,OAAO,KAAK,EAGV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAGf,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAcxD,OAAO,EAAE,iBAAiB,EAA6B,MAAM,6BAA6B,CAAA;AAuB1F,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAE1D,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAQ9C,wBAAgB,eAAe,CAC7B,EAAE,MAAgB,EAAE,QAAgB,EAAE,GAAE,gBAAsC;;;;;yBAwDnD,cAAc;6BAPhB,cAAc;;mBAwBtB,UAAU,SAAS,mBAAmB;;;;;;;eAIpC,UAAU,SAAS,mBAAmB;;;;;;;EAwtE1D"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAKjC,OAAO,KAAK,EAAgC,cAAc,EAAW,MAAM,UAAU,CAAA;AAGrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAiBlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAA;IACX,GAAG,EAAE,GAAG,CAAA;CACT,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,CAAA;AAED,wBAAsB,mBAAmB,CAAC,EACxC,SAAS,EACT,MAAM,EACN,UAAe,EACf,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAia9D"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getStaticBindingsForScope.d.ts","sourceRoot":"","sources":["../../src/extractor/getStaticBindingsForScope.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAuCjC,wBAAgB,iBAAiB,SAQhC;AAyCD,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EACtC,SAAS,
|
1
|
+
{"version":3,"file":"getStaticBindingsForScope.d.ts","sourceRoot":"","sources":["../../src/extractor/getStaticBindingsForScope.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAuCjC,wBAAgB,iBAAiB,SAQhC;AAyCD,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EACtC,SAAS,EAAE,MAAM,EAAE,YAAK,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAC3C,gBAAgB,EAAE,OAAO,GAAG,SAAS,GACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAsI9B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAUxF,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,gBAAgB,CAAA;AAgBvB,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAmDpC;AAMD,eAAO,MAAM,oBAAoB,YAAmB,cAAc,mCAsBjE,CAAA;AAKD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,
|
1
|
+
{"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAUxF,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,gBAAgB,CAAA;AAgBvB,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAmDpC;AAMD,eAAO,MAAM,oBAAoB,YAAmB,cAAc,mCAsBjE,CAAA;AAKD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,GA2B9C,cAAc,CACpB;AAGD,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,GAAG,OAAO,EACX,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,kBAAkB,CAiIrB;AAED,wBAAsB,UAAU,CAAC,EAC/B,IAAoB,EACpB,YAA8B,EAC9B,cAAc,EACd,IAAI,EACJ,KAAK,GACN,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8B5D;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,UAW5D;AA0BD,YAAY,EAAE,kBAAkB,EAAE,CAAA;AAElC,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,uBAoC3E"}
|