weapp-tailwindcss 4.11.2 → 4.12.0-alpha.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.
- package/README.md +38 -0
- package/bin/weapp-tailwindcss.js +21 -1
- package/dist/{chunk-AV3XB6EQ.js → chunk-2A4NRLSY.js} +5 -5
- package/dist/{chunk-WJIRXC26.js → chunk-6JBFHYFM.js} +134 -128
- package/dist/{chunk-OMARW5NC.mjs → chunk-AYJ4HLWZ.mjs} +4 -2
- package/dist/{chunk-W3DXDWYC.mjs → chunk-CMNCGACY.mjs} +66 -60
- package/dist/{chunk-ZZ36BKM5.mjs → chunk-CQMHHQRN.mjs} +6 -2
- package/dist/{chunk-OYSABARD.js → chunk-E7I5TW5K.js} +3 -2
- package/dist/{chunk-7LKMJZD2.js → chunk-GMKSBLNY.js} +2 -2
- package/dist/{chunk-EFBQ4SQR.mjs → chunk-HL3US2OT.mjs} +1 -1
- package/dist/{chunk-AB2RGZQO.mjs → chunk-LWEVOVRD.mjs} +144 -76
- package/dist/{chunk-QK6VNNNL.js → chunk-NIS74SI6.js} +8 -6
- package/dist/{chunk-CRDOWYG4.js → chunk-ONLKZIRQ.js} +1 -1
- package/dist/{chunk-3QHYEMEW.js → chunk-PAAX4FDD.js} +45 -40
- package/dist/{chunk-JIERVBTX.mjs → chunk-SHDJA4GG.mjs} +1 -1
- package/dist/{chunk-SUKOZ6OG.js → chunk-SRAG3FST.js} +10 -6
- package/dist/{chunk-TT5WHNGS.js → chunk-YVRX3F6S.js} +149 -81
- package/dist/{chunk-2LH6PZH3.mjs → chunk-ZCH4YINE.mjs} +3 -2
- package/dist/{chunk-VGPAKLMZ.mjs → chunk-ZGIN2OAY.mjs} +12 -7
- package/dist/cli.js +2233 -158
- package/dist/cli.mjs +2238 -163
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +14 -9
- package/dist/core.mjs +10 -5
- package/dist/css-macro/postcss.js +4 -4
- package/dist/css-macro/postcss.mjs +2 -2
- package/dist/css-macro.js +5 -5
- package/dist/css-macro.mjs +2 -2
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/{index-CoXntW_P.d.mts → index-BXrmQelt.d.mts} +29 -1
- package/dist/{index-CoXntW_P.d.ts → index-BXrmQelt.d.ts} +29 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/index.mjs +7 -7
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +8 -1
- package/dist/presets.d.ts +8 -1
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +3 -2
- package/dist/reset.d.mts +1 -31
- package/dist/reset.d.ts +3 -32
- package/dist/reset.js +3 -160
- package/dist/reset.mjs +3 -160
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +4 -4
- package/dist/weapp-tw-css-import-rewrite-loader.js +10 -5
- package/dist/weapp-tw-runtime-classset-loader.js +9 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +65 -56
- package/dist/webpack4.mjs +35 -26
- package/package.json +12 -7
- package/scripts/postinstall.mjs +59 -0
package/dist/reset.d.ts
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface ResetOptions {
|
|
4
|
-
/**
|
|
5
|
-
* 控制 `button` reset 的注入与选择器,传入 `false` 可跳过该规则。
|
|
6
|
-
*/
|
|
7
|
-
buttonReset?: false | ResetConfig;
|
|
8
|
-
/**
|
|
9
|
-
* 控制 `image` reset(同时覆盖 `<image>` 与 `<img>`)。
|
|
10
|
-
*/
|
|
11
|
-
imageReset?: false | ResetConfig;
|
|
12
|
-
/**
|
|
13
|
-
* 额外的 reset 规则,可根据业务自定义。
|
|
14
|
-
*/
|
|
15
|
-
extraResets?: ResetConfig[];
|
|
16
|
-
}
|
|
17
|
-
interface ResetConfig {
|
|
18
|
-
selectors?: string[];
|
|
19
|
-
declarations?: Record<string, string | number | false | null | undefined>;
|
|
20
|
-
pseudo?: Record<string, string | number | false | null | undefined>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare const reset: {
|
|
24
|
-
(options: ResetOptions): {
|
|
25
|
-
handler: tailwindcss_types_config.PluginCreator;
|
|
26
|
-
config?: Partial<tailwindcss_types_config.Config>;
|
|
27
|
-
};
|
|
28
|
-
__isOptionsFunction: true;
|
|
29
|
-
};
|
|
30
|
-
|
|
1
|
+
import _default from '@weapp-tailwindcss/reset';
|
|
31
2
|
// @ts-ignore
|
|
32
|
-
export =
|
|
33
|
-
export { reset };
|
|
3
|
+
export = _default;
|
|
4
|
+
export { ResetConfig, ResetOptions, ResetPreset, reset } from '@weapp-tailwindcss/reset';
|
package/dist/reset.js
CHANGED
|
@@ -1,165 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-ONLKZIRQ.js');
|
|
2
2
|
|
|
3
3
|
// src/reset/index.ts
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
// src/reset/normalize.ts
|
|
7
|
-
function normalizeResetSelectors(option, defaults) {
|
|
8
|
-
const resolved = _optionalChain([option, 'optionalAccess', _ => _.selectors, 'optionalAccess', _2 => _2.length]) ? option.selectors : defaults;
|
|
9
|
-
const normalized = [];
|
|
10
|
-
for (const selector of resolved) {
|
|
11
|
-
const trimmed = selector.trim();
|
|
12
|
-
if (!trimmed || normalized.includes(trimmed)) {
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
normalized.push(trimmed);
|
|
16
|
-
}
|
|
17
|
-
return normalized.length ? normalized : void 0;
|
|
18
|
-
}
|
|
19
|
-
function convertSelectorForBase(selector) {
|
|
20
|
-
if (selector.startsWith(".")) {
|
|
21
|
-
const className = selector.slice(1);
|
|
22
|
-
if (className.length > 0) {
|
|
23
|
-
return `[class~="${className}"]`;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (selector.startsWith("#")) {
|
|
27
|
-
const id = selector.slice(1);
|
|
28
|
-
if (id.length > 0) {
|
|
29
|
-
return `[id="${id}"]`;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return selector;
|
|
33
|
-
}
|
|
34
|
-
function normalizeDeclarations(option, defaults) {
|
|
35
|
-
const normalized = { ...defaults };
|
|
36
|
-
const overrides = _optionalChain([option, 'optionalAccess', _3 => _3.declarations]);
|
|
37
|
-
if (!overrides) {
|
|
38
|
-
return normalized;
|
|
39
|
-
}
|
|
40
|
-
const entries = Object.entries(overrides);
|
|
41
|
-
for (const [prop, value] of entries) {
|
|
42
|
-
const resolved = normalizeDeclarationValue(value);
|
|
43
|
-
if (resolved === void 0) {
|
|
44
|
-
delete normalized[prop];
|
|
45
|
-
} else {
|
|
46
|
-
normalized[prop] = resolved;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return normalized;
|
|
50
|
-
}
|
|
51
|
-
function normalizePseudo(option, defaults) {
|
|
52
|
-
const normalized = defaults ? { ...defaults } : {};
|
|
53
|
-
const overrides = _optionalChain([option, 'optionalAccess', _4 => _4.pseudo]);
|
|
54
|
-
if (!overrides) {
|
|
55
|
-
return Object.keys(normalized).length ? normalized : void 0;
|
|
56
|
-
}
|
|
57
|
-
const entries = Object.entries(overrides);
|
|
58
|
-
for (const [prop, value] of entries) {
|
|
59
|
-
const resolved = normalizeDeclarationValue(value);
|
|
60
|
-
if (resolved === void 0) {
|
|
61
|
-
delete normalized[prop];
|
|
62
|
-
} else {
|
|
63
|
-
normalized[prop] = resolved;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return Object.keys(normalized).length ? normalized : void 0;
|
|
67
|
-
}
|
|
68
|
-
function normalizeDeclarationValue(value) {
|
|
69
|
-
if (value === false || value === null || value === void 0) {
|
|
70
|
-
return void 0;
|
|
71
|
-
}
|
|
72
|
-
return typeof value === "number" ? value.toString() : value;
|
|
73
|
-
}
|
|
74
|
-
function createResetRule(option, defaults) {
|
|
75
|
-
if (option === false) {
|
|
76
|
-
return void 0;
|
|
77
|
-
}
|
|
78
|
-
const selectors = normalizeResetSelectors(option, defaults.selectors);
|
|
79
|
-
if (!selectors) {
|
|
80
|
-
return void 0;
|
|
81
|
-
}
|
|
82
|
-
const declarations = normalizeDeclarations(_nullishCoalesce(option, () => ( {})), defaults.declarations);
|
|
83
|
-
if (Object.keys(declarations).length === 0) {
|
|
84
|
-
return void 0;
|
|
85
|
-
}
|
|
86
|
-
const pseudo = normalizePseudo(_nullishCoalesce(option, () => ( {})), defaults.pseudo);
|
|
87
|
-
return {
|
|
88
|
-
selectors: selectors.map(convertSelectorForBase),
|
|
89
|
-
declarations,
|
|
90
|
-
pseudo
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/reset/index.ts
|
|
95
|
-
var DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
|
|
96
|
-
var DEFAULT_BUTTON_DECLARATIONS = {
|
|
97
|
-
padding: "0",
|
|
98
|
-
backgroundColor: "transparent",
|
|
99
|
-
fontSize: "inherit",
|
|
100
|
-
lineHeight: "inherit",
|
|
101
|
-
color: "inherit",
|
|
102
|
-
borderWidth: "0"
|
|
103
|
-
};
|
|
104
|
-
var BUTTON_RESET_PSEUDO_DECLARATIONS = {
|
|
105
|
-
border: "none"
|
|
106
|
-
};
|
|
107
|
-
var DEFAULT_IMAGE_RESET_SELECTORS = ["image", "img"];
|
|
108
|
-
var DEFAULT_IMAGE_DECLARATIONS = {
|
|
109
|
-
display: "block",
|
|
110
|
-
borderWidth: "0",
|
|
111
|
-
backgroundColor: "transparent",
|
|
112
|
-
maxWidth: "100%",
|
|
113
|
-
height: "auto"
|
|
114
|
-
};
|
|
115
|
-
var reset = _plugin2.default.withOptions(
|
|
116
|
-
(options) => {
|
|
117
|
-
const rules = [];
|
|
118
|
-
const buttonRule = createResetRule(_optionalChain([options, 'optionalAccess', _5 => _5.buttonReset]), {
|
|
119
|
-
selectors: DEFAULT_BUTTON_RESET_SELECTORS,
|
|
120
|
-
declarations: DEFAULT_BUTTON_DECLARATIONS,
|
|
121
|
-
pseudo: BUTTON_RESET_PSEUDO_DECLARATIONS
|
|
122
|
-
});
|
|
123
|
-
if (buttonRule) {
|
|
124
|
-
rules.push(buttonRule);
|
|
125
|
-
}
|
|
126
|
-
const imageRule = createResetRule(_optionalChain([options, 'optionalAccess', _6 => _6.imageReset]), {
|
|
127
|
-
selectors: DEFAULT_IMAGE_RESET_SELECTORS,
|
|
128
|
-
declarations: DEFAULT_IMAGE_DECLARATIONS
|
|
129
|
-
});
|
|
130
|
-
if (imageRule) {
|
|
131
|
-
rules.push(imageRule);
|
|
132
|
-
}
|
|
133
|
-
for (const extra of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _7 => _7.extraResets]), () => ( []))) {
|
|
134
|
-
const normalized = createResetRule(extra, {
|
|
135
|
-
selectors: _nullishCoalesce(extra.selectors, () => ( [])),
|
|
136
|
-
declarations: {}
|
|
137
|
-
});
|
|
138
|
-
if (normalized) {
|
|
139
|
-
rules.push(normalized);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return ({ addBase }) => {
|
|
143
|
-
if (!rules.length) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const baseRules = {};
|
|
147
|
-
for (const rule of rules) {
|
|
148
|
-
baseRules[rule.selectors.join(",")] = rule.declarations;
|
|
149
|
-
if (rule.pseudo) {
|
|
150
|
-
const pseudoSelectors = rule.selectors.map((selector) => `${selector}::after`).join(",");
|
|
151
|
-
baseRules[pseudoSelectors] = rule.pseudo;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
addBase(baseRules);
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
() => {
|
|
158
|
-
return {};
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
var reset_default = reset;
|
|
4
|
+
var _reset = require('@weapp-tailwindcss/reset'); var _reset2 = _interopRequireDefault(_reset);
|
|
162
5
|
|
|
163
6
|
|
|
164
7
|
|
|
165
|
-
exports.default =
|
|
8
|
+
exports.default = _reset2.default; exports.reset = _reset.reset;
|
package/dist/reset.mjs
CHANGED
|
@@ -1,165 +1,8 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-HL3US2OT.mjs";
|
|
2
2
|
|
|
3
3
|
// src/reset/index.ts
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
// src/reset/normalize.ts
|
|
7
|
-
function normalizeResetSelectors(option, defaults) {
|
|
8
|
-
const resolved = option?.selectors?.length ? option.selectors : defaults;
|
|
9
|
-
const normalized = [];
|
|
10
|
-
for (const selector of resolved) {
|
|
11
|
-
const trimmed = selector.trim();
|
|
12
|
-
if (!trimmed || normalized.includes(trimmed)) {
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
normalized.push(trimmed);
|
|
16
|
-
}
|
|
17
|
-
return normalized.length ? normalized : void 0;
|
|
18
|
-
}
|
|
19
|
-
function convertSelectorForBase(selector) {
|
|
20
|
-
if (selector.startsWith(".")) {
|
|
21
|
-
const className = selector.slice(1);
|
|
22
|
-
if (className.length > 0) {
|
|
23
|
-
return `[class~="${className}"]`;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (selector.startsWith("#")) {
|
|
27
|
-
const id = selector.slice(1);
|
|
28
|
-
if (id.length > 0) {
|
|
29
|
-
return `[id="${id}"]`;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return selector;
|
|
33
|
-
}
|
|
34
|
-
function normalizeDeclarations(option, defaults) {
|
|
35
|
-
const normalized = { ...defaults };
|
|
36
|
-
const overrides = option?.declarations;
|
|
37
|
-
if (!overrides) {
|
|
38
|
-
return normalized;
|
|
39
|
-
}
|
|
40
|
-
const entries = Object.entries(overrides);
|
|
41
|
-
for (const [prop, value] of entries) {
|
|
42
|
-
const resolved = normalizeDeclarationValue(value);
|
|
43
|
-
if (resolved === void 0) {
|
|
44
|
-
delete normalized[prop];
|
|
45
|
-
} else {
|
|
46
|
-
normalized[prop] = resolved;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return normalized;
|
|
50
|
-
}
|
|
51
|
-
function normalizePseudo(option, defaults) {
|
|
52
|
-
const normalized = defaults ? { ...defaults } : {};
|
|
53
|
-
const overrides = option?.pseudo;
|
|
54
|
-
if (!overrides) {
|
|
55
|
-
return Object.keys(normalized).length ? normalized : void 0;
|
|
56
|
-
}
|
|
57
|
-
const entries = Object.entries(overrides);
|
|
58
|
-
for (const [prop, value] of entries) {
|
|
59
|
-
const resolved = normalizeDeclarationValue(value);
|
|
60
|
-
if (resolved === void 0) {
|
|
61
|
-
delete normalized[prop];
|
|
62
|
-
} else {
|
|
63
|
-
normalized[prop] = resolved;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return Object.keys(normalized).length ? normalized : void 0;
|
|
67
|
-
}
|
|
68
|
-
function normalizeDeclarationValue(value) {
|
|
69
|
-
if (value === false || value === null || value === void 0) {
|
|
70
|
-
return void 0;
|
|
71
|
-
}
|
|
72
|
-
return typeof value === "number" ? value.toString() : value;
|
|
73
|
-
}
|
|
74
|
-
function createResetRule(option, defaults) {
|
|
75
|
-
if (option === false) {
|
|
76
|
-
return void 0;
|
|
77
|
-
}
|
|
78
|
-
const selectors = normalizeResetSelectors(option, defaults.selectors);
|
|
79
|
-
if (!selectors) {
|
|
80
|
-
return void 0;
|
|
81
|
-
}
|
|
82
|
-
const declarations = normalizeDeclarations(option ?? {}, defaults.declarations);
|
|
83
|
-
if (Object.keys(declarations).length === 0) {
|
|
84
|
-
return void 0;
|
|
85
|
-
}
|
|
86
|
-
const pseudo = normalizePseudo(option ?? {}, defaults.pseudo);
|
|
87
|
-
return {
|
|
88
|
-
selectors: selectors.map(convertSelectorForBase),
|
|
89
|
-
declarations,
|
|
90
|
-
pseudo
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/reset/index.ts
|
|
95
|
-
var DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
|
|
96
|
-
var DEFAULT_BUTTON_DECLARATIONS = {
|
|
97
|
-
padding: "0",
|
|
98
|
-
backgroundColor: "transparent",
|
|
99
|
-
fontSize: "inherit",
|
|
100
|
-
lineHeight: "inherit",
|
|
101
|
-
color: "inherit",
|
|
102
|
-
borderWidth: "0"
|
|
103
|
-
};
|
|
104
|
-
var BUTTON_RESET_PSEUDO_DECLARATIONS = {
|
|
105
|
-
border: "none"
|
|
106
|
-
};
|
|
107
|
-
var DEFAULT_IMAGE_RESET_SELECTORS = ["image", "img"];
|
|
108
|
-
var DEFAULT_IMAGE_DECLARATIONS = {
|
|
109
|
-
display: "block",
|
|
110
|
-
borderWidth: "0",
|
|
111
|
-
backgroundColor: "transparent",
|
|
112
|
-
maxWidth: "100%",
|
|
113
|
-
height: "auto"
|
|
114
|
-
};
|
|
115
|
-
var reset = plugin.withOptions(
|
|
116
|
-
(options) => {
|
|
117
|
-
const rules = [];
|
|
118
|
-
const buttonRule = createResetRule(options?.buttonReset, {
|
|
119
|
-
selectors: DEFAULT_BUTTON_RESET_SELECTORS,
|
|
120
|
-
declarations: DEFAULT_BUTTON_DECLARATIONS,
|
|
121
|
-
pseudo: BUTTON_RESET_PSEUDO_DECLARATIONS
|
|
122
|
-
});
|
|
123
|
-
if (buttonRule) {
|
|
124
|
-
rules.push(buttonRule);
|
|
125
|
-
}
|
|
126
|
-
const imageRule = createResetRule(options?.imageReset, {
|
|
127
|
-
selectors: DEFAULT_IMAGE_RESET_SELECTORS,
|
|
128
|
-
declarations: DEFAULT_IMAGE_DECLARATIONS
|
|
129
|
-
});
|
|
130
|
-
if (imageRule) {
|
|
131
|
-
rules.push(imageRule);
|
|
132
|
-
}
|
|
133
|
-
for (const extra of options?.extraResets ?? []) {
|
|
134
|
-
const normalized = createResetRule(extra, {
|
|
135
|
-
selectors: extra.selectors ?? [],
|
|
136
|
-
declarations: {}
|
|
137
|
-
});
|
|
138
|
-
if (normalized) {
|
|
139
|
-
rules.push(normalized);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return ({ addBase }) => {
|
|
143
|
-
if (!rules.length) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const baseRules = {};
|
|
147
|
-
for (const rule of rules) {
|
|
148
|
-
baseRules[rule.selectors.join(",")] = rule.declarations;
|
|
149
|
-
if (rule.pseudo) {
|
|
150
|
-
const pseudoSelectors = rule.selectors.map((selector) => `${selector}::after`).join(",");
|
|
151
|
-
baseRules[pseudoSelectors] = rule.pseudo;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
addBase(baseRules);
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
() => {
|
|
158
|
-
return {};
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
var reset_default = reset;
|
|
4
|
+
import { default as default2, reset } from "@weapp-tailwindcss/reset";
|
|
162
5
|
export {
|
|
163
|
-
|
|
6
|
+
default2 as default,
|
|
164
7
|
reset
|
|
165
8
|
};
|
package/dist/types.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/po
|
|
|
4
4
|
import { SourceMap } from 'magic-string';
|
|
5
5
|
import { Result, Root, Document } from 'postcss';
|
|
6
6
|
import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
7
|
-
import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-
|
|
8
|
-
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-
|
|
7
|
+
import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-BXrmQelt.mjs';
|
|
8
|
+
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-BXrmQelt.mjs';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'webpack';
|
|
11
11
|
import 'lru-cache';
|
package/dist/types.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/po
|
|
|
4
4
|
import { SourceMap } from 'magic-string';
|
|
5
5
|
import { Result, Root, Document } from 'postcss';
|
|
6
6
|
import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
7
|
-
import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-
|
|
8
|
-
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-
|
|
7
|
+
import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-BXrmQelt.js';
|
|
8
|
+
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-BXrmQelt.js';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'webpack';
|
|
11
11
|
import 'lru-cache';
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('./chunk-
|
|
1
|
+
"use strict";require('./chunk-ONLKZIRQ.js');
|
package/dist/types.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-HL3US2OT.mjs";
|
package/dist/vite.d.mts
CHANGED
package/dist/vite.d.ts
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunk6JBFHYFMjs = require('./chunk-6JBFHYFM.js');
|
|
4
|
+
require('./chunk-GMKSBLNY.js');
|
|
5
5
|
require('./chunk-OF6MFURR.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-YVRX3F6S.js');
|
|
7
|
+
require('./chunk-NIS74SI6.js');
|
|
8
8
|
require('./chunk-A5PB4KZT.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-ONLKZIRQ.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunk6JBFHYFMjs.UnifiedViteWeappTailwindcssPlugin; exports.weappTailwindcss = _chunk6JBFHYFMjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CMNCGACY.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-76S2EME4.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-LWEVOVRD.mjs";
|
|
7
|
+
import "./chunk-AYJ4HLWZ.mjs";
|
|
8
8
|
import "./chunk-XAKAD2CR.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-HL3US2OT.mjs";
|
|
11
11
|
export {
|
|
12
12
|
UnifiedViteWeappTailwindcssPlugin,
|
|
13
13
|
UnifiedViteWeappTailwindcssPlugin as weappTailwindcss
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-4AFQP74Z.js');
|
|
2
2
|
|
|
3
3
|
// src/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.ts
|
|
4
|
+
var _buffer = require('buffer');
|
|
4
5
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
6
|
+
var _util = require('util');
|
|
5
7
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
6
8
|
var _loaderutils = require('loader-utils'); var _loaderutils2 = _interopRequireDefault(_loaderutils);
|
|
7
9
|
|
|
@@ -51,6 +53,7 @@ function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
// src/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.ts
|
|
56
|
+
var getLoaderOptions = _loaderutils2.default.getOptions;
|
|
54
57
|
function joinPosixPath(base, subpath) {
|
|
55
58
|
if (base.endsWith("/")) {
|
|
56
59
|
return `${base}${subpath}`;
|
|
@@ -74,25 +77,27 @@ function applyCssImportRewrite(source, options) {
|
|
|
74
77
|
return rewritten != null ? rewritten : source;
|
|
75
78
|
}
|
|
76
79
|
function transformCssImportRewriteSource(source, options) {
|
|
77
|
-
const isBuffer = Buffer.isBuffer(source);
|
|
80
|
+
const isBuffer = _buffer.Buffer.isBuffer(source);
|
|
78
81
|
const input = isBuffer ? source.toString("utf-8") : source;
|
|
79
82
|
const rewritten = applyCssImportRewrite(input, options);
|
|
80
83
|
if (rewritten === input) {
|
|
81
84
|
return source;
|
|
82
85
|
}
|
|
83
86
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG) {
|
|
84
|
-
|
|
87
|
+
_process2.default.stdout.write(`[weapp-tw-css-import-rewrite-loader] rewritten import ${_util.inspect.call(void 0, {
|
|
85
88
|
before: input.slice(0, 80),
|
|
86
89
|
after: rewritten.slice(0, 80)
|
|
87
|
-
})
|
|
90
|
+
})}
|
|
91
|
+
`);
|
|
88
92
|
}
|
|
89
93
|
return rewritten;
|
|
90
94
|
}
|
|
91
95
|
var WeappTwCssImportRewriteLoader = function(source) {
|
|
92
96
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG) {
|
|
93
|
-
|
|
97
|
+
_process2.default.stdout.write(`[weapp-tw-css-import-rewrite-loader] executing for ${this.resourcePath}
|
|
98
|
+
`);
|
|
94
99
|
}
|
|
95
|
-
const opt =
|
|
100
|
+
const opt = getLoaderOptions(this);
|
|
96
101
|
return transformCssImportRewriteSource(source, opt);
|
|
97
102
|
};
|
|
98
103
|
var weapp_tw_css_import_rewrite_loader_default = WeappTwCssImportRewriteLoader;
|
|
@@ -5,12 +5,17 @@ var _chunk4AFQP74Zjs = require('./chunk-4AFQP74Z.js');
|
|
|
5
5
|
// src/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.ts
|
|
6
6
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
7
7
|
var _loaderutils = require('loader-utils'); var _loaderutils2 = _interopRequireDefault(_loaderutils);
|
|
8
|
+
function isPromiseLike(value) {
|
|
9
|
+
return Boolean(value && typeof value.then === "function");
|
|
10
|
+
}
|
|
11
|
+
var getLoaderOptions = _loaderutils2.default.getOptions;
|
|
8
12
|
var WeappTwRuntimeClassSetLoader = function(source) {
|
|
9
13
|
var _a;
|
|
10
14
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG) {
|
|
11
|
-
|
|
15
|
+
_process2.default.stdout.write(`[weapp-tw-runtime-classset-loader] executing for ${this.resourcePath}
|
|
16
|
+
`);
|
|
12
17
|
}
|
|
13
|
-
const opt =
|
|
18
|
+
const opt = getLoaderOptions(this);
|
|
14
19
|
const maybePromise = (_a = opt == null ? void 0 : opt.getClassSet) == null ? void 0 : _a.call(opt);
|
|
15
20
|
const applyWatchDependencies = (dependencies) => {
|
|
16
21
|
var _a2, _b, _c, _d;
|
|
@@ -24,14 +29,14 @@ var WeappTwRuntimeClassSetLoader = function(source) {
|
|
|
24
29
|
const resolveWatchDependencies = () => {
|
|
25
30
|
var _a2;
|
|
26
31
|
const dependencies = (_a2 = opt == null ? void 0 : opt.getWatchDependencies) == null ? void 0 : _a2.call(opt);
|
|
27
|
-
if (dependencies
|
|
32
|
+
if (isPromiseLike(dependencies)) {
|
|
28
33
|
return Promise.resolve(dependencies).then((value) => {
|
|
29
34
|
applyWatchDependencies(value);
|
|
30
35
|
});
|
|
31
36
|
}
|
|
32
37
|
applyWatchDependencies(dependencies);
|
|
33
38
|
};
|
|
34
|
-
if (maybePromise
|
|
39
|
+
if (isPromiseLike(maybePromise)) {
|
|
35
40
|
return Promise.resolve(maybePromise).then(() => _chunk4AFQP74Zjs.__async.call(void 0, this, null, function* () {
|
|
36
41
|
yield resolveWatchDependencies();
|
|
37
42
|
return source;
|
package/dist/webpack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.mjs';
|
|
3
|
-
import { A as AppType, e as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-BXrmQelt.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
|
|
3
|
-
import { A as AppType, e as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-BXrmQelt.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkPAAX4FDDjs = require('./chunk-PAAX4FDD.js');
|
|
5
|
+
require('./chunk-2A4NRLSY.js');
|
|
6
|
+
require('./chunk-GMKSBLNY.js');
|
|
7
7
|
require('./chunk-OF6MFURR.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-YVRX3F6S.js');
|
|
9
|
+
require('./chunk-NIS74SI6.js');
|
|
10
10
|
require('./chunk-A5PB4KZT.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
12
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-ONLKZIRQ.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkPAAX4FDDjs.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunkPAAX4FDDjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkPAAX4FDDjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZGIN2OAY.mjs";
|
|
5
|
+
import "./chunk-SHDJA4GG.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-76S2EME4.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-LWEVOVRD.mjs";
|
|
9
|
+
import "./chunk-AYJ4HLWZ.mjs";
|
|
10
10
|
import "./chunk-XAKAD2CR.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-HL3US2OT.mjs";
|
|
13
13
|
export {
|
|
14
14
|
UnifiedWebpackPluginV5,
|
|
15
15
|
UnifiedWebpackPluginV5 as weappTailwindcss,
|
package/dist/webpack4.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack4';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.mjs';
|
|
3
|
-
import { A as AppType, e as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-BXrmQelt.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack4.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack4';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
|
|
3
|
-
import { A as AppType, e as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-BXrmQelt.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|