@unocss/core 0.16.1 → 0.17.2

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 CHANGED
@@ -359,7 +359,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
359
359
  };
360
360
  }
361
361
 
362
- const version = "0.16.1";
362
+ const version = "0.17.2";
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
+ * Color scale. Preferrably 000 - 999
59
+ */
60
+ rgba?: RGBAColorValue;
61
+ };
39
62
  interface RuleContext<Theme extends {} = {}> {
40
63
  /**
41
64
  * Unprocessed selector from user input.
@@ -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): [number, number, number, number] | [number, number, number] | undefined;
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.16.1";
358
+ const version = "0.17.2";
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/core",
3
- "version": "0.16.1",
3
+ "version": "0.17.2",
4
4
  "description": "The instant on-demand Atomic CSS engine.",
5
5
  "keywords": [
6
6
  "unocss",