@unocss/core 0.52.3 → 0.52.5
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 +27 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.mjs +23 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -481,8 +481,29 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
481
481
|
p?.configResolved?.(resolved);
|
|
482
482
|
return resolved;
|
|
483
483
|
}
|
|
484
|
+
function mergeConfigs(configs) {
|
|
485
|
+
function getMerged(key) {
|
|
486
|
+
return uniq(configs.flatMap((p) => toArray(p[key] || [])));
|
|
487
|
+
}
|
|
488
|
+
const merged = Object.assign(
|
|
489
|
+
{},
|
|
490
|
+
...configs,
|
|
491
|
+
{
|
|
492
|
+
presets: getMerged("presets"),
|
|
493
|
+
safelist: getMerged("safelist"),
|
|
494
|
+
preprocess: getMerged("preprocess"),
|
|
495
|
+
postprocess: getMerged("postprocess"),
|
|
496
|
+
preflights: getMerged("preflights"),
|
|
497
|
+
rules: getMerged("rules"),
|
|
498
|
+
variants: getMerged("variants"),
|
|
499
|
+
shortcuts: getMerged("shortcuts"),
|
|
500
|
+
extractors: getMerged("extractors")
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
return merged;
|
|
504
|
+
}
|
|
484
505
|
|
|
485
|
-
const version = "0.52.
|
|
506
|
+
const version = "0.52.5";
|
|
486
507
|
|
|
487
508
|
class UnoGenerator {
|
|
488
509
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -994,6 +1015,7 @@ exports.isStaticShortcut = isStaticShortcut;
|
|
|
994
1015
|
exports.isString = isString;
|
|
995
1016
|
exports.isValidSelector = isValidSelector;
|
|
996
1017
|
exports.makeRegexClassGroup = makeRegexClassGroup;
|
|
1018
|
+
exports.mergeConfigs = mergeConfigs;
|
|
997
1019
|
exports.mergeDeep = mergeDeep;
|
|
998
1020
|
exports.noop = noop;
|
|
999
1021
|
exports.normalizeCSSEntries = normalizeCSSEntries;
|
|
@@ -1002,6 +1024,10 @@ exports.normalizeVariant = normalizeVariant;
|
|
|
1002
1024
|
exports.notNull = notNull;
|
|
1003
1025
|
exports.parseVariantGroup = parseVariantGroup;
|
|
1004
1026
|
exports.regexScopePlaceholder = regexScopePlaceholder;
|
|
1027
|
+
exports.resolveConfig = resolveConfig;
|
|
1028
|
+
exports.resolvePreset = resolvePreset;
|
|
1029
|
+
exports.resolvePresets = resolvePresets;
|
|
1030
|
+
exports.resolveShortcuts = resolveShortcuts;
|
|
1005
1031
|
exports.splitWithVariantGroupRE = splitWithVariantGroupRE;
|
|
1006
1032
|
exports.toArray = toArray;
|
|
1007
1033
|
exports.toEscapedSelector = toEscapedSelector;
|
package/dist/index.d.ts
CHANGED
|
@@ -864,4 +864,19 @@ declare const defaultSplitRE: RegExp;
|
|
|
864
864
|
declare const splitWithVariantGroupRE: RegExp;
|
|
865
865
|
declare const extractorSplit: Extractor;
|
|
866
866
|
|
|
867
|
-
|
|
867
|
+
declare function resolveShortcuts<Theme extends {} = {}>(shortcuts: UserShortcuts<Theme>): Shortcut<Theme>[];
|
|
868
|
+
/**
|
|
869
|
+
* Resolve a single preset, nested presets are ignored
|
|
870
|
+
*/
|
|
871
|
+
declare function resolvePreset<Theme extends {} = {}>(preset: Preset<Theme>): Preset<Theme>;
|
|
872
|
+
/**
|
|
873
|
+
* Resolve presets with nested presets
|
|
874
|
+
*/
|
|
875
|
+
declare function resolvePresets<Theme extends {} = {}>(preset: Preset<Theme>): Preset<Theme>[];
|
|
876
|
+
declare function resolveConfig<Theme extends {} = {}>(userConfig?: UserConfig<Theme>, defaults?: UserConfigDefaults<Theme>): ResolvedConfig<Theme>;
|
|
877
|
+
/**
|
|
878
|
+
* Merge multiple configs into one, later ones have higher priority
|
|
879
|
+
*/
|
|
880
|
+
declare function mergeConfigs<Theme extends {} = {}>(configs: UserConfig<Theme>[]): UserConfig<Theme>;
|
|
881
|
+
|
|
882
|
+
export { ArgumentType, Arrayable, AutoCompleteExtractor, AutoCompleteExtractorContext, AutoCompleteExtractorResult, AutoCompleteFunction, AutoCompleteTemplate, Awaitable, BetterMap, BlocklistRule, CONTROL_SHORTCUT_NO_MERGE, CSSColorValue, CSSEntries, CSSObject, CSSValue, CSSValues, CliEntryItem, CliOptions, ConfigBase, DeepPartial, DynamicMatcher, DynamicRule, DynamicShortcut, DynamicShortcutMatcher, ExtraContentOptions, 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, ToArray, TransformResult, TwoKeyMap, UnoGenerator, UnocssPluginContext, UserConfig, UserConfigDefaults, UserOnlyOptions, UserShortcuts, UtilObject, ValueHandler, ValueHandlerCallback, Variant, VariantContext, VariantFunction, VariantHandler, VariantHandlerContext, VariantMatchedResult, VariantObject, attributifyRE, clearIdenticalEntries, clone, collapseVariantGroup, createGenerator, createValueHandler, cssIdRE, defaultSplitRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit as extractorDefault, extractorSplit, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, makeRegexClassGroup, mergeConfigs, mergeDeep, noop, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, parseVariantGroup, regexScopePlaceholder, resolveConfig, resolvePreset, resolvePresets, resolveShortcuts, splitWithVariantGroupRE, toArray, toEscapedSelector, uniq, validateFilterRE, warnOnce, withLayer };
|
package/dist/index.mjs
CHANGED
|
@@ -477,8 +477,29 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
477
477
|
p?.configResolved?.(resolved);
|
|
478
478
|
return resolved;
|
|
479
479
|
}
|
|
480
|
+
function mergeConfigs(configs) {
|
|
481
|
+
function getMerged(key) {
|
|
482
|
+
return uniq(configs.flatMap((p) => toArray(p[key] || [])));
|
|
483
|
+
}
|
|
484
|
+
const merged = Object.assign(
|
|
485
|
+
{},
|
|
486
|
+
...configs,
|
|
487
|
+
{
|
|
488
|
+
presets: getMerged("presets"),
|
|
489
|
+
safelist: getMerged("safelist"),
|
|
490
|
+
preprocess: getMerged("preprocess"),
|
|
491
|
+
postprocess: getMerged("postprocess"),
|
|
492
|
+
preflights: getMerged("preflights"),
|
|
493
|
+
rules: getMerged("rules"),
|
|
494
|
+
variants: getMerged("variants"),
|
|
495
|
+
shortcuts: getMerged("shortcuts"),
|
|
496
|
+
extractors: getMerged("extractors")
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
return merged;
|
|
500
|
+
}
|
|
480
501
|
|
|
481
|
-
const version = "0.52.
|
|
502
|
+
const version = "0.52.5";
|
|
482
503
|
|
|
483
504
|
class UnoGenerator {
|
|
484
505
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -962,4 +983,4 @@ function defaultVariantHandler(input, next) {
|
|
|
962
983
|
return next(input);
|
|
963
984
|
}
|
|
964
985
|
|
|
965
|
-
export { BetterMap, CONTROL_SHORTCUT_NO_MERGE, TwoKeyMap, UnoGenerator, attributifyRE, clearIdenticalEntries, clone, collapseVariantGroup, createGenerator, createValueHandler, cssIdRE, defaultSplitRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit as extractorDefault, extractorSplit, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, makeRegexClassGroup, mergeDeep, noop, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, parseVariantGroup, regexScopePlaceholder, splitWithVariantGroupRE, toArray, toEscapedSelector, uniq, validateFilterRE, warnOnce, withLayer };
|
|
986
|
+
export { BetterMap, CONTROL_SHORTCUT_NO_MERGE, TwoKeyMap, UnoGenerator, attributifyRE, clearIdenticalEntries, clone, collapseVariantGroup, createGenerator, createValueHandler, cssIdRE, defaultSplitRE, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit as extractorDefault, extractorSplit, hasScopePlaceholder, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isString, isValidSelector, makeRegexClassGroup, mergeConfigs, mergeDeep, noop, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, parseVariantGroup, regexScopePlaceholder, resolveConfig, resolvePreset, resolvePresets, resolveShortcuts, splitWithVariantGroupRE, toArray, toEscapedSelector, uniq, validateFilterRE, warnOnce, withLayer };
|