@panneau/protocol 5.0.0-alpha.0 → 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.
Files changed (83) hide show
  1. package/README.md +13 -8
  2. package/dist/conformance/index.d.ts.map +1 -1
  3. package/dist/conformance/index.js +27 -0
  4. package/dist/conformance/index.js.map +1 -1
  5. package/dist/constants.d.ts +21 -0
  6. package/dist/constants.d.ts.map +1 -0
  7. package/dist/constants.js +73 -0
  8. package/dist/constants.js.map +1 -0
  9. package/dist/index.d.ts +3 -8
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +17 -13
  12. package/dist/mock/example.d.ts.map +1 -1
  13. package/dist/mock/example.js +4 -0
  14. package/dist/mock/example.js.map +1 -1
  15. package/dist/mock/index.d.ts.map +1 -1
  16. package/dist/mock/index.js +5 -1
  17. package/dist/mock/index.js.map +1 -1
  18. package/dist/openapi.d.ts +2 -0
  19. package/dist/openapi.d.ts.map +1 -1
  20. package/dist/openapi.js +13 -2
  21. package/dist/openapi.js.map +1 -1
  22. package/dist/problem.d.ts +7 -0
  23. package/dist/problem.d.ts.map +1 -0
  24. package/dist/problem.js +22 -0
  25. package/dist/problem.js.map +1 -0
  26. package/dist/query.d.ts +26 -2
  27. package/dist/query.d.ts.map +1 -1
  28. package/dist/query.js +37 -6
  29. package/dist/query.js.map +1 -1
  30. package/dist/rules.d.ts.map +1 -1
  31. package/dist/rules.js +1 -1
  32. package/dist/rules.js.map +1 -1
  33. package/dist/runtime/index.d.ts +11 -0
  34. package/dist/runtime/index.d.ts.map +1 -0
  35. package/dist/runtime/index.js +10 -0
  36. package/dist/schemas/action.d.ts +0 -3
  37. package/dist/schemas/action.d.ts.map +1 -1
  38. package/dist/schemas/action.js +1 -11
  39. package/dist/schemas/action.js.map +1 -1
  40. package/dist/schemas/api.d.ts.map +1 -1
  41. package/dist/schemas/api.js +1 -1
  42. package/dist/schemas/api.js.map +1 -1
  43. package/dist/schemas/boot.d.ts +0 -5
  44. package/dist/schemas/boot.d.ts.map +1 -1
  45. package/dist/schemas/boot.js +1 -6
  46. package/dist/schemas/boot.js.map +1 -1
  47. package/dist/schemas/definition.d.ts +54 -1
  48. package/dist/schemas/definition.d.ts.map +1 -1
  49. package/dist/schemas/definition.js +2 -5
  50. package/dist/schemas/definition.js.map +1 -1
  51. package/dist/schemas/field.d.ts +0 -6
  52. package/dist/schemas/field.d.ts.map +1 -1
  53. package/dist/schemas/field.js +2 -35
  54. package/dist/schemas/field.js.map +1 -1
  55. package/dist/schemas/index.d.ts +224 -1
  56. package/dist/schemas/index.d.ts.map +1 -1
  57. package/dist/schemas/index.js +15 -6
  58. package/dist/schemas/index.js.map +1 -1
  59. package/dist/schemas/layout.d.ts +0 -3
  60. package/dist/schemas/layout.d.ts.map +1 -1
  61. package/dist/schemas/layout.js +1 -13
  62. package/dist/schemas/layout.js.map +1 -1
  63. package/dist/schemas/list.d.ts +0 -3
  64. package/dist/schemas/list.d.ts.map +1 -1
  65. package/dist/schemas/list.js +2 -9
  66. package/dist/schemas/list.js.map +1 -1
  67. package/dist/schemas/theme.d.ts +179 -0
  68. package/dist/schemas/theme.d.ts.map +1 -0
  69. package/dist/schemas/theme.js +66 -0
  70. package/dist/schemas/theme.js.map +1 -0
  71. package/dist/themes.d.ts +11 -0
  72. package/dist/themes.d.ts.map +1 -0
  73. package/dist/themes.js +80 -0
  74. package/dist/themes.js.map +1 -0
  75. package/dist/validate.d.ts +0 -3
  76. package/dist/validate.d.ts.map +1 -1
  77. package/dist/validate.js +2 -7
  78. package/dist/validate.js.map +1 -1
  79. package/package.json +7 -1
  80. package/schema/boot.schema.json +255 -12
  81. package/schema/definition.schema.json +255 -12
  82. package/schema/openapi.json +422 -15
  83. package/schema/theme.schema.json +234 -0
package/dist/validate.js CHANGED
@@ -1,7 +1,6 @@
1
+ import { lintDefinition } from "./lint.js";
1
2
  import { Definition } from "./schemas/definition.js";
2
- import { Problem } from "./schemas/api.js";
3
3
  import { BootConfig } from "./schemas/boot.js";
4
- import { lintDefinition } from "./lint.js";
5
4
  //#region src/validate.ts
6
5
  /** Validates a value against one of the protocol's schemas. */
7
6
  function validate(schema, input) {
@@ -47,11 +46,7 @@ function validateBootConfig(input) {
47
46
  issues
48
47
  } : result;
49
48
  }
50
- /** Whether a value is a problem details object (an API error). */
51
- function isProblem(value) {
52
- return Problem.safeParse(value).success;
53
- }
54
49
  //#endregion
55
- export { isProblem, validate, validateBootConfig, validateDefinition };
50
+ export { validate, validateBootConfig, validateDefinition };
56
51
 
57
52
  //# sourceMappingURL=validate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","names":[],"sources":["../src/validate.ts"],"sourcesContent":["import type { z } from 'zod';\n\nimport { lintDefinition } from './lint';\nimport { Problem } from './schemas/api';\nimport { BootConfig } from './schemas/boot';\nimport { Definition } from './schemas/definition';\n\nexport interface ValidationIssue {\n /** Dot path of the invalid value (`resources.0.fields.2.type`), empty for the root. */\n path: string;\n message: string;\n}\n\nexport type ValidationResult<T> =\n { success: true; data: T } | { success: false; issues: ValidationIssue[] };\n\n/** Validates a value against one of the protocol's schemas. */\nexport function validate<T extends z.ZodType>(\n schema: T,\n input: unknown,\n): ValidationResult<z.infer<T>> {\n const result = schema.safeParse(input);\n if (result.success) {\n return { success: true, data: result.data };\n }\n return {\n success: false,\n issues: result.error.issues.map((issue) => ({\n path: issue.path.map(String).join('.'),\n message: issue.message,\n })),\n };\n}\n\n/**\n * Validates a definition, as returned by `GET /definition`: against the schema, then the\n * references between its parts (see `lintDefinition()`).\n */\nexport function validateDefinition(input: unknown): ValidationResult<Definition> {\n const result = validate(Definition, input);\n if (!result.success) {\n return result;\n }\n const issues = lintDefinition(result.data);\n return issues.length > 0 ? { success: false, issues } : result;\n}\n\n/**\n * Validates a boot config, as a server writes it in the page: against the schema, then the\n * references between the parts of its inlined definition, if any.\n */\nexport function validateBootConfig(input: unknown): ValidationResult<BootConfig> {\n const result = validate(BootConfig, input);\n if (!result.success || result.data.definition === undefined) {\n return result;\n }\n const issues = lintDefinition(result.data.definition).map((issue) => ({\n ...issue,\n path: issue.path === '' ? 'definition' : `definition.${issue.path}`,\n }));\n return issues.length > 0 ? { success: false, issues } : result;\n}\n\n/** Whether a value is a problem details object (an API error). */\nexport function isProblem(value: unknown): value is Problem {\n return Problem.safeParse(value).success;\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,SACZ,QACA,OAC4B;CAC5B,MAAM,SAAS,OAAO,UAAU,KAAK;CACrC,IAAI,OAAO,SACP,OAAO;EAAE,SAAS;EAAM,MAAM,OAAO;CAAK;CAE9C,OAAO;EACH,SAAS;EACT,QAAQ,OAAO,MAAM,OAAO,KAAK,WAAW;GACxC,MAAM,MAAM,KAAK,IAAI,MAAM,CAAC,CAAC,KAAK,GAAG;GACrC,SAAS,MAAM;EACnB,EAAE;CACN;AACJ;;;;;AAMA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,SACR,OAAO;CAEX,MAAM,SAAS,eAAe,OAAO,IAAI;CACzC,OAAO,OAAO,SAAS,IAAI;EAAE,SAAS;EAAO;CAAO,IAAI;AAC5D;;;;;AAMA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,WAAW,OAAO,KAAK,eAAe,KAAA,GAC9C,OAAO;CAEX,MAAM,SAAS,eAAe,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK,WAAW;EAClE,GAAG;EACH,MAAM,MAAM,SAAS,KAAK,eAAe,cAAc,MAAM;CACjE,EAAE;CACF,OAAO,OAAO,SAAS,IAAI;EAAE,SAAS;EAAO;CAAO,IAAI;AAC5D;;AAGA,SAAgB,UAAU,OAAkC;CACxD,OAAO,QAAQ,UAAU,KAAK,CAAC,CAAC;AACpC"}
1
+ {"version":3,"file":"validate.js","names":[],"sources":["../src/validate.ts"],"sourcesContent":["import type { z } from 'zod';\n\nimport { lintDefinition } from './lint';\nimport { BootConfig } from './schemas/boot';\nimport { Definition } from './schemas/definition';\n\nexport interface ValidationIssue {\n /** Dot path of the invalid value (`resources.0.fields.2.type`), empty for the root. */\n path: string;\n message: string;\n}\n\nexport type ValidationResult<T> =\n { success: true; data: T } | { success: false; issues: ValidationIssue[] };\n\n/** Validates a value against one of the protocol's schemas. */\nexport function validate<T extends z.ZodType>(\n schema: T,\n input: unknown,\n): ValidationResult<z.infer<T>> {\n const result = schema.safeParse(input);\n if (result.success) {\n return { success: true, data: result.data };\n }\n return {\n success: false,\n issues: result.error.issues.map((issue) => ({\n path: issue.path.map(String).join('.'),\n message: issue.message,\n })),\n };\n}\n\n/**\n * Validates a definition, as returned by `GET /definition`: against the schema, then the\n * references between its parts (see `lintDefinition()`).\n */\nexport function validateDefinition(input: unknown): ValidationResult<Definition> {\n const result = validate(Definition, input);\n if (!result.success) {\n return result;\n }\n const issues = lintDefinition(result.data);\n return issues.length > 0 ? { success: false, issues } : result;\n}\n\n/**\n * Validates a boot config, as a server writes it in the page: against the schema, then the\n * references between the parts of its inlined definition, if any.\n */\nexport function validateBootConfig(input: unknown): ValidationResult<BootConfig> {\n const result = validate(BootConfig, input);\n if (!result.success || result.data.definition === undefined) {\n return result;\n }\n const issues = lintDefinition(result.data.definition).map((issue) => ({\n ...issue,\n path: issue.path === '' ? 'definition' : `definition.${issue.path}`,\n }));\n return issues.length > 0 ? { success: false, issues } : result;\n}\n"],"mappings":";;;;;AAgBA,SAAgB,SACZ,QACA,OAC4B;CAC5B,MAAM,SAAS,OAAO,UAAU,KAAK;CACrC,IAAI,OAAO,SACP,OAAO;EAAE,SAAS;EAAM,MAAM,OAAO;CAAK;CAE9C,OAAO;EACH,SAAS;EACT,QAAQ,OAAO,MAAM,OAAO,KAAK,WAAW;GACxC,MAAM,MAAM,KAAK,IAAI,MAAM,CAAC,CAAC,KAAK,GAAG;GACrC,SAAS,MAAM;EACnB,EAAE;CACN;AACJ;;;;;AAMA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,SACR,OAAO;CAEX,MAAM,SAAS,eAAe,OAAO,IAAI;CACzC,OAAO,OAAO,SAAS,IAAI;EAAE,SAAS;EAAO;CAAO,IAAI;AAC5D;;;;;AAMA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,WAAW,OAAO,KAAK,eAAe,KAAA,GAC9C,OAAO;CAEX,MAAM,SAAS,eAAe,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK,WAAW;EAClE,GAAG;EACH,MAAM,MAAM,SAAS,KAAK,eAAe,cAAc,MAAM;CACjE,EAAE;CACF,OAAO,OAAO,SAAS,IAAI;EAAE,SAAS;EAAO;CAAO,IAAI;AAC5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/protocol",
3
- "version": "5.0.0-alpha.0",
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",
@@ -16,6 +16,11 @@
16
16
  "types": "./dist/index.d.ts",
17
17
  "default": "./dist/index.js"
18
18
  },
19
+ "./runtime": {
20
+ "@panneau/source": "./src/runtime/index.ts",
21
+ "types": "./dist/runtime/index.d.ts",
22
+ "default": "./dist/runtime/index.js"
23
+ },
19
24
  "./mock": {
20
25
  "@panneau/source": "./src/mock/index.ts",
21
26
  "types": "./dist/mock/index.d.ts",
@@ -29,6 +34,7 @@
29
34
  "./definition.schema.json": "./schema/definition.schema.json",
30
35
  "./openapi.json": "./schema/openapi.json",
31
36
  "./boot.schema.json": "./schema/boot.schema.json",
37
+ "./theme.schema.json": "./schema/theme.schema.json",
32
38
  "./package.json": "./package.json"
33
39
  },
34
40
  "files": [
@@ -141,18 +141,7 @@
141
141
  "$ref": "#/$defs/Uploads"
142
142
  },
143
143
  "theme": {
144
- "type": "object",
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
- "type": "object",
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": {