tailwind-styled-v4 5.0.17 → 5.0.20

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 (82) hide show
  1. package/dist/{analyzeWorkspace-CopJNGmi.d.ts → analyzeWorkspace-B1_XRfdl.d.ts} +1 -0
  2. package/dist/{analyzeWorkspace-DpVPccjz.d.mts → analyzeWorkspace-hYfu4Hg3.d.mts} +1 -0
  3. package/dist/analyzer.d.mts +2 -2
  4. package/dist/analyzer.d.ts +2 -2
  5. package/dist/analyzer.js +5 -4
  6. package/dist/analyzer.js.map +1 -1
  7. package/dist/analyzer.mjs +5 -4
  8. package/dist/analyzer.mjs.map +1 -1
  9. package/dist/animate.js +3 -3
  10. package/dist/animate.js.map +1 -1
  11. package/dist/animate.mjs +3 -3
  12. package/dist/animate.mjs.map +1 -1
  13. package/dist/atomic.js +52 -16
  14. package/dist/atomic.js.map +1 -1
  15. package/dist/atomic.mjs +52 -16
  16. package/dist/atomic.mjs.map +1 -1
  17. package/dist/cli.js +57 -20
  18. package/dist/cli.js.map +1 -1
  19. package/dist/cli.mjs +57 -20
  20. package/dist/cli.mjs.map +1 -1
  21. package/dist/compiler.d.mts +177 -2
  22. package/dist/compiler.d.ts +177 -2
  23. package/dist/compiler.js +186 -24
  24. package/dist/compiler.js.map +1 -1
  25. package/dist/compiler.mjs +173 -25
  26. package/dist/compiler.mjs.map +1 -1
  27. package/dist/engine.d.mts +3 -3
  28. package/dist/engine.d.ts +3 -3
  29. package/dist/engine.js +191 -27
  30. package/dist/engine.js.map +1 -1
  31. package/dist/engine.mjs +191 -27
  32. package/dist/engine.mjs.map +1 -1
  33. package/dist/{index-DJv28Uzq.d.mts → index-DQI6O24n.d.mts} +1 -1
  34. package/dist/{index-BDQw13kn.d.ts → index-UkYbyBkR.d.ts} +1 -1
  35. package/dist/index.browser.mjs +5 -66
  36. package/dist/index.browser.mjs.map +1 -1
  37. package/dist/index.d.mts +2 -2
  38. package/dist/index.d.ts +2 -2
  39. package/dist/index.js +241 -118
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +241 -118
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/next.js +202 -24
  44. package/dist/next.js.map +1 -1
  45. package/dist/next.mjs +202 -24
  46. package/dist/next.mjs.map +1 -1
  47. package/dist/plugin.d.mts +3 -3
  48. package/dist/plugin.d.ts +3 -3
  49. package/dist/plugin.js.map +1 -1
  50. package/dist/plugin.mjs.map +1 -1
  51. package/dist/shared.d.mts +2 -3
  52. package/dist/shared.d.ts +2 -3
  53. package/dist/shared.js +186 -23
  54. package/dist/shared.js.map +1 -1
  55. package/dist/shared.mjs +186 -23
  56. package/dist/shared.mjs.map +1 -1
  57. package/dist/svelte.js +24 -42
  58. package/dist/svelte.js.map +1 -1
  59. package/dist/svelte.mjs +24 -42
  60. package/dist/svelte.mjs.map +1 -1
  61. package/dist/turbopackLoader.js +186 -23
  62. package/dist/turbopackLoader.js.map +1 -1
  63. package/dist/turbopackLoader.mjs +186 -23
  64. package/dist/turbopackLoader.mjs.map +1 -1
  65. package/dist/tw.js +57 -20
  66. package/dist/tw.js.map +1 -1
  67. package/dist/tw.mjs +57 -20
  68. package/dist/tw.mjs.map +1 -1
  69. package/dist/vite.js +324 -160
  70. package/dist/vite.js.map +1 -1
  71. package/dist/vite.mjs +324 -160
  72. package/dist/vite.mjs.map +1 -1
  73. package/dist/vue.js +24 -42
  74. package/dist/vue.js.map +1 -1
  75. package/dist/vue.mjs +24 -42
  76. package/dist/vue.mjs.map +1 -1
  77. package/dist/webpackLoader.js +52 -16
  78. package/dist/webpackLoader.js.map +1 -1
  79. package/dist/webpackLoader.mjs +52 -16
  80. package/dist/webpackLoader.mjs.map +1 -1
  81. package/native/tailwind-styled-native.node +0 -0
  82. package/package.json +1 -4
package/dist/tw.mjs CHANGED
@@ -3177,15 +3177,27 @@ function resolveNativeBinary(runtimeDir) {
3177
3177
  }
3178
3178
  tried.push(`env:${envPath} (not found)`);
3179
3179
  }
3180
+ const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
3181
+ for (const pkg of prebuiltPkgs) {
3182
+ try {
3183
+ const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
3184
+ if (fs11.existsSync(candidate)) {
3185
+ return { path: candidate, source: "prebuilt", platform, tried };
3186
+ }
3187
+ tried.push(`prebuilt:${pkg} (resolved but missing)`);
3188
+ } catch {
3189
+ tried.push(`prebuilt:${pkg} (not installed)`);
3190
+ }
3191
+ }
3180
3192
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
3181
- const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser", "index"];
3193
+ const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
3182
3194
  if (runtimeDir) {
3183
3195
  for (const depth of ["..", path6.join("..", ".."), path6.join("..", "..", "..")]) {
3184
3196
  const pkgRoot = path6.resolve(runtimeDir, depth);
3185
3197
  for (const bin of BINARY_NAMES_SELF) {
3186
3198
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
3187
3199
  const candidate = path6.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
3188
- tried.push(`native:${candidate}`);
3200
+ tried.push(`self-bundled:${candidate}`);
3189
3201
  if (fs11.existsSync(candidate)) {
3190
3202
  return { path: candidate, source: "prebuilt", platform, tried };
3191
3203
  }
@@ -3193,18 +3205,6 @@ function resolveNativeBinary(runtimeDir) {
3193
3205
  }
3194
3206
  }
3195
3207
  }
3196
- const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
3197
- for (const pkg of prebuiltPkgs) {
3198
- try {
3199
- const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
3200
- if (fs11.existsSync(candidate)) {
3201
- return { path: candidate, source: "prebuilt", platform, tried };
3202
- }
3203
- tried.push(`prebuilt:${pkg} (resolved but missing)`);
3204
- } catch {
3205
- tried.push(`prebuilt:${pkg} (not installed)`);
3206
- }
3207
- }
3208
3208
  const cwd2 = process.cwd();
3209
3209
  const base = runtimeDir ?? cwd2;
3210
3210
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
@@ -4386,7 +4386,7 @@ async function requireNativeBinding() {
4386
4386
  runtimeDir,
4387
4387
  candidates,
4388
4388
  isValid: isAnalyzerModule,
4389
- invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
4389
+ invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
4390
4390
  });
4391
4391
  const lines = [
4392
4392
  "Native analyzer binding not found. Ensure `tailwind_styled_parser.node` is built."
@@ -4413,7 +4413,7 @@ var init_binding = __esm({
4413
4413
  init_utils();
4414
4414
  isAnalyzerModule = (module) => {
4415
4415
  const candidate = module;
4416
- return typeof candidate?.analyzeClasses === "function";
4416
+ return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
4417
4417
  };
4418
4418
  createAnalyzerBindingLoader = () => {
4419
4419
  const _state = { bindingPromise: null };
@@ -4432,7 +4432,7 @@ var init_binding = __esm({
4432
4432
  runtimeDir,
4433
4433
  candidates,
4434
4434
  isValid: isAnalyzerModule,
4435
- invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
4435
+ invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
4436
4436
  });
4437
4437
  if (binding) {
4438
4438
  debugLog(`native binding loaded from: ${loadedPath}`);
@@ -4911,7 +4911,8 @@ async function analyzeWorkspace(root, options = {}) {
4911
4911
  );
4912
4912
  const nativeReport = (() => {
4913
4913
  try {
4914
- const report = binding.analyzeClasses(filesJson, resolvedRoot, topLimit);
4914
+ const fn = binding.analyzeClassesWorkspace || binding.analyzeClasses;
4915
+ const report = fn(filesJson, resolvedRoot, topLimit);
4915
4916
  if (!report) {
4916
4917
  throw new Error(`Native analyzer returned no report for "${resolvedRoot}".`);
4917
4918
  }
@@ -6069,8 +6070,44 @@ var init_nativeBridge = __esm({
6069
6070
  try {
6070
6071
  const binding = _loadNative(result.path);
6071
6072
  if (isValidNativeBridge(binding)) {
6072
- nativeBridge = binding;
6073
- log3("Native bridge loaded successfully from:", result.path);
6073
+ const toCamelCase = (str) => {
6074
+ return str.replace(/_([a-z0-9])/g, (_, g) => g.toUpperCase());
6075
+ };
6076
+ nativeBridge = new Proxy(binding, {
6077
+ get(target, prop) {
6078
+ if (typeof prop === "string") {
6079
+ if (prop in target) {
6080
+ return target[prop];
6081
+ }
6082
+ const camelKey = toCamelCase(prop);
6083
+ if (camelKey in target) {
6084
+ const val = target[camelKey];
6085
+ if (typeof val === "function") {
6086
+ return val.bind(target);
6087
+ }
6088
+ return val;
6089
+ }
6090
+ const napiKey = `${camelKey}Napi`;
6091
+ if (napiKey in target) {
6092
+ const val = target[napiKey];
6093
+ if (typeof val === "function") {
6094
+ return val.bind(target);
6095
+ }
6096
+ return val;
6097
+ }
6098
+ const napiInnerKey = `${camelKey}NapiInner`;
6099
+ if (napiInnerKey in target) {
6100
+ const val = target[napiInnerKey];
6101
+ if (typeof val === "function") {
6102
+ return val.bind(target);
6103
+ }
6104
+ return val;
6105
+ }
6106
+ }
6107
+ return target[prop];
6108
+ }
6109
+ });
6110
+ log3("Native bridge loaded successfully and proxy-wrapped from:", result.path);
6074
6111
  return nativeBridge;
6075
6112
  }
6076
6113
  } catch (e) {