@atlaskit/adf-schema 36.17.0 → 36.18.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
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "36.
|
3
|
+
"version": "36.18.0",
|
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/"
|
@@ -44,7 +44,7 @@
|
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"@atlassian/adf-schema-json": "^1.15.0",
|
47
|
-
"@atlaskit/adf-schema-generator": "^1.
|
47
|
+
"@atlaskit/adf-schema-generator": "^1.17.0",
|
48
48
|
"@atlaskit/codemod-utils": "^4.2.4",
|
49
49
|
"@atlaskit/json-schema-generator": "^3.3.9",
|
50
50
|
"@babel/cli": "^7.22.9",
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { adfToValidatorSpec } from '@atlaskit/adf-schema-generator';
|
2
2
|
import adfNode from '@atlaskit/adf-schema/src/next-schema/full-schema.adf';
|
3
3
|
|
4
|
-
|
5
|
-
test.skip('should be able to handle heading', () => {
|
4
|
+
test('should be able to handle heading', () => {
|
6
5
|
const result = sortNestedArrays(adfToValidatorSpec(adfNode));
|
7
6
|
|
8
7
|
expect(result.heading.json).toEqual(sortNestedArrays(heading));
|
@@ -20,6 +19,20 @@ test('should be able to handle mentions', () => {
|
|
20
19
|
expect(result.mention.json).toEqual(sortNestedArrays(mention));
|
21
20
|
});
|
22
21
|
|
22
|
+
test('should be able to handle paragraphs', () => {
|
23
|
+
const result = sortNestedArrays(adfToValidatorSpec(adfNode));
|
24
|
+
|
25
|
+
expect(result.paragraph.json).toEqual(sortNestedArrays(paragraph));
|
26
|
+
});
|
27
|
+
|
28
|
+
// i don't know what node on the results object is nested_expand because
|
29
|
+
// nested_expand doesn't exist in the adfNode object :hmmmmmm:
|
30
|
+
test.skip('should be able to handle nested expand', () => {
|
31
|
+
const result = sortNestedArrays(adfToValidatorSpec(adfNode));
|
32
|
+
|
33
|
+
expect(result.nested_expand.json).toEqual(sortNestedArrays(nested_expand));
|
34
|
+
});
|
35
|
+
|
23
36
|
function sortNestedArrays(obj: any): any {
|
24
37
|
if (Array.isArray(obj)) {
|
25
38
|
return obj.sort();
|
@@ -32,6 +45,28 @@ function sortNestedArrays(obj: any): any {
|
|
32
45
|
return obj;
|
33
46
|
}
|
34
47
|
|
48
|
+
const nested_expand = {
|
49
|
+
props: {
|
50
|
+
type: { type: 'enum', values: ['nestedExpand'] },
|
51
|
+
attrs: { props: { title: { type: 'string', optional: true } } },
|
52
|
+
content: 'nestedExpand_content',
|
53
|
+
},
|
54
|
+
required: ['content'],
|
55
|
+
};
|
56
|
+
|
57
|
+
const paragraph = {
|
58
|
+
props: {
|
59
|
+
type: { type: 'enum', values: ['paragraph'] },
|
60
|
+
content: {
|
61
|
+
type: 'array',
|
62
|
+
items: ['inline'],
|
63
|
+
allowUnsupportedInline: true, // currently not supported by DSL
|
64
|
+
optional: true,
|
65
|
+
},
|
66
|
+
marks: { type: 'array', items: [], optional: true },
|
67
|
+
},
|
68
|
+
};
|
69
|
+
|
35
70
|
const mention = {
|
36
71
|
props: {
|
37
72
|
type: { type: 'enum', values: ['mention'] },
|
@@ -103,6 +138,7 @@ const heading = {
|
|
103
138
|
content: {
|
104
139
|
type: 'array',
|
105
140
|
items: ['inline'],
|
141
|
+
allowUnsupportedInline: true,
|
106
142
|
optional: true,
|
107
143
|
},
|
108
144
|
marks: { type: 'array', items: [], optional: true },
|