@unocss/core
Advanced tools
Comparing version 0.4.7 to 0.4.8
@@ -15,3 +15,3 @@ declare class UnoGenerator { | ||
stringifyUtil(parsed?: ParsedUtil | RawUtil): StringifiedUtil | undefined; | ||
expandShortcut(processed: string): string[] | undefined; | ||
expandShortcut(processed: string, depth?: number): string[] | undefined; | ||
stringifyShortcuts(parent: VariantMatchedResult, expanded: string[]): Promise<StringifiedUtil[]>; | ||
@@ -168,3 +168,2 @@ isExcluded(raw: string): boolean; | ||
]; | ||
declare function defineConfig(config: UserConfig): UserConfig<{}>; | ||
@@ -213,2 +212,2 @@ declare function escapeRegExp(string: string): string; | ||
export { ArgumentType, Awaitable, BetterMap, CSSEntries, CSSObject, ConfigBase, DeepPartial, DynamicRule, DynamicShortcut, ExcludeRule, Extractor, GenerateResult, GeneratorOptions, ParsedUtil, Preset, RawUtil, ResolvedConfig, RestArgs, Rule, RuleContext, Shift, Shortcut, StaticRule, StaticShortcut, StaticShortcutMap, StringifiedUtil, TwoKeyMap, UnoGenerator, UserConfig, UserConfigDefaults, UserShortcuts, Variant, VariantFunction, VariantHandler, VariantMatchedResult, VariantObject, attributifyRE, createGenerator, defineConfig, e, entriesToCss, escapeRegExp, escapeSelector, extractorSplit, hasScopePlaceholder, hex2rgba, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isValidSelector, mergeDeep, mergeSet, normalizeVariant, toArray, uniq, validateFilterRE }; | ||
export { ArgumentType, Awaitable, BetterMap, CSSEntries, CSSObject, ConfigBase, DeepPartial, DynamicRule, DynamicShortcut, ExcludeRule, Extractor, GenerateResult, GeneratorOptions, ParsedUtil, Preset, RawUtil, ResolvedConfig, RestArgs, Rule, RuleContext, Shift, Shortcut, StaticRule, StaticShortcut, StaticShortcutMap, StringifiedUtil, TwoKeyMap, UnoGenerator, UserConfig, UserConfigDefaults, UserShortcuts, Variant, VariantFunction, VariantHandler, VariantMatchedResult, VariantObject, attributifyRE, createGenerator, e, entriesToCss, escapeRegExp, escapeSelector, extractorSplit, hasScopePlaceholder, hex2rgba, isAttributifySelector, isObject, isRawUtil, isStaticRule, isStaticShortcut, isValidSelector, mergeDeep, mergeSet, normalizeVariant, toArray, uniq, validateFilterRE }; |
@@ -16,3 +16,2 @@ var __defProp = Object.defineProperty; | ||
createGenerator: () => createGenerator, | ||
defineConfig: () => defineConfig, | ||
e: () => e, | ||
@@ -39,7 +38,2 @@ entriesToCss: () => entriesToCss, | ||
// src/types.ts | ||
function defineConfig(config) { | ||
return config; | ||
} | ||
// src/utils/escape.ts | ||
@@ -345,3 +339,3 @@ function escapeRegExp(string) { | ||
const expanded = this.expandShortcut(applied[1]); | ||
if (expanded) { | ||
if (expanded == null ? void 0 : expanded.length) { | ||
const utils = await this.stringifyShortcuts(applied, expanded); | ||
@@ -473,8 +467,12 @@ if (utils.length) { | ||
} | ||
expandShortcut(processed) { | ||
expandShortcut(processed, depth = 3) { | ||
if (depth === 0) | ||
return; | ||
let result; | ||
for (const s of this.config.shortcuts) { | ||
if (isStaticShortcut(s)) { | ||
if (s[0] === processed) | ||
if (s[0] === processed) { | ||
result = s[1]; | ||
break; | ||
} | ||
} else { | ||
@@ -492,3 +490,3 @@ const match = processed.match(s[0]); | ||
result = result.split(/ /g); | ||
return result; | ||
return uniq(result.flatMap((r) => this.expandShortcut(r, depth - 1) || [r])); | ||
} | ||
@@ -544,3 +542,2 @@ async stringifyShortcuts(parent, expanded) { | ||
createGenerator, | ||
defineConfig, | ||
e, | ||
@@ -547,0 +544,0 @@ entriesToCss, |
{ | ||
"name": "@unocss/core", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42224
1260