tailwind-styled-v4 5.0.11 → 5.0.12

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 (107) hide show
  1. package/dist/{analyzeWorkspace-DDOQdzzI.d.ts → analyzeWorkspace-CopJNGmi.d.ts} +2 -0
  2. package/dist/{analyzeWorkspace-BS5O4rhC.d.mts → analyzeWorkspace-DpVPccjz.d.mts} +2 -0
  3. package/dist/analyzer.d.mts +4 -4
  4. package/dist/analyzer.d.ts +4 -4
  5. package/dist/analyzer.js +34 -69
  6. package/dist/analyzer.js.map +1 -1
  7. package/dist/analyzer.mjs +33 -68
  8. package/dist/analyzer.mjs.map +1 -1
  9. package/dist/animate.js +11 -11
  10. package/dist/animate.js.map +1 -1
  11. package/dist/animate.mjs +11 -11
  12. package/dist/animate.mjs.map +1 -1
  13. package/dist/atomic.js +16 -7
  14. package/dist/atomic.js.map +1 -1
  15. package/dist/atomic.mjs +16 -7
  16. package/dist/atomic.mjs.map +1 -1
  17. package/dist/cli.js +262 -190
  18. package/dist/cli.js.map +1 -1
  19. package/dist/cli.mjs +259 -187
  20. package/dist/cli.mjs.map +1 -1
  21. package/dist/compiler.d.mts +2543 -109
  22. package/dist/compiler.d.ts +2543 -109
  23. package/dist/compiler.js +1962 -435
  24. package/dist/compiler.js.map +1 -1
  25. package/dist/compiler.mjs +1816 -382
  26. package/dist/compiler.mjs.map +1 -1
  27. package/dist/devtools.js +17 -4
  28. package/dist/devtools.js.map +1 -1
  29. package/dist/devtools.mjs +17 -4
  30. package/dist/devtools.mjs.map +1 -1
  31. package/dist/engine.d.mts +11 -470
  32. package/dist/engine.d.ts +11 -470
  33. package/dist/engine.js +1442 -417
  34. package/dist/engine.js.map +1 -1
  35. package/dist/engine.mjs +1442 -417
  36. package/dist/engine.mjs.map +1 -1
  37. package/dist/index-BDQw13kn.d.ts +464 -0
  38. package/dist/index-DJv28Uzq.d.mts +464 -0
  39. package/dist/index.browser.mjs +143 -255
  40. package/dist/index.browser.mjs.map +1 -1
  41. package/dist/index.d.mts +23 -39
  42. package/dist/index.d.ts +23 -39
  43. package/dist/index.js +6000 -1463
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +5995 -1458
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/next.d.mts +44 -1
  48. package/dist/next.d.ts +44 -1
  49. package/dist/next.js +3197 -1128
  50. package/dist/next.js.map +1 -1
  51. package/dist/next.mjs +3196 -1129
  52. package/dist/next.mjs.map +1 -1
  53. package/dist/rspack.d.mts +9 -0
  54. package/dist/rspack.d.ts +9 -0
  55. package/dist/rspack.js +99 -61
  56. package/dist/rspack.js.map +1 -1
  57. package/dist/rspack.mjs +99 -61
  58. package/dist/rspack.mjs.map +1 -1
  59. package/dist/runtime-css.d.mts +8 -0
  60. package/dist/runtime-css.d.ts +8 -0
  61. package/dist/runtime-css.js +23 -7
  62. package/dist/runtime-css.js.map +1 -1
  63. package/dist/runtime-css.mjs +23 -7
  64. package/dist/runtime-css.mjs.map +1 -1
  65. package/dist/scanner.js +16 -37
  66. package/dist/scanner.js.map +1 -1
  67. package/dist/scanner.mjs +15 -36
  68. package/dist/scanner.mjs.map +1 -1
  69. package/dist/shared.d.mts +107 -1
  70. package/dist/shared.d.ts +107 -1
  71. package/dist/shared.js +1627 -376
  72. package/dist/shared.js.map +1 -1
  73. package/dist/shared.mjs +1620 -354
  74. package/dist/shared.mjs.map +1 -1
  75. package/dist/svelte.js +39 -35
  76. package/dist/svelte.js.map +1 -1
  77. package/dist/svelte.mjs +38 -34
  78. package/dist/svelte.mjs.map +1 -1
  79. package/dist/theme.js +85 -76
  80. package/dist/theme.js.map +1 -1
  81. package/dist/theme.mjs +83 -74
  82. package/dist/theme.mjs.map +1 -1
  83. package/dist/turbopackLoader.js +943 -76
  84. package/dist/turbopackLoader.js.map +1 -1
  85. package/dist/turbopackLoader.mjs +943 -76
  86. package/dist/turbopackLoader.mjs.map +1 -1
  87. package/dist/tw.js +262 -190
  88. package/dist/tw.js.map +1 -1
  89. package/dist/tw.mjs +259 -187
  90. package/dist/tw.mjs.map +1 -1
  91. package/dist/vite.js +1336 -296
  92. package/dist/vite.js.map +1 -1
  93. package/dist/vite.mjs +1336 -296
  94. package/dist/vite.mjs.map +1 -1
  95. package/dist/vue.js +39 -35
  96. package/dist/vue.js.map +1 -1
  97. package/dist/vue.mjs +38 -34
  98. package/dist/vue.mjs.map +1 -1
  99. package/dist/webpackLoader.js +140 -34
  100. package/dist/webpackLoader.js.map +1 -1
  101. package/dist/webpackLoader.mjs +140 -34
  102. package/dist/webpackLoader.mjs.map +1 -1
  103. package/native/index.node +0 -0
  104. package/native/tailwind-styled-native.node +0 -0
  105. package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
  106. package/package.json +9 -4
  107. package/CHANGELOG.md +0 -285
package/dist/analyzer.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'crypto';
2
- import fs4 from 'fs';
2
+ import fs3 from 'fs';
3
3
  import path5 from 'path';
4
4
  import { fileURLToPath, pathToFileURL } from 'url';
5
5
  import { createRequire } from 'module';
@@ -69,7 +69,7 @@ function loadNativeBinding(options) {
69
69
  for (const candidate of candidates) {
70
70
  const candidatePath = path5.resolve(runtimeDir, candidate);
71
71
  try {
72
- if (!fs4.existsSync(candidatePath) && !fs4.existsSync(candidatePath + ".node")) {
72
+ if (!fs3.existsSync(candidatePath) && !fs3.existsSync(candidatePath + ".node")) {
73
73
  continue;
74
74
  }
75
75
  const mod = requireNativeModule(candidatePath);
@@ -101,9 +101,9 @@ function resolveNativeBindingCandidates(options) {
101
101
  }
102
102
  }
103
103
  if (!includeDefaultCandidates) return candidates;
104
- if (fs4.existsSync(runtimeDir)) {
104
+ if (fs3.existsSync(runtimeDir)) {
105
105
  try {
106
- for (const entry of fs4.readdirSync(runtimeDir)) {
106
+ for (const entry of fs3.readdirSync(runtimeDir)) {
107
107
  if (entry.endsWith(".node")) candidates.push(entry);
108
108
  }
109
109
  } catch {
@@ -519,7 +519,7 @@ function defaultCachePath(rootDir, cacheDir) {
519
519
  }
520
520
  function readCache(rootDir, cacheDir) {
521
521
  const cachePath = defaultCachePath(rootDir, cacheDir);
522
- fs4.mkdirSync(path5.dirname(cachePath), { recursive: true });
522
+ fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
523
523
  const result = cacheReadNative(cachePath);
524
524
  if (!result) return [];
525
525
  return result.entries.map((e) => ({
@@ -534,7 +534,7 @@ function readCache(rootDir, cacheDir) {
534
534
  }
535
535
  function writeCache(rootDir, entries, cacheDir) {
536
536
  const cachePath = defaultCachePath(rootDir, cacheDir);
537
- fs4.mkdirSync(path5.dirname(cachePath), { recursive: true });
537
+ fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
538
538
  const success = cacheWriteNative(cachePath, entries);
539
539
  if (!success) {
540
540
  throw new Error(
@@ -561,27 +561,7 @@ var init_cache_native = __esm({
561
561
  function collectFiles(rootDir, extensions, ignoreDirs) {
562
562
  const native = collectFilesNative(rootDir, extensions, ignoreDirs);
563
563
  if (native !== null) return native;
564
- const files = [];
565
- function walk(dir) {
566
- let entries;
567
- try {
568
- entries = fs4.readdirSync(dir, { withFileTypes: true });
569
- } catch {
570
- return;
571
- }
572
- for (const entry of entries) {
573
- const fullPath = path5.join(dir, entry.name);
574
- const rel = path5.relative(rootDir, fullPath);
575
- if (entry.isDirectory()) {
576
- const ignored = ignoreDirs.some((d) => entry.name === d || rel.startsWith(d + path5.sep));
577
- if (!ignored) walk(fullPath);
578
- } else if (isScannableFile(entry.name, extensions)) {
579
- files.push(fullPath);
580
- }
581
- }
582
- }
583
- walk(rootDir);
584
- return files;
564
+ throw new Error("FATAL: Native binding 'collectFiles' is required but not available.");
585
565
  }
586
566
  function mergeResults(batchResults) {
587
567
  const files = batchResults.map((r) => ({
@@ -591,8 +571,7 @@ function mergeResults(batchResults) {
591
571
  }));
592
572
  const native = rebuildWorkspaceResultNative(files);
593
573
  if (native) return native;
594
- const unique = new Set(files.flatMap((f) => f.classes));
595
- return { files, totalFiles: files.length, uniqueClasses: Array.from(unique).sort() };
574
+ throw new Error("FATAL: Native binding 'rebuildWorkspaceResult' is required but not available.");
596
575
  }
597
576
  function runChunkInWorker(filePaths) {
598
577
  return new Promise((resolve, reject) => {
@@ -731,7 +710,7 @@ __export(src_exports, {
731
710
  DEFAULT_IGNORES: () => DEFAULT_IGNORES,
732
711
  batchExtractClassesNative: () => batchExtractClassesNative,
733
712
  extractClassesNative: () => extractClassesNative,
734
- isScannableFile: () => isScannableFile,
713
+ isScannableFile: () => isScannableFile2,
735
714
  parseScanWorkspaceOptions: () => parseScanWorkspaceOptions,
736
715
  parseScanWorkspaceResult: () => parseScanWorkspaceResult,
737
716
  parseScannerWorkerMessage: () => parseScannerWorkerMessage,
@@ -765,7 +744,7 @@ function resolveScannerWorkerModulePath() {
765
744
  path5.resolve(runtimeDir, "worker.ts")
766
745
  ];
767
746
  for (const candidate of candidates) {
768
- if (fs4.existsSync(candidate)) return candidate;
747
+ if (fs3.existsSync(candidate)) return candidate;
769
748
  }
770
749
  return null;
771
750
  }
@@ -822,7 +801,7 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
822
801
  if (!currentDir) continue;
823
802
  const entries = (() => {
824
803
  try {
825
- return fs4.readdirSync(currentDir, { withFileTypes: true });
804
+ return fs3.readdirSync(currentDir, { withFileTypes: true });
826
805
  } catch {
827
806
  return [];
828
807
  }
@@ -860,7 +839,7 @@ function scanSource(source) {
860
839
  "FATAL: Native parser binding is required but not available.\nThis package requires native Rust bindings.\n\nResolution steps:\n1. Build the native Rust module: npm run build:rust"
861
840
  );
862
841
  }
863
- function isScannableFile(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
842
+ function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
864
843
  return includeExtensions.includes(path5.extname(filePath));
865
844
  }
866
845
  function scanFile(filePath) {
@@ -921,7 +900,7 @@ function scanWorkspace(rootDir, options = {}) {
921
900
  for (const filePath of candidates) {
922
901
  const stat = (() => {
923
902
  try {
924
- return fs4.statSync(filePath);
903
+ return fs3.statSync(filePath);
925
904
  } catch {
926
905
  return null;
927
906
  }
@@ -947,7 +926,7 @@ function scanWorkspace(rootDir, options = {}) {
947
926
  for (const { filePath, stat, size, cached } of ranked) {
948
927
  const content = (() => {
949
928
  try {
950
- return fs4.readFileSync(filePath, "utf8");
929
+ return fs3.readFileSync(filePath, "utf8");
951
930
  } catch {
952
931
  return null;
953
932
  }
@@ -1091,7 +1070,7 @@ var init_src2 = __esm({
1091
1070
  )
1092
1071
  ];
1093
1072
  for (const fullPath of candidates) {
1094
- if (!fs4.existsSync(fullPath)) continue;
1073
+ if (!fs3.existsSync(fullPath)) continue;
1095
1074
  try {
1096
1075
  const required = req(fullPath);
1097
1076
  if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
@@ -1145,7 +1124,7 @@ function isRecord(value) {
1145
1124
  }
1146
1125
  async function pathExists(filePath) {
1147
1126
  try {
1148
- await fs4.promises.access(filePath, fs4.constants.F_OK);
1127
+ await fs3.promises.access(filePath, fs3.constants.F_OK);
1149
1128
  return true;
1150
1129
  } catch {
1151
1130
  return false;
@@ -1361,27 +1340,13 @@ var splitVariantAndBase = (className) => {
1361
1340
  const base = parts.pop() ?? className;
1362
1341
  return { variantKey: parts.join(":"), base };
1363
1342
  };
1364
- var isArbitraryUtility = (baseClass) => {
1365
- return baseClass.includes("[") && baseClass.includes("]");
1366
- };
1367
- var resolveConflictGroup = (base) => {
1368
- if (isArbitraryUtility(base)) return null;
1369
- if (["block", "inline", "inline-block", "inline-flex", "flex", "grid", "hidden"].includes(base))
1370
- return "display";
1371
- if (base.startsWith("bg-")) return "bg";
1372
- if (base.startsWith("text-")) return "text";
1373
- if (base.startsWith("font-")) return "font";
1374
- if (base.startsWith("rounded")) return "rounded";
1375
- if (base.startsWith("shadow")) return "shadow";
1376
- if (base.startsWith("border-")) return "border";
1377
- if (base.startsWith("opacity-")) return "opacity";
1378
- if (base.startsWith("w-") || base.startsWith("min-w-") || base.startsWith("max-w-"))
1379
- return "width";
1380
- if (base.startsWith("h-") || base.startsWith("min-h-") || base.startsWith("max-h-"))
1381
- return "height";
1382
- if (base.startsWith("p-") || base.startsWith("px-") || base.startsWith("py-")) return "padding";
1383
- if (base.startsWith("m-") || base.startsWith("mx-") || base.startsWith("my-")) return "margin";
1384
- return null;
1343
+ var resolveConflictGroup = async (base) => {
1344
+ const native = await getNativeBinding();
1345
+ if (!native?.resolveConflictGroup) {
1346
+ throw new Error("Native binding 'resolveConflictGroup' is required but not available.");
1347
+ }
1348
+ const result = native.resolveConflictGroup(base);
1349
+ return result.length > 0 ? result : null;
1385
1350
  };
1386
1351
  var detectConflicts = async (usages) => {
1387
1352
  const native = await getNativeBinding();
@@ -1469,7 +1434,7 @@ var collectCustomUtilities = (config) => {
1469
1434
  return out;
1470
1435
  };
1471
1436
  var collectSafelistFromSource = async (configPath) => {
1472
- const source = await fs4.promises.readFile(configPath, "utf8");
1437
+ const source = await fs3.promises.readFile(configPath, "utf8");
1473
1438
  const { extractClassesNative: extractClassesNative2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
1474
1439
  const allTokens = extractClassesNative2(source);
1475
1440
  const hasSafelist = source.includes("safelist");
@@ -1496,7 +1461,7 @@ var loadTailwindConfig = async (root, semanticOption) => {
1496
1461
  customUtilities: /* @__PURE__ */ new Set()
1497
1462
  };
1498
1463
  }
1499
- const configStat = await fs4.promises.stat(configPath).catch(() => null);
1464
+ const configStat = await fs3.promises.stat(configPath).catch(() => null);
1500
1465
  if (configStat) {
1501
1466
  const cached = tailwindConfigCache.get(configPath);
1502
1467
  if (cached && cached.mtimeMs === configStat.mtimeMs && cached.size === configStat.size) {
@@ -1777,12 +1742,12 @@ async function analyzeWorkspace(root, options = {}) {
1777
1742
  }
1778
1743
 
1779
1744
  // packages/domain/analyzer/src/classToCss.ts
1780
- var normalizeClassInput = (input, _binding) => {
1745
+ var normalizeClassInput = (input, binding) => {
1781
1746
  if (typeof input === "string") {
1782
- if (_binding?.normalizeClassInput) {
1783
- return _binding.normalizeClassInput(input);
1747
+ if (!binding.normalizeClassInput) {
1748
+ throw new Error("FATAL: Native binding 'normalizeClassInput' is required but not available.");
1784
1749
  }
1785
- return input.split(/\s+/).map((item) => item.trim()).filter((item) => item.length > 0);
1750
+ return binding.normalizeClassInput(input);
1786
1751
  }
1787
1752
  if (!Array.isArray(input)) {
1788
1753
  throw new TypeError("classToCss input must be a string or an array of strings.");
@@ -1814,11 +1779,11 @@ var mergeDeclarationMap = (target, css, binding) => {
1814
1779
  }
1815
1780
  };
1816
1781
  var declarationMapToString = (declarationMap, binding) => {
1817
- const entries = Array.from(declarationMap.entries()).map(([property, value]) => ({ property, value }));
1818
- if (binding?.declarationMapToString) {
1819
- return binding.declarationMapToString(entries);
1782
+ if (!binding.declarationMapToString) {
1783
+ throw new Error("FATAL: Native binding 'declarationMapToString' is required but not available.");
1820
1784
  }
1821
- return entries.map(({ property, value }) => `${property}: ${value}`).join("; ");
1785
+ const entries = Array.from(declarationMap.entries()).map(([property, value]) => ({ property, value }));
1786
+ return binding.declarationMapToString(entries);
1822
1787
  };
1823
1788
  var classToCss = async (input, options = {}) => {
1824
1789
  const binding = await requireNativeCssCompiler();