@unocss/language-server 66.6.6 → 66.6.7
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/{chunk-C9ebiww4.mjs → chunk-CBBoxR_p.mjs} +8 -14
- package/dist/{dist-Dwf-d4OE.mjs → dist-DJp734Em.mjs} +2 -4
- package/dist/{dist-BUrt6dYo.cjs → dist-FL7p7uq2.cjs} +17 -20
- package/dist/index.d.mts +6 -1
- package/dist/index.mjs +652 -701
- package/dist/jiti-du6HSta6.cjs +4474 -0
- package/dist/{loader-CxlILAbz.mjs → loader-DsXvVy9i.mjs} +4 -19
- package/dist/{multipart-parser-s9tbX9e1.cjs → multipart-parser-DiNB_U8f.cjs} +13 -15
- package/dist/{multipart-parser-D3zGHRx2.mjs → multipart-parser-KkZpcbcp.mjs} +3 -5
- package/dist/{node-B8nS8lcG.cjs → node-3wiZdXIz.cjs} +40 -42
- package/dist/{node-CautW6cw.cjs → node-BM09n__k.cjs} +969 -967
- package/dist/{node-rKyHxxpg.mjs → node-Cd2HRubI.mjs} +930 -928
- package/dist/{node-DvibxqDE.mjs → node-D23LglTq.mjs} +32 -34
- package/dist/{node-loader-BO0uvH6Z.cjs → node-loader-BJV6yUBJ.cjs} +676 -689
- package/dist/{node-loader-DpZIWCu9.mjs → node-loader-ZSa5xzQw.mjs} +440 -453
- package/dist/{prompt-BJqhZQ-_.cjs → prompt-jldWOuck.cjs} +265 -267
- package/dist/server.cjs +14287 -14490
- package/package.json +39 -6
- package/dist/jiti-B459FbZV.cjs +0 -4477
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __require$1, r as __toESM, t as __commonJSMin } from "./chunk-
|
|
2
|
-
import { a as join, i as isAbsolute, n as searchForIcon, o as resolve$1, t as loadIcon } from "./loader-
|
|
1
|
+
import { n as __require$1, r as __toESM, t as __commonJSMin } from "./chunk-CBBoxR_p.mjs";
|
|
2
|
+
import { a as join, i as isAbsolute, n as searchForIcon, o as resolve$1, t as loadIcon } from "./loader-DsXvVy9i.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { BetterMap, LAYER_IMPORTS, clone, createGenerator, createNanoEvents, cssIdRE, defaultSplitRE, definePreset, escapeRegExp, escapeSelector, isAttributifySelector, isString, isValidSelector, mergeDeep, notNull, splitWithVariantGroupRE, symbols, toArray, uniq, warnOnce } from "@unocss/core";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
@@ -11,15 +11,9 @@ import presetWind3 from "@unocss/preset-wind3";
|
|
|
11
11
|
import { sourceObjectFields, sourcePluginFactory } from "unconfig/presets";
|
|
12
12
|
import parserCSS from "prettier/parser-postcss";
|
|
13
13
|
import prettier from "prettier/standalone";
|
|
14
|
-
|
|
15
|
-
//#region ../../virtual-shared/integration/src/constants.ts
|
|
16
|
-
const INCLUDE_COMMENT = "@unocss-include";
|
|
17
|
-
const IGNORE_COMMENT = "@unocss-ignore";
|
|
18
|
-
const CSS_PLACEHOLDER = "@unocss-placeholder";
|
|
19
14
|
const SKIP_START_COMMENT = "@unocss-skip-start";
|
|
20
15
|
const SKIP_END_COMMENT = "@unocss-skip-end";
|
|
21
16
|
const SKIP_COMMENT_RE = new RegExp(`(\/\/\\s*?${SKIP_START_COMMENT}\\s*?|\\/\\*\\s*?${SKIP_START_COMMENT}\\s*?\\*\\/|<!--\\s*?${SKIP_START_COMMENT}\\s*?-->)[\\s\\S]*?(\/\/\\s*?${SKIP_END_COMMENT}\\s*?|\\/\\*\\s*?${SKIP_END_COMMENT}\\s*?\\*\\/|<!--\\s*?${SKIP_END_COMMENT}\\s*?-->)`, "g");
|
|
22
|
-
|
|
23
17
|
//#endregion
|
|
24
18
|
//#region ../../virtual-shared/integration/src/defaults-ide.ts
|
|
25
19
|
/**
|
|
@@ -34,7 +28,6 @@ const defaultIdeMatchInclude = [
|
|
|
34
28
|
* Default match includes in getMatchedPositions for IDE
|
|
35
29
|
*/
|
|
36
30
|
const defaultIdeMatchExclude = [SKIP_COMMENT_RE];
|
|
37
|
-
|
|
38
31
|
//#endregion
|
|
39
32
|
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
40
33
|
var comma = ",".charCodeAt(0);
|
|
@@ -110,18 +103,17 @@ function encode(decoded) {
|
|
|
110
103
|
}
|
|
111
104
|
return writer.flush();
|
|
112
105
|
}
|
|
113
|
-
|
|
114
106
|
//#endregion
|
|
115
107
|
//#region ../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
|
|
116
108
|
var BitSet = class BitSet {
|
|
117
109
|
constructor(arg) {
|
|
118
110
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
119
111
|
}
|
|
120
|
-
add(n
|
|
121
|
-
this.bits[n
|
|
112
|
+
add(n) {
|
|
113
|
+
this.bits[n >> 5] |= 1 << (n & 31);
|
|
122
114
|
}
|
|
123
|
-
has(n
|
|
124
|
-
return !!(this.bits[n
|
|
115
|
+
has(n) {
|
|
116
|
+
return !!(this.bits[n >> 5] & 1 << (n & 31));
|
|
125
117
|
}
|
|
126
118
|
};
|
|
127
119
|
var Chunk = class Chunk {
|
|
@@ -259,15 +251,15 @@ function getBtoa() {
|
|
|
259
251
|
}
|
|
260
252
|
const btoa = /* @__PURE__ */ getBtoa();
|
|
261
253
|
var SourceMap = class {
|
|
262
|
-
constructor(properties
|
|
254
|
+
constructor(properties) {
|
|
263
255
|
this.version = 3;
|
|
264
|
-
this.file = properties
|
|
265
|
-
this.sources = properties
|
|
266
|
-
this.sourcesContent = properties
|
|
267
|
-
this.names = properties
|
|
268
|
-
this.mappings = encode(properties
|
|
269
|
-
if (typeof properties
|
|
270
|
-
if (typeof properties
|
|
256
|
+
this.file = properties.file;
|
|
257
|
+
this.sources = properties.sources;
|
|
258
|
+
this.sourcesContent = properties.sourcesContent;
|
|
259
|
+
this.names = properties.names;
|
|
260
|
+
this.mappings = encode(properties.mappings);
|
|
261
|
+
if (typeof properties.x_google_ignoreList !== "undefined") this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
262
|
+
if (typeof properties.debugId !== "undefined") this.debugId = properties.debugId;
|
|
271
263
|
}
|
|
272
264
|
toString() {
|
|
273
265
|
return JSON.stringify(this);
|
|
@@ -344,14 +336,14 @@ var Mappings = class {
|
|
|
344
336
|
let contentLineEnd = content.indexOf("\n", 0);
|
|
345
337
|
let previousContentLineEnd = -1;
|
|
346
338
|
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
|
|
347
|
-
const segment
|
|
339
|
+
const segment = [
|
|
348
340
|
this.generatedCodeColumn,
|
|
349
341
|
sourceIndex,
|
|
350
342
|
loc.line,
|
|
351
343
|
loc.column
|
|
352
344
|
];
|
|
353
|
-
if (nameIndex >= 0) segment
|
|
354
|
-
this.rawSegments.push(segment
|
|
345
|
+
if (nameIndex >= 0) segment.push(nameIndex);
|
|
346
|
+
this.rawSegments.push(segment);
|
|
355
347
|
this.generatedCodeLine += 1;
|
|
356
348
|
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
357
349
|
this.generatedCodeColumn = 0;
|
|
@@ -876,10 +868,10 @@ var MagicString = class MagicString {
|
|
|
876
868
|
return result;
|
|
877
869
|
}
|
|
878
870
|
snip(start, end) {
|
|
879
|
-
const clone
|
|
880
|
-
clone
|
|
881
|
-
clone
|
|
882
|
-
return clone
|
|
871
|
+
const clone = this.clone();
|
|
872
|
+
clone.remove(0, start);
|
|
873
|
+
clone.remove(end, clone.original.length);
|
|
874
|
+
return clone;
|
|
883
875
|
}
|
|
884
876
|
_split(index) {
|
|
885
877
|
if (this.byStart[index] || this.byEnd[index]) return;
|
|
@@ -937,7 +929,7 @@ var MagicString = class MagicString {
|
|
|
937
929
|
return this.trimStart(charType).trimEnd(charType);
|
|
938
930
|
}
|
|
939
931
|
trimEndAborted(charType) {
|
|
940
|
-
const rx =
|
|
932
|
+
const rx = new RegExp((charType || "\\s") + "+$");
|
|
941
933
|
this.outro = this.outro.replace(rx, "");
|
|
942
934
|
if (this.outro.length) return true;
|
|
943
935
|
let chunk = this.lastChunk;
|
|
@@ -960,7 +952,7 @@ var MagicString = class MagicString {
|
|
|
960
952
|
return this;
|
|
961
953
|
}
|
|
962
954
|
trimStartAborted(charType) {
|
|
963
|
-
const rx =
|
|
955
|
+
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
964
956
|
this.intro = this.intro.replace(rx, "");
|
|
965
957
|
if (this.intro.length) return true;
|
|
966
958
|
let chunk = this.firstChunk;
|
|
@@ -1003,15 +995,15 @@ var MagicString = class MagicString {
|
|
|
1003
995
|
}
|
|
1004
996
|
if (searchValue.global) matchAll(searchValue, this.original).forEach((match) => {
|
|
1005
997
|
if (match.index != null) {
|
|
1006
|
-
const replacement
|
|
1007
|
-
if (replacement
|
|
998
|
+
const replacement = getReplacement(match, this.original);
|
|
999
|
+
if (replacement !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
1008
1000
|
}
|
|
1009
1001
|
});
|
|
1010
1002
|
else {
|
|
1011
1003
|
const match = this.original.match(searchValue);
|
|
1012
1004
|
if (match && match.index != null) {
|
|
1013
|
-
const replacement
|
|
1014
|
-
if (replacement
|
|
1005
|
+
const replacement = getReplacement(match, this.original);
|
|
1006
|
+
if (replacement !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
1015
1007
|
}
|
|
1016
1008
|
}
|
|
1017
1009
|
return this;
|
|
@@ -1046,18 +1038,15 @@ var MagicString = class MagicString {
|
|
|
1046
1038
|
return this._replaceRegexp(searchValue, replacement);
|
|
1047
1039
|
}
|
|
1048
1040
|
};
|
|
1049
|
-
|
|
1050
1041
|
//#endregion
|
|
1051
1042
|
//#region ../../virtual-shared/integration/src/utils.ts
|
|
1052
1043
|
function isCssId(id) {
|
|
1053
1044
|
return cssIdRE.test(id);
|
|
1054
1045
|
}
|
|
1055
|
-
|
|
1056
1046
|
//#endregion
|
|
1057
1047
|
//#region ../../packages-presets/extractor-arbitrary-variants/src/index.ts
|
|
1058
1048
|
const quotedArbitraryValuesRE$1 = /(?:[\w&:[\]-]|\[\S{1,64}=\S{1,64}\]){1,64}\[\\?['"]?\S{1,64}?['"]\]\]?[\w:-]{0,64}/g;
|
|
1059
1049
|
const arbitraryPropertyRE$1 = /\[(\\\W|[\w-]){1,64}:[^\s:]{0,64}?("\S{1,64}?"|'\S{1,64}?'|`\S{1,64}?`|[^\s:]{1,64}?)[^\s:]{0,64}?\)?\]/g;
|
|
1060
|
-
|
|
1061
1050
|
//#endregion
|
|
1062
1051
|
//#region ../../virtual-shared/integration/src/match-positions.ts
|
|
1063
1052
|
async function isPug(uno, code, id = "") {
|
|
@@ -1090,7 +1079,7 @@ function getPlainClassMatchedPositionsForPug(codeSplit, matchedPlain, start) {
|
|
|
1090
1079
|
plainClassName
|
|
1091
1080
|
]);
|
|
1092
1081
|
} else {
|
|
1093
|
-
const match =
|
|
1082
|
+
const match = new RegExp(`\.(${plainClassName})[\.#=\s(]|\.(${plainClassName})$`).exec(codeSplit);
|
|
1094
1083
|
if (match) result.push([
|
|
1095
1084
|
start + match.index + 1,
|
|
1096
1085
|
start + match.index + plainClassName.length + 1,
|
|
@@ -1128,10 +1117,10 @@ function getMatchedPositions(code, matched, extraAnnotations = [], options = {})
|
|
|
1128
1117
|
});
|
|
1129
1118
|
function highlightLessGreaterThanSign(str) {
|
|
1130
1119
|
if (/[><]/.test(str)) for (const match of code.matchAll(new RegExp(escapeRegExp(str), "g"))) {
|
|
1131
|
-
const start
|
|
1132
|
-
const end = start
|
|
1120
|
+
const start = match.index;
|
|
1121
|
+
const end = start + match[0].length;
|
|
1133
1122
|
result.push([
|
|
1134
|
-
start
|
|
1123
|
+
start,
|
|
1135
1124
|
end,
|
|
1136
1125
|
match[0]
|
|
1137
1126
|
]);
|
|
@@ -1149,20 +1138,20 @@ function getMatchedPositions(code, matched, extraAnnotations = [], options = {})
|
|
|
1149
1138
|
start = end;
|
|
1150
1139
|
});
|
|
1151
1140
|
for (const match of code.matchAll(quotedArbitraryValuesRE$1)) {
|
|
1152
|
-
const start
|
|
1153
|
-
const end = start
|
|
1141
|
+
const start = match.index;
|
|
1142
|
+
const end = start + match[0].length;
|
|
1154
1143
|
if (plain.has(match[0])) result.push([
|
|
1155
|
-
start
|
|
1144
|
+
start,
|
|
1156
1145
|
end,
|
|
1157
1146
|
match[0]
|
|
1158
1147
|
]);
|
|
1159
1148
|
}
|
|
1160
1149
|
for (const match of code.matchAll(arbitraryPropertyRE$1)) {
|
|
1161
|
-
const start
|
|
1162
|
-
const end = start
|
|
1150
|
+
const start = match.index;
|
|
1151
|
+
const end = start + match[0].length;
|
|
1163
1152
|
if (plain.has(match[0])) {
|
|
1164
|
-
if (result.findIndex(([s, e]) => s === start
|
|
1165
|
-
start
|
|
1153
|
+
if (result.findIndex(([s, e]) => s === start && e === end) < 0) result.push([
|
|
1154
|
+
start,
|
|
1166
1155
|
end,
|
|
1167
1156
|
match[0]
|
|
1168
1157
|
]);
|
|
@@ -1176,10 +1165,10 @@ function getMatchedPositions(code, matched, extraAnnotations = [], options = {})
|
|
|
1176
1165
|
let bodyIndex = body.match(`[\\b\\s'"]${escapeRegExp(value)}[\\b\\s'"]`)?.index ?? -1;
|
|
1177
1166
|
if (/[\s'"]/.test(body[bodyIndex] ?? "")) bodyIndex++;
|
|
1178
1167
|
if (bodyIndex < 0) return;
|
|
1179
|
-
const start
|
|
1180
|
-
const end = start
|
|
1168
|
+
const start = match.index + escaped.length + bodyIndex;
|
|
1169
|
+
const end = start + value.length;
|
|
1181
1170
|
result.push([
|
|
1182
|
-
start
|
|
1171
|
+
start,
|
|
1183
1172
|
end,
|
|
1184
1173
|
`[${name}="${value}"]`
|
|
1185
1174
|
]);
|
|
@@ -1190,8 +1179,8 @@ function getMatchedPositions(code, matched, extraAnnotations = [], options = {})
|
|
|
1190
1179
|
i.offset + i.length,
|
|
1191
1180
|
i.className
|
|
1192
1181
|
]));
|
|
1193
|
-
return result.filter(([start
|
|
1194
|
-
if (includeRanges.some(([s, e]) => start
|
|
1182
|
+
return result.filter(([start, end]) => {
|
|
1183
|
+
if (includeRanges.some(([s, e]) => start >= s && end <= e)) return true;
|
|
1195
1184
|
return false;
|
|
1196
1185
|
}).sort((a, b) => a[0] - b[0]);
|
|
1197
1186
|
}
|
|
@@ -1208,7 +1197,7 @@ async function getMatchedPositionsFromCode(uno, code, id = "", options = {}) {
|
|
|
1208
1197
|
"pre",
|
|
1209
1198
|
"default",
|
|
1210
1199
|
"post"
|
|
1211
|
-
]) for (const i of transformers?.filter((i
|
|
1200
|
+
]) for (const i of transformers?.filter((i) => (i.enforce ?? "default") === enforce) || []) {
|
|
1212
1201
|
const _annotations = (await i.transform(s, id, ctx))?.highlightAnnotations;
|
|
1213
1202
|
if (_annotations) annotations.push(..._annotations);
|
|
1214
1203
|
}
|
|
@@ -1218,7 +1207,6 @@ async function getMatchedPositionsFromCode(uno, code, id = "", options = {}) {
|
|
|
1218
1207
|
...options
|
|
1219
1208
|
});
|
|
1220
1209
|
}
|
|
1221
|
-
|
|
1222
1210
|
//#endregion
|
|
1223
1211
|
//#region src/core/cache.ts
|
|
1224
1212
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -1235,7 +1223,6 @@ function getMatchedPositionsFromDoc(uno, code, id, strictAnnotationMatch = false
|
|
|
1235
1223
|
cache.set(id, result);
|
|
1236
1224
|
return result;
|
|
1237
1225
|
}
|
|
1238
|
-
|
|
1239
1226
|
//#endregion
|
|
1240
1227
|
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js
|
|
1241
1228
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -1289,28 +1276,24 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1289
1276
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
1290
1277
|
SEP: "\\"
|
|
1291
1278
|
};
|
|
1292
|
-
/**
|
|
1293
|
-
* POSIX Bracket Regex
|
|
1294
|
-
*/
|
|
1295
|
-
const POSIX_REGEX_SOURCE = {
|
|
1296
|
-
alnum: "a-zA-Z0-9",
|
|
1297
|
-
alpha: "a-zA-Z",
|
|
1298
|
-
ascii: "\\x00-\\x7F",
|
|
1299
|
-
blank: " \\t",
|
|
1300
|
-
cntrl: "\\x00-\\x1F\\x7F",
|
|
1301
|
-
digit: "0-9",
|
|
1302
|
-
graph: "\\x21-\\x7E",
|
|
1303
|
-
lower: "a-z",
|
|
1304
|
-
print: "\\x20-\\x7E ",
|
|
1305
|
-
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1306
|
-
space: " \\t\\r\\n\\v\\f",
|
|
1307
|
-
upper: "A-Z",
|
|
1308
|
-
word: "A-Za-z0-9_",
|
|
1309
|
-
xdigit: "A-Fa-f0-9"
|
|
1310
|
-
};
|
|
1311
1279
|
module.exports = {
|
|
1312
1280
|
MAX_LENGTH: 1024 * 64,
|
|
1313
|
-
POSIX_REGEX_SOURCE
|
|
1281
|
+
POSIX_REGEX_SOURCE: {
|
|
1282
|
+
alnum: "a-zA-Z0-9",
|
|
1283
|
+
alpha: "a-zA-Z",
|
|
1284
|
+
ascii: "\\x00-\\x7F",
|
|
1285
|
+
blank: " \\t",
|
|
1286
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
1287
|
+
digit: "0-9",
|
|
1288
|
+
graph: "\\x21-\\x7E",
|
|
1289
|
+
lower: "a-z",
|
|
1290
|
+
print: "\\x20-\\x7E ",
|
|
1291
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1292
|
+
space: " \\t\\r\\n\\v\\f",
|
|
1293
|
+
upper: "A-Z",
|
|
1294
|
+
word: "A-Za-z0-9_",
|
|
1295
|
+
xdigit: "A-Fa-f0-9"
|
|
1296
|
+
},
|
|
1314
1297
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1315
1298
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
1316
1299
|
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
@@ -1366,12 +1349,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1366
1349
|
CHAR_UNDERSCORE: 95,
|
|
1367
1350
|
CHAR_VERTICAL_LINE: 124,
|
|
1368
1351
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
1369
|
-
extglobChars(chars
|
|
1352
|
+
extglobChars(chars) {
|
|
1370
1353
|
return {
|
|
1371
1354
|
"!": {
|
|
1372
1355
|
type: "negate",
|
|
1373
1356
|
open: "(?:(?!(?:",
|
|
1374
|
-
close: `))${chars
|
|
1357
|
+
close: `))${chars.STAR})`
|
|
1375
1358
|
},
|
|
1376
1359
|
"?": {
|
|
1377
1360
|
type: "qmark",
|
|
@@ -1400,7 +1383,6 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1400
1383
|
}
|
|
1401
1384
|
};
|
|
1402
1385
|
}));
|
|
1403
|
-
|
|
1404
1386
|
//#endregion
|
|
1405
1387
|
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js
|
|
1406
1388
|
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -1442,14 +1424,13 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1442
1424
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
1443
1425
|
return output;
|
|
1444
1426
|
};
|
|
1445
|
-
exports.basename = (path
|
|
1446
|
-
const segs = path
|
|
1427
|
+
exports.basename = (path, { windows } = {}) => {
|
|
1428
|
+
const segs = path.split(windows ? /[\\/]/ : "/");
|
|
1447
1429
|
const last = segs[segs.length - 1];
|
|
1448
1430
|
if (last === "") return segs[segs.length - 2];
|
|
1449
1431
|
return last;
|
|
1450
1432
|
};
|
|
1451
1433
|
}));
|
|
1452
|
-
|
|
1453
1434
|
//#endregion
|
|
1454
1435
|
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js
|
|
1455
1436
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -1707,9 +1688,9 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1707
1688
|
if (opts.parts === true || opts.tokens === true) {
|
|
1708
1689
|
let prevIndex;
|
|
1709
1690
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
1710
|
-
const n
|
|
1691
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
1711
1692
|
const i = slashes[idx];
|
|
1712
|
-
const value = input.slice(n
|
|
1693
|
+
const value = input.slice(n, i);
|
|
1713
1694
|
if (opts.tokens) {
|
|
1714
1695
|
if (idx === 0 && start !== 0) {
|
|
1715
1696
|
tokens[idx].isPrefix = true;
|
|
@@ -1737,7 +1718,6 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1737
1718
|
};
|
|
1738
1719
|
module.exports = scan;
|
|
1739
1720
|
}));
|
|
1740
|
-
|
|
1741
1721
|
//#endregion
|
|
1742
1722
|
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js
|
|
1743
1723
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -1790,8 +1770,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1790
1770
|
const PLATFORM_CHARS = constants.globChars(opts.windows);
|
|
1791
1771
|
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
1792
1772
|
const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
|
|
1793
|
-
const globstar = (opts
|
|
1794
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts
|
|
1773
|
+
const globstar = (opts) => {
|
|
1774
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1795
1775
|
};
|
|
1796
1776
|
const nodot = opts.dot ? "" : NO_DOT;
|
|
1797
1777
|
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
@@ -1826,11 +1806,11 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1826
1806
|
* Tokenizing helpers
|
|
1827
1807
|
*/
|
|
1828
1808
|
const eos = () => state.index === len - 1;
|
|
1829
|
-
const peek = state.peek = (n
|
|
1809
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
1830
1810
|
const advance = state.advance = () => input[++state.index] || "";
|
|
1831
1811
|
const remaining = () => input.slice(state.index + 1);
|
|
1832
|
-
const consume = (value
|
|
1833
|
-
state.consumed += value
|
|
1812
|
+
const consume = (value = "", num = 0) => {
|
|
1813
|
+
state.consumed += value;
|
|
1834
1814
|
state.index += num;
|
|
1835
1815
|
};
|
|
1836
1816
|
const append = (token) => {
|
|
@@ -1887,9 +1867,9 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1887
1867
|
tokens.push(tok);
|
|
1888
1868
|
prev = tok;
|
|
1889
1869
|
};
|
|
1890
|
-
const extglobOpen = (type, value
|
|
1870
|
+
const extglobOpen = (type, value) => {
|
|
1891
1871
|
const token = {
|
|
1892
|
-
...EXTGLOB_CHARS[value
|
|
1872
|
+
...EXTGLOB_CHARS[value],
|
|
1893
1873
|
conditions: 1,
|
|
1894
1874
|
inner: ""
|
|
1895
1875
|
};
|
|
@@ -1900,7 +1880,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1900
1880
|
increment("parens");
|
|
1901
1881
|
push({
|
|
1902
1882
|
type,
|
|
1903
|
-
value
|
|
1883
|
+
value,
|
|
1904
1884
|
output: state.output ? "" : ONE_CHAR
|
|
1905
1885
|
});
|
|
1906
1886
|
push({
|
|
@@ -1937,7 +1917,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1937
1917
|
*/
|
|
1938
1918
|
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
1939
1919
|
let backslashes = false;
|
|
1940
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars
|
|
1920
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
1941
1921
|
if (first === "\\") {
|
|
1942
1922
|
backslashes = true;
|
|
1943
1923
|
return m;
|
|
@@ -1945,9 +1925,9 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1945
1925
|
if (first === "?") {
|
|
1946
1926
|
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
1947
1927
|
if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
1948
|
-
return QMARK.repeat(chars
|
|
1928
|
+
return QMARK.repeat(chars.length);
|
|
1949
1929
|
}
|
|
1950
|
-
if (first === ".") return DOT_LITERAL.repeat(chars
|
|
1930
|
+
if (first === ".") return DOT_LITERAL.repeat(chars.length);
|
|
1951
1931
|
if (first === "*") {
|
|
1952
1932
|
if (esc) return esc + first + (rest ? star : "");
|
|
1953
1933
|
return star;
|
|
@@ -2567,9 +2547,9 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2567
2547
|
};
|
|
2568
2548
|
let star = opts.bash === true ? ".*?" : STAR;
|
|
2569
2549
|
if (opts.capture) star = `(${star})`;
|
|
2570
|
-
const globstar = (opts
|
|
2571
|
-
if (opts
|
|
2572
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts
|
|
2550
|
+
const globstar = (opts) => {
|
|
2551
|
+
if (opts.noglobstar === true) return star;
|
|
2552
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
2573
2553
|
};
|
|
2574
2554
|
const create = (str) => {
|
|
2575
2555
|
switch (str) {
|
|
@@ -2584,9 +2564,9 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2584
2564
|
default: {
|
|
2585
2565
|
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
2586
2566
|
if (!match) return;
|
|
2587
|
-
const source
|
|
2588
|
-
if (!source
|
|
2589
|
-
return source
|
|
2567
|
+
const source = create(match[1]);
|
|
2568
|
+
if (!source) return;
|
|
2569
|
+
return source + DOT_LITERAL + match[2];
|
|
2590
2570
|
}
|
|
2591
2571
|
}
|
|
2592
2572
|
};
|
|
@@ -2596,7 +2576,6 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2596
2576
|
};
|
|
2597
2577
|
module.exports = parse;
|
|
2598
2578
|
}));
|
|
2599
|
-
|
|
2600
2579
|
//#endregion
|
|
2601
2580
|
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js
|
|
2602
2581
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -2631,8 +2610,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2631
2610
|
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
2632
2611
|
const arrayMatcher = (str) => {
|
|
2633
2612
|
for (const isMatch of fns) {
|
|
2634
|
-
const state
|
|
2635
|
-
if (state
|
|
2613
|
+
const state = isMatch(str);
|
|
2614
|
+
if (state) return state;
|
|
2636
2615
|
}
|
|
2637
2616
|
return false;
|
|
2638
2617
|
};
|
|
@@ -2889,10 +2868,9 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2889
2868
|
*/
|
|
2890
2869
|
module.exports = picomatch;
|
|
2891
2870
|
}));
|
|
2892
|
-
|
|
2893
2871
|
//#endregion
|
|
2894
|
-
//#region ../../node_modules/.pnpm/
|
|
2895
|
-
var
|
|
2872
|
+
//#region ../../node_modules/.pnpm/unplugin-utils@0.3.1/node_modules/unplugin-utils/dist/index.js
|
|
2873
|
+
var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2896
2874
|
const pico = require_picomatch$1();
|
|
2897
2875
|
const utils = require_utils();
|
|
2898
2876
|
function picomatch(glob, options, returnState = false) {
|
|
@@ -2904,11 +2882,7 @@ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2904
2882
|
}
|
|
2905
2883
|
Object.assign(picomatch, pico);
|
|
2906
2884
|
module.exports = picomatch;
|
|
2907
|
-
}));
|
|
2908
|
-
|
|
2909
|
-
//#endregion
|
|
2910
|
-
//#region ../../node_modules/.pnpm/unplugin-utils@0.3.1/node_modules/unplugin-utils/dist/index.js
|
|
2911
|
-
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
2885
|
+
})))(), 1);
|
|
2912
2886
|
/**
|
|
2913
2887
|
* Converts path separators to forward slash.
|
|
2914
2888
|
*/
|
|
@@ -2961,24 +2935,18 @@ function createFilter(include, exclude, options) {
|
|
|
2961
2935
|
return !includeMatchers.length;
|
|
2962
2936
|
};
|
|
2963
2937
|
}
|
|
2964
|
-
|
|
2965
2938
|
//#endregion
|
|
2966
2939
|
//#region ../../virtual-shared/integration/src/defaults.ts
|
|
2967
2940
|
const defaultPipelineExclude = [cssIdRE];
|
|
2968
2941
|
const defaultPipelineInclude = [/\.(vue|svelte|[jt]sx|vine.ts|mdx?|astro|elm|php|phtml|marko|html)($|\?)/];
|
|
2969
|
-
|
|
2970
|
-
//#endregion
|
|
2971
|
-
//#region ../../virtual-shared/integration/src/deprecation.ts
|
|
2972
|
-
function deprecationCheck(config) {}
|
|
2973
|
-
|
|
2974
2942
|
//#endregion
|
|
2975
2943
|
//#region ../../virtual-shared/integration/src/context.ts
|
|
2976
|
-
function createContext(configOrPath, defaults
|
|
2944
|
+
function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {}) {
|
|
2977
2945
|
let root = process$1.cwd();
|
|
2978
2946
|
let rawConfig = {};
|
|
2979
2947
|
let configFileList = [];
|
|
2980
2948
|
let uno;
|
|
2981
|
-
const _uno = createGenerator(rawConfig, defaults
|
|
2949
|
+
const _uno = createGenerator(rawConfig, defaults).then((r) => {
|
|
2982
2950
|
uno = r;
|
|
2983
2951
|
return r;
|
|
2984
2952
|
});
|
|
@@ -2993,9 +2961,9 @@ function createContext(configOrPath, defaults$1 = {}, extraConfigSources = [], r
|
|
|
2993
2961
|
let ready = reloadConfig();
|
|
2994
2962
|
async function reloadConfig() {
|
|
2995
2963
|
await _uno;
|
|
2996
|
-
const result = await loadConfig(root, configOrPath, extraConfigSources, defaults
|
|
2964
|
+
const result = await loadConfig(root, configOrPath, extraConfigSources, defaults);
|
|
2997
2965
|
resolveConfigResult(result);
|
|
2998
|
-
|
|
2966
|
+
result.config;
|
|
2999
2967
|
rawConfig = result.config;
|
|
3000
2968
|
configFileList = result.sources;
|
|
3001
2969
|
await uno.setConfig(rawConfig);
|
|
@@ -3021,15 +2989,15 @@ function createContext(configOrPath, defaults$1 = {}, extraConfigSources = [], r
|
|
|
3021
2989
|
reloadListeners.forEach((cb) => cb());
|
|
3022
2990
|
}
|
|
3023
2991
|
async function extract(code, id) {
|
|
3024
|
-
const uno
|
|
2992
|
+
const uno = await _uno;
|
|
3025
2993
|
if (id) modules.set(id, code);
|
|
3026
2994
|
const len = tokens.size;
|
|
3027
|
-
await uno
|
|
2995
|
+
await uno.applyExtractors(code.replace(SKIP_COMMENT_RE, ""), id, tokens);
|
|
3028
2996
|
if (tokens.size > len) invalidate();
|
|
3029
2997
|
}
|
|
3030
2998
|
function filter(code, id) {
|
|
3031
|
-
if (code.includes(
|
|
3032
|
-
return code.includes(
|
|
2999
|
+
if (code.includes("@unocss-ignore")) return false;
|
|
3000
|
+
return code.includes("@unocss-include") || code.includes("@unocss-placeholder") || rollupFilter(id.replace(/\?v=\w+$/, ""));
|
|
3033
3001
|
}
|
|
3034
3002
|
async function getConfig() {
|
|
3035
3003
|
await ready;
|
|
@@ -3049,8 +3017,8 @@ function createContext(configOrPath, defaults$1 = {}, extraConfigSources = [], r
|
|
|
3049
3017
|
if (vmpCache.has(prefix)) return vmpCache.get(prefix);
|
|
3050
3018
|
const regexes = {
|
|
3051
3019
|
prefix,
|
|
3052
|
-
RESOLVED_ID_WITH_QUERY_RE:
|
|
3053
|
-
RESOLVED_ID_RE:
|
|
3020
|
+
RESOLVED_ID_WITH_QUERY_RE: new RegExp(`[/\\\\]${prefix}(_.*?)?\\.css(\\?.*)?$`),
|
|
3021
|
+
RESOLVED_ID_RE: new RegExp(`[/\\\\]${prefix}(?:_(.*?))?\.css$`)
|
|
3054
3022
|
};
|
|
3055
3023
|
vmpCache.set(prefix, regexes);
|
|
3056
3024
|
return regexes;
|
|
@@ -3087,7 +3055,6 @@ function createContext(configOrPath, defaults$1 = {}, extraConfigSources = [], r
|
|
|
3087
3055
|
getVMPRegexes
|
|
3088
3056
|
};
|
|
3089
3057
|
}
|
|
3090
|
-
|
|
3091
3058
|
//#endregion
|
|
3092
3059
|
//#region ../../packages-presets/preset-attributify/dist/index.mjs
|
|
3093
3060
|
const variantsRE = /^(?!.*\[[^:]+:.+\]$)((?:.+:)?!?)(.*)$/;
|
|
@@ -3105,24 +3072,24 @@ function variantAttributify(options = {}) {
|
|
|
3105
3072
|
if (name.startsWith(prefix)) name = name.slice(prefix.length);
|
|
3106
3073
|
else if (prefixedOnly) return;
|
|
3107
3074
|
const content = match[2];
|
|
3108
|
-
const [, variants
|
|
3109
|
-
if (body === "~" || trueToNonValued && body === "true" || !body) return `${variants
|
|
3075
|
+
const [, variants = "", body = content] = content.match(variantsRE) || [];
|
|
3076
|
+
if (body === "~" || trueToNonValued && body === "true" || !body) return `${variants}${name}`;
|
|
3110
3077
|
if (variantsValueRE == null) {
|
|
3111
3078
|
const separators = generator?.config?.separators?.join("|");
|
|
3112
|
-
if (separators) variantsValueRE =
|
|
3079
|
+
if (separators) variantsValueRE = new RegExp(`^(.*\\](?:${separators}))(\\[[^\\]]+?\\])$`);
|
|
3113
3080
|
else variantsValueRE = false;
|
|
3114
3081
|
}
|
|
3115
3082
|
if (variantsValueRE) {
|
|
3116
3083
|
const [, bodyVariant, bracketValue] = content.match(variantsValueRE) || [];
|
|
3117
|
-
if (bracketValue) return `${bodyVariant}${variants
|
|
3084
|
+
if (bracketValue) return `${bodyVariant}${variants}${name}-${bracketValue}`;
|
|
3118
3085
|
}
|
|
3119
|
-
if (variants
|
|
3120
|
-
const variantParts = variants
|
|
3086
|
+
if (variants && body.match(/^[\d.]+$/)) {
|
|
3087
|
+
const variantParts = variants.split(/([^:]*:)/g).filter(Boolean);
|
|
3121
3088
|
const _body = variantParts.pop() + body;
|
|
3122
3089
|
const _variants = variantParts.join("");
|
|
3123
|
-
return [{ matcher: `${variants
|
|
3090
|
+
return [{ matcher: `${variants}${name}-${body}` }, { matcher: `${_variants}${name}-${_body}` }];
|
|
3124
3091
|
}
|
|
3125
|
-
return `${variants
|
|
3092
|
+
return `${variants}${name}-${body}`;
|
|
3126
3093
|
}
|
|
3127
3094
|
};
|
|
3128
3095
|
}
|
|
@@ -3137,11 +3104,11 @@ function autocompleteExtractorAttributify(options) {
|
|
|
3137
3104
|
let attrs;
|
|
3138
3105
|
let elPos = 0;
|
|
3139
3106
|
for (const match of matchedElements) {
|
|
3140
|
-
const [, prefix, content
|
|
3141
|
-
const currentPos
|
|
3142
|
-
if (cursor > currentPos
|
|
3143
|
-
elPos = currentPos
|
|
3144
|
-
attrs = content
|
|
3107
|
+
const [, prefix, content] = match;
|
|
3108
|
+
const currentPos = match.index + prefix.length;
|
|
3109
|
+
if (cursor > currentPos && cursor <= currentPos + content.length) {
|
|
3110
|
+
elPos = currentPos;
|
|
3111
|
+
attrs = content;
|
|
3145
3112
|
break;
|
|
3146
3113
|
}
|
|
3147
3114
|
}
|
|
@@ -3152,9 +3119,9 @@ function autocompleteExtractorAttributify(options) {
|
|
|
3152
3119
|
let attrValues;
|
|
3153
3120
|
for (const match of matchedAttributes) {
|
|
3154
3121
|
const [matched, name, rawValues] = match;
|
|
3155
|
-
const currentPos
|
|
3156
|
-
if (cursor > currentPos
|
|
3157
|
-
attrsPos = currentPos
|
|
3122
|
+
const currentPos = elPos + match.index;
|
|
3123
|
+
if (cursor > currentPos && cursor <= currentPos + matched.length) {
|
|
3124
|
+
attrsPos = currentPos;
|
|
3158
3125
|
attrName = name;
|
|
3159
3126
|
attrValues = rawValues?.slice(1);
|
|
3160
3127
|
break;
|
|
@@ -3190,17 +3157,17 @@ function autocompleteExtractorAttributify(options) {
|
|
|
3190
3157
|
matchSplit = splitterRE$1.exec(attrValues.slice(currentPos));
|
|
3191
3158
|
}
|
|
3192
3159
|
if (value === void 0) value = attrValues.slice(currentPos);
|
|
3193
|
-
const [, variants
|
|
3160
|
+
const [, variants = "", body] = value.match(variantsRE) || [];
|
|
3194
3161
|
return {
|
|
3195
|
-
extracted: `${variants
|
|
3162
|
+
extracted: `${variants}${attrNameWithoutPrefix}-${body}`,
|
|
3196
3163
|
transformSuggestions(suggestions) {
|
|
3197
|
-
return suggestions.filter((v) => v.startsWith(`${variants
|
|
3164
|
+
return suggestions.filter((v) => v.startsWith(`${variants}${attrNameWithoutPrefix}-`)).map((v) => variants + v.slice(variants.length + attrNameWithoutPrefix.length + 1));
|
|
3198
3165
|
},
|
|
3199
3166
|
resolveReplacement(suggestion) {
|
|
3200
3167
|
return {
|
|
3201
3168
|
start: currentPos + attrValuePos,
|
|
3202
3169
|
end: currentPos + attrValuePos + value.length,
|
|
3203
|
-
replacement: variants
|
|
3170
|
+
replacement: variants + suggestion.slice(variants.length + attrNameWithoutPrefix.length + 1)
|
|
3204
3171
|
};
|
|
3205
3172
|
}
|
|
3206
3173
|
};
|
|
@@ -3224,8 +3191,8 @@ function extractorAttributify(options) {
|
|
|
3224
3191
|
return {
|
|
3225
3192
|
name: "@unocss/preset-attributify/extractor",
|
|
3226
3193
|
extract({ code }) {
|
|
3227
|
-
return Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents
|
|
3228
|
-
const content = contents
|
|
3194
|
+
return Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
3195
|
+
const content = contents.filter(Boolean).join("");
|
|
3229
3196
|
if (ignoreAttributes.includes(name)) return [];
|
|
3230
3197
|
for (const prefix of strippedPrefixes) if (name.startsWith(prefix)) {
|
|
3231
3198
|
name = name.slice(prefix.length);
|
|
@@ -3286,8 +3253,6 @@ const presetAttributify = definePreset((options = {}) => {
|
|
|
3286
3253
|
extractorDefault: options.strict ? false : void 0
|
|
3287
3254
|
};
|
|
3288
3255
|
});
|
|
3289
|
-
var src_default$5 = presetAttributify;
|
|
3290
|
-
|
|
3291
3256
|
//#endregion
|
|
3292
3257
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/svg/url.js
|
|
3293
3258
|
/**
|
|
@@ -3299,7 +3264,6 @@ var src_default$5 = presetAttributify;
|
|
|
3299
3264
|
function encodeSVGforURL(svg) {
|
|
3300
3265
|
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
3301
3266
|
}
|
|
3302
|
-
|
|
3303
3267
|
//#endregion
|
|
3304
3268
|
//#region ../../node_modules/.pnpm/@iconify+utils@3.1.0/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js
|
|
3305
3269
|
/**
|
|
@@ -3313,9 +3277,8 @@ function encodeSvgForCss(svg) {
|
|
|
3313
3277
|
if (!useSvg.includes(" xmlns=")) useSvg = useSvg.replace("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" ");
|
|
3314
3278
|
return encodeSVGforURL(useSvg);
|
|
3315
3279
|
}
|
|
3316
|
-
|
|
3317
3280
|
//#endregion
|
|
3318
|
-
//#region ../../packages-presets/preset-icons/dist/core-
|
|
3281
|
+
//#region ../../packages-presets/preset-icons/dist/core-CVWr9MHW.mjs
|
|
3319
3282
|
function getEnvFlags() {
|
|
3320
3283
|
const isNode = typeof process !== "undefined" && process.stdout;
|
|
3321
3284
|
return {
|
|
@@ -3695,14 +3658,12 @@ async function parseIconWithLoader(body, loader, options = {}, safeCollectionsNa
|
|
|
3695
3658
|
svg
|
|
3696
3659
|
};
|
|
3697
3660
|
}
|
|
3698
|
-
|
|
3699
3661
|
//#endregion
|
|
3700
|
-
//#region ../../packages-presets/preset-icons/dist/cdn-
|
|
3662
|
+
//#region ../../packages-presets/preset-icons/dist/cdn-fz6F-x8c.mjs
|
|
3701
3663
|
async function createCDNLoader(cdnBase) {
|
|
3702
|
-
const { $fetch } = await import("./node-
|
|
3664
|
+
const { $fetch } = await import("./node-D23LglTq.mjs");
|
|
3703
3665
|
return createCDNFetchLoader($fetch, cdnBase);
|
|
3704
3666
|
}
|
|
3705
|
-
|
|
3706
3667
|
//#endregion
|
|
3707
3668
|
//#region ../../packages-presets/preset-icons/dist/index.mjs
|
|
3708
3669
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
@@ -3739,14 +3700,12 @@ const presetIcons = /* @__PURE__ */ definePreset((options = {}) => {
|
|
|
3739
3700
|
});
|
|
3740
3701
|
async function createNodeLoader() {
|
|
3741
3702
|
try {
|
|
3742
|
-
return await import("./node-loader-
|
|
3703
|
+
return await import("./node-loader-ZSa5xzQw.mjs").then((i) => i?.loadNodeIcon);
|
|
3743
3704
|
} catch {}
|
|
3744
3705
|
try {
|
|
3745
3706
|
return __require("@iconify/utils/lib/loader/node-loader.cjs").loadNodeIcon;
|
|
3746
3707
|
} catch {}
|
|
3747
3708
|
}
|
|
3748
|
-
var src_default$4 = presetIcons;
|
|
3749
|
-
|
|
3750
3709
|
//#endregion
|
|
3751
3710
|
//#region ../../packages-presets/preset-tagify/dist/index.mjs
|
|
3752
3711
|
const MARKER = "__TAGIFY__";
|
|
@@ -3780,13 +3739,13 @@ function variantTagify(options) {
|
|
|
3780
3739
|
match(input) {
|
|
3781
3740
|
if (!input.startsWith(prefix)) return;
|
|
3782
3741
|
const matcher = input.slice(prefix.length);
|
|
3783
|
-
const handler
|
|
3742
|
+
const handler = {
|
|
3784
3743
|
matcher,
|
|
3785
3744
|
selector: (i) => i.slice(11)
|
|
3786
3745
|
};
|
|
3787
|
-
if (extraProperties) if (typeof extraProperties === "function") handler
|
|
3788
|
-
else handler
|
|
3789
|
-
return handler
|
|
3746
|
+
if (extraProperties) if (typeof extraProperties === "function") handler.body = (entries) => [...entries, ...Object.entries(extraProperties(matcher) ?? {})];
|
|
3747
|
+
else handler.body = (entries) => [...entries, ...Object.entries(extraProperties)];
|
|
3748
|
+
return handler;
|
|
3790
3749
|
}
|
|
3791
3750
|
};
|
|
3792
3751
|
}
|
|
@@ -3802,8 +3761,6 @@ const presetTagify = definePreset((options = {}) => {
|
|
|
3802
3761
|
extractorDefault: defaultExtractor ? void 0 : false
|
|
3803
3762
|
};
|
|
3804
3763
|
});
|
|
3805
|
-
var src_default$3 = presetTagify;
|
|
3806
|
-
|
|
3807
3764
|
//#endregion
|
|
3808
3765
|
//#region ../../packages-presets/rule-utils/dist/index.mjs
|
|
3809
3766
|
function getBracket(str, open, close) {
|
|
@@ -3953,7 +3910,7 @@ function parseHexColor(str) {
|
|
|
3953
3910
|
switch (body.length) {
|
|
3954
3911
|
case 3:
|
|
3955
3912
|
case 4: {
|
|
3956
|
-
const digits = Array.from(body, (s) => Number.parseInt(s, 16)).map((n
|
|
3913
|
+
const digits = Array.from(body, (s) => Number.parseInt(s, 16)).map((n) => n << 4 | n);
|
|
3957
3914
|
return {
|
|
3958
3915
|
type: "rgb",
|
|
3959
3916
|
components: digits.slice(0, 3),
|
|
@@ -4061,21 +4018,21 @@ const themeFnRE = /theme\(\s*(['"])?(.*?)\1?\s*\)/g;
|
|
|
4061
4018
|
function hasThemeFn(str) {
|
|
4062
4019
|
return str.includes("theme(") && str.includes(")");
|
|
4063
4020
|
}
|
|
4064
|
-
function transformThemeFn(code, theme
|
|
4021
|
+
function transformThemeFn(code, theme, throwOnMissing = true) {
|
|
4065
4022
|
const matches = Array.from(code.toString().matchAll(themeFnRE));
|
|
4066
4023
|
if (!matches.length) return code;
|
|
4067
4024
|
const s = new MagicString(code);
|
|
4068
4025
|
for (const match of matches) {
|
|
4069
4026
|
const rawArg = match[2];
|
|
4070
4027
|
if (!rawArg) throw new Error("theme() expect exact one argument, but got 0");
|
|
4071
|
-
const value = transformThemeString(rawArg, theme
|
|
4028
|
+
const value = transformThemeString(rawArg, theme, throwOnMissing);
|
|
4072
4029
|
if (value) s.overwrite(match.index, match.index + match[0].length, value);
|
|
4073
4030
|
}
|
|
4074
4031
|
return s.toString();
|
|
4075
4032
|
}
|
|
4076
|
-
function transformThemeString(code, theme
|
|
4033
|
+
function transformThemeString(code, theme, throwOnMissing = true) {
|
|
4077
4034
|
const [rawKey, alpha] = code.split("/");
|
|
4078
|
-
let value = rawKey.trim().split(".").reduce((t, k) => t === null || t === void 0 ? void 0 : t[k], theme
|
|
4035
|
+
let value = rawKey.trim().split(".").reduce((t, k) => t === null || t === void 0 ? void 0 : t[k], theme);
|
|
4079
4036
|
if (typeof value === "object") value = value.DEFAULT;
|
|
4080
4037
|
if (typeof value === "string") {
|
|
4081
4038
|
if (alpha) {
|
|
@@ -4096,12 +4053,12 @@ function calcMaxWidthBySize(size) {
|
|
|
4096
4053
|
return `calc(${size} - 0.1px)`;
|
|
4097
4054
|
}
|
|
4098
4055
|
function createValueHandler(handlers) {
|
|
4099
|
-
const handler
|
|
4056
|
+
const handler = function(str, theme) {
|
|
4100
4057
|
var _this$__options;
|
|
4101
4058
|
const s = ((_this$__options = this.__options) === null || _this$__options === void 0 ? void 0 : _this$__options.sequence) || [];
|
|
4102
4059
|
this.__options.sequence = [];
|
|
4103
|
-
for (const n
|
|
4104
|
-
const res = handlers[n
|
|
4060
|
+
for (const n of s) {
|
|
4061
|
+
const res = handlers[n](str, theme);
|
|
4105
4062
|
if (res != null) return res;
|
|
4106
4063
|
}
|
|
4107
4064
|
};
|
|
@@ -4110,14 +4067,14 @@ function createValueHandler(handlers) {
|
|
|
4110
4067
|
that.__options.sequence.push(name);
|
|
4111
4068
|
return that;
|
|
4112
4069
|
}
|
|
4113
|
-
for (const name of Object.keys(handlers)) Object.defineProperty(handler
|
|
4070
|
+
for (const name of Object.keys(handlers)) Object.defineProperty(handler, name, {
|
|
4114
4071
|
enumerable: true,
|
|
4115
4072
|
configurable: true,
|
|
4116
4073
|
get() {
|
|
4117
4074
|
return addProcessor(this, name);
|
|
4118
4075
|
}
|
|
4119
4076
|
});
|
|
4120
|
-
return handler
|
|
4077
|
+
return handler;
|
|
4121
4078
|
}
|
|
4122
4079
|
const PseudoPlaceholder = "__pseudo_placeholder__";
|
|
4123
4080
|
/**
|
|
@@ -4177,7 +4134,8 @@ const PseudoClasses = Object.fromEntries([
|
|
|
4177
4134
|
["placeholder", "::placeholder"],
|
|
4178
4135
|
["before", "::before"],
|
|
4179
4136
|
["after", "::after"],
|
|
4180
|
-
["file", "::file-selector-button"]
|
|
4137
|
+
["file", "::file-selector-button"],
|
|
4138
|
+
["details-content", "::details-content"]
|
|
4181
4139
|
].map((key) => Array.isArray(key) ? key : [key, `:${key}`]));
|
|
4182
4140
|
const PseudoClassesKeys = Object.keys(PseudoClasses);
|
|
4183
4141
|
const PseudoClassesColon = Object.fromEntries([["backdrop", "::backdrop"]].map((key) => Array.isArray(key) ? key : [key, `:${key}`]));
|
|
@@ -4206,18 +4164,18 @@ const excludedPseudo = [
|
|
|
4206
4164
|
const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).sort((a, b) => b.length - a.length).join("|");
|
|
4207
4165
|
const PseudoClassesAndElementsColonStr = Object.entries(PseudoClassesColon).map(([key]) => key).sort((a, b) => b.length - a.length).join("|");
|
|
4208
4166
|
function createTaggedPseudoClassMatcher(tag, parent, combinator, utils) {
|
|
4209
|
-
const { h
|
|
4210
|
-
const rawRE =
|
|
4167
|
+
const { h, variantGetBracket } = utils;
|
|
4168
|
+
const rawRE = new RegExp(`^(${escapeRegExp(parent)}:)(\\S+)${escapeRegExp(combinator)}\\1`);
|
|
4211
4169
|
let splitRE;
|
|
4212
4170
|
let pseudoRE;
|
|
4213
4171
|
let pseudoColonRE;
|
|
4214
4172
|
let pseudoVarRE;
|
|
4215
4173
|
const matchBracket = (input) => {
|
|
4216
4174
|
var _rest$split;
|
|
4217
|
-
const body = variantGetBracket
|
|
4175
|
+
const body = variantGetBracket(`${tag}-`, input, []);
|
|
4218
4176
|
if (!body) return;
|
|
4219
4177
|
const [match, rest] = body;
|
|
4220
|
-
const bracketValue = h
|
|
4178
|
+
const bracketValue = h.bracket(match);
|
|
4221
4179
|
if (bracketValue == null) return;
|
|
4222
4180
|
const label = ((_rest$split = rest.split(splitRE, 1)) === null || _rest$split === void 0 ? void 0 : _rest$split[0]) ?? "";
|
|
4223
4181
|
const prefix = `${parent}${escapeSelector(label)}`;
|
|
@@ -4257,10 +4215,10 @@ function createTaggedPseudoClassMatcher(tag, parent, combinator, utils) {
|
|
|
4257
4215
|
name: `pseudo:${tag}`,
|
|
4258
4216
|
match(input, ctx) {
|
|
4259
4217
|
if (!(splitRE && pseudoRE && pseudoColonRE)) {
|
|
4260
|
-
splitRE =
|
|
4261
|
-
pseudoRE =
|
|
4262
|
-
pseudoColonRE =
|
|
4263
|
-
pseudoVarRE =
|
|
4218
|
+
splitRE = new RegExp(`(?:${ctx.generator.config.separators.join("|")})`);
|
|
4219
|
+
pseudoRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))(?:(/[\\w-]+))?(?:${ctx.generator.config.separators.join("|")})`);
|
|
4220
|
+
pseudoColonRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))(?:(/[\\w-]+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
4221
|
+
pseudoVarRE = new RegExp(`^${tag}-(?:(${PseudoClassFunctionsStr})-)?\\[(.+)\\](?:(/[\\w-]+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
4264
4222
|
}
|
|
4265
4223
|
if (!input.startsWith(tag)) return;
|
|
4266
4224
|
const result = matchBracket(input) || matchPseudo(input) || matchPseudoVar(input);
|
|
@@ -4268,9 +4226,9 @@ function createTaggedPseudoClassMatcher(tag, parent, combinator, utils) {
|
|
|
4268
4226
|
const [_label, matcher, prefix, pseudoName = ""] = result;
|
|
4269
4227
|
return {
|
|
4270
4228
|
matcher,
|
|
4271
|
-
handle: (input
|
|
4272
|
-
...input
|
|
4273
|
-
prefix: `${prefix}${combinator}${input
|
|
4229
|
+
handle: (input, next) => next({
|
|
4230
|
+
...input,
|
|
4231
|
+
prefix: `${prefix}${combinator}${input.prefix}`.replace(rawRE, "$1$2:"),
|
|
4274
4232
|
sort: PseudoClassesKeys.indexOf(pseudoName) ?? PseudoClassesColonKeys.indexOf(pseudoName)
|
|
4275
4233
|
})
|
|
4276
4234
|
};
|
|
@@ -4279,7 +4237,7 @@ function createTaggedPseudoClassMatcher(tag, parent, combinator, utils) {
|
|
|
4279
4237
|
};
|
|
4280
4238
|
}
|
|
4281
4239
|
function createPseudoClassesAndElements(utils) {
|
|
4282
|
-
const { h
|
|
4240
|
+
const { h } = utils;
|
|
4283
4241
|
let PseudoClassesAndElementsRE;
|
|
4284
4242
|
let PseudoClassesAndElementsColonRE;
|
|
4285
4243
|
let PseudoClassesMultiRE;
|
|
@@ -4287,15 +4245,15 @@ function createPseudoClassesAndElements(utils) {
|
|
|
4287
4245
|
name: "pseudo",
|
|
4288
4246
|
match(input, ctx) {
|
|
4289
4247
|
if (!(PseudoClassesAndElementsRE && PseudoClassesAndElementsColonRE)) {
|
|
4290
|
-
PseudoClassesAndElementsRE =
|
|
4291
|
-
PseudoClassesAndElementsColonRE =
|
|
4248
|
+
PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})(?:-(\\d+|\\[(\\w|[+-.])+\\]))?(?:${ctx.generator.config.separators.join("|")})`);
|
|
4249
|
+
PseudoClassesAndElementsColonRE = new RegExp(`^(${PseudoClassesAndElementsColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
4292
4250
|
}
|
|
4293
4251
|
const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE);
|
|
4294
4252
|
if (match) {
|
|
4295
4253
|
let pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
|
|
4296
4254
|
if (match[2]) {
|
|
4297
4255
|
let anPlusB;
|
|
4298
|
-
if (match[2].startsWith("[") && match[2].endsWith("]")) anPlusB = h
|
|
4256
|
+
if (match[2].startsWith("[") && match[2].endsWith("]")) anPlusB = h.bracket(match[2]);
|
|
4299
4257
|
else anPlusB = match[2];
|
|
4300
4258
|
if (anPlusB) pseudo = pseudo.replace(PseudoPlaceholder, anPlusB);
|
|
4301
4259
|
}
|
|
@@ -4304,10 +4262,10 @@ function createPseudoClassesAndElements(utils) {
|
|
|
4304
4262
|
if (index === -1) index = void 0;
|
|
4305
4263
|
return {
|
|
4306
4264
|
matcher: input.slice(match[0].length),
|
|
4307
|
-
handle: (input
|
|
4308
|
-
const selectors = pseudo.includes("::") && !excludedPseudo.includes(pseudo) ? { pseudo: `${input
|
|
4265
|
+
handle: (input, next) => {
|
|
4266
|
+
const selectors = pseudo.includes("::") && !excludedPseudo.includes(pseudo) ? { pseudo: `${input.pseudo}${pseudo}` } : { selector: `${input.selector}${pseudo}` };
|
|
4309
4267
|
return next({
|
|
4310
|
-
...input
|
|
4268
|
+
...input,
|
|
4311
4269
|
...selectors,
|
|
4312
4270
|
sort: index,
|
|
4313
4271
|
noMerge: true
|
|
@@ -4321,14 +4279,14 @@ function createPseudoClassesAndElements(utils) {
|
|
|
4321
4279
|
}, {
|
|
4322
4280
|
name: "pseudo:multi",
|
|
4323
4281
|
match(input, ctx) {
|
|
4324
|
-
if (!PseudoClassesMultiRE) PseudoClassesMultiRE =
|
|
4282
|
+
if (!PseudoClassesMultiRE) PseudoClassesMultiRE = new RegExp(`^(${PseudoClassesMultiStr})(?:${ctx.generator.config.separators.join("|")})`);
|
|
4325
4283
|
const match = input.match(PseudoClassesMultiRE);
|
|
4326
4284
|
if (match) return PseudoClassesMulti[match[1]].map((pseudo) => {
|
|
4327
4285
|
return {
|
|
4328
4286
|
matcher: input.slice(match[0].length),
|
|
4329
|
-
handle: (input
|
|
4330
|
-
...input
|
|
4331
|
-
pseudo: `${input
|
|
4287
|
+
handle: (input, next) => next({
|
|
4288
|
+
...input,
|
|
4289
|
+
pseudo: `${input.pseudo}${pseudo}`
|
|
4332
4290
|
})
|
|
4333
4291
|
};
|
|
4334
4292
|
});
|
|
@@ -4338,21 +4296,21 @@ function createPseudoClassesAndElements(utils) {
|
|
|
4338
4296
|
}];
|
|
4339
4297
|
}
|
|
4340
4298
|
function createPseudoClassFunctions(utils) {
|
|
4341
|
-
const { getBracket
|
|
4299
|
+
const { getBracket, h } = utils;
|
|
4342
4300
|
let PseudoClassFunctionsRE;
|
|
4343
4301
|
let PseudoClassColonFunctionsRE;
|
|
4344
4302
|
let PseudoClassVarFunctionRE;
|
|
4345
4303
|
return {
|
|
4346
4304
|
match(input, ctx) {
|
|
4347
4305
|
if (!(PseudoClassFunctionsRE && PseudoClassColonFunctionsRE)) {
|
|
4348
|
-
PseudoClassFunctionsRE =
|
|
4349
|
-
PseudoClassColonFunctionsRE =
|
|
4350
|
-
PseudoClassVarFunctionRE =
|
|
4306
|
+
PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})(?:${ctx.generator.config.separators.join("|")})`);
|
|
4307
|
+
PseudoClassColonFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
4308
|
+
PseudoClassVarFunctionRE = new RegExp(`^(${PseudoClassFunctionsStr})-(\\[.+\\])(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
|
|
4351
4309
|
}
|
|
4352
4310
|
const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE) || input.match(PseudoClassVarFunctionRE);
|
|
4353
4311
|
if (match) {
|
|
4354
4312
|
const fn = match[1];
|
|
4355
|
-
const pseudo = getBracket
|
|
4313
|
+
const pseudo = getBracket(match[2], "[", "]") ? h.bracket(match[2]) : PseudoClasses[match[2]] || PseudoClassesColon[match[2]] || `:${match[2]}`;
|
|
4356
4314
|
return {
|
|
4357
4315
|
matcher: input.slice(match[0].length),
|
|
4358
4316
|
selector: (s) => `${s}:${fn}(${pseudo})`
|
|
@@ -4391,20 +4349,20 @@ function createPartClasses() {
|
|
|
4391
4349
|
multiPass: true
|
|
4392
4350
|
};
|
|
4393
4351
|
}
|
|
4394
|
-
function variantMatcher(name, handler
|
|
4352
|
+
function variantMatcher(name, handler, options = {}) {
|
|
4395
4353
|
let re;
|
|
4396
4354
|
return {
|
|
4397
4355
|
name,
|
|
4398
4356
|
match(input, ctx) {
|
|
4399
|
-
if (!re) re =
|
|
4357
|
+
if (!re) re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
4400
4358
|
const match = input.match(re);
|
|
4401
4359
|
if (match) {
|
|
4402
4360
|
const matcher = input.slice(match[0].length);
|
|
4403
|
-
const handlers = toArray(handler
|
|
4361
|
+
const handlers = toArray(handler).map((handler) => ({
|
|
4404
4362
|
matcher,
|
|
4405
|
-
handle: (input
|
|
4406
|
-
...input
|
|
4407
|
-
...handler
|
|
4363
|
+
handle: (input, next) => next({
|
|
4364
|
+
...input,
|
|
4365
|
+
...handler(input)
|
|
4408
4366
|
}),
|
|
4409
4367
|
...options
|
|
4410
4368
|
}));
|
|
@@ -4419,13 +4377,13 @@ function variantParentMatcher(name, parent) {
|
|
|
4419
4377
|
return {
|
|
4420
4378
|
name,
|
|
4421
4379
|
match(input, ctx) {
|
|
4422
|
-
if (!re) re =
|
|
4380
|
+
if (!re) re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
4423
4381
|
const match = input.match(re);
|
|
4424
4382
|
if (match) return {
|
|
4425
4383
|
matcher: input.slice(match[0].length),
|
|
4426
|
-
handle: (input
|
|
4427
|
-
...input
|
|
4428
|
-
parent: `${input
|
|
4384
|
+
handle: (input, next) => next({
|
|
4385
|
+
...input,
|
|
4386
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}${parent}`
|
|
4429
4387
|
})
|
|
4430
4388
|
};
|
|
4431
4389
|
},
|
|
@@ -4474,7 +4432,6 @@ function variantGetParameter(prefix, matcher, separators) {
|
|
|
4474
4432
|
}
|
|
4475
4433
|
}
|
|
4476
4434
|
}
|
|
4477
|
-
|
|
4478
4435
|
//#endregion
|
|
4479
4436
|
//#region ../../packages-presets/preset-typography/dist/index.mjs
|
|
4480
4437
|
const modifiers = [
|
|
@@ -4537,8 +4494,8 @@ const defaultColorScheme = {
|
|
|
4537
4494
|
"td-borders": [200, 700]
|
|
4538
4495
|
};
|
|
4539
4496
|
const round$1 = (num) => num.toFixed(7).replace(/0+$/, "").replace(/\.$/, "");
|
|
4540
|
-
const rem$1 = (px
|
|
4541
|
-
const em = (px
|
|
4497
|
+
const rem$1 = (px) => `${round$1(px / 16)}rem`;
|
|
4498
|
+
const em = (px, base) => `${round$1(px / base)}em`;
|
|
4542
4499
|
const ProseDefaultCSSObject = {
|
|
4543
4500
|
"color": "var(--un-prose-body)",
|
|
4544
4501
|
"max-width": "65ch",
|
|
@@ -5503,17 +5460,17 @@ function resolveSizeScheme(userSizeScheme) {
|
|
|
5503
5460
|
if (userSizeScheme) return mergeDeep(ProseDefaultSize, userSizeScheme);
|
|
5504
5461
|
return ProseDefaultSize;
|
|
5505
5462
|
}
|
|
5506
|
-
function getCSS$1(preflights
|
|
5463
|
+
function getCSS$1(preflights, options) {
|
|
5507
5464
|
const selectorName = options.selectorName || "prose";
|
|
5508
5465
|
const notProseSelector = `:not(:where([class~="not-${selectorName}"],[class~="not-${selectorName}"] *))`;
|
|
5509
|
-
const important
|
|
5466
|
+
const important = options.important === true;
|
|
5510
5467
|
let css = "";
|
|
5511
|
-
for (const [selectorOrKey, cssObjectOrValue] of Object.entries(preflights
|
|
5468
|
+
for (const [selectorOrKey, cssObjectOrValue] of Object.entries(preflights)) if (typeof cssObjectOrValue !== "object") css += `${selectorOrKey}:${cssObjectOrValue}${important ? " !important" : ""};`;
|
|
5512
5469
|
else {
|
|
5513
5470
|
const [selectorOrGroup, pseudo] = selectorOrKey.split("::");
|
|
5514
5471
|
const _selector = `:where(${selectorOrGroup})${notProseSelector}${pseudo ? `::${pseudo}` : ""}`;
|
|
5515
5472
|
css += `${_selector} {`;
|
|
5516
|
-
for (const [key, value] of Object.entries(cssObjectOrValue)) css += `${key}:${value}${important
|
|
5473
|
+
for (const [key, value] of Object.entries(cssObjectOrValue)) css += `${key}:${value}${important ? " !important" : ""};`;
|
|
5517
5474
|
css += `}`;
|
|
5518
5475
|
}
|
|
5519
5476
|
return css;
|
|
@@ -5547,8 +5504,8 @@ const presetTypography = definePreset((options) => {
|
|
|
5547
5504
|
const cssVarPrefix = options?.cssVarPrefix ?? "--un-prose";
|
|
5548
5505
|
const resolvedColorScheme = resolveColorScheme(options?.colorScheme);
|
|
5549
5506
|
const resolvedSizeScheme = resolveSizeScheme(options?.sizeScheme);
|
|
5550
|
-
const extended = (entries, theme
|
|
5551
|
-
const merged = mergeDeep(entries, (typeof options?.cssExtend === "function" ? options?.cssExtend(theme
|
|
5507
|
+
const extended = (entries, theme) => {
|
|
5508
|
+
const merged = mergeDeep(entries, (typeof options?.cssExtend === "function" ? options?.cssExtend(theme) : options?.cssExtend) ?? {});
|
|
5552
5509
|
for (const key in merged) {
|
|
5553
5510
|
const value = merged[key];
|
|
5554
5511
|
if (value == null || typeof value === "object" && Object.keys(value).length === 0) delete merged[key];
|
|
@@ -5560,9 +5517,9 @@ const presetTypography = definePreset((options) => {
|
|
|
5560
5517
|
if (!options?.compatibility?.noColonIs) s = `:is(${s})`;
|
|
5561
5518
|
return s;
|
|
5562
5519
|
};
|
|
5563
|
-
const defaultRE =
|
|
5564
|
-
const colorsRE =
|
|
5565
|
-
const sizeRE =
|
|
5520
|
+
const defaultRE = new RegExp(`^${selectorName}-default$`);
|
|
5521
|
+
const colorsRE = new RegExp(`^${selectorName}-([-\\w]+)$`);
|
|
5522
|
+
const sizeRE = new RegExp(`^${selectorName}-(${Object.keys(resolvedSizeScheme).join("|")})$`);
|
|
5566
5523
|
return {
|
|
5567
5524
|
name: "@unocss/preset-typography",
|
|
5568
5525
|
enforce: "post",
|
|
@@ -5575,11 +5532,11 @@ const presetTypography = definePreset((options) => {
|
|
|
5575
5532
|
rules: [
|
|
5576
5533
|
[
|
|
5577
5534
|
defaultRE,
|
|
5578
|
-
(_, { symbols
|
|
5579
|
-
const css = getCSS$1(extended(mergeDeep(ProseDefaultCSSObject, ProseDefaultSize.base), theme
|
|
5535
|
+
(_, { symbols, theme }) => {
|
|
5536
|
+
const css = getCSS$1(extended(mergeDeep(ProseDefaultCSSObject, ProseDefaultSize.base), theme), options ?? {});
|
|
5580
5537
|
return {
|
|
5581
|
-
[symbols
|
|
5582
|
-
[symbols
|
|
5538
|
+
[symbols.body]: css,
|
|
5539
|
+
[symbols.selector]: normalizeSelector
|
|
5583
5540
|
};
|
|
5584
5541
|
},
|
|
5585
5542
|
{
|
|
@@ -5590,8 +5547,8 @@ const presetTypography = definePreset((options) => {
|
|
|
5590
5547
|
],
|
|
5591
5548
|
[
|
|
5592
5549
|
colorsRE,
|
|
5593
|
-
([, color], { theme
|
|
5594
|
-
const baseColor = theme
|
|
5550
|
+
([, color], { theme, symbols }) => {
|
|
5551
|
+
const baseColor = theme.colors?.[color];
|
|
5595
5552
|
if (!baseColor || typeof baseColor !== "object") return;
|
|
5596
5553
|
if ([
|
|
5597
5554
|
"red",
|
|
@@ -5614,20 +5571,20 @@ const presetTypography = definePreset((options) => {
|
|
|
5614
5571
|
].includes(color)) return {
|
|
5615
5572
|
[`${cssVarPrefix}-links`]: baseColor["600"],
|
|
5616
5573
|
[`${cssVarPrefix}-invert-links`]: baseColor["500"],
|
|
5617
|
-
[symbols
|
|
5574
|
+
[symbols.selector]: normalizeSelector
|
|
5618
5575
|
};
|
|
5619
5576
|
else return Object.entries(resolvedColorScheme).reduce((acc, [key, value]) => {
|
|
5620
5577
|
const [colorKey, invertKey] = value;
|
|
5621
|
-
const resolve
|
|
5622
|
-
const color
|
|
5623
|
-
const invertColor = resolve
|
|
5578
|
+
const resolve = (key) => baseColor[key] ?? theme[key] ?? key;
|
|
5579
|
+
const color = resolve(colorKey);
|
|
5580
|
+
const invertColor = resolve(invertKey);
|
|
5624
5581
|
const cssVarColorKey = `${cssVarPrefix}-${key}`;
|
|
5625
5582
|
const cssVarInvertColorKey = `${cssVarPrefix}-invert-${key}`;
|
|
5626
|
-
acc[cssVarColorKey] = colorToString(color
|
|
5583
|
+
acc[cssVarColorKey] = colorToString(color, `var(${cssVarColorKey}-opacity)`);
|
|
5627
5584
|
acc[cssVarInvertColorKey] = colorToString(invertColor, `var(${cssVarInvertColorKey}-opacity)`);
|
|
5628
|
-
for (const [c, k] of [[color
|
|
5585
|
+
for (const [c, k] of [[color, `${cssVarColorKey}-opacity`], [invertColor, `${cssVarInvertColorKey}-opacity`]]) if (alphaPlaceholders.some((p) => c.includes(p))) acc[k] = "1";
|
|
5629
5586
|
return acc;
|
|
5630
|
-
}, { [symbols
|
|
5587
|
+
}, { [symbols.selector]: normalizeSelector });
|
|
5631
5588
|
},
|
|
5632
5589
|
{
|
|
5633
5590
|
layer: "typography",
|
|
@@ -5636,11 +5593,11 @@ const presetTypography = definePreset((options) => {
|
|
|
5636
5593
|
],
|
|
5637
5594
|
[
|
|
5638
5595
|
sizeRE,
|
|
5639
|
-
([, size], { symbols
|
|
5640
|
-
const css = getCSS$1(extended(resolvedSizeScheme[size], theme
|
|
5596
|
+
([, size], { symbols, theme }) => {
|
|
5597
|
+
const css = getCSS$1(extended(resolvedSizeScheme[size], theme), options ?? {});
|
|
5641
5598
|
return {
|
|
5642
|
-
[symbols
|
|
5643
|
-
[symbols
|
|
5599
|
+
[symbols.body]: css,
|
|
5600
|
+
[symbols.selector]: normalizeSelector
|
|
5644
5601
|
};
|
|
5645
5602
|
},
|
|
5646
5603
|
{
|
|
@@ -5678,7 +5635,7 @@ const presetTypography = definePreset((options) => {
|
|
|
5678
5635
|
name: "typography element modifiers",
|
|
5679
5636
|
match: (matcher) => {
|
|
5680
5637
|
if (matcher.startsWith(`${selectorName}-`)) {
|
|
5681
|
-
const modifyRe =
|
|
5638
|
+
const modifyRe = new RegExp(`^${selectorName}-(\\w+)[:-].+$`);
|
|
5682
5639
|
const modifier = matcher.match(modifyRe)?.[1];
|
|
5683
5640
|
if (modifier) {
|
|
5684
5641
|
const elements = getElements(modifier);
|
|
@@ -5696,17 +5653,15 @@ const presetTypography = definePreset((options) => {
|
|
|
5696
5653
|
}]
|
|
5697
5654
|
};
|
|
5698
5655
|
});
|
|
5699
|
-
var src_default$2 = presetTypography;
|
|
5700
|
-
|
|
5701
5656
|
//#endregion
|
|
5702
5657
|
//#region ../../packages-presets/preset-web-fonts/dist/index.mjs
|
|
5703
5658
|
function createBunnyFontsProvider(name, host) {
|
|
5704
5659
|
return {
|
|
5705
5660
|
name,
|
|
5706
|
-
getImportUrl(fonts
|
|
5707
|
-
return `${host}/css?family=${fonts
|
|
5708
|
-
const { name
|
|
5709
|
-
const formattedName = name
|
|
5661
|
+
getImportUrl(fonts) {
|
|
5662
|
+
return `${host}/css?family=${fonts.map((font) => {
|
|
5663
|
+
const { name, weights, italic } = font;
|
|
5664
|
+
const formattedName = name.toLowerCase().replace(/\s/g, "-");
|
|
5710
5665
|
if (!weights?.length) return `${formattedName}${italic ? ":i" : ""}`;
|
|
5711
5666
|
let weightsAsString = weights.map((weight) => weight.toString());
|
|
5712
5667
|
if (!weightsAsString.some((weight) => weight.endsWith("i")) && italic) weightsAsString = weightsAsString.map((weight) => weight += "i");
|
|
@@ -5729,9 +5684,9 @@ function generateFontAxes(axes) {
|
|
|
5729
5684
|
function createGoogleCompatibleProvider(name, host) {
|
|
5730
5685
|
return {
|
|
5731
5686
|
name,
|
|
5732
|
-
getImportUrl(fonts
|
|
5733
|
-
return `${host}/css2?${fonts
|
|
5734
|
-
let name
|
|
5687
|
+
getImportUrl(fonts) {
|
|
5688
|
+
return `${host}/css2?${fonts.map((i) => {
|
|
5689
|
+
let name = i.name.replace(/\s+/g, "+");
|
|
5735
5690
|
/**
|
|
5736
5691
|
* When using the Google Fonts API, be sure to list them alphabetically.
|
|
5737
5692
|
* @see https://fonts.google.com/knowledge/using_type/styling_type_on_the_web_with_variable_fonts
|
|
@@ -5751,12 +5706,12 @@ function createGoogleCompatibleProvider(name, host) {
|
|
|
5751
5706
|
values: i.weights.map((w) => w.toString())
|
|
5752
5707
|
});
|
|
5753
5708
|
if (axisValues.length) {
|
|
5754
|
-
name
|
|
5755
|
-
name
|
|
5756
|
-
name
|
|
5757
|
-
name
|
|
5709
|
+
name += ":";
|
|
5710
|
+
name += axisValues.map((a) => a.axis).join(",");
|
|
5711
|
+
name += "@";
|
|
5712
|
+
name += generateFontAxes(axisValues);
|
|
5758
5713
|
}
|
|
5759
|
-
return `family=${name
|
|
5714
|
+
return `family=${name}`;
|
|
5760
5715
|
}).join("&")}&display=swap`;
|
|
5761
5716
|
}
|
|
5762
5717
|
};
|
|
@@ -5767,12 +5722,12 @@ const FontshareProvider = createFontshareProvider("fontshare", "https://api.font
|
|
|
5767
5722
|
function createFontshareProvider(name, host) {
|
|
5768
5723
|
return {
|
|
5769
5724
|
name,
|
|
5770
|
-
getImportUrl(fonts
|
|
5771
|
-
return `${host}/v2/css?${fonts
|
|
5772
|
-
let name
|
|
5773
|
-
if (f.weights?.length) name
|
|
5774
|
-
else name
|
|
5775
|
-
return `f[]=${name
|
|
5725
|
+
getImportUrl(fonts) {
|
|
5726
|
+
return `${host}/v2/css?${fonts.map((f) => {
|
|
5727
|
+
let name = f.name.replace(/\s+/g, "-").toLocaleLowerCase();
|
|
5728
|
+
if (f.weights?.length) name += `@${f.weights.flatMap((w) => f.italic ? Number(w) + 1 : w).sort().join()}`;
|
|
5729
|
+
else name += `@${f.italic ? 2 : 1}`;
|
|
5730
|
+
return `f[]=${name}`;
|
|
5776
5731
|
}).join("&")}&display=swap`;
|
|
5777
5732
|
}
|
|
5778
5733
|
};
|
|
@@ -5782,10 +5737,10 @@ function createFontSourceProvider(name, host) {
|
|
|
5782
5737
|
const variablesMap = /* @__PURE__ */ new Map();
|
|
5783
5738
|
return {
|
|
5784
5739
|
name,
|
|
5785
|
-
async getPreflight(fonts
|
|
5786
|
-
return (await Promise.all(fonts
|
|
5740
|
+
async getPreflight(fonts, fetcher) {
|
|
5741
|
+
return (await Promise.all(fonts.map(async (font) => {
|
|
5787
5742
|
const css = [];
|
|
5788
|
-
const id = font
|
|
5743
|
+
const id = font.name.toLowerCase().replace(/\s+/g, "-");
|
|
5789
5744
|
let metadata = fontsMap.get(id);
|
|
5790
5745
|
if (!metadata) {
|
|
5791
5746
|
const url = `https://api.fontsource.org/v1/fonts/${id}`;
|
|
@@ -5793,22 +5748,22 @@ function createFontSourceProvider(name, host) {
|
|
|
5793
5748
|
metadata = await fetcher(url);
|
|
5794
5749
|
fontsMap.set(id, metadata);
|
|
5795
5750
|
} catch {
|
|
5796
|
-
throw new Error(`Failed to fetch font: ${font
|
|
5751
|
+
throw new Error(`Failed to fetch font: ${font.name}`);
|
|
5797
5752
|
}
|
|
5798
5753
|
}
|
|
5799
|
-
const { weights, unicodeRange, variants
|
|
5800
|
-
const subsets = metadata.subsets.filter((subset) => font
|
|
5801
|
-
const style = font
|
|
5802
|
-
if (metadata.variable && !font
|
|
5754
|
+
const { weights, unicodeRange, variants, family } = metadata;
|
|
5755
|
+
const subsets = metadata.subsets.filter((subset) => font.subsets ? font.subsets.includes(subset) : true);
|
|
5756
|
+
const style = font.italic ? "italic" : "normal";
|
|
5757
|
+
if (metadata.variable && !font.preferStatic) {
|
|
5803
5758
|
let variableData = variablesMap.get(id);
|
|
5804
5759
|
const url = `https://api.fontsource.org/v1/variable/${id}`;
|
|
5805
5760
|
try {
|
|
5806
5761
|
variableData = await fetcher(url);
|
|
5807
5762
|
variablesMap.set(id, variableData);
|
|
5808
5763
|
} catch {
|
|
5809
|
-
throw new Error(`Failed to fetch font variable: ${font
|
|
5764
|
+
throw new Error(`Failed to fetch font variable: ${font.name}`);
|
|
5810
5765
|
}
|
|
5811
|
-
const mergeAxes = mergeDeep(variableData.axes, font
|
|
5766
|
+
const mergeAxes = mergeDeep(variableData.axes, font.variable ?? {});
|
|
5812
5767
|
for (const subset of subsets) if (unicodeRange[subset]) {
|
|
5813
5768
|
const fontObj = {
|
|
5814
5769
|
family,
|
|
@@ -5849,9 +5804,9 @@ function createFontSourceProvider(name, host) {
|
|
|
5849
5804
|
css.push(generateFontFace(fontObj));
|
|
5850
5805
|
});
|
|
5851
5806
|
} else {
|
|
5852
|
-
const _weights = font
|
|
5807
|
+
const _weights = font.weights && font.weights.length > 0 ? font.weights : weights;
|
|
5853
5808
|
for (const subset of subsets) for (const weight of _weights) {
|
|
5854
|
-
const url = variants
|
|
5809
|
+
const url = variants[weight][style][subset].url;
|
|
5855
5810
|
const fontObj = {
|
|
5856
5811
|
family,
|
|
5857
5812
|
display: "swap",
|
|
@@ -5873,8 +5828,8 @@ function createFontSourceProvider(name, host) {
|
|
|
5873
5828
|
};
|
|
5874
5829
|
}
|
|
5875
5830
|
const FontSourceProvider = createFontSourceProvider("fontsource", "https://cdn.jsdelivr.net");
|
|
5876
|
-
function generateFontFace(font
|
|
5877
|
-
const { family, style, display, weight, variable, src, unicodeRange, comment, spacer = "\n " } = font
|
|
5831
|
+
function generateFontFace(font) {
|
|
5832
|
+
const { family, style, display, weight, variable, src, unicodeRange, comment, spacer = "\n " } = font;
|
|
5878
5833
|
const { wght, wdth, slnt } = variable ?? {};
|
|
5879
5834
|
let result = "@font-face {";
|
|
5880
5835
|
result += `${spacer}font-family: '${family}';`;
|
|
@@ -5903,8 +5858,8 @@ const builtinProviders = {
|
|
|
5903
5858
|
getPreflight() {
|
|
5904
5859
|
return "";
|
|
5905
5860
|
},
|
|
5906
|
-
getFontName(font
|
|
5907
|
-
return font
|
|
5861
|
+
getFontName(font) {
|
|
5862
|
+
return font.name;
|
|
5908
5863
|
}
|
|
5909
5864
|
}
|
|
5910
5865
|
};
|
|
@@ -5933,20 +5888,20 @@ function createWebFontPreset(fetcher) {
|
|
|
5933
5888
|
const layerName = inlineImports ? fontLayer : LAYER_IMPORTS;
|
|
5934
5889
|
const processors = toArray(options.processors || []);
|
|
5935
5890
|
const fontObject = Object.fromEntries(Object.entries(options.fonts || {}).map(([name, meta]) => [name, toArray(meta).map((m) => normalizedFontMeta(m, defaultProvider))]));
|
|
5936
|
-
const fonts
|
|
5891
|
+
const fonts = Object.values(fontObject).flatMap((i) => i);
|
|
5937
5892
|
const importCache = {};
|
|
5938
5893
|
async function fetchWithTimeout(url) {
|
|
5939
5894
|
if (timeouts === false) return customFetch(url);
|
|
5940
5895
|
const { warning = 1e3, failure = 2e3 } = timeouts;
|
|
5941
|
-
let warned
|
|
5896
|
+
let warned = false;
|
|
5942
5897
|
const timer = setTimeout(() => {
|
|
5943
5898
|
console.warn(`[unocss] Fetching web fonts: ${url}`);
|
|
5944
|
-
warned
|
|
5899
|
+
warned = true;
|
|
5945
5900
|
}, warning);
|
|
5946
5901
|
return await Promise.race([customFetch(url), new Promise((_, reject) => {
|
|
5947
5902
|
setTimeout(() => reject(/* @__PURE__ */ new Error(`[unocss] Fetch web fonts timeout.`)), failure);
|
|
5948
5903
|
})]).then((res) => {
|
|
5949
|
-
if (warned
|
|
5904
|
+
if (warned) console.info(`[unocss] Web fonts fetched.`);
|
|
5950
5905
|
return res;
|
|
5951
5906
|
}).finally(() => clearTimeout(timer));
|
|
5952
5907
|
}
|
|
@@ -5960,22 +5915,22 @@ function createWebFontPreset(fetcher) {
|
|
|
5960
5915
|
return await importCache[url];
|
|
5961
5916
|
} else return `@import url('${url}');`;
|
|
5962
5917
|
}
|
|
5963
|
-
const enabledProviders = Array.from(new Set(fonts
|
|
5964
|
-
async function getCSSDefault(fonts
|
|
5965
|
-
const preflights
|
|
5918
|
+
const enabledProviders = Array.from(new Set(fonts.map((i) => i.provider)));
|
|
5919
|
+
async function getCSSDefault(fonts, providers) {
|
|
5920
|
+
const preflights = [];
|
|
5966
5921
|
for (const provider of providers) {
|
|
5967
|
-
const fontsForProvider = fonts
|
|
5922
|
+
const fontsForProvider = fonts.filter((i) => i.provider.name === provider.name);
|
|
5968
5923
|
if (provider.getImportUrl) {
|
|
5969
5924
|
const url = provider.getImportUrl(fontsForProvider);
|
|
5970
|
-
if (url) preflights
|
|
5925
|
+
if (url) preflights.push(await importUrl(url));
|
|
5971
5926
|
}
|
|
5972
5927
|
try {
|
|
5973
|
-
preflights
|
|
5928
|
+
preflights.push(await provider.getPreflight?.(fontsForProvider, fetchWithTimeout));
|
|
5974
5929
|
} catch (e) {
|
|
5975
5930
|
console.warn(`[unocss] Web fonts preflight fetch failed.`, e);
|
|
5976
5931
|
}
|
|
5977
5932
|
}
|
|
5978
|
-
return preflights
|
|
5933
|
+
return preflights.filter(Boolean).join("\n");
|
|
5979
5934
|
}
|
|
5980
5935
|
const preset = {
|
|
5981
5936
|
name: "@unocss/preset-web-fonts",
|
|
@@ -5983,13 +5938,13 @@ function createWebFontPreset(fetcher) {
|
|
|
5983
5938
|
async getCSS() {
|
|
5984
5939
|
let css;
|
|
5985
5940
|
for (const processor of processors) {
|
|
5986
|
-
const result = await processor.getCSS?.(fonts
|
|
5941
|
+
const result = await processor.getCSS?.(fonts, enabledProviders, getCSSDefault);
|
|
5987
5942
|
if (result) {
|
|
5988
5943
|
css = result;
|
|
5989
5944
|
break;
|
|
5990
5945
|
}
|
|
5991
5946
|
}
|
|
5992
|
-
if (!css) css = await getCSSDefault(fonts
|
|
5947
|
+
if (!css) css = await getCSSDefault(fonts, enabledProviders);
|
|
5993
5948
|
for (const processor of processors) css = await processor.transformCSS?.(css) || css;
|
|
5994
5949
|
return css;
|
|
5995
5950
|
},
|
|
@@ -5997,19 +5952,19 @@ function createWebFontPreset(fetcher) {
|
|
|
5997
5952
|
}],
|
|
5998
5953
|
layers: { [fontLayer]: -200 }
|
|
5999
5954
|
};
|
|
6000
|
-
if (extendTheme) preset.extendTheme = (theme
|
|
5955
|
+
if (extendTheme) preset.extendTheme = (theme, config) => {
|
|
6001
5956
|
const hasWind4 = config.presets.some((p) => p.name === "@unocss/preset-wind4");
|
|
6002
5957
|
const themeKey = options.themeKey ?? (hasWind4 ? "font" : "fontFamily");
|
|
6003
|
-
if (!theme
|
|
6004
|
-
const obj = Object.fromEntries(Object.entries(fontObject).map(([name, fonts
|
|
6005
|
-
for (const key of Object.keys(obj)) if (typeof theme
|
|
6006
|
-
else theme
|
|
5958
|
+
if (!theme[themeKey]) theme[themeKey] = {};
|
|
5959
|
+
const obj = Object.fromEntries(Object.entries(fontObject).map(([name, fonts]) => [name, fonts.map((f) => f.provider.getFontName?.(f) ?? `"${f.name}"`)]));
|
|
5960
|
+
for (const key of Object.keys(obj)) if (typeof theme[themeKey][key] === "string") theme[themeKey][key] = obj[key].map((i) => `${i},`).join("") + theme[themeKey][key];
|
|
5961
|
+
else theme[themeKey][key] = obj[key].join(",");
|
|
6007
5962
|
};
|
|
6008
5963
|
return preset;
|
|
6009
5964
|
};
|
|
6010
5965
|
}
|
|
6011
5966
|
const userAgentWoff2 = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
|
|
6012
|
-
const defaultFetch = async (url) => (await import("./node-
|
|
5967
|
+
const defaultFetch = async (url) => (await import("./node-D23LglTq.mjs")).$fetch(url, {
|
|
6013
5968
|
headers: { "User-Agent": userAgentWoff2 },
|
|
6014
5969
|
retry: 3
|
|
6015
5970
|
});
|
|
@@ -6019,8 +5974,6 @@ const defaultFetch = async (url) => (await import("./node-DvibxqDE.mjs")).$fetch
|
|
|
6019
5974
|
* @see https://unocss.dev/presets/web-fonts
|
|
6020
5975
|
*/
|
|
6021
5976
|
const presetWebFonts = definePreset(createWebFontPreset(defaultFetch));
|
|
6022
|
-
var src_default$1 = presetWebFonts;
|
|
6023
|
-
|
|
6024
5977
|
//#endregion
|
|
6025
5978
|
//#region ../../packages-presets/preset-wind4/dist/postprocess.mjs
|
|
6026
5979
|
function important({ important: option }) {
|
|
@@ -6040,6 +5993,7 @@ function important({ important: option }) {
|
|
|
6040
5993
|
}
|
|
6041
5994
|
function varPrefix({ variablePrefix: prefix }) {
|
|
6042
5995
|
const processor = (obj) => {
|
|
5996
|
+
if (obj.layer === "properties") obj.selector = obj.selector.replace(/^@property --un-/, `@property --${prefix}`);
|
|
6043
5997
|
obj.entries.forEach((i) => {
|
|
6044
5998
|
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
|
6045
5999
|
if (typeof i[1] === "string") i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
|
@@ -6050,22 +6004,20 @@ function varPrefix({ variablePrefix: prefix }) {
|
|
|
6050
6004
|
function postprocessors(options) {
|
|
6051
6005
|
return [important, varPrefix].flatMap((i) => i(options));
|
|
6052
6006
|
}
|
|
6053
|
-
|
|
6054
6007
|
//#endregion
|
|
6055
|
-
//#region ../../packages-presets/preset-wind4/dist/chunk-
|
|
6008
|
+
//#region ../../packages-presets/preset-wind4/dist/chunk-D1SwGrFN.mjs
|
|
6056
6009
|
var __defProp = Object.defineProperty;
|
|
6057
|
-
var __exportAll = (all,
|
|
6010
|
+
var __exportAll = (all, no_symbols) => {
|
|
6058
6011
|
let target = {};
|
|
6059
6012
|
for (var name in all) __defProp(target, name, {
|
|
6060
6013
|
get: all[name],
|
|
6061
6014
|
enumerable: true
|
|
6062
6015
|
});
|
|
6063
|
-
if (
|
|
6016
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
6064
6017
|
return target;
|
|
6065
6018
|
};
|
|
6066
|
-
|
|
6067
6019
|
//#endregion
|
|
6068
|
-
//#region ../../packages-presets/preset-wind4/dist/utils-
|
|
6020
|
+
//#region ../../packages-presets/preset-wind4/dist/utils-BamiTVVE.mjs
|
|
6069
6021
|
const PRESET_NAME = "@unocss/preset-wind4";
|
|
6070
6022
|
const CONTROL_NO_NEGATIVE = "$$mini-no-negative";
|
|
6071
6023
|
const SpecialColorKey = {
|
|
@@ -6280,14 +6232,14 @@ const cssProps = [
|
|
|
6280
6232
|
"clip",
|
|
6281
6233
|
"border-radius"
|
|
6282
6234
|
];
|
|
6283
|
-
function round(n
|
|
6284
|
-
return +n
|
|
6235
|
+
function round(n) {
|
|
6236
|
+
return +n.toFixed(10);
|
|
6285
6237
|
}
|
|
6286
6238
|
function numberWithUnit(str) {
|
|
6287
6239
|
const match = str.match(numberWithUnitRE);
|
|
6288
6240
|
if (!match) return;
|
|
6289
|
-
const [, n
|
|
6290
|
-
const num = Number.parseFloat(n
|
|
6241
|
+
const [, n, unit] = match;
|
|
6242
|
+
const num = Number.parseFloat(n);
|
|
6291
6243
|
if (unit && !Number.isNaN(num)) return `${round(num)}${unit}`;
|
|
6292
6244
|
}
|
|
6293
6245
|
function auto(str) {
|
|
@@ -6298,8 +6250,8 @@ function rem(str) {
|
|
|
6298
6250
|
if (unitOnlyRE.test(str)) return `${unitOnlyMap[str]}${str}`;
|
|
6299
6251
|
const match = str.match(numberWithUnitRE);
|
|
6300
6252
|
if (!match) return;
|
|
6301
|
-
const [, n
|
|
6302
|
-
const num = Number.parseFloat(n
|
|
6253
|
+
const [, n, unit] = match;
|
|
6254
|
+
const num = Number.parseFloat(n);
|
|
6303
6255
|
if (!Number.isNaN(num)) {
|
|
6304
6256
|
if (num === 0) return "0";
|
|
6305
6257
|
return unit ? `${round(num)}${unit}` : `${round(num / 4)}rem`;
|
|
@@ -6309,8 +6261,8 @@ function px(str) {
|
|
|
6309
6261
|
if (unitOnlyRE.test(str)) return `${unitOnlyMap[str]}${str}`;
|
|
6310
6262
|
const match = str.match(numberWithUnitRE);
|
|
6311
6263
|
if (!match) return;
|
|
6312
|
-
const [, n
|
|
6313
|
-
const num = Number.parseFloat(n
|
|
6264
|
+
const [, n, unit] = match;
|
|
6265
|
+
const num = Number.parseFloat(n);
|
|
6314
6266
|
if (!Number.isNaN(num)) return unit ? `${round(num)}${unit}` : `${round(num)}px`;
|
|
6315
6267
|
}
|
|
6316
6268
|
function number(str) {
|
|
@@ -6333,8 +6285,8 @@ function fraction(str) {
|
|
|
6333
6285
|
return `${round(num * 100)}%`;
|
|
6334
6286
|
}
|
|
6335
6287
|
}
|
|
6336
|
-
function processThemeVariable(name, key, paths, theme
|
|
6337
|
-
const valOrObj = getThemeByKey(theme
|
|
6288
|
+
function processThemeVariable(name, key, paths, theme) {
|
|
6289
|
+
const valOrObj = getThemeByKey(theme, key, paths);
|
|
6338
6290
|
const hasDefault = typeof valOrObj === "object" && "DEFAULT" in valOrObj;
|
|
6339
6291
|
if (hasDefault) paths.push("DEFAULT");
|
|
6340
6292
|
const val = hasDefault ? valOrObj.DEFAULT : valOrObj;
|
|
@@ -6345,7 +6297,7 @@ function processThemeVariable(name, key, paths, theme$2) {
|
|
|
6345
6297
|
varKey
|
|
6346
6298
|
};
|
|
6347
6299
|
}
|
|
6348
|
-
function bracketWithType(str, requiredType, theme
|
|
6300
|
+
function bracketWithType(str, requiredType, theme) {
|
|
6349
6301
|
if (str && str.startsWith("[") && str.endsWith("]")) {
|
|
6350
6302
|
let base;
|
|
6351
6303
|
let hintedType;
|
|
@@ -6360,18 +6312,18 @@ function bracketWithType(str, requiredType, theme$2) {
|
|
|
6360
6312
|
if (base === "=\"\"") return;
|
|
6361
6313
|
if (base.startsWith("--")) {
|
|
6362
6314
|
const calcMatch = base.match(/^--([\w.-]+)\(([^)]+)\)$/);
|
|
6363
|
-
if (calcMatch != null && theme
|
|
6315
|
+
if (calcMatch != null && theme) {
|
|
6364
6316
|
const [, name, factor] = calcMatch;
|
|
6365
6317
|
const [key, ...paths] = name.split(".");
|
|
6366
|
-
const { val, varKey } = processThemeVariable(name, key, paths, theme
|
|
6318
|
+
const { val, varKey } = processThemeVariable(name, key, paths, theme);
|
|
6367
6319
|
if (val != null) base = `calc(var(--${escapeSelector(varKey.replaceAll(".", "-"))}) * ${factor})`;
|
|
6368
6320
|
} else {
|
|
6369
6321
|
const [name, defaultValue] = base.slice(2).split(",");
|
|
6370
6322
|
const suffix = defaultValue ? `, ${defaultValue}` : "";
|
|
6371
6323
|
const escapedName = escapeSelector(name);
|
|
6372
|
-
if (theme
|
|
6324
|
+
if (theme) {
|
|
6373
6325
|
const [key, ...paths] = name.split(".");
|
|
6374
|
-
const { val, varKey } = processThemeVariable(name, key, paths, theme
|
|
6326
|
+
const { val, varKey } = processThemeVariable(name, key, paths, theme);
|
|
6375
6327
|
base = val != null ? `var(--${escapeSelector(varKey.replaceAll(".", "-"))}${suffix})` : `var(--${escapedName}${suffix})`;
|
|
6376
6328
|
} else base = `var(--${escapedName}${suffix})`;
|
|
6377
6329
|
}
|
|
@@ -6387,32 +6339,32 @@ function bracketWithType(str, requiredType, theme$2) {
|
|
|
6387
6339
|
case "string": return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_");
|
|
6388
6340
|
case "quoted": return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(["\\])/g, "\\$1").replace(/^(.+)$/, "\"$1\"");
|
|
6389
6341
|
}
|
|
6390
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match
|
|
6342
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match) => {
|
|
6391
6343
|
const vars = [];
|
|
6392
|
-
return match
|
|
6344
|
+
return match.replace(/var\((--.+?)[,)]/g, (match, g1) => {
|
|
6393
6345
|
vars.push(g1);
|
|
6394
|
-
return match
|
|
6346
|
+
return match.replace(g1, "--un-calc");
|
|
6395
6347
|
}).replace(/(-?\d*\.?\d(?!-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(/--un-calc/g, () => vars.shift());
|
|
6396
6348
|
});
|
|
6397
6349
|
}
|
|
6398
6350
|
}
|
|
6399
|
-
function bracket(str, theme
|
|
6400
|
-
return bracketWithType(str, void 0, theme
|
|
6351
|
+
function bracket(str, theme) {
|
|
6352
|
+
return bracketWithType(str, void 0, theme);
|
|
6401
6353
|
}
|
|
6402
|
-
function bracketOfColor(str, theme
|
|
6403
|
-
return bracketWithType(str, "color", theme
|
|
6354
|
+
function bracketOfColor(str, theme) {
|
|
6355
|
+
return bracketWithType(str, "color", theme);
|
|
6404
6356
|
}
|
|
6405
|
-
function bracketOfLength(str, theme
|
|
6406
|
-
return bracketWithType(str, "length", theme
|
|
6357
|
+
function bracketOfLength(str, theme) {
|
|
6358
|
+
return bracketWithType(str, "length", theme) || bracketWithType(str, "size", theme);
|
|
6407
6359
|
}
|
|
6408
|
-
function bracketOfPosition(str, theme
|
|
6409
|
-
return bracketWithType(str, "position", theme
|
|
6360
|
+
function bracketOfPosition(str, theme) {
|
|
6361
|
+
return bracketWithType(str, "position", theme);
|
|
6410
6362
|
}
|
|
6411
|
-
function bracketOfFamily(str, theme
|
|
6412
|
-
return bracketWithType(str, "family", theme
|
|
6363
|
+
function bracketOfFamily(str, theme) {
|
|
6364
|
+
return bracketWithType(str, "family", theme);
|
|
6413
6365
|
}
|
|
6414
|
-
function bracketOfNumber(str, theme
|
|
6415
|
-
return bracketWithType(str, "number", theme
|
|
6366
|
+
function bracketOfNumber(str, theme) {
|
|
6367
|
+
return bracketWithType(str, "number", theme);
|
|
6416
6368
|
}
|
|
6417
6369
|
function cssvar(str) {
|
|
6418
6370
|
if (str.startsWith("var(")) return str;
|
|
@@ -6425,8 +6377,8 @@ function cssvar(str) {
|
|
|
6425
6377
|
function time(str) {
|
|
6426
6378
|
const match = str.match(/^(-?[0-9.]+)(s|ms)?$/i);
|
|
6427
6379
|
if (!match) return;
|
|
6428
|
-
const [, n
|
|
6429
|
-
const num = Number.parseFloat(n
|
|
6380
|
+
const [, n, unit] = match;
|
|
6381
|
+
const num = Number.parseFloat(n);
|
|
6430
6382
|
if (!Number.isNaN(num)) {
|
|
6431
6383
|
if (num === 0 && !unit) return "0s";
|
|
6432
6384
|
return unit ? `${round(num)}${unit}` : `${round(num)}ms`;
|
|
@@ -6435,8 +6387,8 @@ function time(str) {
|
|
|
6435
6387
|
function degree(str) {
|
|
6436
6388
|
const match = str.match(/^(-?[0-9.]+)(deg|rad|grad|turn)?$/i);
|
|
6437
6389
|
if (!match) return;
|
|
6438
|
-
const [, n
|
|
6439
|
-
const num = Number.parseFloat(n
|
|
6390
|
+
const [, n, unit] = match;
|
|
6391
|
+
const num = Number.parseFloat(n);
|
|
6440
6392
|
if (!Number.isNaN(num)) {
|
|
6441
6393
|
if (num === 0) return "0deg";
|
|
6442
6394
|
return unit ? `${round(num)}${unit}` : `${round(num)}deg`;
|
|
@@ -6460,8 +6412,7 @@ function position(str) {
|
|
|
6460
6412
|
function none(str) {
|
|
6461
6413
|
if (str === "none") return "none";
|
|
6462
6414
|
}
|
|
6463
|
-
const
|
|
6464
|
-
const h = handler;
|
|
6415
|
+
const h = createValueHandler(handlers_exports);
|
|
6465
6416
|
function numberResolver(size, defaultValue) {
|
|
6466
6417
|
const v = h.number(size) ?? defaultValue;
|
|
6467
6418
|
if (v != null) {
|
|
@@ -6477,8 +6428,8 @@ function numberResolver(size, defaultValue) {
|
|
|
6477
6428
|
* @param map - Optional mapping of direction keys to property postfixes. Defaults to {@link directionMap}.
|
|
6478
6429
|
* @param formatter - Optional function to format the final property name. Defaults to `(p, d) => \`\${p}\${d}\``.
|
|
6479
6430
|
*/
|
|
6480
|
-
function directionSize(property
|
|
6481
|
-
return (([_, direction, size = "4"], { theme
|
|
6431
|
+
function directionSize(property, map = directionMap, formatter = (p, d) => `${p}${d}`) {
|
|
6432
|
+
return (([_, direction, size = "4"], { theme }) => {
|
|
6482
6433
|
if (size != null && direction != null) {
|
|
6483
6434
|
let v;
|
|
6484
6435
|
const isNegative = size.startsWith("-");
|
|
@@ -6486,13 +6437,13 @@ function directionSize(property$2, map = directionMap, formatter = (p, d) => `${
|
|
|
6486
6437
|
v = numberResolver(size);
|
|
6487
6438
|
if (v != null && !Number.isNaN(v)) {
|
|
6488
6439
|
themeTracking("spacing");
|
|
6489
|
-
return map[direction].map((i) => [formatter(property
|
|
6490
|
-
} else if (theme
|
|
6440
|
+
return map[direction].map((i) => [formatter(property, i), `calc(var(--spacing) * ${isNegative ? "-" : ""}${v})`]);
|
|
6441
|
+
} else if (theme.spacing && size in theme.spacing) {
|
|
6491
6442
|
themeTracking("spacing", size);
|
|
6492
|
-
return map[direction].map((i) => [formatter(property
|
|
6443
|
+
return map[direction].map((i) => [formatter(property, i), isNegative ? `calc(var(--${escapeSelector(`spacing-${size}`)}) * -1)` : `var(--${escapeSelector(`spacing-${size}`)})`]);
|
|
6493
6444
|
}
|
|
6494
|
-
v = h.bracket.cssvar.global.auto.fraction.rem(isNegative ? `-${size}` : size, theme
|
|
6495
|
-
if (v != null) return map[direction].map((i) => [formatter(property
|
|
6445
|
+
v = h.bracket.cssvar.global.auto.fraction.rem(isNegative ? `-${size}` : size, theme);
|
|
6446
|
+
if (v != null) return map[direction].map((i) => [formatter(property, i), v]);
|
|
6496
6447
|
}
|
|
6497
6448
|
});
|
|
6498
6449
|
}
|
|
@@ -6511,7 +6462,7 @@ function directionSize(property$2, map = directionMap, formatter = (p, d) => `${
|
|
|
6511
6462
|
* @param theme - {@link Theme} object.
|
|
6512
6463
|
* @return object if string is parseable.
|
|
6513
6464
|
*/
|
|
6514
|
-
function parseColor(body, theme
|
|
6465
|
+
function parseColor(body, theme) {
|
|
6515
6466
|
let split;
|
|
6516
6467
|
const [front, ...rest] = getStringComponents(body, ["/", ":"], 3) ?? [];
|
|
6517
6468
|
if (front != null) {
|
|
@@ -6519,47 +6470,47 @@ function parseColor(body, theme$2) {
|
|
|
6519
6470
|
if (match == null || match === "color") split = [front, ...rest];
|
|
6520
6471
|
}
|
|
6521
6472
|
if (!split) return;
|
|
6522
|
-
let opacity
|
|
6473
|
+
let opacity;
|
|
6523
6474
|
let [main, opacityOrModifier, modifier] = split;
|
|
6524
6475
|
if (isInterpolatedMethod(opacityOrModifier) || isInterpolatedMethod(h.bracket(opacityOrModifier ?? ""))) modifier = opacityOrModifier;
|
|
6525
|
-
else opacity
|
|
6526
|
-
const colors
|
|
6527
|
-
const [name] = colors
|
|
6476
|
+
else opacity = opacityOrModifier;
|
|
6477
|
+
const colors = main.replace(/([a-z])(\d)(?![-_a-z])/g, "$1-$2").split(/-/g);
|
|
6478
|
+
const [name] = colors;
|
|
6528
6479
|
if (!name) return;
|
|
6529
|
-
let parsed = parseThemeColor(theme
|
|
6530
|
-
if (!parsed && colors
|
|
6531
|
-
const last = colors
|
|
6532
|
-
const secondLast = colors
|
|
6533
|
-
if (/^\d+$/.test(last)) parsed = parseThemeColor(theme
|
|
6480
|
+
let parsed = parseThemeColor(theme, colors);
|
|
6481
|
+
if (!parsed && colors.length >= 2) {
|
|
6482
|
+
const last = colors.at(-1);
|
|
6483
|
+
const secondLast = colors.at(-2);
|
|
6484
|
+
if (/^\d+$/.test(last)) parsed = parseThemeColor(theme, colors.slice(0, -2).concat([`${secondLast}${last}`]));
|
|
6534
6485
|
}
|
|
6535
6486
|
let { no, keys, color } = parsed ?? {};
|
|
6536
6487
|
if (!color) {
|
|
6537
|
-
const bracket
|
|
6538
|
-
const bracketOrMain = bracket
|
|
6488
|
+
const bracket = h.bracketOfColor(main, theme);
|
|
6489
|
+
const bracketOrMain = bracket || main;
|
|
6539
6490
|
if (h.numberWithUnit(bracketOrMain)) return;
|
|
6540
6491
|
if (/^#[\da-f]+$/i.test(bracketOrMain)) color = bracketOrMain;
|
|
6541
6492
|
else if (/^hex-[\da-fA-F]+$/.test(bracketOrMain)) color = `#${bracketOrMain.slice(4)}`;
|
|
6542
6493
|
else if (main.startsWith("$")) color = h.cssvar(main);
|
|
6543
|
-
color = color || bracket
|
|
6494
|
+
color = color || bracket;
|
|
6544
6495
|
}
|
|
6545
6496
|
return {
|
|
6546
|
-
opacity
|
|
6497
|
+
opacity,
|
|
6547
6498
|
modifier: modifier && h.bracket.cssvar(modifier) || modifier,
|
|
6548
6499
|
name,
|
|
6549
6500
|
no,
|
|
6550
6501
|
color: color ?? SpecialColorKey[name],
|
|
6551
|
-
alpha: h.bracket.cssvar.percent(opacity
|
|
6502
|
+
alpha: h.bracket.cssvar.percent(opacity ?? ""),
|
|
6552
6503
|
keys,
|
|
6553
6504
|
get cssColor() {
|
|
6554
6505
|
return parseCssColor(this.color);
|
|
6555
6506
|
}
|
|
6556
6507
|
};
|
|
6557
6508
|
}
|
|
6558
|
-
function parseThemeColor(theme
|
|
6509
|
+
function parseThemeColor(theme, keys) {
|
|
6559
6510
|
let color;
|
|
6560
6511
|
let no;
|
|
6561
6512
|
let key;
|
|
6562
|
-
const colorData = getThemeByKey(theme
|
|
6513
|
+
const colorData = getThemeByKey(theme, "colors", keys);
|
|
6563
6514
|
if (typeof colorData === "object") {
|
|
6564
6515
|
if ("DEFAULT" in colorData) {
|
|
6565
6516
|
color = colorData.DEFAULT;
|
|
@@ -6578,23 +6529,23 @@ function parseThemeColor(theme$2, keys) {
|
|
|
6578
6529
|
keys: key
|
|
6579
6530
|
};
|
|
6580
6531
|
}
|
|
6581
|
-
function getThemeByKey(theme
|
|
6582
|
-
const obj = theme
|
|
6583
|
-
function deepGet(current, path
|
|
6584
|
-
if (path
|
|
6532
|
+
function getThemeByKey(theme, themeKey, keys) {
|
|
6533
|
+
const obj = theme[themeKey];
|
|
6534
|
+
function deepGet(current, path) {
|
|
6535
|
+
if (path.length === 0) return current;
|
|
6585
6536
|
if (!current || typeof current !== "object") return void 0;
|
|
6586
|
-
for (let i = path
|
|
6587
|
-
const flatKey = path
|
|
6537
|
+
for (let i = path.length; i > 0; i--) {
|
|
6538
|
+
const flatKey = path.slice(0, i).join("-");
|
|
6588
6539
|
if (flatKey in current) {
|
|
6589
6540
|
const v = current[flatKey];
|
|
6590
|
-
if (i === path
|
|
6591
|
-
return deepGet(v, path
|
|
6541
|
+
if (i === path.length) return v;
|
|
6542
|
+
return deepGet(v, path.slice(i));
|
|
6592
6543
|
}
|
|
6593
6544
|
}
|
|
6594
6545
|
}
|
|
6595
6546
|
return deepGet(obj, keys);
|
|
6596
6547
|
}
|
|
6597
|
-
function colorCSSGenerator(data, property
|
|
6548
|
+
function colorCSSGenerator(data, property, varName, ctx) {
|
|
6598
6549
|
if (!data) return;
|
|
6599
6550
|
const { color, keys, alpha, modifier } = data;
|
|
6600
6551
|
const rawColorComment = ctx?.generator.config.envMode === "dev" && color ? ` /* ${color} */` : "";
|
|
@@ -6604,14 +6555,14 @@ function colorCSSGenerator(data, property$2, varName, ctx) {
|
|
|
6604
6555
|
const isCSSVar = color.includes("var(");
|
|
6605
6556
|
const isSpecial = Object.values(SpecialColorKey).includes(color);
|
|
6606
6557
|
if (isSpecial && !alpha) {
|
|
6607
|
-
css[property
|
|
6558
|
+
css[property] = color;
|
|
6608
6559
|
return result;
|
|
6609
6560
|
}
|
|
6610
6561
|
const alphaKey = `--un-${varName}-opacity`;
|
|
6611
6562
|
const value = keys && !isCSSVar && !isSpecial ? generateThemeVariable("colors", keys) : color;
|
|
6612
6563
|
let method = modifier ?? (keys ? "in srgb" : "in oklab");
|
|
6613
6564
|
if (!method.startsWith("in ") && !method.startsWith("var(")) method = `in ${method}`;
|
|
6614
|
-
css[property
|
|
6565
|
+
css[property] = `color-mix(${method}, ${value} ${alpha ?? `var(${alphaKey})`}, transparent)${rawColorComment}`;
|
|
6615
6566
|
result.push(defineProperty(alphaKey, {
|
|
6616
6567
|
syntax: "<percentage>",
|
|
6617
6568
|
initialValue: "100%"
|
|
@@ -6629,7 +6580,7 @@ function colorCSSGenerator(data, property$2, varName, ctx) {
|
|
|
6629
6580
|
result.push({
|
|
6630
6581
|
[symbols.parent]: "@supports (color: color-mix(in lab, red, red))",
|
|
6631
6582
|
[symbols.noMerge]: true,
|
|
6632
|
-
[property
|
|
6583
|
+
[property]: `color-mix(in oklab, ${colorValue}, transparent)${rawColorComment}`
|
|
6633
6584
|
});
|
|
6634
6585
|
}
|
|
6635
6586
|
}
|
|
@@ -6638,11 +6589,11 @@ function colorCSSGenerator(data, property$2, varName, ctx) {
|
|
|
6638
6589
|
return result;
|
|
6639
6590
|
}
|
|
6640
6591
|
}
|
|
6641
|
-
function colorResolver(property
|
|
6592
|
+
function colorResolver(property, varName) {
|
|
6642
6593
|
return ([, body], ctx) => {
|
|
6643
6594
|
const data = parseColor(body ?? "", ctx.theme);
|
|
6644
6595
|
if (!data) return;
|
|
6645
|
-
return colorCSSGenerator(data, property
|
|
6596
|
+
return colorCSSGenerator(data, property, varName, ctx);
|
|
6646
6597
|
};
|
|
6647
6598
|
}
|
|
6648
6599
|
function colorableShadows(shadows, colorVar, alpha) {
|
|
@@ -6673,26 +6624,26 @@ function colorableShadows(shadows, colorVar, alpha) {
|
|
|
6673
6624
|
}
|
|
6674
6625
|
return colored;
|
|
6675
6626
|
}
|
|
6676
|
-
function hasParseableColor(color, theme
|
|
6677
|
-
return color != null && !!parseColor(color, theme
|
|
6627
|
+
function hasParseableColor(color, theme) {
|
|
6628
|
+
return color != null && !!parseColor(color, theme)?.color;
|
|
6678
6629
|
}
|
|
6679
6630
|
const reLetters = /[a-z]+/gi;
|
|
6680
6631
|
const resolvedBreakpoints = /* @__PURE__ */ new WeakMap();
|
|
6681
|
-
function resolveBreakpoints({ theme
|
|
6682
|
-
const breakpoints = (generator?.userConfig?.theme)?.[key] || theme
|
|
6632
|
+
function resolveBreakpoints({ theme, generator }, key = "breakpoint") {
|
|
6633
|
+
const breakpoints = (generator?.userConfig?.theme)?.[key] || theme[key];
|
|
6683
6634
|
if (!breakpoints) return void 0;
|
|
6684
|
-
if (resolvedBreakpoints.has(theme
|
|
6635
|
+
if (resolvedBreakpoints.has(theme)) return resolvedBreakpoints.get(theme);
|
|
6685
6636
|
const resolved = Object.entries(breakpoints).sort((a, b) => Number.parseInt(a[1].replace(reLetters, "")) - Number.parseInt(b[1].replace(reLetters, ""))).map(([point, size]) => ({
|
|
6686
6637
|
point,
|
|
6687
6638
|
size
|
|
6688
6639
|
}));
|
|
6689
|
-
resolvedBreakpoints.set(theme
|
|
6640
|
+
resolvedBreakpoints.set(theme, resolved);
|
|
6690
6641
|
return resolved;
|
|
6691
6642
|
}
|
|
6692
|
-
function makeGlobalStaticRules(prefix, property
|
|
6693
|
-
return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property
|
|
6643
|
+
function makeGlobalStaticRules(prefix, property) {
|
|
6644
|
+
return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]);
|
|
6694
6645
|
}
|
|
6695
|
-
function defineProperty(property
|
|
6646
|
+
function defineProperty(property, options = {}) {
|
|
6696
6647
|
const { syntax = "*", inherits = false, initialValue } = options;
|
|
6697
6648
|
const value = {
|
|
6698
6649
|
[symbols.shortcutsNoMerge]: true,
|
|
@@ -6701,13 +6652,13 @@ function defineProperty(property$2, options = {}) {
|
|
|
6701
6652
|
[symbols.variants]: () => [{
|
|
6702
6653
|
parent: "",
|
|
6703
6654
|
layer: "properties",
|
|
6704
|
-
selector: () => `@property ${property
|
|
6655
|
+
selector: () => `@property ${property}`
|
|
6705
6656
|
}],
|
|
6706
6657
|
syntax: JSON.stringify(syntax),
|
|
6707
6658
|
inherits: inherits ? "true" : "false"
|
|
6708
6659
|
};
|
|
6709
6660
|
if (initialValue != null) value["initial-value"] = initialValue;
|
|
6710
|
-
propertyTracking(property
|
|
6661
|
+
propertyTracking(property, initialValue ? String(initialValue) : "initial");
|
|
6711
6662
|
return value;
|
|
6712
6663
|
}
|
|
6713
6664
|
function isCSSMathFn(value) {
|
|
@@ -6739,26 +6690,25 @@ function themeTracking(key, props = "DEFAULT") {
|
|
|
6739
6690
|
function generateThemeVariable(key, props) {
|
|
6740
6691
|
return `var(--${key}-${toArray(props).join("-")})`;
|
|
6741
6692
|
}
|
|
6742
|
-
function detectThemeValue(value, theme
|
|
6693
|
+
function detectThemeValue(value, theme) {
|
|
6743
6694
|
if (value.startsWith("var(")) {
|
|
6744
6695
|
const variable = value.match(/var\(--([\w-]+)(?:,.*)?\)/)?.[1];
|
|
6745
6696
|
if (variable) {
|
|
6746
|
-
const [key, ...path
|
|
6747
|
-
const themeValue = getThemeByKey(theme
|
|
6697
|
+
const [key, ...path] = variable.split("-");
|
|
6698
|
+
const themeValue = getThemeByKey(theme, key, path);
|
|
6748
6699
|
if (typeof themeValue === "string") {
|
|
6749
|
-
themeTracking(key, path
|
|
6750
|
-
detectThemeValue(themeValue, theme
|
|
6700
|
+
themeTracking(key, path);
|
|
6701
|
+
detectThemeValue(themeValue, theme);
|
|
6751
6702
|
}
|
|
6752
6703
|
}
|
|
6753
6704
|
}
|
|
6754
6705
|
}
|
|
6755
6706
|
const trackedProperties = /* @__PURE__ */ new Map();
|
|
6756
|
-
function propertyTracking(property
|
|
6757
|
-
if (!trackedProperties.has(property
|
|
6707
|
+
function propertyTracking(property, value) {
|
|
6708
|
+
if (!trackedProperties.has(property)) trackedProperties.set(property, value);
|
|
6758
6709
|
}
|
|
6759
|
-
|
|
6760
6710
|
//#endregion
|
|
6761
|
-
//#region ../../packages-presets/preset-wind4/dist/container-
|
|
6711
|
+
//#region ../../packages-presets/preset-wind4/dist/container-_7pdPWQl.mjs
|
|
6762
6712
|
const containerParent = [[/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
|
|
6763
6713
|
return {
|
|
6764
6714
|
"container-type": v ?? "inline-size",
|
|
@@ -6769,12 +6719,12 @@ const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
|
6769
6719
|
const container$1 = [[
|
|
6770
6720
|
/^__container$/,
|
|
6771
6721
|
(_, context) => {
|
|
6772
|
-
const { theme
|
|
6773
|
-
const themePadding = theme
|
|
6722
|
+
const { theme, variantHandlers } = context;
|
|
6723
|
+
const themePadding = theme.containers?.padding;
|
|
6774
6724
|
let padding;
|
|
6775
6725
|
if (isString(themePadding)) padding = themePadding;
|
|
6776
6726
|
else padding = themePadding?.DEFAULT;
|
|
6777
|
-
const themeMaxWidth = theme
|
|
6727
|
+
const themeMaxWidth = theme.containers?.maxWidth;
|
|
6778
6728
|
let maxWidth;
|
|
6779
6729
|
for (const v of variantHandlers) {
|
|
6780
6730
|
const query = v.handle?.({}, (x) => x)?.parent;
|
|
@@ -6790,7 +6740,7 @@ const container$1 = [[
|
|
|
6790
6740
|
}
|
|
6791
6741
|
const css = { "max-width": maxWidth };
|
|
6792
6742
|
if (!variantHandlers.length) css.width = "100%";
|
|
6793
|
-
if (theme
|
|
6743
|
+
if (theme.containers?.center) {
|
|
6794
6744
|
css["margin-left"] = "auto";
|
|
6795
6745
|
css["margin-right"] = "auto";
|
|
6796
6746
|
}
|
|
@@ -6808,11 +6758,10 @@ const containerShortcuts = [[/^(?:(\w+)[:-])?container$/, ([, bp], context) => {
|
|
|
6808
6758
|
if (!points.includes(bp)) return;
|
|
6809
6759
|
points = points.slice(points.indexOf(bp));
|
|
6810
6760
|
}
|
|
6811
|
-
const shortcuts
|
|
6812
|
-
if (!bp) shortcuts
|
|
6813
|
-
return shortcuts
|
|
6761
|
+
const shortcuts = points.map((p) => `${p}:__container`);
|
|
6762
|
+
if (!bp) shortcuts.unshift("__container");
|
|
6763
|
+
return shortcuts;
|
|
6814
6764
|
}]];
|
|
6815
|
-
|
|
6816
6765
|
//#endregion
|
|
6817
6766
|
//#region ../../packages-presets/preset-wind4/dist/rules.mjs
|
|
6818
6767
|
const verticalAlignAlias = {
|
|
@@ -6848,21 +6797,21 @@ const textAligns = [...textAlignValues.map((v) => [`text-${v}`, { "text-align":
|
|
|
6848
6797
|
const animations = [
|
|
6849
6798
|
[
|
|
6850
6799
|
/^(?:animate-)?keyframes-(.+)$/,
|
|
6851
|
-
([, name], { theme
|
|
6852
|
-
const kf = theme
|
|
6800
|
+
([, name], { theme }) => {
|
|
6801
|
+
const kf = theme.animation?.keyframes?.[name];
|
|
6853
6802
|
if (kf) return [`@keyframes ${name}${kf}`, { animation: name }];
|
|
6854
6803
|
},
|
|
6855
6804
|
{ autocomplete: ["animate-keyframes-$animation.keyframes", "keyframes-$animation.keyframes"] }
|
|
6856
6805
|
],
|
|
6857
6806
|
[
|
|
6858
6807
|
/^animate-(.+)$/,
|
|
6859
|
-
([, name], { theme
|
|
6860
|
-
const kf = theme
|
|
6808
|
+
([, name], { theme }) => {
|
|
6809
|
+
const kf = theme.animation?.keyframes?.[name];
|
|
6861
6810
|
if (kf) {
|
|
6862
|
-
const duration = theme
|
|
6863
|
-
const timing = theme
|
|
6864
|
-
const count = theme
|
|
6865
|
-
const props = theme
|
|
6811
|
+
const duration = theme.animation?.durations?.[name] ?? "1s";
|
|
6812
|
+
const timing = theme.animation?.timingFns?.[name] ?? "linear";
|
|
6813
|
+
const count = theme.animation?.counts?.[name] ?? 1;
|
|
6814
|
+
const props = theme.animation?.properties?.[name];
|
|
6866
6815
|
return [`@keyframes ${name}${kf}`, {
|
|
6867
6816
|
animation: `${name} ${duration} ${timing} ${count}`,
|
|
6868
6817
|
...props
|
|
@@ -6875,17 +6824,17 @@ const animations = [
|
|
|
6875
6824
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": h.bracket.cssvar(d) ?? d })],
|
|
6876
6825
|
[
|
|
6877
6826
|
/^animate-duration-(.+)$/,
|
|
6878
|
-
([, d], { theme
|
|
6827
|
+
([, d], { theme }) => ({ "animation-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
|
|
6879
6828
|
{ autocomplete: ["animate-duration"] }
|
|
6880
6829
|
],
|
|
6881
6830
|
[
|
|
6882
6831
|
/^animate-delay-(.+)$/,
|
|
6883
|
-
([, d], { theme
|
|
6832
|
+
([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
|
|
6884
6833
|
{ autocomplete: ["animate-delay"] }
|
|
6885
6834
|
],
|
|
6886
6835
|
[
|
|
6887
6836
|
/^animate-ease(?:-(.+))?$/,
|
|
6888
|
-
([, d], { theme
|
|
6837
|
+
([, d], { theme }) => ({ "animation-timing-function": theme.ease?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }),
|
|
6889
6838
|
{ autocomplete: ["animate-ease", "animate-ease-$ease"] }
|
|
6890
6839
|
],
|
|
6891
6840
|
[
|
|
@@ -6983,28 +6932,28 @@ function resolveModifier(modifier) {
|
|
|
6983
6932
|
return interpolationMethod;
|
|
6984
6933
|
}
|
|
6985
6934
|
function bgGradientColorResolver() {
|
|
6986
|
-
return function* ([, position
|
|
6935
|
+
return function* ([, position, body], { theme }) {
|
|
6987
6936
|
const css = {};
|
|
6988
|
-
const data = parseColor(body, theme
|
|
6937
|
+
const data = parseColor(body, theme);
|
|
6989
6938
|
if (data) {
|
|
6990
6939
|
const { color, keys, alpha } = data;
|
|
6991
6940
|
if (color) {
|
|
6992
|
-
if (Object.values(SpecialColorKey).includes(color)) css[`--un-gradient-${position
|
|
6941
|
+
if (Object.values(SpecialColorKey).includes(color)) css[`--un-gradient-${position}`] = color;
|
|
6993
6942
|
else {
|
|
6994
|
-
css[`--un-${position
|
|
6943
|
+
css[`--un-${position}-opacity`] = alpha;
|
|
6995
6944
|
const value = keys ? generateThemeVariable("colors", keys) : color;
|
|
6996
|
-
css[`--un-gradient-${position
|
|
6997
|
-
yield defineProperty(`--un-${position
|
|
6945
|
+
css[`--un-gradient-${position}`] = `color-mix(in oklab, ${value} var(--un-${position}-opacity), transparent)`;
|
|
6946
|
+
yield defineProperty(`--un-${position}-opacity`, {
|
|
6998
6947
|
syntax: "<percentage>",
|
|
6999
6948
|
initialValue: "100%"
|
|
7000
6949
|
});
|
|
7001
6950
|
}
|
|
7002
6951
|
if (keys) themeTracking(`colors`, keys);
|
|
7003
|
-
if (theme
|
|
6952
|
+
if (theme) detectThemeValue(color, theme);
|
|
7004
6953
|
}
|
|
7005
|
-
} else css[`--un-gradient-${position
|
|
7006
|
-
if (css[`--un-gradient-${position
|
|
7007
|
-
switch (position
|
|
6954
|
+
} else css[`--un-gradient-${position}`] = h.bracket.cssvar(body);
|
|
6955
|
+
if (css[`--un-gradient-${position}`]) {
|
|
6956
|
+
switch (position) {
|
|
7008
6957
|
case "from":
|
|
7009
6958
|
yield {
|
|
7010
6959
|
...css,
|
|
@@ -7058,7 +7007,7 @@ const backgroundStyles = [
|
|
|
7058
7007
|
] }
|
|
7059
7008
|
],
|
|
7060
7009
|
[/^(from|via|to|stops)-(.+)$/, bgGradientColorResolver()],
|
|
7061
|
-
[/^(from|via|to)-op(?:acity)?-?(.+)$/, ([, position
|
|
7010
|
+
[/^(from|via|to)-op(?:acity)?-?(.+)$/, ([, position, opacity]) => ({ [`--un-${position}-opacity`]: h.bracket.percent(opacity) })],
|
|
7062
7011
|
[/^(from|via|to)-([\d.]+%)$/, bgGradientPositionResolver()],
|
|
7063
7012
|
[
|
|
7064
7013
|
/^bg-((?:repeating-)?(?:linear|radial|conic))$/,
|
|
@@ -7143,7 +7092,7 @@ const outline = [
|
|
|
7143
7092
|
],
|
|
7144
7093
|
[
|
|
7145
7094
|
/^outline-op(?:acity)?-?(.+)$/,
|
|
7146
|
-
([, opacity
|
|
7095
|
+
([, opacity]) => ({ "--un-outline-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
7147
7096
|
{ autocomplete: "outline-(op|opacity)-<percent>" }
|
|
7148
7097
|
],
|
|
7149
7098
|
[
|
|
@@ -7231,11 +7180,11 @@ const listStyles = {
|
|
|
7231
7180
|
const listStyle = [
|
|
7232
7181
|
[
|
|
7233
7182
|
/^list-(.+?)(?:-(outside|inside))?$/,
|
|
7234
|
-
([, alias, position
|
|
7183
|
+
([, alias, position]) => {
|
|
7235
7184
|
const style = listStyles[alias];
|
|
7236
7185
|
if (style) {
|
|
7237
|
-
if (position
|
|
7238
|
-
"list-style-position": position
|
|
7186
|
+
if (position) return {
|
|
7187
|
+
"list-style-position": position,
|
|
7239
7188
|
"list-style-type": style
|
|
7240
7189
|
};
|
|
7241
7190
|
return { "list-style-type": style };
|
|
@@ -7404,24 +7353,24 @@ function handlerBorderColorOrSize([, a = "", b], ctx) {
|
|
|
7404
7353
|
b
|
|
7405
7354
|
]);
|
|
7406
7355
|
if (hasParseableColor(b, ctx.theme)) {
|
|
7407
|
-
const directions
|
|
7408
|
-
return [directions
|
|
7356
|
+
const directions = directionMap[a].map((i) => borderColorResolver(i)(["", b], ctx)).filter(notNull);
|
|
7357
|
+
return [directions.map((d) => d[0]).reduce((acc, item) => {
|
|
7409
7358
|
Object.assign(acc, item);
|
|
7410
7359
|
return acc;
|
|
7411
|
-
}, {}), ...directions
|
|
7360
|
+
}, {}), ...directions.flatMap((d) => d.slice(1))];
|
|
7412
7361
|
}
|
|
7413
7362
|
}
|
|
7414
7363
|
}
|
|
7415
|
-
function handlerBorderOpacity([, a = "", opacity
|
|
7416
|
-
const v = h.bracket.percent.cssvar(opacity
|
|
7364
|
+
function handlerBorderOpacity([, a = "", opacity]) {
|
|
7365
|
+
const v = h.bracket.percent.cssvar(opacity);
|
|
7417
7366
|
if (a in directionMap && v != null) return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
7418
7367
|
}
|
|
7419
|
-
function handlerRounded([, a = "", s = "DEFAULT"], { theme
|
|
7368
|
+
function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
|
|
7420
7369
|
if (a in cornerMap) {
|
|
7421
7370
|
if (s === "full") return cornerMap[a].map((i) => [`border${i}-radius`, "calc(infinity * 1px)"]);
|
|
7422
|
-
const _v = theme
|
|
7371
|
+
const _v = theme.radius?.[s] ?? h.bracket.cssvar.global.fraction.rem(s);
|
|
7423
7372
|
if (_v != null) {
|
|
7424
|
-
const isVar = theme
|
|
7373
|
+
const isVar = theme.radius && s in theme.radius;
|
|
7425
7374
|
if (isVar) themeTracking(`radius`, s);
|
|
7426
7375
|
return cornerMap[a].map((i) => [`border${i}-radius`, isVar ? generateThemeVariable("radius", s) : _v]);
|
|
7427
7376
|
}
|
|
@@ -7461,15 +7410,15 @@ const bgColors = [[
|
|
|
7461
7410
|
{ autocomplete: "bg-$colors" }
|
|
7462
7411
|
], [
|
|
7463
7412
|
/^bg-op(?:acity)?-?(.+)$/,
|
|
7464
|
-
([, opacity
|
|
7413
|
+
([, opacity]) => ({ "--un-bg-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
7465
7414
|
{ autocomplete: "bg-(op|opacity)-<percent>" }
|
|
7466
7415
|
]];
|
|
7467
7416
|
const colorScheme = [[/^(?:color-)?scheme-(.+)$/, ([, v]) => ({ "color-scheme": v.split("-").join(" ") })]];
|
|
7468
7417
|
const columns = [
|
|
7469
7418
|
[
|
|
7470
7419
|
/^columns-(.+)$/,
|
|
7471
|
-
([, v], { theme
|
|
7472
|
-
if (theme
|
|
7420
|
+
([, v], { theme }) => {
|
|
7421
|
+
if (theme.container && v in theme.container) {
|
|
7473
7422
|
themeTracking("container", v);
|
|
7474
7423
|
return { columns: generateThemeVariable("container", v) };
|
|
7475
7424
|
}
|
|
@@ -7533,7 +7482,7 @@ const textDecorations = [
|
|
|
7533
7482
|
],
|
|
7534
7483
|
[
|
|
7535
7484
|
/^(?:underline|decoration)-op(?:acity)?-?(.+)$/,
|
|
7536
|
-
([, opacity
|
|
7485
|
+
([, opacity]) => ({ "--un-line-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
7537
7486
|
{ autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }
|
|
7538
7487
|
],
|
|
7539
7488
|
[
|
|
@@ -7602,9 +7551,9 @@ const spaces = [[
|
|
|
7602
7551
|
"space-(x|y)-reverse",
|
|
7603
7552
|
"space-(x|y)-$spacing"
|
|
7604
7553
|
] }
|
|
7605
|
-
], [/^space-([xy])-reverse$/, function* ([m, d], { symbols
|
|
7554
|
+
], [/^space-([xy])-reverse$/, function* ([m, d], { symbols }) {
|
|
7606
7555
|
yield {
|
|
7607
|
-
[symbols
|
|
7556
|
+
[symbols.variants]: [notLastChildSelectorVariant(m)],
|
|
7608
7557
|
[`--un-space-${d}-reverse`]: "1"
|
|
7609
7558
|
};
|
|
7610
7559
|
yield defineProperty(`--un-space-${d}-reverse`, { initialValue: 0 });
|
|
@@ -7619,20 +7568,20 @@ function notLastChildSelectorVariant(s) {
|
|
|
7619
7568
|
})
|
|
7620
7569
|
};
|
|
7621
7570
|
}
|
|
7622
|
-
function* handlerSpace([m, d, s], { theme
|
|
7571
|
+
function* handlerSpace([m, d, s], { theme, symbols }) {
|
|
7623
7572
|
let v;
|
|
7624
7573
|
const num = numberResolver(s);
|
|
7625
7574
|
if (num != null) {
|
|
7626
7575
|
themeTracking(`spacing`);
|
|
7627
7576
|
v = `calc(var(--spacing) * ${num})`;
|
|
7628
|
-
} else v = theme
|
|
7577
|
+
} else v = theme.spacing?.[s] ?? h.bracket.cssvar.auto.fraction.rem(s || "1");
|
|
7629
7578
|
if (v != null) {
|
|
7630
7579
|
const results = directionMap[d === "x" ? "inline" : "block"].map((item, index) => {
|
|
7631
7580
|
return [`margin${item}`, `calc(${v} * ${index === 0 ? `var(--un-space-${d}-reverse)` : `calc(1 - var(--un-space-${d}-reverse))`})`];
|
|
7632
7581
|
});
|
|
7633
7582
|
if (results) {
|
|
7634
7583
|
yield {
|
|
7635
|
-
[symbols
|
|
7584
|
+
[symbols.variants]: [notLastChildSelectorVariant(m)],
|
|
7636
7585
|
[`--un-space-${d}-reverse`]: "0",
|
|
7637
7586
|
...Object.fromEntries(results)
|
|
7638
7587
|
};
|
|
@@ -7657,10 +7606,10 @@ const divides = [
|
|
|
7657
7606
|
],
|
|
7658
7607
|
[
|
|
7659
7608
|
/^divide-op(?:acity)?-?(.+)$/,
|
|
7660
|
-
function* ([match, opacity
|
|
7609
|
+
function* ([match, opacity], { symbols }) {
|
|
7661
7610
|
yield {
|
|
7662
|
-
[symbols
|
|
7663
|
-
"--un-divide-opacity": h.bracket.percent(opacity
|
|
7611
|
+
[symbols.variants]: [notLastChildSelectorVariant(match)],
|
|
7612
|
+
"--un-divide-opacity": h.bracket.percent(opacity)
|
|
7664
7613
|
};
|
|
7665
7614
|
},
|
|
7666
7615
|
{ autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }
|
|
@@ -7671,25 +7620,25 @@ const divides = [
|
|
|
7671
7620
|
{ autocomplete: ["divide-(x|y)", "divide-(x|y)-reverse"] }
|
|
7672
7621
|
],
|
|
7673
7622
|
[/^divide-?([xy])-?(.+)$/, handlerDivide],
|
|
7674
|
-
[/^divide-?([xy])-reverse$/, function* ([m, d], { symbols
|
|
7623
|
+
[/^divide-?([xy])-reverse$/, function* ([m, d], { symbols }) {
|
|
7675
7624
|
yield {
|
|
7676
|
-
[symbols
|
|
7625
|
+
[symbols.variants]: [notLastChildSelectorVariant(m)],
|
|
7677
7626
|
[`--un-divide-${d}-reverse`]: "1"
|
|
7678
7627
|
};
|
|
7679
7628
|
yield defineProperty(`--un-divide-${d}-reverse`, { initialValue: 0 });
|
|
7680
7629
|
}],
|
|
7681
7630
|
[
|
|
7682
|
-
|
|
7683
|
-
function* ([match, style], { symbols
|
|
7631
|
+
new RegExp(`^divide-(${borderStyles.join("|")})$`),
|
|
7632
|
+
function* ([match, style], { symbols }) {
|
|
7684
7633
|
yield {
|
|
7685
|
-
[symbols
|
|
7634
|
+
[symbols.variants]: [notLastChildSelectorVariant(match)],
|
|
7686
7635
|
"border-style": style
|
|
7687
7636
|
};
|
|
7688
7637
|
},
|
|
7689
7638
|
{ autocomplete: borderStyles.map((i) => `divide-${i}`) }
|
|
7690
7639
|
]
|
|
7691
7640
|
];
|
|
7692
|
-
function* handlerDivide([m, d, s], { symbols
|
|
7641
|
+
function* handlerDivide([m, d, s], { symbols }) {
|
|
7693
7642
|
let v = h.bracket.cssvar.px(s || "1");
|
|
7694
7643
|
if (v != null) {
|
|
7695
7644
|
if (v === "0") v = "0px";
|
|
@@ -7702,7 +7651,7 @@ function* handlerDivide([m, d, s], { symbols: symbols$1 }) {
|
|
|
7702
7651
|
});
|
|
7703
7652
|
if (results) {
|
|
7704
7653
|
yield {
|
|
7705
|
-
[symbols
|
|
7654
|
+
[symbols.variants]: [notLastChildSelectorVariant(m)],
|
|
7706
7655
|
[`--un-divide-${d}-reverse`]: 0,
|
|
7707
7656
|
...Object.fromEntries(results.flat())
|
|
7708
7657
|
};
|
|
@@ -7744,8 +7693,8 @@ function percentWithDefault(str) {
|
|
|
7744
7693
|
if (v != null && Number.parseFloat(v.slice(0, -1)) <= 100) return v;
|
|
7745
7694
|
}
|
|
7746
7695
|
function toFilter(varName, resolver) {
|
|
7747
|
-
return ([, b, s], { theme
|
|
7748
|
-
const value = resolver(s, theme
|
|
7696
|
+
return ([, b, s], { theme }) => {
|
|
7697
|
+
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
7749
7698
|
if (value !== "") if (b) return [{
|
|
7750
7699
|
[`--un-${b}${varName}`]: `${varName}(${value})`,
|
|
7751
7700
|
"-webkit-backdrop-filter": backdropCSS,
|
|
@@ -7759,15 +7708,15 @@ function toFilter(varName, resolver) {
|
|
|
7759
7708
|
}
|
|
7760
7709
|
function dropShadowResolver(match, ctx) {
|
|
7761
7710
|
const [, s] = match;
|
|
7762
|
-
const { theme
|
|
7711
|
+
const { theme } = ctx;
|
|
7763
7712
|
let res = [];
|
|
7764
7713
|
if (s) {
|
|
7765
7714
|
res = getStringComponents(s, "/", 2) ?? [];
|
|
7766
7715
|
if (s.startsWith("/")) res = ["", s.slice(1)];
|
|
7767
7716
|
}
|
|
7768
|
-
let v = theme
|
|
7717
|
+
let v = theme.dropShadow?.[res[0] || "DEFAULT"];
|
|
7769
7718
|
const c = s ? h.bracket.cssvar(s) : void 0;
|
|
7770
|
-
if ((v != null || c != null) && !hasParseableColor(c, theme
|
|
7719
|
+
if ((v != null || c != null) && !hasParseableColor(c, theme)) {
|
|
7771
7720
|
const alpha = res[1] ? h.bracket.percent.cssvar(res[1]) : void 0;
|
|
7772
7721
|
return [{
|
|
7773
7722
|
"--un-drop-shadow-opacity": alpha,
|
|
@@ -7775,7 +7724,7 @@ function dropShadowResolver(match, ctx) {
|
|
|
7775
7724
|
"filter": filterCSS
|
|
7776
7725
|
}, ...filterProperties];
|
|
7777
7726
|
}
|
|
7778
|
-
if (hasParseableColor(s, theme
|
|
7727
|
+
if (hasParseableColor(s, theme)) return colorResolver("--un-drop-shadow-color", "drop-shadow")(match, ctx);
|
|
7779
7728
|
v = h.bracket.cssvar(s) ?? (s === "none" ? "" : void 0);
|
|
7780
7729
|
if (v != null) return [{
|
|
7781
7730
|
"--un-drop-shadow": v ? `drop-shadow(${v})` : v,
|
|
@@ -7785,7 +7734,7 @@ function dropShadowResolver(match, ctx) {
|
|
|
7785
7734
|
const filters = [
|
|
7786
7735
|
[
|
|
7787
7736
|
/^(?:(backdrop-)|filter-)?blur(?:-(.+))?$/,
|
|
7788
|
-
toFilter("blur", (s, theme
|
|
7737
|
+
toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || h.bracket.cssvar.px(s)),
|
|
7789
7738
|
{ autocomplete: [
|
|
7790
7739
|
"(backdrop|filter)-blur-$blur",
|
|
7791
7740
|
"blur-$blur",
|
|
@@ -7824,7 +7773,7 @@ const filters = [
|
|
|
7824
7773
|
] }
|
|
7825
7774
|
],
|
|
7826
7775
|
[/^(?:filter-)?drop-shadow-color-(.+)$/, colorResolver("--un-drop-shadow-color", "drop-shadow")],
|
|
7827
|
-
[/^(?:filter-)?drop-shadow(?:-color)?-op(?:acity)?-?(.+)$/, ([, opacity
|
|
7776
|
+
[/^(?:filter-)?drop-shadow(?:-color)?-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-drop-shadow-opacity": h.bracket.percent(opacity) })],
|
|
7828
7777
|
[
|
|
7829
7778
|
/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/,
|
|
7830
7779
|
toFilter("grayscale", percentWithDefault),
|
|
@@ -7995,7 +7944,7 @@ const grids = [
|
|
|
7995
7944
|
{ autocomplete: "(grid-rows|grid-cols|rows|cols)-<num>" }
|
|
7996
7945
|
],
|
|
7997
7946
|
[/^grid-area(s)?-(.+)$/, ([, s, v]) => {
|
|
7998
|
-
if (s != null) return { "grid-template-areas": h.cssvar(v) ?? v.split("-").map((s
|
|
7947
|
+
if (s != null) return { "grid-template-areas": h.cssvar(v) ?? v.split("-").map((s) => `"${h.bracket(s)}"`).join(" ") };
|
|
7999
7948
|
return { "grid-area": h.bracket.cssvar(v) };
|
|
8000
7949
|
}],
|
|
8001
7950
|
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
@@ -8047,8 +7996,8 @@ const baseMaskImage = {
|
|
|
8047
7996
|
};
|
|
8048
7997
|
function handlePosition([, v = ""]) {
|
|
8049
7998
|
if (v in cornerMap) {
|
|
8050
|
-
const positions
|
|
8051
|
-
return { "mask-position": positions
|
|
7999
|
+
const positions = v.split("").flatMap((c) => linearMap[c]).join(" ");
|
|
8000
|
+
return { "mask-position": positions };
|
|
8052
8001
|
}
|
|
8053
8002
|
const _v = h.bracket.cssvar.global.position(v);
|
|
8054
8003
|
if (_v !== null) return { "mask-position": _v };
|
|
@@ -8210,7 +8159,7 @@ const placeholders = [[
|
|
|
8210
8159
|
{ autocomplete: "placeholder-$colors" }
|
|
8211
8160
|
], [
|
|
8212
8161
|
/^\$ placeholder-op(?:acity)?-?(.+)$/,
|
|
8213
|
-
([, opacity
|
|
8162
|
+
([, opacity]) => ({ "--un-placeholder-opacity": h.bracket.percent(opacity) }),
|
|
8214
8163
|
{ autocomplete: ["placeholder-(op|opacity)", "placeholder-(op|opacity)-<percent>"] }
|
|
8215
8164
|
]];
|
|
8216
8165
|
const positions = [
|
|
@@ -8421,7 +8370,7 @@ const boxShadows = [
|
|
|
8421
8370
|
],
|
|
8422
8371
|
[
|
|
8423
8372
|
/^shadow-op(?:acity)?-?(.+)$/,
|
|
8424
|
-
([, opacity
|
|
8373
|
+
([, opacity]) => ({ "--un-shadow-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8425
8374
|
{ autocomplete: "shadow-(op|opacity)-<percent>" }
|
|
8426
8375
|
],
|
|
8427
8376
|
[
|
|
@@ -8431,23 +8380,23 @@ const boxShadows = [
|
|
|
8431
8380
|
],
|
|
8432
8381
|
[
|
|
8433
8382
|
/^inset-shadow-op(?:acity)?-?(.+)$/,
|
|
8434
|
-
([, opacity
|
|
8383
|
+
([, opacity]) => ({ "--un-inset-shadow-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8435
8384
|
{ autocomplete: "shadow-(op|opacity)-<percent>" }
|
|
8436
8385
|
]
|
|
8437
8386
|
];
|
|
8438
8387
|
function handleShadow(themeKey) {
|
|
8439
8388
|
return (match, ctx) => {
|
|
8440
8389
|
const [, d] = match;
|
|
8441
|
-
const { theme
|
|
8390
|
+
const { theme } = ctx;
|
|
8442
8391
|
let res = [];
|
|
8443
8392
|
if (d) {
|
|
8444
8393
|
res = getStringComponents(d, "/", 2) ?? [];
|
|
8445
8394
|
if (d.startsWith("/")) res = ["", d.slice(1)];
|
|
8446
8395
|
}
|
|
8447
|
-
const v = theme
|
|
8396
|
+
const v = theme[themeKey]?.[res[0] || "DEFAULT"];
|
|
8448
8397
|
const c = d ? h.bracket.cssvar(d) : void 0;
|
|
8449
8398
|
const shadowVar = hyphenate(themeKey);
|
|
8450
|
-
if ((v != null || c != null) && !hasParseableColor(c, theme
|
|
8399
|
+
if ((v != null || c != null) && !hasParseableColor(c, theme)) {
|
|
8451
8400
|
const alpha = res[1] ? h.bracket.percent.cssvar(res[1]) : void 0;
|
|
8452
8401
|
return [{
|
|
8453
8402
|
[`--un-${shadowVar}-opacity`]: alpha,
|
|
@@ -8473,7 +8422,7 @@ const rings = [
|
|
|
8473
8422
|
],
|
|
8474
8423
|
[
|
|
8475
8424
|
/^ring-op(?:acity)?-?(.+)$/,
|
|
8476
|
-
([, opacity
|
|
8425
|
+
([, opacity]) => ({ "--un-ring-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8477
8426
|
{ autocomplete: "ring-(op|opacity)-<percent>" }
|
|
8478
8427
|
],
|
|
8479
8428
|
[/^inset-ring(?:-(.+))?$/, ([, d]) => {
|
|
@@ -8490,7 +8439,7 @@ const rings = [
|
|
|
8490
8439
|
],
|
|
8491
8440
|
[
|
|
8492
8441
|
/^inset-ring-op(?:acity)?-?(.+)$/,
|
|
8493
|
-
([, opacity
|
|
8442
|
+
([, opacity]) => ({ "--un-inset-ring-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8494
8443
|
{ autocomplete: "inset-ring-(op|opacity)-<percent>" }
|
|
8495
8444
|
],
|
|
8496
8445
|
[
|
|
@@ -8511,7 +8460,7 @@ const rings = [
|
|
|
8511
8460
|
],
|
|
8512
8461
|
[
|
|
8513
8462
|
/^ring-offset-op(?:acity)?-?(.+)$/,
|
|
8514
|
-
([, opacity
|
|
8463
|
+
([, opacity]) => ({ "--un-ring-offset-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8515
8464
|
{ autocomplete: "ring-offset-(op|opacity)-<percent>" }
|
|
8516
8465
|
],
|
|
8517
8466
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
@@ -8559,9 +8508,9 @@ const sizeMapping = {
|
|
|
8559
8508
|
function getPropName(minmax, hw) {
|
|
8560
8509
|
return `${minmax || ""}${sizeMapping[hw]}`;
|
|
8561
8510
|
}
|
|
8562
|
-
function getSizeValue(theme
|
|
8511
|
+
function getSizeValue(theme, hw, prop) {
|
|
8563
8512
|
let v;
|
|
8564
|
-
for (const key of ["container", "spacing"]) if (theme
|
|
8513
|
+
for (const key of ["container", "spacing"]) if (theme[key]?.[prop]) {
|
|
8565
8514
|
themeTracking(key, prop);
|
|
8566
8515
|
v = generateThemeVariable(key, prop);
|
|
8567
8516
|
break;
|
|
@@ -8586,14 +8535,14 @@ function getSizeValue(theme$2, hw, prop) {
|
|
|
8586
8535
|
return v ?? h.bracket.cssvar.global.auto.none.fraction.rem(prop);
|
|
8587
8536
|
}
|
|
8588
8537
|
const sizes = [
|
|
8589
|
-
[/^size-(min-|max-)?(.+)$/, ([, m, s], { theme
|
|
8590
|
-
[getPropName(m, "w")]: getSizeValue(theme
|
|
8591
|
-
[getPropName(m, "h")]: getSizeValue(theme
|
|
8538
|
+
[/^size-(min-|max-)?(.+)$/, ([, m, s], { theme }) => ({
|
|
8539
|
+
[getPropName(m, "w")]: getSizeValue(theme, "w", s),
|
|
8540
|
+
[getPropName(m, "h")]: getSizeValue(theme, "h", s)
|
|
8592
8541
|
})],
|
|
8593
|
-
[/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme
|
|
8542
|
+
[/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(theme, w, s) })],
|
|
8594
8543
|
[
|
|
8595
8544
|
/^(?:size-)?(min-|max-)?(block|inline)-(.+)$/,
|
|
8596
|
-
([, m, w, s], { theme
|
|
8545
|
+
([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(theme, w, s) }),
|
|
8597
8546
|
{ autocomplete: [
|
|
8598
8547
|
"(w|h)-<num>",
|
|
8599
8548
|
"(w|h)-(full|screen|fit|max|min)",
|
|
@@ -8606,7 +8555,7 @@ const sizes = [
|
|
|
8606
8555
|
"(max|min)-(w|h|block|inline)-(full|screen|fit|max|min)"
|
|
8607
8556
|
] }
|
|
8608
8557
|
],
|
|
8609
|
-
[/^(?:size-)?(min-|max-)?(h)-screen-(.+)$/, ([, m, h
|
|
8558
|
+
[/^(?:size-)?(min-|max-)?(h)-screen-(.+)$/, ([, m, h, p], context) => ({ [getPropName(m, h)]: handleBreakpoint(context, p, "verticalBreakpoint") })],
|
|
8610
8559
|
[
|
|
8611
8560
|
/^(?:size-)?(min-|max-)?(w)-screen-(.+)$/,
|
|
8612
8561
|
([, m, w, p], context) => ({ [getPropName(m, w)]: handleBreakpoint(context, p) }),
|
|
@@ -8971,7 +8920,7 @@ const svgUtilities = [
|
|
|
8971
8920
|
],
|
|
8972
8921
|
[
|
|
8973
8922
|
/^fill-op(?:acity)?-?(.+)$/,
|
|
8974
|
-
([, opacity
|
|
8923
|
+
([, opacity]) => ({ "--un-fill-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8975
8924
|
{ autocomplete: "fill-(op|opacity)-<percent>" }
|
|
8976
8925
|
],
|
|
8977
8926
|
["fill-none", { fill: "none" }],
|
|
@@ -8989,7 +8938,7 @@ const svgUtilities = [
|
|
|
8989
8938
|
],
|
|
8990
8939
|
[
|
|
8991
8940
|
/^stroke-op(?:acity)?-?(.+)$/,
|
|
8992
|
-
([, opacity
|
|
8941
|
+
([, opacity]) => ({ "--un-stroke-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
8993
8942
|
{ autocomplete: "stroke-(op|opacity)-<percent>" }
|
|
8994
8943
|
],
|
|
8995
8944
|
["stroke-cap-square", { "stroke-linecap": "square" }],
|
|
@@ -9024,8 +8973,8 @@ const tables = [
|
|
|
9024
8973
|
["border-separate", { "border-collapse": "separate" }],
|
|
9025
8974
|
[
|
|
9026
8975
|
/^border-spacing-(.+)$/,
|
|
9027
|
-
function* ([, s], { theme
|
|
9028
|
-
const v = resolveValue(s, theme
|
|
8976
|
+
function* ([, s], { theme }) {
|
|
8977
|
+
const v = resolveValue(s, theme);
|
|
9029
8978
|
if (v != null) {
|
|
9030
8979
|
yield {
|
|
9031
8980
|
"--un-border-spacing-x": v,
|
|
@@ -9042,14 +8991,14 @@ const tables = [
|
|
|
9042
8991
|
],
|
|
9043
8992
|
[
|
|
9044
8993
|
/^border-spacing-([xy])-(.+)$/,
|
|
9045
|
-
function* ([, d, s], { theme
|
|
9046
|
-
const v = resolveValue(s, theme
|
|
8994
|
+
function* ([, d, s], { theme }) {
|
|
8995
|
+
const v = resolveValue(s, theme);
|
|
9047
8996
|
if (v != null) {
|
|
9048
8997
|
yield {
|
|
9049
8998
|
[`--un-border-spacing-${d}`]: v,
|
|
9050
8999
|
"border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
|
|
9051
9000
|
};
|
|
9052
|
-
for (const d
|
|
9001
|
+
for (const d of ["x", "y"]) yield defineProperty(`--un-border-spacing-${d}`, {
|
|
9053
9002
|
syntax: "<length>",
|
|
9054
9003
|
initialValue: "0"
|
|
9055
9004
|
});
|
|
@@ -9064,8 +9013,8 @@ const tables = [
|
|
|
9064
9013
|
["table-empty-cells-visible", { "empty-cells": "show" }],
|
|
9065
9014
|
["table-empty-cells-hidden", { "empty-cells": "hide" }]
|
|
9066
9015
|
];
|
|
9067
|
-
function resolveValue(s, theme
|
|
9068
|
-
let v = theme
|
|
9016
|
+
function resolveValue(s, theme) {
|
|
9017
|
+
let v = theme.spacing?.[s];
|
|
9069
9018
|
if (!v) {
|
|
9070
9019
|
const num = numberResolver(s);
|
|
9071
9020
|
if (num != null) {
|
|
@@ -9134,9 +9083,9 @@ const transforms = [
|
|
|
9134
9083
|
],
|
|
9135
9084
|
[
|
|
9136
9085
|
/^(transform-)?perspect(?:ive)?-(.+)$/,
|
|
9137
|
-
([, t, s], { theme
|
|
9086
|
+
([, t, s], { theme }) => {
|
|
9138
9087
|
let v;
|
|
9139
|
-
if (theme
|
|
9088
|
+
if (theme.perspective?.[s]) {
|
|
9140
9089
|
themeTracking(`perspective`, s);
|
|
9141
9090
|
v = generateThemeVariable("perspective", s);
|
|
9142
9091
|
} else v = h.bracket.cssvar.px.numberWithUnit(s);
|
|
@@ -9197,7 +9146,7 @@ function handleTranslate([, d, b]) {
|
|
|
9197
9146
|
"x",
|
|
9198
9147
|
"y",
|
|
9199
9148
|
"z"
|
|
9200
|
-
].map((d
|
|
9149
|
+
].map((d) => defineProperty(`--un-translate-${d}`, { initialValue: 0 }))];
|
|
9201
9150
|
}
|
|
9202
9151
|
}
|
|
9203
9152
|
function handleScale([, d, b]) {
|
|
@@ -9208,7 +9157,7 @@ function handleScale([, d, b]) {
|
|
|
9208
9157
|
"x",
|
|
9209
9158
|
"y",
|
|
9210
9159
|
"z"
|
|
9211
|
-
].map((d
|
|
9160
|
+
].map((d) => defineProperty(`--un-scale-${d}`, { initialValue: 1 }))];
|
|
9212
9161
|
}
|
|
9213
9162
|
}
|
|
9214
9163
|
function handleRotate([, d = "", b]) {
|
|
@@ -9221,8 +9170,8 @@ function handleRotate([, d = "", b]) {
|
|
|
9221
9170
|
"x",
|
|
9222
9171
|
"y",
|
|
9223
9172
|
"z"
|
|
9224
|
-
].map((d
|
|
9225
|
-
...["x", "y"].map((d
|
|
9173
|
+
].map((d) => defineProperty(`--un-rotate-${d}`, { initialValue: `rotate${d.toUpperCase()}(0)` })),
|
|
9174
|
+
...["x", "y"].map((d) => defineProperty(`--un-skew-${d}`, { initialValue: `skew${d.toUpperCase()}(0)` }))
|
|
9226
9175
|
];
|
|
9227
9176
|
else return { rotate: h.bracket.cssvar.degree(b) };
|
|
9228
9177
|
}
|
|
@@ -9236,37 +9185,37 @@ function handleSkew([, d, b]) {
|
|
|
9236
9185
|
"x",
|
|
9237
9186
|
"y",
|
|
9238
9187
|
"z"
|
|
9239
|
-
].map((d
|
|
9240
|
-
...["x", "y"].map((d
|
|
9188
|
+
].map((d) => defineProperty(`--un-rotate-${d}`, { initialValue: `rotate${d.toUpperCase()}(0)` })),
|
|
9189
|
+
...["x", "y"].map((d) => defineProperty(`--un-skew-${d}`, { initialValue: `skew${d.toUpperCase()}(0)` }))
|
|
9241
9190
|
];
|
|
9242
9191
|
}
|
|
9243
9192
|
function transformXYZ(d, v, name) {
|
|
9244
9193
|
const values = v.split(splitComma);
|
|
9245
9194
|
if (d || !d && values.length === 1) return xyzMap[d].map((i) => [`--un-${name}${i}`, v]);
|
|
9246
|
-
return values.map((v
|
|
9195
|
+
return values.map((v, i) => [`--un-${name}-${xyzArray[i]}`, v]);
|
|
9247
9196
|
}
|
|
9248
|
-
function resolveTransitionProperty(prop, theme
|
|
9197
|
+
function resolveTransitionProperty(prop, theme) {
|
|
9249
9198
|
let p;
|
|
9250
9199
|
if (h.cssvar(prop) != null) p = h.cssvar(prop);
|
|
9251
9200
|
else {
|
|
9252
9201
|
if (prop.startsWith("[") && prop.endsWith("]")) prop = prop.slice(1, -1);
|
|
9253
|
-
const props = prop.split(",").map((p
|
|
9202
|
+
const props = prop.split(",").map((p) => theme.property?.[p] ?? h.properties(p));
|
|
9254
9203
|
if (props.every(Boolean)) p = props.join(",");
|
|
9255
9204
|
}
|
|
9256
9205
|
return p;
|
|
9257
9206
|
}
|
|
9258
9207
|
const transitions = [
|
|
9259
|
-
[/^transition(?:-(\D+?))?(?:-(\d+))?$/, ([, prop, d], { theme
|
|
9208
|
+
[/^transition(?:-(\D+?))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
|
|
9260
9209
|
themeTracking("default", ["transition", "timingFunction"]);
|
|
9261
9210
|
themeTracking("default", ["transition", "duration"]);
|
|
9262
9211
|
const defaultTransition = {
|
|
9263
|
-
"transition-property": theme
|
|
9212
|
+
"transition-property": theme.property?.DEFAULT,
|
|
9264
9213
|
"transition-timing-function": `var(--un-ease, ${generateThemeVariable("default", ["transition", "timingFunction"])})`,
|
|
9265
9214
|
"transition-duration": `var(--un-duration, ${generateThemeVariable("default", ["transition", "duration"])})`
|
|
9266
9215
|
};
|
|
9267
9216
|
if (!prop && !d) return { ...defaultTransition };
|
|
9268
9217
|
else if (prop != null) {
|
|
9269
|
-
const p = resolveTransitionProperty(prop, theme
|
|
9218
|
+
const p = resolveTransitionProperty(prop, theme);
|
|
9270
9219
|
if (p) return {
|
|
9271
9220
|
"--un-duration": d && h.time(d),
|
|
9272
9221
|
...defaultTransition,
|
|
@@ -9284,9 +9233,9 @@ const transitions = [
|
|
|
9284
9233
|
[/^(?:transition-)?delay-(.+)$/, ([, d]) => ({ "transition-delay": h.bracket.cssvar.time(d) })],
|
|
9285
9234
|
[
|
|
9286
9235
|
/^(?:transition-)?ease(?:-(.+))?$/,
|
|
9287
|
-
([, d = "DEFAULT"], { theme
|
|
9236
|
+
([, d = "DEFAULT"], { theme }) => {
|
|
9288
9237
|
let v;
|
|
9289
|
-
if (theme
|
|
9238
|
+
if (theme.ease?.[d]) {
|
|
9290
9239
|
themeTracking("ease", d);
|
|
9291
9240
|
v = generateThemeVariable("ease", d);
|
|
9292
9241
|
} else v = h.bracket.cssvar(d);
|
|
@@ -9299,8 +9248,8 @@ const transitions = [
|
|
|
9299
9248
|
],
|
|
9300
9249
|
[
|
|
9301
9250
|
/^(?:transition-)?property-(.+)$/,
|
|
9302
|
-
([, v], { theme
|
|
9303
|
-
const p = h.global(v) || resolveTransitionProperty(v, theme
|
|
9251
|
+
([, v], { theme }) => {
|
|
9252
|
+
const p = h.global(v) || resolveTransitionProperty(v, theme);
|
|
9304
9253
|
if (p) return { "transition-property": p };
|
|
9305
9254
|
},
|
|
9306
9255
|
{ autocomplete: [`transition-property-(${[...globalKeywords].join("|")})`] }
|
|
@@ -9334,14 +9283,14 @@ const fonts = [
|
|
|
9334
9283
|
],
|
|
9335
9284
|
[
|
|
9336
9285
|
/^(?:text|color|c)-op(?:acity)?-?(.+)$/,
|
|
9337
|
-
([, opacity
|
|
9286
|
+
([, opacity]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
9338
9287
|
{ autocomplete: "(text|color|c)-(op|opacity)-<percent>" }
|
|
9339
9288
|
],
|
|
9340
9289
|
[
|
|
9341
9290
|
/^fw-?([^-]+)$/,
|
|
9342
|
-
([, s], { theme
|
|
9291
|
+
([, s], { theme }) => {
|
|
9343
9292
|
let v;
|
|
9344
|
-
if (theme
|
|
9293
|
+
if (theme.fontWeight?.[s]) {
|
|
9345
9294
|
themeTracking(`fontWeight`, s);
|
|
9346
9295
|
v = generateThemeVariable("fontWeight", s);
|
|
9347
9296
|
} else v = h.bracket.cssvar.global.number(s);
|
|
@@ -9354,9 +9303,9 @@ const fonts = [
|
|
|
9354
9303
|
],
|
|
9355
9304
|
[
|
|
9356
9305
|
/^(?:font-)?(?:leading|lh|line-height)-(.+)$/,
|
|
9357
|
-
([, s], { theme
|
|
9306
|
+
([, s], { theme }) => {
|
|
9358
9307
|
let v;
|
|
9359
|
-
if (theme
|
|
9308
|
+
if (theme.leading?.[s]) {
|
|
9360
9309
|
themeTracking("leading", s);
|
|
9361
9310
|
v = generateThemeVariable("leading", s);
|
|
9362
9311
|
} else if (numberResolver(s)) {
|
|
@@ -9377,9 +9326,9 @@ const fonts = [
|
|
|
9377
9326
|
[/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": h.bracket.cssvar.global(s) })],
|
|
9378
9327
|
[
|
|
9379
9328
|
/^(?:font-)?tracking-(.+)$/,
|
|
9380
|
-
([, s], { theme
|
|
9329
|
+
([, s], { theme }) => {
|
|
9381
9330
|
let v;
|
|
9382
|
-
if (theme
|
|
9331
|
+
if (theme.tracking?.[s]) {
|
|
9383
9332
|
themeTracking(`tracking`, s);
|
|
9384
9333
|
v = generateThemeVariable("tracking", s);
|
|
9385
9334
|
} else v = h.bracket.cssvar.global.rem(s);
|
|
@@ -9392,8 +9341,8 @@ const fonts = [
|
|
|
9392
9341
|
],
|
|
9393
9342
|
[
|
|
9394
9343
|
/^(?:font-)?word-spacing-(.+)$/,
|
|
9395
|
-
([, s], { theme
|
|
9396
|
-
const v = theme
|
|
9344
|
+
([, s], { theme }) => {
|
|
9345
|
+
const v = theme.tracking?.[s] ? generateThemeVariable("tracking", s) : h.bracket.cssvar.global.rem(s);
|
|
9397
9346
|
return {
|
|
9398
9347
|
"--un-word-spacing": v,
|
|
9399
9348
|
"word-spacing": v
|
|
@@ -9417,14 +9366,14 @@ const fonts = [
|
|
|
9417
9366
|
],
|
|
9418
9367
|
[
|
|
9419
9368
|
/^font-(.+)$/,
|
|
9420
|
-
([, d], { theme
|
|
9369
|
+
([, d], { theme }) => {
|
|
9421
9370
|
let v;
|
|
9422
|
-
if (theme
|
|
9371
|
+
if (theme.font?.[d]) {
|
|
9423
9372
|
themeTracking("font", d);
|
|
9424
9373
|
v = generateThemeVariable("font", d);
|
|
9425
9374
|
return { "font-family": v };
|
|
9426
9375
|
}
|
|
9427
|
-
if (theme
|
|
9376
|
+
if (theme.fontWeight?.[d]) {
|
|
9428
9377
|
themeTracking("fontWeight", d);
|
|
9429
9378
|
v = generateThemeVariable("fontWeight", d);
|
|
9430
9379
|
return {
|
|
@@ -9484,9 +9433,9 @@ const textIndents = [[/^indent-(.+)$/, ([, s]) => {
|
|
|
9484
9433
|
const textStrokes = [
|
|
9485
9434
|
[
|
|
9486
9435
|
/^text-stroke(?:-(.+))?$/,
|
|
9487
|
-
([, s = "DEFAULT"], { theme
|
|
9488
|
-
if (theme
|
|
9489
|
-
return { "-webkit-text-stroke-width": theme
|
|
9436
|
+
([, s = "DEFAULT"], { theme }) => {
|
|
9437
|
+
if (theme.textStrokeWidth?.[s]) themeTracking(`textStrokeWidth`, s);
|
|
9438
|
+
return { "-webkit-text-stroke-width": theme.textStrokeWidth?.[s] ? generateThemeVariable("textStrokeWidth", s) : h.bracket.cssvar.px(s) };
|
|
9490
9439
|
},
|
|
9491
9440
|
{ autocomplete: "text-stroke-$textStrokeWidth" }
|
|
9492
9441
|
],
|
|
@@ -9497,18 +9446,18 @@ const textStrokes = [
|
|
|
9497
9446
|
],
|
|
9498
9447
|
[
|
|
9499
9448
|
/^text-stroke-op(?:acity)?-?(.+)$/,
|
|
9500
|
-
([, opacity
|
|
9449
|
+
([, opacity]) => ({ "--un-text-stroke-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
9501
9450
|
{ autocomplete: "text-stroke-(op|opacity)-<percent>" }
|
|
9502
9451
|
]
|
|
9503
9452
|
];
|
|
9504
9453
|
function handleTextShadow(match, ctx) {
|
|
9505
9454
|
const [, s] = match;
|
|
9506
|
-
const { theme
|
|
9455
|
+
const { theme } = ctx;
|
|
9507
9456
|
let res = [];
|
|
9508
9457
|
if (s) res = getStringComponents(s, "/", 2) ?? [];
|
|
9509
|
-
const v = theme
|
|
9458
|
+
const v = theme.textShadow?.[res[0]];
|
|
9510
9459
|
const c = s ? h.bracket.cssvar(s) : void 0;
|
|
9511
|
-
if ((v != null || c != null) && !hasParseableColor(c, theme
|
|
9460
|
+
if ((v != null || c != null) && !hasParseableColor(c, theme)) {
|
|
9512
9461
|
const alpha = res[1] ? h.bracket.percent.cssvar(res[1]) : void 0;
|
|
9513
9462
|
return {
|
|
9514
9463
|
"--un-text-shadow-opacity": alpha,
|
|
@@ -9535,7 +9484,7 @@ const textShadows = [
|
|
|
9535
9484
|
],
|
|
9536
9485
|
[
|
|
9537
9486
|
/^text-shadow(?:-color)?-op(?:acity)?-?(.+)$/,
|
|
9538
|
-
([, opacity
|
|
9487
|
+
([, opacity]) => ({ "--un-text-shadow-opacity": h.bracket.percent.cssvar(opacity) }),
|
|
9539
9488
|
{ autocomplete: "text-shadow(-color)?-(op|opacity)-<percent>" }
|
|
9540
9489
|
]
|
|
9541
9490
|
];
|
|
@@ -9582,16 +9531,16 @@ const fontVariantNumeric = [
|
|
|
9582
9531
|
}, ...fontVariantNumericProperties]],
|
|
9583
9532
|
["normal-nums", [{ "font-variant-numeric": "normal" }]]
|
|
9584
9533
|
];
|
|
9585
|
-
function handleText([, s = "base"], { theme
|
|
9534
|
+
function handleText([, s = "base"], { theme }) {
|
|
9586
9535
|
const split = splitShorthand(s, "length");
|
|
9587
9536
|
if (!split) return;
|
|
9588
|
-
const [size, leading
|
|
9589
|
-
const sizePairs = theme
|
|
9537
|
+
const [size, leading] = split;
|
|
9538
|
+
const sizePairs = theme.text?.[size];
|
|
9590
9539
|
let lineHeight;
|
|
9591
|
-
if (leading
|
|
9592
|
-
themeTracking(`leading`, leading
|
|
9593
|
-
lineHeight = generateThemeVariable("leading", leading
|
|
9594
|
-
} else lineHeight = h.bracket.cssvar.global.rem(leading
|
|
9540
|
+
if (leading) if (theme.leading?.[leading]) {
|
|
9541
|
+
themeTracking(`leading`, leading);
|
|
9542
|
+
lineHeight = generateThemeVariable("leading", leading);
|
|
9543
|
+
} else lineHeight = h.bracket.cssvar.global.rem(leading);
|
|
9595
9544
|
if (sizePairs) {
|
|
9596
9545
|
themeTracking(`text`, [size, "fontSize"]);
|
|
9597
9546
|
themeTracking(`text`, [size, "lineHeight"]);
|
|
@@ -9609,8 +9558,8 @@ function handleText([, s = "base"], { theme: theme$2 }) {
|
|
|
9609
9558
|
};
|
|
9610
9559
|
return { "font-size": h.bracketOfLength.rem(s) };
|
|
9611
9560
|
}
|
|
9612
|
-
function handleSize([, s], { theme
|
|
9613
|
-
if (theme
|
|
9561
|
+
function handleSize([, s], { theme }) {
|
|
9562
|
+
if (theme.text?.[s] != null) {
|
|
9614
9563
|
themeTracking(`text`, [s, "fontSize"]);
|
|
9615
9564
|
themeTracking(`text`, [s, "lineHeight"]);
|
|
9616
9565
|
return {
|
|
@@ -9664,12 +9613,12 @@ const cssVariables = [[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
|
9664
9613
|
const prop = variablesAbbrMap[name];
|
|
9665
9614
|
if (prop) return { [prop]: h.cssvar(varname) };
|
|
9666
9615
|
}]];
|
|
9667
|
-
const cssProperty = [[/^\[(.*)\]$/, ([_, body], { theme
|
|
9616
|
+
const cssProperty = [[/^\[(.*)\]$/, ([_, body], { theme }) => {
|
|
9668
9617
|
if (!body.includes(":")) return;
|
|
9669
9618
|
const [prop, ...rest] = body.split(":");
|
|
9670
9619
|
const value = rest.join(":");
|
|
9671
9620
|
if (!isURI(body) && /^[\w-]+$/.test(prop) && isValidCSSBody(value)) {
|
|
9672
|
-
const parsed = h.bracket(`[${value}]`, theme
|
|
9621
|
+
const parsed = h.bracket(`[${value}]`, theme);
|
|
9673
9622
|
if (parsed) return { [prop]: parsed };
|
|
9674
9623
|
}
|
|
9675
9624
|
}]];
|
|
@@ -9700,9 +9649,6 @@ function isURI(declaration) {
|
|
|
9700
9649
|
return false;
|
|
9701
9650
|
}
|
|
9702
9651
|
}
|
|
9703
|
-
const viewTransition = [[/^view-transition-([\w-]+)$/, ([, name]) => {
|
|
9704
|
-
return { "view-transition-name": name };
|
|
9705
|
-
}]];
|
|
9706
9652
|
const rules = [
|
|
9707
9653
|
fonts,
|
|
9708
9654
|
tabSizes,
|
|
@@ -9791,19 +9737,19 @@ const rules = [
|
|
|
9791
9737
|
tables,
|
|
9792
9738
|
touchActions,
|
|
9793
9739
|
fontVariantNumeric,
|
|
9794
|
-
|
|
9740
|
+
[[/^view-transition-([\w-]+)$/, ([, name]) => {
|
|
9741
|
+
return { "view-transition-name": name };
|
|
9742
|
+
}]],
|
|
9795
9743
|
spaces,
|
|
9796
9744
|
divides,
|
|
9797
9745
|
fieldSizing,
|
|
9798
9746
|
questionMark
|
|
9799
9747
|
].flat();
|
|
9800
|
-
|
|
9801
9748
|
//#endregion
|
|
9802
9749
|
//#region ../../packages-presets/preset-wind4/dist/shortcuts.mjs
|
|
9803
9750
|
const shortcuts = [...containerShortcuts];
|
|
9804
|
-
|
|
9805
9751
|
//#endregion
|
|
9806
|
-
//#region ../../packages-presets/preset-wind4/dist/colors-
|
|
9752
|
+
//#region ../../packages-presets/preset-wind4/dist/colors-DSN24uxs.mjs
|
|
9807
9753
|
const colors = {
|
|
9808
9754
|
black: "#000",
|
|
9809
9755
|
white: "#fff",
|
|
@@ -10175,7 +10121,6 @@ const colors = {
|
|
|
10175
10121
|
Object.values(colors).forEach((color) => {
|
|
10176
10122
|
if (typeof color !== "string" && color !== void 0) color.DEFAULT = color.DEFAULT || color[400];
|
|
10177
10123
|
});
|
|
10178
|
-
|
|
10179
10124
|
//#endregion
|
|
10180
10125
|
//#region ../../packages-presets/preset-wind4/dist/theme.mjs
|
|
10181
10126
|
const animation = {
|
|
@@ -10726,47 +10671,6 @@ const breakpoint = {
|
|
|
10726
10671
|
};
|
|
10727
10672
|
const verticalBreakpoint = { ...breakpoint };
|
|
10728
10673
|
const supports = { grid: "(display: grid)" };
|
|
10729
|
-
const ease = {
|
|
10730
|
-
"linear": "linear",
|
|
10731
|
-
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
10732
|
-
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
10733
|
-
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
10734
|
-
"DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
10735
|
-
};
|
|
10736
|
-
const property$1 = {
|
|
10737
|
-
none: "none",
|
|
10738
|
-
all: "all",
|
|
10739
|
-
colors: [
|
|
10740
|
-
"color",
|
|
10741
|
-
"background-color",
|
|
10742
|
-
"border-color",
|
|
10743
|
-
"text-decoration-color",
|
|
10744
|
-
"fill",
|
|
10745
|
-
"stroke",
|
|
10746
|
-
"--un-gradient-from",
|
|
10747
|
-
"--un-gradient-via",
|
|
10748
|
-
"--un-gradient-to"
|
|
10749
|
-
].join(","),
|
|
10750
|
-
opacity: "opacity",
|
|
10751
|
-
shadow: "box-shadow",
|
|
10752
|
-
transform: [
|
|
10753
|
-
"transform",
|
|
10754
|
-
"translate",
|
|
10755
|
-
"scale",
|
|
10756
|
-
"rotate"
|
|
10757
|
-
].join(","),
|
|
10758
|
-
get DEFAULT() {
|
|
10759
|
-
return [
|
|
10760
|
-
this.colors,
|
|
10761
|
-
this.opacity,
|
|
10762
|
-
this.shadow,
|
|
10763
|
-
this.transform,
|
|
10764
|
-
"filter",
|
|
10765
|
-
"-webkit-backdrop-filter",
|
|
10766
|
-
"backdrop-filter"
|
|
10767
|
-
].join(",");
|
|
10768
|
-
}
|
|
10769
|
-
};
|
|
10770
10674
|
const theme = {
|
|
10771
10675
|
font,
|
|
10772
10676
|
colors,
|
|
@@ -10783,30 +10687,68 @@ const theme = {
|
|
|
10783
10687
|
insetShadow,
|
|
10784
10688
|
dropShadow,
|
|
10785
10689
|
textShadow,
|
|
10786
|
-
ease
|
|
10690
|
+
ease: {
|
|
10691
|
+
"linear": "linear",
|
|
10692
|
+
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
10693
|
+
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
10694
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
10695
|
+
"DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
10696
|
+
},
|
|
10787
10697
|
animation,
|
|
10788
10698
|
blur,
|
|
10789
10699
|
perspective,
|
|
10790
|
-
property:
|
|
10700
|
+
property: {
|
|
10701
|
+
none: "none",
|
|
10702
|
+
all: "all",
|
|
10703
|
+
colors: [
|
|
10704
|
+
"color",
|
|
10705
|
+
"background-color",
|
|
10706
|
+
"border-color",
|
|
10707
|
+
"text-decoration-color",
|
|
10708
|
+
"fill",
|
|
10709
|
+
"stroke",
|
|
10710
|
+
"--un-gradient-from",
|
|
10711
|
+
"--un-gradient-via",
|
|
10712
|
+
"--un-gradient-to"
|
|
10713
|
+
].join(","),
|
|
10714
|
+
opacity: "opacity",
|
|
10715
|
+
shadow: "box-shadow",
|
|
10716
|
+
transform: [
|
|
10717
|
+
"transform",
|
|
10718
|
+
"translate",
|
|
10719
|
+
"scale",
|
|
10720
|
+
"rotate"
|
|
10721
|
+
].join(","),
|
|
10722
|
+
get DEFAULT() {
|
|
10723
|
+
return [
|
|
10724
|
+
this.colors,
|
|
10725
|
+
this.opacity,
|
|
10726
|
+
this.shadow,
|
|
10727
|
+
this.transform,
|
|
10728
|
+
"filter",
|
|
10729
|
+
"-webkit-backdrop-filter",
|
|
10730
|
+
"backdrop-filter"
|
|
10731
|
+
].join(",");
|
|
10732
|
+
}
|
|
10733
|
+
},
|
|
10791
10734
|
default: defaults,
|
|
10792
10735
|
container,
|
|
10793
10736
|
aria,
|
|
10794
10737
|
media,
|
|
10795
10738
|
supports
|
|
10796
10739
|
};
|
|
10797
|
-
|
|
10798
10740
|
//#endregion
|
|
10799
|
-
//#region ../../packages-presets/preset-wind4/dist/variants-
|
|
10741
|
+
//#region ../../packages-presets/preset-wind4/dist/variants-BQhcPCjX.mjs
|
|
10800
10742
|
const variantAria = {
|
|
10801
10743
|
name: "aria",
|
|
10802
10744
|
match(matcher, ctx) {
|
|
10803
10745
|
const variant = variantGetParameter("aria-", matcher, ctx.generator.config.separators);
|
|
10804
10746
|
if (variant) {
|
|
10805
10747
|
const [match, rest] = variant;
|
|
10806
|
-
const aria
|
|
10807
|
-
if (aria
|
|
10748
|
+
const aria = h.bracket(match) ?? ctx.theme.aria?.[match] ?? "";
|
|
10749
|
+
if (aria) return {
|
|
10808
10750
|
matcher: rest,
|
|
10809
|
-
selector: (s) => `${s}[aria-${aria
|
|
10751
|
+
selector: (s) => `${s}[aria-${aria}]`
|
|
10810
10752
|
};
|
|
10811
10753
|
}
|
|
10812
10754
|
},
|
|
@@ -10874,7 +10816,7 @@ function variantBreakpoints() {
|
|
|
10874
10816
|
idx
|
|
10875
10817
|
]);
|
|
10876
10818
|
for (const [point, size, idx] of variantEntries) {
|
|
10877
|
-
if (!regexCache[point]) regexCache[point] =
|
|
10819
|
+
if (!regexCache[point]) regexCache[point] = new RegExp(`^((?:([al]t-|[<~]|max-))?${point}(?:${context.generator.config.separators.join("|")}))`);
|
|
10878
10820
|
const match = matcher.match(regexCache[point]);
|
|
10879
10821
|
if (!match) continue;
|
|
10880
10822
|
const [, pre] = match;
|
|
@@ -10958,17 +10900,17 @@ const variantContainerQuery = {
|
|
|
10958
10900
|
if (variant) {
|
|
10959
10901
|
const [match, rest, label] = variant;
|
|
10960
10902
|
const unbracket = h.bracket(match);
|
|
10961
|
-
let container
|
|
10962
|
-
if (unbracket) container
|
|
10963
|
-
else container
|
|
10964
|
-
if (container
|
|
10903
|
+
let container;
|
|
10904
|
+
if (unbracket) container = h.numberWithUnit(unbracket);
|
|
10905
|
+
else container = ctx.theme.container?.[match] ?? "";
|
|
10906
|
+
if (container) {
|
|
10965
10907
|
let order = 1e3 + Object.keys(ctx.theme.container ?? {}).indexOf(match);
|
|
10966
10908
|
if (label) order += 1e3;
|
|
10967
10909
|
return {
|
|
10968
10910
|
matcher: rest,
|
|
10969
10911
|
handle: (input, next) => next({
|
|
10970
10912
|
...input,
|
|
10971
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@container${label ? ` ${label} ` : " "}(min-width: ${container
|
|
10913
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@container${label ? ` ${label} ` : " "}(min-width: ${container})`,
|
|
10972
10914
|
parentOrder: order
|
|
10973
10915
|
})
|
|
10974
10916
|
};
|
|
@@ -11051,7 +10993,7 @@ function variantImportant() {
|
|
|
11051
10993
|
return {
|
|
11052
10994
|
name: "important",
|
|
11053
10995
|
match(matcher, ctx) {
|
|
11054
|
-
if (!re) re =
|
|
10996
|
+
if (!re) re = new RegExp(`^(important(?:${ctx.generator.config.separators.join("|")})|!)`);
|
|
11055
10997
|
let base;
|
|
11056
10998
|
const match = matcher.match(re);
|
|
11057
10999
|
if (match) base = matcher.slice(match[0].length);
|
|
@@ -11102,13 +11044,13 @@ const variantCustomMedia = {
|
|
|
11102
11044
|
const variant = variantGetParameter("media-", matcher, ctx.generator.config.separators);
|
|
11103
11045
|
if (variant) {
|
|
11104
11046
|
const [match, rest] = variant;
|
|
11105
|
-
let media
|
|
11106
|
-
if (media
|
|
11107
|
-
if (media
|
|
11047
|
+
let media = h.bracket(match) ?? "";
|
|
11048
|
+
if (media === "") media = ctx.theme.media?.[match] ?? "";
|
|
11049
|
+
if (media) return {
|
|
11108
11050
|
matcher: rest,
|
|
11109
11051
|
handle: (input, next) => next({
|
|
11110
11052
|
...input,
|
|
11111
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media
|
|
11053
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
|
|
11112
11054
|
})
|
|
11113
11055
|
};
|
|
11114
11056
|
}
|
|
@@ -11284,12 +11226,12 @@ const variantNegative = {
|
|
|
11284
11226
|
return {
|
|
11285
11227
|
matcher: matcher.slice(1),
|
|
11286
11228
|
body: (body) => {
|
|
11287
|
-
if (body.find((v) => v[0] ===
|
|
11229
|
+
if (body.find((v) => v[0] === "$$mini-no-negative")) return;
|
|
11288
11230
|
let changed = false;
|
|
11289
11231
|
for (const v of body) {
|
|
11290
11232
|
const [prop, rawValue, meta] = v;
|
|
11291
11233
|
if (typeof rawValue === "object") continue;
|
|
11292
|
-
if (meta && toArray(meta).includes(
|
|
11234
|
+
if (meta && toArray(meta).includes("$$mini-no-negative")) continue;
|
|
11293
11235
|
const value = rawValue?.toString();
|
|
11294
11236
|
if (!value || value === "0" || ignoreProps.some((i) => i.test(prop))) continue;
|
|
11295
11237
|
const nextValue = negateMathFunction(value) ?? negateFunctionBody(value) ?? (anchoredNumberRE.test(value) ? value.replace(numberRE, (i) => i.startsWith("-") ? i.slice(1) : `-${i}`) : void 0);
|
|
@@ -11303,11 +11245,11 @@ const variantNegative = {
|
|
|
11303
11245
|
};
|
|
11304
11246
|
}
|
|
11305
11247
|
};
|
|
11306
|
-
const placeholderModifier = (input, { theme
|
|
11248
|
+
const placeholderModifier = (input, { theme }) => {
|
|
11307
11249
|
const m = input.match(/^(.*)\b(placeholder-)(.+)$/);
|
|
11308
11250
|
if (m) {
|
|
11309
11251
|
const [, pre = "", p, body] = m;
|
|
11310
|
-
if (hasParseableColor(body, theme
|
|
11252
|
+
if (hasParseableColor(body, theme) || hasOpacityValue(body)) return { matcher: `${pre}placeholder-$ ${p}${body}` };
|
|
11311
11253
|
}
|
|
11312
11254
|
};
|
|
11313
11255
|
function hasOpacityValue(body) {
|
|
@@ -11356,15 +11298,15 @@ const variantSupports = {
|
|
|
11356
11298
|
const variant = variantGetParameter("supports-", matcher, ctx.generator.config.separators);
|
|
11357
11299
|
if (variant) {
|
|
11358
11300
|
const [match, rest] = variant;
|
|
11359
|
-
let supports
|
|
11360
|
-
if (supports
|
|
11361
|
-
if (supports
|
|
11362
|
-
if (!(supports
|
|
11301
|
+
let supports = h.bracket(match) ?? "";
|
|
11302
|
+
if (supports === "") supports = ctx.theme.supports?.[match] ?? "";
|
|
11303
|
+
if (supports) {
|
|
11304
|
+
if (!(supports.startsWith("(") && supports.endsWith(")"))) supports = `(${supports})`;
|
|
11363
11305
|
return {
|
|
11364
11306
|
matcher: rest,
|
|
11365
11307
|
handle: (input, next) => next({
|
|
11366
11308
|
...input,
|
|
11367
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports
|
|
11309
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports}`
|
|
11368
11310
|
})
|
|
11369
11311
|
};
|
|
11370
11312
|
}
|
|
@@ -11414,7 +11356,6 @@ function variants(options) {
|
|
|
11414
11356
|
variantImplicitGroup
|
|
11415
11357
|
].flat();
|
|
11416
11358
|
}
|
|
11417
|
-
|
|
11418
11359
|
//#endregion
|
|
11419
11360
|
//#region ../../packages-presets/extractor-arbitrary-variants/dist/index.mjs
|
|
11420
11361
|
function hash(str) {
|
|
@@ -11474,7 +11415,6 @@ function extractorArbitraryVariants() {
|
|
|
11474
11415
|
}
|
|
11475
11416
|
};
|
|
11476
11417
|
}
|
|
11477
|
-
|
|
11478
11418
|
//#endregion
|
|
11479
11419
|
//#region ../../packages-presets/preset-wind4/dist/index.mjs
|
|
11480
11420
|
function property(options) {
|
|
@@ -11482,10 +11422,11 @@ function property(options) {
|
|
|
11482
11422
|
const propertyConfig = typeof options.preflights?.property === "object" ? options.preflights.property : void 0;
|
|
11483
11423
|
const parentSelector = propertyConfig?.parent !== void 0 ? propertyConfig.parent : "@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))";
|
|
11484
11424
|
const selector = propertyConfig?.selector ?? "*, ::before, ::after, ::backdrop";
|
|
11425
|
+
const prefix = options.variablePrefix ?? "un-";
|
|
11485
11426
|
return {
|
|
11486
11427
|
getCSS: () => {
|
|
11487
11428
|
if (trackedProperties.size === 0) return;
|
|
11488
|
-
const css = Array.from(trackedProperties.entries()).map(([property
|
|
11429
|
+
const css = Array.from(trackedProperties.entries()).map(([property, value]) => `${property.replace(/^--un-/, `--${prefix}`)}:${value};`).join("");
|
|
11489
11430
|
return parentSelector === false ? `${selector}{${css}}` : `${parentSelector}{${selector}{${css}}}`;
|
|
11490
11431
|
},
|
|
11491
11432
|
layer: "properties"
|
|
@@ -11915,17 +11856,17 @@ const ExcludeCssVarKeys = [
|
|
|
11915
11856
|
"supports",
|
|
11916
11857
|
"containers"
|
|
11917
11858
|
];
|
|
11918
|
-
function getThemeVarsMap(theme
|
|
11919
|
-
const themeMap = new Map([["--spacing", theme
|
|
11859
|
+
function getThemeVarsMap(theme, keys) {
|
|
11860
|
+
const themeMap = new Map([["--spacing", theme.spacing.DEFAULT]]);
|
|
11920
11861
|
const normalizeValue = (value) => value.replace(alphaPlaceholdersRE, "1");
|
|
11921
|
-
function process
|
|
11862
|
+
function process(obj, prefix) {
|
|
11922
11863
|
for (const key in obj) if (Array.isArray(obj[key])) themeMap.set(`--${prefix}-${key}`, normalizeValue(obj[key].join(",")));
|
|
11923
|
-
else if (typeof obj[key] === "object") process
|
|
11864
|
+
else if (typeof obj[key] === "object") process(obj[key], `${prefix}-${key}`);
|
|
11924
11865
|
else themeMap.set(`--${prefix}-${key}`, normalizeValue(obj[key]));
|
|
11925
11866
|
}
|
|
11926
|
-
for (const key in theme
|
|
11867
|
+
for (const key in theme) {
|
|
11927
11868
|
if (!keys.includes(key)) continue;
|
|
11928
|
-
process
|
|
11869
|
+
process(theme[key], key);
|
|
11929
11870
|
}
|
|
11930
11871
|
return themeMap;
|
|
11931
11872
|
}
|
|
@@ -11937,25 +11878,25 @@ function theme$1(options) {
|
|
|
11937
11878
|
return {
|
|
11938
11879
|
layer: "theme",
|
|
11939
11880
|
getCSS(ctx) {
|
|
11940
|
-
const { theme
|
|
11881
|
+
const { theme, generator } = ctx;
|
|
11941
11882
|
const safelist = uniq(generator.config.safelist.flatMap((s) => typeof s === "function" ? s(ctx) : s));
|
|
11942
|
-
const { mode, process
|
|
11883
|
+
const { mode, process } = preflightsTheme;
|
|
11943
11884
|
if (mode === false) return;
|
|
11944
11885
|
if (safelist.length > 0) for (const s of safelist) {
|
|
11945
11886
|
const [key, ...prop] = s.trim().split(":");
|
|
11946
|
-
if (key in theme
|
|
11887
|
+
if (key in theme && prop.length <= 1) {
|
|
11947
11888
|
const props = prop.length === 0 ? ["DEFAULT"] : prop[0].split("-");
|
|
11948
|
-
const v = getThemeByKey(theme
|
|
11889
|
+
const v = getThemeByKey(theme, key, props);
|
|
11949
11890
|
if (typeof v === "string") {
|
|
11950
11891
|
themeTracking(key, props);
|
|
11951
|
-
detectThemeValue(v, theme
|
|
11892
|
+
detectThemeValue(v, theme);
|
|
11952
11893
|
}
|
|
11953
11894
|
}
|
|
11954
11895
|
}
|
|
11955
11896
|
let deps;
|
|
11956
|
-
const generateCSS = (deps
|
|
11957
|
-
if (process
|
|
11958
|
-
const resolvedDeps = deps
|
|
11897
|
+
const generateCSS = (deps) => {
|
|
11898
|
+
if (process) for (const utility of deps) for (const p of toArray(process)) p(utility, ctx);
|
|
11899
|
+
const resolvedDeps = deps.map(([key, value]) => key && value ? `${escapeSelector(key)}: ${value};` : void 0).filter(Boolean);
|
|
11959
11900
|
if (resolvedDeps.length === 0) return;
|
|
11960
11901
|
return compressCSS(`
|
|
11961
11902
|
:root, :host {
|
|
@@ -11966,12 +11907,12 @@ ${resolvedDeps.join("\n")}
|
|
|
11966
11907
|
if (trackedTheme.size === 0) return void 0;
|
|
11967
11908
|
deps = Array.from(trackedTheme).map((k) => {
|
|
11968
11909
|
const [key, prop] = k.split(":");
|
|
11969
|
-
const v = getThemeByKey(theme
|
|
11910
|
+
const v = getThemeByKey(theme, key, prop.split("-"));
|
|
11970
11911
|
if (typeof v === "string") return [`--${key}${`${key === "spacing" && prop === "DEFAULT" ? "" : `-${prop}`}`}`, v];
|
|
11971
11912
|
}).filter(Boolean);
|
|
11972
11913
|
} else {
|
|
11973
|
-
const keys = Object.keys(theme
|
|
11974
|
-
deps = Array.from(getThemeVarsMap(theme
|
|
11914
|
+
const keys = Object.keys(theme).filter((k) => !ExcludeCssVarKeys.includes(k));
|
|
11915
|
+
deps = Array.from(getThemeVarsMap(theme, keys));
|
|
11975
11916
|
}
|
|
11976
11917
|
return generateCSS(deps);
|
|
11977
11918
|
}
|
|
@@ -12026,8 +11967,6 @@ const presetWind4 = definePreset((options = {}) => {
|
|
|
12026
11967
|
}
|
|
12027
11968
|
};
|
|
12028
11969
|
});
|
|
12029
|
-
var src_default = presetWind4;
|
|
12030
|
-
|
|
12031
11970
|
//#endregion
|
|
12032
11971
|
//#region ../nuxt/src/options.ts
|
|
12033
11972
|
function resolveOptions(options) {
|
|
@@ -12039,12 +11978,12 @@ function resolveOptions(options) {
|
|
|
12039
11978
|
options.presets = [];
|
|
12040
11979
|
const presetMap = {
|
|
12041
11980
|
wind3: presetWind3,
|
|
12042
|
-
wind4:
|
|
12043
|
-
attributify:
|
|
12044
|
-
icons:
|
|
12045
|
-
webFonts:
|
|
12046
|
-
typography:
|
|
12047
|
-
tagify:
|
|
11981
|
+
wind4: presetWind4,
|
|
11982
|
+
attributify: presetAttributify,
|
|
11983
|
+
icons: presetIcons,
|
|
11984
|
+
webFonts: presetWebFonts,
|
|
11985
|
+
typography: presetTypography,
|
|
11986
|
+
tagify: presetTagify
|
|
12048
11987
|
};
|
|
12049
11988
|
for (const [key, preset] of Object.entries(presetMap)) {
|
|
12050
11989
|
const option = options[key];
|
|
@@ -12058,7 +11997,6 @@ function resolveOptions(options) {
|
|
|
12058
11997
|
if (Array.isArray(options.content.pipeline.exclude)) options.content.pipeline.exclude.push(/\?macro=true/);
|
|
12059
11998
|
}
|
|
12060
11999
|
}
|
|
12061
|
-
|
|
12062
12000
|
//#endregion
|
|
12063
12001
|
//#region src/utils/position.ts
|
|
12064
12002
|
const styleTagsRe = /<style[^>]*>[\s\S]*?(?:<\/style>|<\/>)/g;
|
|
@@ -12080,7 +12018,6 @@ function isSubdir(parent, child) {
|
|
|
12080
12018
|
const relative = path.relative(parent, child);
|
|
12081
12019
|
return relative && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
12082
12020
|
}
|
|
12083
|
-
|
|
12084
12021
|
//#endregion
|
|
12085
12022
|
//#region src/core/context.ts
|
|
12086
12023
|
const frameworkConfigRE = /^(?:vite|svelte|astro|iles|nuxt|unocss|uno)\.config/;
|
|
@@ -12095,10 +12032,12 @@ var ContextManager = class {
|
|
|
12095
12032
|
loadingContexts = /* @__PURE__ */ new Map();
|
|
12096
12033
|
discoveredConfigs = /* @__PURE__ */ new Set();
|
|
12097
12034
|
defaultUnocssConfig = { presets: [presetWind3()] };
|
|
12035
|
+
workspaceRoots;
|
|
12098
12036
|
events = createNanoEvents();
|
|
12099
|
-
constructor(cwd
|
|
12100
|
-
this.cwd = cwd
|
|
12037
|
+
constructor(cwd, connection, workspaceRoots = [cwd]) {
|
|
12038
|
+
this.cwd = cwd;
|
|
12101
12039
|
this.connection = connection;
|
|
12040
|
+
this.workspaceRoots = Array.from(new Set(workspaceRoots.length ? workspaceRoots : [cwd]));
|
|
12102
12041
|
this.ready = this.reload();
|
|
12103
12042
|
}
|
|
12104
12043
|
log(message) {
|
|
@@ -12108,28 +12047,26 @@ var ContextManager = class {
|
|
|
12108
12047
|
this.connection.console.warn(message);
|
|
12109
12048
|
}
|
|
12110
12049
|
isTarget(id) {
|
|
12111
|
-
return Array.from(this.contextsMap.keys()).some((cwd
|
|
12050
|
+
return Array.from(this.contextsMap.keys()).some((cwd) => isSubdir(cwd, id));
|
|
12112
12051
|
}
|
|
12113
12052
|
get contexts() {
|
|
12114
12053
|
return Array.from(new Set(this.contextsMap.values())).filter(notNull);
|
|
12115
12054
|
}
|
|
12055
|
+
async setRoots(roots) {
|
|
12056
|
+
const nextRoots = Array.from(new Set(roots.length ? roots : this.workspaceRoots));
|
|
12057
|
+
const currentRoots = Array.from(this.contextsMap.keys());
|
|
12058
|
+
if (currentRoots.length === nextRoots.length && nextRoots.every((root) => currentRoots.includes(root))) return;
|
|
12059
|
+
await Promise.all(currentRoots.filter((root) => !nextRoots.includes(root)).map((root) => this.unloadContext(root)));
|
|
12060
|
+
this.resetCaches();
|
|
12061
|
+
await this.loadRoots(nextRoots.filter((root) => !currentRoots.includes(root)));
|
|
12062
|
+
this.events.emit("reload");
|
|
12063
|
+
}
|
|
12116
12064
|
async reload() {
|
|
12117
12065
|
const dirs = Array.from(this.contextsMap.keys());
|
|
12066
|
+
const rootsToLoad = dirs.length ? dirs : this.workspaceRoots;
|
|
12118
12067
|
await Promise.all(dirs.map((dir) => this.unloadContext(dir)));
|
|
12119
|
-
this.
|
|
12120
|
-
this.
|
|
12121
|
-
if (dirs.length) await Promise.all(dirs.map(async (dir) => {
|
|
12122
|
-
try {
|
|
12123
|
-
await this.loadContextInDirectory(dir);
|
|
12124
|
-
} catch (e) {
|
|
12125
|
-
this.warn(`⚠️ Failed to reload context for ${dir}: ${String(e.stack ?? e)}`);
|
|
12126
|
-
}
|
|
12127
|
-
}));
|
|
12128
|
-
else try {
|
|
12129
|
-
await this.loadContextInDirectory(this.cwd);
|
|
12130
|
-
} catch (e) {
|
|
12131
|
-
this.warn(`⚠️ Failed to reload context for ${this.cwd}: ${String(e.stack ?? e)}`);
|
|
12132
|
-
}
|
|
12068
|
+
this.resetCaches();
|
|
12069
|
+
await this.loadRoots(rootsToLoad);
|
|
12133
12070
|
this.events.emit("reload");
|
|
12134
12071
|
}
|
|
12135
12072
|
async unloadContext(configDir) {
|
|
@@ -12149,7 +12086,20 @@ var ContextManager = class {
|
|
|
12149
12086
|
this.events.emit("unload", context);
|
|
12150
12087
|
}
|
|
12151
12088
|
clearFileContextCache(context) {
|
|
12152
|
-
for (const [path
|
|
12089
|
+
for (const [path, ctx] of this.fileContextCache) if (ctx === context) this.fileContextCache.delete(path);
|
|
12090
|
+
}
|
|
12091
|
+
resetCaches() {
|
|
12092
|
+
this.fileContextCache.clear();
|
|
12093
|
+
this.configExistsCache.clear();
|
|
12094
|
+
}
|
|
12095
|
+
async loadRoots(roots) {
|
|
12096
|
+
await Promise.all(roots.map(async (dir) => {
|
|
12097
|
+
try {
|
|
12098
|
+
await this.loadContextInDirectory(dir);
|
|
12099
|
+
} catch (e) {
|
|
12100
|
+
this.warn(`⚠️ Failed to reload context for ${dir}: ${String(e.stack ?? e)}`);
|
|
12101
|
+
}
|
|
12102
|
+
}));
|
|
12153
12103
|
}
|
|
12154
12104
|
async loadContextInDirectory(dir) {
|
|
12155
12105
|
const cached = this.contextsMap.get(dir);
|
|
@@ -12189,9 +12139,9 @@ var ContextManager = class {
|
|
|
12189
12139
|
files: "nuxt.config",
|
|
12190
12140
|
fields: "unocss"
|
|
12191
12141
|
})
|
|
12192
|
-
], (result
|
|
12193
|
-
if (result
|
|
12194
|
-
result
|
|
12142
|
+
], (result) => {
|
|
12143
|
+
if (result.sources.some((s) => s.includes("nuxt.config"))) resolveOptions(result.config);
|
|
12144
|
+
result.config.details = true;
|
|
12195
12145
|
});
|
|
12196
12146
|
let sources = [];
|
|
12197
12147
|
try {
|
|
@@ -12224,11 +12174,11 @@ var ContextManager = class {
|
|
|
12224
12174
|
}
|
|
12225
12175
|
setupContextReload(context) {
|
|
12226
12176
|
context.onReload(() => {
|
|
12227
|
-
for (const [path
|
|
12177
|
+
for (const [path, ctx] of this.fileContextCache) if (ctx === context || !ctx) this.fileContextCache.delete(path);
|
|
12228
12178
|
this.configExistsCache.clear();
|
|
12229
12179
|
this.events.emit("contextReload", context);
|
|
12230
12180
|
});
|
|
12231
|
-
for (const [path
|
|
12181
|
+
for (const [path, ctx] of this.fileContextCache) if (!ctx) this.fileContextCache.delete(path);
|
|
12232
12182
|
}
|
|
12233
12183
|
logConfigInfo(sources, uno) {
|
|
12234
12184
|
const sourcesStr = sources.length === 1 ? sources[0] : `\n${sources.map((s) => ` - ${s}`).join("\n")}`;
|
|
@@ -12243,7 +12193,7 @@ var ContextManager = class {
|
|
|
12243
12193
|
if (!this.contextsMap.has(dir)) this.contextsMap.set(dir, context);
|
|
12244
12194
|
this.fileContextCache.clear();
|
|
12245
12195
|
this.events.emit("reload");
|
|
12246
|
-
const enabledContexts = Array.from(this.contextsMap.entries()).filter(([, ctx]) => ctx).map(([dir
|
|
12196
|
+
const enabledContexts = Array.from(this.contextsMap.entries()).filter(([, ctx]) => ctx).map(([dir]) => dir).join(", ") || "[none]";
|
|
12247
12197
|
this.log(`🗂️ Enabled context: ${enabledContexts}`);
|
|
12248
12198
|
return context;
|
|
12249
12199
|
}
|
|
@@ -12279,15 +12229,17 @@ var ContextManager = class {
|
|
|
12279
12229
|
async findConfigDirectory(startDir) {
|
|
12280
12230
|
const cached = this.configExistsCache.get(startDir);
|
|
12281
12231
|
if (cached !== void 0) return cached || void 0;
|
|
12232
|
+
const searchBoundary = this.getWorkspaceBoundary(startDir);
|
|
12233
|
+
if (!searchBoundary) return void 0;
|
|
12282
12234
|
const root = path.parse(startDir).root;
|
|
12283
12235
|
const searchedDirs = [];
|
|
12284
12236
|
let dir = startDir;
|
|
12285
|
-
while (dir !== root && (isSubdir(
|
|
12237
|
+
while (dir !== root && (isSubdir(searchBoundary, dir) || dir === searchBoundary)) {
|
|
12286
12238
|
searchedDirs.push(dir);
|
|
12287
|
-
const cached
|
|
12288
|
-
if (cached
|
|
12289
|
-
this.cacheSearchPath(searchedDirs, cached
|
|
12290
|
-
return cached
|
|
12239
|
+
const cached = this.configExistsCache.get(dir);
|
|
12240
|
+
if (cached !== void 0) {
|
|
12241
|
+
this.cacheSearchPath(searchedDirs, cached || false);
|
|
12242
|
+
return cached || void 0;
|
|
12291
12243
|
}
|
|
12292
12244
|
if (await this.hasConfigFiles(dir)) {
|
|
12293
12245
|
this.cacheSearchPath(searchedDirs, dir);
|
|
@@ -12297,6 +12249,9 @@ var ContextManager = class {
|
|
|
12297
12249
|
}
|
|
12298
12250
|
this.cacheSearchPath(searchedDirs, false);
|
|
12299
12251
|
}
|
|
12252
|
+
getWorkspaceBoundary(dir) {
|
|
12253
|
+
return [...this.workspaceRoots, ...this.contextsMap.keys()].filter((root) => root === dir || isSubdir(root, dir)).sort((a, b) => b.length - a.length)[0];
|
|
12254
|
+
}
|
|
12300
12255
|
async hasConfigFiles(dir) {
|
|
12301
12256
|
try {
|
|
12302
12257
|
return (await readdir(dir)).some((file) => unoConfigRE.test(file) || frameworkConfigRE.test(file));
|
|
@@ -12308,7 +12263,6 @@ var ContextManager = class {
|
|
|
12308
12263
|
for (const dir of dirs) this.configExistsCache.set(dir, result);
|
|
12309
12264
|
}
|
|
12310
12265
|
};
|
|
12311
|
-
|
|
12312
12266
|
//#endregion
|
|
12313
12267
|
//#region src/types.ts
|
|
12314
12268
|
const defaultSettings = {
|
|
@@ -12327,7 +12281,6 @@ const defaultSettings = {
|
|
|
12327
12281
|
autocompleteStrict: false,
|
|
12328
12282
|
autocompleteMaxItems: 1e3
|
|
12329
12283
|
};
|
|
12330
|
-
|
|
12331
12284
|
//#endregion
|
|
12332
12285
|
//#region src/utils/color.ts
|
|
12333
12286
|
const matchCssVarNameRE = /var\((?<cssVarName>--[^,|)]+)(?:,(?<fallback>[^)]+))?\)/g;
|
|
@@ -12335,12 +12288,12 @@ const cssColorRE = /(?:#|0x)(?:[a-f0-9]{3}|[a-f0-9]{6})\b|(?:rgb|rgba|hsl|hsla|o
|
|
|
12335
12288
|
const varFnRE = /var\((--[^,|)]+)(?:,([^)]+))?\)/;
|
|
12336
12289
|
function getCssVariables(code) {
|
|
12337
12290
|
const regex = /(?<key>--[^\s:]+):(?<value>.+?)[!;]/g;
|
|
12338
|
-
const cssVariables
|
|
12291
|
+
const cssVariables = /* @__PURE__ */ new Map();
|
|
12339
12292
|
for (const match of code.matchAll(regex)) {
|
|
12340
12293
|
const key = match.groups?.key;
|
|
12341
|
-
if (key) cssVariables
|
|
12294
|
+
if (key) cssVariables.set(key, match.groups?.value ?? "");
|
|
12342
12295
|
}
|
|
12343
|
-
return cssVariables
|
|
12296
|
+
return cssVariables;
|
|
12344
12297
|
}
|
|
12345
12298
|
/**
|
|
12346
12299
|
* Get CSS color string from CSS string
|
|
@@ -12425,7 +12378,6 @@ function parseColorToRGBA(colorString) {
|
|
|
12425
12378
|
};
|
|
12426
12379
|
}
|
|
12427
12380
|
}
|
|
12428
|
-
|
|
12429
12381
|
//#endregion
|
|
12430
12382
|
//#region src/utils/css.ts
|
|
12431
12383
|
const remUnitRE = /(-?[\d.]+)rem(\s+!important)?;/;
|
|
@@ -12441,12 +12393,12 @@ function addRemToPxComment(str, remToPixel = 16) {
|
|
|
12441
12393
|
let index = 0;
|
|
12442
12394
|
const output = [];
|
|
12443
12395
|
while (index < str.length) {
|
|
12444
|
-
const rem
|
|
12445
|
-
if (!rem
|
|
12446
|
-
const px
|
|
12447
|
-
const end = index + rem
|
|
12396
|
+
const rem = str.slice(index).match(remUnitRE);
|
|
12397
|
+
if (!rem || !rem.index) break;
|
|
12398
|
+
const px = ` /* ${Number.parseFloat(rem[1]) * remToPixel}px */`;
|
|
12399
|
+
const end = index + rem.index + rem[0].length;
|
|
12448
12400
|
output.push(str.slice(index, end));
|
|
12449
|
-
output.push(px
|
|
12401
|
+
output.push(px);
|
|
12450
12402
|
index = end;
|
|
12451
12403
|
}
|
|
12452
12404
|
output.push(str.slice(index));
|
|
@@ -12477,6 +12429,5 @@ async function getPrettiedCSS(uno, util, remToPxRatio) {
|
|
|
12477
12429
|
async function getPrettiedMarkdown(uno, util, remToPxRatio) {
|
|
12478
12430
|
return `\`\`\`css\n${(await getPrettiedCSS(uno, util, remToPxRatio)).prettified.trimEnd()}\n\`\`\``;
|
|
12479
12431
|
}
|
|
12480
|
-
|
|
12481
12432
|
//#endregion
|
|
12482
|
-
export { ContextManager, addRemToPxComment, clearDocumentCache, convertToRGBA, defaultSettings, getCSS, getColorString, getMatchedPositionsFromCode, getMatchedPositionsFromDoc, getPrettiedCSS, getPrettiedMarkdown, isSubdir, isVueWithPug, parseColorToRGBA, shouldProvideAutocomplete };
|
|
12433
|
+
export { ContextManager, addRemToPxComment, clearDocumentCache, convertToRGBA, defaultSettings, getCSS, getColorString, getMatchedPositionsFromCode, getMatchedPositionsFromDoc, getPrettiedCSS, getPrettiedMarkdown, isSubdir, isVueWithPug, parseColorToRGBA, shouldProvideAutocomplete };
|