@atlaskit/adf-schema 44.7.0 → 45.0.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 (56) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/next-schema/full-schema.adf.js +2 -2
  3. package/dist/cjs/next-schema/generated/nodeTypes.js +4 -4
  4. package/dist/cjs/next-schema/groups/blockContentGroup.js +2 -2
  5. package/dist/cjs/next-schema/groups/blockGroup.js +2 -2
  6. package/dist/cjs/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  7. package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  8. package/dist/cjs/next-schema/nodes/blockquote.js +1 -1
  9. package/dist/cjs/next-schema/nodes/codeBlock.js +8 -14
  10. package/dist/cjs/next-schema/nodes/extensionFrame.js +1 -1
  11. package/dist/cjs/next-schema/nodes/list.js +2 -2
  12. package/dist/cjs/next-schema/nodes/nestedExpand.js +1 -1
  13. package/dist/cjs/next-schema/nodes/panel.js +2 -2
  14. package/dist/cjs/schema/nodes/code-block.js +1 -5
  15. package/dist/cjs/validator-schema/generated/validatorSpec.js +15 -30
  16. package/dist/es2019/next-schema/full-schema.adf.js +2 -2
  17. package/dist/es2019/next-schema/generated/nodeTypes.js +3 -3
  18. package/dist/es2019/next-schema/groups/blockContentGroup.js +2 -2
  19. package/dist/es2019/next-schema/groups/blockGroup.js +2 -2
  20. package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  21. package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  22. package/dist/es2019/next-schema/nodes/blockquote.js +1 -1
  23. package/dist/es2019/next-schema/nodes/codeBlock.js +7 -13
  24. package/dist/es2019/next-schema/nodes/extensionFrame.js +1 -1
  25. package/dist/es2019/next-schema/nodes/list.js +2 -2
  26. package/dist/es2019/next-schema/nodes/nestedExpand.js +1 -1
  27. package/dist/es2019/next-schema/nodes/panel.js +2 -2
  28. package/dist/es2019/schema/nodes/code-block.js +1 -5
  29. package/dist/es2019/validator-schema/generated/validatorSpec.js +14 -29
  30. package/dist/esm/next-schema/full-schema.adf.js +2 -2
  31. package/dist/esm/next-schema/generated/nodeTypes.js +3 -3
  32. package/dist/esm/next-schema/groups/blockContentGroup.js +2 -2
  33. package/dist/esm/next-schema/groups/blockGroup.js +2 -2
  34. package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  35. package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  36. package/dist/esm/next-schema/nodes/blockquote.js +1 -1
  37. package/dist/esm/next-schema/nodes/codeBlock.js +7 -13
  38. package/dist/esm/next-schema/nodes/extensionFrame.js +1 -1
  39. package/dist/esm/next-schema/nodes/list.js +2 -2
  40. package/dist/esm/next-schema/nodes/nestedExpand.js +1 -1
  41. package/dist/esm/next-schema/nodes/panel.js +2 -2
  42. package/dist/esm/schema/nodes/code-block.js +1 -5
  43. package/dist/esm/validator-schema/generated/validatorSpec.js +14 -29
  44. package/dist/json-schema/v1/full.json +73 -60
  45. package/dist/json-schema/v1/stage-0.json +78 -65
  46. package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +3 -3
  47. package/dist/types/next-schema/generated/nodeTypes.d.ts +20 -19
  48. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +5 -1
  49. package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +5 -1
  50. package/dist/types/next-schema/nodes/codeBlock.d.ts +3 -16
  51. package/dist/types/schema/nodes/code-block.d.ts +1 -4
  52. package/dist/types/validator-schema/generated/validatorSpec.d.ts +1 -16
  53. package/json-schema/v1/full.json +73 -60
  54. package/json-schema/v1/stage-0.json +78 -65
  55. package/package.json +2 -2
  56. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 45.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - a3ce608: Remove code block with marks and merge with standard code block definition to resolve adf inconsistencies.
8
+
9
+ Major change:
10
+
11
+ - Entry-point `@atlaskit/adf-schema/schema-validator` no longer has `codeBlock_with_marks` it has been replaced with `codeBlock`.
12
+
3
13
  ## 44.7.0
4
14
 
5
15
  ### Minor Changes
@@ -9,12 +9,12 @@ var _blockGroup = require("./groups/blockGroup");
9
9
  var _layoutSection = require("./nodes/layoutSection");
10
10
  var _blockRootOnlyGroup = require("./groups/blockRootOnlyGroup");
11
11
  var _blockContentGroup = require("./groups/blockContentGroup");
12
- var _codeBlock = require("./nodes/codeBlock");
13
12
  var _expand = require("./nodes/expand");
13
+ var _codeBlock = require("./nodes/codeBlock");
14
14
  var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({
15
15
  root: true,
16
16
  version: 1,
17
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('with_marks'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('with_breakout_mark')))],
17
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('with_breakout_mark')))],
18
18
  DANGEROUS_MANUAL_OVERRIDE: {
19
19
  'validator-spec': {
20
20
  'props.content.minItems': {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.unsupportedInline = exports.unsupportedBlock = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableWithNestedTable = exports.tableRowWithNestedTable = exports.tableRow = exports.tableHeaderWithNestedTable = exports.tableHeader = exports.tableCellWithNestedTable = exports.tableCell = exports.table = exports.statusStage0 = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panelWithNestedBlockquoteStage0 = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtensionStage0 = exports.mentionStage0 = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemWithNestedDecisionStage0 = exports.listItem = exports.layoutSectionWithSingleColumnStage0 = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCardStage0 = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrameStage0 = exports.extension = exports.expandWithoutNestedExpand = exports.expandWithNoMark = exports.expand = exports.emojiStage0 = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.dateStage0 = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockWithNoMarks = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteWithoutNestedCodeblockOrMedia = exports.blockquoteLegacy = exports.blockquote = exports.blockCard = void 0;
6
+ exports.unsupportedInline = exports.unsupportedBlock = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableWithNestedTable = exports.tableRowWithNestedTable = exports.tableRow = exports.tableHeaderWithNestedTable = exports.tableHeader = exports.tableCellWithNestedTable = exports.tableCell = exports.table = exports.statusStage0 = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panelWithNestedBlockquoteStage0 = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtensionStage0 = exports.mentionStage0 = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemWithNestedDecisionStage0 = exports.listItem = exports.layoutSectionWithSingleColumnStage0 = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCardStage0 = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrameStage0 = exports.extension = exports.expandWithoutNestedExpand = exports.expandWithNoMark = exports.expand = exports.emojiStage0 = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.dateStage0 = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockRootOnly = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteWithoutNestedCodeblockOrMedia = exports.blockquoteLegacy = exports.blockquote = exports.blockCard = void 0;
7
7
  var _createPMSpecFactory = require("../../schema/createPMSpecFactory");
8
8
  /**
9
9
  * This file was automatically generated by @atlaskit/adf-schema-generator
@@ -136,9 +136,9 @@ var codeBlock = exports.codeBlock = (0, _createPMSpecFactory.createPMNodeSpecFac
136
136
  code: true,
137
137
  defining: true
138
138
  });
139
- var codeBlockWithNoMarks = exports.codeBlockWithNoMarks = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
139
+ var codeBlockRootOnly = exports.codeBlockRootOnly = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
140
+ content: '(text | unsupportedInline)*',
140
141
  marks: 'unsupportedMark unsupportedNodeAttribute',
141
- group: 'block',
142
142
  attrs: {
143
143
  language: {
144
144
  default: null
@@ -236,7 +236,7 @@ var decisionList = exports.decisionList = (0, _createPMSpecFactory.createPMNodeS
236
236
  defining: true
237
237
  });
238
238
  var doc = exports.doc = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
239
- content: '(block | layoutSection | blockRootOnly)+',
239
+ content: '(block | codeBlock | layoutSection | blockRootOnly)+',
240
240
  marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation dataConsumer fragment breakout'
241
241
  });
242
242
  var embedCard = exports.embedCard = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
@@ -37,8 +37,8 @@ var _unsupportedBlock = require("../nodes/unsupportedBlock");
37
37
  * - no base heading
38
38
  * - no base expand
39
39
  */
40
- var blockContentGroup = exports.blockContentGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block_content', [_blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _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, _panel.panel.use('with_nested_blockquote'), _blockquote.blockquote, _blockquote.blockquote.use('without_nested_codeblock_or_media'), _extension.extension.use('with_marks'), _embedCard.embedCard, _tableNodes.table,
40
+ var blockContentGroup = exports.blockContentGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block_content', [_blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _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, _panel.panel.use('with_nested_blockquote'), _blockquote.blockquote, _blockquote.blockquote.use('without_nested_codeblock_or_media'), _extension.extension.use('with_marks'), _embedCard.embedCard, _tableNodes.table,
41
41
  // @ts-expect-error - types don't deal well with circular references for the variant
42
42
  _tableNodes.table.use('with_nested_table'), _expand.expand.use('without_nested_expand'), _expand.expand.use('with_no_mark'), _bodiedExtension.bodiedExtension.use('with_marks'), _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _unsupportedBlock.unsupportedBlock], {
43
- ignore: ['pm-spec', 'json-schema']
43
+ ignore: ['pm-spec']
44
44
  });
@@ -24,10 +24,10 @@ var _rule = require("../nodes/rule");
24
24
  var _tableNodes = require("../nodes/tableNodes");
25
25
  var _task = require("../nodes/task");
26
26
  var _unsupportedBlock = require("../nodes/unsupportedBlock");
27
- var blockGroup = exports.blockGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block', [_blockCard.blockCard, _codeBlock.codeBlock, _codeBlock.codeBlock.use('with_marks'), _codeBlock.codeBlock.use('with_no_marks'), _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _task.taskList, _list.orderedList, _list.bulletList, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _blockquote.blockquote.use('without_nested_codeblock_or_media'), _decisionList.decisionList, _embedCard.embedCard, _extension.extension, _extension.extension.use('with_marks'), _heading.heading, _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _mediaGroup.mediaGroup, _rule.rule, _panel.panel, _panel.panel.use('with_nested_blockquote'), _tableNodes.table,
27
+ var blockGroup = exports.blockGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block', [_blockCard.blockCard, _codeBlock.codeBlock, _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _task.taskList, _list.orderedList, _list.bulletList, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _blockquote.blockquote.use('without_nested_codeblock_or_media'), _decisionList.decisionList, _embedCard.embedCard, _extension.extension, _extension.extension.use('with_marks'), _heading.heading, _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _mediaGroup.mediaGroup, _rule.rule, _panel.panel, _panel.panel.use('with_nested_blockquote'), _tableNodes.table,
28
28
  // @ts-expect-error - types don't deal well with circular references for the variant
29
29
  _tableNodes.table.use('with_nested_table'), _bodiedExtension.bodiedExtension, _bodiedExtension.bodiedExtension.use('with_marks'), _expand.expand, _expand.expand.use('with_no_mark'), _expand.expand.use('with_breakout_mark'), _expand.expand.use('without_nested_expand'), _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _unsupportedBlock.unsupportedBlock], {
30
30
  // @DSLCompatibilityException
31
31
  // Block group in PM doesn't match ADF
32
- ignore: ['validator-spec']
32
+ ignore: ['validator-spec', 'json-schema']
33
33
  });
@@ -23,7 +23,7 @@ var _task = require("../nodes/task");
23
23
  var _unsupportedBlock = require("../nodes/unsupportedBlock");
24
24
  // Not an actual group, but a collection of nodes that can't be nested inside each other
25
25
  // TODO: make it an actual group
26
- var nonNestableBlockContent = exports.nonNestableBlockContent = [_paragraph.paragraph.use('with_no_marks'), _panel.panel, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading.use('with_no_marks'), _codeBlock.codeBlock.use('with_no_marks'), _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _decisionList.decisionList, _task.taskList, _tableNodes.table,
26
+ var nonNestableBlockContent = exports.nonNestableBlockContent = [_paragraph.paragraph.use('with_no_marks'), _panel.panel, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading.use('with_no_marks'), _codeBlock.codeBlock, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _decisionList.decisionList, _task.taskList, _tableNodes.table,
27
27
  // @ts-expect-error - types don't deal well with circular references for the variant
28
28
  _tableNodes.table.use('with_nested_table'), _blockCard.blockCard, _embedCard.embedCard, _extension.extension.use('with_marks'), _unsupportedBlock.unsupportedBlock];
29
29
 
@@ -21,7 +21,7 @@ var _paragraph = require("../nodes/paragraph");
21
21
  var _rule = require("../nodes/rule");
22
22
  var _task = require("../nodes/task");
23
23
  var _unsupportedBlock = require("../nodes/unsupportedBlock");
24
- var tableCellContentNodes = exports.tableCellContentNodes = [_paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _panel.panel, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _codeBlock.codeBlock.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaGroup.mediaGroup, _decisionList.decisionList, _task.taskList, _blockCard.blockCard, _embedCard.embedCard, _extension.extension.use('with_marks'), _nestedExpand.nestedExpand.use('content'), _nestedExpand.nestedExpand.use('with_no_marks')];
24
+ var tableCellContentNodes = exports.tableCellContentNodes = [_paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _panel.panel, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _codeBlock.codeBlock, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaGroup.mediaGroup, _decisionList.decisionList, _task.taskList, _blockCard.blockCard, _embedCard.embedCard, _extension.extension.use('with_marks'), _nestedExpand.nestedExpand.use('content'), _nestedExpand.nestedExpand.use('with_no_marks')];
25
25
 
26
26
  // This is not an actual group, but a collection of nodes
27
27
  // @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
@@ -19,7 +19,7 @@ var blockquote = exports.blockquote = (0, _adfSchemaGenerator.adfNode)('blockquo
19
19
  // Marks don't make it into the PM node spec, as they get overridden by the marks in
20
20
  // packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
21
21
  marks: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
22
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _list.orderedList, _list.bulletList, _unsupportedBlock.unsupportedBlock, _codeBlock.codeBlock.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaGroup.mediaGroup))]
22
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _list.orderedList, _list.bulletList, _unsupportedBlock.unsupportedBlock, _codeBlock.codeBlock, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaGroup.mediaGroup))]
23
23
  }).variant('legacy', {
24
24
  ignore: ['json-schema', 'validator-spec'],
25
25
  content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _unsupportedBlock.unsupportedBlock))]
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.codeBlockWithNoMarks = exports.codeBlock = void 0;
6
+ exports.codeBlock = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
8
  var _breakout = require("../marks/breakout");
9
9
  var _unsupportedMark = require("../marks/unsupportedMark");
@@ -13,10 +13,6 @@ var _unsupportedInline = require("./unsupportedInline");
13
13
  var codeBlock = exports.codeBlock = (0, _adfSchemaGenerator.adfNode)('codeBlock').define({
14
14
  code: true,
15
15
  defining: true,
16
- // Marks don't make it into the PM node spec, as they get overridden by the marks in
17
- // packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
18
- marks: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
19
- hasEmptyMarks: true,
20
16
  attrs: {
21
17
  language: {
22
18
  type: 'string',
@@ -29,6 +25,7 @@ var codeBlock = exports.codeBlock = (0, _adfSchemaGenerator.adfNode)('codeBlock'
29
25
  optional: true
30
26
  }
31
27
  },
28
+ noMarks: true,
32
29
  content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_text.text, _unsupportedInline.unsupportedInline))],
33
30
  DANGEROUS_MANUAL_OVERRIDE: {
34
31
  'validator-spec': {
@@ -51,13 +48,10 @@ var codeBlock = exports.codeBlock = (0, _adfSchemaGenerator.adfNode)('codeBlock'
51
48
  }
52
49
  }
53
50
  }
54
- }).variant('with_marks', {
51
+ })
52
+ // Variant used root scenario where we have breakout
53
+ .variant('root_only', {
55
54
  marks: [_breakout.breakout, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
56
- ignore: ['pm-spec']
57
- }).variant('with_no_marks', {
58
- content: [],
59
- marks: [],
60
- noMarks: true,
61
- ignore: []
62
- });
63
- var codeBlockWithNoMarks = exports.codeBlockWithNoMarks = codeBlock;
55
+ noMarks: false,
56
+ noExtend: true
57
+ });
@@ -36,7 +36,7 @@ var extensionFrame = exports.extensionFrame = (0, _adfSchemaGenerator.adfNode)('
36
36
  // packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
37
37
  marks: [_dataConsumer.dataConsumer, _fragment.fragment, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
38
38
  attrs: {},
39
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _panel.panel, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading.use('with_no_marks'), _codeBlock.codeBlock.use('with_no_marks'), _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('caption'), _decisionList.decisionList, _task.taskList, _tableNodes.table,
39
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _panel.panel, _blockquote.blockquote, _list.orderedList, _list.bulletList, _rule.rule, _heading.heading.use('with_no_marks'), _codeBlock.codeBlock, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('caption'), _decisionList.decisionList, _task.taskList, _tableNodes.table,
40
40
  // @ts-expect-error - types don't deal well with circular references for the variant
41
41
  _tableNodes.table.use('with_nested_table'), _extension.extension.use('with_marks'), _bodiedExtension.bodiedExtension.use('with_marks'), _unsupportedBlock.unsupportedBlock, _blockCard.blockCard, _embedCard.embedCard))],
42
42
  DANGEROUS_MANUAL_OVERRIDE: {
@@ -20,9 +20,9 @@ var listItem = (0, _adfSchemaGenerator.adfNode)('listItem').define({
20
20
  selectable: false,
21
21
  marks: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
22
22
  contentMinItems: 1,
23
- content: [(0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _unsupportedBlock.unsupportedBlock), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), bulletList, orderedList, _task.taskList, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _unsupportedBlock.unsupportedBlock))]
23
+ content: [(0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _unsupportedBlock.unsupportedBlock), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), bulletList, orderedList, _task.taskList, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _unsupportedBlock.unsupportedBlock))]
24
24
  }).variant('with_nested_decision', {
25
- content: [(0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _unsupportedBlock.unsupportedBlock, _decisionList.decisionList), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), bulletList, orderedList, _task.taskList, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _unsupportedBlock.unsupportedBlock, _decisionList.decisionList))],
25
+ content: [(0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _unsupportedBlock.unsupportedBlock, _decisionList.decisionList), (0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), bulletList, orderedList, _task.taskList, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _unsupportedBlock.unsupportedBlock, _decisionList.decisionList))],
26
26
  noExtend: true,
27
27
  stage0: true
28
28
  });
@@ -35,7 +35,7 @@ var nestedExpand = exports.nestedExpand = (0, _adfSchemaGenerator.adfNode)('nest
35
35
  optional: true
36
36
  }
37
37
  },
38
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaGroup.mediaGroup, _codeBlock.codeBlock.use('with_no_marks'), _list.bulletList, _list.orderedList, _task.taskList, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _unsupportedBlock.unsupportedBlock))],
38
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaGroup.mediaGroup, _codeBlock.codeBlock, _list.bulletList, _list.orderedList, _task.taskList, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _unsupportedBlock.unsupportedBlock))],
39
39
  DANGEROUS_MANUAL_OVERRIDE: {
40
40
  'validator-spec': {
41
41
  'props.attrs.optional': {
@@ -49,9 +49,9 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
49
49
  optional: true
50
50
  }
51
51
  },
52
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock))]
52
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock))]
53
53
  }).variant('with_nested_blockquote', {
54
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock, _blockquote.blockquote))],
54
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock, _blockquote.blockquote))],
55
55
  noExtend: true,
56
56
  stage0: true
57
57
  });
@@ -6,16 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.toJSON = exports.codeBlock = void 0;
7
7
  var _model = require("@atlaskit/editor-prosemirror/model");
8
8
  var _nodeTypes = require("../../next-schema/generated/nodeTypes");
9
- /**
10
- * @name codeBlock_node
11
- */
12
-
13
9
  /**
14
10
  * @name codeBlock_with_no_marks_node
15
11
  */
16
12
 
17
13
  /**
18
- * @name codeBlock_with_marks_node
14
+ * @name codeBlock_node
19
15
  */
20
16
 
21
17
  var getLanguageFromEditorStyle = function getLanguageFromEditorStyle(dom) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.underline = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.subsup = exports.strong = exports.strike = exports.status = exports.rule = exports.placeholder = exports.paragraph_with_no_marks = exports.paragraph_with_indentation = exports.paragraph_with_alignment = exports.paragraph = exports.panel_with_nested_blockquote = exports.panel = exports.orderedList = exports.non_nestable_block_content = exports.nestedExpand_with_no_marks = exports.nestedExpand_content = exports.nestedExpand = exports.multiBodiedExtension = exports.mention = exports.mediaSingle_width_type = exports.mediaSingle_full = exports.mediaSingle_caption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem_with_nested_decision = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.extension_with_marks = exports.extensionFrame = exports.extension = exports.expand_with_no_mark = exports.expand_with_breakout_mark = exports.expand = exports.emoji = exports.embedCard = exports.em = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.dataConsumer = exports.confluenceInlineComment = exports.codeBlock_with_no_marks = exports.codeBlock_with_marks = exports.codeBlock = exports.code = exports.caption = exports.bulletList = exports.breakout = exports.border = exports.bodiedExtension_with_marks = exports.bodiedExtension = exports.blockquote = exports.block_content = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
6
+ exports.underline = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.subsup = exports.strong = exports.strike = exports.status = exports.rule = exports.placeholder = exports.paragraph_with_no_marks = exports.paragraph_with_indentation = exports.paragraph_with_alignment = exports.paragraph = exports.panel_with_nested_blockquote = exports.panel = exports.orderedList = exports.non_nestable_block_content = exports.nestedExpand_with_no_marks = exports.nestedExpand_content = exports.nestedExpand = exports.multiBodiedExtension = exports.mention = exports.mediaSingle_width_type = exports.mediaSingle_full = exports.mediaSingle_caption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem_with_nested_decision = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.extension_with_marks = exports.extensionFrame = exports.extension = exports.expand_with_no_mark = exports.expand_with_breakout_mark = exports.expand = exports.emoji = exports.embedCard = exports.em = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.dataConsumer = exports.confluenceInlineComment = exports.codeBlock_root_only = exports.codeBlock = exports.code = exports.caption = exports.bulletList = exports.breakout = exports.border = exports.bodiedExtension_with_marks = exports.bodiedExtension = exports.blockquote = exports.block_content = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
7
7
  var alignment = exports.alignment = {
8
8
  props: {
9
9
  type: {
@@ -55,7 +55,7 @@ var backgroundColor = exports.backgroundColor = {
55
55
  }
56
56
  }
57
57
  };
58
- var block_content = exports.block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
58
+ var block_content = exports.block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
59
59
  var blockCard = exports.blockCard = {
60
60
  props: {
61
61
  type: {
@@ -129,7 +129,7 @@ var blockquote = exports.blockquote = {
129
129
  },
130
130
  content: {
131
131
  type: 'array',
132
- items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', 'codeBlock_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup']],
132
+ items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup']],
133
133
  minItems: 1,
134
134
  allowUnsupportedBlock: true
135
135
  }
@@ -299,15 +299,10 @@ var codeBlock = exports.codeBlock = {
299
299
  }]],
300
300
  optional: true,
301
301
  allowUnsupportedInline: true
302
- },
303
- marks: {
304
- type: 'array',
305
- items: [],
306
- optional: true
307
302
  }
308
303
  }
309
304
  };
310
- var codeBlock_with_marks = exports.codeBlock_with_marks = ['codeBlock', {
305
+ var codeBlock_root_only = exports.codeBlock_root_only = ['codeBlock', {
311
306
  props: {
312
307
  marks: {
313
308
  type: 'array',
@@ -316,16 +311,6 @@ var codeBlock_with_marks = exports.codeBlock_with_marks = ['codeBlock', {
316
311
  }
317
312
  }
318
313
  }];
319
- var codeBlock_with_no_marks = exports.codeBlock_with_no_marks = ['codeBlock', {
320
- props: {
321
- marks: {
322
- type: 'array',
323
- maxItems: 0,
324
- items: [],
325
- optional: true
326
- }
327
- }
328
- }];
329
314
  var confluenceInlineComment = exports.confluenceInlineComment = {
330
315
  props: {
331
316
  type: {
@@ -438,7 +423,7 @@ var doc = exports.doc = {
438
423
  },
439
424
  content: {
440
425
  type: 'array',
441
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_with_marks', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_with_breakout_mark']],
426
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_with_breakout_mark']],
442
427
  allowUnsupportedBlock: true
443
428
  }
444
429
  }
@@ -529,7 +514,7 @@ var expand = exports.expand = {
529
514
  },
530
515
  content: {
531
516
  type: 'array',
532
- items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
517
+ items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
533
518
  minItems: 1,
534
519
  allowUnsupportedBlock: true
535
520
  },
@@ -619,7 +604,7 @@ var extensionFrame = exports.extensionFrame = {
619
604
  },
620
605
  content: {
621
606
  type: 'array',
622
- items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock_with_no_marks', 'mediaGroup', 'mediaSingle_full', 'mediaSingle_caption', 'decisionList', 'taskList', 'table', 'extension_with_marks', 'bodiedExtension_with_marks', 'blockCard', 'embedCard']],
607
+ items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_full', 'mediaSingle_caption', 'decisionList', 'taskList', 'table', 'extension_with_marks', 'bodiedExtension_with_marks', 'blockCard', 'embedCard']],
623
608
  minItems: 1
624
609
  },
625
610
  marks: {
@@ -946,7 +931,7 @@ var listItem = exports.listItem = {
946
931
  content: {
947
932
  type: 'array',
948
933
  isTupleLike: true,
949
- items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks']],
934
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock']],
950
935
  minItems: 1,
951
936
  allowUnsupportedBlock: true
952
937
  }
@@ -957,7 +942,7 @@ var listItem_with_nested_decision = exports.listItem_with_nested_decision = ['li
957
942
  content: {
958
943
  type: 'array',
959
944
  isTupleLike: true,
960
- items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'decisionList'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'decisionList']],
945
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList']],
961
946
  minItems: 1,
962
947
  allowUnsupportedBlock: true
963
948
  }
@@ -1280,7 +1265,7 @@ var nestedExpand = exports.nestedExpand = {
1280
1265
  };
1281
1266
  var nestedExpand_content = exports.nestedExpand_content = {
1282
1267
  type: 'array',
1283
- items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'decisionList', 'rule', 'panel', 'blockquote']],
1268
+ items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'codeBlock', 'bulletList', 'orderedList', 'taskList', 'decisionList', 'rule', 'panel', 'blockquote']],
1284
1269
  minItems: 1,
1285
1270
  allowUnsupportedBlock: true
1286
1271
  };
@@ -1294,7 +1279,7 @@ var nestedExpand_with_no_marks = exports.nestedExpand_with_no_marks = ['nestedEx
1294
1279
  }
1295
1280
  }
1296
1281
  }];
1297
- var non_nestable_block_content = exports.non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks'];
1282
+ var non_nestable_block_content = exports.non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks'];
1298
1283
  var orderedList = exports.orderedList = {
1299
1284
  props: {
1300
1285
  type: {
@@ -1350,7 +1335,7 @@ var panel = exports.panel = {
1350
1335
  },
1351
1336
  content: {
1352
1337
  type: 'array',
1353
- items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'rule', 'decisionList']],
1338
+ items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList']],
1354
1339
  minItems: 1,
1355
1340
  allowUnsupportedBlock: true
1356
1341
  }
@@ -1360,7 +1345,7 @@ var panel_with_nested_blockquote = exports.panel_with_nested_blockquote = ['pane
1360
1345
  props: {
1361
1346
  content: {
1362
1347
  type: 'array',
1363
- items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'rule', 'decisionList', 'blockquote']],
1348
+ items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList', 'blockquote']],
1364
1349
  minItems: 1,
1365
1350
  allowUnsupportedBlock: true
1366
1351
  }
@@ -1588,7 +1573,7 @@ var tableCell = exports.tableCell = {
1588
1573
  },
1589
1574
  content: {
1590
1575
  type: 'array',
1591
- items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
1576
+ items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
1592
1577
  minItems: 1,
1593
1578
  allowUnsupportedBlock: true
1594
1579
  }
@@ -1627,7 +1612,7 @@ var tableHeader = exports.tableHeader = {
1627
1612
  },
1628
1613
  content: {
1629
1614
  type: 'array',
1630
- items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks', 'nestedExpand']],
1615
+ items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks', 'nestedExpand']],
1631
1616
  minItems: 1
1632
1617
  }
1633
1618
  },
@@ -3,12 +3,12 @@ import { blockGroup } from './groups/blockGroup';
3
3
  import { layoutSection } from './nodes/layoutSection';
4
4
  import { blockRootOnlyGroup } from './groups/blockRootOnlyGroup';
5
5
  import { blockContentGroup } from './groups/blockContentGroup';
6
- import { codeBlock } from './nodes/codeBlock';
7
6
  import { expand } from './nodes/expand';
7
+ import { codeBlock } from './nodes/codeBlock';
8
8
  const doc = adfNode('doc').define({
9
9
  root: true,
10
10
  version: 1,
11
- content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('with_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('with_breakout_mark')))],
11
+ content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('with_breakout_mark')))],
12
12
  DANGEROUS_MANUAL_OVERRIDE: {
13
13
  'validator-spec': {
14
14
  'props.content.minItems': {
@@ -130,9 +130,9 @@ export const codeBlock = createPMNodeSpecFactory({
130
130
  code: true,
131
131
  defining: true
132
132
  });
133
- export const codeBlockWithNoMarks = createPMNodeSpecFactory({
133
+ export const codeBlockRootOnly = createPMNodeSpecFactory({
134
+ content: '(text | unsupportedInline)*',
134
135
  marks: 'unsupportedMark unsupportedNodeAttribute',
135
- group: 'block',
136
136
  attrs: {
137
137
  language: {
138
138
  default: null
@@ -230,7 +230,7 @@ export const decisionList = createPMNodeSpecFactory({
230
230
  defining: true
231
231
  });
232
232
  export const doc = createPMNodeSpecFactory({
233
- content: '(block | layoutSection | blockRootOnly)+',
233
+ content: '(block | codeBlock | layoutSection | blockRootOnly)+',
234
234
  marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation dataConsumer fragment breakout'
235
235
  });
236
236
  export const embedCard = createPMNodeSpecFactory({
@@ -32,8 +32,8 @@ import { unsupportedBlock } from '../nodes/unsupportedBlock';
32
32
  * - no base heading
33
33
  * - no base expand
34
34
  */
35
- export const blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, panel.use('with_nested_blockquote'), blockquote, blockquote.use('without_nested_codeblock_or_media'), extension.use('with_marks'), embedCard, table,
35
+ export const blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, panel.use('with_nested_blockquote'), blockquote, blockquote.use('without_nested_codeblock_or_media'), extension.use('with_marks'), embedCard, table,
36
36
  // @ts-expect-error - types don't deal well with circular references for the variant
37
37
  table.use('with_nested_table'), expand.use('without_nested_expand'), expand.use('with_no_mark'), bodiedExtension.use('with_marks'), confluenceUnsupportedBlock, unsupportedBlock], {
38
- ignore: ['pm-spec', 'json-schema']
38
+ ignore: ['pm-spec']
39
39
  });
@@ -18,10 +18,10 @@ import { rule } from '../nodes/rule';
18
18
  import { table } from '../nodes/tableNodes';
19
19
  import { taskList } from '../nodes/task';
20
20
  import { unsupportedBlock } from '../nodes/unsupportedBlock';
21
- export const blockGroup = adfNodeGroup('block', [blockCard, codeBlock, codeBlock.use('with_marks'), codeBlock.use('with_no_marks'), mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('with_nested_blockquote'), table,
21
+ export const blockGroup = adfNodeGroup('block', [blockCard, codeBlock, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('with_nested_blockquote'), table,
22
22
  // @ts-expect-error - types don't deal well with circular references for the variant
23
23
  table.use('with_nested_table'), bodiedExtension, bodiedExtension.use('with_marks'), expand, expand.use('with_no_mark'), expand.use('with_breakout_mark'), expand.use('without_nested_expand'), confluenceUnsupportedBlock, unsupportedBlock], {
24
24
  // @DSLCompatibilityException
25
25
  // Block group in PM doesn't match ADF
26
- ignore: ['validator-spec']
26
+ ignore: ['validator-spec', 'json-schema']
27
27
  });
@@ -18,7 +18,7 @@ import { unsupportedBlock } from '../nodes/unsupportedBlock';
18
18
 
19
19
  // Not an actual group, but a collection of nodes that can't be nested inside each other
20
20
  // TODO: make it an actual group
21
- export const nonNestableBlockContent = [paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock.use('with_no_marks'), mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), decisionList, taskList, table,
21
+ export const nonNestableBlockContent = [paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), decisionList, taskList, table,
22
22
  // @ts-expect-error - types don't deal well with circular references for the variant
23
23
  table.use('with_nested_table'), blockCard, embedCard, extension.use('with_marks'), unsupportedBlock];
24
24
 
@@ -15,7 +15,7 @@ import { paragraph } from '../nodes/paragraph';
15
15
  import { rule } from '../nodes/rule';
16
16
  import { taskList } from '../nodes/task';
17
17
  import { unsupportedBlock } from '../nodes/unsupportedBlock';
18
- export const tableCellContentNodes = [paragraph.use('with_no_marks'), paragraph.use('with_alignment'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), codeBlock.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, decisionList, taskList, blockCard, embedCard, extension.use('with_marks'), nestedExpand.use('content'), nestedExpand.use('with_no_marks')];
18
+ export const tableCellContentNodes = [paragraph.use('with_no_marks'), paragraph.use('with_alignment'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, decisionList, taskList, blockCard, embedCard, extension.use('with_marks'), nestedExpand.use('content'), nestedExpand.use('with_no_marks')];
19
19
 
20
20
  // This is not an actual group, but a collection of nodes
21
21
  // @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
@@ -13,7 +13,7 @@ export const blockquote = adfNode('blockquote').define({
13
13
  // Marks don't make it into the PM node spec, as they get overridden by the marks in
14
14
  // packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
15
15
  marks: [unsupportedMark, unsupportedNodeAttribute],
16
- content: [$onePlus($or(paragraph.use('with_no_marks'), orderedList, bulletList, unsupportedBlock, codeBlock.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup))]
16
+ content: [$onePlus($or(paragraph.use('with_no_marks'), orderedList, bulletList, unsupportedBlock, codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup))]
17
17
  }).variant('legacy', {
18
18
  ignore: ['json-schema', 'validator-spec'],
19
19
  content: [$onePlus($or(paragraph, unsupportedBlock))]
@@ -7,10 +7,6 @@ import { unsupportedInline } from './unsupportedInline';
7
7
  export const codeBlock = adfNode('codeBlock').define({
8
8
  code: true,
9
9
  defining: true,
10
- // Marks don't make it into the PM node spec, as they get overridden by the marks in
11
- // packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
12
- marks: [unsupportedMark, unsupportedNodeAttribute],
13
- hasEmptyMarks: true,
14
10
  attrs: {
15
11
  language: {
16
12
  type: 'string',
@@ -23,6 +19,7 @@ export const codeBlock = adfNode('codeBlock').define({
23
19
  optional: true
24
20
  }
25
21
  },
22
+ noMarks: true,
26
23
  content: [$zeroPlus($or(text, unsupportedInline))],
27
24
  DANGEROUS_MANUAL_OVERRIDE: {
28
25
  'validator-spec': {
@@ -45,13 +42,10 @@ export const codeBlock = adfNode('codeBlock').define({
45
42
  }
46
43
  }
47
44
  }
48
- }).variant('with_marks', {
45
+ })
46
+ // Variant used root scenario where we have breakout
47
+ .variant('root_only', {
49
48
  marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
50
- ignore: ['pm-spec']
51
- }).variant('with_no_marks', {
52
- content: [],
53
- marks: [],
54
- noMarks: true,
55
- ignore: []
56
- });
57
- export const codeBlockWithNoMarks = codeBlock;
49
+ noMarks: false,
50
+ noExtend: true
51
+ });
@@ -30,7 +30,7 @@ export const extensionFrame = adfNode('extensionFrame').define({
30
30
  // packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
31
31
  marks: [dataConsumer, fragment, unsupportedMark, unsupportedNodeAttribute],
32
32
  attrs: {},
33
- content: [$onePlus($or(paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock.use('with_no_marks'), mediaGroup, mediaSingle.use('full'), mediaSingle.use('caption'), decisionList, taskList, table,
33
+ content: [$onePlus($or(paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock, mediaGroup, mediaSingle.use('full'), mediaSingle.use('caption'), decisionList, taskList, table,
34
34
  // @ts-expect-error - types don't deal well with circular references for the variant
35
35
  table.use('with_nested_table'), extension.use('with_marks'), bodiedExtension.use('with_marks'), unsupportedBlock, blockCard, embedCard))],
36
36
  DANGEROUS_MANUAL_OVERRIDE: {
@@ -14,9 +14,9 @@ const listItem = adfNode('listItem').define({
14
14
  selectable: false,
15
15
  marks: [unsupportedMark, unsupportedNodeAttribute],
16
16
  contentMinItems: 1,
17
- content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), unsupportedBlock), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), unsupportedBlock))]
17
+ content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock))]
18
18
  }).variant('with_nested_decision', {
19
- content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), unsupportedBlock, decisionList), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), unsupportedBlock, decisionList))],
19
+ content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, decisionList), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, decisionList))],
20
20
  noExtend: true,
21
21
  stage0: true
22
22
  });