tailwind-styled-v4 5.0.18 → 5.0.21
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/{analyzeWorkspace-CopJNGmi.d.ts → analyzeWorkspace-B1_XRfdl.d.ts} +1 -0
- package/dist/{analyzeWorkspace-DpVPccjz.d.mts → analyzeWorkspace-hYfu4Hg3.d.mts} +1 -0
- package/dist/analyzer.d.mts +2 -2
- package/dist/analyzer.d.ts +2 -2
- package/dist/analyzer.js +5 -4
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +5 -4
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +3 -3
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +3 -3
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +38 -2
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +38 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +43 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +43 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +177 -2
- package/dist/compiler.d.ts +177 -2
- package/dist/compiler.js +172 -10
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +159 -11
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.d.mts +3 -3
- package/dist/engine.d.ts +3 -3
- package/dist/engine.js +182 -14
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +182 -14
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BFqmBxl9.d.mts +102 -0
- package/dist/{index-DJv28Uzq.d.mts → index-DQI6O24n.d.mts} +1 -1
- package/dist/index-DwNErRJ_.d.ts +102 -0
- package/dist/{index-BDQw13kn.d.ts → index-UkYbyBkR.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +182 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +182 -14
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +193 -11
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +193 -11
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.d.mts +3 -101
- package/dist/plugin-api.d.ts +3 -101
- package/dist/plugin.d.mts +3 -5
- package/dist/plugin.d.ts +3 -5
- package/dist/plugin.js +0 -97
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +1 -77
- package/dist/plugin.mjs.map +1 -1
- package/dist/shared.js +177 -10
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +177 -10
- package/dist/shared.mjs.map +1 -1
- package/dist/turbopackLoader.js +179 -12
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +179 -12
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +43 -6
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +43 -6
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +315 -147
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +315 -147
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +38 -2
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +38 -2
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +1 -1
package/dist/vite.js
CHANGED
|
@@ -1023,8 +1023,8 @@ async function generateCssNative(classes, options) {
|
|
|
1023
1023
|
return css;
|
|
1024
1024
|
}
|
|
1025
1025
|
function clearThemeCache() {
|
|
1026
|
+
const native = getNativeBridge();
|
|
1026
1027
|
try {
|
|
1027
|
-
const native = getNativeBridge();
|
|
1028
1028
|
if (!native?.clearThemeCache) {
|
|
1029
1029
|
return;
|
|
1030
1030
|
}
|
|
@@ -1032,12 +1032,165 @@ function clearThemeCache() {
|
|
|
1032
1032
|
} catch {
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
|
+
function resetCacheStats() {
|
|
1036
|
+
const native = getNativeBridge();
|
|
1037
|
+
try {
|
|
1038
|
+
if (!native?.resetCacheStats) {
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
native.resetCacheStats();
|
|
1042
|
+
} catch {
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1035
1045
|
var init_cssGeneratorNative = __esm({
|
|
1036
1046
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
1037
1047
|
init_nativeBridge();
|
|
1038
1048
|
}
|
|
1039
1049
|
});
|
|
1040
1050
|
|
|
1051
|
+
// packages/domain/compiler/src/compiler/cssCompilationNative.ts
|
|
1052
|
+
function compileClass(input) {
|
|
1053
|
+
const native = getNativeBridge();
|
|
1054
|
+
if (!native?.compile_class) throw new Error("compile_class not available");
|
|
1055
|
+
const resultJson = native.compile_class(input);
|
|
1056
|
+
try {
|
|
1057
|
+
return JSON.parse(resultJson);
|
|
1058
|
+
} catch {
|
|
1059
|
+
return {
|
|
1060
|
+
selector: "",
|
|
1061
|
+
declarations: "",
|
|
1062
|
+
properties: [],
|
|
1063
|
+
specificity: 0
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
function compileClasses(inputs) {
|
|
1068
|
+
const native = getNativeBridge();
|
|
1069
|
+
if (!native?.compile_classes) throw new Error("compile_classes not available");
|
|
1070
|
+
const resultJson = native.compile_classes(inputs);
|
|
1071
|
+
try {
|
|
1072
|
+
return JSON.parse(resultJson);
|
|
1073
|
+
} catch {
|
|
1074
|
+
return {
|
|
1075
|
+
css: "",
|
|
1076
|
+
resolved_classes: [],
|
|
1077
|
+
unknown_classes: [],
|
|
1078
|
+
size_bytes: 0,
|
|
1079
|
+
duration_ms: 0
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
function compileToCss(input, minify) {
|
|
1084
|
+
const native = getNativeBridge();
|
|
1085
|
+
if (!native?.compile_to_css) throw new Error("compile_to_css not available");
|
|
1086
|
+
return native.compile_to_css(input, minify ?? false);
|
|
1087
|
+
}
|
|
1088
|
+
function compileToCssBatch(inputs, minify) {
|
|
1089
|
+
const native = getNativeBridge();
|
|
1090
|
+
if (!native?.compile_to_css_batch) throw new Error("compile_to_css_batch not available");
|
|
1091
|
+
return native.compile_to_css_batch(inputs, minify ?? false);
|
|
1092
|
+
}
|
|
1093
|
+
function minifyCss(css) {
|
|
1094
|
+
const native = getNativeBridge();
|
|
1095
|
+
if (!native?.minify_css) throw new Error("minify_css not available");
|
|
1096
|
+
return native.minify_css(css);
|
|
1097
|
+
}
|
|
1098
|
+
function generateCss(ruleJson, minify) {
|
|
1099
|
+
const native = getNativeBridge();
|
|
1100
|
+
if (!native?.generate_css) throw new Error("generate_css not available");
|
|
1101
|
+
return native.generate_css(ruleJson, minify);
|
|
1102
|
+
}
|
|
1103
|
+
function generateCssBatch(rulesJson, minify) {
|
|
1104
|
+
const native = getNativeBridge();
|
|
1105
|
+
if (!native?.generate_css_batch) throw new Error("generate_css_batch not available");
|
|
1106
|
+
return native.generate_css_batch(rulesJson, minify);
|
|
1107
|
+
}
|
|
1108
|
+
function compileAnimation(animationName, from, to) {
|
|
1109
|
+
const native = getNativeBridge();
|
|
1110
|
+
if (!native?.compile_animation) throw new Error("compile_animation not available");
|
|
1111
|
+
const resultJson = native.compile_animation(animationName, from, to);
|
|
1112
|
+
try {
|
|
1113
|
+
return JSON.parse(resultJson);
|
|
1114
|
+
} catch {
|
|
1115
|
+
return {
|
|
1116
|
+
animation_id: "",
|
|
1117
|
+
keyframes_css: "",
|
|
1118
|
+
animation_rule: "",
|
|
1119
|
+
duration_ms: 0
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
function compileKeyframes(name, stopsJson) {
|
|
1124
|
+
const native = getNativeBridge();
|
|
1125
|
+
if (!native?.compile_keyframes) throw new Error("compile_keyframes not available");
|
|
1126
|
+
const resultJson = native.compile_keyframes(name, stopsJson);
|
|
1127
|
+
try {
|
|
1128
|
+
return JSON.parse(resultJson);
|
|
1129
|
+
} catch {
|
|
1130
|
+
return {
|
|
1131
|
+
animation_id: "",
|
|
1132
|
+
keyframes_css: "",
|
|
1133
|
+
animation_rule: "",
|
|
1134
|
+
duration_ms: 0
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function compileTheme(tokensJson, themeName, prefix) {
|
|
1139
|
+
const native = getNativeBridge();
|
|
1140
|
+
if (!native?.compile_theme) throw new Error("compile_theme not available");
|
|
1141
|
+
const resultJson = native.compile_theme(tokensJson, themeName, prefix);
|
|
1142
|
+
try {
|
|
1143
|
+
return JSON.parse(resultJson);
|
|
1144
|
+
} catch {
|
|
1145
|
+
return {
|
|
1146
|
+
selector: ":root",
|
|
1147
|
+
variables: [],
|
|
1148
|
+
variables_css: "",
|
|
1149
|
+
theme_name: themeName
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
function twMerge(classString) {
|
|
1154
|
+
const native = getNativeBridge();
|
|
1155
|
+
if (!native?.tw_merge) throw new Error("tw_merge not available");
|
|
1156
|
+
return native.tw_merge(classString);
|
|
1157
|
+
}
|
|
1158
|
+
function twMergeMany(classStrings) {
|
|
1159
|
+
const native = getNativeBridge();
|
|
1160
|
+
if (!native?.tw_merge_many) throw new Error("tw_merge_many not available");
|
|
1161
|
+
return native.tw_merge_many(classStrings);
|
|
1162
|
+
}
|
|
1163
|
+
function twMergeWithSeparator(classString, options) {
|
|
1164
|
+
const native = getNativeBridge();
|
|
1165
|
+
if (!native?.tw_merge_with_separator)
|
|
1166
|
+
throw new Error("tw_merge_with_separator not available");
|
|
1167
|
+
const opts = {
|
|
1168
|
+
separator: options.separator,
|
|
1169
|
+
debug: options.debug
|
|
1170
|
+
};
|
|
1171
|
+
return native.tw_merge_with_separator(classString, opts);
|
|
1172
|
+
}
|
|
1173
|
+
function twMergeManyWithSeparator(classStrings, options) {
|
|
1174
|
+
const native = getNativeBridge();
|
|
1175
|
+
if (!native?.tw_merge_many_with_separator)
|
|
1176
|
+
throw new Error("tw_merge_many_with_separator not available");
|
|
1177
|
+
const opts = {
|
|
1178
|
+
separator: options.separator,
|
|
1179
|
+
debug: options.debug
|
|
1180
|
+
};
|
|
1181
|
+
return native.tw_merge_many_with_separator(classStrings, opts);
|
|
1182
|
+
}
|
|
1183
|
+
function twMergeRaw(classLists) {
|
|
1184
|
+
const native = getNativeBridge();
|
|
1185
|
+
if (!native?.tw_merge_raw) throw new Error("tw_merge_raw not available");
|
|
1186
|
+
return native.tw_merge_raw(classLists);
|
|
1187
|
+
}
|
|
1188
|
+
var init_cssCompilationNative = __esm({
|
|
1189
|
+
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
1190
|
+
init_nativeBridge();
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
|
|
1041
1194
|
// packages/domain/compiler/src/compiler/tailwindEngine.ts
|
|
1042
1195
|
var tailwindEngine_exports = {};
|
|
1043
1196
|
__export(tailwindEngine_exports, {
|
|
@@ -1149,7 +1302,7 @@ function postProcessWithLightning(rawCss) {
|
|
|
1149
1302
|
}
|
|
1150
1303
|
return result.css;
|
|
1151
1304
|
}
|
|
1152
|
-
async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
1305
|
+
async function runCssPipeline(classes, cssEntryContent, root, minify = true, minifier = "lightning") {
|
|
1153
1306
|
const filtered = classes.filter(Boolean);
|
|
1154
1307
|
const uniqueMap = /* @__PURE__ */ new Map();
|
|
1155
1308
|
filtered.forEach((cls) => uniqueMap.set(cls, cls));
|
|
@@ -1157,7 +1310,7 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
1157
1310
|
if (unique.length === 0) {
|
|
1158
1311
|
return { css: "", classes: [], sizeBytes: 0, optimized: false };
|
|
1159
1312
|
}
|
|
1160
|
-
const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root)
|
|
1313
|
+
const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root) + `|${minifier}`;
|
|
1161
1314
|
const cached = _cssCache.get(cacheKey);
|
|
1162
1315
|
if (cached) {
|
|
1163
1316
|
_cacheHits++;
|
|
@@ -1174,7 +1327,14 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
1174
1327
|
const theme = getThemeConfig();
|
|
1175
1328
|
rawCss = await generateCssNative(unique, { theme });
|
|
1176
1329
|
usedRustCompiler = true;
|
|
1177
|
-
|
|
1330
|
+
let finalCss = rawCss;
|
|
1331
|
+
if (minify) {
|
|
1332
|
+
if (minifier === "fast") {
|
|
1333
|
+
finalCss = minifyCss(rawCss);
|
|
1334
|
+
} else {
|
|
1335
|
+
finalCss = postProcessWithLightning(rawCss);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1178
1338
|
if (process.env.DEBUG?.includes("compiler")) {
|
|
1179
1339
|
console.log(
|
|
1180
1340
|
`[Compiler] Generated CSS from ${unique.length} classes (${usedRustCompiler ? "Rust" : "JavaScript"})`,
|
|
@@ -1210,6 +1370,7 @@ var init_tailwindEngine = __esm({
|
|
|
1210
1370
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1211
1371
|
init_nativeBridge();
|
|
1212
1372
|
init_cssGeneratorNative();
|
|
1373
|
+
init_cssCompilationNative();
|
|
1213
1374
|
module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vite.js', document.baseURI).href)));
|
|
1214
1375
|
_cssCache = /* @__PURE__ */ new Map();
|
|
1215
1376
|
_cacheHits = 0;
|
|
@@ -1290,139 +1451,6 @@ var init_compilationNative = __esm({
|
|
|
1290
1451
|
}
|
|
1291
1452
|
});
|
|
1292
1453
|
|
|
1293
|
-
// packages/domain/compiler/src/compiler/cssCompilationNative.ts
|
|
1294
|
-
function compileClass(input) {
|
|
1295
|
-
const native = getNativeBridge();
|
|
1296
|
-
if (!native?.compile_class) throw new Error("compile_class not available");
|
|
1297
|
-
const resultJson = native.compile_class(input);
|
|
1298
|
-
try {
|
|
1299
|
-
return JSON.parse(resultJson);
|
|
1300
|
-
} catch {
|
|
1301
|
-
return {
|
|
1302
|
-
selector: "",
|
|
1303
|
-
declarations: "",
|
|
1304
|
-
properties: [],
|
|
1305
|
-
specificity: 0
|
|
1306
|
-
};
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
function compileClasses(inputs) {
|
|
1310
|
-
const native = getNativeBridge();
|
|
1311
|
-
if (!native?.compile_classes) throw new Error("compile_classes not available");
|
|
1312
|
-
const resultJson = native.compile_classes(inputs);
|
|
1313
|
-
try {
|
|
1314
|
-
return JSON.parse(resultJson);
|
|
1315
|
-
} catch {
|
|
1316
|
-
return {
|
|
1317
|
-
css: "",
|
|
1318
|
-
resolved_classes: [],
|
|
1319
|
-
unknown_classes: [],
|
|
1320
|
-
size_bytes: 0,
|
|
1321
|
-
duration_ms: 0
|
|
1322
|
-
};
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
function compileToCss(input, minify) {
|
|
1326
|
-
const native = getNativeBridge();
|
|
1327
|
-
if (!native?.compile_to_css) throw new Error("compile_to_css not available");
|
|
1328
|
-
return native.compile_to_css(input, minify ?? false);
|
|
1329
|
-
}
|
|
1330
|
-
function compileToCssBatch(inputs, minify) {
|
|
1331
|
-
const native = getNativeBridge();
|
|
1332
|
-
if (!native?.compile_to_css_batch) throw new Error("compile_to_css_batch not available");
|
|
1333
|
-
return native.compile_to_css_batch(inputs, minify ?? false);
|
|
1334
|
-
}
|
|
1335
|
-
function minifyCss(css) {
|
|
1336
|
-
const native = getNativeBridge();
|
|
1337
|
-
if (!native?.minify_css) throw new Error("minify_css not available");
|
|
1338
|
-
return native.minify_css(css);
|
|
1339
|
-
}
|
|
1340
|
-
function compileAnimation(animationName, from, to) {
|
|
1341
|
-
const native = getNativeBridge();
|
|
1342
|
-
if (!native?.compile_animation) throw new Error("compile_animation not available");
|
|
1343
|
-
const resultJson = native.compile_animation(animationName, from, to);
|
|
1344
|
-
try {
|
|
1345
|
-
return JSON.parse(resultJson);
|
|
1346
|
-
} catch {
|
|
1347
|
-
return {
|
|
1348
|
-
animation_id: "",
|
|
1349
|
-
keyframes_css: "",
|
|
1350
|
-
animation_rule: "",
|
|
1351
|
-
duration_ms: 0
|
|
1352
|
-
};
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
function compileKeyframes(name, stopsJson) {
|
|
1356
|
-
const native = getNativeBridge();
|
|
1357
|
-
if (!native?.compile_keyframes) throw new Error("compile_keyframes not available");
|
|
1358
|
-
const resultJson = native.compile_keyframes(name, stopsJson);
|
|
1359
|
-
try {
|
|
1360
|
-
return JSON.parse(resultJson);
|
|
1361
|
-
} catch {
|
|
1362
|
-
return {
|
|
1363
|
-
animation_id: "",
|
|
1364
|
-
keyframes_css: "",
|
|
1365
|
-
animation_rule: "",
|
|
1366
|
-
duration_ms: 0
|
|
1367
|
-
};
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
function compileTheme(tokensJson, themeName, prefix) {
|
|
1371
|
-
const native = getNativeBridge();
|
|
1372
|
-
if (!native?.compile_theme) throw new Error("compile_theme not available");
|
|
1373
|
-
const resultJson = native.compile_theme(tokensJson, themeName, prefix);
|
|
1374
|
-
try {
|
|
1375
|
-
return JSON.parse(resultJson);
|
|
1376
|
-
} catch {
|
|
1377
|
-
return {
|
|
1378
|
-
selector: ":root",
|
|
1379
|
-
variables: [],
|
|
1380
|
-
variables_css: "",
|
|
1381
|
-
theme_name: themeName
|
|
1382
|
-
};
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
function twMerge(classString) {
|
|
1386
|
-
const native = getNativeBridge();
|
|
1387
|
-
if (!native?.tw_merge) throw new Error("tw_merge not available");
|
|
1388
|
-
return native.tw_merge(classString);
|
|
1389
|
-
}
|
|
1390
|
-
function twMergeMany(classStrings) {
|
|
1391
|
-
const native = getNativeBridge();
|
|
1392
|
-
if (!native?.tw_merge_many) throw new Error("tw_merge_many not available");
|
|
1393
|
-
return native.tw_merge_many(classStrings);
|
|
1394
|
-
}
|
|
1395
|
-
function twMergeWithSeparator(classString, options) {
|
|
1396
|
-
const native = getNativeBridge();
|
|
1397
|
-
if (!native?.tw_merge_with_separator)
|
|
1398
|
-
throw new Error("tw_merge_with_separator not available");
|
|
1399
|
-
const opts = {
|
|
1400
|
-
separator: options.separator,
|
|
1401
|
-
debug: options.debug
|
|
1402
|
-
};
|
|
1403
|
-
return native.tw_merge_with_separator(classString, opts);
|
|
1404
|
-
}
|
|
1405
|
-
function twMergeManyWithSeparator(classStrings, options) {
|
|
1406
|
-
const native = getNativeBridge();
|
|
1407
|
-
if (!native?.tw_merge_many_with_separator)
|
|
1408
|
-
throw new Error("tw_merge_many_with_separator not available");
|
|
1409
|
-
const opts = {
|
|
1410
|
-
separator: options.separator,
|
|
1411
|
-
debug: options.debug
|
|
1412
|
-
};
|
|
1413
|
-
return native.tw_merge_many_with_separator(classStrings, opts);
|
|
1414
|
-
}
|
|
1415
|
-
function twMergeRaw(classLists) {
|
|
1416
|
-
const native = getNativeBridge();
|
|
1417
|
-
if (!native?.tw_merge_raw) throw new Error("tw_merge_raw not available");
|
|
1418
|
-
return native.tw_merge_raw(classLists);
|
|
1419
|
-
}
|
|
1420
|
-
var init_cssCompilationNative = __esm({
|
|
1421
|
-
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
1422
|
-
init_nativeBridge();
|
|
1423
|
-
}
|
|
1424
|
-
});
|
|
1425
|
-
|
|
1426
1454
|
// packages/domain/compiler/src/compiler/idRegistryNative.ts
|
|
1427
1455
|
function idRegistryCreate() {
|
|
1428
1456
|
const native = getNativeBridge();
|
|
@@ -1687,9 +1715,10 @@ __export(parser_exports, {
|
|
|
1687
1715
|
mergeClassesStatic: () => mergeClassesStatic,
|
|
1688
1716
|
normalizeAndDedupClasses: () => normalizeAndDedupClasses,
|
|
1689
1717
|
normalizeClasses: () => normalizeClasses,
|
|
1718
|
+
parseClass: () => parseClass,
|
|
1690
1719
|
parseClasses: () => parseClasses
|
|
1691
1720
|
});
|
|
1692
|
-
var parseClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1721
|
+
var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1693
1722
|
var init_parser = __esm({
|
|
1694
1723
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1695
1724
|
init_nativeBridge();
|
|
@@ -1700,6 +1729,14 @@ var init_parser = __esm({
|
|
|
1700
1729
|
}
|
|
1701
1730
|
return native.parseClasses(raw) || [];
|
|
1702
1731
|
};
|
|
1732
|
+
parseClass = (input) => {
|
|
1733
|
+
const native = getNativeBridge();
|
|
1734
|
+
if (!native?.parseClass) {
|
|
1735
|
+
throw new Error("FATAL: Native binding 'parseClass' is required but not available.");
|
|
1736
|
+
}
|
|
1737
|
+
const result = native.parseClass(input);
|
|
1738
|
+
return typeof result === "string" ? JSON.parse(result) : result;
|
|
1739
|
+
};
|
|
1703
1740
|
extractAllClasses = (source) => {
|
|
1704
1741
|
const native = getNativeBridge();
|
|
1705
1742
|
if (!native?.extractAllClasses) {
|
|
@@ -1831,6 +1868,35 @@ function mergeCssDeclarationsNative(cssChunks) {
|
|
|
1831
1868
|
if (!native?.mergeCssDeclarations) throw new Error("mergeCssDeclarations not available");
|
|
1832
1869
|
return native.mergeCssDeclarations(cssChunks);
|
|
1833
1870
|
}
|
|
1871
|
+
function getWeek6FeaturesStatus() {
|
|
1872
|
+
const native = getNativeBridge();
|
|
1873
|
+
if (!native?.getWeek6FeaturesStatus) throw new Error("getWeek6FeaturesStatus not available");
|
|
1874
|
+
const resultJson = native.getWeek6FeaturesStatus();
|
|
1875
|
+
return JSON.parse(resultJson);
|
|
1876
|
+
}
|
|
1877
|
+
function getMemoryStatsNative() {
|
|
1878
|
+
const native = getNativeBridge();
|
|
1879
|
+
if (!native?.getMemoryStatsNative) throw new Error("getMemoryStatsNative not available");
|
|
1880
|
+
const resultJson = native.getMemoryStatsNative();
|
|
1881
|
+
return JSON.parse(resultJson);
|
|
1882
|
+
}
|
|
1883
|
+
function getMemoryRecommendationsNative() {
|
|
1884
|
+
const native = getNativeBridge();
|
|
1885
|
+
if (!native?.getMemoryRecommendationsNative) throw new Error("getMemoryRecommendationsNative not available");
|
|
1886
|
+
const resultJson = native.getMemoryRecommendationsNative();
|
|
1887
|
+
return JSON.parse(resultJson);
|
|
1888
|
+
}
|
|
1889
|
+
function estimateOptimalCacheConfigNative(workloadType, expectedEntries) {
|
|
1890
|
+
const native = getNativeBridge();
|
|
1891
|
+
if (!native?.estimateOptimalCacheConfigNative) throw new Error("estimateOptimalCacheConfigNative not available");
|
|
1892
|
+
const resultJson = native.estimateOptimalCacheConfigNative(workloadType, expectedEntries);
|
|
1893
|
+
return JSON.parse(resultJson);
|
|
1894
|
+
}
|
|
1895
|
+
function resetMemoryStats() {
|
|
1896
|
+
const native = getNativeBridge();
|
|
1897
|
+
if (!native?.resetMemoryStats) throw new Error("resetMemoryStats not available");
|
|
1898
|
+
native.resetMemoryStats();
|
|
1899
|
+
}
|
|
1834
1900
|
var init_analyzerNative = __esm({
|
|
1835
1901
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
1836
1902
|
init_nativeBridge();
|
|
@@ -2120,6 +2186,52 @@ function cachePriority(mtimeMs, sizeBytes, hitCount) {
|
|
|
2120
2186
|
if (!native?.cache_priority) throw new Error("cache_priority not available");
|
|
2121
2187
|
return native.cache_priority(mtimeMs, sizeBytes, hitCount);
|
|
2122
2188
|
}
|
|
2189
|
+
function getResolverPoolStats() {
|
|
2190
|
+
const native = getNativeBridge();
|
|
2191
|
+
if (!native?.getResolverPoolStats) throw new Error("getResolverPoolStats not available");
|
|
2192
|
+
const statsJson = native.getResolverPoolStats();
|
|
2193
|
+
try {
|
|
2194
|
+
return JSON.parse(statsJson);
|
|
2195
|
+
} catch {
|
|
2196
|
+
return {
|
|
2197
|
+
hits: 0,
|
|
2198
|
+
misses: 0,
|
|
2199
|
+
total: 0,
|
|
2200
|
+
hit_rate: 0,
|
|
2201
|
+
cached_resolvers: 0
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
function clearResolverPool() {
|
|
2206
|
+
const native = getNativeBridge();
|
|
2207
|
+
if (!native?.clearResolverPool) throw new Error("clearResolverPool not available");
|
|
2208
|
+
const resultJson = native.clearResolverPool();
|
|
2209
|
+
try {
|
|
2210
|
+
return JSON.parse(resultJson);
|
|
2211
|
+
} catch {
|
|
2212
|
+
return { status: "error" };
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
function resolveColorCached(themeId, color, configJson) {
|
|
2216
|
+
const native = getNativeBridge();
|
|
2217
|
+
if (!native?.resolveColorCached) throw new Error("resolveColorCached not available");
|
|
2218
|
+
return native.resolveColorCached(themeId, color, configJson);
|
|
2219
|
+
}
|
|
2220
|
+
function resolveSpacingCached(themeId, spacing, configJson) {
|
|
2221
|
+
const native = getNativeBridge();
|
|
2222
|
+
if (!native?.resolveSpacingCached) throw new Error("resolveSpacingCached not available");
|
|
2223
|
+
return native.resolveSpacingCached(themeId, spacing, configJson);
|
|
2224
|
+
}
|
|
2225
|
+
function resolveFontSizeCached(themeId, size, configJson) {
|
|
2226
|
+
const native = getNativeBridge();
|
|
2227
|
+
if (!native?.resolveFontSizeCached) throw new Error("resolveFontSizeCached not available");
|
|
2228
|
+
return native.resolveFontSizeCached(themeId, size, configJson);
|
|
2229
|
+
}
|
|
2230
|
+
function resetResolverPoolStats() {
|
|
2231
|
+
const native = getNativeBridge();
|
|
2232
|
+
if (!native?.resetResolverPoolStats) throw new Error("resetResolverPoolStats not available");
|
|
2233
|
+
native.resetResolverPoolStats();
|
|
2234
|
+
}
|
|
2123
2235
|
var init_cacheNative = __esm({
|
|
2124
2236
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
2125
2237
|
init_nativeBridge();
|
|
@@ -2563,6 +2675,7 @@ __export(internal_exports, {
|
|
|
2563
2675
|
clearCssGenCache: () => clearCssGenCache,
|
|
2564
2676
|
clearParseCache: () => clearParseCache,
|
|
2565
2677
|
clearResolveCache: () => clearResolveCache,
|
|
2678
|
+
clearResolverPool: () => clearResolverPool,
|
|
2566
2679
|
clearThemeCache: () => clearThemeCache,
|
|
2567
2680
|
collectFiles: () => collectFiles,
|
|
2568
2681
|
compileAnimation: () => compileAnimation,
|
|
@@ -2585,6 +2698,7 @@ __export(internal_exports, {
|
|
|
2585
2698
|
eliminateDeadCssNative: () => eliminateDeadCssNative,
|
|
2586
2699
|
emitPluginHook: () => emitPluginHook,
|
|
2587
2700
|
estimateOptimalCacheConfig: () => estimateOptimalCacheConfig,
|
|
2701
|
+
estimateOptimalCacheConfigNative: () => estimateOptimalCacheConfigNative,
|
|
2588
2702
|
extractAllClasses: () => extractAllClasses,
|
|
2589
2703
|
extractAndGenerateStateCss: () => extractAndGenerateStateCss,
|
|
2590
2704
|
extractAndGenerateStateCssNative: () => extractAndGenerateStateCssNative,
|
|
@@ -2598,6 +2712,8 @@ __export(internal_exports, {
|
|
|
2598
2712
|
fileToRoute: () => fileToRoute,
|
|
2599
2713
|
findDeadVariants: () => findDeadVariants,
|
|
2600
2714
|
generateAtomicCss: () => generateAtomicCss,
|
|
2715
|
+
generateCss: () => generateCss,
|
|
2716
|
+
generateCssBatch: () => generateCssBatch,
|
|
2601
2717
|
generateCssForClasses: () => generateCssForClasses,
|
|
2602
2718
|
generateCssNative: () => generateCssNative,
|
|
2603
2719
|
generateSafelist: () => generateSafelist,
|
|
@@ -2613,10 +2729,14 @@ __export(internal_exports, {
|
|
|
2613
2729
|
getCompilerDiagnostics: () => getCompilerDiagnostics,
|
|
2614
2730
|
getContentPaths: () => getContentPaths,
|
|
2615
2731
|
getIncrementalEngine: () => getIncrementalEngine,
|
|
2732
|
+
getMemoryRecommendationsNative: () => getMemoryRecommendationsNative,
|
|
2733
|
+
getMemoryStatsNative: () => getMemoryStatsNative,
|
|
2616
2734
|
getNativeBridge: () => getNativeBridge,
|
|
2617
2735
|
getPluginHooks: () => getPluginHooks,
|
|
2736
|
+
getResolverPoolStats: () => getResolverPoolStats,
|
|
2618
2737
|
getRouteClasses: () => getRouteClasses,
|
|
2619
2738
|
getWatchStats: () => getWatchStats,
|
|
2739
|
+
getWeek6FeaturesStatus: () => getWeek6FeaturesStatus,
|
|
2620
2740
|
hasTwUsage: () => hasTwUsage,
|
|
2621
2741
|
hashContent: () => hashContent,
|
|
2622
2742
|
hoistComponentsNative: () => hoistComponentsNative,
|
|
@@ -2645,6 +2765,7 @@ __export(internal_exports, {
|
|
|
2645
2765
|
normalizeClasses: () => normalizeClasses,
|
|
2646
2766
|
optimizeCssNative: () => optimizeCssNative,
|
|
2647
2767
|
parseAtomicClass: () => parseAtomicClass,
|
|
2768
|
+
parseClass: () => parseClass,
|
|
2648
2769
|
parseClasses: () => parseClasses,
|
|
2649
2770
|
pollWatchEvents: () => pollWatchEvents,
|
|
2650
2771
|
processFileChange: () => processFileChange,
|
|
@@ -2696,12 +2817,18 @@ __export(internal_exports, {
|
|
|
2696
2817
|
registerPropertyName: () => registerPropertyName,
|
|
2697
2818
|
registerValueName: () => registerValueName,
|
|
2698
2819
|
resetBucketEngine: () => resetBucketEngine,
|
|
2820
|
+
resetCacheStats: () => resetCacheStats,
|
|
2699
2821
|
resetCompilationMetrics: () => resetCompilationMetrics,
|
|
2700
2822
|
resetIncrementalEngine: () => resetIncrementalEngine,
|
|
2823
|
+
resetMemoryStats: () => resetMemoryStats,
|
|
2824
|
+
resetResolverPoolStats: () => resetResolverPoolStats,
|
|
2701
2825
|
resolveCascade: () => resolveCascade,
|
|
2702
2826
|
resolveClassNames: () => resolveClassNames,
|
|
2827
|
+
resolveColorCached: () => resolveColorCached,
|
|
2703
2828
|
resolveConflictGroup: () => resolveConflictGroup,
|
|
2829
|
+
resolveFontSizeCached: () => resolveFontSizeCached,
|
|
2704
2830
|
resolveSimpleVariants: () => resolveSimpleVariants,
|
|
2831
|
+
resolveSpacingCached: () => resolveSpacingCached,
|
|
2705
2832
|
resolveThemeValue: () => resolveThemeValue,
|
|
2706
2833
|
resolveVariants: () => resolveVariants,
|
|
2707
2834
|
reverseLookupProperty: () => reverseLookupProperty,
|
|
@@ -2947,7 +3074,11 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
2947
3074
|
return result;
|
|
2948
3075
|
}
|
|
2949
3076
|
function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
2950
|
-
const result = extractStaticStateCss(srcDir,
|
|
3077
|
+
const result = extractStaticStateCss(srcDir, {
|
|
3078
|
+
verbose: options.verbose,
|
|
3079
|
+
resolvedCss: options.resolvedCss || ""
|
|
3080
|
+
// ← ensure always passed
|
|
3081
|
+
});
|
|
2951
3082
|
const twClassesDir = path9__namespace.default.join(path9__namespace.default.dirname(safelistPath), "tw-classes");
|
|
2952
3083
|
fs13__namespace.default.mkdirSync(twClassesDir, { recursive: true });
|
|
2953
3084
|
const stateFilePath = path9__namespace.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
@@ -3385,8 +3516,44 @@ var init_nativeBridge = __esm({
|
|
|
3385
3516
|
try {
|
|
3386
3517
|
const binding = _loadNative(result.path);
|
|
3387
3518
|
if (isValidNativeBridge(binding)) {
|
|
3388
|
-
|
|
3389
|
-
|
|
3519
|
+
const toCamelCase = (str) => {
|
|
3520
|
+
return str.replace(/_([a-z0-9])/g, (_, g) => g.toUpperCase());
|
|
3521
|
+
};
|
|
3522
|
+
nativeBridge = new Proxy(binding, {
|
|
3523
|
+
get(target, prop) {
|
|
3524
|
+
if (typeof prop === "string") {
|
|
3525
|
+
if (prop in target) {
|
|
3526
|
+
return target[prop];
|
|
3527
|
+
}
|
|
3528
|
+
const camelKey = toCamelCase(prop);
|
|
3529
|
+
if (camelKey in target) {
|
|
3530
|
+
const val = target[camelKey];
|
|
3531
|
+
if (typeof val === "function") {
|
|
3532
|
+
return val.bind(target);
|
|
3533
|
+
}
|
|
3534
|
+
return val;
|
|
3535
|
+
}
|
|
3536
|
+
const napiKey = `${camelKey}Napi`;
|
|
3537
|
+
if (napiKey in target) {
|
|
3538
|
+
const val = target[napiKey];
|
|
3539
|
+
if (typeof val === "function") {
|
|
3540
|
+
return val.bind(target);
|
|
3541
|
+
}
|
|
3542
|
+
return val;
|
|
3543
|
+
}
|
|
3544
|
+
const napiInnerKey = `${camelKey}NapiInner`;
|
|
3545
|
+
if (napiInnerKey in target) {
|
|
3546
|
+
const val = target[napiInnerKey];
|
|
3547
|
+
if (typeof val === "function") {
|
|
3548
|
+
return val.bind(target);
|
|
3549
|
+
}
|
|
3550
|
+
return val;
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
return target[prop];
|
|
3554
|
+
}
|
|
3555
|
+
});
|
|
3556
|
+
log("Native bridge loaded successfully and proxy-wrapped from:", result.path);
|
|
3390
3557
|
return nativeBridge;
|
|
3391
3558
|
}
|
|
3392
3559
|
} catch (e) {
|
|
@@ -3655,9 +3822,9 @@ var init_src2 = __esm({
|
|
|
3655
3822
|
if (normalized.includes("/layout.") || normalized.includes("/loading.") || normalized.includes("/error.")) {
|
|
3656
3823
|
return "__global";
|
|
3657
3824
|
}
|
|
3658
|
-
const pageMatch = normalized.match(
|
|
3825
|
+
const pageMatch = normalized.match(/(?:^|\/)app\/(.+?)\/page\.[tj]sx?$/);
|
|
3659
3826
|
if (pageMatch) return `/${pageMatch[1]}`;
|
|
3660
|
-
const rootPage = normalized.match(
|
|
3827
|
+
const rootPage = normalized.match(/(?:^|\/)app\/page\.[tj]sx?$/);
|
|
3661
3828
|
if (rootPage) return "/";
|
|
3662
3829
|
return null;
|
|
3663
3830
|
};
|
|
@@ -4833,7 +5000,7 @@ function sanitizeFrequentThreshold(value) {
|
|
|
4833
5000
|
// packages/domain/analyzer/src/binding.ts
|
|
4834
5001
|
var isAnalyzerModule = (module) => {
|
|
4835
5002
|
const candidate = module;
|
|
4836
|
-
return typeof candidate?.analyzeClasses === "function";
|
|
5003
|
+
return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
|
|
4837
5004
|
};
|
|
4838
5005
|
var createAnalyzerBindingLoader = () => {
|
|
4839
5006
|
const _state = { bindingPromise: null };
|
|
@@ -4852,7 +5019,7 @@ var createAnalyzerBindingLoader = () => {
|
|
|
4852
5019
|
runtimeDir,
|
|
4853
5020
|
candidates,
|
|
4854
5021
|
isValid: isAnalyzerModule,
|
|
4855
|
-
invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
|
|
5022
|
+
invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
|
|
4856
5023
|
});
|
|
4857
5024
|
if (binding) {
|
|
4858
5025
|
debugLog(`native binding loaded from: ${loadedPath}`);
|
|
@@ -4895,7 +5062,7 @@ async function requireNativeBinding() {
|
|
|
4895
5062
|
runtimeDir,
|
|
4896
5063
|
candidates,
|
|
4897
5064
|
isValid: isAnalyzerModule,
|
|
4898
|
-
invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
|
|
5065
|
+
invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
|
|
4899
5066
|
});
|
|
4900
5067
|
const lines = [
|
|
4901
5068
|
"Native analyzer binding not found. Ensure `tailwind_styled_parser.node` is built."
|
|
@@ -5315,7 +5482,8 @@ async function analyzeWorkspace(root, options = {}) {
|
|
|
5315
5482
|
);
|
|
5316
5483
|
const nativeReport = (() => {
|
|
5317
5484
|
try {
|
|
5318
|
-
const
|
|
5485
|
+
const fn = binding.analyzeClassesWorkspace || binding.analyzeClasses;
|
|
5486
|
+
const report = fn(filesJson, resolvedRoot, topLimit);
|
|
5319
5487
|
if (!report) {
|
|
5320
5488
|
throw new Error(`Native analyzer returned no report for "${resolvedRoot}".`);
|
|
5321
5489
|
}
|