tailwind-styled-v4 5.0.38 → 5.0.39

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 +19 -19
  2. package/dist/analyzer.js.map +1 -1
  3. package/dist/analyzer.mjs +3 -1
  4. package/dist/analyzer.mjs.map +1 -1
  5. package/dist/animate.js +8 -8
  6. package/dist/animate.js.map +1 -1
  7. package/dist/animate.mjs +3 -1
  8. package/dist/animate.mjs.map +1 -1
  9. package/dist/atomic.js +15 -12
  10. package/dist/atomic.js.map +1 -1
  11. package/dist/atomic.mjs +9 -3
  12. package/dist/atomic.mjs.map +1 -1
  13. package/dist/cli.js +71 -49
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +42 -13
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/compiler.js +25 -18
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/compiler.mjs +15 -5
  20. package/dist/compiler.mjs.map +1 -1
  21. package/dist/dashboard.js +1 -0
  22. package/dist/dashboard.js.map +1 -1
  23. package/dist/devtools.js +5 -3
  24. package/dist/devtools.js.map +1 -1
  25. package/dist/devtools.mjs +3 -1
  26. package/dist/devtools.mjs.map +1 -1
  27. package/dist/engine.js +88 -52
  28. package/dist/engine.js.map +1 -1
  29. package/dist/engine.mjs +58 -16
  30. package/dist/engine.mjs.map +1 -1
  31. package/dist/index.js +16 -9
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +12 -4
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/next.js +39 -29
  36. package/dist/next.js.map +1 -1
  37. package/dist/next.mjs +21 -8
  38. package/dist/next.mjs.map +1 -1
  39. package/dist/plugin-api.js +1 -0
  40. package/dist/plugin-api.js.map +1 -1
  41. package/dist/plugin-registry.js +2 -1
  42. package/dist/plugin-registry.js.map +1 -1
  43. package/dist/plugin.js +1 -0
  44. package/dist/plugin.js.map +1 -1
  45. package/dist/preset.js +1 -0
  46. package/dist/preset.js.map +1 -1
  47. package/dist/rspack.js +37 -14
  48. package/dist/rspack.js.map +1 -1
  49. package/dist/rspack.mjs +31 -7
  50. package/dist/rspack.mjs.map +1 -1
  51. package/dist/runtime-css.js +1 -0
  52. package/dist/runtime-css.js.map +1 -1
  53. package/dist/runtime.js +1 -0
  54. package/dist/runtime.js.map +1 -1
  55. package/dist/scanner.js +15 -14
  56. package/dist/scanner.js.map +1 -1
  57. package/dist/scanner.mjs +3 -1
  58. package/dist/scanner.mjs.map +1 -1
  59. package/dist/shared.d.mts +0 -12
  60. package/dist/shared.d.ts +0 -12
  61. package/dist/shared.js +66 -30
  62. package/dist/shared.js.map +1 -1
  63. package/dist/shared.mjs +55 -15
  64. package/dist/shared.mjs.map +1 -1
  65. package/dist/storybook-addon.js +1 -0
  66. package/dist/storybook-addon.js.map +1 -1
  67. package/dist/svelte.js +16 -9
  68. package/dist/svelte.js.map +1 -1
  69. package/dist/svelte.mjs +12 -4
  70. package/dist/svelte.mjs.map +1 -1
  71. package/dist/syntax.js +3 -2
  72. package/dist/syntax.js.map +1 -1
  73. package/dist/testing.js +1 -0
  74. package/dist/testing.js.map +1 -1
  75. package/dist/theme.js +8 -6
  76. package/dist/theme.js.map +1 -1
  77. package/dist/theme.mjs +3 -1
  78. package/dist/theme.mjs.map +1 -1
  79. package/dist/turbopackLoader.js +25 -18
  80. package/dist/turbopackLoader.js.map +1 -1
  81. package/dist/turbopackLoader.mjs +15 -5
  82. package/dist/turbopackLoader.mjs.map +1 -1
  83. package/dist/tw.js +71 -49
  84. package/dist/tw.js.map +1 -1
  85. package/dist/tw.mjs +42 -13
  86. package/dist/tw.mjs.map +1 -1
  87. package/dist/vite.js +84 -50
  88. package/dist/vite.js.map +1 -1
  89. package/dist/vite.mjs +55 -15
  90. package/dist/vite.mjs.map +1 -1
  91. package/dist/vue.js +16 -9
  92. package/dist/vue.js.map +1 -1
  93. package/dist/vue.mjs +12 -4
  94. package/dist/vue.mjs.map +1 -1
  95. package/dist/webpackLoader.js +15 -12
  96. package/dist/webpackLoader.js.map +1 -1
  97. package/dist/webpackLoader.mjs +9 -3
  98. package/dist/webpackLoader.mjs.map +1 -1
  99. package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
  100. package/native/tailwind-styled-native.node +0 -0
  101. package/package.json +1 -1
package/dist/shared.js CHANGED
@@ -1,3 +1,4 @@
1
+ const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
1
2
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
2
3
  "use strict";
3
4
  var __create = Object.create;
@@ -305,48 +306,78 @@ function getNodeModuleRef() {
305
306
  return null;
306
307
  }
307
308
  }
309
+ function getCurrentFileUrl() {
310
+ if (__importMetaUrl) {
311
+ return __importMetaUrl;
312
+ }
313
+ if (typeof __filename !== "undefined") {
314
+ return `file://${__filename.replace(/\\/g, "/")}`;
315
+ }
316
+ return "file://unknown";
317
+ }
308
318
  function getNodePath() {
309
319
  if (isBrowser) throw new Error("node:path not available in browser");
310
- const nodeRequire = getNodeModuleRef();
311
- if (!nodeRequire) throw new Error("require not available");
312
- if (!_nodePath) _nodePath = nodeRequire.createRequire(import_meta.url)("node:path");
320
+ if (!_nodePath) {
321
+ if (typeof require === "function") {
322
+ _nodePath = require("path");
323
+ } else {
324
+ const nodeRequire = getNodeModuleRef();
325
+ if (!nodeRequire) throw new Error("require not available");
326
+ _nodePath = nodeRequire.createRequire(getCurrentFileUrl())("node:path");
327
+ }
328
+ }
313
329
  return _nodePath;
314
330
  }
315
331
  function getNodeUrl() {
316
332
  if (isBrowser) throw new Error("node:url not available in browser");
317
- const nodeRequire = getNodeModuleRef();
318
- if (!nodeRequire) throw new Error("require not available");
319
- if (!_nodeUrl) _nodeUrl = nodeRequire.createRequire(import_meta.url)("node:url");
333
+ if (!_nodeUrl) {
334
+ if (typeof require === "function") {
335
+ _nodeUrl = require("url");
336
+ } else {
337
+ const nodeRequire = getNodeModuleRef();
338
+ if (!nodeRequire) throw new Error("require not available");
339
+ _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())("node:url");
340
+ }
341
+ }
320
342
  return _nodeUrl;
321
343
  }
322
344
  function getNodeFs() {
323
345
  if (isBrowser) throw new Error("node:fs not available in browser");
324
- const nodeRequire = getNodeModuleRef();
325
- if (!nodeRequire) throw new Error("require not available");
326
- if (!_nodeFs) _nodeFs = nodeRequire.createRequire(import_meta.url)("node:fs");
346
+ if (!_nodeFs) {
347
+ if (typeof require === "function") {
348
+ _nodeFs = require("fs");
349
+ } else {
350
+ const nodeRequire = getNodeModuleRef();
351
+ if (!nodeRequire) throw new Error("require not available");
352
+ _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())("node:fs");
353
+ }
354
+ }
327
355
  return _nodeFs;
328
356
  }
329
357
  function createEsmRequire(importMetaUrl) {
330
358
  if (isBrowser) throw new Error("require not available in browser");
359
+ if (typeof require === "function") return require;
331
360
  const nodeRequire = getNodeModuleRef();
332
361
  if (!nodeRequire) throw new Error("require not available");
333
362
  return nodeRequire.createRequire(importMetaUrl);
334
363
  }
335
364
  function getDirname(importMetaUrl) {
336
365
  if (isBrowser) return "";
366
+ if (typeof __dirname !== "undefined") return __dirname;
337
367
  const nodePath = getNodePath();
338
368
  const nodeUrl = getNodeUrl();
339
369
  return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
340
370
  }
341
371
  function getFilename(importMetaUrl) {
342
372
  if (isBrowser) return "";
373
+ if (typeof __filename !== "undefined") return __filename;
343
374
  return getNodeUrl().fileURLToPath(importMetaUrl);
344
375
  }
345
376
  function resolveFromRoot(...segments) {
346
377
  if (isBrowser) return segments.join("/");
347
378
  const nodePath = getNodePath();
348
379
  const nodeFs = getNodeFs();
349
- let dir = getDirname(import_meta.url);
380
+ let dir = typeof __dirname !== "undefined" ? __dirname : getDirname(getCurrentFileUrl());
350
381
  for (let i = 0; i < 10; i++) {
351
382
  const pkgPath = nodePath.join(dir, "package.json");
352
383
  try {
@@ -372,11 +403,10 @@ function resolveNativeNodePath(importMetaUrl, ...relativeSegments) {
372
403
  if (isBrowser) return relativeSegments.join("/");
373
404
  return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments);
374
405
  }
375
- var import_meta, isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
406
+ var isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
376
407
  var init_esmHelpers = __esm({
377
408
  "packages/domain/shared/src/esmHelpers.ts"() {
378
409
  "use strict";
379
- import_meta = {};
380
410
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
381
411
  nodeModuleRef = null;
382
412
  _nodePath = null;
@@ -945,16 +975,17 @@ function formatNativeNotFoundError(result) {
945
975
  ];
946
976
  return lines.join("\n");
947
977
  }
948
- var import_node_module, fs, path, import_meta2, isBrowser3, _require, PLATFORM_MAP;
978
+ var import_node_module, fs, path, isBrowser3, _require, PLATFORM_MAP;
949
979
  var init_native_resolution = __esm({
950
980
  "packages/domain/shared/src/native-resolution.ts"() {
951
981
  "use strict";
952
982
  import_node_module = require("module");
953
983
  fs = __toESM(require("fs"));
954
984
  path = __toESM(require("path"));
955
- import_meta2 = {};
956
985
  isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
957
- _require = typeof require !== "undefined" ? require : (0, import_node_module.createRequire)(import_meta2.url);
986
+ _require = (0, import_node_module.createRequire)(
987
+ typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
988
+ );
958
989
  PLATFORM_MAP = {
959
990
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
960
991
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -1005,12 +1036,11 @@ var init_observability = __esm({
1005
1036
  });
1006
1037
 
1007
1038
  // packages/domain/compiler/src/nativeBridge.ts
1008
- var import_meta3, _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
1039
+ var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
1009
1040
  var init_nativeBridge = __esm({
1010
1041
  "packages/domain/compiler/src/nativeBridge.ts"() {
1011
1042
  "use strict";
1012
1043
  init_src2();
1013
- import_meta3 = {};
1014
1044
  _loadNative = (path6) => require(path6);
1015
1045
  log = (...args) => {
1016
1046
  if (process.env.DEBUG?.includes("compiler:native")) {
@@ -1037,7 +1067,7 @@ var init_nativeBridge = __esm({
1037
1067
  }
1038
1068
  bridgeLoadAttempted = true;
1039
1069
  try {
1040
- const runtimeDir = resolveRuntimeDir(void 0, import_meta3.url);
1070
+ const runtimeDir = resolveRuntimeDir(void 0, __importMetaUrl);
1041
1071
  const result = resolveNativeBinary(runtimeDir);
1042
1072
  if (result.path && result.path.endsWith(".node")) {
1043
1073
  try {
@@ -1656,13 +1686,15 @@ async function generateRawCss(classes, cssEntryContent, root) {
1656
1686
  const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
1657
1687
  return compiler.build(classes);
1658
1688
  }
1659
- var import_node_module2, import_meta4, require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
1689
+ var import_node_module2, import_meta, require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
1660
1690
  var init_tailwindEngine = __esm({
1661
1691
  "packages/domain/compiler/src/tailwindEngine.ts"() {
1662
1692
  "use strict";
1663
1693
  import_node_module2 = require("module");
1664
- import_meta4 = {};
1665
- require2 = (0, import_node_module2.createRequire)(import_meta4.url);
1694
+ import_meta = {};
1695
+ require2 = (0, import_node_module2.createRequire)(
1696
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
1697
+ );
1666
1698
  MAX_CACHE_MEMORY = 256 * 1024;
1667
1699
  _twEngine = null;
1668
1700
  _twEngineError = null;
@@ -1844,7 +1876,7 @@ function processTailwindCssWithTargets(css, targets) {
1844
1876
  }
1845
1877
  return result.css;
1846
1878
  }
1847
- var import_node_module3, import_meta5, require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
1879
+ var import_node_module3, import_meta2, require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
1848
1880
  var init_tailwindEngine2 = __esm({
1849
1881
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1850
1882
  "use strict";
@@ -1853,8 +1885,10 @@ var init_tailwindEngine2 = __esm({
1853
1885
  init_cssGeneratorNative();
1854
1886
  init_cssCompilationNative();
1855
1887
  init_tailwindEngine();
1856
- import_meta5 = {};
1857
- require3 = (0, import_node_module3.createRequire)(import_meta5.url);
1888
+ import_meta2 = {};
1889
+ require3 = (0, import_node_module3.createRequire)(
1890
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta2 !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
1891
+ );
1858
1892
  _cssCache = /* @__PURE__ */ new Map();
1859
1893
  _cacheHits = 0;
1860
1894
  _cacheMisses = 0;
@@ -2849,7 +2883,7 @@ function extractContainerCssFromSource(source) {
2849
2883
  }
2850
2884
  return rules.join("\n");
2851
2885
  }
2852
- var import_node_fs, import_node_path, import_node_module4, import_meta6, _require2, 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;
2886
+ var import_node_fs, import_node_path, import_node_module4, _require2, 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;
2853
2887
  var init_src = __esm({
2854
2888
  "packages/domain/compiler/src/index.ts"() {
2855
2889
  "use strict";
@@ -2863,8 +2897,9 @@ var init_src = __esm({
2863
2897
  init_cache();
2864
2898
  init_redis();
2865
2899
  init_watch();
2866
- import_meta6 = {};
2867
- _require2 = (0, import_node_module4.createRequire)(import_meta6.url);
2900
+ _require2 = (0, import_node_module4.createRequire)(
2901
+ typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
2902
+ );
2868
2903
  transformSource = (source, opts) => {
2869
2904
  const native = getNativeBridge();
2870
2905
  if (!native?.transformSource) {
@@ -3878,7 +3913,7 @@ function formatErrorMessage(error) {
3878
3913
  if (error instanceof Error) return error.message;
3879
3914
  return String(error);
3880
3915
  }
3881
- var import_node_crypto, import_node_fs4, import_node_path4, import_node_url, import_node_module5, import_meta7, TwError, _require3, LRUCache;
3916
+ var import_node_crypto, import_node_fs4, import_node_path4, import_node_url, import_node_module5, TwError, _require3, LRUCache;
3882
3917
  var init_src2 = __esm({
3883
3918
  "packages/domain/shared/src/index.ts"() {
3884
3919
  "use strict";
@@ -3900,7 +3935,6 @@ var init_src2 = __esm({
3900
3935
  init_observability();
3901
3936
  init_staticStateExtractor();
3902
3937
  init_logger();
3903
- import_meta7 = {};
3904
3938
  TwError = class _TwError extends Error {
3905
3939
  /** @deprecated Gunakan source */
3906
3940
  domain;
@@ -3953,7 +3987,9 @@ var init_src2 = __esm({
3953
3987
  return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
3954
3988
  }
3955
3989
  };
3956
- _require3 = (0, import_node_module5.createRequire)(import_meta7.url);
3990
+ _require3 = (0, import_node_module5.createRequire)(
3991
+ typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
3992
+ );
3957
3993
  LRUCache = class {
3958
3994
  capacity;
3959
3995
  cache;