@atlaskit/adf-schema 57.0.1 → 57.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 57.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`158de476cd932`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/158de476cd932) -
8
+ Table-in-panel: order the `panel_c1` variant ahead of the base `panel` in `doc`, `layoutColumn`
9
+ and `bodiedSyncBlock` content. The validator's repairing loop returns the first candidate that
10
+ reports valid, so with a repairing callback the less permissive base `panel` "succeeded" by
11
+ wrapping a nested `table` as `unsupportedBlock` and `panel_c1` was never reached. Ordering the
12
+ variant first replaces a candidate-probing workaround in the validator.
13
+
14
+ `panel_c1` is placed after `blockGroup` rather than first so that `block` remains the leading
15
+ alternative in the ProseMirror content expression, leaving `defaultType` and fill behaviour
16
+ unchanged; the ProseMirror content expressions for these three nodes do change order
17
+ mid-expression.
18
+
19
+ Also adds two stage-0 reference fixtures covering table-in-panel inside a synced block and
20
+ alongside mixed panel content.
21
+
22
+ Gated by `platform_editor_table_in_panel_patch_1`.
23
+
3
24
  ## 57.0.1
4
25
 
5
26
  ### Patch Changes
@@ -21,7 +21,16 @@ var _rule = require("./nodes/rule");
21
21
  var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({
22
22
  root: true,
23
23
  version: 1,
24
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _panel.panel.use('root_only'), _panel.panel.use('c1'), _panel.panel.use('c1_root_only'), _rule.rule.use('root_only'), _extension.extension.use('root_only'), _bodiedExtension.bodiedExtension.use('root_only'), _multiBodiedExtension.multiBodiedExtension.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock, _bodiedSyncBlock.bodiedSyncBlock))],
24
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup,
25
+ // `panel.use('c1')` must precede `blockContentGroup`, which contributes the bare `panel`
26
+ // name to the validator spec. The validator's repairing loop takes the FIRST candidate that
27
+ // reports valid, and with a repairing callback the less permissive base `panel` "succeeds"
28
+ // by wrapping a nested table as `unsupportedBlock`, so `panel_c1` is never reached.
29
+ // Safe because panel_c1's content is a strict superset of the base's (it only adds `table`).
30
+ // Deliberately placed AFTER `blockGroup` rather than first: `blockContentGroup` is ignored
31
+ // for `pm-spec`, so this keeps `block` the leading alternative in the PM content
32
+ // expression and leaves ProseMirror's defaultType/fill behaviour untouched.
33
+ _panel.panel.use('c1'), _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _panel.panel.use('root_only'), _panel.panel.use('c1_root_only'), _rule.rule.use('root_only'), _extension.extension.use('root_only'), _bodiedExtension.bodiedExtension.use('root_only'), _multiBodiedExtension.multiBodiedExtension.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock, _bodiedSyncBlock.bodiedSyncBlock))],
25
34
  DANGEROUS_MANUAL_OVERRIDE: {
26
35
  'validator-spec': {
27
36
  'props.content.minItems': {
@@ -157,7 +157,7 @@ var bodiedExtensionWithMarks = exports.bodiedExtensionWithMarks = (0, _createPMS
157
157
  isolating: true
158
158
  });
159
159
  var bodiedSyncBlock = exports.bodiedSyncBlock = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
160
- content: '(paragraph | blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel | panel_c1 | rule | table | taskList | unsupportedBlock)+',
160
+ content: '(paragraph | blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel_c1 | panel | rule | table | taskList | unsupportedBlock)+',
161
161
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation breakout link fragment',
162
162
  attrs: {
163
163
  resourceId: {
@@ -331,7 +331,7 @@ var decisionList = exports.decisionList = (0, _createPMSpecFactory.createPMNodeS
331
331
  defining: true
332
332
  });
333
333
  var doc = exports.doc = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
334
- content: '(block | codeBlock | panel | panel_c1 | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
334
+ content: '(block | panel_c1 | codeBlock | panel | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
335
335
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment breakout'
336
336
  });
337
337
  var embedCard = exports.embedCard = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
@@ -677,7 +677,7 @@ var inlineExtensionWithMarks = exports.inlineExtensionWithMarks = (0, _createPMS
677
677
  selectable: true
678
678
  });
679
679
  var layoutColumn = exports.layoutColumn = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
680
- content: '(block | unsupportedBlock | panel_c1)+',
680
+ content: '(block | panel_c1 | unsupportedBlock)+',
681
681
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment',
682
682
  attrs: {
683
683
  width: {
@@ -40,7 +40,10 @@ var bodiedSyncBlock = exports.bodiedSyncBlock = (0, _adfSchemaGenerator.adfNode)
40
40
  default: ''
41
41
  }
42
42
  },
43
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _blockCard.blockCard, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _list.bulletList, _codeBlock.codeBlock, _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _decisionList.decisionList, _embedCard.embedCard, _expand.expand, _heading.heading, _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _list.orderedList, _panel.panel, _panel.panel.use('c1'), _rule.rule, _tableNodes.table,
43
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _blockCard.blockCard, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _list.bulletList, _codeBlock.codeBlock, _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _decisionList.decisionList, _embedCard.embedCard, _expand.expand, _heading.heading, _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _list.orderedList,
44
+ // panel_c1 must precede bare `panel` so the validator's repairing loop reaches it before
45
+ // base `panel` wraps a nested table as `unsupportedBlock`. See full-schema.adf.ts.
46
+ _panel.panel.use('c1'), _panel.panel, _rule.rule, _tableNodes.table,
44
47
  // @ts-expect-error - types don't deal well with circular references for the variant
45
48
  _tableNodes.table.use('with_nested_table'), _task.taskList, _unsupportedBlock.unsupportedBlock))]
46
49
  });
@@ -35,6 +35,10 @@ var layoutColumn = exports.layoutColumn = (0, _adfSchemaGenerator.adfNode)('layo
35
35
  selectable: false,
36
36
  marks: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
37
37
  attrs: layoutColumnAttributes,
38
- // panel_c1 (table-in-panel) is also valid inside a layout column.
39
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _unsupportedBlock.unsupportedBlock, _panel.panel.use('c1')))]
38
+ // panel_c1 (table-in-panel) is also valid inside a layout column. It must come before
39
+ // `blockContentGroup`, which contributes the bare `panel` name: the validator's repairing loop
40
+ // takes the first valid candidate, and base `panel` "succeeds" by wrapping a nested table as
41
+ // `unsupportedBlock`. Kept after `blockGroup` so `block` stays the leading PM alternative.
42
+ // See the same note in full-schema.adf.ts.
43
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _panel.panel.use('c1'), _blockContentGroup.blockContentGroup, _unsupportedBlock.unsupportedBlock))]
40
44
  });
@@ -263,7 +263,7 @@ var bodiedSyncBlock = exports.bodiedSyncBlock = {
263
263
  },
264
264
  content: {
265
265
  allowUnsupportedBlock: true,
266
- items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'panel_c1', 'rule', 'table', 'taskList']],
266
+ items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel_c1', 'panel', 'rule', 'table', 'taskList']],
267
267
  minItems: 1,
268
268
  type: 'array'
269
269
  },
@@ -528,7 +528,7 @@ var doc = exports.doc = {
528
528
  props: {
529
529
  content: {
530
530
  allowUnsupportedBlock: true,
531
- 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
531
+ items: [['panel_c1', '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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
532
532
  type: 'array'
533
533
  },
534
534
  type: {
@@ -975,7 +975,7 @@ var layoutColumn = exports.layoutColumn = {
975
975
  },
976
976
  content: {
977
977
  allowUnsupportedBlock: true,
978
- 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'panel_c1']],
978
+ items: [['panel_c1', '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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks']],
979
979
  minItems: 1,
980
980
  type: 'array'
981
981
  },
@@ -15,7 +15,16 @@ import { rule } from './nodes/rule';
15
15
  const doc = adfNode('doc').define({
16
16
  root: true,
17
17
  version: 1,
18
- content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), panel.use('root_only'), panel.use('c1'), panel.use('c1_root_only'), rule.use('root_only'), extension.use('root_only'), bodiedExtension.use('root_only'), multiBodiedExtension.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
18
+ content: [$onePlus($or(blockGroup,
19
+ // `panel.use('c1')` must precede `blockContentGroup`, which contributes the bare `panel`
20
+ // name to the validator spec. The validator's repairing loop takes the FIRST candidate that
21
+ // reports valid, and with a repairing callback the less permissive base `panel` "succeeds"
22
+ // by wrapping a nested table as `unsupportedBlock`, so `panel_c1` is never reached.
23
+ // Safe because panel_c1's content is a strict superset of the base's (it only adds `table`).
24
+ // Deliberately placed AFTER `blockGroup` rather than first: `blockContentGroup` is ignored
25
+ // for `pm-spec`, so this keeps `block` the leading alternative in the PM content
26
+ // expression and leaves ProseMirror's defaultType/fill behaviour untouched.
27
+ panel.use('c1'), blockContentGroup, codeBlock.use('root_only'), panel.use('root_only'), panel.use('c1_root_only'), rule.use('root_only'), extension.use('root_only'), bodiedExtension.use('root_only'), multiBodiedExtension.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
19
28
  DANGEROUS_MANUAL_OVERRIDE: {
20
29
  'validator-spec': {
21
30
  'props.content.minItems': {
@@ -151,7 +151,7 @@ export const bodiedExtensionWithMarks = createPMNodeSpecFactory({
151
151
  isolating: true
152
152
  });
153
153
  export const bodiedSyncBlock = createPMNodeSpecFactory({
154
- content: '(paragraph | blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel | panel_c1 | rule | table | taskList | unsupportedBlock)+',
154
+ content: '(paragraph | blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel_c1 | panel | rule | table | taskList | unsupportedBlock)+',
155
155
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation breakout link fragment',
156
156
  attrs: {
157
157
  resourceId: {
@@ -325,7 +325,7 @@ export const decisionList = createPMNodeSpecFactory({
325
325
  defining: true
326
326
  });
327
327
  export const doc = createPMNodeSpecFactory({
328
- content: '(block | codeBlock | panel | panel_c1 | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
328
+ content: '(block | panel_c1 | codeBlock | panel | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
329
329
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment breakout'
330
330
  });
331
331
  export const embedCard = createPMNodeSpecFactory({
@@ -671,7 +671,7 @@ export const inlineExtensionWithMarks = createPMNodeSpecFactory({
671
671
  selectable: true
672
672
  });
673
673
  export const layoutColumn = createPMNodeSpecFactory({
674
- content: '(block | unsupportedBlock | panel_c1)+',
674
+ content: '(block | panel_c1 | unsupportedBlock)+',
675
675
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment',
676
676
  attrs: {
677
677
  width: {
@@ -34,7 +34,10 @@ export const bodiedSyncBlock = adfNode('bodiedSyncBlock').define({
34
34
  default: ''
35
35
  }
36
36
  },
37
- content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, panel.use('c1'), rule, table,
37
+ content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList,
38
+ // panel_c1 must precede bare `panel` so the validator's repairing loop reaches it before
39
+ // base `panel` wraps a nested table as `unsupportedBlock`. See full-schema.adf.ts.
40
+ panel.use('c1'), panel, rule, table,
38
41
  // @ts-expect-error - types don't deal well with circular references for the variant
39
42
  table.use('with_nested_table'), taskList, unsupportedBlock))]
40
43
  });
@@ -29,6 +29,10 @@ export const layoutColumn = adfNode('layoutColumn').define({
29
29
  selectable: false,
30
30
  marks: [unsupportedMark, unsupportedNodeAttribute],
31
31
  attrs: layoutColumnAttributes,
32
- // panel_c1 (table-in-panel) is also valid inside a layout column.
33
- content: [$onePlus($or(blockGroup, blockContentGroup, unsupportedBlock, panel.use('c1')))]
32
+ // panel_c1 (table-in-panel) is also valid inside a layout column. It must come before
33
+ // `blockContentGroup`, which contributes the bare `panel` name: the validator's repairing loop
34
+ // takes the first valid candidate, and base `panel` "succeeds" by wrapping a nested table as
35
+ // `unsupportedBlock`. Kept after `blockGroup` so `block` stays the leading PM alternative.
36
+ // See the same note in full-schema.adf.ts.
37
+ content: [$onePlus($or(blockGroup, panel.use('c1'), blockContentGroup, unsupportedBlock))]
34
38
  });
@@ -257,7 +257,7 @@ export const bodiedSyncBlock = {
257
257
  },
258
258
  content: {
259
259
  allowUnsupportedBlock: true,
260
- items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'panel_c1', 'rule', 'table', 'taskList']],
260
+ items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel_c1', 'panel', 'rule', 'table', 'taskList']],
261
261
  minItems: 1,
262
262
  type: 'array'
263
263
  },
@@ -522,7 +522,7 @@ export const doc = {
522
522
  props: {
523
523
  content: {
524
524
  allowUnsupportedBlock: true,
525
- 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
525
+ items: [['panel_c1', '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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
526
526
  type: 'array'
527
527
  },
528
528
  type: {
@@ -969,7 +969,7 @@ export const layoutColumn = {
969
969
  },
970
970
  content: {
971
971
  allowUnsupportedBlock: true,
972
- 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'panel_c1']],
972
+ items: [['panel_c1', '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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks']],
973
973
  minItems: 1,
974
974
  type: 'array'
975
975
  },
@@ -15,7 +15,16 @@ import { rule } from './nodes/rule';
15
15
  var doc = adfNode('doc').define({
16
16
  root: true,
17
17
  version: 1,
18
- content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), panel.use('root_only'), panel.use('c1'), panel.use('c1_root_only'), rule.use('root_only'), extension.use('root_only'), bodiedExtension.use('root_only'), multiBodiedExtension.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
18
+ content: [$onePlus($or(blockGroup,
19
+ // `panel.use('c1')` must precede `blockContentGroup`, which contributes the bare `panel`
20
+ // name to the validator spec. The validator's repairing loop takes the FIRST candidate that
21
+ // reports valid, and with a repairing callback the less permissive base `panel` "succeeds"
22
+ // by wrapping a nested table as `unsupportedBlock`, so `panel_c1` is never reached.
23
+ // Safe because panel_c1's content is a strict superset of the base's (it only adds `table`).
24
+ // Deliberately placed AFTER `blockGroup` rather than first: `blockContentGroup` is ignored
25
+ // for `pm-spec`, so this keeps `block` the leading alternative in the PM content
26
+ // expression and leaves ProseMirror's defaultType/fill behaviour untouched.
27
+ panel.use('c1'), blockContentGroup, codeBlock.use('root_only'), panel.use('root_only'), panel.use('c1_root_only'), rule.use('root_only'), extension.use('root_only'), bodiedExtension.use('root_only'), multiBodiedExtension.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
19
28
  DANGEROUS_MANUAL_OVERRIDE: {
20
29
  'validator-spec': {
21
30
  'props.content.minItems': {
@@ -151,7 +151,7 @@ export var bodiedExtensionWithMarks = createPMNodeSpecFactory({
151
151
  isolating: true
152
152
  });
153
153
  export var bodiedSyncBlock = createPMNodeSpecFactory({
154
- content: '(paragraph | blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel | panel_c1 | rule | table | taskList | unsupportedBlock)+',
154
+ content: '(paragraph | blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel_c1 | panel | rule | table | taskList | unsupportedBlock)+',
155
155
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation breakout link fragment',
156
156
  attrs: {
157
157
  resourceId: {
@@ -325,7 +325,7 @@ export var decisionList = createPMNodeSpecFactory({
325
325
  defining: true
326
326
  });
327
327
  export var doc = createPMNodeSpecFactory({
328
- content: '(block | codeBlock | panel | panel_c1 | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
328
+ content: '(block | panel_c1 | codeBlock | panel | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
329
329
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment breakout'
330
330
  });
331
331
  export var embedCard = createPMNodeSpecFactory({
@@ -671,7 +671,7 @@ export var inlineExtensionWithMarks = createPMNodeSpecFactory({
671
671
  selectable: true
672
672
  });
673
673
  export var layoutColumn = createPMNodeSpecFactory({
674
- content: '(block | unsupportedBlock | panel_c1)+',
674
+ content: '(block | panel_c1 | unsupportedBlock)+',
675
675
  marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment',
676
676
  attrs: {
677
677
  width: {
@@ -34,7 +34,10 @@ export var bodiedSyncBlock = adfNode('bodiedSyncBlock').define({
34
34
  default: ''
35
35
  }
36
36
  },
37
- content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, panel.use('c1'), rule, table,
37
+ content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList,
38
+ // panel_c1 must precede bare `panel` so the validator's repairing loop reaches it before
39
+ // base `panel` wraps a nested table as `unsupportedBlock`. See full-schema.adf.ts.
40
+ panel.use('c1'), panel, rule, table,
38
41
  // @ts-expect-error - types don't deal well with circular references for the variant
39
42
  table.use('with_nested_table'), taskList, unsupportedBlock))]
40
43
  });
@@ -29,6 +29,10 @@ export var layoutColumn = adfNode('layoutColumn').define({
29
29
  selectable: false,
30
30
  marks: [unsupportedMark, unsupportedNodeAttribute],
31
31
  attrs: layoutColumnAttributes,
32
- // panel_c1 (table-in-panel) is also valid inside a layout column.
33
- content: [$onePlus($or(blockGroup, blockContentGroup, unsupportedBlock, panel.use('c1')))]
32
+ // panel_c1 (table-in-panel) is also valid inside a layout column. It must come before
33
+ // `blockContentGroup`, which contributes the bare `panel` name: the validator's repairing loop
34
+ // takes the first valid candidate, and base `panel` "succeeds" by wrapping a nested table as
35
+ // `unsupportedBlock`. Kept after `blockGroup` so `block` stays the leading PM alternative.
36
+ // See the same note in full-schema.adf.ts.
37
+ content: [$onePlus($or(blockGroup, panel.use('c1'), blockContentGroup, unsupportedBlock))]
34
38
  });
@@ -257,7 +257,7 @@ export var bodiedSyncBlock = {
257
257
  },
258
258
  content: {
259
259
  allowUnsupportedBlock: true,
260
- items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'panel_c1', 'rule', 'table', 'taskList']],
260
+ items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel_c1', 'panel', 'rule', 'table', 'taskList']],
261
261
  minItems: 1,
262
262
  type: 'array'
263
263
  },
@@ -522,7 +522,7 @@ export var doc = {
522
522
  props: {
523
523
  content: {
524
524
  allowUnsupportedBlock: true,
525
- 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
525
+ items: [['panel_c1', '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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
526
526
  type: 'array'
527
527
  },
528
528
  type: {
@@ -969,7 +969,7 @@ export var layoutColumn = {
969
969
  },
970
970
  content: {
971
971
  allowUnsupportedBlock: true,
972
- 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'panel_c1']],
972
+ items: [['panel_c1', '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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks']],
973
973
  minItems: 1,
974
974
  type: 'array'
975
975
  },
@@ -545,10 +545,10 @@
545
545
  "$ref": "#/definitions/orderedList_node"
546
546
  },
547
547
  {
548
- "$ref": "#/definitions/panel_node"
548
+ "$ref": "#/definitions/panel_c1_node"
549
549
  },
550
550
  {
551
- "$ref": "#/definitions/panel_c1_node"
551
+ "$ref": "#/definitions/panel_node"
552
552
  },
553
553
  {
554
554
  "$ref": "#/definitions/rule_node"
@@ -1809,10 +1809,10 @@
1809
1809
  "items": {
1810
1810
  "anyOf": [
1811
1811
  {
1812
- "$ref": "#/definitions/block_content"
1812
+ "$ref": "#/definitions/panel_c1_node"
1813
1813
  },
1814
1814
  {
1815
- "$ref": "#/definitions/panel_c1_node"
1815
+ "$ref": "#/definitions/block_content"
1816
1816
  }
1817
1817
  ]
1818
1818
  },
@@ -545,10 +545,10 @@
545
545
  "$ref": "#/definitions/orderedList_node"
546
546
  },
547
547
  {
548
- "$ref": "#/definitions/panel_node"
548
+ "$ref": "#/definitions/panel_c1_node"
549
549
  },
550
550
  {
551
- "$ref": "#/definitions/panel_c1_node"
551
+ "$ref": "#/definitions/panel_node"
552
552
  },
553
553
  {
554
554
  "$ref": "#/definitions/rule_node"
@@ -1809,10 +1809,10 @@
1809
1809
  "items": {
1810
1810
  "anyOf": [
1811
1811
  {
1812
- "$ref": "#/definitions/block_content"
1812
+ "$ref": "#/definitions/panel_c1_node"
1813
1813
  },
1814
1814
  {
1815
- "$ref": "#/definitions/panel_c1_node"
1815
+ "$ref": "#/definitions/block_content"
1816
1816
  }
1817
1817
  ]
1818
1818
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "57.0.1",
3
+ "version": "57.0.2",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/adf-schema-generator": "^4.0.0",
41
41
  "@atlaskit/editor-prosemirror": "^8.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^148.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^148.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "css-color-names": "0.0.4",
46
46
  "linkify-it": "^5.0.2",