@atlaskit/adf-schema 37.1.36 → 37.1.37
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 +7 -0
- package/dist/cjs/next-schema/marks/confluenceInlineComment.js +1 -1
- package/dist/cjs/next-schema/nodes/tableCell.js +4 -0
- package/dist/cjs/next-schema/nodes/tableHeader.js +4 -0
- package/dist/cjs/next-schema/nodes/text.js +10 -1
- package/dist/es2019/next-schema/marks/confluenceInlineComment.js +2 -2
- package/dist/es2019/next-schema/nodes/tableCell.js +4 -0
- package/dist/es2019/next-schema/nodes/tableHeader.js +4 -0
- package/dist/es2019/next-schema/nodes/text.js +10 -1
- package/dist/esm/next-schema/marks/confluenceInlineComment.js +2 -2
- package/dist/esm/next-schema/nodes/tableCell.js +4 -0
- package/dist/esm/next-schema/nodes/tableHeader.js +4 -0
- package/dist/esm/next-schema/nodes/text.js +10 -1
- package/dist/types/next-schema/nodes/text.d.ts +8 -0
- package/package.json +2 -2
- package/schema-generators/__tests__/unit/adfToValidatorSpecValidation.unit.ts +0 -3
- package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +41 -13
package/CHANGELOG.md
CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.confluenceInlineComment = void 0;
|
7
7
|
var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
|
8
8
|
var confluenceInlineComment = exports.confluenceInlineComment = (0, _adfSchemaGenerator.adfMark)('confluenceInlineComment').define({
|
9
|
-
ignore: [_adfSchemaGenerator.JSONSchemaTransformerName
|
9
|
+
ignore: [_adfSchemaGenerator.JSONSchemaTransformerName],
|
10
10
|
inclusive: false,
|
11
11
|
excludes: _adfSchemaGenerator.MarkExcludesNone,
|
12
12
|
attrs: {
|
@@ -44,6 +44,10 @@ var tableCell = exports.tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell'
|
|
44
44
|
required: {
|
45
45
|
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
46
46
|
value: ['content']
|
47
|
+
},
|
48
|
+
'props.content': {
|
49
|
+
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
50
|
+
value: 'tableCell_content'
|
47
51
|
}
|
48
52
|
}
|
49
53
|
}
|
@@ -44,6 +44,10 @@ var tableHeader = exports.tableHeader = (0, _adfSchemaGenerator.adfNode)('tableH
|
|
44
44
|
required: {
|
45
45
|
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
46
46
|
value: ['content']
|
47
|
+
},
|
48
|
+
'props.content': {
|
49
|
+
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
50
|
+
value: 'tableCell_content'
|
47
51
|
}
|
48
52
|
}
|
49
53
|
}
|
@@ -25,7 +25,16 @@ var text = exports.text = (0, _adfSchemaGenerator.adfNode)('text').define({
|
|
25
25
|
marks: [_link.link],
|
26
26
|
ignore: ['pm-spec', 'json-schema']
|
27
27
|
}).variant('formatted', {
|
28
|
-
marks: [_link.link, _em.em, _strong.strong, _strike.strike, _subsup.subsup, _underline.underline, _color.textColor, _annotation.annotation, _color.backgroundColor, _typeAheadQuery.typeAheadQuery, _confluenceInlineComment.confluenceInlineComment, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark]
|
28
|
+
marks: [_link.link, _em.em, _strong.strong, _strike.strike, _subsup.subsup, _underline.underline, _color.textColor, _annotation.annotation, _color.backgroundColor, _typeAheadQuery.typeAheadQuery, _confluenceInlineComment.confluenceInlineComment, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
|
29
|
+
DANGEROUS_MANUAL_OVERRIDE: {
|
30
|
+
'validator-spec': {
|
31
|
+
// Refers to confluence inline comment value (9th on list)
|
32
|
+
'props.marks.items[0][9]': {
|
33
|
+
remove: true,
|
34
|
+
reason: '@DSLCompatibilityException - Confluence inline comment is not matched on the validator'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
29
38
|
}).variant('code_inline', {
|
30
39
|
marks: [_code.code, _link.link, _annotation.annotation, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark]
|
31
40
|
});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
|
2
2
|
export const confluenceInlineComment = adfMark('confluenceInlineComment').define({
|
3
|
-
ignore: [JSONSchemaTransformerName
|
3
|
+
ignore: [JSONSchemaTransformerName],
|
4
4
|
inclusive: false,
|
5
5
|
excludes: MarkExcludesNone,
|
6
6
|
attrs: {
|
@@ -38,6 +38,10 @@ export const tableCell = adfNode('tableCell').define({
|
|
38
38
|
required: {
|
39
39
|
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
40
40
|
value: ['content']
|
41
|
+
},
|
42
|
+
'props.content': {
|
43
|
+
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
44
|
+
value: 'tableCell_content'
|
41
45
|
}
|
42
46
|
}
|
43
47
|
}
|
@@ -38,6 +38,10 @@ export const tableHeader = adfNode('tableHeader').define({
|
|
38
38
|
required: {
|
39
39
|
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
40
40
|
value: ['content']
|
41
|
+
},
|
42
|
+
'props.content': {
|
43
|
+
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
44
|
+
value: 'tableCell_content'
|
41
45
|
}
|
42
46
|
}
|
43
47
|
}
|
@@ -19,7 +19,16 @@ export const text = adfNode('text').define({
|
|
19
19
|
marks: [link],
|
20
20
|
ignore: ['pm-spec', 'json-schema']
|
21
21
|
}).variant('formatted', {
|
22
|
-
marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
|
22
|
+
marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark],
|
23
|
+
DANGEROUS_MANUAL_OVERRIDE: {
|
24
|
+
'validator-spec': {
|
25
|
+
// Refers to confluence inline comment value (9th on list)
|
26
|
+
'props.marks.items[0][9]': {
|
27
|
+
remove: true,
|
28
|
+
reason: '@DSLCompatibilityException - Confluence inline comment is not matched on the validator'
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
23
32
|
}).variant('code_inline', {
|
24
33
|
marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
|
25
34
|
});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
|
2
2
|
export var confluenceInlineComment = adfMark('confluenceInlineComment').define({
|
3
|
-
ignore: [JSONSchemaTransformerName
|
3
|
+
ignore: [JSONSchemaTransformerName],
|
4
4
|
inclusive: false,
|
5
5
|
excludes: MarkExcludesNone,
|
6
6
|
attrs: {
|
@@ -38,6 +38,10 @@ export var tableCell = adfNode('tableCell').define({
|
|
38
38
|
required: {
|
39
39
|
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
40
40
|
value: ['content']
|
41
|
+
},
|
42
|
+
'props.content': {
|
43
|
+
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
44
|
+
value: 'tableCell_content'
|
41
45
|
}
|
42
46
|
}
|
43
47
|
}
|
@@ -38,6 +38,10 @@ export var tableHeader = adfNode('tableHeader').define({
|
|
38
38
|
required: {
|
39
39
|
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
40
40
|
value: ['content']
|
41
|
+
},
|
42
|
+
'props.content': {
|
43
|
+
reason: '@DSLCompatibilityException - required for tableHeader validator spec',
|
44
|
+
value: 'tableCell_content'
|
41
45
|
}
|
42
46
|
}
|
43
47
|
}
|
@@ -19,7 +19,16 @@ export var text = adfNode('text').define({
|
|
19
19
|
marks: [link],
|
20
20
|
ignore: ['pm-spec', 'json-schema']
|
21
21
|
}).variant('formatted', {
|
22
|
-
marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
|
22
|
+
marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark],
|
23
|
+
DANGEROUS_MANUAL_OVERRIDE: {
|
24
|
+
'validator-spec': {
|
25
|
+
// Refers to confluence inline comment value (9th on list)
|
26
|
+
'props.marks.items[0][9]': {
|
27
|
+
remove: true,
|
28
|
+
reason: '@DSLCompatibilityException - Confluence inline comment is not matched on the validator'
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
23
32
|
}).variant('code_inline', {
|
24
33
|
marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
|
25
34
|
});
|
@@ -32,6 +32,14 @@ export declare const text: import("@atlaskit/adf-schema-generator/dist/types/adf
|
|
32
32
|
ignore: ("pm-spec" | "json-schema")[];
|
33
33
|
} & {
|
34
34
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
35
|
+
DANGEROUS_MANUAL_OVERRIDE: {
|
36
|
+
'validator-spec': {
|
37
|
+
'props.marks.items[0][9]': {
|
38
|
+
remove: true;
|
39
|
+
reason: string;
|
40
|
+
};
|
41
|
+
};
|
42
|
+
};
|
35
43
|
} & {
|
36
44
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
37
45
|
}>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "37.1.
|
3
|
+
"version": "37.1.37",
|
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.8",
|
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",
|
@@ -4,12 +4,9 @@ import adfNode from '../../../src/next-schema/full-schema.adf';
|
|
4
4
|
|
5
5
|
const newSpecs = sortNestedArrays(adfToValidatorSpec(adfNode));
|
6
6
|
const SKIP_LIST = [
|
7
|
-
'inline_comment_marker', // doesn't exist in the output
|
8
7
|
'layoutSection_with_single_column', // doesn't exist in the output
|
9
8
|
'multiBodiedExtension', // doesn't match existing spec
|
10
9
|
'nestedExpand', // doesn't match existing spec
|
11
|
-
'tableCell', // doesn't match existing spec
|
12
|
-
'tableHeader', // doesn't match existing spec
|
13
10
|
|
14
11
|
'atomic_inline', // doesn't exist in the output, not even used anywhere...
|
15
12
|
'nestedExpand_content', // doesn't exist in the output, completely different format from other groups
|
@@ -48,20 +48,48 @@ test('ADF DSL to JSON Schema backwards compatibility for full schema', () => {
|
|
48
48
|
function transformFullFixtureForKnownFailures(json) {
|
49
49
|
const definitions = json.definitions;
|
50
50
|
|
51
|
+
// Extra nodes in anyOf
|
52
|
+
definitions.inline_node.anyOf = definitions.inline_node.anyOf.filter(
|
53
|
+
(v) =>
|
54
|
+
![
|
55
|
+
'#/definitions/confluenceJiraIssue_node',
|
56
|
+
'#/definitions/confluenceUnsupportedInline_node',
|
57
|
+
'#/definitions/image_node',
|
58
|
+
'#/definitions/inlineExtension_node',
|
59
|
+
'#/definitions/text_link_inline_node',
|
60
|
+
'#/definitions/text_node',
|
61
|
+
'#/definitions/unsupportedInline_node',
|
62
|
+
].includes(v.$ref),
|
63
|
+
);
|
64
|
+
|
65
|
+
// Extra nodes in content.items.anyOf
|
66
|
+
definitions.table_row_node.properties.content.items.anyOf =
|
67
|
+
definitions.table_row_node.properties.content.items.anyOf.filter(
|
68
|
+
(v) => v.$ref !== '#/definitions/table_cell_content',
|
69
|
+
);
|
70
|
+
|
71
|
+
// Extra definitions
|
51
72
|
delete definitions.extensionFrame_node;
|
52
|
-
|
53
|
-
|
54
|
-
delete definitions.
|
55
|
-
delete definitions.
|
56
|
-
delete definitions.
|
57
|
-
delete definitions.
|
58
|
-
|
59
|
-
|
60
|
-
delete definitions.
|
61
|
-
delete definitions.
|
62
|
-
|
63
|
-
|
64
|
-
delete definitions.
|
73
|
+
|
74
|
+
// // Extra marks
|
75
|
+
delete definitions.date_node.properties.marks;
|
76
|
+
delete definitions.emoji_node.properties.marks;
|
77
|
+
delete definitions.mention_node.properties.marks;
|
78
|
+
delete definitions.status_node.properties.marks;
|
79
|
+
|
80
|
+
// // Extra properties
|
81
|
+
delete definitions.codeBlock_node.properties.attrs.properties.uniqueId;
|
82
|
+
delete definitions.codeBlock_with_marks_node.allOf.find(
|
83
|
+
(v) => v.type === 'object',
|
84
|
+
).properties.content;
|
85
|
+
delete definitions.mediaGroup_node.properties.attrs;
|
86
|
+
delete definitions.mediaInline_node.properties.attrs.properties.url;
|
87
|
+
|
88
|
+
// Special case for table_cell_content
|
89
|
+
definitions.table_cell_content.items.anyOf =
|
90
|
+
definitions.table_cell_content.items.anyOf.filter(
|
91
|
+
(v) => v.$ref !== '#/definitions/nestedExpand_content',
|
92
|
+
);
|
65
93
|
|
66
94
|
return json;
|
67
95
|
}
|