@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 +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/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.
|
package/dist/css-common.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/css-directives.d.ts
CHANGED
|
@@ -1,138 +1,142 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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 };
|
package/dist/css-syntax.d.ts
CHANGED
|
@@ -1,92 +1,95 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
interface NumberValueComponent {
|
|
12
|
+
text?: string;
|
|
13
|
+
token: string;
|
|
14
|
+
type: 'number';
|
|
15
|
+
value: number;
|
|
16
|
+
unit?: string;
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
interface SeparatorValueComponent {
|
|
38
|
+
text?: string;
|
|
39
|
+
token: string;
|
|
40
|
+
type: 'separator';
|
|
41
|
+
value: string;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
interface MediaQuery {
|
|
66
|
+
token: string;
|
|
67
|
+
features: Record<string, MediaFeatureComponent>;
|
|
68
|
+
type?: string;
|
|
67
69
|
}
|
|
68
70
|
interface VariableCommon {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
interface StringVariable {
|
|
80
|
+
type: 'string';
|
|
81
|
+
value: string | number;
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
interface NumberVariable {
|
|
84
|
+
type: 'number';
|
|
85
|
+
value: number | string;
|
|
86
|
+
numeric?: MasterCSSManifestVariableNumericValue;
|
|
85
87
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
type ResolvedVariableValue = StringVariable | NumberVariable;
|
|
89
|
+
type Variable = VariableCommon & {
|
|
90
|
+
type: ResolvedVariableValue['type'];
|
|
91
|
+
value?: ResolvedVariableValue['value'];
|
|
92
|
+
numeric?: MasterCSSManifestVariableNumericValue;
|
|
91
93
|
};
|
|
92
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
+
interface MasterCSSGeneratedRuleNodeIR {
|
|
14
|
+
text: string;
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
interface MasterCSSHydrationManifest {
|
|
30
|
+
version: 1;
|
|
31
|
+
rules: MasterCSSGeneratedRuleIR[];
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
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 };
|