tailwind-styled-v4 5.0.12 → 5.0.14

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 (69) hide show
  1. package/README.md +100 -4
  2. package/dist/animate.d.mts +4 -0
  3. package/dist/animate.d.ts +4 -0
  4. package/dist/animate.js +22 -0
  5. package/dist/animate.js.map +1 -1
  6. package/dist/animate.mjs +22 -0
  7. package/dist/animate.mjs.map +1 -1
  8. package/dist/atomic.js +56 -14
  9. package/dist/atomic.js.map +1 -1
  10. package/dist/atomic.mjs +56 -14
  11. package/dist/atomic.mjs.map +1 -1
  12. package/dist/cli.js +156 -14
  13. package/dist/cli.js.map +1 -1
  14. package/dist/cli.mjs +156 -14
  15. package/dist/cli.mjs.map +1 -1
  16. package/dist/compiler.d.mts +1045 -991
  17. package/dist/compiler.d.ts +1045 -991
  18. package/dist/compiler.js +891 -925
  19. package/dist/compiler.js.map +1 -1
  20. package/dist/compiler.mjs +890 -925
  21. package/dist/compiler.mjs.map +1 -1
  22. package/dist/engine.js +1651 -354
  23. package/dist/engine.js.map +1 -1
  24. package/dist/engine.mjs +1650 -353
  25. package/dist/engine.mjs.map +1 -1
  26. package/dist/index.browser.mjs +3 -1
  27. package/dist/index.browser.mjs.map +1 -1
  28. package/dist/index.js +1682 -365
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +1682 -365
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/next.js +1076 -986
  33. package/dist/next.js.map +1 -1
  34. package/dist/next.mjs +1076 -986
  35. package/dist/next.mjs.map +1 -1
  36. package/dist/shared.d.mts +3 -2
  37. package/dist/shared.d.ts +3 -2
  38. package/dist/shared.js +1595 -298
  39. package/dist/shared.js.map +1 -1
  40. package/dist/shared.mjs +1595 -298
  41. package/dist/shared.mjs.map +1 -1
  42. package/dist/svelte.js +42 -24
  43. package/dist/svelte.js.map +1 -1
  44. package/dist/svelte.mjs +42 -24
  45. package/dist/svelte.mjs.map +1 -1
  46. package/dist/turbopackLoader.js +1606 -309
  47. package/dist/turbopackLoader.js.map +1 -1
  48. package/dist/turbopackLoader.mjs +1606 -309
  49. package/dist/turbopackLoader.mjs.map +1 -1
  50. package/dist/tw.js +156 -14
  51. package/dist/tw.js.map +1 -1
  52. package/dist/tw.mjs +156 -14
  53. package/dist/tw.mjs.map +1 -1
  54. package/dist/vite.js +1636 -339
  55. package/dist/vite.js.map +1 -1
  56. package/dist/vite.mjs +1636 -339
  57. package/dist/vite.mjs.map +1 -1
  58. package/dist/vue.js +42 -24
  59. package/dist/vue.js.map +1 -1
  60. package/dist/vue.mjs +42 -24
  61. package/dist/vue.mjs.map +1 -1
  62. package/dist/webpackLoader.js +80 -29
  63. package/dist/webpackLoader.js.map +1 -1
  64. package/dist/webpackLoader.mjs +80 -29
  65. package/dist/webpackLoader.mjs.map +1 -1
  66. package/native/tailwind-styled-native.node +0 -0
  67. package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
  68. package/package.json +3 -2
  69. package/native/index.node +0 -0
@@ -37,27 +37,15 @@ function resolveNativeBinary(runtimeDir) {
37
37
  }
38
38
  tried.push(`env:${envPath} (not found)`);
39
39
  }
40
- const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
41
- for (const pkg of prebuiltPkgs) {
42
- try {
43
- const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
44
- if (fs.existsSync(candidate)) {
45
- return { path: candidate, source: "prebuilt", platform, tried };
46
- }
47
- tried.push(`prebuilt:${pkg} (resolved but missing)`);
48
- } catch {
49
- tried.push(`prebuilt:${pkg} (not installed)`);
50
- }
51
- }
52
40
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
53
- const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
41
+ const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser", "index"];
54
42
  if (runtimeDir) {
55
43
  for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
56
44
  const pkgRoot = path.resolve(runtimeDir, depth);
57
45
  for (const bin of BINARY_NAMES_SELF) {
58
46
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
59
47
  const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
60
- tried.push(`self-bundled:${candidate}`);
48
+ tried.push(`native:${candidate}`);
61
49
  if (fs.existsSync(candidate)) {
62
50
  return { path: candidate, source: "prebuilt", platform, tried };
63
51
  }
@@ -65,6 +53,18 @@ function resolveNativeBinary(runtimeDir) {
65
53
  }
66
54
  }
67
55
  }
56
+ const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
57
+ for (const pkg of prebuiltPkgs) {
58
+ try {
59
+ const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
60
+ if (fs.existsSync(candidate)) {
61
+ return { path: candidate, source: "prebuilt", platform, tried };
62
+ }
63
+ tried.push(`prebuilt:${pkg} (resolved but missing)`);
64
+ } catch {
65
+ tried.push(`prebuilt:${pkg} (not installed)`);
66
+ }
67
+ }
68
68
  const cwd = process.cwd();
69
69
  const base = runtimeDir ?? cwd;
70
70
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
@@ -189,6 +189,42 @@ Tried paths: ${result.tried.join("\n")}`);
189
189
  }
190
190
  }
191
191
  });
192
+
193
+ // packages/domain/compiler/src/compiler/index.ts
194
+ var init_compiler = __esm({
195
+ "packages/domain/compiler/src/compiler/index.ts"() {
196
+ }
197
+ });
198
+
199
+ // packages/domain/compiler/src/parser/index.ts
200
+ var init_parser = __esm({
201
+ "packages/domain/compiler/src/parser/index.ts"() {
202
+ }
203
+ });
204
+
205
+ // packages/domain/compiler/src/analyzer/index.ts
206
+ var init_analyzer = __esm({
207
+ "packages/domain/compiler/src/analyzer/index.ts"() {
208
+ }
209
+ });
210
+
211
+ // packages/domain/compiler/src/cache/index.ts
212
+ var init_cache = __esm({
213
+ "packages/domain/compiler/src/cache/index.ts"() {
214
+ }
215
+ });
216
+
217
+ // packages/domain/compiler/src/redis/index.ts
218
+ var init_redis = __esm({
219
+ "packages/domain/compiler/src/redis/index.ts"() {
220
+ }
221
+ });
222
+
223
+ // packages/domain/compiler/src/watch/index.ts
224
+ var init_watch = __esm({
225
+ "packages/domain/compiler/src/watch/index.ts"() {
226
+ }
227
+ });
192
228
  function _layoutClassesToCss(classes) {
193
229
  const native = getNativeBridge();
194
230
  if (!native?.layoutClassesToCss) {
@@ -227,6 +263,12 @@ var transformSource, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile,
227
263
  var init_src2 = __esm({
228
264
  "packages/domain/compiler/src/index.ts"() {
229
265
  init_nativeBridge();
266
+ init_compiler();
267
+ init_parser();
268
+ init_analyzer();
269
+ init_cache();
270
+ init_redis();
271
+ init_watch();
230
272
  transformSource = (source, opts) => {
231
273
  const native = getNativeBridge();
232
274
  if (!native?.transformSource) {
@@ -260,7 +302,8 @@ var init_src2 = __esm({
260
302
  if (containerCss) cssChunks.push(containerCss);
261
303
  const combined = cssChunks.join("\n").trim();
262
304
  if (combined) staticCss = combined;
263
- } catch {
305
+ } catch (err) {
306
+ console.debug("Static CSS extraction warning:", err);
264
307
  }
265
308
  return {
266
309
  code: result?.code || "",
@@ -289,23 +332,25 @@ var init_src2 = __esm({
289
332
  }
290
333
  return native.extractTwStateConfigs(source, filename);
291
334
  };
292
- generateStaticStateCss = (inputs, resolvedCss = null) => {
293
- const native = getNativeBridge();
294
- if (!native?.generateStaticStateCss) {
295
- throw new Error("FATAL: Native binding 'generateStaticStateCss' is required but not available.");
335
+ generateStaticStateCss = (entries, _themeConfig) => {
336
+ const rules = [];
337
+ for (const entry of entries) {
338
+ const stateConfig = JSON.parse(entry.statesJson);
339
+ for (const [stateName, classes] of Object.entries(stateConfig)) {
340
+ rules.push({
341
+ selector: `.${entry.componentName}[data-state="${stateName}"]`,
342
+ declarations: classes,
343
+ cssRule: `.${entry.componentName}[data-state="${stateName}"]{${classes}}`,
344
+ componentName: entry.componentName,
345
+ stateName
346
+ });
347
+ }
296
348
  }
297
- return native.generateStaticStateCss(inputs, resolvedCss);
349
+ return rules;
298
350
  };
299
351
  extractAndGenerateStateCss = (source, filename) => {
300
- const native = getNativeBridge();
301
- if (!native?.extractAndGenerateStateCss) {
302
- const configs = extractTwStateConfigs(source, filename);
303
- if (configs.length === 0) return [];
304
- return generateStaticStateCss(
305
- configs.map((c) => ({ tag: c.tag, componentName: c.componentName, statesJson: c.statesJson }))
306
- );
307
- }
308
- return native.extractAndGenerateStateCss(source, filename);
352
+ const entries = extractTwStateConfigs(source, filename);
353
+ return generateStaticStateCss(entries);
309
354
  };
310
355
  }
311
356
  });
@@ -314,6 +359,12 @@ var init_src2 = __esm({
314
359
  var init_internal = __esm({
315
360
  "packages/domain/compiler/src/internal.ts"() {
316
361
  init_src2();
362
+ init_compiler();
363
+ init_parser();
364
+ init_analyzer();
365
+ init_cache();
366
+ init_redis();
367
+ init_watch();
317
368
  }
318
369
  });
319
370