@atlaskit/adf-schema 44.7.0 → 45.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/next-schema/full-schema.adf.js +2 -2
- package/dist/cjs/next-schema/generated/nodeTypes.js +4 -4
- package/dist/cjs/next-schema/groups/blockContentGroup.js +2 -2
- package/dist/cjs/next-schema/groups/blockGroup.js +2 -2
- package/dist/cjs/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
- package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/cjs/next-schema/nodes/blockquote.js +1 -1
- package/dist/cjs/next-schema/nodes/codeBlock.js +8 -14
- package/dist/cjs/next-schema/nodes/extensionFrame.js +1 -1
- package/dist/cjs/next-schema/nodes/list.js +2 -2
- package/dist/cjs/next-schema/nodes/nestedExpand.js +1 -1
- package/dist/cjs/next-schema/nodes/panel.js +2 -2
- package/dist/cjs/schema/nodes/code-block.js +1 -5
- package/dist/cjs/validator-schema/generated/validatorSpec.js +15 -30
- package/dist/es2019/next-schema/full-schema.adf.js +2 -2
- package/dist/es2019/next-schema/generated/nodeTypes.js +3 -3
- package/dist/es2019/next-schema/groups/blockContentGroup.js +2 -2
- package/dist/es2019/next-schema/groups/blockGroup.js +2 -2
- package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
- package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/es2019/next-schema/nodes/blockquote.js +1 -1
- package/dist/es2019/next-schema/nodes/codeBlock.js +7 -13
- package/dist/es2019/next-schema/nodes/extensionFrame.js +1 -1
- package/dist/es2019/next-schema/nodes/list.js +2 -2
- package/dist/es2019/next-schema/nodes/nestedExpand.js +1 -1
- package/dist/es2019/next-schema/nodes/panel.js +2 -2
- package/dist/es2019/schema/nodes/code-block.js +1 -5
- package/dist/es2019/validator-schema/generated/validatorSpec.js +14 -29
- package/dist/esm/next-schema/full-schema.adf.js +2 -2
- package/dist/esm/next-schema/generated/nodeTypes.js +3 -3
- package/dist/esm/next-schema/groups/blockContentGroup.js +2 -2
- package/dist/esm/next-schema/groups/blockGroup.js +2 -2
- package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
- package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/esm/next-schema/nodes/blockquote.js +1 -1
- package/dist/esm/next-schema/nodes/codeBlock.js +7 -13
- package/dist/esm/next-schema/nodes/extensionFrame.js +1 -1
- package/dist/esm/next-schema/nodes/list.js +2 -2
- package/dist/esm/next-schema/nodes/nestedExpand.js +1 -1
- package/dist/esm/next-schema/nodes/panel.js +2 -2
- package/dist/esm/schema/nodes/code-block.js +1 -5
- package/dist/esm/validator-schema/generated/validatorSpec.js +14 -29
- package/dist/json-schema/v1/full.json +73 -60
- package/dist/json-schema/v1/stage-0.json +78 -65
- package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +3 -3
- package/dist/types/next-schema/generated/nodeTypes.d.ts +20 -19
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +5 -1
- package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +5 -1
- package/dist/types/next-schema/nodes/codeBlock.d.ts +3 -16
- package/dist/types/schema/nodes/code-block.d.ts +1 -4
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +1 -16
- package/json-schema/v1/full.json +73 -60
- package/json-schema/v1/stage-0.json +78 -65
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +1 -1
@@ -29,7 +29,7 @@ export const nestedExpand = adfNode('nestedExpand').define({
|
|
29
29
|
optional: true
|
30
30
|
}
|
31
31
|
},
|
32
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock
|
32
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
|
33
33
|
DANGEROUS_MANUAL_OVERRIDE: {
|
34
34
|
'validator-spec': {
|
35
35
|
'props.attrs.optional': {
|
@@ -43,9 +43,9 @@ export const panel = adfNode('panel').define({
|
|
43
43
|
optional: true
|
44
44
|
}
|
45
45
|
},
|
46
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
46
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock))]
|
47
47
|
}).variant('with_nested_blockquote', {
|
48
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
48
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock, blockquote))],
|
49
49
|
noExtend: true,
|
50
50
|
stage0: true
|
51
51
|
});
|
@@ -1,16 +1,12 @@
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
2
2
|
import { codeBlock as codeBlockFactory } from '../../next-schema/generated/nodeTypes';
|
3
3
|
|
4
|
-
/**
|
5
|
-
* @name codeBlock_node
|
6
|
-
*/
|
7
|
-
|
8
4
|
/**
|
9
5
|
* @name codeBlock_with_no_marks_node
|
10
6
|
*/
|
11
7
|
|
12
8
|
/**
|
13
|
-
* @name
|
9
|
+
* @name codeBlock_node
|
14
10
|
*/
|
15
11
|
|
16
12
|
const getLanguageFromEditorStyle = dom => {
|
@@ -49,7 +49,7 @@ export const backgroundColor = {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
};
|
52
|
-
export const block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', '
|
52
|
+
export const block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
|
53
53
|
export const blockCard = {
|
54
54
|
props: {
|
55
55
|
type: {
|
@@ -123,7 +123,7 @@ export const blockquote = {
|
|
123
123
|
},
|
124
124
|
content: {
|
125
125
|
type: 'array',
|
126
|
-
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', '
|
126
|
+
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup']],
|
127
127
|
minItems: 1,
|
128
128
|
allowUnsupportedBlock: true
|
129
129
|
}
|
@@ -293,15 +293,10 @@ export const codeBlock = {
|
|
293
293
|
}]],
|
294
294
|
optional: true,
|
295
295
|
allowUnsupportedInline: true
|
296
|
-
},
|
297
|
-
marks: {
|
298
|
-
type: 'array',
|
299
|
-
items: [],
|
300
|
-
optional: true
|
301
296
|
}
|
302
297
|
}
|
303
298
|
};
|
304
|
-
export const
|
299
|
+
export const codeBlock_root_only = ['codeBlock', {
|
305
300
|
props: {
|
306
301
|
marks: {
|
307
302
|
type: 'array',
|
@@ -310,16 +305,6 @@ export const codeBlock_with_marks = ['codeBlock', {
|
|
310
305
|
}
|
311
306
|
}
|
312
307
|
}];
|
313
|
-
export const codeBlock_with_no_marks = ['codeBlock', {
|
314
|
-
props: {
|
315
|
-
marks: {
|
316
|
-
type: 'array',
|
317
|
-
maxItems: 0,
|
318
|
-
items: [],
|
319
|
-
optional: true
|
320
|
-
}
|
321
|
-
}
|
322
|
-
}];
|
323
308
|
export const confluenceInlineComment = {
|
324
309
|
props: {
|
325
310
|
type: {
|
@@ -432,7 +417,7 @@ export const doc = {
|
|
432
417
|
},
|
433
418
|
content: {
|
434
419
|
type: 'array',
|
435
|
-
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', '
|
420
|
+
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_with_breakout_mark']],
|
436
421
|
allowUnsupportedBlock: true
|
437
422
|
}
|
438
423
|
}
|
@@ -523,7 +508,7 @@ export const expand = {
|
|
523
508
|
},
|
524
509
|
content: {
|
525
510
|
type: 'array',
|
526
|
-
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', '
|
511
|
+
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
|
527
512
|
minItems: 1,
|
528
513
|
allowUnsupportedBlock: true
|
529
514
|
},
|
@@ -613,7 +598,7 @@ export const extensionFrame = {
|
|
613
598
|
},
|
614
599
|
content: {
|
615
600
|
type: 'array',
|
616
|
-
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', '
|
601
|
+
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_full', 'mediaSingle_caption', 'decisionList', 'taskList', 'table', 'extension_with_marks', 'bodiedExtension_with_marks', 'blockCard', 'embedCard']],
|
617
602
|
minItems: 1
|
618
603
|
},
|
619
604
|
marks: {
|
@@ -940,7 +925,7 @@ export const listItem = {
|
|
940
925
|
content: {
|
941
926
|
type: 'array',
|
942
927
|
isTupleLike: true,
|
943
|
-
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', '
|
928
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock']],
|
944
929
|
minItems: 1,
|
945
930
|
allowUnsupportedBlock: true
|
946
931
|
}
|
@@ -951,7 +936,7 @@ export const listItem_with_nested_decision = ['listItem', {
|
|
951
936
|
content: {
|
952
937
|
type: 'array',
|
953
938
|
isTupleLike: true,
|
954
|
-
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', '
|
939
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList']],
|
955
940
|
minItems: 1,
|
956
941
|
allowUnsupportedBlock: true
|
957
942
|
}
|
@@ -1274,7 +1259,7 @@ export const nestedExpand = {
|
|
1274
1259
|
};
|
1275
1260
|
export const nestedExpand_content = {
|
1276
1261
|
type: 'array',
|
1277
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', '
|
1262
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'codeBlock', 'bulletList', 'orderedList', 'taskList', 'decisionList', 'rule', 'panel', 'blockquote']],
|
1278
1263
|
minItems: 1,
|
1279
1264
|
allowUnsupportedBlock: true
|
1280
1265
|
};
|
@@ -1288,7 +1273,7 @@ export const nestedExpand_with_no_marks = ['nestedExpand', {
|
|
1288
1273
|
}
|
1289
1274
|
}
|
1290
1275
|
}];
|
1291
|
-
export const non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', '
|
1276
|
+
export const non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks'];
|
1292
1277
|
export const orderedList = {
|
1293
1278
|
props: {
|
1294
1279
|
type: {
|
@@ -1344,7 +1329,7 @@ export const panel = {
|
|
1344
1329
|
},
|
1345
1330
|
content: {
|
1346
1331
|
type: 'array',
|
1347
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', '
|
1332
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList']],
|
1348
1333
|
minItems: 1,
|
1349
1334
|
allowUnsupportedBlock: true
|
1350
1335
|
}
|
@@ -1354,7 +1339,7 @@ export const panel_with_nested_blockquote = ['panel', {
|
|
1354
1339
|
props: {
|
1355
1340
|
content: {
|
1356
1341
|
type: 'array',
|
1357
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', '
|
1342
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList', 'blockquote']],
|
1358
1343
|
minItems: 1,
|
1359
1344
|
allowUnsupportedBlock: true
|
1360
1345
|
}
|
@@ -1582,7 +1567,7 @@ export const tableCell = {
|
|
1582
1567
|
},
|
1583
1568
|
content: {
|
1584
1569
|
type: 'array',
|
1585
|
-
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', '
|
1570
|
+
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
|
1586
1571
|
minItems: 1,
|
1587
1572
|
allowUnsupportedBlock: true
|
1588
1573
|
}
|
@@ -1621,7 +1606,7 @@ export const tableHeader = {
|
|
1621
1606
|
},
|
1622
1607
|
content: {
|
1623
1608
|
type: 'array',
|
1624
|
-
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', '
|
1609
|
+
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks', 'nestedExpand']],
|
1625
1610
|
minItems: 1
|
1626
1611
|
}
|
1627
1612
|
},
|
@@ -3,12 +3,12 @@ import { blockGroup } from './groups/blockGroup';
|
|
3
3
|
import { layoutSection } from './nodes/layoutSection';
|
4
4
|
import { blockRootOnlyGroup } from './groups/blockRootOnlyGroup';
|
5
5
|
import { blockContentGroup } from './groups/blockContentGroup';
|
6
|
-
import { codeBlock } from './nodes/codeBlock';
|
7
6
|
import { expand } from './nodes/expand';
|
7
|
+
import { codeBlock } from './nodes/codeBlock';
|
8
8
|
var doc = adfNode('doc').define({
|
9
9
|
root: true,
|
10
10
|
version: 1,
|
11
|
-
content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('
|
11
|
+
content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('with_breakout_mark')))],
|
12
12
|
DANGEROUS_MANUAL_OVERRIDE: {
|
13
13
|
'validator-spec': {
|
14
14
|
'props.content.minItems': {
|
@@ -130,9 +130,9 @@ export var codeBlock = createPMNodeSpecFactory({
|
|
130
130
|
code: true,
|
131
131
|
defining: true
|
132
132
|
});
|
133
|
-
export var
|
133
|
+
export var codeBlockRootOnly = createPMNodeSpecFactory({
|
134
|
+
content: '(text | unsupportedInline)*',
|
134
135
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
135
|
-
group: 'block',
|
136
136
|
attrs: {
|
137
137
|
language: {
|
138
138
|
default: null
|
@@ -230,7 +230,7 @@ export var decisionList = createPMNodeSpecFactory({
|
|
230
230
|
defining: true
|
231
231
|
});
|
232
232
|
export var doc = createPMNodeSpecFactory({
|
233
|
-
content: '(block | layoutSection | blockRootOnly)+',
|
233
|
+
content: '(block | codeBlock | layoutSection | blockRootOnly)+',
|
234
234
|
marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation dataConsumer fragment breakout'
|
235
235
|
});
|
236
236
|
export var embedCard = createPMNodeSpecFactory({
|
@@ -32,8 +32,8 @@ import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
32
32
|
* - no base heading
|
33
33
|
* - no base expand
|
34
34
|
*/
|
35
|
-
export var blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
35
|
+
export var blockContentGroup = adfNodeGroup('block_content', [blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), paragraph.use('with_indentation'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, panel.use('with_nested_blockquote'), blockquote, blockquote.use('without_nested_codeblock_or_media'), extension.use('with_marks'), embedCard, table,
|
36
36
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
37
37
|
table.use('with_nested_table'), expand.use('without_nested_expand'), expand.use('with_no_mark'), bodiedExtension.use('with_marks'), confluenceUnsupportedBlock, unsupportedBlock], {
|
38
|
-
ignore: ['pm-spec'
|
38
|
+
ignore: ['pm-spec']
|
39
39
|
});
|
@@ -18,10 +18,10 @@ import { rule } from '../nodes/rule';
|
|
18
18
|
import { table } from '../nodes/tableNodes';
|
19
19
|
import { taskList } from '../nodes/task';
|
20
20
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
21
|
-
export var blockGroup = adfNodeGroup('block', [blockCard, codeBlock,
|
21
|
+
export var blockGroup = adfNodeGroup('block', [blockCard, codeBlock, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('with_nested_blockquote'), table,
|
22
22
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
23
23
|
table.use('with_nested_table'), bodiedExtension, bodiedExtension.use('with_marks'), expand, expand.use('with_no_mark'), expand.use('with_breakout_mark'), expand.use('without_nested_expand'), confluenceUnsupportedBlock, unsupportedBlock], {
|
24
24
|
// @DSLCompatibilityException
|
25
25
|
// Block group in PM doesn't match ADF
|
26
|
-
ignore: ['validator-spec']
|
26
|
+
ignore: ['validator-spec', 'json-schema']
|
27
27
|
});
|
@@ -18,7 +18,7 @@ import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
18
18
|
|
19
19
|
// Not an actual group, but a collection of nodes that can't be nested inside each other
|
20
20
|
// TODO: make it an actual group
|
21
|
-
export var nonNestableBlockContent = [paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock
|
21
|
+
export var nonNestableBlockContent = [paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), decisionList, taskList, table,
|
22
22
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
23
23
|
table.use('with_nested_table'), blockCard, embedCard, extension.use('with_marks'), unsupportedBlock];
|
24
24
|
|
@@ -15,7 +15,7 @@ import { paragraph } from '../nodes/paragraph';
|
|
15
15
|
import { rule } from '../nodes/rule';
|
16
16
|
import { taskList } from '../nodes/task';
|
17
17
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
18
|
-
export var tableCellContentNodes = [paragraph.use('with_no_marks'), paragraph.use('with_alignment'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), codeBlock
|
18
|
+
export var tableCellContentNodes = [paragraph.use('with_no_marks'), paragraph.use('with_alignment'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, decisionList, taskList, blockCard, embedCard, extension.use('with_marks'), nestedExpand.use('content'), nestedExpand.use('with_no_marks')];
|
19
19
|
|
20
20
|
// This is not an actual group, but a collection of nodes
|
21
21
|
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
@@ -13,7 +13,7 @@ export var blockquote = adfNode('blockquote').define({
|
|
13
13
|
// Marks don't make it into the PM node spec, as they get overridden by the marks in
|
14
14
|
// packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
|
15
15
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
16
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), orderedList, bulletList, unsupportedBlock, codeBlock
|
16
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), orderedList, bulletList, unsupportedBlock, codeBlock, mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup))]
|
17
17
|
}).variant('legacy', {
|
18
18
|
ignore: ['json-schema', 'validator-spec'],
|
19
19
|
content: [$onePlus($or(paragraph, unsupportedBlock))]
|
@@ -7,10 +7,6 @@ import { unsupportedInline } from './unsupportedInline';
|
|
7
7
|
export var codeBlock = adfNode('codeBlock').define({
|
8
8
|
code: true,
|
9
9
|
defining: true,
|
10
|
-
// Marks don't make it into the PM node spec, as they get overridden by the marks in
|
11
|
-
// packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
|
12
|
-
marks: [unsupportedMark, unsupportedNodeAttribute],
|
13
|
-
hasEmptyMarks: true,
|
14
10
|
attrs: {
|
15
11
|
language: {
|
16
12
|
type: 'string',
|
@@ -23,6 +19,7 @@ export var codeBlock = adfNode('codeBlock').define({
|
|
23
19
|
optional: true
|
24
20
|
}
|
25
21
|
},
|
22
|
+
noMarks: true,
|
26
23
|
content: [$zeroPlus($or(text, unsupportedInline))],
|
27
24
|
DANGEROUS_MANUAL_OVERRIDE: {
|
28
25
|
'validator-spec': {
|
@@ -45,13 +42,10 @@ export var codeBlock = adfNode('codeBlock').define({
|
|
45
42
|
}
|
46
43
|
}
|
47
44
|
}
|
48
|
-
})
|
45
|
+
})
|
46
|
+
// Variant used root scenario where we have breakout
|
47
|
+
.variant('root_only', {
|
49
48
|
marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
marks: [],
|
54
|
-
noMarks: true,
|
55
|
-
ignore: []
|
56
|
-
});
|
57
|
-
export var codeBlockWithNoMarks = codeBlock;
|
49
|
+
noMarks: false,
|
50
|
+
noExtend: true
|
51
|
+
});
|
@@ -30,7 +30,7 @@ export var extensionFrame = adfNode('extensionFrame').define({
|
|
30
30
|
// packages/adf-schema-generator/src/transforms/adfToPm/buildPmSpec.ts
|
31
31
|
marks: [dataConsumer, fragment, unsupportedMark, unsupportedNodeAttribute],
|
32
32
|
attrs: {},
|
33
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock
|
33
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock, mediaGroup, mediaSingle.use('full'), mediaSingle.use('caption'), decisionList, taskList, table,
|
34
34
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
35
35
|
table.use('with_nested_table'), extension.use('with_marks'), bodiedExtension.use('with_marks'), unsupportedBlock, blockCard, embedCard))],
|
36
36
|
DANGEROUS_MANUAL_OVERRIDE: {
|
@@ -14,9 +14,9 @@ var listItem = adfNode('listItem').define({
|
|
14
14
|
selectable: false,
|
15
15
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
16
16
|
contentMinItems: 1,
|
17
|
-
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
17
|
+
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock))]
|
18
18
|
}).variant('with_nested_decision', {
|
19
|
-
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
19
|
+
content: [$or(paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, decisionList), $zeroPlus($or(paragraph.use('with_no_marks'), bulletList, orderedList, taskList, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, unsupportedBlock, decisionList))],
|
20
20
|
noExtend: true,
|
21
21
|
stage0: true
|
22
22
|
});
|
@@ -29,7 +29,7 @@ export var nestedExpand = adfNode('nestedExpand').define({
|
|
29
29
|
optional: true
|
30
30
|
}
|
31
31
|
},
|
32
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock
|
32
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
|
33
33
|
DANGEROUS_MANUAL_OVERRIDE: {
|
34
34
|
'validator-spec': {
|
35
35
|
'props.attrs.optional': {
|
@@ -43,9 +43,9 @@ export var panel = adfNode('panel').define({
|
|
43
43
|
optional: true
|
44
44
|
}
|
45
45
|
},
|
46
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
46
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock))]
|
47
47
|
}).variant('with_nested_blockquote', {
|
48
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock
|
48
|
+
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock, blockquote))],
|
49
49
|
noExtend: true,
|
50
50
|
stage0: true
|
51
51
|
});
|
@@ -1,16 +1,12 @@
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
2
2
|
import { codeBlock as codeBlockFactory } from '../../next-schema/generated/nodeTypes';
|
3
3
|
|
4
|
-
/**
|
5
|
-
* @name codeBlock_node
|
6
|
-
*/
|
7
|
-
|
8
4
|
/**
|
9
5
|
* @name codeBlock_with_no_marks_node
|
10
6
|
*/
|
11
7
|
|
12
8
|
/**
|
13
|
-
* @name
|
9
|
+
* @name codeBlock_node
|
14
10
|
*/
|
15
11
|
|
16
12
|
var getLanguageFromEditorStyle = function getLanguageFromEditorStyle(dom) {
|
@@ -49,7 +49,7 @@ export var backgroundColor = {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
};
|
52
|
-
export var block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', '
|
52
|
+
export var block_content = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
|
53
53
|
export var blockCard = {
|
54
54
|
props: {
|
55
55
|
type: {
|
@@ -123,7 +123,7 @@ export var blockquote = {
|
|
123
123
|
},
|
124
124
|
content: {
|
125
125
|
type: 'array',
|
126
|
-
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', '
|
126
|
+
items: [['paragraph_with_no_marks', 'orderedList', 'bulletList', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup']],
|
127
127
|
minItems: 1,
|
128
128
|
allowUnsupportedBlock: true
|
129
129
|
}
|
@@ -293,15 +293,10 @@ export var codeBlock = {
|
|
293
293
|
}]],
|
294
294
|
optional: true,
|
295
295
|
allowUnsupportedInline: true
|
296
|
-
},
|
297
|
-
marks: {
|
298
|
-
type: 'array',
|
299
|
-
items: [],
|
300
|
-
optional: true
|
301
296
|
}
|
302
297
|
}
|
303
298
|
};
|
304
|
-
export var
|
299
|
+
export var codeBlock_root_only = ['codeBlock', {
|
305
300
|
props: {
|
306
301
|
marks: {
|
307
302
|
type: 'array',
|
@@ -310,16 +305,6 @@ export var codeBlock_with_marks = ['codeBlock', {
|
|
310
305
|
}
|
311
306
|
}
|
312
307
|
}];
|
313
|
-
export var codeBlock_with_no_marks = ['codeBlock', {
|
314
|
-
props: {
|
315
|
-
marks: {
|
316
|
-
type: 'array',
|
317
|
-
maxItems: 0,
|
318
|
-
items: [],
|
319
|
-
optional: true
|
320
|
-
}
|
321
|
-
}
|
322
|
-
}];
|
323
308
|
export var confluenceInlineComment = {
|
324
309
|
props: {
|
325
310
|
type: {
|
@@ -432,7 +417,7 @@ export var doc = {
|
|
432
417
|
},
|
433
418
|
content: {
|
434
419
|
type: 'array',
|
435
|
-
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', '
|
420
|
+
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'panel_with_nested_blockquote', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_with_breakout_mark']],
|
436
421
|
allowUnsupportedBlock: true
|
437
422
|
}
|
438
423
|
}
|
@@ -523,7 +508,7 @@ export var expand = {
|
|
523
508
|
},
|
524
509
|
content: {
|
525
510
|
type: 'array',
|
526
|
-
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', '
|
511
|
+
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
|
527
512
|
minItems: 1,
|
528
513
|
allowUnsupportedBlock: true
|
529
514
|
},
|
@@ -613,7 +598,7 @@ export var extensionFrame = {
|
|
613
598
|
},
|
614
599
|
content: {
|
615
600
|
type: 'array',
|
616
|
-
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', '
|
601
|
+
items: [['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_full', 'mediaSingle_caption', 'decisionList', 'taskList', 'table', 'extension_with_marks', 'bodiedExtension_with_marks', 'blockCard', 'embedCard']],
|
617
602
|
minItems: 1
|
618
603
|
},
|
619
604
|
marks: {
|
@@ -940,7 +925,7 @@ export var listItem = {
|
|
940
925
|
content: {
|
941
926
|
type: 'array',
|
942
927
|
isTupleLike: true,
|
943
|
-
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', '
|
928
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock']],
|
944
929
|
minItems: 1,
|
945
930
|
allowUnsupportedBlock: true
|
946
931
|
}
|
@@ -951,7 +936,7 @@ export var listItem_with_nested_decision = ['listItem', {
|
|
951
936
|
content: {
|
952
937
|
type: 'array',
|
953
938
|
isTupleLike: true,
|
954
|
-
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', '
|
939
|
+
items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList'], ['paragraph_with_no_marks', 'bulletList', 'orderedList', 'taskList', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'decisionList']],
|
955
940
|
minItems: 1,
|
956
941
|
allowUnsupportedBlock: true
|
957
942
|
}
|
@@ -1274,7 +1259,7 @@ export var nestedExpand = {
|
|
1274
1259
|
};
|
1275
1260
|
export var nestedExpand_content = {
|
1276
1261
|
type: 'array',
|
1277
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', '
|
1262
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'codeBlock', 'bulletList', 'orderedList', 'taskList', 'decisionList', 'rule', 'panel', 'blockquote']],
|
1278
1263
|
minItems: 1,
|
1279
1264
|
allowUnsupportedBlock: true
|
1280
1265
|
};
|
@@ -1288,7 +1273,7 @@ export var nestedExpand_with_no_marks = ['nestedExpand', {
|
|
1288
1273
|
}
|
1289
1274
|
}
|
1290
1275
|
}];
|
1291
|
-
export var non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', '
|
1276
|
+
export var non_nestable_block_content = ['paragraph_with_no_marks', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'codeBlock', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'decisionList', 'taskList', 'table', 'blockCard', 'embedCard', 'extension_with_marks'];
|
1292
1277
|
export var orderedList = {
|
1293
1278
|
props: {
|
1294
1279
|
type: {
|
@@ -1344,7 +1329,7 @@ export var panel = {
|
|
1344
1329
|
},
|
1345
1330
|
content: {
|
1346
1331
|
type: 'array',
|
1347
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', '
|
1332
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList']],
|
1348
1333
|
minItems: 1,
|
1349
1334
|
allowUnsupportedBlock: true
|
1350
1335
|
}
|
@@ -1354,7 +1339,7 @@ export var panel_with_nested_blockquote = ['panel', {
|
|
1354
1339
|
props: {
|
1355
1340
|
content: {
|
1356
1341
|
type: 'array',
|
1357
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', '
|
1342
|
+
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList', 'blockquote']],
|
1358
1343
|
minItems: 1,
|
1359
1344
|
allowUnsupportedBlock: true
|
1360
1345
|
}
|
@@ -1582,7 +1567,7 @@ export var tableCell = {
|
|
1582
1567
|
},
|
1583
1568
|
content: {
|
1584
1569
|
type: 'array',
|
1585
|
-
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', '
|
1570
|
+
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks']],
|
1586
1571
|
minItems: 1,
|
1587
1572
|
allowUnsupportedBlock: true
|
1588
1573
|
}
|
@@ -1621,7 +1606,7 @@ export var tableHeader = {
|
|
1621
1606
|
},
|
1622
1607
|
content: {
|
1623
1608
|
type: 'array',
|
1624
|
-
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', '
|
1609
|
+
items: [['paragraph_with_no_marks', 'paragraph_with_alignment', 'panel', 'blockquote', 'orderedList', 'bulletList', 'rule', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'codeBlock', 'mediaSingle_caption', 'mediaSingle_full', 'mediaGroup', 'decisionList', 'taskList', 'blockCard', 'embedCard', 'extension_with_marks', 'nestedExpand_with_no_marks', 'nestedExpand']],
|
1625
1610
|
minItems: 1
|
1626
1611
|
}
|
1627
1612
|
},
|