@atlaskit/adf-schema 36.10.11 → 36.10.13

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 (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/next-schema/full-schema.adf.js +3 -1
  3. package/dist/cjs/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  4. package/dist/cjs/next-schema/nodes/blockquote.js +1 -1
  5. package/dist/cjs/next-schema/nodes/caption.js +1 -1
  6. package/dist/cjs/next-schema/nodes/list.js +1 -1
  7. package/dist/cjs/next-schema/nodes/nestedExpand.js +1 -1
  8. package/dist/cjs/next-schema/nodes/panel.js +1 -1
  9. package/dist/cjs/next-schema/nodes/tableCell.js +1 -1
  10. package/dist/cjs/next-schema/nodes/tableHeader.js +1 -1
  11. package/dist/es2019/next-schema/full-schema.adf.js +3 -1
  12. package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  13. package/dist/es2019/next-schema/nodes/blockquote.js +1 -1
  14. package/dist/es2019/next-schema/nodes/caption.js +1 -1
  15. package/dist/es2019/next-schema/nodes/list.js +1 -1
  16. package/dist/es2019/next-schema/nodes/nestedExpand.js +1 -1
  17. package/dist/es2019/next-schema/nodes/panel.js +1 -1
  18. package/dist/es2019/next-schema/nodes/tableCell.js +1 -1
  19. package/dist/es2019/next-schema/nodes/tableHeader.js +1 -1
  20. package/dist/esm/next-schema/full-schema.adf.js +3 -1
  21. package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  22. package/dist/esm/next-schema/nodes/blockquote.js +1 -1
  23. package/dist/esm/next-schema/nodes/caption.js +1 -1
  24. package/dist/esm/next-schema/nodes/list.js +1 -1
  25. package/dist/esm/next-schema/nodes/nestedExpand.js +1 -1
  26. package/dist/esm/next-schema/nodes/panel.js +1 -1
  27. package/dist/esm/next-schema/nodes/tableCell.js +1 -1
  28. package/dist/esm/next-schema/nodes/tableHeader.js +1 -1
  29. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +2 -65
  30. package/package.json +2 -2
  31. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +69 -0
  32. package/schema-generators/__tests__/unit/jqueries.md +26 -0
  33. package/schema-generators/__tests__/unit/json-full-schema.unit.ts +581 -30
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.10.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 98d9d14: Create anyof field under content items in JSON Schema transformer for ADF dSL
8
+
9
+ ## 36.10.12
10
+
11
+ ### Patch Changes
12
+
13
+ - cc7c8bf: Add content list field and $ref field to JSON Schema transformer from ADF DSL
14
+
3
15
  ## 36.10.11
4
16
 
5
17
  ### Patch Changes
@@ -8,9 +8,11 @@ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var _blockGroup = require("./groups/blockGroup");
9
9
  var _layoutSection = require("./nodes/layoutSection");
10
10
  var _blockRootOnlyGroup = require("./groups/blockRootOnlyGroup");
11
+ var _nestedExpand = require("./nodes/nestedExpand");
12
+ var _paragraph = require("./nodes/paragraph");
11
13
  var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({
12
14
  root: true,
13
15
  version: 1,
14
- content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _layoutSection.layoutSection, _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup))]
16
+ content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _layoutSection.layoutSection, _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _nestedExpand.nestedExpand, _paragraph.paragraph))]
15
17
  });
16
18
  var _default = exports.default = doc;
@@ -21,4 +21,4 @@ var _table = require("../nodes/table");
21
21
  var _task = require("../nodes/task");
22
22
  // Not an actual group, but a collection of nodes that can't be nested inside each other
23
23
  // TODO: make it an actual group
24
- var nonNestableBlockContent = exports.nonNestableBlockContent = [_panel.panel, _paragraph.paragraph, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading, _codeBlock.codeBlock, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _decisionList.decisionList, _task.taskList, _table.table, _extension.extension, _blockCard.blockCard, _embedCard.embedCard];
24
+ var nonNestableBlockContent = exports.nonNestableBlockContent = [_codeBlock.codeBlock.use('with_no_marks'), _blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _extension.extension.use('with_marks'), _embedCard.embedCard, _table.table];
@@ -10,7 +10,7 @@ var _paragraph = require("./paragraph");
10
10
  var blockquote = exports.blockquote = (0, _adfSchemaGenerator.adfNode)('blockquote').define({
11
11
  defining: true,
12
12
  selectable: false,
13
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph))]
13
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _list.bulletList, _list.orderedList))]
14
14
  }).variant('with_list', {
15
15
  content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _list.orderedList, _list.bulletList))]
16
16
  });
@@ -17,5 +17,5 @@ var _text = require("./text");
17
17
  var caption = exports.caption = (0, _adfSchemaGenerator.adfNode)('caption').define({
18
18
  isolating: true,
19
19
  selectable: false,
20
- content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_text.text.use('formatted'), _hardBreak.hardBreak, _mention.mention, _emoji.emoji, _date.date, _placeholder.placeholder, _inlineCard.inlineCard, _status.status))]
20
+ content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_hardBreak.hardBreak, _mention.mention, _emoji.emoji, _date.date, _placeholder.placeholder, _inlineCard.inlineCard, _status.status, _text.text.use('formatted'), _text.text.use('code_inline')))]
21
21
  });
@@ -30,5 +30,5 @@ bulletList.define({
30
30
  listItem.define({
31
31
  defining: true,
32
32
  selectable: false,
33
- content: [(0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _mediaSingle.mediaSingle, _codeBlock.codeBlock), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, orderedList, bulletList, _mediaSingle.mediaSingle, _codeBlock.codeBlock, _task.taskList))]
33
+ content: [(0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full')), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, bulletList, orderedList))]
34
34
  });
@@ -31,5 +31,5 @@ var nestedExpand = exports.nestedExpand = (0, _adfSchemaGenerator.adfNode)('nest
31
31
  optional: true
32
32
  }
33
33
  },
34
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _heading.heading, _mediaSingle.mediaSingle, _mediaGroup.mediaGroup, _codeBlock.codeBlock, _list.bulletList, _list.orderedList, _task.taskList, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote))]
34
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote))]
35
35
  }).variant('with_no_marks', {});
@@ -44,5 +44,5 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
44
44
  optional: true
45
45
  }
46
46
  },
47
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _heading.heading, _list.bulletList, _list.orderedList, _blockCard.blockCard, _codeBlock.codeBlock, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _decisionList.decisionList, _task.taskList, _rule.rule))]
47
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule))]
48
48
  });
@@ -46,5 +46,5 @@ var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell'
46
46
  optional: true
47
47
  }
48
48
  },
49
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_panel.panel, _paragraph.paragraph, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading, _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _codeBlock.codeBlock, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _decisionList.decisionList, _task.taskList, _extension.extension, _blockCard.blockCard, _nestedExpand.nestedExpand, _embedCard.embedCard))]
49
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _extension.extension.use('with_marks'), _embedCard.embedCard, _nestedExpand.nestedExpand.use('with_no_marks')))]
50
50
  });
@@ -46,5 +46,5 @@ var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('tableH
46
46
  optional: true
47
47
  }
48
48
  },
49
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_panel.panel, _paragraph.paragraph, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading, _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _codeBlock.codeBlock, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _decisionList.decisionList, _task.taskList, _extension.extension, _blockCard.blockCard, _nestedExpand.nestedExpand, _nestedExpand.nestedExpand.use('with_no_marks'), _embedCard.embedCard))]
49
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _extension.extension.use('with_marks'), _embedCard.embedCard, _nestedExpand.nestedExpand.use('with_no_marks')))]
50
50
  });
@@ -2,9 +2,11 @@ import { $or, $zeroPlus, adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { blockGroup } from './groups/blockGroup';
3
3
  import { layoutSection } from './nodes/layoutSection';
4
4
  import { blockRootOnlyGroup } from './groups/blockRootOnlyGroup';
5
+ import { nestedExpand } from './nodes/nestedExpand';
6
+ import { paragraph } from './nodes/paragraph';
5
7
  const doc = adfNode('doc').define({
6
8
  root: true,
7
9
  version: 1,
8
- content: [$zeroPlus($or(blockGroup, layoutSection, layoutSection.use('full'), blockRootOnlyGroup))]
10
+ content: [$zeroPlus($or(blockGroup, layoutSection, layoutSection.use('full'), blockRootOnlyGroup, nestedExpand, paragraph))]
9
11
  });
10
12
  export default doc;
@@ -16,4 +16,4 @@ import { taskList } from '../nodes/task';
16
16
 
17
17
  // Not an actual group, but a collection of nodes that can't be nested inside each other
18
18
  // TODO: make it an actual group
19
- export const nonNestableBlockContent = [panel, paragraph, blockquote, orderedList, bulletList, rule, heading, codeBlock, mediaGroup, mediaSingle, decisionList, taskList, table, extension, blockCard, embedCard];
19
+ export const nonNestableBlockContent = [codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, table];
@@ -4,7 +4,7 @@ import { paragraph } from './paragraph';
4
4
  export const blockquote = adfNode('blockquote').define({
5
5
  defining: true,
6
6
  selectable: false,
7
- content: [$onePlus($or(paragraph))]
7
+ content: [$onePlus($or(paragraph.use('with_no_marks'), bulletList, orderedList))]
8
8
  }).variant('with_list', {
9
9
  content: [$onePlus($or(paragraph, orderedList, bulletList))]
10
10
  });
@@ -12,5 +12,5 @@ import { text } from './text';
12
12
  export const caption = adfNode('caption').define({
13
13
  isolating: true,
14
14
  selectable: false,
15
- content: [$zeroPlus($or(text.use('formatted'), hardBreak, mention, emoji, date, placeholder, inlineCard, status))]
15
+ content: [$zeroPlus($or(hardBreak, mention, emoji, date, placeholder, inlineCard, status, text.use('formatted'), text.use('code_inline')))]
16
16
  });
@@ -24,5 +24,5 @@ bulletList.define({
24
24
  listItem.define({
25
25
  defining: true,
26
26
  selectable: false,
27
- content: [$or(paragraph, mediaSingle, codeBlock), $zeroPlus($or(paragraph, orderedList, bulletList, mediaSingle, codeBlock, taskList))]
27
+ content: [$or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full')), $zeroPlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList))]
28
28
  });
@@ -25,5 +25,5 @@ export const nestedExpand = adfNode('nestedExpand').define({
25
25
  optional: true
26
26
  }
27
27
  },
28
- content: [$onePlus($or(paragraph, heading, mediaSingle, mediaGroup, codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote))]
28
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote))]
29
29
  }).variant('with_no_marks', {});
@@ -38,5 +38,5 @@ export const panel = adfNode('panel').define({
38
38
  optional: true
39
39
  }
40
40
  },
41
- content: [$onePlus($or(paragraph, heading, bulletList, orderedList, blockCard, codeBlock, mediaGroup, mediaSingle, decisionList, taskList, rule))]
41
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule))]
42
42
  });
@@ -40,5 +40,5 @@ export const tableCell = adfNode('tableCell').define({
40
40
  optional: true
41
41
  }
42
42
  },
43
- content: [$onePlus($or(panel, paragraph, blockquote, orderedList, bulletList, rule, heading, heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaGroup, mediaSingle, decisionList, taskList, extension, blockCard, nestedExpand, embedCard))]
43
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, nestedExpand.use('with_no_marks')))]
44
44
  });
@@ -40,5 +40,5 @@ export const tableHeader = adfNode('tableHeader').define({
40
40
  optional: true
41
41
  }
42
42
  },
43
- content: [$onePlus($or(panel, paragraph, blockquote, orderedList, bulletList, rule, heading, heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaGroup, mediaSingle, decisionList, taskList, extension, blockCard, nestedExpand, nestedExpand.use('with_no_marks'), embedCard))]
43
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, nestedExpand.use('with_no_marks')))]
44
44
  });
@@ -2,9 +2,11 @@ import { $or, $zeroPlus, adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { blockGroup } from './groups/blockGroup';
3
3
  import { layoutSection } from './nodes/layoutSection';
4
4
  import { blockRootOnlyGroup } from './groups/blockRootOnlyGroup';
5
+ import { nestedExpand } from './nodes/nestedExpand';
6
+ import { paragraph } from './nodes/paragraph';
5
7
  var doc = adfNode('doc').define({
6
8
  root: true,
7
9
  version: 1,
8
- content: [$zeroPlus($or(blockGroup, layoutSection, layoutSection.use('full'), blockRootOnlyGroup))]
10
+ content: [$zeroPlus($or(blockGroup, layoutSection, layoutSection.use('full'), blockRootOnlyGroup, nestedExpand, paragraph))]
9
11
  });
10
12
  export default doc;
@@ -16,4 +16,4 @@ import { taskList } from '../nodes/task';
16
16
 
17
17
  // Not an actual group, but a collection of nodes that can't be nested inside each other
18
18
  // TODO: make it an actual group
19
- export var nonNestableBlockContent = [panel, paragraph, blockquote, orderedList, bulletList, rule, heading, codeBlock, mediaGroup, mediaSingle, decisionList, taskList, table, extension, blockCard, embedCard];
19
+ export var nonNestableBlockContent = [codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, table];
@@ -4,7 +4,7 @@ import { paragraph } from './paragraph';
4
4
  export var blockquote = adfNode('blockquote').define({
5
5
  defining: true,
6
6
  selectable: false,
7
- content: [$onePlus($or(paragraph))]
7
+ content: [$onePlus($or(paragraph.use('with_no_marks'), bulletList, orderedList))]
8
8
  }).variant('with_list', {
9
9
  content: [$onePlus($or(paragraph, orderedList, bulletList))]
10
10
  });
@@ -12,5 +12,5 @@ import { text } from './text';
12
12
  export var caption = adfNode('caption').define({
13
13
  isolating: true,
14
14
  selectable: false,
15
- content: [$zeroPlus($or(text.use('formatted'), hardBreak, mention, emoji, date, placeholder, inlineCard, status))]
15
+ content: [$zeroPlus($or(hardBreak, mention, emoji, date, placeholder, inlineCard, status, text.use('formatted'), text.use('code_inline')))]
16
16
  });
@@ -24,5 +24,5 @@ bulletList.define({
24
24
  listItem.define({
25
25
  defining: true,
26
26
  selectable: false,
27
- content: [$or(paragraph, mediaSingle, codeBlock), $zeroPlus($or(paragraph, orderedList, bulletList, mediaSingle, codeBlock, taskList))]
27
+ content: [$or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full')), $zeroPlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList))]
28
28
  });
@@ -25,5 +25,5 @@ export var nestedExpand = adfNode('nestedExpand').define({
25
25
  optional: true
26
26
  }
27
27
  },
28
- content: [$onePlus($or(paragraph, heading, mediaSingle, mediaGroup, codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote))]
28
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote))]
29
29
  }).variant('with_no_marks', {});
@@ -38,5 +38,5 @@ export var panel = adfNode('panel').define({
38
38
  optional: true
39
39
  }
40
40
  },
41
- content: [$onePlus($or(paragraph, heading, bulletList, orderedList, blockCard, codeBlock, mediaGroup, mediaSingle, decisionList, taskList, rule))]
41
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule))]
42
42
  });
@@ -40,5 +40,5 @@ export var tableCell = adfNode('tableCell').define({
40
40
  optional: true
41
41
  }
42
42
  },
43
- content: [$onePlus($or(panel, paragraph, blockquote, orderedList, bulletList, rule, heading, heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaGroup, mediaSingle, decisionList, taskList, extension, blockCard, nestedExpand, embedCard))]
43
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, nestedExpand.use('with_no_marks')))]
44
44
  });
@@ -40,5 +40,5 @@ export var tableHeader = adfNode('tableHeader').define({
40
40
  optional: true
41
41
  }
42
42
  },
43
- content: [$onePlus($or(panel, paragraph, blockquote, orderedList, bulletList, rule, heading, heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaGroup, mediaSingle, decisionList, taskList, extension, blockCard, nestedExpand, nestedExpand.use('with_no_marks'), embedCard))]
43
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, nestedExpand.use('with_no_marks')))]
44
44
  });
@@ -15,7 +15,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
15
15
  marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
16
16
  selectable?: boolean;
17
17
  whitespace?: "pre" | "normal";
18
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks", "with_no_marks"], {
18
+ }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<any, {
19
19
  root?: boolean;
20
20
  atom?: boolean;
21
21
  version?: 1;
@@ -34,7 +34,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
34
34
  whitespace?: "pre" | "normal";
35
35
  } & {
36
36
  marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
37
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "caption", "full"], {
37
+ }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<any, {
38
38
  root?: boolean;
39
39
  atom?: boolean;
40
40
  version?: 1;
@@ -54,29 +54,6 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
54
54
  } & {
55
55
  atom: false;
56
56
  content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOrSpec[];
57
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_marks", "with_no_marks"], {
58
- root?: boolean;
59
- atom?: boolean;
60
- version?: 1;
61
- attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
62
- inline?: true;
63
- code?: boolean;
64
- content?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentSpec[];
65
- defining?: boolean;
66
- definingAsContext?: boolean;
67
- definingForContent?: boolean;
68
- draggable?: boolean;
69
- group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
70
- isolating?: boolean;
71
- marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
72
- selectable?: boolean;
73
- whitespace?: "pre" | "normal";
74
- } & {
75
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
76
- } & {
77
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
78
- } & {
79
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
80
57
  }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_list"], {
81
58
  root?: boolean;
82
59
  atom?: boolean;
@@ -96,44 +73,4 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
96
73
  whitespace?: "pre" | "normal";
97
74
  } & {
98
75
  content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
99
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks"], {
100
- root?: boolean;
101
- atom?: boolean;
102
- version?: 1;
103
- attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
104
- inline?: true;
105
- code?: boolean;
106
- content?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentSpec[];
107
- defining?: boolean;
108
- definingAsContext?: boolean;
109
- definingForContent?: boolean;
110
- draggable?: boolean;
111
- group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
112
- isolating?: boolean;
113
- marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
114
- selectable?: boolean;
115
- whitespace?: "pre" | "normal";
116
- } & {
117
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
118
- }> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_no_marks"], {
119
- root?: boolean;
120
- atom?: boolean;
121
- version?: 1;
122
- attrs?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFAttribute").ADFAttributes;
123
- inline?: true;
124
- code?: boolean;
125
- content?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentSpec[];
126
- defining?: boolean;
127
- definingAsContext?: boolean;
128
- definingForContent?: boolean;
129
- draggable?: boolean;
130
- group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
131
- isolating?: boolean;
132
- marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
133
- selectable?: boolean;
134
- whitespace?: "pre" | "normal";
135
- } & {
136
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
137
- } & {
138
- marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
139
76
  }>)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.10.11",
3
+ "version": "36.10.13",
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/"
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@atlassian/adf-schema-json": "^1.15.0",
48
- "@atlaskit/adf-schema-generator": "^1.8.4",
48
+ "@atlaskit/adf-schema-generator": "^1.9.1",
49
49
  "@babel/cli": "^7.22.9",
50
50
  "@babel/core": "^7.22.9",
51
51
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -0,0 +1,69 @@
1
+ import { adfToValidatorSpec } from '@atlaskit/adf-schema-generator';
2
+ import adfNode from '@atlaskit/adf-schema/src/next-schema/full-schema.adf';
3
+
4
+ test('should transform adfNode to validator spec', () => {
5
+ const result = adfToValidatorSpec(adfNode);
6
+
7
+ expect(result.heading_with_alignment.json.props).toEqual(
8
+ heading_with_alignment.props,
9
+ );
10
+ });
11
+
12
+ test('should be able to handle weird attrs', () => {
13
+ const result = adfToValidatorSpec(adfNode);
14
+
15
+ expect(result.mention.json.props.attrs).toEqual(mention);
16
+ });
17
+
18
+ const heading_with_alignment = {
19
+ props: {
20
+ attrs: {
21
+ level: {
22
+ default: 1,
23
+ maximum: 6,
24
+ minimum: 1,
25
+ type: 'number',
26
+ },
27
+ },
28
+ content: {
29
+ items: ['inline'],
30
+ minItems: 0,
31
+ type: 'array',
32
+ },
33
+ marks: {
34
+ items: [
35
+ 'link',
36
+ 'em',
37
+ 'strong',
38
+ 'strike',
39
+ 'subsup',
40
+ 'underline',
41
+ 'textColor',
42
+ 'annotation',
43
+ 'backgroundColor',
44
+ 'code',
45
+ 'border',
46
+ ],
47
+ type: 'array',
48
+ },
49
+ type: {
50
+ type: 'enum',
51
+ values: ['heading'],
52
+ },
53
+ },
54
+ };
55
+
56
+ const mention = {
57
+ attrs: {
58
+ id: { type: 'string', default: '' },
59
+ localId: { type: 'string', optional: true },
60
+ text: { type: 'string', default: '', optional: true },
61
+ accessLevel: { type: 'string', default: '', optional: true },
62
+ userType: {
63
+ type: 'enum',
64
+ values: ['DEFAULT', 'SPECIAL', 'APP'],
65
+ default: null,
66
+ optional: true,
67
+ },
68
+ },
69
+ };
@@ -140,3 +140,29 @@ A number of nodes have `marks` defined, yet the array is empty. Assuming this is
140
140
  .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
141
141
  .bodiedExtension_node.properties.marks, .codeBlock_node.properties.marks, .expand_node.properties.marks, .heading_node.properties.marks, .inlineExtension_node.properties.marks, .text_node.properties.marks, .extension_node.properties.marks, .paragraph_node.properties.marks) else . end)' | pbcopy
142
142
  ```
143
+
144
+ Base level content objects (not nodes) are deleted. `inline` is also deleted, as it is a content object for paragraph.
145
+
146
+ All fields of content except for type, items, items.$ref and $ref have been deleted as well.
147
+
148
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
149
+
150
+ ```sh
151
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
152
+ .required, .additionalProperties, .allOf, .content.items.anyOf?,
153
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
154
+ .bodiedExtension_node.properties.marks, .codeBlock_node.properties.marks, .expand_node.properties.marks, .heading_node.properties.marks, .inlineExtension_node.properties.marks, .text_node.properties.marks, .extension_node.properties.marks, .paragraph_node.properties.marks) else . end)' | pbcopy
155
+ ```
156
+
157
+ Base level content objects (not nodes) are deleted. `inline` is also deleted, as it is a content object for paragraph.
158
+
159
+ All fields of content except for type, items, items.$ref and $ref have been deleted as well.
160
+
161
+ A number of nodes have `marks` defined, yet the array is empty. Assuming this is redundant, I've removed them.
162
+
163
+ ```sh
164
+ cat packages/adf-schema/json-schema/v1/full.json | jq 'walk(if type == "object" then del(
165
+ .required, .additionalProperties, .allOf,
166
+ .block_content, .nestedExpand_content, .non_nestable_block_content, .table_cell_content, .inline_node,
167
+ .bodiedExtension_node.properties.marks, .codeBlock_node.properties.marks, .expand_node.properties.marks, .heading_node.properties.marks, .inlineExtension_node.properties.marks, .text_node.properties.marks, .extension_node.properties.marks, .paragraph_node.properties.marks) else . end)' | pbcopy
168
+ ```
@@ -685,7 +685,9 @@ const jsonWithTypes = {
685
685
  },
686
686
  content: {
687
687
  type: 'array',
688
- items: {},
688
+ items: {
689
+ $ref: '#/definitions/inline_node',
690
+ },
689
691
  },
690
692
  },
691
693
  },
@@ -700,7 +702,37 @@ const jsonWithTypes = {
700
702
  },
701
703
  content: {
702
704
  type: 'array',
703
- items: {},
705
+ items: {
706
+ anyOf: [
707
+ {
708
+ $ref: '#/definitions/hardBreak_node',
709
+ },
710
+ {
711
+ $ref: '#/definitions/mention_node',
712
+ },
713
+ {
714
+ $ref: '#/definitions/emoji_node',
715
+ },
716
+ {
717
+ $ref: '#/definitions/date_node',
718
+ },
719
+ {
720
+ $ref: '#/definitions/placeholder_node',
721
+ },
722
+ {
723
+ $ref: '#/definitions/inlineCard_node',
724
+ },
725
+ {
726
+ $ref: '#/definitions/status_node',
727
+ },
728
+ {
729
+ $ref: '#/definitions/formatted_text_inline_node',
730
+ },
731
+ {
732
+ $ref: '#/definitions/code_inline_node',
733
+ },
734
+ ],
735
+ },
704
736
  minItems: 0,
705
737
  },
706
738
  },
@@ -780,7 +812,9 @@ const jsonWithTypes = {
780
812
  },
781
813
  content: {
782
814
  type: 'array',
783
- items: {},
815
+ items: {
816
+ $ref: '#/definitions/inline_node',
817
+ },
784
818
  },
785
819
  attrs: {
786
820
  type: 'object',
@@ -803,7 +837,21 @@ const jsonWithTypes = {
803
837
  },
804
838
  content: {
805
839
  type: 'array',
806
- items: [],
840
+ items: [
841
+ {
842
+ $ref: '#/definitions/taskItem_node',
843
+ },
844
+ {
845
+ anyOf: [
846
+ {
847
+ $ref: '#/definitions/taskItem_node',
848
+ },
849
+ {
850
+ $ref: '#/definitions/taskList_node',
851
+ },
852
+ ],
853
+ },
854
+ ],
807
855
  minItems: 1,
808
856
  },
809
857
  attrs: {
@@ -824,7 +872,49 @@ const jsonWithTypes = {
824
872
  },
825
873
  content: {
826
874
  type: 'array',
827
- items: [],
875
+ items: [
876
+ {
877
+ anyOf: [
878
+ {
879
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
880
+ },
881
+ {
882
+ $ref: '#/definitions/paragraph_with_no_marks_node',
883
+ },
884
+ {
885
+ $ref: '#/definitions/mediaSingle_caption_node',
886
+ },
887
+ {
888
+ $ref: '#/definitions/mediaSingle_full_node',
889
+ },
890
+ ],
891
+ },
892
+ {
893
+ anyOf: [
894
+ {
895
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
896
+ },
897
+ {
898
+ $ref: '#/definitions/paragraph_with_no_marks_node',
899
+ },
900
+ {
901
+ $ref: '#/definitions/mediaSingle_caption_node',
902
+ },
903
+ {
904
+ $ref: '#/definitions/mediaSingle_full_node',
905
+ },
906
+ {
907
+ $ref: '#/definitions/taskList_node',
908
+ },
909
+ {
910
+ $ref: '#/definitions/bulletList_node',
911
+ },
912
+ {
913
+ $ref: '#/definitions/orderedList_node',
914
+ },
915
+ ],
916
+ },
917
+ ],
828
918
  minItems: 1,
829
919
  },
830
920
  },
@@ -837,7 +927,9 @@ const jsonWithTypes = {
837
927
  },
838
928
  content: {
839
929
  type: 'array',
840
- items: {},
930
+ items: {
931
+ $ref: '#/definitions/listItem_node',
932
+ },
841
933
  minItems: 1,
842
934
  },
843
935
  },
@@ -850,7 +942,9 @@ const jsonWithTypes = {
850
942
  },
851
943
  content: {
852
944
  type: 'array',
853
- items: {},
945
+ items: {
946
+ $ref: '#/definitions/listItem_node',
947
+ },
854
948
  minItems: 1,
855
949
  },
856
950
  attrs: {
@@ -872,7 +966,9 @@ const jsonWithTypes = {
872
966
  },
873
967
  content: {
874
968
  type: 'array',
875
- items: {},
969
+ items: {
970
+ $ref: '#/definitions/inline_node',
971
+ },
876
972
  },
877
973
  attrs: {
878
974
  type: 'object',
@@ -897,7 +993,9 @@ const jsonWithTypes = {
897
993
  },
898
994
  content: {
899
995
  type: 'array',
900
- items: {},
996
+ items: {
997
+ $ref: '#/definitions/media_node',
998
+ },
901
999
  minItems: 1,
902
1000
  },
903
1001
  },
@@ -910,7 +1008,9 @@ const jsonWithTypes = {
910
1008
  },
911
1009
  content: {
912
1010
  type: 'array',
913
- items: {},
1011
+ items: {
1012
+ $ref: '#/definitions/inline_node',
1013
+ },
914
1014
  },
915
1015
  attrs: {
916
1016
  type: 'object',
@@ -933,7 +1033,9 @@ const jsonWithTypes = {
933
1033
  },
934
1034
  content: {
935
1035
  type: 'array',
936
- items: {},
1036
+ items: {
1037
+ $ref: '#/definitions/decisionItem_node',
1038
+ },
937
1039
  minItems: 1,
938
1040
  },
939
1041
  attrs: {
@@ -990,7 +1092,46 @@ const jsonWithTypes = {
990
1092
  },
991
1093
  content: {
992
1094
  type: 'array',
993
- items: {},
1095
+ items: {
1096
+ anyOf: [
1097
+ {
1098
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1099
+ },
1100
+ {
1101
+ $ref: '#/definitions/blockCard_node',
1102
+ },
1103
+ {
1104
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1105
+ },
1106
+ {
1107
+ $ref: '#/definitions/mediaSingle_caption_node',
1108
+ },
1109
+ {
1110
+ $ref: '#/definitions/mediaSingle_full_node',
1111
+ },
1112
+ {
1113
+ $ref: '#/definitions/taskList_node',
1114
+ },
1115
+ {
1116
+ $ref: '#/definitions/bulletList_node',
1117
+ },
1118
+ {
1119
+ $ref: '#/definitions/orderedList_node',
1120
+ },
1121
+ {
1122
+ $ref: '#/definitions/heading_with_no_marks_node',
1123
+ },
1124
+ {
1125
+ $ref: '#/definitions/mediaGroup_node',
1126
+ },
1127
+ {
1128
+ $ref: '#/definitions/decisionList_node',
1129
+ },
1130
+ {
1131
+ $ref: '#/definitions/rule_node',
1132
+ },
1133
+ ],
1134
+ },
994
1135
  minItems: 1,
995
1136
  },
996
1137
  },
@@ -1003,7 +1144,19 @@ const jsonWithTypes = {
1003
1144
  },
1004
1145
  content: {
1005
1146
  type: 'array',
1006
- items: {},
1147
+ items: {
1148
+ anyOf: [
1149
+ {
1150
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1151
+ },
1152
+ {
1153
+ $ref: '#/definitions/bulletList_node',
1154
+ },
1155
+ {
1156
+ $ref: '#/definitions/orderedList_node',
1157
+ },
1158
+ ],
1159
+ },
1007
1160
  minItems: 1,
1008
1161
  },
1009
1162
  },
@@ -1093,7 +1246,9 @@ const jsonWithTypes = {
1093
1246
  },
1094
1247
  },
1095
1248
  },
1096
- content: {},
1249
+ content: {
1250
+ $ref: '#/definitions/nestedExpand_content',
1251
+ },
1097
1252
  },
1098
1253
  },
1099
1254
  nestedExpand_with_no_marks_node: {},
@@ -1133,7 +1288,9 @@ const jsonWithTypes = {
1133
1288
  },
1134
1289
  content: {
1135
1290
  type: 'array',
1136
- items: {},
1291
+ items: {
1292
+ $ref: '#/definitions/table_row_node',
1293
+ },
1137
1294
  minItems: 1,
1138
1295
  },
1139
1296
  marks: {
@@ -1152,7 +1309,16 @@ const jsonWithTypes = {
1152
1309
  },
1153
1310
  content: {
1154
1311
  type: 'array',
1155
- items: {},
1312
+ items: {
1313
+ anyOf: [
1314
+ {
1315
+ $ref: '#/definitions/table_cell_node',
1316
+ },
1317
+ {
1318
+ $ref: '#/definitions/table_header_node',
1319
+ },
1320
+ ],
1321
+ },
1156
1322
  },
1157
1323
  },
1158
1324
  },
@@ -1182,7 +1348,9 @@ const jsonWithTypes = {
1182
1348
  },
1183
1349
  },
1184
1350
  },
1185
- content: {},
1351
+ content: {
1352
+ $ref: '#/definitions/table_cell_content',
1353
+ },
1186
1354
  },
1187
1355
  },
1188
1356
  table_header_node: {
@@ -1211,7 +1379,9 @@ const jsonWithTypes = {
1211
1379
  },
1212
1380
  },
1213
1381
  },
1214
- content: {},
1382
+ content: {
1383
+ $ref: '#/definitions/table_cell_content',
1384
+ },
1215
1385
  },
1216
1386
  },
1217
1387
  expand_node: {
@@ -1230,7 +1400,9 @@ const jsonWithTypes = {
1230
1400
  },
1231
1401
  content: {
1232
1402
  type: 'array',
1233
- items: {},
1403
+ items: {
1404
+ $ref: '#/definitions/non_nestable_block_content',
1405
+ },
1234
1406
  minItems: 1,
1235
1407
  },
1236
1408
  },
@@ -1269,7 +1441,9 @@ const jsonWithTypes = {
1269
1441
  },
1270
1442
  content: {
1271
1443
  type: 'array',
1272
- items: {},
1444
+ items: {
1445
+ $ref: '#/definitions/non_nestable_block_content',
1446
+ },
1273
1447
  minItems: 1,
1274
1448
  },
1275
1449
  },
@@ -1293,7 +1467,9 @@ const jsonWithTypes = {
1293
1467
  },
1294
1468
  content: {
1295
1469
  type: 'array',
1296
- items: {},
1470
+ items: {
1471
+ $ref: '#/definitions/block_content',
1472
+ },
1297
1473
  minItems: 1,
1298
1474
  },
1299
1475
  },
@@ -1312,7 +1488,9 @@ const jsonWithTypes = {
1312
1488
  },
1313
1489
  content: {
1314
1490
  type: 'array',
1315
- items: {},
1491
+ items: {
1492
+ $ref: '#/definitions/layoutColumn_node',
1493
+ },
1316
1494
  },
1317
1495
  },
1318
1496
  },
@@ -1328,7 +1506,88 @@ const jsonWithTypes = {
1328
1506
  },
1329
1507
  content: {
1330
1508
  type: 'array',
1331
- items: {},
1509
+ items: {
1510
+ anyOf: [
1511
+ {
1512
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1513
+ },
1514
+ {
1515
+ $ref: '#/definitions/codeBlock_with_marks_node',
1516
+ },
1517
+ {
1518
+ $ref: '#/definitions/blockCard_node',
1519
+ },
1520
+ {
1521
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1522
+ },
1523
+ {
1524
+ $ref: '#/definitions/paragraph_with_alignment_node',
1525
+ },
1526
+ {
1527
+ $ref: '#/definitions/paragraph_with_indentation_node',
1528
+ },
1529
+ {
1530
+ $ref: '#/definitions/mediaSingle_caption_node',
1531
+ },
1532
+ {
1533
+ $ref: '#/definitions/mediaSingle_full_node',
1534
+ },
1535
+ {
1536
+ $ref: '#/definitions/taskList_node',
1537
+ },
1538
+ {
1539
+ $ref: '#/definitions/bulletList_node',
1540
+ },
1541
+ {
1542
+ $ref: '#/definitions/orderedList_node',
1543
+ },
1544
+ {
1545
+ $ref: '#/definitions/heading_with_no_marks_node',
1546
+ },
1547
+ {
1548
+ $ref: '#/definitions/heading_with_alignment_node',
1549
+ },
1550
+ {
1551
+ $ref: '#/definitions/heading_with_indentation_node',
1552
+ },
1553
+ {
1554
+ $ref: '#/definitions/mediaGroup_node',
1555
+ },
1556
+ {
1557
+ $ref: '#/definitions/decisionList_node',
1558
+ },
1559
+ {
1560
+ $ref: '#/definitions/rule_node',
1561
+ },
1562
+ {
1563
+ $ref: '#/definitions/panel_node',
1564
+ },
1565
+ {
1566
+ $ref: '#/definitions/blockquote_node',
1567
+ },
1568
+ {
1569
+ $ref: '#/definitions/extension_with_marks_node',
1570
+ },
1571
+ {
1572
+ $ref: '#/definitions/embedCard_node',
1573
+ },
1574
+ {
1575
+ $ref: '#/definitions/table_node',
1576
+ },
1577
+ {
1578
+ $ref: '#/definitions/expand_with_no_mark_node',
1579
+ },
1580
+ {
1581
+ $ref: '#/definitions/expand_with_breakout_mark_node',
1582
+ },
1583
+ {
1584
+ $ref: '#/definitions/bodiedExtension_with_marks_node',
1585
+ },
1586
+ {
1587
+ $ref: '#/definitions/layoutSection_full_node',
1588
+ },
1589
+ ],
1590
+ },
1332
1591
  },
1333
1592
  },
1334
1593
  },
@@ -1336,22 +1595,314 @@ const jsonWithTypes = {
1336
1595
  };
1337
1596
 
1338
1597
  // New JSON, different to the old JSON schema
1339
- jsonWithTypes.definitions.heading_node.properties.content = {
1340
- type: 'array',
1341
- items: {},
1342
- };
1343
1598
  jsonWithTypes.definitions.nestedExpand_node.properties.content = {
1344
1599
  type: 'array',
1345
- items: {},
1600
+ items: {
1601
+ anyOf: [
1602
+ {
1603
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1604
+ },
1605
+ {
1606
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1607
+ },
1608
+ {
1609
+ $ref: '#/definitions/mediaSingle_caption_node',
1610
+ },
1611
+ {
1612
+ $ref: '#/definitions/mediaSingle_full_node',
1613
+ },
1614
+ {
1615
+ $ref: '#/definitions/taskList_node',
1616
+ },
1617
+ {
1618
+ $ref: '#/definitions/bulletList_node',
1619
+ },
1620
+ {
1621
+ $ref: '#/definitions/orderedList_node',
1622
+ },
1623
+ {
1624
+ $ref: '#/definitions/heading_with_no_marks_node',
1625
+ },
1626
+ {
1627
+ $ref: '#/definitions/mediaGroup_node',
1628
+ },
1629
+ {
1630
+ $ref: '#/definitions/decisionList_node',
1631
+ },
1632
+ {
1633
+ $ref: '#/definitions/rule_node',
1634
+ },
1635
+ {
1636
+ $ref: '#/definitions/panel_node',
1637
+ },
1638
+ {
1639
+ $ref: '#/definitions/blockquote_node',
1640
+ },
1641
+ ],
1642
+ },
1346
1643
  minItems: 1,
1347
1644
  };
1645
+ jsonWithTypes.definitions.expand_node.properties.content.items = {
1646
+ anyOf: [
1647
+ {
1648
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1649
+ },
1650
+ {
1651
+ $ref: '#/definitions/blockCard_node',
1652
+ },
1653
+ {
1654
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1655
+ },
1656
+ {
1657
+ $ref: '#/definitions/mediaSingle_caption_node',
1658
+ },
1659
+ {
1660
+ $ref: '#/definitions/mediaSingle_full_node',
1661
+ },
1662
+ {
1663
+ $ref: '#/definitions/taskList_node',
1664
+ },
1665
+ {
1666
+ $ref: '#/definitions/bulletList_node',
1667
+ },
1668
+ {
1669
+ $ref: '#/definitions/orderedList_node',
1670
+ },
1671
+ {
1672
+ $ref: '#/definitions/heading_with_no_marks_node',
1673
+ },
1674
+ {
1675
+ $ref: '#/definitions/mediaGroup_node',
1676
+ },
1677
+ {
1678
+ $ref: '#/definitions/decisionList_node',
1679
+ },
1680
+ {
1681
+ $ref: '#/definitions/rule_node',
1682
+ },
1683
+ {
1684
+ $ref: '#/definitions/panel_node',
1685
+ },
1686
+ {
1687
+ $ref: '#/definitions/blockquote_node',
1688
+ },
1689
+ {
1690
+ $ref: '#/definitions/extension_with_marks_node',
1691
+ },
1692
+ {
1693
+ $ref: '#/definitions/embedCard_node',
1694
+ },
1695
+ {
1696
+ $ref: '#/definitions/table_node',
1697
+ },
1698
+ ],
1699
+ };
1700
+ jsonWithTypes.definitions.bodiedExtension_node.properties.content.items = {
1701
+ anyOf: [
1702
+ {
1703
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1704
+ },
1705
+ {
1706
+ $ref: '#/definitions/blockCard_node',
1707
+ },
1708
+ {
1709
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1710
+ },
1711
+ {
1712
+ $ref: '#/definitions/mediaSingle_caption_node',
1713
+ },
1714
+ {
1715
+ $ref: '#/definitions/mediaSingle_full_node',
1716
+ },
1717
+ {
1718
+ $ref: '#/definitions/taskList_node',
1719
+ },
1720
+ {
1721
+ $ref: '#/definitions/bulletList_node',
1722
+ },
1723
+ {
1724
+ $ref: '#/definitions/orderedList_node',
1725
+ },
1726
+ {
1727
+ $ref: '#/definitions/heading_with_no_marks_node',
1728
+ },
1729
+ {
1730
+ $ref: '#/definitions/mediaGroup_node',
1731
+ },
1732
+ {
1733
+ $ref: '#/definitions/decisionList_node',
1734
+ },
1735
+ {
1736
+ $ref: '#/definitions/rule_node',
1737
+ },
1738
+ {
1739
+ $ref: '#/definitions/panel_node',
1740
+ },
1741
+ {
1742
+ $ref: '#/definitions/blockquote_node',
1743
+ },
1744
+ {
1745
+ $ref: '#/definitions/extension_with_marks_node',
1746
+ },
1747
+ {
1748
+ $ref: '#/definitions/embedCard_node',
1749
+ },
1750
+ {
1751
+ $ref: '#/definitions/table_node',
1752
+ },
1753
+ ],
1754
+ };
1348
1755
  jsonWithTypes.definitions.table_cell_node.properties.content = {
1349
1756
  type: 'array',
1350
- items: {},
1757
+ items: {
1758
+ anyOf: [
1759
+ {
1760
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1761
+ },
1762
+ {
1763
+ $ref: '#/definitions/blockCard_node',
1764
+ },
1765
+ {
1766
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1767
+ },
1768
+ {
1769
+ $ref: '#/definitions/paragraph_with_alignment_node',
1770
+ },
1771
+ {
1772
+ $ref: '#/definitions/mediaSingle_caption_node',
1773
+ },
1774
+ {
1775
+ $ref: '#/definitions/mediaSingle_full_node',
1776
+ },
1777
+ {
1778
+ $ref: '#/definitions/taskList_node',
1779
+ },
1780
+ {
1781
+ $ref: '#/definitions/bulletList_node',
1782
+ },
1783
+ {
1784
+ $ref: '#/definitions/orderedList_node',
1785
+ },
1786
+ {
1787
+ $ref: '#/definitions/heading_with_no_marks_node',
1788
+ },
1789
+ {
1790
+ $ref: '#/definitions/heading_with_alignment_node',
1791
+ },
1792
+ {
1793
+ $ref: '#/definitions/heading_with_indentation_node',
1794
+ },
1795
+ {
1796
+ $ref: '#/definitions/mediaGroup_node',
1797
+ },
1798
+ {
1799
+ $ref: '#/definitions/decisionList_node',
1800
+ },
1801
+ {
1802
+ $ref: '#/definitions/rule_node',
1803
+ },
1804
+ {
1805
+ $ref: '#/definitions/panel_node',
1806
+ },
1807
+ {
1808
+ $ref: '#/definitions/blockquote_node',
1809
+ },
1810
+ {
1811
+ $ref: '#/definitions/extension_with_marks_node',
1812
+ },
1813
+ {
1814
+ $ref: '#/definitions/embedCard_node',
1815
+ },
1816
+ {
1817
+ $ref: '#/definitions/nestedExpand_with_no_marks_node',
1818
+ },
1819
+ ],
1820
+ },
1351
1821
  minItems: 1,
1352
1822
  };
1353
1823
  jsonWithTypes.definitions.table_header_node.properties.content = {
1354
1824
  type: 'array',
1355
- items: {},
1825
+ items: {
1826
+ anyOf: [
1827
+ {
1828
+ $ref: '#/definitions/codeBlock_with_no_marks_node',
1829
+ },
1830
+ {
1831
+ $ref: '#/definitions/blockCard_node',
1832
+ },
1833
+ {
1834
+ $ref: '#/definitions/paragraph_with_no_marks_node',
1835
+ },
1836
+ {
1837
+ $ref: '#/definitions/paragraph_with_alignment_node',
1838
+ },
1839
+ {
1840
+ $ref: '#/definitions/mediaSingle_caption_node',
1841
+ },
1842
+ {
1843
+ $ref: '#/definitions/mediaSingle_full_node',
1844
+ },
1845
+ {
1846
+ $ref: '#/definitions/taskList_node',
1847
+ },
1848
+ {
1849
+ $ref: '#/definitions/bulletList_node',
1850
+ },
1851
+ {
1852
+ $ref: '#/definitions/orderedList_node',
1853
+ },
1854
+ {
1855
+ $ref: '#/definitions/heading_with_no_marks_node',
1856
+ },
1857
+ {
1858
+ $ref: '#/definitions/heading_with_alignment_node',
1859
+ },
1860
+ {
1861
+ $ref: '#/definitions/heading_with_indentation_node',
1862
+ },
1863
+ {
1864
+ $ref: '#/definitions/mediaGroup_node',
1865
+ },
1866
+ {
1867
+ $ref: '#/definitions/decisionList_node',
1868
+ },
1869
+ {
1870
+ $ref: '#/definitions/rule_node',
1871
+ },
1872
+ {
1873
+ $ref: '#/definitions/panel_node',
1874
+ },
1875
+ {
1876
+ $ref: '#/definitions/blockquote_node',
1877
+ },
1878
+ {
1879
+ $ref: '#/definitions/extension_with_marks_node',
1880
+ },
1881
+ {
1882
+ $ref: '#/definitions/embedCard_node',
1883
+ },
1884
+ {
1885
+ $ref: '#/definitions/nestedExpand_with_no_marks_node',
1886
+ },
1887
+ ],
1888
+ },
1356
1889
  minItems: 1,
1357
1890
  };
1891
+ jsonWithTypes.definitions.doc_node.properties.content.items.anyOf = [
1892
+ {
1893
+ $ref: '#/definitions/block_content',
1894
+ },
1895
+ {
1896
+ $ref: '#/definitions/layoutSection_node',
1897
+ },
1898
+ {
1899
+ $ref: '#/definitions/layoutSection_full_node',
1900
+ },
1901
+ {
1902
+ $ref: '#/definitions/nestedExpand_node',
1903
+ },
1904
+ // There was no where else to put paragraph, so I'm parking it here for now
1905
+ {
1906
+ $ref: '#/definitions/paragraph_node',
1907
+ },
1908
+ ];