@atlaskit/adf-schema 36.18.2 → 37.0.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/index.js +0 -24
- package/dist/cjs/next-schema/generated/markTypes.js +27 -16
- package/dist/cjs/next-schema/generated/nodeTypes.js +36 -4
- package/dist/cjs/next-schema/groups/searchQueryMarkGroup.js +2 -1
- package/dist/cjs/next-schema/marks/annotation.js +1 -0
- package/dist/cjs/next-schema/marks/confluenceInlineComment.js +18 -0
- package/dist/cjs/next-schema/marks/fragment.js +2 -0
- package/dist/cjs/next-schema/marks/typeAheadQuery.js +17 -0
- package/dist/cjs/next-schema/marks/unsupportedMark.js +3 -2
- package/dist/cjs/next-schema/marks/unsupportedNodeAttribute.js +4 -6
- package/dist/cjs/next-schema/nodes/heading.js +5 -0
- package/dist/cjs/next-schema/nodes/paragraph.js +7 -0
- package/dist/cjs/next-schema/nodes/text.js +3 -1
- package/dist/cjs/schema/create-schema.js +2 -2
- package/dist/cjs/schema/default-schema.js +1 -3
- package/dist/cjs/schema/index.js +0 -24
- package/dist/cjs/schema/nodes/heading.js +2 -51
- package/dist/cjs/schema/nodes/index.js +0 -24
- package/dist/cjs/schema/nodes/paragraph.js +2 -18
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/next-schema/generated/markTypes.js +26 -15
- package/dist/es2019/next-schema/generated/nodeTypes.js +36 -4
- package/dist/es2019/next-schema/groups/searchQueryMarkGroup.js +2 -1
- package/dist/es2019/next-schema/marks/annotation.js +2 -1
- package/dist/es2019/next-schema/marks/confluenceInlineComment.js +12 -0
- package/dist/es2019/next-schema/marks/fragment.js +3 -1
- package/dist/es2019/next-schema/marks/typeAheadQuery.js +11 -0
- package/dist/es2019/next-schema/marks/unsupportedMark.js +4 -3
- package/dist/es2019/next-schema/marks/unsupportedNodeAttribute.js +4 -6
- package/dist/es2019/next-schema/nodes/heading.js +5 -0
- package/dist/es2019/next-schema/nodes/paragraph.js +7 -0
- package/dist/es2019/next-schema/nodes/text.js +3 -1
- package/dist/es2019/schema/create-schema.js +3 -3
- package/dist/es2019/schema/default-schema.js +2 -4
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/nodes/heading.js +2 -48
- package/dist/es2019/schema/nodes/index.js +2 -2
- package/dist/es2019/schema/nodes/paragraph.js +2 -15
- package/dist/esm/index.js +1 -1
- package/dist/esm/next-schema/generated/markTypes.js +26 -15
- package/dist/esm/next-schema/generated/nodeTypes.js +36 -4
- package/dist/esm/next-schema/groups/searchQueryMarkGroup.js +2 -1
- package/dist/esm/next-schema/marks/annotation.js +2 -1
- package/dist/esm/next-schema/marks/confluenceInlineComment.js +12 -0
- package/dist/esm/next-schema/marks/fragment.js +3 -1
- package/dist/esm/next-schema/marks/typeAheadQuery.js +11 -0
- package/dist/esm/next-schema/marks/unsupportedMark.js +4 -3
- package/dist/esm/next-schema/marks/unsupportedNodeAttribute.js +4 -6
- package/dist/esm/next-schema/nodes/heading.js +5 -0
- package/dist/esm/next-schema/nodes/paragraph.js +7 -0
- package/dist/esm/next-schema/nodes/text.js +3 -1
- package/dist/esm/schema/create-schema.js +3 -3
- package/dist/esm/schema/default-schema.js +2 -4
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/nodes/heading.js +1 -50
- package/dist/esm/schema/nodes/index.js +2 -2
- package/dist/esm/schema/nodes/paragraph.js +1 -17
- package/dist/json-schema/v1/full.json +12 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/next-schema/generated/markTypes.d.ts +23 -1
- package/dist/types/next-schema/generated/nodeTypes.d.ts +18 -2
- package/dist/types/next-schema/marks/confluenceInlineComment.d.ts +1 -0
- package/dist/types/next-schema/marks/typeAheadQuery.d.ts +1 -0
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/nodes/heading.d.ts +1 -3
- package/dist/types/schema/nodes/index.d.ts +2 -2
- package/dist/types/schema/nodes/paragraph.d.ts +1 -6
- package/json-schema/v1/full.json +12 -0
- package/package.json +3 -3
- package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +7 -1
- package/schema-generators/__tests__/unit/json-full-schema.unit.ts +12 -0
- package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +3 -25
@@ -19,17 +19,7 @@ const defaultSchema = getNodesAndMarksMap();
|
|
19
19
|
const EXCLUDE_CONTENT_FROM_NODESPEC = [
|
20
20
|
'uknownBlock', // We won't have it in DSL
|
21
21
|
];
|
22
|
-
|
23
|
-
'confluenceInlineComment', // not exist in ADF DSL
|
24
|
-
'typeAheadQuery', // not exist in ADF DSL
|
25
|
-
];
|
26
|
-
const SKIPPED_MARKSPEC_TESTS = [
|
27
|
-
'link', // new link mark is not matching old link mark
|
28
|
-
'confluenceInlineComment', // not exist in ADF DSL
|
29
|
-
'unsupportedMark', // exist in ADF DSL but have default value where old spec doesn't have
|
30
|
-
'unsupportedNodeAttribute', // exist in ADF DSL but have default value where old spec doesn't have
|
31
|
-
'typeAheadQuery', // not exist in ADF DSL
|
32
|
-
];
|
22
|
+
|
33
23
|
const SKIPPED_NODESPEC_TESTS = [
|
34
24
|
'unknownBlock', // unused node
|
35
25
|
'mediaSingleFull', // not aligned with old spec - content is different, another case similar to layoutSection
|
@@ -93,7 +83,7 @@ expect.extend({
|
|
93
83
|
content: formatContent(expected.content, EXCLUDE_CONTENT_FROM_NODESPEC),
|
94
84
|
}),
|
95
85
|
...(expected.marks && {
|
96
|
-
marks: filterAndSortMarks(expected.marks
|
86
|
+
marks: filterAndSortMarks(expected.marks),
|
97
87
|
}),
|
98
88
|
};
|
99
89
|
|
@@ -110,10 +100,6 @@ expect.extend({
|
|
110
100
|
},
|
111
101
|
});
|
112
102
|
|
113
|
-
function isMarkSpec(_value: MarkSpec | NodeSpec): _value is MarkSpec {
|
114
|
-
return true;
|
115
|
-
}
|
116
|
-
|
117
103
|
function isNodeSpec(_value: MarkSpec | NodeSpec): _value is NodeSpec {
|
118
104
|
return true;
|
119
105
|
}
|
@@ -131,13 +117,6 @@ function omit<T extends object>(data: T, keys = []): T {
|
|
131
117
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
132
118
|
delete result[k];
|
133
119
|
}
|
134
|
-
if (isMarkSpec(data)) {
|
135
|
-
// Treat excludes: '' same as no excludes property
|
136
|
-
if (data.excludes !== undefined && data.excludes === '') {
|
137
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
138
|
-
delete result['excludes'];
|
139
|
-
}
|
140
|
-
}
|
141
120
|
if (isNodeSpec(data)) {
|
142
121
|
// Treat inline: false same as no inline property
|
143
122
|
if (data.inline !== undefined && data.inline === false) {
|
@@ -151,14 +130,13 @@ function omit<T extends object>(data: T, keys = []): T {
|
|
151
130
|
describe('validate PM schema', () => {
|
152
131
|
describe('marks', () => {
|
153
132
|
const { marks } = defaultSchema;
|
154
|
-
const skipLists = SKIPPED_MARKSPEC_TESTS;
|
155
133
|
|
156
134
|
const testCases = Object.entries(marks).map(([key, value]) => {
|
157
135
|
return {
|
158
136
|
name: key,
|
159
137
|
legacyMarkSpec: value,
|
160
138
|
newMarkSpecFn: newMarkSpecs[key] as MarkSpecFactory,
|
161
|
-
skip:
|
139
|
+
skip: key.startsWith('__'),
|
162
140
|
};
|
163
141
|
});
|
164
142
|
|