@master/css 2.0.0-rc.4 → 2.0.0-rc.40
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/README.md +4 -43
- package/dist/_virtual/_commonjsHelpers.cjs +5 -0
- package/dist/_virtual/_commonjsHelpers.mjs +3 -0
- package/dist/_virtual/css-escape.cjs +5 -0
- package/dist/_virtual/css-escape.mjs +3 -0
- package/dist/bin/index.cjs +11 -0
- package/dist/bin/index.d.ts +0 -1
- package/dist/bin/index.mjs +9 -0
- package/dist/common.cjs +159 -0
- package/dist/common.d.ts +26 -0
- package/dist/common.mjs +137 -0
- package/dist/config/animations.cjs +113 -0
- package/dist/config/animations.mjs +111 -0
- package/dist/config/at.cjs +14 -0
- package/dist/config/at.d.ts +11 -0
- package/dist/config/at.mjs +12 -0
- package/dist/config/functions.cjs +351 -0
- package/dist/config/functions.mjs +349 -0
- package/dist/config/index.cjs +36 -0
- package/dist/config/index.d.ts +17 -14
- package/dist/config/index.mjs +26 -0
- package/dist/config/modes.cjs +8 -0
- package/dist/config/modes.d.ts +3 -0
- package/dist/config/modes.mjs +6 -0
- package/dist/config/rules.cjs +2283 -0
- package/dist/config/rules.d.ts +9 -6
- package/dist/config/rules.mjs +2281 -0
- package/dist/config/selectors.cjs +28 -0
- package/dist/config/selectors.d.ts +0 -1
- package/dist/config/selectors.mjs +26 -0
- package/dist/config/styles.cjs +2 -0
- package/dist/config/styles.mjs +1 -0
- package/dist/config/utilities.cjs +203 -0
- package/dist/config/{semantics.d.ts → utilities.d.ts} +14 -5
- package/dist/config/utilities.mjs +201 -0
- package/dist/config/variables.cjs +127 -0
- package/dist/config/variables.d.ts +132 -177
- package/dist/config/variables.mjs +125 -0
- package/dist/core.cjs +1040 -0
- package/dist/core.d.ts +37 -33
- package/dist/core.mjs +1035 -0
- package/dist/index.cjs +73 -0
- package/dist/index.d.ts +15 -8
- package/dist/index.mjs +22 -0
- package/dist/layer.cjs +28 -0
- package/dist/layer.d.ts +26 -9
- package/dist/layer.mjs +26 -0
- package/dist/polyfills/css-escape.cjs +8 -0
- package/dist/polyfills/css-escape.mjs +2 -0
- package/dist/polyfills/css-escape2.cjs +68 -0
- package/dist/polyfills/css-escape2.mjs +64 -0
- package/dist/rule.cjs +722 -0
- package/dist/rule.d.ts +60 -22
- package/dist/rule.mjs +720 -0
- package/dist/shared/utils/css-escape.cjs +56 -0
- package/dist/shared/utils/css-escape.mjs +54 -0
- package/dist/types/global.cjs +2 -0
- package/dist/types/global.d.ts +3 -3
- package/dist/types/global.mjs +1 -0
- package/dist/utils/are-rule-at-equal.cjs +22 -0
- package/dist/utils/are-rule-at-equal.d.ts +2 -0
- package/dist/utils/are-rule-at-equal.mjs +20 -0
- package/dist/utils/are-rule-modes-equal.cjs +7 -0
- package/dist/utils/are-rule-modes-equal.d.ts +2 -0
- package/dist/utils/are-rule-modes-equal.mjs +5 -0
- package/dist/utils/are-rule-selectors-equal.cjs +29 -0
- package/dist/utils/are-rule-selectors-equal.d.ts +2 -0
- package/dist/utils/are-rule-selectors-equal.mjs +27 -0
- package/dist/utils/are-rule-states-equal.cjs +11 -0
- package/dist/utils/are-rule-states-equal.d.ts +2 -0
- package/dist/utils/are-rule-states-equal.mjs +9 -0
- package/dist/utils/are-rules-duplicated.cjs +17 -0
- package/dist/utils/are-rules-duplicated.d.ts +2 -0
- package/dist/utils/are-rules-duplicated.mjs +15 -0
- package/dist/utils/autofill-solid-style.cjs +31 -0
- package/dist/utils/autofill-solid-style.d.ts +3 -0
- package/dist/utils/autofill-solid-style.mjs +29 -0
- package/dist/utils/extend-config.cjs +73 -0
- package/dist/utils/extend-config.d.ts +1 -1
- package/dist/utils/extend-config.mjs +71 -0
- package/dist/utils/flatten-object.cjs +15 -0
- package/dist/utils/flatten-object.mjs +13 -0
- package/dist/utils/generate-css.cjs +13 -0
- package/dist/utils/generate-css.d.ts +2 -0
- package/dist/utils/generate-css.mjs +11 -0
- package/dist/utils/hex-to-rgb.cjs +30 -0
- package/dist/utils/hex-to-rgb.d.ts +1 -1
- package/dist/utils/hex-to-rgb.mjs +28 -0
- package/dist/utils/is-core-rule.cjs +9 -0
- package/dist/utils/is-core-rule.d.ts +1 -0
- package/dist/utils/is-core-rule.mjs +7 -0
- package/dist/utils/reorder-for-readable-classes.cjs +62 -0
- package/dist/{functions → utils}/reorder-for-readable-classes.d.ts +2 -6
- package/dist/utils/reorder-for-readable-classes.mjs +60 -0
- package/package.json +1 -1
- package/dist/bin/index.bundle.js +0 -36
- package/dist/config/media-queries.d.ts +0 -1
- package/dist/constants/base-unit-regex.d.ts +0 -1
- package/dist/constants/config-esm-text.d.ts +0 -1
- package/dist/constants/config-text.d.ts +0 -1
- package/dist/constants/config-ts-text.d.ts +0 -1
- package/dist/constants/start-symbol.d.ts +0 -6
- package/dist/functions/transform-color-with-opacity.d.ts +0 -1
- package/dist/index.bundle.js +0 -35
- package/dist/index.bundle.mjs +0 -35
- package/dist/tokens/screen-sizes.d.ts +0 -14
- package/dist/utils/concat-arrays.d.ts +0 -1
- package/dist/utils/get-type.d.ts +0 -7
- package/dist/utils/is-plain-object.d.ts +0 -8
- package/dist/utils/is-symbol.d.ts +0 -7
- package/dist/utils/rgb-to-hex.d.ts +0 -1
package/dist/rule.d.ts
CHANGED
|
@@ -1,41 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { PropertiesHyphen } from 'csstype';
|
|
1
|
+
import MasterCSS, { type Variable } from './core';
|
|
2
|
+
import Layer from './layer';
|
|
3
|
+
import { type PropertiesHyphen } from 'csstype';
|
|
4
4
|
export declare class Rule {
|
|
5
5
|
readonly className: string;
|
|
6
|
+
readonly RegisteredRule: RegisteredRule;
|
|
6
7
|
css: MasterCSS;
|
|
7
|
-
readonly at: Record<string,
|
|
8
|
+
readonly at: Record<string, AtComponent[]>;
|
|
8
9
|
readonly priority: number;
|
|
9
10
|
readonly natives: NativeRule[];
|
|
10
11
|
readonly order: number;
|
|
11
12
|
readonly layer: Layer;
|
|
12
|
-
readonly stateToken: string;
|
|
13
13
|
readonly declarations?: PropertiesHyphen;
|
|
14
14
|
animationNames?: string[];
|
|
15
15
|
variableNames?: string[];
|
|
16
16
|
constructor(className: string, RegisteredRule: RegisteredRule, css: MasterCSS);
|
|
17
|
+
resolveAtComponent(atComponent: AtComponent): string;
|
|
17
18
|
resolveValue: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[], bypassParsing: boolean) => string;
|
|
18
19
|
get text(): string;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
parseValues: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol: string, parentFunctionName?: string, bypassParsing?: boolean, bypassVariableNames?: string[]) => number;
|
|
21
|
+
parseValue(token: string | number, unit?: any): {
|
|
22
|
+
value: string;
|
|
23
|
+
type: 'string';
|
|
24
|
+
} | {
|
|
25
|
+
value: number;
|
|
26
|
+
unit: string;
|
|
27
|
+
type: 'number';
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export type AtComponent = AtArbitraryComponent | AtFeatureComponent | AtOperatorComponent;
|
|
31
|
+
export interface AtArbitraryComponent {
|
|
32
|
+
type: 'arbitrary';
|
|
33
|
+
token?: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AtFeatureComponent {
|
|
37
|
+
type: 'feature';
|
|
38
|
+
token?: string;
|
|
39
|
+
name: string;
|
|
40
|
+
valueType: 'number' | 'string';
|
|
41
|
+
value: string | number;
|
|
42
|
+
unit?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface AtOperatorComponent {
|
|
45
|
+
type: 'operator';
|
|
46
|
+
token: '&';
|
|
47
|
+
value: 'and';
|
|
21
48
|
}
|
|
22
49
|
export type ValueComponent = StringValueComponent | NumericValueComponent | FunctionValueComponent | VariableValueComponent | SeparatorValueComponent;
|
|
23
50
|
export interface StringValueComponent {
|
|
24
51
|
text?: string;
|
|
25
|
-
token
|
|
52
|
+
token: string;
|
|
26
53
|
type: 'string';
|
|
27
54
|
value: string;
|
|
28
55
|
}
|
|
29
56
|
export interface NumericValueComponent {
|
|
30
57
|
text?: string;
|
|
31
|
-
token
|
|
58
|
+
token: string;
|
|
32
59
|
type: 'number';
|
|
33
60
|
value: number;
|
|
34
61
|
unit?: string;
|
|
35
62
|
}
|
|
36
63
|
export interface FunctionValueComponent {
|
|
37
64
|
text?: string;
|
|
38
|
-
token
|
|
65
|
+
token: string;
|
|
39
66
|
type: 'function';
|
|
40
67
|
name: string;
|
|
41
68
|
symbol: string;
|
|
@@ -44,7 +71,7 @@ export interface FunctionValueComponent {
|
|
|
44
71
|
}
|
|
45
72
|
export interface VariableValueComponent {
|
|
46
73
|
text?: string;
|
|
47
|
-
token
|
|
74
|
+
token: string;
|
|
48
75
|
type: 'variable';
|
|
49
76
|
name: string;
|
|
50
77
|
alpha?: string;
|
|
@@ -53,41 +80,52 @@ export interface VariableValueComponent {
|
|
|
53
80
|
}
|
|
54
81
|
export interface SeparatorValueComponent {
|
|
55
82
|
text?: string;
|
|
83
|
+
token: string;
|
|
56
84
|
type: 'separator';
|
|
57
85
|
value: string;
|
|
58
86
|
}
|
|
59
87
|
export interface Rule extends RegisteredRule {
|
|
60
|
-
colored: boolean;
|
|
61
|
-
prefix: string;
|
|
62
88
|
token: string;
|
|
63
89
|
vendorPrefixSelectors: Record<string, string[]>;
|
|
64
90
|
vendorSuffixSelectors: Record<string, string[]>;
|
|
65
91
|
important: boolean;
|
|
66
|
-
media: MediaQuery;
|
|
67
92
|
direction: string;
|
|
68
|
-
|
|
93
|
+
mode: string;
|
|
69
94
|
unitToken: string;
|
|
95
|
+
keyToken: string;
|
|
96
|
+
valueToken: string;
|
|
97
|
+
stateToken: string;
|
|
98
|
+
atToken: string;
|
|
70
99
|
hasWhere: boolean;
|
|
71
100
|
valueComponents: Array<ValueComponent>;
|
|
72
101
|
}
|
|
73
102
|
export interface RegisteredRule {
|
|
74
103
|
id: string;
|
|
75
|
-
|
|
76
|
-
|
|
104
|
+
key?: string;
|
|
105
|
+
keys: string[];
|
|
106
|
+
matchers: {
|
|
107
|
+
key?: RegExp;
|
|
108
|
+
variable?: RegExp;
|
|
109
|
+
value?: RegExp;
|
|
110
|
+
arbitrary?: RegExp;
|
|
111
|
+
};
|
|
112
|
+
variables: Record<string, Variable>;
|
|
77
113
|
order: number;
|
|
78
114
|
definition: RuleDefinition;
|
|
79
115
|
}
|
|
80
116
|
export interface RuleDefinition {
|
|
81
117
|
layer?: Layer;
|
|
82
|
-
|
|
118
|
+
matcher?: RegExp;
|
|
119
|
+
sign?: string;
|
|
120
|
+
key?: string;
|
|
121
|
+
subkey?: string;
|
|
122
|
+
ambiguousKeys?: string[];
|
|
123
|
+
ambiguousValues?: (RegExp | string)[];
|
|
83
124
|
variables?: string[];
|
|
84
125
|
separators?: string[];
|
|
85
|
-
shorthand?: string;
|
|
86
|
-
colored?: boolean;
|
|
87
|
-
numeric?: boolean;
|
|
88
126
|
unit?: any;
|
|
89
|
-
native?: boolean;
|
|
90
127
|
declarations?: PropertiesHyphen;
|
|
128
|
+
includeAnimations?: boolean;
|
|
91
129
|
analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string];
|
|
92
130
|
transformValue?(this: Rule, value: string): string;
|
|
93
131
|
transformValueComponents?(this: Rule, valueComponents: ValueComponent[]): ValueComponent[];
|