@unocss/rule-utils 66.5.10 → 66.5.11
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 +1010 -60
- package/dist/index.mjs +620 -663
- package/package.json +5 -6
- package/dist/index.d.ts +0 -120
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/rule-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.5.
|
|
4
|
+
"version": "66.5.11",
|
|
5
5
|
"description": "Utilities for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"main": "dist/index.mjs",
|
|
27
27
|
"module": "dist/index.mjs",
|
|
28
|
-
"types": "dist/index.d.
|
|
28
|
+
"types": "dist/index.d.mts",
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
@@ -34,11 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"magic-string": "^0.30.21",
|
|
37
|
-
"@unocss/core": "^66.5.
|
|
37
|
+
"@unocss/core": "^66.5.11"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "
|
|
41
|
-
"
|
|
42
|
-
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
|
|
40
|
+
"build": "tsdown",
|
|
41
|
+
"dev": "tsdown --watch"
|
|
43
42
|
}
|
|
44
43
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Arrayable, VariantHandlerContext, VariantObject } from '@unocss/core';
|
|
2
|
-
|
|
3
|
-
interface CSSColorValue {
|
|
4
|
-
type: string;
|
|
5
|
-
components: (string | number)[];
|
|
6
|
-
alpha: string | number | undefined;
|
|
7
|
-
}
|
|
8
|
-
type RGBAColorValue = [number, number, number, number] | [number, number, number];
|
|
9
|
-
interface ParsedColorValue {
|
|
10
|
-
/**
|
|
11
|
-
* Parsed color value.
|
|
12
|
-
*/
|
|
13
|
-
color?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Parsed opacity value.
|
|
16
|
-
*/
|
|
17
|
-
opacity: string;
|
|
18
|
-
/**
|
|
19
|
-
* Color name.
|
|
20
|
-
*/
|
|
21
|
-
name: string;
|
|
22
|
-
/**
|
|
23
|
-
* Color scale, preferably 000 - 999.
|
|
24
|
-
*/
|
|
25
|
-
no: string;
|
|
26
|
-
/**
|
|
27
|
-
* {@link CSSColorValue}
|
|
28
|
-
*/
|
|
29
|
-
cssColor: CSSColorValue | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Parsed alpha value from opacity
|
|
32
|
-
*/
|
|
33
|
-
alpha: string | number | undefined;
|
|
34
|
-
}
|
|
35
|
-
declare const cssColorFunctions: string[];
|
|
36
|
-
declare const rectangularColorSpace: string[];
|
|
37
|
-
declare const polarColorSpace: string[];
|
|
38
|
-
declare const hueInterpolationMethods: string[];
|
|
39
|
-
declare const alphaPlaceholders: string[];
|
|
40
|
-
declare const alphaPlaceholdersRE: RegExp;
|
|
41
|
-
declare function isInterpolatedMethod(type?: string): boolean;
|
|
42
|
-
declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
|
|
43
|
-
declare function parseCssColor(str?: string): CSSColorValue | undefined;
|
|
44
|
-
declare function colorOpacityToString(color: CSSColorValue): string | number;
|
|
45
|
-
declare function colorToString(color: CSSColorValue | string, alphaOverride?: string | number): string;
|
|
46
|
-
|
|
47
|
-
declare const themeFnRE: RegExp;
|
|
48
|
-
declare function hasThemeFn(str: string): boolean;
|
|
49
|
-
declare function transformThemeFn(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string;
|
|
50
|
-
declare function transformThemeString(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string | undefined;
|
|
51
|
-
declare function calcMaxWidthBySize(size: string): string;
|
|
52
|
-
|
|
53
|
-
type ValueHandlerCallback<T extends object> = (str: string, theme?: T) => string | number | undefined;
|
|
54
|
-
type ValueHandler<K extends string, T extends object> = {
|
|
55
|
-
[S in K]: ValueHandler<K, T>;
|
|
56
|
-
} & {
|
|
57
|
-
(str: string, theme?: T): string | undefined;
|
|
58
|
-
__options: {
|
|
59
|
-
sequence: K[];
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
declare function createValueHandler<K extends string, T extends object>(handlers: Record<K, ValueHandlerCallback<T>>): ValueHandler<K, T>;
|
|
63
|
-
|
|
64
|
-
declare const iconFnRE: RegExp;
|
|
65
|
-
declare function hasIconFn(str: string): boolean;
|
|
66
|
-
|
|
67
|
-
declare function getBracket(str: string, open: string, close: string): string[] | undefined;
|
|
68
|
-
declare function getStringComponent(str: string, open: string, close: string, separators: string | string[]): string[] | undefined;
|
|
69
|
-
declare function getStringComponents(str: string, separators: string | string[], limit?: number, open?: string, close?: string): string[] | undefined;
|
|
70
|
-
|
|
71
|
-
declare function variantMatcher<T extends object = object>(name: string, handler: Arrayable<(input: VariantHandlerContext) => Record<string, any>>, options?: Omit<VariantObject<T>, 'match'>): VariantObject<T>;
|
|
72
|
-
declare function variantParentMatcher<T extends object = object>(name: string, parent: string): VariantObject<T>;
|
|
73
|
-
declare function variantGetBracket(prefix: string, matcher: string, separators: string[]): string[] | undefined;
|
|
74
|
-
declare function variantGetParameter(prefix: Arrayable<string>, matcher: string, separators: string[]): string[] | undefined;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Note: the order of following pseudo classes will affect the order of generated css.
|
|
78
|
-
*
|
|
79
|
-
* Reference: https://github.com/tailwindlabs/tailwindcss/blob/main/src/corePlugins.js#L83
|
|
80
|
-
*/
|
|
81
|
-
declare const PseudoClasses: Record<string, string>;
|
|
82
|
-
declare const PseudoClassesKeys: string[];
|
|
83
|
-
declare const PseudoClassesColon: Record<string, string>;
|
|
84
|
-
declare const PseudoClassesColonKeys: string[];
|
|
85
|
-
declare const PseudoClassFunctions: string[];
|
|
86
|
-
declare const PseudoClassesMulti: Record<string, string[]>;
|
|
87
|
-
declare const PseudoClassesStr: string;
|
|
88
|
-
declare const PseudoClassesColonStr: string;
|
|
89
|
-
declare const PseudoClassFunctionsStr: string;
|
|
90
|
-
declare const PseudoClassesMultiStr: string;
|
|
91
|
-
declare const excludedPseudo: string[];
|
|
92
|
-
declare const PseudoClassesAndElementsStr: string;
|
|
93
|
-
declare const PseudoClassesAndElementsColonStr: string;
|
|
94
|
-
interface PseudoVariantOptions {
|
|
95
|
-
/**
|
|
96
|
-
* Generate tagged pseudo selector as `[group=""]` instead of `.group`
|
|
97
|
-
*
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
attributifyPseudo?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Utils prefix
|
|
103
|
-
*/
|
|
104
|
-
prefix?: string | string[];
|
|
105
|
-
}
|
|
106
|
-
interface PseudoVariantUtilities<Theme extends object = object> {
|
|
107
|
-
getBracket: typeof getBracket;
|
|
108
|
-
h: {
|
|
109
|
-
bracket: (s: string, theme?: Theme) => string | undefined;
|
|
110
|
-
};
|
|
111
|
-
variantGetBracket: typeof variantGetBracket;
|
|
112
|
-
}
|
|
113
|
-
declare function createTaggedPseudoClassMatcher<T extends object = object>(tag: string, parent: string, combinator: string, utils: PseudoVariantUtilities): VariantObject<T>;
|
|
114
|
-
declare function createPseudoClassesAndElements<T extends object = object>(utils: PseudoVariantUtilities): VariantObject<T>[];
|
|
115
|
-
declare function createPseudoClassFunctions<T extends object = object>(utils: PseudoVariantUtilities): VariantObject<T>;
|
|
116
|
-
declare function createTaggedPseudoClasses<T extends object = object>(options: PseudoVariantOptions, utils: PseudoVariantUtilities): VariantObject<T>[];
|
|
117
|
-
declare function createPartClasses<T extends object = object>(): VariantObject<T>;
|
|
118
|
-
|
|
119
|
-
export { PseudoClassFunctions, PseudoClassFunctionsStr, PseudoClasses, PseudoClassesAndElementsColonStr, PseudoClassesAndElementsStr, PseudoClassesColon, PseudoClassesColonKeys, PseudoClassesColonStr, PseudoClassesKeys, PseudoClassesMulti, PseudoClassesMultiStr, PseudoClassesStr, alphaPlaceholders, alphaPlaceholdersRE, calcMaxWidthBySize, colorOpacityToString, colorToString, createPartClasses, createPseudoClassFunctions, createPseudoClassesAndElements, createTaggedPseudoClassMatcher, createTaggedPseudoClasses, createValueHandler, cssColorFunctions, excludedPseudo, getBracket, getStringComponent, getStringComponents, hasIconFn, hasThemeFn, hex2rgba, hueInterpolationMethods, iconFnRE, isInterpolatedMethod, parseCssColor, polarColorSpace, rectangularColorSpace, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
|
120
|
-
export type { CSSColorValue, ParsedColorValue, PseudoVariantOptions, PseudoVariantUtilities, RGBAColorValue, ValueHandler, ValueHandlerCallback };
|