@atlaskit/adf-schema 42.0.2 → 42.2.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 +12 -0
- package/dist/cjs/next-schema/generated/nodeTypes.js +7 -25
- package/dist/cjs/next-schema/groups/blockGroup.js +1 -1
- package/dist/cjs/next-schema/nodes/layoutSection.js +9 -1
- package/dist/cjs/next-schema/nodes/panel.js +0 -3
- package/dist/cjs/schema/nodes/layout-section.js +13 -5
- package/dist/cjs/validator-schema/generated/validatorSpec.js +12 -12
- package/dist/es2019/next-schema/generated/nodeTypes.js +6 -24
- package/dist/es2019/next-schema/groups/blockGroup.js +1 -1
- package/dist/es2019/next-schema/nodes/layoutSection.js +9 -1
- package/dist/es2019/next-schema/nodes/panel.js +0 -3
- package/dist/es2019/schema/nodes/layout-section.js +16 -6
- package/dist/es2019/validator-schema/generated/validatorSpec.js +11 -11
- package/dist/esm/next-schema/generated/nodeTypes.js +6 -24
- package/dist/esm/next-schema/groups/blockGroup.js +1 -1
- package/dist/esm/next-schema/nodes/layoutSection.js +9 -1
- package/dist/esm/next-schema/nodes/panel.js +0 -3
- package/dist/esm/schema/nodes/layout-section.js +14 -6
- package/dist/esm/validator-schema/generated/validatorSpec.js +11 -11
- package/dist/json-schema/v1/stage-0.json +24 -22
- package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +2 -2
- package/dist/types/next-schema/generated/nodeTypes.d.ts +3 -14
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +1 -4
- package/dist/types/next-schema/nodes/layoutSection.d.ts +8 -0
- package/dist/types/next-schema/nodes/panel.d.ts +1 -4
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +10 -10
- package/eslint-plugin-warn-schema.js +3 -0
- package/eslint.config.js +19 -0
- package/json-schema/v1/stage-0.json +24 -22
- package/package.json +1 -1
- package/warn-schema-change.js +152 -0
- package/warn-schema-change.test.js +42 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 42.2.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 767b124: Added columnRuleStyle to layoutSection_with_single_column, and add layoutSectionAdvLayouts nodespec export
|
8
|
+
|
9
|
+
## 42.1.0
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
|
13
|
+
- b54cb82: remove unused legacy panel variant
|
14
|
+
|
3
15
|
## 42.0.2
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.unsupportedInline = exports.unsupportedBlock = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.statusStage0 = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panelWithNestedBlockquoteStage0 = exports.
|
6
|
+
exports.unsupportedInline = exports.unsupportedBlock = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.statusStage0 = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panelWithNestedBlockquoteStage0 = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtensionStage0 = exports.mentionStage0 = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemWithNestedDecisionStage0 = exports.listItemLegacy = exports.listItem = exports.layoutSectionWithSingleColumnStage0 = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCardStage0 = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrameStage0 = exports.extension = exports.expandWithoutNestedExpand = exports.expandWithNoMark = exports.expand = exports.emojiStage0 = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.dateStage0 = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockWithNoMarks = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteWithoutNestedCodeblockOrMedia = exports.blockquoteLegacy = exports.blockquote = exports.blockCard = void 0;
|
7
7
|
var _createPMSpecFactory = require("../../schema/createPMSpecFactory");
|
8
8
|
/**
|
9
9
|
* This file was automatically generated by @atlaskit/adf-schema-generator
|
@@ -563,8 +563,13 @@ var layoutSectionFull = exports.layoutSectionFull = (0, _createPMSpecFactory.cre
|
|
563
563
|
isolating: true
|
564
564
|
});
|
565
565
|
var layoutSectionWithSingleColumnStage0 = exports.layoutSectionWithSingleColumnStage0 = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
566
|
-
content: '(layoutColumn | unsupportedBlock){1,
|
566
|
+
content: '(layoutColumn | unsupportedBlock){1,5}',
|
567
567
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
568
|
+
attrs: {
|
569
|
+
columnRuleStyle: {
|
570
|
+
default: null
|
571
|
+
}
|
572
|
+
},
|
568
573
|
isolating: true
|
569
574
|
});
|
570
575
|
var listItem = exports.listItem = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
@@ -891,29 +896,6 @@ var panel = exports.panel = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
891
896
|
},
|
892
897
|
selectable: true
|
893
898
|
});
|
894
|
-
var panelLegacy = exports.panelLegacy = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
895
|
-
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
896
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
897
|
-
group: 'block',
|
898
|
-
attrs: {
|
899
|
-
panelType: {
|
900
|
-
default: 'info'
|
901
|
-
},
|
902
|
-
panelIcon: {
|
903
|
-
default: null
|
904
|
-
},
|
905
|
-
panelIconId: {
|
906
|
-
default: null
|
907
|
-
},
|
908
|
-
panelIconText: {
|
909
|
-
default: null
|
910
|
-
},
|
911
|
-
panelColor: {
|
912
|
-
default: null
|
913
|
-
}
|
914
|
-
},
|
915
|
-
selectable: true
|
916
|
-
});
|
917
899
|
var panelWithNestedBlockquoteStage0 = exports.panelWithNestedBlockquoteStage0 = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
918
900
|
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | blockquote)+',
|
919
901
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
@@ -24,7 +24,7 @@ var _rule = require("../nodes/rule");
|
|
24
24
|
var _table = require("../nodes/table");
|
25
25
|
var _task = require("../nodes/task");
|
26
26
|
var _unsupportedBlock = require("../nodes/unsupportedBlock");
|
27
|
-
var blockGroup = exports.blockGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block', [_blockCard.blockCard, _codeBlock.codeBlock, _codeBlock.codeBlock.use('with_marks'), _codeBlock.codeBlock.use('with_no_marks'), _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _task.taskList, _list.orderedList, _list.bulletList, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _blockquote.blockquote.use('without_nested_codeblock_or_media'), _decisionList.decisionList, _embedCard.embedCard, _extension.extension, _extension.extension.use('with_marks'), _heading.heading, _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _mediaGroup.mediaGroup, _rule.rule, _panel.panel, _panel.panel.use('
|
27
|
+
var blockGroup = exports.blockGroup = (0, _adfSchemaGenerator.adfNodeGroup)('block', [_blockCard.blockCard, _codeBlock.codeBlock, _codeBlock.codeBlock.use('with_marks'), _codeBlock.codeBlock.use('with_no_marks'), _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _task.taskList, _list.orderedList, _list.bulletList, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _blockquote.blockquote.use('without_nested_codeblock_or_media'), _decisionList.decisionList, _embedCard.embedCard, _extension.extension, _extension.extension.use('with_marks'), _heading.heading, _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _mediaGroup.mediaGroup, _rule.rule, _panel.panel, _panel.panel.use('with_nested_blockquote'), _table.table, _bodiedExtension.bodiedExtension, _bodiedExtension.bodiedExtension.use('with_marks'), _expand.expand, _expand.expand.use('with_no_mark'), _expand.expand.use('with_breakout_mark'), _expand.expand.use('without_nested_expand'), _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _unsupportedBlock.unsupportedBlock], {
|
28
28
|
// @DSLCompatibilityException
|
29
29
|
// Block group in PM doesn't match ADF
|
30
30
|
ignore: ['validator-spec']
|
@@ -30,8 +30,16 @@ var layoutSection = exports.layoutSection = (0, _adfSchemaGenerator.adfNode)('la
|
|
30
30
|
}
|
31
31
|
}).variant('with_single_column', {
|
32
32
|
stage0: true,
|
33
|
-
content: [(0, _adfSchemaGenerator.$range)(1,
|
33
|
+
content: [(0, _adfSchemaGenerator.$range)(1, 5, (0, _adfSchemaGenerator.$or)(_layoutColumn.layoutColumn, _unsupportedBlock.unsupportedBlock))],
|
34
34
|
ignore: [],
|
35
|
+
attrs: {
|
36
|
+
columnRuleStyle: {
|
37
|
+
type: 'enum',
|
38
|
+
values: ['solid'],
|
39
|
+
default: null,
|
40
|
+
optional: true
|
41
|
+
}
|
42
|
+
},
|
35
43
|
DANGEROUS_MANUAL_OVERRIDE: {
|
36
44
|
'validator-spec': {
|
37
45
|
'props.type': {
|
@@ -50,9 +50,6 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
|
|
50
50
|
}
|
51
51
|
},
|
52
52
|
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock))]
|
53
|
-
}).variant('legacy', {
|
54
|
-
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _unsupportedBlock.unsupportedBlock))],
|
55
|
-
ignore: ['json-schema', 'validator-spec']
|
56
53
|
}).variant('with_nested_blockquote', {
|
57
54
|
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_paragraph.paragraph.use('with_no_marks'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock.use('with_no_marks'), _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock, _blockquote.blockquote))],
|
58
55
|
noExtend: true,
|
@@ -53,18 +53,26 @@ var layoutSectionFull = exports.layoutSectionFull = (0, _nodeTypes.layoutSection
|
|
53
53
|
}
|
54
54
|
});
|
55
55
|
|
56
|
-
//
|
57
|
-
var layoutSectionWithSingleColumn = exports.layoutSectionWithSingleColumn = (0, _nodeTypes.
|
56
|
+
// stage-0 support for columnRuleStyle attribute and 1-5 columns
|
57
|
+
var layoutSectionWithSingleColumn = exports.layoutSectionWithSingleColumn = (0, _nodeTypes.layoutSectionWithSingleColumnStage0)({
|
58
58
|
parseDOM: [{
|
59
59
|
context: 'layoutSection//|layoutColumn//',
|
60
60
|
tag: 'div[data-layout-section]',
|
61
61
|
skip: true
|
62
62
|
}, {
|
63
|
-
tag: 'div[data-layout-section]'
|
63
|
+
tag: 'div[data-layout-section]',
|
64
|
+
getAttrs: function getAttrs(dom) {
|
65
|
+
var columnRuleStyle = dom.getAttribute('data-column-rule-style');
|
66
|
+
return columnRuleStyle ? {
|
67
|
+
columnRuleStyle: columnRuleStyle
|
68
|
+
} : {};
|
69
|
+
}
|
64
70
|
}],
|
65
|
-
toDOM: function toDOM() {
|
71
|
+
toDOM: function toDOM(node) {
|
72
|
+
var columnRuleStyle = node.attrs.columnRuleStyle;
|
66
73
|
var attrs = {
|
67
|
-
'data-layout-section': 'true'
|
74
|
+
'data-layout-section': 'true',
|
75
|
+
'data-column-rule-style': columnRuleStyle || undefined
|
68
76
|
};
|
69
77
|
return ['div', attrs, 0];
|
70
78
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.unsupportedInline = exports.unsupportedBlock = exports.underline = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = 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_with_nested_blockquote = exports.
|
6
|
+
exports.unsupportedInline = exports.unsupportedBlock = exports.underline = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = 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_with_nested_blockquote = 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_with_nested_decision = exports.listItem_legacy = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.image = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.extension_with_marks = exports.extensionFrame = exports.extension = exports.expand_without_nested_expand = 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.confluenceInlineComment = 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_without_nested_codeblock_or_media = exports.blockquote_legacy = exports.blockquote = exports.block_content = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
|
7
7
|
var blockCard = exports.blockCard = {
|
8
8
|
props: {
|
9
9
|
type: {
|
@@ -1345,16 +1345,6 @@ var panel = exports.panel = {
|
|
1345
1345
|
}
|
1346
1346
|
}
|
1347
1347
|
};
|
1348
|
-
var panel_legacy = exports.panel_legacy = ['panel', {
|
1349
|
-
props: {
|
1350
|
-
content: {
|
1351
|
-
type: 'array',
|
1352
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard']],
|
1353
|
-
minItems: 1,
|
1354
|
-
allowUnsupportedBlock: true
|
1355
|
-
}
|
1356
|
-
}
|
1357
|
-
}];
|
1358
1348
|
var panel_with_nested_blockquote = exports.panel_with_nested_blockquote = ['panel', {
|
1359
1349
|
props: {
|
1360
1350
|
content: {
|
@@ -1813,11 +1803,21 @@ var layoutSection_full = exports.layoutSection_full = ['layoutSection', {
|
|
1813
1803
|
}];
|
1814
1804
|
var layoutSection_with_single_column = exports.layoutSection_with_single_column = ['layoutSection', {
|
1815
1805
|
props: {
|
1806
|
+
attrs: {
|
1807
|
+
props: {
|
1808
|
+
columnRuleStyle: {
|
1809
|
+
type: 'enum',
|
1810
|
+
values: ['solid'],
|
1811
|
+
optional: true
|
1812
|
+
}
|
1813
|
+
},
|
1814
|
+
optional: true
|
1815
|
+
},
|
1816
1816
|
content: {
|
1817
1817
|
type: 'array',
|
1818
1818
|
items: ['layoutColumn'],
|
1819
1819
|
minItems: 1,
|
1820
|
-
maxItems:
|
1820
|
+
maxItems: 5,
|
1821
1821
|
allowUnsupportedBlock: true
|
1822
1822
|
},
|
1823
1823
|
type: {
|
@@ -557,8 +557,13 @@ export const layoutSectionFull = createPMNodeSpecFactory({
|
|
557
557
|
isolating: true
|
558
558
|
});
|
559
559
|
export const layoutSectionWithSingleColumnStage0 = createPMNodeSpecFactory({
|
560
|
-
content: '(layoutColumn | unsupportedBlock){1,
|
560
|
+
content: '(layoutColumn | unsupportedBlock){1,5}',
|
561
561
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
562
|
+
attrs: {
|
563
|
+
columnRuleStyle: {
|
564
|
+
default: null
|
565
|
+
}
|
566
|
+
},
|
562
567
|
isolating: true
|
563
568
|
});
|
564
569
|
export const listItem = createPMNodeSpecFactory({
|
@@ -885,29 +890,6 @@ export const panel = createPMNodeSpecFactory({
|
|
885
890
|
},
|
886
891
|
selectable: true
|
887
892
|
});
|
888
|
-
export const panelLegacy = createPMNodeSpecFactory({
|
889
|
-
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
890
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
891
|
-
group: 'block',
|
892
|
-
attrs: {
|
893
|
-
panelType: {
|
894
|
-
default: 'info'
|
895
|
-
},
|
896
|
-
panelIcon: {
|
897
|
-
default: null
|
898
|
-
},
|
899
|
-
panelIconId: {
|
900
|
-
default: null
|
901
|
-
},
|
902
|
-
panelIconText: {
|
903
|
-
default: null
|
904
|
-
},
|
905
|
-
panelColor: {
|
906
|
-
default: null
|
907
|
-
}
|
908
|
-
},
|
909
|
-
selectable: true
|
910
|
-
});
|
911
893
|
export const panelWithNestedBlockquoteStage0 = createPMNodeSpecFactory({
|
912
894
|
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | blockquote)+',
|
913
895
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
@@ -18,7 +18,7 @@ import { rule } from '../nodes/rule';
|
|
18
18
|
import { table } from '../nodes/table';
|
19
19
|
import { taskList } from '../nodes/task';
|
20
20
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
21
|
-
export const blockGroup = adfNodeGroup('block', [blockCard, codeBlock, codeBlock.use('with_marks'), codeBlock.use('with_no_marks'), mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('
|
21
|
+
export const blockGroup = adfNodeGroup('block', [blockCard, codeBlock, codeBlock.use('with_marks'), codeBlock.use('with_no_marks'), mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('with_nested_blockquote'), table, bodiedExtension, bodiedExtension.use('with_marks'), expand, expand.use('with_no_mark'), expand.use('with_breakout_mark'), expand.use('without_nested_expand'), confluenceUnsupportedBlock, unsupportedBlock], {
|
22
22
|
// @DSLCompatibilityException
|
23
23
|
// Block group in PM doesn't match ADF
|
24
24
|
ignore: ['validator-spec']
|
@@ -24,8 +24,16 @@ export const layoutSection = adfNode('layoutSection').define({
|
|
24
24
|
}
|
25
25
|
}).variant('with_single_column', {
|
26
26
|
stage0: true,
|
27
|
-
content: [$range(1,
|
27
|
+
content: [$range(1, 5, $or(layoutColumn, unsupportedBlock))],
|
28
28
|
ignore: [],
|
29
|
+
attrs: {
|
30
|
+
columnRuleStyle: {
|
31
|
+
type: 'enum',
|
32
|
+
values: ['solid'],
|
33
|
+
default: null,
|
34
|
+
optional: true
|
35
|
+
}
|
36
|
+
},
|
29
37
|
DANGEROUS_MANUAL_OVERRIDE: {
|
30
38
|
'validator-spec': {
|
31
39
|
'props.type': {
|
@@ -44,9 +44,6 @@ export const panel = adfNode('panel').define({
|
|
44
44
|
}
|
45
45
|
},
|
46
46
|
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock))]
|
47
|
-
}).variant('legacy', {
|
48
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, unsupportedBlock))],
|
49
|
-
ignore: ['json-schema', 'validator-spec']
|
50
47
|
}).variant('with_nested_blockquote', {
|
51
48
|
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock, blockquote))],
|
52
49
|
noExtend: true,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { layoutSection as layoutSectionFactory } from '../../next-schema/generated/nodeTypes';
|
1
|
+
import { layoutSection as layoutSectionFactory, layoutSectionWithSingleColumnStage0 as layoutSectionWithSingleColumnStage0Factory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
import { layoutSectionFull as layoutSectionFullFactory } from '../../next-schema/generated/nodeTypes';
|
3
3
|
|
4
4
|
/**
|
@@ -49,18 +49,28 @@ export const layoutSectionFull = layoutSectionFullFactory({
|
|
49
49
|
}
|
50
50
|
});
|
51
51
|
|
52
|
-
//
|
53
|
-
export const layoutSectionWithSingleColumn =
|
52
|
+
// stage-0 support for columnRuleStyle attribute and 1-5 columns
|
53
|
+
export const layoutSectionWithSingleColumn = layoutSectionWithSingleColumnStage0Factory({
|
54
54
|
parseDOM: [{
|
55
55
|
context: 'layoutSection//|layoutColumn//',
|
56
56
|
tag: 'div[data-layout-section]',
|
57
57
|
skip: true
|
58
58
|
}, {
|
59
|
-
tag: 'div[data-layout-section]'
|
59
|
+
tag: 'div[data-layout-section]',
|
60
|
+
getAttrs: dom => {
|
61
|
+
const columnRuleStyle = dom.getAttribute('data-column-rule-style');
|
62
|
+
return columnRuleStyle ? {
|
63
|
+
columnRuleStyle
|
64
|
+
} : {};
|
65
|
+
}
|
60
66
|
}],
|
61
|
-
toDOM() {
|
67
|
+
toDOM(node) {
|
68
|
+
const {
|
69
|
+
columnRuleStyle
|
70
|
+
} = node.attrs;
|
62
71
|
const attrs = {
|
63
|
-
'data-layout-section': 'true'
|
72
|
+
'data-layout-section': 'true',
|
73
|
+
'data-column-rule-style': columnRuleStyle || undefined
|
64
74
|
};
|
65
75
|
return ['div', attrs, 0];
|
66
76
|
}
|
@@ -1339,16 +1339,6 @@ export const panel = {
|
|
1339
1339
|
}
|
1340
1340
|
}
|
1341
1341
|
};
|
1342
|
-
export const panel_legacy = ['panel', {
|
1343
|
-
props: {
|
1344
|
-
content: {
|
1345
|
-
type: 'array',
|
1346
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard']],
|
1347
|
-
minItems: 1,
|
1348
|
-
allowUnsupportedBlock: true
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
}];
|
1352
1342
|
export const panel_with_nested_blockquote = ['panel', {
|
1353
1343
|
props: {
|
1354
1344
|
content: {
|
@@ -1807,11 +1797,21 @@ export const layoutSection_full = ['layoutSection', {
|
|
1807
1797
|
}];
|
1808
1798
|
export const layoutSection_with_single_column = ['layoutSection', {
|
1809
1799
|
props: {
|
1800
|
+
attrs: {
|
1801
|
+
props: {
|
1802
|
+
columnRuleStyle: {
|
1803
|
+
type: 'enum',
|
1804
|
+
values: ['solid'],
|
1805
|
+
optional: true
|
1806
|
+
}
|
1807
|
+
},
|
1808
|
+
optional: true
|
1809
|
+
},
|
1810
1810
|
content: {
|
1811
1811
|
type: 'array',
|
1812
1812
|
items: ['layoutColumn'],
|
1813
1813
|
minItems: 1,
|
1814
|
-
maxItems:
|
1814
|
+
maxItems: 5,
|
1815
1815
|
allowUnsupportedBlock: true
|
1816
1816
|
},
|
1817
1817
|
type: {
|
@@ -557,8 +557,13 @@ export var layoutSectionFull = createPMNodeSpecFactory({
|
|
557
557
|
isolating: true
|
558
558
|
});
|
559
559
|
export var layoutSectionWithSingleColumnStage0 = createPMNodeSpecFactory({
|
560
|
-
content: '(layoutColumn | unsupportedBlock){1,
|
560
|
+
content: '(layoutColumn | unsupportedBlock){1,5}',
|
561
561
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
562
|
+
attrs: {
|
563
|
+
columnRuleStyle: {
|
564
|
+
default: null
|
565
|
+
}
|
566
|
+
},
|
562
567
|
isolating: true
|
563
568
|
});
|
564
569
|
export var listItem = createPMNodeSpecFactory({
|
@@ -885,29 +890,6 @@ export var panel = createPMNodeSpecFactory({
|
|
885
890
|
},
|
886
891
|
selectable: true
|
887
892
|
});
|
888
|
-
export var panelLegacy = createPMNodeSpecFactory({
|
889
|
-
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
890
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
891
|
-
group: 'block',
|
892
|
-
attrs: {
|
893
|
-
panelType: {
|
894
|
-
default: 'info'
|
895
|
-
},
|
896
|
-
panelIcon: {
|
897
|
-
default: null
|
898
|
-
},
|
899
|
-
panelIconId: {
|
900
|
-
default: null
|
901
|
-
},
|
902
|
-
panelIconText: {
|
903
|
-
default: null
|
904
|
-
},
|
905
|
-
panelColor: {
|
906
|
-
default: null
|
907
|
-
}
|
908
|
-
},
|
909
|
-
selectable: true
|
910
|
-
});
|
911
893
|
export var panelWithNestedBlockquoteStage0 = createPMNodeSpecFactory({
|
912
894
|
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | blockquote)+',
|
913
895
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
@@ -18,7 +18,7 @@ import { rule } from '../nodes/rule';
|
|
18
18
|
import { table } from '../nodes/table';
|
19
19
|
import { taskList } from '../nodes/task';
|
20
20
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
21
|
-
export var blockGroup = adfNodeGroup('block', [blockCard, codeBlock, codeBlock.use('with_marks'), codeBlock.use('with_no_marks'), mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('
|
21
|
+
export var blockGroup = adfNodeGroup('block', [blockCard, codeBlock, codeBlock.use('with_marks'), codeBlock.use('with_no_marks'), mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), taskList, orderedList, bulletList, blockquote, blockquote.use('legacy'), blockquote.use('without_nested_codeblock_or_media'), decisionList, embedCard, extension, extension.use('with_marks'), heading, heading.use('with_indentation'), heading.use('with_no_marks'), heading.use('with_alignment'), mediaGroup, rule, panel, panel.use('with_nested_blockquote'), table, bodiedExtension, bodiedExtension.use('with_marks'), expand, expand.use('with_no_mark'), expand.use('with_breakout_mark'), expand.use('without_nested_expand'), confluenceUnsupportedBlock, unsupportedBlock], {
|
22
22
|
// @DSLCompatibilityException
|
23
23
|
// Block group in PM doesn't match ADF
|
24
24
|
ignore: ['validator-spec']
|
@@ -24,8 +24,16 @@ export var layoutSection = adfNode('layoutSection').define({
|
|
24
24
|
}
|
25
25
|
}).variant('with_single_column', {
|
26
26
|
stage0: true,
|
27
|
-
content: [$range(1,
|
27
|
+
content: [$range(1, 5, $or(layoutColumn, unsupportedBlock))],
|
28
28
|
ignore: [],
|
29
|
+
attrs: {
|
30
|
+
columnRuleStyle: {
|
31
|
+
type: 'enum',
|
32
|
+
values: ['solid'],
|
33
|
+
default: null,
|
34
|
+
optional: true
|
35
|
+
}
|
36
|
+
},
|
29
37
|
DANGEROUS_MANUAL_OVERRIDE: {
|
30
38
|
'validator-spec': {
|
31
39
|
'props.type': {
|
@@ -44,9 +44,6 @@ export var panel = adfNode('panel').define({
|
|
44
44
|
}
|
45
45
|
},
|
46
46
|
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock))]
|
47
|
-
}).variant('legacy', {
|
48
|
-
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, unsupportedBlock))],
|
49
|
-
ignore: ['json-schema', 'validator-spec']
|
50
47
|
}).variant('with_nested_blockquote', {
|
51
48
|
content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock, blockquote))],
|
52
49
|
noExtend: true,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { layoutSection as layoutSectionFactory } from '../../next-schema/generated/nodeTypes';
|
1
|
+
import { layoutSection as layoutSectionFactory, layoutSectionWithSingleColumnStage0 as layoutSectionWithSingleColumnStage0Factory } from '../../next-schema/generated/nodeTypes';
|
2
2
|
import { layoutSectionFull as layoutSectionFullFactory } from '../../next-schema/generated/nodeTypes';
|
3
3
|
|
4
4
|
/**
|
@@ -49,18 +49,26 @@ export var layoutSectionFull = layoutSectionFullFactory({
|
|
49
49
|
}
|
50
50
|
});
|
51
51
|
|
52
|
-
//
|
53
|
-
export var layoutSectionWithSingleColumn =
|
52
|
+
// stage-0 support for columnRuleStyle attribute and 1-5 columns
|
53
|
+
export var layoutSectionWithSingleColumn = layoutSectionWithSingleColumnStage0Factory({
|
54
54
|
parseDOM: [{
|
55
55
|
context: 'layoutSection//|layoutColumn//',
|
56
56
|
tag: 'div[data-layout-section]',
|
57
57
|
skip: true
|
58
58
|
}, {
|
59
|
-
tag: 'div[data-layout-section]'
|
59
|
+
tag: 'div[data-layout-section]',
|
60
|
+
getAttrs: function getAttrs(dom) {
|
61
|
+
var columnRuleStyle = dom.getAttribute('data-column-rule-style');
|
62
|
+
return columnRuleStyle ? {
|
63
|
+
columnRuleStyle: columnRuleStyle
|
64
|
+
} : {};
|
65
|
+
}
|
60
66
|
}],
|
61
|
-
toDOM: function toDOM() {
|
67
|
+
toDOM: function toDOM(node) {
|
68
|
+
var columnRuleStyle = node.attrs.columnRuleStyle;
|
62
69
|
var attrs = {
|
63
|
-
'data-layout-section': 'true'
|
70
|
+
'data-layout-section': 'true',
|
71
|
+
'data-column-rule-style': columnRuleStyle || undefined
|
64
72
|
};
|
65
73
|
return ['div', attrs, 0];
|
66
74
|
}
|
@@ -1339,16 +1339,6 @@ export var panel = {
|
|
1339
1339
|
}
|
1340
1340
|
}
|
1341
1341
|
};
|
1342
|
-
export var panel_legacy = ['panel', {
|
1343
|
-
props: {
|
1344
|
-
content: {
|
1345
|
-
type: 'array',
|
1346
|
-
items: [['paragraph_with_no_marks', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard']],
|
1347
|
-
minItems: 1,
|
1348
|
-
allowUnsupportedBlock: true
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
}];
|
1352
1342
|
export var panel_with_nested_blockquote = ['panel', {
|
1353
1343
|
props: {
|
1354
1344
|
content: {
|
@@ -1807,11 +1797,21 @@ export var layoutSection_full = ['layoutSection', {
|
|
1807
1797
|
}];
|
1808
1798
|
export var layoutSection_with_single_column = ['layoutSection', {
|
1809
1799
|
props: {
|
1800
|
+
attrs: {
|
1801
|
+
props: {
|
1802
|
+
columnRuleStyle: {
|
1803
|
+
type: 'enum',
|
1804
|
+
values: ['solid'],
|
1805
|
+
optional: true
|
1806
|
+
}
|
1807
|
+
},
|
1808
|
+
optional: true
|
1809
|
+
},
|
1810
1810
|
content: {
|
1811
1811
|
type: 'array',
|
1812
1812
|
items: ['layoutColumn'],
|
1813
1813
|
minItems: 1,
|
1814
|
-
maxItems:
|
1814
|
+
maxItems: 5,
|
1815
1815
|
allowUnsupportedBlock: true
|
1816
1816
|
},
|
1817
1817
|
type: {
|
@@ -2645,35 +2645,37 @@
|
|
2645
2645
|
]
|
2646
2646
|
},
|
2647
2647
|
"layoutSection_with_single_column_node": {
|
2648
|
-
"
|
2649
|
-
|
2650
|
-
|
2648
|
+
"type": "object",
|
2649
|
+
"properties": {
|
2650
|
+
"type": {
|
2651
|
+
"enum": ["layoutSection"]
|
2651
2652
|
},
|
2652
|
-
{
|
2653
|
+
"marks": {
|
2654
|
+
"type": "array",
|
2655
|
+
"items": {
|
2656
|
+
"$ref": "#/definitions/breakout_mark"
|
2657
|
+
}
|
2658
|
+
},
|
2659
|
+
"attrs": {
|
2653
2660
|
"type": "object",
|
2654
2661
|
"properties": {
|
2655
|
-
"
|
2656
|
-
"
|
2657
|
-
"items": {
|
2658
|
-
"$ref": "#/definitions/breakout_mark"
|
2659
|
-
}
|
2660
|
-
},
|
2661
|
-
"content": {
|
2662
|
-
"type": "array",
|
2663
|
-
"items": {
|
2664
|
-
"$ref": "#/definitions/layoutColumn_node"
|
2665
|
-
},
|
2666
|
-
"minItems": 1,
|
2667
|
-
"maxItems": 3
|
2668
|
-
},
|
2669
|
-
"type": {
|
2670
|
-
"enum": ["layoutSection"]
|
2662
|
+
"columnRuleStyle": {
|
2663
|
+
"enum": ["solid"]
|
2671
2664
|
}
|
2672
2665
|
},
|
2673
|
-
"required": ["type", "content"],
|
2674
2666
|
"additionalProperties": false
|
2667
|
+
},
|
2668
|
+
"content": {
|
2669
|
+
"type": "array",
|
2670
|
+
"items": {
|
2671
|
+
"$ref": "#/definitions/layoutColumn_node"
|
2672
|
+
},
|
2673
|
+
"minItems": 1,
|
2674
|
+
"maxItems": 5
|
2675
2675
|
}
|
2676
|
-
|
2676
|
+
},
|
2677
|
+
"additionalProperties": false,
|
2678
|
+
"required": ["type", "content"]
|
2677
2679
|
},
|
2678
2680
|
"extensionFrame_node": {
|
2679
2681
|
"type": "object",
|
@@ -3,8 +3,8 @@
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
|
4
4
|
* and run "yarn workspace @atlaskit/adf-schema build:schema:all" to regenerate this file.
|
5
5
|
*/
|
6
|
-
import type { BlockCardDefinition, BlockquoteDefinition, BlockquoteLegacyDefinition, BlockquoteWithoutNestedCodeblockOrMediaDefinition, BodiedExtensionDefinition, BodiedExtensionWithMarksDefinition, BulletListDefinition, CodeBlockDefinition, CodeBlockWithNoMarksDefinition, ConfluenceJiraIssueDefinition, ConfluenceUnsupportedBlockDefinition, ConfluenceUnsupportedInlineDefinition, DateDefinition, DateStage0Definition, DecisionListDefinition, EmbedCardDefinition, EmojiDefinition, EmojiStage0Definition, ExpandDefinition, ExpandWithNoMarkDefinition, ExpandWithoutNestedExpandDefinition, ExtensionDefinition, ExtensionWithMarksDefinition, HardBreakDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithNoMarksDefinition, ImageDefinition, InlineCardDefinition, InlineCardStage0Definition, InlineExtensionDefinition, InlineExtensionWithMarksDefinition, MediaGroupDefinition, MediaInlineDefinition, MediaSingleCaptionDefinition, MediaSingleDefinition, MediaSingleFullDefinition, MediaSingleWidthTypeDefinition, MentionDefinition, MentionStage0Definition, MultiBodiedExtensionStage0Definition, OrderedListDefinition, PanelDefinition,
|
7
|
-
export type BlockDefinition = Array<BlockCardDefinition | CodeBlockDefinition | CodeBlockWithNoMarksDefinition | MediaSingleDefinition | MediaSingleCaptionDefinition | MediaSingleFullDefinition | MediaSingleWidthTypeDefinition | ParagraphDefinition | ParagraphWithAlignmentDefinition | ParagraphWithIndentationDefinition | ParagraphWithNoMarksDefinition | TaskListDefinition | OrderedListDefinition | BulletListDefinition | BlockquoteDefinition | BlockquoteLegacyDefinition | BlockquoteWithoutNestedCodeblockOrMediaDefinition | DecisionListDefinition | EmbedCardDefinition | ExtensionDefinition | ExtensionWithMarksDefinition | HeadingDefinition | HeadingWithIndentationDefinition | HeadingWithNoMarksDefinition | HeadingWithAlignmentDefinition | MediaGroupDefinition | RuleDefinition | PanelDefinition |
|
6
|
+
import type { BlockCardDefinition, BlockquoteDefinition, BlockquoteLegacyDefinition, BlockquoteWithoutNestedCodeblockOrMediaDefinition, BodiedExtensionDefinition, BodiedExtensionWithMarksDefinition, BulletListDefinition, CodeBlockDefinition, CodeBlockWithNoMarksDefinition, ConfluenceJiraIssueDefinition, ConfluenceUnsupportedBlockDefinition, ConfluenceUnsupportedInlineDefinition, DateDefinition, DateStage0Definition, DecisionListDefinition, EmbedCardDefinition, EmojiDefinition, EmojiStage0Definition, ExpandDefinition, ExpandWithNoMarkDefinition, ExpandWithoutNestedExpandDefinition, ExtensionDefinition, ExtensionWithMarksDefinition, HardBreakDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithNoMarksDefinition, ImageDefinition, InlineCardDefinition, InlineCardStage0Definition, InlineExtensionDefinition, InlineExtensionWithMarksDefinition, MediaGroupDefinition, MediaInlineDefinition, MediaSingleCaptionDefinition, MediaSingleDefinition, MediaSingleFullDefinition, MediaSingleWidthTypeDefinition, MentionDefinition, MentionStage0Definition, MultiBodiedExtensionStage0Definition, OrderedListDefinition, PanelDefinition, PanelWithNestedBlockquoteStage0Definition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithNoMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StatusStage0Definition, TableDefinition, TaskListDefinition, TextCodeInlineDefinition, TextDefinition, TextFormattedDefinition, UnsupportedBlockDefinition, UnsupportedInlineDefinition } from './nodeTypes';
|
7
|
+
export type BlockDefinition = Array<BlockCardDefinition | CodeBlockDefinition | CodeBlockWithNoMarksDefinition | MediaSingleDefinition | MediaSingleCaptionDefinition | MediaSingleFullDefinition | MediaSingleWidthTypeDefinition | ParagraphDefinition | ParagraphWithAlignmentDefinition | ParagraphWithIndentationDefinition | ParagraphWithNoMarksDefinition | TaskListDefinition | OrderedListDefinition | BulletListDefinition | BlockquoteDefinition | BlockquoteLegacyDefinition | BlockquoteWithoutNestedCodeblockOrMediaDefinition | DecisionListDefinition | EmbedCardDefinition | ExtensionDefinition | ExtensionWithMarksDefinition | HeadingDefinition | HeadingWithIndentationDefinition | HeadingWithNoMarksDefinition | HeadingWithAlignmentDefinition | MediaGroupDefinition | RuleDefinition | PanelDefinition | PanelWithNestedBlockquoteStage0Definition | TableDefinition | BodiedExtensionDefinition | BodiedExtensionWithMarksDefinition | ExpandDefinition | ExpandWithNoMarkDefinition | ExpandWithoutNestedExpandDefinition | ConfluenceUnsupportedBlockDefinition | UnsupportedBlockDefinition>;
|
8
8
|
export type BlockRootOnlyDefinition = Array<MultiBodiedExtensionStage0Definition>;
|
9
9
|
export type InlineDefinition = Array<TextDefinition | TextFormattedDefinition | TextCodeInlineDefinition | DateDefinition | DateStage0Definition | EmojiDefinition | EmojiStage0Definition | HardBreakDefinition | InlineCardDefinition | InlineCardStage0Definition | MentionDefinition | MentionStage0Definition | PlaceholderDefinition | StatusDefinition | StatusStage0Definition | InlineExtensionDefinition | InlineExtensionWithMarksDefinition | MediaInlineDefinition | ImageDefinition | ConfluenceJiraIssueDefinition | ConfluenceUnsupportedInlineDefinition | UnsupportedInlineDefinition>;
|
10
10
|
export type NonNestableBlockContentDefinition = Array<ParagraphWithNoMarksDefinition | PanelDefinition | BlockquoteDefinition | OrderedListDefinition | BulletListDefinition | RuleDefinition | HeadingWithNoMarksDefinition | CodeBlockWithNoMarksDefinition | MediaGroupDefinition | MediaSingleCaptionDefinition | MediaSingleFullDefinition | DecisionListDefinition | TaskListDefinition | TableDefinition | BlockCardDefinition | EmbedCardDefinition | ExtensionWithMarksDefinition | UnsupportedBlockDefinition>;
|
@@ -421,6 +421,9 @@ export interface LayoutSectionWithSingleColumnStage0Definition {
|
|
421
421
|
type: 'layoutSection';
|
422
422
|
content: Array<LayoutColumnDefinition | UnsupportedBlockDefinition>;
|
423
423
|
marks: Array<BreakoutMark | UnsupportedMarkMark | UnsupportedNodeAttributeMark>;
|
424
|
+
attrs: {
|
425
|
+
columnRuleStyle?: 'solid';
|
426
|
+
};
|
424
427
|
}
|
425
428
|
export type LayoutSectionWithSingleColumnStage0Node = PMNode & LayoutSectionWithSingleColumnStage0Definition;
|
426
429
|
export declare const layoutSectionWithSingleColumnStage0: ({ parseDOM, toDOM, toDebugString }: import("../../schema/createPMSpecFactory").NodeSpecOptions<LayoutSectionWithSingleColumnStage0Node>) => import("prosemirror-model").NodeSpec;
|
@@ -659,20 +662,6 @@ export interface PanelDefinition {
|
|
659
662
|
}
|
660
663
|
export type PanelNode = PMNode & PanelDefinition;
|
661
664
|
export declare const panel: ({ parseDOM, toDOM, toDebugString }: import("../../schema/createPMSpecFactory").NodeSpecOptions<PanelNode>) => import("prosemirror-model").NodeSpec;
|
662
|
-
export interface PanelLegacyDefinition {
|
663
|
-
type: 'panel';
|
664
|
-
content: Array<BlockCardDefinition | BulletListDefinition | HeadingWithNoMarksDefinition | OrderedListDefinition | ParagraphWithNoMarksDefinition | UnsupportedBlockDefinition>;
|
665
|
-
marks: Array<UnsupportedMarkMark | UnsupportedNodeAttributeMark>;
|
666
|
-
attrs: {
|
667
|
-
panelType: 'info' | 'note' | 'tip' | 'warning' | 'error' | 'success' | 'custom';
|
668
|
-
panelIcon?: string;
|
669
|
-
panelIconId?: string;
|
670
|
-
panelIconText?: string;
|
671
|
-
panelColor?: string;
|
672
|
-
};
|
673
|
-
}
|
674
|
-
export type PanelLegacyNode = PMNode & PanelLegacyDefinition;
|
675
|
-
export declare const panelLegacy: ({ parseDOM, toDOM, toDebugString }: import("../../schema/createPMSpecFactory").NodeSpecOptions<PanelLegacyNode>) => import("prosemirror-model").NodeSpec;
|
676
665
|
export interface PanelWithNestedBlockquoteStage0Definition {
|
677
666
|
type: 'panel';
|
678
667
|
content: Array<BlockCardDefinition | BlockquoteDefinition | BulletListDefinition | CodeBlockWithNoMarksDefinition | DecisionListDefinition | HeadingWithNoMarksDefinition | MediaGroupDefinition | MediaSingleCaptionDefinition | MediaSingleFullDefinition | OrderedListDefinition | ParagraphWithNoMarksDefinition | RuleDefinition | TaskListDefinition | UnsupportedBlockDefinition>;
|
@@ -55,10 +55,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
|
|
55
55
|
} & {
|
56
56
|
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
|
57
57
|
ignore: ("json-schema" | "validator-spec")[];
|
58
|
-
}> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "
|
59
|
-
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
|
60
|
-
ignore: ("json-schema" | "validator-spec")[];
|
61
|
-
} & {
|
58
|
+
}> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_nested_blockquote"], import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFCommonNodeSpec & {
|
62
59
|
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
|
63
60
|
noExtend: true;
|
64
61
|
stage0: true;
|
@@ -2,6 +2,14 @@ export declare const layoutSection: import("@atlaskit/adf-schema-generator/dist/
|
|
2
2
|
stage0: true;
|
3
3
|
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentRangeSpec[];
|
4
4
|
ignore: any[];
|
5
|
+
attrs: {
|
6
|
+
columnRuleStyle: {
|
7
|
+
type: "enum";
|
8
|
+
values: string[];
|
9
|
+
default: any;
|
10
|
+
optional: true;
|
11
|
+
};
|
12
|
+
};
|
5
13
|
DANGEROUS_MANUAL_OVERRIDE: {
|
6
14
|
'validator-spec': {
|
7
15
|
'props.type': {
|
@@ -1,7 +1,4 @@
|
|
1
|
-
export declare const panel: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "
|
2
|
-
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
|
3
|
-
ignore: ("json-schema" | "validator-spec")[];
|
4
|
-
} & {
|
1
|
+
export declare const panel: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_nested_blockquote"], import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFCommonNodeSpec & {
|
5
2
|
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOneOrMoreSpec[];
|
6
3
|
noExtend: true;
|
7
4
|
stage0: true;
|
@@ -1358,16 +1358,6 @@ export declare const panel: {
|
|
1358
1358
|
};
|
1359
1359
|
};
|
1360
1360
|
};
|
1361
|
-
export declare const panel_legacy: (string | {
|
1362
|
-
props: {
|
1363
|
-
content: {
|
1364
|
-
type: string;
|
1365
|
-
items: string[][];
|
1366
|
-
minItems: number;
|
1367
|
-
allowUnsupportedBlock: boolean;
|
1368
|
-
};
|
1369
|
-
};
|
1370
|
-
})[];
|
1371
1361
|
export declare const panel_with_nested_blockquote: (string | {
|
1372
1362
|
props: {
|
1373
1363
|
content: {
|
@@ -1826,6 +1816,16 @@ export declare const layoutSection_full: (string | {
|
|
1826
1816
|
})[];
|
1827
1817
|
export declare const layoutSection_with_single_column: (string | {
|
1828
1818
|
props: {
|
1819
|
+
attrs: {
|
1820
|
+
props: {
|
1821
|
+
columnRuleStyle: {
|
1822
|
+
type: string;
|
1823
|
+
values: string[];
|
1824
|
+
optional: boolean;
|
1825
|
+
};
|
1826
|
+
};
|
1827
|
+
optional: boolean;
|
1828
|
+
};
|
1829
1829
|
content: {
|
1830
1830
|
type: string;
|
1831
1831
|
items: string[];
|
package/eslint.config.js
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
// Import the ESLint plugin locally
|
4
|
+
const warnSchemaEslintPlugin = require('./eslint-plugin-warn-schema');
|
5
|
+
const tsParser = require('@typescript-eslint/parser');
|
6
|
+
|
7
|
+
module.exports = [
|
8
|
+
{
|
9
|
+
files: ['**/*.ts'],
|
10
|
+
languageOptions: {
|
11
|
+
parser: tsParser,
|
12
|
+
},
|
13
|
+
// Using the eslint-plugin-example plugin defined locally
|
14
|
+
plugins: { warnSchemaPlugin: warnSchemaEslintPlugin },
|
15
|
+
rules: {
|
16
|
+
'warnSchemaPlugin/warn-schema-change': 'warn',
|
17
|
+
},
|
18
|
+
},
|
19
|
+
];
|
@@ -2645,35 +2645,37 @@
|
|
2645
2645
|
]
|
2646
2646
|
},
|
2647
2647
|
"layoutSection_with_single_column_node": {
|
2648
|
-
"
|
2649
|
-
|
2650
|
-
|
2648
|
+
"type": "object",
|
2649
|
+
"properties": {
|
2650
|
+
"type": {
|
2651
|
+
"enum": ["layoutSection"]
|
2651
2652
|
},
|
2652
|
-
{
|
2653
|
+
"marks": {
|
2654
|
+
"type": "array",
|
2655
|
+
"items": {
|
2656
|
+
"$ref": "#/definitions/breakout_mark"
|
2657
|
+
}
|
2658
|
+
},
|
2659
|
+
"attrs": {
|
2653
2660
|
"type": "object",
|
2654
2661
|
"properties": {
|
2655
|
-
"
|
2656
|
-
"
|
2657
|
-
"items": {
|
2658
|
-
"$ref": "#/definitions/breakout_mark"
|
2659
|
-
}
|
2660
|
-
},
|
2661
|
-
"content": {
|
2662
|
-
"type": "array",
|
2663
|
-
"items": {
|
2664
|
-
"$ref": "#/definitions/layoutColumn_node"
|
2665
|
-
},
|
2666
|
-
"minItems": 1,
|
2667
|
-
"maxItems": 3
|
2668
|
-
},
|
2669
|
-
"type": {
|
2670
|
-
"enum": ["layoutSection"]
|
2662
|
+
"columnRuleStyle": {
|
2663
|
+
"enum": ["solid"]
|
2671
2664
|
}
|
2672
2665
|
},
|
2673
|
-
"required": ["type", "content"],
|
2674
2666
|
"additionalProperties": false
|
2667
|
+
},
|
2668
|
+
"content": {
|
2669
|
+
"type": "array",
|
2670
|
+
"items": {
|
2671
|
+
"$ref": "#/definitions/layoutColumn_node"
|
2672
|
+
},
|
2673
|
+
"minItems": 1,
|
2674
|
+
"maxItems": 5
|
2675
2675
|
}
|
2676
|
-
|
2676
|
+
},
|
2677
|
+
"additionalProperties": false,
|
2678
|
+
"required": ["type", "content"]
|
2677
2679
|
},
|
2678
2680
|
"extensionFrame_node": {
|
2679
2681
|
"type": "object",
|
package/package.json
CHANGED
@@ -0,0 +1,152 @@
|
|
1
|
+
module.exports = {
|
2
|
+
meta: {
|
3
|
+
type: 'suggestion',
|
4
|
+
docs: {
|
5
|
+
description:
|
6
|
+
'Warn that changes to next-schema or schema should be reflected in the other.',
|
7
|
+
},
|
8
|
+
schema: [],
|
9
|
+
},
|
10
|
+
create(context) {
|
11
|
+
const filename = context.filename;
|
12
|
+
const nextSchemaFilesPattern =
|
13
|
+
/.*\/adf-schema\/packages\/adf-schema\/src\/next-schema\/.*/;
|
14
|
+
const schemaFilesPattern =
|
15
|
+
/.*\/adf-schema\/packages\/adf-schema\/src\/schema\/.*/;
|
16
|
+
|
17
|
+
const isInSchemaOrNextSchema =
|
18
|
+
filename.match(nextSchemaFilesPattern) ||
|
19
|
+
filename.match(schemaFilesPattern);
|
20
|
+
|
21
|
+
const findDefine = (node) => {
|
22
|
+
const callExpression = node;
|
23
|
+
const memberExpression = callExpression.callee;
|
24
|
+
const property = memberExpression.property;
|
25
|
+
if (
|
26
|
+
property &&
|
27
|
+
property?.type === 'Identifier' &&
|
28
|
+
property?.name === 'define'
|
29
|
+
) {
|
30
|
+
return callExpression;
|
31
|
+
}
|
32
|
+
if (
|
33
|
+
memberExpression &&
|
34
|
+
memberExpression?.object?.type === 'CallExpression'
|
35
|
+
) {
|
36
|
+
return findDefine(memberExpression.object);
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
const reportInSchema = (objectExpression) => {
|
41
|
+
if (!objectExpression) {
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
|
45
|
+
const parseDOMProp = objectExpression?.properties?.find(
|
46
|
+
(p) => p?.key?.type === 'Identifier' && p?.key?.name === 'parseDOM',
|
47
|
+
);
|
48
|
+
|
49
|
+
const toDOMProp = objectExpression?.properties?.find(
|
50
|
+
(p) => p?.key?.type === 'Identifier' && p?.key?.name === 'toDOM',
|
51
|
+
);
|
52
|
+
|
53
|
+
if (parseDOMProp) {
|
54
|
+
context.report({
|
55
|
+
node: parseDOMProp.key,
|
56
|
+
message:
|
57
|
+
'Changes to next-schema or schema should be reflected in the other.',
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
if (toDOMProp) {
|
62
|
+
context.report({
|
63
|
+
node: toDOMProp.key,
|
64
|
+
message:
|
65
|
+
'Changes to next-schema or schema should be reflected in the other.',
|
66
|
+
});
|
67
|
+
}
|
68
|
+
};
|
69
|
+
|
70
|
+
const reportInNextSchema = (defineCallExpression) => {
|
71
|
+
const defineArgs = defineCallExpression.arguments.find((p) => {
|
72
|
+
return p.type === 'ObjectExpression';
|
73
|
+
});
|
74
|
+
const attrsProp = defineArgs?.properties?.find(
|
75
|
+
(p) => p.key.type === 'Identifier' && p.key.name === 'attrs',
|
76
|
+
);
|
77
|
+
if (attrsProp) {
|
78
|
+
context.report({
|
79
|
+
node: attrsProp.key,
|
80
|
+
message:
|
81
|
+
'Changes to next-schema or schema should be reflected in the other.',
|
82
|
+
});
|
83
|
+
}
|
84
|
+
};
|
85
|
+
|
86
|
+
return {
|
87
|
+
// packages/adf-schema/src/schema/nodes/unknown-block.ts
|
88
|
+
ExportDefaultDeclaration: function (node) {
|
89
|
+
if (!isInSchemaOrNextSchema) {
|
90
|
+
return;
|
91
|
+
}
|
92
|
+
if (node?.declaration?.expression?.type === 'ObjectExpression') {
|
93
|
+
const objectExpression = node.declaration.expression;
|
94
|
+
reportInSchema(objectExpression);
|
95
|
+
}
|
96
|
+
},
|
97
|
+
ExpressionStatement(node) {
|
98
|
+
if (!isInSchemaOrNextSchema) {
|
99
|
+
return;
|
100
|
+
}
|
101
|
+
if (node.expression.type === 'CallExpression') {
|
102
|
+
const defineCallExpression = findDefine(node.expression);
|
103
|
+
|
104
|
+
if (defineCallExpression) {
|
105
|
+
reportInNextSchema(defineCallExpression);
|
106
|
+
}
|
107
|
+
}
|
108
|
+
},
|
109
|
+
ReturnStatement: function (node) {
|
110
|
+
if (!isInSchemaOrNextSchema) {
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
if (node?.argument && node?.argument?.type === 'CallExpression') {
|
114
|
+
const callExpression = node.argument;
|
115
|
+
const args = callExpression.arguments;
|
116
|
+
const objectExpression = args.find(
|
117
|
+
(a) => a?.type === 'ObjectExpression',
|
118
|
+
);
|
119
|
+
if (objectExpression) {
|
120
|
+
reportInSchema(objectExpression);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
},
|
124
|
+
VariableDeclarator(node) {
|
125
|
+
if (!isInSchemaOrNextSchema) {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
if (node.init && node.init.type === 'ObjectExpression') {
|
129
|
+
const objExpression = node.init;
|
130
|
+
reportInSchema(objExpression);
|
131
|
+
}
|
132
|
+
if (node.init && node.init.type === 'CallExpression') {
|
133
|
+
const callExpression = node.init;
|
134
|
+
|
135
|
+
const arg = callExpression.arguments.find((a) => {
|
136
|
+
return a.type === 'ObjectExpression';
|
137
|
+
});
|
138
|
+
|
139
|
+
if (arg) {
|
140
|
+
reportInSchema(arg);
|
141
|
+
}
|
142
|
+
|
143
|
+
const define = findDefine(callExpression);
|
144
|
+
|
145
|
+
if (define) {
|
146
|
+
reportInNextSchema(define);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
},
|
150
|
+
};
|
151
|
+
},
|
152
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
const { RuleTester } = require('eslint');
|
2
|
+
const tsParser = require('@typescript-eslint/parser');
|
3
|
+
const warnSchemaChangeRule = require('./warn-schema-change');
|
4
|
+
|
5
|
+
const ruleTester = new RuleTester({
|
6
|
+
parserOptions: { ecmaVersion: 2015 },
|
7
|
+
});
|
8
|
+
|
9
|
+
// Throws error if the tests in ruleTester.run() do not pass
|
10
|
+
ruleTester.run(
|
11
|
+
'warn-schema-change', // rule name
|
12
|
+
warnSchemaChangeRule, // rule code
|
13
|
+
{
|
14
|
+
// checks
|
15
|
+
// 'valid' checks cases that should pass
|
16
|
+
valid: [
|
17
|
+
{
|
18
|
+
code: 'const codeBlock = codeBlockFactory({noDOM: []})',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
code: "const codeBlock = adfNode('codeBlock').define({noAttrs: {}})",
|
22
|
+
},
|
23
|
+
],
|
24
|
+
// 'invalid' checks cases that should not pass
|
25
|
+
invalid: [
|
26
|
+
{
|
27
|
+
code: 'const codeBlock = codeBlockFactory({parseDOM: [],toDOM: []})',
|
28
|
+
errors: 2
|
29
|
+
},
|
30
|
+
{
|
31
|
+
code: "const codeBlock = adfNode('codeBlock').define({attrs: {}})",
|
32
|
+
errors: 1
|
33
|
+
},
|
34
|
+
{
|
35
|
+
code: "const codeBlock = adfNode('codeBlock').define({attrs: {}}).variant('with_marks', {})",
|
36
|
+
errors: 1
|
37
|
+
},
|
38
|
+
],
|
39
|
+
},
|
40
|
+
);
|
41
|
+
|
42
|
+
console.log('All tests passed!');
|