@unocss/core 65.4.3 → 66.0.0
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/index.mjs +19 -19
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -208,7 +208,7 @@ class TwoKeyMap {
|
|
|
208
208
|
class BetterMap extends Map {
|
|
209
209
|
getFallback(key, fallback) {
|
|
210
210
|
const v = this.get(key);
|
|
211
|
-
if (v ===
|
|
211
|
+
if (v === void 0) {
|
|
212
212
|
this.set(key, fallback);
|
|
213
213
|
return fallback;
|
|
214
214
|
}
|
|
@@ -259,7 +259,7 @@ function clearIdenticalEntries(entry) {
|
|
|
259
259
|
function entriesToCss(arr) {
|
|
260
260
|
if (arr == null)
|
|
261
261
|
return "";
|
|
262
|
-
return clearIdenticalEntries(arr).map(([key, value]) => value != null && typeof value !== "function" ? `${key}:${value};` :
|
|
262
|
+
return clearIdenticalEntries(arr).map(([key, value]) => value != null && typeof value !== "function" ? `${key}:${value};` : void 0).filter(Boolean).join("");
|
|
263
263
|
}
|
|
264
264
|
function isObject(item) {
|
|
265
265
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
@@ -449,7 +449,7 @@ async function resolvePreset(presetInput) {
|
|
|
449
449
|
value: true,
|
|
450
450
|
enumerable: false
|
|
451
451
|
});
|
|
452
|
-
const shortcuts = preset.shortcuts ? resolveShortcuts(preset.shortcuts) :
|
|
452
|
+
const shortcuts = preset.shortcuts ? resolveShortcuts(preset.shortcuts) : void 0;
|
|
453
453
|
preset.shortcuts = shortcuts;
|
|
454
454
|
if (preset.prefix || preset.layer) {
|
|
455
455
|
const apply = (i) => {
|
|
@@ -543,8 +543,8 @@ async function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
543
543
|
return uniq(sources.flatMap((p) => toArray(p[key] || [])));
|
|
544
544
|
}
|
|
545
545
|
const extractors = getMerged("extractors");
|
|
546
|
-
let extractorDefault = sourcesReversed.find((i) => i.extractorDefault !==
|
|
547
|
-
if (extractorDefault ===
|
|
546
|
+
let extractorDefault = sourcesReversed.find((i) => i.extractorDefault !== void 0)?.extractorDefault;
|
|
547
|
+
if (extractorDefault === void 0)
|
|
548
548
|
extractorDefault = extractorSplit;
|
|
549
549
|
if (extractorDefault && !extractors.includes(extractorDefault))
|
|
550
550
|
extractors.unshift(extractorDefault);
|
|
@@ -651,7 +651,7 @@ function definePreset(preset) {
|
|
|
651
651
|
return preset;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
const version = "
|
|
654
|
+
const version = "66.0.0";
|
|
655
655
|
|
|
656
656
|
const symbols = {
|
|
657
657
|
shortcutsNoMerge: "$$symbol-shortcut-no-merge",
|
|
@@ -668,7 +668,7 @@ class UnoGeneratorInternal {
|
|
|
668
668
|
}
|
|
669
669
|
version = version;
|
|
670
670
|
events = createNanoEvents();
|
|
671
|
-
config =
|
|
671
|
+
config = void 0;
|
|
672
672
|
cache = /* @__PURE__ */ new Map();
|
|
673
673
|
blocked = /* @__PURE__ */ new Set();
|
|
674
674
|
parentOrders = /* @__PURE__ */ new Map();
|
|
@@ -866,7 +866,7 @@ class UnoGeneratorInternal {
|
|
|
866
866
|
];
|
|
867
867
|
});
|
|
868
868
|
if (!sorted.length)
|
|
869
|
-
return
|
|
869
|
+
return void 0;
|
|
870
870
|
const rules = sorted.reverse().map(([selectorSortPair, body, noMerge], idx) => {
|
|
871
871
|
if (!noMerge && this.config.mergeSelectors) {
|
|
872
872
|
for (let i = idx + 1; i < size; i++) {
|
|
@@ -902,7 +902,7 @@ class UnoGeneratorInternal {
|
|
|
902
902
|
const getLayers = (includes = layers, excludes) => {
|
|
903
903
|
const layers2 = includes.filter((i) => !excludes?.includes(i));
|
|
904
904
|
return [
|
|
905
|
-
outputCssLayers && layers2.length > 0 ? `@layer ${layers2.map(getLayerAlias).filter(notNull).join(", ")};` :
|
|
905
|
+
outputCssLayers && layers2.length > 0 ? `@layer ${layers2.map(getLayerAlias).filter(notNull).join(", ")};` : void 0,
|
|
906
906
|
...layers2.map((i) => getLayer(i) || "")
|
|
907
907
|
].filter(Boolean).join(nl);
|
|
908
908
|
};
|
|
@@ -987,7 +987,7 @@ class UnoGeneratorInternal {
|
|
|
987
987
|
const handler = variantHandlers.slice().sort((a, b) => (a.order || 0) - (b.order || 0)).reduceRight(
|
|
988
988
|
(previous, v) => (input) => {
|
|
989
989
|
const entries = v.body?.(input.entries) || input.entries;
|
|
990
|
-
const parents = Array.isArray(v.parent) ? v.parent : [v.parent,
|
|
990
|
+
const parents = Array.isArray(v.parent) ? v.parent : [v.parent, void 0];
|
|
991
991
|
return (v.handle ?? defaultVariantHandler)({
|
|
992
992
|
...input,
|
|
993
993
|
entries,
|
|
@@ -1029,7 +1029,7 @@ class UnoGeneratorInternal {
|
|
|
1029
1029
|
const normalizedBody = normalizeCSSEntries(body);
|
|
1030
1030
|
if (isString(normalizedBody))
|
|
1031
1031
|
return normalizedBody;
|
|
1032
|
-
const { selector, entries, parent } = this.applyVariants([0, overrideSelector || context.rawSelector, normalizedBody,
|
|
1032
|
+
const { selector, entries, parent } = this.applyVariants([0, overrideSelector || context.rawSelector, normalizedBody, void 0, context.variantHandlers]);
|
|
1033
1033
|
const cssBody = `${selector}{${entriesToCss(entries)}}`;
|
|
1034
1034
|
if (parent)
|
|
1035
1035
|
return `${parent}{${cssBody}}`;
|
|
@@ -1139,14 +1139,14 @@ class UnoGeneratorInternal {
|
|
|
1139
1139
|
};
|
|
1140
1140
|
const parsed = (await Promise.all(variantResults.map((i) => parse(i)))).flat().filter((x) => !!x);
|
|
1141
1141
|
if (!parsed.length)
|
|
1142
|
-
return
|
|
1142
|
+
return void 0;
|
|
1143
1143
|
return parsed;
|
|
1144
1144
|
}
|
|
1145
1145
|
stringifyUtil(parsed, context) {
|
|
1146
1146
|
if (!parsed)
|
|
1147
1147
|
return;
|
|
1148
1148
|
if (isRawUtil(parsed))
|
|
1149
|
-
return [parsed[0],
|
|
1149
|
+
return [parsed[0], void 0, parsed[1], void 0, parsed[2], this.config.details ? context : void 0, void 0];
|
|
1150
1150
|
const {
|
|
1151
1151
|
selector,
|
|
1152
1152
|
entries,
|
|
@@ -1164,7 +1164,7 @@ class UnoGeneratorInternal {
|
|
|
1164
1164
|
layer: variantLayer ?? metaLayer,
|
|
1165
1165
|
sort: variantSort ?? metaSort
|
|
1166
1166
|
};
|
|
1167
|
-
return [parsed[0], selector, body, parent, ruleMeta, this.config.details ? context :
|
|
1167
|
+
return [parsed[0], selector, body, parent, ruleMeta, this.config.details ? context : void 0, noMerge];
|
|
1168
1168
|
}
|
|
1169
1169
|
async expandShortcut(input, context, depth = 5) {
|
|
1170
1170
|
if (depth === 0)
|
|
@@ -1236,7 +1236,7 @@ class UnoGeneratorInternal {
|
|
|
1236
1236
|
async stringifyShortcuts(parent, context, expanded, meta = { layer: this.config.shortcutsLayer }) {
|
|
1237
1237
|
const layerMap = new BetterMap();
|
|
1238
1238
|
const parsed = (await Promise.all(uniq(expanded).map(async (i) => {
|
|
1239
|
-
const result = isString(i) ? await this.parseUtil(i, context, true, meta.prefix) : [[Number.POSITIVE_INFINITY, "{inline}", normalizeCSSEntries(i.value),
|
|
1239
|
+
const result = isString(i) ? await this.parseUtil(i, context, true, meta.prefix) : [[Number.POSITIVE_INFINITY, "{inline}", normalizeCSSEntries(i.value), void 0, i.handles]];
|
|
1240
1240
|
if (!result && this.config.warn)
|
|
1241
1241
|
warnOnce(`unmatched utility "${i}" in shortcut "${parent[1]}"`);
|
|
1242
1242
|
return result || [];
|
|
@@ -1245,7 +1245,7 @@ class UnoGeneratorInternal {
|
|
|
1245
1245
|
const rawStringifiedUtil = [];
|
|
1246
1246
|
for (const item of parsed) {
|
|
1247
1247
|
if (isRawUtil(item)) {
|
|
1248
|
-
rawStringifiedUtil.push([item[0],
|
|
1248
|
+
rawStringifiedUtil.push([item[0], void 0, item[1], void 0, item[2], context, void 0]);
|
|
1249
1249
|
continue;
|
|
1250
1250
|
}
|
|
1251
1251
|
const { selector, entries, parent: parent2, sort, noMerge, layer } = this.applyVariants(item, [...item[4], ...parentVariants], raw);
|
|
@@ -1261,8 +1261,8 @@ class UnoGeneratorInternal {
|
|
|
1261
1261
|
return (flatten ? [entriesList.flat(1)] : entriesList).map((entries) => {
|
|
1262
1262
|
const body = entriesToCss(entries);
|
|
1263
1263
|
if (body)
|
|
1264
|
-
return [index, selector, body, joinedParents, { ...meta, noMerge, sort: maxSort, layer }, context,
|
|
1265
|
-
return
|
|
1264
|
+
return [index, selector, body, joinedParents, { ...meta, noMerge, sort: maxSort, layer }, context, void 0];
|
|
1265
|
+
return void 0;
|
|
1266
1266
|
});
|
|
1267
1267
|
};
|
|
1268
1268
|
const merges = [
|
|
@@ -1284,7 +1284,7 @@ class UnoGeneratorInternal {
|
|
|
1284
1284
|
const v = Array.isArray(e2) ? e2[0] : e2;
|
|
1285
1285
|
return typeof v === "function" ? v(raw) : isString(v) ? v === raw : v.test(raw);
|
|
1286
1286
|
});
|
|
1287
|
-
return rule ? Array.isArray(rule) ? rule : [rule,
|
|
1287
|
+
return rule ? Array.isArray(rule) ? rule : [rule, void 0] : void 0;
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
class UnoGenerator extends UnoGeneratorInternal {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "66.0.0",
|
|
5
5
|
"description": "The instant on-demand Atomic CSS engine.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"homepage": "https://unocss.dev",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/unocss/unocss",
|
|
12
|
+
"url": "git+https://github.com/unocss/unocss",
|
|
13
13
|
"directory": "packages-engine/core"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"magic-string": "^0.30.17",
|
|
41
|
-
"unconfig": "~0.
|
|
41
|
+
"unconfig": "~7.0.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|