@panneau/protocol 5.0.0-alpha.1 → 5.0.0-alpha.2
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 +10 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/openapi.d.ts +2 -0
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +12 -1
- package/dist/openapi.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -1
- package/dist/schemas/definition.d.ts +54 -1
- package/dist/schemas/definition.d.ts.map +1 -1
- package/dist/schemas/definition.js +2 -5
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/index.d.ts +224 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +10 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/theme.d.ts +179 -0
- package/dist/schemas/theme.d.ts.map +1 -0
- package/dist/schemas/theme.js +66 -0
- package/dist/schemas/theme.js.map +1 -0
- package/dist/themes.d.ts +11 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +80 -0
- package/dist/themes.js.map +1 -0
- package/package.json +2 -1
- package/schema/boot.schema.json +255 -12
- package/schema/definition.schema.json +255 -12
- package/schema/openapi.json +418 -12
- package/schema/theme.schema.json +234 -0
package/dist/themes.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//#region src/themes.ts
|
|
2
|
+
function mergeRecords(first, second) {
|
|
3
|
+
return first === void 0 && second === void 0 ? void 0 : {
|
|
4
|
+
...first,
|
|
5
|
+
...second
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function mergeComponents(first, second) {
|
|
9
|
+
const components = mergeRecords(first, second);
|
|
10
|
+
if (components === void 0) return;
|
|
11
|
+
return Object.fromEntries(Object.keys(components).map((component) => {
|
|
12
|
+
const before = first?.[component];
|
|
13
|
+
const after = second?.[component];
|
|
14
|
+
const variants = mergeRecords(before?.variants, after?.variants);
|
|
15
|
+
return [component, {
|
|
16
|
+
...before,
|
|
17
|
+
...after,
|
|
18
|
+
...variants !== void 0 && { variants: Object.fromEntries(Object.keys(variants).map((name) => [name, {
|
|
19
|
+
...before?.variants?.[name],
|
|
20
|
+
...after?.variants?.[name]
|
|
21
|
+
}])) }
|
|
22
|
+
}];
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
var DENSITIES = [
|
|
26
|
+
"compact",
|
|
27
|
+
"comfortable",
|
|
28
|
+
"touch"
|
|
29
|
+
];
|
|
30
|
+
function mergeDensities(first, second) {
|
|
31
|
+
if (first === void 0 && second === void 0) return;
|
|
32
|
+
const densities = {
|
|
33
|
+
...first,
|
|
34
|
+
...second
|
|
35
|
+
};
|
|
36
|
+
DENSITIES.forEach((density) => {
|
|
37
|
+
if (first?.[density] !== void 0 && second?.[density] !== void 0) densities[density] = {
|
|
38
|
+
...first[density],
|
|
39
|
+
...second[density]
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return densities;
|
|
43
|
+
}
|
|
44
|
+
function mergeFonts(first, second) {
|
|
45
|
+
if (first === void 0 && second === void 0) return;
|
|
46
|
+
const fonts = [...first ?? [], ...second ?? []];
|
|
47
|
+
return fonts.filter((font, index) => fonts.findIndex((other) => JSON.stringify(other) === JSON.stringify(font)) === index);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Merges themes, in order: each one overrides the tokens, palette colors, tones and variants of
|
|
51
|
+
* those before it. A token a theme sets in `tokens` but not in `dark` applies to both schemes, so it
|
|
52
|
+
* also replaces the dark value of earlier themes. Variants merge token by token; tones are replaced
|
|
53
|
+
* whole; densities merge token by token; fonts add up. The label is the last one set. `defineTheme()` of `@panneau/ui` merges the same way.
|
|
54
|
+
*/
|
|
55
|
+
function mergeThemes(...themes) {
|
|
56
|
+
return themes.reduce((merged, theme) => {
|
|
57
|
+
const tokens = theme.tokens ?? {};
|
|
58
|
+
const dark = mergeRecords(merged.dark !== void 0 ? Object.fromEntries(Object.entries(merged.dark).filter(([name]) => !Object.hasOwn(tokens, name))) : void 0, theme.dark);
|
|
59
|
+
const result = {
|
|
60
|
+
...merged,
|
|
61
|
+
...theme,
|
|
62
|
+
label: theme.label ?? merged.label,
|
|
63
|
+
tokens: {
|
|
64
|
+
...merged.tokens,
|
|
65
|
+
...tokens
|
|
66
|
+
},
|
|
67
|
+
dark: dark !== void 0 && Object.keys(dark).length > 0 ? dark : void 0,
|
|
68
|
+
palette: mergeRecords(merged.palette, theme.palette),
|
|
69
|
+
tones: mergeRecords(merged.tones, theme.tones),
|
|
70
|
+
components: mergeComponents(merged.components, theme.components),
|
|
71
|
+
densities: mergeDensities(merged.densities, theme.densities),
|
|
72
|
+
fonts: mergeFonts(merged.fonts, theme.fonts)
|
|
73
|
+
};
|
|
74
|
+
return Object.fromEntries(Object.entries(result).filter(([, value]) => value !== void 0));
|
|
75
|
+
}, { tokens: {} });
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { mergeThemes };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=themes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.js","names":[],"sources":["../src/themes.ts"],"sourcesContent":["import type { Theme } from './schemas/theme';\n\n/** A theme to merge: `tokens` can be left out, as in the theme of a definition. */\nexport type PartialTheme = Partial<Theme>;\n\nfunction mergeRecords<T>(\n first: Record<string, T> | undefined,\n second: Record<string, T> | undefined,\n): Record<string, T> | undefined {\n return first === undefined && second === undefined ? undefined : { ...first, ...second };\n}\n\nfunction mergeComponents(\n first: Theme['components'],\n second: Theme['components'],\n): Theme['components'] {\n const components = mergeRecords(first, second);\n if (components === undefined) {\n return undefined;\n }\n return Object.fromEntries(\n Object.keys(components).map((component) => {\n const before = first?.[component];\n const after = second?.[component];\n const variants = mergeRecords(before?.variants, after?.variants);\n return [\n component,\n {\n ...before,\n ...after,\n ...(variants !== undefined && {\n variants: Object.fromEntries(\n Object.keys(variants).map((name) => [\n name,\n { ...before?.variants?.[name], ...after?.variants?.[name] },\n ]),\n ),\n }),\n },\n ];\n }),\n );\n}\n\nconst DENSITIES = ['compact', 'comfortable', 'touch'] as const;\n\nfunction mergeDensities(first: Theme['densities'], second: Theme['densities']): Theme['densities'] {\n if (first === undefined && second === undefined) {\n return undefined;\n }\n const densities = { ...first, ...second };\n DENSITIES.forEach((density) => {\n if (first?.[density] !== undefined && second?.[density] !== undefined) {\n densities[density] = { ...first[density], ...second[density] };\n }\n });\n return densities;\n}\n\nfunction mergeFonts(first: Theme['fonts'], second: Theme['fonts']): Theme['fonts'] {\n if (first === undefined && second === undefined) {\n return undefined;\n }\n const fonts = [...(first ?? []), ...(second ?? [])];\n return fonts.filter(\n (font, index) =>\n fonts.findIndex((other) => JSON.stringify(other) === JSON.stringify(font)) === index,\n );\n}\n\n/**\n * Merges themes, in order: each one overrides the tokens, palette colors, tones and variants of\n * those before it. A token a theme sets in `tokens` but not in `dark` applies to both schemes, so it\n * also replaces the dark value of earlier themes. Variants merge token by token; tones are replaced\n * whole; densities merge token by token; fonts add up. The label is the last one set. `defineTheme()` of `@panneau/ui` merges the same way.\n */\nexport function mergeThemes(...themes: readonly PartialTheme[]): Theme {\n return themes.reduce<Theme>(\n (merged, theme) => {\n const tokens = theme.tokens ?? {};\n const dark = mergeRecords(\n merged.dark !== undefined\n ? Object.fromEntries(\n Object.entries(merged.dark).filter(\n ([name]) => !Object.hasOwn(tokens, name),\n ),\n )\n : undefined,\n theme.dark,\n );\n const result: Theme = {\n ...merged,\n ...theme,\n label: theme.label ?? merged.label,\n tokens: { ...merged.tokens, ...tokens },\n dark: dark !== undefined && Object.keys(dark).length > 0 ? dark : undefined,\n palette: mergeRecords(merged.palette, theme.palette),\n tones: mergeRecords(merged.tones, theme.tones),\n components: mergeComponents(merged.components, theme.components),\n densities: mergeDensities(merged.densities, theme.densities),\n fonts: mergeFonts(merged.fonts, theme.fonts),\n };\n return Object.fromEntries(\n Object.entries(result).filter(([, value]) => value !== undefined),\n ) as Theme;\n },\n { tokens: {} },\n );\n}\n"],"mappings":";AAKA,SAAS,aACL,OACA,QAC6B;CAC7B,OAAO,UAAU,KAAA,KAAa,WAAW,KAAA,IAAY,KAAA,IAAY;EAAE,GAAG;EAAO,GAAG;CAAO;AAC3F;AAEA,SAAS,gBACL,OACA,QACmB;CACnB,MAAM,aAAa,aAAa,OAAO,MAAM;CAC7C,IAAI,eAAe,KAAA,GACf;CAEJ,OAAO,OAAO,YACV,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK,cAAc;EACvC,MAAM,SAAS,QAAQ;EACvB,MAAM,QAAQ,SAAS;EACvB,MAAM,WAAW,aAAa,QAAQ,UAAU,OAAO,QAAQ;EAC/D,OAAO,CACH,WACA;GACI,GAAG;GACH,GAAG;GACH,GAAI,aAAa,KAAA,KAAa,EAC1B,UAAU,OAAO,YACb,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAK,SAAS,CAChC,MACA;IAAE,GAAG,QAAQ,WAAW;IAAO,GAAG,OAAO,WAAW;GAAM,CAC9D,CAAC,CACL,EACJ;EACJ,CACJ;CACJ,CAAC,CACL;AACJ;AAEA,IAAM,YAAY;CAAC;CAAW;CAAe;AAAO;AAEpD,SAAS,eAAe,OAA2B,QAAgD;CAC/F,IAAI,UAAU,KAAA,KAAa,WAAW,KAAA,GAClC;CAEJ,MAAM,YAAY;EAAE,GAAG;EAAO,GAAG;CAAO;CACxC,UAAU,SAAS,YAAY;EAC3B,IAAI,QAAQ,aAAa,KAAA,KAAa,SAAS,aAAa,KAAA,GACxD,UAAU,WAAW;GAAE,GAAG,MAAM;GAAU,GAAG,OAAO;EAAS;CAErE,CAAC;CACD,OAAO;AACX;AAEA,SAAS,WAAW,OAAuB,QAAwC;CAC/E,IAAI,UAAU,KAAA,KAAa,WAAW,KAAA,GAClC;CAEJ,MAAM,QAAQ,CAAC,GAAI,SAAS,CAAC,GAAI,GAAI,UAAU,CAAC,CAAE;CAClD,OAAO,MAAM,QACR,MAAM,UACH,MAAM,WAAW,UAAU,KAAK,UAAU,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC,MAAM,KACvF;AACJ;;;;;;;AAQA,SAAgB,YAAY,GAAG,QAAwC;CACnE,OAAO,OAAO,QACT,QAAQ,UAAU;EACf,MAAM,SAAS,MAAM,UAAU,CAAC;EAChC,MAAM,OAAO,aACT,OAAO,SAAS,KAAA,IACV,OAAO,YACH,OAAO,QAAQ,OAAO,IAAI,CAAC,CAAC,QACvB,CAAC,UAAU,CAAC,OAAO,OAAO,QAAQ,IAAI,CAC3C,CACJ,IACA,KAAA,GACN,MAAM,IACV;EACA,MAAM,SAAgB;GAClB,GAAG;GACH,GAAG;GACH,OAAO,MAAM,SAAS,OAAO;GAC7B,QAAQ;IAAE,GAAG,OAAO;IAAQ,GAAG;GAAO;GACtC,MAAM,SAAS,KAAA,KAAa,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,KAAA;GAClE,SAAS,aAAa,OAAO,SAAS,MAAM,OAAO;GACnD,OAAO,aAAa,OAAO,OAAO,MAAM,KAAK;GAC7C,YAAY,gBAAgB,OAAO,YAAY,MAAM,UAAU;GAC/D,WAAW,eAAe,OAAO,WAAW,MAAM,SAAS;GAC3D,OAAO,WAAW,OAAO,OAAO,MAAM,KAAK;EAC/C;EACA,OAAO,OAAO,YACV,OAAO,QAAQ,MAAM,CAAC,CAAC,QAAQ,GAAG,WAAW,UAAU,KAAA,CAAS,CACpE;CACJ,GACA,EAAE,QAAQ,CAAC,EAAE,CACjB;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/protocol",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.2",
|
|
4
4
|
"description": "The Panneau protocol: definition schema, HTTP API spec and conformance kit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"./definition.schema.json": "./schema/definition.schema.json",
|
|
35
35
|
"./openapi.json": "./schema/openapi.json",
|
|
36
36
|
"./boot.schema.json": "./schema/boot.schema.json",
|
|
37
|
+
"./theme.schema.json": "./schema/theme.schema.json",
|
|
37
38
|
"./package.json": "./package.json"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|
package/schema/boot.schema.json
CHANGED
|
@@ -141,18 +141,7 @@
|
|
|
141
141
|
"$ref": "#/$defs/Uploads"
|
|
142
142
|
},
|
|
143
143
|
"theme": {
|
|
144
|
-
"
|
|
145
|
-
"properties": {
|
|
146
|
-
"colorScheme": {
|
|
147
|
-
"type": "string",
|
|
148
|
-
"enum": [
|
|
149
|
-
"light",
|
|
150
|
-
"dark",
|
|
151
|
-
"auto"
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
"additionalProperties": {}
|
|
144
|
+
"$ref": "#/$defs/DefinitionTheme"
|
|
156
145
|
},
|
|
157
146
|
"user": {
|
|
158
147
|
"anyOf": [
|
|
@@ -1196,6 +1185,260 @@
|
|
|
1196
1185
|
],
|
|
1197
1186
|
"additionalProperties": {}
|
|
1198
1187
|
},
|
|
1188
|
+
"DefinitionTheme": {
|
|
1189
|
+
"type": "object",
|
|
1190
|
+
"properties": {
|
|
1191
|
+
"label": {
|
|
1192
|
+
"type": "string"
|
|
1193
|
+
},
|
|
1194
|
+
"tokens": {
|
|
1195
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1196
|
+
},
|
|
1197
|
+
"dark": {
|
|
1198
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1199
|
+
},
|
|
1200
|
+
"palette": {
|
|
1201
|
+
"type": "object",
|
|
1202
|
+
"propertyNames": {
|
|
1203
|
+
"type": "string",
|
|
1204
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1205
|
+
},
|
|
1206
|
+
"additionalProperties": {
|
|
1207
|
+
"type": "string",
|
|
1208
|
+
"pattern": "^[^{};<]*$"
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
"tones": {
|
|
1212
|
+
"type": "object",
|
|
1213
|
+
"propertyNames": {
|
|
1214
|
+
"type": "string",
|
|
1215
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1216
|
+
},
|
|
1217
|
+
"additionalProperties": {
|
|
1218
|
+
"$ref": "#/$defs/ToneInput"
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
"components": {
|
|
1222
|
+
"type": "object",
|
|
1223
|
+
"propertyNames": {
|
|
1224
|
+
"type": "string",
|
|
1225
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1226
|
+
},
|
|
1227
|
+
"additionalProperties": {
|
|
1228
|
+
"type": "object",
|
|
1229
|
+
"properties": {
|
|
1230
|
+
"variants": {
|
|
1231
|
+
"type": "object",
|
|
1232
|
+
"propertyNames": {
|
|
1233
|
+
"type": "string",
|
|
1234
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1235
|
+
},
|
|
1236
|
+
"additionalProperties": {
|
|
1237
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
"additionalProperties": {}
|
|
1242
|
+
}
|
|
1243
|
+
},
|
|
1244
|
+
"densities": {
|
|
1245
|
+
"type": "object",
|
|
1246
|
+
"properties": {
|
|
1247
|
+
"compact": {
|
|
1248
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1249
|
+
},
|
|
1250
|
+
"comfortable": {
|
|
1251
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1252
|
+
},
|
|
1253
|
+
"touch": {
|
|
1254
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
"additionalProperties": {}
|
|
1258
|
+
},
|
|
1259
|
+
"fonts": {
|
|
1260
|
+
"type": "array",
|
|
1261
|
+
"items": {
|
|
1262
|
+
"$ref": "#/$defs/ThemeFont"
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
"colorScheme": {
|
|
1266
|
+
"type": "string",
|
|
1267
|
+
"enum": [
|
|
1268
|
+
"light",
|
|
1269
|
+
"dark",
|
|
1270
|
+
"auto"
|
|
1271
|
+
]
|
|
1272
|
+
},
|
|
1273
|
+
"density": {
|
|
1274
|
+
"type": "string",
|
|
1275
|
+
"enum": [
|
|
1276
|
+
"compact",
|
|
1277
|
+
"comfortable",
|
|
1278
|
+
"touch",
|
|
1279
|
+
"auto"
|
|
1280
|
+
]
|
|
1281
|
+
},
|
|
1282
|
+
"extends": {
|
|
1283
|
+
"anyOf": [
|
|
1284
|
+
{
|
|
1285
|
+
"type": "string"
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
"type": "array",
|
|
1289
|
+
"items": {
|
|
1290
|
+
"type": "string"
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
]
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
"additionalProperties": {}
|
|
1297
|
+
},
|
|
1298
|
+
"ThemeTokens": {
|
|
1299
|
+
"type": "object",
|
|
1300
|
+
"propertyNames": {
|
|
1301
|
+
"type": "string",
|
|
1302
|
+
"pattern": "^[a-zA-Z0-9_-]+$"
|
|
1303
|
+
},
|
|
1304
|
+
"additionalProperties": {
|
|
1305
|
+
"type": "string",
|
|
1306
|
+
"pattern": "^[^{};<]*$"
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
"ToneInput": {
|
|
1310
|
+
"anyOf": [
|
|
1311
|
+
{
|
|
1312
|
+
"type": "string"
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
"type": "object",
|
|
1316
|
+
"properties": {
|
|
1317
|
+
"text": {
|
|
1318
|
+
"type": "string"
|
|
1319
|
+
},
|
|
1320
|
+
"subtle": {
|
|
1321
|
+
"type": "string"
|
|
1322
|
+
},
|
|
1323
|
+
"border": {
|
|
1324
|
+
"type": "string"
|
|
1325
|
+
},
|
|
1326
|
+
"outline": {
|
|
1327
|
+
"type": "string"
|
|
1328
|
+
},
|
|
1329
|
+
"solid": {
|
|
1330
|
+
"type": "string"
|
|
1331
|
+
},
|
|
1332
|
+
"solidHover": {
|
|
1333
|
+
"type": "string"
|
|
1334
|
+
},
|
|
1335
|
+
"solidText": {
|
|
1336
|
+
"type": "string"
|
|
1337
|
+
},
|
|
1338
|
+
"dark": {
|
|
1339
|
+
"type": "object",
|
|
1340
|
+
"properties": {
|
|
1341
|
+
"text": {
|
|
1342
|
+
"type": "string"
|
|
1343
|
+
},
|
|
1344
|
+
"subtle": {
|
|
1345
|
+
"type": "string"
|
|
1346
|
+
},
|
|
1347
|
+
"border": {
|
|
1348
|
+
"type": "string"
|
|
1349
|
+
},
|
|
1350
|
+
"outline": {
|
|
1351
|
+
"type": "string"
|
|
1352
|
+
},
|
|
1353
|
+
"solid": {
|
|
1354
|
+
"type": "string"
|
|
1355
|
+
},
|
|
1356
|
+
"solidHover": {
|
|
1357
|
+
"type": "string"
|
|
1358
|
+
},
|
|
1359
|
+
"solidText": {
|
|
1360
|
+
"type": "string"
|
|
1361
|
+
}
|
|
1362
|
+
},
|
|
1363
|
+
"additionalProperties": {}
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1366
|
+
"required": [
|
|
1367
|
+
"text",
|
|
1368
|
+
"subtle",
|
|
1369
|
+
"border",
|
|
1370
|
+
"outline",
|
|
1371
|
+
"solid",
|
|
1372
|
+
"solidHover",
|
|
1373
|
+
"solidText"
|
|
1374
|
+
],
|
|
1375
|
+
"additionalProperties": {}
|
|
1376
|
+
}
|
|
1377
|
+
]
|
|
1378
|
+
},
|
|
1379
|
+
"ThemeFont": {
|
|
1380
|
+
"anyOf": [
|
|
1381
|
+
{
|
|
1382
|
+
"$ref": "#/$defs/ThemeFontFace"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"$ref": "#/$defs/ThemeFontStylesheet"
|
|
1386
|
+
}
|
|
1387
|
+
]
|
|
1388
|
+
},
|
|
1389
|
+
"ThemeFontFace": {
|
|
1390
|
+
"type": "object",
|
|
1391
|
+
"properties": {
|
|
1392
|
+
"family": {
|
|
1393
|
+
"type": "string",
|
|
1394
|
+
"pattern": "^[^{}<;\"\\\\]+$"
|
|
1395
|
+
},
|
|
1396
|
+
"src": {
|
|
1397
|
+
"type": "string",
|
|
1398
|
+
"pattern": "^[^{}<]+$"
|
|
1399
|
+
},
|
|
1400
|
+
"weight": {
|
|
1401
|
+
"type": "string",
|
|
1402
|
+
"pattern": "^[^{}<;]*$"
|
|
1403
|
+
},
|
|
1404
|
+
"style": {
|
|
1405
|
+
"type": "string",
|
|
1406
|
+
"pattern": "^[^{}<;]*$"
|
|
1407
|
+
},
|
|
1408
|
+
"display": {
|
|
1409
|
+
"type": "string",
|
|
1410
|
+
"enum": [
|
|
1411
|
+
"auto",
|
|
1412
|
+
"block",
|
|
1413
|
+
"swap",
|
|
1414
|
+
"fallback",
|
|
1415
|
+
"optional"
|
|
1416
|
+
]
|
|
1417
|
+
},
|
|
1418
|
+
"unicodeRange": {
|
|
1419
|
+
"type": "string",
|
|
1420
|
+
"pattern": "^[^{}<;]*$"
|
|
1421
|
+
}
|
|
1422
|
+
},
|
|
1423
|
+
"required": [
|
|
1424
|
+
"family",
|
|
1425
|
+
"src"
|
|
1426
|
+
],
|
|
1427
|
+
"additionalProperties": {}
|
|
1428
|
+
},
|
|
1429
|
+
"ThemeFontStylesheet": {
|
|
1430
|
+
"type": "object",
|
|
1431
|
+
"properties": {
|
|
1432
|
+
"stylesheet": {
|
|
1433
|
+
"type": "string",
|
|
1434
|
+
"minLength": 1
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1437
|
+
"required": [
|
|
1438
|
+
"stylesheet"
|
|
1439
|
+
],
|
|
1440
|
+
"additionalProperties": {}
|
|
1441
|
+
},
|
|
1199
1442
|
"User": {
|
|
1200
1443
|
"type": "object",
|
|
1201
1444
|
"properties": {
|
|
@@ -107,18 +107,7 @@
|
|
|
107
107
|
"$ref": "#/$defs/Uploads"
|
|
108
108
|
},
|
|
109
109
|
"theme": {
|
|
110
|
-
"
|
|
111
|
-
"properties": {
|
|
112
|
-
"colorScheme": {
|
|
113
|
-
"type": "string",
|
|
114
|
-
"enum": [
|
|
115
|
-
"light",
|
|
116
|
-
"dark",
|
|
117
|
-
"auto"
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"additionalProperties": {}
|
|
110
|
+
"$ref": "#/$defs/DefinitionTheme"
|
|
122
111
|
},
|
|
123
112
|
"user": {
|
|
124
113
|
"anyOf": [
|
|
@@ -1162,6 +1151,260 @@
|
|
|
1162
1151
|
],
|
|
1163
1152
|
"additionalProperties": {}
|
|
1164
1153
|
},
|
|
1154
|
+
"DefinitionTheme": {
|
|
1155
|
+
"type": "object",
|
|
1156
|
+
"properties": {
|
|
1157
|
+
"label": {
|
|
1158
|
+
"type": "string"
|
|
1159
|
+
},
|
|
1160
|
+
"tokens": {
|
|
1161
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1162
|
+
},
|
|
1163
|
+
"dark": {
|
|
1164
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1165
|
+
},
|
|
1166
|
+
"palette": {
|
|
1167
|
+
"type": "object",
|
|
1168
|
+
"propertyNames": {
|
|
1169
|
+
"type": "string",
|
|
1170
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1171
|
+
},
|
|
1172
|
+
"additionalProperties": {
|
|
1173
|
+
"type": "string",
|
|
1174
|
+
"pattern": "^[^{};<]*$"
|
|
1175
|
+
}
|
|
1176
|
+
},
|
|
1177
|
+
"tones": {
|
|
1178
|
+
"type": "object",
|
|
1179
|
+
"propertyNames": {
|
|
1180
|
+
"type": "string",
|
|
1181
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1182
|
+
},
|
|
1183
|
+
"additionalProperties": {
|
|
1184
|
+
"$ref": "#/$defs/ToneInput"
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
"components": {
|
|
1188
|
+
"type": "object",
|
|
1189
|
+
"propertyNames": {
|
|
1190
|
+
"type": "string",
|
|
1191
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1192
|
+
},
|
|
1193
|
+
"additionalProperties": {
|
|
1194
|
+
"type": "object",
|
|
1195
|
+
"properties": {
|
|
1196
|
+
"variants": {
|
|
1197
|
+
"type": "object",
|
|
1198
|
+
"propertyNames": {
|
|
1199
|
+
"type": "string",
|
|
1200
|
+
"pattern": "^[a-z0-9-]+$"
|
|
1201
|
+
},
|
|
1202
|
+
"additionalProperties": {
|
|
1203
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
"additionalProperties": {}
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
"densities": {
|
|
1211
|
+
"type": "object",
|
|
1212
|
+
"properties": {
|
|
1213
|
+
"compact": {
|
|
1214
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1215
|
+
},
|
|
1216
|
+
"comfortable": {
|
|
1217
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1218
|
+
},
|
|
1219
|
+
"touch": {
|
|
1220
|
+
"$ref": "#/$defs/ThemeTokens"
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
"additionalProperties": {}
|
|
1224
|
+
},
|
|
1225
|
+
"fonts": {
|
|
1226
|
+
"type": "array",
|
|
1227
|
+
"items": {
|
|
1228
|
+
"$ref": "#/$defs/ThemeFont"
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
"colorScheme": {
|
|
1232
|
+
"type": "string",
|
|
1233
|
+
"enum": [
|
|
1234
|
+
"light",
|
|
1235
|
+
"dark",
|
|
1236
|
+
"auto"
|
|
1237
|
+
]
|
|
1238
|
+
},
|
|
1239
|
+
"density": {
|
|
1240
|
+
"type": "string",
|
|
1241
|
+
"enum": [
|
|
1242
|
+
"compact",
|
|
1243
|
+
"comfortable",
|
|
1244
|
+
"touch",
|
|
1245
|
+
"auto"
|
|
1246
|
+
]
|
|
1247
|
+
},
|
|
1248
|
+
"extends": {
|
|
1249
|
+
"anyOf": [
|
|
1250
|
+
{
|
|
1251
|
+
"type": "string"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"type": "array",
|
|
1255
|
+
"items": {
|
|
1256
|
+
"type": "string"
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
]
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
"additionalProperties": {}
|
|
1263
|
+
},
|
|
1264
|
+
"ThemeTokens": {
|
|
1265
|
+
"type": "object",
|
|
1266
|
+
"propertyNames": {
|
|
1267
|
+
"type": "string",
|
|
1268
|
+
"pattern": "^[a-zA-Z0-9_-]+$"
|
|
1269
|
+
},
|
|
1270
|
+
"additionalProperties": {
|
|
1271
|
+
"type": "string",
|
|
1272
|
+
"pattern": "^[^{};<]*$"
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
"ToneInput": {
|
|
1276
|
+
"anyOf": [
|
|
1277
|
+
{
|
|
1278
|
+
"type": "string"
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"type": "object",
|
|
1282
|
+
"properties": {
|
|
1283
|
+
"text": {
|
|
1284
|
+
"type": "string"
|
|
1285
|
+
},
|
|
1286
|
+
"subtle": {
|
|
1287
|
+
"type": "string"
|
|
1288
|
+
},
|
|
1289
|
+
"border": {
|
|
1290
|
+
"type": "string"
|
|
1291
|
+
},
|
|
1292
|
+
"outline": {
|
|
1293
|
+
"type": "string"
|
|
1294
|
+
},
|
|
1295
|
+
"solid": {
|
|
1296
|
+
"type": "string"
|
|
1297
|
+
},
|
|
1298
|
+
"solidHover": {
|
|
1299
|
+
"type": "string"
|
|
1300
|
+
},
|
|
1301
|
+
"solidText": {
|
|
1302
|
+
"type": "string"
|
|
1303
|
+
},
|
|
1304
|
+
"dark": {
|
|
1305
|
+
"type": "object",
|
|
1306
|
+
"properties": {
|
|
1307
|
+
"text": {
|
|
1308
|
+
"type": "string"
|
|
1309
|
+
},
|
|
1310
|
+
"subtle": {
|
|
1311
|
+
"type": "string"
|
|
1312
|
+
},
|
|
1313
|
+
"border": {
|
|
1314
|
+
"type": "string"
|
|
1315
|
+
},
|
|
1316
|
+
"outline": {
|
|
1317
|
+
"type": "string"
|
|
1318
|
+
},
|
|
1319
|
+
"solid": {
|
|
1320
|
+
"type": "string"
|
|
1321
|
+
},
|
|
1322
|
+
"solidHover": {
|
|
1323
|
+
"type": "string"
|
|
1324
|
+
},
|
|
1325
|
+
"solidText": {
|
|
1326
|
+
"type": "string"
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
"additionalProperties": {}
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
"required": [
|
|
1333
|
+
"text",
|
|
1334
|
+
"subtle",
|
|
1335
|
+
"border",
|
|
1336
|
+
"outline",
|
|
1337
|
+
"solid",
|
|
1338
|
+
"solidHover",
|
|
1339
|
+
"solidText"
|
|
1340
|
+
],
|
|
1341
|
+
"additionalProperties": {}
|
|
1342
|
+
}
|
|
1343
|
+
]
|
|
1344
|
+
},
|
|
1345
|
+
"ThemeFont": {
|
|
1346
|
+
"anyOf": [
|
|
1347
|
+
{
|
|
1348
|
+
"$ref": "#/$defs/ThemeFontFace"
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"$ref": "#/$defs/ThemeFontStylesheet"
|
|
1352
|
+
}
|
|
1353
|
+
]
|
|
1354
|
+
},
|
|
1355
|
+
"ThemeFontFace": {
|
|
1356
|
+
"type": "object",
|
|
1357
|
+
"properties": {
|
|
1358
|
+
"family": {
|
|
1359
|
+
"type": "string",
|
|
1360
|
+
"pattern": "^[^{}<;\"\\\\]+$"
|
|
1361
|
+
},
|
|
1362
|
+
"src": {
|
|
1363
|
+
"type": "string",
|
|
1364
|
+
"pattern": "^[^{}<]+$"
|
|
1365
|
+
},
|
|
1366
|
+
"weight": {
|
|
1367
|
+
"type": "string",
|
|
1368
|
+
"pattern": "^[^{}<;]*$"
|
|
1369
|
+
},
|
|
1370
|
+
"style": {
|
|
1371
|
+
"type": "string",
|
|
1372
|
+
"pattern": "^[^{}<;]*$"
|
|
1373
|
+
},
|
|
1374
|
+
"display": {
|
|
1375
|
+
"type": "string",
|
|
1376
|
+
"enum": [
|
|
1377
|
+
"auto",
|
|
1378
|
+
"block",
|
|
1379
|
+
"swap",
|
|
1380
|
+
"fallback",
|
|
1381
|
+
"optional"
|
|
1382
|
+
]
|
|
1383
|
+
},
|
|
1384
|
+
"unicodeRange": {
|
|
1385
|
+
"type": "string",
|
|
1386
|
+
"pattern": "^[^{}<;]*$"
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
"required": [
|
|
1390
|
+
"family",
|
|
1391
|
+
"src"
|
|
1392
|
+
],
|
|
1393
|
+
"additionalProperties": {}
|
|
1394
|
+
},
|
|
1395
|
+
"ThemeFontStylesheet": {
|
|
1396
|
+
"type": "object",
|
|
1397
|
+
"properties": {
|
|
1398
|
+
"stylesheet": {
|
|
1399
|
+
"type": "string",
|
|
1400
|
+
"minLength": 1
|
|
1401
|
+
}
|
|
1402
|
+
},
|
|
1403
|
+
"required": [
|
|
1404
|
+
"stylesheet"
|
|
1405
|
+
],
|
|
1406
|
+
"additionalProperties": {}
|
|
1407
|
+
},
|
|
1165
1408
|
"User": {
|
|
1166
1409
|
"type": "object",
|
|
1167
1410
|
"properties": {
|