@master/css-schema 2.0.0-rc.73 → 2.0.0-rc.74
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/LICENSE +21 -0
- package/dist/css-common.d.ts +4 -1
- package/dist/css-common.js +1 -0
- package/dist/css-directives.d.ts +141 -137
- package/dist/css-directives.js +44 -0
- package/dist/css-syntax.d.ts +82 -79
- package/dist/css-syntax.js +1 -0
- package/dist/hydration-manifest.d.ts +32 -28
- package/dist/hydration-manifest.js +13 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +8 -0
- package/dist/manifest-json.d.ts +7 -3
- package/dist/manifest-json.js +53 -0
- package/dist/manifest.d.ts +201 -197
- package/dist/manifest.js +30 -0
- package/dist/native-css-shorthand.d.ts +4 -2
- package/dist/native-css-shorthand.js +86 -0
- package/dist/runtime-style.d.ts +4 -1
- package/dist/runtime-style.js +4 -0
- package/dist/utility-type.d.ts +20 -18
- package/dist/utility-type.js +20 -0
- package/package.json +99 -1
- package/dist/css-common.mjs +0 -1
- package/dist/css-directives.mjs +0 -51
- package/dist/css-syntax.mjs +0 -1
- package/dist/hydration-manifest.mjs +0 -12
- package/dist/index.mjs +0 -7
- package/dist/manifest-json.mjs +0 -62
- package/dist/manifest.mjs +0 -33
- package/dist/native-css-shorthand.mjs +0 -85
- package/dist/runtime-style.mjs +0 -3
- package/dist/utility-type.mjs +0 -16
package/dist/manifest-json.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { MasterCSSManifest } from "./manifest.js";
|
|
2
|
+
|
|
3
|
+
//#region src/manifest-json.d.ts
|
|
4
|
+
declare function normalizeMasterCSSManifestForJSON(manifest: MasterCSSManifest): MasterCSSManifest;
|
|
5
|
+
declare function stringifyMasterCSSManifestJSON(manifest: MasterCSSManifest): string;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { normalizeMasterCSSManifestForJSON, stringifyMasterCSSManifestJSON };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region src/manifest-json.ts
|
|
2
|
+
function getVariableName(namespace, variable) {
|
|
3
|
+
return variable.name || (namespace ? `${namespace}${variable.key ? "-" + variable.key : ""}` : variable.key);
|
|
4
|
+
}
|
|
5
|
+
function normalizeTemplateDeclarations(declarations) {
|
|
6
|
+
const normalized = {};
|
|
7
|
+
for (const propertyName in declarations) {
|
|
8
|
+
const value = declarations[propertyName];
|
|
9
|
+
normalized[propertyName] = Array.isArray(value) ? value.map((part) => part === void 0 ? null : part) : value === void 0 ? null : value;
|
|
10
|
+
}
|
|
11
|
+
return normalized;
|
|
12
|
+
}
|
|
13
|
+
function normalizeVariablesForJSON(variables) {
|
|
14
|
+
if (!variables) return;
|
|
15
|
+
const normalized = {};
|
|
16
|
+
for (const [namespace, definitions] of Object.entries(variables)) {
|
|
17
|
+
const nextDefinitions = definitions.map((definition) => {
|
|
18
|
+
const normalizedDefinition = { ...definition };
|
|
19
|
+
if (normalizedDefinition.namespace === namespace || !namespace) delete normalizedDefinition.namespace;
|
|
20
|
+
if (normalizedDefinition.name === getVariableName(namespace, normalizedDefinition)) delete normalizedDefinition.name;
|
|
21
|
+
if (normalizedDefinition.type === "string") delete normalizedDefinition.type;
|
|
22
|
+
return normalizedDefinition;
|
|
23
|
+
});
|
|
24
|
+
if (nextDefinitions.length) normalized[namespace] = nextDefinitions;
|
|
25
|
+
}
|
|
26
|
+
return Object.keys(normalized).length ? normalized : void 0;
|
|
27
|
+
}
|
|
28
|
+
function normalizeUtilityForJSON(utility) {
|
|
29
|
+
const normalized = { ...utility };
|
|
30
|
+
if (normalized.name === normalized.id) delete normalized.name;
|
|
31
|
+
if (normalized.layer === "utilities") delete normalized.layer;
|
|
32
|
+
delete normalized.order;
|
|
33
|
+
if (normalized.emit.type !== "template") return normalized;
|
|
34
|
+
return {
|
|
35
|
+
...normalized,
|
|
36
|
+
emit: {
|
|
37
|
+
...normalized.emit,
|
|
38
|
+
declarations: normalizeTemplateDeclarations(normalized.emit.declarations)
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function normalizeMasterCSSManifestForJSON(manifest) {
|
|
43
|
+
return {
|
|
44
|
+
...manifest,
|
|
45
|
+
...manifest.variables ? { variables: normalizeVariablesForJSON(manifest.variables) } : {},
|
|
46
|
+
...manifest.utilities?.length ? { utilities: manifest.utilities.map(normalizeUtilityForJSON) } : {}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function stringifyMasterCSSManifestJSON(manifest) {
|
|
50
|
+
return JSON.stringify(normalizeMasterCSSManifestForJSON(manifest));
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { normalizeMasterCSSManifestForJSON, stringifyMasterCSSManifestJSON };
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,210 +1,214 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { UtilityType } from "./utility-type.js";
|
|
2
|
+
import { PropertiesHyphen } from "csstype";
|
|
3
|
+
|
|
4
|
+
//#region src/manifest.d.ts
|
|
5
|
+
type MasterCSSManifestAtIdentifier = 'container' | 'starting-style' | 'supports' | 'media' | 'layer';
|
|
6
|
+
type MasterCSSManifestUtilityLayerName = 'base' | 'defaults' | 'components' | 'utilities';
|
|
7
|
+
type MasterCSSManifestDefaultMode = 'light' | 'dark' | 'none' | string;
|
|
8
|
+
type MasterCSSManifestModeTrigger = 'class' | 'media' | 'host';
|
|
9
|
+
type MasterCSSManifestVariantToken = `:${string}` | `::${string}` | `@${string}`;
|
|
10
|
+
type MasterCSSManifestUtilityKind = 'number' | 'color' | 'image';
|
|
9
11
|
/** Defaults to single for variable/value matchers; multiple is an explicit opt-in. */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
type: MasterCSSManifestVariableType;
|
|
97
|
-
value: number | string;
|
|
98
|
-
numeric?: MasterCSSManifestVariableNumericValue;
|
|
99
|
-
}>;
|
|
100
|
-
dependencies?: string[];
|
|
101
|
-
mode?: string;
|
|
102
|
-
inline?: boolean;
|
|
103
|
-
static?: boolean;
|
|
104
|
-
}
|
|
105
|
-
export type MasterCSSManifestVariables = Record<string, MasterCSSManifestVariable[]>;
|
|
106
|
-
export type MasterCSSManifestVariableEntry = MasterCSSManifestVariable & {
|
|
107
|
-
name: string;
|
|
108
|
-
namespace?: string;
|
|
12
|
+
type MasterCSSManifestUtilityMatcherValueSegments = 'single' | 'multiple';
|
|
13
|
+
type MasterCSSManifestCSSDeclarationPrimitive = string | number | null;
|
|
14
|
+
type MasterCSSManifestCSSDeclarations = PropertiesHyphen | Record<string, MasterCSSManifestCSSDeclarationPrimitive | MasterCSSManifestCSSDeclarationPrimitive[]>;
|
|
15
|
+
type MasterCSSManifestVariableValue = number | string | false | (number | string)[];
|
|
16
|
+
type MasterCSSManifestVariableType = 'number' | 'string';
|
|
17
|
+
interface MasterCSSManifestVariableNumericValue {
|
|
18
|
+
value: number;
|
|
19
|
+
unit?: string;
|
|
20
|
+
}
|
|
21
|
+
interface MasterCSSManifestAtRuleBooleanNode {
|
|
22
|
+
raw?: string;
|
|
23
|
+
name: string;
|
|
24
|
+
type: 'boolean';
|
|
25
|
+
}
|
|
26
|
+
interface MasterCSSManifestAtRuleNumberNode {
|
|
27
|
+
raw?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
type: 'number';
|
|
30
|
+
value: number;
|
|
31
|
+
unit?: string;
|
|
32
|
+
operator?: string;
|
|
33
|
+
}
|
|
34
|
+
interface MasterCSSManifestAtRuleStringNode {
|
|
35
|
+
raw?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
type: 'string';
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
40
|
+
type MasterCSSManifestAtRuleValueNode = MasterCSSManifestAtRuleNumberNode | MasterCSSManifestAtRuleStringNode;
|
|
41
|
+
interface MasterCSSManifestAtRuleComparisonOperatorNode {
|
|
42
|
+
type: 'comparison';
|
|
43
|
+
raw?: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}
|
|
46
|
+
interface MasterCSSManifestAtRuleLogicalOperatorNode {
|
|
47
|
+
type: 'logical';
|
|
48
|
+
raw?: string;
|
|
49
|
+
value: string;
|
|
50
|
+
}
|
|
51
|
+
type MasterCSSManifestAtRuleOperatorNode = MasterCSSManifestAtRuleComparisonOperatorNode | MasterCSSManifestAtRuleLogicalOperatorNode;
|
|
52
|
+
interface MasterCSSManifestAtRuleGroupNode {
|
|
53
|
+
type?: 'group';
|
|
54
|
+
raw?: string;
|
|
55
|
+
children: MasterCSSManifestAtRuleNode[];
|
|
56
|
+
}
|
|
57
|
+
type MasterCSSManifestAtRuleNode = MasterCSSManifestAtRuleBooleanNode | MasterCSSManifestAtRuleValueNode | MasterCSSManifestAtRuleComparisonOperatorNode | MasterCSSManifestAtRuleLogicalOperatorNode | MasterCSSManifestAtRuleGroupNode;
|
|
58
|
+
interface MasterCSSManifestAtRule {
|
|
59
|
+
id: MasterCSSManifestAtIdentifier;
|
|
60
|
+
nodes: MasterCSSManifestAtRuleNode[];
|
|
61
|
+
}
|
|
62
|
+
type MasterCSSManifestAtRules = Record<string, MasterCSSManifestAtRule>;
|
|
63
|
+
interface MasterCSSManifestSelectorLiteralNode {
|
|
64
|
+
type?: 'attribute' | 'pseudo-class' | 'pseudo-element' | 'class' | 'universal' | 'id';
|
|
65
|
+
raw?: string;
|
|
66
|
+
value?: string;
|
|
67
|
+
children?: MasterCSSManifestSelectorNode[];
|
|
68
|
+
}
|
|
69
|
+
interface MasterCSSManifestSelectorSeparatorNode {
|
|
70
|
+
type: 'separator';
|
|
71
|
+
raw?: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}
|
|
74
|
+
interface MasterCSSManifestSelectorCombinatorNode {
|
|
75
|
+
type: 'combinator';
|
|
76
|
+
raw?: string;
|
|
77
|
+
value: string;
|
|
78
|
+
}
|
|
79
|
+
type MasterCSSManifestSelectorNode = MasterCSSManifestSelectorLiteralNode | MasterCSSManifestSelectorCombinatorNode | MasterCSSManifestSelectorSeparatorNode;
|
|
80
|
+
type MasterCSSManifestSelectors = Record<string, MasterCSSManifestSelectorNode[]>;
|
|
81
|
+
interface MasterCSSManifestSettings {
|
|
82
|
+
rootSize?: number;
|
|
83
|
+
baseUnit?: number;
|
|
84
|
+
defaultMode?: MasterCSSManifestDefaultMode;
|
|
85
|
+
scope?: string;
|
|
86
|
+
important?: boolean;
|
|
87
|
+
modeTrigger?: MasterCSSManifestModeTrigger;
|
|
88
|
+
modes?: string[];
|
|
89
|
+
}
|
|
90
|
+
interface MasterCSSManifestVariable {
|
|
91
|
+
name?: string;
|
|
92
|
+
key: string;
|
|
93
|
+
namespace?: string;
|
|
94
|
+
type?: MasterCSSManifestVariableType;
|
|
95
|
+
value?: MasterCSSManifestVariableValue;
|
|
96
|
+
numeric?: MasterCSSManifestVariableNumericValue;
|
|
97
|
+
modes?: Record<string, {
|
|
109
98
|
type: MasterCSSManifestVariableType;
|
|
99
|
+
value: number | string;
|
|
100
|
+
numeric?: MasterCSSManifestVariableNumericValue;
|
|
101
|
+
}>;
|
|
102
|
+
dependencies?: string[];
|
|
103
|
+
mode?: string;
|
|
104
|
+
inline?: boolean;
|
|
105
|
+
static?: boolean;
|
|
106
|
+
}
|
|
107
|
+
type MasterCSSManifestVariables = Record<string, MasterCSSManifestVariable[]>;
|
|
108
|
+
type MasterCSSManifestVariableEntry = MasterCSSManifestVariable & {
|
|
109
|
+
name: string;
|
|
110
|
+
namespace?: string;
|
|
111
|
+
type: MasterCSSManifestVariableType;
|
|
110
112
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
type MasterCSSManifestKeyframes<TDeclarations = MasterCSSManifestCSSDeclarations> = Record<'from' | 'to' | string, TDeclarations>;
|
|
114
|
+
type MasterCSSManifestAnimations<TDeclarations = MasterCSSManifestCSSDeclarations> = Record<string, MasterCSSManifestKeyframes<TDeclarations>>;
|
|
115
|
+
type MasterCSSManifestAnimationOptions = Record<string, {
|
|
116
|
+
static?: boolean;
|
|
115
117
|
}>;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
interface MasterCSSManifestVariantBranch {
|
|
119
|
+
selector?: string;
|
|
120
|
+
selectorNodes?: MasterCSSManifestSelectorNode[];
|
|
121
|
+
atRules?: string[];
|
|
122
|
+
atRuleNodes?: MasterCSSManifestAtRule[];
|
|
123
|
+
layer?: MasterCSSManifestUtilityLayerName;
|
|
124
|
+
}
|
|
125
|
+
interface MasterCSSManifestVariant {
|
|
126
|
+
token: MasterCSSManifestVariantToken;
|
|
127
|
+
branches: MasterCSSManifestVariantBranch[];
|
|
128
|
+
}
|
|
129
|
+
type MasterCSSManifestVariants = MasterCSSManifestVariant[];
|
|
130
|
+
type MasterCSSManifestUtilityMatcher = {
|
|
131
|
+
type: 'static';
|
|
132
|
+
name: string;
|
|
131
133
|
} | {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
type: 'pattern';
|
|
135
|
+
prefix: string;
|
|
136
|
+
values: string[];
|
|
135
137
|
} | {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
type: 'key';
|
|
139
|
+
keys: string[];
|
|
138
140
|
} | {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
type: 'variable';
|
|
142
|
+
keys: string[];
|
|
143
|
+
segments?: MasterCSSManifestUtilityMatcherValueSegments;
|
|
142
144
|
} | {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
type: 'value';
|
|
146
|
+
keys: string[];
|
|
147
|
+
segments?: MasterCSSManifestUtilityMatcherValueSegments;
|
|
146
148
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
type MasterCSSManifestVariableAlias = [key: string, name: string];
|
|
150
|
+
type MasterCSSManifestVariableAliasSet = MasterCSSManifestVariableAlias[];
|
|
151
|
+
type MasterCSSManifestUtilityEmit = {
|
|
152
|
+
type: 'declarations';
|
|
153
|
+
declarations: string[];
|
|
152
154
|
} | {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
type: 'template';
|
|
156
|
+
declarations: MasterCSSManifestCSSDeclarations;
|
|
155
157
|
} | {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
type: 'property';
|
|
159
|
+
property: string;
|
|
158
160
|
} | {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
type: 'static';
|
|
162
|
+
rules: MasterCSSManifestUtilityRule[];
|
|
161
163
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
164
|
+
interface MasterCSSManifestUtilityRule<TDeclarations = MasterCSSManifestCSSDeclarations> {
|
|
165
|
+
declarations: TDeclarations;
|
|
166
|
+
atRules?: string[];
|
|
167
|
+
selector?: string;
|
|
168
|
+
}
|
|
169
|
+
interface MasterCSSManifestUtility {
|
|
170
|
+
id: string;
|
|
171
|
+
name?: string;
|
|
172
|
+
type: UtilityType;
|
|
173
|
+
order?: number;
|
|
174
|
+
layer?: MasterCSSManifestUtilityLayerName;
|
|
175
|
+
key?: string;
|
|
176
|
+
subkey?: string;
|
|
177
|
+
keys?: string[];
|
|
178
|
+
aliasGroups?: string[];
|
|
179
|
+
kind?: MasterCSSManifestUtilityKind;
|
|
180
|
+
namespaces?: string[];
|
|
181
|
+
implicitNamespace?: boolean;
|
|
182
|
+
separators?: string[];
|
|
183
|
+
atRules?: string[];
|
|
184
|
+
variableAliases?: MasterCSSManifestVariableAliasSet;
|
|
185
|
+
variableAliasRefs?: string[];
|
|
186
|
+
emit: MasterCSSManifestUtilityEmit;
|
|
187
|
+
matchers: MasterCSSManifestUtilityMatcher[];
|
|
188
|
+
debug?: Record<string, unknown>;
|
|
189
|
+
}
|
|
190
|
+
type MasterCSSManifestUtilities = MasterCSSManifestUtility[];
|
|
191
|
+
interface MasterCSSManifest {
|
|
192
|
+
/**
|
|
193
|
+
* MasterCSSManifest IR schema/codec version.
|
|
194
|
+
* This is not a legacy Config compatibility marker; engines must reject
|
|
195
|
+
* unsupported manifest versions instead of migrating authoring APIs at runtime.
|
|
196
|
+
*/
|
|
197
|
+
version: 1;
|
|
198
|
+
settings?: MasterCSSManifestSettings;
|
|
199
|
+
variables?: MasterCSSManifestVariables;
|
|
200
|
+
animations?: MasterCSSManifestAnimations;
|
|
201
|
+
animationOptions?: MasterCSSManifestAnimationOptions;
|
|
202
|
+
variants?: MasterCSSManifestVariants;
|
|
203
|
+
atRules?: MasterCSSManifestAtRules;
|
|
204
|
+
breakpointAtRules?: MasterCSSManifestAtRules;
|
|
205
|
+
containerAtRules?: MasterCSSManifestAtRules;
|
|
206
|
+
selectors?: MasterCSSManifestSelectors;
|
|
207
|
+
utilities?: MasterCSSManifestUtilities;
|
|
208
|
+
debug?: Record<string, unknown>;
|
|
209
|
+
}
|
|
210
|
+
declare function getMasterCSSManifestVariableName(namespace: string, variable: Pick<MasterCSSManifestVariable, 'key' | 'name'>): string;
|
|
211
|
+
declare function flattenMasterCSSManifestVariables(variables: MasterCSSManifestVariables | undefined): MasterCSSManifestVariableEntry[];
|
|
212
|
+
declare function groupMasterCSSManifestVariables(variables: readonly MasterCSSManifestVariable[] | undefined): MasterCSSManifestVariables | undefined;
|
|
213
|
+
//#endregion
|
|
214
|
+
export { MasterCSSManifest, MasterCSSManifestAnimationOptions, MasterCSSManifestAnimations, MasterCSSManifestAtIdentifier, MasterCSSManifestAtRule, MasterCSSManifestAtRuleBooleanNode, MasterCSSManifestAtRuleComparisonOperatorNode, MasterCSSManifestAtRuleGroupNode, MasterCSSManifestAtRuleLogicalOperatorNode, MasterCSSManifestAtRuleNode, MasterCSSManifestAtRuleNumberNode, MasterCSSManifestAtRuleOperatorNode, MasterCSSManifestAtRuleStringNode, MasterCSSManifestAtRuleValueNode, MasterCSSManifestAtRules, MasterCSSManifestCSSDeclarationPrimitive, MasterCSSManifestCSSDeclarations, MasterCSSManifestDefaultMode, MasterCSSManifestKeyframes, MasterCSSManifestModeTrigger, MasterCSSManifestSelectorCombinatorNode, MasterCSSManifestSelectorLiteralNode, MasterCSSManifestSelectorNode, MasterCSSManifestSelectorSeparatorNode, MasterCSSManifestSelectors, MasterCSSManifestSettings, MasterCSSManifestUtilities, MasterCSSManifestUtility, MasterCSSManifestUtilityEmit, MasterCSSManifestUtilityKind, MasterCSSManifestUtilityLayerName, MasterCSSManifestUtilityMatcher, MasterCSSManifestUtilityMatcherValueSegments, MasterCSSManifestUtilityRule, MasterCSSManifestVariable, MasterCSSManifestVariableAlias, MasterCSSManifestVariableAliasSet, MasterCSSManifestVariableEntry, MasterCSSManifestVariableNumericValue, MasterCSSManifestVariableType, MasterCSSManifestVariableValue, MasterCSSManifestVariables, MasterCSSManifestVariant, MasterCSSManifestVariantBranch, MasterCSSManifestVariantToken, MasterCSSManifestVariants, flattenMasterCSSManifestVariables, getMasterCSSManifestVariableName, groupMasterCSSManifestVariables };
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/manifest.ts
|
|
2
|
+
function getMasterCSSManifestVariableName(namespace, variable) {
|
|
3
|
+
return variable.name || (namespace ? `${namespace}${variable.key ? "-" + variable.key : ""}` : variable.key);
|
|
4
|
+
}
|
|
5
|
+
function flattenMasterCSSManifestVariables(variables) {
|
|
6
|
+
const flattened = [];
|
|
7
|
+
for (const [namespace, definitions] of Object.entries(variables || {})) for (const definition of definitions) {
|
|
8
|
+
const type = definition.type || (typeof definition.value === "number" ? "number" : "string");
|
|
9
|
+
flattened.push({
|
|
10
|
+
...definition,
|
|
11
|
+
name: getMasterCSSManifestVariableName(namespace, definition),
|
|
12
|
+
...namespace ? { namespace } : {},
|
|
13
|
+
type
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return flattened;
|
|
17
|
+
}
|
|
18
|
+
function groupMasterCSSManifestVariables(variables) {
|
|
19
|
+
if (!variables?.length) return;
|
|
20
|
+
const grouped = {};
|
|
21
|
+
for (const variable of variables) {
|
|
22
|
+
const namespace = variable.namespace || "";
|
|
23
|
+
const group = grouped[namespace] ||= [];
|
|
24
|
+
const { namespace: _namespace, ...definition } = variable;
|
|
25
|
+
group.push(definition);
|
|
26
|
+
}
|
|
27
|
+
return Object.keys(grouped).length ? grouped : void 0;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { flattenMasterCSSManifestVariables, getMasterCSSManifestVariableName, groupMasterCSSManifestVariables };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
//#region src/native-css-shorthand.d.ts
|
|
1
2
|
declare const nativeCSSShorthandProperties: Set<string>;
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
declare function isNativeCSSShorthandProperty(property: string): boolean;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { nativeCSSShorthandProperties as default, isNativeCSSShorthandProperty };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/native-css-shorthand.ts
|
|
2
|
+
const nativeCSSShorthandProperties = /* @__PURE__ */ new Set([
|
|
3
|
+
"all",
|
|
4
|
+
"animation",
|
|
5
|
+
"animation-range",
|
|
6
|
+
"background",
|
|
7
|
+
"background-position",
|
|
8
|
+
"background-repeat",
|
|
9
|
+
"border",
|
|
10
|
+
"border-block",
|
|
11
|
+
"border-block-color",
|
|
12
|
+
"border-block-end",
|
|
13
|
+
"border-block-start",
|
|
14
|
+
"border-block-style",
|
|
15
|
+
"border-block-width",
|
|
16
|
+
"border-bottom",
|
|
17
|
+
"border-color",
|
|
18
|
+
"border-image",
|
|
19
|
+
"border-inline",
|
|
20
|
+
"border-inline-color",
|
|
21
|
+
"border-inline-end",
|
|
22
|
+
"border-inline-start",
|
|
23
|
+
"border-inline-style",
|
|
24
|
+
"border-inline-width",
|
|
25
|
+
"border-left",
|
|
26
|
+
"border-radius",
|
|
27
|
+
"border-right",
|
|
28
|
+
"border-style",
|
|
29
|
+
"border-top",
|
|
30
|
+
"border-width",
|
|
31
|
+
"column-rule",
|
|
32
|
+
"columns",
|
|
33
|
+
"contain-intrinsic-size",
|
|
34
|
+
"container",
|
|
35
|
+
"flex",
|
|
36
|
+
"flex-flow",
|
|
37
|
+
"font",
|
|
38
|
+
"font-synthesis",
|
|
39
|
+
"font-variant",
|
|
40
|
+
"gap",
|
|
41
|
+
"grid",
|
|
42
|
+
"grid-area",
|
|
43
|
+
"grid-column",
|
|
44
|
+
"grid-row",
|
|
45
|
+
"grid-template",
|
|
46
|
+
"inset",
|
|
47
|
+
"inset-block",
|
|
48
|
+
"inset-inline",
|
|
49
|
+
"line-clamp",
|
|
50
|
+
"list-style",
|
|
51
|
+
"margin",
|
|
52
|
+
"margin-block",
|
|
53
|
+
"margin-inline",
|
|
54
|
+
"mask",
|
|
55
|
+
"mask-border",
|
|
56
|
+
"mask-position",
|
|
57
|
+
"mask-repeat",
|
|
58
|
+
"offset",
|
|
59
|
+
"outline",
|
|
60
|
+
"overflow",
|
|
61
|
+
"overscroll-behavior",
|
|
62
|
+
"padding",
|
|
63
|
+
"padding-block",
|
|
64
|
+
"padding-inline",
|
|
65
|
+
"place-content",
|
|
66
|
+
"place-items",
|
|
67
|
+
"place-self",
|
|
68
|
+
"scroll-margin",
|
|
69
|
+
"scroll-margin-block",
|
|
70
|
+
"scroll-margin-inline",
|
|
71
|
+
"scroll-padding",
|
|
72
|
+
"scroll-padding-block",
|
|
73
|
+
"scroll-padding-inline",
|
|
74
|
+
"scroll-timeline",
|
|
75
|
+
"text-decoration",
|
|
76
|
+
"text-emphasis",
|
|
77
|
+
"text-wrap",
|
|
78
|
+
"transition",
|
|
79
|
+
"view-timeline",
|
|
80
|
+
"white-space"
|
|
81
|
+
]);
|
|
82
|
+
function isNativeCSSShorthandProperty(property) {
|
|
83
|
+
return nativeCSSShorthandProperties.has(property);
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { nativeCSSShorthandProperties as default, isNativeCSSShorthandProperty };
|
package/dist/runtime-style.d.ts
CHANGED
package/dist/utility-type.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
//#region src/utility-type.d.ts
|
|
2
|
+
declare const UtilityType: {
|
|
3
|
+
/**
|
|
4
|
+
* semantic utility classes
|
|
5
|
+
* @example block, inline
|
|
6
|
+
*/
|
|
7
|
+
readonly Semantic: -2;
|
|
8
|
+
/**
|
|
9
|
+
* shorthand
|
|
10
|
+
* @example border, padding, margin
|
|
11
|
+
*/
|
|
12
|
+
readonly Shorthand: -1;
|
|
13
|
+
/**
|
|
14
|
+
* normal
|
|
15
|
+
* @example grid-cols
|
|
16
|
+
*/
|
|
17
|
+
readonly Normal: 0;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type UtilityType = typeof UtilityType[keyof typeof UtilityType];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { UtilityType, UtilityType as default };
|