@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.
@@ -1,3 +1,7 @@
1
- import type { MasterCSSManifest } from './manifest.js';
2
- export declare function normalizeMasterCSSManifestForJSON(manifest: MasterCSSManifest): MasterCSSManifest;
3
- export declare function stringifyMasterCSSManifestJSON(manifest: MasterCSSManifest): string;
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 };
@@ -1,210 +1,214 @@
1
- import type { PropertiesHyphen } from 'csstype';
2
- import type { UtilityType } from './utility-type.js';
3
- export type MasterCSSManifestAtIdentifier = 'container' | 'starting-style' | 'supports' | 'media' | 'layer';
4
- export type MasterCSSManifestUtilityLayerName = 'base' | 'defaults' | 'components' | 'utilities';
5
- export type MasterCSSManifestDefaultMode = 'light' | 'dark' | 'none' | string;
6
- export type MasterCSSManifestModeTrigger = 'class' | 'media' | 'host';
7
- export type MasterCSSManifestVariantToken = `:${string}` | `::${string}` | `@${string}`;
8
- export type MasterCSSManifestUtilityKind = 'number' | 'color' | 'image';
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
- export type MasterCSSManifestUtilityMatcherValueSegments = 'single' | 'multiple';
11
- export type MasterCSSManifestCSSDeclarationPrimitive = string | number | null;
12
- export type MasterCSSManifestCSSDeclarations = PropertiesHyphen | Record<string, MasterCSSManifestCSSDeclarationPrimitive | MasterCSSManifestCSSDeclarationPrimitive[]>;
13
- export type MasterCSSManifestVariableValue = number | string | false | (number | string)[];
14
- export type MasterCSSManifestVariableType = 'number' | 'string';
15
- export interface MasterCSSManifestVariableNumericValue {
16
- value: number;
17
- unit?: string;
18
- }
19
- export interface MasterCSSManifestAtRuleBooleanNode {
20
- raw?: string;
21
- name: string;
22
- type: 'boolean';
23
- }
24
- export interface MasterCSSManifestAtRuleNumberNode {
25
- raw?: string;
26
- name?: string;
27
- type: 'number';
28
- value: number;
29
- unit?: string;
30
- operator?: string;
31
- }
32
- export interface MasterCSSManifestAtRuleStringNode {
33
- raw?: string;
34
- name?: string;
35
- type: 'string';
36
- value: string;
37
- }
38
- export type MasterCSSManifestAtRuleValueNode = MasterCSSManifestAtRuleNumberNode | MasterCSSManifestAtRuleStringNode;
39
- export interface MasterCSSManifestAtRuleComparisonOperatorNode {
40
- type: 'comparison';
41
- raw?: string;
42
- value: string;
43
- }
44
- export interface MasterCSSManifestAtRuleLogicalOperatorNode {
45
- type: 'logical';
46
- raw?: string;
47
- value: string;
48
- }
49
- export type MasterCSSManifestAtRuleOperatorNode = MasterCSSManifestAtRuleComparisonOperatorNode | MasterCSSManifestAtRuleLogicalOperatorNode;
50
- export interface MasterCSSManifestAtRuleGroupNode {
51
- type?: 'group';
52
- raw?: string;
53
- children: MasterCSSManifestAtRuleNode[];
54
- }
55
- export type MasterCSSManifestAtRuleNode = MasterCSSManifestAtRuleBooleanNode | MasterCSSManifestAtRuleValueNode | MasterCSSManifestAtRuleComparisonOperatorNode | MasterCSSManifestAtRuleLogicalOperatorNode | MasterCSSManifestAtRuleGroupNode;
56
- export interface MasterCSSManifestAtRule {
57
- id: MasterCSSManifestAtIdentifier;
58
- nodes: MasterCSSManifestAtRuleNode[];
59
- }
60
- export type MasterCSSManifestAtRules = Record<string, MasterCSSManifestAtRule>;
61
- export interface MasterCSSManifestSelectorLiteralNode {
62
- type?: 'attribute' | 'pseudo-class' | 'pseudo-element' | 'class' | 'universal' | 'id';
63
- raw?: string;
64
- value?: string;
65
- children?: MasterCSSManifestSelectorNode[];
66
- }
67
- export interface MasterCSSManifestSelectorSeparatorNode {
68
- type: 'separator';
69
- raw?: string;
70
- value: string;
71
- }
72
- export interface MasterCSSManifestSelectorCombinatorNode {
73
- type: 'combinator';
74
- raw?: string;
75
- value: string;
76
- }
77
- export type MasterCSSManifestSelectorNode = MasterCSSManifestSelectorLiteralNode | MasterCSSManifestSelectorCombinatorNode | MasterCSSManifestSelectorSeparatorNode;
78
- export type MasterCSSManifestSelectors = Record<string, MasterCSSManifestSelectorNode[]>;
79
- export interface MasterCSSManifestSettings {
80
- rootSize?: number;
81
- baseUnit?: number;
82
- defaultMode?: MasterCSSManifestDefaultMode;
83
- scope?: string;
84
- important?: boolean;
85
- modeTrigger?: MasterCSSManifestModeTrigger;
86
- modes?: string[];
87
- }
88
- export interface MasterCSSManifestVariable {
89
- name?: string;
90
- key: string;
91
- namespace?: string;
92
- type?: MasterCSSManifestVariableType;
93
- value?: MasterCSSManifestVariableValue;
94
- numeric?: MasterCSSManifestVariableNumericValue;
95
- modes?: Record<string, {
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
- export type MasterCSSManifestKeyframes<TDeclarations = MasterCSSManifestCSSDeclarations> = Record<'from' | 'to' | string, TDeclarations>;
112
- export type MasterCSSManifestAnimations<TDeclarations = MasterCSSManifestCSSDeclarations> = Record<string, MasterCSSManifestKeyframes<TDeclarations>>;
113
- export type MasterCSSManifestAnimationOptions = Record<string, {
114
- static?: boolean;
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
- export interface MasterCSSManifestVariantBranch {
117
- selector?: string;
118
- selectorNodes?: MasterCSSManifestSelectorNode[];
119
- atRules?: string[];
120
- atRuleNodes?: MasterCSSManifestAtRule[];
121
- layer?: MasterCSSManifestUtilityLayerName;
122
- }
123
- export interface MasterCSSManifestVariant {
124
- token: MasterCSSManifestVariantToken;
125
- branches: MasterCSSManifestVariantBranch[];
126
- }
127
- export type MasterCSSManifestVariants = MasterCSSManifestVariant[];
128
- export type MasterCSSManifestUtilityMatcher = {
129
- type: 'static';
130
- name: string;
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
- type: 'pattern';
133
- prefix: string;
134
- values: string[];
134
+ type: 'pattern';
135
+ prefix: string;
136
+ values: string[];
135
137
  } | {
136
- type: 'key';
137
- keys: string[];
138
+ type: 'key';
139
+ keys: string[];
138
140
  } | {
139
- type: 'variable';
140
- keys: string[];
141
- segments?: MasterCSSManifestUtilityMatcherValueSegments;
141
+ type: 'variable';
142
+ keys: string[];
143
+ segments?: MasterCSSManifestUtilityMatcherValueSegments;
142
144
  } | {
143
- type: 'value';
144
- keys: string[];
145
- segments?: MasterCSSManifestUtilityMatcherValueSegments;
145
+ type: 'value';
146
+ keys: string[];
147
+ segments?: MasterCSSManifestUtilityMatcherValueSegments;
146
148
  };
147
- export type MasterCSSManifestVariableAlias = [key: string, name: string];
148
- export type MasterCSSManifestVariableAliasSet = MasterCSSManifestVariableAlias[];
149
- export type MasterCSSManifestUtilityEmit = {
150
- type: 'declarations';
151
- declarations: string[];
149
+ type MasterCSSManifestVariableAlias = [key: string, name: string];
150
+ type MasterCSSManifestVariableAliasSet = MasterCSSManifestVariableAlias[];
151
+ type MasterCSSManifestUtilityEmit = {
152
+ type: 'declarations';
153
+ declarations: string[];
152
154
  } | {
153
- type: 'template';
154
- declarations: MasterCSSManifestCSSDeclarations;
155
+ type: 'template';
156
+ declarations: MasterCSSManifestCSSDeclarations;
155
157
  } | {
156
- type: 'property';
157
- property: string;
158
+ type: 'property';
159
+ property: string;
158
160
  } | {
159
- type: 'static';
160
- rules: MasterCSSManifestUtilityRule[];
161
+ type: 'static';
162
+ rules: MasterCSSManifestUtilityRule[];
161
163
  };
162
- export interface MasterCSSManifestUtilityRule<TDeclarations = MasterCSSManifestCSSDeclarations> {
163
- declarations: TDeclarations;
164
- atRules?: string[];
165
- selector?: string;
166
- }
167
- export interface MasterCSSManifestUtility {
168
- id: string;
169
- name?: string;
170
- type: UtilityType;
171
- order?: number;
172
- layer?: MasterCSSManifestUtilityLayerName;
173
- key?: string;
174
- subkey?: string;
175
- keys?: string[];
176
- aliasGroups?: string[];
177
- kind?: MasterCSSManifestUtilityKind;
178
- namespaces?: string[];
179
- implicitNamespace?: boolean;
180
- separators?: string[];
181
- atRules?: string[];
182
- variableAliases?: MasterCSSManifestVariableAliasSet;
183
- variableAliasRefs?: string[];
184
- emit: MasterCSSManifestUtilityEmit;
185
- matchers: MasterCSSManifestUtilityMatcher[];
186
- debug?: Record<string, unknown>;
187
- }
188
- export type MasterCSSManifestUtilities = MasterCSSManifestUtility[];
189
- export interface MasterCSSManifest {
190
- /**
191
- * MasterCSSManifest IR schema/codec version.
192
- * This is not a legacy Config compatibility marker; engines must reject
193
- * unsupported manifest versions instead of migrating authoring APIs at runtime.
194
- */
195
- version: 1;
196
- settings?: MasterCSSManifestSettings;
197
- variables?: MasterCSSManifestVariables;
198
- animations?: MasterCSSManifestAnimations;
199
- animationOptions?: MasterCSSManifestAnimationOptions;
200
- variants?: MasterCSSManifestVariants;
201
- atRules?: MasterCSSManifestAtRules;
202
- breakpointAtRules?: MasterCSSManifestAtRules;
203
- containerAtRules?: MasterCSSManifestAtRules;
204
- selectors?: MasterCSSManifestSelectors;
205
- utilities?: MasterCSSManifestUtilities;
206
- debug?: Record<string, unknown>;
207
- }
208
- export declare function getMasterCSSManifestVariableName(namespace: string, variable: Pick<MasterCSSManifestVariable, 'key' | 'name'>): string;
209
- export declare function flattenMasterCSSManifestVariables(variables: MasterCSSManifestVariables | undefined): MasterCSSManifestVariableEntry[];
210
- export declare function groupMasterCSSManifestVariables(variables: readonly MasterCSSManifestVariable[] | undefined): MasterCSSManifestVariables | undefined;
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 };
@@ -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
- export declare function isNativeCSSShorthandProperty(property: string): boolean;
3
- export default nativeCSSShorthandProperties;
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 };
@@ -1 +1,4 @@
1
- export declare const MASTER_CSS_RUNTIME_STYLE_ID = "master-css";
1
+ //#region src/runtime-style.d.ts
2
+ declare const MASTER_CSS_RUNTIME_STYLE_ID = "master-css";
3
+ //#endregion
4
+ export { MASTER_CSS_RUNTIME_STYLE_ID };
@@ -0,0 +1,4 @@
1
+ //#region src/runtime-style.ts
2
+ const MASTER_CSS_RUNTIME_STYLE_ID = "master-css";
3
+ //#endregion
4
+ export { MASTER_CSS_RUNTIME_STYLE_ID };
@@ -1,19 +1,21 @@
1
- export declare const UtilityType: {
2
- /**
3
- * semantic utility classes
4
- * @example block, inline
5
- */
6
- readonly Semantic: -2;
7
- /**
8
- * shorthand
9
- * @example border, padding, margin
10
- */
11
- readonly Shorthand: -1;
12
- /**
13
- * normal
14
- * @example grid-cols
15
- */
16
- readonly Normal: 0;
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
- export type UtilityType = typeof UtilityType[keyof typeof UtilityType];
19
- export default UtilityType;
19
+ type UtilityType = typeof UtilityType[keyof typeof UtilityType];
20
+ //#endregion
21
+ export { UtilityType, UtilityType as default };