@master/css-schema 2.0.0-rc.73 → 2.0.0-rc.75

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 ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Aoyue Design LLC.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1 +1,4 @@
1
- export type Vendors = 'webkit' | 'moz' | 'ms' | 'o';
1
+ //#region src/css-common.d.ts
2
+ type Vendors = 'webkit' | 'moz' | 'ms' | 'o';
3
+ //#endregion
4
+ export { Vendors };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,138 +1,142 @@
1
- import type { MasterCSSManifestDefaultMode, MasterCSSManifestUtilityKind, MasterCSSManifestModeTrigger, MasterCSSManifestUtilityLayerName, MasterCSSManifestVariant } from './manifest.js';
2
- export type CSSDirectiveVariableValue = number | string | false | (number | string)[];
3
- export type CSSDirectiveDeclarations = Record<string, string>;
4
- export type CSSDirectiveLayerName = MasterCSSManifestUtilityLayerName;
5
- export type CSSDirectiveModeTrigger = MasterCSSManifestModeTrigger;
6
- export type CSSDirectiveDefaultMode = MasterCSSManifestDefaultMode;
7
- export type CSSDirectiveVariantDefinitions = Pick<MasterCSSManifestVariant, 'token' | 'branches'>[];
8
- export interface CSSDirectiveSourceRange {
9
- start: number;
10
- end: number;
11
- }
12
- export interface CSSDirectiveSourceLocation {
13
- line: number;
14
- column: number;
15
- }
16
- export interface CSSDirectiveSourceReference {
17
- file?: string;
18
- range: CSSDirectiveSourceRange;
19
- loc?: {
20
- start: CSSDirectiveSourceLocation;
21
- end: CSSDirectiveSourceLocation;
22
- };
23
- }
24
- export interface CSSDirectiveRelatedInformation {
25
- message: string;
26
- source?: CSSDirectiveSourceReference;
27
- }
28
- export declare class CSSDirectiveError extends Error {
29
- code: string;
30
- source?: CSSDirectiveSourceReference;
31
- related?: CSSDirectiveRelatedInformation[];
32
- constructor(code: string, message: string, source?: CSSDirectiveSourceReference, related?: CSSDirectiveRelatedInformation[]);
33
- }
34
- export declare function createCSSDirectiveSourceReference(file: string | undefined, range: CSSDirectiveSourceRange, source?: string): CSSDirectiveSourceReference;
35
- export interface CSSDirectiveVariableDefinition {
36
- name?: string;
37
- value: CSSDirectiveVariableValue;
38
- mode?: string;
39
- inline?: boolean;
40
- static?: boolean;
41
- namespace?: string;
42
- key?: string;
43
- }
44
- export type CSSDirectiveAnimationDefinitions = Record<string, Record<string, CSSDirectiveDeclarations>>;
45
- export type CSSDirectiveAnimationOptions = Record<string, {
46
- static?: boolean;
1
+ import { MasterCSSManifestDefaultMode, MasterCSSManifestModeTrigger, MasterCSSManifestUtilityKind, MasterCSSManifestUtilityLayerName, MasterCSSManifestVariant } from "./manifest.js";
2
+
3
+ //#region src/css-directives.d.ts
4
+ type CSSDirectiveVariableValue = number | string | false | (number | string)[];
5
+ type CSSDirectiveDeclarations = Record<string, string>;
6
+ type CSSDirectiveLayerName = MasterCSSManifestUtilityLayerName;
7
+ type CSSDirectiveModeTrigger = MasterCSSManifestModeTrigger;
8
+ type CSSDirectiveDefaultMode = MasterCSSManifestDefaultMode;
9
+ type CSSDirectiveVariantDefinitions = Pick<MasterCSSManifestVariant, 'token' | 'branches'>[];
10
+ interface CSSDirectiveSourceRange {
11
+ start: number;
12
+ end: number;
13
+ }
14
+ interface CSSDirectiveSourceLocation {
15
+ line: number;
16
+ column: number;
17
+ }
18
+ interface CSSDirectiveSourceReference {
19
+ file?: string;
20
+ range: CSSDirectiveSourceRange;
21
+ loc?: {
22
+ start: CSSDirectiveSourceLocation;
23
+ end: CSSDirectiveSourceLocation;
24
+ };
25
+ }
26
+ interface CSSDirectiveRelatedInformation {
27
+ message: string;
28
+ source?: CSSDirectiveSourceReference;
29
+ }
30
+ declare class CSSDirectiveError extends Error {
31
+ code: string;
32
+ source?: CSSDirectiveSourceReference;
33
+ related?: CSSDirectiveRelatedInformation[];
34
+ constructor(code: string, message: string, source?: CSSDirectiveSourceReference, related?: CSSDirectiveRelatedInformation[]);
35
+ }
36
+ declare function createCSSDirectiveSourceReference(file: string | undefined, range: CSSDirectiveSourceRange, source?: string): CSSDirectiveSourceReference;
37
+ interface CSSDirectiveVariableDefinition {
38
+ name?: string;
39
+ value: CSSDirectiveVariableValue;
40
+ mode?: string;
41
+ inline?: boolean;
42
+ static?: boolean;
43
+ namespace?: string;
44
+ key?: string;
45
+ }
46
+ type CSSDirectiveAnimationDefinitions = Record<string, Record<string, CSSDirectiveDeclarations>>;
47
+ type CSSDirectiveAnimationOptions = Record<string, {
48
+ static?: boolean;
47
49
  }>;
48
- export interface CSSDirectiveUtilityRuleDefinition {
49
- declarations: CSSDirectiveDeclarations;
50
- atRules?: string[];
51
- selector?: string;
52
- }
53
- export interface CSSDirectiveUtilityPatternDefinition {
54
- prefix: string;
55
- values: string[];
56
- }
57
- export interface CSSDirectiveUtilityDynamicDefinition {
58
- key: string;
59
- variableAliasRefs?: string[];
60
- kind?: MasterCSSManifestUtilityKind;
61
- values?: string[];
62
- arbitrary?: boolean;
63
- }
64
- export interface CSSDirectiveUtilityDefinition {
65
- name: string;
66
- type?: 'static' | 'pattern' | 'dynamic';
67
- layer?: CSSDirectiveLayerName;
68
- pattern?: CSSDirectiveUtilityPatternDefinition;
69
- dynamic?: CSSDirectiveUtilityDynamicDefinition;
70
- declarations?: CSSDirectiveDeclarations;
71
- atRules?: string[];
72
- rules?: CSSDirectiveUtilityRuleDefinition[];
73
- }
74
- export interface CSSDirectiveManifestInput {
75
- variants?: CSSDirectiveVariantDefinitions;
76
- variables?: CSSDirectiveVariableDefinition[];
77
- utilities?: CSSDirectiveUtilityDefinition[];
78
- rootSize?: number;
79
- baseUnit?: number;
80
- defaultMode?: CSSDirectiveDefaultMode;
81
- scope?: string;
82
- important?: boolean;
83
- animations?: CSSDirectiveAnimationDefinitions;
84
- animationOptions?: CSSDirectiveAnimationOptions;
85
- modes?: string[];
86
- modeTrigger?: CSSDirectiveModeTrigger;
87
- }
88
- export interface CSSDirectiveExtractionPolicy {
89
- include: string[];
90
- exclude: string[];
91
- safelist: string[];
92
- blocklist: (string | RegExp)[];
93
- preserveNative: boolean;
94
- }
95
- export interface CSSDirectiveReference {
96
- source: string;
97
- file?: string;
98
- }
99
- export interface CSSDirectiveStyleComposeDefinition {
100
- type: 'compose';
101
- order: number;
102
- className: string;
103
- selector: string;
104
- source?: CSSDirectiveSourceReference;
105
- directiveSource?: CSSDirectiveSourceReference;
106
- selectorSource?: CSSDirectiveSourceReference;
107
- atRules?: string[];
108
- layer?: CSSDirectiveLayerName;
109
- name?: string;
110
- }
111
- export interface CSSDirectiveStyleNativeDefinition {
112
- type: 'native';
113
- order: number;
114
- selector: string;
115
- declarations: CSSDirectiveDeclarations;
116
- source?: CSSDirectiveSourceReference;
117
- selectorSource?: CSSDirectiveSourceReference;
118
- atRules?: string[];
119
- layer?: CSSDirectiveLayerName;
120
- name?: string;
121
- }
122
- export type CSSDirectiveStyleDefinition = CSSDirectiveStyleComposeDefinition | CSSDirectiveStyleNativeDefinition;
123
- export interface CSSDirectiveResult {
124
- manifestInput: CSSDirectiveManifestInput;
125
- extractionPolicy: CSSDirectiveExtractionPolicy;
126
- classNames: string[];
127
- nativeClassNames: string[];
128
- nativeCSS: string;
129
- css: string;
130
- generatedCSS: string;
131
- warnings: string[];
132
- dependencies: string[];
133
- references?: CSSDirectiveReference[];
134
- styleDefinitions?: CSSDirectiveStyleDefinition[];
135
- }
136
- export declare const CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX = "__master_variant__:";
137
- export declare function createCSSDirectiveVariantReference(token: string): string;
138
- export declare function readCSSDirectiveVariantReference(atRule: string): string | undefined;
50
+ interface CSSDirectiveUtilityRuleDefinition {
51
+ declarations: CSSDirectiveDeclarations;
52
+ atRules?: string[];
53
+ selector?: string;
54
+ }
55
+ interface CSSDirectiveUtilityPatternDefinition {
56
+ prefix: string;
57
+ values: string[];
58
+ }
59
+ interface CSSDirectiveUtilityDynamicDefinition {
60
+ key: string;
61
+ variableAliasRefs?: string[];
62
+ kind?: MasterCSSManifestUtilityKind;
63
+ values?: string[];
64
+ arbitrary?: boolean;
65
+ }
66
+ interface CSSDirectiveUtilityDefinition {
67
+ name: string;
68
+ type?: 'static' | 'pattern' | 'dynamic';
69
+ layer?: CSSDirectiveLayerName;
70
+ pattern?: CSSDirectiveUtilityPatternDefinition;
71
+ dynamic?: CSSDirectiveUtilityDynamicDefinition;
72
+ declarations?: CSSDirectiveDeclarations;
73
+ atRules?: string[];
74
+ rules?: CSSDirectiveUtilityRuleDefinition[];
75
+ }
76
+ interface CSSDirectiveManifestInput {
77
+ variants?: CSSDirectiveVariantDefinitions;
78
+ variables?: CSSDirectiveVariableDefinition[];
79
+ utilities?: CSSDirectiveUtilityDefinition[];
80
+ rootSize?: number;
81
+ baseUnit?: number;
82
+ defaultMode?: CSSDirectiveDefaultMode;
83
+ scope?: string;
84
+ important?: boolean;
85
+ animations?: CSSDirectiveAnimationDefinitions;
86
+ animationOptions?: CSSDirectiveAnimationOptions;
87
+ modes?: string[];
88
+ modeTrigger?: CSSDirectiveModeTrigger;
89
+ }
90
+ interface CSSDirectiveExtractionPolicy {
91
+ include: string[];
92
+ exclude: string[];
93
+ safelist: string[];
94
+ blocklist: (string | RegExp)[];
95
+ preserveNative: boolean;
96
+ }
97
+ interface CSSDirectiveReference {
98
+ source: string;
99
+ file?: string;
100
+ }
101
+ interface CSSDirectiveStyleComposeDefinition {
102
+ type: 'compose';
103
+ order: number;
104
+ className: string;
105
+ selector: string;
106
+ source?: CSSDirectiveSourceReference;
107
+ directiveSource?: CSSDirectiveSourceReference;
108
+ selectorSource?: CSSDirectiveSourceReference;
109
+ atRules?: string[];
110
+ layer?: CSSDirectiveLayerName;
111
+ name?: string;
112
+ }
113
+ interface CSSDirectiveStyleNativeDefinition {
114
+ type: 'native';
115
+ order: number;
116
+ selector: string;
117
+ declarations: CSSDirectiveDeclarations;
118
+ source?: CSSDirectiveSourceReference;
119
+ selectorSource?: CSSDirectiveSourceReference;
120
+ atRules?: string[];
121
+ layer?: CSSDirectiveLayerName;
122
+ name?: string;
123
+ }
124
+ type CSSDirectiveStyleDefinition = CSSDirectiveStyleComposeDefinition | CSSDirectiveStyleNativeDefinition;
125
+ interface CSSDirectiveResult {
126
+ manifestInput: CSSDirectiveManifestInput;
127
+ extractionPolicy: CSSDirectiveExtractionPolicy;
128
+ classNames: string[];
129
+ nativeClassNames: string[];
130
+ nativeCSS: string;
131
+ css: string;
132
+ generatedCSS: string;
133
+ warnings: string[];
134
+ dependencies: string[];
135
+ references?: CSSDirectiveReference[];
136
+ styleDefinitions?: CSSDirectiveStyleDefinition[];
137
+ }
138
+ declare const CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX = "__master_variant__:";
139
+ declare function createCSSDirectiveVariantReference(token: string): string;
140
+ declare function readCSSDirectiveVariantReference(atRule: string): string | undefined;
141
+ //#endregion
142
+ export { CSSDirectiveAnimationDefinitions, CSSDirectiveAnimationOptions, CSSDirectiveDeclarations, CSSDirectiveDefaultMode, CSSDirectiveError, CSSDirectiveExtractionPolicy, CSSDirectiveLayerName, CSSDirectiveManifestInput, CSSDirectiveModeTrigger, CSSDirectiveReference, CSSDirectiveRelatedInformation, CSSDirectiveResult, CSSDirectiveSourceLocation, CSSDirectiveSourceRange, CSSDirectiveSourceReference, CSSDirectiveStyleComposeDefinition, CSSDirectiveStyleDefinition, CSSDirectiveStyleNativeDefinition, CSSDirectiveUtilityDefinition, CSSDirectiveUtilityDynamicDefinition, CSSDirectiveUtilityPatternDefinition, CSSDirectiveUtilityRuleDefinition, CSSDirectiveVariableDefinition, CSSDirectiveVariableValue, CSSDirectiveVariantDefinitions, CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX, createCSSDirectiveSourceReference, createCSSDirectiveVariantReference, readCSSDirectiveVariantReference };
@@ -0,0 +1,44 @@
1
+ //#region src/css-directives.ts
2
+ var CSSDirectiveError = class extends Error {
3
+ code;
4
+ source;
5
+ related;
6
+ constructor(code, message, source, related) {
7
+ super(message);
8
+ this.name = "CSSDirectiveError";
9
+ this.code = code;
10
+ this.source = source;
11
+ this.related = related;
12
+ }
13
+ };
14
+ function offsetToLocation(source, offset) {
15
+ let line = 1;
16
+ let column = 1;
17
+ for (let index = 0; index < offset && index < source.length; index++) if (source[index] === "\n") {
18
+ line++;
19
+ column = 1;
20
+ } else column++;
21
+ return {
22
+ line,
23
+ column
24
+ };
25
+ }
26
+ function createCSSDirectiveSourceReference(file, range, source) {
27
+ return {
28
+ ...file ? { file } : {},
29
+ range,
30
+ ...source ? { loc: {
31
+ start: offsetToLocation(source, range.start),
32
+ end: offsetToLocation(source, range.end)
33
+ } } : {}
34
+ };
35
+ }
36
+ const CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX = "__master_variant__:";
37
+ function createCSSDirectiveVariantReference(token) {
38
+ return CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX + token;
39
+ }
40
+ function readCSSDirectiveVariantReference(atRule) {
41
+ return atRule.startsWith("__master_variant__:") ? atRule.slice(19) : void 0;
42
+ }
43
+ //#endregion
44
+ export { CSSDirectiveError, CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX, createCSSDirectiveSourceReference, createCSSDirectiveVariantReference, readCSSDirectiveVariantReference };
@@ -1,92 +1,95 @@
1
- import type { MasterCSSManifestUtility, MasterCSSManifestUtilityLayerName, MasterCSSManifestVariableNumericValue } from './manifest.js';
2
- export type ValueComponent = StringValueComponent | NumberValueComponent | FunctionValueComponent | VariableValueComponent | SeparatorValueComponent;
3
- export interface StringValueComponent {
4
- text?: string;
5
- token: string;
6
- type: 'string';
7
- value: string;
1
+ import { MasterCSSManifestUtility, MasterCSSManifestUtilityLayerName, MasterCSSManifestVariableNumericValue } from "./manifest.js";
2
+
3
+ //#region src/css-syntax.d.ts
4
+ type ValueComponent = StringValueComponent | NumberValueComponent | FunctionValueComponent | VariableValueComponent | SeparatorValueComponent;
5
+ interface StringValueComponent {
6
+ text?: string;
7
+ token: string;
8
+ type: 'string';
9
+ value: string;
8
10
  }
9
- export interface NumberValueComponent {
10
- text?: string;
11
- token: string;
12
- type: 'number';
13
- value: number;
14
- unit?: string;
11
+ interface NumberValueComponent {
12
+ text?: string;
13
+ token: string;
14
+ type: 'number';
15
+ value: number;
16
+ unit?: string;
15
17
  }
16
- export interface FunctionValueComponent {
17
- text?: string;
18
- token: string;
19
- type: 'function';
20
- name: string;
21
- symbol: string;
22
- children: ValueComponent[];
23
- bypassTransform?: boolean;
18
+ interface FunctionValueComponent {
19
+ text?: string;
20
+ token: string;
21
+ type: 'function';
22
+ name: string;
23
+ symbol: string;
24
+ children: ValueComponent[];
25
+ bypassTransform?: boolean;
24
26
  }
25
- export interface VariableValueComponent {
26
- text?: string;
27
- token: string;
28
- type: 'variable';
29
- name: string;
30
- alpha?: number;
31
- fallback?: string;
32
- negative?: boolean;
33
- variable?: Variable;
27
+ interface VariableValueComponent {
28
+ text?: string;
29
+ token: string;
30
+ type: 'variable';
31
+ name: string;
32
+ alpha?: number;
33
+ fallback?: string;
34
+ negative?: boolean;
35
+ variable?: Variable;
34
36
  }
35
- export interface SeparatorValueComponent {
36
- text?: string;
37
- token: string;
38
- type: 'separator';
39
- value: string;
37
+ interface SeparatorValueComponent {
38
+ text?: string;
39
+ token: string;
40
+ type: 'separator';
41
+ value: string;
40
42
  }
41
- export interface DefinedUtility {
42
- id: string;
43
- key?: string;
44
- keys: string[];
45
- matchers: {
46
- key?: RegExp;
47
- variable?: RegExp;
48
- value?: RegExp;
49
- arbitrary?: RegExp;
50
- };
51
- variables?: Map<string, Variable>;
52
- order: number;
53
- definition: MasterCSSManifestUtility;
43
+ interface DefinedUtility {
44
+ id: string;
45
+ key?: string;
46
+ keys: string[];
47
+ matchers: {
48
+ key?: RegExp;
49
+ variable?: RegExp;
50
+ value?: RegExp;
51
+ arbitrary?: RegExp;
52
+ };
53
+ variables?: Map<string, Variable>;
54
+ order: number;
55
+ definition: MasterCSSManifestUtility;
54
56
  }
55
- export type ExplicitUtilityLayerName = MasterCSSManifestUtilityLayerName;
56
- export interface MediaFeatureComponent {
57
- type: string;
58
- tokenType?: string;
59
- operator?: string;
60
- value: number;
61
- unit: string;
57
+ type ExplicitUtilityLayerName = MasterCSSManifestUtilityLayerName;
58
+ interface MediaFeatureComponent {
59
+ type: string;
60
+ tokenType?: string;
61
+ operator?: string;
62
+ value: number;
63
+ unit: string;
62
64
  }
63
- export interface MediaQuery {
64
- token: string;
65
- features: Record<string, MediaFeatureComponent>;
66
- type?: string;
65
+ interface MediaQuery {
66
+ token: string;
67
+ features: Record<string, MediaFeatureComponent>;
68
+ type?: string;
67
69
  }
68
70
  interface VariableCommon {
69
- namespace?: string;
70
- name: string;
71
- key: string;
72
- inline?: boolean;
73
- static?: boolean;
74
- modes?: Record<string, ResolvedVariableValue>;
75
- dependencies?: Set<string>;
71
+ namespace?: string;
72
+ name: string;
73
+ key: string;
74
+ inline?: boolean;
75
+ static?: boolean;
76
+ modes?: Record<string, ResolvedVariableValue>;
77
+ dependencies?: Set<string>;
76
78
  }
77
- export interface StringVariable {
78
- type: 'string';
79
- value: string | number;
79
+ interface StringVariable {
80
+ type: 'string';
81
+ value: string | number;
80
82
  }
81
- export interface NumberVariable {
82
- type: 'number';
83
- value: number | string;
84
- numeric?: MasterCSSManifestVariableNumericValue;
83
+ interface NumberVariable {
84
+ type: 'number';
85
+ value: number | string;
86
+ numeric?: MasterCSSManifestVariableNumericValue;
85
87
  }
86
- export type ResolvedVariableValue = StringVariable | NumberVariable;
87
- export type Variable = VariableCommon & {
88
- type: ResolvedVariableValue['type'];
89
- value?: ResolvedVariableValue['value'];
90
- numeric?: MasterCSSManifestVariableNumericValue;
88
+ type ResolvedVariableValue = StringVariable | NumberVariable;
89
+ type Variable = VariableCommon & {
90
+ type: ResolvedVariableValue['type'];
91
+ value?: ResolvedVariableValue['value'];
92
+ numeric?: MasterCSSManifestVariableNumericValue;
91
93
  };
92
- export {};
94
+ //#endregion
95
+ export { DefinedUtility, ExplicitUtilityLayerName, FunctionValueComponent, MediaFeatureComponent, MediaQuery, NumberValueComponent, NumberVariable, ResolvedVariableValue, SeparatorValueComponent, StringValueComponent, StringVariable, ValueComponent, Variable, VariableValueComponent };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,32 +1,36 @@
1
- import type { MasterCSSManifestUtilityLayerName } from './manifest.js';
2
- import type { UtilityType } from './utility-type.js';
3
- export declare const MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID = "master-css-hydration-manifest";
4
- export declare const MASTER_CSS_HYDRATION_MANIFEST_ATTR = "data-master-css-hydration-manifest";
5
- export declare const MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE = "/_master-css/hydration/";
6
- export declare const MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME = "master-css-hydration";
7
- export interface MasterCSSRulePriorityIR {
8
- features?: [string, number, number][];
9
- selector: number;
1
+ import { MasterCSSManifestUtilityLayerName } from "./manifest.js";
2
+ import { UtilityType } from "./utility-type.js";
3
+
4
+ //#region src/hydration-manifest.d.ts
5
+ declare const MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID = "master-css-hydration-manifest";
6
+ declare const MASTER_CSS_HYDRATION_MANIFEST_ATTR = "data-master-css-hydration-manifest";
7
+ declare const MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE = "/_master-css/hydration/";
8
+ declare const MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME = "master-css-hydration";
9
+ interface MasterCSSRulePriorityIR {
10
+ features?: [string, number, number][];
11
+ selector: number;
10
12
  }
11
- export interface MasterCSSGeneratedRuleNodeIR {
12
- text: string;
13
+ interface MasterCSSGeneratedRuleNodeIR {
14
+ text: string;
13
15
  }
14
- export interface MasterCSSGeneratedRuleIR {
15
- className: string;
16
- key: string;
17
- layer: MasterCSSManifestUtilityLayerName;
18
- type: UtilityType;
19
- sortTier: number;
20
- priority: MasterCSSRulePriorityIR;
21
- text: string;
22
- nodes?: MasterCSSGeneratedRuleNodeIR[];
23
- selectorText?: string;
24
- variableNames?: string[];
25
- animationNames?: string[];
16
+ interface MasterCSSGeneratedRuleIR {
17
+ className: string;
18
+ key: string;
19
+ layer: MasterCSSManifestUtilityLayerName;
20
+ type: UtilityType;
21
+ sortTier: number;
22
+ priority: MasterCSSRulePriorityIR;
23
+ text: string;
24
+ nodes?: MasterCSSGeneratedRuleNodeIR[];
25
+ selectorText?: string;
26
+ variableNames?: string[];
27
+ animationNames?: string[];
26
28
  }
27
- export interface MasterCSSHydrationManifest {
28
- version: 1;
29
- rules: MasterCSSGeneratedRuleIR[];
29
+ interface MasterCSSHydrationManifest {
30
+ version: 1;
31
+ rules: MasterCSSGeneratedRuleIR[];
30
32
  }
31
- export declare function serializeMasterCSSHydrationManifest(hydrationManifest: MasterCSSHydrationManifest): string;
32
- export declare function createMasterCSSHydrationManifestScript(hydrationManifest: MasterCSSHydrationManifest): string;
33
+ declare function serializeMasterCSSHydrationManifest(hydrationManifest: MasterCSSHydrationManifest): string;
34
+ declare function createMasterCSSHydrationManifestScript(hydrationManifest: MasterCSSHydrationManifest): string;
35
+ //#endregion
36
+ export { MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE, MASTER_CSS_HYDRATION_MANIFEST_ATTR, MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME, MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID, MasterCSSGeneratedRuleIR, MasterCSSGeneratedRuleNodeIR, MasterCSSHydrationManifest, MasterCSSRulePriorityIR, createMasterCSSHydrationManifestScript, serializeMasterCSSHydrationManifest };
@@ -0,0 +1,13 @@
1
+ //#region src/hydration-manifest.ts
2
+ const MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID = "master-css-hydration-manifest";
3
+ const MASTER_CSS_HYDRATION_MANIFEST_ATTR = "data-master-css-hydration-manifest";
4
+ const MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE = "/_master-css/hydration/";
5
+ const MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME = "master-css-hydration";
6
+ function serializeMasterCSSHydrationManifest(hydrationManifest) {
7
+ return JSON.stringify(hydrationManifest).replace(/</g, "\\u003c");
8
+ }
9
+ function createMasterCSSHydrationManifestScript(hydrationManifest) {
10
+ return `<script type="application/json" id="${MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID}">${serializeMasterCSSHydrationManifest(hydrationManifest)}<\/script>`;
11
+ }
12
+ //#endregion
13
+ export { MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE, MASTER_CSS_HYDRATION_MANIFEST_ATTR, MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME, MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID, createMasterCSSHydrationManifestScript, serializeMasterCSSHydrationManifest };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export * from './manifest';
2
- export * from './manifest-json';
3
- export * from './hydration-manifest';
4
- export * from './css-directives';
5
- export * from './css-syntax';
6
- export * from './utility-type';
7
- export * from './runtime-style';
8
- export * from './native-css-shorthand';
9
- export * from './css-common';
1
+ export * from "./manifest.js";
2
+ export * from "./manifest-json.js";
3
+ export * from "./hydration-manifest.js";
4
+ export * from "./css-directives.js";
5
+ export * from "./css-syntax.js";
6
+ export * from "./utility-type.js";
7
+ export * from "./runtime-style.js";
8
+ export * from "./native-css-shorthand.js";
9
+ export * from "./css-common.js";
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { CSSDirectiveError, CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX, createCSSDirectiveSourceReference, createCSSDirectiveVariantReference, readCSSDirectiveVariantReference } from "./css-directives.js";
2
+ import { MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE, MASTER_CSS_HYDRATION_MANIFEST_ATTR, MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME, MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID, createMasterCSSHydrationManifestScript, serializeMasterCSSHydrationManifest } from "./hydration-manifest.js";
3
+ import { flattenMasterCSSManifestVariables, getMasterCSSManifestVariableName, groupMasterCSSManifestVariables } from "./manifest.js";
4
+ import { normalizeMasterCSSManifestForJSON, stringifyMasterCSSManifestJSON } from "./manifest-json.js";
5
+ import { UtilityType } from "./utility-type.js";
6
+ import { MASTER_CSS_RUNTIME_STYLE_ID } from "./runtime-style.js";
7
+ import { isNativeCSSShorthandProperty } from "./native-css-shorthand.js";
8
+ export { CSSDirectiveError, CSS_DIRECTIVE_VARIANT_REFERENCE_PREFIX, MASTER_CSS_HYDRATION_MANIFEST_ASSET_BASE, MASTER_CSS_HYDRATION_MANIFEST_ATTR, MASTER_CSS_HYDRATION_MANIFEST_FILE_BASENAME, MASTER_CSS_HYDRATION_MANIFEST_SCRIPT_ID, MASTER_CSS_RUNTIME_STYLE_ID, UtilityType, createCSSDirectiveSourceReference, createCSSDirectiveVariantReference, createMasterCSSHydrationManifestScript, flattenMasterCSSManifestVariables, getMasterCSSManifestVariableName, groupMasterCSSManifestVariables, isNativeCSSShorthandProperty, normalizeMasterCSSManifestForJSON, readCSSDirectiveVariantReference, serializeMasterCSSHydrationManifest, stringifyMasterCSSManifestJSON };