weapp-tailwindcss 5.0.0-next.31 → 5.0.0-next.32

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 (45) hide show
  1. package/dist/auto-DEHRmEAx.mjs +200 -0
  2. package/dist/auto-dPpsm6FB.js +238 -0
  3. package/dist/{bundle-state-Bi-cQua6.mjs → bundle-state-BIsgsoNW.mjs} +2 -2
  4. package/dist/{bundle-state-Ct_8GcSR.js → bundle-state-C4ib5xPG.js} +3 -3
  5. package/dist/core.js +1 -1
  6. package/dist/core.mjs +1 -1
  7. package/dist/css-macro/auto.d.ts +2 -1
  8. package/dist/css-macro.js +1 -1
  9. package/dist/css-macro.mjs +1 -1
  10. package/dist/{generator-CrU-Ghc1.js → generator-BEXaaUzP.js} +1 -1
  11. package/dist/{generator-Qw-tZ0Z2.mjs → generator-CpsHA4Wd.mjs} +1 -1
  12. package/dist/generator.js +2 -2
  13. package/dist/generator.mjs +2 -2
  14. package/dist/gulp.js +7 -7
  15. package/dist/gulp.mjs +6 -6
  16. package/dist/{incremental-runtime-class-set-FAOHZmzh.js → incremental-runtime-class-set-CLP1Qv8F.js} +5 -5
  17. package/dist/{incremental-runtime-class-set-Boqi1QlB.mjs → incremental-runtime-class-set-D2fsgk5t.mjs} +4 -4
  18. package/dist/index.js +4 -4
  19. package/dist/index.mjs +4 -4
  20. package/dist/{postcss-C6zOQqlL.mjs → postcss-BvkdIZr8.mjs} +3 -3
  21. package/dist/{postcss-DAWf9D3C.js → postcss-DN7IQzYb.js} +4 -4
  22. package/dist/postcss.js +1 -1
  23. package/dist/postcss.mjs +1 -1
  24. package/dist/{precheck-D7gJSmJz.js → precheck-CQeqnfo5.js} +4 -4
  25. package/dist/{precheck-D7K12zeX.mjs → precheck-nITnYBDn.mjs} +3 -3
  26. package/dist/presets.js +4 -4
  27. package/dist/presets.mjs +3 -3
  28. package/dist/{source-candidates-DNM8iwXW.js → source-candidates-7Q-kTOSb.js} +1 -1
  29. package/dist/{source-candidates-CX2ozpKM.mjs → source-candidates-_x8bq0Mz.mjs} +1 -1
  30. package/dist/{tailwindcss-B-e2RiXr.js → tailwindcss-Cl7hUlYV.js} +3 -3
  31. package/dist/{tailwindcss-C7dJHZ0G.mjs → tailwindcss-udhXxMX9.mjs} +2 -2
  32. package/dist/{v3-engine-DcvCCHfs.mjs → v3-engine-C_KeUQG3.mjs} +6 -6
  33. package/dist/{v3-engine-CHItlVq5.js → v3-engine-DwY4Fixu.js} +7 -7
  34. package/dist/{vite-fFRpSvyz.mjs → vite-BAHjBu8j.mjs} +8 -8
  35. package/dist/{vite-BgTPSkQS.js → vite-CYkkJZ3Q.js} +9 -9
  36. package/dist/vite.js +1 -1
  37. package/dist/vite.mjs +1 -1
  38. package/dist/weapp-tw-css-import-rewrite-loader.js +127 -6
  39. package/dist/{webpack-BXSWVdXh.js → webpack-CPwDaKy3.js} +8 -8
  40. package/dist/{webpack-Dx2AZpGU.mjs → webpack-xxmiRxcy.mjs} +7 -7
  41. package/dist/webpack.js +1 -1
  42. package/dist/webpack.mjs +1 -1
  43. package/package.json +4 -4
  44. package/dist/auto-TH1jG2UW.js +0 -115
  45. package/dist/auto-XyKTOP7B.mjs +0 -78
@@ -0,0 +1,200 @@
1
+ import { n as creator } from "./postcss-C7BMYpEF.mjs";
2
+ import postcss from "postcss";
3
+ import process from "node:process";
4
+ //#region src/css-macro/auto.ts
5
+ const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
6
+ const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
7
+ const PLATFORM_ENV_KEYS = [
8
+ "WEAPP_TW_TARGET",
9
+ "WEAPP_TAILWINDCSS_TARGET",
10
+ "UNI_PLATFORM",
11
+ "UNI_UTS_PLATFORM",
12
+ "TARO_ENV",
13
+ "MPX_CLI_MODE",
14
+ "MPX_CURRENT_TARGET_MODE"
15
+ ];
16
+ const CONDITIONAL_END_RE = /^\s*#endif\s*$/;
17
+ function readEnvValue(key) {
18
+ return typeof process === "undefined" ? void 0 : process.env[key];
19
+ }
20
+ function normalizePlatformToken(value) {
21
+ return value?.trim().replaceAll("_", "-").toUpperCase() || void 0;
22
+ }
23
+ function resolveCssMacroPlatform(options) {
24
+ const explicit = normalizePlatformToken(options?.platform);
25
+ if (explicit) return explicit;
26
+ for (const key of PLATFORM_ENV_KEYS) {
27
+ const value = normalizePlatformToken(readEnvValue(key));
28
+ if (value) return value;
29
+ }
30
+ }
31
+ function createPlatformTokenSet(platform) {
32
+ const normalized = normalizePlatformToken(platform);
33
+ const tokens = /* @__PURE__ */ new Set();
34
+ if (!normalized) return tokens;
35
+ tokens.add(normalized);
36
+ if (normalized.startsWith("MP-")) tokens.add("MP");
37
+ if (normalized === "WEAPP" || normalized === "WEIXIN" || normalized === "WX") {
38
+ tokens.add("MP");
39
+ tokens.add("MP-WEIXIN");
40
+ }
41
+ if (normalized === "MP-WEIXIN") {
42
+ tokens.add("WEAPP");
43
+ tokens.add("WEIXIN");
44
+ tokens.add("WX");
45
+ }
46
+ if (normalized === "H5") tokens.add("WEB");
47
+ if (normalized === "WEB") tokens.add("H5");
48
+ if (normalized === "APP") tokens.add("APP-PLUS");
49
+ if (normalized.startsWith("APP-")) tokens.add("APP");
50
+ if (normalized.startsWith("QUICKAPP-WEBVIEW")) tokens.add("QUICKAPP-WEBVIEW");
51
+ return tokens;
52
+ }
53
+ function combineAnd(values) {
54
+ if (values.includes(false)) return false;
55
+ return values.every((value) => value === true) ? true : void 0;
56
+ }
57
+ function combineOr(values) {
58
+ if (values.includes(true)) return true;
59
+ return values.every((value) => value === false) ? false : void 0;
60
+ }
61
+ function evaluatePlatformExpression(expression, platformTokens) {
62
+ return combineOr(expression.split(/\s*\|\|\s*/).map((orPart) => {
63
+ return combineAnd(orPart.split(/\s*&&\s*/).map((part) => {
64
+ const token = normalizePlatformToken(part);
65
+ if (!token || /[<>=!()]/.test(token)) return;
66
+ return platformTokens.has(token);
67
+ }));
68
+ }));
69
+ }
70
+ function negateConditionalValue(value) {
71
+ return value === void 0 ? void 0 : !value;
72
+ }
73
+ function getActiveConditionalValue(stack) {
74
+ if (stack.includes(false)) return false;
75
+ return stack.includes(void 0) ? void 0 : true;
76
+ }
77
+ function parseConditionalStart(text) {
78
+ const normalized = text.trim();
79
+ if (!normalized.startsWith("#")) return;
80
+ const body = normalized.slice(1).trimStart();
81
+ for (const directive of ["ifndef", "ifdef"]) {
82
+ if (!body.startsWith(directive)) continue;
83
+ const expression = body.slice(directive.length).trim();
84
+ if (expression.length === 0) return;
85
+ return {
86
+ directive,
87
+ expression
88
+ };
89
+ }
90
+ }
91
+ function compileCssMacroConditionalComments(css, options) {
92
+ const platformTokens = createPlatformTokenSet(resolveCssMacroPlatform(options));
93
+ if (platformTokens.size === 0 || !css.includes("#if")) return css;
94
+ try {
95
+ const root = postcss.parse(css);
96
+ const transformContainer = (container) => {
97
+ const stack = [];
98
+ for (const node of [...container.nodes ?? []]) {
99
+ if (node.type === "comment") {
100
+ const start = parseConditionalStart(node.text);
101
+ if (start) {
102
+ const value = start.directive === "ifndef" ? negateConditionalValue(evaluatePlatformExpression(start.expression, platformTokens)) : evaluatePlatformExpression(start.expression, platformTokens);
103
+ const parentActive = getActiveConditionalValue(stack);
104
+ stack.push(value);
105
+ if (parentActive !== void 0 && value !== void 0) node.remove();
106
+ continue;
107
+ }
108
+ if (CONDITIONAL_END_RE.test(node.text)) {
109
+ const value = stack.pop();
110
+ if (getActiveConditionalValue(stack) !== void 0 && value !== void 0) node.remove();
111
+ continue;
112
+ }
113
+ }
114
+ if (getActiveConditionalValue(stack) === false) {
115
+ node.remove();
116
+ continue;
117
+ }
118
+ if ("nodes" in node && node.nodes) transformContainer(node);
119
+ }
120
+ };
121
+ transformContainer(root);
122
+ return root.toString();
123
+ } catch {
124
+ return css;
125
+ }
126
+ }
127
+ function markCssMacroPlugin(value) {
128
+ Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
129
+ configurable: false,
130
+ enumerable: false,
131
+ value: true
132
+ });
133
+ return value;
134
+ }
135
+ function isCssMacroTailwindPlugin(value) {
136
+ return Boolean(value && (typeof value === "function" || typeof value === "object") && value["__weappTailwindcssCssMacro"] === true);
137
+ }
138
+ function hasCssMacroTailwindPlugin(plugins) {
139
+ if (!plugins) return false;
140
+ if (Array.isArray(plugins)) return plugins.some(isCssMacroTailwindPlugin);
141
+ if (typeof plugins === "object") return Object.values(plugins).some(isCssMacroTailwindPlugin);
142
+ return false;
143
+ }
144
+ function parseCssPluginRequest(params) {
145
+ const value = params.trim();
146
+ const quoted = /^(['"])(.*?)\1/.exec(value);
147
+ if (quoted) return quoted[2];
148
+ const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
149
+ return url?.[2] ?? url?.[3];
150
+ }
151
+ function isCssMacroPluginRequest(request) {
152
+ return request === "weapp-tailwindcss/css-macro";
153
+ }
154
+ function hasCssMacroTailwindV4Directive(css) {
155
+ if (!css?.includes("css-macro")) return false;
156
+ try {
157
+ let found = false;
158
+ postcss.parse(css).walkAtRules("plugin", (rule) => {
159
+ if (isCssMacroPluginRequest(parseCssPluginRequest(rule.params))) found = true;
160
+ });
161
+ return found;
162
+ } catch {
163
+ return /@plugin\s+(?:url\(\s*)?["']weapp-tailwindcss\/css-macro["']/.test(css);
164
+ }
165
+ }
166
+ function isCssMacroPostcssPlugin(plugin) {
167
+ if (plugin === creator) return true;
168
+ return Boolean(plugin && (typeof plugin === "function" || typeof plugin === "object") && plugin.postcssPlugin === "postcss-weapp-tw-css-macro-plugin");
169
+ }
170
+ function withCssMacroPostcssPlugins(plugins) {
171
+ const macroPlugin = creator();
172
+ if (!plugins) return [macroPlugin];
173
+ if (Array.isArray(plugins)) return plugins.some(isCssMacroPostcssPlugin) ? plugins : [...plugins, macroPlugin];
174
+ if (typeof plugins === "object") {
175
+ const values = Object.values(plugins).filter(Boolean);
176
+ if (values.some(isCssMacroPostcssPlugin)) return values;
177
+ return [...values, macroPlugin];
178
+ }
179
+ return [macroPlugin];
180
+ }
181
+ function withCssMacroStyleOptions(options) {
182
+ const postcssOptions = options?.postcssOptions;
183
+ return {
184
+ ...options,
185
+ [CSS_MACRO_STYLE_OPTIONS_MARKER]: true,
186
+ postcssOptions: {
187
+ ...postcssOptions,
188
+ plugins: withCssMacroPostcssPlugins(postcssOptions?.plugins)
189
+ }
190
+ };
191
+ }
192
+ function hasCssMacroStyleOptions(options) {
193
+ return Boolean(options?.[CSS_MACRO_STYLE_OPTIONS_MARKER]);
194
+ }
195
+ async function transformCssMacroCss(css, options) {
196
+ const result = (await postcss([creator()]).process(css, { from: void 0 })).css;
197
+ return compileCssMacroConditionalComments(result, options);
198
+ }
199
+ //#endregion
200
+ export { transformCssMacroCss as a, markCssMacroPlugin as i, hasCssMacroTailwindPlugin as n, withCssMacroStyleOptions as o, hasCssMacroTailwindV4Directive as r, hasCssMacroStyleOptions as t };
@@ -0,0 +1,238 @@
1
+ const require_chunk = require("./chunk-C5U5_Hdc.js");
2
+ const require_postcss = require("./postcss-CiYLsqZn.js");
3
+ let postcss = require("postcss");
4
+ postcss = require_chunk.__toESM(postcss);
5
+ let node_process = require("node:process");
6
+ node_process = require_chunk.__toESM(node_process);
7
+ //#region src/css-macro/auto.ts
8
+ const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
9
+ const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
10
+ const PLATFORM_ENV_KEYS = [
11
+ "WEAPP_TW_TARGET",
12
+ "WEAPP_TAILWINDCSS_TARGET",
13
+ "UNI_PLATFORM",
14
+ "UNI_UTS_PLATFORM",
15
+ "TARO_ENV",
16
+ "MPX_CLI_MODE",
17
+ "MPX_CURRENT_TARGET_MODE"
18
+ ];
19
+ const CONDITIONAL_END_RE = /^\s*#endif\s*$/;
20
+ function readEnvValue(key) {
21
+ return typeof node_process.default === "undefined" ? void 0 : node_process.default.env[key];
22
+ }
23
+ function normalizePlatformToken(value) {
24
+ return value?.trim().replaceAll("_", "-").toUpperCase() || void 0;
25
+ }
26
+ function resolveCssMacroPlatform(options) {
27
+ const explicit = normalizePlatformToken(options?.platform);
28
+ if (explicit) return explicit;
29
+ for (const key of PLATFORM_ENV_KEYS) {
30
+ const value = normalizePlatformToken(readEnvValue(key));
31
+ if (value) return value;
32
+ }
33
+ }
34
+ function createPlatformTokenSet(platform) {
35
+ const normalized = normalizePlatformToken(platform);
36
+ const tokens = /* @__PURE__ */ new Set();
37
+ if (!normalized) return tokens;
38
+ tokens.add(normalized);
39
+ if (normalized.startsWith("MP-")) tokens.add("MP");
40
+ if (normalized === "WEAPP" || normalized === "WEIXIN" || normalized === "WX") {
41
+ tokens.add("MP");
42
+ tokens.add("MP-WEIXIN");
43
+ }
44
+ if (normalized === "MP-WEIXIN") {
45
+ tokens.add("WEAPP");
46
+ tokens.add("WEIXIN");
47
+ tokens.add("WX");
48
+ }
49
+ if (normalized === "H5") tokens.add("WEB");
50
+ if (normalized === "WEB") tokens.add("H5");
51
+ if (normalized === "APP") tokens.add("APP-PLUS");
52
+ if (normalized.startsWith("APP-")) tokens.add("APP");
53
+ if (normalized.startsWith("QUICKAPP-WEBVIEW")) tokens.add("QUICKAPP-WEBVIEW");
54
+ return tokens;
55
+ }
56
+ function combineAnd(values) {
57
+ if (values.includes(false)) return false;
58
+ return values.every((value) => value === true) ? true : void 0;
59
+ }
60
+ function combineOr(values) {
61
+ if (values.includes(true)) return true;
62
+ return values.every((value) => value === false) ? false : void 0;
63
+ }
64
+ function evaluatePlatformExpression(expression, platformTokens) {
65
+ return combineOr(expression.split(/\s*\|\|\s*/).map((orPart) => {
66
+ return combineAnd(orPart.split(/\s*&&\s*/).map((part) => {
67
+ const token = normalizePlatformToken(part);
68
+ if (!token || /[<>=!()]/.test(token)) return;
69
+ return platformTokens.has(token);
70
+ }));
71
+ }));
72
+ }
73
+ function negateConditionalValue(value) {
74
+ return value === void 0 ? void 0 : !value;
75
+ }
76
+ function getActiveConditionalValue(stack) {
77
+ if (stack.includes(false)) return false;
78
+ return stack.includes(void 0) ? void 0 : true;
79
+ }
80
+ function parseConditionalStart(text) {
81
+ const normalized = text.trim();
82
+ if (!normalized.startsWith("#")) return;
83
+ const body = normalized.slice(1).trimStart();
84
+ for (const directive of ["ifndef", "ifdef"]) {
85
+ if (!body.startsWith(directive)) continue;
86
+ const expression = body.slice(directive.length).trim();
87
+ if (expression.length === 0) return;
88
+ return {
89
+ directive,
90
+ expression
91
+ };
92
+ }
93
+ }
94
+ function compileCssMacroConditionalComments(css, options) {
95
+ const platformTokens = createPlatformTokenSet(resolveCssMacroPlatform(options));
96
+ if (platformTokens.size === 0 || !css.includes("#if")) return css;
97
+ try {
98
+ const root = postcss.default.parse(css);
99
+ const transformContainer = (container) => {
100
+ const stack = [];
101
+ for (const node of [...container.nodes ?? []]) {
102
+ if (node.type === "comment") {
103
+ const start = parseConditionalStart(node.text);
104
+ if (start) {
105
+ const value = start.directive === "ifndef" ? negateConditionalValue(evaluatePlatformExpression(start.expression, platformTokens)) : evaluatePlatformExpression(start.expression, platformTokens);
106
+ const parentActive = getActiveConditionalValue(stack);
107
+ stack.push(value);
108
+ if (parentActive !== void 0 && value !== void 0) node.remove();
109
+ continue;
110
+ }
111
+ if (CONDITIONAL_END_RE.test(node.text)) {
112
+ const value = stack.pop();
113
+ if (getActiveConditionalValue(stack) !== void 0 && value !== void 0) node.remove();
114
+ continue;
115
+ }
116
+ }
117
+ if (getActiveConditionalValue(stack) === false) {
118
+ node.remove();
119
+ continue;
120
+ }
121
+ if ("nodes" in node && node.nodes) transformContainer(node);
122
+ }
123
+ };
124
+ transformContainer(root);
125
+ return root.toString();
126
+ } catch {
127
+ return css;
128
+ }
129
+ }
130
+ function markCssMacroPlugin(value) {
131
+ Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
132
+ configurable: false,
133
+ enumerable: false,
134
+ value: true
135
+ });
136
+ return value;
137
+ }
138
+ function isCssMacroTailwindPlugin(value) {
139
+ return Boolean(value && (typeof value === "function" || typeof value === "object") && value["__weappTailwindcssCssMacro"] === true);
140
+ }
141
+ function hasCssMacroTailwindPlugin(plugins) {
142
+ if (!plugins) return false;
143
+ if (Array.isArray(plugins)) return plugins.some(isCssMacroTailwindPlugin);
144
+ if (typeof plugins === "object") return Object.values(plugins).some(isCssMacroTailwindPlugin);
145
+ return false;
146
+ }
147
+ function parseCssPluginRequest(params) {
148
+ const value = params.trim();
149
+ const quoted = /^(['"])(.*?)\1/.exec(value);
150
+ if (quoted) return quoted[2];
151
+ const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
152
+ return url?.[2] ?? url?.[3];
153
+ }
154
+ function isCssMacroPluginRequest(request) {
155
+ return request === "weapp-tailwindcss/css-macro";
156
+ }
157
+ function hasCssMacroTailwindV4Directive(css) {
158
+ if (!css?.includes("css-macro")) return false;
159
+ try {
160
+ let found = false;
161
+ postcss.default.parse(css).walkAtRules("plugin", (rule) => {
162
+ if (isCssMacroPluginRequest(parseCssPluginRequest(rule.params))) found = true;
163
+ });
164
+ return found;
165
+ } catch {
166
+ return /@plugin\s+(?:url\(\s*)?["']weapp-tailwindcss\/css-macro["']/.test(css);
167
+ }
168
+ }
169
+ function isCssMacroPostcssPlugin(plugin) {
170
+ if (plugin === require_postcss.creator) return true;
171
+ return Boolean(plugin && (typeof plugin === "function" || typeof plugin === "object") && plugin.postcssPlugin === "postcss-weapp-tw-css-macro-plugin");
172
+ }
173
+ function withCssMacroPostcssPlugins(plugins) {
174
+ const macroPlugin = require_postcss.creator();
175
+ if (!plugins) return [macroPlugin];
176
+ if (Array.isArray(plugins)) return plugins.some(isCssMacroPostcssPlugin) ? plugins : [...plugins, macroPlugin];
177
+ if (typeof plugins === "object") {
178
+ const values = Object.values(plugins).filter(Boolean);
179
+ if (values.some(isCssMacroPostcssPlugin)) return values;
180
+ return [...values, macroPlugin];
181
+ }
182
+ return [macroPlugin];
183
+ }
184
+ function withCssMacroStyleOptions(options) {
185
+ const postcssOptions = options?.postcssOptions;
186
+ return {
187
+ ...options,
188
+ [CSS_MACRO_STYLE_OPTIONS_MARKER]: true,
189
+ postcssOptions: {
190
+ ...postcssOptions,
191
+ plugins: withCssMacroPostcssPlugins(postcssOptions?.plugins)
192
+ }
193
+ };
194
+ }
195
+ function hasCssMacroStyleOptions(options) {
196
+ return Boolean(options?.[CSS_MACRO_STYLE_OPTIONS_MARKER]);
197
+ }
198
+ async function transformCssMacroCss(css, options) {
199
+ const result = (await (0, postcss.default)([require_postcss.creator()]).process(css, { from: void 0 })).css;
200
+ return compileCssMacroConditionalComments(result, options);
201
+ }
202
+ //#endregion
203
+ Object.defineProperty(exports, "hasCssMacroStyleOptions", {
204
+ enumerable: true,
205
+ get: function() {
206
+ return hasCssMacroStyleOptions;
207
+ }
208
+ });
209
+ Object.defineProperty(exports, "hasCssMacroTailwindPlugin", {
210
+ enumerable: true,
211
+ get: function() {
212
+ return hasCssMacroTailwindPlugin;
213
+ }
214
+ });
215
+ Object.defineProperty(exports, "hasCssMacroTailwindV4Directive", {
216
+ enumerable: true,
217
+ get: function() {
218
+ return hasCssMacroTailwindV4Directive;
219
+ }
220
+ });
221
+ Object.defineProperty(exports, "markCssMacroPlugin", {
222
+ enumerable: true,
223
+ get: function() {
224
+ return markCssMacroPlugin;
225
+ }
226
+ });
227
+ Object.defineProperty(exports, "transformCssMacroCss", {
228
+ enumerable: true,
229
+ get: function() {
230
+ return transformCssMacroCss;
231
+ }
232
+ });
233
+ Object.defineProperty(exports, "withCssMacroStyleOptions", {
234
+ enumerable: true,
235
+ get: function() {
236
+ return withCssMacroStyleOptions;
237
+ }
238
+ });
@@ -1,7 +1,7 @@
1
- import { g as traverse, h as babelParse, o as Parser } from "./precheck-D7K12zeX.mjs";
1
+ import { g as traverse, h as babelParse, o as Parser } from "./precheck-nITnYBDn.mjs";
2
2
  import { createRequire } from "node:module";
3
- import path from "node:path";
4
3
  import process from "node:process";
4
+ import path from "node:path";
5
5
  import { cleanUrl, ensurePosix } from "@weapp-tailwindcss/shared";
6
6
  import { Buffer } from "node:buffer";
7
7
  //#region src/bundlers/shared/module-graph.ts
@@ -1,10 +1,10 @@
1
1
  const require_chunk = require("./chunk-C5U5_Hdc.js");
2
- const require_precheck = require("./precheck-D7gJSmJz.js");
2
+ const require_precheck = require("./precheck-CQeqnfo5.js");
3
3
  let node_module = require("node:module");
4
- let node_path = require("node:path");
5
- node_path = require_chunk.__toESM(node_path);
6
4
  let node_process = require("node:process");
7
5
  node_process = require_chunk.__toESM(node_process);
6
+ let node_path = require("node:path");
7
+ node_path = require_chunk.__toESM(node_path);
8
8
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
9
9
  let node_buffer = require("node:buffer");
10
10
  //#region src/bundlers/shared/module-graph.ts
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_precheck = require("./precheck-D7gJSmJz.js");
2
+ const require_precheck = require("./precheck-CQeqnfo5.js");
3
3
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
4
4
  //#region src/core.ts
5
5
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-D7K12zeX.mjs";
1
+ import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-nITnYBDn.mjs";
2
2
  import { defuOverrideArray } from "@weapp-tailwindcss/shared";
3
3
  //#region src/core.ts
4
4
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
@@ -1,10 +1,11 @@
1
1
  import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
2
2
  export declare const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
3
3
  export declare const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
4
+ export declare function compileCssMacroConditionalComments(css: string, options?: Pick<IStyleHandlerOptions, 'platform'>): string;
4
5
  export declare function markCssMacroPlugin<T extends object>(value: T): T;
5
6
  export declare function isCssMacroTailwindPlugin(value: unknown): boolean;
6
7
  export declare function hasCssMacroTailwindPlugin(plugins: unknown): boolean;
7
8
  export declare function hasCssMacroTailwindV4Directive(css: string | undefined): boolean;
8
9
  export declare function withCssMacroStyleOptions(options: Partial<IStyleHandlerOptions> | undefined): Partial<IStyleHandlerOptions>;
9
10
  export declare function hasCssMacroStyleOptions(options: Partial<IStyleHandlerOptions> | undefined): boolean;
10
- export declare function transformCssMacroCss(css: string): Promise<string>;
11
+ export declare function transformCssMacroCss(css: string, options?: Pick<IStyleHandlerOptions, 'platform'>): Promise<string>;
package/dist/css-macro.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require("./chunk-C5U5_Hdc.js");
2
2
  const require_postcss = require("./postcss-CiYLsqZn.js");
3
- const require_auto = require("./auto-TH1jG2UW.js");
3
+ const require_auto = require("./auto-dPpsm6FB.js");
4
4
  require("./utils-D7Ygohep.js");
5
5
  let tailwindcss_plugin = require("tailwindcss/plugin");
6
6
  tailwindcss_plugin = require_chunk.__toESM(tailwindcss_plugin);
@@ -1,5 +1,5 @@
1
1
  import { i as createNegativeConditionalAtRule, r as createConditionalAtRule } from "./postcss-C7BMYpEF.mjs";
2
- import { i as markCssMacroPlugin } from "./auto-XyKTOP7B.mjs";
2
+ import { i as markCssMacroPlugin } from "./auto-DEHRmEAx.mjs";
3
3
  import { t as defu } from "./utils-DsaS975I.mjs";
4
4
  import plugin from "tailwindcss/plugin";
5
5
  //#region src/css-macro/index.ts
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-C5U5_Hdc.js");
2
- const require_v3_engine = require("./v3-engine-CHItlVq5.js");
2
+ const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
3
3
  let node_process = require("node:process");
4
4
  node_process = require_chunk.__toESM(node_process);
5
5
  //#region src/generator/options.ts
@@ -1,4 +1,4 @@
1
- import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-DcvCCHfs.mjs";
1
+ import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-C_KeUQG3.mjs";
2
2
  import process from "node:process";
3
3
  //#region src/generator/options.ts
4
4
  const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
package/dist/generator.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_v3_engine = require("./v3-engine-CHItlVq5.js");
3
- const require_generator = require("./generator-CrU-Ghc1.js");
2
+ const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
3
+ const require_generator = require("./generator-BEXaaUzP.js");
4
4
  let tailwindcss_patch = require("tailwindcss-patch");
5
5
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
6
6
  exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
@@ -1,3 +1,3 @@
1
- import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-DcvCCHfs.mjs";
2
- import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-Qw-tZ0Z2.mjs";
1
+ import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-C_KeUQG3.mjs";
2
+ import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-CpsHA4Wd.mjs";
3
3
  export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
package/dist/gulp.js CHANGED
@@ -1,16 +1,16 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-C5U5_Hdc.js");
3
- const require_v3_engine = require("./v3-engine-CHItlVq5.js");
4
- const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-FAOHZmzh.js");
5
- const require_precheck = require("./precheck-D7gJSmJz.js");
6
- const require_tailwindcss = require("./tailwindcss-B-e2RiXr.js");
7
- const require_source_candidates = require("./source-candidates-DNM8iwXW.js");
3
+ const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
4
+ const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-CLP1Qv8F.js");
5
+ const require_precheck = require("./precheck-CQeqnfo5.js");
6
+ const require_tailwindcss = require("./tailwindcss-Cl7hUlYV.js");
7
+ const require_source_candidates = require("./source-candidates-7Q-kTOSb.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
10
- let node_path = require("node:path");
11
- node_path = require_chunk.__toESM(node_path);
12
10
  let node_process = require("node:process");
13
11
  node_process = require_chunk.__toESM(node_process);
12
+ let node_path = require("node:path");
13
+ node_path = require_chunk.__toESM(node_path);
14
14
  let node_buffer = require("node:buffer");
15
15
  let node_stream = require("node:stream");
16
16
  node_stream = require_chunk.__toESM(node_stream);
package/dist/gulp.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-D7K12zeX.mjs";
2
- import { B as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-DcvCCHfs.mjs";
3
- import { c as hasTailwindRootDirectives, i as generateCssByGenerator, r as emitHmrTiming, s as processCachedTask, t as createBundleRuntimeClassSetManager, u as normalizeTailwindSourceForGenerator } from "./incremental-runtime-class-set-Boqi1QlB.mjs";
4
- import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-C7dJHZ0G.mjs";
5
- import { t as createSourceCandidateCollector } from "./source-candidates-CX2ozpKM.mjs";
1
+ import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-nITnYBDn.mjs";
2
+ import { B as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-C_KeUQG3.mjs";
3
+ import { c as hasTailwindRootDirectives, i as generateCssByGenerator, r as emitHmrTiming, s as processCachedTask, t as createBundleRuntimeClassSetManager, u as normalizeTailwindSourceForGenerator } from "./incremental-runtime-class-set-D2fsgk5t.mjs";
4
+ import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-udhXxMX9.mjs";
5
+ import { t as createSourceCandidateCollector } from "./source-candidates-_x8bq0Mz.mjs";
6
6
  import fs from "node:fs";
7
- import path from "node:path";
8
7
  import process from "node:process";
8
+ import path from "node:path";
9
9
  import { Buffer } from "node:buffer";
10
10
  import stream from "node:stream";
11
11
  //#region src/bundlers/gulp/index.ts
@@ -1,14 +1,14 @@
1
1
  const require_chunk = require("./chunk-C5U5_Hdc.js");
2
- const require_v3_engine = require("./v3-engine-CHItlVq5.js");
3
- const require_generator = require("./generator-CrU-Ghc1.js");
4
- const require_precheck = require("./precheck-D7gJSmJz.js");
2
+ const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
3
+ const require_generator = require("./generator-BEXaaUzP.js");
4
+ const require_precheck = require("./precheck-CQeqnfo5.js");
5
5
  let node_fs = require("node:fs");
6
6
  let postcss = require("postcss");
7
7
  postcss = require_chunk.__toESM(postcss);
8
- let node_path = require("node:path");
9
- node_path = require_chunk.__toESM(node_path);
10
8
  let node_process = require("node:process");
11
9
  node_process = require_chunk.__toESM(node_process);
10
+ let node_path = require("node:path");
11
+ node_path = require_chunk.__toESM(node_path);
12
12
  let tailwindcss_patch = require("tailwindcss-patch");
13
13
  let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
14
14
  //#region src/bundlers/shared/generator-css/markers.ts
@@ -1,10 +1,10 @@
1
- import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-D7K12zeX.mjs";
2
- import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-DcvCCHfs.mjs";
3
- import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-Qw-tZ0Z2.mjs";
1
+ import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-nITnYBDn.mjs";
2
+ import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-C_KeUQG3.mjs";
3
+ import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-CpsHA4Wd.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  import postcss from "postcss";
6
- import path from "node:path";
7
6
  import process from "node:process";
7
+ import path from "node:path";
8
8
  import { extractRawCandidatesWithPositions, extractSourceCandidates, extractValidCandidates } from "tailwindcss-patch";
9
9
  import { finalizeMiniProgramCss, removeUnsupportedMiniProgramAtRules } from "@weapp-tailwindcss/postcss";
10
10
  //#region src/bundlers/shared/generator-css/markers.ts
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_generator = require("./generator-CrU-Ghc1.js");
2
+ const require_generator = require("./generator-BEXaaUzP.js");
3
3
  const require_gulp = require("./gulp.js");
4
- const require_postcss = require("./postcss-DAWf9D3C.js");
5
- const require_vite = require("./vite-BgTPSkQS.js");
6
- const require_webpack = require("./webpack-BXSWVdXh.js");
4
+ const require_postcss = require("./postcss-DN7IQzYb.js");
5
+ const require_vite = require("./vite-CYkkJZ3Q.js");
6
+ const require_webpack = require("./webpack-CPwDaKy3.js");
7
7
  let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
8
8
  exports.WeappTailwindcss = require_vite.WeappTailwindcss;
9
9
  exports.createPlugins = require_gulp.createPlugins;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { t as createWeappTailwindcssGenerator } from "./generator-Qw-tZ0Z2.mjs";
1
+ import { t as createWeappTailwindcssGenerator } from "./generator-CpsHA4Wd.mjs";
2
2
  import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
3
- import { t as weappTailwindcssPostcssPlugin } from "./postcss-C6zOQqlL.mjs";
4
- import { t as WeappTailwindcss } from "./vite-fFRpSvyz.mjs";
5
- import { n as weappTailwindcssPackageDir } from "./webpack-Dx2AZpGU.mjs";
3
+ import { t as weappTailwindcssPostcssPlugin } from "./postcss-BvkdIZr8.mjs";
4
+ import { t as WeappTailwindcss } from "./vite-BAHjBu8j.mjs";
5
+ import { n as weappTailwindcssPackageDir } from "./webpack-xxmiRxcy.mjs";
6
6
  import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
7
7
  export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };