weapp-tailwindcss 5.1.13 → 5.1.15

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 (78) hide show
  1. package/dist/auto-2dg_uhEJ.mjs +13 -0
  2. package/dist/bundlers/gulp/frameworks/native/index.d.ts +2 -0
  3. package/dist/bundlers/gulp/index.d.ts +2 -0
  4. package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +2 -0
  5. package/dist/bundlers/shared/generated-css-marker.d.ts +2 -2
  6. package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
  7. package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +2 -0
  8. package/dist/bundlers/shared/generator-css/types.d.ts +5 -0
  9. package/dist/bundlers/shared/style-requests.d.ts +1 -0
  10. package/dist/bundlers/vite/bundle-state.d.ts +1 -0
  11. package/dist/bundlers/vite/css-finalizer.d.ts +1 -0
  12. package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -0
  13. package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +2 -0
  14. package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +2 -0
  15. package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +20 -0
  16. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
  17. package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +4 -0
  18. package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +18 -0
  19. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
  20. package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +1 -0
  21. package/dist/bundlers/vite/generate-bundle/types.d.ts +7 -0
  22. package/dist/bundlers/vite/serve-css-generation.d.ts +3 -2
  23. package/dist/bundlers/vite/serve-root-import-shell.d.ts +8 -0
  24. package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +1 -0
  25. package/dist/bundlers/vite/source-candidates.d.ts +3 -0
  26. package/dist/bundlers/vite/watch-css-post.d.ts +10 -0
  27. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
  28. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +1 -0
  29. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +2 -0
  30. package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -0
  31. package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +4 -0
  32. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +3 -0
  33. package/dist/{context-xSJE588m.mjs → context-BgGWVAmN.mjs} +5 -3
  34. package/dist/{context-DRRgW7i2.js → context-VeFq_8vW.js} +5 -3
  35. package/dist/core.js +1 -1
  36. package/dist/core.mjs +1 -1
  37. package/dist/css-macro.mjs +1 -1
  38. package/dist/{generator-CS10c9g1.js → generator-CEnUsjed.js} +17 -3
  39. package/dist/{generator-BvPcmqxU.mjs → generator-CEo920So.mjs} +18 -4
  40. package/dist/generator.js +1 -1
  41. package/dist/generator.mjs +1 -1
  42. package/dist/{gulp-DNZZvUMq.js → gulp-3m1dAiig.js} +92 -54
  43. package/dist/{gulp-BEOzXrbp.mjs → gulp-DP71z1jG.mjs} +92 -54
  44. package/dist/gulp.js +1 -1
  45. package/dist/gulp.mjs +1 -1
  46. package/dist/{hmr-timing-hRhRAjYV.mjs → hmr-timing-1aS6--U7.mjs} +272 -56
  47. package/dist/{hmr-timing-DW1g3zjl.js → hmr-timing-B8p4f0ca.js} +323 -53
  48. package/dist/index.js +4 -4
  49. package/dist/index.mjs +4 -4
  50. package/dist/postcss.js +1 -1
  51. package/dist/postcss.mjs +1 -1
  52. package/dist/presets.js +1 -1
  53. package/dist/presets.mjs +1 -1
  54. package/dist/rspack.js +1 -1
  55. package/dist/rspack.mjs +1 -1
  56. package/dist/shared/mpx.d.ts +4 -1
  57. package/dist/{source-candidate-scan-signature-CMgu5bJk.js → source-candidate-scan-signature-BAahhiwb.js} +20 -139
  58. package/dist/{source-candidate-scan-signature-t4XKAQ04.mjs → source-candidate-scan-signature-Cf7259PR.mjs} +21 -104
  59. package/dist/tailwindcss/candidates.d.ts +4 -0
  60. package/dist/{tailwindcss-z9JMF-qU.js → tailwindcss-KBYPJ2DW.js} +1 -1
  61. package/dist/{tailwindcss-DZT_pWrd.mjs → tailwindcss-xs704TRw.mjs} +1 -1
  62. package/dist/{transform-D5JUgMpE.mjs → transform-B_KM9sLX.mjs} +47 -5
  63. package/dist/{transform-COFRlmDF.js → transform-CcYptivi.js} +47 -5
  64. package/dist/uni-app-x/component-local-style.d.ts +1 -0
  65. package/dist/uni-app-x/style-asset/style-value.d.ts +1 -1
  66. package/dist/{vite-DnkObu2L.js → vite-DUVjMduj.js} +807 -320
  67. package/dist/{vite-Tpgi77vE.mjs → vite-nXZEiwG0.mjs} +757 -270
  68. package/dist/vite.js +1 -1
  69. package/dist/vite.mjs +1 -1
  70. package/dist/weapp-tw-css-generation-loader.js +12 -0
  71. package/dist/weapp-tw-css-import-rewrite-loader-DNk0IxAt.js +10198 -0
  72. package/dist/weapp-tw-css-import-rewrite-loader.js +6 -8209
  73. package/dist/{webpack-CTYm19zA.mjs → webpack-C_UUFRgj.mjs} +228 -58
  74. package/dist/{webpack-CzXjfvYS.js → webpack-nppysF4B.js} +240 -70
  75. package/dist/webpack.js +1 -1
  76. package/dist/webpack.mjs +1 -1
  77. package/package.json +11 -3
  78. package/dist/auto-CrJJc5rK.mjs +0 -13
@@ -14618,6 +14618,48 @@ function isRuntimeCandidate(candidate, runtimeSet) {
14618
14618
  if (!runtimeSet || runtimeSet.size === 0) return false;
14619
14619
  return runtimeSet.has(candidate) || runtimeSet.has(require_wxml.replaceWxml(candidate));
14620
14620
  }
14621
+ function hasTopLevelVariant(candidate) {
14622
+ let bracketDepth = 0;
14623
+ let parenthesisDepth = 0;
14624
+ let quote = "";
14625
+ let escaped = false;
14626
+ for (const char of candidate) {
14627
+ if (escaped) {
14628
+ escaped = false;
14629
+ continue;
14630
+ }
14631
+ if (char === "\\") {
14632
+ escaped = true;
14633
+ continue;
14634
+ }
14635
+ if (quote) {
14636
+ if (char === quote) quote = "";
14637
+ continue;
14638
+ }
14639
+ if (char === "\"" || char === "'") {
14640
+ quote = char;
14641
+ continue;
14642
+ }
14643
+ if (char === "[") {
14644
+ bracketDepth += 1;
14645
+ continue;
14646
+ }
14647
+ if (char === "]") {
14648
+ bracketDepth = Math.max(0, bracketDepth - 1);
14649
+ continue;
14650
+ }
14651
+ if (char === "(") {
14652
+ parenthesisDepth += 1;
14653
+ continue;
14654
+ }
14655
+ if (char === ")") {
14656
+ parenthesisDepth = Math.max(0, parenthesisDepth - 1);
14657
+ continue;
14658
+ }
14659
+ if (char === ":" && bracketDepth === 0 && parenthesisDepth === 0) return true;
14660
+ }
14661
+ return false;
14662
+ }
14621
14663
  function shouldEnableComponentLocalStyle(id) {
14622
14664
  return COMPONENT_RE.test(id);
14623
14665
  }
@@ -14640,18 +14682,18 @@ var UniAppXComponentLocalStyleCollector = class {
14640
14682
  this.aliasByLookup.set(require_wxml.replaceWxml(utility), alias);
14641
14683
  return alias;
14642
14684
  }
14643
- rewriteLiteral(literal, shouldInclude) {
14685
+ rewriteLiteral(literal) {
14644
14686
  const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
14645
14687
  if (candidates.length === 0) return literal;
14646
14688
  let rewritten = literal;
14647
14689
  for (const candidate of candidates) {
14648
- if (!shouldInclude(candidate)) continue;
14649
- rewritten = rewritten.replace(candidate, this.ensureAlias(candidate));
14690
+ if (!isRuntimeCandidate(candidate, this.runtimeSet)) continue;
14691
+ rewritten = rewritten.replace(candidate, hasTopLevelVariant(candidate) ? require_wxml.replaceWxml(candidate) : this.ensureAlias(candidate));
14650
14692
  }
14651
14693
  return rewritten;
14652
14694
  }
14653
14695
  collectAndRewriteStaticClass(literal) {
14654
- return this.rewriteLiteral(literal, (candidate) => isRuntimeCandidate(candidate, this.runtimeSet));
14696
+ return this.rewriteLiteral(literal);
14655
14697
  }
14656
14698
  collectRuntimeClasses(rawSource, options = {}) {
14657
14699
  const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
@@ -14666,7 +14708,7 @@ var UniAppXComponentLocalStyleCollector = class {
14666
14708
  const classContext = options.wrapExpression || require_wxml.isClassContextLiteralPath(path);
14667
14709
  for (const candidate of candidates) {
14668
14710
  if (!candidate || !classContext && !isRuntimeCandidate(candidate, this.runtimeSet)) continue;
14669
- if (isRuntimeCandidate(candidate, this.runtimeSet)) this.ensureAlias(candidate);
14711
+ if (isRuntimeCandidate(candidate, this.runtimeSet) && !hasTopLevelVariant(candidate)) this.ensureAlias(candidate);
14670
14712
  }
14671
14713
  }
14672
14714
  } catch {}
@@ -1,6 +1,7 @@
1
1
  interface RewriteCodeOptions {
2
2
  wrapExpression?: boolean;
3
3
  }
4
+ export declare function hasTopLevelVariant(candidate: string): boolean;
4
5
  export declare function shouldEnableComponentLocalStyle(id: string): boolean;
5
6
  export declare function shouldEnablePageLocalStyle(id: string): boolean;
6
7
  export declare class UniAppXComponentLocalStyleCollector {
@@ -10,7 +10,7 @@ export declare function createUtsStyleArrayFromAppStyles(code: string, appSource
10
10
  export declare function cssSourceToStyleValue(source: string): StyleValue | undefined;
11
11
  export declare function mergeStyleValues(...items: Array<StyleValue | undefined>): StyleValue | undefined;
12
12
  export declare function createStyleValueFromApplySources(sources: string[], utilityStyles: StyleValue | undefined): StyleValue | undefined;
13
- export declare function collectUniAppXHarmonyApplyStyleSourcesFromSource(source: string): string[];
13
+ export declare function collectUniAppXHarmonyApplyStyleSourcesFromSource(source: string, sourceId?: string): string[];
14
14
  export declare function collectUniAppXHarmonyApplyUtilitiesFromSources(sources: Iterable<string>): Set<string>;
15
15
  export declare function createMergedStyleValue(code: string, localStyle: StyleValue | undefined, appStyle: StyleValue): StyleValue | undefined;
16
16
  export {};