tailwind-styled-v4 5.0.40 → 5.1.1

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 (103) 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/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
  102. package/native/tailwind-styled-native.node +0 -0
  103. package/package.json +1 -1
@@ -10,10 +10,31 @@ var __esm = (fn, res) => function __init() {
10
10
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
11
  };
12
12
 
13
+ // node_modules/tsup/assets/esm_shims.js
14
+ import path from "path";
15
+ import { fileURLToPath } from "url";
16
+ var getFilename, __filename;
17
+ var init_esm_shims = __esm({
18
+ "node_modules/tsup/assets/esm_shims.js"() {
19
+ "use strict";
20
+ getFilename = () => fileURLToPath(import.meta.url);
21
+ __filename = /* @__PURE__ */ getFilename();
22
+ }
23
+ });
24
+
13
25
  // packages/domain/shared/src/native-resolution.ts
14
26
  import { createRequire } from "module";
15
27
  import * as fs from "fs";
16
- import * as path from "path";
28
+ import * as path2 from "path";
29
+ function _safeCreateRequire() {
30
+ if (typeof import.meta !== "undefined" && import.meta.url && !import.meta.url.includes("unknown")) {
31
+ return createRequire(import.meta.url);
32
+ }
33
+ if (typeof __filename !== "undefined") {
34
+ return createRequire(__filename);
35
+ }
36
+ return createRequire(new URL(`file://${process.cwd()}/`).href);
37
+ }
17
38
  function platformKey() {
18
39
  if (isBrowser) return "browser";
19
40
  return `${process.platform}-${process.arch}`;
@@ -49,11 +70,11 @@ function resolveNativeBinary(runtimeDir) {
49
70
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
50
71
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
51
72
  if (runtimeDir) {
52
- for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
53
- const pkgRoot = path.resolve(runtimeDir, depth);
73
+ for (const depth of ["..", path2.join("..", ".."), path2.join("..", "..", "..")]) {
74
+ const pkgRoot = path2.resolve(runtimeDir, depth);
54
75
  for (const bin of BINARY_NAMES_SELF) {
55
76
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
56
- const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
77
+ const candidate = path2.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
57
78
  tried.push(`self-bundled:${candidate}`);
58
79
  if (fs.existsSync(candidate)) {
59
80
  return { path: candidate, source: "prebuilt", platform, tried };
@@ -67,22 +88,22 @@ function resolveNativeBinary(runtimeDir) {
67
88
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
68
89
  const localCandidates = [];
69
90
  for (const bin of BINARY_NAMES) {
70
- localCandidates.push(path.resolve(base, `${bin}.node`));
71
- localCandidates.push(path.resolve(base, "..", `${bin}.node`));
72
- localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
73
- localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
91
+ localCandidates.push(path2.resolve(base, `${bin}.node`));
92
+ localCandidates.push(path2.resolve(base, "..", `${bin}.node`));
93
+ localCandidates.push(path2.resolve(base, `${bin}.${platform}.node`));
94
+ localCandidates.push(path2.resolve(base, `${bin}.${napiPlatform}.node`));
74
95
  }
75
96
  for (const startDir of [cwd, base]) {
76
97
  let dir = startDir;
77
98
  for (let i = 0; i < 6; i++) {
78
- const nativeDir = path.resolve(dir, "native");
99
+ const nativeDir = path2.resolve(dir, "native");
79
100
  for (const bin of BINARY_NAMES) {
80
- localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
81
- localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
82
- localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
83
- localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
101
+ localCandidates.push(path2.resolve(nativeDir, `${bin}.node`));
102
+ localCandidates.push(path2.resolve(nativeDir, `${bin}.${platform}.node`));
103
+ localCandidates.push(path2.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
104
+ localCandidates.push(path2.resolve(nativeDir, "target", "release", `${bin}.node`));
84
105
  }
85
- const parent = path.resolve(dir, "..");
106
+ const parent = path2.resolve(dir, "..");
86
107
  if (parent === dir) break;
87
108
  dir = parent;
88
109
  }
@@ -99,10 +120,9 @@ var isBrowser, _require, PLATFORM_MAP;
99
120
  var init_native_resolution = __esm({
100
121
  "packages/domain/shared/src/native-resolution.ts"() {
101
122
  "use strict";
123
+ init_esm_shims();
102
124
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
103
- _require = createRequire(
104
- typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
105
- );
125
+ _require = _safeCreateRequire();
106
126
  PLATFORM_MAP = {
107
127
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
108
128
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -117,13 +137,13 @@ var init_native_resolution = __esm({
117
137
  // packages/domain/shared/src/index.ts
118
138
  import { createHash } from "crypto";
119
139
  import fs2 from "fs";
120
- import path2 from "path";
121
- import { fileURLToPath } from "url";
140
+ import path3 from "path";
141
+ import { fileURLToPath as fileURLToPath2 } from "url";
122
142
  import { createRequire as createRequire2 } from "module";
123
143
  function resolveRuntimeDir(dir, importMetaUrl) {
124
- if (dir) return path2.resolve(dir);
144
+ if (dir) return path3.resolve(dir);
125
145
  try {
126
- return path2.dirname(fileURLToPath(importMetaUrl));
146
+ return path3.dirname(fileURLToPath2(importMetaUrl));
127
147
  } catch {
128
148
  return process.cwd();
129
149
  }
@@ -132,6 +152,7 @@ var _require2;
132
152
  var init_src = __esm({
133
153
  "packages/domain/shared/src/index.ts"() {
134
154
  "use strict";
155
+ init_esm_shims();
135
156
  init_native_resolution();
136
157
  _require2 = createRequire2(
137
158
  typeof __filename !== "undefined" ? `file://${__filename}` : import.meta.url ?? "file://unknown"
@@ -144,8 +165,9 @@ var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttemp
144
165
  var init_nativeBridge = __esm({
145
166
  "packages/domain/compiler/src/nativeBridge.ts"() {
146
167
  "use strict";
168
+ init_esm_shims();
147
169
  init_src();
148
- _loadNative = (path6) => __require(path6);
170
+ _loadNative = (path7) => __require(path7);
149
171
  log = (...args) => {
150
172
  if (process.env.DEBUG?.includes("compiler:native")) {
151
173
  console.log("[compiler:native]", ...args);
@@ -243,6 +265,7 @@ Tried paths: ${result.tried.join("\n")}`);
243
265
  var init_compiler = __esm({
244
266
  "packages/domain/compiler/src/compiler/index.ts"() {
245
267
  "use strict";
268
+ init_esm_shims();
246
269
  }
247
270
  });
248
271
 
@@ -250,6 +273,7 @@ var init_compiler = __esm({
250
273
  var init_parser = __esm({
251
274
  "packages/domain/compiler/src/parser/index.ts"() {
252
275
  "use strict";
276
+ init_esm_shims();
253
277
  }
254
278
  });
255
279
 
@@ -257,6 +281,7 @@ var init_parser = __esm({
257
281
  var init_analyzer = __esm({
258
282
  "packages/domain/compiler/src/analyzer/index.ts"() {
259
283
  "use strict";
284
+ init_esm_shims();
260
285
  }
261
286
  });
262
287
 
@@ -264,6 +289,7 @@ var init_analyzer = __esm({
264
289
  var init_cache = __esm({
265
290
  "packages/domain/compiler/src/cache/index.ts"() {
266
291
  "use strict";
292
+ init_esm_shims();
267
293
  }
268
294
  });
269
295
 
@@ -271,6 +297,7 @@ var init_cache = __esm({
271
297
  var init_redis = __esm({
272
298
  "packages/domain/compiler/src/redis/index.ts"() {
273
299
  "use strict";
300
+ init_esm_shims();
274
301
  }
275
302
  });
276
303
 
@@ -278,12 +305,13 @@ var init_redis = __esm({
278
305
  var init_watch = __esm({
279
306
  "packages/domain/compiler/src/watch/index.ts"() {
280
307
  "use strict";
308
+ init_esm_shims();
281
309
  }
282
310
  });
283
311
 
284
312
  // packages/domain/compiler/src/index.ts
285
313
  import fs3 from "fs";
286
- import path3 from "path";
314
+ import path4 from "path";
287
315
  import { createRequire as createRequire3 } from "module";
288
316
  function _layoutClassesToCss(classes) {
289
317
  const native = getNativeBridge();
@@ -323,6 +351,7 @@ var _require3, transformSource, _CONTAINER_BREAKPOINTS, runLoaderTransform, shou
323
351
  var init_src2 = __esm({
324
352
  "packages/domain/compiler/src/index.ts"() {
325
353
  "use strict";
354
+ init_esm_shims();
326
355
  init_nativeBridge();
327
356
  init_compiler();
328
357
  init_parser();
@@ -431,6 +460,7 @@ var init_src2 = __esm({
431
460
  var init_internal = __esm({
432
461
  "packages/domain/compiler/src/internal.ts"() {
433
462
  "use strict";
463
+ init_esm_shims();
434
464
  init_src2();
435
465
  init_compiler();
436
466
  init_parser();
@@ -442,13 +472,15 @@ var init_internal = __esm({
442
472
  });
443
473
 
444
474
  // packages/presentation/next/src/webpackLoader.ts
475
+ init_esm_shims();
445
476
  init_internal();
446
- import path5 from "path";
477
+ import path6 from "path";
447
478
  import { z } from "zod";
448
479
 
449
480
  // packages/presentation/next/src/staticCssWebpackPlugin.ts
481
+ init_esm_shims();
450
482
  import fs4 from "fs";
451
- import path4 from "path";
483
+ import path5 from "path";
452
484
  var _fileStaticCssMap = /* @__PURE__ */ new Map();
453
485
  function setFileStaticCss(filepath, css) {
454
486
  if (css && css.trim()) {
@@ -470,7 +502,7 @@ var WebpackLoaderOptionsSchema = z.object({
470
502
  preserveImports: z.boolean().optional(),
471
503
  safelistPath: z.string().optional()
472
504
  });
473
- var isNextBuildArtifact = (filepath) => filepath.includes(`${path5.sep}.next${path5.sep}`);
505
+ var isNextBuildArtifact = (filepath) => filepath.includes(`${path6.sep}.next${path6.sep}`);
474
506
  function webpackLoader(source) {
475
507
  const callback = this.async?.();
476
508
  if (!callback) {
@@ -511,7 +543,7 @@ function webpackLoader(source) {
511
543
  const rsc = output.rsc;
512
544
  const engine = output.engine ?? "js";
513
545
  const env = rsc?.isServer ? "server" : "client";
514
- const name = path5.basename(filepath);
546
+ const name = path6.basename(filepath);
515
547
  process.stdout.write(
516
548
  `[tailwind-styled/webpack] ${name} -> ${output.classes.length} classes (${env}) [${engine}]
517
549
  `