tailwind-styled-v4 5.0.17 → 5.0.20

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.
Files changed (82) hide show
  1. package/dist/{analyzeWorkspace-CopJNGmi.d.ts → analyzeWorkspace-B1_XRfdl.d.ts} +1 -0
  2. package/dist/{analyzeWorkspace-DpVPccjz.d.mts → analyzeWorkspace-hYfu4Hg3.d.mts} +1 -0
  3. package/dist/analyzer.d.mts +2 -2
  4. package/dist/analyzer.d.ts +2 -2
  5. package/dist/analyzer.js +5 -4
  6. package/dist/analyzer.js.map +1 -1
  7. package/dist/analyzer.mjs +5 -4
  8. package/dist/analyzer.mjs.map +1 -1
  9. package/dist/animate.js +3 -3
  10. package/dist/animate.js.map +1 -1
  11. package/dist/animate.mjs +3 -3
  12. package/dist/animate.mjs.map +1 -1
  13. package/dist/atomic.js +52 -16
  14. package/dist/atomic.js.map +1 -1
  15. package/dist/atomic.mjs +52 -16
  16. package/dist/atomic.mjs.map +1 -1
  17. package/dist/cli.js +57 -20
  18. package/dist/cli.js.map +1 -1
  19. package/dist/cli.mjs +57 -20
  20. package/dist/cli.mjs.map +1 -1
  21. package/dist/compiler.d.mts +177 -2
  22. package/dist/compiler.d.ts +177 -2
  23. package/dist/compiler.js +186 -24
  24. package/dist/compiler.js.map +1 -1
  25. package/dist/compiler.mjs +173 -25
  26. package/dist/compiler.mjs.map +1 -1
  27. package/dist/engine.d.mts +3 -3
  28. package/dist/engine.d.ts +3 -3
  29. package/dist/engine.js +191 -27
  30. package/dist/engine.js.map +1 -1
  31. package/dist/engine.mjs +191 -27
  32. package/dist/engine.mjs.map +1 -1
  33. package/dist/{index-DJv28Uzq.d.mts → index-DQI6O24n.d.mts} +1 -1
  34. package/dist/{index-BDQw13kn.d.ts → index-UkYbyBkR.d.ts} +1 -1
  35. package/dist/index.browser.mjs +5 -66
  36. package/dist/index.browser.mjs.map +1 -1
  37. package/dist/index.d.mts +2 -2
  38. package/dist/index.d.ts +2 -2
  39. package/dist/index.js +241 -118
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +241 -118
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/next.js +202 -24
  44. package/dist/next.js.map +1 -1
  45. package/dist/next.mjs +202 -24
  46. package/dist/next.mjs.map +1 -1
  47. package/dist/plugin.d.mts +3 -3
  48. package/dist/plugin.d.ts +3 -3
  49. package/dist/plugin.js.map +1 -1
  50. package/dist/plugin.mjs.map +1 -1
  51. package/dist/shared.d.mts +2 -3
  52. package/dist/shared.d.ts +2 -3
  53. package/dist/shared.js +186 -23
  54. package/dist/shared.js.map +1 -1
  55. package/dist/shared.mjs +186 -23
  56. package/dist/shared.mjs.map +1 -1
  57. package/dist/svelte.js +24 -42
  58. package/dist/svelte.js.map +1 -1
  59. package/dist/svelte.mjs +24 -42
  60. package/dist/svelte.mjs.map +1 -1
  61. package/dist/turbopackLoader.js +186 -23
  62. package/dist/turbopackLoader.js.map +1 -1
  63. package/dist/turbopackLoader.mjs +186 -23
  64. package/dist/turbopackLoader.mjs.map +1 -1
  65. package/dist/tw.js +57 -20
  66. package/dist/tw.js.map +1 -1
  67. package/dist/tw.mjs +57 -20
  68. package/dist/tw.mjs.map +1 -1
  69. package/dist/vite.js +324 -160
  70. package/dist/vite.js.map +1 -1
  71. package/dist/vite.mjs +324 -160
  72. package/dist/vite.mjs.map +1 -1
  73. package/dist/vue.js +24 -42
  74. package/dist/vue.js.map +1 -1
  75. package/dist/vue.mjs +24 -42
  76. package/dist/vue.mjs.map +1 -1
  77. package/dist/webpackLoader.js +52 -16
  78. package/dist/webpackLoader.js.map +1 -1
  79. package/dist/webpackLoader.mjs +52 -16
  80. package/dist/webpackLoader.mjs.map +1 -1
  81. package/native/tailwind-styled-native.node +0 -0
  82. package/package.json +1 -4
package/dist/engine.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-DJv28Uzq.mjs';
2
- export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-DJv28Uzq.mjs';
1
+ import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-DQI6O24n.mjs';
2
+ export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-DQI6O24n.mjs';
3
3
  import { z } from 'zod';
4
4
  import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.mjs';
5
5
  export { S as ScanFileResult } from './schemas-DR-SLxZZ.mjs';
6
- import './analyzeWorkspace-DpVPccjz.mjs';
6
+ import './analyzeWorkspace-hYfu4Hg3.mjs';
7
7
 
8
8
  interface ClassBundleInfo {
9
9
  className: string;
package/dist/engine.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-BDQw13kn.js';
2
- export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-BDQw13kn.js';
1
+ import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-UkYbyBkR.js';
2
+ export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-UkYbyBkR.js';
3
3
  import { z } from 'zod';
4
4
  import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.js';
5
5
  export { S as ScanFileResult } from './schemas-DR-SLxZZ.js';
6
- import './analyzeWorkspace-CopJNGmi.js';
6
+ import './analyzeWorkspace-B1_XRfdl.js';
7
7
 
8
8
  interface ClassBundleInfo {
9
9
  className: string;
package/dist/engine.js CHANGED
@@ -881,15 +881,27 @@ function resolveNativeBinary(runtimeDir) {
881
881
  }
882
882
  tried.push(`env:${envPath} (not found)`);
883
883
  }
884
+ const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
885
+ for (const pkg of prebuiltPkgs) {
886
+ try {
887
+ const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
888
+ if (fs3__namespace.existsSync(candidate)) {
889
+ return { path: candidate, source: "prebuilt", platform, tried };
890
+ }
891
+ tried.push(`prebuilt:${pkg} (resolved but missing)`);
892
+ } catch {
893
+ tried.push(`prebuilt:${pkg} (not installed)`);
894
+ }
895
+ }
884
896
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
885
- const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser", "index"];
897
+ const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
886
898
  if (runtimeDir) {
887
899
  for (const depth of ["..", path9__namespace.join("..", ".."), path9__namespace.join("..", "..", "..")]) {
888
900
  const pkgRoot = path9__namespace.resolve(runtimeDir, depth);
889
901
  for (const bin of BINARY_NAMES_SELF) {
890
902
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
891
903
  const candidate = path9__namespace.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
892
- tried.push(`native:${candidate}`);
904
+ tried.push(`self-bundled:${candidate}`);
893
905
  if (fs3__namespace.existsSync(candidate)) {
894
906
  return { path: candidate, source: "prebuilt", platform, tried };
895
907
  }
@@ -897,18 +909,6 @@ function resolveNativeBinary(runtimeDir) {
897
909
  }
898
910
  }
899
911
  }
900
- const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
901
- for (const pkg of prebuiltPkgs) {
902
- try {
903
- const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
904
- if (fs3__namespace.existsSync(candidate)) {
905
- return { path: candidate, source: "prebuilt", platform, tried };
906
- }
907
- tried.push(`prebuilt:${pkg} (resolved but missing)`);
908
- } catch {
909
- tried.push(`prebuilt:${pkg} (not installed)`);
910
- }
911
- }
912
912
  const cwd = process.cwd();
913
913
  const base = runtimeDir ?? cwd;
914
914
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
@@ -1046,8 +1046,44 @@ var init_nativeBridge = __esm({
1046
1046
  try {
1047
1047
  const binding = _loadNative(result.path);
1048
1048
  if (isValidNativeBridge(binding)) {
1049
- nativeBridge = binding;
1050
- log("Native bridge loaded successfully from:", result.path);
1049
+ const toCamelCase = (str) => {
1050
+ return str.replace(/_([a-z0-9])/g, (_, g) => g.toUpperCase());
1051
+ };
1052
+ nativeBridge = new Proxy(binding, {
1053
+ get(target, prop) {
1054
+ if (typeof prop === "string") {
1055
+ if (prop in target) {
1056
+ return target[prop];
1057
+ }
1058
+ const camelKey = toCamelCase(prop);
1059
+ if (camelKey in target) {
1060
+ const val = target[camelKey];
1061
+ if (typeof val === "function") {
1062
+ return val.bind(target);
1063
+ }
1064
+ return val;
1065
+ }
1066
+ const napiKey = `${camelKey}Napi`;
1067
+ if (napiKey in target) {
1068
+ const val = target[napiKey];
1069
+ if (typeof val === "function") {
1070
+ return val.bind(target);
1071
+ }
1072
+ return val;
1073
+ }
1074
+ const napiInnerKey = `${camelKey}NapiInner`;
1075
+ if (napiInnerKey in target) {
1076
+ const val = target[napiInnerKey];
1077
+ if (typeof val === "function") {
1078
+ return val.bind(target);
1079
+ }
1080
+ return val;
1081
+ }
1082
+ }
1083
+ return target[prop];
1084
+ }
1085
+ });
1086
+ log("Native bridge loaded successfully and proxy-wrapped from:", result.path);
1051
1087
  return nativeBridge;
1052
1088
  }
1053
1089
  } catch (e) {
@@ -1095,8 +1131,8 @@ async function generateCssNative(classes, options) {
1095
1131
  return css;
1096
1132
  }
1097
1133
  function clearThemeCache() {
1134
+ const native = getNativeBridge();
1098
1135
  try {
1099
- const native = getNativeBridge();
1100
1136
  if (!native?.clearThemeCache) {
1101
1137
  return;
1102
1138
  }
@@ -1104,6 +1140,16 @@ function clearThemeCache() {
1104
1140
  } catch {
1105
1141
  }
1106
1142
  }
1143
+ function resetCacheStats() {
1144
+ const native = getNativeBridge();
1145
+ try {
1146
+ if (!native?.resetCacheStats) {
1147
+ return;
1148
+ }
1149
+ native.resetCacheStats();
1150
+ } catch {
1151
+ }
1152
+ }
1107
1153
  var init_cssGeneratorNative = __esm({
1108
1154
  "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
1109
1155
  init_nativeBridge();
@@ -1229,6 +1275,16 @@ function minifyCss(css) {
1229
1275
  if (!native?.minify_css) throw new Error("minify_css not available");
1230
1276
  return native.minify_css(css);
1231
1277
  }
1278
+ function generateCss(ruleJson, minify) {
1279
+ const native = getNativeBridge();
1280
+ if (!native?.generate_css) throw new Error("generate_css not available");
1281
+ return native.generate_css(ruleJson, minify);
1282
+ }
1283
+ function generateCssBatch(rulesJson, minify) {
1284
+ const native = getNativeBridge();
1285
+ if (!native?.generate_css_batch) throw new Error("generate_css_batch not available");
1286
+ return native.generate_css_batch(rulesJson, minify);
1287
+ }
1232
1288
  function compileAnimation(animationName, from, to) {
1233
1289
  const native = getNativeBridge();
1234
1290
  if (!native?.compile_animation) throw new Error("compile_animation not available");
@@ -1666,7 +1722,7 @@ function postProcessWithLightning(rawCss) {
1666
1722
  }
1667
1723
  return result.css;
1668
1724
  }
1669
- async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
1725
+ async function runCssPipeline(classes, cssEntryContent, root, minify = true, minifier = "lightning") {
1670
1726
  const filtered = classes.filter(Boolean);
1671
1727
  const uniqueMap = /* @__PURE__ */ new Map();
1672
1728
  filtered.forEach((cls) => uniqueMap.set(cls, cls));
@@ -1674,7 +1730,7 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
1674
1730
  if (unique.length === 0) {
1675
1731
  return { css: "", classes: [], sizeBytes: 0, optimized: false };
1676
1732
  }
1677
- const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root);
1733
+ const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root) + `|${minifier}`;
1678
1734
  const cached = _cssCache.get(cacheKey);
1679
1735
  if (cached) {
1680
1736
  _cacheHits++;
@@ -1691,7 +1747,14 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
1691
1747
  const theme = getThemeConfig();
1692
1748
  rawCss = await generateCssNative(unique, { theme });
1693
1749
  usedRustCompiler = true;
1694
- const finalCss = minify ? postProcessWithLightning(rawCss) : rawCss;
1750
+ let finalCss = rawCss;
1751
+ if (minify) {
1752
+ if (minifier === "fast") {
1753
+ finalCss = minifyCss(rawCss);
1754
+ } else {
1755
+ finalCss = postProcessWithLightning(rawCss);
1756
+ }
1757
+ }
1695
1758
  if (process.env.DEBUG?.includes("compiler")) {
1696
1759
  console.log(
1697
1760
  `[Compiler] Generated CSS from ${unique.length} classes (${usedRustCompiler ? "Rust" : "JavaScript"})`,
@@ -1727,6 +1790,7 @@ var init_tailwindEngine = __esm({
1727
1790
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1728
1791
  init_nativeBridge();
1729
1792
  init_cssGeneratorNative();
1793
+ init_cssCompilationNative();
1730
1794
  module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
1731
1795
  _cssCache = /* @__PURE__ */ new Map();
1732
1796
  _cacheHits = 0;
@@ -1759,9 +1823,10 @@ __export(parser_exports, {
1759
1823
  mergeClassesStatic: () => mergeClassesStatic,
1760
1824
  normalizeAndDedupClasses: () => normalizeAndDedupClasses,
1761
1825
  normalizeClasses: () => normalizeClasses,
1826
+ parseClass: () => parseClass,
1762
1827
  parseClasses: () => parseClasses
1763
1828
  });
1764
- var parseClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1829
+ var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1765
1830
  var init_parser = __esm({
1766
1831
  "packages/domain/compiler/src/parser/index.ts"() {
1767
1832
  init_nativeBridge();
@@ -1772,6 +1837,14 @@ var init_parser = __esm({
1772
1837
  }
1773
1838
  return native.parseClasses(raw) || [];
1774
1839
  };
1840
+ parseClass = (input) => {
1841
+ const native = getNativeBridge();
1842
+ if (!native?.parseClass) {
1843
+ throw new Error("FATAL: Native binding 'parseClass' is required but not available.");
1844
+ }
1845
+ const result = native.parseClass(input);
1846
+ return typeof result === "string" ? JSON.parse(result) : result;
1847
+ };
1775
1848
  extractAllClasses = (source) => {
1776
1849
  const native = getNativeBridge();
1777
1850
  if (!native?.extractAllClasses) {
@@ -1903,6 +1976,35 @@ function mergeCssDeclarationsNative(cssChunks) {
1903
1976
  if (!native?.mergeCssDeclarations) throw new Error("mergeCssDeclarations not available");
1904
1977
  return native.mergeCssDeclarations(cssChunks);
1905
1978
  }
1979
+ function getWeek6FeaturesStatus() {
1980
+ const native = getNativeBridge();
1981
+ if (!native?.getWeek6FeaturesStatus) throw new Error("getWeek6FeaturesStatus not available");
1982
+ const resultJson = native.getWeek6FeaturesStatus();
1983
+ return JSON.parse(resultJson);
1984
+ }
1985
+ function getMemoryStatsNative() {
1986
+ const native = getNativeBridge();
1987
+ if (!native?.getMemoryStatsNative) throw new Error("getMemoryStatsNative not available");
1988
+ const resultJson = native.getMemoryStatsNative();
1989
+ return JSON.parse(resultJson);
1990
+ }
1991
+ function getMemoryRecommendationsNative() {
1992
+ const native = getNativeBridge();
1993
+ if (!native?.getMemoryRecommendationsNative) throw new Error("getMemoryRecommendationsNative not available");
1994
+ const resultJson = native.getMemoryRecommendationsNative();
1995
+ return JSON.parse(resultJson);
1996
+ }
1997
+ function estimateOptimalCacheConfigNative(workloadType, expectedEntries) {
1998
+ const native = getNativeBridge();
1999
+ if (!native?.estimateOptimalCacheConfigNative) throw new Error("estimateOptimalCacheConfigNative not available");
2000
+ const resultJson = native.estimateOptimalCacheConfigNative(workloadType, expectedEntries);
2001
+ return JSON.parse(resultJson);
2002
+ }
2003
+ function resetMemoryStats() {
2004
+ const native = getNativeBridge();
2005
+ if (!native?.resetMemoryStats) throw new Error("resetMemoryStats not available");
2006
+ native.resetMemoryStats();
2007
+ }
1906
2008
  var init_analyzerNative = __esm({
1907
2009
  "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
1908
2010
  init_nativeBridge();
@@ -2192,6 +2294,52 @@ function cachePriority(mtimeMs, sizeBytes, hitCount) {
2192
2294
  if (!native?.cache_priority) throw new Error("cache_priority not available");
2193
2295
  return native.cache_priority(mtimeMs, sizeBytes, hitCount);
2194
2296
  }
2297
+ function getResolverPoolStats() {
2298
+ const native = getNativeBridge();
2299
+ if (!native?.getResolverPoolStats) throw new Error("getResolverPoolStats not available");
2300
+ const statsJson = native.getResolverPoolStats();
2301
+ try {
2302
+ return JSON.parse(statsJson);
2303
+ } catch {
2304
+ return {
2305
+ hits: 0,
2306
+ misses: 0,
2307
+ total: 0,
2308
+ hit_rate: 0,
2309
+ cached_resolvers: 0
2310
+ };
2311
+ }
2312
+ }
2313
+ function clearResolverPool() {
2314
+ const native = getNativeBridge();
2315
+ if (!native?.clearResolverPool) throw new Error("clearResolverPool not available");
2316
+ const resultJson = native.clearResolverPool();
2317
+ try {
2318
+ return JSON.parse(resultJson);
2319
+ } catch {
2320
+ return { status: "error" };
2321
+ }
2322
+ }
2323
+ function resolveColorCached(themeId, color, configJson) {
2324
+ const native = getNativeBridge();
2325
+ if (!native?.resolveColorCached) throw new Error("resolveColorCached not available");
2326
+ return native.resolveColorCached(themeId, color, configJson);
2327
+ }
2328
+ function resolveSpacingCached(themeId, spacing, configJson) {
2329
+ const native = getNativeBridge();
2330
+ if (!native?.resolveSpacingCached) throw new Error("resolveSpacingCached not available");
2331
+ return native.resolveSpacingCached(themeId, spacing, configJson);
2332
+ }
2333
+ function resolveFontSizeCached(themeId, size, configJson) {
2334
+ const native = getNativeBridge();
2335
+ if (!native?.resolveFontSizeCached) throw new Error("resolveFontSizeCached not available");
2336
+ return native.resolveFontSizeCached(themeId, size, configJson);
2337
+ }
2338
+ function resetResolverPoolStats() {
2339
+ const native = getNativeBridge();
2340
+ if (!native?.resetResolverPoolStats) throw new Error("resetResolverPoolStats not available");
2341
+ native.resetResolverPoolStats();
2342
+ }
2195
2343
  var init_cacheNative = __esm({
2196
2344
  "packages/domain/compiler/src/cache/cacheNative.ts"() {
2197
2345
  init_nativeBridge();
@@ -2840,9 +2988,9 @@ var init_src = __esm({
2840
2988
  if (normalized.includes("/layout.") || normalized.includes("/loading.") || normalized.includes("/error.")) {
2841
2989
  return "__global";
2842
2990
  }
2843
- const pageMatch = normalized.match(/\/app\/(.+?)\/page\.[tj]sx?$/);
2991
+ const pageMatch = normalized.match(/(?:^|\/)app\/(.+?)\/page\.[tj]sx?$/);
2844
2992
  if (pageMatch) return `/${pageMatch[1]}`;
2845
- const rootPage = normalized.match(/\/app\/page\.[tj]sx?$/);
2993
+ const rootPage = normalized.match(/(?:^|\/)app\/page\.[tj]sx?$/);
2846
2994
  if (rootPage) return "/";
2847
2995
  return null;
2848
2996
  };
@@ -3001,6 +3149,7 @@ __export(internal_exports, {
3001
3149
  clearCssGenCache: () => clearCssGenCache,
3002
3150
  clearParseCache: () => clearParseCache,
3003
3151
  clearResolveCache: () => clearResolveCache,
3152
+ clearResolverPool: () => clearResolverPool,
3004
3153
  clearThemeCache: () => clearThemeCache,
3005
3154
  collectFiles: () => collectFiles,
3006
3155
  compileAnimation: () => compileAnimation,
@@ -3023,6 +3172,7 @@ __export(internal_exports, {
3023
3172
  eliminateDeadCssNative: () => eliminateDeadCssNative,
3024
3173
  emitPluginHook: () => emitPluginHook,
3025
3174
  estimateOptimalCacheConfig: () => estimateOptimalCacheConfig,
3175
+ estimateOptimalCacheConfigNative: () => estimateOptimalCacheConfigNative,
3026
3176
  extractAllClasses: () => extractAllClasses,
3027
3177
  extractAndGenerateStateCss: () => extractAndGenerateStateCss,
3028
3178
  extractAndGenerateStateCssNative: () => extractAndGenerateStateCssNative,
@@ -3036,6 +3186,8 @@ __export(internal_exports, {
3036
3186
  fileToRoute: () => fileToRoute,
3037
3187
  findDeadVariants: () => findDeadVariants,
3038
3188
  generateAtomicCss: () => generateAtomicCss,
3189
+ generateCss: () => generateCss,
3190
+ generateCssBatch: () => generateCssBatch,
3039
3191
  generateCssForClasses: () => generateCssForClasses,
3040
3192
  generateCssNative: () => generateCssNative,
3041
3193
  generateSafelist: () => generateSafelist,
@@ -3051,10 +3203,14 @@ __export(internal_exports, {
3051
3203
  getCompilerDiagnostics: () => getCompilerDiagnostics,
3052
3204
  getContentPaths: () => getContentPaths,
3053
3205
  getIncrementalEngine: () => getIncrementalEngine,
3206
+ getMemoryRecommendationsNative: () => getMemoryRecommendationsNative,
3207
+ getMemoryStatsNative: () => getMemoryStatsNative,
3054
3208
  getNativeBridge: () => getNativeBridge,
3055
3209
  getPluginHooks: () => getPluginHooks,
3210
+ getResolverPoolStats: () => getResolverPoolStats,
3056
3211
  getRouteClasses: () => getRouteClasses,
3057
3212
  getWatchStats: () => getWatchStats,
3213
+ getWeek6FeaturesStatus: () => getWeek6FeaturesStatus,
3058
3214
  hasTwUsage: () => hasTwUsage,
3059
3215
  hashContent: () => hashContent,
3060
3216
  hoistComponentsNative: () => hoistComponentsNative,
@@ -3083,6 +3239,7 @@ __export(internal_exports, {
3083
3239
  normalizeClasses: () => normalizeClasses,
3084
3240
  optimizeCssNative: () => optimizeCssNative,
3085
3241
  parseAtomicClass: () => parseAtomicClass,
3242
+ parseClass: () => parseClass,
3086
3243
  parseClasses: () => parseClasses,
3087
3244
  pollWatchEvents: () => pollWatchEvents,
3088
3245
  processFileChange: () => processFileChange,
@@ -3134,12 +3291,18 @@ __export(internal_exports, {
3134
3291
  registerPropertyName: () => registerPropertyName,
3135
3292
  registerValueName: () => registerValueName,
3136
3293
  resetBucketEngine: () => resetBucketEngine,
3294
+ resetCacheStats: () => resetCacheStats,
3137
3295
  resetCompilationMetrics: () => resetCompilationMetrics,
3138
3296
  resetIncrementalEngine: () => resetIncrementalEngine,
3297
+ resetMemoryStats: () => resetMemoryStats,
3298
+ resetResolverPoolStats: () => resetResolverPoolStats,
3139
3299
  resolveCascade: () => resolveCascade,
3140
3300
  resolveClassNames: () => resolveClassNames,
3301
+ resolveColorCached: () => resolveColorCached,
3141
3302
  resolveConflictGroup: () => resolveConflictGroup,
3303
+ resolveFontSizeCached: () => resolveFontSizeCached,
3142
3304
  resolveSimpleVariants: () => resolveSimpleVariants,
3305
+ resolveSpacingCached: () => resolveSpacingCached,
3143
3306
  resolveThemeValue: () => resolveThemeValue,
3144
3307
  resolveVariants: () => resolveVariants,
3145
3308
  reverseLookupProperty: () => reverseLookupProperty,
@@ -5415,7 +5578,7 @@ function sanitizeFrequentThreshold(value) {
5415
5578
  // packages/domain/analyzer/src/binding.ts
5416
5579
  var isAnalyzerModule = (module) => {
5417
5580
  const candidate = module;
5418
- return typeof candidate?.analyzeClasses === "function";
5581
+ return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
5419
5582
  };
5420
5583
  var createAnalyzerBindingLoader = () => {
5421
5584
  const _state = { bindingPromise: null };
@@ -5434,7 +5597,7 @@ var createAnalyzerBindingLoader = () => {
5434
5597
  runtimeDir,
5435
5598
  candidates,
5436
5599
  isValid: isAnalyzerModule,
5437
- invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
5600
+ invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
5438
5601
  });
5439
5602
  if (binding) {
5440
5603
  debugLog(`native binding loaded from: ${loadedPath}`);
@@ -5477,7 +5640,7 @@ async function requireNativeBinding() {
5477
5640
  runtimeDir,
5478
5641
  candidates,
5479
5642
  isValid: isAnalyzerModule,
5480
- invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
5643
+ invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
5481
5644
  });
5482
5645
  const lines = [
5483
5646
  "Native analyzer binding not found. Ensure `tailwind_styled_parser.node` is built."
@@ -5897,7 +6060,8 @@ async function analyzeWorkspace(root, options = {}) {
5897
6060
  );
5898
6061
  const nativeReport = (() => {
5899
6062
  try {
5900
- const report = binding.analyzeClasses(filesJson, resolvedRoot, topLimit);
6063
+ const fn = binding.analyzeClassesWorkspace || binding.analyzeClasses;
6064
+ const report = fn(filesJson, resolvedRoot, topLimit);
5901
6065
  if (!report) {
5902
6066
  throw new Error(`Native analyzer returned no report for "${resolvedRoot}".`);
5903
6067
  }