weapp-tailwindcss 5.0.3 → 5.0.5
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.en.md +9 -0
- package/README.md +5 -133
- package/dist/{auto-dPpsm6FB.js → auto-Cvy0zWpS.js} +1 -1
- package/dist/{bundle-state-CW1X7QIy.js → bundle-state-Cso_ceUo.js} +8 -2
- package/dist/{bundle-state-s5HwfrmR.mjs → bundle-state-DEyxCR4f.mjs} +2 -2
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +3 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +5 -0
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +2 -0
- package/dist/{chunk-C5U5_Hdc.js → chunk-emK7D4bc.js} +0 -7
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.js +3 -3
- package/dist/{defaults-zKUH2mDe.js → defaults-BPUuNYcD.js} +1 -1
- package/dist/defaults.js +1 -1
- package/dist/{generator-Bd1LntD3.js → generator-AD-eX8Tr.js} +2 -2
- package/dist/{generator-DRHWC1t-.mjs → generator-DVWLNO0n.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-BdCWIuPW.js → incremental-runtime-class-set-vOetpdWs.js} +195 -43
- package/dist/{incremental-runtime-class-set-BcAFhVvu.mjs → incremental-runtime-class-set-xf49kky6.mjs} +194 -42
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-DfnqZ4Bm.js → postcss-Cbi6RFpf.js} +57 -10
- package/dist/{postcss-CJrmfXvi.mjs → postcss-hSUxK7oR.mjs} +55 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-h6TNzFbF.mjs → precheck-Bsn_LMmo.mjs} +19 -33
- package/dist/{precheck-8Ik4q0yI.js → precheck-b8Y8qZg0.js} +17 -31
- package/dist/presets.js +9 -5
- package/dist/presets.mjs +7 -3
- package/dist/reset.js +1 -1
- package/dist/{source-candidates-D7b-Jzsx.mjs → source-candidates-BsWYoIPN.mjs} +1 -1
- package/dist/{source-candidates-DQxvGPSw.js → source-candidates-o2ZrKWzu.js} +2 -2
- package/dist/{tailwindcss-D5RogwtV.mjs → tailwindcss-AWaPVF2B.mjs} +1 -1
- package/dist/{tailwindcss-jvoYizzX.js → tailwindcss-CpQ6X4l6.js} +3 -3
- package/dist/{vite-DT-VUrl0.js → transform-BkGtbxb1.js} +245 -10127
- package/dist/{vite-yCeZWm7n.mjs → transform-DumSZmTh.mjs} +263 -10128
- package/dist/uni-app-x/vite.d.ts +3 -0
- package/dist/{utils-D7Ygohep.js → utils-Dolmt8EO.js} +1 -1
- package/dist/{v3-engine-CmIF_gsq.js → v3-engine-CM0TRa8V.js} +29 -5
- package/dist/{v3-engine-BCUGX3gX.mjs → v3-engine-Cczrkzqt.mjs} +22 -4
- package/dist/vite-CTuHPC91.js +3283 -0
- package/dist/vite-DLXDMHON.mjs +3270 -0
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +201 -42
- package/dist/{webpack-BFMJqCH9.js → webpack-BBHJYKqB.js} +8 -9
- package/dist/{webpack-E0gT72EX.mjs → webpack-DJFw08SK.mjs} +6 -7
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +3 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import postcss from "postcss";
|
|
1
|
+
import { $ as collectCssInlineSourceCandidates, T as hasTailwindRootDirectives, Z as DEFAULT_SOURCE_SCAN_EXTENSIONS, at as resolveCssSourceEntries, dt as readInstalledPackageMajorVersion, et as createSourceScanPattern, it as parseConfigParam, rt as normalizeLegacyContentEntries, t as resolveTailwindV3Source, tt as expandTailwindSourceEntries, w as hasTailwindApplyDirective, y as resolveTailwindV4Source$1 } from "./v3-engine-Cczrkzqt.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-DVWLNO0n.mjs";
|
|
3
|
+
import postcss$1 from "postcss";
|
|
4
4
|
import { extractRawCandidatesWithPositions, extractValidCandidates } from "tailwindcss-patch";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "node:path";
|
|
@@ -38,7 +38,7 @@ function resolvePostcssProjectRoot(result, options) {
|
|
|
38
38
|
function replaceRootCss(root, css, result) {
|
|
39
39
|
root.removeAll();
|
|
40
40
|
try {
|
|
41
|
-
const nextRoot = postcss.parse(css, { from: resolveInputFile(result) });
|
|
41
|
+
const nextRoot = postcss$1.parse(css, { from: resolveInputFile(result) });
|
|
42
42
|
root.append(nextRoot.nodes);
|
|
43
43
|
} catch {
|
|
44
44
|
root.raws = { after: css };
|
|
@@ -61,6 +61,9 @@ function addSourceDependencyMessages(result, files) {
|
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region src/postcss/source-files.ts
|
|
63
63
|
const POSTCSS_SOURCE_PATTERN = createSourceScanPattern(DEFAULT_SOURCE_SCAN_EXTENSIONS);
|
|
64
|
+
function isTailwindV4ApplyOnlyCss$1(root, options) {
|
|
65
|
+
return options.version === 4 && hasTailwindApplyDirective(root.toString()) && !hasTailwindRootDirectives(root.toString(), { importFallback: true });
|
|
66
|
+
}
|
|
64
67
|
function getSourceExtension(file) {
|
|
65
68
|
return path.extname(file).slice(1) || void 0;
|
|
66
69
|
}
|
|
@@ -118,10 +121,11 @@ async function collectAutoTailwindCandidates(root, result, options) {
|
|
|
118
121
|
const projectRoot = resolvePostcssProjectRoot(result, options);
|
|
119
122
|
const sourceEntries = [];
|
|
120
123
|
const hasSourceNone = root.toString().includes("source(none)");
|
|
124
|
+
const shouldSkipAutoScan = isTailwindV4ApplyOnlyCss$1(root, options);
|
|
121
125
|
const inlineCandidates = collectCssInlineSourceCandidates(root);
|
|
122
126
|
const configuredContentEntries = options.version === 3 ? await collectConfiguredContentEntries(root, base, options) : [];
|
|
123
127
|
if (configuredContentEntries.length > 0) sourceEntries.push(...configuredContentEntries);
|
|
124
|
-
else if (!hasSourceNone) sourceEntries.push({
|
|
128
|
+
else if (!hasSourceNone && !shouldSkipAutoScan) sourceEntries.push({
|
|
125
129
|
base,
|
|
126
130
|
negated: false,
|
|
127
131
|
pattern: POSTCSS_SOURCE_PATTERN
|
|
@@ -175,6 +179,47 @@ function resolvePostcssTailwindVersion(root, result, options) {
|
|
|
175
179
|
//#endregion
|
|
176
180
|
//#region src/postcss.ts
|
|
177
181
|
const PLUGIN_NAME = "weapp-tailwindcss";
|
|
182
|
+
function isTailwindV4ApplyOnlyCss(css) {
|
|
183
|
+
return hasTailwindApplyDirective(css) && !hasTailwindRootDirectives(css, { importFallback: true });
|
|
184
|
+
}
|
|
185
|
+
function resolveTailwindV4PostcssSourceCss(css, sourceOptions) {
|
|
186
|
+
return isTailwindV4ApplyOnlyCss(css) ? `@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);\n${css}` : css;
|
|
187
|
+
}
|
|
188
|
+
function normalizeSelector(selector) {
|
|
189
|
+
return selector.replace(/:not\(#\\#\)/g, "").trim();
|
|
190
|
+
}
|
|
191
|
+
function collectApplyOnlyCssSelectors(css) {
|
|
192
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
193
|
+
try {
|
|
194
|
+
postcss.parse(css).walkRules((rule) => {
|
|
195
|
+
if (!rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) return;
|
|
196
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
197
|
+
const normalized = normalizeSelector(selector);
|
|
198
|
+
if (normalized) selectors.add(normalized);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
} catch {}
|
|
202
|
+
return selectors;
|
|
203
|
+
}
|
|
204
|
+
function ruleMatchesApplyOnlySelector(rule, selectors) {
|
|
205
|
+
return (rule.selectors ?? [rule.selector]).some((selector) => selectors.has(normalizeSelector(selector)));
|
|
206
|
+
}
|
|
207
|
+
function filterApplyOnlyGeneratedCss(css, rawCss) {
|
|
208
|
+
const selectors = collectApplyOnlyCssSelectors(rawCss);
|
|
209
|
+
if (selectors.size === 0) return css;
|
|
210
|
+
try {
|
|
211
|
+
const root = postcss.parse(css);
|
|
212
|
+
root.walkRules((rule) => {
|
|
213
|
+
if (!ruleMatchesApplyOnlySelector(rule, selectors) && !rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"))) rule.remove();
|
|
214
|
+
});
|
|
215
|
+
root.walkAtRules((rule) => {
|
|
216
|
+
if (rule.nodes !== void 0 && rule.nodes.length === 0) rule.remove();
|
|
217
|
+
});
|
|
218
|
+
return root.toString();
|
|
219
|
+
} catch {
|
|
220
|
+
return css;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
178
223
|
const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
179
224
|
return {
|
|
180
225
|
postcssPlugin: PLUGIN_NAME,
|
|
@@ -184,9 +229,11 @@ const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
|
184
229
|
const tailwindVersion = resolvePostcssTailwindVersion(root, result, options);
|
|
185
230
|
const [collectedSources, autoCandidates] = await Promise.all([collectPostcssLocalSources(root, result, options), collectAutoTailwindCandidates(root, result, options)]);
|
|
186
231
|
const generatorConfig = generatorOptions.config ?? options.config;
|
|
232
|
+
const rawCss = sourceOptions.css ?? root.toString();
|
|
233
|
+
const isApplyOnlyTailwindV4Css = tailwindVersion === 4 && isTailwindV4ApplyOnlyCss(rawCss);
|
|
187
234
|
const generator = createWeappTailwindcssGenerator(tailwindVersion === 3 ? await resolveTailwindV3Source({
|
|
188
235
|
config: generatorConfig,
|
|
189
|
-
css:
|
|
236
|
+
css: rawCss,
|
|
190
237
|
base: resolvePostcssBase(result, options),
|
|
191
238
|
cwd: resolvePostcssProjectRoot(result, options),
|
|
192
239
|
projectRoot: resolvePostcssProjectRoot(result, options),
|
|
@@ -194,7 +241,7 @@ const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
|
194
241
|
postcssPlugin: options.postcssPlugin
|
|
195
242
|
}) : await resolveTailwindV4Source$1({
|
|
196
243
|
...sourceOptions,
|
|
197
|
-
css: prependConfigDirective(sourceOptions
|
|
244
|
+
css: prependConfigDirective(resolveTailwindV4PostcssSourceCss(rawCss, sourceOptions), generatorConfig),
|
|
198
245
|
base: resolvePostcssBase(result, options),
|
|
199
246
|
projectRoot: resolvePostcssProjectRoot(result, options)
|
|
200
247
|
}));
|
|
@@ -210,7 +257,7 @@ const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
|
210
257
|
target: generatorOptions.target
|
|
211
258
|
};
|
|
212
259
|
const generated = await generator.generate(generateOptions);
|
|
213
|
-
replaceRootCss(root, generated.css, result);
|
|
260
|
+
replaceRootCss(root, isApplyOnlyTailwindV4Css ? filterApplyOnlyGeneratedCss(generated.css, rawCss) : generated.css, result);
|
|
214
261
|
addDependencyMessages(result, generated);
|
|
215
262
|
addSourceDependencyMessages(result, collectedSources.files);
|
|
216
263
|
result.messages.push({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
2
|
let _weapp_tailwindcss_postcss_html_transform = require("@weapp-tailwindcss/postcss/html-transform");
|
|
3
3
|
_weapp_tailwindcss_postcss_html_transform = require_chunk.__toESM(_weapp_tailwindcss_postcss_html_transform);
|
|
4
4
|
//#region src/postcss-html-transform.ts
|
package/dist/postcss.js
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_postcss = require("./postcss-
|
|
5
|
+
const require_postcss = require("./postcss-Cbi6RFpf.js");
|
|
6
6
|
exports.default = require_postcss.weappTailwindcssPostcssPlugin;
|
|
7
7
|
exports.weappTailwindcssPostcssPlugin = require_postcss.weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
1
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-hSUxK7oR.mjs";
|
|
2
2
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { K as createTailwindV4Engine$1, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, gt as omitUndefined, ht as resolveBooleanObjectOption, lt as createDebug, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-Cczrkzqt.mjs";
|
|
2
2
|
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-8xrgzxFY.mjs";
|
|
3
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
4
|
-
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-
|
|
5
|
-
import { createRequire } from "node:module";
|
|
4
|
+
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-AWaPVF2B.mjs";
|
|
6
5
|
import { splitCandidateTokens } from "tailwindcss-patch";
|
|
7
6
|
import process from "node:process";
|
|
8
7
|
import path from "node:path";
|
|
9
8
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
10
9
|
import { rm } from "node:fs/promises";
|
|
11
10
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
12
|
-
import { Buffer
|
|
11
|
+
import { Buffer } from "node:buffer";
|
|
13
12
|
import { LRUCache } from "lru-cache";
|
|
14
13
|
import { md5 as md5Hash } from "@weapp-tailwindcss/shared/node";
|
|
15
14
|
import { MappingChars2String, escape } from "@weapp-core/escape";
|
|
@@ -18,11 +17,6 @@ import { parse, parseExpression } from "@babel/parser";
|
|
|
18
17
|
import MagicString from "magic-string";
|
|
19
18
|
import { jsStringEscape } from "@ast-core/escape";
|
|
20
19
|
import * as t from "@babel/types";
|
|
21
|
-
//#region \0rolldown/runtime.js
|
|
22
|
-
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
23
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
24
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
25
|
-
//#endregion
|
|
26
20
|
//#region src/cache/index.ts
|
|
27
21
|
function isProcessResult(value) {
|
|
28
22
|
return typeof value === "object" && value !== null && "result" in value;
|
|
@@ -484,13 +478,13 @@ function normalizeOptionsValue(rawValue, stack = /* @__PURE__ */ new WeakSet())
|
|
|
484
478
|
source: rawValue.source,
|
|
485
479
|
flags: rawValue.flags
|
|
486
480
|
};
|
|
487
|
-
if (typeof Buffer
|
|
481
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(rawValue)) return encodeTaggedValue("Buffer", rawValue.toString("base64"));
|
|
488
482
|
if (ArrayBuffer.isView(rawValue)) {
|
|
489
483
|
const view = rawValue;
|
|
490
|
-
const buffer = Buffer
|
|
484
|
+
const buffer = Buffer.from(view.buffer, view.byteOffset, view.byteLength);
|
|
491
485
|
return encodeTaggedValue(view.constructor?.name ?? "ArrayBufferView", buffer.toString("base64"));
|
|
492
486
|
}
|
|
493
|
-
if (rawValue instanceof ArrayBuffer) return encodeTaggedValue("ArrayBuffer", Buffer
|
|
487
|
+
if (rawValue instanceof ArrayBuffer) return encodeTaggedValue("ArrayBuffer", Buffer.from(rawValue).toString("base64"));
|
|
494
488
|
if (rawValue instanceof Set) return withCircularGuard(rawValue, stack, () => {
|
|
495
489
|
const normalizedEntries = Array.from(rawValue, (element) => createComparableNormalizedValue(element, stack));
|
|
496
490
|
normalizedEntries.sort((a, b) => a.sortKey.localeCompare(b.sortKey));
|
|
@@ -1238,7 +1232,6 @@ function _typeof(o) {
|
|
|
1238
1232
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
1239
1233
|
}, _typeof(o);
|
|
1240
1234
|
}
|
|
1241
|
-
var init_typeof = __esmMin((() => {}));
|
|
1242
1235
|
//#endregion
|
|
1243
1236
|
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
1244
1237
|
function toPrimitive(t, r) {
|
|
@@ -1251,19 +1244,12 @@ function toPrimitive(t, r) {
|
|
|
1251
1244
|
}
|
|
1252
1245
|
return ("string" === r ? String : Number)(t);
|
|
1253
1246
|
}
|
|
1254
|
-
var init_toPrimitive = __esmMin((() => {
|
|
1255
|
-
init_typeof();
|
|
1256
|
-
}));
|
|
1257
1247
|
//#endregion
|
|
1258
1248
|
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
1259
1249
|
function toPropertyKey(t) {
|
|
1260
1250
|
var i = toPrimitive(t, "string");
|
|
1261
1251
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1262
1252
|
}
|
|
1263
|
-
var init_toPropertyKey = __esmMin((() => {
|
|
1264
|
-
init_typeof();
|
|
1265
|
-
init_toPrimitive();
|
|
1266
|
-
}));
|
|
1267
1253
|
//#endregion
|
|
1268
1254
|
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
1269
1255
|
function _defineProperty(e, r, t) {
|
|
@@ -1274,12 +1260,8 @@ function _defineProperty(e, r, t) {
|
|
|
1274
1260
|
writable: !0
|
|
1275
1261
|
}) : e[r] = t, e;
|
|
1276
1262
|
}
|
|
1277
|
-
var init_defineProperty = __esmMin((() => {
|
|
1278
|
-
init_toPropertyKey();
|
|
1279
|
-
}));
|
|
1280
1263
|
//#endregion
|
|
1281
1264
|
//#region src/js/JsTokenUpdater.ts
|
|
1282
|
-
init_defineProperty();
|
|
1283
1265
|
/**
|
|
1284
1266
|
* Lightweight helper that batches updates to {@link MagicString}.
|
|
1285
1267
|
* It keeps the transformation logic out of the traversal code and makes
|
|
@@ -1318,7 +1300,6 @@ var JsTokenUpdater = class {
|
|
|
1318
1300
|
};
|
|
1319
1301
|
//#endregion
|
|
1320
1302
|
//#region src/js/module-graph/ignored-exports.ts
|
|
1321
|
-
init_defineProperty();
|
|
1322
1303
|
var IgnoredExportsTracker = class {
|
|
1323
1304
|
constructor(options) {
|
|
1324
1305
|
this.options = options;
|
|
@@ -1439,7 +1420,6 @@ var IgnoredExportsTracker = class {
|
|
|
1439
1420
|
};
|
|
1440
1421
|
//#endregion
|
|
1441
1422
|
//#region src/js/ModuleGraph.ts
|
|
1442
|
-
init_defineProperty();
|
|
1443
1423
|
var JsModuleGraph = class {
|
|
1444
1424
|
constructor(entry, graphOptions) {
|
|
1445
1425
|
_defineProperty(this, "modules", /* @__PURE__ */ new Map());
|
|
@@ -1614,7 +1594,6 @@ function maybeAddImportToken(imports, arg) {
|
|
|
1614
1594
|
}
|
|
1615
1595
|
//#endregion
|
|
1616
1596
|
//#region src/js/NodePathWalker.ts
|
|
1617
|
-
init_defineProperty();
|
|
1618
1597
|
const EMPTY_IGNORE_CALL_EXPRESSION_IDENTIFIERS = [];
|
|
1619
1598
|
const EMPTY_IMPORT_TOKENS = /* @__PURE__ */ new Set();
|
|
1620
1599
|
function NOOP_STRING_PATH_CALLBACK() {}
|
|
@@ -2333,7 +2312,6 @@ var BinTrieFlags;
|
|
|
2333
2312
|
})(BinTrieFlags || (BinTrieFlags = {}));
|
|
2334
2313
|
//#endregion
|
|
2335
2314
|
//#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode.js
|
|
2336
|
-
init_defineProperty();
|
|
2337
2315
|
var CharCodes$1;
|
|
2338
2316
|
(function(CharCodes) {
|
|
2339
2317
|
CharCodes[CharCodes["NUM"] = 35] = "NUM";
|
|
@@ -2704,7 +2682,6 @@ function determineBranch(decodeTree, current, nodeIndex, char) {
|
|
|
2704
2682
|
}
|
|
2705
2683
|
//#endregion
|
|
2706
2684
|
//#region ../../node_modules/.pnpm/htmlparser2@12.0.0/node_modules/htmlparser2/dist/Tokenizer.js
|
|
2707
|
-
init_defineProperty();
|
|
2708
2685
|
var CharCodes;
|
|
2709
2686
|
(function(CharCodes) {
|
|
2710
2687
|
CharCodes[CharCodes["Tab"] = 9] = "Tab";
|
|
@@ -3647,7 +3624,6 @@ var Tokenizer$1 = class {
|
|
|
3647
3624
|
};
|
|
3648
3625
|
//#endregion
|
|
3649
3626
|
//#region ../../node_modules/.pnpm/htmlparser2@12.0.0/node_modules/htmlparser2/dist/Parser.js
|
|
3650
|
-
init_defineProperty();
|
|
3651
3627
|
const { fromCodePoint } = String;
|
|
3652
3628
|
const formTags = new Set([
|
|
3653
3629
|
"input",
|
|
@@ -4257,7 +4233,6 @@ function isAllWhitespace(value) {
|
|
|
4257
4233
|
}
|
|
4258
4234
|
//#endregion
|
|
4259
4235
|
//#region src/wxml/Tokenizer.ts
|
|
4260
|
-
init_defineProperty();
|
|
4261
4236
|
var Tokenizer = class {
|
|
4262
4237
|
constructor() {
|
|
4263
4238
|
_defineProperty(this, "state", void 0);
|
|
@@ -4619,6 +4594,17 @@ function applyLoggerLevel(logLevel) {
|
|
|
4619
4594
|
}
|
|
4620
4595
|
//#endregion
|
|
4621
4596
|
//#region src/context/index.ts
|
|
4597
|
+
function resolveContextCssPreflight(opts, ctx, majorVersion) {
|
|
4598
|
+
const cssPreflight = resolveDefaultCssPreflight(opts?.cssPreflight, majorVersion);
|
|
4599
|
+
if (majorVersion !== 4 || cssPreflight === false || !resolveUniAppXOptions(ctx.uniAppX).enabled) return cssPreflight;
|
|
4600
|
+
const userCssPreflight = opts?.cssPreflight && typeof opts.cssPreflight === "object" ? opts.cssPreflight : void 0;
|
|
4601
|
+
return {
|
|
4602
|
+
...cssPreflight,
|
|
4603
|
+
"border-width": userCssPreflight && "border-width" in userCssPreflight ? cssPreflight["border-width"] ?? false : "0",
|
|
4604
|
+
"border-style": userCssPreflight && "border-style" in userCssPreflight ? cssPreflight["border-style"] ?? false : false,
|
|
4605
|
+
"border": userCssPreflight && "border" in userCssPreflight ? cssPreflight["border"] ?? false : false
|
|
4606
|
+
};
|
|
4607
|
+
}
|
|
4622
4608
|
async function clearTailwindcssPatcherCache(patcher, options) {
|
|
4623
4609
|
if (!patcher) return;
|
|
4624
4610
|
const cacheOptions = patcher.options?.cache;
|
|
@@ -4656,7 +4642,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4656
4642
|
logTailwindcssTarget(twPatcher, ctx.tailwindcssBasedir);
|
|
4657
4643
|
logRuntimeTailwindcssVersion(ctx.tailwindcssBasedir, twPatcher.packageInfo?.rootPath, twPatcher.packageInfo?.version);
|
|
4658
4644
|
if (opts?.__internalDeferMissingCssEntriesWarning !== true) warnMissingCssEntries(ctx, twPatcher);
|
|
4659
|
-
ctx.cssPreflight =
|
|
4645
|
+
ctx.cssPreflight = resolveContextCssPreflight(opts, ctx, twPatcher.majorVersion);
|
|
4660
4646
|
const cssCalcOptions = applyV4CssCalcDefaults(ctx.cssCalc, twPatcher);
|
|
4661
4647
|
ctx.cssCalc = cssCalcOptions;
|
|
4662
4648
|
const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, toCustomAttributesEntities(ctx.customAttributes), cssCalcOptions, twPatcher.majorVersion);
|
|
@@ -4713,4 +4699,4 @@ function shouldSkipJsTransform(rawSource, options) {
|
|
|
4713
4699
|
return !FAST_JS_TRANSFORM_HINT_RE.test(rawSource);
|
|
4714
4700
|
}
|
|
4715
4701
|
//#endregion
|
|
4716
|
-
export {
|
|
4702
|
+
export { collectRuntimeClassSet as _, vitePluginName as a, refreshTailwindRuntimeState as b, createAttributeMatcher as c, _defineProperty as d, isClassContextLiteralPath as f, toCustomAttributesEntities as g, traverse as h, pluginName as i, analyzeSource as l, babelParse as m, getCompilerContext as n, Parser as o, replaceWxml as p, resolveStyleOptionsFromContext as r, generateCode as s, shouldSkipJsTransform as t, JsTokenUpdater as u, createTailwindRuntimeReadyPromise as v, ensureRuntimeClassSet as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_defaults = require("./defaults-
|
|
4
|
-
require("./utils-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CM0TRa8V.js");
|
|
3
|
+
const require_defaults = require("./defaults-BPUuNYcD.js");
|
|
4
|
+
require("./utils-Dolmt8EO.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-CpQ6X4l6.js");
|
|
6
6
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_chunk.__toESM(node_process);
|
|
@@ -1239,7 +1239,6 @@ function _typeof(o) {
|
|
|
1239
1239
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
1240
1240
|
}, _typeof(o);
|
|
1241
1241
|
}
|
|
1242
|
-
var init_typeof = require_chunk.__esmMin((() => {}));
|
|
1243
1242
|
//#endregion
|
|
1244
1243
|
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
1245
1244
|
function toPrimitive(t, r) {
|
|
@@ -1252,19 +1251,12 @@ function toPrimitive(t, r) {
|
|
|
1252
1251
|
}
|
|
1253
1252
|
return ("string" === r ? String : Number)(t);
|
|
1254
1253
|
}
|
|
1255
|
-
var init_toPrimitive = require_chunk.__esmMin((() => {
|
|
1256
|
-
init_typeof();
|
|
1257
|
-
}));
|
|
1258
1254
|
//#endregion
|
|
1259
1255
|
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
1260
1256
|
function toPropertyKey(t) {
|
|
1261
1257
|
var i = toPrimitive(t, "string");
|
|
1262
1258
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1263
1259
|
}
|
|
1264
|
-
var init_toPropertyKey = require_chunk.__esmMin((() => {
|
|
1265
|
-
init_typeof();
|
|
1266
|
-
init_toPrimitive();
|
|
1267
|
-
}));
|
|
1268
1260
|
//#endregion
|
|
1269
1261
|
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
1270
1262
|
function _defineProperty(e, r, t) {
|
|
@@ -1275,12 +1267,8 @@ function _defineProperty(e, r, t) {
|
|
|
1275
1267
|
writable: !0
|
|
1276
1268
|
}) : e[r] = t, e;
|
|
1277
1269
|
}
|
|
1278
|
-
var init_defineProperty = require_chunk.__esmMin((() => {
|
|
1279
|
-
init_toPropertyKey();
|
|
1280
|
-
}));
|
|
1281
1270
|
//#endregion
|
|
1282
1271
|
//#region src/js/JsTokenUpdater.ts
|
|
1283
|
-
init_defineProperty();
|
|
1284
1272
|
/**
|
|
1285
1273
|
* Lightweight helper that batches updates to {@link MagicString}.
|
|
1286
1274
|
* It keeps the transformation logic out of the traversal code and makes
|
|
@@ -1319,7 +1307,6 @@ var JsTokenUpdater = class {
|
|
|
1319
1307
|
};
|
|
1320
1308
|
//#endregion
|
|
1321
1309
|
//#region src/js/module-graph/ignored-exports.ts
|
|
1322
|
-
init_defineProperty();
|
|
1323
1310
|
var IgnoredExportsTracker = class {
|
|
1324
1311
|
constructor(options) {
|
|
1325
1312
|
this.options = options;
|
|
@@ -1440,7 +1427,6 @@ var IgnoredExportsTracker = class {
|
|
|
1440
1427
|
};
|
|
1441
1428
|
//#endregion
|
|
1442
1429
|
//#region src/js/ModuleGraph.ts
|
|
1443
|
-
init_defineProperty();
|
|
1444
1430
|
var JsModuleGraph = class {
|
|
1445
1431
|
constructor(entry, graphOptions) {
|
|
1446
1432
|
_defineProperty(this, "modules", /* @__PURE__ */ new Map());
|
|
@@ -1615,7 +1601,6 @@ function maybeAddImportToken(imports, arg) {
|
|
|
1615
1601
|
}
|
|
1616
1602
|
//#endregion
|
|
1617
1603
|
//#region src/js/NodePathWalker.ts
|
|
1618
|
-
init_defineProperty();
|
|
1619
1604
|
const EMPTY_IGNORE_CALL_EXPRESSION_IDENTIFIERS = [];
|
|
1620
1605
|
const EMPTY_IMPORT_TOKENS = /* @__PURE__ */ new Set();
|
|
1621
1606
|
function NOOP_STRING_PATH_CALLBACK() {}
|
|
@@ -2334,7 +2319,6 @@ var BinTrieFlags;
|
|
|
2334
2319
|
})(BinTrieFlags || (BinTrieFlags = {}));
|
|
2335
2320
|
//#endregion
|
|
2336
2321
|
//#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode.js
|
|
2337
|
-
init_defineProperty();
|
|
2338
2322
|
var CharCodes$1;
|
|
2339
2323
|
(function(CharCodes) {
|
|
2340
2324
|
CharCodes[CharCodes["NUM"] = 35] = "NUM";
|
|
@@ -2705,7 +2689,6 @@ function determineBranch(decodeTree, current, nodeIndex, char) {
|
|
|
2705
2689
|
}
|
|
2706
2690
|
//#endregion
|
|
2707
2691
|
//#region ../../node_modules/.pnpm/htmlparser2@12.0.0/node_modules/htmlparser2/dist/Tokenizer.js
|
|
2708
|
-
init_defineProperty();
|
|
2709
2692
|
var CharCodes;
|
|
2710
2693
|
(function(CharCodes) {
|
|
2711
2694
|
CharCodes[CharCodes["Tab"] = 9] = "Tab";
|
|
@@ -3648,7 +3631,6 @@ var Tokenizer$1 = class {
|
|
|
3648
3631
|
};
|
|
3649
3632
|
//#endregion
|
|
3650
3633
|
//#region ../../node_modules/.pnpm/htmlparser2@12.0.0/node_modules/htmlparser2/dist/Parser.js
|
|
3651
|
-
init_defineProperty();
|
|
3652
3634
|
const { fromCodePoint } = String;
|
|
3653
3635
|
const formTags = new Set([
|
|
3654
3636
|
"input",
|
|
@@ -4258,7 +4240,6 @@ function isAllWhitespace(value) {
|
|
|
4258
4240
|
}
|
|
4259
4241
|
//#endregion
|
|
4260
4242
|
//#region src/wxml/Tokenizer.ts
|
|
4261
|
-
init_defineProperty();
|
|
4262
4243
|
var Tokenizer = class {
|
|
4263
4244
|
constructor() {
|
|
4264
4245
|
_defineProperty(this, "state", void 0);
|
|
@@ -4620,6 +4601,17 @@ function applyLoggerLevel(logLevel) {
|
|
|
4620
4601
|
}
|
|
4621
4602
|
//#endregion
|
|
4622
4603
|
//#region src/context/index.ts
|
|
4604
|
+
function resolveContextCssPreflight(opts, ctx, majorVersion) {
|
|
4605
|
+
const cssPreflight = require_defaults.resolveDefaultCssPreflight(opts?.cssPreflight, majorVersion);
|
|
4606
|
+
if (majorVersion !== 4 || cssPreflight === false || !require_tailwindcss.resolveUniAppXOptions(ctx.uniAppX).enabled) return cssPreflight;
|
|
4607
|
+
const userCssPreflight = opts?.cssPreflight && typeof opts.cssPreflight === "object" ? opts.cssPreflight : void 0;
|
|
4608
|
+
return {
|
|
4609
|
+
...cssPreflight,
|
|
4610
|
+
"border-width": userCssPreflight && "border-width" in userCssPreflight ? cssPreflight["border-width"] ?? false : "0",
|
|
4611
|
+
"border-style": userCssPreflight && "border-style" in userCssPreflight ? cssPreflight["border-style"] ?? false : false,
|
|
4612
|
+
"border": userCssPreflight && "border" in userCssPreflight ? cssPreflight["border"] ?? false : false
|
|
4613
|
+
};
|
|
4614
|
+
}
|
|
4623
4615
|
async function clearTailwindcssPatcherCache(patcher, options) {
|
|
4624
4616
|
if (!patcher) return;
|
|
4625
4617
|
const cacheOptions = patcher.options?.cache;
|
|
@@ -4657,7 +4649,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4657
4649
|
logTailwindcssTarget(twPatcher, ctx.tailwindcssBasedir);
|
|
4658
4650
|
logRuntimeTailwindcssVersion(ctx.tailwindcssBasedir, twPatcher.packageInfo?.rootPath, twPatcher.packageInfo?.version);
|
|
4659
4651
|
if (opts?.__internalDeferMissingCssEntriesWarning !== true) require_tailwindcss.warnMissingCssEntries(ctx, twPatcher);
|
|
4660
|
-
ctx.cssPreflight =
|
|
4652
|
+
ctx.cssPreflight = resolveContextCssPreflight(opts, ctx, twPatcher.majorVersion);
|
|
4661
4653
|
const cssCalcOptions = require_tailwindcss.applyV4CssCalcDefaults(ctx.cssCalc, twPatcher);
|
|
4662
4654
|
ctx.cssCalc = cssCalcOptions;
|
|
4663
4655
|
const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, toCustomAttributesEntities(ctx.customAttributes), cssCalcOptions, twPatcher.majorVersion);
|
|
@@ -4780,12 +4772,6 @@ Object.defineProperty(exports, "getCompilerContext", {
|
|
|
4780
4772
|
return getCompilerContext;
|
|
4781
4773
|
}
|
|
4782
4774
|
});
|
|
4783
|
-
Object.defineProperty(exports, "init_defineProperty", {
|
|
4784
|
-
enumerable: true,
|
|
4785
|
-
get: function() {
|
|
4786
|
-
return init_defineProperty;
|
|
4787
|
-
}
|
|
4788
|
-
});
|
|
4789
4775
|
Object.defineProperty(exports, "isClassContextLiteralPath", {
|
|
4790
4776
|
enumerable: true,
|
|
4791
4777
|
get: function() {
|
package/dist/presets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_chunk = require("./chunk-
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_utils = require("./utils-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
2
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
3
|
+
const require_v3_engine = require("./v3-engine-CM0TRa8V.js");
|
|
4
|
+
const require_utils = require("./utils-Dolmt8EO.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-CpQ6X4l6.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_chunk.__toESM(node_process);
|
|
@@ -132,7 +132,11 @@ function uniAppX(options) {
|
|
|
132
132
|
...installedTailwindDefaults ?? {},
|
|
133
133
|
resolve: resolvedResolve
|
|
134
134
|
},
|
|
135
|
-
cssPreflight: {
|
|
135
|
+
cssPreflight: {
|
|
136
|
+
"border-width": "0",
|
|
137
|
+
"border-style": false,
|
|
138
|
+
"border": false
|
|
139
|
+
},
|
|
136
140
|
cssPresetEnv: { features: { "custom-properties": { preserve: false } } },
|
|
137
141
|
...options.customAttributes ? { customAttributes: options.customAttributes } : {}
|
|
138
142
|
});
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gt as omitUndefined } from "./v3-engine-Cczrkzqt.mjs";
|
|
2
2
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-AWaPVF2B.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "node:path";
|
|
@@ -126,7 +126,11 @@ function uniAppX(options) {
|
|
|
126
126
|
...installedTailwindDefaults ?? {},
|
|
127
127
|
resolve: resolvedResolve
|
|
128
128
|
},
|
|
129
|
-
cssPreflight: {
|
|
129
|
+
cssPreflight: {
|
|
130
|
+
"border-width": "0",
|
|
131
|
+
"border-style": false,
|
|
132
|
+
"border": false
|
|
133
|
+
},
|
|
130
134
|
cssPresetEnv: { features: { "custom-properties": { preserve: false } } },
|
|
131
135
|
...options.customAttributes ? { customAttributes: options.customAttributes } : {}
|
|
132
136
|
});
|
package/dist/reset.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_chunk = require("./chunk-
|
|
5
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
6
6
|
let _weapp_tailwindcss_reset = require("@weapp-tailwindcss/reset");
|
|
7
7
|
_weapp_tailwindcss_reset = require_chunk.__toESM(_weapp_tailwindcss_reset);
|
|
8
8
|
Object.defineProperty(exports, "default", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as FULL_SOURCE_SCAN_EXTENSION_RE, ct as toPosixPath, nt as isFileMatchedByTailwindSourceEntries, ot as resolveSourceScanPath } from "./v3-engine-Cczrkzqt.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { extractSourceCandidates, resolveProjectSourceFiles } from "tailwindcss-patch";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CM0TRa8V.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
5
5
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _t as
|
|
1
|
+
import { _t as findNearestPackageRoot, dt as readInstalledPackageMajorVersion, f as runtimeSignaturePatchersSymbol, gt as omitUndefined, mt as normalizeStringListOption, ut as createTailwindcssPatcher, vt as findWorkspacePackageDir, yt as findWorkspaceRoot } from "./v3-engine-Cczrkzqt.mjs";
|
|
2
2
|
import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
require("./utils-
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CM0TRa8V.js");
|
|
3
|
+
require("./utils-Dolmt8EO.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_module = require("node:module");
|
|
6
6
|
let node_process = require("node:process");
|