@unocss/rule-utils 0.62.4 → 0.63.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.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +6 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -48,6 +48,9 @@ type ValueHandler<K extends string> = {
|
|
|
48
48
|
};
|
|
49
49
|
declare function createValueHandler<K extends string>(handlers: Record<K, ValueHandlerCallback>): ValueHandler<K>;
|
|
50
50
|
|
|
51
|
+
declare const iconFnRE: RegExp;
|
|
52
|
+
declare function hasIconFn(str: string): boolean;
|
|
53
|
+
|
|
51
54
|
declare const themeFnRE: RegExp;
|
|
52
55
|
declare function hasThemeFn(str: string): boolean;
|
|
53
56
|
declare function transformThemeFn(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string;
|
|
@@ -62,4 +65,4 @@ declare function variantParentMatcher(name: string, parent: string): VariantObje
|
|
|
62
65
|
declare function variantGetBracket(prefix: string, matcher: string, separators: string[]): string[] | undefined;
|
|
63
66
|
declare function variantGetParameter(prefix: string, matcher: string, separators: string[]): string[] | undefined;
|
|
64
67
|
|
|
65
|
-
export { type CSSColorValue, type ParsedColorValue, type RGBAColorValue, type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
|
68
|
+
export { type CSSColorValue, type ParsedColorValue, type RGBAColorValue, type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasIconFn, hasThemeFn, hex2rgba, iconFnRE, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,9 @@ type ValueHandler<K extends string> = {
|
|
|
48
48
|
};
|
|
49
49
|
declare function createValueHandler<K extends string>(handlers: Record<K, ValueHandlerCallback>): ValueHandler<K>;
|
|
50
50
|
|
|
51
|
+
declare const iconFnRE: RegExp;
|
|
52
|
+
declare function hasIconFn(str: string): boolean;
|
|
53
|
+
|
|
51
54
|
declare const themeFnRE: RegExp;
|
|
52
55
|
declare function hasThemeFn(str: string): boolean;
|
|
53
56
|
declare function transformThemeFn(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string;
|
|
@@ -62,4 +65,4 @@ declare function variantParentMatcher(name: string, parent: string): VariantObje
|
|
|
62
65
|
declare function variantGetBracket(prefix: string, matcher: string, separators: string[]): string[] | undefined;
|
|
63
66
|
declare function variantGetParameter(prefix: string, matcher: string, separators: string[]): string[] | undefined;
|
|
64
67
|
|
|
65
|
-
export { type CSSColorValue, type ParsedColorValue, type RGBAColorValue, type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
|
68
|
+
export { type CSSColorValue, type ParsedColorValue, type RGBAColorValue, type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasIconFn, hasThemeFn, hex2rgba, iconFnRE, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
package/dist/index.mjs
CHANGED
|
@@ -295,6 +295,11 @@ function createValueHandler(handlers) {
|
|
|
295
295
|
return handler;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
const iconFnRE = /icon\(\s*(['"])?(.*?)\1?\s*\)/g;
|
|
299
|
+
function hasIconFn(str) {
|
|
300
|
+
return str.includes("icon(") && str.includes(")");
|
|
301
|
+
}
|
|
302
|
+
|
|
298
303
|
const themeFnRE = /theme\(\s*(['"])?(.*?)\1?\s*\)/g;
|
|
299
304
|
function hasThemeFn(str) {
|
|
300
305
|
return str.includes("theme(") && str.includes(")");
|
|
@@ -414,4 +419,4 @@ function variantGetParameter(prefix, matcher, separators) {
|
|
|
414
419
|
}
|
|
415
420
|
}
|
|
416
421
|
|
|
417
|
-
export { colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
|
422
|
+
export { colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasIconFn, hasThemeFn, hex2rgba, iconFnRE, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/rule-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.63.0",
|
|
5
5
|
"description": "Utilities for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"magic-string": "^0.30.11",
|
|
37
|
-
"@unocss/core": "^0.
|
|
37
|
+
"@unocss/core": "^0.63.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "unbuild",
|