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.
- package/dist/auto-DEHRmEAx.mjs +200 -0
- package/dist/auto-dPpsm6FB.js +238 -0
- package/dist/{bundle-state-Bi-cQua6.mjs → bundle-state-BIsgsoNW.mjs} +2 -2
- package/dist/{bundle-state-Ct_8GcSR.js → bundle-state-C4ib5xPG.js} +3 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro/auto.d.ts +2 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{generator-CrU-Ghc1.js → generator-BEXaaUzP.js} +1 -1
- package/dist/{generator-Qw-tZ0Z2.mjs → generator-CpsHA4Wd.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +6 -6
- package/dist/{incremental-runtime-class-set-FAOHZmzh.js → incremental-runtime-class-set-CLP1Qv8F.js} +5 -5
- package/dist/{incremental-runtime-class-set-Boqi1QlB.mjs → incremental-runtime-class-set-D2fsgk5t.mjs} +4 -4
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-C6zOQqlL.mjs → postcss-BvkdIZr8.mjs} +3 -3
- package/dist/{postcss-DAWf9D3C.js → postcss-DN7IQzYb.js} +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-D7gJSmJz.js → precheck-CQeqnfo5.js} +4 -4
- package/dist/{precheck-D7K12zeX.mjs → precheck-nITnYBDn.mjs} +3 -3
- package/dist/presets.js +4 -4
- package/dist/presets.mjs +3 -3
- package/dist/{source-candidates-DNM8iwXW.js → source-candidates-7Q-kTOSb.js} +1 -1
- package/dist/{source-candidates-CX2ozpKM.mjs → source-candidates-_x8bq0Mz.mjs} +1 -1
- package/dist/{tailwindcss-B-e2RiXr.js → tailwindcss-Cl7hUlYV.js} +3 -3
- package/dist/{tailwindcss-C7dJHZ0G.mjs → tailwindcss-udhXxMX9.mjs} +2 -2
- package/dist/{v3-engine-DcvCCHfs.mjs → v3-engine-C_KeUQG3.mjs} +6 -6
- package/dist/{v3-engine-CHItlVq5.js → v3-engine-DwY4Fixu.js} +7 -7
- package/dist/{vite-fFRpSvyz.mjs → vite-BAHjBu8j.mjs} +8 -8
- package/dist/{vite-BgTPSkQS.js → vite-CYkkJZ3Q.js} +9 -9
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +127 -6
- package/dist/{webpack-BXSWVdXh.js → webpack-CPwDaKy3.js} +8 -8
- package/dist/{webpack-Dx2AZpGU.mjs → webpack-xxmiRxcy.mjs} +7 -7
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +4 -4
- package/dist/auto-TH1jG2UW.js +0 -115
- package/dist/auto-XyKTOP7B.mjs +0 -78
package/dist/auto-TH1jG2UW.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
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
|
-
//#region src/css-macro/auto.ts
|
|
6
|
-
const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
7
|
-
const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
|
|
8
|
-
function markCssMacroPlugin(value) {
|
|
9
|
-
Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
|
|
10
|
-
configurable: false,
|
|
11
|
-
enumerable: false,
|
|
12
|
-
value: true
|
|
13
|
-
});
|
|
14
|
-
return value;
|
|
15
|
-
}
|
|
16
|
-
function isCssMacroTailwindPlugin(value) {
|
|
17
|
-
return Boolean(value && (typeof value === "function" || typeof value === "object") && value["__weappTailwindcssCssMacro"] === true);
|
|
18
|
-
}
|
|
19
|
-
function hasCssMacroTailwindPlugin(plugins) {
|
|
20
|
-
if (!plugins) return false;
|
|
21
|
-
if (Array.isArray(plugins)) return plugins.some(isCssMacroTailwindPlugin);
|
|
22
|
-
if (typeof plugins === "object") return Object.values(plugins).some(isCssMacroTailwindPlugin);
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
function parseCssPluginRequest(params) {
|
|
26
|
-
const value = params.trim();
|
|
27
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
28
|
-
if (quoted) return quoted[2];
|
|
29
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
30
|
-
return url?.[2] ?? url?.[3];
|
|
31
|
-
}
|
|
32
|
-
function isCssMacroPluginRequest(request) {
|
|
33
|
-
return request === "weapp-tailwindcss/css-macro";
|
|
34
|
-
}
|
|
35
|
-
function hasCssMacroTailwindV4Directive(css) {
|
|
36
|
-
if (!css?.includes("css-macro")) return false;
|
|
37
|
-
try {
|
|
38
|
-
let found = false;
|
|
39
|
-
postcss.default.parse(css).walkAtRules("plugin", (rule) => {
|
|
40
|
-
if (isCssMacroPluginRequest(parseCssPluginRequest(rule.params))) found = true;
|
|
41
|
-
});
|
|
42
|
-
return found;
|
|
43
|
-
} catch {
|
|
44
|
-
return /@plugin\s+(?:url\(\s*)?["']weapp-tailwindcss\/css-macro["']/.test(css);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function isCssMacroPostcssPlugin(plugin) {
|
|
48
|
-
if (plugin === require_postcss.creator) return true;
|
|
49
|
-
return Boolean(plugin && (typeof plugin === "function" || typeof plugin === "object") && plugin.postcssPlugin === "postcss-weapp-tw-css-macro-plugin");
|
|
50
|
-
}
|
|
51
|
-
function withCssMacroPostcssPlugins(plugins) {
|
|
52
|
-
const macroPlugin = require_postcss.creator();
|
|
53
|
-
if (!plugins) return [macroPlugin];
|
|
54
|
-
if (Array.isArray(plugins)) return plugins.some(isCssMacroPostcssPlugin) ? plugins : [...plugins, macroPlugin];
|
|
55
|
-
if (typeof plugins === "object") {
|
|
56
|
-
const values = Object.values(plugins).filter(Boolean);
|
|
57
|
-
if (values.some(isCssMacroPostcssPlugin)) return values;
|
|
58
|
-
return [...values, macroPlugin];
|
|
59
|
-
}
|
|
60
|
-
return [macroPlugin];
|
|
61
|
-
}
|
|
62
|
-
function withCssMacroStyleOptions(options) {
|
|
63
|
-
const postcssOptions = options?.postcssOptions;
|
|
64
|
-
return {
|
|
65
|
-
...options,
|
|
66
|
-
[CSS_MACRO_STYLE_OPTIONS_MARKER]: true,
|
|
67
|
-
postcssOptions: {
|
|
68
|
-
...postcssOptions,
|
|
69
|
-
plugins: withCssMacroPostcssPlugins(postcssOptions?.plugins)
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function hasCssMacroStyleOptions(options) {
|
|
74
|
-
return Boolean(options?.[CSS_MACRO_STYLE_OPTIONS_MARKER]);
|
|
75
|
-
}
|
|
76
|
-
async function transformCssMacroCss(css) {
|
|
77
|
-
return (await (0, postcss.default)([require_postcss.creator()]).process(css, { from: void 0 })).css;
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
Object.defineProperty(exports, "hasCssMacroStyleOptions", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function() {
|
|
83
|
-
return hasCssMacroStyleOptions;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "hasCssMacroTailwindPlugin", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function() {
|
|
89
|
-
return hasCssMacroTailwindPlugin;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "hasCssMacroTailwindV4Directive", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function() {
|
|
95
|
-
return hasCssMacroTailwindV4Directive;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
Object.defineProperty(exports, "markCssMacroPlugin", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function() {
|
|
101
|
-
return markCssMacroPlugin;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(exports, "transformCssMacroCss", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
get: function() {
|
|
107
|
-
return transformCssMacroCss;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
Object.defineProperty(exports, "withCssMacroStyleOptions", {
|
|
111
|
-
enumerable: true,
|
|
112
|
-
get: function() {
|
|
113
|
-
return withCssMacroStyleOptions;
|
|
114
|
-
}
|
|
115
|
-
});
|
package/dist/auto-XyKTOP7B.mjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { n as creator } from "./postcss-C7BMYpEF.mjs";
|
|
2
|
-
import postcss from "postcss";
|
|
3
|
-
//#region src/css-macro/auto.ts
|
|
4
|
-
const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
5
|
-
const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
|
|
6
|
-
function markCssMacroPlugin(value) {
|
|
7
|
-
Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
|
|
8
|
-
configurable: false,
|
|
9
|
-
enumerable: false,
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
function isCssMacroTailwindPlugin(value) {
|
|
15
|
-
return Boolean(value && (typeof value === "function" || typeof value === "object") && value["__weappTailwindcssCssMacro"] === true);
|
|
16
|
-
}
|
|
17
|
-
function hasCssMacroTailwindPlugin(plugins) {
|
|
18
|
-
if (!plugins) return false;
|
|
19
|
-
if (Array.isArray(plugins)) return plugins.some(isCssMacroTailwindPlugin);
|
|
20
|
-
if (typeof plugins === "object") return Object.values(plugins).some(isCssMacroTailwindPlugin);
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
function parseCssPluginRequest(params) {
|
|
24
|
-
const value = params.trim();
|
|
25
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
26
|
-
if (quoted) return quoted[2];
|
|
27
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
28
|
-
return url?.[2] ?? url?.[3];
|
|
29
|
-
}
|
|
30
|
-
function isCssMacroPluginRequest(request) {
|
|
31
|
-
return request === "weapp-tailwindcss/css-macro";
|
|
32
|
-
}
|
|
33
|
-
function hasCssMacroTailwindV4Directive(css) {
|
|
34
|
-
if (!css?.includes("css-macro")) return false;
|
|
35
|
-
try {
|
|
36
|
-
let found = false;
|
|
37
|
-
postcss.parse(css).walkAtRules("plugin", (rule) => {
|
|
38
|
-
if (isCssMacroPluginRequest(parseCssPluginRequest(rule.params))) found = true;
|
|
39
|
-
});
|
|
40
|
-
return found;
|
|
41
|
-
} catch {
|
|
42
|
-
return /@plugin\s+(?:url\(\s*)?["']weapp-tailwindcss\/css-macro["']/.test(css);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function isCssMacroPostcssPlugin(plugin) {
|
|
46
|
-
if (plugin === creator) return true;
|
|
47
|
-
return Boolean(plugin && (typeof plugin === "function" || typeof plugin === "object") && plugin.postcssPlugin === "postcss-weapp-tw-css-macro-plugin");
|
|
48
|
-
}
|
|
49
|
-
function withCssMacroPostcssPlugins(plugins) {
|
|
50
|
-
const macroPlugin = creator();
|
|
51
|
-
if (!plugins) return [macroPlugin];
|
|
52
|
-
if (Array.isArray(plugins)) return plugins.some(isCssMacroPostcssPlugin) ? plugins : [...plugins, macroPlugin];
|
|
53
|
-
if (typeof plugins === "object") {
|
|
54
|
-
const values = Object.values(plugins).filter(Boolean);
|
|
55
|
-
if (values.some(isCssMacroPostcssPlugin)) return values;
|
|
56
|
-
return [...values, macroPlugin];
|
|
57
|
-
}
|
|
58
|
-
return [macroPlugin];
|
|
59
|
-
}
|
|
60
|
-
function withCssMacroStyleOptions(options) {
|
|
61
|
-
const postcssOptions = options?.postcssOptions;
|
|
62
|
-
return {
|
|
63
|
-
...options,
|
|
64
|
-
[CSS_MACRO_STYLE_OPTIONS_MARKER]: true,
|
|
65
|
-
postcssOptions: {
|
|
66
|
-
...postcssOptions,
|
|
67
|
-
plugins: withCssMacroPostcssPlugins(postcssOptions?.plugins)
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function hasCssMacroStyleOptions(options) {
|
|
72
|
-
return Boolean(options?.[CSS_MACRO_STYLE_OPTIONS_MARKER]);
|
|
73
|
-
}
|
|
74
|
-
async function transformCssMacroCss(css) {
|
|
75
|
-
return (await postcss([creator()]).process(css, { from: void 0 })).css;
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
export { transformCssMacroCss as a, markCssMacroPlugin as i, hasCssMacroTailwindPlugin as n, withCssMacroStyleOptions as o, hasCssMacroTailwindV4Directive as r, hasCssMacroStyleOptions as t };
|