@atlaskit/adf-schema 37.1.41 → 37.1.42

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 (25) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/next-schema/groups/atomicInlineGroup.js +19 -0
  3. package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  4. package/dist/cjs/next-schema/nodes/nestedExpand.js +1 -1
  5. package/dist/cjs/next-schema/nodes/paragraph.js +2 -1
  6. package/dist/cjs/next-schema/nodes/tableCellContent.js +1 -1
  7. package/dist/cjs/validator-schema/generated/validatorSpec.js +13 -17
  8. package/dist/es2019/next-schema/groups/atomicInlineGroup.js +13 -0
  9. package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  10. package/dist/es2019/next-schema/nodes/nestedExpand.js +1 -1
  11. package/dist/es2019/next-schema/nodes/paragraph.js +2 -1
  12. package/dist/es2019/next-schema/nodes/tableCellContent.js +1 -1
  13. package/dist/es2019/validator-schema/generated/validatorSpec.js +12 -16
  14. package/dist/esm/next-schema/groups/atomicInlineGroup.js +13 -0
  15. package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  16. package/dist/esm/next-schema/nodes/nestedExpand.js +1 -1
  17. package/dist/esm/next-schema/nodes/paragraph.js +2 -1
  18. package/dist/esm/next-schema/nodes/tableCellContent.js +1 -1
  19. package/dist/esm/validator-schema/generated/validatorSpec.js +12 -16
  20. package/dist/types/next-schema/groups/atomicInlineGroup.d.ts +1 -0
  21. package/dist/types/next-schema/nodes/nestedExpand.d.ts +1 -1
  22. package/dist/types/validator-schema/generated/validatorSpec.d.ts +12 -16
  23. package/package.json +2 -2
  24. package/schema-generators/__tests__/unit/adfToValidatorSpecValidation.unit.ts +1 -7
  25. package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +23 -46
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 37.1.42
4
+
5
+ ### Patch Changes
6
+
7
+ - 758ee06: last hacks to support tableCell_content, nestedExpand_content and atomic_inlines pseudo groups in validator spec
8
+
3
9
  ## 37.1.41
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.atomicInlineGroup = void 0;
7
+ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ var _date = require("../nodes/date");
9
+ var _emoji = require("../nodes/emoji");
10
+ var _hardBreak = require("../nodes/hardBreak");
11
+ var _inlineCard = require("../nodes/inlineCard");
12
+ var _inlineExtension = require("../nodes/inlineExtension");
13
+ var _mediaInline = require("../nodes/mediaInline");
14
+ var _mention = require("../nodes/mention");
15
+ var _placeholder = require("../nodes/placeholder");
16
+ var _status = require("../nodes/status");
17
+ var atomicInlineGroup = exports.atomicInlineGroup = (0, _adfSchemaGenerator.adfNodeGroup)('atomic_inline', [_hardBreak.hardBreak, _mention.mention, _emoji.emoji, _inlineExtension.inlineExtension.use('with_marks'), _date.date, _placeholder.placeholder, _inlineCard.inlineCard, _status.status, _mediaInline.mediaInline], {
18
+ ignore: ['pm-spec', 'json-schema']
19
+ });
@@ -27,6 +27,6 @@ var tableCellContentNodes = [_codeBlock.codeBlock.use('with_no_marks'), _blockCa
27
27
  // @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
28
28
  // In PM Spec, they contain different items. (tableHeader using tableHeaderContentPseudoGroup, tableCell using tableCellContentPseudoGroup)
29
29
  // In JSON Schema, both tableHeader and tableCell points to tableCellContentPseudoGroup
30
- // The differences are highighted below.
30
+ // The differences are highlighted below.
31
31
  var tableCellContentPseudoGroup = exports.tableCellContentPseudoGroup = (0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, tableCellContentNodes.concat([_unsupportedBlock.unsupportedBlock])));
32
32
  var tableHeaderContentPseudoGroup = exports.tableHeaderContentPseudoGroup = (0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, tableCellContentNodes.concat([_nestedExpand.nestedExpand])));
@@ -53,7 +53,7 @@ var nestedExpand = exports.nestedExpand = (0, _adfSchemaGenerator.adfNode)('nest
53
53
  }
54
54
  }
55
55
  }).variant('content', {
56
- ignore: ['pm-spec', 'validator-spec']
56
+ ignore: ['pm-spec']
57
57
  }).variant('with_no_marks', {
58
58
  marks: [],
59
59
  content: [],
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.paragraph = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ var _atomicInlineGroup = require("../groups/atomicInlineGroup");
8
9
  var _inlineContentGroup = require("../groups/inlineContentGroup");
9
10
  var _inlineGroup = require("../groups/inlineGroup");
10
11
  var _alignmentAndIndentation = require("../marks/alignmentAndIndentation");
@@ -21,7 +22,7 @@ var paragraph = exports.paragraph = (0, _adfSchemaGenerator.adfNode)('paragraph'
21
22
  selectable: false,
22
23
  marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
23
24
  hasEmptyMarks: true,
24
- content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_inlineGroup.inlineGroup, _inlineContentGroup.inlineContentGroup))],
25
+ content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_inlineGroup.inlineGroup, _atomicInlineGroup.atomicInlineGroup, _inlineContentGroup.inlineContentGroup))],
25
26
  DANGEROUS_MANUAL_OVERRIDE: {
26
27
  'validator-spec': {
27
28
  'props.marks': {
@@ -9,6 +9,6 @@ var _tableCellContentPseudoGroup = require("../groups/tableCellContentPseudoGrou
9
9
  // @DSLCompatibilityException This is only used by JSON schema to group the table cell content into a definition.
10
10
  // This node should be deleted and the content should be replicated in the JSON schema for table header and table cell node
11
11
  var tableCellContent = exports.tableCellContent = (0, _adfSchemaGenerator.adfNode)('tableCellContent').define({
12
- ignore: ['pm-spec', 'validator-spec'],
12
+ ignore: ['pm-spec'],
13
13
  content: [_tableCellContentPseudoGroup.tableCellContentPseudoGroup]
14
14
  });
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.unsupportedInline = exports.unsupportedBlock = exports.underline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCellContent = 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_legacy = 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_legacy = exports.listItem = exports.link_text_inline = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_comment_marker = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.inline = exports.indentation = exports.image = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.formatted_text_inline = 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.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.code_inline = 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_legacy = exports.blockquote = exports.block_content = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
6
+ exports.unsupportedInline = exports.unsupportedBlock = exports.underline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell_content = 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_legacy = 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_legacy = exports.listItem = exports.link_text_inline = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_comment_marker = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.inline = exports.indentation = exports.image = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.formatted_text_inline = 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.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.code_inline = 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_legacy = exports.blockquote = exports.block_content = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.atomic_inline = exports.annotation = exports.alignment = void 0;
7
7
  var blockCard = exports.blockCard = {
8
8
  props: {
9
9
  type: {
@@ -883,6 +883,7 @@ var confluenceUnsupportedInline = exports.confluenceUnsupportedInline = {
883
883
  }
884
884
  }
885
885
  };
886
+ var atomic_inline = exports.atomic_inline = ['date', 'emoji', 'hardBreak', 'inlineCard', 'inlineExtension_with_marks', 'mediaInline', 'mention', 'placeholder', 'status'];
886
887
  var inline = exports.inline = ['code_inline', 'date', 'emoji', 'formatted_text_inline', 'hardBreak', 'inlineCard', 'inlineExtension_with_marks', 'mediaInline', 'mention', 'placeholder', 'status'];
887
888
  var paragraph = exports.paragraph = {
888
889
  props: {
@@ -1334,9 +1335,12 @@ var panel_legacy = exports.panel_legacy = ['panel', {
1334
1335
  }
1335
1336
  }
1336
1337
  }];
1337
- var nestedExpand_content = exports.nestedExpand_content = ['nestedExpand', {
1338
- props: {}
1339
- }];
1338
+ var nestedExpand_content = exports.nestedExpand_content = {
1339
+ type: 'array',
1340
+ items: [['blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'orderedList', 'panel', 'paragraph_with_no_marks', 'rule', 'taskList']],
1341
+ minItems: 1,
1342
+ allowUnsupportedBlock: true
1343
+ };
1340
1344
  var nestedExpand_with_no_marks = exports.nestedExpand_with_no_marks = ['nestedExpand', {
1341
1345
  props: {
1342
1346
  marks: {
@@ -1505,19 +1509,11 @@ var tableHeader = exports.tableHeader = {
1505
1509
  },
1506
1510
  required: ['content']
1507
1511
  };
1508
- var tableCellContent = exports.tableCellContent = {
1509
- props: {
1510
- type: {
1511
- type: 'enum',
1512
- values: ['tableCellContent']
1513
- },
1514
- content: {
1515
- type: 'array',
1516
- items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'embedCard', 'extension_with_marks', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'nestedExpand_with_no_marks', 'orderedList', 'panel', 'paragraph_with_alignment', 'paragraph_with_no_marks', 'rule', 'taskList']],
1517
- minItems: 1,
1518
- allowUnsupportedBlock: true
1519
- }
1520
- }
1512
+ var tableCell_content = exports.tableCell_content = {
1513
+ type: 'array',
1514
+ items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'embedCard', 'extension_with_marks', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'nestedExpand_with_no_marks', 'orderedList', 'panel', 'paragraph_with_alignment', 'paragraph_with_no_marks', 'rule', 'taskList']],
1515
+ minItems: 1,
1516
+ allowUnsupportedBlock: true
1521
1517
  };
1522
1518
  var tableRow = exports.tableRow = {
1523
1519
  props: {
@@ -0,0 +1,13 @@
1
+ import { adfNodeGroup } from '@atlaskit/adf-schema-generator';
2
+ import { date } from '../nodes/date';
3
+ import { emoji } from '../nodes/emoji';
4
+ import { hardBreak } from '../nodes/hardBreak';
5
+ import { inlineCard } from '../nodes/inlineCard';
6
+ import { inlineExtension } from '../nodes/inlineExtension';
7
+ import { mediaInline } from '../nodes/mediaInline';
8
+ import { mention } from '../nodes/mention';
9
+ import { placeholder } from '../nodes/placeholder';
10
+ import { status } from '../nodes/status';
11
+ export const atomicInlineGroup = adfNodeGroup('atomic_inline', [hardBreak, mention, emoji, inlineExtension.use('with_marks'), date, placeholder, inlineCard, status, mediaInline], {
12
+ ignore: ['pm-spec', 'json-schema']
13
+ });
@@ -21,6 +21,6 @@ const tableCellContentNodes = [codeBlock.use('with_no_marks'), blockCard, paragr
21
21
  // @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
22
22
  // In PM Spec, they contain different items. (tableHeader using tableHeaderContentPseudoGroup, tableCell using tableCellContentPseudoGroup)
23
23
  // In JSON Schema, both tableHeader and tableCell points to tableCellContentPseudoGroup
24
- // The differences are highighted below.
24
+ // The differences are highlighted below.
25
25
  export const tableCellContentPseudoGroup = $onePlus($or(...tableCellContentNodes, unsupportedBlock));
26
26
  export const tableHeaderContentPseudoGroup = $onePlus($or(...tableCellContentNodes, nestedExpand));
@@ -47,7 +47,7 @@ export const nestedExpand = adfNode('nestedExpand').define({
47
47
  }
48
48
  }
49
49
  }).variant('content', {
50
- ignore: ['pm-spec', 'validator-spec']
50
+ ignore: ['pm-spec']
51
51
  }).variant('with_no_marks', {
52
52
  marks: [],
53
53
  content: [],
@@ -1,4 +1,5 @@
1
1
  import { $or, $zeroPlus, adfNode } from '@atlaskit/adf-schema-generator';
2
+ import { atomicInlineGroup } from '../groups/atomicInlineGroup';
2
3
  import { inlineContentGroup } from '../groups/inlineContentGroup';
3
4
  import { inlineGroup } from '../groups/inlineGroup';
4
5
  import { alignment, indentation } from '../marks/alignmentAndIndentation';
@@ -15,7 +16,7 @@ export const paragraph = adfNode('paragraph').define({
15
16
  selectable: false,
16
17
  marks: [unsupportedNodeAttribute, unsupportedMark],
17
18
  hasEmptyMarks: true,
18
- content: [$zeroPlus($or(inlineGroup, inlineContentGroup))],
19
+ content: [$zeroPlus($or(inlineGroup, atomicInlineGroup, inlineContentGroup))],
19
20
  DANGEROUS_MANUAL_OVERRIDE: {
20
21
  'validator-spec': {
21
22
  'props.marks': {
@@ -4,6 +4,6 @@ import { tableCellContentPseudoGroup } from '../groups/tableCellContentPseudoGro
4
4
  // @DSLCompatibilityException This is only used by JSON schema to group the table cell content into a definition.
5
5
  // This node should be deleted and the content should be replicated in the JSON schema for table header and table cell node
6
6
  export const tableCellContent = adfNode('tableCellContent').define({
7
- ignore: ['pm-spec', 'validator-spec'],
7
+ ignore: ['pm-spec'],
8
8
  content: [tableCellContentPseudoGroup]
9
9
  });
@@ -877,6 +877,7 @@ export const confluenceUnsupportedInline = {
877
877
  }
878
878
  }
879
879
  };
880
+ export const atomic_inline = ['date', 'emoji', 'hardBreak', 'inlineCard', 'inlineExtension_with_marks', 'mediaInline', 'mention', 'placeholder', 'status'];
880
881
  export const inline = ['code_inline', 'date', 'emoji', 'formatted_text_inline', 'hardBreak', 'inlineCard', 'inlineExtension_with_marks', 'mediaInline', 'mention', 'placeholder', 'status'];
881
882
  export const paragraph = {
882
883
  props: {
@@ -1328,9 +1329,12 @@ export const panel_legacy = ['panel', {
1328
1329
  }
1329
1330
  }
1330
1331
  }];
1331
- export const nestedExpand_content = ['nestedExpand', {
1332
- props: {}
1333
- }];
1332
+ export const nestedExpand_content = {
1333
+ type: 'array',
1334
+ items: [['blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'orderedList', 'panel', 'paragraph_with_no_marks', 'rule', 'taskList']],
1335
+ minItems: 1,
1336
+ allowUnsupportedBlock: true
1337
+ };
1334
1338
  export const nestedExpand_with_no_marks = ['nestedExpand', {
1335
1339
  props: {
1336
1340
  marks: {
@@ -1499,19 +1503,11 @@ export const tableHeader = {
1499
1503
  },
1500
1504
  required: ['content']
1501
1505
  };
1502
- export const tableCellContent = {
1503
- props: {
1504
- type: {
1505
- type: 'enum',
1506
- values: ['tableCellContent']
1507
- },
1508
- content: {
1509
- type: 'array',
1510
- items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'embedCard', 'extension_with_marks', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'nestedExpand_with_no_marks', 'orderedList', 'panel', 'paragraph_with_alignment', 'paragraph_with_no_marks', 'rule', 'taskList']],
1511
- minItems: 1,
1512
- allowUnsupportedBlock: true
1513
- }
1514
- }
1506
+ export const tableCell_content = {
1507
+ type: 'array',
1508
+ items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'embedCard', 'extension_with_marks', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'nestedExpand_with_no_marks', 'orderedList', 'panel', 'paragraph_with_alignment', 'paragraph_with_no_marks', 'rule', 'taskList']],
1509
+ minItems: 1,
1510
+ allowUnsupportedBlock: true
1515
1511
  };
1516
1512
  export const tableRow = {
1517
1513
  props: {
@@ -0,0 +1,13 @@
1
+ import { adfNodeGroup } from '@atlaskit/adf-schema-generator';
2
+ import { date } from '../nodes/date';
3
+ import { emoji } from '../nodes/emoji';
4
+ import { hardBreak } from '../nodes/hardBreak';
5
+ import { inlineCard } from '../nodes/inlineCard';
6
+ import { inlineExtension } from '../nodes/inlineExtension';
7
+ import { mediaInline } from '../nodes/mediaInline';
8
+ import { mention } from '../nodes/mention';
9
+ import { placeholder } from '../nodes/placeholder';
10
+ import { status } from '../nodes/status';
11
+ export var atomicInlineGroup = adfNodeGroup('atomic_inline', [hardBreak, mention, emoji, inlineExtension.use('with_marks'), date, placeholder, inlineCard, status, mediaInline], {
12
+ ignore: ['pm-spec', 'json-schema']
13
+ });
@@ -21,6 +21,6 @@ var tableCellContentNodes = [codeBlock.use('with_no_marks'), blockCard, paragrap
21
21
  // @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
22
22
  // In PM Spec, they contain different items. (tableHeader using tableHeaderContentPseudoGroup, tableCell using tableCellContentPseudoGroup)
23
23
  // In JSON Schema, both tableHeader and tableCell points to tableCellContentPseudoGroup
24
- // The differences are highighted below.
24
+ // The differences are highlighted below.
25
25
  export var tableCellContentPseudoGroup = $onePlus($or.apply(void 0, tableCellContentNodes.concat([unsupportedBlock])));
26
26
  export var tableHeaderContentPseudoGroup = $onePlus($or.apply(void 0, tableCellContentNodes.concat([nestedExpand])));
@@ -47,7 +47,7 @@ export var nestedExpand = adfNode('nestedExpand').define({
47
47
  }
48
48
  }
49
49
  }).variant('content', {
50
- ignore: ['pm-spec', 'validator-spec']
50
+ ignore: ['pm-spec']
51
51
  }).variant('with_no_marks', {
52
52
  marks: [],
53
53
  content: [],
@@ -1,4 +1,5 @@
1
1
  import { $or, $zeroPlus, adfNode } from '@atlaskit/adf-schema-generator';
2
+ import { atomicInlineGroup } from '../groups/atomicInlineGroup';
2
3
  import { inlineContentGroup } from '../groups/inlineContentGroup';
3
4
  import { inlineGroup } from '../groups/inlineGroup';
4
5
  import { alignment, indentation } from '../marks/alignmentAndIndentation';
@@ -15,7 +16,7 @@ export var paragraph = adfNode('paragraph').define({
15
16
  selectable: false,
16
17
  marks: [unsupportedNodeAttribute, unsupportedMark],
17
18
  hasEmptyMarks: true,
18
- content: [$zeroPlus($or(inlineGroup, inlineContentGroup))],
19
+ content: [$zeroPlus($or(inlineGroup, atomicInlineGroup, inlineContentGroup))],
19
20
  DANGEROUS_MANUAL_OVERRIDE: {
20
21
  'validator-spec': {
21
22
  'props.marks': {
@@ -4,6 +4,6 @@ import { tableCellContentPseudoGroup } from '../groups/tableCellContentPseudoGro
4
4
  // @DSLCompatibilityException This is only used by JSON schema to group the table cell content into a definition.
5
5
  // This node should be deleted and the content should be replicated in the JSON schema for table header and table cell node
6
6
  export var tableCellContent = adfNode('tableCellContent').define({
7
- ignore: ['pm-spec', 'validator-spec'],
7
+ ignore: ['pm-spec'],
8
8
  content: [tableCellContentPseudoGroup]
9
9
  });
@@ -877,6 +877,7 @@ export var confluenceUnsupportedInline = {
877
877
  }
878
878
  }
879
879
  };
880
+ export var atomic_inline = ['date', 'emoji', 'hardBreak', 'inlineCard', 'inlineExtension_with_marks', 'mediaInline', 'mention', 'placeholder', 'status'];
880
881
  export var inline = ['code_inline', 'date', 'emoji', 'formatted_text_inline', 'hardBreak', 'inlineCard', 'inlineExtension_with_marks', 'mediaInline', 'mention', 'placeholder', 'status'];
881
882
  export var paragraph = {
882
883
  props: {
@@ -1328,9 +1329,12 @@ export var panel_legacy = ['panel', {
1328
1329
  }
1329
1330
  }
1330
1331
  }];
1331
- export var nestedExpand_content = ['nestedExpand', {
1332
- props: {}
1333
- }];
1332
+ export var nestedExpand_content = {
1333
+ type: 'array',
1334
+ items: [['blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'orderedList', 'panel', 'paragraph_with_no_marks', 'rule', 'taskList']],
1335
+ minItems: 1,
1336
+ allowUnsupportedBlock: true
1337
+ };
1334
1338
  export var nestedExpand_with_no_marks = ['nestedExpand', {
1335
1339
  props: {
1336
1340
  marks: {
@@ -1499,19 +1503,11 @@ export var tableHeader = {
1499
1503
  },
1500
1504
  required: ['content']
1501
1505
  };
1502
- export var tableCellContent = {
1503
- props: {
1504
- type: {
1505
- type: 'enum',
1506
- values: ['tableCellContent']
1507
- },
1508
- content: {
1509
- type: 'array',
1510
- items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'embedCard', 'extension_with_marks', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'nestedExpand_with_no_marks', 'orderedList', 'panel', 'paragraph_with_alignment', 'paragraph_with_no_marks', 'rule', 'taskList']],
1511
- minItems: 1,
1512
- allowUnsupportedBlock: true
1513
- }
1514
- }
1506
+ export var tableCell_content = {
1507
+ type: 'array',
1508
+ items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock_with_no_marks', 'decisionList', 'embedCard', 'extension_with_marks', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'nestedExpand_with_no_marks', 'orderedList', 'panel', 'paragraph_with_alignment', 'paragraph_with_no_marks', 'rule', 'taskList']],
1509
+ minItems: 1,
1510
+ allowUnsupportedBlock: true
1515
1511
  };
1516
1512
  export var tableRow = {
1517
1513
  props: {
@@ -0,0 +1 @@
1
+ export declare const atomicInlineGroup: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
@@ -28,7 +28,7 @@ export declare const nestedExpand: import("@atlaskit/adf-schema-generator/dist/t
28
28
  'validator-spec'?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").DangerousManualOverride;
29
29
  };
30
30
  } & {
31
- ignore: ("pm-spec" | "validator-spec")[];
31
+ ignore: "pm-spec"[];
32
32
  } & {
33
33
  marks: any[];
34
34
  content: any[];
@@ -896,6 +896,7 @@ export declare const confluenceUnsupportedInline: {
896
896
  };
897
897
  };
898
898
  };
899
+ export declare const atomic_inline: string[];
899
900
  export declare const inline: string[];
900
901
  export declare const paragraph: {
901
902
  props: {
@@ -1347,9 +1348,12 @@ export declare const panel_legacy: (string | {
1347
1348
  };
1348
1349
  };
1349
1350
  })[];
1350
- export declare const nestedExpand_content: (string | {
1351
- props: {};
1352
- })[];
1351
+ export declare const nestedExpand_content: {
1352
+ type: string;
1353
+ items: string[][];
1354
+ minItems: number;
1355
+ allowUnsupportedBlock: boolean;
1356
+ };
1353
1357
  export declare const nestedExpand_with_no_marks: (string | {
1354
1358
  props: {
1355
1359
  marks: {
@@ -1518,19 +1522,11 @@ export declare const tableHeader: {
1518
1522
  };
1519
1523
  required: string[];
1520
1524
  };
1521
- export declare const tableCellContent: {
1522
- props: {
1523
- type: {
1524
- type: string;
1525
- values: string[];
1526
- };
1527
- content: {
1528
- type: string;
1529
- items: string[][];
1530
- minItems: number;
1531
- allowUnsupportedBlock: boolean;
1532
- };
1533
- };
1525
+ export declare const tableCell_content: {
1526
+ type: string;
1527
+ items: string[][];
1528
+ minItems: number;
1529
+ allowUnsupportedBlock: boolean;
1534
1530
  };
1535
1531
  export declare const tableRow: {
1536
1532
  props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "37.1.41",
3
+ "version": "37.1.42",
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/"
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@atlassian/adf-schema-json": "^1.16.0",
51
- "@atlaskit/adf-schema-generator": "^1.25.10",
51
+ "@atlaskit/adf-schema-generator": "^1.25.11",
52
52
  "@atlaskit/adf-utils": "^19.2.2",
53
53
  "@atlaskit/codemod-utils": "^4.2.4",
54
54
  "@atlaskit/json-schema-generator": "^3.3.9",
@@ -4,11 +4,6 @@ import adfNode from '../../../src/next-schema/full-schema.adf';
4
4
  import { sortNestedArrays } from '../../../src/validator-schema/utils/sortNestedArrays';
5
5
 
6
6
  const newSpecs = sortNestedArrays(adfToValidatorSpec(adfNode));
7
- const SKIP_LIST = [
8
- 'atomic_inline', // doesn't exist in the output, not even used anywhere...
9
- 'nestedExpand_content', // doesn't exist in the output, completely different format from other groups
10
- 'tableCell_content', // doesn't exist in the output, completely different format from other groups
11
- ];
12
7
 
13
8
  const testCases = Object.entries(currentSpecs).map(([key, value]) => {
14
9
  return {
@@ -19,8 +14,7 @@ const testCases = Object.entries(currentSpecs).map(([key, value]) => {
19
14
  });
20
15
 
21
16
  testCases.forEach(({ name, currentSpec, newSpec }) => {
22
- const testMethod = SKIP_LIST.includes(name) ? it.skip : it;
23
- testMethod(`should be able to handle ${name}`, () => {
17
+ it(`should be able to handle ${name}`, () => {
24
18
  expect(newSpec).toEqual(currentSpec);
25
19
  });
26
20
  });
@@ -101,63 +101,40 @@ test('JSON Schema to ADF DSL backwards compatibility for full schema', () => {
101
101
  expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
102
102
  });
103
103
 
104
- const DEFINITIONS_TO_SKIP_STAGE_0 = [
105
- 'blockCard_node',
106
- 'block_content',
107
- 'bodiedExtension_node',
108
- 'bodiedExtension_with_marks_node',
109
- 'codeBlock_node',
110
- 'codeBlock_with_marks_node',
111
- 'codeBlock_with_no_marks_node',
112
- 'code_inline_node',
113
- 'date_node',
104
+ const DEFINITIONS_TO_SKIP_STAGE_0_BACKWARDS = [
114
105
  'doc_node',
115
- 'emoji_node',
116
- 'expand_node',
117
- 'expand_with_breakout_mark_node',
118
- 'expand_with_no_mark_node',
119
- 'extensionFrame_node',
120
- 'extension_node',
121
- 'extension_with_marks_node',
122
- 'formatted_text_inline_node',
123
- 'heading_node',
124
- 'heading_with_alignment_node',
125
- 'heading_with_indentation_node',
126
- 'heading_with_no_marks_node',
127
106
  'inlineCard_node',
128
- 'inlineExtension_node',
129
- 'inlineExtension_with_marks_node',
130
- 'inline_node',
131
- 'layoutSection_node',
132
- 'layoutSection_full_node',
133
107
  'layoutSection_with_single_column_node',
134
- 'mediaInline_node',
135
- 'mediaSingle_caption_node',
136
- 'mediaSingle_full_node',
137
- 'mediaSingle_node',
138
- 'mention_node',
139
108
  'multiBodiedExtension_node',
140
- 'nestedExpand_content',
141
- 'nestedExpand_node',
142
- 'nestedExpand_with_no_marks_node',
143
- 'non_nestable_block_content',
144
- 'paragraph_node',
145
- 'paragraph_with_alignment_node',
146
- 'paragraph_with_indentation_node',
147
- 'paragraph_with_no_marks_node',
148
- 'status_node',
149
- 'table_cell_content',
150
- 'table_cell_node',
151
- 'table_header_node',
152
- 'text_node',
153
109
  ];
154
110
  test('ADF DSL to JSON Schema backwards compatibility for stage0 schema', () => {
155
111
  // eslint-disable-next-line @typescript-eslint/no-var-requires
156
112
  const currentSchema = require('../../../json-schema/v1/stage-0.json');
157
113
  const nextSchema = adfToJSON(adfNode);
158
- DEFINITIONS_TO_SKIP_STAGE_0.forEach((definition) => {
114
+ DEFINITIONS_TO_SKIP_STAGE_0_BACKWARDS.forEach((definition) => {
159
115
  nextSchema.definitions[definition] = currentSchema.definitions[definition];
160
116
  });
161
117
 
162
118
  expect(nextSchema).toBeBackwardsCompatibleWith(currentSchema);
163
119
  });
120
+
121
+ const DEFINITIONS_TO_SKIP_STAGE_0_FORWARDS = [
122
+ 'extensionFrame_node',
123
+ 'inline_node',
124
+ 'table_row_node',
125
+ 'table_cell_content',
126
+ 'codeBlock_node',
127
+ 'codeBlock_with_marks_node',
128
+ 'mediaInline_node',
129
+ 'mediaGroup_node',
130
+ ];
131
+ test('JSON Schema to ADF DSL backwards compatibility for stage0 schema', () => {
132
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
133
+ const currentSchema = require('../../../json-schema/v1/stage-0.json');
134
+ const nextSchema = adfToJSON(adfNode);
135
+ DEFINITIONS_TO_SKIP_STAGE_0_FORWARDS.forEach((definition) => {
136
+ currentSchema.definitions[definition] = nextSchema.definitions[definition];
137
+ });
138
+
139
+ expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
140
+ });