weapp-tailwindcss 5.2.10 → 5.2.12
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/bundlers/shared/generator-css/user-css/source-fragments.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -1
- package/dist/cli.cjs +372 -293
- package/dist/cli.js +20 -11
- package/dist/{context-DbL0d-zB.js → context-DW4ukjx4.js} +19 -8
- package/dist/{context-C3TryIjF.cjs → context-zWINV_E2.cjs} +17 -11
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-imports-DfNC3e6a.cjs → css-imports-BFMU7Hpd.cjs} +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +1 -1
- package/dist/defaults.cjs +2 -0
- package/dist/defaults.js +2 -0
- package/dist/framework.cjs +1 -1
- package/dist/{generator-BLpOsd5O.js → generator-C2UFjlZ1.js} +36 -11
- package/dist/{generator-B0dCFlP1.cjs → generator-CwMI20jy.cjs} +37 -12
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-G6af_vyo.cjs → gulp-CWFxs2lE.cjs} +16 -13
- package/dist/{gulp-CB_GZky7.js → gulp-CltYkglj.js} +12 -9
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-gbPzjYTj.cjs → hmr-timing-BjOxhci8.cjs} +5 -5
- package/dist/{hmr-timing-CZu2ITV8.js → hmr-timing-D6JKLBCD.js} +35 -20
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{object-Bvy6-w9r.js → object-B-8IHefx.js} +4 -4
- package/dist/{object-C_Vr6_S5.cjs → object-DbHtAXRk.cjs} +4 -4
- package/dist/{options-zpZez7qe.cjs → options-CSqLm6U2.cjs} +2 -2
- package/dist/{pipeline-helpers-CtIXw85G.cjs → pipeline-helpers-Cj9ZzHaY.cjs} +25 -10
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +6 -5
- package/dist/presets.js +4 -3
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-CVvi-lCc.cjs → rolldown-runtime-Ctb5zv51.cjs} +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/{source-candidate-scan-signature-DFZlYd3t.js → source-candidate-scan-signature-DQZ_DkgW.js} +5 -4
- package/dist/{source-candidate-scan-signature-CTX7eBJX.cjs → source-candidate-scan-signature-uRHl5Ne9.cjs} +6 -5
- package/dist/{style-options-COpQc8fr.cjs → style-options-D0NukP02.cjs} +9 -4
- package/dist/{tailwindcss-LtnGCxF0.cjs → tailwindcss-B3lqgbln.cjs} +17 -13
- package/dist/{tailwindcss-2zdmASlM.js → tailwindcss-vbApajUH.js} +13 -10
- package/dist/{transform-BlsDWgjt.js → transform-52FLRu-0.js} +2 -2
- package/dist/{transform-9wbmvHcC.cjs → transform-BiHG42Rp.cjs} +2 -2
- package/dist/types/user-defined-options/general.d.ts +2 -0
- package/dist/{v4-generation-core-BVd_4348.cjs → v4-generation-core-2AuNMweK.cjs} +36 -21
- package/dist/{vite-DjU_5LY6.cjs → vite-BLB7vjKQ.cjs} +99 -46
- package/dist/{vite-cIvaBul_.js → vite-q3ilYV7x.js} +94 -41
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-BZGubvuJ.cjs → watch-dependencies-DLZDrWdH.cjs} +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +10 -9
- package/dist/weapp-tw-runtime-classset-loader.cjs +4 -3
- package/dist/{webpack-CvKV7U7L.js → webpack-DExB8tzB.js} +36 -18
- package/dist/{webpack-B9lRT1no.cjs → webpack-Jn4FJT6y.cjs} +40 -31
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/{wxml-CWJc0yY-.js → wxml-B7OAVpXJ.js} +10 -6
- package/dist/{wxml-DUIdXCVa.cjs → wxml-CQmBCjOR.cjs} +386 -311
- package/package.json +6 -6
package/dist/cli.js
CHANGED
|
@@ -50,13 +50,15 @@ new LRUCache({ max: 8 });
|
|
|
50
50
|
new LRUCache({ max: 32 });
|
|
51
51
|
createStyleHandler({
|
|
52
52
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
53
|
+
cssRemoveActivePseudoClass: true,
|
|
53
54
|
cssRemoveHoverPseudoClass: true,
|
|
55
|
+
cssRemoveFocusPseudoClass: true,
|
|
54
56
|
isMainChunk: true,
|
|
55
57
|
majorVersion: 4
|
|
56
58
|
});
|
|
57
59
|
createRequire(import.meta.url);
|
|
58
60
|
//#endregion
|
|
59
|
-
//#region \0@oxc-project+runtime@0.
|
|
61
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/typeof.js
|
|
60
62
|
function _typeof(o) {
|
|
61
63
|
"@babel/helpers - typeof";
|
|
62
64
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -66,7 +68,7 @@ function _typeof(o) {
|
|
|
66
68
|
}, _typeof(o);
|
|
67
69
|
}
|
|
68
70
|
//#endregion
|
|
69
|
-
//#region \0@oxc-project+runtime@0.
|
|
71
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPrimitive.js
|
|
70
72
|
function toPrimitive(t, r) {
|
|
71
73
|
if ("object" != _typeof(t) || !t) return t;
|
|
72
74
|
var e = t[Symbol.toPrimitive];
|
|
@@ -78,13 +80,13 @@ function toPrimitive(t, r) {
|
|
|
78
80
|
return ("string" === r ? String : Number)(t);
|
|
79
81
|
}
|
|
80
82
|
//#endregion
|
|
81
|
-
//#region \0@oxc-project+runtime@0.
|
|
83
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPropertyKey.js
|
|
82
84
|
function toPropertyKey(t) {
|
|
83
85
|
var i = toPrimitive(t, "string");
|
|
84
86
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
85
87
|
}
|
|
86
88
|
//#endregion
|
|
87
|
-
//#region \0@oxc-project+runtime@0.
|
|
89
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/defineProperty.js
|
|
88
90
|
function _defineProperty(e, r, t) {
|
|
89
91
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
90
92
|
value: t,
|
|
@@ -170,6 +172,8 @@ createDebug("[tailwindcss:runtime] ");
|
|
|
170
172
|
const runtimeLogDedupeHolder = globalThis;
|
|
171
173
|
runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ ?? (runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ = /* @__PURE__ */ new Set());
|
|
172
174
|
createRequire(import.meta.url);
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/context/compiler-context-cache.ts
|
|
173
177
|
const globalCacheHolder = globalThis;
|
|
174
178
|
globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map());
|
|
175
179
|
//#endregion
|
|
@@ -209,9 +213,10 @@ function createNameMatcher(list, { exact = false } = {}) {
|
|
|
209
213
|
const exactStrings = exact ? /* @__PURE__ */ new Set() : void 0;
|
|
210
214
|
const fuzzyStrings = [];
|
|
211
215
|
const regexList = [];
|
|
212
|
-
for (const item of list) if (typeof item === "string")
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
for (const item of list) if (typeof item === "string") {
|
|
217
|
+
if (exact) exactStrings.add(item);
|
|
218
|
+
else fuzzyStrings.push(item);
|
|
219
|
+
} else regexList.push(normaliseRegex(item));
|
|
215
220
|
if (exact) {
|
|
216
221
|
const exactStringCount = exactStrings?.size ?? 0;
|
|
217
222
|
if (exactStringCount === 1 && regexList.length === 0) {
|
|
@@ -1479,7 +1484,7 @@ function analyzeSource(ast, options, handler, collectModuleMetadata = true) {
|
|
|
1479
1484
|
const exportDeclarations = collectModuleMetadata ? /* @__PURE__ */ new Set() : EMPTY_EXPORT_DECLARATIONS;
|
|
1480
1485
|
const requireCallPaths = collectModuleMetadata ? [] : EMPTY_REQUIRE_CALL_PATHS;
|
|
1481
1486
|
const evalHandler = handler ?? getDefaultEvalHandler();
|
|
1482
|
-
|
|
1487
|
+
const traverseOptions = {
|
|
1483
1488
|
StringLiteral: { enter(p) {
|
|
1484
1489
|
if (isEvalPath(p.parentPath)) return;
|
|
1485
1490
|
targetPaths.push(p);
|
|
@@ -1527,7 +1532,10 @@ function analyzeSource(ast, options, handler, collectModuleMetadata = true) {
|
|
|
1527
1532
|
ExportDeclaration: { enter(p) {
|
|
1528
1533
|
exportDeclarations.add(p);
|
|
1529
1534
|
} }
|
|
1530
|
-
} : {}
|
|
1535
|
+
} : {}
|
|
1536
|
+
};
|
|
1537
|
+
traverse(ast, {
|
|
1538
|
+
...traverseOptions,
|
|
1531
1539
|
noScope: !needScope
|
|
1532
1540
|
});
|
|
1533
1541
|
return {
|
|
@@ -2145,7 +2153,7 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
2145
2153
|
const formattedSources = (options.sources && options.sources.length > 0 ? options.sources : DEFAULT_VSCODE_SOURCES).map(formatSource).filter((statement) => Boolean(statement));
|
|
2146
2154
|
const cssImport = toRelativeImport(outputPath, cssEntryPath);
|
|
2147
2155
|
const separator = formattedSources.length > 0 ? [""] : [];
|
|
2148
|
-
|
|
2156
|
+
const content = [
|
|
2149
2157
|
"/*",
|
|
2150
2158
|
" * Auto-generated by weapp-tailwindcss.",
|
|
2151
2159
|
" * This file exists solely to activate Tailwind CSS IntelliSense in VS Code.",
|
|
@@ -2157,7 +2165,8 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
2157
2165
|
...separator,
|
|
2158
2166
|
`@import '${cssImport}';`,
|
|
2159
2167
|
""
|
|
2160
|
-
].filter((line, idx, arr) => !(line === "" && arr[idx - 1] === "")).join("\n")
|
|
2168
|
+
].filter((line, idx, arr) => !(line === "" && arr[idx - 1] === "")).join("\n");
|
|
2169
|
+
await writeFile(outputPath, `${content}\n`, "utf8");
|
|
2161
2170
|
return {
|
|
2162
2171
|
outputPath,
|
|
2163
2172
|
cssEntryPath
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveMpxPlatform } from "./framework.js";
|
|
2
|
-
import { It as shouldUseUniAppWebRpxCompatibility, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, Rt as resolveValidTailwindV4Candidates$1, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveBooleanObjectOption, yt as createTailwindV4Engine$1 } from "./generator-
|
|
3
|
-
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-
|
|
2
|
+
import { It as shouldUseUniAppWebRpxCompatibility, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, Rt as resolveValidTailwindV4Candidates$1, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveBooleanObjectOption, yt as createTailwindV4Engine$1 } from "./generator-C2UFjlZ1.js";
|
|
3
|
+
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-vbApajUH.js";
|
|
4
4
|
import { i as isMap, n as defuOverrideArray } from "./utils-MVwpU07P.js";
|
|
5
|
-
import { _ as md5Hash, a as jsHandler, c as getReplacementCacheStore, d as decodeUnicode2, f as resolveClassNameTransformWithResult, l as jsStringEscape, m as createDebug, s as getReplacement, t as createTemplateHandler } from "./wxml-
|
|
5
|
+
import { _ as md5Hash, a as jsHandler, c as getReplacementCacheStore, d as decodeUnicode2, f as resolveClassNameTransformWithResult, l as jsStringEscape, m as createDebug, s as getReplacement, t as createTemplateHandler } from "./wxml-B7OAVpXJ.js";
|
|
6
6
|
import { getDefaultOptions, resolveDefaultCssPreflight } from "./defaults.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import path from "node:path";
|
|
@@ -235,7 +235,8 @@ async function collectTailwindV4GeneratorClassSet(tailwindRuntime) {
|
|
|
235
235
|
scanSources: true,
|
|
236
236
|
target: "web"
|
|
237
237
|
});
|
|
238
|
-
const
|
|
238
|
+
const designSystem = await loadTailwindV4DesignSystem(source);
|
|
239
|
+
const classSet = resolveValidTailwindV4Candidates$1(designSystem, generated.classSet, { ...source.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: source.bareArbitraryValues } });
|
|
239
240
|
debug("runtime class set resolved via tailwindcss v4 generator source scan, raw=%d valid=%d", generated.classSet.size, classSet.size);
|
|
240
241
|
return classSet;
|
|
241
242
|
} catch (error) {
|
|
@@ -389,7 +390,7 @@ const PAREN_CONTENT_RE = /\(([^)]+)\)/u;
|
|
|
389
390
|
const AT_LOCATION_RE = /at\s+(\S.*)$/u;
|
|
390
391
|
const TRAILING_LINE_COL_RE = /:\d+(?::\d+)?$/u;
|
|
391
392
|
const DEFAULT_COMPILER_CONTEXT_CACHE_MAX = 32;
|
|
392
|
-
const DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX =
|
|
393
|
+
const DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX = 64;
|
|
393
394
|
const globalCacheHolder = globalThis;
|
|
394
395
|
const compilerContextCache = globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map());
|
|
395
396
|
const compilerContextKeyCacheByOptions = /* @__PURE__ */ new WeakMap();
|
|
@@ -578,7 +579,8 @@ function createCompilerContextCacheKey(opts) {
|
|
|
578
579
|
const keyStore = getCompilerContextKeyCacheStore(opts);
|
|
579
580
|
const cached = keyStore.get(runtimeCacheScopeKey);
|
|
580
581
|
if (cached !== void 0) return cached;
|
|
581
|
-
const
|
|
582
|
+
const normalized = normalizeOptionsValue(getRuntimeCacheScopeValue(opts));
|
|
583
|
+
const cacheKey = md5Hash(serializeNormalizedValue(normalized));
|
|
582
584
|
touchMapValue(keyStore, runtimeCacheScopeKey, cacheKey);
|
|
583
585
|
pruneMapToMaxSize(keyStore, resolveCompilerContextCacheMax(DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX));
|
|
584
586
|
return cacheKey;
|
|
@@ -977,12 +979,13 @@ function normalizeStyleHandlerMajorVersion(majorVersion) {
|
|
|
977
979
|
}
|
|
978
980
|
function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
979
981
|
const resolvedUniAppXOptions = resolveUniAppXOptions(ctx.uniAppX);
|
|
980
|
-
const
|
|
982
|
+
const generatorOptions = normalizeWeappTailwindcssGeneratorOptions(ctx.generator, {
|
|
981
983
|
appType: ctx.appType,
|
|
982
984
|
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
983
985
|
tailwindcssMajorVersion,
|
|
984
986
|
uniAppX: resolvedUniAppXOptions
|
|
985
|
-
})
|
|
987
|
+
});
|
|
988
|
+
const branch = resolveGeneratorRuntimeBranch(generatorOptions, {
|
|
986
989
|
appType: ctx.appType,
|
|
987
990
|
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
988
991
|
tailwindcssMajorVersion,
|
|
@@ -998,7 +1001,9 @@ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
|
998
1001
|
cssSelectorReplacement: ctx.cssOptions?.cssSelectorReplacement ?? ctx.cssSelectorReplacement,
|
|
999
1002
|
rem2rpx,
|
|
1000
1003
|
cssRemoveProperty: ctx.cssOptions?.cssRemoveProperty ?? ctx.cssRemoveProperty,
|
|
1004
|
+
cssRemoveActivePseudoClass: ctx.cssOptions?.cssRemoveActivePseudoClass ?? ctx.cssRemoveActivePseudoClass,
|
|
1001
1005
|
cssRemoveHoverPseudoClass: ctx.cssOptions?.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass,
|
|
1006
|
+
cssRemoveFocusPseudoClass: ctx.cssOptions?.cssRemoveFocusPseudoClass ?? ctx.cssRemoveFocusPseudoClass,
|
|
1002
1007
|
tailwindcssV4GradientFallback: ctx.cssOptions?.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback,
|
|
1003
1008
|
cssPresetEnv: ctx.cssOptions?.cssPresetEnv ?? ctx.cssPresetEnv,
|
|
1004
1009
|
atRules: ctx.cssOptions?.atRules ?? ctx.atRules,
|
|
@@ -1020,7 +1025,9 @@ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
|
1020
1025
|
rem2rpx: cssOptions.rem2rpx,
|
|
1021
1026
|
...hasCssOptions ? { cssOptions } : {},
|
|
1022
1027
|
cssRemoveProperty: cssOptions.cssRemoveProperty,
|
|
1028
|
+
cssRemoveActivePseudoClass: cssOptions.cssRemoveActivePseudoClass,
|
|
1023
1029
|
cssRemoveHoverPseudoClass: cssOptions.cssRemoveHoverPseudoClass,
|
|
1030
|
+
cssRemoveFocusPseudoClass: cssOptions.cssRemoveFocusPseudoClass,
|
|
1024
1031
|
tailwindcssV4GradientFallback: cssOptions.tailwindcssV4GradientFallback,
|
|
1025
1032
|
cssPresetEnv: cssOptions.cssPresetEnv,
|
|
1026
1033
|
atRules: cssOptions.atRules,
|
|
@@ -1110,7 +1117,9 @@ function syncCssOptionsToLegacyFields(ctx) {
|
|
|
1110
1117
|
ctx.cssSelectorReplacement = cssOptions.cssSelectorReplacement ?? ctx.cssSelectorReplacement;
|
|
1111
1118
|
ctx.rem2rpx = cssOptions.rem2rpx ?? ctx.rem2rpx;
|
|
1112
1119
|
ctx.cssRemoveProperty = cssOptions.cssRemoveProperty ?? ctx.cssRemoveProperty;
|
|
1120
|
+
ctx.cssRemoveActivePseudoClass = cssOptions.cssRemoveActivePseudoClass ?? ctx.cssRemoveActivePseudoClass;
|
|
1113
1121
|
ctx.cssRemoveHoverPseudoClass = cssOptions.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass;
|
|
1122
|
+
ctx.cssRemoveFocusPseudoClass = cssOptions.cssRemoveFocusPseudoClass ?? ctx.cssRemoveFocusPseudoClass;
|
|
1114
1123
|
ctx.tailwindcssV4GradientFallback = cssOptions.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback;
|
|
1115
1124
|
ctx.cssPresetEnv = cssOptions.cssPresetEnv ?? ctx.cssPresetEnv;
|
|
1116
1125
|
ctx.atRules = cssOptions.atRules ?? ctx.atRules;
|
|
@@ -1132,7 +1141,9 @@ function syncLegacyFieldsToCssOptions(ctx) {
|
|
|
1132
1141
|
cssSelectorReplacement: ctx.cssSelectorReplacement,
|
|
1133
1142
|
rem2rpx: ctx.rem2rpx,
|
|
1134
1143
|
cssRemoveProperty: ctx.cssRemoveProperty,
|
|
1144
|
+
cssRemoveActivePseudoClass: ctx.cssRemoveActivePseudoClass,
|
|
1135
1145
|
cssRemoveHoverPseudoClass: ctx.cssRemoveHoverPseudoClass,
|
|
1146
|
+
cssRemoveFocusPseudoClass: ctx.cssRemoveFocusPseudoClass,
|
|
1136
1147
|
tailwindcssV4GradientFallback: ctx.tailwindcssV4GradientFallback,
|
|
1137
1148
|
cssPresetEnv: ctx.cssPresetEnv,
|
|
1138
1149
|
atRules: ctx.atRules,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_object = require("./object-
|
|
5
|
-
const require_options = require("./options-
|
|
3
|
+
const require_generator = require("./generator-CwMI20jy.cjs");
|
|
4
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
|
+
const require_options = require("./options-CSqLm6U2.cjs");
|
|
6
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
7
|
-
const require_wxml = require("./wxml-
|
|
7
|
+
const require_wxml = require("./wxml-CQmBCjOR.cjs");
|
|
8
8
|
const require_defaults = require("./defaults.cjs");
|
|
9
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
10
|
-
const require_style_options = require("./style-options-
|
|
9
|
+
const require_tailwindcss = require("./tailwindcss-B3lqgbln.cjs");
|
|
10
|
+
const require_style_options = require("./style-options-D0NukP02.cjs");
|
|
11
11
|
let node_path = require("node:path");
|
|
12
12
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
13
13
|
let node_process = require("node:process");
|
|
@@ -241,7 +241,8 @@ async function collectTailwindV4GeneratorClassSet(tailwindRuntime) {
|
|
|
241
241
|
scanSources: true,
|
|
242
242
|
target: "web"
|
|
243
243
|
});
|
|
244
|
-
const
|
|
244
|
+
const designSystem = await (0, _tailwindcss_mangle_engine.loadTailwindV4DesignSystem)(source);
|
|
245
|
+
const classSet = (0, _tailwindcss_mangle_engine.resolveValidTailwindV4Candidates)(designSystem, generated.classSet, { ...source.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: source.bareArbitraryValues } });
|
|
245
246
|
debug("runtime class set resolved via tailwindcss v4 generator source scan, raw=%d valid=%d", generated.classSet.size, classSet.size);
|
|
246
247
|
return classSet;
|
|
247
248
|
} catch (error) {
|
|
@@ -395,7 +396,7 @@ const PAREN_CONTENT_RE = /\(([^)]+)\)/u;
|
|
|
395
396
|
const AT_LOCATION_RE = /at\s+(\S.*)$/u;
|
|
396
397
|
const TRAILING_LINE_COL_RE = /:\d+(?::\d+)?$/u;
|
|
397
398
|
const DEFAULT_COMPILER_CONTEXT_CACHE_MAX = 32;
|
|
398
|
-
const DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX =
|
|
399
|
+
const DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX = 64;
|
|
399
400
|
const globalCacheHolder = globalThis;
|
|
400
401
|
const compilerContextCache = globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map());
|
|
401
402
|
const compilerContextKeyCacheByOptions = /* @__PURE__ */ new WeakMap();
|
|
@@ -584,7 +585,8 @@ function createCompilerContextCacheKey(opts) {
|
|
|
584
585
|
const keyStore = getCompilerContextKeyCacheStore(opts);
|
|
585
586
|
const cached = keyStore.get(runtimeCacheScopeKey);
|
|
586
587
|
if (cached !== void 0) return cached;
|
|
587
|
-
const
|
|
588
|
+
const normalized = normalizeOptionsValue(getRuntimeCacheScopeValue(opts));
|
|
589
|
+
const cacheKey = (0, _weapp_tailwindcss_shared_node.md5)(serializeNormalizedValue(normalized));
|
|
588
590
|
touchMapValue(keyStore, runtimeCacheScopeKey, cacheKey);
|
|
589
591
|
pruneMapToMaxSize(keyStore, resolveCompilerContextCacheMax(DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX));
|
|
590
592
|
return cacheKey;
|
|
@@ -617,7 +619,7 @@ function toCustomAttributesEntities(customAttributes) {
|
|
|
617
619
|
return Object.entries(customAttributes);
|
|
618
620
|
}
|
|
619
621
|
//#endregion
|
|
620
|
-
//#region ../../node_modules/.pnpm/oxc-walker@1.1.1_@oxc-project+types@0.
|
|
622
|
+
//#region ../../node_modules/.pnpm/oxc-walker@1.1.1_@oxc-project+types@0.143.0_oxc-parser@0.143.0_rolldown@1.2.0/node_modules/oxc-walker/dist/index.mjs
|
|
621
623
|
function isNode(v) {
|
|
622
624
|
return v !== null && typeof v === "object" && typeof v.type === "string";
|
|
623
625
|
}
|
|
@@ -1220,7 +1222,9 @@ function syncCssOptionsToLegacyFields(ctx) {
|
|
|
1220
1222
|
ctx.cssSelectorReplacement = cssOptions.cssSelectorReplacement ?? ctx.cssSelectorReplacement;
|
|
1221
1223
|
ctx.rem2rpx = cssOptions.rem2rpx ?? ctx.rem2rpx;
|
|
1222
1224
|
ctx.cssRemoveProperty = cssOptions.cssRemoveProperty ?? ctx.cssRemoveProperty;
|
|
1225
|
+
ctx.cssRemoveActivePseudoClass = cssOptions.cssRemoveActivePseudoClass ?? ctx.cssRemoveActivePseudoClass;
|
|
1223
1226
|
ctx.cssRemoveHoverPseudoClass = cssOptions.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass;
|
|
1227
|
+
ctx.cssRemoveFocusPseudoClass = cssOptions.cssRemoveFocusPseudoClass ?? ctx.cssRemoveFocusPseudoClass;
|
|
1224
1228
|
ctx.tailwindcssV4GradientFallback = cssOptions.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback;
|
|
1225
1229
|
ctx.cssPresetEnv = cssOptions.cssPresetEnv ?? ctx.cssPresetEnv;
|
|
1226
1230
|
ctx.atRules = cssOptions.atRules ?? ctx.atRules;
|
|
@@ -1242,7 +1246,9 @@ function syncLegacyFieldsToCssOptions(ctx) {
|
|
|
1242
1246
|
cssSelectorReplacement: ctx.cssSelectorReplacement,
|
|
1243
1247
|
rem2rpx: ctx.rem2rpx,
|
|
1244
1248
|
cssRemoveProperty: ctx.cssRemoveProperty,
|
|
1249
|
+
cssRemoveActivePseudoClass: ctx.cssRemoveActivePseudoClass,
|
|
1245
1250
|
cssRemoveHoverPseudoClass: ctx.cssRemoveHoverPseudoClass,
|
|
1251
|
+
cssRemoveFocusPseudoClass: ctx.cssRemoveFocusPseudoClass,
|
|
1246
1252
|
tailwindcssV4GradientFallback: ctx.tailwindcssV4GradientFallback,
|
|
1247
1253
|
cssPresetEnv: ctx.cssPresetEnv,
|
|
1248
1254
|
atRules: ctx.atRules,
|
package/dist/core.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_context = require("./context-
|
|
2
|
+
const require_context = require("./context-zWINV_E2.cjs");
|
|
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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-
|
|
1
|
+
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-DW4ukjx4.js";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
4
4
|
//#region src/bundlers/shared/css-imports.ts
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_rolldown_runtime = require("../rolldown-runtime-
|
|
5
|
+
const require_rolldown_runtime = require("../rolldown-runtime-Ctb5zv51.cjs");
|
|
6
6
|
let _weapp_tailwindcss_postcss_css_macro_postcss = require("@weapp-tailwindcss/postcss/css-macro/postcss");
|
|
7
7
|
_weapp_tailwindcss_postcss_css_macro_postcss = require_rolldown_runtime.__toESM(_weapp_tailwindcss_postcss_css_macro_postcss, 1);
|
|
8
8
|
Object.defineProperty(exports, "CSS_MACRO_POSTCSS_PLUGIN_NAME", {
|
package/dist/css-macro.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_auto = require("./auto-DtU6f3X6.cjs");
|
|
3
3
|
require("./utils-CuKLf1Zv.cjs");
|
|
4
4
|
let tailwindcss_plugin = require("tailwindcss/plugin");
|
package/dist/defaults.cjs
CHANGED
|
@@ -100,7 +100,9 @@ function getDefaultOptions() {
|
|
|
100
100
|
},
|
|
101
101
|
postcssOptions: {},
|
|
102
102
|
cssRemoveProperty: true,
|
|
103
|
+
cssRemoveActivePseudoClass: true,
|
|
103
104
|
cssRemoveHoverPseudoClass: true,
|
|
105
|
+
cssRemoveFocusPseudoClass: true,
|
|
104
106
|
ignoreCallExpressionIdentifiers: [],
|
|
105
107
|
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
106
108
|
replaceRuntimePackages: false,
|
package/dist/defaults.js
CHANGED
|
@@ -98,7 +98,9 @@ function getDefaultOptions() {
|
|
|
98
98
|
},
|
|
99
99
|
postcssOptions: {},
|
|
100
100
|
cssRemoveProperty: true,
|
|
101
|
+
cssRemoveActivePseudoClass: true,
|
|
101
102
|
cssRemoveHoverPseudoClass: true,
|
|
103
|
+
cssRemoveFocusPseudoClass: true,
|
|
102
104
|
ignoreCallExpressionIdentifiers: [],
|
|
103
105
|
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
104
106
|
replaceRuntimePackages: false,
|
package/dist/framework.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.js";
|
|
2
2
|
import { c as withCssMacroStyleOptions, i as hasCssMacroTailwindV4Source, o as transformCssMacroCss, s as transformCssMacroTailwindV4Source, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.js";
|
|
3
|
-
import { n as _defineProperty, t as omitUndefined } from "./object-
|
|
3
|
+
import { n as _defineProperty, t as omitUndefined } from "./object-B-8IHefx.js";
|
|
4
4
|
import "./utils-MVwpU07P.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
9
9
|
import { createTailwindGenerationSession, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
10
|
-
import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
10
|
+
import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, selectorContainsPseudoClass, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
11
11
|
import { LRUCache } from "lru-cache";
|
|
12
12
|
import { stat } from "node:fs/promises";
|
|
13
13
|
import micromatch from "micromatch";
|
|
@@ -105,7 +105,7 @@ function restoreRpxLengthCssSelectors(css, restoreCandidates) {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12e3;
|
|
108
|
-
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX =
|
|
108
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 2097152;
|
|
109
109
|
const incrementalGenerateCache = new LRUCache({ max: 8 });
|
|
110
110
|
const incrementalGenerateTaskCache = new LRUCache({ max: 32 });
|
|
111
111
|
function collectCandidates(candidates) {
|
|
@@ -286,7 +286,9 @@ function resolveCssMacroTailwindV4Source(source) {
|
|
|
286
286
|
//#region src/tailwindcss/v4-engine/miniprogram.ts
|
|
287
287
|
const defaultStyleHandler = createStyleHandler({
|
|
288
288
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
289
|
+
cssRemoveActivePseudoClass: true,
|
|
289
290
|
cssRemoveHoverPseudoClass: true,
|
|
291
|
+
cssRemoveFocusPseudoClass: true,
|
|
290
292
|
isMainChunk: true,
|
|
291
293
|
majorVersion: 4
|
|
292
294
|
});
|
|
@@ -306,7 +308,9 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
306
308
|
const protectedCss = protectDynamicColorMixAlpha(compatibleCss, { customPropertyValues });
|
|
307
309
|
const result = await defaultStyleHandler(protectedCss.css, {
|
|
308
310
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
311
|
+
cssRemoveActivePseudoClass: true,
|
|
309
312
|
cssRemoveHoverPseudoClass: true,
|
|
313
|
+
cssRemoveFocusPseudoClass: true,
|
|
310
314
|
isMainChunk: true,
|
|
311
315
|
majorVersion: 4,
|
|
312
316
|
...options
|
|
@@ -2471,14 +2475,28 @@ function isCommentOnlyCss(source) {
|
|
|
2471
2475
|
return false;
|
|
2472
2476
|
}
|
|
2473
2477
|
}
|
|
2474
|
-
function
|
|
2475
|
-
|
|
2478
|
+
function removeMiniProgramInteractiveSelectors(source, options = {
|
|
2479
|
+
active: true,
|
|
2480
|
+
hover: true
|
|
2481
|
+
}) {
|
|
2482
|
+
const removeActive = options.active === true;
|
|
2483
|
+
const removeHover = options.hover === true;
|
|
2484
|
+
const removeFocus = options.focus === true;
|
|
2485
|
+
const unsupportedPseudoClasses = [
|
|
2486
|
+
...removeActive ? [":active"] : [],
|
|
2487
|
+
...removeHover ? [":hover"] : [],
|
|
2488
|
+
...removeFocus ? [":focus"] : []
|
|
2489
|
+
];
|
|
2490
|
+
if (unsupportedPseudoClasses.length === 0 || !source.includes(":active") && !source.includes(":hover") && !source.includes(":focus")) return source;
|
|
2476
2491
|
try {
|
|
2477
2492
|
const root = postcss.parse(source);
|
|
2478
2493
|
let changed = false;
|
|
2479
2494
|
root.walkRules((rule) => {
|
|
2480
2495
|
const selectors = rule.selectors ?? [rule.selector];
|
|
2481
|
-
const keptSelectors = selectors.filter((selector) =>
|
|
2496
|
+
const keptSelectors = selectors.filter((selector) => {
|
|
2497
|
+
if (!unsupportedPseudoClasses.some((pseudoClass) => selector.includes(pseudoClass))) return true;
|
|
2498
|
+
return !selectorContainsPseudoClass(selector, unsupportedPseudoClasses);
|
|
2499
|
+
});
|
|
2482
2500
|
if (keptSelectors.length === selectors.length) return;
|
|
2483
2501
|
changed = true;
|
|
2484
2502
|
if (keptSelectors.length === 0) {
|
|
@@ -2499,7 +2517,11 @@ function removeMiniProgramHoverSelectors(source, enabled = true) {
|
|
|
2499
2517
|
}
|
|
2500
2518
|
}
|
|
2501
2519
|
function removeProcessedMiniProgramUnsupportedCss(source, options) {
|
|
2502
|
-
return
|
|
2520
|
+
return removeMiniProgramInteractiveSelectors(removeUnsupportedMiniProgramAtRules(source), {
|
|
2521
|
+
active: options.cssRemoveActivePseudoClass ?? true,
|
|
2522
|
+
hover: options.cssRemoveHoverPseudoClass ?? true,
|
|
2523
|
+
focus: options.cssRemoveFocusPseudoClass ?? true
|
|
2524
|
+
});
|
|
2503
2525
|
}
|
|
2504
2526
|
function unwrapMiniProgramCascadeLayers(source) {
|
|
2505
2527
|
if (!source.includes("@layer")) return source;
|
|
@@ -2635,7 +2657,8 @@ function findWorkspaceRoot(startDir) {
|
|
|
2635
2657
|
if (!startDir) return;
|
|
2636
2658
|
let current = path.resolve(startDir);
|
|
2637
2659
|
while (true) {
|
|
2638
|
-
|
|
2660
|
+
const workspaceFile = path.join(current, "pnpm-workspace.yaml");
|
|
2661
|
+
if (existsSync(workspaceFile)) return current;
|
|
2639
2662
|
const parent = path.dirname(current);
|
|
2640
2663
|
if (parent === current) return;
|
|
2641
2664
|
current = parent;
|
|
@@ -2645,7 +2668,8 @@ function findNearestPackageRoot(startDir) {
|
|
|
2645
2668
|
if (!startDir) return;
|
|
2646
2669
|
let current = path.resolve(startDir);
|
|
2647
2670
|
while (true) {
|
|
2648
|
-
|
|
2671
|
+
const pkgPath = path.join(current, "package.json");
|
|
2672
|
+
if (existsSync(pkgPath)) return current;
|
|
2649
2673
|
const parent = path.dirname(current);
|
|
2650
2674
|
if (parent === current) return;
|
|
2651
2675
|
current = parent;
|
|
@@ -3047,7 +3071,8 @@ function resolveTailwindV4SourceOptionsFromRuntime(runtime) {
|
|
|
3047
3071
|
}));
|
|
3048
3072
|
}
|
|
3049
3073
|
function resolveTailwindV4Source$1(options) {
|
|
3050
|
-
|
|
3074
|
+
const normalizedOptions = normalizeTailwindV4SourceOptions(options);
|
|
3075
|
+
return resolveTailwindV4Source(normalizedOptions);
|
|
3051
3076
|
}
|
|
3052
3077
|
function resolveTailwindV4SourceFromRuntimeOptions(options) {
|
|
3053
3078
|
const projectRoot = options?.projectRoot ?? process.cwd();
|
|
@@ -3199,4 +3224,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
|
3199
3224
|
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3200
3225
|
}
|
|
3201
3226
|
//#endregion
|
|
3202
|
-
export { hasTailwindSourceDirectives as $, transformGeneratorUserCss as A, toPosixPath as At, stripMiniProgramCssSpecificityPlaceholders as B, findWorkspacePackageDir as C, expandTailwindSourceEntries as Ct, resolveTailwindcssOptions as D, resolveCssSourceEntries as Dt, normalizeTailwindcssRuntimeOptions as E, parseConfigParam as Et, stripUnmatchedTailwindSourceMediaCloseFragments as F, filterUnsupportedMiniProgramTailwindV4Candidates as Ft, extractGeneratedCssForUserLayerSelectors as G, filterApplyOnlyGeneratedCss as H, finalizeMiniProgramCss as I, shouldUseUniAppWebRpxCompatibility as It, preferScopedGeneratedCssRules as J, hasUserCssLayerBlocks as K, hasMiniProgramCssSpecificityPlaceholders as L, loadTailwindV4DesignSystem as Lt,
|
|
3227
|
+
export { hasTailwindSourceDirectives as $, transformGeneratorUserCss as A, toPosixPath as At, stripMiniProgramCssSpecificityPlaceholders as B, findWorkspacePackageDir as C, expandTailwindSourceEntries as Ct, resolveTailwindcssOptions as D, resolveCssSourceEntries as Dt, normalizeTailwindcssRuntimeOptions as E, parseConfigParam as Et, stripUnmatchedTailwindSourceMediaCloseFragments as F, filterUnsupportedMiniProgramTailwindV4Candidates as Ft, extractGeneratedCssForUserLayerSelectors as G, filterApplyOnlyGeneratedCss as H, finalizeMiniProgramCss as I, shouldUseUniAppWebRpxCompatibility as It, preferScopedGeneratedCssRules as J, hasUserCssLayerBlocks as K, hasMiniProgramCssSpecificityPlaceholders as L, loadTailwindV4DesignSystem as Lt, removeMiniProgramInteractiveSelectors as M, transformTailwindV4CssToWeapp as Mt, removeTailwindV4GeneratorAtRules as N, resolveCssMacroTailwindV4Source as Nt, normalizeStringListOption as O, resolveSourceScanPath as Ot, stripTailwindSourceMediaFragments as P, getTailwindV4IncrementalGenerateCacheStats as Pt, hasTailwindRootDirectives as Q, pruneMiniProgramGeneratedCss as R, resolveValidTailwindV4Candidates$1 as Rt, findNearestPackageRoot as S, createTailwindSourceEntryMatcher as St, normalizeExtendLengthUnits as T, normalizeLegacyContentEntries as Tt, normalizeEmptyTailwindCustomVariants as U, removeTailwindV4GeneratedUserCssArtifacts as V, shouldFilterApplyOnlyGeneratedCss as W, hasTailwindApplyDirective as X, hasLocalCssImport as Y, hasTailwindNonRootGenerationDirectives as Z, upsertTailwindV4CssSource as _, normalizeConfigDirective as _t, resolveGeneratorRuntimeBranch as a, resolveCssEntrySource as at, isTailwindV4CssEntry as b, FULL_SOURCE_SCAN_EXTENSION_RE as bt, shouldUseNativeAppCssBranch as c, createCssAppend as ct, resolveTailwindV4SourceFromRuntime as d, splitGeneratorPlaceholderCssBySourceOrder as dt, normalizeTailwindConfigDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, splitTailwindGeneratedCssByBanner as ft, removeTailwindV4CssSource as g, stripTailwindBanners as gt, hasConfiguredTailwindV4CssRoots as h, stripTailwindBanner as ht, normalizeWeappTailwindcssGeneratorOptions as i, removeTailwindSourceDirectives as it, isCommentOnlyCss as j, transformTailwindV4CssByTarget as jt, resolveBooleanObjectOption as k, resolveTailwindV4CssSourceBase as kt, resolveUniUtsPlatform as l, hasTailwindGeneratedCss as lt, filterTailwindV4CssSourceRoots as m, stripGeneratorPlaceholderMarkers as mt, createWeappTailwindcssGeneratorFromRuntime as n, normalizeTailwindSourceForGenerator as nt, resolveRuntimeBranch as o, GENERATOR_PLACEHOLDER_MARKER_RE as ot, resolveTailwindV4SourceOptionsFromRuntime as p, splitTailwindV4GeneratedCssBySourceOrder as pt, splitUserCssLayerBlocks as q, resolveTailwindSourceFromRuntime as r, parseImportRequest as rt, shouldUseMiniProgramCssBranch as s, VITE_MARKER_RE as st, createWeappTailwindcssGenerator as t, normalizeTailwindSourceDirectives as tt, resolveTailwindV4Source$1 as u, hasTailwindGeneratedCssMarkers as ut, groupCssEntriesByBase as v, prependConfigDirective as vt, findWorkspaceRoot as w, isFileMatchedByTailwindSourceEntries as wt, normalizeCssEntries as x, FULL_SOURCE_SCAN_PATTERN as xt, guessBasedirFromEntries as y, createTailwindV4Engine$1 as yt, removeUnsupportedMiniProgramAtRules as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
3
|
require("./auto-DtU6f3X6.cjs");
|
|
4
|
-
const require_object = require("./object-
|
|
4
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
5
|
require("./utils-CuKLf1Zv.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
@@ -110,7 +110,7 @@ function restoreRpxLengthCssSelectors(css, restoreCandidates) {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12e3;
|
|
113
|
-
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX =
|
|
113
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 2097152;
|
|
114
114
|
const incrementalGenerateCache = new lru_cache.LRUCache({ max: 8 });
|
|
115
115
|
const incrementalGenerateTaskCache = new lru_cache.LRUCache({ max: 32 });
|
|
116
116
|
function collectCandidates(candidates) {
|
|
@@ -291,7 +291,9 @@ function resolveCssMacroTailwindV4Source(source) {
|
|
|
291
291
|
//#region src/tailwindcss/v4-engine/miniprogram.ts
|
|
292
292
|
const defaultStyleHandler = (0, _weapp_tailwindcss_postcss.createStyleHandler)({
|
|
293
293
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
294
|
+
cssRemoveActivePseudoClass: true,
|
|
294
295
|
cssRemoveHoverPseudoClass: true,
|
|
296
|
+
cssRemoveFocusPseudoClass: true,
|
|
295
297
|
isMainChunk: true,
|
|
296
298
|
majorVersion: 4
|
|
297
299
|
});
|
|
@@ -311,7 +313,9 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
311
313
|
const protectedCss = (0, _weapp_tailwindcss_postcss.protectDynamicColorMixAlpha)(compatibleCss, { customPropertyValues });
|
|
312
314
|
const result = await defaultStyleHandler(protectedCss.css, {
|
|
313
315
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
316
|
+
cssRemoveActivePseudoClass: true,
|
|
314
317
|
cssRemoveHoverPseudoClass: true,
|
|
318
|
+
cssRemoveFocusPseudoClass: true,
|
|
315
319
|
isMainChunk: true,
|
|
316
320
|
majorVersion: 4,
|
|
317
321
|
...options
|
|
@@ -2476,14 +2480,28 @@ function isCommentOnlyCss(source) {
|
|
|
2476
2480
|
return false;
|
|
2477
2481
|
}
|
|
2478
2482
|
}
|
|
2479
|
-
function
|
|
2480
|
-
|
|
2483
|
+
function removeMiniProgramInteractiveSelectors(source, options = {
|
|
2484
|
+
active: true,
|
|
2485
|
+
hover: true
|
|
2486
|
+
}) {
|
|
2487
|
+
const removeActive = options.active === true;
|
|
2488
|
+
const removeHover = options.hover === true;
|
|
2489
|
+
const removeFocus = options.focus === true;
|
|
2490
|
+
const unsupportedPseudoClasses = [
|
|
2491
|
+
...removeActive ? [":active"] : [],
|
|
2492
|
+
...removeHover ? [":hover"] : [],
|
|
2493
|
+
...removeFocus ? [":focus"] : []
|
|
2494
|
+
];
|
|
2495
|
+
if (unsupportedPseudoClasses.length === 0 || !source.includes(":active") && !source.includes(":hover") && !source.includes(":focus")) return source;
|
|
2481
2496
|
try {
|
|
2482
2497
|
const root = _weapp_tailwindcss_postcss.postcss.parse(source);
|
|
2483
2498
|
let changed = false;
|
|
2484
2499
|
root.walkRules((rule) => {
|
|
2485
2500
|
const selectors = rule.selectors ?? [rule.selector];
|
|
2486
|
-
const keptSelectors = selectors.filter((selector) =>
|
|
2501
|
+
const keptSelectors = selectors.filter((selector) => {
|
|
2502
|
+
if (!unsupportedPseudoClasses.some((pseudoClass) => selector.includes(pseudoClass))) return true;
|
|
2503
|
+
return !(0, _weapp_tailwindcss_postcss.selectorContainsPseudoClass)(selector, unsupportedPseudoClasses);
|
|
2504
|
+
});
|
|
2487
2505
|
if (keptSelectors.length === selectors.length) return;
|
|
2488
2506
|
changed = true;
|
|
2489
2507
|
if (keptSelectors.length === 0) {
|
|
@@ -2504,7 +2522,11 @@ function removeMiniProgramHoverSelectors(source, enabled = true) {
|
|
|
2504
2522
|
}
|
|
2505
2523
|
}
|
|
2506
2524
|
function removeProcessedMiniProgramUnsupportedCss(source, options) {
|
|
2507
|
-
return
|
|
2525
|
+
return removeMiniProgramInteractiveSelectors((0, _weapp_tailwindcss_postcss.removeUnsupportedMiniProgramAtRules)(source), {
|
|
2526
|
+
active: options.cssRemoveActivePseudoClass ?? true,
|
|
2527
|
+
hover: options.cssRemoveHoverPseudoClass ?? true,
|
|
2528
|
+
focus: options.cssRemoveFocusPseudoClass ?? true
|
|
2529
|
+
});
|
|
2508
2530
|
}
|
|
2509
2531
|
function unwrapMiniProgramCascadeLayers(source) {
|
|
2510
2532
|
if (!source.includes("@layer")) return source;
|
|
@@ -2640,7 +2662,8 @@ function findWorkspaceRoot(startDir) {
|
|
|
2640
2662
|
if (!startDir) return;
|
|
2641
2663
|
let current = node_path.default.resolve(startDir);
|
|
2642
2664
|
while (true) {
|
|
2643
|
-
|
|
2665
|
+
const workspaceFile = node_path.default.join(current, "pnpm-workspace.yaml");
|
|
2666
|
+
if ((0, node_fs.existsSync)(workspaceFile)) return current;
|
|
2644
2667
|
const parent = node_path.default.dirname(current);
|
|
2645
2668
|
if (parent === current) return;
|
|
2646
2669
|
current = parent;
|
|
@@ -2650,7 +2673,8 @@ function findNearestPackageRoot(startDir) {
|
|
|
2650
2673
|
if (!startDir) return;
|
|
2651
2674
|
let current = node_path.default.resolve(startDir);
|
|
2652
2675
|
while (true) {
|
|
2653
|
-
|
|
2676
|
+
const pkgPath = node_path.default.join(current, "package.json");
|
|
2677
|
+
if ((0, node_fs.existsSync)(pkgPath)) return current;
|
|
2654
2678
|
const parent = node_path.default.dirname(current);
|
|
2655
2679
|
if (parent === current) return;
|
|
2656
2680
|
current = parent;
|
|
@@ -3052,7 +3076,8 @@ function resolveTailwindV4SourceOptionsFromRuntime(runtime) {
|
|
|
3052
3076
|
}));
|
|
3053
3077
|
}
|
|
3054
3078
|
function resolveTailwindV4Source(options) {
|
|
3055
|
-
|
|
3079
|
+
const normalizedOptions = normalizeTailwindV4SourceOptions(options);
|
|
3080
|
+
return (0, _tailwindcss_mangle_engine.resolveTailwindV4Source)(normalizedOptions);
|
|
3056
3081
|
}
|
|
3057
3082
|
function resolveTailwindV4SourceFromRuntimeOptions(options) {
|
|
3058
3083
|
const projectRoot = options?.projectRoot ?? node_process.default.cwd();
|
|
@@ -3486,10 +3511,10 @@ Object.defineProperty(exports, "prependConfigDirective", {
|
|
|
3486
3511
|
return prependConfigDirective;
|
|
3487
3512
|
}
|
|
3488
3513
|
});
|
|
3489
|
-
Object.defineProperty(exports, "
|
|
3514
|
+
Object.defineProperty(exports, "removeMiniProgramInteractiveSelectors", {
|
|
3490
3515
|
enumerable: true,
|
|
3491
3516
|
get: function() {
|
|
3492
|
-
return
|
|
3517
|
+
return removeMiniProgramInteractiveSelectors;
|
|
3493
3518
|
}
|
|
3494
3519
|
});
|
|
3495
3520
|
Object.defineProperty(exports, "removeTailwindSourceDirectives", {
|
package/dist/generator.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-CwMI20jy.cjs");
|
|
3
3
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
4
4
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
5
5
|
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|
package/dist/generator.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Mt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, jt as transformTailwindV4CssByTarget, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-
|
|
1
|
+
import { Mt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, jt as transformTailwindV4CssByTarget, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-C2UFjlZ1.js";
|
|
2
2
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|