@unocss/core 0.16.3 → 0.18.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.cjs +2 -2
- package/dist/index.d.ts +27 -4
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -359,7 +359,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
const version = "0.
|
|
362
|
+
const version = "0.18.0";
|
|
363
363
|
|
|
364
364
|
class UnoGenerator {
|
|
365
365
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -629,7 +629,7 @@ class UnoGenerator {
|
|
|
629
629
|
if (!result)
|
|
630
630
|
return;
|
|
631
631
|
return [
|
|
632
|
-
result.flatMap((r) => this.expandShortcut(r, context, depth - 1)?.[0] || [r]),
|
|
632
|
+
result.flatMap((r) => this.expandShortcut(r, context, depth - 1)?.[0] || [r]).filter((r) => r !== ""),
|
|
633
633
|
meta
|
|
634
634
|
];
|
|
635
635
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,29 @@ declare type PartialByKeys<T, K extends keyof T = keyof T> = FlatObjectTuple<Par
|
|
|
36
36
|
declare type RequiredByKey<T, K extends keyof T = keyof T> = FlatObjectTuple<Required<Pick<T, Extract<keyof T, K>>> & Omit<T, K>>;
|
|
37
37
|
declare type CSSObject = Record<string, string | number | undefined>;
|
|
38
38
|
declare type CSSEntries = [string, string | number | undefined][];
|
|
39
|
+
declare type RGBAColorValue = [number, number, number, number] | [number, number, number];
|
|
40
|
+
declare type ParsedColorValue = {
|
|
41
|
+
/**
|
|
42
|
+
* Parsed color value.
|
|
43
|
+
*/
|
|
44
|
+
color?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Parsed opacity value.
|
|
47
|
+
*/
|
|
48
|
+
opacity: string;
|
|
49
|
+
/**
|
|
50
|
+
* Color name.
|
|
51
|
+
*/
|
|
52
|
+
name: string;
|
|
53
|
+
/**
|
|
54
|
+
* Color scale. Preferrably 000 - 999
|
|
55
|
+
*/
|
|
56
|
+
no: string;
|
|
57
|
+
/**
|
|
58
|
+
* {@link RGBAColorValue}
|
|
59
|
+
*/
|
|
60
|
+
rgba?: RGBAColorValue;
|
|
61
|
+
};
|
|
39
62
|
interface RuleContext<Theme extends {} = {}> {
|
|
40
63
|
/**
|
|
41
64
|
* Unprocessed selector from user input.
|
|
@@ -87,11 +110,11 @@ interface RuleMeta {
|
|
|
87
110
|
internal?: boolean;
|
|
88
111
|
}
|
|
89
112
|
declare type CSSValues = CSSObject | CSSEntries | (CSSObject | CSSEntries)[];
|
|
90
|
-
declare type DynamicMatcher<Theme extends {} = {}> = ((match:
|
|
113
|
+
declare type DynamicMatcher<Theme extends {} = {}> = ((match: RegExpMatchArray, context: Readonly<RuleContext<Theme>>) => Awaitable<CSSValues | string | undefined>);
|
|
91
114
|
declare type DynamicRule<Theme extends {} = {}> = [RegExp, DynamicMatcher<Theme>] | [RegExp, DynamicMatcher<Theme>, RuleMeta];
|
|
92
115
|
declare type StaticRule = [string, CSSObject | CSSEntries] | [string, CSSObject | CSSEntries, RuleMeta];
|
|
93
116
|
declare type Rule<Theme extends {} = {}> = DynamicRule<Theme> | StaticRule;
|
|
94
|
-
declare type DynamicShortcutMatcher<Theme extends {} = {}> = ((match:
|
|
117
|
+
declare type DynamicShortcutMatcher<Theme extends {} = {}> = ((match: RegExpMatchArray, context: Readonly<RuleContext<Theme>>) => (string | string[] | undefined));
|
|
95
118
|
declare type StaticShortcut = [string, string | string[]] | [string, string | string[], RuleMeta];
|
|
96
119
|
declare type StaticShortcutMap = Record<string, string | string[]>;
|
|
97
120
|
declare type DynamicShortcut<Theme extends {} = {}> = [RegExp, DynamicShortcutMatcher<Theme>] | [RegExp, DynamicShortcutMatcher<Theme>, RuleMeta];
|
|
@@ -340,7 +363,7 @@ declare function toArray<T>(value?: T | T[]): T[];
|
|
|
340
363
|
declare function uniq<T>(value: T[]): T[];
|
|
341
364
|
declare function mergeSet<T>(target: Set<T>, append: Set<T>): Set<T>;
|
|
342
365
|
|
|
343
|
-
declare function hex2rgba(hex?: string):
|
|
366
|
+
declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
|
|
344
367
|
|
|
345
368
|
declare const attributifyRE: RegExp;
|
|
346
369
|
declare const validateFilterRE: RegExp;
|
|
@@ -386,4 +409,4 @@ declare const extractorSplit: Extractor;
|
|
|
386
409
|
|
|
387
410
|
declare const extractorSvelte: Extractor;
|
|
388
411
|
|
|
389
|
-
export { ArgumentType, Awaitable, BetterMap, BlocklistRule, CSSEntries, CSSObject, CSSValues, ConfigBase, DeepPartial, DynamicMatcher, DynamicRule, DynamicShortcut, DynamicShortcutMatcher, Extractor, ExtractorContext, FilterPattern, FlatObjectTuple, GenerateOptions, GenerateResult, GeneratorOptions, ParsedUtil, PartialByKeys, PluginOptions, Preflight, Preset, RawUtil, RequiredByKey, ResolvedConfig, RestArgs, Rule, RuleContext, RuleMeta, Shift, Shortcut, StaticRule, StaticShortcut, StaticShortcutMap, StringifiedUtil, TwoKeyMap, UnoGenerator, UserConfig, UserConfigDefaults, UserOnlyOptions, UserShortcuts, ValueHandler, ValueHandlerCallback, Variant, VariantFunction, VariantHandler, VariantMatchedResult, VariantObject, attributifyRE, clearIdenticalEntries, createGenerator, createValueHandler, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit, extractorSvelte, hasScopePlaceholder, hex2rgba, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isValidSelector, mergeDeep, mergeSet, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, regexClassGroup, toArray, uniq, validateFilterRE, warnOnce, withLayer };
|
|
412
|
+
export { ArgumentType, Awaitable, BetterMap, BlocklistRule, CSSEntries, CSSObject, CSSValues, ConfigBase, DeepPartial, DynamicMatcher, DynamicRule, DynamicShortcut, DynamicShortcutMatcher, Extractor, ExtractorContext, FilterPattern, FlatObjectTuple, GenerateOptions, GenerateResult, GeneratorOptions, ParsedColorValue, ParsedUtil, PartialByKeys, PluginOptions, Preflight, Preset, RGBAColorValue, RawUtil, RequiredByKey, ResolvedConfig, RestArgs, Rule, RuleContext, RuleMeta, Shift, Shortcut, StaticRule, StaticShortcut, StaticShortcutMap, StringifiedUtil, TwoKeyMap, UnoGenerator, UserConfig, UserConfigDefaults, UserOnlyOptions, UserShortcuts, ValueHandler, ValueHandlerCallback, Variant, VariantFunction, VariantHandler, VariantMatchedResult, VariantObject, attributifyRE, clearIdenticalEntries, createGenerator, createValueHandler, e, entriesToCss, escapeRegExp, escapeSelector, expandVariantGroup, extractorSplit, extractorSvelte, hasScopePlaceholder, hex2rgba, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isValidSelector, mergeDeep, mergeSet, normalizeCSSEntries, normalizeCSSValues, normalizeVariant, notNull, regexClassGroup, toArray, uniq, validateFilterRE, warnOnce, withLayer };
|
package/dist/index.mjs
CHANGED
|
@@ -355,7 +355,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
const version = "0.
|
|
358
|
+
const version = "0.18.0";
|
|
359
359
|
|
|
360
360
|
class UnoGenerator {
|
|
361
361
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -625,7 +625,7 @@ class UnoGenerator {
|
|
|
625
625
|
if (!result)
|
|
626
626
|
return;
|
|
627
627
|
return [
|
|
628
|
-
result.flatMap((r) => this.expandShortcut(r, context, depth - 1)?.[0] || [r]),
|
|
628
|
+
result.flatMap((r) => this.expandShortcut(r, context, depth - 1)?.[0] || [r]).filter((r) => r !== ""),
|
|
629
629
|
meta
|
|
630
630
|
];
|
|
631
631
|
}
|