weapp-tailwindcss 5.2.9 → 5.2.11
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/class-selectors.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +1 -0
- package/dist/bundlers/vite/utils.d.ts +2 -0
- package/dist/cli.cjs +4 -30
- package/dist/cli.js +4 -30
- package/dist/{context-CByXWyhQ.cjs → context-C3TryIjF.cjs} +8 -13
- package/dist/{context-BMkbwnH8.js → context-DbL0d-zB.js} +8 -13
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{gulp-BWhCahA2.js → gulp-BLaGc0MJ.js} +3 -3
- package/dist/{gulp-BdoorWb5.cjs → gulp-DSrcDQsA.cjs} +4 -4
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-DiYnyg_W.cjs → hmr-timing-BnGBBJ6S.cjs} +2 -2
- package/dist/{hmr-timing-CJocHeZr.js → hmr-timing-DXyGw6jp.js} +18 -8
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/js/literal-transform.d.ts +1 -1
- package/dist/{pipeline-helpers-CsNLoEX1.cjs → pipeline-helpers-B5CzvTUJ.cjs} +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/shared/classname-transform.d.ts +2 -3
- package/dist/{source-candidate-scan-signature-D9FXTD9a.cjs → source-candidate-scan-signature-GjsLzP8Z.cjs} +1 -1
- package/dist/{source-candidate-scan-signature-of-TmeOs.js → source-candidate-scan-signature-xgmxO8_F.js} +1 -1
- package/dist/{transform-GzbxfNGA.cjs → transform-9wbmvHcC.cjs} +1 -1
- package/dist/{transform-DhDe9eSf.js → transform-BlsDWgjt.js} +1 -1
- package/dist/{v4-generation-core-BjHT6qGC.cjs → v4-generation-core-D4zQcQqW.cjs} +22 -6
- package/dist/{vite-8l9_S4Qi.js → vite-BWmBFzgf.js} +36 -12
- package/dist/{vite-Dcx59GRQ.cjs → vite-DTDbD-95.cjs} +37 -13
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +2 -2
- package/dist/{webpack-CzQrloDg.cjs → webpack-Bpovb6YE.cjs} +6 -6
- package/dist/{webpack-CkeFhPY2.js → webpack-CtUyQNqC.js} +4 -4
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/{wxml-IBzZSaQC.js → wxml-CWJc0yY-.js} +5 -31
- package/dist/{wxml-DSMNuUaP.cjs → wxml-DUIdXCVa.cjs} +4 -36
- package/package.json +2 -2
|
@@ -36828,30 +36828,8 @@ function isPlainSlashPathCandidate(candidate) {
|
|
|
36828
36828
|
if (candidate.includes("[") || candidate.includes("]") || candidate.includes(":")) return false;
|
|
36829
36829
|
return !candidate.slice(0, slashIndex).includes("-");
|
|
36830
36830
|
}
|
|
36831
|
-
function isArbitraryValueCandidate(candidate) {
|
|
36832
|
-
let hasOpenBracket = false;
|
|
36833
|
-
let hasCloseBracket = false;
|
|
36834
|
-
for (let i = 0; i < candidate.length; i++) {
|
|
36835
|
-
const char = candidate[i];
|
|
36836
|
-
if (char === "[") hasOpenBracket = true;
|
|
36837
|
-
else if (char === "]") hasCloseBracket = true;
|
|
36838
|
-
if (hasOpenBracket && hasCloseBracket) break;
|
|
36839
|
-
}
|
|
36840
|
-
if (!hasOpenBracket || !hasCloseBracket) return false;
|
|
36841
|
-
if (isUrlLikeCandidate(candidate.trim())) return false;
|
|
36842
|
-
return true;
|
|
36843
|
-
}
|
|
36844
|
-
function shouldEnableArbitraryValueFallbackByInputs(classNameSet, jsArbitraryValueFallback, tailwindcssMajorVersion) {
|
|
36845
|
-
if (jsArbitraryValueFallback === true) return true;
|
|
36846
|
-
if (jsArbitraryValueFallback === false) return false;
|
|
36847
|
-
return tailwindcssMajorVersion === 4 && (!classNameSet || classNameSet.size === 0);
|
|
36848
|
-
}
|
|
36849
|
-
function shouldEnableArbitraryValueFallback({ classNameSet, jsArbitraryValueFallback, tailwindcssMajorVersion }) {
|
|
36850
|
-
return shouldEnableArbitraryValueFallbackByInputs(classNameSet, jsArbitraryValueFallback, tailwindcssMajorVersion);
|
|
36851
|
-
}
|
|
36852
36831
|
const SKIP_RESULT = { decision: "skip" };
|
|
36853
36832
|
const DIRECT_RESULT = { decision: "direct" };
|
|
36854
|
-
const FALLBACK_RESULT = { decision: "fallback" };
|
|
36855
36833
|
function getEscapedCandidateCacheStore(escapeMap) {
|
|
36856
36834
|
if (!escapeMap) return defaultEscapedCandidateCache;
|
|
36857
36835
|
if (escapeMap === lastEscapedCandidateEscapeMap && lastEscapedCandidateCacheStore) return lastEscapedCandidateCacheStore;
|
|
@@ -36876,11 +36854,11 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
36876
36854
|
* JS 转译严格遵循 runtime class set:
|
|
36877
36855
|
* 1. 直接命中 classNameSet 原始值;
|
|
36878
36856
|
* 2. 兼容命中 classNameSet 中已转义值;
|
|
36879
|
-
* 3.
|
|
36857
|
+
* 3. 除显式 alwaysEscape 外,不允许绕过 classNameSet。
|
|
36880
36858
|
*
|
|
36881
36859
|
* 返回结构化结果,附带已计算的 escapedValue 以避免下游重复 escape。
|
|
36882
36860
|
*/
|
|
36883
|
-
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap,
|
|
36861
|
+
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsPreserveClass, classContext }) {
|
|
36884
36862
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
36885
36863
|
if (alwaysEscape) return DIRECT_RESULT;
|
|
36886
36864
|
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
@@ -36892,7 +36870,6 @@ function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNam
|
|
|
36892
36870
|
escapedValue: escapedCandidate
|
|
36893
36871
|
};
|
|
36894
36872
|
}
|
|
36895
|
-
if (classContext && shouldEnableArbitraryValueFallbackByInputs(classNameSet, jsArbitraryValueFallback, tailwindcssMajorVersion) && isArbitraryValueCandidate(candidate)) return FALLBACK_RESULT;
|
|
36896
36873
|
return SKIP_RESULT;
|
|
36897
36874
|
}
|
|
36898
36875
|
//#endregion
|
|
@@ -37138,8 +37115,7 @@ function createCandidatePlanResolver(options, classContext) {
|
|
|
37138
37115
|
function replaceHandleValue(path, options) {
|
|
37139
37116
|
const { needEscaped = false } = options;
|
|
37140
37117
|
const { classNameSet, alwaysEscape } = options;
|
|
37141
|
-
|
|
37142
|
-
if (!alwaysEscape && !fallbackEnabled && (!classNameSet || classNameSet.size === 0)) return;
|
|
37118
|
+
if (!alwaysEscape && (!classNameSet || classNameSet.size === 0)) return;
|
|
37143
37119
|
if (hasIgnoreComment(path.node)) return;
|
|
37144
37120
|
if (isConditionTestLiteral(path)) return;
|
|
37145
37121
|
const { literal, original, offset } = extractLiteralValue(path, options);
|
|
@@ -37151,7 +37127,6 @@ function replaceHandleValue(path, options) {
|
|
|
37151
37127
|
let mutated = false;
|
|
37152
37128
|
let matchedCandidateCount = 0;
|
|
37153
37129
|
let escapedDecisionCount = 0;
|
|
37154
|
-
let fallbackDecisionCount = 0;
|
|
37155
37130
|
let escapedSamples;
|
|
37156
37131
|
let skippedSamples;
|
|
37157
37132
|
const resolveCandidatePlan = createCandidatePlanResolver(options, classContext);
|
|
@@ -37171,7 +37146,6 @@ function replaceHandleValue(path, options) {
|
|
|
37171
37146
|
if (!escapedSamples) escapedSamples = [];
|
|
37172
37147
|
if (escapedSamples.length < 6) escapedSamples.push(candidate);
|
|
37173
37148
|
}
|
|
37174
|
-
if (plan.result.decision === "fallback") fallbackDecisionCount += 1;
|
|
37175
37149
|
}
|
|
37176
37150
|
const replaced = transformed.replace(candidate, plan.replacement);
|
|
37177
37151
|
if (replaced !== transformed) {
|
|
@@ -37181,7 +37155,7 @@ function replaceHandleValue(path, options) {
|
|
|
37181
37155
|
}
|
|
37182
37156
|
const node = path.node;
|
|
37183
37157
|
if (!mutated || typeof node.start !== "number" || typeof node.end !== "number") return;
|
|
37184
|
-
if (debugEnabled) debug$1("runtimeSet size=%d
|
|
37158
|
+
if (debugEnabled) debug$1("runtimeSet size=%d candidates=%d matched=%d escapedHits=%d skipped=%d file=%s escapedSamples=%s skippedSamples=%s", classNameSet?.size ?? 0, candidates.length, matchedCandidateCount, escapedDecisionCount, skippedSamples?.length ?? 0, options.filename ?? "unknown", escapedSamples?.join(",") || "-", skippedSamples?.join(",") || "-");
|
|
37185
37159
|
const start = node.start + offset;
|
|
37186
37160
|
const end = node.end - offset;
|
|
37187
37161
|
if (start >= end || transformed === original) return;
|
|
@@ -38595,12 +38569,6 @@ Object.defineProperty(exports, "resolveClassNameTransformWithResult", {
|
|
|
38595
38569
|
return resolveClassNameTransformWithResult;
|
|
38596
38570
|
}
|
|
38597
38571
|
});
|
|
38598
|
-
Object.defineProperty(exports, "shouldEnableArbitraryValueFallback", {
|
|
38599
|
-
enumerable: true,
|
|
38600
|
-
get: function() {
|
|
38601
|
-
return shouldEnableArbitraryValueFallback;
|
|
38602
|
-
}
|
|
38603
|
-
});
|
|
38604
38572
|
Object.defineProperty(exports, "traverse", {
|
|
38605
38573
|
enumerable: true,
|
|
38606
38574
|
get: function() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.11",
|
|
5
5
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"semver": "~7.8.5",
|
|
217
217
|
"yaml": "^2.9.0",
|
|
218
218
|
"@weapp-tailwindcss/logger": "2.0.1",
|
|
219
|
-
"@weapp-tailwindcss/postcss": "3.2.
|
|
219
|
+
"@weapp-tailwindcss/postcss": "3.2.8",
|
|
220
220
|
"@weapp-tailwindcss/reset": "0.1.2",
|
|
221
221
|
"@weapp-tailwindcss/shared": "2.0.1",
|
|
222
222
|
"tailwindcss-config": "2.0.2",
|