tailwind-styled-v4 5.0.37 → 5.0.38

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 (119) hide show
  1. package/dist/analyzer.js +213 -161
  2. package/dist/analyzer.js.map +1 -1
  3. package/dist/analyzer.mjs +118 -82
  4. package/dist/analyzer.mjs.map +1 -1
  5. package/dist/animate.js +131 -87
  6. package/dist/animate.js.map +1 -1
  7. package/dist/animate.mjs +28 -14
  8. package/dist/animate.mjs.map +1 -1
  9. package/dist/atomic.js +105 -68
  10. package/dist/atomic.js.map +1 -1
  11. package/dist/atomic.mjs +40 -13
  12. package/dist/atomic.mjs.map +1 -1
  13. package/dist/cli.js +577 -426
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +466 -304
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/compiler.js +826 -508
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/compiler.mjs +287 -29
  20. package/dist/compiler.mjs.map +1 -1
  21. package/dist/dashboard.js +71 -41
  22. package/dist/dashboard.js.map +1 -1
  23. package/dist/dashboard.mjs +12 -6
  24. package/dist/dashboard.mjs.map +1 -1
  25. package/dist/devtools.js +333 -289
  26. package/dist/devtools.js.map +1 -1
  27. package/dist/devtools.mjs +26 -11
  28. package/dist/devtools.mjs.map +1 -1
  29. package/dist/engine.js +679 -502
  30. package/dist/engine.js.map +1 -1
  31. package/dist/engine.mjs +467 -307
  32. package/dist/engine.mjs.map +1 -1
  33. package/dist/index.d.mts +145 -319
  34. package/dist/index.d.ts +145 -319
  35. package/dist/index.js +1329 -7441
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +1266 -7385
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/next.js +318 -243
  40. package/dist/next.js.map +1 -1
  41. package/dist/next.mjs +256 -181
  42. package/dist/next.mjs.map +1 -1
  43. package/dist/plugin-api.js +93 -49
  44. package/dist/plugin-api.js.map +1 -1
  45. package/dist/plugin-api.mjs +26 -6
  46. package/dist/plugin-api.mjs.map +1 -1
  47. package/dist/plugin-registry.js +67 -40
  48. package/dist/plugin-registry.js.map +1 -1
  49. package/dist/plugin-registry.mjs +14 -10
  50. package/dist/plugin-registry.mjs.map +1 -1
  51. package/dist/plugin.js +101 -53
  52. package/dist/plugin.js.map +1 -1
  53. package/dist/plugin.mjs +30 -6
  54. package/dist/plugin.mjs.map +1 -1
  55. package/dist/preset.js +47 -15
  56. package/dist/preset.js.map +1 -1
  57. package/dist/preset.mjs +13 -5
  58. package/dist/preset.mjs.map +1 -1
  59. package/dist/rspack.js +82 -50
  60. package/dist/rspack.js.map +1 -1
  61. package/dist/rspack.mjs +20 -12
  62. package/dist/rspack.mjs.map +1 -1
  63. package/dist/runtime-css.js +62 -24
  64. package/dist/runtime-css.js.map +1 -1
  65. package/dist/runtime-css.mjs +15 -7
  66. package/dist/runtime-css.mjs.map +1 -1
  67. package/dist/runtime.js +97 -44
  68. package/dist/runtime.js.map +1 -1
  69. package/dist/runtime.mjs +31 -8
  70. package/dist/runtime.mjs.map +1 -1
  71. package/dist/scanner.js +163 -120
  72. package/dist/scanner.js.map +1 -1
  73. package/dist/scanner.mjs +67 -39
  74. package/dist/scanner.mjs.map +1 -1
  75. package/dist/shared.js +441 -295
  76. package/dist/shared.js.map +1 -1
  77. package/dist/shared.mjs +253 -122
  78. package/dist/shared.mjs.map +1 -1
  79. package/dist/storybook-addon.js +39 -10
  80. package/dist/storybook-addon.js.map +1 -1
  81. package/dist/storybook-addon.mjs +8 -3
  82. package/dist/storybook-addon.mjs.map +1 -1
  83. package/dist/svelte.js +88 -64
  84. package/dist/svelte.js.map +1 -1
  85. package/dist/svelte.mjs +28 -13
  86. package/dist/svelte.mjs.map +1 -1
  87. package/dist/syntax.js +68 -37
  88. package/dist/syntax.js.map +1 -1
  89. package/dist/syntax.mjs +8 -7
  90. package/dist/syntax.mjs.map +1 -1
  91. package/dist/testing.js +55 -18
  92. package/dist/testing.js.map +1 -1
  93. package/dist/testing.mjs +16 -3
  94. package/dist/testing.mjs.map +1 -1
  95. package/dist/theme.js +131 -74
  96. package/dist/theme.js.map +1 -1
  97. package/dist/theme.mjs +42 -13
  98. package/dist/theme.mjs.map +1 -1
  99. package/dist/turbopackLoader.js +150 -116
  100. package/dist/turbopackLoader.js.map +1 -1
  101. package/dist/turbopackLoader.mjs +124 -81
  102. package/dist/turbopackLoader.mjs.map +1 -1
  103. package/dist/tw.js +560 -421
  104. package/dist/tw.js.map +1 -1
  105. package/dist/tw.mjs +460 -302
  106. package/dist/tw.mjs.map +1 -1
  107. package/dist/vite.js +561 -446
  108. package/dist/vite.js.map +1 -1
  109. package/dist/vite.mjs +433 -321
  110. package/dist/vite.mjs.map +1 -1
  111. package/dist/vue.js +95 -70
  112. package/dist/vue.js.map +1 -1
  113. package/dist/vue.mjs +30 -14
  114. package/dist/vue.mjs.map +1 -1
  115. package/dist/webpackLoader.js +110 -78
  116. package/dist/webpackLoader.js.map +1 -1
  117. package/dist/webpackLoader.mjs +45 -17
  118. package/dist/webpackLoader.mjs.map +1 -1
  119. package/package.json +3 -1
@@ -1,11 +1,3 @@
1
- import { createRequire } from 'module';
2
- import * as fs4 from 'fs';
3
- import fs4__default from 'fs';
4
- import * as path4 from 'path';
5
- import path4__default from 'path';
6
- import 'crypto';
7
- import { fileURLToPath } from 'url';
8
-
9
1
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
10
2
  var __defProp = Object.defineProperty;
11
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -33,6 +25,11 @@ var __copyProps = (to, from, except, desc) => {
33
25
  return to;
34
26
  };
35
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // packages/domain/shared/src/native-resolution.ts
30
+ import { createRequire } from "module";
31
+ import * as fs from "fs";
32
+ import * as path from "path";
36
33
  function platformKey() {
37
34
  if (isBrowser) return "browser";
38
35
  return `${process.platform}-${process.arch}`;
@@ -48,7 +45,7 @@ function resolveNativeBinary(runtimeDir) {
48
45
  }
49
46
  const envPath = process.env.TW_NATIVE_PATH?.trim();
50
47
  if (envPath) {
51
- if (fs4.existsSync(envPath)) {
48
+ if (fs.existsSync(envPath)) {
52
49
  return { path: envPath, source: "env", platform, tried };
53
50
  }
54
51
  tried.push(`env:${envPath} (not found)`);
@@ -57,7 +54,7 @@ function resolveNativeBinary(runtimeDir) {
57
54
  for (const pkg of prebuiltPkgs) {
58
55
  try {
59
56
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
60
- if (fs4.existsSync(candidate)) {
57
+ if (fs.existsSync(candidate)) {
61
58
  return { path: candidate, source: "prebuilt", platform, tried };
62
59
  }
63
60
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -68,13 +65,13 @@ function resolveNativeBinary(runtimeDir) {
68
65
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
69
66
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
70
67
  if (runtimeDir) {
71
- for (const depth of ["..", path4.join("..", ".."), path4.join("..", "..", "..")]) {
72
- const pkgRoot = path4.resolve(runtimeDir, depth);
68
+ for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
69
+ const pkgRoot = path.resolve(runtimeDir, depth);
73
70
  for (const bin of BINARY_NAMES_SELF) {
74
71
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
75
- const candidate = path4.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
72
+ const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
76
73
  tried.push(`self-bundled:${candidate}`);
77
- if (fs4.existsSync(candidate)) {
74
+ if (fs.existsSync(candidate)) {
78
75
  return { path: candidate, source: "prebuilt", platform, tried };
79
76
  }
80
77
  }
@@ -86,29 +83,29 @@ function resolveNativeBinary(runtimeDir) {
86
83
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
87
84
  const localCandidates = [];
88
85
  for (const bin of BINARY_NAMES) {
89
- localCandidates.push(path4.resolve(base, `${bin}.node`));
90
- localCandidates.push(path4.resolve(base, "..", `${bin}.node`));
91
- localCandidates.push(path4.resolve(base, `${bin}.${platform}.node`));
92
- localCandidates.push(path4.resolve(base, `${bin}.${napiPlatform}.node`));
86
+ localCandidates.push(path.resolve(base, `${bin}.node`));
87
+ localCandidates.push(path.resolve(base, "..", `${bin}.node`));
88
+ localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
89
+ localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
93
90
  }
94
91
  for (const startDir of [cwd, base]) {
95
92
  let dir = startDir;
96
93
  for (let i = 0; i < 6; i++) {
97
- const nativeDir = path4.resolve(dir, "native");
94
+ const nativeDir = path.resolve(dir, "native");
98
95
  for (const bin of BINARY_NAMES) {
99
- localCandidates.push(path4.resolve(nativeDir, `${bin}.node`));
100
- localCandidates.push(path4.resolve(nativeDir, `${bin}.${platform}.node`));
101
- localCandidates.push(path4.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
102
- localCandidates.push(path4.resolve(nativeDir, "target", "release", `${bin}.node`));
96
+ localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
97
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
98
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
99
+ localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
103
100
  }
104
- const parent = path4.resolve(dir, "..");
101
+ const parent = path.resolve(dir, "..");
105
102
  if (parent === dir) break;
106
103
  dir = parent;
107
104
  }
108
105
  }
109
106
  for (const candidate of localCandidates) {
110
107
  tried.push(`local:${candidate}`);
111
- if (fs4.existsSync(candidate)) {
108
+ if (fs.existsSync(candidate)) {
112
109
  return { path: candidate, source: "local", platform, tried };
113
110
  }
114
111
  }
@@ -117,6 +114,7 @@ function resolveNativeBinary(runtimeDir) {
117
114
  var isBrowser, _require, PLATFORM_MAP;
118
115
  var init_native_resolution = __esm({
119
116
  "packages/domain/shared/src/native-resolution.ts"() {
117
+ "use strict";
120
118
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
121
119
  _require = typeof __require !== "undefined" ? __require : createRequire(import.meta.url);
122
120
  PLATFORM_MAP = {
@@ -129,17 +127,27 @@ var init_native_resolution = __esm({
129
127
  };
130
128
  }
131
129
  });
130
+
131
+ // packages/domain/shared/src/index.ts
132
+ import { createHash } from "crypto";
133
+ import fs2 from "fs";
134
+ import path2 from "path";
135
+ import { fileURLToPath } from "url";
136
+ import { createRequire as createRequire2 } from "module";
132
137
  function resolveRuntimeDir(dir, importMetaUrl) {
138
+ if (dir) return path2.resolve(dir);
133
139
  try {
134
- return path4__default.dirname(fileURLToPath(importMetaUrl));
140
+ return path2.dirname(fileURLToPath(importMetaUrl));
135
141
  } catch {
136
142
  return process.cwd();
137
143
  }
138
144
  }
145
+ var _require2;
139
146
  var init_src = __esm({
140
147
  "packages/domain/shared/src/index.ts"() {
148
+ "use strict";
141
149
  init_native_resolution();
142
- createRequire(import.meta.url);
150
+ _require2 = createRequire2(import.meta.url);
143
151
  }
144
152
  });
145
153
 
@@ -147,6 +155,7 @@ var init_src = __esm({
147
155
  var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
148
156
  var init_nativeBridge = __esm({
149
157
  "packages/domain/compiler/src/nativeBridge.ts"() {
158
+ "use strict";
150
159
  init_src();
151
160
  _loadNative = (path5) => __require(path5);
152
161
  log = (...args) => {
@@ -286,6 +295,7 @@ function resetCacheStats() {
286
295
  }
287
296
  var init_cssGeneratorNative = __esm({
288
297
  "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
298
+ "use strict";
289
299
  init_nativeBridge();
290
300
  }
291
301
  });
@@ -358,6 +368,7 @@ function atomicRegistrySize() {
358
368
  }
359
369
  var init_compilationNative = __esm({
360
370
  "packages/domain/compiler/src/compiler/compilationNative.ts"() {
371
+ "use strict";
361
372
  init_nativeBridge();
362
373
  }
363
374
  });
@@ -501,6 +512,7 @@ function twMergeRaw(classLists) {
501
512
  }
502
513
  var init_cssCompilationNative = __esm({
503
514
  "packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
515
+ "use strict";
504
516
  init_nativeBridge();
505
517
  }
506
518
  });
@@ -600,6 +612,7 @@ function idRegistryImport(importedData) {
600
612
  }
601
613
  var init_idRegistryNative = __esm({
602
614
  "packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
615
+ "use strict";
603
616
  init_nativeBridge();
604
617
  }
605
618
  });
@@ -741,9 +754,13 @@ function scanFilesBatchNative(filesJson) {
741
754
  }
742
755
  var init_streamingNative = __esm({
743
756
  "packages/domain/compiler/src/compiler/streamingNative.ts"() {
757
+ "use strict";
744
758
  init_nativeBridge();
745
759
  }
746
760
  });
761
+
762
+ // packages/domain/compiler/src/tailwindEngine.ts
763
+ import { createRequire as createRequire3 } from "module";
747
764
  function loadTailwindEngine() {
748
765
  if (_twEngine) return _twEngine;
749
766
  if (_twEngineError) throw _twEngineError;
@@ -763,10 +780,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
763
780
  if (classes.length === 0) return "";
764
781
  const tw = loadTailwindEngine();
765
782
  const input = cssEntryContent ?? "@import 'tailwindcss';";
766
- const { readFileSync, existsSync: existsSync2 } = await import('fs');
767
- const { dirname, resolve: resolve2 } = await import('path');
783
+ const { readFileSync, existsSync: existsSync2 } = await import("fs");
784
+ const { dirname, resolve: resolve2 } = await import("path");
768
785
  const projectRoot = root ?? process.cwd();
769
- const req = createRequire(resolve2(projectRoot, "package.json"));
786
+ const req = createRequire3(resolve2(projectRoot, "package.json"));
770
787
  const loadStylesheet = async (id, base) => {
771
788
  try {
772
789
  const cssId = id === "tailwindcss" ? "tailwindcss/index.css" : id === "tailwindcss/preflight" ? "tailwindcss/preflight.css" : id === "tailwindcss/utilities" ? "tailwindcss/utilities.css" : id === "tailwindcss/theme" ? "tailwindcss/theme.css" : id;
@@ -786,10 +803,12 @@ async function generateRawCss(classes, cssEntryContent, root) {
786
803
  const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
787
804
  return compiler.build(classes);
788
805
  }
789
- var require2, _twEngine, _twEngineError;
806
+ var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
790
807
  var init_tailwindEngine = __esm({
791
808
  "packages/domain/compiler/src/tailwindEngine.ts"() {
792
- require2 = createRequire(import.meta.url);
809
+ "use strict";
810
+ require2 = createRequire3(import.meta.url);
811
+ MAX_CACHE_MEMORY = 256 * 1024;
793
812
  _twEngine = null;
794
813
  _twEngineError = null;
795
814
  }
@@ -804,6 +823,7 @@ __export(tailwindEngine_exports, {
804
823
  runCssPipeline: () => runCssPipeline,
805
824
  runCssPipelineSync: () => runCssPipelineSync
806
825
  });
826
+ import { createRequire as createRequire4 } from "module";
807
827
  function _getCacheKey(classes, minify, cssEntry, root) {
808
828
  const sorted = [...classes].sort().join(",");
809
829
  const flags = `${minify ? "1" : "0"}${cssEntry ? "1" : "0"}${root ? "1" : "0"}`;
@@ -970,24 +990,27 @@ function processTailwindCssWithTargets(css, targets) {
970
990
  }
971
991
  return result.css;
972
992
  }
973
- var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
993
+ var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
974
994
  var init_tailwindEngine2 = __esm({
975
995
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
996
+ "use strict";
976
997
  init_nativeBridge();
977
998
  init_cssGeneratorNative();
978
999
  init_cssCompilationNative();
979
1000
  init_tailwindEngine();
980
- createRequire(import.meta.url);
1001
+ require3 = createRequire4(import.meta.url);
981
1002
  _cssCache = /* @__PURE__ */ new Map();
982
1003
  _cacheHits = 0;
983
1004
  _cacheMisses = 0;
984
1005
  MAX_CACHE_SIZE = 100;
1006
+ MAX_CACHE_MEMORY2 = 256 * 1024;
985
1007
  }
986
1008
  });
987
1009
 
988
1010
  // packages/domain/compiler/src/compiler/index.ts
989
1011
  var init_compiler = __esm({
990
1012
  "packages/domain/compiler/src/compiler/index.ts"() {
1013
+ "use strict";
991
1014
  init_cssGeneratorNative();
992
1015
  init_compilationNative();
993
1016
  init_cssCompilationNative();
@@ -1000,6 +1023,7 @@ var init_compiler = __esm({
1000
1023
  var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1001
1024
  var init_parser = __esm({
1002
1025
  "packages/domain/compiler/src/parser/index.ts"() {
1026
+ "use strict";
1003
1027
  init_nativeBridge();
1004
1028
  parseClasses = (raw) => {
1005
1029
  const native = getNativeBridge();
@@ -1178,6 +1202,7 @@ function resetMemoryStats() {
1178
1202
  }
1179
1203
  var init_analyzerNative = __esm({
1180
1204
  "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
1205
+ "use strict";
1181
1206
  init_nativeBridge();
1182
1207
  }
1183
1208
  });
@@ -1271,6 +1296,7 @@ function resolveSimpleVariants(configJson) {
1271
1296
  }
1272
1297
  var init_themeResolutionNative = __esm({
1273
1298
  "packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
1299
+ "use strict";
1274
1300
  init_nativeBridge();
1275
1301
  }
1276
1302
  });
@@ -1318,6 +1344,7 @@ function generateSubComponentTypes(root, outputPath) {
1318
1344
  }
1319
1345
  var init_scannerNative = __esm({
1320
1346
  "packages/domain/compiler/src/analyzer/scannerNative.ts"() {
1347
+ "use strict";
1321
1348
  init_nativeBridge();
1322
1349
  }
1323
1350
  });
@@ -1325,6 +1352,7 @@ var init_scannerNative = __esm({
1325
1352
  // packages/domain/compiler/src/analyzer/index.ts
1326
1353
  var init_analyzer = __esm({
1327
1354
  "packages/domain/compiler/src/analyzer/index.ts"() {
1355
+ "use strict";
1328
1356
  init_analyzerNative();
1329
1357
  init_themeResolutionNative();
1330
1358
  init_scannerNative();
@@ -1513,6 +1541,7 @@ function resetResolverPoolStats() {
1513
1541
  }
1514
1542
  var init_cacheNative = __esm({
1515
1543
  "packages/domain/compiler/src/cache/cacheNative.ts"() {
1544
+ "use strict";
1516
1545
  init_nativeBridge();
1517
1546
  }
1518
1547
  });
@@ -1520,6 +1549,7 @@ var init_cacheNative = __esm({
1520
1549
  // packages/domain/compiler/src/cache/index.ts
1521
1550
  var init_cache = __esm({
1522
1551
  "packages/domain/compiler/src/cache/index.ts"() {
1552
+ "use strict";
1523
1553
  init_cacheNative();
1524
1554
  }
1525
1555
  });
@@ -1768,6 +1798,7 @@ function redisDiagnose() {
1768
1798
  }
1769
1799
  var init_redisNative = __esm({
1770
1800
  "packages/domain/compiler/src/redis/redisNative.ts"() {
1801
+ "use strict";
1771
1802
  init_nativeBridge();
1772
1803
  }
1773
1804
  });
@@ -1775,6 +1806,7 @@ var init_redisNative = __esm({
1775
1806
  // packages/domain/compiler/src/redis/index.ts
1776
1807
  var init_redis = __esm({
1777
1808
  "packages/domain/compiler/src/redis/index.ts"() {
1809
+ "use strict";
1778
1810
  init_redisNative();
1779
1811
  }
1780
1812
  });
@@ -1913,6 +1945,7 @@ function getCompilerDiagnostics() {
1913
1945
  }
1914
1946
  var init_watchSystemNative = __esm({
1915
1947
  "packages/domain/compiler/src/watch/watchSystemNative.ts"() {
1948
+ "use strict";
1916
1949
  init_nativeBridge();
1917
1950
  }
1918
1951
  });
@@ -1920,9 +1953,15 @@ var init_watchSystemNative = __esm({
1920
1953
  // packages/domain/compiler/src/watch/index.ts
1921
1954
  var init_watch = __esm({
1922
1955
  "packages/domain/compiler/src/watch/index.ts"() {
1956
+ "use strict";
1923
1957
  init_watchSystemNative();
1924
1958
  }
1925
1959
  });
1960
+
1961
+ // packages/domain/compiler/src/index.ts
1962
+ import fs3 from "fs";
1963
+ import path3 from "path";
1964
+ import { createRequire as createRequire5 } from "module";
1926
1965
  function _layoutClassesToCss(classes) {
1927
1966
  const native = getNativeBridge();
1928
1967
  if (!native?.layoutClassesToCss) {
@@ -1960,6 +1999,7 @@ function extractContainerCssFromSource(source) {
1960
1999
  var _require3, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
1961
2000
  var init_src2 = __esm({
1962
2001
  "packages/domain/compiler/src/index.ts"() {
2002
+ "use strict";
1963
2003
  init_nativeBridge();
1964
2004
  init_compiler();
1965
2005
  init_parser();
@@ -1967,7 +2007,7 @@ var init_src2 = __esm({
1967
2007
  init_cache();
1968
2008
  init_redis();
1969
2009
  init_watch();
1970
- _require3 = createRequire(import.meta.url);
2010
+ _require3 = createRequire5(import.meta.url);
1971
2011
  transformSource = (source, opts) => {
1972
2012
  const native = getNativeBridge();
1973
2013
  if (!native?.transformSource) {
@@ -2059,7 +2099,7 @@ var init_src2 = __esm({
2059
2099
  };
2060
2100
  scanProjectUsage = (dirs, cwd) => {
2061
2101
  const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
2062
- const files = dirs.map((dir) => path4__default.resolve(cwd, dir));
2102
+ const files = dirs.map((dir) => path3.resolve(cwd, dir));
2063
2103
  const results = batchExtractClasses2(files) || [];
2064
2104
  const combined = {};
2065
2105
  for (const result of results) {
@@ -2076,13 +2116,13 @@ var init_src2 = __esm({
2076
2116
  const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
2077
2117
  const allClasses = Object.keys(classes).sort();
2078
2118
  if (outputPath) {
2079
- fs4__default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
2119
+ fs3.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
2080
2120
  }
2081
2121
  return allClasses;
2082
2122
  };
2083
2123
  loadSafelist = (safelistPath) => {
2084
2124
  try {
2085
- const content = fs4__default.readFileSync(safelistPath, "utf-8");
2125
+ const content = fs3.readFileSync(safelistPath, "utf-8");
2086
2126
  return JSON.parse(content);
2087
2127
  } catch {
2088
2128
  return [];
@@ -2096,8 +2136,8 @@ var init_src2 = __esm({
2096
2136
  "tailwind.config.cjs"
2097
2137
  ];
2098
2138
  for (const file of configFiles) {
2099
- const fullPath = path4__default.join(cwd, file);
2100
- if (fs4__default.existsSync(fullPath)) {
2139
+ const fullPath = path3.join(cwd, file);
2140
+ if (fs3.existsSync(fullPath)) {
2101
2141
  const mod = __require(fullPath);
2102
2142
  return mod.default || mod;
2103
2143
  }
@@ -2107,9 +2147,9 @@ var init_src2 = __esm({
2107
2147
  getContentPaths = (cwd = process.cwd()) => {
2108
2148
  return {
2109
2149
  content: [
2110
- path4__default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2111
- path4__default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2112
- path4__default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2150
+ path3.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2151
+ path3.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2152
+ path3.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2113
2153
  ]
2114
2154
  };
2115
2155
  };
@@ -2523,6 +2563,7 @@ __export(internal_exports, {
2523
2563
  });
2524
2564
  var init_internal = __esm({
2525
2565
  "packages/domain/compiler/src/internal.ts"() {
2566
+ "use strict";
2526
2567
  init_src2();
2527
2568
  init_tailwindEngine2();
2528
2569
  init_compiler();
@@ -2536,10 +2577,12 @@ var init_internal = __esm({
2536
2577
 
2537
2578
  // packages/presentation/next/src/turbopackLoader.ts
2538
2579
  init_internal();
2580
+ import fs4 from "fs";
2581
+ import path4 from "path";
2539
2582
  var _writtenRules = /* @__PURE__ */ new Set();
2540
2583
  function appendStaticCssToFile(staticCss, safelistPath) {
2541
2584
  if (!staticCss.trim() || !safelistPath) return;
2542
- const stateFilePath = path4__default.join(path4__default.dirname(safelistPath), "_tw-state-static.css");
2585
+ const stateFilePath = path4.join(path4.dirname(safelistPath), "_tw-state-static.css");
2543
2586
  const newRules = [];
2544
2587
  for (const chunk of staticCss.split(/(?<=\})\s*/)) {
2545
2588
  const rule = chunk.trim();
@@ -2550,9 +2593,9 @@ function appendStaticCssToFile(staticCss, safelistPath) {
2550
2593
  }
2551
2594
  if (newRules.length === 0) return;
2552
2595
  try {
2553
- fs4__default.mkdirSync(path4__default.dirname(stateFilePath), { recursive: true });
2554
- if (!fs4__default.existsSync(stateFilePath)) {
2555
- fs4__default.writeFileSync(
2596
+ fs4.mkdirSync(path4.dirname(stateFilePath), { recursive: true });
2597
+ if (!fs4.existsSync(stateFilePath)) {
2598
+ fs4.writeFileSync(
2556
2599
  stateFilePath,
2557
2600
  `/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
2558
2601
  * Import di globals.css: @import "./_tw-state-static.css";
@@ -2563,7 +2606,7 @@ function appendStaticCssToFile(staticCss, safelistPath) {
2563
2606
  "utf-8"
2564
2607
  );
2565
2608
  }
2566
- fs4__default.appendFileSync(stateFilePath, newRules.join("\n") + "\n", "utf-8");
2609
+ fs4.appendFileSync(stateFilePath, newRules.join("\n") + "\n", "utf-8");
2567
2610
  } catch {
2568
2611
  }
2569
2612
  }
@@ -2602,11 +2645,11 @@ var CYCLE_SENTINEL = "_cycle.txt";
2602
2645
  var START_SENTINEL = "_start.txt";
2603
2646
  var _workerCache = /* @__PURE__ */ new Map();
2604
2647
  function getTwClassesDir(safelistPath) {
2605
- return path4__default.join(path4__default.dirname(safelistPath), "tw-classes");
2648
+ return path4.join(path4.dirname(safelistPath), "tw-classes");
2606
2649
  }
2607
2650
  function readSentinel(filePath) {
2608
2651
  try {
2609
- return fs4__default.readFileSync(filePath, "utf-8").trim();
2652
+ return fs4.readFileSync(filePath, "utf-8").trim();
2610
2653
  } catch {
2611
2654
  return "";
2612
2655
  }
@@ -2616,36 +2659,36 @@ function clearAndMarkCycle(twClassesDir, startId) {
2616
2659
  if (_clearLock) return;
2617
2660
  _clearLock = true;
2618
2661
  try {
2619
- if (fs4__default.existsSync(twClassesDir)) {
2662
+ if (fs4.existsSync(twClassesDir)) {
2620
2663
  const tempDir = `${twClassesDir}_clearing_${Date.now()}`;
2621
2664
  try {
2622
- fs4__default.renameSync(twClassesDir, tempDir);
2623
- fs4__default.mkdirSync(twClassesDir, { recursive: true });
2624
- const startFile = path4__default.join(tempDir, START_SENTINEL);
2625
- if (fs4__default.existsSync(startFile)) {
2626
- fs4__default.copyFileSync(startFile, path4__default.join(twClassesDir, START_SENTINEL));
2665
+ fs4.renameSync(twClassesDir, tempDir);
2666
+ fs4.mkdirSync(twClassesDir, { recursive: true });
2667
+ const startFile = path4.join(tempDir, START_SENTINEL);
2668
+ if (fs4.existsSync(startFile)) {
2669
+ fs4.copyFileSync(startFile, path4.join(twClassesDir, START_SENTINEL));
2627
2670
  }
2628
- const mergedFile = path4__default.join(tempDir, "_webpack-merged.css");
2629
- if (fs4__default.existsSync(mergedFile)) {
2630
- fs4__default.copyFileSync(mergedFile, path4__default.join(twClassesDir, "_webpack-merged.css"));
2671
+ const mergedFile = path4.join(tempDir, "_webpack-merged.css");
2672
+ if (fs4.existsSync(mergedFile)) {
2673
+ fs4.copyFileSync(mergedFile, path4.join(twClassesDir, "_webpack-merged.css"));
2631
2674
  }
2632
- fs4__default.writeFileSync(path4__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2675
+ fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2633
2676
  _workerCache.set(twClassesDir, startId);
2634
- fs4__default.rmSync(tempDir, { recursive: true, force: true });
2677
+ fs4.rmSync(tempDir, { recursive: true, force: true });
2635
2678
  } catch {
2636
- for (const file of fs4__default.readdirSync(twClassesDir)) {
2679
+ for (const file of fs4.readdirSync(twClassesDir)) {
2637
2680
  if (file === START_SENTINEL || file === "_webpack-merged.css") continue;
2638
2681
  try {
2639
- fs4__default.unlinkSync(path4__default.join(twClassesDir, file));
2682
+ fs4.unlinkSync(path4.join(twClassesDir, file));
2640
2683
  } catch {
2641
2684
  }
2642
2685
  }
2643
- fs4__default.writeFileSync(path4__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2686
+ fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2644
2687
  _workerCache.set(twClassesDir, startId);
2645
2688
  }
2646
2689
  } else {
2647
- fs4__default.mkdirSync(twClassesDir, { recursive: true });
2648
- fs4__default.writeFileSync(path4__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2690
+ fs4.mkdirSync(twClassesDir, { recursive: true });
2691
+ fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2649
2692
  _workerCache.set(twClassesDir, startId);
2650
2693
  }
2651
2694
  } catch {
@@ -2656,41 +2699,41 @@ function clearAndMarkCycle(twClassesDir, startId) {
2656
2699
  function getPerFileSafelistPath(safelistDir, resourcePath) {
2657
2700
  const normalized = resourcePath.replace(/\\/g, "/");
2658
2701
  const slug = normalized.replace(/^.*\/src\//, "").replace(/\.[tj]sx?$/, "").replace(/[^a-zA-Z0-9]/g, "_").slice(0, 80);
2659
- return path4__default.join(safelistDir, `${slug}.css`);
2702
+ return path4.join(safelistDir, `${slug}.css`);
2660
2703
  }
2661
2704
  function writePerFileSafelist(safelistPath, resourcePath, classes) {
2662
2705
  if (!safelistPath || classes.length === 0) return;
2663
2706
  try {
2664
2707
  const twClassesDir = getTwClassesDir(safelistPath);
2665
- const startId = readSentinel(path4__default.join(twClassesDir, START_SENTINEL));
2666
- const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path4__default.join(twClassesDir, CYCLE_SENTINEL));
2708
+ const startId = readSentinel(path4.join(twClassesDir, START_SENTINEL));
2709
+ const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path4.join(twClassesDir, CYCLE_SENTINEL));
2667
2710
  if (startId && cachedCycle !== startId) {
2668
2711
  clearAndMarkCycle(twClassesDir, startId);
2669
- } else if (!fs4__default.existsSync(twClassesDir)) {
2670
- fs4__default.mkdirSync(twClassesDir, { recursive: true });
2712
+ } else if (!fs4.existsSync(twClassesDir)) {
2713
+ fs4.mkdirSync(twClassesDir, { recursive: true });
2671
2714
  }
2672
2715
  const outPath = getPerFileSafelistPath(twClassesDir, resourcePath);
2673
2716
  const sorted = [...new Set(classes)].sort();
2674
2717
  const css = [
2675
- `/* tw-safelist: ${path4__default.basename(resourcePath)} \u2014 auto-generated */`,
2718
+ `/* tw-safelist: ${path4.basename(resourcePath)} \u2014 auto-generated */`,
2676
2719
  "@layer utilities {",
2677
2720
  sorted.map((cls) => `.${cls.replace(/([^a-zA-Z0-9_-])/g, "\\$1")} {}`).join("\n"),
2678
2721
  "}"
2679
2722
  ].join("\n");
2680
2723
  try {
2681
- if (fs4__default.readFileSync(outPath, "utf-8") === css) return;
2724
+ if (fs4.readFileSync(outPath, "utf-8") === css) return;
2682
2725
  } catch {
2683
2726
  }
2684
2727
  const tmpPath = `${outPath}.tmp`;
2685
2728
  try {
2686
- fs4__default.writeFileSync(tmpPath, css, "utf-8");
2687
- fs4__default.renameSync(tmpPath, outPath);
2729
+ fs4.writeFileSync(tmpPath, css, "utf-8");
2730
+ fs4.renameSync(tmpPath, outPath);
2688
2731
  } catch {
2689
2732
  try {
2690
- fs4__default.unlinkSync(tmpPath);
2733
+ fs4.unlinkSync(tmpPath);
2691
2734
  } catch {
2692
2735
  }
2693
- fs4__default.writeFileSync(outPath, css, "utf-8");
2736
+ fs4.writeFileSync(outPath, css, "utf-8");
2694
2737
  }
2695
2738
  } catch {
2696
2739
  }
@@ -2704,7 +2747,7 @@ function turbopackLoader(source, options = {}) {
2704
2747
  const router = detectRouter(this.resourcePath);
2705
2748
  const nextMajor = parseNum(options.nextMajor);
2706
2749
  const debug = parseBool(options.debug);
2707
- const filename = path4__default.basename(this.resourcePath);
2750
+ const filename = path4.basename(this.resourcePath);
2708
2751
  const effective = {
2709
2752
  addDataAttr: parseBool(options.addDataAttr),
2710
2753
  // App Router: selalu auto-detect client boundary
@@ -2766,7 +2809,7 @@ function turbopackLoader(source, options = {}) {
2766
2809
  return source;
2767
2810
  }
2768
2811
  }
2769
-
2770
- export { turbopackLoader as default };
2771
- //# sourceMappingURL=turbopackLoader.mjs.map
2812
+ export {
2813
+ turbopackLoader as default
2814
+ };
2772
2815
  //# sourceMappingURL=turbopackLoader.mjs.map