@atlaskit/adf-schema 37.1.25 → 37.1.26
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 +6 -0
- package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- 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/nestedExpand.js +2 -0
- package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
- 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/json-full-schema-backwards-compat.unit.ts +29 -11
package/CHANGELOG.md
CHANGED
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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.26",
|
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",
|
@@ -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 = [
|