weapp-tailwindcss 5.1.11 → 5.1.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/cache-options-DavPxrhC.js +16 -0
- package/dist/cache-options-DwBtLwQe.mjs +5 -0
- package/dist/cli.js +10 -6
- package/dist/cli.mjs +10 -6
- package/dist/context-DRRgW7i2.js +1311 -0
- package/dist/context-xSJE588m.mjs +1234 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +119 -5
- package/dist/defaults.mjs +114 -1
- package/dist/{generator-ROzBodj6.mjs → generator-BvPcmqxU.mjs} +9 -139
- package/dist/{generator-Bz94KTkH.js → generator-CS10c9g1.js} +18 -154
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-BKqMb_Ds.mjs → gulp-BEOzXrbp.mjs} +5 -4
- package/dist/{gulp-DfOLvYLs.js → gulp-DNZZvUMq.js} +6 -5
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DOTdH18A.js → hmr-timing-DW1g3zjl.js} +17 -15
- package/dist/{hmr-timing-DwtYJdwb.mjs → hmr-timing-hRhRAjYV.mjs} +5 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/object-BJSWl-E5.mjs +9 -0
- package/dist/object-COs_Mw6p.js +14 -0
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +3 -3
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-BrWuBTjY.js → source-candidate-scan-signature-CMgu5bJk.js} +6 -6
- package/dist/{source-candidate-scan-signature-CQ04hiox.mjs → source-candidate-scan-signature-t4XKAQ04.mjs} +3 -3
- package/dist/{tailwindcss-hzy_WaC9.mjs → tailwindcss-DZT_pWrd.mjs} +132 -2
- package/dist/{tailwindcss-Dn5DVlkI.js → tailwindcss-z9JMF-qU.js} +140 -10
- package/dist/{transform-DZQETx51.js → transform-COFRlmDF.js} +13 -13
- package/dist/{transform-BgnNYkIG.mjs → transform-D5JUgMpE.mjs} +1 -1
- package/dist/{utils-D3h8j7Mk.js → utils-CuKLf1Zv.js} +0 -15
- package/dist/{utils-DodxWHGz.mjs → utils-MVwpU07P.mjs} +1 -8
- package/dist/{vite-oI2ReOic.mjs → vite-DF1gE6a5.mjs} +35 -23
- package/dist/{vite-DODC15Fr.js → vite-VGfkFQkC.js} +50 -38
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +6 -2
- package/dist/{webpack-CCapGlNg.mjs → webpack-CTYm19zA.mjs} +22 -16
- package/dist/{webpack-XxBCIrBp.js → webpack-CzXjfvYS.js} +28 -22
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/dist/{context-y2BGCok4.js → wxml-Ce10eREX.js} +37 -1286
- package/dist/{context-DzkSFEVL.mjs → wxml-DdGdeqaH.mjs} +13 -1235
- package/package.json +3 -3
- package/dist/defaults-9B6aMyZb.mjs +0 -118
- package/dist/defaults-nsf4VNMX.js +0 -154
package/dist/core.js
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-DRRgW7i2.js");
|
|
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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-xSJE588m.mjs";
|
|
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 });
|
package/dist/css-macro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_auto = require("./auto-DtU6f3X6.js");
|
|
3
|
-
require("./utils-
|
|
3
|
+
require("./utils-CuKLf1Zv.js");
|
|
4
4
|
let tailwindcss_plugin = require("tailwindcss/plugin");
|
|
5
5
|
tailwindcss_plugin = require_rolldown_runtime.__toESM(tailwindcss_plugin);
|
|
6
6
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
package/dist/css-macro.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as markCssMacroPlugin } from "./auto-CrJJc5rK.mjs";
|
|
2
|
-
import { t as defu } from "./utils-
|
|
2
|
+
import { t as defu } from "./utils-MVwpU07P.mjs";
|
|
3
3
|
import plugin from "tailwindcss/plugin";
|
|
4
4
|
//#region src/css-macro/constants.ts
|
|
5
5
|
const queryKey = "weapp-tw-platform";
|
package/dist/defaults.js
CHANGED
|
@@ -1,6 +1,120 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
require("./utils-CuKLf1Zv.js");
|
|
3
|
+
const require_cache_options = require("./cache-options-DavPxrhC.js");
|
|
4
|
+
let _weapp_core_escape = require("@weapp-core/escape");
|
|
5
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
6
|
+
//#region src/defaults.ts
|
|
7
|
+
const CSS_FILE_PATTERN = /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/;
|
|
8
|
+
const HTML_FILE_PATTERN = /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/;
|
|
9
|
+
const JS_FILE_PATTERN = /.+\.[cm]?js?$/;
|
|
10
|
+
const alwaysFalse = () => false;
|
|
11
|
+
const TAILWIND_V4_CSS_PREFLIGHT = {
|
|
12
|
+
"border": "0 solid",
|
|
13
|
+
"box-sizing": "border-box",
|
|
14
|
+
"margin": "0",
|
|
15
|
+
"padding": "0"
|
|
16
|
+
};
|
|
17
|
+
function getDefaultCssPreflight() {
|
|
18
|
+
return { ...TAILWIND_V4_CSS_PREFLIGHT };
|
|
19
|
+
}
|
|
20
|
+
function resolveDefaultCssPreflight(cssPreflight, _tailwindcssMajorVersion) {
|
|
21
|
+
if (cssPreflight === false) return false;
|
|
22
|
+
return {
|
|
23
|
+
...getDefaultCssPreflight(),
|
|
24
|
+
...cssPreflight ?? {}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function getDefaultOptions() {
|
|
28
|
+
return {
|
|
29
|
+
/**
|
|
30
|
+
* wxss 微信小程序
|
|
31
|
+
* acss 支付宝小程序
|
|
32
|
+
* jxss 京东小程序
|
|
33
|
+
* ttss 头条小程序
|
|
34
|
+
* qss QQ小程序
|
|
35
|
+
* css 最正常的样式文件
|
|
36
|
+
* tyss 涂鸦小程序
|
|
37
|
+
*/
|
|
38
|
+
cssMatcher: (file) => CSS_FILE_PATTERN.test(file),
|
|
39
|
+
/**
|
|
40
|
+
* wxml 微信小程序
|
|
41
|
+
* axml 支付宝小程序
|
|
42
|
+
* jxml 京东小程序
|
|
43
|
+
* ksml 快手小程序
|
|
44
|
+
* ttml 头条小程序
|
|
45
|
+
* qml QQ小程序
|
|
46
|
+
* tyml 涂鸦小程序
|
|
47
|
+
* xhsml 小红书小程序
|
|
48
|
+
* swan 百度小程序
|
|
49
|
+
*/
|
|
50
|
+
htmlMatcher: (file) => HTML_FILE_PATTERN.test(file),
|
|
51
|
+
jsMatcher: (file) => {
|
|
52
|
+
if (file.includes("node_modules")) return false;
|
|
53
|
+
return JS_FILE_PATTERN.test(file);
|
|
54
|
+
},
|
|
55
|
+
transform: {
|
|
56
|
+
include: [],
|
|
57
|
+
exclude: []
|
|
58
|
+
},
|
|
59
|
+
mainCssChunkMatcher: alwaysFalse,
|
|
60
|
+
wxsMatcher: alwaysFalse,
|
|
61
|
+
cssPreflight: getDefaultCssPreflight(),
|
|
62
|
+
disabled: false,
|
|
63
|
+
onLoad: _weapp_tailwindcss_shared.noop,
|
|
64
|
+
onStart: _weapp_tailwindcss_shared.noop,
|
|
65
|
+
onEnd: _weapp_tailwindcss_shared.noop,
|
|
66
|
+
onUpdate: _weapp_tailwindcss_shared.noop,
|
|
67
|
+
customAttributes: {},
|
|
68
|
+
customReplaceDictionary: _weapp_core_escape.MappingChars2String,
|
|
69
|
+
appType: void 0,
|
|
70
|
+
arbitraryValues: {
|
|
71
|
+
allowDoubleQuotes: false,
|
|
72
|
+
bareArbitraryValues: false
|
|
73
|
+
},
|
|
74
|
+
unocss: false,
|
|
75
|
+
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
76
|
+
inlineWxs: false,
|
|
77
|
+
injectAdditionalCssVarScope: false,
|
|
78
|
+
jsPreserveClass: (keyword) => {
|
|
79
|
+
/**
|
|
80
|
+
* 默认保留 keyword
|
|
81
|
+
*/
|
|
82
|
+
if (keyword === "*") return true;
|
|
83
|
+
return false;
|
|
84
|
+
},
|
|
85
|
+
disabledDefaultTemplateHandler: false,
|
|
86
|
+
cssSelectorReplacement: {
|
|
87
|
+
root: [
|
|
88
|
+
"page",
|
|
89
|
+
".tw-root",
|
|
90
|
+
"wx-root-portal-content"
|
|
91
|
+
],
|
|
92
|
+
universal: ["view", "text"]
|
|
93
|
+
},
|
|
94
|
+
babelParserOptions: {
|
|
95
|
+
sourceType: "unambiguous",
|
|
96
|
+
cache: true,
|
|
97
|
+
cacheKey: "st:unambiguous",
|
|
98
|
+
cacheMaxEntries: 128,
|
|
99
|
+
cacheMaxSourceLength: require_cache_options.DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH
|
|
100
|
+
},
|
|
101
|
+
postcssOptions: {},
|
|
102
|
+
cssRemoveProperty: true,
|
|
103
|
+
cssRemoveHoverPseudoClass: true,
|
|
104
|
+
ignoreCallExpressionIdentifiers: [],
|
|
105
|
+
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
106
|
+
replaceRuntimePackages: false,
|
|
107
|
+
rewriteCssImports: false,
|
|
108
|
+
generator: {},
|
|
109
|
+
cssSourceTrace: false,
|
|
110
|
+
tailwindcssRuntimeOptions: { filter(className) {
|
|
111
|
+
return !(0, _weapp_core_escape.isAllowedClassName)(className);
|
|
112
|
+
} },
|
|
113
|
+
logLevel: "info"
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
exports.TAILWIND_V4_CSS_PREFLIGHT = TAILWIND_V4_CSS_PREFLIGHT;
|
|
118
|
+
exports.getDefaultCssPreflight = getDefaultCssPreflight;
|
|
119
|
+
exports.getDefaultOptions = getDefaultOptions;
|
|
120
|
+
exports.resolveDefaultCssPreflight = resolveDefaultCssPreflight;
|
package/dist/defaults.mjs
CHANGED
|
@@ -1,2 +1,115 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as noop } from "./utils-MVwpU07P.mjs";
|
|
2
|
+
import { t as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH } from "./cache-options-DwBtLwQe.mjs";
|
|
3
|
+
import { MappingChars2String, isAllowedClassName } from "@weapp-core/escape";
|
|
4
|
+
//#region src/defaults.ts
|
|
5
|
+
const CSS_FILE_PATTERN = /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/;
|
|
6
|
+
const HTML_FILE_PATTERN = /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/;
|
|
7
|
+
const JS_FILE_PATTERN = /.+\.[cm]?js?$/;
|
|
8
|
+
const alwaysFalse = () => false;
|
|
9
|
+
const TAILWIND_V4_CSS_PREFLIGHT = {
|
|
10
|
+
"border": "0 solid",
|
|
11
|
+
"box-sizing": "border-box",
|
|
12
|
+
"margin": "0",
|
|
13
|
+
"padding": "0"
|
|
14
|
+
};
|
|
15
|
+
function getDefaultCssPreflight() {
|
|
16
|
+
return { ...TAILWIND_V4_CSS_PREFLIGHT };
|
|
17
|
+
}
|
|
18
|
+
function resolveDefaultCssPreflight(cssPreflight, _tailwindcssMajorVersion) {
|
|
19
|
+
if (cssPreflight === false) return false;
|
|
20
|
+
return {
|
|
21
|
+
...getDefaultCssPreflight(),
|
|
22
|
+
...cssPreflight ?? {}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function getDefaultOptions() {
|
|
26
|
+
return {
|
|
27
|
+
/**
|
|
28
|
+
* wxss 微信小程序
|
|
29
|
+
* acss 支付宝小程序
|
|
30
|
+
* jxss 京东小程序
|
|
31
|
+
* ttss 头条小程序
|
|
32
|
+
* qss QQ小程序
|
|
33
|
+
* css 最正常的样式文件
|
|
34
|
+
* tyss 涂鸦小程序
|
|
35
|
+
*/
|
|
36
|
+
cssMatcher: (file) => CSS_FILE_PATTERN.test(file),
|
|
37
|
+
/**
|
|
38
|
+
* wxml 微信小程序
|
|
39
|
+
* axml 支付宝小程序
|
|
40
|
+
* jxml 京东小程序
|
|
41
|
+
* ksml 快手小程序
|
|
42
|
+
* ttml 头条小程序
|
|
43
|
+
* qml QQ小程序
|
|
44
|
+
* tyml 涂鸦小程序
|
|
45
|
+
* xhsml 小红书小程序
|
|
46
|
+
* swan 百度小程序
|
|
47
|
+
*/
|
|
48
|
+
htmlMatcher: (file) => HTML_FILE_PATTERN.test(file),
|
|
49
|
+
jsMatcher: (file) => {
|
|
50
|
+
if (file.includes("node_modules")) return false;
|
|
51
|
+
return JS_FILE_PATTERN.test(file);
|
|
52
|
+
},
|
|
53
|
+
transform: {
|
|
54
|
+
include: [],
|
|
55
|
+
exclude: []
|
|
56
|
+
},
|
|
57
|
+
mainCssChunkMatcher: alwaysFalse,
|
|
58
|
+
wxsMatcher: alwaysFalse,
|
|
59
|
+
cssPreflight: getDefaultCssPreflight(),
|
|
60
|
+
disabled: false,
|
|
61
|
+
onLoad: noop,
|
|
62
|
+
onStart: noop,
|
|
63
|
+
onEnd: noop,
|
|
64
|
+
onUpdate: noop,
|
|
65
|
+
customAttributes: {},
|
|
66
|
+
customReplaceDictionary: MappingChars2String,
|
|
67
|
+
appType: void 0,
|
|
68
|
+
arbitraryValues: {
|
|
69
|
+
allowDoubleQuotes: false,
|
|
70
|
+
bareArbitraryValues: false
|
|
71
|
+
},
|
|
72
|
+
unocss: false,
|
|
73
|
+
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
74
|
+
inlineWxs: false,
|
|
75
|
+
injectAdditionalCssVarScope: false,
|
|
76
|
+
jsPreserveClass: (keyword) => {
|
|
77
|
+
/**
|
|
78
|
+
* 默认保留 keyword
|
|
79
|
+
*/
|
|
80
|
+
if (keyword === "*") return true;
|
|
81
|
+
return false;
|
|
82
|
+
},
|
|
83
|
+
disabledDefaultTemplateHandler: false,
|
|
84
|
+
cssSelectorReplacement: {
|
|
85
|
+
root: [
|
|
86
|
+
"page",
|
|
87
|
+
".tw-root",
|
|
88
|
+
"wx-root-portal-content"
|
|
89
|
+
],
|
|
90
|
+
universal: ["view", "text"]
|
|
91
|
+
},
|
|
92
|
+
babelParserOptions: {
|
|
93
|
+
sourceType: "unambiguous",
|
|
94
|
+
cache: true,
|
|
95
|
+
cacheKey: "st:unambiguous",
|
|
96
|
+
cacheMaxEntries: 128,
|
|
97
|
+
cacheMaxSourceLength: DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH
|
|
98
|
+
},
|
|
99
|
+
postcssOptions: {},
|
|
100
|
+
cssRemoveProperty: true,
|
|
101
|
+
cssRemoveHoverPseudoClass: true,
|
|
102
|
+
ignoreCallExpressionIdentifiers: [],
|
|
103
|
+
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
104
|
+
replaceRuntimePackages: false,
|
|
105
|
+
rewriteCssImports: false,
|
|
106
|
+
generator: {},
|
|
107
|
+
cssSourceTrace: false,
|
|
108
|
+
tailwindcssRuntimeOptions: { filter(className) {
|
|
109
|
+
return !isAllowedClassName(className);
|
|
110
|
+
} },
|
|
111
|
+
logLevel: "info"
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
2
115
|
export { TAILWIND_V4_CSS_PREFLIGHT, getDefaultCssPreflight, getDefaultOptions, resolveDefaultCssPreflight };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.mjs";
|
|
1
2
|
import { a as transformCssMacroCss, o as transformCssMacroTailwindV4Source, r as hasCssMacroTailwindV4Source, s as withCssMacroStyleOptions, t as hasCssMacroStyleOptions } from "./auto-CrJJc5rK.mjs";
|
|
2
|
-
import {
|
|
3
|
+
import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
|
|
4
|
+
import "./utils-MVwpU07P.mjs";
|
|
3
5
|
import { createRequire } from "node:module";
|
|
4
6
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
5
7
|
import path from "node:path";
|
|
@@ -49,14 +51,6 @@ function inferGeneratorTargetFromEnv() {
|
|
|
49
51
|
return inferGeneratorTargetFromExplicitEnv() ?? (shouldUseWebGeneratorTargetFromEnv() ? "web" : "weapp");
|
|
50
52
|
}
|
|
51
53
|
//#endregion
|
|
52
|
-
//#region src/utils/object.ts
|
|
53
|
-
function definedEntries(value) {
|
|
54
|
-
return Object.entries(value).filter(([, item]) => item !== void 0);
|
|
55
|
-
}
|
|
56
|
-
function omitUndefined(value) {
|
|
57
|
-
return Object.fromEntries(definedEntries(value));
|
|
58
|
-
}
|
|
59
|
-
//#endregion
|
|
60
54
|
//#region src/tailwindcss/v4-engine/candidates.ts
|
|
61
55
|
const UNSUPPORTED_MINI_PROGRAM_TAILWIND_V4_CANDIDATE_RE = /(?:^|:)(?:group|peer|in|not-in)-[^\s:]*\/|(?:^|:)(?:in|not-in)-\[/;
|
|
62
56
|
function isUnsupportedMiniProgramTailwindV4Candidate(candidate) {
|
|
@@ -603,135 +597,6 @@ function restoreRpxLengthCssSelectors(css, restoreCandidates) {
|
|
|
603
597
|
});
|
|
604
598
|
}
|
|
605
599
|
//#endregion
|
|
606
|
-
//#region src/tailwindcss/source-scan/inline-source.ts
|
|
607
|
-
const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
|
|
608
|
-
function segmentTopLevel(input, separator, options = {}) {
|
|
609
|
-
const parts = [];
|
|
610
|
-
const stack = [];
|
|
611
|
-
let lastPos = 0;
|
|
612
|
-
let quote;
|
|
613
|
-
for (let index = 0; index < input.length; index++) {
|
|
614
|
-
const char = input[index];
|
|
615
|
-
if (char === "\\") {
|
|
616
|
-
index += 1;
|
|
617
|
-
continue;
|
|
618
|
-
}
|
|
619
|
-
if (quote) {
|
|
620
|
-
if (char === quote) quote = void 0;
|
|
621
|
-
continue;
|
|
622
|
-
}
|
|
623
|
-
if (char === "\"" || char === "'") {
|
|
624
|
-
quote = char;
|
|
625
|
-
continue;
|
|
626
|
-
}
|
|
627
|
-
if (char === "(") {
|
|
628
|
-
stack.push(")");
|
|
629
|
-
continue;
|
|
630
|
-
}
|
|
631
|
-
if (char === "[") {
|
|
632
|
-
stack.push("]");
|
|
633
|
-
continue;
|
|
634
|
-
}
|
|
635
|
-
if (char === "{") {
|
|
636
|
-
stack.push("}");
|
|
637
|
-
continue;
|
|
638
|
-
}
|
|
639
|
-
if (stack.length > 0 && char === stack[stack.length - 1]) {
|
|
640
|
-
stack.pop();
|
|
641
|
-
continue;
|
|
642
|
-
}
|
|
643
|
-
if (stack.length === 0 && char === separator) {
|
|
644
|
-
const part = input.slice(lastPos, index);
|
|
645
|
-
if (part || options.keepEmpty) parts.push(part);
|
|
646
|
-
lastPos = index + 1;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
const part = input.slice(lastPos);
|
|
650
|
-
if (part || options.keepEmpty) parts.push(part);
|
|
651
|
-
return parts;
|
|
652
|
-
}
|
|
653
|
-
function isSequence(value) {
|
|
654
|
-
return NUMERICAL_RANGE_RE.test(value);
|
|
655
|
-
}
|
|
656
|
-
function expandSequence(value) {
|
|
657
|
-
const match = value.match(NUMERICAL_RANGE_RE);
|
|
658
|
-
if (!match) return [value];
|
|
659
|
-
const [, start, end, stepValue] = match;
|
|
660
|
-
if (start === void 0 || end === void 0) return [value];
|
|
661
|
-
let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
|
|
662
|
-
const startNumber = Number.parseInt(start, 10);
|
|
663
|
-
const endNumber = Number.parseInt(end, 10);
|
|
664
|
-
const increasing = startNumber < endNumber;
|
|
665
|
-
if (step === void 0) step = increasing ? 1 : -1;
|
|
666
|
-
if (step === 0) return [];
|
|
667
|
-
if (increasing && step < 0) step = -step;
|
|
668
|
-
if (!increasing && step > 0) step = -step;
|
|
669
|
-
const result = [];
|
|
670
|
-
for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
|
|
671
|
-
return result;
|
|
672
|
-
}
|
|
673
|
-
function expandInlineSourceCandidatePattern(pattern) {
|
|
674
|
-
const index = pattern.indexOf("{");
|
|
675
|
-
if (index === -1) return [pattern];
|
|
676
|
-
const prefix = pattern.slice(0, index);
|
|
677
|
-
const rest = pattern.slice(index);
|
|
678
|
-
let depth = 0;
|
|
679
|
-
let endIndex = -1;
|
|
680
|
-
for (let index = 0; index < rest.length; index++) {
|
|
681
|
-
const char = rest[index];
|
|
682
|
-
if (char === "{") depth += 1;
|
|
683
|
-
else if (char === "}") {
|
|
684
|
-
depth -= 1;
|
|
685
|
-
if (depth === 0) {
|
|
686
|
-
endIndex = index;
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
if (endIndex === -1) return [pattern];
|
|
692
|
-
const inner = rest.slice(1, endIndex);
|
|
693
|
-
const suffix = rest.slice(endIndex + 1);
|
|
694
|
-
const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
|
|
695
|
-
return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
|
|
696
|
-
}
|
|
697
|
-
function parseSourceInlineParam(params) {
|
|
698
|
-
let value = params.trim();
|
|
699
|
-
const negated = value.startsWith("not ");
|
|
700
|
-
if (negated) value = value.slice(4).trim();
|
|
701
|
-
if (!value.startsWith("inline(") || !value.endsWith(")")) return;
|
|
702
|
-
const inlineValue = value.slice(7, -1).trim();
|
|
703
|
-
const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
|
|
704
|
-
if (!match) return;
|
|
705
|
-
const source = match[2];
|
|
706
|
-
if (source === void 0) return;
|
|
707
|
-
return {
|
|
708
|
-
negated,
|
|
709
|
-
source
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
function collectCssInlineSourceCandidates(root) {
|
|
713
|
-
const included = /* @__PURE__ */ new Set();
|
|
714
|
-
const excluded = /* @__PURE__ */ new Set();
|
|
715
|
-
root.walkAtRules("source", (rule) => {
|
|
716
|
-
const parsed = parseSourceInlineParam(rule.params);
|
|
717
|
-
if (!parsed) return;
|
|
718
|
-
const target = parsed.negated ? excluded : included;
|
|
719
|
-
for (const source of segmentTopLevel(parsed.source, " ")) {
|
|
720
|
-
const trimmed = source.trim();
|
|
721
|
-
if (!trimmed) continue;
|
|
722
|
-
for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
|
|
723
|
-
const normalized = candidate.trim();
|
|
724
|
-
if (normalized) target.add(normalized);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
for (const candidate of excluded) included.delete(candidate);
|
|
729
|
-
return {
|
|
730
|
-
included,
|
|
731
|
-
excluded
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
//#endregion
|
|
735
600
|
//#region src/tailwindcss/source-scan.ts
|
|
736
601
|
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
737
602
|
"html",
|
|
@@ -2947,6 +2812,11 @@ function createMiniProgramRuntimeBranch(base) {
|
|
|
2947
2812
|
return createRuntimeBranch(base, "mini-program", { platform: typeof context.platform === "string" && context.platform.length > 0 ? context.platform : uniUtsPlatform.isMp ? uniUtsPlatform.normalized : context.platform });
|
|
2948
2813
|
}
|
|
2949
2814
|
//#endregion
|
|
2815
|
+
//#region src/utils/uni-platform.ts
|
|
2816
|
+
function resolveUniUtsPlatform(value = process.env["UNI_UTS_PLATFORM"]) {
|
|
2817
|
+
return resolveUniUtsPlatform$1(value);
|
|
2818
|
+
}
|
|
2819
|
+
//#endregion
|
|
2950
2820
|
//#region src/runtime-branch/platform.ts
|
|
2951
2821
|
function isRuntimeUniAppXEnabled(value) {
|
|
2952
2822
|
return value === true || typeof value === "object" && value?.enabled !== false;
|
|
@@ -3055,4 +2925,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
|
3055
2925
|
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3056
2926
|
}
|
|
3057
2927
|
//#endregion
|
|
3058
|
-
export {
|
|
2928
|
+
export { normalizeTailwindSourceDirectives as $, filterApplyOnlyGeneratedCss as A, resolveTailwindV4CssSourceBase as At, stripUnmatchedTailwindSourceMediaCloseFragments as B, findWorkspaceRoot as C, createTailwindSourceEntryMatcher as Ct, normalizeStringListOption as D, parseConfigParam as Dt, resolveTailwindcssOptions as E, normalizeLegacyContentEntries as Et, removeTailwindV4GeneratedUserCssArtifacts as F, resolveValidTailwindV4Candidates$1 as Ft, removeUnsupportedMiniProgramAtRules as G, finalizeMiniProgramCss as H, removeTailwindV4GeneratorAtRules as I, hasTailwindApplyDirective as J, stripMiniProgramCssSpecificityPlaceholders as K, shouldFilterApplyOnlyGeneratedCss as L, isCommentOnlyCss as M, resolveCssMacroTailwindV4Source as Mt, normalizeEmptyTailwindCustomVariants as N, filterUnsupportedMiniProgramTailwindV4Candidates as Nt, resolveBooleanObjectOption as O, resolveCssSourceEntries as Ot, removeMiniProgramHoverSelectors as P, loadTailwindV4DesignSystem as Pt, normalizeTailwindConfigDirectives as Q, splitUserCssLayerBlocks as R, findWorkspacePackageDir as S, FULL_SOURCE_SCAN_PATTERN as St, normalizeTailwindcssRuntimeOptions as T, isFileMatchedByTailwindSourceEntries as Tt, hasMiniProgramCssSpecificityPlaceholders as U, transformGeneratorUserCss as V, pruneMiniProgramGeneratedCss as W, hasTailwindRootDirectives as X, hasTailwindNonRootGenerationDirectives as Y, hasTailwindSourceDirectives as Z, groupCssEntriesByBase as _, createTailwindV4Engine$1 as _t, resolveGeneratorRuntimeBranch as a, VITE_MARKER_RE as at, normalizeCssEntries as b, transformTailwindV4CssToWeapp as bt, shouldUseNativeAppCssBranch as c, hasTailwindGeneratedCssMarkers as ct, resolveTailwindV4SourceFromRuntime as d, splitTailwindV4GeneratedCssBySourceOrder as dt, normalizeTailwindSourceForGenerator as et, resolveTailwindV4SourceFromRuntimeOptions as f, stripGeneratorPlaceholderMarkers as ft, upsertTailwindV4CssSource as g, prependConfigDirective as gt, hasConfiguredTailwindV4CssRoots as h, normalizeConfigDirective as ht, normalizeWeappTailwindcssGeneratorOptions as i, GENERATOR_PLACEHOLDER_MARKER_RE as it, hasUserCssLayerBlocks as j, toPosixPath as jt, extractGeneratedCssForUserLayerSelectors as k, resolveSourceScanPath as kt, resolveUniUtsPlatform as l, splitGeneratorPlaceholderCssBySourceOrder as lt, filterTailwindV4CssSourceRoots as m, stripTailwindBanners as mt, createWeappTailwindcssGeneratorFromRuntime as n, removeTailwindSourceDirectives as nt, resolveRuntimeBranch as o, createCssAppend as ot, resolveTailwindV4SourceOptionsFromRuntime as p, stripTailwindBanner as pt, hasLocalCssImport as q, resolveTailwindSourceFromRuntime as r, resolveCssEntrySource as rt, shouldUseMiniProgramCssBranch as s, hasTailwindGeneratedCss as st, createWeappTailwindcssGenerator as t, parseImportRequest as tt, resolveTailwindV4Source$1 as u, splitTailwindGeneratedCssByBanner as ut, guessBasedirFromEntries as v, getTailwindV4IncrementalGenerateCacheStats as vt, normalizeExtendLengthUnits as w, expandTailwindSourceEntries as wt, findNearestPackageRoot as x, FULL_SOURCE_SCAN_EXTENSION_RE as xt, isTailwindV4CssEntry as y, transformTailwindV4CssByTarget as yt, stripTailwindSourceMediaFragments as z };
|