@atlaskit/adf-schema 36.8.1 → 36.8.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 3d6a62a: Add properties, marks, and mark array type
8
+
9
+ ## 36.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - f80bbc4: Process type for json schema generator from ADF DSL
14
+
3
15
  ## 36.8.1
4
16
 
5
17
  ### Patch Changes
@@ -20,7 +20,7 @@ var _panel = require("./panel");
20
20
  var _paragraph = require("./paragraph");
21
21
  var _rule = require("./rule");
22
22
  var _task = require("./task");
23
- var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('table_cell').define({
23
+ var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell').define({
24
24
  isolating: true,
25
25
  selectable: false,
26
26
  tableRole: 'cell',
@@ -20,7 +20,7 @@ var _panel = require("./panel");
20
20
  var _paragraph = require("./paragraph");
21
21
  var _rule = require("./rule");
22
22
  var _task = require("./task");
23
- var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('table_header').define({
23
+ var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('tableHeader').define({
24
24
  isolating: true,
25
25
  selectable: false,
26
26
  tableRole: 'header_cell',
@@ -7,7 +7,7 @@ exports.tableRow = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var _tableCell = require("./tableCell");
9
9
  var _tableHeader = require("./tableHeader");
10
- var tableRow = exports.tableRow = (0, _adfSchemaGenerator.adfNode)('table_row').define({
10
+ var tableRow = exports.tableRow = (0, _adfSchemaGenerator.adfNode)('tableRow').define({
11
11
  selectable: false,
12
12
  content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_tableCell.tableCell, _tableHeader.tableHeader))]
13
13
  });
@@ -14,7 +14,7 @@ import { panel } from './panel';
14
14
  import { paragraph } from './paragraph';
15
15
  import { rule } from './rule';
16
16
  import { taskList } from './task';
17
- export const tableCell = adfNode('table_cell').define({
17
+ export const tableCell = adfNode('tableCell').define({
18
18
  isolating: true,
19
19
  selectable: false,
20
20
  tableRole: 'cell',
@@ -14,7 +14,7 @@ import { panel } from './panel';
14
14
  import { paragraph } from './paragraph';
15
15
  import { rule } from './rule';
16
16
  import { taskList } from './task';
17
- export const tableHeader = adfNode('table_header').define({
17
+ export const tableHeader = adfNode('tableHeader').define({
18
18
  isolating: true,
19
19
  selectable: false,
20
20
  tableRole: 'header_cell',
@@ -1,7 +1,7 @@
1
1
  import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { tableCell } from './tableCell';
3
3
  import { tableHeader } from './tableHeader';
4
- export const tableRow = adfNode('table_row').define({
4
+ export const tableRow = adfNode('tableRow').define({
5
5
  selectable: false,
6
6
  content: [$onePlus($or(tableCell, tableHeader))]
7
7
  });
@@ -14,7 +14,7 @@ import { panel } from './panel';
14
14
  import { paragraph } from './paragraph';
15
15
  import { rule } from './rule';
16
16
  import { taskList } from './task';
17
- export var tableCell = adfNode('table_cell').define({
17
+ export var tableCell = adfNode('tableCell').define({
18
18
  isolating: true,
19
19
  selectable: false,
20
20
  tableRole: 'cell',
@@ -14,7 +14,7 @@ import { panel } from './panel';
14
14
  import { paragraph } from './paragraph';
15
15
  import { rule } from './rule';
16
16
  import { taskList } from './task';
17
- export var tableHeader = adfNode('table_header').define({
17
+ export var tableHeader = adfNode('tableHeader').define({
18
18
  isolating: true,
19
19
  selectable: false,
20
20
  tableRole: 'header_cell',
@@ -1,7 +1,7 @@
1
1
  import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { tableCell } from './tableCell';
3
3
  import { tableHeader } from './tableHeader';
4
- export var tableRow = adfNode('table_row').define({
4
+ export var tableRow = adfNode('tableRow').define({
5
5
  selectable: false,
6
6
  content: [$onePlus($or(tableCell, tableHeader))]
7
7
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.8.1",
3
+ "version": "36.8.3",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@atlassian/adf-schema-json": "^1.15.0",
47
- "@atlaskit/adf-schema-generator": "^1.7.0",
47
+ "@atlaskit/adf-schema-generator": "^1.7.2",
48
48
  "@babel/cli": "^7.22.9",
49
49
  "@babel/core": "^7.22.9",
50
50
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -19,3 +19,26 @@ Delete all subfields except for type. Content objects are also deleted. Inline i
19
19
  ```sh
20
20
  cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(.content, .properties, .text, .marks, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems, .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node) else . end)'
21
21
  ```
22
+
23
+ Delete all subfields except for type and properties. Content objects are also deleted. Inline is also deleted, as it is a content object for paragraph.
24
+
25
+ ```sh
26
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(.content, .text, .marks, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems, .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node) else . end)'
27
+ ```
28
+
29
+ Delete all subfields except for marks, type and properties. Content objects are also deleted. Inline is also deleted, as it is a content object for paragraph.
30
+
31
+ ```sh
32
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(.content, .text, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems, .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node) else . end)'
33
+ ```
34
+
35
+ Delete all subfields except for marks, type and properties. Content objects are also deleted. Inline is also deleted, as it is a content object for paragraph.
36
+
37
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
38
+
39
+ ```sh
40
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
41
+ .content, .text, .attrs, .version, .required, .additionalProperties, .allOf, .anyOf, .items, .minItems,
42
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
43
+ .bodiedExtension_node.properties.marks, .codeBlock_node.properties.marks, .expand_node.properties.marks, .heading_node.properties.marks, .inlineExtension_node.properties.marks, .text_node.properties.marks) else . end)'
44
+ ```
@@ -15,190 +15,491 @@ const jsonWithTypes = {
15
15
  definitions: {
16
16
  text_node: {
17
17
  type: 'object',
18
+ properties: {
19
+ type: {
20
+ enum: ['text'],
21
+ },
22
+ },
18
23
  },
19
24
  breakout_mark: {
20
25
  type: 'object',
26
+ properties: {
27
+ type: {
28
+ enum: ['breakout'],
29
+ },
30
+ },
21
31
  },
22
32
  codeBlock_node: {
23
33
  type: 'object',
34
+ properties: {
35
+ type: {
36
+ enum: ['codeBlock'],
37
+ },
38
+ },
24
39
  },
25
40
  codeBlock_with_no_marks_node: {},
26
41
  codeBlock_with_marks_node: {},
27
42
  em_mark: {
28
43
  type: 'object',
44
+ properties: {
45
+ type: {
46
+ enum: ['em'],
47
+ },
48
+ },
29
49
  },
30
50
  code_mark: {
31
51
  type: 'object',
52
+ properties: {
53
+ type: {
54
+ enum: ['code'],
55
+ },
56
+ },
32
57
  },
33
58
  strike_mark: {
34
59
  type: 'object',
60
+ properties: {
61
+ type: {
62
+ enum: ['strike'],
63
+ },
64
+ },
35
65
  },
36
66
  strong_mark: {
37
67
  type: 'object',
68
+ properties: {
69
+ type: {
70
+ enum: ['strong'],
71
+ },
72
+ },
38
73
  },
39
74
  underline_mark: {
40
75
  type: 'object',
76
+ properties: {
77
+ type: {
78
+ enum: ['underline'],
79
+ },
80
+ },
41
81
  },
42
82
  link_mark: {
43
83
  type: 'object',
84
+ properties: {
85
+ type: {
86
+ enum: ['link'],
87
+ },
88
+ },
44
89
  },
45
90
  subsup_mark: {
46
91
  type: 'object',
92
+ properties: {
93
+ type: {
94
+ enum: ['subsup'],
95
+ },
96
+ },
47
97
  },
48
98
  textColor_mark: {
49
99
  type: 'object',
100
+ properties: {
101
+ type: {
102
+ enum: ['textColor'],
103
+ },
104
+ },
50
105
  },
51
106
  alignment_mark: {
52
107
  type: 'object',
108
+ properties: {
109
+ type: {
110
+ enum: ['alignment'],
111
+ },
112
+ },
53
113
  },
54
114
  indentation_mark: {
55
115
  type: 'object',
116
+ properties: {
117
+ type: {
118
+ enum: ['indentation'],
119
+ },
120
+ },
56
121
  },
57
122
  annotation_mark: {
58
123
  type: 'object',
124
+ properties: {
125
+ type: {
126
+ enum: ['annotation'],
127
+ },
128
+ },
59
129
  },
60
130
  dataConsumer_mark: {
61
131
  type: 'object',
132
+ properties: {
133
+ type: {
134
+ enum: ['dataConsumer'],
135
+ },
136
+ },
62
137
  },
63
138
  fragment_mark: {
64
139
  type: 'object',
140
+ properties: {
141
+ type: {
142
+ enum: ['fragment'],
143
+ },
144
+ },
65
145
  },
66
146
  border_mark: {
67
147
  type: 'object',
148
+ properties: {
149
+ type: {
150
+ enum: ['border'],
151
+ },
152
+ },
68
153
  },
69
154
  backgroundColor_mark: {
70
155
  type: 'object',
156
+ properties: {
157
+ type: {
158
+ enum: ['backgroundColor'],
159
+ },
160
+ },
71
161
  },
72
162
  hardBreak_node: {
73
163
  type: 'object',
164
+ properties: {
165
+ type: {
166
+ enum: ['hardBreak'],
167
+ },
168
+ },
74
169
  },
75
170
  mention_node: {
76
171
  type: 'object',
172
+ properties: {
173
+ type: {
174
+ enum: ['mention'],
175
+ },
176
+ },
77
177
  },
78
178
  emoji_node: {
79
179
  type: 'object',
180
+ properties: {
181
+ type: {
182
+ enum: ['emoji'],
183
+ },
184
+ },
80
185
  },
81
186
  inlineExtension_node: {
82
187
  type: 'object',
188
+ properties: {
189
+ type: {
190
+ enum: ['inlineExtension'],
191
+ },
192
+ },
83
193
  },
84
194
  inlineExtension_with_marks_node: {},
85
195
  date_node: {
86
196
  type: 'object',
197
+ properties: {
198
+ type: {
199
+ enum: ['date'],
200
+ },
201
+ },
87
202
  },
88
203
  placeholder_node: {
89
204
  type: 'object',
205
+ properties: {
206
+ type: {
207
+ enum: ['placeholder'],
208
+ },
209
+ },
90
210
  },
91
211
  blockCard_node: {
92
212
  type: 'object',
213
+ properties: {
214
+ type: {
215
+ enum: ['blockCard'],
216
+ },
217
+ },
93
218
  },
94
219
  inlineCard_node: {
95
220
  type: 'object',
221
+ properties: {
222
+ type: {
223
+ enum: ['inlineCard'],
224
+ },
225
+ },
96
226
  },
97
227
  status_node: {
98
228
  type: 'object',
229
+ properties: {
230
+ type: {
231
+ enum: ['status'],
232
+ },
233
+ },
99
234
  },
100
235
  media_node: {
101
236
  type: 'object',
237
+ properties: {
238
+ type: {
239
+ enum: ['media'],
240
+ },
241
+ marks: {
242
+ type: 'array',
243
+ },
244
+ },
102
245
  },
103
246
  mediaInline_node: {
104
247
  type: 'object',
248
+ properties: {
249
+ type: {
250
+ enum: ['mediaInline'],
251
+ },
252
+ marks: {
253
+ type: 'array',
254
+ },
255
+ },
105
256
  },
106
257
  formatted_text_inline_node: {},
107
258
  code_inline_node: {},
108
259
  paragraph_node: {
109
260
  type: 'object',
261
+ properties: {
262
+ type: {
263
+ enum: ['paragraph'],
264
+ },
265
+ marks: {
266
+ type: 'array',
267
+ },
268
+ },
110
269
  },
111
270
  paragraph_with_no_marks_node: {},
112
271
  paragraph_with_alignment_node: {},
113
272
  paragraph_with_indentation_node: {},
114
273
  caption_node: {
115
274
  type: 'object',
275
+ properties: {
276
+ type: {
277
+ enum: ['caption'],
278
+ },
279
+ },
116
280
  },
117
281
  mediaSingle_node: {
118
282
  type: 'object',
283
+ properties: {
284
+ type: {
285
+ enum: ['mediaSingle'],
286
+ },
287
+ marks: {
288
+ type: 'array',
289
+ },
290
+ },
119
291
  },
120
292
  mediaSingle_caption_node: {},
121
293
  mediaSingle_full_node: {},
122
294
  taskItem_node: {
123
295
  type: 'object',
296
+ properties: {
297
+ type: {
298
+ enum: ['taskItem'],
299
+ },
300
+ },
124
301
  },
125
302
  taskList_node: {
126
303
  type: 'object',
304
+ properties: {
305
+ type: {
306
+ enum: ['taskList'],
307
+ },
308
+ },
127
309
  },
128
310
  listItem_node: {
129
311
  type: 'object',
312
+ properties: {
313
+ type: {
314
+ enum: ['listItem'],
315
+ },
316
+ },
130
317
  },
131
318
  bulletList_node: {
132
319
  type: 'object',
320
+ properties: {
321
+ type: {
322
+ enum: ['bulletList'],
323
+ },
324
+ },
133
325
  },
134
326
  orderedList_node: {
135
327
  type: 'object',
328
+ properties: {
329
+ type: {
330
+ enum: ['orderedList'],
331
+ },
332
+ },
136
333
  },
137
334
  heading_node: {
138
335
  type: 'object',
336
+ properties: {
337
+ type: {
338
+ enum: ['heading'],
339
+ },
340
+ },
139
341
  },
140
342
  heading_with_no_marks_node: {},
141
343
  heading_with_alignment_node: {},
142
344
  heading_with_indentation_node: {},
143
345
  mediaGroup_node: {
144
346
  type: 'object',
347
+ properties: {
348
+ type: {
349
+ enum: ['mediaGroup'],
350
+ },
351
+ },
145
352
  },
146
353
  decisionItem_node: {
147
354
  type: 'object',
355
+ properties: {
356
+ type: {
357
+ enum: ['decisionItem'],
358
+ },
359
+ },
148
360
  },
149
361
  decisionList_node: {
150
362
  type: 'object',
363
+ properties: {
364
+ type: {
365
+ enum: ['decisionList'],
366
+ },
367
+ },
151
368
  },
152
369
  rule_node: {
153
370
  type: 'object',
371
+ properties: {
372
+ type: {
373
+ enum: ['rule'],
374
+ },
375
+ },
154
376
  },
155
377
  panel_node: {
156
378
  type: 'object',
379
+ properties: {
380
+ type: {
381
+ enum: ['panel'],
382
+ },
383
+ },
157
384
  },
158
385
  blockquote_node: {
159
386
  type: 'object',
387
+ properties: {
388
+ type: {
389
+ enum: ['blockquote'],
390
+ },
391
+ },
160
392
  },
161
393
  extension_node: {
162
394
  type: 'object',
395
+ properties: {
396
+ type: {
397
+ enum: ['extension'],
398
+ },
399
+ marks: {
400
+ type: 'array',
401
+ },
402
+ },
163
403
  },
164
404
  extension_with_marks_node: {},
165
405
  embedCard_node: {
166
406
  type: 'object',
407
+ properties: {
408
+ type: {
409
+ enum: ['embedCard'],
410
+ },
411
+ },
167
412
  },
168
413
  nestedExpand_node: {
169
414
  type: 'object',
415
+ properties: {
416
+ type: {
417
+ enum: ['nestedExpand'],
418
+ },
419
+ },
170
420
  },
171
421
  nestedExpand_with_no_marks_node: {},
172
422
  table_node: {
173
423
  type: 'object',
424
+ properties: {
425
+ type: {
426
+ enum: ['table'],
427
+ },
428
+ marks: {
429
+ type: 'array',
430
+ },
431
+ },
174
432
  },
175
433
  table_row_node: {
176
434
  type: 'object',
435
+ properties: {
436
+ type: {
437
+ enum: ['tableRow'],
438
+ },
439
+ },
177
440
  },
178
441
  table_cell_node: {
179
442
  type: 'object',
443
+ properties: {
444
+ type: {
445
+ enum: ['tableCell'],
446
+ },
447
+ },
180
448
  },
181
449
  table_header_node: {
182
450
  type: 'object',
451
+ properties: {
452
+ type: {
453
+ enum: ['tableHeader'],
454
+ },
455
+ },
183
456
  },
184
457
  expand_node: {
185
458
  type: 'object',
459
+ properties: {
460
+ type: {
461
+ enum: ['expand'],
462
+ },
463
+ },
186
464
  },
187
465
  expand_with_no_mark_node: {},
188
466
  expand_with_breakout_mark_node: {},
189
467
  bodiedExtension_node: {
190
468
  type: 'object',
469
+ properties: {
470
+ type: {
471
+ enum: ['bodiedExtension'],
472
+ },
473
+ },
191
474
  },
192
475
  bodiedExtension_with_marks_node: {},
193
476
  layoutColumn_node: {
194
477
  type: 'object',
478
+ properties: {
479
+ type: {
480
+ enum: ['layoutColumn'],
481
+ },
482
+ },
195
483
  },
196
484
  layoutSection_node: {
197
485
  type: 'object',
486
+ properties: {
487
+ type: {
488
+ enum: ['layoutSection'],
489
+ },
490
+ marks: {
491
+ type: 'array',
492
+ },
493
+ },
198
494
  },
199
495
  layoutSection_full_node: {},
200
496
  doc_node: {
201
497
  type: 'object',
498
+ properties: {
499
+ type: {
500
+ enum: ['doc'],
501
+ },
502
+ },
202
503
  },
203
504
  },
204
505
  };