@atlaskit/adf-schema 44.7.0 → 45.1.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 (59) hide show
  1. package/CHANGELOG.md +20 -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 -18
  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/mediaInline.js +0 -8
  13. package/dist/cjs/next-schema/nodes/nestedExpand.js +1 -1
  14. package/dist/cjs/next-schema/nodes/panel.js +2 -2
  15. package/dist/cjs/schema/nodes/code-block.js +1 -5
  16. package/dist/cjs/validator-schema/generated/validatorSpec.js +23 -30
  17. package/dist/es2019/next-schema/full-schema.adf.js +2 -2
  18. package/dist/es2019/next-schema/generated/nodeTypes.js +3 -3
  19. package/dist/es2019/next-schema/groups/blockContentGroup.js +2 -2
  20. package/dist/es2019/next-schema/groups/blockGroup.js +2 -2
  21. package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  22. package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  23. package/dist/es2019/next-schema/nodes/blockquote.js +1 -1
  24. package/dist/es2019/next-schema/nodes/codeBlock.js +7 -17
  25. package/dist/es2019/next-schema/nodes/extensionFrame.js +1 -1
  26. package/dist/es2019/next-schema/nodes/list.js +2 -2
  27. package/dist/es2019/next-schema/nodes/mediaInline.js +0 -8
  28. package/dist/es2019/next-schema/nodes/nestedExpand.js +1 -1
  29. package/dist/es2019/next-schema/nodes/panel.js +2 -2
  30. package/dist/es2019/schema/nodes/code-block.js +1 -5
  31. package/dist/es2019/validator-schema/generated/validatorSpec.js +22 -29
  32. package/dist/esm/next-schema/full-schema.adf.js +2 -2
  33. package/dist/esm/next-schema/generated/nodeTypes.js +3 -3
  34. package/dist/esm/next-schema/groups/blockContentGroup.js +2 -2
  35. package/dist/esm/next-schema/groups/blockGroup.js +2 -2
  36. package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  37. package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  38. package/dist/esm/next-schema/nodes/blockquote.js +1 -1
  39. package/dist/esm/next-schema/nodes/codeBlock.js +7 -17
  40. package/dist/esm/next-schema/nodes/extensionFrame.js +1 -1
  41. package/dist/esm/next-schema/nodes/list.js +2 -2
  42. package/dist/esm/next-schema/nodes/mediaInline.js +0 -8
  43. package/dist/esm/next-schema/nodes/nestedExpand.js +1 -1
  44. package/dist/esm/next-schema/nodes/panel.js +2 -2
  45. package/dist/esm/schema/nodes/code-block.js +1 -5
  46. package/dist/esm/validator-schema/generated/validatorSpec.js +22 -29
  47. package/dist/json-schema/v1/full.json +76 -60
  48. package/dist/json-schema/v1/stage-0.json +81 -65
  49. package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +3 -3
  50. package/dist/types/next-schema/generated/nodeTypes.d.ts +20 -19
  51. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +5 -1
  52. package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +5 -1
  53. package/dist/types/next-schema/nodes/codeBlock.d.ts +3 -16
  54. package/dist/types/schema/nodes/code-block.d.ts +1 -4
  55. package/dist/types/validator-schema/generated/validatorSpec.d.ts +9 -16
  56. package/json-schema/v1/full.json +76 -60
  57. package/json-schema/v1/stage-0.json +81 -65
  58. package/package.json +2 -2
  59. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +1 -1
@@ -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,13 +19,10 @@ 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': {
29
- 'props.attrs.props.uniqueId': {
30
- remove: true,
31
- reason: '@DSLCompatibilityException - uniqueId is missing in the existing validator spec'
32
- },
33
26
  'props.content.items': {
34
27
  value: [['text', {
35
28
  props: {
@@ -45,13 +38,10 @@ export const codeBlock = adfNode('codeBlock').define({
45
38
  }
46
39
  }
47
40
  }
48
- }).variant('with_marks', {
41
+ })
42
+ // Variant used root scenario where we have breakout
43
+ .variant('root_only', {
49
44
  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;
45
+ noMarks: false,
46
+ noExtend: true
47
+ });
@@ -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
  });
@@ -91,13 +91,5 @@ export const mediaInline = adfNode('mediaInline').define({
91
91
  type: 'object',
92
92
  optional: true
93
93
  }
94
- },
95
- DANGEROUS_MANUAL_OVERRIDE: {
96
- 'validator-spec': {
97
- 'props.attrs.props.url': {
98
- remove: true,
99
- reason: '@DSLCompatibilityException - url is not specified on the validator spec (but it probably should be)'
100
- }
101
- }
102
94
  }
103
95
  });
@@ -29,7 +29,7 @@ export const nestedExpand = adfNode('nestedExpand').define({
29
29
  optional: true
30
30
  }
31
31
  },
32
- content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock.use('with_no_marks'), bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
32
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
33
33
  DANGEROUS_MANUAL_OVERRIDE: {
34
34
  'validator-spec': {
35
35
  'props.attrs.optional': {
@@ -43,9 +43,9 @@ export const panel = adfNode('panel').define({
43
43
  optional: true
44
44
  }
45
45
  },
46
- content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock))]
46
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock))]
47
47
  }).variant('with_nested_blockquote', {
48
- content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock, blockquote))],
48
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock, blockquote))],
49
49
  noExtend: true,
50
50
  stage0: true
51
51
  });
@@ -1,16 +1,12 @@
1
1
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
2
  import { codeBlock as codeBlockFactory } from '../../next-schema/generated/nodeTypes';
3
3
 
4
- /**
5
- * @name codeBlock_node
6
- */
7
-
8
4
  /**
9
5
  * @name codeBlock_with_no_marks_node
10
6
  */
11
7
 
12
8
  /**
13
- * @name codeBlock_with_marks_node
9
+ * @name codeBlock_node
14
10
  */
15
11
 
16
12
  const getLanguageFromEditorStyle = dom => {
@@ -49,7 +49,7 @@ export const backgroundColor = {
49
49
  }
50
50
  }
51
51
  };
52
- export const 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'];
52
+ export const 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'];
53
53
  export const blockCard = {
54
54
  props: {
55
55
  type: {
@@ -123,7 +123,7 @@ export const blockquote = {
123
123
  },
124
124
  content: {
125
125
  type: 'array',
126
- items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', 'codeBlock_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup']],
126
+ items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup']],
127
127
  minItems: 1,
128
128
  allowUnsupportedBlock: true
129
129
  }
@@ -275,6 +275,10 @@ export const codeBlock = {
275
275
  language: {
276
276
  type: 'string',
277
277
  optional: true
278
+ },
279
+ uniqueId: {
280
+ type: 'string',
281
+ optional: true
278
282
  }
279
283
  },
280
284
  optional: true
@@ -293,15 +297,10 @@ export const codeBlock = {
293
297
  }]],
294
298
  optional: true,
295
299
  allowUnsupportedInline: true
296
- },
297
- marks: {
298
- type: 'array',
299
- items: [],
300
- optional: true
301
300
  }
302
301
  }
303
302
  };
304
- export const codeBlock_with_marks = ['codeBlock', {
303
+ export const codeBlock_root_only = ['codeBlock', {
305
304
  props: {
306
305
  marks: {
307
306
  type: 'array',
@@ -310,16 +309,6 @@ export const codeBlock_with_marks = ['codeBlock', {
310
309
  }
311
310
  }
312
311
  }];
313
- export const codeBlock_with_no_marks = ['codeBlock', {
314
- props: {
315
- marks: {
316
- type: 'array',
317
- maxItems: 0,
318
- items: [],
319
- optional: true
320
- }
321
- }
322
- }];
323
312
  export const confluenceInlineComment = {
324
313
  props: {
325
314
  type: {
@@ -432,7 +421,7 @@ export const doc = {
432
421
  },
433
422
  content: {
434
423
  type: 'array',
435
- 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']],
424
+ 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']],
436
425
  allowUnsupportedBlock: true
437
426
  }
438
427
  }
@@ -523,7 +512,7 @@ export const expand = {
523
512
  },
524
513
  content: {
525
514
  type: 'array',
526
- 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']],
515
+ 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']],
527
516
  minItems: 1,
528
517
  allowUnsupportedBlock: true
529
518
  },
@@ -613,7 +602,7 @@ export const extensionFrame = {
613
602
  },
614
603
  content: {
615
604
  type: 'array',
616
- 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']],
605
+ 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']],
617
606
  minItems: 1
618
607
  },
619
608
  marks: {
@@ -940,7 +929,7 @@ export const listItem = {
940
929
  content: {
941
930
  type: 'array',
942
931
  isTupleLike: true,
943
- 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']],
932
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock']],
944
933
  minItems: 1,
945
934
  allowUnsupportedBlock: true
946
935
  }
@@ -951,7 +940,7 @@ export const listItem_with_nested_decision = ['listItem', {
951
940
  content: {
952
941
  type: 'array',
953
942
  isTupleLike: true,
954
- 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']],
943
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList']],
955
944
  minItems: 1,
956
945
  allowUnsupportedBlock: true
957
946
  }
@@ -1052,6 +1041,10 @@ export const mediaInline = {
1052
1041
  values: ['link', 'file', 'image'],
1053
1042
  optional: true
1054
1043
  },
1044
+ url: {
1045
+ type: 'string',
1046
+ optional: true
1047
+ },
1055
1048
  id: {
1056
1049
  minLength: 1,
1057
1050
  type: 'string'
@@ -1274,7 +1267,7 @@ export const nestedExpand = {
1274
1267
  };
1275
1268
  export const nestedExpand_content = {
1276
1269
  type: 'array',
1277
- 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']],
1270
+ items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'codeBlock', 'bulletList', 'orderedList', 'taskList', 'decisionList', 'rule', 'panel', 'blockquote']],
1278
1271
  minItems: 1,
1279
1272
  allowUnsupportedBlock: true
1280
1273
  };
@@ -1288,7 +1281,7 @@ export const nestedExpand_with_no_marks = ['nestedExpand', {
1288
1281
  }
1289
1282
  }
1290
1283
  }];
1291
- export const 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'];
1284
+ export const 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'];
1292
1285
  export const orderedList = {
1293
1286
  props: {
1294
1287
  type: {
@@ -1344,7 +1337,7 @@ export const panel = {
1344
1337
  },
1345
1338
  content: {
1346
1339
  type: 'array',
1347
- items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'rule', 'decisionList']],
1340
+ items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList']],
1348
1341
  minItems: 1,
1349
1342
  allowUnsupportedBlock: true
1350
1343
  }
@@ -1354,7 +1347,7 @@ export const panel_with_nested_blockquote = ['panel', {
1354
1347
  props: {
1355
1348
  content: {
1356
1349
  type: 'array',
1357
- 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']],
1350
+ items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList', 'blockquote']],
1358
1351
  minItems: 1,
1359
1352
  allowUnsupportedBlock: true
1360
1353
  }
@@ -1582,7 +1575,7 @@ export const tableCell = {
1582
1575
  },
1583
1576
  content: {
1584
1577
  type: 'array',
1585
- 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']],
1578
+ 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']],
1586
1579
  minItems: 1,
1587
1580
  allowUnsupportedBlock: true
1588
1581
  }
@@ -1621,7 +1614,7 @@ export const tableHeader = {
1621
1614
  },
1622
1615
  content: {
1623
1616
  type: 'array',
1624
- 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']],
1617
+ 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']],
1625
1618
  minItems: 1
1626
1619
  }
1627
1620
  },
@@ -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
  var 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 var codeBlock = createPMNodeSpecFactory({
130
130
  code: true,
131
131
  defining: true
132
132
  });
133
- export var codeBlockWithNoMarks = createPMNodeSpecFactory({
133
+ export var 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 var decisionList = createPMNodeSpecFactory({
230
230
  defining: true
231
231
  });
232
232
  export var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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,13 +19,10 @@ export var 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': {
29
- 'props.attrs.props.uniqueId': {
30
- remove: true,
31
- reason: '@DSLCompatibilityException - uniqueId is missing in the existing validator spec'
32
- },
33
26
  'props.content.items': {
34
27
  value: [['text', {
35
28
  props: {
@@ -45,13 +38,10 @@ export var codeBlock = adfNode('codeBlock').define({
45
38
  }
46
39
  }
47
40
  }
48
- }).variant('with_marks', {
41
+ })
42
+ // Variant used root scenario where we have breakout
43
+ .variant('root_only', {
49
44
  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 var codeBlockWithNoMarks = codeBlock;
45
+ noMarks: false,
46
+ noExtend: true
47
+ });
@@ -30,7 +30,7 @@ export var 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 @@ var 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
  });
@@ -91,13 +91,5 @@ export var mediaInline = adfNode('mediaInline').define({
91
91
  type: 'object',
92
92
  optional: true
93
93
  }
94
- },
95
- DANGEROUS_MANUAL_OVERRIDE: {
96
- 'validator-spec': {
97
- 'props.attrs.props.url': {
98
- remove: true,
99
- reason: '@DSLCompatibilityException - url is not specified on the validator spec (but it probably should be)'
100
- }
101
- }
102
94
  }
103
95
  });
@@ -29,7 +29,7 @@ export var nestedExpand = adfNode('nestedExpand').define({
29
29
  optional: true
30
30
  }
31
31
  },
32
- content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock.use('with_no_marks'), bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
32
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
33
33
  DANGEROUS_MANUAL_OVERRIDE: {
34
34
  'validator-spec': {
35
35
  'props.attrs.optional': {
@@ -43,9 +43,9 @@ export var panel = adfNode('panel').define({
43
43
  optional: true
44
44
  }
45
45
  },
46
- content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock))]
46
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock))]
47
47
  }).variant('with_nested_blockquote', {
48
- content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock, blockquote))],
48
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock, blockquote))],
49
49
  noExtend: true,
50
50
  stage0: true
51
51
  });
@@ -1,16 +1,12 @@
1
1
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
2
  import { codeBlock as codeBlockFactory } from '../../next-schema/generated/nodeTypes';
3
3
 
4
- /**
5
- * @name codeBlock_node
6
- */
7
-
8
4
  /**
9
5
  * @name codeBlock_with_no_marks_node
10
6
  */
11
7
 
12
8
  /**
13
- * @name codeBlock_with_marks_node
9
+ * @name codeBlock_node
14
10
  */
15
11
 
16
12
  var getLanguageFromEditorStyle = function getLanguageFromEditorStyle(dom) {