@rathnasgala2/schemas 3.9.0 → 3.10.0

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 (45) hide show
  1. package/THIRD_PARTY_LICENSES.json +1 -1
  2. package/diagnostics/diagnostic-map.json +255 -9
  3. package/docs/catalogs/schema-inventory.json +5 -5
  4. package/examples/valid/appearance/rules.json +105 -1
  5. package/examples/valid/build-input/rules.json +105 -1
  6. package/examples/valid/theme-contract/rules.json +276 -2
  7. package/fixtures/boundary/appearance/rules.json +105 -12
  8. package/fixtures/boundary/build-input/rules.json +105 -12
  9. package/fixtures/boundary/theme-contract/rules.json +386 -2
  10. package/fixtures/invalid/appearance/REQUEST_FIELD_UNKNOWN/cases.json +33 -0
  11. package/fixtures/invalid/appearance/SCHEMA_OBJECT_TOO_LARGE/cases.json +0 -13
  12. package/fixtures/invalid/appearance/SCHEMA_PATTERN_INVALID/cases.json +68 -0
  13. package/fixtures/invalid/appearance/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +66 -0
  14. package/fixtures/invalid/appearance/SCHEMA_TYPE_INVALID/cases.json +99 -0
  15. package/fixtures/invalid/build-input/REQUEST_FIELD_UNKNOWN/cases.json +33 -0
  16. package/fixtures/invalid/build-input/SCHEMA_PATTERN_INVALID/cases.json +66 -0
  17. package/fixtures/invalid/build-input/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +66 -0
  18. package/fixtures/invalid/build-input/SCHEMA_TYPE_INVALID/cases.json +99 -0
  19. package/fixtures/invalid/theme-contract/REQUEST_FIELD_UNKNOWN/cases.json +33 -0
  20. package/fixtures/invalid/theme-contract/SCHEMA_ARRAY_TOO_LONG/cases.json +165 -0
  21. package/fixtures/invalid/theme-contract/SCHEMA_CONSTANT_INVALID/cases.json +11 -11
  22. package/fixtures/invalid/theme-contract/SCHEMA_ENUM_INVALID/cases.json +88 -0
  23. package/fixtures/invalid/theme-contract/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +93 -0
  24. package/fixtures/invalid/theme-contract/SCHEMA_TYPE_INVALID/cases.json +51 -0
  25. package/fixtures/manifest.json +1955 -35
  26. package/fixtures/unknown-field/appearance/rules.json +54 -1
  27. package/fixtures/unknown-field/build-input/rules.json +54 -1
  28. package/fixtures/unknown-field/theme-contract/rules.json +70 -1
  29. package/generated/browser/validator-core.mjs +3 -3
  30. package/generated/typescript/contracts/appearance.d.ts +14 -1
  31. package/generated/typescript/contracts/build-input.d.ts +14 -1
  32. package/generated/typescript/contracts/theme-contract.d.ts +51 -0
  33. package/openapi/http-catalog.json +2 -2
  34. package/openapi/openapi.yaml +56 -2
  35. package/package.json +10 -1
  36. package/parity/palette/golden-vectors.json +883 -0
  37. package/parity/palette/stress-corpus.json +521 -0
  38. package/parity/palette/theme-default.fixture.json +698 -0
  39. package/sbom.cdx.json +23 -23
  40. package/schemas/appearance.schema.json +30 -3
  41. package/schemas/build-input.schema.json +30 -3
  42. package/schemas/theme-contract.schema.json +185 -1
  43. package/src/palette.js +919 -0
  44. package/types/palette.d.ts +305 -0
  45. package/fixtures/invalid/build-input/SCHEMA_OBJECT_TOO_LARGE/cases.json +0 -15
@@ -41,7 +41,20 @@ export type AppearanceRepoRelativePath = string;
41
41
 
42
42
  export type AppearanceRfc3339 = string;
43
43
 
44
- export type AppearanceSemanticTokens = Readonly<Record<string, never>>;
44
+ export type AppearanceSemanticTokens = Readonly<{
45
+ readonly accent?: Readonly<{
46
+ readonly dark: string;
47
+ readonly light: string;
48
+ }>;
49
+ readonly canvas?: Readonly<{
50
+ readonly dark: string;
51
+ readonly light: string;
52
+ }>;
53
+ readonly text?: Readonly<{
54
+ readonly dark: string;
55
+ readonly light: string;
56
+ }>;
57
+ }>;
45
58
 
46
59
  export type AppearanceSemver = string;
47
60
 
@@ -366,7 +366,20 @@ export type BuildInputResolvedMedia = Readonly<{
366
366
 
367
367
  export type BuildInputRfc3339 = string;
368
368
 
369
- export type BuildInputSemanticTokens = Readonly<Record<string, never>>;
369
+ export type BuildInputSemanticTokens = Readonly<{
370
+ readonly accent?: Readonly<{
371
+ readonly dark: string;
372
+ readonly light: string;
373
+ }>;
374
+ readonly canvas?: Readonly<{
375
+ readonly dark: string;
376
+ readonly light: string;
377
+ }>;
378
+ readonly text?: Readonly<{
379
+ readonly dark: string;
380
+ readonly light: string;
381
+ }>;
382
+ }>;
370
383
 
371
384
  export type BuildInputSemver = string;
372
385
 
@@ -21,6 +21,53 @@ export type ThemeContractPackageExact = string;
21
21
 
22
22
  export type ThemeContractPackageRange = string;
23
23
 
24
+ export type ThemeContractPaletteFollow = Readonly<{
25
+ readonly dark: ReadonlyArray<'accent' | 'canvas' | 'text' | null>;
26
+ readonly key:
27
+ | 'border-button'
28
+ | 'border-card'
29
+ | 'border-chip'
30
+ | 'border-media-divider'
31
+ | 'border-quote'
32
+ | 'border-row-divider'
33
+ | 'border-section-rule'
34
+ | 'color-accent'
35
+ | 'color-accent-2'
36
+ | 'color-border'
37
+ | 'color-btn-panel'
38
+ | 'color-btn-panel-text'
39
+ | 'color-btn-text'
40
+ | 'color-canvas'
41
+ | 'color-chip-text'
42
+ | 'color-focus'
43
+ | 'color-footer'
44
+ | 'color-header'
45
+ | 'color-icon-accent'
46
+ | 'color-link'
47
+ | 'color-link-underline'
48
+ | 'color-link-underline-hover'
49
+ | 'color-link-visited'
50
+ | 'color-on-accent'
51
+ | 'color-panel-muted'
52
+ | 'color-panel-text'
53
+ | 'color-selection'
54
+ | 'color-surface'
55
+ | 'color-surface-raised'
56
+ | 'color-text'
57
+ | 'color-text-faint'
58
+ | 'color-text-muted'
59
+ | 'color-toc-active'
60
+ | 'color-toc-active-text'
61
+ | 'paint-button'
62
+ | 'paint-chip'
63
+ | 'paint-page-decor'
64
+ | 'paint-panel'
65
+ | 'shadow-avatar-ring'
66
+ | 'shadow-button';
67
+ readonly light: ReadonlyArray<'accent' | 'canvas' | 'text' | null>;
68
+ }> &
69
+ unknown;
70
+
24
71
  export type ThemeContractPassiveAsset = Readonly<{
25
72
  readonly byteLength: ThemeContractNonNegativeInt64;
26
73
  readonly license: ThemeContractSpdxExpression;
@@ -330,6 +377,10 @@ export type ThemeContractDocument = (
330
377
  readonly integrity: ThemeContractDigest;
331
378
  readonly modes: ['dark', 'light', 'system'];
332
379
  readonly package: string & ThemeContractPackageExact;
380
+ readonly palette?: Readonly<{
381
+ readonly follow: ReadonlyArray<ThemeContractPaletteFollow>;
382
+ readonly profile: 'gala-palette-follow-v1';
383
+ }>;
333
384
  readonly schemaId: 'urn:gala:schema:theme-contract:2.0.0';
334
385
  readonly schemaVersion: '2.0.0';
335
386
  readonly slotHooks: ReadonlyArray<ThemeContractPlainLabel>;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "2.0.0",
3
3
  "sourceDesignRevision": "a53052955ceb6c1aa10c886289dc832eedfe6de0a00004df07d353ac19c4403a",
4
- "openApiDigest": "sha256:9612379eda4997a04a0e3d0bcb4c3e7d68c5ba76688d4c733ab2b91520a914f7",
4
+ "openApiDigest": "sha256:6cb44277f117370a70e3828a1a5fdadbfbd1ddb5df3e84b317acf205d5913aeb",
5
5
  "operations": [
6
6
  {
7
7
  "operationId": "getInternalHealth",
@@ -2121,5 +2121,5 @@
2121
2121
  "sourceFragment": "workloads"
2122
2122
  }
2123
2123
  ],
2124
- "digest": "sha256:e203c10513b422926292b5ed11f582de9ad4522fcdb824eed3fc332f639a819f"
2124
+ "digest": "sha256:161281d4484ec95bf4980bbd15129efca7630a14a23ba66d30b3820294df714b"
2125
2125
  }
@@ -1056,7 +1056,10 @@ components:
1056
1056
  values to change only `attribution`. `attribution` (SCHEMA-3.3.0) is
1057
1057
  optional: when present the server writes it as
1058
1058
  `gala/appearance.json`'s `attribution`; when absent the file's
1059
- `attribution` is preserved unchanged.
1059
+ `attribution` is preserved unchanged. `tokens` (SCHEMA-3.10.0) is
1060
+ optional: the author's publication palette, written as
1061
+ `gala/appearance.json`'s `tokens`; when absent the file's `tokens`
1062
+ are preserved unchanged, and `{}` resets to the theme's own colours.
1060
1063
  properties:
1061
1064
  attribution:
1062
1065
  $ref: "#/components/schemas/PortableAppearanceAttribution"
@@ -1064,6 +1067,8 @@ components:
1064
1067
  $ref: "#/components/schemas/AppearanceColorMode"
1065
1068
  themeId:
1066
1069
  $ref: "#/components/schemas/AppearanceThemeId"
1070
+ tokens:
1071
+ $ref: "#/components/schemas/PortableAppearanceSemanticTokens"
1067
1072
  required:
1068
1073
  - themeId
1069
1074
  - colorModeDefault
@@ -7038,6 +7043,51 @@ components:
7038
7043
  minLength: 3
7039
7044
  pattern: ^(?:@[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?/[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?|[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?)@(?:\S+|\S+ \S+)$
7040
7045
  type: string
7046
+ PortableAppearanceSemanticTokens:
7047
+ additionalProperties: false
7048
+ description: "SCHEMA-3.10.0: the author's publication palette. Each role (accent, canvas, text) is optional; when present it carries both light and dark as opaque lowercase #rrggbb. An absent role uses the theme's default; `{}` selects the theme's default palette entirely."
7049
+ properties:
7050
+ accent:
7051
+ additionalProperties: false
7052
+ properties:
7053
+ dark:
7054
+ pattern: ^#[0-9a-f]{6}$
7055
+ type: string
7056
+ light:
7057
+ pattern: ^#[0-9a-f]{6}$
7058
+ type: string
7059
+ required:
7060
+ - light
7061
+ - dark
7062
+ type: object
7063
+ canvas:
7064
+ additionalProperties: false
7065
+ properties:
7066
+ dark:
7067
+ pattern: ^#[0-9a-f]{6}$
7068
+ type: string
7069
+ light:
7070
+ pattern: ^#[0-9a-f]{6}$
7071
+ type: string
7072
+ required:
7073
+ - light
7074
+ - dark
7075
+ type: object
7076
+ text:
7077
+ additionalProperties: false
7078
+ properties:
7079
+ dark:
7080
+ pattern: ^#[0-9a-f]{6}$
7081
+ type: string
7082
+ light:
7083
+ pattern: ^#[0-9a-f]{6}$
7084
+ type: string
7085
+ required:
7086
+ - light
7087
+ - dark
7088
+ type: object
7089
+ required: []
7090
+ type: object
7041
7091
  PortableAuthorPlainText:
7042
7092
  description: NFC Unicode text without disallowed C0/C1 controls or bidi override/isolate controls.
7043
7093
  format: gala-plain-text
@@ -15677,7 +15727,9 @@ components:
15677
15727
  `themePackage` is not in the catalog. `themePackage` is the file's
15678
15728
  `theme` value, a package with its version range. `attribution`
15679
15729
  (SCHEMA-3.3.0, optional) is the file's footer attribution switch;
15680
- absent means the file has none, which renders as shown.
15730
+ absent means the file has none, which renders as shown. `tokens`
15731
+ (SCHEMA-3.10.0, optional) is the file's publication palette as read;
15732
+ absent or `{}` means the theme's own colours.
15681
15733
  properties:
15682
15734
  attribution:
15683
15735
  $ref: "#/components/schemas/PortableAppearanceAttribution"
@@ -15689,6 +15741,8 @@ components:
15689
15741
  - type: "null"
15690
15742
  themePackage:
15691
15743
  $ref: "#/components/schemas/PortableAppearancePackageRange"
15744
+ tokens:
15745
+ $ref: "#/components/schemas/PortableAppearanceSemanticTokens"
15692
15746
  required:
15693
15747
  - themeId
15694
15748
  - themePackage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rathnasgala2/schemas",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "Executable JSON Schema and OpenAPI contracts for Galascribe",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -29,6 +29,10 @@
29
29
  "types": "./types/frozen-envelope.d.ts",
30
30
  "import": "./src/frozen-envelope.js"
31
31
  },
32
+ "./palette": {
33
+ "types": "./types/palette.d.ts",
34
+ "import": "./src/palette.js"
35
+ },
32
36
  "./schemas/adapter-capability.schema.json": "./schemas/adapter-capability.schema.json",
33
37
  "./schemas/appearance.schema.json": "./schemas/appearance.schema.json",
34
38
  "./schemas/artifact-manifest.schema.json": "./schemas/artifact-manifest.schema.json",
@@ -55,6 +59,9 @@
55
59
  "import": "./generated/typescript/index.js"
56
60
  },
57
61
  "./parity/digest-record-vectors.json": "./parity/digest-record-vectors.json",
62
+ "./palette/golden-vectors.json": "./parity/palette/golden-vectors.json",
63
+ "./palette/stress-corpus.json": "./parity/palette/stress-corpus.json",
64
+ "./palette/theme-default.fixture.json": "./parity/palette/theme-default.fixture.json",
58
65
  "./catalog-sources/internal-event-actions.json": "./catalog-sources/internal-event-actions.json",
59
66
  "./docs/catalogs/app-components.json": "./docs/catalogs/app-components.json",
60
67
  "./docs/catalogs/app-routes.json": "./docs/catalogs/app-routes.json",
@@ -85,6 +92,7 @@
85
92
  "docs/catalogs/app-routes.json",
86
93
  "docs/catalogs/app-components.json",
87
94
  "parity/digest-record-vectors.json",
95
+ "parity/palette/",
88
96
  "LICENSE",
89
97
  "NOTICE",
90
98
  "README.md",
@@ -142,6 +150,7 @@
142
150
  "app-catalogs:generate": "node scripts/generate-app-catalogs.mjs",
143
151
  "app-catalogs:check": "node scripts/generate-app-catalogs.mjs --check",
144
152
  "browser-safety:check": "node scripts/check-browser-safety.mjs",
153
+ "palette-vectors:generate": "node scripts/generate-palette-vectors.mjs",
145
154
  "format": "prettier --write .",
146
155
  "format:check": "prettier --check .",
147
156
  "lint": "eslint .",