@weapp-tailwindcss/postcss 3.1.2 → 3.1.4
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/compat/mini-program-css/at-rules.d.ts +1 -0
- package/dist/compat/mini-program-css/finalize-options.d.ts +2 -1
- package/dist/compat/mini-program-css/index.d.ts +1 -1
- package/dist/compat/mini-program-css/preflight.d.ts +2 -1
- package/dist/compat/mini-program-css/selectors.d.ts +2 -0
- package/dist/compat/mini-program-css/theme.d.ts +1 -1
- package/dist/css-macro/auto.d.ts +4 -0
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/generator-plugin/apply-only.d.ts +5 -0
- package/dist/generator-plugin/directives.d.ts +24 -1
- package/dist/generator-plugin/local-imports.d.ts +25 -0
- package/dist/generator-plugin/source-files.d.ts +8 -2
- package/dist/html-transform.js +193 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +20400 -12437
- package/dist/index.mjs +20088 -12179
- package/dist/{postcss-BebUgs5n.mjs → postcss-BNPP2oxO.mjs} +3 -1
- package/dist/{postcss-by-0mwIg.js → postcss-DAEMn9OL.js} +14 -0
- package/dist/rolldown-runtime-emK7D4bc.js +35 -0
- package/dist/selectorParser/utils.d.ts +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +4 -4
- package/dist/html-transform-CMF3g0Cc.js +0 -232
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
//#region src/css-macro/constants.ts
|
|
2
2
|
const queryKey = "weapp-tw-platform";
|
|
3
|
+
const ifdefAtRule = "weapp-tw-ifdef";
|
|
4
|
+
const ifndefAtRule = "weapp-tw-ifndef";
|
|
3
5
|
const UNESCAPED_UNDERSCORE_RE = /(?<!\\)_/g;
|
|
4
6
|
const WHITESPACE_RE = /\s+/g;
|
|
5
7
|
const LOGICAL_OPERATOR_RE = /\s*(\|\||&&)\s*/g;
|
|
@@ -155,4 +157,4 @@ const creator = () => {
|
|
|
155
157
|
};
|
|
156
158
|
creator.postcss = true;
|
|
157
159
|
//#endregion
|
|
158
|
-
export { creator
|
|
160
|
+
export { CSS_MACRO_POSTCSS_PLUGIN_NAME, creator, ifdefAtRule, ifndefAtRule };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
//#region src/css-macro/constants.ts
|
|
2
2
|
const queryKey = "weapp-tw-platform";
|
|
3
|
+
const ifdefAtRule = "weapp-tw-ifdef";
|
|
4
|
+
const ifndefAtRule = "weapp-tw-ifndef";
|
|
3
5
|
const UNESCAPED_UNDERSCORE_RE = /(?<!\\)_/g;
|
|
4
6
|
const WHITESPACE_RE = /\s+/g;
|
|
5
7
|
const LOGICAL_OPERATOR_RE = /\s*(\|\||&&)\s*/g;
|
|
@@ -167,3 +169,15 @@ Object.defineProperty(exports, "creator", {
|
|
|
167
169
|
return creator;
|
|
168
170
|
}
|
|
169
171
|
});
|
|
172
|
+
Object.defineProperty(exports, "ifdefAtRule", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function() {
|
|
175
|
+
return ifdefAtRule;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "ifndefAtRule", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function() {
|
|
181
|
+
return ifndefAtRule;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
Object.defineProperty(exports, "__commonJSMin", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return __commonJSMin;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "__toESM", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function() {
|
|
33
|
+
return __toESM;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -8,4 +8,4 @@ export type ParserTransformOptions = Partial<{
|
|
|
8
8
|
export declare function normalizeTransformOptions(options?: ParserTransformOptions): ParserTransformOptions;
|
|
9
9
|
export declare function mklist(node: Node): Node[];
|
|
10
10
|
export declare function composeIsPseudoAst(strs: string | string[]): Node[];
|
|
11
|
-
export declare function getCombinatorSelectorAst(options: IStyleHandlerOptions): (psp.Pseudo | psp.Selector | psp.String | psp.
|
|
11
|
+
export declare function getCombinatorSelectorAst(options: IStyleHandlerOptions): (psp.Pseudo | psp.Selector | psp.String | psp.Root | psp.Tag | psp.Nesting | psp.Identifier | psp.Comment | psp.Combinator | psp.ClassName | psp.Attribute | psp.Universal)[];
|
package/dist/types.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export interface WebCssCompatFeatures {
|
|
|
67
67
|
theme?: boolean | undefined;
|
|
68
68
|
layer?: boolean | undefined;
|
|
69
69
|
property?: boolean | undefined;
|
|
70
|
+
nesting?: boolean | undefined;
|
|
70
71
|
oklch?: boolean | undefined;
|
|
71
72
|
colorFunctions?: boolean | undefined;
|
|
72
73
|
supports?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/postcss",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "@weapp-tailwindcss/postcss",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"postcss-selector-parser": "~7.1.4",
|
|
78
78
|
"postcss-value-parser": "^4.2.0",
|
|
79
79
|
"@weapp-tailwindcss/postcss-calc": "^1.0.2",
|
|
80
|
-
"
|
|
81
|
-
"tailwindcss
|
|
80
|
+
"tailwindcss-config": "2.0.1",
|
|
81
|
+
"@weapp-tailwindcss/shared": "2.0.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@csstools/css-color-parser": "^4.1.
|
|
84
|
+
"@csstools/css-color-parser": "^4.1.9",
|
|
85
85
|
"@csstools/css-parser-algorithms": "^4.0.0",
|
|
86
86
|
"@csstools/css-tokenizer": "^4.0.0",
|
|
87
87
|
"@csstools/postcss-is-pseudo-class": "^6.0.0",
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
|
-
let node_process = require("node:process");
|
|
25
|
-
node_process = __toESM(node_process);
|
|
26
|
-
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
27
|
-
//#region src/html-transform.ts
|
|
28
|
-
const htmlTags = [
|
|
29
|
-
"html",
|
|
30
|
-
"body",
|
|
31
|
-
"a",
|
|
32
|
-
"audio",
|
|
33
|
-
"button",
|
|
34
|
-
"canvas",
|
|
35
|
-
"form",
|
|
36
|
-
"iframe",
|
|
37
|
-
"img",
|
|
38
|
-
"input",
|
|
39
|
-
"label",
|
|
40
|
-
"progress",
|
|
41
|
-
"select",
|
|
42
|
-
"slot",
|
|
43
|
-
"textarea",
|
|
44
|
-
"video",
|
|
45
|
-
"abbr",
|
|
46
|
-
"area",
|
|
47
|
-
"b",
|
|
48
|
-
"bdi",
|
|
49
|
-
"big",
|
|
50
|
-
"br",
|
|
51
|
-
"cite",
|
|
52
|
-
"code",
|
|
53
|
-
"data",
|
|
54
|
-
"datalist",
|
|
55
|
-
"del",
|
|
56
|
-
"dfn",
|
|
57
|
-
"em",
|
|
58
|
-
"i",
|
|
59
|
-
"ins",
|
|
60
|
-
"kbd",
|
|
61
|
-
"map",
|
|
62
|
-
"mark",
|
|
63
|
-
"meter",
|
|
64
|
-
"output",
|
|
65
|
-
"picture",
|
|
66
|
-
"q",
|
|
67
|
-
"s",
|
|
68
|
-
"samp",
|
|
69
|
-
"small",
|
|
70
|
-
"span",
|
|
71
|
-
"strong",
|
|
72
|
-
"sub",
|
|
73
|
-
"sup",
|
|
74
|
-
"td",
|
|
75
|
-
"template",
|
|
76
|
-
"th",
|
|
77
|
-
"time",
|
|
78
|
-
"tt",
|
|
79
|
-
"u",
|
|
80
|
-
"var",
|
|
81
|
-
"wbr",
|
|
82
|
-
"address",
|
|
83
|
-
"article",
|
|
84
|
-
"aside",
|
|
85
|
-
"blockquote",
|
|
86
|
-
"caption",
|
|
87
|
-
"dd",
|
|
88
|
-
"details",
|
|
89
|
-
"dialog",
|
|
90
|
-
"div",
|
|
91
|
-
"dl",
|
|
92
|
-
"dt",
|
|
93
|
-
"fieldset",
|
|
94
|
-
"figcaption",
|
|
95
|
-
"figure",
|
|
96
|
-
"footer",
|
|
97
|
-
"h1",
|
|
98
|
-
"h2",
|
|
99
|
-
"h3",
|
|
100
|
-
"h4",
|
|
101
|
-
"h5",
|
|
102
|
-
"h6",
|
|
103
|
-
"header",
|
|
104
|
-
"hgroup",
|
|
105
|
-
"hr",
|
|
106
|
-
"legend",
|
|
107
|
-
"li",
|
|
108
|
-
"main",
|
|
109
|
-
"nav",
|
|
110
|
-
"ol",
|
|
111
|
-
"p",
|
|
112
|
-
"pre",
|
|
113
|
-
"section",
|
|
114
|
-
"summary",
|
|
115
|
-
"table",
|
|
116
|
-
"tbody",
|
|
117
|
-
"tfoot",
|
|
118
|
-
"thead",
|
|
119
|
-
"tr",
|
|
120
|
-
"ul",
|
|
121
|
-
"svg"
|
|
122
|
-
];
|
|
123
|
-
const miniAppTags = [
|
|
124
|
-
"cover-image",
|
|
125
|
-
"cover-view",
|
|
126
|
-
"match-media",
|
|
127
|
-
"movable-area",
|
|
128
|
-
"movable-view",
|
|
129
|
-
"page-container",
|
|
130
|
-
"scroll-view",
|
|
131
|
-
"share-element",
|
|
132
|
-
"swiper",
|
|
133
|
-
"swiper-item",
|
|
134
|
-
"view",
|
|
135
|
-
"icon",
|
|
136
|
-
"progress",
|
|
137
|
-
"rich-text",
|
|
138
|
-
"text",
|
|
139
|
-
"button",
|
|
140
|
-
"checkbox",
|
|
141
|
-
"checkbox-group",
|
|
142
|
-
"editor",
|
|
143
|
-
"form",
|
|
144
|
-
"input",
|
|
145
|
-
"keyboard-accessory",
|
|
146
|
-
"label",
|
|
147
|
-
"picker",
|
|
148
|
-
"picker-view",
|
|
149
|
-
"picker-view-column",
|
|
150
|
-
"radio",
|
|
151
|
-
"radio-group",
|
|
152
|
-
"slider",
|
|
153
|
-
"switch",
|
|
154
|
-
"textarea",
|
|
155
|
-
"functional-page-navigator",
|
|
156
|
-
"navigator",
|
|
157
|
-
"audio",
|
|
158
|
-
"camera",
|
|
159
|
-
"image",
|
|
160
|
-
"live-player",
|
|
161
|
-
"live-pusher",
|
|
162
|
-
"video",
|
|
163
|
-
"voip-room",
|
|
164
|
-
"map",
|
|
165
|
-
"canvas",
|
|
166
|
-
"web-view",
|
|
167
|
-
"ad",
|
|
168
|
-
"ad-custom",
|
|
169
|
-
"official-account",
|
|
170
|
-
"open-data",
|
|
171
|
-
"navigation-bar",
|
|
172
|
-
"page-meta"
|
|
173
|
-
];
|
|
174
|
-
const tags2Rgx = (tags = []) => new RegExp(`(^| |\\+|,|~|>|\\n)(${tags.join("|")})\\b(?=$| |\\.|\\+|,|~|:|\\[)`, "g");
|
|
175
|
-
const UNIVERSAL_SELECTOR_RE = /(?:^| )\*(?![=/*])/;
|
|
176
|
-
const postcssHtmlTransform = (opts = {}) => {
|
|
177
|
-
const options = (0, _weapp_tailwindcss_shared.defu)(opts, { platform: node_process.default.env.TARO_ENV });
|
|
178
|
-
let selectorFilter;
|
|
179
|
-
let walkRules;
|
|
180
|
-
switch (options.platform) {
|
|
181
|
-
case "h5":
|
|
182
|
-
selectorFilter = tags2Rgx(miniAppTags);
|
|
183
|
-
walkRules = (rule) => {
|
|
184
|
-
rule.selector = rule.selector.replace(selectorFilter, "$1taro-$2-core");
|
|
185
|
-
};
|
|
186
|
-
break;
|
|
187
|
-
case "rn": break;
|
|
188
|
-
case "quickapp": break;
|
|
189
|
-
default: {
|
|
190
|
-
const selector = tags2Rgx(htmlTags);
|
|
191
|
-
walkRules = (rule) => {
|
|
192
|
-
if (options.removeUniversal && UNIVERSAL_SELECTOR_RE.test(rule.selector)) {
|
|
193
|
-
rule.remove();
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
rule.selector = rule.selector.replace(selector, "$1.h5-$2");
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return {
|
|
201
|
-
postcssPlugin: "postcss-html-transform",
|
|
202
|
-
Rule(rule) {
|
|
203
|
-
if (typeof walkRules === "function") if (selectorFilter && selectorFilter.test(rule.selector)) walkRules(rule);
|
|
204
|
-
else walkRules(rule);
|
|
205
|
-
},
|
|
206
|
-
Declaration(decl) {
|
|
207
|
-
if (options?.removeCursorStyle) {
|
|
208
|
-
if (decl.prop === "cursor") decl.remove();
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
postcssHtmlTransform.postcss = true;
|
|
214
|
-
//#endregion
|
|
215
|
-
Object.defineProperty(exports, "__commonJSMin", {
|
|
216
|
-
enumerable: true,
|
|
217
|
-
get: function() {
|
|
218
|
-
return __commonJSMin;
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
Object.defineProperty(exports, "__toESM", {
|
|
222
|
-
enumerable: true,
|
|
223
|
-
get: function() {
|
|
224
|
-
return __toESM;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
Object.defineProperty(exports, "postcssHtmlTransform", {
|
|
228
|
-
enumerable: true,
|
|
229
|
-
get: function() {
|
|
230
|
-
return postcssHtmlTransform;
|
|
231
|
-
}
|
|
232
|
-
});
|