@unocss/core 0.45.9 → 0.45.14
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.cjs +22 -24
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +23 -24
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -45,10 +45,6 @@ function toArray(value = []) {
|
|
|
45
45
|
function uniq(value) {
|
|
46
46
|
return Array.from(new Set(value));
|
|
47
47
|
}
|
|
48
|
-
function mergeSet(target, append) {
|
|
49
|
-
append.forEach((i) => target.add(i));
|
|
50
|
-
return target;
|
|
51
|
-
}
|
|
52
48
|
function isString(s) {
|
|
53
49
|
return typeof s === "string";
|
|
54
50
|
}
|
|
@@ -138,7 +134,7 @@ function isStaticShortcut(sc) {
|
|
|
138
134
|
|
|
139
135
|
const attributifyRE = /^\[(.+?)~?="(.*)"\]$/;
|
|
140
136
|
const cssIdRE = /\.(css|postcss|sass|scss|less|stylus|styl)$/;
|
|
141
|
-
const validateFilterRE = /
|
|
137
|
+
const validateFilterRE = /[\w\u00A0-\uFFFF-_:%-?]/;
|
|
142
138
|
const CONTROL_SHORTCUT_NO_MERGE = "$$shortcut-no-merge";
|
|
143
139
|
function isAttributifySelector(selector) {
|
|
144
140
|
return selector.match(attributifyRE);
|
|
@@ -224,7 +220,7 @@ function withLayer(layer, rules) {
|
|
|
224
220
|
}
|
|
225
221
|
|
|
226
222
|
const regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;
|
|
227
|
-
function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
223
|
+
function expandVariantGroup(str, seperators = ["-", ":"], depth = 5) {
|
|
228
224
|
regexClassGroup.lastIndex = 0;
|
|
229
225
|
let hasChanged = false;
|
|
230
226
|
let content = str.toString();
|
|
@@ -239,11 +235,13 @@ function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
|
239
235
|
}
|
|
240
236
|
);
|
|
241
237
|
hasChanged = content !== before;
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
depth -= 1;
|
|
239
|
+
} while (hasChanged && depth);
|
|
240
|
+
if (typeof str === "string") {
|
|
244
241
|
return content;
|
|
245
|
-
else
|
|
246
|
-
return str.overwrite(0, str.length(), content);
|
|
242
|
+
} else {
|
|
243
|
+
return str.length() ? str.overwrite(0, str.length(), content) : str;
|
|
244
|
+
}
|
|
247
245
|
}
|
|
248
246
|
|
|
249
247
|
const warned = /* @__PURE__ */ new Set();
|
|
@@ -323,7 +321,7 @@ function createNanoEvents() {
|
|
|
323
321
|
const LAYER_DEFAULT = "default";
|
|
324
322
|
const LAYER_PREFLIGHTS = "preflights";
|
|
325
323
|
const LAYER_SHORTCUTS = "shortcuts";
|
|
326
|
-
const
|
|
324
|
+
const DEFAULT_LAYERS = {
|
|
327
325
|
[LAYER_PREFLIGHTS]: -100,
|
|
328
326
|
[LAYER_SHORTCUTS]: -10,
|
|
329
327
|
[LAYER_DEFAULT]: 0
|
|
@@ -362,7 +360,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
362
360
|
...rawPresets.filter((p) => !p.enforce),
|
|
363
361
|
...rawPresets.filter((p) => p.enforce === "post")
|
|
364
362
|
];
|
|
365
|
-
const layers = Object.assign(
|
|
363
|
+
const layers = Object.assign(DEFAULT_LAYERS, ...rawPresets.map((i) => i.layers), userConfig.layers);
|
|
366
364
|
function mergePresets(key) {
|
|
367
365
|
return uniq([
|
|
368
366
|
...sortedPresets.flatMap((p) => toArray(p[key] || [])),
|
|
@@ -417,7 +415,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
417
415
|
};
|
|
418
416
|
}
|
|
419
417
|
|
|
420
|
-
const version = "0.45.
|
|
418
|
+
const version = "0.45.14";
|
|
421
419
|
|
|
422
420
|
class UnoGenerator {
|
|
423
421
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -581,12 +579,12 @@ class UnoGenerator {
|
|
|
581
579
|
return layerCache[layer];
|
|
582
580
|
let css = Array.from(sheet).sort((a, b) => (this.parentOrders.get(a[0]) ?? 0) - (this.parentOrders.get(b[0]) ?? 0) || a[0]?.localeCompare(b[0] || "") || 0).map(([parent, items]) => {
|
|
583
581
|
const size = items.length;
|
|
584
|
-
const sorted = items.filter((i) => (i[4]?.layer || LAYER_DEFAULT) === layer).sort((a, b) => a[0] - b[0] || (a[4]?.sort || 0) - (b[4]?.sort || 0) || a[1]?.localeCompare(b[1] || "") || a[2]?.localeCompare(b[2] || "") || 0).map(([, selector, body, , meta]) => {
|
|
582
|
+
const sorted = items.filter((i) => (i[4]?.layer || LAYER_DEFAULT) === layer).sort((a, b) => a[0] - b[0] || (a[4]?.sort || 0) - (b[4]?.sort || 0) || a[1]?.localeCompare(b[1] || "") || a[2]?.localeCompare(b[2] || "") || 0).map(([, selector, body, , meta, , variantNoMerge]) => {
|
|
585
583
|
const scopedSelector = selector ? applyScope(selector, scope) : selector;
|
|
586
584
|
return [
|
|
587
585
|
[[scopedSelector ?? "", meta?.sort ?? 0]],
|
|
588
586
|
body,
|
|
589
|
-
!!meta?.noMerge
|
|
587
|
+
!!(variantNoMerge ?? meta?.noMerge)
|
|
590
588
|
];
|
|
591
589
|
});
|
|
592
590
|
if (!sorted.length)
|
|
@@ -699,7 +697,8 @@ class UnoGenerator {
|
|
|
699
697
|
entries: variantContextResult.entries,
|
|
700
698
|
parent,
|
|
701
699
|
layer: variantContextResult.layer,
|
|
702
|
-
sort: variantContextResult.sort
|
|
700
|
+
sort: variantContextResult.sort,
|
|
701
|
+
noMerge: variantContextResult.noMerge
|
|
703
702
|
};
|
|
704
703
|
for (const p of this.config.postprocess)
|
|
705
704
|
p(obj);
|
|
@@ -768,8 +767,8 @@ class UnoGenerator {
|
|
|
768
767
|
if (!parsed)
|
|
769
768
|
return;
|
|
770
769
|
if (isRawUtil(parsed))
|
|
771
|
-
return [parsed[0], void 0, parsed[1], void 0, parsed[2], this.config.details ? context : void 0];
|
|
772
|
-
const { selector, entries, parent, layer: variantLayer, sort: variantSort } = this.applyVariants(parsed);
|
|
770
|
+
return [parsed[0], void 0, parsed[1], void 0, parsed[2], this.config.details ? context : void 0, void 0];
|
|
771
|
+
const { selector, entries, parent, layer: variantLayer, sort: variantSort, noMerge } = this.applyVariants(parsed);
|
|
773
772
|
const body = entriesToCss(entries);
|
|
774
773
|
if (!body)
|
|
775
774
|
return;
|
|
@@ -779,7 +778,7 @@ class UnoGenerator {
|
|
|
779
778
|
layer: variantLayer ?? metaLayer,
|
|
780
779
|
sort: variantSort ?? metaSort
|
|
781
780
|
};
|
|
782
|
-
return [parsed[0], selector, body, parent, ruleMeta, this.config.details ? context : void 0];
|
|
781
|
+
return [parsed[0], selector, body, parent, ruleMeta, this.config.details ? context : void 0, noMerge];
|
|
783
782
|
}
|
|
784
783
|
expandShortcut(input, context, depth = 5) {
|
|
785
784
|
if (depth === 0)
|
|
@@ -839,12 +838,12 @@ class UnoGenerator {
|
|
|
839
838
|
const rawStringfieldUtil = [];
|
|
840
839
|
for (const item of parsed) {
|
|
841
840
|
if (isRawUtil(item)) {
|
|
842
|
-
rawStringfieldUtil.push([item[0], void 0, item[1], void 0, item[2], context]);
|
|
841
|
+
rawStringfieldUtil.push([item[0], void 0, item[1], void 0, item[2], context, void 0]);
|
|
843
842
|
continue;
|
|
844
843
|
}
|
|
845
|
-
const { selector, entries, parent: parent2, sort } = this.applyVariants(item, [...item[4], ...parentVariants], raw);
|
|
844
|
+
const { selector, entries, parent: parent2, sort, noMerge } = this.applyVariants(item, [...item[4], ...parentVariants], raw);
|
|
846
845
|
const mapItem = selectorMap.getFallback(selector, parent2, [[], item[0]]);
|
|
847
|
-
mapItem[0].push([entries, !!item[3]?.noMerge, sort ?? 0]);
|
|
846
|
+
mapItem[0].push([entries, !!(noMerge ?? item[3]?.noMerge), sort ?? 0]);
|
|
848
847
|
}
|
|
849
848
|
return rawStringfieldUtil.concat(selectorMap.map(([e2, index], selector, joinedParents) => {
|
|
850
849
|
const stringify = (flatten, noMerge, entrySortPair) => {
|
|
@@ -853,7 +852,7 @@ class UnoGenerator {
|
|
|
853
852
|
return (flatten ? [entriesList.flat(1)] : entriesList).map((entries) => {
|
|
854
853
|
const body = entriesToCss(entries);
|
|
855
854
|
if (body)
|
|
856
|
-
return [index, selector, body, joinedParents, { ...meta, noMerge, sort: maxSort }, context];
|
|
855
|
+
return [index, selector, body, joinedParents, { ...meta, noMerge, sort: maxSort }, context, void 0];
|
|
857
856
|
return void 0;
|
|
858
857
|
});
|
|
859
858
|
};
|
|
@@ -926,7 +925,6 @@ exports.isStaticShortcut = isStaticShortcut;
|
|
|
926
925
|
exports.isString = isString;
|
|
927
926
|
exports.isValidSelector = isValidSelector;
|
|
928
927
|
exports.mergeDeep = mergeDeep;
|
|
929
|
-
exports.mergeSet = mergeSet;
|
|
930
928
|
exports.movePseudoElementsEnd = movePseudoElementsEnd;
|
|
931
929
|
exports.noop = noop;
|
|
932
930
|
exports.normalizeCSSEntries = normalizeCSSEntries;
|
package/dist/index.d.ts
CHANGED
|
@@ -102,7 +102,6 @@ declare function isStaticShortcut(sc: Shortcut): sc is StaticShortcut;
|
|
|
102
102
|
|
|
103
103
|
declare function toArray<T>(value?: T | T[]): T[];
|
|
104
104
|
declare function uniq<T>(value: T[]): T[];
|
|
105
|
-
declare function mergeSet<T>(target: Set<T>, append: Set<T>): Set<T>;
|
|
106
105
|
declare function isString(s: any): s is string;
|
|
107
106
|
|
|
108
107
|
declare const attributifyRE: RegExp;
|
|
@@ -133,8 +132,8 @@ declare class BetterMap<K, V> extends Map<K, V> {
|
|
|
133
132
|
declare function withLayer<T>(layer: string, rules: Rule<T>[]): Rule<T>[];
|
|
134
133
|
|
|
135
134
|
declare const regexClassGroup: RegExp;
|
|
136
|
-
declare function expandVariantGroup(str: string, seperators?:
|
|
137
|
-
declare function expandVariantGroup(str: MagicString, seperators?:
|
|
135
|
+
declare function expandVariantGroup(str: string, seperators?: string[], depth?: number): string;
|
|
136
|
+
declare function expandVariantGroup(str: MagicString, seperators?: string[], depth?: number): MagicString;
|
|
138
137
|
|
|
139
138
|
declare function warnOnce(msg: string): void;
|
|
140
139
|
|
|
@@ -356,6 +355,11 @@ interface VariantHandlerContext {
|
|
|
356
355
|
* Order in which the variant is sorted within single rule.
|
|
357
356
|
*/
|
|
358
357
|
sort?: number;
|
|
358
|
+
/**
|
|
359
|
+
* Option to not merge the resulting entries even if the body are the same.
|
|
360
|
+
* @default false
|
|
361
|
+
*/
|
|
362
|
+
noMerge?: boolean;
|
|
359
363
|
}
|
|
360
364
|
interface VariantHandler {
|
|
361
365
|
/**
|
|
@@ -725,7 +729,8 @@ declare type StringifiedUtil = readonly [
|
|
|
725
729
|
body: string,
|
|
726
730
|
parent: string | undefined,
|
|
727
731
|
meta: RuleMeta | undefined,
|
|
728
|
-
context: RuleContext | undefined
|
|
732
|
+
context: RuleContext | undefined,
|
|
733
|
+
noMerge: boolean | undefined
|
|
729
734
|
];
|
|
730
735
|
declare type PreparedRule = readonly [
|
|
731
736
|
selector: [string, number][],
|
|
@@ -738,6 +743,7 @@ interface UtilObject {
|
|
|
738
743
|
parent: string | undefined;
|
|
739
744
|
layer: string | undefined;
|
|
740
745
|
sort: number | undefined;
|
|
746
|
+
noMerge: boolean | undefined;
|
|
741
747
|
}
|
|
742
748
|
interface GenerateOptions {
|
|
743
749
|
/**
|
|
@@ -769,4 +775,4 @@ declare const extractorSplit: Extractor;
|
|
|
769
775
|
|
|
770
776
|
declare const extractorSvelte: Extractor;
|
|
771
777
|
|
|
772
|
-
export { ArgumentType, Arrayable, AutoCompleteExtractor, AutoCompleteExtractorContext, AutoCompleteExtractorResult, AutoCompleteFunction, AutoCompleteTemplate, Awaitable, BetterMap, BlocklistRule, CONTROL_SHORTCUT_NO_MERGE, CSSColorValue, CSSEntries, CSSObject, CSSValue, CSSValues, ConfigBase, DeepPartial, DynamicMatcher, DynamicRule, DynamicShortcut, DynamicShortcutMatcher, Extractor, ExtractorContext, FilterPattern, FlatObjectTuple, GenerateOptions, GenerateResult, GeneratorOptions, ParsedColorValue, ParsedUtil, PartialByKeys, PluginOptions, Postprocessor, Preflight, PreflightContext, PreparedRule, Preprocessor, Preset, PresetOptions, RGBAColorValue, RawUtil, Replacement, RequiredByKey, ResolvedConfig, RestArgs, Rule, RuleContext, RuleMeta, Shift, Shortcut, ShortcutValue, SourceCodeTransformer, SourceCodeTransformerEnforce, SourceMap, StaticRule, StaticShortcut, StaticShortcutMap, StringifiedUtil, SuggestResult, ThemeExtender, TransformResult, TwoKeyMap, UnoGenerator, UnocssPluginContext, UserConfig, UserConfigDefaults, UserOnlyOptions, UserShortcuts, UtilObject, ValueHandler, ValueHandlerCallback, Variant, VariantContext, VariantFunction, VariantHandler, VariantHandlerContext, VariantMatchedResult, VariantObject, attributifyRE, clearIdenticalEntries, clone, createGenerator, createValueHandler, cssIdRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit, extractorSvelte, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, mergeDeep,
|
|
778
|
+
export { ArgumentType, Arrayable, AutoCompleteExtractor, AutoCompleteExtractorContext, AutoCompleteExtractorResult, AutoCompleteFunction, AutoCompleteTemplate, Awaitable, BetterMap, BlocklistRule, CONTROL_SHORTCUT_NO_MERGE, CSSColorValue, CSSEntries, CSSObject, CSSValue, CSSValues, ConfigBase, DeepPartial, DynamicMatcher, DynamicRule, DynamicShortcut, DynamicShortcutMatcher, Extractor, ExtractorContext, FilterPattern, FlatObjectTuple, GenerateOptions, GenerateResult, GeneratorOptions, ParsedColorValue, ParsedUtil, PartialByKeys, PluginOptions, Postprocessor, Preflight, PreflightContext, PreparedRule, Preprocessor, Preset, PresetOptions, RGBAColorValue, RawUtil, Replacement, RequiredByKey, ResolvedConfig, RestArgs, Rule, RuleContext, RuleMeta, Shift, Shortcut, ShortcutValue, SourceCodeTransformer, SourceCodeTransformerEnforce, SourceMap, StaticRule, StaticShortcut, StaticShortcutMap, StringifiedUtil, SuggestResult, ThemeExtender, TransformResult, TwoKeyMap, UnoGenerator, UnocssPluginContext, UserConfig, UserConfigDefaults, UserOnlyOptions, UserShortcuts, UtilObject, ValueHandler, ValueHandlerCallback, Variant, VariantContext, VariantFunction, VariantHandler, VariantHandlerContext, VariantMatchedResult, VariantObject, attributifyRE, clearIdenticalEntries, clone, createGenerator, createValueHandler, cssIdRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit, extractorSvelte, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, mergeDeep, movePseudoElementsEnd, noop, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, regexClassGroup, regexScopePlaceholder, toArray, toEscapedSelector, uniq, validateFilterRE, warnOnce, withLayer };
|
package/dist/index.mjs
CHANGED
|
@@ -41,10 +41,6 @@ function toArray(value = []) {
|
|
|
41
41
|
function uniq(value) {
|
|
42
42
|
return Array.from(new Set(value));
|
|
43
43
|
}
|
|
44
|
-
function mergeSet(target, append) {
|
|
45
|
-
append.forEach((i) => target.add(i));
|
|
46
|
-
return target;
|
|
47
|
-
}
|
|
48
44
|
function isString(s) {
|
|
49
45
|
return typeof s === "string";
|
|
50
46
|
}
|
|
@@ -134,7 +130,7 @@ function isStaticShortcut(sc) {
|
|
|
134
130
|
|
|
135
131
|
const attributifyRE = /^\[(.+?)~?="(.*)"\]$/;
|
|
136
132
|
const cssIdRE = /\.(css|postcss|sass|scss|less|stylus|styl)$/;
|
|
137
|
-
const validateFilterRE = /
|
|
133
|
+
const validateFilterRE = /[\w\u00A0-\uFFFF-_:%-?]/;
|
|
138
134
|
const CONTROL_SHORTCUT_NO_MERGE = "$$shortcut-no-merge";
|
|
139
135
|
function isAttributifySelector(selector) {
|
|
140
136
|
return selector.match(attributifyRE);
|
|
@@ -220,7 +216,7 @@ function withLayer(layer, rules) {
|
|
|
220
216
|
}
|
|
221
217
|
|
|
222
218
|
const regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;
|
|
223
|
-
function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
219
|
+
function expandVariantGroup(str, seperators = ["-", ":"], depth = 5) {
|
|
224
220
|
regexClassGroup.lastIndex = 0;
|
|
225
221
|
let hasChanged = false;
|
|
226
222
|
let content = str.toString();
|
|
@@ -235,11 +231,13 @@ function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
|
235
231
|
}
|
|
236
232
|
);
|
|
237
233
|
hasChanged = content !== before;
|
|
238
|
-
|
|
239
|
-
|
|
234
|
+
depth -= 1;
|
|
235
|
+
} while (hasChanged && depth);
|
|
236
|
+
if (typeof str === "string") {
|
|
240
237
|
return content;
|
|
241
|
-
else
|
|
242
|
-
return str.overwrite(0, str.length(), content);
|
|
238
|
+
} else {
|
|
239
|
+
return str.length() ? str.overwrite(0, str.length(), content) : str;
|
|
240
|
+
}
|
|
243
241
|
}
|
|
244
242
|
|
|
245
243
|
const warned = /* @__PURE__ */ new Set();
|
|
@@ -319,7 +317,7 @@ function createNanoEvents() {
|
|
|
319
317
|
const LAYER_DEFAULT = "default";
|
|
320
318
|
const LAYER_PREFLIGHTS = "preflights";
|
|
321
319
|
const LAYER_SHORTCUTS = "shortcuts";
|
|
322
|
-
const
|
|
320
|
+
const DEFAULT_LAYERS = {
|
|
323
321
|
[LAYER_PREFLIGHTS]: -100,
|
|
324
322
|
[LAYER_SHORTCUTS]: -10,
|
|
325
323
|
[LAYER_DEFAULT]: 0
|
|
@@ -358,7 +356,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
358
356
|
...rawPresets.filter((p) => !p.enforce),
|
|
359
357
|
...rawPresets.filter((p) => p.enforce === "post")
|
|
360
358
|
];
|
|
361
|
-
const layers = Object.assign(
|
|
359
|
+
const layers = Object.assign(DEFAULT_LAYERS, ...rawPresets.map((i) => i.layers), userConfig.layers);
|
|
362
360
|
function mergePresets(key) {
|
|
363
361
|
return uniq([
|
|
364
362
|
...sortedPresets.flatMap((p) => toArray(p[key] || [])),
|
|
@@ -413,7 +411,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
413
411
|
};
|
|
414
412
|
}
|
|
415
413
|
|
|
416
|
-
const version = "0.45.
|
|
414
|
+
const version = "0.45.14";
|
|
417
415
|
|
|
418
416
|
class UnoGenerator {
|
|
419
417
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -577,12 +575,12 @@ class UnoGenerator {
|
|
|
577
575
|
return layerCache[layer];
|
|
578
576
|
let css = Array.from(sheet).sort((a, b) => (this.parentOrders.get(a[0]) ?? 0) - (this.parentOrders.get(b[0]) ?? 0) || a[0]?.localeCompare(b[0] || "") || 0).map(([parent, items]) => {
|
|
579
577
|
const size = items.length;
|
|
580
|
-
const sorted = items.filter((i) => (i[4]?.layer || LAYER_DEFAULT) === layer).sort((a, b) => a[0] - b[0] || (a[4]?.sort || 0) - (b[4]?.sort || 0) || a[1]?.localeCompare(b[1] || "") || a[2]?.localeCompare(b[2] || "") || 0).map(([, selector, body, , meta]) => {
|
|
578
|
+
const sorted = items.filter((i) => (i[4]?.layer || LAYER_DEFAULT) === layer).sort((a, b) => a[0] - b[0] || (a[4]?.sort || 0) - (b[4]?.sort || 0) || a[1]?.localeCompare(b[1] || "") || a[2]?.localeCompare(b[2] || "") || 0).map(([, selector, body, , meta, , variantNoMerge]) => {
|
|
581
579
|
const scopedSelector = selector ? applyScope(selector, scope) : selector;
|
|
582
580
|
return [
|
|
583
581
|
[[scopedSelector ?? "", meta?.sort ?? 0]],
|
|
584
582
|
body,
|
|
585
|
-
!!meta?.noMerge
|
|
583
|
+
!!(variantNoMerge ?? meta?.noMerge)
|
|
586
584
|
];
|
|
587
585
|
});
|
|
588
586
|
if (!sorted.length)
|
|
@@ -695,7 +693,8 @@ class UnoGenerator {
|
|
|
695
693
|
entries: variantContextResult.entries,
|
|
696
694
|
parent,
|
|
697
695
|
layer: variantContextResult.layer,
|
|
698
|
-
sort: variantContextResult.sort
|
|
696
|
+
sort: variantContextResult.sort,
|
|
697
|
+
noMerge: variantContextResult.noMerge
|
|
699
698
|
};
|
|
700
699
|
for (const p of this.config.postprocess)
|
|
701
700
|
p(obj);
|
|
@@ -764,8 +763,8 @@ class UnoGenerator {
|
|
|
764
763
|
if (!parsed)
|
|
765
764
|
return;
|
|
766
765
|
if (isRawUtil(parsed))
|
|
767
|
-
return [parsed[0], void 0, parsed[1], void 0, parsed[2], this.config.details ? context : void 0];
|
|
768
|
-
const { selector, entries, parent, layer: variantLayer, sort: variantSort } = this.applyVariants(parsed);
|
|
766
|
+
return [parsed[0], void 0, parsed[1], void 0, parsed[2], this.config.details ? context : void 0, void 0];
|
|
767
|
+
const { selector, entries, parent, layer: variantLayer, sort: variantSort, noMerge } = this.applyVariants(parsed);
|
|
769
768
|
const body = entriesToCss(entries);
|
|
770
769
|
if (!body)
|
|
771
770
|
return;
|
|
@@ -775,7 +774,7 @@ class UnoGenerator {
|
|
|
775
774
|
layer: variantLayer ?? metaLayer,
|
|
776
775
|
sort: variantSort ?? metaSort
|
|
777
776
|
};
|
|
778
|
-
return [parsed[0], selector, body, parent, ruleMeta, this.config.details ? context : void 0];
|
|
777
|
+
return [parsed[0], selector, body, parent, ruleMeta, this.config.details ? context : void 0, noMerge];
|
|
779
778
|
}
|
|
780
779
|
expandShortcut(input, context, depth = 5) {
|
|
781
780
|
if (depth === 0)
|
|
@@ -835,12 +834,12 @@ class UnoGenerator {
|
|
|
835
834
|
const rawStringfieldUtil = [];
|
|
836
835
|
for (const item of parsed) {
|
|
837
836
|
if (isRawUtil(item)) {
|
|
838
|
-
rawStringfieldUtil.push([item[0], void 0, item[1], void 0, item[2], context]);
|
|
837
|
+
rawStringfieldUtil.push([item[0], void 0, item[1], void 0, item[2], context, void 0]);
|
|
839
838
|
continue;
|
|
840
839
|
}
|
|
841
|
-
const { selector, entries, parent: parent2, sort } = this.applyVariants(item, [...item[4], ...parentVariants], raw);
|
|
840
|
+
const { selector, entries, parent: parent2, sort, noMerge } = this.applyVariants(item, [...item[4], ...parentVariants], raw);
|
|
842
841
|
const mapItem = selectorMap.getFallback(selector, parent2, [[], item[0]]);
|
|
843
|
-
mapItem[0].push([entries, !!item[3]?.noMerge, sort ?? 0]);
|
|
842
|
+
mapItem[0].push([entries, !!(noMerge ?? item[3]?.noMerge), sort ?? 0]);
|
|
844
843
|
}
|
|
845
844
|
return rawStringfieldUtil.concat(selectorMap.map(([e2, index], selector, joinedParents) => {
|
|
846
845
|
const stringify = (flatten, noMerge, entrySortPair) => {
|
|
@@ -849,7 +848,7 @@ class UnoGenerator {
|
|
|
849
848
|
return (flatten ? [entriesList.flat(1)] : entriesList).map((entries) => {
|
|
850
849
|
const body = entriesToCss(entries);
|
|
851
850
|
if (body)
|
|
852
|
-
return [index, selector, body, joinedParents, { ...meta, noMerge, sort: maxSort }, context];
|
|
851
|
+
return [index, selector, body, joinedParents, { ...meta, noMerge, sort: maxSort }, context, void 0];
|
|
853
852
|
return void 0;
|
|
854
853
|
});
|
|
855
854
|
};
|
|
@@ -896,4 +895,4 @@ function defaultVariantHandler(input, next) {
|
|
|
896
895
|
return next(input);
|
|
897
896
|
}
|
|
898
897
|
|
|
899
|
-
export { BetterMap, CONTROL_SHORTCUT_NO_MERGE, TwoKeyMap, UnoGenerator, attributifyRE, clearIdenticalEntries, clone, createGenerator, createValueHandler, cssIdRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit, extractorSvelte, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, mergeDeep,
|
|
898
|
+
export { BetterMap, CONTROL_SHORTCUT_NO_MERGE, TwoKeyMap, UnoGenerator, attributifyRE, clearIdenticalEntries, clone, createGenerator, createValueHandler, cssIdRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit, extractorSvelte, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, mergeDeep, movePseudoElementsEnd, noop, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, regexClassGroup, regexScopePlaceholder, toArray, toEscapedSelector, uniq, validateFilterRE, warnOnce, withLayer };
|