@atlaskit/adf-schema 37.1.25 → 37.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/cjs/next-schema/nodes/layoutSection.js +6 -0
- package/dist/cjs/next-schema/nodes/nestedExpand.js +2 -0
- package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/es2019/next-schema/nodes/layoutSection.js +6 -0
- package/dist/es2019/next-schema/nodes/nestedExpand.js +2 -0
- package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- package/dist/esm/next-schema/nodes/layoutSection.js +6 -0
- package/dist/esm/next-schema/nodes/nestedExpand.js +2 -0
- package/dist/types/next-schema/nodes/nestedExpand.d.ts +3 -1
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/adfToValidatorSpecValidation.unit.ts +0 -2
- package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +29 -11
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 37.1.27
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 8d8dd32: Fix exception to layoutSection node for validator spec from DSL.
|
8
|
+
|
9
|
+
## 37.1.26
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 6106a46: Unskip nestedExpand, nestedExpand_content and nestedExpand_with_no_marks
|
14
|
+
|
3
15
|
## 37.1.25
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -21,7 +21,7 @@ var _paragraph = require("../nodes/paragraph");
|
|
21
21
|
var _rule = require("../nodes/rule");
|
22
22
|
var _task = require("../nodes/task");
|
23
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')];
|
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('content'), _nestedExpand.nestedExpand.use('with_no_marks')];
|
25
25
|
|
26
26
|
// This is not an actual group, but a collection of nodes
|
27
27
|
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
@@ -20,6 +20,12 @@ var layoutSection = exports.layoutSection = (0, _adfSchemaGenerator.adfNode)('la
|
|
20
20
|
value: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
21
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."
|
22
22
|
}
|
23
|
+
},
|
24
|
+
'validator-spec': {
|
25
|
+
'props.content.allowUnsupportedBlock': {
|
26
|
+
remove: true,
|
27
|
+
reason: '@DSLCompatibilityException - mismatch for layoutSection'
|
28
|
+
}
|
23
29
|
}
|
24
30
|
}
|
25
31
|
}).variant('full', {
|
@@ -36,6 +36,8 @@ var nestedExpand = exports.nestedExpand = (0, _adfSchemaGenerator.adfNode)('nest
|
|
36
36
|
}
|
37
37
|
},
|
38
38
|
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_codeBlock.codeBlock.use('with_no_marks'), _paragraph.paragraph.use('with_no_marks'), _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _task.taskList, _list.bulletList, _list.orderedList, _heading.heading.use('with_no_marks'), _mediaGroup.mediaGroup, _decisionList.decisionList, _rule.rule, _panel.panel, _blockquote.blockquote, _unsupportedBlock.unsupportedBlock))]
|
39
|
+
}).variant('content', {
|
40
|
+
ignore: ['pm-spec', 'validator-spec']
|
39
41
|
}).variant('with_no_marks', {
|
40
42
|
marks: [],
|
41
43
|
content: [],
|
@@ -15,7 +15,7 @@ import { paragraph } from '../nodes/paragraph';
|
|
15
15
|
import { rule } from '../nodes/rule';
|
16
16
|
import { taskList } from '../nodes/task';
|
17
17
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
18
|
-
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')];
|
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('content'), nestedExpand.use('with_no_marks')];
|
19
19
|
|
20
20
|
// This is not an actual group, but a collection of nodes
|
21
21
|
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
@@ -14,6 +14,12 @@ export const layoutSection = adfNode('layoutSection').define({
|
|
14
14
|
value: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
15
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.`
|
16
16
|
}
|
17
|
+
},
|
18
|
+
'validator-spec': {
|
19
|
+
'props.content.allowUnsupportedBlock': {
|
20
|
+
remove: true,
|
21
|
+
reason: '@DSLCompatibilityException - mismatch for layoutSection'
|
22
|
+
}
|
17
23
|
}
|
18
24
|
}
|
19
25
|
}).variant('full', {
|
@@ -30,6 +30,8 @@ export const nestedExpand = adfNode('nestedExpand').define({
|
|
30
30
|
}
|
31
31
|
},
|
32
32
|
content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, unsupportedBlock))]
|
33
|
+
}).variant('content', {
|
34
|
+
ignore: ['pm-spec', 'validator-spec']
|
33
35
|
}).variant('with_no_marks', {
|
34
36
|
marks: [],
|
35
37
|
content: [],
|
@@ -15,7 +15,7 @@ import { paragraph } from '../nodes/paragraph';
|
|
15
15
|
import { rule } from '../nodes/rule';
|
16
16
|
import { taskList } from '../nodes/task';
|
17
17
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
18
|
-
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')];
|
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('content'), nestedExpand.use('with_no_marks')];
|
19
19
|
|
20
20
|
// This is not an actual group, but a collection of nodes
|
21
21
|
// @DSLCompatibilityException JSON Schema and PM Spec are not in sync. We need to fix it
|
@@ -14,6 +14,12 @@ export var layoutSection = adfNode('layoutSection').define({
|
|
14
14
|
value: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
15
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."
|
16
16
|
}
|
17
|
+
},
|
18
|
+
'validator-spec': {
|
19
|
+
'props.content.allowUnsupportedBlock': {
|
20
|
+
remove: true,
|
21
|
+
reason: '@DSLCompatibilityException - mismatch for layoutSection'
|
22
|
+
}
|
17
23
|
}
|
18
24
|
}
|
19
25
|
}).variant('full', {
|
@@ -30,6 +30,8 @@ export var nestedExpand = adfNode('nestedExpand').define({
|
|
30
30
|
}
|
31
31
|
},
|
32
32
|
content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, unsupportedBlock))]
|
33
|
+
}).variant('content', {
|
34
|
+
ignore: ['pm-spec', 'validator-spec']
|
33
35
|
}).variant('with_no_marks', {
|
34
36
|
marks: [],
|
35
37
|
content: [],
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export declare const nestedExpand: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_no_marks"], {
|
1
|
+
export declare const nestedExpand: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "content", "with_no_marks"], {
|
2
2
|
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
3
3
|
root?: boolean;
|
4
4
|
atom?: boolean;
|
@@ -27,6 +27,8 @@ export declare const nestedExpand: import("@atlaskit/adf-schema-generator/dist/t
|
|
27
27
|
'pm-spec'?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").DangerousManualOverride;
|
28
28
|
'validator-spec'?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").DangerousManualOverride;
|
29
29
|
};
|
30
|
+
} & {
|
31
|
+
ignore: ("pm-spec" | "validator-spec")[];
|
30
32
|
} & {
|
31
33
|
marks: any[];
|
32
34
|
content: any[];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "37.1.
|
3
|
+
"version": "37.1.27",
|
4
4
|
"description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
|
5
5
|
"publishConfig": {
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
@@ -47,7 +47,7 @@
|
|
47
47
|
},
|
48
48
|
"devDependencies": {
|
49
49
|
"@atlassian/adf-schema-json": "^1.16.0",
|
50
|
-
"@atlaskit/adf-schema-generator": "^1.25.
|
50
|
+
"@atlaskit/adf-schema-generator": "^1.25.5",
|
51
51
|
"@atlaskit/adf-utils": "^19.2.2",
|
52
52
|
"@atlaskit/codemod-utils": "^4.2.4",
|
53
53
|
"@atlaskit/json-schema-generator": "^3.3.9",
|
@@ -10,9 +10,7 @@ const SKIP_LIST = [
|
|
10
10
|
'expand', // doesn't match existing spec
|
11
11
|
'extensionFrame', // doesn't match existing spec
|
12
12
|
'inlineCard', // doesn't match existing spec
|
13
|
-
'inlineExtension', // doesn't exist in the output
|
14
13
|
'inline_comment_marker', // doesn't exist in the output
|
15
|
-
'layoutSection', // doesn't match existing spec, maxItem/minItem, extra marks
|
16
14
|
'layoutSection_full', // doesn't match existing spec, allowUnsupportedBlock, extra marks
|
17
15
|
'layoutSection_with_single_column', // doesn't exist in the output
|
18
16
|
'media', // doesn't match existing spec
|
@@ -37,25 +37,43 @@ expect.extend({
|
|
37
37
|
},
|
38
38
|
});
|
39
39
|
|
40
|
+
test('ADF DSL to JSON Schema backwards compatibility for full schema', () => {
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
42
|
+
const currentSchema = require('../../../json-schema/v1/full.json');
|
43
|
+
const nextSchema = adfToJSON(adfNode);
|
44
|
+
expect(nextSchema).toBeBackwardsCompatibleWith(currentSchema);
|
45
|
+
});
|
46
|
+
|
40
47
|
// The end goal is to be able to remove all transformation for known failures
|
41
48
|
function transformFullFixtureForKnownFailures(json) {
|
42
49
|
const definitions = json.definitions;
|
43
50
|
|
44
|
-
delete definitions.
|
45
|
-
delete definitions.
|
46
|
-
delete definitions.
|
51
|
+
delete definitions.doc_node;
|
52
|
+
delete definitions.blockRootOnly_node;
|
53
|
+
delete definitions.extensionFrame_node;
|
54
|
+
delete definitions.block_content;
|
55
|
+
delete definitions.non_nestable_block_content;
|
56
|
+
delete definitions.table_row_node;
|
57
|
+
delete definitions.table_cell_content;
|
58
|
+
delete definitions.mediaGroup_node;
|
59
|
+
delete definitions.inline_node;
|
60
|
+
delete definitions.mediaInline_node;
|
61
|
+
delete definitions.mediaSingle_width_type_node;
|
62
|
+
delete definitions.status_node;
|
63
|
+
delete definitions.date_node;
|
64
|
+
delete definitions.emoji_node;
|
65
|
+
delete definitions.mention_node;
|
66
|
+
delete definitions.codeBlock_with_marks_node;
|
67
|
+
delete definitions.codeBlock_node;
|
47
68
|
|
48
69
|
return json;
|
49
70
|
}
|
50
71
|
|
51
|
-
test('
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
);
|
56
|
-
const nextSchema = adfToJSON(adfNode);
|
57
|
-
|
58
|
-
expect(nextSchema).toBeBackwardsCompatibleWith(currentSchema);
|
72
|
+
test('JSON Schema to ADF DSL backwards compatibility for full schema', () => {
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
74
|
+
const currentSchema = require('../../../json-schema/v1/full.json');
|
75
|
+
const nextSchema = transformFullFixtureForKnownFailures(adfToJSON(adfNode));
|
76
|
+
expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
|
59
77
|
});
|
60
78
|
|
61
79
|
const DEFINITIONS_TO_SKIP_STAGE_0 = [
|