@kumwe/studio-protocol 0.1.0-alpha.6 → 0.1.0-rc.1

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 (39) hide show
  1. package/README.md +54 -5
  2. package/THIRD_PARTY_NOTICES.md +9 -0
  3. package/dist/generated/schema-models.d.ts +1968 -0
  4. package/dist/generated/schema-models.d.ts.map +1 -0
  5. package/dist/generated/schema-models.js +76 -0
  6. package/dist/generated/schema-models.js.map +1 -0
  7. package/dist/host-failure.d.ts +16 -0
  8. package/dist/host-failure.d.ts.map +1 -0
  9. package/dist/host-failure.js +27 -0
  10. package/dist/host-failure.js.map +1 -0
  11. package/dist/index.d.ts +5 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/schemas.d.ts +14 -0
  16. package/dist/schemas.d.ts.map +1 -1
  17. package/dist/schemas.js +42 -0
  18. package/dist/schemas.js.map +1 -1
  19. package/dist/types.d.ts +111 -1
  20. package/dist/types.d.ts.map +1 -1
  21. package/dist/types.js +5 -0
  22. package/dist/types.js.map +1 -1
  23. package/package.json +6 -2
  24. package/schemas/authoring-message-catalog.schema.json +45 -0
  25. package/schemas/authoring-web-vector.schema.json +236 -0
  26. package/schemas/binding-projection-vector.schema.json +127 -0
  27. package/schemas/block-definition.schema.json +10 -1
  28. package/schemas/host-vector.schema.json +2 -0
  29. package/schemas/manifest.json +58 -4
  30. package/schemas/renderer-web-vector.schema.json +160 -0
  31. package/schemas/rich-text-projection.schema.json +12 -3
  32. package/schemas/rich-text.schema.json +156 -7
  33. package/schemas/studio-chart.schema.json +35 -0
  34. package/schemas/studio-drawing.schema.json +44 -0
  35. package/schemas/studio-money.schema.json +16 -0
  36. package/schemas/studio-presentation.schema.json +31 -0
  37. package/schemas/studio-release.schema.json +81 -0
  38. package/schemas/studio-table.schema.json +27 -0
  39. package/studio-release.json +28 -0
@@ -0,0 +1,127 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/binding-projection-vector.schema.json",
4
+ "title": "Studio field-binding projection conformance vector",
5
+ "description": "One complete Blueprint, exact host-projected content model, locked block definitions, and the normalized field-binding affordances and diagnostics every implementation must reproduce.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "contractVersion",
10
+ "kind",
11
+ "id",
12
+ "description",
13
+ "profile",
14
+ "blueprint",
15
+ "model",
16
+ "blockDefinitions",
17
+ "expect"
18
+ ],
19
+ "properties": {
20
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
21
+ "kind": { "const": "binding-projection-vector" },
22
+ "id": { "$ref": "common.schema.json#/$defs/stableId" },
23
+ "description": { "type": "string", "minLength": 1, "maxLength": 1000 },
24
+ "profile": { "const": "studio.profile/binding-projection-v1" },
25
+ "blueprint": { "$ref": "blueprint.schema.json" },
26
+ "model": { "$ref": "content-model.schema.json" },
27
+ "blockDefinitions": {
28
+ "type": "array",
29
+ "minItems": 1,
30
+ "maxItems": 1000,
31
+ "items": { "$ref": "block-definition.schema.json" }
32
+ },
33
+ "expect": { "$ref": "#/$defs/projection" }
34
+ },
35
+ "$defs": {
36
+ "fieldPath": {
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "maxItems": 32,
40
+ "items": { "$ref": "common.schema.json#/$defs/localName" }
41
+ },
42
+ "candidate": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["fieldPath", "kind", "cardinality"],
46
+ "properties": {
47
+ "fieldPath": { "$ref": "#/$defs/fieldPath" },
48
+ "kind": {
49
+ "$ref": "content-model.schema.json#/$defs/field/properties/kind"
50
+ },
51
+ "itemKind": {
52
+ "$ref": "content-model.schema.json#/$defs/field/properties/itemKind"
53
+ },
54
+ "cardinality": { "enum": ["one", "many"] },
55
+ "control": { "$ref": "common.schema.json#/$defs/qualifiedName" }
56
+ }
57
+ },
58
+ "port": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": ["port", "status", "candidates"],
62
+ "properties": {
63
+ "port": { "$ref": "common.schema.json#/$defs/localName" },
64
+ "status": { "enum": ["invalid", "non-field-source", "resolved", "unbound"] },
65
+ "bindingSourceKind": {
66
+ "enum": [
67
+ "context-value",
68
+ "entry-field",
69
+ "query-reference",
70
+ "resource-reference",
71
+ "static-value"
72
+ ]
73
+ },
74
+ "boundFieldPath": { "$ref": "#/$defs/fieldPath" },
75
+ "candidates": {
76
+ "type": "array",
77
+ "maxItems": 1000,
78
+ "items": { "$ref": "#/$defs/candidate" }
79
+ },
80
+ "multiple": { "type": "boolean" },
81
+ "required": { "type": "boolean" },
82
+ "valueType": { "type": "string", "minLength": 1, "maxLength": 200 }
83
+ }
84
+ },
85
+ "node": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": ["nodeId", "ports"],
89
+ "properties": {
90
+ "nodeId": { "$ref": "common.schema.json#/$defs/stableId" },
91
+ "ports": {
92
+ "type": "array",
93
+ "maxItems": 100,
94
+ "items": { "$ref": "#/$defs/port" }
95
+ }
96
+ }
97
+ },
98
+ "diagnostic": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["code", "severity"],
102
+ "properties": {
103
+ "code": { "$ref": "common.schema.json#/$defs/qualifiedName" },
104
+ "severity": { "enum": ["information", "warning", "error", "blocking"] },
105
+ "location": { "$ref": "common.schema.json#/$defs/diagnosticLocation" }
106
+ }
107
+ },
108
+ "projection": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["model", "nodes", "diagnostics"],
112
+ "properties": {
113
+ "model": { "$ref": "common.schema.json#/$defs/lockedArtifactReference" },
114
+ "nodes": {
115
+ "type": "array",
116
+ "maxItems": 100000,
117
+ "items": { "$ref": "#/$defs/node" }
118
+ },
119
+ "diagnostics": {
120
+ "type": "array",
121
+ "maxItems": 100000,
122
+ "items": { "$ref": "#/$defs/diagnostic" }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
@@ -140,7 +140,16 @@
140
140
  ]
141
141
  },
142
142
  "required": { "type": "boolean" },
143
- "multiple": { "type": "boolean" }
143
+ "multiple": { "type": "boolean" },
144
+ "authoring": {
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "control": { "$ref": "common.schema.json#/$defs/qualifiedName" },
149
+ "profile": { "$ref": "common.schema.json#/$defs/qualifiedName" },
150
+ "readOnly": { "type": "boolean" }
151
+ }
152
+ }
144
153
  }
145
154
  }
146
155
  },
@@ -133,6 +133,8 @@
133
133
  "enum": [
134
134
  "artifact",
135
135
  "artifact-references",
136
+ "content-model",
137
+ "content-models",
136
138
  "media-asset",
137
139
  "media-page",
138
140
  "message-bundle",
@@ -1,10 +1,29 @@
1
1
  {
2
2
  "contractVersion": "0.1-draft",
3
3
  "epoch": "https://schemas.kumwe.org/studio/v1/",
4
+ "generator": {
5
+ "name": "@kumwe/studio/schema-manifest",
6
+ "version": "1.0.0"
7
+ },
4
8
  "kind": "schema-manifest",
5
9
  "schemas": [
6
10
  {
7
- "digest": "sha256-sx4nxAo1fq7Mjp2J3gfsIWRq9vD6nkDDrc1PtWLzfNE=",
11
+ "digest": "sha256-WvSNMOQ3OZWs7ZKBCCRRwLtw5byZBtn6Rwvxz74vfAY=",
12
+ "file": "authoring-message-catalog.schema.json",
13
+ "id": "https://schemas.kumwe.org/studio/v1/authoring-message-catalog.schema.json"
14
+ },
15
+ {
16
+ "digest": "sha256-hZBNrpwHkLuUu/mPeU2UWtuOXfvZgrd8MO7vB9fJWog=",
17
+ "file": "authoring-web-vector.schema.json",
18
+ "id": "https://schemas.kumwe.org/studio/v1/authoring-web-vector.schema.json"
19
+ },
20
+ {
21
+ "digest": "sha256-GCk2z8XalwUUKM6R146c7WeCj3CY00kTMRKtPjaeehs=",
22
+ "file": "binding-projection-vector.schema.json",
23
+ "id": "https://schemas.kumwe.org/studio/v1/binding-projection-vector.schema.json"
24
+ },
25
+ {
26
+ "digest": "sha256-S3sx0m9PQs2vMFNvYIapBXc8W184cEng5MFF54C6RwQ=",
8
27
  "file": "block-definition.schema.json",
9
28
  "id": "https://schemas.kumwe.org/studio/v1/block-definition.schema.json"
10
29
  },
@@ -89,7 +108,7 @@
89
108
  "id": "https://schemas.kumwe.org/studio/v1/host-sequence-vector.schema.json"
90
109
  },
91
110
  {
92
- "digest": "sha256-KETVqPMNQCSN8faoNW7fHuSWc6rT/Jkp4+Lh31gQuQM=",
111
+ "digest": "sha256-v2LFWwqpa0hS9XnYaVP9xC7Ohyw+Dl7ZG4e038+LqtI=",
93
112
  "file": "host-vector.schema.json",
94
113
  "id": "https://schemas.kumwe.org/studio/v1/host-vector.schema.json"
95
114
  },
@@ -154,12 +173,17 @@
154
173
  "id": "https://schemas.kumwe.org/studio/v1/provenance.schema.json"
155
174
  },
156
175
  {
157
- "digest": "sha256-PKyCGI95WZ6Uojq9u5HvS2wwWU97+V+nmsY4l/Vc040=",
176
+ "digest": "sha256-oi//2JX617h+s50otcRWB4/ZTnv4iVo+gngpr73i+EA=",
177
+ "file": "renderer-web-vector.schema.json",
178
+ "id": "https://schemas.kumwe.org/studio/v1/renderer-web-vector.schema.json"
179
+ },
180
+ {
181
+ "digest": "sha256-74OcoS9iGzRnDOjo/opHhlXZdxMLcCUkw0Ol4ipzkws=",
158
182
  "file": "rich-text-projection.schema.json",
159
183
  "id": "https://schemas.kumwe.org/studio/v1/rich-text-projection.schema.json"
160
184
  },
161
185
  {
162
- "digest": "sha256-PgFfnylfsJzq7B0wQq1gAxYA0r6gMx+xiKeT3NiDVqc=",
186
+ "digest": "sha256-r+wYEvy3tvMdQhmU0272K1cklAiYcEiD7nICWDdFFPs=",
163
187
  "file": "rich-text.schema.json",
164
188
  "id": "https://schemas.kumwe.org/studio/v1/rich-text.schema.json"
165
189
  },
@@ -173,11 +197,41 @@
173
197
  "file": "schema-profile.schema.json",
174
198
  "id": "https://schemas.kumwe.org/studio/v1/schema-profile.schema.json"
175
199
  },
200
+ {
201
+ "digest": "sha256-3jvAa7VGd6F7uAOR82AcTOSMGXWvgaMVmGsG1UzSXiI=",
202
+ "file": "studio-chart.schema.json",
203
+ "id": "https://schemas.kumwe.org/studio/v1/studio-chart.schema.json"
204
+ },
176
205
  {
177
206
  "digest": "sha256-FC0lGnAqTIdHLvlwbGyYGdXEK5mwtyhdyrCwt7WzVhY=",
178
207
  "file": "studio-config.schema.json",
179
208
  "id": "https://schemas.kumwe.org/studio/v1/studio-config.schema.json"
180
209
  },
210
+ {
211
+ "digest": "sha256-SAP1i3VfZS51FRsqnN2frFxE/UmI9xEUsSREUp/cA+E=",
212
+ "file": "studio-drawing.schema.json",
213
+ "id": "https://schemas.kumwe.org/studio/v1/studio-drawing.schema.json"
214
+ },
215
+ {
216
+ "digest": "sha256-6jp6QkIqqUrNSVAQJHOlK8BCb8vdAZF5QRZmyRUqfgM=",
217
+ "file": "studio-money.schema.json",
218
+ "id": "https://schemas.kumwe.org/studio/v1/studio-money.schema.json"
219
+ },
220
+ {
221
+ "digest": "sha256-+dyYyHfQcUz4n5BUNMmGODJ6J7n2ysm9/+rWpSrbODA=",
222
+ "file": "studio-presentation.schema.json",
223
+ "id": "https://schemas.kumwe.org/studio/v1/studio-presentation.schema.json"
224
+ },
225
+ {
226
+ "digest": "sha256-8U3Im000ka2Zdfeo9J/ixmPLnMaLj3JE8vo8DrA6HMI=",
227
+ "file": "studio-release.schema.json",
228
+ "id": "https://schemas.kumwe.org/studio/v1/studio-release.schema.json"
229
+ },
230
+ {
231
+ "digest": "sha256-txf6OXjSyFvOcoepU01qNY2WWlTyDA3iquMVXrFC2tQ=",
232
+ "file": "studio-table.schema.json",
233
+ "id": "https://schemas.kumwe.org/studio/v1/studio-table.schema.json"
234
+ },
181
235
  {
182
236
  "digest": "sha256-xzhCb8J2nx+K6kBMciFj1glB4Q6jT8+KUdbUBsNM4h8=",
183
237
  "file": "theme.schema.json",
@@ -0,0 +1,160 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/renderer-web-vector.schema.json",
4
+ "title": "Studio renderer-web conformance vector",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["id", "coverage", "roots", "bindings", "media", "expect"],
8
+ "properties": {
9
+ "id": { "$ref": "common.schema.json#/$defs/stableId" },
10
+ "coverage": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["blockTypes", "behaviors", "presentation", "security"],
14
+ "properties": {
15
+ "blockTypes": {
16
+ "type": "array",
17
+ "maxItems": 100,
18
+ "uniqueItems": true,
19
+ "items": { "$ref": "common.schema.json#/$defs/qualifiedName" }
20
+ },
21
+ "behaviors": {
22
+ "type": "array",
23
+ "maxItems": 50,
24
+ "uniqueItems": true,
25
+ "items": {
26
+ "enum": [
27
+ "accordion-native",
28
+ "countdown",
29
+ "dialog",
30
+ "lightbox",
31
+ "navigation-disclosure",
32
+ "notice-dismiss",
33
+ "popover",
34
+ "slideshow",
35
+ "tabs"
36
+ ]
37
+ }
38
+ },
39
+ "presentation": {
40
+ "type": "array",
41
+ "maxItems": 50,
42
+ "uniqueItems": true,
43
+ "items": {
44
+ "enum": [
45
+ "alignment",
46
+ "inverse",
47
+ "markers",
48
+ "motion",
49
+ "position",
50
+ "print",
51
+ "responsive-visibility",
52
+ "scrolling",
53
+ "sizing",
54
+ "spacing"
55
+ ]
56
+ }
57
+ },
58
+ "security": {
59
+ "type": "array",
60
+ "maxItems": 50,
61
+ "uniqueItems": true,
62
+ "items": {
63
+ "enum": [
64
+ "active-media-deny",
65
+ "blob-default-deny",
66
+ "escaped-text",
67
+ "safe-url-deny",
68
+ "typed-data-fallback"
69
+ ]
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "context": {
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "properties": { "allowBlobMedia": { "type": "boolean" } }
78
+ },
79
+ "roots": {
80
+ "type": "array",
81
+ "minItems": 1,
82
+ "maxItems": 100,
83
+ "items": { "$ref": "blueprint.schema.json#/$defs/node" }
84
+ },
85
+ "bindings": {
86
+ "type": "array",
87
+ "maxItems": 1000,
88
+ "items": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["nodeId", "port", "value"],
92
+ "properties": {
93
+ "nodeId": { "$ref": "common.schema.json#/$defs/stableId" },
94
+ "port": { "$ref": "common.schema.json#/$defs/localName" },
95
+ "value": { "$ref": "common.schema.json#/$defs/jsonValue" }
96
+ }
97
+ }
98
+ },
99
+ "media": {
100
+ "type": "array",
101
+ "maxItems": 1000,
102
+ "items": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["assetId", "src", "altText"],
106
+ "properties": {
107
+ "assetId": { "$ref": "common.schema.json#/$defs/stableId" },
108
+ "src": { "type": "string", "minLength": 1, "maxLength": 2048 },
109
+ "altText": { "type": "string", "maxLength": 5000 },
110
+ "mediaType": { "type": "string", "maxLength": 255 },
111
+ "caption": { "type": "string", "maxLength": 20000 },
112
+ "width": { "type": "integer", "minimum": 1, "maximum": 100000 },
113
+ "height": { "type": "integer", "minimum": 1, "maximum": 100000 }
114
+ }
115
+ }
116
+ },
117
+ "expect": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": ["htmlContains", "htmlExcludes", "cssContains", "enhancements"],
121
+ "properties": {
122
+ "htmlContains": {
123
+ "type": "array",
124
+ "maxItems": 100,
125
+ "items": { "type": "string", "maxLength": 10000 }
126
+ },
127
+ "htmlExcludes": {
128
+ "type": "array",
129
+ "maxItems": 100,
130
+ "items": { "type": "string", "maxLength": 10000 }
131
+ },
132
+ "cssContains": {
133
+ "type": "array",
134
+ "maxItems": 100,
135
+ "items": { "type": "string", "maxLength": 10000 }
136
+ },
137
+ "enhancements": {
138
+ "type": "array",
139
+ "maxItems": 100,
140
+ "items": {
141
+ "enum": [
142
+ "chart",
143
+ "countdown",
144
+ "diagram",
145
+ "dialog",
146
+ "lightbox",
147
+ "math",
148
+ "motion",
149
+ "navigation",
150
+ "notice",
151
+ "popover",
152
+ "slideshow",
153
+ "tabs"
154
+ ]
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
@@ -24,7 +24,16 @@
24
24
  "additionalProperties": false,
25
25
  "required": ["type", "text", "spans", "embeds"],
26
26
  "properties": {
27
- "type": { "enum": ["heading", "horizontalRule", "paragraph"] },
27
+ "type": {
28
+ "enum": [
29
+ "checklistItem",
30
+ "codeBlock",
31
+ "heading",
32
+ "horizontalRule",
33
+ "paragraph",
34
+ "tableCell"
35
+ ]
36
+ },
28
37
  "text": {
29
38
  "type": "string",
30
39
  "maxLength": 250000
@@ -51,9 +60,9 @@
51
60
  "marks": {
52
61
  "type": "array",
53
62
  "minItems": 1,
54
- "maxItems": 4,
63
+ "maxItems": 5,
55
64
  "uniqueItems": true,
56
- "items": { "enum": ["bold", "code", "italic", "strike"] }
65
+ "items": { "enum": ["bold", "code", "highlight", "italic", "strike"] }
57
66
  }
58
67
  }
59
68
  },
@@ -24,7 +24,11 @@
24
24
  { "$ref": "#/$defs/blockquote" },
25
25
  { "$ref": "#/$defs/bulletList" },
26
26
  { "$ref": "#/$defs/orderedList" },
27
- { "$ref": "#/$defs/horizontalRule" }
27
+ { "$ref": "#/$defs/horizontalRule" },
28
+ { "$ref": "#/$defs/checklist" },
29
+ { "$ref": "#/$defs/table" },
30
+ { "$ref": "#/$defs/callout" },
31
+ { "$ref": "#/$defs/codeBlock" }
28
32
  ]
29
33
  },
30
34
  "paragraph": {
@@ -133,6 +137,131 @@
133
137
  "type": { "const": "horizontalRule" }
134
138
  }
135
139
  },
140
+ "checklist": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": ["type", "content"],
144
+ "properties": {
145
+ "type": { "const": "checklist" },
146
+ "content": {
147
+ "type": "array",
148
+ "minItems": 1,
149
+ "maxItems": 500,
150
+ "items": { "$ref": "#/$defs/checklistItem" }
151
+ }
152
+ }
153
+ },
154
+ "checklistItem": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": ["type", "attrs"],
158
+ "properties": {
159
+ "type": { "const": "checklistItem" },
160
+ "attrs": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": ["checked", "level"],
164
+ "properties": {
165
+ "checked": { "type": "boolean" },
166
+ "level": { "type": "integer", "minimum": 0, "maximum": 4 }
167
+ }
168
+ },
169
+ "content": {
170
+ "type": "array",
171
+ "maxItems": 5000,
172
+ "items": { "$ref": "#/$defs/inline" }
173
+ }
174
+ }
175
+ },
176
+ "table": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "required": ["type", "attrs", "content"],
180
+ "properties": {
181
+ "type": { "const": "table" },
182
+ "attrs": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": ["header"],
186
+ "properties": { "header": { "type": "boolean" } }
187
+ },
188
+ "content": {
189
+ "type": "array",
190
+ "minItems": 1,
191
+ "maxItems": 200,
192
+ "items": { "$ref": "#/$defs/tableRow" }
193
+ }
194
+ }
195
+ },
196
+ "tableRow": {
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "required": ["type", "content"],
200
+ "properties": {
201
+ "type": { "const": "tableRow" },
202
+ "content": {
203
+ "type": "array",
204
+ "minItems": 1,
205
+ "maxItems": 50,
206
+ "items": { "$ref": "#/$defs/tableCell" }
207
+ }
208
+ }
209
+ },
210
+ "tableCell": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": ["type"],
214
+ "properties": {
215
+ "type": { "const": "tableCell" },
216
+ "content": {
217
+ "type": "array",
218
+ "maxItems": 5000,
219
+ "items": { "$ref": "#/$defs/inline" }
220
+ }
221
+ }
222
+ },
223
+ "callout": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["type", "attrs", "content"],
227
+ "properties": {
228
+ "type": { "const": "callout" },
229
+ "attrs": {
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": ["tone"],
233
+ "properties": {
234
+ "tone": { "enum": ["danger", "info", "success", "warning"] }
235
+ }
236
+ },
237
+ "content": {
238
+ "type": "array",
239
+ "minItems": 1,
240
+ "maxItems": 5000,
241
+ "items": { "$ref": "#/$defs/block" }
242
+ }
243
+ }
244
+ },
245
+ "codeBlock": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": ["type", "attrs", "text"],
249
+ "properties": {
250
+ "type": { "const": "codeBlock" },
251
+ "attrs": {
252
+ "type": "object",
253
+ "additionalProperties": false,
254
+ "required": ["language"],
255
+ "properties": {
256
+ "language": {
257
+ "type": "string",
258
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9+_.#-]{0,63}$"
259
+ }
260
+ }
261
+ },
262
+ "text": { "type": "string", "maxLength": 250000 }
263
+ }
264
+ },
136
265
  "hardBreak": {
137
266
  "type": "object",
138
267
  "additionalProperties": false,
@@ -163,12 +292,32 @@
163
292
  "oneOf": [{ "$ref": "#/$defs/text" }, { "$ref": "#/$defs/hardBreak" }]
164
293
  },
165
294
  "mark": {
166
- "type": "object",
167
- "additionalProperties": false,
168
- "required": ["type"],
169
- "properties": {
170
- "type": { "enum": ["bold", "code", "italic", "strike"] }
171
- }
295
+ "oneOf": [
296
+ {
297
+ "type": "object",
298
+ "additionalProperties": false,
299
+ "required": ["type"],
300
+ "properties": {
301
+ "type": { "enum": ["bold", "code", "italic", "strike"] }
302
+ }
303
+ },
304
+ {
305
+ "type": "object",
306
+ "additionalProperties": false,
307
+ "required": ["type", "attrs"],
308
+ "properties": {
309
+ "type": { "const": "highlight" },
310
+ "attrs": {
311
+ "type": "object",
312
+ "additionalProperties": false,
313
+ "required": ["tone"],
314
+ "properties": {
315
+ "tone": { "enum": ["accent", "danger", "info", "success", "warning"] }
316
+ }
317
+ }
318
+ }
319
+ }
320
+ ]
172
321
  }
173
322
  }
174
323
  }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/studio-chart.schema.json",
4
+ "title": "Studio canonical chart",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["type", "labels", "datasets"],
8
+ "properties": {
9
+ "type": { "enum": ["bar", "doughnut", "line", "pie"] },
10
+ "title": { "type": "string", "maxLength": 500 },
11
+ "labels": {
12
+ "type": "array",
13
+ "maxItems": 200,
14
+ "items": { "type": "string", "maxLength": 500 }
15
+ },
16
+ "datasets": {
17
+ "type": "array",
18
+ "minItems": 1,
19
+ "maxItems": 20,
20
+ "items": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["label", "values"],
24
+ "properties": {
25
+ "label": { "type": "string", "maxLength": 500 },
26
+ "values": {
27
+ "type": "array",
28
+ "maxItems": 200,
29
+ "items": { "type": "number", "minimum": -1000000000000000, "maximum": 1000000000000000 }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }