tailwind-styled-v4 5.0.40 → 5.0.411

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 (101) hide show
  1. package/dist/analyzer.js +43 -16
  2. package/dist/analyzer.js.map +1 -1
  3. package/dist/analyzer.mjs +104 -72
  4. package/dist/analyzer.mjs.map +1 -1
  5. package/dist/animate.js +33 -7
  6. package/dist/animate.js.map +1 -1
  7. package/dist/animate.mjs +55 -22
  8. package/dist/animate.mjs.map +1 -1
  9. package/dist/atomic.js +39 -10
  10. package/dist/atomic.js.map +1 -1
  11. package/dist/atomic.mjs +56 -23
  12. package/dist/atomic.mjs.map +1 -1
  13. package/dist/cli.js +222 -38
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +321 -203
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/compiler.js +57 -14
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/compiler.mjs +71 -28
  20. package/dist/compiler.mjs.map +1 -1
  21. package/dist/dashboard.js +0 -1
  22. package/dist/dashboard.js.map +1 -1
  23. package/dist/devtools.js +16 -2
  24. package/dist/devtools.js.map +1 -1
  25. package/dist/devtools.mjs +21 -2
  26. package/dist/devtools.mjs.map +1 -1
  27. package/dist/engine.js +141 -51
  28. package/dist/engine.js.map +1 -1
  29. package/dist/engine.mjs +238 -148
  30. package/dist/engine.mjs.map +1 -1
  31. package/dist/index.js +50 -8
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +74 -29
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/next.js +98 -37
  36. package/dist/next.js.map +1 -1
  37. package/dist/next.mjs +177 -115
  38. package/dist/next.mjs.map +1 -1
  39. package/dist/plugin-api.js +0 -1
  40. package/dist/plugin-api.js.map +1 -1
  41. package/dist/plugin-registry.js +6 -2
  42. package/dist/plugin-registry.js.map +1 -1
  43. package/dist/plugin-registry.mjs +9 -2
  44. package/dist/plugin-registry.mjs.map +1 -1
  45. package/dist/plugin.js +0 -1
  46. package/dist/plugin.js.map +1 -1
  47. package/dist/preset.js +0 -1
  48. package/dist/preset.js.map +1 -1
  49. package/dist/rspack.js +89 -6
  50. package/dist/rspack.js.map +1 -1
  51. package/dist/rspack.mjs +39 -18
  52. package/dist/rspack.mjs.map +1 -1
  53. package/dist/runtime-css.js +0 -1
  54. package/dist/runtime-css.js.map +1 -1
  55. package/dist/runtime.js +0 -1
  56. package/dist/runtime.js.map +1 -1
  57. package/dist/scanner.js +29 -11
  58. package/dist/scanner.js.map +1 -1
  59. package/dist/scanner.mjs +84 -61
  60. package/dist/scanner.mjs.map +1 -1
  61. package/dist/shared.js +91 -35
  62. package/dist/shared.js.map +1 -1
  63. package/dist/shared.mjs +122 -64
  64. package/dist/shared.mjs.map +1 -1
  65. package/dist/storybook-addon.js +0 -1
  66. package/dist/storybook-addon.js.map +1 -1
  67. package/dist/svelte.js +40 -8
  68. package/dist/svelte.js.map +1 -1
  69. package/dist/svelte.mjs +57 -28
  70. package/dist/svelte.mjs.map +1 -1
  71. package/dist/syntax.js +7 -3
  72. package/dist/syntax.js.map +1 -1
  73. package/dist/syntax.mjs +30 -23
  74. package/dist/syntax.mjs.map +1 -1
  75. package/dist/testing.js +0 -1
  76. package/dist/testing.js.map +1 -1
  77. package/dist/theme.js +23 -5
  78. package/dist/theme.js.map +1 -1
  79. package/dist/theme.mjs +41 -17
  80. package/dist/theme.mjs.map +1 -1
  81. package/dist/turbopackLoader.js +58 -14
  82. package/dist/turbopackLoader.js.map +1 -1
  83. package/dist/turbopackLoader.mjs +89 -45
  84. package/dist/turbopackLoader.mjs.map +1 -1
  85. package/dist/tw.js +224 -38
  86. package/dist/tw.js.map +1 -1
  87. package/dist/tw.mjs +321 -203
  88. package/dist/tw.mjs.map +1 -1
  89. package/dist/vite.js +132 -50
  90. package/dist/vite.js.map +1 -1
  91. package/dist/vite.mjs +226 -143
  92. package/dist/vite.mjs.map +1 -1
  93. package/dist/vue.js +40 -8
  94. package/dist/vue.js.map +1 -1
  95. package/dist/vue.mjs +57 -28
  96. package/dist/vue.mjs.map +1 -1
  97. package/dist/webpackLoader.js +40 -10
  98. package/dist/webpackLoader.js.map +1 -1
  99. package/dist/webpackLoader.mjs +59 -27
  100. package/dist/webpackLoader.mjs.map +1 -1
  101. package/package.json +1 -1
package/dist/compiler.mjs CHANGED
@@ -15,10 +15,31 @@ var __export = (target, all) => {
15
15
  __defProp(target, name, { get: all[name], enumerable: true });
16
16
  };
17
17
 
18
+ // node_modules/tsup/assets/esm_shims.js
19
+ import path from "path";
20
+ import { fileURLToPath } from "url";
21
+ var getFilename, __filename;
22
+ var init_esm_shims = __esm({
23
+ "node_modules/tsup/assets/esm_shims.js"() {
24
+ "use strict";
25
+ getFilename = () => fileURLToPath(import.meta.url);
26
+ __filename = /* @__PURE__ */ getFilename();
27
+ }
28
+ });
29
+
18
30
  // packages/domain/shared/src/native-resolution.ts
19
31
  import { createRequire } from "module";
20
32
  import * as fs from "fs";
21
- import * as path from "path";
33
+ import * as path2 from "path";
34
+ function _safeCreateRequire() {
35
+ if (typeof import.meta !== "undefined" && import.meta.url && !import.meta.url.includes("unknown")) {
36
+ return createRequire(import.meta.url);
37
+ }
38
+ if (typeof __filename !== "undefined") {
39
+ return createRequire(__filename);
40
+ }
41
+ return createRequire(new URL(`file://${process.cwd()}/`).href);
42
+ }
22
43
  function platformKey() {
23
44
  if (isBrowser) return "browser";
24
45
  return `${process.platform}-${process.arch}`;
@@ -54,11 +75,11 @@ function resolveNativeBinary(runtimeDir) {
54
75
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
55
76
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
56
77
  if (runtimeDir) {
57
- for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
58
- const pkgRoot = path.resolve(runtimeDir, depth);
78
+ for (const depth of ["..", path2.join("..", ".."), path2.join("..", "..", "..")]) {
79
+ const pkgRoot = path2.resolve(runtimeDir, depth);
59
80
  for (const bin of BINARY_NAMES_SELF) {
60
81
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
61
- const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
82
+ const candidate = path2.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
62
83
  tried.push(`self-bundled:${candidate}`);
63
84
  if (fs.existsSync(candidate)) {
64
85
  return { path: candidate, source: "prebuilt", platform, tried };
@@ -72,22 +93,22 @@ function resolveNativeBinary(runtimeDir) {
72
93
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
73
94
  const localCandidates = [];
74
95
  for (const bin of BINARY_NAMES) {
75
- localCandidates.push(path.resolve(base, `${bin}.node`));
76
- localCandidates.push(path.resolve(base, "..", `${bin}.node`));
77
- localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
78
- localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
96
+ localCandidates.push(path2.resolve(base, `${bin}.node`));
97
+ localCandidates.push(path2.resolve(base, "..", `${bin}.node`));
98
+ localCandidates.push(path2.resolve(base, `${bin}.${platform}.node`));
99
+ localCandidates.push(path2.resolve(base, `${bin}.${napiPlatform}.node`));
79
100
  }
80
101
  for (const startDir of [cwd, base]) {
81
102
  let dir = startDir;
82
103
  for (let i = 0; i < 6; i++) {
83
- const nativeDir = path.resolve(dir, "native");
104
+ const nativeDir = path2.resolve(dir, "native");
84
105
  for (const bin of BINARY_NAMES) {
85
- localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
86
- localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
87
- localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
88
- localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
106
+ localCandidates.push(path2.resolve(nativeDir, `${bin}.node`));
107
+ localCandidates.push(path2.resolve(nativeDir, `${bin}.${platform}.node`));
108
+ localCandidates.push(path2.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
109
+ localCandidates.push(path2.resolve(nativeDir, "target", "release", `${bin}.node`));
89
110
  }
90
- const parent = path.resolve(dir, "..");
111
+ const parent = path2.resolve(dir, "..");
91
112
  if (parent === dir) break;
92
113
  dir = parent;
93
114
  }
@@ -104,10 +125,9 @@ var isBrowser, _require, PLATFORM_MAP;
104
125
  var init_native_resolution = __esm({
105
126
  "packages/domain/shared/src/native-resolution.ts"() {
106
127
  "use strict";
128
+ init_esm_shims();
107
129
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
108
- _require = createRequire(
109
- typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
110
- );
130
+ _require = _safeCreateRequire();
111
131
  PLATFORM_MAP = {
112
132
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
113
133
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -122,13 +142,13 @@ var init_native_resolution = __esm({
122
142
  // packages/domain/shared/src/index.ts
123
143
  import { createHash } from "crypto";
124
144
  import fs2 from "fs";
125
- import path2 from "path";
126
- import { fileURLToPath } from "url";
145
+ import path3 from "path";
146
+ import { fileURLToPath as fileURLToPath2 } from "url";
127
147
  import { createRequire as createRequire2 } from "module";
128
148
  function resolveRuntimeDir(dir, importMetaUrl) {
129
- if (dir) return path2.resolve(dir);
149
+ if (dir) return path3.resolve(dir);
130
150
  try {
131
- return path2.dirname(fileURLToPath(importMetaUrl));
151
+ return path3.dirname(fileURLToPath2(importMetaUrl));
132
152
  } catch {
133
153
  return process.cwd();
134
154
  }
@@ -137,6 +157,7 @@ var _require2;
137
157
  var init_src = __esm({
138
158
  "packages/domain/shared/src/index.ts"() {
139
159
  "use strict";
160
+ init_esm_shims();
140
161
  init_native_resolution();
141
162
  _require2 = createRequire2(
142
163
  typeof __filename !== "undefined" ? `file://${__filename}` : import.meta.url ?? "file://unknown"
@@ -149,8 +170,9 @@ var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttemp
149
170
  var init_nativeBridge = __esm({
150
171
  "packages/domain/compiler/src/nativeBridge.ts"() {
151
172
  "use strict";
173
+ init_esm_shims();
152
174
  init_src();
153
- _loadNative = (path4) => __require(path4);
175
+ _loadNative = (path5) => __require(path5);
154
176
  log = (...args) => {
155
177
  if (process.env.DEBUG?.includes("compiler:native")) {
156
178
  console.log("[compiler:native]", ...args);
@@ -307,6 +329,7 @@ function resetCacheStats() {
307
329
  var init_cssGeneratorNative = __esm({
308
330
  "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
309
331
  "use strict";
332
+ init_esm_shims();
310
333
  init_nativeBridge();
311
334
  }
312
335
  });
@@ -380,6 +403,7 @@ function atomicRegistrySize() {
380
403
  var init_compilationNative = __esm({
381
404
  "packages/domain/compiler/src/compiler/compilationNative.ts"() {
382
405
  "use strict";
406
+ init_esm_shims();
383
407
  init_nativeBridge();
384
408
  }
385
409
  });
@@ -524,6 +548,7 @@ function twMergeRaw(classLists) {
524
548
  var init_cssCompilationNative = __esm({
525
549
  "packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
526
550
  "use strict";
551
+ init_esm_shims();
527
552
  init_nativeBridge();
528
553
  }
529
554
  });
@@ -624,6 +649,7 @@ function idRegistryImport(importedData) {
624
649
  var init_idRegistryNative = __esm({
625
650
  "packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
626
651
  "use strict";
652
+ init_esm_shims();
627
653
  init_nativeBridge();
628
654
  }
629
655
  });
@@ -766,6 +792,7 @@ function scanFilesBatchNative(filesJson) {
766
792
  var init_streamingNative = __esm({
767
793
  "packages/domain/compiler/src/compiler/streamingNative.ts"() {
768
794
  "use strict";
795
+ init_esm_shims();
769
796
  init_nativeBridge();
770
797
  }
771
798
  });
@@ -818,6 +845,7 @@ var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
818
845
  var init_tailwindEngine = __esm({
819
846
  "packages/domain/compiler/src/tailwindEngine.ts"() {
820
847
  "use strict";
848
+ init_esm_shims();
821
849
  require2 = createRequire3(
822
850
  typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
823
851
  );
@@ -1007,6 +1035,7 @@ var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEM
1007
1035
  var init_tailwindEngine2 = __esm({
1008
1036
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1009
1037
  "use strict";
1038
+ init_esm_shims();
1010
1039
  init_nativeBridge();
1011
1040
  init_cssGeneratorNative();
1012
1041
  init_cssCompilationNative();
@@ -1026,6 +1055,7 @@ var init_tailwindEngine2 = __esm({
1026
1055
  var init_compiler = __esm({
1027
1056
  "packages/domain/compiler/src/compiler/index.ts"() {
1028
1057
  "use strict";
1058
+ init_esm_shims();
1029
1059
  init_cssGeneratorNative();
1030
1060
  init_compilationNative();
1031
1061
  init_cssCompilationNative();
@@ -1040,6 +1070,7 @@ var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astEx
1040
1070
  var init_parser = __esm({
1041
1071
  "packages/domain/compiler/src/parser/index.ts"() {
1042
1072
  "use strict";
1073
+ init_esm_shims();
1043
1074
  init_nativeBridge();
1044
1075
  parseClasses = (raw) => {
1045
1076
  const native = getNativeBridge();
@@ -1219,6 +1250,7 @@ function resetMemoryStats() {
1219
1250
  var init_analyzerNative = __esm({
1220
1251
  "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
1221
1252
  "use strict";
1253
+ init_esm_shims();
1222
1254
  init_nativeBridge();
1223
1255
  }
1224
1256
  });
@@ -1313,6 +1345,7 @@ function resolveSimpleVariants(configJson) {
1313
1345
  var init_themeResolutionNative = __esm({
1314
1346
  "packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
1315
1347
  "use strict";
1348
+ init_esm_shims();
1316
1349
  init_nativeBridge();
1317
1350
  }
1318
1351
  });
@@ -1361,6 +1394,7 @@ function generateSubComponentTypes(root, outputPath) {
1361
1394
  var init_scannerNative = __esm({
1362
1395
  "packages/domain/compiler/src/analyzer/scannerNative.ts"() {
1363
1396
  "use strict";
1397
+ init_esm_shims();
1364
1398
  init_nativeBridge();
1365
1399
  }
1366
1400
  });
@@ -1369,6 +1403,7 @@ var init_scannerNative = __esm({
1369
1403
  var init_analyzer = __esm({
1370
1404
  "packages/domain/compiler/src/analyzer/index.ts"() {
1371
1405
  "use strict";
1406
+ init_esm_shims();
1372
1407
  init_analyzerNative();
1373
1408
  init_themeResolutionNative();
1374
1409
  init_scannerNative();
@@ -1558,6 +1593,7 @@ function resetResolverPoolStats() {
1558
1593
  var init_cacheNative = __esm({
1559
1594
  "packages/domain/compiler/src/cache/cacheNative.ts"() {
1560
1595
  "use strict";
1596
+ init_esm_shims();
1561
1597
  init_nativeBridge();
1562
1598
  }
1563
1599
  });
@@ -1566,6 +1602,7 @@ var init_cacheNative = __esm({
1566
1602
  var init_cache = __esm({
1567
1603
  "packages/domain/compiler/src/cache/index.ts"() {
1568
1604
  "use strict";
1605
+ init_esm_shims();
1569
1606
  init_cacheNative();
1570
1607
  }
1571
1608
  });
@@ -1815,6 +1852,7 @@ function redisDiagnose() {
1815
1852
  var init_redisNative = __esm({
1816
1853
  "packages/domain/compiler/src/redis/redisNative.ts"() {
1817
1854
  "use strict";
1855
+ init_esm_shims();
1818
1856
  init_nativeBridge();
1819
1857
  }
1820
1858
  });
@@ -1823,6 +1861,7 @@ var init_redisNative = __esm({
1823
1861
  var init_redis = __esm({
1824
1862
  "packages/domain/compiler/src/redis/index.ts"() {
1825
1863
  "use strict";
1864
+ init_esm_shims();
1826
1865
  init_redisNative();
1827
1866
  }
1828
1867
  });
@@ -1962,6 +2001,7 @@ function getCompilerDiagnostics() {
1962
2001
  var init_watchSystemNative = __esm({
1963
2002
  "packages/domain/compiler/src/watch/watchSystemNative.ts"() {
1964
2003
  "use strict";
2004
+ init_esm_shims();
1965
2005
  init_nativeBridge();
1966
2006
  }
1967
2007
  });
@@ -1970,13 +2010,14 @@ var init_watchSystemNative = __esm({
1970
2010
  var init_watch = __esm({
1971
2011
  "packages/domain/compiler/src/watch/index.ts"() {
1972
2012
  "use strict";
2013
+ init_esm_shims();
1973
2014
  init_watchSystemNative();
1974
2015
  }
1975
2016
  });
1976
2017
 
1977
2018
  // packages/domain/compiler/src/index.ts
1978
2019
  import fs3 from "fs";
1979
- import path3 from "path";
2020
+ import path4 from "path";
1980
2021
  import { createRequire as createRequire5 } from "module";
1981
2022
  function _layoutClassesToCss(classes) {
1982
2023
  const native = getNativeBridge();
@@ -2016,6 +2057,7 @@ var _require3, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess,
2016
2057
  var init_src2 = __esm({
2017
2058
  "packages/domain/compiler/src/index.ts"() {
2018
2059
  "use strict";
2060
+ init_esm_shims();
2019
2061
  init_nativeBridge();
2020
2062
  init_compiler();
2021
2063
  init_parser();
@@ -2117,7 +2159,7 @@ var init_src2 = __esm({
2117
2159
  };
2118
2160
  scanProjectUsage = (dirs, cwd) => {
2119
2161
  const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
2120
- const files = dirs.map((dir) => path3.resolve(cwd, dir));
2162
+ const files = dirs.map((dir) => path4.resolve(cwd, dir));
2121
2163
  const results = batchExtractClasses2(files) || [];
2122
2164
  const combined = {};
2123
2165
  for (const result of results) {
@@ -2154,7 +2196,7 @@ var init_src2 = __esm({
2154
2196
  "tailwind.config.cjs"
2155
2197
  ];
2156
2198
  for (const file of configFiles) {
2157
- const fullPath = path3.join(cwd, file);
2199
+ const fullPath = path4.join(cwd, file);
2158
2200
  if (fs3.existsSync(fullPath)) {
2159
2201
  const mod = __require(fullPath);
2160
2202
  return mod.default || mod;
@@ -2165,9 +2207,9 @@ var init_src2 = __esm({
2165
2207
  getContentPaths = (cwd = process.cwd()) => {
2166
2208
  return {
2167
2209
  content: [
2168
- path3.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2169
- path3.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2170
- path3.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2210
+ path4.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2211
+ path4.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2212
+ path4.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2171
2213
  ]
2172
2214
  };
2173
2215
  };
@@ -2363,6 +2405,7 @@ ${source}`;
2363
2405
  });
2364
2406
 
2365
2407
  // src/umbrella/compiler.ts
2408
+ init_esm_shims();
2366
2409
  init_src2();
2367
2410
  export {
2368
2411
  BucketEngine,