tailwind-styled-v4 5.0.12 → 5.0.13

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 (60) 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 +42 -0
  9. package/dist/atomic.js.map +1 -1
  10. package/dist/atomic.mjs +42 -0
  11. package/dist/atomic.mjs.map +1 -1
  12. package/dist/cli.js +142 -0
  13. package/dist/cli.js.map +1 -1
  14. package/dist/cli.mjs +142 -0
  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 +888 -922
  19. package/dist/compiler.js.map +1 -1
  20. package/dist/compiler.mjs +873 -908
  21. package/dist/compiler.mjs.map +1 -1
  22. package/dist/engine.js +1637 -340
  23. package/dist/engine.js.map +1 -1
  24. package/dist/engine.mjs +1636 -339
  25. package/dist/engine.mjs.map +1 -1
  26. package/dist/index.js +1636 -339
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +1636 -339
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/next.js +1060 -970
  31. package/dist/next.js.map +1 -1
  32. package/dist/next.mjs +1060 -970
  33. package/dist/next.mjs.map +1 -1
  34. package/dist/shared.js +1607 -310
  35. package/dist/shared.js.map +1 -1
  36. package/dist/shared.mjs +1607 -310
  37. package/dist/shared.mjs.map +1 -1
  38. package/dist/svelte.js.map +1 -1
  39. package/dist/svelte.mjs.map +1 -1
  40. package/dist/turbopackLoader.js +1610 -313
  41. package/dist/turbopackLoader.js.map +1 -1
  42. package/dist/turbopackLoader.mjs +1610 -313
  43. package/dist/turbopackLoader.mjs.map +1 -1
  44. package/dist/tw.js +142 -0
  45. package/dist/tw.js.map +1 -1
  46. package/dist/tw.mjs +142 -0
  47. package/dist/tw.mjs.map +1 -1
  48. package/dist/vite.js +1622 -325
  49. package/dist/vite.js.map +1 -1
  50. package/dist/vite.mjs +1622 -325
  51. package/dist/vite.mjs.map +1 -1
  52. package/dist/vue.js.map +1 -1
  53. package/dist/vue.mjs.map +1 -1
  54. package/dist/webpackLoader.js +66 -15
  55. package/dist/webpackLoader.js.map +1 -1
  56. package/dist/webpackLoader.mjs +66 -15
  57. package/dist/webpackLoader.mjs.map +1 -1
  58. package/native/tailwind-styled-native.node +0 -0
  59. package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
  60. package/package.json +1 -1
@@ -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