@atlaskit/adf-schema 36.12.1 → 36.12.2
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/types/next-schema/full-schema.adf.d.ts +1 -0
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +4 -0
- package/dist/types/next-schema/nodes/blockCard.d.ts +1 -0
- package/dist/types/next-schema/nodes/blockquote.d.ts +1 -0
- package/dist/types/next-schema/nodes/bodiedExtension.d.ts +1 -0
- package/dist/types/next-schema/nodes/caption.d.ts +1 -0
- package/dist/types/next-schema/nodes/codeBlock.d.ts +2 -0
- package/dist/types/next-schema/nodes/date.d.ts +1 -0
- package/dist/types/next-schema/nodes/decisionItem.d.ts +1 -0
- package/dist/types/next-schema/nodes/decisionList.d.ts +1 -0
- package/dist/types/next-schema/nodes/embedCard.d.ts +1 -0
- package/dist/types/next-schema/nodes/emoji.d.ts +1 -0
- package/dist/types/next-schema/nodes/expand.d.ts +1 -0
- package/dist/types/next-schema/nodes/extension.d.ts +1 -0
- package/dist/types/next-schema/nodes/extensionFrame.d.ts +1 -0
- package/dist/types/next-schema/nodes/hardBreak.d.ts +1 -0
- package/dist/types/next-schema/nodes/heading.d.ts +2 -0
- package/dist/types/next-schema/nodes/inlineCard.d.ts +1 -0
- package/dist/types/next-schema/nodes/inlineExtension.d.ts +1 -0
- package/dist/types/next-schema/nodes/layoutColumn.d.ts +1 -0
- package/dist/types/next-schema/nodes/layoutSection.d.ts +1 -0
- package/dist/types/next-schema/nodes/list.d.ts +2 -0
- package/dist/types/next-schema/nodes/media.d.ts +1 -0
- package/dist/types/next-schema/nodes/mediaGroup.d.ts +1 -0
- package/dist/types/next-schema/nodes/mediaInline.d.ts +1 -0
- package/dist/types/next-schema/nodes/mediaSingle.d.ts +1 -0
- package/dist/types/next-schema/nodes/mention.d.ts +1 -0
- package/dist/types/next-schema/nodes/multiBodiedExtension.d.ts +1 -0
- package/dist/types/next-schema/nodes/nestedExpand.d.ts +1 -0
- package/dist/types/next-schema/nodes/panel.d.ts +1 -0
- package/dist/types/next-schema/nodes/paragraph.d.ts +1 -0
- package/dist/types/next-schema/nodes/placeholder.d.ts +1 -0
- package/dist/types/next-schema/nodes/rule.d.ts +1 -0
- package/dist/types/next-schema/nodes/status.d.ts +1 -0
- package/dist/types/next-schema/nodes/table.d.ts +1 -0
- package/dist/types/next-schema/nodes/tableCell.d.ts +1 -0
- package/dist/types/next-schema/nodes/tableHeader.d.ts +1 -0
- package/dist/types/next-schema/nodes/tableRow.d.ts +1 -0
- package/dist/types/next-schema/nodes/task.d.ts +2 -0
- package/dist/types/next-schema/nodes/text.d.ts +1 -0
- package/package.json +4 -4
- package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +86 -44
package/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -16,6 +17,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
|
|
16
17
|
selectable?: boolean;
|
17
18
|
whitespace?: "pre" | "normal";
|
18
19
|
}> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<any, {
|
20
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
19
21
|
root?: boolean;
|
20
22
|
atom?: boolean;
|
21
23
|
version?: 1;
|
@@ -35,6 +37,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
|
|
35
37
|
} & {
|
36
38
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
37
39
|
}> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<any, {
|
40
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
38
41
|
root?: boolean;
|
39
42
|
atom?: boolean;
|
40
43
|
version?: 1;
|
@@ -55,6 +58,7 @@ export declare const nonNestableBlockContent: (import("@atlaskit/adf-schema-gene
|
|
55
58
|
atom: false;
|
56
59
|
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOrSpec[];
|
57
60
|
}> | import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_list"], {
|
61
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
58
62
|
root?: boolean;
|
59
63
|
atom?: boolean;
|
60
64
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const blockCard: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const blockquote: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_list"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const bodiedExtension: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const codeBlock: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks", "with_no_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -19,6 +20,7 @@ export declare const codeBlock: import("@atlaskit/adf-schema-generator/dist/type
|
|
19
20
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
20
21
|
}>;
|
21
22
|
export declare const codeBlockWithMarks: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks", "with_no_marks"], {
|
23
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
22
24
|
root?: boolean;
|
23
25
|
atom?: boolean;
|
24
26
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const decisionItem: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const decisionList: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const embedCard: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const expand: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_breakout_mark", "with_no_mark"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const extension: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const extensionFrame: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const hardBreak: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const heading: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_no_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -21,6 +22,7 @@ export declare const heading: import("@atlaskit/adf-schema-generator/dist/types/
|
|
21
22
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
22
23
|
}>;
|
23
24
|
export declare const headingWithMarks: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_no_marks"], {
|
25
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
24
26
|
root?: boolean;
|
25
27
|
atom?: boolean;
|
26
28
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const inlineCard: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_annotation"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const inlineExtension: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const layoutColumn: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const layoutSection: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "full"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const orderedList: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -17,6 +18,7 @@ export declare const orderedList: import("@atlaskit/adf-schema-generator/dist/ty
|
|
17
18
|
whitespace?: "pre" | "normal";
|
18
19
|
}>;
|
19
20
|
export declare const bulletList: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
21
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
20
22
|
root?: boolean;
|
21
23
|
atom?: boolean;
|
22
24
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const mediaGroup: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const mediaInline: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const mediaSingle: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "caption", "full"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const multiBodiedExtension: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const nestedExpand: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_no_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const paragraph: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "with_alignment", "with_indentation", "with_marks", "with_no_marks"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const placeholder: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const tableCell: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const tableHeader: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const tableRow: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const taskItem: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
@@ -17,6 +18,7 @@ export declare const taskItem: import("@atlaskit/adf-schema-generator/dist/types
|
|
17
18
|
whitespace?: "pre" | "normal";
|
18
19
|
}>;
|
19
20
|
export declare const taskList: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
21
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
20
22
|
root?: boolean;
|
21
23
|
atom?: boolean;
|
22
24
|
version?: 1;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const text: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string, "formatted", "code_inline"], {
|
2
|
+
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
2
3
|
root?: boolean;
|
3
4
|
atom?: boolean;
|
4
5
|
version?: 1;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "36.12.
|
3
|
+
"version": "36.12.2",
|
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/"
|
@@ -36,9 +36,7 @@
|
|
36
36
|
"link:afe": "yarn build:all && node ./copy-dist-to-afe.js"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@atlaskit/codemod-utils": "^4.2.0",
|
40
39
|
"@atlaskit/editor-prosemirror": "*",
|
41
|
-
"@atlaskit/json-schema-generator": "^3.3.6",
|
42
40
|
"@babel/runtime": "^7.0.0",
|
43
41
|
"css-color-names": "0.0.4",
|
44
42
|
"linkify-it": "^2.0.3",
|
@@ -46,7 +44,9 @@
|
|
46
44
|
},
|
47
45
|
"devDependencies": {
|
48
46
|
"@atlassian/adf-schema-json": "^1.15.0",
|
49
|
-
"@atlaskit/adf-schema-generator": "^1.
|
47
|
+
"@atlaskit/adf-schema-generator": "^1.11.1",
|
48
|
+
"@atlaskit/codemod-utils": "^4.2.4",
|
49
|
+
"@atlaskit/json-schema-generator": "^3.3.9",
|
50
50
|
"@babel/cli": "^7.22.9",
|
51
51
|
"@babel/core": "^7.22.9",
|
52
52
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
@@ -1,69 +1,111 @@
|
|
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
|
-
|
4
|
+
// currently doesn't work, will fix with next PR
|
5
|
+
test.skip('should be able to handle heading', () => {
|
6
|
+
const result = sortNestedArrays(adfToValidatorSpec(adfNode));
|
6
7
|
|
7
|
-
expect(result.
|
8
|
-
heading_with_alignment.props,
|
9
|
-
);
|
8
|
+
expect(result.heading.json).toEqual(sortNestedArrays(heading));
|
10
9
|
});
|
11
10
|
|
12
|
-
test('should be able to handle
|
13
|
-
const result = adfToValidatorSpec(adfNode);
|
11
|
+
test('should be able to handle the panel node', () => {
|
12
|
+
const result = sortNestedArrays(adfToValidatorSpec(adfNode));
|
14
13
|
|
15
|
-
expect(result.
|
14
|
+
expect(result.panel.json).toEqual(sortNestedArrays(panel));
|
16
15
|
});
|
17
16
|
|
18
|
-
|
17
|
+
test('should be able to handle mentions', () => {
|
18
|
+
const result = sortNestedArrays(adfToValidatorSpec(adfNode));
|
19
|
+
|
20
|
+
expect(result.mention.json).toEqual(sortNestedArrays(mention));
|
21
|
+
});
|
22
|
+
|
23
|
+
function sortNestedArrays(obj: any): any {
|
24
|
+
if (Array.isArray(obj)) {
|
25
|
+
return obj.sort();
|
26
|
+
}
|
27
|
+
if (typeof obj === 'object') {
|
28
|
+
for (const key in obj) {
|
29
|
+
obj[key] = sortNestedArrays(obj[key]);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
return obj;
|
33
|
+
}
|
34
|
+
|
35
|
+
const mention = {
|
19
36
|
props: {
|
37
|
+
type: { type: 'enum', values: ['mention'] },
|
20
38
|
attrs: {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
39
|
+
props: {
|
40
|
+
id: { type: 'string' },
|
41
|
+
text: { type: 'string', optional: true },
|
42
|
+
userType: {
|
43
|
+
type: 'enum',
|
44
|
+
values: ['DEFAULT', 'SPECIAL', 'APP'],
|
45
|
+
optional: true,
|
46
|
+
},
|
47
|
+
accessLevel: { type: 'string', optional: true },
|
48
|
+
localId: { type: 'string', optional: true },
|
49
|
+
},
|
50
|
+
},
|
51
|
+
},
|
52
|
+
};
|
53
|
+
|
54
|
+
const panel = {
|
55
|
+
props: {
|
56
|
+
type: { type: 'enum', values: ['panel'] },
|
57
|
+
attrs: {
|
58
|
+
props: {
|
59
|
+
panelType: {
|
60
|
+
type: 'enum',
|
61
|
+
values: [
|
62
|
+
'info',
|
63
|
+
'note',
|
64
|
+
'tip',
|
65
|
+
'warning',
|
66
|
+
'error',
|
67
|
+
'success',
|
68
|
+
'custom',
|
69
|
+
],
|
70
|
+
},
|
71
|
+
panelIcon: { type: 'string', optional: true },
|
72
|
+
panelIconId: { type: 'string', optional: true },
|
73
|
+
panelIconText: { type: 'string', optional: true },
|
74
|
+
panelColor: { type: 'string', optional: true },
|
26
75
|
},
|
27
76
|
},
|
28
77
|
content: {
|
29
|
-
items: ['inline'],
|
30
|
-
minItems: 0,
|
31
78
|
type: 'array',
|
32
|
-
},
|
33
|
-
marks: {
|
34
79
|
items: [
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
80
|
+
[
|
81
|
+
'codeBlock_with_no_marks',
|
82
|
+
'blockCard',
|
83
|
+
'paragraph_with_no_marks',
|
84
|
+
'mediaSingle_caption',
|
85
|
+
'mediaSingle_full',
|
86
|
+
'taskList',
|
87
|
+
'bulletList',
|
88
|
+
'orderedList',
|
89
|
+
'heading_with_no_marks',
|
90
|
+
'mediaGroup',
|
91
|
+
'decisionList',
|
92
|
+
'rule',
|
93
|
+
],
|
46
94
|
],
|
47
|
-
|
48
|
-
},
|
49
|
-
type: {
|
50
|
-
type: 'enum',
|
51
|
-
values: ['heading'],
|
95
|
+
minItems: 1,
|
52
96
|
},
|
53
97
|
},
|
54
98
|
};
|
55
99
|
|
56
|
-
const
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
userType: {
|
63
|
-
type: 'enum',
|
64
|
-
values: ['DEFAULT', 'SPECIAL', 'APP'],
|
65
|
-
default: null,
|
100
|
+
const heading = {
|
101
|
+
props: {
|
102
|
+
type: { type: 'enum', values: ['heading'] },
|
103
|
+
content: {
|
104
|
+
type: 'array',
|
105
|
+
items: ['inline'],
|
66
106
|
optional: true,
|
67
107
|
},
|
108
|
+
marks: { type: 'array', items: [], optional: true },
|
109
|
+
attrs: { props: { level: { type: 'number', minimum: 1, maximum: 6 } } },
|
68
110
|
},
|
69
111
|
};
|