tailwind-styled-v4 5.0.10 → 5.0.11

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 (93) hide show
  1. package/README.md +245 -373
  2. package/dist/analyzer.js +75 -22
  3. package/dist/analyzer.js.map +1 -1
  4. package/dist/analyzer.mjs +74 -21
  5. package/dist/analyzer.mjs.map +1 -1
  6. package/dist/animate.js +4 -2
  7. package/dist/animate.js.map +1 -1
  8. package/dist/animate.mjs +4 -2
  9. package/dist/animate.mjs.map +1 -1
  10. package/dist/atomic.js +20 -5
  11. package/dist/atomic.js.map +1 -1
  12. package/dist/atomic.mjs +20 -5
  13. package/dist/atomic.mjs.map +1 -1
  14. package/dist/cli.js +174 -67
  15. package/dist/cli.js.map +1 -1
  16. package/dist/cli.mjs +171 -64
  17. package/dist/cli.mjs.map +1 -1
  18. package/dist/compiler.d.mts +7 -1
  19. package/dist/compiler.d.ts +7 -1
  20. package/dist/compiler.js +53 -27
  21. package/dist/compiler.js.map +1 -1
  22. package/dist/compiler.mjs +53 -27
  23. package/dist/compiler.mjs.map +1 -1
  24. package/dist/devtools.js.map +1 -1
  25. package/dist/devtools.mjs.map +1 -1
  26. package/dist/engine.js +159 -61
  27. package/dist/engine.js.map +1 -1
  28. package/dist/engine.mjs +159 -61
  29. package/dist/engine.mjs.map +1 -1
  30. package/dist/index.browser.mjs +1512 -0
  31. package/dist/index.browser.mjs.map +1 -0
  32. package/dist/index.d.mts +94 -12
  33. package/dist/index.d.ts +94 -12
  34. package/dist/index.js +436 -106
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.mjs +436 -106
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/next.js +1946 -47
  39. package/dist/next.js.map +1 -1
  40. package/dist/next.mjs +1929 -44
  41. package/dist/next.mjs.map +1 -1
  42. package/dist/plugin-api.js.map +1 -1
  43. package/dist/plugin-api.mjs.map +1 -1
  44. package/dist/plugin-registry.js +23 -10
  45. package/dist/plugin-registry.js.map +1 -1
  46. package/dist/plugin-registry.mjs +23 -11
  47. package/dist/plugin-registry.mjs.map +1 -1
  48. package/dist/plugin.js.map +1 -1
  49. package/dist/plugin.mjs.map +1 -1
  50. package/dist/rspack.js.map +1 -1
  51. package/dist/rspack.mjs.map +1 -1
  52. package/dist/scanner.js +72 -19
  53. package/dist/scanner.js.map +1 -1
  54. package/dist/scanner.mjs +71 -18
  55. package/dist/scanner.mjs.map +1 -1
  56. package/dist/shared.js +32 -15
  57. package/dist/shared.js.map +1 -1
  58. package/dist/shared.mjs +32 -15
  59. package/dist/shared.mjs.map +1 -1
  60. package/dist/svelte.js +38 -12
  61. package/dist/svelte.js.map +1 -1
  62. package/dist/svelte.mjs +38 -12
  63. package/dist/svelte.mjs.map +1 -1
  64. package/dist/syntax.js +17 -5
  65. package/dist/syntax.js.map +1 -1
  66. package/dist/syntax.mjs +17 -5
  67. package/dist/syntax.mjs.map +1 -1
  68. package/dist/theme.js +4 -2
  69. package/dist/theme.js.map +1 -1
  70. package/dist/theme.mjs +4 -2
  71. package/dist/theme.mjs.map +1 -1
  72. package/dist/turbopackLoader.js +87 -33
  73. package/dist/turbopackLoader.js.map +1 -1
  74. package/dist/turbopackLoader.mjs +87 -33
  75. package/dist/turbopackLoader.mjs.map +1 -1
  76. package/dist/tw.js +174 -67
  77. package/dist/tw.js.map +1 -1
  78. package/dist/tw.mjs +171 -64
  79. package/dist/tw.mjs.map +1 -1
  80. package/dist/vite.js +145 -63
  81. package/dist/vite.js.map +1 -1
  82. package/dist/vite.mjs +145 -63
  83. package/dist/vite.mjs.map +1 -1
  84. package/dist/vue.js +38 -12
  85. package/dist/vue.js.map +1 -1
  86. package/dist/vue.mjs +38 -12
  87. package/dist/vue.mjs.map +1 -1
  88. package/dist/webpackLoader.js +20 -5
  89. package/dist/webpackLoader.js.map +1 -1
  90. package/dist/webpackLoader.mjs +20 -5
  91. package/dist/webpackLoader.mjs.map +1 -1
  92. package/native/tailwind-styled-native.node +0 -0
  93. package/package.json +29 -24
package/dist/shared.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var crypto = require('crypto');
4
- var fs2 = require('fs');
4
+ var fs = require('fs');
5
5
  var path = require('path');
6
6
  var url = require('url');
7
7
  var module$1 = require('module');
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
26
26
  return Object.freeze(n);
27
27
  }
28
28
 
29
- var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
29
+ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
30
30
  var path__namespace = /*#__PURE__*/_interopNamespace(path);
31
31
 
32
32
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
@@ -799,12 +799,12 @@ function generateBarrelFile(exports$1, dir, opts = {}) {
799
799
  var isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
800
800
  var _require = typeof __require !== "undefined" ? __require : module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared.js', document.baseURI).href)));
801
801
  var PLATFORM_MAP = {
802
- "linux-x64": ["@tailwind-styled/native-linux-x64"],
803
- "linux-arm64": ["@tailwind-styled/native-linux-arm64"],
802
+ "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
803
+ "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
804
804
  "darwin-x64": ["@tailwind-styled/native-darwin-x64"],
805
805
  "darwin-arm64": ["@tailwind-styled/native-darwin-arm64"],
806
- "win32-x64": ["@tailwind-styled/native-win32-x64"],
807
- "win32-arm64": ["@tailwind-styled/native-win32-arm64"]
806
+ "win32-x64": ["@tailwind-styled/native-win32-x64-msvc", "@tailwind-styled/native-win32-x64"],
807
+ "win32-arm64": ["@tailwind-styled/native-win32-arm64-msvc", "@tailwind-styled/native-win32-arm64"]
808
808
  };
809
809
  function platformKey() {
810
810
  if (isBrowser3) return "browser";
@@ -821,7 +821,7 @@ function resolveNativeBinary(runtimeDir) {
821
821
  }
822
822
  const envPath = process.env.TW_NATIVE_PATH?.trim();
823
823
  if (envPath) {
824
- if (fs2__namespace.existsSync(envPath)) {
824
+ if (fs__namespace.existsSync(envPath)) {
825
825
  return { path: envPath, source: "env", platform, tried };
826
826
  }
827
827
  tried.push(`env:${envPath} (not found)`);
@@ -830,7 +830,7 @@ function resolveNativeBinary(runtimeDir) {
830
830
  for (const pkg of prebuiltPkgs) {
831
831
  try {
832
832
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
833
- if (fs2__namespace.existsSync(candidate)) {
833
+ if (fs__namespace.existsSync(candidate)) {
834
834
  return { path: candidate, source: "prebuilt", platform, tried };
835
835
  }
836
836
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -838,9 +838,24 @@ function resolveNativeBinary(runtimeDir) {
838
838
  tried.push(`prebuilt:${pkg} (not installed)`);
839
839
  }
840
840
  }
841
+ const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
842
+ const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
843
+ if (runtimeDir) {
844
+ for (const depth of ["..", path__namespace.join("..", ".."), path__namespace.join("..", "..", "..")]) {
845
+ const pkgRoot = path__namespace.resolve(runtimeDir, depth);
846
+ for (const bin of BINARY_NAMES_SELF) {
847
+ for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
848
+ const candidate = path__namespace.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
849
+ tried.push(`self-bundled:${candidate}`);
850
+ if (fs__namespace.existsSync(candidate)) {
851
+ return { path: candidate, source: "prebuilt", platform, tried };
852
+ }
853
+ }
854
+ }
855
+ }
856
+ }
841
857
  const cwd = process.cwd();
842
858
  const base = runtimeDir ?? cwd;
843
- const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
844
859
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
845
860
  const localCandidates = [];
846
861
  for (const bin of BINARY_NAMES) {
@@ -866,7 +881,7 @@ function resolveNativeBinary(runtimeDir) {
866
881
  }
867
882
  for (const candidate of localCandidates) {
868
883
  tried.push(`local:${candidate}`);
869
- if (fs2__namespace.existsSync(candidate)) {
884
+ if (fs__namespace.existsSync(candidate)) {
870
885
  return { path: candidate, source: "local", platform, tried };
871
886
  }
872
887
  }
@@ -1020,7 +1035,7 @@ function loadNativeBinding(options) {
1020
1035
  for (const candidate of candidates) {
1021
1036
  const candidatePath = path__namespace.default.resolve(runtimeDir, candidate);
1022
1037
  try {
1023
- if (!fs2__namespace.default.existsSync(candidatePath) && !fs2__namespace.default.existsSync(candidatePath + ".node")) {
1038
+ if (!fs__namespace.default.existsSync(candidatePath) && !fs__namespace.default.existsSync(candidatePath + ".node")) {
1024
1039
  continue;
1025
1040
  }
1026
1041
  const mod = requireNativeModule(candidatePath);
@@ -1053,9 +1068,9 @@ function resolveNativeBindingCandidates(options) {
1053
1068
  }
1054
1069
  }
1055
1070
  if (!includeDefaultCandidates) return candidates;
1056
- if (fs2__namespace.default.existsSync(runtimeDir)) {
1071
+ if (fs__namespace.default.existsSync(runtimeDir)) {
1057
1072
  try {
1058
- for (const entry of fs2__namespace.default.readdirSync(runtimeDir)) {
1073
+ for (const entry of fs__namespace.default.readdirSync(runtimeDir)) {
1059
1074
  if (entry.endsWith(".node")) candidates.push(entry);
1060
1075
  }
1061
1076
  } catch {
@@ -1066,11 +1081,13 @@ function resolveNativeBindingCandidates(options) {
1066
1081
  for (const bin of BINARY_NAMES) {
1067
1082
  candidates.push(path__namespace.default.resolve(runtimeDir, `${bin}.node`));
1068
1083
  candidates.push(path__namespace.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
1084
+ candidates.push(path__namespace.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
1085
+ candidates.push(path__namespace.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
1086
+ candidates.push(path__namespace.default.resolve(process.cwd(), "native", `${bin}.node`));
1087
+ candidates.push(path__namespace.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
1069
1088
  candidates.push(path__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
1070
1089
  candidates.push(path__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
1071
1090
  candidates.push(path__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
1072
- candidates.push(path__namespace.default.resolve(process.cwd(), "native", `${bin}.node`));
1073
- candidates.push(path__namespace.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
1074
1091
  }
1075
1092
  return Array.from(new Set(candidates));
1076
1093
  }