weapp-tailwindcss 5.5.0 → 5.5.2

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 (83) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/dist/bundlers/shared/css-imports.d.ts +1 -0
  4. package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
  5. package/dist/bundlers/shared/framework-user-css.d.ts +3 -0
  6. package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +6 -2
  7. package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -1
  8. package/dist/bundlers/shared/v4-generation-core.d.ts +1 -0
  9. package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -1
  10. package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +3 -2
  11. package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +1 -0
  12. package/dist/bundlers/vite/generate-bundle/entry-style-graph.d.ts +6 -0
  13. package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +1 -0
  14. package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
  15. package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +2 -0
  16. package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +1 -1
  17. package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +3 -1
  18. package/dist/bundlers/webpack/shared/loader-anchors.d.ts +1 -0
  19. package/dist/compiler/runtime-snapshot.d.ts +4 -1
  20. package/dist/{compiler-SwMb3lOX.cjs → compiler-BSMSbVVt.cjs} +6 -6
  21. package/dist/{compiler-B0YSc0DY.js → compiler-tHMcW3BT.js} +3 -3
  22. package/dist/core.cjs +1 -1
  23. package/dist/core.js +1 -1
  24. package/dist/{css-imports-BFMU7Hpd.cjs → css-imports-DsCSPIj2.cjs} +29 -0
  25. package/dist/{css-loader-runtime-CSv0lKqV.cjs → css-loader-runtime-DGqsWVua.cjs} +2 -1
  26. package/dist/{defaults-B5ep0ojb.js → defaults-CKx-4LcW.js} +1 -1
  27. package/dist/{defaults-BI9j1znS.cjs → defaults-CiGsr8Xq.cjs} +1 -1
  28. package/dist/defaults.cjs +1 -1
  29. package/dist/defaults.js +1 -1
  30. package/dist/{final-css-cleanup-CmVYbXPr.js → final-css-cleanup-B0HUBtiE.js} +63 -37
  31. package/dist/final-css-cleanup-DSjczga3.cjs +138 -0
  32. package/dist/{generator-DsrQ9txU.cjs → generator-CCw17l0G.cjs} +72 -67
  33. package/dist/{generator-DyXTBPmE.js → generator-DxEsInLz.js} +61 -68
  34. package/dist/generator.cjs +1 -1
  35. package/dist/generator.js +1 -1
  36. package/dist/{gulp-Dtc01FdI.cjs → gulp-C1r36Y_f.cjs} +6 -6
  37. package/dist/{gulp-CVUiPXPy.js → gulp-qGXKwQMZ.js} +5 -5
  38. package/dist/gulp.cjs +1 -1
  39. package/dist/gulp.js +1 -1
  40. package/dist/{hmr-timing-DNxQm-bN.js → hmr-timing-DixZjtTS.js} +245 -183
  41. package/dist/{hmr-timing-3SdRVfZx.cjs → hmr-timing-DuIbach8.cjs} +5 -5
  42. package/dist/index.cjs +4 -4
  43. package/dist/index.js +4 -4
  44. package/dist/{pipeline-helpers-DVrgv1HS.cjs → pipeline-helpers-CUwwOFt3.cjs} +5 -5
  45. package/dist/postcss.cjs +1 -1
  46. package/dist/postcss.js +1 -1
  47. package/dist/presets.cjs +2 -2
  48. package/dist/presets.js +2 -2
  49. package/dist/rspack.cjs +6 -3
  50. package/dist/rspack.js +6 -3
  51. package/dist/{scoped-generator-kRj_5Axx.js → scoped-generator-BJvL2CKZ.js} +3 -3
  52. package/dist/{scoped-generator-B7thnzzm.cjs → scoped-generator-CO9xZ06m.cjs} +3 -3
  53. package/dist/{source-candidate-scan-signature-CsP4BQNa.js → source-candidate-scan-signature-CgJi--lh.js} +2 -2
  54. package/dist/{source-candidate-scan-signature-B7cUxqqX.cjs → source-candidate-scan-signature-_UPwg8oJ.cjs} +2 -2
  55. package/dist/tailwindcss/v4-engine/css-import.d.ts +14 -0
  56. package/dist/{tailwindcss-BK9S7zuq.js → tailwindcss-D2joPNdN.js} +1 -1
  57. package/dist/{tailwindcss-C-jBBQfw.cjs → tailwindcss-DhaLV5a2.cjs} +1 -1
  58. package/dist/{transform-C0rWZblB.js → transform-BNtyKkZi.js} +14 -14
  59. package/dist/{transform-C7QxW-fV.cjs → transform-DAg85t9Z.cjs} +14 -14
  60. package/dist/uni-app-x/border-preflight.d.ts +18 -0
  61. package/dist/uni-app-x/style-asset/source-parser.d.ts +2 -0
  62. package/dist/uni-app-x/transform.d.ts +2 -0
  63. package/dist/uni-app-x/vite/plugin-options.d.ts +2 -0
  64. package/dist/uni-app-x/vite/style-source.d.ts +21 -0
  65. package/dist/{v4-generation-core-DuIVZvRz.cjs → v4-generation-core-bOm8k4AY.cjs} +243 -181
  66. package/dist/vite/web.cjs +1 -1
  67. package/dist/vite/web.js +1 -1
  68. package/dist/{vite-0PsttwuR.js → vite-C_JJxZWl.js} +290 -69
  69. package/dist/{vite-CJbO-7AQ.cjs → vite-bJZi1V-l.cjs} +306 -66
  70. package/dist/vite.cjs +1 -1
  71. package/dist/vite.js +1 -1
  72. package/dist/{watch-dependencies-DLZDrWdH.cjs → watch-dependencies-GbC14Rlt.cjs} +14 -11
  73. package/dist/weapp-tw-css-generation-loader.cjs +3 -2
  74. package/dist/weapp-tw-css-import-rewrite-loader.cjs +11 -10
  75. package/dist/weapp-tw-runtime-classset-loader.cjs +16 -11
  76. package/dist/{web-BFOkkJ-8.cjs → web-B4wa3xrE.cjs} +13 -8
  77. package/dist/{web-D8HSs56R.js → web-BiubXhxs.js} +11 -6
  78. package/dist/{webpack-DVtKeBq1.js → webpack-BDOQUv3J.js} +39 -24
  79. package/dist/{webpack-BWknqSDV.cjs → webpack-CsBe1G_1.cjs} +37 -23
  80. package/dist/webpack.cjs +1 -1
  81. package/dist/webpack.js +1 -1
  82. package/package.json +7 -5
  83. package/dist/final-css-cleanup-BMlUDzik.cjs +0 -112
@@ -1,112 +0,0 @@
1
- let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
2
- //#region src/bundlers/shared/final-css-cleanup.ts
3
- function isAtRuleNameCharacter(code) {
4
- return code === 45 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
5
- }
6
- function isCssWhitespace(code) {
7
- return code === 9 || code === 10 || code === 12 || code === 13 || code === 32;
8
- }
9
- function findAtRuleBlockStart(css, start) {
10
- let parenthesisDepth = 0;
11
- let quote = 0;
12
- let squareBracketDepth = 0;
13
- for (let index = start; index < css.length; index++) {
14
- const code = css.charCodeAt(index);
15
- if (quote !== 0) {
16
- if (code === 92) index++;
17
- else if (code === quote) quote = 0;
18
- continue;
19
- }
20
- if (code === 34 || code === 39) {
21
- quote = code;
22
- continue;
23
- }
24
- if (code === 92) {
25
- index++;
26
- continue;
27
- }
28
- if (code === 47 && css.charCodeAt(index + 1) === 42) {
29
- const commentEnd = css.indexOf("*/", index + 2);
30
- if (commentEnd < 0) return -1;
31
- index = commentEnd + 1;
32
- continue;
33
- }
34
- if (code === 40) {
35
- parenthesisDepth++;
36
- continue;
37
- }
38
- if (code === 41 && parenthesisDepth > 0) {
39
- parenthesisDepth--;
40
- continue;
41
- }
42
- if (code === 91) {
43
- squareBracketDepth++;
44
- continue;
45
- }
46
- if (code === 93 && squareBracketDepth > 0) {
47
- squareBracketDepth--;
48
- continue;
49
- }
50
- if (code === 123 && parenthesisDepth === 0 && squareBracketDepth === 0) return index;
51
- if ((code === 59 || code === 125) && parenthesisDepth === 0 && squareBracketDepth === 0) return -1;
52
- }
53
- return -1;
54
- }
55
- function isEmptyAtRuleBody(css, blockStart) {
56
- for (let index = blockStart + 1; index < css.length; index++) {
57
- const code = css.charCodeAt(index);
58
- if (isCssWhitespace(code)) continue;
59
- if (code === 47 && css.charCodeAt(index + 1) === 42) {
60
- const commentEnd = css.indexOf("*/", index + 2);
61
- if (commentEnd < 0) return false;
62
- index = commentEnd + 1;
63
- continue;
64
- }
65
- return code === 125;
66
- }
67
- return false;
68
- }
69
- function hasEmptyAtRuleBlockCandidate(css) {
70
- let searchFrom = 0;
71
- while (searchFrom < css.length) {
72
- const atRuleStart = css.indexOf("@", searchFrom);
73
- if (atRuleStart < 0) return false;
74
- searchFrom = atRuleStart + 1;
75
- if (!isAtRuleNameCharacter(css.charCodeAt(searchFrom))) continue;
76
- const blockStart = findAtRuleBlockStart(css, searchFrom + 1);
77
- if (blockStart >= 0 && isEmptyAtRuleBody(css, blockStart)) return true;
78
- }
79
- return false;
80
- }
81
- /**
82
- * 在小程序样式进入最终产物图时递归清理空的块级 at-rule。
83
- */
84
- function finalizeMiniProgramCssStructure(css) {
85
- const repaired = (0, _weapp_tailwindcss_postcss.repairTrailingUnclosedTailwindSourceMedia)(css);
86
- if (!hasEmptyAtRuleBlockCandidate(repaired)) return repaired;
87
- try {
88
- const root = _weapp_tailwindcss_postcss.postcss.parse(repaired);
89
- let removed = 0;
90
- let passRemoved = 0;
91
- do {
92
- passRemoved = (0, _weapp_tailwindcss_postcss.removeEmptyAtRules)(root);
93
- removed += passRemoved;
94
- } while (passRemoved > 0);
95
- return removed > 0 ? root.toString() : repaired;
96
- } catch {
97
- return repaired;
98
- }
99
- }
100
- //#endregion
101
- Object.defineProperty(exports, "finalizeMiniProgramCssStructure", {
102
- enumerable: true,
103
- get: function() {
104
- return finalizeMiniProgramCssStructure;
105
- }
106
- });
107
- Object.defineProperty(exports, "hasEmptyAtRuleBlockCandidate", {
108
- enumerable: true,
109
- get: function() {
110
- return hasEmptyAtRuleBlockCandidate;
111
- }
112
- });