@atlaskit/adf-schema 39.0.1 → 39.0.3
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 +12 -0
- package/dist/cjs/next-schema/groups/blockContentGroup.js +1 -1
- package/dist/cjs/validator-schema/generated/validatorSpec.js +34 -34
- package/dist/es2019/next-schema/groups/blockContentGroup.js +1 -1
- package/dist/es2019/validator-schema/generated/validatorSpec.js +34 -34
- package/dist/esm/next-schema/groups/blockContentGroup.js +1 -1
- package/dist/esm/validator-schema/generated/validatorSpec.js +34 -34
- package/package.json +1 -1
- package/schema-generators/validator-full-schema.ts +1 -2
- package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +0 -307
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 39.0.3
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 3f37dcf: Sorting of validator spec is breaking for isTupleLike content
|
8
|
+
|
9
|
+
## 39.0.2
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 3d69cd2: clean up comments and remove validating pm spec unit tests as we have migrated pm spec
|
14
|
+
|
3
15
|
## 39.0.1
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -37,6 +37,6 @@ var _unsupportedBlock = require("../nodes/unsupportedBlock");
|
|
37
37
|
* - no base heading
|
38
38
|
* - no base expand
|
39
39
|
*/
|
40
|
-
var blockContentGroup = exports.blockContentGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block_content', [_blockCard.blockCard,
|
40
|
+
var blockContentGroup = exports.blockContentGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block_content', [_blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _extension.extension.use('with_marks'), _embedCard.embedCard, _table.table, _expand.expand.use('with_no_mark'), _bodiedExtension.bodiedExtension.use('with_marks'), _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _unsupportedBlock.unsupportedBlock], {
|
41
41
|
ignore: ['pm-spec', 'json-schema']
|
42
42
|
});
|
@@ -48,7 +48,7 @@ var blockCard = exports.blockCard = {
|
|
48
48
|
},
|
49
49
|
layout: {
|
50
50
|
type: 'enum',
|
51
|
-
values: ['
|
51
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start'],
|
52
52
|
optional: true
|
53
53
|
}
|
54
54
|
}
|
@@ -173,7 +173,7 @@ var mediaSingle = exports.mediaSingle = {
|
|
173
173
|
},
|
174
174
|
layout: {
|
175
175
|
type: 'enum',
|
176
|
-
values: ['
|
176
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
177
177
|
},
|
178
178
|
widthType: {
|
179
179
|
type: 'enum',
|
@@ -193,7 +193,7 @@ var mediaSingle = exports.mediaSingle = {
|
|
193
193
|
},
|
194
194
|
layout: {
|
195
195
|
type: 'enum',
|
196
|
-
values: ['
|
196
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
197
197
|
}
|
198
198
|
}
|
199
199
|
}],
|
@@ -214,7 +214,7 @@ var media = exports.media = {
|
|
214
214
|
props: {
|
215
215
|
type: {
|
216
216
|
type: 'enum',
|
217
|
-
values: ['
|
217
|
+
values: ['link', 'file']
|
218
218
|
},
|
219
219
|
id: {
|
220
220
|
minLength: 1,
|
@@ -267,7 +267,7 @@ var media = exports.media = {
|
|
267
267
|
marks: {
|
268
268
|
type: 'array',
|
269
269
|
optional: true,
|
270
|
-
items: [['
|
270
|
+
items: [['link', 'annotation', 'border']]
|
271
271
|
}
|
272
272
|
},
|
273
273
|
required: ['attrs']
|
@@ -402,7 +402,7 @@ var mention = exports.mention = {
|
|
402
402
|
},
|
403
403
|
userType: {
|
404
404
|
type: 'enum',
|
405
|
-
values: ['
|
405
|
+
values: ['DEFAULT', 'SPECIAL', 'APP'],
|
406
406
|
optional: true
|
407
407
|
}
|
408
408
|
}
|
@@ -520,7 +520,7 @@ var status = exports.status = {
|
|
520
520
|
},
|
521
521
|
color: {
|
522
522
|
type: 'enum',
|
523
|
-
values: ['
|
523
|
+
values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green']
|
524
524
|
},
|
525
525
|
localId: {
|
526
526
|
type: 'string',
|
@@ -544,7 +544,7 @@ var formatted_text_inline = exports.formatted_text_inline = ['text', {
|
|
544
544
|
marks: {
|
545
545
|
type: 'array',
|
546
546
|
optional: true,
|
547
|
-
items: [['
|
547
|
+
items: [['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'textColor', 'annotation', 'backgroundColor', null]]
|
548
548
|
}
|
549
549
|
}
|
550
550
|
}];
|
@@ -553,7 +553,7 @@ var code_inline = exports.code_inline = ['text', {
|
|
553
553
|
marks: {
|
554
554
|
type: 'array',
|
555
555
|
optional: true,
|
556
|
-
items: [['
|
556
|
+
items: [['code', 'link', 'annotation']]
|
557
557
|
}
|
558
558
|
}
|
559
559
|
}];
|
@@ -668,7 +668,7 @@ var caption = exports.caption = {
|
|
668
668
|
},
|
669
669
|
content: {
|
670
670
|
type: 'array',
|
671
|
-
items: [['
|
671
|
+
items: [['hardBreak', 'mention', 'emoji', 'date', 'placeholder', 'inlineCard', 'status', 'formatted_text_inline', 'code_inline']],
|
672
672
|
allowUnsupportedInline: true,
|
673
673
|
minItems: 0
|
674
674
|
}
|
@@ -679,7 +679,7 @@ var mediaSingle_caption = exports.mediaSingle_caption = ['mediaSingle', {
|
|
679
679
|
content: {
|
680
680
|
type: 'array',
|
681
681
|
isTupleLike: true,
|
682
|
-
items: ['
|
682
|
+
items: ['media', 'caption'],
|
683
683
|
minItems: 1,
|
684
684
|
maxItems: 2,
|
685
685
|
allowUnsupportedBlock: true
|
@@ -774,7 +774,7 @@ var mediaInline = exports.mediaInline = {
|
|
774
774
|
props: {
|
775
775
|
type: {
|
776
776
|
type: 'enum',
|
777
|
-
values: ['
|
777
|
+
values: ['link', 'file', 'image'],
|
778
778
|
optional: true
|
779
779
|
},
|
780
780
|
id: {
|
@@ -810,7 +810,7 @@ var mediaInline = exports.mediaInline = {
|
|
810
810
|
marks: {
|
811
811
|
type: 'array',
|
812
812
|
optional: true,
|
813
|
-
items: [['
|
813
|
+
items: [['link', 'annotation', 'border']]
|
814
814
|
}
|
815
815
|
}
|
816
816
|
};
|
@@ -883,8 +883,8 @@ var confluenceUnsupportedInline = exports.confluenceUnsupportedInline = {
|
|
883
883
|
}
|
884
884
|
}
|
885
885
|
};
|
886
|
-
var atomic_inline = exports.atomic_inline = ['
|
887
|
-
var inline = exports.inline = ['
|
886
|
+
var atomic_inline = exports.atomic_inline = ['hardBreak', 'mention', 'emoji', 'inlineExtension_with_marks', 'date', 'placeholder', 'inlineCard', 'status', 'mediaInline'];
|
887
|
+
var inline = exports.inline = ['formatted_text_inline', 'code_inline', 'date', 'emoji', 'hardBreak', 'inlineCard', 'mention', 'placeholder', 'status', 'inlineExtension_with_marks', 'mediaInline'];
|
888
888
|
var paragraph = exports.paragraph = {
|
889
889
|
props: {
|
890
890
|
type: {
|
@@ -954,7 +954,7 @@ var taskItem = exports.taskItem = {
|
|
954
954
|
},
|
955
955
|
state: {
|
956
956
|
type: 'enum',
|
957
|
-
values: ['
|
957
|
+
values: ['TODO', 'DONE']
|
958
958
|
}
|
959
959
|
}
|
960
960
|
},
|
@@ -993,7 +993,7 @@ var listItem_legacy = exports.listItem_legacy = ['listItem', {
|
|
993
993
|
content: {
|
994
994
|
type: 'array',
|
995
995
|
isTupleLike: true,
|
996
|
-
items: [['
|
996
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks']],
|
997
997
|
minItems: 1,
|
998
998
|
allowUnsupportedBlock: true
|
999
999
|
}
|
@@ -1021,7 +1021,7 @@ var listItem = exports.listItem = {
|
|
1021
1021
|
content: {
|
1022
1022
|
type: 'array',
|
1023
1023
|
isTupleLike: true,
|
1024
|
-
items: [['
|
1024
|
+
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']],
|
1025
1025
|
minItems: 1,
|
1026
1026
|
allowUnsupportedBlock: true
|
1027
1027
|
}
|
@@ -1058,7 +1058,7 @@ var blockquote = exports.blockquote = {
|
|
1058
1058
|
},
|
1059
1059
|
content: {
|
1060
1060
|
type: 'array',
|
1061
|
-
items: [['
|
1061
|
+
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList']],
|
1062
1062
|
minItems: 1,
|
1063
1063
|
allowUnsupportedBlock: true
|
1064
1064
|
}
|
@@ -1133,7 +1133,7 @@ var embedCard = exports.embedCard = {
|
|
1133
1133
|
},
|
1134
1134
|
layout: {
|
1135
1135
|
type: 'enum',
|
1136
|
-
values: ['
|
1136
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
1137
1137
|
},
|
1138
1138
|
width: {
|
1139
1139
|
type: 'number',
|
@@ -1179,7 +1179,7 @@ var extension = exports.extension = {
|
|
1179
1179
|
},
|
1180
1180
|
layout: {
|
1181
1181
|
type: 'enum',
|
1182
|
-
values: ['
|
1182
|
+
values: ['wide', 'full-width', 'default'],
|
1183
1183
|
optional: true
|
1184
1184
|
},
|
1185
1185
|
localId: {
|
@@ -1297,7 +1297,7 @@ var panel = exports.panel = {
|
|
1297
1297
|
props: {
|
1298
1298
|
panelType: {
|
1299
1299
|
type: 'enum',
|
1300
|
-
values: ['
|
1300
|
+
values: ['info', 'note', 'tip', 'warning', 'error', 'success', 'custom']
|
1301
1301
|
},
|
1302
1302
|
panelIcon: {
|
1303
1303
|
type: 'string',
|
@@ -1319,7 +1319,7 @@ var panel = exports.panel = {
|
|
1319
1319
|
},
|
1320
1320
|
content: {
|
1321
1321
|
type: 'array',
|
1322
|
-
items: [['
|
1322
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'rule', 'decisionList']],
|
1323
1323
|
minItems: 1,
|
1324
1324
|
allowUnsupportedBlock: true
|
1325
1325
|
}
|
@@ -1329,7 +1329,7 @@ var panel_legacy = exports.panel_legacy = ['panel', {
|
|
1329
1329
|
props: {
|
1330
1330
|
content: {
|
1331
1331
|
type: 'array',
|
1332
|
-
items: [['
|
1332
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard']],
|
1333
1333
|
minItems: 1,
|
1334
1334
|
allowUnsupportedBlock: true
|
1335
1335
|
}
|
@@ -1337,7 +1337,7 @@ var panel_legacy = exports.panel_legacy = ['panel', {
|
|
1337
1337
|
}];
|
1338
1338
|
var nestedExpand_content = exports.nestedExpand_content = {
|
1339
1339
|
type: 'array',
|
1340
|
-
items: [['
|
1340
|
+
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']],
|
1341
1341
|
minItems: 1,
|
1342
1342
|
allowUnsupportedBlock: true
|
1343
1343
|
};
|
@@ -1511,7 +1511,7 @@ var tableHeader = exports.tableHeader = {
|
|
1511
1511
|
};
|
1512
1512
|
var tableCell_content = exports.tableCell_content = {
|
1513
1513
|
type: 'array',
|
1514
|
-
items: [['
|
1514
|
+
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']],
|
1515
1515
|
minItems: 1,
|
1516
1516
|
allowUnsupportedBlock: true
|
1517
1517
|
};
|
@@ -1546,7 +1546,7 @@ var table = exports.table = {
|
|
1546
1546
|
},
|
1547
1547
|
layout: {
|
1548
1548
|
type: 'enum',
|
1549
|
-
values: ['
|
1549
|
+
values: ['wide', 'full-width', 'center', 'align-end', 'align-start', 'default'],
|
1550
1550
|
optional: true
|
1551
1551
|
},
|
1552
1552
|
localId: {
|
@@ -1573,7 +1573,7 @@ var table = exports.table = {
|
|
1573
1573
|
}
|
1574
1574
|
}
|
1575
1575
|
};
|
1576
|
-
var non_nestable_block_content = exports.non_nestable_block_content = ['
|
1576
|
+
var non_nestable_block_content = exports.non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock_with_no_marks', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks'];
|
1577
1577
|
var bodiedExtension = exports.bodiedExtension = {
|
1578
1578
|
props: {
|
1579
1579
|
type: {
|
@@ -1600,7 +1600,7 @@ var bodiedExtension = exports.bodiedExtension = {
|
|
1600
1600
|
},
|
1601
1601
|
layout: {
|
1602
1602
|
type: 'enum',
|
1603
|
-
values: ['
|
1603
|
+
values: ['wide', 'full-width', 'default'],
|
1604
1604
|
optional: true
|
1605
1605
|
},
|
1606
1606
|
localId: {
|
@@ -1693,7 +1693,7 @@ var confluenceUnsupportedBlock = exports.confluenceUnsupportedBlock = {
|
|
1693
1693
|
}
|
1694
1694
|
}
|
1695
1695
|
};
|
1696
|
-
var block_content = exports.block_content = ['blockCard', '
|
1696
|
+
var block_content = exports.block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
|
1697
1697
|
var layoutColumn = exports.layoutColumn = {
|
1698
1698
|
props: {
|
1699
1699
|
type: {
|
@@ -1782,7 +1782,7 @@ var extensionFrame = exports.extensionFrame = {
|
|
1782
1782
|
},
|
1783
1783
|
content: {
|
1784
1784
|
type: 'array',
|
1785
|
-
items: [['
|
1785
|
+
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']],
|
1786
1786
|
minItems: 1
|
1787
1787
|
},
|
1788
1788
|
marks: {
|
@@ -1818,7 +1818,7 @@ var multiBodiedExtension = exports.multiBodiedExtension = {
|
|
1818
1818
|
},
|
1819
1819
|
layout: {
|
1820
1820
|
type: 'enum',
|
1821
|
-
values: ['default', '
|
1821
|
+
values: ['default', 'wide', 'full-width'],
|
1822
1822
|
optional: true
|
1823
1823
|
},
|
1824
1824
|
localId: {
|
@@ -1850,7 +1850,7 @@ var breakout = exports.breakout = {
|
|
1850
1850
|
props: {
|
1851
1851
|
mode: {
|
1852
1852
|
type: 'enum',
|
1853
|
-
values: ['
|
1853
|
+
values: ['wide', 'full-width']
|
1854
1854
|
}
|
1855
1855
|
}
|
1856
1856
|
}
|
@@ -1868,7 +1868,7 @@ var doc = exports.doc = {
|
|
1868
1868
|
},
|
1869
1869
|
content: {
|
1870
1870
|
type: 'array',
|
1871
|
-
items: [['blockCard', '
|
1871
|
+
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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_with_marks', 'layoutSection_full', 'layoutSection_with_single_column', 'multiBodiedExtension', 'expand_with_breakout_mark']],
|
1872
1872
|
allowUnsupportedBlock: true
|
1873
1873
|
}
|
1874
1874
|
}
|
@@ -32,6 +32,6 @@ import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
32
32
|
* - no base heading
|
33
33
|
* - no base expand
|
34
34
|
*/
|
35
|
-
export const blockContentGroup = adfNodeGroup('block_content', [blockCard,
|
35
|
+
export const blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, table, expand.use('with_no_mark'), bodiedExtension.use('with_marks'), confluenceUnsupportedBlock, unsupportedBlock], {
|
36
36
|
ignore: ['pm-spec', 'json-schema']
|
37
37
|
});
|
@@ -42,7 +42,7 @@ export const blockCard = {
|
|
42
42
|
},
|
43
43
|
layout: {
|
44
44
|
type: 'enum',
|
45
|
-
values: ['
|
45
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start'],
|
46
46
|
optional: true
|
47
47
|
}
|
48
48
|
}
|
@@ -167,7 +167,7 @@ export const mediaSingle = {
|
|
167
167
|
},
|
168
168
|
layout: {
|
169
169
|
type: 'enum',
|
170
|
-
values: ['
|
170
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
171
171
|
},
|
172
172
|
widthType: {
|
173
173
|
type: 'enum',
|
@@ -187,7 +187,7 @@ export const mediaSingle = {
|
|
187
187
|
},
|
188
188
|
layout: {
|
189
189
|
type: 'enum',
|
190
|
-
values: ['
|
190
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
191
191
|
}
|
192
192
|
}
|
193
193
|
}],
|
@@ -208,7 +208,7 @@ export const media = {
|
|
208
208
|
props: {
|
209
209
|
type: {
|
210
210
|
type: 'enum',
|
211
|
-
values: ['
|
211
|
+
values: ['link', 'file']
|
212
212
|
},
|
213
213
|
id: {
|
214
214
|
minLength: 1,
|
@@ -261,7 +261,7 @@ export const media = {
|
|
261
261
|
marks: {
|
262
262
|
type: 'array',
|
263
263
|
optional: true,
|
264
|
-
items: [['
|
264
|
+
items: [['link', 'annotation', 'border']]
|
265
265
|
}
|
266
266
|
},
|
267
267
|
required: ['attrs']
|
@@ -396,7 +396,7 @@ export const mention = {
|
|
396
396
|
},
|
397
397
|
userType: {
|
398
398
|
type: 'enum',
|
399
|
-
values: ['
|
399
|
+
values: ['DEFAULT', 'SPECIAL', 'APP'],
|
400
400
|
optional: true
|
401
401
|
}
|
402
402
|
}
|
@@ -514,7 +514,7 @@ export const status = {
|
|
514
514
|
},
|
515
515
|
color: {
|
516
516
|
type: 'enum',
|
517
|
-
values: ['
|
517
|
+
values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green']
|
518
518
|
},
|
519
519
|
localId: {
|
520
520
|
type: 'string',
|
@@ -538,7 +538,7 @@ export const formatted_text_inline = ['text', {
|
|
538
538
|
marks: {
|
539
539
|
type: 'array',
|
540
540
|
optional: true,
|
541
|
-
items: [['
|
541
|
+
items: [['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'textColor', 'annotation', 'backgroundColor', null]]
|
542
542
|
}
|
543
543
|
}
|
544
544
|
}];
|
@@ -547,7 +547,7 @@ export const code_inline = ['text', {
|
|
547
547
|
marks: {
|
548
548
|
type: 'array',
|
549
549
|
optional: true,
|
550
|
-
items: [['
|
550
|
+
items: [['code', 'link', 'annotation']]
|
551
551
|
}
|
552
552
|
}
|
553
553
|
}];
|
@@ -662,7 +662,7 @@ export const caption = {
|
|
662
662
|
},
|
663
663
|
content: {
|
664
664
|
type: 'array',
|
665
|
-
items: [['
|
665
|
+
items: [['hardBreak', 'mention', 'emoji', 'date', 'placeholder', 'inlineCard', 'status', 'formatted_text_inline', 'code_inline']],
|
666
666
|
allowUnsupportedInline: true,
|
667
667
|
minItems: 0
|
668
668
|
}
|
@@ -673,7 +673,7 @@ export const mediaSingle_caption = ['mediaSingle', {
|
|
673
673
|
content: {
|
674
674
|
type: 'array',
|
675
675
|
isTupleLike: true,
|
676
|
-
items: ['
|
676
|
+
items: ['media', 'caption'],
|
677
677
|
minItems: 1,
|
678
678
|
maxItems: 2,
|
679
679
|
allowUnsupportedBlock: true
|
@@ -768,7 +768,7 @@ export const mediaInline = {
|
|
768
768
|
props: {
|
769
769
|
type: {
|
770
770
|
type: 'enum',
|
771
|
-
values: ['
|
771
|
+
values: ['link', 'file', 'image'],
|
772
772
|
optional: true
|
773
773
|
},
|
774
774
|
id: {
|
@@ -804,7 +804,7 @@ export const mediaInline = {
|
|
804
804
|
marks: {
|
805
805
|
type: 'array',
|
806
806
|
optional: true,
|
807
|
-
items: [['
|
807
|
+
items: [['link', 'annotation', 'border']]
|
808
808
|
}
|
809
809
|
}
|
810
810
|
};
|
@@ -877,8 +877,8 @@ export const confluenceUnsupportedInline = {
|
|
877
877
|
}
|
878
878
|
}
|
879
879
|
};
|
880
|
-
export const atomic_inline = ['
|
881
|
-
export const inline = ['
|
880
|
+
export const atomic_inline = ['hardBreak', 'mention', 'emoji', 'inlineExtension_with_marks', 'date', 'placeholder', 'inlineCard', 'status', 'mediaInline'];
|
881
|
+
export const inline = ['formatted_text_inline', 'code_inline', 'date', 'emoji', 'hardBreak', 'inlineCard', 'mention', 'placeholder', 'status', 'inlineExtension_with_marks', 'mediaInline'];
|
882
882
|
export const paragraph = {
|
883
883
|
props: {
|
884
884
|
type: {
|
@@ -948,7 +948,7 @@ export const taskItem = {
|
|
948
948
|
},
|
949
949
|
state: {
|
950
950
|
type: 'enum',
|
951
|
-
values: ['
|
951
|
+
values: ['TODO', 'DONE']
|
952
952
|
}
|
953
953
|
}
|
954
954
|
},
|
@@ -987,7 +987,7 @@ export const listItem_legacy = ['listItem', {
|
|
987
987
|
content: {
|
988
988
|
type: 'array',
|
989
989
|
isTupleLike: true,
|
990
|
-
items: [['
|
990
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks']],
|
991
991
|
minItems: 1,
|
992
992
|
allowUnsupportedBlock: true
|
993
993
|
}
|
@@ -1015,7 +1015,7 @@ export const listItem = {
|
|
1015
1015
|
content: {
|
1016
1016
|
type: 'array',
|
1017
1017
|
isTupleLike: true,
|
1018
|
-
items: [['
|
1018
|
+
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']],
|
1019
1019
|
minItems: 1,
|
1020
1020
|
allowUnsupportedBlock: true
|
1021
1021
|
}
|
@@ -1052,7 +1052,7 @@ export const blockquote = {
|
|
1052
1052
|
},
|
1053
1053
|
content: {
|
1054
1054
|
type: 'array',
|
1055
|
-
items: [['
|
1055
|
+
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList']],
|
1056
1056
|
minItems: 1,
|
1057
1057
|
allowUnsupportedBlock: true
|
1058
1058
|
}
|
@@ -1127,7 +1127,7 @@ export const embedCard = {
|
|
1127
1127
|
},
|
1128
1128
|
layout: {
|
1129
1129
|
type: 'enum',
|
1130
|
-
values: ['
|
1130
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
1131
1131
|
},
|
1132
1132
|
width: {
|
1133
1133
|
type: 'number',
|
@@ -1173,7 +1173,7 @@ export const extension = {
|
|
1173
1173
|
},
|
1174
1174
|
layout: {
|
1175
1175
|
type: 'enum',
|
1176
|
-
values: ['
|
1176
|
+
values: ['wide', 'full-width', 'default'],
|
1177
1177
|
optional: true
|
1178
1178
|
},
|
1179
1179
|
localId: {
|
@@ -1291,7 +1291,7 @@ export const panel = {
|
|
1291
1291
|
props: {
|
1292
1292
|
panelType: {
|
1293
1293
|
type: 'enum',
|
1294
|
-
values: ['
|
1294
|
+
values: ['info', 'note', 'tip', 'warning', 'error', 'success', 'custom']
|
1295
1295
|
},
|
1296
1296
|
panelIcon: {
|
1297
1297
|
type: 'string',
|
@@ -1313,7 +1313,7 @@ export const panel = {
|
|
1313
1313
|
},
|
1314
1314
|
content: {
|
1315
1315
|
type: 'array',
|
1316
|
-
items: [['
|
1316
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'rule', 'decisionList']],
|
1317
1317
|
minItems: 1,
|
1318
1318
|
allowUnsupportedBlock: true
|
1319
1319
|
}
|
@@ -1323,7 +1323,7 @@ export const panel_legacy = ['panel', {
|
|
1323
1323
|
props: {
|
1324
1324
|
content: {
|
1325
1325
|
type: 'array',
|
1326
|
-
items: [['
|
1326
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard']],
|
1327
1327
|
minItems: 1,
|
1328
1328
|
allowUnsupportedBlock: true
|
1329
1329
|
}
|
@@ -1331,7 +1331,7 @@ export const panel_legacy = ['panel', {
|
|
1331
1331
|
}];
|
1332
1332
|
export const nestedExpand_content = {
|
1333
1333
|
type: 'array',
|
1334
|
-
items: [['
|
1334
|
+
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']],
|
1335
1335
|
minItems: 1,
|
1336
1336
|
allowUnsupportedBlock: true
|
1337
1337
|
};
|
@@ -1505,7 +1505,7 @@ export const tableHeader = {
|
|
1505
1505
|
};
|
1506
1506
|
export const tableCell_content = {
|
1507
1507
|
type: 'array',
|
1508
|
-
items: [['
|
1508
|
+
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']],
|
1509
1509
|
minItems: 1,
|
1510
1510
|
allowUnsupportedBlock: true
|
1511
1511
|
};
|
@@ -1540,7 +1540,7 @@ export const table = {
|
|
1540
1540
|
},
|
1541
1541
|
layout: {
|
1542
1542
|
type: 'enum',
|
1543
|
-
values: ['
|
1543
|
+
values: ['wide', 'full-width', 'center', 'align-end', 'align-start', 'default'],
|
1544
1544
|
optional: true
|
1545
1545
|
},
|
1546
1546
|
localId: {
|
@@ -1567,7 +1567,7 @@ export const table = {
|
|
1567
1567
|
}
|
1568
1568
|
}
|
1569
1569
|
};
|
1570
|
-
export const non_nestable_block_content = ['
|
1570
|
+
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'];
|
1571
1571
|
export const bodiedExtension = {
|
1572
1572
|
props: {
|
1573
1573
|
type: {
|
@@ -1594,7 +1594,7 @@ export const bodiedExtension = {
|
|
1594
1594
|
},
|
1595
1595
|
layout: {
|
1596
1596
|
type: 'enum',
|
1597
|
-
values: ['
|
1597
|
+
values: ['wide', 'full-width', 'default'],
|
1598
1598
|
optional: true
|
1599
1599
|
},
|
1600
1600
|
localId: {
|
@@ -1687,7 +1687,7 @@ export const confluenceUnsupportedBlock = {
|
|
1687
1687
|
}
|
1688
1688
|
}
|
1689
1689
|
};
|
1690
|
-
export const block_content = ['blockCard', '
|
1690
|
+
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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
|
1691
1691
|
export const layoutColumn = {
|
1692
1692
|
props: {
|
1693
1693
|
type: {
|
@@ -1776,7 +1776,7 @@ export const extensionFrame = {
|
|
1776
1776
|
},
|
1777
1777
|
content: {
|
1778
1778
|
type: 'array',
|
1779
|
-
items: [['
|
1779
|
+
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']],
|
1780
1780
|
minItems: 1
|
1781
1781
|
},
|
1782
1782
|
marks: {
|
@@ -1812,7 +1812,7 @@ export const multiBodiedExtension = {
|
|
1812
1812
|
},
|
1813
1813
|
layout: {
|
1814
1814
|
type: 'enum',
|
1815
|
-
values: ['default', '
|
1815
|
+
values: ['default', 'wide', 'full-width'],
|
1816
1816
|
optional: true
|
1817
1817
|
},
|
1818
1818
|
localId: {
|
@@ -1844,7 +1844,7 @@ export const breakout = {
|
|
1844
1844
|
props: {
|
1845
1845
|
mode: {
|
1846
1846
|
type: 'enum',
|
1847
|
-
values: ['
|
1847
|
+
values: ['wide', 'full-width']
|
1848
1848
|
}
|
1849
1849
|
}
|
1850
1850
|
}
|
@@ -1862,7 +1862,7 @@ export const doc = {
|
|
1862
1862
|
},
|
1863
1863
|
content: {
|
1864
1864
|
type: 'array',
|
1865
|
-
items: [['blockCard', '
|
1865
|
+
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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_with_marks', 'layoutSection_full', 'layoutSection_with_single_column', 'multiBodiedExtension', 'expand_with_breakout_mark']],
|
1866
1866
|
allowUnsupportedBlock: true
|
1867
1867
|
}
|
1868
1868
|
}
|
@@ -32,6 +32,6 @@ 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,
|
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, blockquote, extension.use('with_marks'), embedCard, table, expand.use('with_no_mark'), bodiedExtension.use('with_marks'), confluenceUnsupportedBlock, unsupportedBlock], {
|
36
36
|
ignore: ['pm-spec', 'json-schema']
|
37
37
|
});
|
@@ -42,7 +42,7 @@ export var blockCard = {
|
|
42
42
|
},
|
43
43
|
layout: {
|
44
44
|
type: 'enum',
|
45
|
-
values: ['
|
45
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start'],
|
46
46
|
optional: true
|
47
47
|
}
|
48
48
|
}
|
@@ -167,7 +167,7 @@ export var mediaSingle = {
|
|
167
167
|
},
|
168
168
|
layout: {
|
169
169
|
type: 'enum',
|
170
|
-
values: ['
|
170
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
171
171
|
},
|
172
172
|
widthType: {
|
173
173
|
type: 'enum',
|
@@ -187,7 +187,7 @@ export var mediaSingle = {
|
|
187
187
|
},
|
188
188
|
layout: {
|
189
189
|
type: 'enum',
|
190
|
-
values: ['
|
190
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
191
191
|
}
|
192
192
|
}
|
193
193
|
}],
|
@@ -208,7 +208,7 @@ export var media = {
|
|
208
208
|
props: {
|
209
209
|
type: {
|
210
210
|
type: 'enum',
|
211
|
-
values: ['
|
211
|
+
values: ['link', 'file']
|
212
212
|
},
|
213
213
|
id: {
|
214
214
|
minLength: 1,
|
@@ -261,7 +261,7 @@ export var media = {
|
|
261
261
|
marks: {
|
262
262
|
type: 'array',
|
263
263
|
optional: true,
|
264
|
-
items: [['
|
264
|
+
items: [['link', 'annotation', 'border']]
|
265
265
|
}
|
266
266
|
},
|
267
267
|
required: ['attrs']
|
@@ -396,7 +396,7 @@ export var mention = {
|
|
396
396
|
},
|
397
397
|
userType: {
|
398
398
|
type: 'enum',
|
399
|
-
values: ['
|
399
|
+
values: ['DEFAULT', 'SPECIAL', 'APP'],
|
400
400
|
optional: true
|
401
401
|
}
|
402
402
|
}
|
@@ -514,7 +514,7 @@ export var status = {
|
|
514
514
|
},
|
515
515
|
color: {
|
516
516
|
type: 'enum',
|
517
|
-
values: ['
|
517
|
+
values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green']
|
518
518
|
},
|
519
519
|
localId: {
|
520
520
|
type: 'string',
|
@@ -538,7 +538,7 @@ export var formatted_text_inline = ['text', {
|
|
538
538
|
marks: {
|
539
539
|
type: 'array',
|
540
540
|
optional: true,
|
541
|
-
items: [['
|
541
|
+
items: [['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'textColor', 'annotation', 'backgroundColor', null]]
|
542
542
|
}
|
543
543
|
}
|
544
544
|
}];
|
@@ -547,7 +547,7 @@ export var code_inline = ['text', {
|
|
547
547
|
marks: {
|
548
548
|
type: 'array',
|
549
549
|
optional: true,
|
550
|
-
items: [['
|
550
|
+
items: [['code', 'link', 'annotation']]
|
551
551
|
}
|
552
552
|
}
|
553
553
|
}];
|
@@ -662,7 +662,7 @@ export var caption = {
|
|
662
662
|
},
|
663
663
|
content: {
|
664
664
|
type: 'array',
|
665
|
-
items: [['
|
665
|
+
items: [['hardBreak', 'mention', 'emoji', 'date', 'placeholder', 'inlineCard', 'status', 'formatted_text_inline', 'code_inline']],
|
666
666
|
allowUnsupportedInline: true,
|
667
667
|
minItems: 0
|
668
668
|
}
|
@@ -673,7 +673,7 @@ export var mediaSingle_caption = ['mediaSingle', {
|
|
673
673
|
content: {
|
674
674
|
type: 'array',
|
675
675
|
isTupleLike: true,
|
676
|
-
items: ['
|
676
|
+
items: ['media', 'caption'],
|
677
677
|
minItems: 1,
|
678
678
|
maxItems: 2,
|
679
679
|
allowUnsupportedBlock: true
|
@@ -768,7 +768,7 @@ export var mediaInline = {
|
|
768
768
|
props: {
|
769
769
|
type: {
|
770
770
|
type: 'enum',
|
771
|
-
values: ['
|
771
|
+
values: ['link', 'file', 'image'],
|
772
772
|
optional: true
|
773
773
|
},
|
774
774
|
id: {
|
@@ -804,7 +804,7 @@ export var mediaInline = {
|
|
804
804
|
marks: {
|
805
805
|
type: 'array',
|
806
806
|
optional: true,
|
807
|
-
items: [['
|
807
|
+
items: [['link', 'annotation', 'border']]
|
808
808
|
}
|
809
809
|
}
|
810
810
|
};
|
@@ -877,8 +877,8 @@ export var confluenceUnsupportedInline = {
|
|
877
877
|
}
|
878
878
|
}
|
879
879
|
};
|
880
|
-
export var atomic_inline = ['
|
881
|
-
export var inline = ['
|
880
|
+
export var atomic_inline = ['hardBreak', 'mention', 'emoji', 'inlineExtension_with_marks', 'date', 'placeholder', 'inlineCard', 'status', 'mediaInline'];
|
881
|
+
export var inline = ['formatted_text_inline', 'code_inline', 'date', 'emoji', 'hardBreak', 'inlineCard', 'mention', 'placeholder', 'status', 'inlineExtension_with_marks', 'mediaInline'];
|
882
882
|
export var paragraph = {
|
883
883
|
props: {
|
884
884
|
type: {
|
@@ -948,7 +948,7 @@ export var taskItem = {
|
|
948
948
|
},
|
949
949
|
state: {
|
950
950
|
type: 'enum',
|
951
|
-
values: ['
|
951
|
+
values: ['TODO', 'DONE']
|
952
952
|
}
|
953
953
|
}
|
954
954
|
},
|
@@ -987,7 +987,7 @@ export var listItem_legacy = ['listItem', {
|
|
987
987
|
content: {
|
988
988
|
type: 'array',
|
989
989
|
isTupleLike: true,
|
990
|
-
items: [['
|
990
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks']],
|
991
991
|
minItems: 1,
|
992
992
|
allowUnsupportedBlock: true
|
993
993
|
}
|
@@ -1015,7 +1015,7 @@ export var listItem = {
|
|
1015
1015
|
content: {
|
1016
1016
|
type: 'array',
|
1017
1017
|
isTupleLike: true,
|
1018
|
-
items: [['
|
1018
|
+
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']],
|
1019
1019
|
minItems: 1,
|
1020
1020
|
allowUnsupportedBlock: true
|
1021
1021
|
}
|
@@ -1052,7 +1052,7 @@ export var blockquote = {
|
|
1052
1052
|
},
|
1053
1053
|
content: {
|
1054
1054
|
type: 'array',
|
1055
|
-
items: [['
|
1055
|
+
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList']],
|
1056
1056
|
minItems: 1,
|
1057
1057
|
allowUnsupportedBlock: true
|
1058
1058
|
}
|
@@ -1127,7 +1127,7 @@ export var embedCard = {
|
|
1127
1127
|
},
|
1128
1128
|
layout: {
|
1129
1129
|
type: 'enum',
|
1130
|
-
values: ['
|
1130
|
+
values: ['wide', 'full-width', 'center', 'wrap-right', 'wrap-left', 'align-end', 'align-start']
|
1131
1131
|
},
|
1132
1132
|
width: {
|
1133
1133
|
type: 'number',
|
@@ -1173,7 +1173,7 @@ export var extension = {
|
|
1173
1173
|
},
|
1174
1174
|
layout: {
|
1175
1175
|
type: 'enum',
|
1176
|
-
values: ['
|
1176
|
+
values: ['wide', 'full-width', 'default'],
|
1177
1177
|
optional: true
|
1178
1178
|
},
|
1179
1179
|
localId: {
|
@@ -1291,7 +1291,7 @@ export var panel = {
|
|
1291
1291
|
props: {
|
1292
1292
|
panelType: {
|
1293
1293
|
type: 'enum',
|
1294
|
-
values: ['
|
1294
|
+
values: ['info', 'note', 'tip', 'warning', 'error', 'success', 'custom']
|
1295
1295
|
},
|
1296
1296
|
panelIcon: {
|
1297
1297
|
type: 'string',
|
@@ -1313,7 +1313,7 @@ export var panel = {
|
|
1313
1313
|
},
|
1314
1314
|
content: {
|
1315
1315
|
type: 'array',
|
1316
|
-
items: [['
|
1316
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'taskList', 'rule', 'decisionList']],
|
1317
1317
|
minItems: 1,
|
1318
1318
|
allowUnsupportedBlock: true
|
1319
1319
|
}
|
@@ -1323,7 +1323,7 @@ export var panel_legacy = ['panel', {
|
|
1323
1323
|
props: {
|
1324
1324
|
content: {
|
1325
1325
|
type: 'array',
|
1326
|
-
items: [['
|
1326
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard']],
|
1327
1327
|
minItems: 1,
|
1328
1328
|
allowUnsupportedBlock: true
|
1329
1329
|
}
|
@@ -1331,7 +1331,7 @@ export var panel_legacy = ['panel', {
|
|
1331
1331
|
}];
|
1332
1332
|
export var nestedExpand_content = {
|
1333
1333
|
type: 'array',
|
1334
|
-
items: [['
|
1334
|
+
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']],
|
1335
1335
|
minItems: 1,
|
1336
1336
|
allowUnsupportedBlock: true
|
1337
1337
|
};
|
@@ -1505,7 +1505,7 @@ export var tableHeader = {
|
|
1505
1505
|
};
|
1506
1506
|
export var tableCell_content = {
|
1507
1507
|
type: 'array',
|
1508
|
-
items: [['
|
1508
|
+
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']],
|
1509
1509
|
minItems: 1,
|
1510
1510
|
allowUnsupportedBlock: true
|
1511
1511
|
};
|
@@ -1540,7 +1540,7 @@ export var table = {
|
|
1540
1540
|
},
|
1541
1541
|
layout: {
|
1542
1542
|
type: 'enum',
|
1543
|
-
values: ['
|
1543
|
+
values: ['wide', 'full-width', 'center', 'align-end', 'align-start', 'default'],
|
1544
1544
|
optional: true
|
1545
1545
|
},
|
1546
1546
|
localId: {
|
@@ -1567,7 +1567,7 @@ export var table = {
|
|
1567
1567
|
}
|
1568
1568
|
}
|
1569
1569
|
};
|
1570
|
-
export var non_nestable_block_content = ['
|
1570
|
+
export var 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'];
|
1571
1571
|
export var bodiedExtension = {
|
1572
1572
|
props: {
|
1573
1573
|
type: {
|
@@ -1594,7 +1594,7 @@ export var bodiedExtension = {
|
|
1594
1594
|
},
|
1595
1595
|
layout: {
|
1596
1596
|
type: 'enum',
|
1597
|
-
values: ['
|
1597
|
+
values: ['wide', 'full-width', 'default'],
|
1598
1598
|
optional: true
|
1599
1599
|
},
|
1600
1600
|
localId: {
|
@@ -1687,7 +1687,7 @@ export var confluenceUnsupportedBlock = {
|
|
1687
1687
|
}
|
1688
1688
|
}
|
1689
1689
|
};
|
1690
|
-
export var block_content = ['blockCard', '
|
1690
|
+
export var 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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
|
1691
1691
|
export var layoutColumn = {
|
1692
1692
|
props: {
|
1693
1693
|
type: {
|
@@ -1776,7 +1776,7 @@ export var extensionFrame = {
|
|
1776
1776
|
},
|
1777
1777
|
content: {
|
1778
1778
|
type: 'array',
|
1779
|
-
items: [['
|
1779
|
+
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']],
|
1780
1780
|
minItems: 1
|
1781
1781
|
},
|
1782
1782
|
marks: {
|
@@ -1812,7 +1812,7 @@ export var multiBodiedExtension = {
|
|
1812
1812
|
},
|
1813
1813
|
layout: {
|
1814
1814
|
type: 'enum',
|
1815
|
-
values: ['default', '
|
1815
|
+
values: ['default', 'wide', 'full-width'],
|
1816
1816
|
optional: true
|
1817
1817
|
},
|
1818
1818
|
localId: {
|
@@ -1844,7 +1844,7 @@ export var breakout = {
|
|
1844
1844
|
props: {
|
1845
1845
|
mode: {
|
1846
1846
|
type: 'enum',
|
1847
|
-
values: ['
|
1847
|
+
values: ['wide', 'full-width']
|
1848
1848
|
}
|
1849
1849
|
}
|
1850
1850
|
}
|
@@ -1862,7 +1862,7 @@ export var doc = {
|
|
1862
1862
|
},
|
1863
1863
|
content: {
|
1864
1864
|
type: 'array',
|
1865
|
-
items: [['blockCard', '
|
1865
|
+
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', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_with_marks', 'layoutSection_full', 'layoutSection_with_single_column', 'multiBodiedExtension', 'expand_with_breakout_mark']],
|
1866
1866
|
allowUnsupportedBlock: true
|
1867
1867
|
}
|
1868
1868
|
}
|
package/package.json
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
import path from 'path';
|
2
2
|
import { adfToValidatorSpec } from '@atlaskit/adf-schema-generator';
|
3
3
|
import adfNode from 'src/next-schema/full-schema.adf';
|
4
|
-
import { sortNestedArrays } from 'src/validator-schema/utils/sortNestedArrays';
|
5
4
|
import { writeToFile } from './helpers/writeToFile';
|
6
5
|
|
7
6
|
const outputPath = path.join('src', 'validator-schema', 'generated');
|
8
7
|
|
9
8
|
function generateValidatorSpec() {
|
10
|
-
const output =
|
9
|
+
const output = adfToValidatorSpec(adfNode);
|
11
10
|
return Object.entries(output)
|
12
11
|
.map(
|
13
12
|
([key, value]) => `export const ${key} = ${JSON.stringify(value.json)};`,
|
@@ -1,307 +0,0 @@
|
|
1
|
-
import { MarkSpec, NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
2
|
-
import * as newMarkSpecs from '@atlaskit/adf-schema/src/next-schema/generated/markTypes';
|
3
|
-
import * as newNodeSpecs from '@atlaskit/adf-schema/src/next-schema/generated/nodeTypes';
|
4
|
-
import { getNodesAndMarksMap } from '../../../src/schema/create-schema';
|
5
|
-
import { printExpected, printReceived, matcherHint } from 'jest-matcher-utils';
|
6
|
-
import { filterAndSortMarks, formatContent } from '../helpers/_utils';
|
7
|
-
import {
|
8
|
-
blockCard,
|
9
|
-
blockquote,
|
10
|
-
blockquoteWithList,
|
11
|
-
bodiedExtension,
|
12
|
-
bulletList,
|
13
|
-
caption,
|
14
|
-
codeBlock,
|
15
|
-
confluenceJiraIssue,
|
16
|
-
confluenceUnsupportedBlock,
|
17
|
-
confluenceUnsupportedInline,
|
18
|
-
date,
|
19
|
-
decisionItem,
|
20
|
-
decisionList,
|
21
|
-
doc,
|
22
|
-
embedCard,
|
23
|
-
emoji,
|
24
|
-
expand,
|
25
|
-
extendedPanel,
|
26
|
-
extension,
|
27
|
-
extensionFrame,
|
28
|
-
hardBreak,
|
29
|
-
heading,
|
30
|
-
image,
|
31
|
-
inlineCard,
|
32
|
-
inlineExtension,
|
33
|
-
layoutColumn,
|
34
|
-
layoutSection,
|
35
|
-
listItem,
|
36
|
-
listItemWithTask,
|
37
|
-
media,
|
38
|
-
mediaGroup,
|
39
|
-
mediaInline,
|
40
|
-
mediaSingle,
|
41
|
-
mediaSingleFull,
|
42
|
-
mediaSingleWithCaption,
|
43
|
-
mediaSingleWithWidthType,
|
44
|
-
mention,
|
45
|
-
multiBodiedExtension,
|
46
|
-
nestedExpand,
|
47
|
-
orderedList,
|
48
|
-
orderedListWithOrder,
|
49
|
-
panel,
|
50
|
-
paragraph,
|
51
|
-
placeholder,
|
52
|
-
rule,
|
53
|
-
status,
|
54
|
-
taskItem,
|
55
|
-
taskList,
|
56
|
-
table,
|
57
|
-
tableCell,
|
58
|
-
tableHeader,
|
59
|
-
tableRow,
|
60
|
-
text,
|
61
|
-
unsupportedBlock,
|
62
|
-
unsupportedInline,
|
63
|
-
} from '../../../src/schema/nodes';
|
64
|
-
import {
|
65
|
-
MarkSpecFactory,
|
66
|
-
NodeSpecFactory,
|
67
|
-
} from '../../../src/schema/createPMSpecFactory';
|
68
|
-
|
69
|
-
const defaultSchema = getNodesAndMarksMap();
|
70
|
-
|
71
|
-
/**
|
72
|
-
* TODO: The SKIPPED consts are defined to pass the test
|
73
|
-
* Once following ticket is done, will need to remove exclude and unskip tests.
|
74
|
-
* https://product-fabric.atlassian.net/browse/ED-23488
|
75
|
-
*/
|
76
|
-
const SKIPPED_NODESPEC_TESTS = [];
|
77
|
-
|
78
|
-
const newSpecNameReference = {
|
79
|
-
blockquote: 'blockquoteLegacy',
|
80
|
-
blockquoteWithList: 'blockquote',
|
81
|
-
extendedPanel: 'panel',
|
82
|
-
inlineExtension: 'inlineExtensionWithMarks',
|
83
|
-
listItem: 'listItemLegacy',
|
84
|
-
listItemWithTask: 'listItem',
|
85
|
-
mediaSingleWithCaption: 'mediaSingleCaption',
|
86
|
-
mediaSingleWithWidthType: 'mediaSingleWidthType',
|
87
|
-
orderedListWithOrder: 'orderedList',
|
88
|
-
panel: 'panelLegacy',
|
89
|
-
multiBodiedExtension: 'multiBodiedExtensionStage0',
|
90
|
-
extensionFrame: 'extensionFrameStage0',
|
91
|
-
};
|
92
|
-
|
93
|
-
const getNewSpecName = (nodeName: string) => {
|
94
|
-
const customNodeSpecName = newSpecNameReference[nodeName];
|
95
|
-
return customNodeSpecName ? customNodeSpecName : nodeName;
|
96
|
-
};
|
97
|
-
|
98
|
-
const oldSpecReferences = {
|
99
|
-
blockCard,
|
100
|
-
blockquote,
|
101
|
-
blockquoteWithList,
|
102
|
-
bodiedExtension,
|
103
|
-
bulletList,
|
104
|
-
caption,
|
105
|
-
codeBlock,
|
106
|
-
confluenceJiraIssue,
|
107
|
-
confluenceUnsupportedBlock,
|
108
|
-
confluenceUnsupportedInline,
|
109
|
-
date,
|
110
|
-
decisionItem,
|
111
|
-
decisionList,
|
112
|
-
doc,
|
113
|
-
embedCard,
|
114
|
-
emoji,
|
115
|
-
expand,
|
116
|
-
extendedPanel: extendedPanel(true),
|
117
|
-
extension,
|
118
|
-
extensionFrame,
|
119
|
-
hardBreak,
|
120
|
-
heading,
|
121
|
-
image,
|
122
|
-
inlineCard,
|
123
|
-
inlineExtension,
|
124
|
-
layoutColumn,
|
125
|
-
layoutSection,
|
126
|
-
listItem,
|
127
|
-
listItemWithTask,
|
128
|
-
media,
|
129
|
-
mediaGroup,
|
130
|
-
mediaInline,
|
131
|
-
mediaSingle,
|
132
|
-
mediaSingleFull,
|
133
|
-
mediaSingleWithCaption,
|
134
|
-
mediaSingleWithWidthType,
|
135
|
-
mention,
|
136
|
-
multiBodiedExtension,
|
137
|
-
nestedExpand,
|
138
|
-
orderedList,
|
139
|
-
orderedListWithOrder,
|
140
|
-
panel: panel(true),
|
141
|
-
paragraph,
|
142
|
-
placeholder,
|
143
|
-
rule,
|
144
|
-
status,
|
145
|
-
taskItem,
|
146
|
-
taskList,
|
147
|
-
table,
|
148
|
-
tableCell,
|
149
|
-
tableHeader,
|
150
|
-
tableRow,
|
151
|
-
text,
|
152
|
-
unsupportedBlock,
|
153
|
-
unsupportedInline,
|
154
|
-
};
|
155
|
-
|
156
|
-
const failMessage = (actual, expected, not) => () =>
|
157
|
-
`${matcherHint(
|
158
|
-
`${not ? '.not' : ''}.toMatchNodeSpec`,
|
159
|
-
'received',
|
160
|
-
'expected',
|
161
|
-
)}
|
162
|
-
|
163
|
-
Expected nodeSpec${not ? ' not ' : ' '}to be equal:
|
164
|
-
|
165
|
-
Expected: ${printExpected(expected)}
|
166
|
-
Received: ${printReceived(actual)}`;
|
167
|
-
|
168
|
-
declare let expect: any;
|
169
|
-
expect.extend({
|
170
|
-
toMatchNodeSpec(actual: NodeSpec, expected: NodeSpec) {
|
171
|
-
const formattedActual = {
|
172
|
-
...actual,
|
173
|
-
...(actual.content && { content: formatContent(actual.content) }),
|
174
|
-
...(actual.marks && {
|
175
|
-
marks: filterAndSortMarks(actual.marks),
|
176
|
-
}),
|
177
|
-
};
|
178
|
-
|
179
|
-
const formattedExpected = {
|
180
|
-
...expected,
|
181
|
-
...(expected.content && {
|
182
|
-
content: formatContent(expected.content),
|
183
|
-
}),
|
184
|
-
...(expected.marks && {
|
185
|
-
marks: filterAndSortMarks(expected.marks),
|
186
|
-
}),
|
187
|
-
};
|
188
|
-
|
189
|
-
// status node used uuid for localId, which is incorrect, and not supported in DSL.
|
190
|
-
if (formattedExpected?.attrs?.localId?.default) {
|
191
|
-
formattedExpected.attrs.localId.default = '';
|
192
|
-
}
|
193
|
-
|
194
|
-
const pass = this.equals(
|
195
|
-
formattedActual,
|
196
|
-
formattedExpected,
|
197
|
-
undefined,
|
198
|
-
true, // enable strict equal
|
199
|
-
);
|
200
|
-
return {
|
201
|
-
pass,
|
202
|
-
message: failMessage(formattedActual, formattedExpected, pass),
|
203
|
-
};
|
204
|
-
},
|
205
|
-
});
|
206
|
-
|
207
|
-
function isNodeSpec(_value: MarkSpec | NodeSpec): _value is NodeSpec {
|
208
|
-
return true;
|
209
|
-
}
|
210
|
-
|
211
|
-
/**
|
212
|
-
* Custom omit function, mainly used to filter out parseDOM and toDOM from old spec
|
213
|
-
* and some special logic to filter out certain field when compare spec
|
214
|
-
* @param data
|
215
|
-
* @param keys
|
216
|
-
* @returns
|
217
|
-
*/
|
218
|
-
function omit<T extends object>(data: T, keys = []): T {
|
219
|
-
const result = { ...data };
|
220
|
-
for (const k of keys) {
|
221
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
222
|
-
delete result[k];
|
223
|
-
}
|
224
|
-
if (isNodeSpec(data)) {
|
225
|
-
// Treat inline: false same as no inline property
|
226
|
-
if (data.inline !== undefined && data.inline === false) {
|
227
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
228
|
-
delete result['inline'];
|
229
|
-
}
|
230
|
-
}
|
231
|
-
return result;
|
232
|
-
}
|
233
|
-
|
234
|
-
describe('validate PM schema', () => {
|
235
|
-
describe('marks', () => {
|
236
|
-
const { marks } = defaultSchema;
|
237
|
-
|
238
|
-
const testCases = Object.entries(marks).map(([key, value]) => {
|
239
|
-
return {
|
240
|
-
name: key,
|
241
|
-
legacyMarkSpec: value,
|
242
|
-
newMarkSpecFn: newMarkSpecs[key] as MarkSpecFactory,
|
243
|
-
skip: key.startsWith('__'),
|
244
|
-
};
|
245
|
-
});
|
246
|
-
|
247
|
-
const getTestingMethod = (skip: boolean) => {
|
248
|
-
return skip ? it.skip : it;
|
249
|
-
};
|
250
|
-
|
251
|
-
testCases.forEach(({ name, legacyMarkSpec, newMarkSpecFn, skip }) => {
|
252
|
-
const testMethod = getTestingMethod(skip);
|
253
|
-
|
254
|
-
testMethod(`validate markSpec for mark ${name}`, () => {
|
255
|
-
// check if there's any missing markSpec
|
256
|
-
expect(newMarkSpecFn).toBeDefined();
|
257
|
-
const newMarkSpec = newMarkSpecFn<any>({});
|
258
|
-
expect(
|
259
|
-
omit(newMarkSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
260
|
-
).toStrictEqual(
|
261
|
-
omit(legacyMarkSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
262
|
-
);
|
263
|
-
});
|
264
|
-
});
|
265
|
-
});
|
266
|
-
|
267
|
-
describe('nodes', () => {
|
268
|
-
const skipLists = SKIPPED_NODESPEC_TESTS;
|
269
|
-
const testCases = Object.entries(oldSpecReferences).map(([key, value]) => {
|
270
|
-
const newSpecName = getNewSpecName(key);
|
271
|
-
return {
|
272
|
-
name: key,
|
273
|
-
legacyNodeSpec: value,
|
274
|
-
newNodeSpecFn: newNodeSpecs[newSpecName] as NodeSpecFactory,
|
275
|
-
testingMethod: {
|
276
|
-
skip: skipLists.includes(key),
|
277
|
-
},
|
278
|
-
};
|
279
|
-
});
|
280
|
-
|
281
|
-
const getTestingMethod = ({ only = false, skip = false }) => {
|
282
|
-
if (skip) {
|
283
|
-
return it.skip;
|
284
|
-
}
|
285
|
-
if (only) {
|
286
|
-
return it.only;
|
287
|
-
}
|
288
|
-
return it;
|
289
|
-
};
|
290
|
-
|
291
|
-
testCases.forEach(
|
292
|
-
({ name, legacyNodeSpec, newNodeSpecFn, testingMethod }) => {
|
293
|
-
const testMethod = getTestingMethod(testingMethod);
|
294
|
-
testMethod(`validate nodeSpec for node ${name}`, () => {
|
295
|
-
// check if there's any missing nodeSpec
|
296
|
-
expect(newNodeSpecFn).toBeDefined();
|
297
|
-
const newNodeSpec = newNodeSpecFn<any>({});
|
298
|
-
expect(
|
299
|
-
omit(newNodeSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
300
|
-
).toMatchNodeSpec(
|
301
|
-
omit(legacyNodeSpec, ['parseDOM', 'toDOM', 'toDebugString']),
|
302
|
-
);
|
303
|
-
});
|
304
|
-
},
|
305
|
-
);
|
306
|
-
});
|
307
|
-
});
|