@tamagui/static 1.135.3 → 1.135.4-1761749240853
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/check-dep-versions.mjs +268 -0
- package/dist/check-dep-versions.mjs.map +1 -0
- package/dist/checkDeps.mjs +33 -0
- package/dist/checkDeps.mjs.map +1 -0
- package/dist/constants.mjs +50 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/exports.mjs +42 -0
- package/dist/exports.mjs.map +1 -0
- package/dist/extractor/accessSafe.mjs +47 -0
- package/dist/extractor/accessSafe.mjs.map +1 -0
- package/dist/extractor/babelParse.mjs +55 -0
- package/dist/extractor/babelParse.mjs.map +1 -0
- package/dist/extractor/bundle.mjs +149 -0
- package/dist/extractor/bundle.mjs.map +1 -0
- package/dist/extractor/bundleConfig.mjs +331 -0
- package/dist/extractor/bundleConfig.mjs.map +1 -0
- package/dist/extractor/concatClassName.mjs +79 -0
- package/dist/extractor/concatClassName.mjs.map +1 -0
- package/dist/extractor/createEvaluator.mjs +76 -0
- package/dist/extractor/createEvaluator.mjs.map +1 -0
- package/dist/extractor/createExtractor.mjs +976 -0
- package/dist/extractor/createExtractor.mjs.map +1 -0
- package/dist/extractor/createLogger.mjs +46 -0
- package/dist/extractor/createLogger.mjs.map +1 -0
- package/dist/extractor/errors.mjs +27 -0
- package/dist/extractor/errors.mjs.map +1 -0
- package/dist/extractor/esbuildAliasPlugin.mjs +45 -0
- package/dist/extractor/esbuildAliasPlugin.mjs.map +1 -0
- package/dist/extractor/esbuildTsconfigPaths.mjs +85 -0
- package/dist/extractor/esbuildTsconfigPaths.mjs.map +1 -0
- package/dist/extractor/evaluateAstNode.mjs +84 -0
- package/dist/extractor/evaluateAstNode.mjs.map +1 -0
- package/dist/extractor/extractHelpers.mjs +121 -0
- package/dist/extractor/extractHelpers.mjs.map +1 -0
- package/dist/extractor/extractMediaStyle.mjs +129 -0
- package/dist/extractor/extractMediaStyle.mjs.map +1 -0
- package/dist/extractor/extractToClassNames.mjs +304 -0
- package/dist/extractor/extractToClassNames.mjs.map +1 -0
- package/dist/extractor/extractToNative.mjs +262 -0
- package/dist/extractor/extractToNative.mjs.map +1 -0
- package/dist/extractor/findTopmostFunction.mjs +35 -0
- package/dist/extractor/findTopmostFunction.mjs.map +1 -0
- package/dist/extractor/{generatedUid.native.js → generatedUid.mjs} +26 -23
- package/dist/extractor/generatedUid.mjs.map +1 -0
- package/dist/extractor/getPrefixLogs.mjs +30 -0
- package/dist/extractor/getPrefixLogs.mjs.map +1 -0
- package/dist/extractor/getPropValueFromAttributes.mjs +68 -0
- package/dist/extractor/getPropValueFromAttributes.mjs.map +1 -0
- package/dist/extractor/getSourceModule.mjs +65 -0
- package/dist/extractor/getSourceModule.mjs.map +1 -0
- package/dist/extractor/getStaticBindingsForScope.mjs +149 -0
- package/dist/extractor/getStaticBindingsForScope.mjs.map +1 -0
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.mjs +36 -0
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.mjs.map +1 -0
- package/dist/extractor/literalToAst.mjs +85 -0
- package/dist/extractor/literalToAst.mjs.map +1 -0
- package/dist/extractor/loadFile.mjs +12 -0
- package/dist/extractor/loadFile.mjs.map +1 -0
- package/dist/extractor/loadTamagui.mjs +296 -0
- package/dist/extractor/loadTamagui.mjs.map +1 -0
- package/dist/extractor/logLines.mjs +36 -0
- package/dist/extractor/logLines.mjs.map +1 -0
- package/dist/extractor/{normalizeTernaries.native.js → normalizeTernaries.mjs} +45 -31
- package/dist/extractor/normalizeTernaries.mjs.map +1 -0
- package/dist/extractor/propsToFontFamilyCache.mjs +39 -0
- package/dist/extractor/propsToFontFamilyCache.mjs.map +1 -0
- package/dist/extractor/regenerateConfig.mjs +145 -0
- package/dist/extractor/regenerateConfig.mjs.map +1 -0
- package/dist/extractor/removeUnusedHooks.mjs +77 -0
- package/dist/extractor/removeUnusedHooks.mjs.map +1 -0
- package/dist/extractor/timer.mjs +44 -0
- package/dist/extractor/timer.mjs.map +1 -0
- package/dist/extractor/{validHTMLAttributes.native.js → validHTMLAttributes.mjs} +17 -16
- package/dist/extractor/validHTMLAttributes.mjs.map +1 -0
- package/dist/extractor/watchTamaguiConfig.mjs +59 -0
- package/dist/extractor/watchTamaguiConfig.mjs.map +1 -0
- package/dist/getPragmaOptions.mjs +55 -0
- package/dist/getPragmaOptions.mjs.map +1 -0
- package/dist/helpers/memoize.mjs +38 -0
- package/dist/helpers/memoize.mjs.map +1 -0
- package/dist/helpers/requireTamaguiCore.mjs +34 -0
- package/dist/helpers/requireTamaguiCore.mjs.map +1 -0
- package/dist/index.mjs +41 -0
- package/dist/index.mjs.map +1 -0
- package/dist/registerRequire.mjs +107 -0
- package/dist/registerRequire.mjs.map +1 -0
- package/dist/server.mjs +76 -0
- package/dist/server.mjs.map +1 -0
- package/dist/setup.mjs +2 -0
- package/dist/setup.mjs.map +1 -0
- package/dist/{types.native.js → types.mjs} +8 -6
- package/dist/types.mjs.map +1 -0
- package/package.json +19 -21
- package/dist/check-dep-versions.native.js +0 -602
- package/dist/check-dep-versions.native.js.map +0 -6
- package/dist/checkDeps.native.js +0 -34
- package/dist/checkDeps.native.js.map +0 -6
- package/dist/constants.native.js +0 -45
- package/dist/constants.native.js.map +0 -6
- package/dist/exports.native.js +0 -52
- package/dist/exports.native.js.map +0 -6
- package/dist/extractor/accessSafe.native.js +0 -48
- package/dist/extractor/accessSafe.native.js.map +0 -6
- package/dist/extractor/babelParse.native.js +0 -62
- package/dist/extractor/babelParse.native.js.map +0 -6
- package/dist/extractor/bundle.native.js +0 -168
- package/dist/extractor/bundle.native.js.map +0 -6
- package/dist/extractor/bundleConfig.native.js +0 -394
- package/dist/extractor/bundleConfig.native.js.map +0 -6
- package/dist/extractor/concatClassName.native.js +0 -69
- package/dist/extractor/concatClassName.native.js.map +0 -6
- package/dist/extractor/createEvaluator.native.js +0 -63
- package/dist/extractor/createEvaluator.native.js.map +0 -6
- package/dist/extractor/createExtractor.native.js +0 -1229
- package/dist/extractor/createExtractor.native.js.map +0 -6
- package/dist/extractor/createLogger.native.js +0 -35
- package/dist/extractor/createLogger.native.js.map +0 -6
- package/dist/extractor/errors.native.js +0 -119
- package/dist/extractor/errors.native.js.map +0 -6
- package/dist/extractor/esbuildAliasPlugin.native.js +0 -52
- package/dist/extractor/esbuildAliasPlugin.native.js.map +0 -6
- package/dist/extractor/esbuildTsconfigPaths.native.js +0 -79
- package/dist/extractor/esbuildTsconfigPaths.native.js.map +0 -6
- package/dist/extractor/evaluateAstNode.native.js +0 -98
- package/dist/extractor/evaluateAstNode.native.js.map +0 -6
- package/dist/extractor/extractHelpers.native.js +0 -183
- package/dist/extractor/extractHelpers.native.js.map +0 -6
- package/dist/extractor/extractMediaStyle.native.js +0 -138
- package/dist/extractor/extractMediaStyle.native.js.map +0 -6
- package/dist/extractor/extractToClassNames.native.js +0 -332
- package/dist/extractor/extractToClassNames.native.js.map +0 -6
- package/dist/extractor/extractToNative.native.js +0 -276
- package/dist/extractor/extractToNative.native.js.map +0 -6
- package/dist/extractor/findTopmostFunction.native.js +0 -37
- package/dist/extractor/findTopmostFunction.native.js.map +0 -6
- package/dist/extractor/generatedUid.native.js.map +0 -6
- package/dist/extractor/getPrefixLogs.native.js +0 -30
- package/dist/extractor/getPrefixLogs.native.js.map +0 -6
- package/dist/extractor/getPropValueFromAttributes.native.js +0 -68
- package/dist/extractor/getPropValueFromAttributes.native.js.map +0 -6
- package/dist/extractor/getSourceModule.native.js +0 -80
- package/dist/extractor/getSourceModule.native.js.map +0 -6
- package/dist/extractor/getStaticBindingsForScope.native.js +0 -183
- package/dist/extractor/getStaticBindingsForScope.native.js.map +0 -6
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.native.js +0 -37
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +0 -6
- package/dist/extractor/literalToAst.native.js +0 -106
- package/dist/extractor/literalToAst.native.js.map +0 -6
- package/dist/extractor/loadFile.native.js +0 -21
- package/dist/extractor/loadFile.native.js.map +0 -6
- package/dist/extractor/loadTamagui.native.js +0 -314
- package/dist/extractor/loadTamagui.native.js.map +0 -6
- package/dist/extractor/logLines.native.js +0 -53
- package/dist/extractor/logLines.native.js.map +0 -6
- package/dist/extractor/normalizeTernaries.native.js.map +0 -6
- package/dist/extractor/propsToFontFamilyCache.native.js +0 -40
- package/dist/extractor/propsToFontFamilyCache.native.js.map +0 -6
- package/dist/extractor/regenerateConfig.native.js +0 -148
- package/dist/extractor/regenerateConfig.native.js.map +0 -6
- package/dist/extractor/removeUnusedHooks.native.js +0 -111
- package/dist/extractor/removeUnusedHooks.native.js.map +0 -6
- package/dist/extractor/timer.native.js +0 -44
- package/dist/extractor/timer.native.js.map +0 -6
- package/dist/extractor/validHTMLAttributes.native.js.map +0 -6
- package/dist/extractor/watchTamaguiConfig.native.js +0 -60
- package/dist/extractor/watchTamaguiConfig.native.js.map +0 -6
- package/dist/getPragmaOptions.native.js +0 -62
- package/dist/getPragmaOptions.native.js.map +0 -6
- package/dist/helpers/memoize.native.js +0 -40
- package/dist/helpers/memoize.native.js.map +0 -6
- package/dist/helpers/requireTamaguiCore.native.js +0 -34
- package/dist/helpers/requireTamaguiCore.native.js.map +0 -6
- package/dist/index.native.js +0 -35
- package/dist/index.native.js.map +0 -6
- package/dist/registerRequire.native.js +0 -124
- package/dist/registerRequire.native.js.map +0 -6
- package/dist/server.native.js +0 -70
- package/dist/server.native.js.map +0 -6
- package/dist/setup.native.js +0 -2
- package/dist/setup.native.js.map +0 -6
- package/dist/types.native.js.map +0 -6
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var extractMediaStyle_exports = {};
|
|
33
|
+
__export(extractMediaStyle_exports, {
|
|
34
|
+
extractMediaStyle: () => extractMediaStyle,
|
|
35
|
+
isValidMediaCall: () => isValidMediaCall
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(extractMediaStyle_exports);
|
|
38
|
+
var t = __toESM(require("@babel/types")),
|
|
39
|
+
core = __toESM(require("@tamagui/core")),
|
|
40
|
+
import_requireTamaguiCore = require("../helpers/requireTamaguiCore.mjs"),
|
|
41
|
+
import_extractHelpers = require("./extractHelpers.mjs");
|
|
42
|
+
function extractMediaStyle(props, ternary, jsxPath, tamaguiConfig, sourcePath, importance = 0, shouldPrintDebug = !1) {
|
|
43
|
+
const {
|
|
44
|
+
getCSSStylesAtomic
|
|
45
|
+
} = (0, import_requireTamaguiCore.requireTamaguiCore)("web"),
|
|
46
|
+
mt = getMediaQueryTernary(props, ternary, jsxPath, sourcePath);
|
|
47
|
+
if (!mt) return null;
|
|
48
|
+
const {
|
|
49
|
+
key
|
|
50
|
+
} = mt;
|
|
51
|
+
if (!tamaguiConfig.media[key]) return console.error(`Media query "${key}" not found: ${Object.keys(tamaguiConfig.media)}`), null;
|
|
52
|
+
const getStyleObj = (styleObj, negate = !1) => styleObj ? {
|
|
53
|
+
styleObj,
|
|
54
|
+
negate
|
|
55
|
+
} : null,
|
|
56
|
+
styleOpts = [getStyleObj(ternary.consequent, !1), getStyleObj(ternary.alternate, !0)].filter(import_extractHelpers.isPresent);
|
|
57
|
+
if (shouldPrintDebug && !styleOpts.length) return console.info(" media query, no styles?"), null;
|
|
58
|
+
const mediaKeyPrecendence = Object.keys(tamaguiConfig.media).reduce((acc, cur, i) => (acc[cur] = new Array(importance + 1).fill(":root").join(""), acc), {});
|
|
59
|
+
let mediaStyles = [];
|
|
60
|
+
for (const {
|
|
61
|
+
styleObj,
|
|
62
|
+
negate
|
|
63
|
+
} of styleOpts) {
|
|
64
|
+
const singleMediaStyles = getCSSStylesAtomic(styleObj).map(style => {
|
|
65
|
+
const mediaStyle = core.createMediaStyle(style, key, tamaguiConfig.media, !0, negate),
|
|
66
|
+
className = `.${mediaStyle[core.StyleObjectIdentifier]}`;
|
|
67
|
+
return {
|
|
68
|
+
...mediaStyle,
|
|
69
|
+
className
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
shouldPrintDebug === "verbose" && console.info(" media styles:", importance, styleObj, singleMediaStyles.map(x => x[core.StyleObjectIdentifier]).join(", ")), mediaStyles = [...mediaStyles, ...singleMediaStyles];
|
|
73
|
+
}
|
|
74
|
+
return ternary.remove(), {
|
|
75
|
+
mediaStyles,
|
|
76
|
+
ternaryWithoutMedia: mt.ternaryWithoutMedia
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function getMediaQueryTernary(props, ternary, jsxPath, sourcePath) {
|
|
80
|
+
if (t.isLogicalExpression(ternary.test) && ternary.test.operator === "&&") {
|
|
81
|
+
const mediaLeft = getMediaInfoFromExpression(props, ternary.test.left, jsxPath, sourcePath, ternary.inlineMediaQuery);
|
|
82
|
+
if (mediaLeft) return {
|
|
83
|
+
...mediaLeft,
|
|
84
|
+
ternaryWithoutMedia: {
|
|
85
|
+
...ternary,
|
|
86
|
+
test: ternary.test.right
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const result = getMediaInfoFromExpression(props, ternary.test, jsxPath, sourcePath, ternary.inlineMediaQuery);
|
|
91
|
+
return result ? {
|
|
92
|
+
...result,
|
|
93
|
+
ternaryWithoutMedia: null
|
|
94
|
+
} : null;
|
|
95
|
+
}
|
|
96
|
+
function getMediaInfoFromExpression(props, test, jsxPath, sourcePath, inlineMediaQuery) {
|
|
97
|
+
if (inlineMediaQuery) return {
|
|
98
|
+
key: inlineMediaQuery,
|
|
99
|
+
bindingName: inlineMediaQuery
|
|
100
|
+
};
|
|
101
|
+
if (t.isMemberExpression(test) && t.isIdentifier(test.object) && t.isIdentifier(test.property)) {
|
|
102
|
+
const name = test.object.name,
|
|
103
|
+
key = test.property.name,
|
|
104
|
+
binding = jsxPath.scope.getAllBindings()[name];
|
|
105
|
+
if (!binding) return !1;
|
|
106
|
+
const bindingNode = binding.path?.node;
|
|
107
|
+
return !t.isVariableDeclarator(bindingNode) || !bindingNode.init || !isValidMediaCall(props, jsxPath, bindingNode.init, sourcePath) ? !1 : {
|
|
108
|
+
key,
|
|
109
|
+
bindingName: name
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (t.isIdentifier(test)) {
|
|
113
|
+
const key = test.name,
|
|
114
|
+
node = jsxPath.scope.getBinding(test.name)?.path?.node;
|
|
115
|
+
return !t.isVariableDeclarator(node) || !node.init || !isValidMediaCall(props, jsxPath, node.init, sourcePath) ? !1 : {
|
|
116
|
+
key,
|
|
117
|
+
bindingName: key
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
function isValidMediaCall(props, jsxPath, init, sourcePath) {
|
|
123
|
+
if (!init || !t.isCallExpression(init) || !t.isIdentifier(init.callee) || init.callee.name !== "useMedia") return !1;
|
|
124
|
+
const mediaBinding = jsxPath.scope.getAllBindings().useMedia;
|
|
125
|
+
if (!mediaBinding) return !1;
|
|
126
|
+
const useMediaImport = mediaBinding.path.parent;
|
|
127
|
+
return !(!t.isImportDeclaration(useMediaImport) || !(0, import_extractHelpers.isValidImport)(props, sourcePath));
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=extractMediaStyle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["extractMediaStyle_exports","__export","extractMediaStyle","isValidMediaCall","module","exports","__toCommonJS","t","__toESM","require","core","import_requireTamaguiCore","import_extractHelpers","props","ternary","jsxPath","tamaguiConfig","sourcePath","importance","shouldPrintDebug","getCSSStylesAtomic","requireTamaguiCore","mt","getMediaQueryTernary","key","media","console","error","Object","keys","getStyleObj","styleObj","negate","styleOpts","consequent","alternate","filter","isPresent","length","info","mediaKeyPrecendence","reduce","acc","cur","i","Array","fill","join","mediaStyles","singleMediaStyles","map","style","mediaStyle","createMediaStyle","className","StyleObjectIdentifier","x","remove","ternaryWithoutMedia","isLogicalExpression","test","operator","mediaLeft","getMediaInfoFromExpression","left","inlineMediaQuery","right","result","bindingName","isMemberExpression","isIdentifier","object","property","name","binding","scope","getAllBindings","bindingNode","path","node","isVariableDeclarator","init","getBinding","isCallExpression","callee","mediaBinding","useMedia","useMediaImport","parent","isImportDeclaration","isValidImport"],"sources":["../../src/extractor/extractMediaStyle.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;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oreList":[]}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var extractToClassNames_exports = {};
|
|
33
|
+
__export(extractToClassNames_exports, {
|
|
34
|
+
extractToClassNames: () => extractToClassNames
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(extractToClassNames_exports);
|
|
37
|
+
var import_generator = __toESM(require("@babel/generator")),
|
|
38
|
+
t = __toESM(require("@babel/types")),
|
|
39
|
+
import_web = require("@tamagui/web"),
|
|
40
|
+
path = __toESM(require("node:path")),
|
|
41
|
+
util = __toESM(require("node:util")),
|
|
42
|
+
import_requireTamaguiCore = require("../helpers/requireTamaguiCore.mjs"),
|
|
43
|
+
import_babelParse = require("./babelParse.mjs"),
|
|
44
|
+
import_createLogger = require("./createLogger.mjs"),
|
|
45
|
+
import_extractMediaStyle = require("./extractMediaStyle.mjs"),
|
|
46
|
+
import_normalizeTernaries = require("./normalizeTernaries.mjs"),
|
|
47
|
+
import_propsToFontFamilyCache = require("./propsToFontFamilyCache.mjs"),
|
|
48
|
+
import_timer = require("./timer.mjs"),
|
|
49
|
+
import_errors = require("./errors.mjs"),
|
|
50
|
+
import_concatClassName = require("./concatClassName.mjs");
|
|
51
|
+
const remove = () => {},
|
|
52
|
+
spaceString = t.stringLiteral(" ");
|
|
53
|
+
async function extractToClassNames({
|
|
54
|
+
extractor,
|
|
55
|
+
source,
|
|
56
|
+
sourcePath = "",
|
|
57
|
+
options,
|
|
58
|
+
shouldPrintDebug
|
|
59
|
+
}) {
|
|
60
|
+
const tm = (0, import_timer.timer)(),
|
|
61
|
+
{
|
|
62
|
+
getCSSStylesAtomic,
|
|
63
|
+
createMediaStyle
|
|
64
|
+
} = (0, import_requireTamaguiCore.requireTamaguiCore)("web");
|
|
65
|
+
if (sourcePath.includes("node_modules")) return null;
|
|
66
|
+
if (shouldPrintDebug && console.warn(`--- ${sourcePath} ---
|
|
67
|
+
|
|
68
|
+
`), typeof source != "string") throw new Error("`source` must be a string of javascript");
|
|
69
|
+
if (!path.isAbsolute(sourcePath)) throw new Error("`sourcePath` must be an absolute path to a .js file, got: " + sourcePath);
|
|
70
|
+
/.[tj]sx?$/i.test(sourcePath || "") || console.warn(`${sourcePath.slice(0, 100)} - bad filename.`), !options.disableExtraction && !options._disableLoadTamagui && (await extractor.loadTamagui(options));
|
|
71
|
+
const printLog = (0, import_createLogger.createLogger)(sourcePath, options);
|
|
72
|
+
let ast;
|
|
73
|
+
try {
|
|
74
|
+
ast = (0, import_babelParse.babelParse)(source, sourcePath);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
throw console.error("babel parse error:", sourcePath.slice(0, 100)), err;
|
|
77
|
+
}
|
|
78
|
+
tm.mark("babel-parse", shouldPrintDebug === "verbose");
|
|
79
|
+
const cssMap = /* @__PURE__ */new Map(),
|
|
80
|
+
tamaguiConfig = extractor.getTamagui(),
|
|
81
|
+
res = await extractor.parse(ast, {
|
|
82
|
+
shouldPrintDebug,
|
|
83
|
+
...options,
|
|
84
|
+
platform: "web",
|
|
85
|
+
sourcePath,
|
|
86
|
+
extractStyledDefinitions: !0,
|
|
87
|
+
onStyledDefinitionRule(identifier, rules) {
|
|
88
|
+
const css = rules.join(";");
|
|
89
|
+
shouldPrintDebug && console.info(`adding styled() rule: .${identifier} ${css}`), cssMap.set(`.${identifier}`, {
|
|
90
|
+
css,
|
|
91
|
+
commentTexts: []
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
getFlattenedNode: ({
|
|
95
|
+
tag
|
|
96
|
+
}) => tag,
|
|
97
|
+
onExtractTag: ({
|
|
98
|
+
parserProps,
|
|
99
|
+
attrs,
|
|
100
|
+
node,
|
|
101
|
+
attemptEval,
|
|
102
|
+
jsxPath,
|
|
103
|
+
originalNodeName,
|
|
104
|
+
filePath,
|
|
105
|
+
lineNumbers,
|
|
106
|
+
staticConfig
|
|
107
|
+
}) => {
|
|
108
|
+
if (staticConfig.acceptsClassName === !1) throw new import_errors.BailOptimizationError();
|
|
109
|
+
const finalAttrs = [];
|
|
110
|
+
let mergeForwardBaseStyle = null,
|
|
111
|
+
attrClassName = null,
|
|
112
|
+
baseFontFamily = "",
|
|
113
|
+
mediaStylesSeen = 1;
|
|
114
|
+
const comment = util.format("/* %s:%s (%s) */", filePath, lineNumbers, originalNodeName);
|
|
115
|
+
function addStyle(style) {
|
|
116
|
+
const identifier = style[import_web.StyleObjectIdentifier],
|
|
117
|
+
rules = style[import_web.StyleObjectRules],
|
|
118
|
+
selector = `.${identifier}`;
|
|
119
|
+
return cssMap.has(selector) ? cssMap.get(selector).commentTexts.push(comment) : rules.length && cssMap.set(selector, {
|
|
120
|
+
css: rules.join(`
|
|
121
|
+
`),
|
|
122
|
+
commentTexts: [comment]
|
|
123
|
+
}), identifier;
|
|
124
|
+
}
|
|
125
|
+
function addStyles(style) {
|
|
126
|
+
const cssStyles = getCSSStylesAtomic(style),
|
|
127
|
+
classNames = [];
|
|
128
|
+
for (const style2 of cssStyles) {
|
|
129
|
+
const mediaName = style2[0].slice(1);
|
|
130
|
+
if (tamaguiConfig.media[mediaName]) {
|
|
131
|
+
const mediaStyle = createMediaStyle(style2, mediaName, extractor.getTamagui().media, !0, !1, mediaStylesSeen),
|
|
132
|
+
identifier2 = addStyle(mediaStyle);
|
|
133
|
+
classNames.push(identifier2);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const identifier = addStyle(style2);
|
|
137
|
+
classNames.push(identifier);
|
|
138
|
+
}
|
|
139
|
+
return classNames;
|
|
140
|
+
}
|
|
141
|
+
const onlyTernaries = attrs.flatMap(attr => {
|
|
142
|
+
if (attr.type === "attr") {
|
|
143
|
+
const value = attr.value;
|
|
144
|
+
if (t.isJSXSpreadAttribute(value)) return console.error("Should never happen"), [];
|
|
145
|
+
if (value.name.name === "className") {
|
|
146
|
+
let inner = value.value;
|
|
147
|
+
t.isJSXExpressionContainer(inner) && (inner = inner.expression);
|
|
148
|
+
try {
|
|
149
|
+
const evaluatedValue = inner ? attemptEval(inner) : null;
|
|
150
|
+
typeof evaluatedValue == "string" && (attrClassName = t.stringLiteral(evaluatedValue));
|
|
151
|
+
} catch {
|
|
152
|
+
inner && (attrClassName ||= inner);
|
|
153
|
+
}
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
return finalAttrs.push(value), [];
|
|
157
|
+
}
|
|
158
|
+
if (attr.type === "style") return mergeForwardBaseStyle = (0, import_web.mergeProps)(mergeForwardBaseStyle || {}, attr.value), baseFontFamily = (0, import_propsToFontFamilyCache.getFontFamilyNameFromProps)(attr.value) || "", [];
|
|
159
|
+
let ternary = attr.value;
|
|
160
|
+
if (ternary.inlineMediaQuery) {
|
|
161
|
+
const mediaExtraction = (0, import_extractMediaStyle.extractMediaStyle)(parserProps, attr.value, jsxPath, extractor.getTamagui(), sourcePath || "", mediaStylesSeen++, shouldPrintDebug);
|
|
162
|
+
if (mediaExtraction) if (mediaExtraction.mediaStyles && (mergeForwardBaseStyle = (0, import_web.mergeProps)(mergeForwardBaseStyle || {}, {
|
|
163
|
+
[`$${ternary.inlineMediaQuery}`]: attr.value.consequent
|
|
164
|
+
})), mediaExtraction.ternaryWithoutMedia) ternary = mediaExtraction.ternaryWithoutMedia;else return [];
|
|
165
|
+
}
|
|
166
|
+
let mergedAlternate, mergedConsequent;
|
|
167
|
+
return ternary.alternate && Object.keys(ternary.alternate).length && (mergedAlternate = (0, import_web.mergeProps)(mergeForwardBaseStyle || {}, ternary.alternate || {}), (0, import_propsToFontFamilyCache.forwardFontFamilyName)(ternary.alternate, mergedAlternate, baseFontFamily)), ternary.consequent && Object.keys(ternary.consequent).length && (mergedConsequent = (0, import_web.mergeProps)(mergeForwardBaseStyle || {}, ternary.consequent || {}), (0, import_propsToFontFamilyCache.forwardFontFamilyName)(ternary.consequent, mergedConsequent, baseFontFamily)), {
|
|
168
|
+
...ternary,
|
|
169
|
+
alternate: mergedAlternate,
|
|
170
|
+
consequent: mergedConsequent
|
|
171
|
+
};
|
|
172
|
+
}),
|
|
173
|
+
hasTernaries = !!onlyTernaries.length,
|
|
174
|
+
baseClassNames = mergeForwardBaseStyle ? addStyles(mergeForwardBaseStyle) : null;
|
|
175
|
+
let baseClassNameStr = baseClassNames ? baseClassNames.join(" ") : "";
|
|
176
|
+
!hasTernaries && baseFontFamily && (baseClassNameStr = `font_${baseFontFamily}${baseClassNameStr ? ` ${baseClassNameStr}` : ""}`);
|
|
177
|
+
let base = staticConfig.componentName ? t.stringLiteral(`is_${staticConfig.componentName}${baseClassNameStr ? ` ${baseClassNameStr}` : ""}`) : t.stringLiteral(baseClassNameStr || "");
|
|
178
|
+
attrClassName = attrClassName;
|
|
179
|
+
const baseClassNameExpression = attrClassName ? t.isStringLiteral(attrClassName) ? t.stringLiteral(base.value ? `${base.value} ${attrClassName.value}` : attrClassName.value) : t.binaryExpression("+", t.binaryExpression("+", attrClassName, spaceString), base) : base,
|
|
180
|
+
expandedTernaries = [];
|
|
181
|
+
if (onlyTernaries.length) {
|
|
182
|
+
const normalizedTernaries = (0, import_normalizeTernaries.normalizeTernaries)(onlyTernaries);
|
|
183
|
+
for (const ternary of normalizedTernaries) {
|
|
184
|
+
if (!expandedTernaries.length) {
|
|
185
|
+
expandTernary(ternary);
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
for (const prev of [...expandedTernaries]) expandTernary(ternary, prev);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function expandTernary(ternary, prev) {
|
|
192
|
+
if (ternary.consequent && Object.keys(ternary.consequent).length) {
|
|
193
|
+
const fontFamily = (0, import_propsToFontFamilyCache.getFontFamilyNameFromProps)(ternary.consequent);
|
|
194
|
+
expandedTernaries.push({
|
|
195
|
+
fontFamily,
|
|
196
|
+
// prevTest && test: merge consequent
|
|
197
|
+
test: prev ? t.logicalExpression("&&", prev.test, ternary.test) : ternary.test,
|
|
198
|
+
consequent: prev ? (0, import_web.mergeProps)(prev.consequent, ternary.consequent) : ternary.consequent,
|
|
199
|
+
remove,
|
|
200
|
+
alternate: null
|
|
201
|
+
}), prev && expandedTernaries.push({
|
|
202
|
+
fontFamily,
|
|
203
|
+
// !prevTest && test: just consequent
|
|
204
|
+
test: t.logicalExpression("&&", t.unaryExpression("!", prev.test), ternary.test),
|
|
205
|
+
consequent: ternary.consequent,
|
|
206
|
+
alternate: null,
|
|
207
|
+
remove
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
if (ternary.alternate && Object.keys(ternary.alternate).length) {
|
|
211
|
+
const fontFamily = (0, import_propsToFontFamilyCache.getFontFamilyNameFromProps)(ternary.alternate),
|
|
212
|
+
negated = t.unaryExpression("!", ternary.test);
|
|
213
|
+
expandedTernaries.push({
|
|
214
|
+
fontFamily,
|
|
215
|
+
// prevTest && !test: merge alternate
|
|
216
|
+
test: prev ? t.logicalExpression("&&", prev.test, negated) : negated,
|
|
217
|
+
consequent: prev ? (0, import_web.mergeProps)(prev.alternate, ternary.alternate) : ternary.alternate,
|
|
218
|
+
remove,
|
|
219
|
+
alternate: null
|
|
220
|
+
}), prev && expandedTernaries.push({
|
|
221
|
+
fontFamily,
|
|
222
|
+
test: t.logicalExpression("&&", t.unaryExpression("!", prev.test), ternary.test),
|
|
223
|
+
consequent: ternary.alternate,
|
|
224
|
+
remove,
|
|
225
|
+
alternate: null
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
let ternaryClassNameExpr = null;
|
|
230
|
+
if (hasTernaries) for (const ternary of expandedTernaries) {
|
|
231
|
+
if (!ternary.consequent) continue;
|
|
232
|
+
const classNames = addStyles(ternary.consequent);
|
|
233
|
+
ternary.fontFamily && classNames.unshift(`font_${ternary.fontFamily}`);
|
|
234
|
+
const baseString = t.isStringLiteral(baseClassNameExpression) ? baseClassNameExpression.value : "",
|
|
235
|
+
fullClassNameWithDups = (baseString ? `${baseString} ` : "") + classNames.join(" "),
|
|
236
|
+
fullClassName = (0, import_concatClassName.concatClassName)(fullClassNameWithDups),
|
|
237
|
+
classNameLiteral = t.stringLiteral(fullClassName);
|
|
238
|
+
ternaryClassNameExpr ? ternaryClassNameExpr = t.conditionalExpression(ternary.test, classNameLiteral, ternaryClassNameExpr) : ternaryClassNameExpr = t.conditionalExpression(ternary.test, classNameLiteral, baseClassNameExpression);
|
|
239
|
+
}
|
|
240
|
+
let finalExpression = ternaryClassNameExpr || baseClassNameExpression || null;
|
|
241
|
+
if (shouldPrintDebug && (console.info("attrs", JSON.stringify(attrs, null, 2)), console.info("expandedTernaries", JSON.stringify(expandedTernaries, null, 2)), console.info("finalExpression", JSON.stringify(finalExpression, null, 2)), console.info({
|
|
242
|
+
hasTernaries,
|
|
243
|
+
baseClassNameExpression
|
|
244
|
+
})), finalExpression) {
|
|
245
|
+
finalExpression = hoistClassNames(jsxPath, finalExpression);
|
|
246
|
+
const classNameProp = t.jsxAttribute(t.jsxIdentifier("className"), t.jsxExpressionContainer(finalExpression));
|
|
247
|
+
finalAttrs.unshift(classNameProp);
|
|
248
|
+
}
|
|
249
|
+
node.attributes = finalAttrs;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
if (!res || !res.modified && !res.optimized && !res.flattened && !res.styled) return shouldPrintDebug && console.info("no res or none modified", res), null;
|
|
253
|
+
const styles = Array.from(cssMap.values()).map(x => x.css).join(`
|
|
254
|
+
`).trim(),
|
|
255
|
+
result = (0, import_generator.default)(ast, {
|
|
256
|
+
concise: !1,
|
|
257
|
+
filename: sourcePath,
|
|
258
|
+
// this makes the debug output terrible, and i think sourcemap works already
|
|
259
|
+
retainLines: !1,
|
|
260
|
+
sourceFileName: sourcePath,
|
|
261
|
+
sourceMaps: !0
|
|
262
|
+
}, source);
|
|
263
|
+
return shouldPrintDebug && (console.info(`
|
|
264
|
+
-------- output code -------
|
|
265
|
+
|
|
266
|
+
`, result.code.split(`
|
|
267
|
+
`).filter(x => !x.startsWith("//")).join(`
|
|
268
|
+
`)), console.info(`
|
|
269
|
+
-------- output style --------
|
|
270
|
+
|
|
271
|
+
`, styles)), printLog(res), {
|
|
272
|
+
ast,
|
|
273
|
+
styles,
|
|
274
|
+
js: result.code,
|
|
275
|
+
map: result.map
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function hoistClassNames(path2, expr) {
|
|
279
|
+
if (t.isStringLiteral(expr)) return hoistClassName(path2, expr.value);
|
|
280
|
+
if (t.isLogicalExpression(expr)) {
|
|
281
|
+
const left = t.isStringLiteral(expr.left) ? hoistClassName(path2, expr.left.value) : expr.left,
|
|
282
|
+
right = t.isStringLiteral(expr.right) ? hoistClassName(path2, expr.right.value) : hoistClassNames(path2, expr.right);
|
|
283
|
+
return t.logicalExpression(expr.operator, left, right);
|
|
284
|
+
}
|
|
285
|
+
if (t.isConditionalExpression(expr)) {
|
|
286
|
+
const cons = t.isStringLiteral(expr.consequent) ? hoistClassName(path2, expr.consequent.value) : hoistClassNames(path2, expr.consequent),
|
|
287
|
+
alt = t.isStringLiteral(expr.alternate) ? hoistClassName(path2, expr.alternate.value) : hoistClassNames(path2, expr.alternate);
|
|
288
|
+
return t.conditionalExpression(expr.test, cons, alt);
|
|
289
|
+
}
|
|
290
|
+
return expr;
|
|
291
|
+
}
|
|
292
|
+
function hoistClassName(path2, str) {
|
|
293
|
+
const uid = path2.scope.generateUidIdentifier("cn"),
|
|
294
|
+
parent = path2.findParent(path3 => path3.isProgram());
|
|
295
|
+
if (!parent) throw new Error("no program?");
|
|
296
|
+
const variable = t.variableDeclaration("const", [t.variableDeclarator(uid, t.stringLiteral(cleanupClassName(str)))]);
|
|
297
|
+
return parent.unshiftContainer("body", variable), uid;
|
|
298
|
+
}
|
|
299
|
+
function cleanupClassName(inStr) {
|
|
300
|
+
const out = /* @__PURE__ */new Set();
|
|
301
|
+
for (const part of inStr.split(" ")) part !== " " && part !== "font_" && out.add(part);
|
|
302
|
+
return [...out].join(" ") + " ";
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=extractToClassNames.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["extractToClassNames_exports","__export","extractToClassNames","module","exports","__toCommonJS","import_generator","__toESM","require","t","import_web","path","util","import_requireTamaguiCore","import_babelParse","import_createLogger","import_extractMediaStyle","import_normalizeTernaries","import_propsToFontFamilyCache","import_timer","import_errors","import_concatClassName","remove","spaceString","stringLiteral","extractor","source","sourcePath","options","shouldPrintDebug","tm","timer","getCSSStylesAtomic","createMediaStyle","requireTamaguiCore","includes","console","warn","Error","isAbsolute","test","slice","disableExtraction","_disableLoadTamagui","loadTamagui","printLog","createLogger","ast","babelParse","err","error","mark","cssMap","Map","tamaguiConfig","getTamagui","res","parse","platform","extractStyledDefinitions","onStyledDefinitionRule","identifier","rules","css","join","info","set","commentTexts","getFlattenedNode","tag","onExtractTag","parserProps","attrs","node","attemptEval","jsxPath","originalNodeName","filePath","lineNumbers","staticConfig","acceptsClassName","BailOptimizationError","finalAttrs","mergeForwardBaseStyle","attrClassName","baseFontFamily","mediaStylesSeen","comment","format","addStyle","style","StyleObjectIdentifier","StyleObjectRules","selector","has","get","push","length","addStyles","cssStyles","classNames","style2","mediaName","media","mediaStyle","identifier2","onlyTernaries","flatMap","attr","type","value","isJSXSpreadAttribute","name","inner","isJSXExpressionContainer","expression","evaluatedValue","mergeProps","getFontFamilyNameFromProps","ternary","inlineMediaQuery","mediaExtraction","extractMediaStyle","mediaStyles","consequent","ternaryWithoutMedia","mergedAlternate","mergedConsequent","alternate","Object","keys","forwardFontFamilyName","hasTernaries","baseClassNames","baseClassNameStr","base","componentName","baseClassNameExpression","isStringLiteral","binaryExpression","expandedTernaries","normalizedTernaries","normalizeTernaries","expandTernary","prev","fontFamily","logicalExpression","unaryExpression","negated","ternaryClassNameExpr","unshift","baseString","fullClassNameWithDups","fullClassName","concatClassName","classNameLiteral","conditionalExpression","finalExpression","JSON","stringify","hoistClassNames","classNameProp","jsxAttribute","jsxIdentifier","jsxExpressionContainer","attributes","modified","optimized","flattened","styled","styles","Array","from","values","map","x","trim","result","default","concise","filename","retainLines","sourceFileName","sourceMaps","code","split","filter","startsWith","js","path2","expr","hoistClassName","isLogicalExpression","left","right","operator","isConditionalExpression","cons","alt","str","uid","scope","generateUidIdentifier","parent","findParent","path3","isProgram","variable","variableDeclaration","variableDeclarator","cleanupClassName","unshiftContainer","inStr","out","Set","part","add"],"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