@atlaskit/adf-schema 37.1.21 → 37.1.23
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 +23 -1
- package/dist/cjs/next-schema/groups/inlineGroup.js +1 -1
- package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +32 -0
- package/dist/cjs/next-schema/nodes/bodiedExtension.js +1 -2
- package/dist/cjs/next-schema/nodes/codeBlock.js +2 -2
- package/dist/cjs/next-schema/nodes/expand.js +2 -2
- package/dist/cjs/next-schema/nodes/extension.js +1 -2
- package/dist/cjs/next-schema/nodes/layoutSection.js +2 -3
- package/dist/cjs/next-schema/nodes/mediaSingle.js +0 -1
- package/dist/cjs/next-schema/nodes/tableCell.js +2 -17
- package/dist/cjs/next-schema/nodes/tableCellContent.js +14 -0
- package/dist/cjs/next-schema/nodes/tableHeader.js +2 -16
- package/dist/cjs/next-schema/nodes/tableRow.js +2 -1
- package/dist/es2019/next-schema/generated/nodeTypes.js +22 -0
- package/dist/es2019/next-schema/groups/inlineGroup.js +1 -1
- package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +26 -0
- package/dist/es2019/next-schema/nodes/bodiedExtension.js +1 -2
- package/dist/es2019/next-schema/nodes/codeBlock.js +2 -2
- package/dist/es2019/next-schema/nodes/expand.js +2 -2
- package/dist/es2019/next-schema/nodes/extension.js +1 -2
- package/dist/es2019/next-schema/nodes/layoutSection.js +2 -3
- package/dist/es2019/next-schema/nodes/mediaSingle.js +0 -1
- package/dist/es2019/next-schema/nodes/tableCell.js +3 -18
- package/dist/es2019/next-schema/nodes/tableCellContent.js +9 -0
- package/dist/es2019/next-schema/nodes/tableHeader.js +3 -17
- package/dist/es2019/next-schema/nodes/tableRow.js +2 -1
- package/dist/esm/next-schema/generated/nodeTypes.js +22 -0
- package/dist/esm/next-schema/groups/inlineGroup.js +1 -1
- package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +26 -0
- package/dist/esm/next-schema/nodes/bodiedExtension.js +1 -2
- package/dist/esm/next-schema/nodes/codeBlock.js +2 -2
- package/dist/esm/next-schema/nodes/expand.js +2 -2
- package/dist/esm/next-schema/nodes/extension.js +1 -2
- package/dist/esm/next-schema/nodes/layoutSection.js +2 -3
- package/dist/esm/next-schema/nodes/mediaSingle.js +0 -1
- package/dist/esm/next-schema/nodes/tableCell.js +3 -18
- package/dist/esm/next-schema/nodes/tableCellContent.js +9 -0
- package/dist/esm/next-schema/nodes/tableHeader.js +3 -17
- package/dist/esm/next-schema/nodes/tableRow.js +2 -1
- package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +2 -2
- package/dist/types/next-schema/generated/nodeTypes.d.ts +79 -66
- package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +2 -0
- package/dist/types/next-schema/nodes/tableCellContent.d.ts +40 -0
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +0 -18
- package/schema-generators/__tests__/unit/__fixtures__/index.fixture.ts +0 -140
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 37.1.23
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- e0280dc: Add backwards compatability for bodied extension, code block, expand, layout section, non-nestable block content
|
8
|
+
|
9
|
+
## 37.1.22
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 16c9ef7: Make extension, inlineExtension and mediaInline backwards compatible
|
14
|
+
|
3
15
|
## 37.1.21
|
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.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panelLegacy = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtension = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemLegacy = exports.listItem = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrame = exports.extension = exports.expandWithNoMark = exports.expand = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockWithNoMarks = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteLegacy = exports.blockquote = exports.blockCard = void 0;
|
6
|
+
exports.unsupportedInline = exports.unsupportedBlock = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panelLegacy = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtension = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemLegacy = exports.listItem = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrame = exports.extension = exports.expandWithNoMark = exports.expand = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockWithNoMarks = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteLegacy = exports.blockquote = exports.blockCard = void 0;
|
7
7
|
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
|
8
8
|
/**
|
9
9
|
* This file was automatically generated by @atlaskit/adf-schema-generator
|
@@ -432,6 +432,28 @@ var inlineCard = exports.inlineCard = (0, _adfSchemaGenerator.createPMNodeSpecFa
|
|
432
432
|
selectable: true,
|
433
433
|
draggable: true
|
434
434
|
});
|
435
|
+
var inlineExtension = exports.inlineExtension = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
|
436
|
+
group: 'inline',
|
437
|
+
inline: true,
|
438
|
+
attrs: {
|
439
|
+
extensionKey: {
|
440
|
+
default: ''
|
441
|
+
},
|
442
|
+
extensionType: {
|
443
|
+
default: ''
|
444
|
+
},
|
445
|
+
parameters: {
|
446
|
+
default: null
|
447
|
+
},
|
448
|
+
text: {
|
449
|
+
default: null
|
450
|
+
},
|
451
|
+
localId: {
|
452
|
+
default: null
|
453
|
+
}
|
454
|
+
},
|
455
|
+
selectable: true
|
456
|
+
});
|
435
457
|
var inlineExtensionWithMarks = exports.inlineExtensionWithMarks = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
|
436
458
|
group: 'inline',
|
437
459
|
inline: true,
|
@@ -19,7 +19,7 @@ var _unsupportedInline = require("../nodes/unsupportedInline");
|
|
19
19
|
var _confluenceUnsupportedInline = require("../nodes/confluenceUnsupportedInline");
|
20
20
|
var _image = require("../nodes/image");
|
21
21
|
var _confluenceJiraIssue = require("../nodes/confluenceJiraIssue");
|
22
|
-
var inlineGroup = exports.inlineGroup = (0, _adfSchemaGenerator.adfNodeGroup)('inline', [_text.text, _text.text.use('link_inline'), _text.text.use('formatted'), _text.text.use('code_inline'), _date.date, _emoji.emoji, _hardBreak.hardBreak, _inlineCard.inlineCard, _mention.mention, _placeholder.placeholder, _status.status, _inlineExtension.inlineExtension.use('with_marks'), _mediaInline.mediaInline, _image.image, _confluenceJiraIssue.confluenceJiraIssue, _confluenceUnsupportedInline.confluenceUnsupportedInline, _unsupportedInline.unsupportedInline], {
|
22
|
+
var inlineGroup = exports.inlineGroup = (0, _adfSchemaGenerator.adfNodeGroup)('inline', [_text.text, _text.text.use('link_inline'), _text.text.use('formatted'), _text.text.use('code_inline'), _date.date, _emoji.emoji, _hardBreak.hardBreak, _inlineCard.inlineCard, _mention.mention, _placeholder.placeholder, _status.status, _inlineExtension.inlineExtension, _inlineExtension.inlineExtension.use('with_marks'), _mediaInline.mediaInline, _image.image, _confluenceJiraIssue.confluenceJiraIssue, _confluenceUnsupportedInline.confluenceUnsupportedInline, _unsupportedInline.unsupportedInline], {
|
23
23
|
// @DSLCompatibilityException
|
24
24
|
// Inline group in PM doesn't match ADF
|
25
25
|
ignore: ['validator-spec']
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.tableHeaderContentPseudoGroup = exports.tableCellContentPseudoGroup = void 0;
|
7
|
+
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
|
8
|
+
var _blockCard = require("../nodes/blockCard");
|
9
|
+
var _blockquote = require("../nodes/blockquote");
|
10
|
+
var _codeBlock = require("../nodes/codeBlock");
|
11
|
+
var _decisionList = require("../nodes/decisionList");
|
12
|
+
var _embedCard = require("../nodes/embedCard");
|
13
|
+
var _extension = require("../nodes/extension");
|
14
|
+
var _heading = require("../nodes/heading");
|
15
|
+
var _list = require("../nodes/list");
|
16
|
+
var _mediaGroup = require("../nodes/mediaGroup");
|
17
|
+
var _mediaSingle = require("../nodes/mediaSingle");
|
18
|
+
var _nestedExpand = require("../nodes/nestedExpand");
|
19
|
+
var _panel = require("../nodes/panel");
|
20
|
+
var _paragraph = require("../nodes/paragraph");
|
21
|
+
var _rule = require("../nodes/rule");
|
22
|
+
var _task = require("../nodes/task");
|
23
|
+
var _unsupportedBlock = require("../nodes/unsupportedBlock");
|
24
|
+
var tableCellContentNodes = [_codeBlock.codeBlock.use('with_no_marks'), _blockCard.blockCard, _paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_alignment'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _extension.extension.use('with_marks'), _embedCard.embedCard, _nestedExpand.nestedExpand.use('with_no_marks')];
|
25
|
+
|
26
|
+
// This is not an actual group, but a collection of nodes
|
27
|
+
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
28
|
+
// In PM Spec, they contain different items. (tableHeader using tableHeaderContentPseudoGroup, tableCell using tableCellContentPseudoGroup)
|
29
|
+
// In JSON Schema, both tableHeader and tableCell points to tableCellContentPseudoGroup
|
30
|
+
// The differences are highighted below.
|
31
|
+
var tableCellContentPseudoGroup = exports.tableCellContentPseudoGroup = (0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, tableCellContentNodes.concat([_unsupportedBlock.unsupportedBlock])));
|
32
|
+
var tableHeaderContentPseudoGroup = exports.tableHeaderContentPseudoGroup = (0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, tableCellContentNodes.concat([_nestedExpand.nestedExpand])));
|
@@ -50,8 +50,7 @@ var bodiedExtension = exports.bodiedExtension = (0, _adfSchemaGenerator.adfNode)
|
|
50
50
|
default: null
|
51
51
|
}
|
52
52
|
},
|
53
|
-
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_nonNestableBlockContentGroup.nonNestableBlockContentGroup))]
|
54
|
-
ignore: ['json-schema']
|
53
|
+
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_nonNestableBlockContentGroup.nonNestableBlockContentGroup))]
|
55
54
|
}).variant('with_marks', {
|
56
55
|
marks: [_dataConsumer.dataConsumer, _fragment.fragment, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
57
56
|
content: [],
|
@@ -14,6 +14,7 @@ var codeBlock = exports.codeBlock = (0, _adfSchemaGenerator.adfNode)('codeBlock'
|
|
14
14
|
code: true,
|
15
15
|
defining: true,
|
16
16
|
marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
17
|
+
hasEmptyMarks: true,
|
17
18
|
attrs: {
|
18
19
|
language: {
|
19
20
|
type: 'string',
|
@@ -26,8 +27,7 @@ var codeBlock = exports.codeBlock = (0, _adfSchemaGenerator.adfNode)('codeBlock'
|
|
26
27
|
optional: true
|
27
28
|
}
|
28
29
|
},
|
29
|
-
content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_text.text, _unsupportedInline.unsupportedInline))]
|
30
|
-
ignore: ['json-schema']
|
30
|
+
content: [(0, _adfSchemaGenerator.$zeroPlus)((0, _adfSchemaGenerator.$or)(_text.text, _unsupportedInline.unsupportedInline))]
|
31
31
|
}).variant('with_marks', {
|
32
32
|
marks: [_breakout.breakout, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
33
33
|
ignore: ['pm-spec']
|
@@ -13,6 +13,7 @@ var expand = exports.expand = (0, _adfSchemaGenerator.adfNode)('expand').define(
|
|
13
13
|
isolating: true,
|
14
14
|
selectable: true,
|
15
15
|
marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
16
|
+
hasEmptyMarks: true,
|
16
17
|
attrs: {
|
17
18
|
title: {
|
18
19
|
type: 'string',
|
@@ -25,8 +26,7 @@ var expand = exports.expand = (0, _adfSchemaGenerator.adfNode)('expand').define(
|
|
25
26
|
optional: true
|
26
27
|
}
|
27
28
|
},
|
28
|
-
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_nonNestableBlockContentGroup.nonNestableBlockContentGroup))]
|
29
|
-
ignore: ['json-schema']
|
29
|
+
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_nonNestableBlockContentGroup.nonNestableBlockContentGroup))]
|
30
30
|
}).variant('with_breakout_mark', {
|
31
31
|
marks: [_breakout.breakout, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
32
32
|
content: [],
|
@@ -47,8 +47,7 @@ var extension = exports.extension = (0, _adfSchemaGenerator.adfNode)('extension'
|
|
47
47
|
optional: true,
|
48
48
|
default: null
|
49
49
|
}
|
50
|
-
}
|
51
|
-
ignore: ['json-schema']
|
50
|
+
}
|
52
51
|
}).variant('with_marks', {
|
53
52
|
marks: [_dataConsumer.dataConsumer, _fragment.fragment, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
54
53
|
ignore: []
|
@@ -13,13 +13,12 @@ var _unsupportedBlock = require("./unsupportedBlock");
|
|
13
13
|
var layoutSection = exports.layoutSection = (0, _adfSchemaGenerator.adfNode)('layoutSection').define({
|
14
14
|
isolating: true,
|
15
15
|
marks: [_breakout.breakout, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
16
|
-
content: [(0, _adfSchemaGenerator.$
|
17
|
-
ignore: ['json-schema'],
|
16
|
+
content: [(0, _adfSchemaGenerator.$or)(_layoutColumn.layoutColumn, _unsupportedBlock.unsupportedBlock)],
|
18
17
|
DANGEROUS_MANUAL_OVERRIDE: {
|
19
18
|
'pm-spec': {
|
20
19
|
content: {
|
21
20
|
value: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
22
|
-
reason: "The content expression is not correct or redundant around 'unsupportedBlock* | unsupportedBlock+'. This case is not supported by the DSL."
|
21
|
+
reason: "The content expression is not correct or redundant around 'unsupportedBlock* | unsupportedBlock+'. This case is not supported by the DSL. Also in JSON schema there is no range for the items, so theres a mismatch between JSON and PM."
|
23
22
|
}
|
24
23
|
}
|
25
24
|
}
|
@@ -14,7 +14,6 @@ var _unsupportedBlock = require("./unsupportedBlock");
|
|
14
14
|
var mediaSingle = exports.mediaSingle = (0, _adfSchemaGenerator.adfNode)('mediaSingle').define({
|
15
15
|
atom: true,
|
16
16
|
selectable: true,
|
17
|
-
ignore: ['json-schema'],
|
18
17
|
marks: [_link.link, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
19
18
|
attrs: {
|
20
19
|
anyOf: [{
|
@@ -7,22 +7,7 @@ exports.tableCell = void 0;
|
|
7
7
|
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
|
8
8
|
var _unsupportedMark = require("../marks/unsupportedMark");
|
9
9
|
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
|
10
|
-
var
|
11
|
-
var _blockquote = require("./blockquote");
|
12
|
-
var _codeBlock = require("./codeBlock");
|
13
|
-
var _decisionList = require("./decisionList");
|
14
|
-
var _embedCard = require("./embedCard");
|
15
|
-
var _extension = require("./extension");
|
16
|
-
var _heading = require("./heading");
|
17
|
-
var _list = require("./list");
|
18
|
-
var _mediaGroup = require("./mediaGroup");
|
19
|
-
var _mediaSingle = require("./mediaSingle");
|
20
|
-
var _nestedExpand = require("./nestedExpand");
|
21
|
-
var _panel = require("./panel");
|
22
|
-
var _paragraph = require("./paragraph");
|
23
|
-
var _rule = require("./rule");
|
24
|
-
var _task = require("./task");
|
25
|
-
var _unsupportedBlock = require("./unsupportedBlock");
|
10
|
+
var _tableCellContentPseudoGroup = require("../groups/tableCellContentPseudoGroup");
|
26
11
|
var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell').define({
|
27
12
|
isolating: true,
|
28
13
|
selectable: false,
|
@@ -53,5 +38,5 @@ var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell'
|
|
53
38
|
optional: true
|
54
39
|
}
|
55
40
|
},
|
56
|
-
content: [
|
41
|
+
content: [_tableCellContentPseudoGroup.tableCellContentPseudoGroup]
|
57
42
|
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.tableCellContent = void 0;
|
7
|
+
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
|
8
|
+
var _tableCellContentPseudoGroup = require("../groups/tableCellContentPseudoGroup");
|
9
|
+
// @DSLCompatibilityException This is only used by JSON schema to group the table cell content into a definition.
|
10
|
+
// This node should be deleted and the content should be replicated in the JSON schema for table header and table cell node
|
11
|
+
var tableCellContent = exports.tableCellContent = (0, _adfSchemaGenerator.adfNode)('tableCellContent').define({
|
12
|
+
ignore: ['pm-spec', 'validator-spec'],
|
13
|
+
content: [_tableCellContentPseudoGroup.tableCellContentPseudoGroup]
|
14
|
+
});
|
@@ -5,23 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.tableHeader = void 0;
|
7
7
|
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
|
8
|
+
var _tableCellContentPseudoGroup = require("../groups/tableCellContentPseudoGroup");
|
8
9
|
var _unsupportedMark = require("../marks/unsupportedMark");
|
9
10
|
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
|
10
|
-
var _blockCard = require("./blockCard");
|
11
|
-
var _blockquote = require("./blockquote");
|
12
|
-
var _codeBlock = require("./codeBlock");
|
13
|
-
var _decisionList = require("./decisionList");
|
14
|
-
var _embedCard = require("./embedCard");
|
15
|
-
var _extension = require("./extension");
|
16
|
-
var _heading = require("./heading");
|
17
|
-
var _list = require("./list");
|
18
|
-
var _mediaGroup = require("./mediaGroup");
|
19
|
-
var _mediaSingle = require("./mediaSingle");
|
20
|
-
var _nestedExpand = require("./nestedExpand");
|
21
|
-
var _panel = require("./panel");
|
22
|
-
var _paragraph = require("./paragraph");
|
23
|
-
var _rule = require("./rule");
|
24
|
-
var _task = require("./task");
|
25
11
|
var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('tableHeader').define({
|
26
12
|
isolating: true,
|
27
13
|
selectable: false,
|
@@ -52,5 +38,5 @@ var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('tableH
|
|
52
38
|
optional: true
|
53
39
|
}
|
54
40
|
},
|
55
|
-
content: [
|
41
|
+
content: [_tableCellContentPseudoGroup.tableHeaderContentPseudoGroup]
|
56
42
|
});
|
@@ -9,9 +9,10 @@ var _unsupportedMark = require("../marks/unsupportedMark");
|
|
9
9
|
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
|
10
10
|
var _tableCell = require("./tableCell");
|
11
11
|
var _tableHeader = require("./tableHeader");
|
12
|
+
var _tableCellContent = require("./tableCellContent");
|
12
13
|
var tableRow = exports.tableRow = (0, _adfSchemaGenerator.adfNode)('tableRow').define({
|
13
14
|
selectable: false,
|
14
15
|
marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
15
|
-
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_tableCell.tableCell, _tableHeader.tableHeader))],
|
16
|
+
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_tableCell.tableCell, _tableHeader.tableHeader, _tableCellContent.tableCellContent))],
|
16
17
|
tableRole: 'row'
|
17
18
|
});
|
@@ -426,6 +426,28 @@ export const inlineCard = createPMNodeSpecFactory({
|
|
426
426
|
selectable: true,
|
427
427
|
draggable: true
|
428
428
|
});
|
429
|
+
export const inlineExtension = createPMNodeSpecFactory({
|
430
|
+
group: 'inline',
|
431
|
+
inline: true,
|
432
|
+
attrs: {
|
433
|
+
extensionKey: {
|
434
|
+
default: ''
|
435
|
+
},
|
436
|
+
extensionType: {
|
437
|
+
default: ''
|
438
|
+
},
|
439
|
+
parameters: {
|
440
|
+
default: null
|
441
|
+
},
|
442
|
+
text: {
|
443
|
+
default: null
|
444
|
+
},
|
445
|
+
localId: {
|
446
|
+
default: null
|
447
|
+
}
|
448
|
+
},
|
449
|
+
selectable: true
|
450
|
+
});
|
429
451
|
export const inlineExtensionWithMarks = createPMNodeSpecFactory({
|
430
452
|
group: 'inline',
|
431
453
|
inline: true,
|
@@ -13,7 +13,7 @@ import { unsupportedInline } from '../nodes/unsupportedInline';
|
|
13
13
|
import { confluenceUnsupportedInline } from '../nodes/confluenceUnsupportedInline';
|
14
14
|
import { image } from '../nodes/image';
|
15
15
|
import { confluenceJiraIssue } from '../nodes/confluenceJiraIssue';
|
16
|
-
export const inlineGroup = adfNodeGroup('inline', [text, text.use('link_inline'), text.use('formatted'), text.use('code_inline'), date, emoji, hardBreak, inlineCard, mention, placeholder, status, inlineExtension.use('with_marks'), mediaInline, image, confluenceJiraIssue, confluenceUnsupportedInline, unsupportedInline], {
|
16
|
+
export const inlineGroup = adfNodeGroup('inline', [text, text.use('link_inline'), text.use('formatted'), text.use('code_inline'), date, emoji, hardBreak, inlineCard, mention, placeholder, status, inlineExtension, inlineExtension.use('with_marks'), mediaInline, image, confluenceJiraIssue, confluenceUnsupportedInline, unsupportedInline], {
|
17
17
|
// @DSLCompatibilityException
|
18
18
|
// Inline group in PM doesn't match ADF
|
19
19
|
ignore: ['validator-spec']
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { $onePlus, $or } from '@atlaskit/adf-schema-generator';
|
2
|
+
import { blockCard } from '../nodes/blockCard';
|
3
|
+
import { blockquote } from '../nodes/blockquote';
|
4
|
+
import { codeBlock } from '../nodes/codeBlock';
|
5
|
+
import { decisionList } from '../nodes/decisionList';
|
6
|
+
import { embedCard } from '../nodes/embedCard';
|
7
|
+
import { extension } from '../nodes/extension';
|
8
|
+
import { heading } from '../nodes/heading';
|
9
|
+
import { bulletList, orderedList } from '../nodes/list';
|
10
|
+
import { mediaGroup } from '../nodes/mediaGroup';
|
11
|
+
import { mediaSingle } from '../nodes/mediaSingle';
|
12
|
+
import { nestedExpand } from '../nodes/nestedExpand';
|
13
|
+
import { panel } from '../nodes/panel';
|
14
|
+
import { paragraph } from '../nodes/paragraph';
|
15
|
+
import { rule } from '../nodes/rule';
|
16
|
+
import { taskList } from '../nodes/task';
|
17
|
+
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
18
|
+
const tableCellContentNodes = [codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, nestedExpand.use('with_no_marks')];
|
19
|
+
|
20
|
+
// This is not an actual group, but a collection of nodes
|
21
|
+
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
22
|
+
// In PM Spec, they contain different items. (tableHeader using tableHeaderContentPseudoGroup, tableCell using tableCellContentPseudoGroup)
|
23
|
+
// In JSON Schema, both tableHeader and tableCell points to tableCellContentPseudoGroup
|
24
|
+
// The differences are highighted below.
|
25
|
+
export const tableCellContentPseudoGroup = $onePlus($or(...tableCellContentNodes, unsupportedBlock));
|
26
|
+
export const tableHeaderContentPseudoGroup = $onePlus($or(...tableCellContentNodes, nestedExpand));
|
@@ -44,8 +44,7 @@ export const bodiedExtension = adfNode('bodiedExtension').define({
|
|
44
44
|
default: null
|
45
45
|
}
|
46
46
|
},
|
47
|
-
content: [$onePlus($or(nonNestableBlockContentGroup))]
|
48
|
-
ignore: ['json-schema']
|
47
|
+
content: [$onePlus($or(nonNestableBlockContentGroup))]
|
49
48
|
}).variant('with_marks', {
|
50
49
|
marks: [dataConsumer, fragment, unsupportedNodeAttribute, unsupportedMark],
|
51
50
|
content: [],
|
@@ -8,6 +8,7 @@ export const codeBlock = adfNode('codeBlock').define({
|
|
8
8
|
code: true,
|
9
9
|
defining: true,
|
10
10
|
marks: [unsupportedNodeAttribute, unsupportedMark],
|
11
|
+
hasEmptyMarks: true,
|
11
12
|
attrs: {
|
12
13
|
language: {
|
13
14
|
type: 'string',
|
@@ -20,8 +21,7 @@ export const codeBlock = adfNode('codeBlock').define({
|
|
20
21
|
optional: true
|
21
22
|
}
|
22
23
|
},
|
23
|
-
content: [$zeroPlus($or(text, unsupportedInline))]
|
24
|
-
ignore: ['json-schema']
|
24
|
+
content: [$zeroPlus($or(text, unsupportedInline))]
|
25
25
|
}).variant('with_marks', {
|
26
26
|
marks: [breakout, unsupportedNodeAttribute, unsupportedMark],
|
27
27
|
ignore: ['pm-spec']
|
@@ -7,6 +7,7 @@ export const expand = adfNode('expand').define({
|
|
7
7
|
isolating: true,
|
8
8
|
selectable: true,
|
9
9
|
marks: [unsupportedNodeAttribute, unsupportedMark],
|
10
|
+
hasEmptyMarks: true,
|
10
11
|
attrs: {
|
11
12
|
title: {
|
12
13
|
type: 'string',
|
@@ -19,8 +20,7 @@ export const expand = adfNode('expand').define({
|
|
19
20
|
optional: true
|
20
21
|
}
|
21
22
|
},
|
22
|
-
content: [$onePlus($or(nonNestableBlockContentGroup))]
|
23
|
-
ignore: ['json-schema']
|
23
|
+
content: [$onePlus($or(nonNestableBlockContentGroup))]
|
24
24
|
}).variant('with_breakout_mark', {
|
25
25
|
marks: [breakout, unsupportedNodeAttribute, unsupportedMark],
|
26
26
|
content: [],
|
@@ -7,13 +7,12 @@ import { unsupportedBlock } from './unsupportedBlock';
|
|
7
7
|
export const layoutSection = adfNode('layoutSection').define({
|
8
8
|
isolating: true,
|
9
9
|
marks: [breakout, unsupportedNodeAttribute, unsupportedMark],
|
10
|
-
content: [$
|
11
|
-
ignore: ['json-schema'],
|
10
|
+
content: [$or(layoutColumn, unsupportedBlock)],
|
12
11
|
DANGEROUS_MANUAL_OVERRIDE: {
|
13
12
|
'pm-spec': {
|
14
13
|
content: {
|
15
14
|
value: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
16
|
-
reason: `The content expression is not correct or redundant around 'unsupportedBlock* | unsupportedBlock+'. This case is not supported by the DSL.`
|
15
|
+
reason: `The content expression is not correct or redundant around 'unsupportedBlock* | unsupportedBlock+'. This case is not supported by the DSL. Also in JSON schema there is no range for the items, so theres a mismatch between JSON and PM.`
|
17
16
|
}
|
18
17
|
}
|
19
18
|
}
|
@@ -1,22 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { adfNode } from '@atlaskit/adf-schema-generator';
|
2
2
|
import { unsupportedMark } from '../marks/unsupportedMark';
|
3
3
|
import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
|
4
|
-
import {
|
5
|
-
import { blockquote } from './blockquote';
|
6
|
-
import { codeBlock } from './codeBlock';
|
7
|
-
import { decisionList } from './decisionList';
|
8
|
-
import { embedCard } from './embedCard';
|
9
|
-
import { extension } from './extension';
|
10
|
-
import { heading } from './heading';
|
11
|
-
import { bulletList, orderedList } from './list';
|
12
|
-
import { mediaGroup } from './mediaGroup';
|
13
|
-
import { mediaSingle } from './mediaSingle';
|
14
|
-
import { nestedExpand } from './nestedExpand';
|
15
|
-
import { panel } from './panel';
|
16
|
-
import { paragraph } from './paragraph';
|
17
|
-
import { rule } from './rule';
|
18
|
-
import { taskList } from './task';
|
19
|
-
import { unsupportedBlock } from './unsupportedBlock';
|
4
|
+
import { tableCellContentPseudoGroup } from '../groups/tableCellContentPseudoGroup';
|
20
5
|
export const tableCell = adfNode('tableCell').define({
|
21
6
|
isolating: true,
|
22
7
|
selectable: false,
|
@@ -47,5 +32,5 @@ export const tableCell = adfNode('tableCell').define({
|
|
47
32
|
optional: true
|
48
33
|
}
|
49
34
|
},
|
50
|
-
content: [
|
35
|
+
content: [tableCellContentPseudoGroup]
|
51
36
|
});
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { adfNode } from '@atlaskit/adf-schema-generator';
|
2
|
+
import { tableCellContentPseudoGroup } from '../groups/tableCellContentPseudoGroup';
|
3
|
+
|
4
|
+
// @DSLCompatibilityException This is only used by JSON schema to group the table cell content into a definition.
|
5
|
+
// This node should be deleted and the content should be replicated in the JSON schema for table header and table cell node
|
6
|
+
export const tableCellContent = adfNode('tableCellContent').define({
|
7
|
+
ignore: ['pm-spec', 'validator-spec'],
|
8
|
+
content: [tableCellContentPseudoGroup]
|
9
|
+
});
|
@@ -1,21 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { adfNode } from '@atlaskit/adf-schema-generator';
|
2
|
+
import { tableHeaderContentPseudoGroup } from '../groups/tableCellContentPseudoGroup';
|
2
3
|
import { unsupportedMark } from '../marks/unsupportedMark';
|
3
4
|
import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
|
4
|
-
import { blockCard } from './blockCard';
|
5
|
-
import { blockquote } from './blockquote';
|
6
|
-
import { codeBlock } from './codeBlock';
|
7
|
-
import { decisionList } from './decisionList';
|
8
|
-
import { embedCard } from './embedCard';
|
9
|
-
import { extension } from './extension';
|
10
|
-
import { heading } from './heading';
|
11
|
-
import { bulletList, orderedList } from './list';
|
12
|
-
import { mediaGroup } from './mediaGroup';
|
13
|
-
import { mediaSingle } from './mediaSingle';
|
14
|
-
import { nestedExpand } from './nestedExpand';
|
15
|
-
import { panel } from './panel';
|
16
|
-
import { paragraph } from './paragraph';
|
17
|
-
import { rule } from './rule';
|
18
|
-
import { taskList } from './task';
|
19
5
|
export const tableHeader = adfNode('tableHeader').define({
|
20
6
|
isolating: true,
|
21
7
|
selectable: false,
|
@@ -46,5 +32,5 @@ export const tableHeader = adfNode('tableHeader').define({
|
|
46
32
|
optional: true
|
47
33
|
}
|
48
34
|
},
|
49
|
-
content: [
|
35
|
+
content: [tableHeaderContentPseudoGroup]
|
50
36
|
});
|
@@ -3,9 +3,10 @@ import { unsupportedMark } from '../marks/unsupportedMark';
|
|
3
3
|
import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
|
4
4
|
import { tableCell } from './tableCell';
|
5
5
|
import { tableHeader } from './tableHeader';
|
6
|
+
import { tableCellContent } from './tableCellContent';
|
6
7
|
export const tableRow = adfNode('tableRow').define({
|
7
8
|
selectable: false,
|
8
9
|
marks: [unsupportedNodeAttribute, unsupportedMark],
|
9
|
-
content: [$onePlus($or(tableCell, tableHeader))],
|
10
|
+
content: [$onePlus($or(tableCell, tableHeader, tableCellContent))],
|
10
11
|
tableRole: 'row'
|
11
12
|
});
|
@@ -426,6 +426,28 @@ export var inlineCard = createPMNodeSpecFactory({
|
|
426
426
|
selectable: true,
|
427
427
|
draggable: true
|
428
428
|
});
|
429
|
+
export var inlineExtension = createPMNodeSpecFactory({
|
430
|
+
group: 'inline',
|
431
|
+
inline: true,
|
432
|
+
attrs: {
|
433
|
+
extensionKey: {
|
434
|
+
default: ''
|
435
|
+
},
|
436
|
+
extensionType: {
|
437
|
+
default: ''
|
438
|
+
},
|
439
|
+
parameters: {
|
440
|
+
default: null
|
441
|
+
},
|
442
|
+
text: {
|
443
|
+
default: null
|
444
|
+
},
|
445
|
+
localId: {
|
446
|
+
default: null
|
447
|
+
}
|
448
|
+
},
|
449
|
+
selectable: true
|
450
|
+
});
|
429
451
|
export var inlineExtensionWithMarks = createPMNodeSpecFactory({
|
430
452
|
group: 'inline',
|
431
453
|
inline: true,
|
@@ -13,7 +13,7 @@ import { unsupportedInline } from '../nodes/unsupportedInline';
|
|
13
13
|
import { confluenceUnsupportedInline } from '../nodes/confluenceUnsupportedInline';
|
14
14
|
import { image } from '../nodes/image';
|
15
15
|
import { confluenceJiraIssue } from '../nodes/confluenceJiraIssue';
|
16
|
-
export var inlineGroup = adfNodeGroup('inline', [text, text.use('link_inline'), text.use('formatted'), text.use('code_inline'), date, emoji, hardBreak, inlineCard, mention, placeholder, status, inlineExtension.use('with_marks'), mediaInline, image, confluenceJiraIssue, confluenceUnsupportedInline, unsupportedInline], {
|
16
|
+
export var inlineGroup = adfNodeGroup('inline', [text, text.use('link_inline'), text.use('formatted'), text.use('code_inline'), date, emoji, hardBreak, inlineCard, mention, placeholder, status, inlineExtension, inlineExtension.use('with_marks'), mediaInline, image, confluenceJiraIssue, confluenceUnsupportedInline, unsupportedInline], {
|
17
17
|
// @DSLCompatibilityException
|
18
18
|
// Inline group in PM doesn't match ADF
|
19
19
|
ignore: ['validator-spec']
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { $onePlus, $or } from '@atlaskit/adf-schema-generator';
|
2
|
+
import { blockCard } from '../nodes/blockCard';
|
3
|
+
import { blockquote } from '../nodes/blockquote';
|
4
|
+
import { codeBlock } from '../nodes/codeBlock';
|
5
|
+
import { decisionList } from '../nodes/decisionList';
|
6
|
+
import { embedCard } from '../nodes/embedCard';
|
7
|
+
import { extension } from '../nodes/extension';
|
8
|
+
import { heading } from '../nodes/heading';
|
9
|
+
import { bulletList, orderedList } from '../nodes/list';
|
10
|
+
import { mediaGroup } from '../nodes/mediaGroup';
|
11
|
+
import { mediaSingle } from '../nodes/mediaSingle';
|
12
|
+
import { nestedExpand } from '../nodes/nestedExpand';
|
13
|
+
import { panel } from '../nodes/panel';
|
14
|
+
import { paragraph } from '../nodes/paragraph';
|
15
|
+
import { rule } from '../nodes/rule';
|
16
|
+
import { taskList } from '../nodes/task';
|
17
|
+
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
18
|
+
var tableCellContentNodes = [codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), paragraph.use('with_alignment'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), heading.use('with_alignment'), heading.use('with_indentation'), mediaGroup, decisionList, rule, panel, blockquote, extension.use('with_marks'), embedCard, nestedExpand.use('with_no_marks')];
|
19
|
+
|
20
|
+
// This is not an actual group, but a collection of nodes
|
21
|
+
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
22
|
+
// In PM Spec, they contain different items. (tableHeader using tableHeaderContentPseudoGroup, tableCell using tableCellContentPseudoGroup)
|
23
|
+
// In JSON Schema, both tableHeader and tableCell points to tableCellContentPseudoGroup
|
24
|
+
// The differences are highighted below.
|
25
|
+
export var tableCellContentPseudoGroup = $onePlus($or.apply(void 0, tableCellContentNodes.concat([unsupportedBlock])));
|
26
|
+
export var tableHeaderContentPseudoGroup = $onePlus($or.apply(void 0, tableCellContentNodes.concat([nestedExpand])));
|
@@ -44,8 +44,7 @@ export var bodiedExtension = adfNode('bodiedExtension').define({
|
|
44
44
|
default: null
|
45
45
|
}
|
46
46
|
},
|
47
|
-
content: [$onePlus($or(nonNestableBlockContentGroup))]
|
48
|
-
ignore: ['json-schema']
|
47
|
+
content: [$onePlus($or(nonNestableBlockContentGroup))]
|
49
48
|
}).variant('with_marks', {
|
50
49
|
marks: [dataConsumer, fragment, unsupportedNodeAttribute, unsupportedMark],
|
51
50
|
content: [],
|
@@ -8,6 +8,7 @@ export var codeBlock = adfNode('codeBlock').define({
|
|
8
8
|
code: true,
|
9
9
|
defining: true,
|
10
10
|
marks: [unsupportedNodeAttribute, unsupportedMark],
|
11
|
+
hasEmptyMarks: true,
|
11
12
|
attrs: {
|
12
13
|
language: {
|
13
14
|
type: 'string',
|
@@ -20,8 +21,7 @@ export var codeBlock = adfNode('codeBlock').define({
|
|
20
21
|
optional: true
|
21
22
|
}
|
22
23
|
},
|
23
|
-
content: [$zeroPlus($or(text, unsupportedInline))]
|
24
|
-
ignore: ['json-schema']
|
24
|
+
content: [$zeroPlus($or(text, unsupportedInline))]
|
25
25
|
}).variant('with_marks', {
|
26
26
|
marks: [breakout, unsupportedNodeAttribute, unsupportedMark],
|
27
27
|
ignore: ['pm-spec']
|