zyzz 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -19
- package/dist/Config.d.ts +16 -167
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +7 -246
- package/dist/Config.js.map +1 -1
- package/dist/Style.d.ts +15 -12
- package/dist/Style.d.ts.map +1 -1
- package/dist/Style.js +51 -26
- package/dist/Style.js.map +1 -1
- package/dist/Vars.d.ts +114 -0
- package/dist/Vars.d.ts.map +1 -0
- package/dist/Vars.js +42 -0
- package/dist/Vars.js.map +1 -0
- package/dist/babel/index.d.ts +2 -0
- package/dist/babel/index.d.ts.map +1 -1
- package/dist/babel/index.js +10 -1
- package/dist/babel/index.js.map +1 -1
- package/dist/compiler/Graph.d.ts +2 -0
- package/dist/compiler/Graph.d.ts.map +1 -1
- package/dist/compiler/Graph.js +30 -9
- package/dist/compiler/Graph.js.map +1 -1
- package/dist/compiler/Native.d.ts +5 -5
- package/dist/compiler/Native.d.ts.map +1 -1
- package/dist/compiler/Native.js +21 -21
- package/dist/compiler/Native.js.map +1 -1
- package/dist/compiler/Source.d.ts +8 -6
- package/dist/compiler/Source.d.ts.map +1 -1
- package/dist/compiler/Source.js +52 -16
- package/dist/compiler/Source.js.map +1 -1
- package/dist/compiler/Transform.d.ts +1 -1
- package/dist/compiler/Transform.d.ts.map +1 -1
- package/dist/compiler/Transform.js +58 -22
- package/dist/compiler/Transform.js.map +1 -1
- package/dist/compiler/internal/Compositions.d.ts +5 -0
- package/dist/compiler/internal/Compositions.d.ts.map +1 -1
- package/dist/compiler/internal/Compositions.js +22 -3
- package/dist/compiler/internal/Compositions.js.map +1 -1
- package/dist/compiler/internal/Configurations.d.ts.map +1 -1
- package/dist/compiler/internal/Configurations.js +73 -12
- package/dist/compiler/internal/Configurations.js.map +1 -1
- package/dist/compiler/internal/Contract.d.ts +1 -1
- package/dist/compiler/internal/Contract.d.ts.map +1 -1
- package/dist/compiler/internal/Contract.js +155 -13
- package/dist/compiler/internal/Contract.js.map +1 -1
- package/dist/compiler/internal/Contributions.d.ts +1 -1
- package/dist/compiler/internal/Contributions.d.ts.map +1 -1
- package/dist/compiler/internal/Contributions.js +6 -4
- package/dist/compiler/internal/Contributions.js.map +1 -1
- package/dist/compiler/internal/Dynamic.js +1 -1
- package/dist/compiler/internal/Dynamic.js.map +1 -1
- package/dist/compiler/internal/Expression.d.ts +3 -0
- package/dist/compiler/internal/Expression.d.ts.map +1 -1
- package/dist/compiler/internal/Expression.js +21 -0
- package/dist/compiler/internal/Expression.js.map +1 -1
- package/dist/compiler/internal/Identifiers.d.ts +1 -1
- package/dist/compiler/internal/Identifiers.d.ts.map +1 -1
- package/dist/compiler/internal/Identifiers.js +2 -2
- package/dist/compiler/internal/Identifiers.js.map +1 -1
- package/dist/compiler/internal/NativeBindings.d.ts +1 -1
- package/dist/compiler/internal/NativeBindings.d.ts.map +1 -1
- package/dist/compiler/internal/NativeBindings.js +3 -3
- package/dist/compiler/internal/NativeBindings.js.map +1 -1
- package/dist/compiler/internal/PackedStyles.d.ts +1 -1
- package/dist/compiler/internal/PackedStyles.d.ts.map +1 -1
- package/dist/compiler/internal/PackedStyles.js +15 -25
- package/dist/compiler/internal/PackedStyles.js.map +1 -1
- package/dist/compiler/internal/Recipes.js +1 -1
- package/dist/compiler/internal/Recipes.js.map +1 -1
- package/dist/compiler/internal/Selectors.js +1 -1
- package/dist/compiler/internal/Selectors.js.map +1 -1
- package/dist/compiler/internal/Static.d.ts.map +1 -1
- package/dist/compiler/internal/Static.js +2 -0
- package/dist/compiler/internal/Static.js.map +1 -1
- package/dist/compiler/internal/Themes.d.ts +12 -3
- package/dist/compiler/internal/Themes.d.ts.map +1 -1
- package/dist/compiler/internal/Themes.js +192 -52
- package/dist/compiler/internal/Themes.js.map +1 -1
- package/dist/compiler/internal/{Variables.d.ts → Vars.d.ts} +1 -1
- package/dist/compiler/internal/Vars.d.ts.map +1 -0
- package/dist/compiler/internal/{Variables.js → Vars.js} +3 -3
- package/dist/compiler/internal/Vars.js.map +1 -0
- package/dist/default.d.ts +147 -2562
- package/dist/default.d.ts.map +1 -1
- package/dist/default.js +85 -80
- package/dist/default.js.map +2 -2
- package/dist/default.js.zyzz.json +1 -1
- package/dist/esbuild/index.d.ts +3 -0
- package/dist/esbuild/index.d.ts.map +1 -0
- package/dist/esbuild/index.js +5 -0
- package/dist/esbuild/index.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/Authoring.d.ts +1 -1
- package/dist/internal/Authoring.d.ts.map +1 -1
- package/dist/internal/Authoring.js +4 -4
- package/dist/internal/Authoring.js.map +1 -1
- package/dist/internal/Binding.d.ts +1 -1
- package/dist/internal/Binding.d.ts.map +1 -1
- package/dist/internal/Completion.d.ts +19 -0
- package/dist/internal/Completion.d.ts.map +1 -0
- package/dist/internal/Completion.js +2 -0
- package/dist/internal/Completion.js.map +1 -0
- package/dist/internal/Condition.d.ts +3 -1
- package/dist/internal/Condition.d.ts.map +1 -1
- package/dist/internal/Condition.js.map +1 -1
- package/dist/internal/Configuration.d.ts +248 -0
- package/dist/internal/Configuration.d.ts.map +1 -0
- package/dist/internal/Configuration.js +343 -0
- package/dist/internal/Configuration.js.map +1 -0
- package/dist/{Theme.d.ts → internal/Theme.d.ts} +15 -13
- package/dist/internal/Theme.d.ts.map +1 -0
- package/dist/{Theme.js → internal/Theme.js} +39 -12
- package/dist/internal/Theme.js.map +1 -0
- package/dist/internal/Token.d.ts +46 -16
- package/dist/internal/Token.d.ts.map +1 -1
- package/dist/internal/Token.js +89 -5
- package/dist/internal/Token.js.map +1 -1
- package/dist/internal/Typography.d.ts +13 -5
- package/dist/internal/Typography.d.ts.map +1 -1
- package/dist/internal/Typography.js +42 -6
- package/dist/internal/Typography.js.map +1 -1
- package/dist/internal/Value.d.ts +6 -1
- package/dist/internal/Value.d.ts.map +1 -1
- package/dist/internal/Value.js.map +1 -1
- package/dist/internal/VariableSets.d.ts +20 -0
- package/dist/internal/VariableSets.d.ts.map +1 -0
- package/dist/internal/VariableSets.js +317 -0
- package/dist/internal/VariableSets.js.map +1 -0
- package/dist/next/index.d.ts +8 -3
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +21 -10
- package/dist/next/index.js.map +1 -1
- package/dist/next/loader.d.ts +1 -0
- package/dist/next/loader.d.ts.map +1 -1
- package/dist/next/loader.js +25 -6
- package/dist/next/loader.js.map +1 -1
- package/dist/node/Host.d.ts.map +1 -1
- package/dist/node/Host.js +1 -1
- package/dist/node/Host.js.map +1 -1
- package/dist/node/Reset.d.ts +3 -0
- package/dist/node/Reset.d.ts.map +1 -0
- package/dist/node/Reset.js +7 -0
- package/dist/node/Reset.js.map +1 -0
- package/dist/react-native/Host.d.ts +2 -2
- package/dist/react-native/Host.d.ts.map +1 -1
- package/dist/react-native/Host.js +4 -4
- package/dist/react-native/Host.js.map +1 -1
- package/dist/react-native/StyleSheet.d.ts +9 -8
- package/dist/react-native/StyleSheet.d.ts.map +1 -1
- package/dist/react-native/StyleSheet.js +29 -23
- package/dist/react-native/StyleSheet.js.map +1 -1
- package/dist/react-native/Variants.d.ts +3 -3
- package/dist/react-native/Variants.d.ts.map +1 -1
- package/dist/react-native/Variants.js +2 -2
- package/dist/react-native/react.d.ts +1 -1
- package/dist/react-native/react.d.ts.map +1 -1
- package/dist/react-native/react.js +5 -5
- package/dist/react-native/react.js.map +1 -1
- package/dist/rollup/index.d.ts +3 -0
- package/dist/rollup/index.d.ts.map +1 -0
- package/dist/rollup/index.js +5 -0
- package/dist/rollup/index.js.map +1 -0
- package/dist/runtime/Appearance.d.ts +7 -7
- package/dist/runtime/Appearance.d.ts.map +1 -1
- package/dist/runtime/Appearance.js +15 -15
- package/dist/runtime/Appearance.js.map +1 -1
- package/dist/runtime/Dynamic.d.ts.map +1 -1
- package/dist/runtime/Dynamic.js +4 -1
- package/dist/runtime/Dynamic.js.map +1 -1
- package/dist/runtime/NativeContext.d.ts +4 -4
- package/dist/runtime/NativeContext.d.ts.map +1 -1
- package/dist/runtime/NativeContext.js +5 -5
- package/dist/runtime/NativeContext.js.map +1 -1
- package/dist/runtime/NativeDynamic.d.ts +1 -1
- package/dist/runtime/NativeDynamic.d.ts.map +1 -1
- package/dist/runtime/NativeDynamic.js.map +1 -1
- package/dist/runtime/Props.d.ts +1 -1
- package/dist/runtime/Props.js +3 -3
- package/dist/runtime/Props.js.map +1 -1
- package/dist/runtime/Selection.d.ts +14 -10
- package/dist/runtime/Selection.d.ts.map +1 -1
- package/dist/runtime/Selection.js +19 -18
- package/dist/runtime/Selection.js.map +1 -1
- package/dist/styleFunction.d.ts +14 -14
- package/dist/styleFunction.d.ts.map +1 -1
- package/dist/styleFunction.js.map +1 -1
- package/dist/unplugin/index.d.ts +22 -0
- package/dist/unplugin/index.d.ts.map +1 -0
- package/dist/unplugin/index.js +500 -0
- package/dist/unplugin/index.js.map +1 -0
- package/dist/variants.d.ts +3 -3
- package/dist/variants.d.ts.map +1 -1
- package/dist/variants.js.map +1 -1
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +44 -12
- package/dist/vite/index.js.map +1 -1
- package/dist/web/Css.d.ts +4 -3
- package/dist/web/Css.d.ts.map +1 -1
- package/dist/web/Css.js +4 -4
- package/dist/web/Css.js.map +1 -1
- package/dist/web/internal/Themes.d.ts +3 -2
- package/dist/web/internal/Themes.d.ts.map +1 -1
- package/dist/web/internal/Themes.js +42 -6
- package/dist/web/internal/Themes.js.map +1 -1
- package/dist/webpack/index.d.ts +3 -0
- package/dist/webpack/index.d.ts.map +1 -0
- package/dist/webpack/index.js +5 -0
- package/dist/webpack/index.js.map +1 -0
- package/package.json +23 -2
- package/src/Config.ts +43 -685
- package/src/Style.ts +97 -34
- package/src/Vars.ts +299 -0
- package/src/babel/index.ts +23 -1
- package/src/compiler/Graph.ts +36 -9
- package/src/compiler/Native.ts +29 -32
- package/src/compiler/Source.ts +64 -22
- package/src/compiler/Transform.ts +73 -23
- package/src/compiler/internal/Compositions.ts +36 -3
- package/src/compiler/internal/Configurations.ts +83 -11
- package/src/compiler/internal/Contract.ts +207 -15
- package/src/compiler/internal/Contributions.ts +6 -3
- package/src/compiler/internal/Dynamic.ts +1 -1
- package/src/compiler/internal/Expression.ts +26 -0
- package/src/compiler/internal/Identifiers.ts +2 -1
- package/src/compiler/internal/NativeBindings.ts +3 -3
- package/src/compiler/internal/PackedStyles.ts +22 -26
- package/src/compiler/internal/Recipes.ts +1 -1
- package/src/compiler/internal/Selectors.ts +1 -1
- package/src/compiler/internal/Static.ts +1 -0
- package/src/compiler/internal/Themes.ts +266 -57
- package/src/compiler/internal/{Variables.ts → Vars.ts} +2 -2
- package/src/default.ts +173 -154
- package/src/esbuild/index.ts +5 -0
- package/src/index.ts +4 -4
- package/src/internal/Authoring.ts +5 -7
- package/src/internal/Binding.ts +1 -1
- package/src/internal/Completion.ts +42 -0
- package/src/internal/Condition.ts +31 -1
- package/src/internal/Configuration.ts +970 -0
- package/src/{Theme.ts → internal/Theme.ts} +75 -20
- package/src/internal/Token.ts +258 -85
- package/src/internal/Typography.ts +71 -16
- package/src/internal/Value.ts +45 -26
- package/src/internal/VariableSets.ts +458 -0
- package/src/next/index.ts +34 -12
- package/src/next/loader.ts +35 -6
- package/src/node/Host.ts +1 -2
- package/src/node/Reset.ts +7 -0
- package/src/react-native/Host.ts +6 -6
- package/src/react-native/StyleSheet.ts +49 -42
- package/src/react-native/Variants.ts +3 -3
- package/src/react-native/react.ts +6 -6
- package/src/rollup/index.ts +5 -0
- package/src/runtime/Appearance.ts +20 -20
- package/src/runtime/Dynamic.ts +4 -1
- package/src/runtime/NativeContext.ts +8 -8
- package/src/runtime/NativeDynamic.ts +2 -4
- package/src/runtime/Props.ts +3 -3
- package/src/runtime/Selection.ts +44 -33
- package/src/styleFunction.ts +22 -19
- package/src/unplugin/index.ts +604 -0
- package/src/variants.ts +7 -5
- package/src/vite/index.ts +48 -18
- package/src/web/Css.ts +10 -7
- package/src/web/internal/Themes.ts +52 -9
- package/src/webpack/index.ts +5 -0
- package/dist/Theme.d.ts.map +0 -1
- package/dist/Theme.js.map +0 -1
- package/dist/compiler/internal/Variables.d.ts.map +0 -1
- package/dist/compiler/internal/Variables.js.map +0 -1
|
@@ -3,18 +3,26 @@
|
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
5
|
import * as Identity from '../../internal/Identity.js';
|
|
6
|
-
import * as Config from '../../
|
|
6
|
+
import * as Config from '../../internal/Configuration.js';
|
|
7
|
+
import * as PublicConfig from '../../Config.js';
|
|
7
8
|
import * as Shorthands from '../../internal/Shorthands.js';
|
|
8
9
|
import * as Token from '../../internal/Token.js';
|
|
9
|
-
import * as Theme from '../../Theme.js';
|
|
10
|
+
import * as Theme from '../../internal/Theme.js';
|
|
11
|
+
import * as VariableSets from '../../internal/VariableSets.js';
|
|
12
|
+
import * as Vars from '../../Vars.js';
|
|
10
13
|
/** Reads a direct configuration factory without executing authored expressions. */
|
|
11
14
|
export function collect(options) {
|
|
12
15
|
function data(node) {
|
|
13
16
|
const linked = options.resolve(node);
|
|
14
|
-
if (linked?.kind === 'theme'
|
|
15
|
-
|
|
17
|
+
if (linked?.kind === 'theme' ||
|
|
18
|
+
(linked?.call.variableConfig && linked.call.selection))
|
|
19
|
+
return linked.definition[Token.definition].contract.variableSet
|
|
20
|
+
? VariableSets.from(linked.definition[Token.definition])
|
|
21
|
+
: linked.definition;
|
|
16
22
|
if (node.type === 'TSAsExpression' || node.type === 'TSSatisfiesExpression')
|
|
17
23
|
return data(node.expression);
|
|
24
|
+
if (node.type === 'Literal' && node.value === false)
|
|
25
|
+
return false;
|
|
18
26
|
if (node.type === 'ArrayExpression')
|
|
19
27
|
return node.elements.map((node) => {
|
|
20
28
|
if (!node || node.type === 'SpreadElement')
|
|
@@ -50,9 +58,30 @@ export function collect(options) {
|
|
|
50
58
|
}
|
|
51
59
|
if (options.expression.arguments.length > 1)
|
|
52
60
|
throw new Config.InvalidError('Config.create accepts one literal options object.');
|
|
53
|
-
|
|
61
|
+
let input = (options.expression.arguments.length
|
|
54
62
|
? data(options.expression.arguments[0])
|
|
55
63
|
: {});
|
|
64
|
+
PublicConfig.create(input);
|
|
65
|
+
const authored = input;
|
|
66
|
+
const variableMode = authored.vars !== undefined;
|
|
67
|
+
if (variableMode) {
|
|
68
|
+
Config.create(authored);
|
|
69
|
+
const wrap = (value) => VariableSets.theme(Token.definition in value
|
|
70
|
+
? value
|
|
71
|
+
: Vars.define(value), authored.mappings);
|
|
72
|
+
const { vars, defaultVars, mappings: _mappings, ...rest } = authored;
|
|
73
|
+
input =
|
|
74
|
+
defaultVars === undefined
|
|
75
|
+
? { ...rest, theme: wrap(vars) }
|
|
76
|
+
: {
|
|
77
|
+
...rest,
|
|
78
|
+
defaultTheme: defaultVars,
|
|
79
|
+
themes: Object.fromEntries(Object.entries(vars).map(([key, value]) => [
|
|
80
|
+
key,
|
|
81
|
+
wrap(value),
|
|
82
|
+
])),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
56
85
|
const config = Config.create(input);
|
|
57
86
|
const catalog = (() => {
|
|
58
87
|
if ('themes' in config) {
|
|
@@ -67,8 +96,17 @@ export function collect(options) {
|
|
|
67
96
|
? options.name
|
|
68
97
|
: Identity.requireId(input.id, 'Config.create');
|
|
69
98
|
const contract = Object.freeze({
|
|
99
|
+
...(variableMode
|
|
100
|
+
? {
|
|
101
|
+
variableSet: true,
|
|
102
|
+
mappings: VariableSets.mappings(authored.mappings),
|
|
103
|
+
}
|
|
104
|
+
: {}),
|
|
70
105
|
[Token.identity]: identity,
|
|
71
106
|
cssOutput: input.cssOutput ?? 'atomic',
|
|
107
|
+
...(input.defaultLayer !== undefined
|
|
108
|
+
? { defaultLayer: input.defaultLayer }
|
|
109
|
+
: {}),
|
|
72
110
|
...(input.shorthands
|
|
73
111
|
? { shorthands: Shorthands.read(input.shorthands) }
|
|
74
112
|
: {}),
|
|
@@ -104,29 +142,44 @@ export function collect(options) {
|
|
|
104
142
|
const selected = members[JSON.stringify('themes' in config ? ['themes', input.defaultTheme] : ['theme'])];
|
|
105
143
|
if ('themes' in config && selected)
|
|
106
144
|
members[JSON.stringify(['theme'])] = selected;
|
|
145
|
+
if (variableMode && selected)
|
|
146
|
+
members[JSON.stringify(['vars'])] = {
|
|
147
|
+
...selected,
|
|
148
|
+
call: {
|
|
149
|
+
...selected.call,
|
|
150
|
+
directVariables: true,
|
|
151
|
+
type: `import('zyzz').Vars.References<${selected.call.tokenType}>`,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
107
154
|
const definition = selected?.definition ?? Token.bind(Theme.define({}), contract);
|
|
108
155
|
const normalized = {
|
|
109
156
|
...(() => {
|
|
110
157
|
if ('themes' in config) {
|
|
111
158
|
return {
|
|
112
159
|
defaultTheme: input.defaultTheme,
|
|
113
|
-
themes: Object.fromEntries(Object.
|
|
114
|
-
name
|
|
115
|
-
|
|
116
|
-
|
|
160
|
+
themes: Object.fromEntries(Object.keys(catalog).map((name) => {
|
|
161
|
+
const theme = members[JSON.stringify(['themes', name])].definition;
|
|
162
|
+
return [
|
|
163
|
+
name,
|
|
164
|
+
{ ...values(theme.tokens), ...theme[Token.definition].queries },
|
|
165
|
+
];
|
|
166
|
+
})),
|
|
117
167
|
};
|
|
118
168
|
}
|
|
119
169
|
if ('theme' in config) {
|
|
120
170
|
return {
|
|
121
171
|
theme: {
|
|
122
|
-
...values(
|
|
123
|
-
...
|
|
172
|
+
...values(definition.tokens),
|
|
173
|
+
...definition[Token.definition].queries,
|
|
124
174
|
},
|
|
125
175
|
};
|
|
126
176
|
}
|
|
127
177
|
return {};
|
|
128
178
|
})(),
|
|
129
179
|
...(input.cssOutput ? { cssOutput: input.cssOutput } : {}),
|
|
180
|
+
...(input.defaultLayer !== undefined
|
|
181
|
+
? { defaultLayer: input.defaultLayer }
|
|
182
|
+
: {}),
|
|
130
183
|
...(input.shorthands ? { shorthands: input.shorthands } : {}),
|
|
131
184
|
...(input.output ? { output: input.output } : {}),
|
|
132
185
|
...(input.layers ? { layers: input.layers } : {}),
|
|
@@ -135,6 +188,9 @@ export function collect(options) {
|
|
|
135
188
|
return {
|
|
136
189
|
binding: options.name,
|
|
137
190
|
call: {
|
|
191
|
+
...(variableMode
|
|
192
|
+
? { variableConfig: true, variableMappings: authored.mappings }
|
|
193
|
+
: {}),
|
|
138
194
|
appearance: true,
|
|
139
195
|
script: true,
|
|
140
196
|
end: options.expression.end,
|
|
@@ -143,7 +199,9 @@ export function collect(options) {
|
|
|
143
199
|
options: normalized,
|
|
144
200
|
start: options.expression.start,
|
|
145
201
|
tokenType: selected?.call.tokenType ?? '{}',
|
|
146
|
-
type:
|
|
202
|
+
type: variableMode
|
|
203
|
+
? `import('zyzz').Config.VariableConfig<${type({ ...normalized, theme: undefined, themes: undefined, defaultTheme: undefined, vars: 'themes' in normalized ? normalized.themes : normalized.theme, ...('themes' in normalized ? { defaultVars: normalized.defaultTheme } : {}), ...(authored.mappings !== undefined ? { mappings: VariableSets.mappings(authored.mappings) } : {}) })}>`
|
|
204
|
+
: `import('zyzz').Config.create.ReturnType<${type(normalized)}>`,
|
|
147
205
|
},
|
|
148
206
|
definition,
|
|
149
207
|
kind: 'config',
|
|
@@ -152,11 +210,14 @@ export function collect(options) {
|
|
|
152
210
|
}
|
|
153
211
|
/** Encodes validated literal options as a declaration type, never executable text. */
|
|
154
212
|
export function type(value) {
|
|
213
|
+
if (Token.is(value))
|
|
214
|
+
return `import('zyzz').Vars.Reference<'${value.group}'>`;
|
|
155
215
|
if (Array.isArray(value))
|
|
156
216
|
return `readonly [${value.map(type).join(',')}]`;
|
|
157
217
|
if (!value || typeof value !== 'object')
|
|
158
218
|
return JSON.stringify(value);
|
|
159
219
|
return `{${Object.entries(value)
|
|
220
|
+
.filter(([, value]) => value !== undefined)
|
|
160
221
|
.map(([key, value]) => `readonly ${JSON.stringify(key)}:${type(value)}`)
|
|
161
222
|
.join(';')}}`;
|
|
162
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configurations.js","sourceRoot":"","sources":["../../../src/compiler/internal/Configurations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAA;AAEtD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Configurations.js","sourceRoot":"","sources":["../../../src/compiler/internal/Configurations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAA;AAEtD,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAA;AACzD,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAChD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AAGrC,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,OAAwB;IAC9C,SAAS,IAAI,CAAC,IAAc;QAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACpC,IACE,MAAM,EAAE,IAAI,KAAK,OAAO;YACxB,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YAEtD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,WAAW;gBAC7D,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBACxD,CAAC,CAAC,MAAM,CAAC,UA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AA;IAErE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;SAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;SACvE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;AACjB,CAAC;AAED,SAAS,MAAM,CAAC,IAAoC;IAClD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACzC,GAAG;QACH,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC;YACb,CAAC,CAAC,KAAK,CAAC,KAAK;YACb,CAAC,CAAC,MAAM,CAAC,KAAuC,CAAC;KACpD,CAAC,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Stylesheets from './Stylesheets.js';
|
|
2
|
-
import * as Theme from '../../Theme.js';
|
|
2
|
+
import * as Theme from '../../internal/Theme.js';
|
|
3
3
|
import type * as Themes from './Themes.js';
|
|
4
4
|
import * as Token from '../../internal/Token.js';
|
|
5
5
|
/** Reads versioned JSON as validated data; never evaluates package code. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../../src/compiler/internal/Contract.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../../src/compiler/internal/Contract.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAGhD,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAEhD,4EAA4E;AAC5E,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,EACvC,QAAQ,SAAK;;;;;;EAkhBd;AAyCD,4EAA4E;AAC5E,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAC5C,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,EAClD,WAAW,GAAE,SAAS,WAAW,CAAC,OAAO,EAAO,EAChD,QAAQ,SAAK,EACb,cAAc,GAAE,SAAS,KAAK,CAAC,aAAa,EAAO,GAClD,MAAM,CAkVR;AAED,iCAAiC;AACjC,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,wFAAwF;IACxF,KAAK,aAAa,GAAG;QACnB,kEAAkE;QAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,2EAA2E;QAC3E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QACxC,uDAAuD;QACvD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;KACnC,CAAA;CACF"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import * as Config from '../../
|
|
1
|
+
import * as Config from '../../internal/Configuration.js';
|
|
2
2
|
import * as Configurations from './Configurations.js';
|
|
3
3
|
import * as FunctionSyntax from '../../internal/FunctionSyntax.js';
|
|
4
4
|
import * as Identifiers from './Identifiers.js';
|
|
5
5
|
import * as PackedStyles from './PackedStyles.js';
|
|
6
6
|
import * as Shorthands from '../../internal/Shorthands.js';
|
|
7
7
|
import * as Stylesheets from './Stylesheets.js';
|
|
8
|
-
import * as Theme from '../../Theme.js';
|
|
8
|
+
import * as Theme from '../../internal/Theme.js';
|
|
9
|
+
import * as VariableSets from '../../internal/VariableSets.js';
|
|
10
|
+
import * as Vars from '../../Vars.js';
|
|
9
11
|
import * as Token from '../../internal/Token.js';
|
|
10
12
|
/** Reads versioned JSON as validated data; never evaluates package code. */
|
|
11
13
|
export function read(source, identities, moduleId = '') {
|
|
12
14
|
const data = record(JSON.parse(source));
|
|
13
15
|
if (![
|
|
14
16
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
|
15
|
-
22, 23, 24,
|
|
17
|
+
22, 23, 24, 25, 26, 27,
|
|
16
18
|
].includes(data.version))
|
|
17
19
|
throw new Error('Unsupported Zyzz contract version.');
|
|
18
20
|
// Root controls arrived with version 18; older readers must treat them as absent.
|
|
@@ -40,20 +42,69 @@ export function read(source, identities, moduleId = '') {
|
|
|
40
42
|
for (const entry of Object.values(record(data.exports)))
|
|
41
43
|
collect(entry);
|
|
42
44
|
}
|
|
45
|
+
function decode(value) {
|
|
46
|
+
if (!value || typeof value !== 'object')
|
|
47
|
+
return value;
|
|
48
|
+
if (Array.isArray(value))
|
|
49
|
+
return value.map(decode);
|
|
50
|
+
const fields = record(value);
|
|
51
|
+
if (Object.hasOwn(fields, '$object'))
|
|
52
|
+
return Object.fromEntries(Object.entries(record(fields.$object)).map(([key, value]) => [
|
|
53
|
+
key,
|
|
54
|
+
decode(value),
|
|
55
|
+
]));
|
|
56
|
+
if (Object.hasOwn(fields, '$variable')) {
|
|
57
|
+
const reference = record(fields.$variable);
|
|
58
|
+
const identity = string(reference.identity);
|
|
59
|
+
let contract = identities.get(identity);
|
|
60
|
+
if (contract && !contract.variableSet)
|
|
61
|
+
throw new Error('Conflicting packed variable-set modes for one identity.');
|
|
62
|
+
if (!contract) {
|
|
63
|
+
contract = Object.freeze({
|
|
64
|
+
variableSet: true,
|
|
65
|
+
[Token.identity]: identity,
|
|
66
|
+
});
|
|
67
|
+
identities.set(identity, contract);
|
|
68
|
+
}
|
|
69
|
+
const resolved = decode(reference.value);
|
|
70
|
+
return Token.create({
|
|
71
|
+
contract,
|
|
72
|
+
group: VariableSets.domain(resolved),
|
|
73
|
+
path: string(reference.path),
|
|
74
|
+
value: resolved,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return Object.fromEntries(Object.entries(fields).map(([key, value]) => [key, decode(value)]));
|
|
78
|
+
}
|
|
43
79
|
const themes = Object.create(null);
|
|
44
80
|
const types = Object.create(null);
|
|
45
81
|
for (const [name, value] of Object.entries(record(data.themes))) {
|
|
46
82
|
const entry = record(value);
|
|
47
83
|
const identity = string(entry.identity);
|
|
84
|
+
if (entry.variableSet === true && data.version < 26)
|
|
85
|
+
throw new Error('Vars contracts require contract version 26 or later.');
|
|
86
|
+
const mappings = VariableSets.mappings(entry.mappings);
|
|
48
87
|
if (entry.cssOutput !== undefined &&
|
|
49
88
|
entry.cssOutput !== 'atomic' &&
|
|
50
89
|
entry.cssOutput !== 'grouped')
|
|
51
90
|
throw new Error('Invalid packed CSS output mode.');
|
|
52
91
|
const cssOutput = (entry.cssOutput ?? legacyModes.get(identity));
|
|
92
|
+
if (entry.defaultLayer !== undefined) {
|
|
93
|
+
if (data.version < 27)
|
|
94
|
+
throw new Error('Default layers require contract version 27 or later.');
|
|
95
|
+
Config.create({ defaultLayer: entry.defaultLayer });
|
|
96
|
+
}
|
|
97
|
+
const defaultLayer = entry.defaultLayer;
|
|
53
98
|
const shorthands = entry.shorthands !== undefined
|
|
54
99
|
? Shorthands.read(entry.shorthands)
|
|
55
100
|
: undefined;
|
|
56
101
|
let contract = identities.get(identity);
|
|
102
|
+
if (contract &&
|
|
103
|
+
Boolean(contract.variableSet) !== (entry.variableSet === true))
|
|
104
|
+
throw new Error('Conflicting packed variable-set modes for one identity.');
|
|
105
|
+
if (contract &&
|
|
106
|
+
JSON.stringify(contract.mappings ?? {}) !== JSON.stringify(mappings ?? {}))
|
|
107
|
+
throw new Error('Conflicting packed variable mappings for one identity.');
|
|
57
108
|
if (contract &&
|
|
58
109
|
Shorthands.signature(contract.shorthands) !==
|
|
59
110
|
Shorthands.signature(shorthands))
|
|
@@ -61,21 +112,36 @@ export function read(source, identities, moduleId = '') {
|
|
|
61
112
|
if (contract &&
|
|
62
113
|
(contract.cssOutput ?? 'atomic') !== (cssOutput ?? 'atomic'))
|
|
63
114
|
throw new Error('Conflicting packed CSS output modes for one theme identity.');
|
|
115
|
+
if (contract && contract.defaultLayer !== defaultLayer)
|
|
116
|
+
throw new Error('Conflicting packed default layers for one theme identity.');
|
|
64
117
|
if (!contract) {
|
|
65
118
|
contract = Object.freeze({
|
|
119
|
+
...(entry.variableSet === true
|
|
120
|
+
? {
|
|
121
|
+
variableSet: true,
|
|
122
|
+
mappings,
|
|
123
|
+
}
|
|
124
|
+
: {}),
|
|
66
125
|
...(entry.shorthands !== undefined
|
|
67
126
|
? { shorthands: Shorthands.read(entry.shorthands) }
|
|
68
127
|
: {}),
|
|
69
128
|
...(cssOutput ? { cssOutput } : {}),
|
|
129
|
+
...(defaultLayer !== undefined ? { defaultLayer } : {}),
|
|
70
130
|
[Token.complete]: true,
|
|
71
131
|
[Token.identity]: identity,
|
|
72
132
|
});
|
|
73
133
|
identities.set(identity, contract);
|
|
74
134
|
}
|
|
75
|
-
const definition =
|
|
135
|
+
const definition = entry.variableSet === true
|
|
136
|
+
? VariableSets.theme(Vars.define(decode(entry.tokens)), mappings)
|
|
137
|
+
: Theme.define(record(entry.tokens));
|
|
76
138
|
if (data.version < 24 &&
|
|
77
139
|
Object.hasOwn(definition.tokens, 'typography'))
|
|
78
140
|
throw new Error('Packed typography sets require contract version 24 or later.');
|
|
141
|
+
if (data.version < 25 &&
|
|
142
|
+
(definition[Token.definition].paths ||
|
|
143
|
+
Object.hasOwn(definition.tokens, 'borderWidth')))
|
|
144
|
+
throw new Error('Packed responsive typography and border widths require contract version 25 or later.');
|
|
79
145
|
themes[name] = Token.bind(definition, contract);
|
|
80
146
|
types[name] = type(input(definition));
|
|
81
147
|
}
|
|
@@ -146,7 +212,8 @@ export function read(source, identities, moduleId = '') {
|
|
|
146
212
|
const name = string(entry.name);
|
|
147
213
|
const reference = string(entry.reference);
|
|
148
214
|
if (![
|
|
149
|
-
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
|
215
|
+
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
|
|
216
|
+
27,
|
|
150
217
|
].includes(data.version) ||
|
|
151
218
|
![
|
|
152
219
|
'cssFunction',
|
|
@@ -188,8 +255,7 @@ export function read(source, identities, moduleId = '') {
|
|
|
188
255
|
};
|
|
189
256
|
}
|
|
190
257
|
if (entry.kind === 'style-reference') {
|
|
191
|
-
if (entry.style !== undefined &&
|
|
192
|
-
![16, 17, 18, 19, 20, 21, 22, 23, 24].includes(data.version))
|
|
258
|
+
if (entry.style !== undefined && data.version < 16)
|
|
193
259
|
throw new Error('Packed callable styles require contract version 16 or later.');
|
|
194
260
|
const binding = string(entry.binding);
|
|
195
261
|
if (!/^z-style-[a-z0-9_-]+$/.test(binding))
|
|
@@ -239,13 +305,19 @@ export function read(source, identities, moduleId = '') {
|
|
|
239
305
|
link(value),
|
|
240
306
|
]))
|
|
241
307
|
: undefined;
|
|
242
|
-
const options = entry.options === undefined ? undefined : record(entry.options);
|
|
308
|
+
const options = entry.options === undefined ? undefined : record(decode(entry.options));
|
|
243
309
|
if (options) {
|
|
244
|
-
|
|
310
|
+
if (entry.variableConfig === true)
|
|
311
|
+
Config.create(variableOptions(options, entry.variableMappings));
|
|
312
|
+
else
|
|
313
|
+
Config.create(options);
|
|
245
314
|
if (data.version >= 17 &&
|
|
246
315
|
(options.cssOutput ?? 'atomic') !==
|
|
247
316
|
(definition[Token.definition].contract.cssOutput ?? 'atomic'))
|
|
248
317
|
throw new Error('Configuration CSS output disagrees with linked theme metadata.');
|
|
318
|
+
if (options.defaultLayer !==
|
|
319
|
+
definition[Token.definition].contract.defaultLayer)
|
|
320
|
+
throw new Error('Configuration default layer disagrees with linked theme metadata.');
|
|
249
321
|
if (Shorthands.signature(options.shorthands) !==
|
|
250
322
|
Shorthands.signature(definition[Token.definition].contract.shorthands))
|
|
251
323
|
throw new Error('Configuration mappings disagree with linked theme metadata.');
|
|
@@ -253,7 +325,9 @@ export function read(source, identities, moduleId = '') {
|
|
|
253
325
|
const catalogOnly = !!options?.themes &&
|
|
254
326
|
(data.version < 4 || entry.catalogOnly === true);
|
|
255
327
|
const fullConfigType = options
|
|
256
|
-
?
|
|
328
|
+
? entry.variableConfig === true
|
|
329
|
+
? `import('zyzz').Config.VariableConfig<${Configurations.type(variableOptions(options, entry.variableMappings))}>`
|
|
330
|
+
: `import('zyzz').Config.create.ReturnType<${Configurations.type(options)}>`
|
|
257
331
|
: '';
|
|
258
332
|
// Helpers a legacy library did not compile are hidden from its consumers' types.
|
|
259
333
|
const hidden = [
|
|
@@ -271,6 +345,24 @@ export function read(source, identities, moduleId = '') {
|
|
|
271
345
|
return {
|
|
272
346
|
binding: string(entry.binding),
|
|
273
347
|
call: {
|
|
348
|
+
...(entry.variableSet === true
|
|
349
|
+
? {
|
|
350
|
+
variableSet: true,
|
|
351
|
+
type: `import('zyzz').Vars.Definition<${types[theme]}>`,
|
|
352
|
+
}
|
|
353
|
+
: {}),
|
|
354
|
+
...(entry.directVariables === true
|
|
355
|
+
? {
|
|
356
|
+
directVariables: true,
|
|
357
|
+
type: `import('zyzz').Vars.${entry.variableSet === true ? 'Definition' : 'References'}<${types[theme]}>`,
|
|
358
|
+
}
|
|
359
|
+
: {}),
|
|
360
|
+
...(entry.variableConfig === true
|
|
361
|
+
? {
|
|
362
|
+
variableConfig: true,
|
|
363
|
+
variableMappings: entry.variableMappings,
|
|
364
|
+
}
|
|
365
|
+
: {}),
|
|
274
366
|
...(entry.recipe === true ? { recipe: true } : {}),
|
|
275
367
|
...(entry.output === 'html' ? { output: 'html' } : {}),
|
|
276
368
|
...(catalogOnly ? { catalogOnly: true } : {}),
|
|
@@ -294,7 +386,7 @@ export function read(source, identities, moduleId = '') {
|
|
|
294
386
|
...(options
|
|
295
387
|
? {
|
|
296
388
|
options,
|
|
297
|
-
type: `${outputType}${entry.initialization === true ? "['script']" : entry.root === true ? "['appearance']" : entry.selection === true ? "['themes']" : ''}`,
|
|
389
|
+
type: `${outputType}${entry.initialization === true ? "['script']" : entry.root === true ? "['appearance']" : entry.selection === true ? (entry.variableConfig === true ? "['vars']" : "['themes']") : ''}`,
|
|
298
390
|
}
|
|
299
391
|
: {}),
|
|
300
392
|
...(members
|
|
@@ -339,6 +431,8 @@ function tokens(tree) {
|
|
|
339
431
|
]));
|
|
340
432
|
}
|
|
341
433
|
function type(value) {
|
|
434
|
+
if (Token.is(value))
|
|
435
|
+
return Configurations.type(value);
|
|
342
436
|
if (Array.isArray(value))
|
|
343
437
|
return `readonly [${value.map(type).join(',')}]`;
|
|
344
438
|
if (!value || typeof value !== 'object')
|
|
@@ -392,6 +486,11 @@ export function write(links, themes, stylesheets = [], moduleId = '', configurat
|
|
|
392
486
|
: {}),
|
|
393
487
|
};
|
|
394
488
|
return {
|
|
489
|
+
...(link.call.variableSet ? { variableSet: true } : {}),
|
|
490
|
+
...(link.call.directVariables ? { directVariables: true } : {}),
|
|
491
|
+
...(link.call.variableConfig
|
|
492
|
+
? { variableConfig: true, variableMappings: link.call.variableMappings }
|
|
493
|
+
: {}),
|
|
395
494
|
...(link.call.recipe ? { recipe: true } : {}),
|
|
396
495
|
...(link.call.output ? { output: link.call.output } : {}),
|
|
397
496
|
...(link.call.script &&
|
|
@@ -408,7 +507,7 @@ export function write(links, themes, stylesheets = [], moduleId = '', configurat
|
|
|
408
507
|
...(link.call.selection ? { selection: true } : {}),
|
|
409
508
|
...(link.call.initialization ? { initialization: true } : {}),
|
|
410
509
|
...(link.call.root ? { root: true } : {}),
|
|
411
|
-
...(link.call.options ? { options: link.call.options } : {}),
|
|
510
|
+
...(link.call.options ? { options: encode(link.call.options) } : {}),
|
|
412
511
|
...(link.members
|
|
413
512
|
? {
|
|
414
513
|
members: Object.fromEntries(Object.entries(link.members).map(([key, link]) => [
|
|
@@ -433,14 +532,30 @@ export function write(links, themes, stylesheets = [], moduleId = '', configurat
|
|
|
433
532
|
...(theme[Token.definition].contract.shorthands
|
|
434
533
|
? { shorthands: theme[Token.definition].contract.shorthands }
|
|
435
534
|
: {}),
|
|
535
|
+
...(theme[Token.definition].contract.defaultLayer !== undefined
|
|
536
|
+
? { defaultLayer: theme[Token.definition].contract.defaultLayer }
|
|
537
|
+
: {}),
|
|
436
538
|
...(theme[Token.definition].contract.cssOutput
|
|
437
539
|
? { cssOutput: theme[Token.definition].contract.cssOutput }
|
|
438
540
|
: {}),
|
|
541
|
+
...(theme[Token.definition].contract.variableSet
|
|
542
|
+
? {
|
|
543
|
+
variableSet: true,
|
|
544
|
+
mappings: theme[Token.definition].contract.mappings,
|
|
545
|
+
}
|
|
546
|
+
: {}),
|
|
439
547
|
identity: theme[Token.definition].contract[Token.identity],
|
|
440
|
-
tokens: input(theme),
|
|
548
|
+
tokens: encode(input(theme)),
|
|
441
549
|
},
|
|
442
550
|
])),
|
|
443
551
|
version: (() => {
|
|
552
|
+
if (Object.values(themes).some((theme) => theme[Token.definition].contract.defaultLayer !== undefined))
|
|
553
|
+
return 27;
|
|
554
|
+
if (Object.values(themes).some((theme) => theme[Token.definition].contract.variableSet))
|
|
555
|
+
return 26;
|
|
556
|
+
if (Object.values(themes).some((theme) => theme[Token.definition].paths ||
|
|
557
|
+
Object.hasOwn(theme.tokens, 'borderWidth')))
|
|
558
|
+
return 25;
|
|
444
559
|
if (Object.values(themes).some((theme) => Object.hasOwn(theme.tokens, 'typography')))
|
|
445
560
|
return 24;
|
|
446
561
|
function callable(link) {
|
|
@@ -604,4 +719,31 @@ function extended(signature) {
|
|
|
604
719
|
return (/[\\\u0080-\uffff]/.test(signature.returns) ||
|
|
605
720
|
signature.parameters.some((parameter) => /[\\\u0080-\uffff]/.test(parameter.name + (parameter.syntax ?? '*'))));
|
|
606
721
|
}
|
|
722
|
+
function encode(value) {
|
|
723
|
+
if (Token.is(value))
|
|
724
|
+
return {
|
|
725
|
+
$variable: {
|
|
726
|
+
identity: value.contract[Token.identity],
|
|
727
|
+
path: value.path,
|
|
728
|
+
value: encode(value.value),
|
|
729
|
+
},
|
|
730
|
+
};
|
|
731
|
+
if (Array.isArray(value))
|
|
732
|
+
return value.map(encode);
|
|
733
|
+
if (!value || typeof value !== 'object')
|
|
734
|
+
return value;
|
|
735
|
+
const fields = Object.fromEntries(Object.entries(value).map(([key, value]) => [key, encode(value)]));
|
|
736
|
+
return Object.hasOwn(fields, '$variable') || Object.hasOwn(fields, '$object')
|
|
737
|
+
? { $object: fields }
|
|
738
|
+
: fields;
|
|
739
|
+
}
|
|
740
|
+
function variableOptions(options, mappings) {
|
|
741
|
+
const { theme, themes, defaultTheme, ...rest } = options;
|
|
742
|
+
return {
|
|
743
|
+
...rest,
|
|
744
|
+
vars: (themes ?? theme),
|
|
745
|
+
...(themes ? { defaultVars: String(defaultTheme) } : {}),
|
|
746
|
+
...(mappings !== undefined ? { mappings } : {}),
|
|
747
|
+
};
|
|
748
|
+
}
|
|
607
749
|
//# sourceMappingURL=Contract.js.map
|