@atlaskit/adf-schema 36.14.0 → 36.15.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/next-schema/full-schema.adf.js +3 -2
- package/dist/cjs/next-schema/generated/markTypes.js +23 -23
- package/dist/cjs/next-schema/generated/nodeTypes.js +136 -202
- package/dist/cjs/next-schema/groups/blockGroup.js +5 -1
- package/dist/cjs/next-schema/groups/inlineGroup.js +1 -3
- package/dist/cjs/next-schema/nodes/blockCard.js +7 -3
- package/dist/cjs/next-schema/nodes/caption.js +1 -0
- package/dist/cjs/next-schema/nodes/codeBlock.js +2 -2
- package/dist/cjs/next-schema/nodes/decisionItem.js +1 -0
- package/dist/cjs/next-schema/nodes/inlineExtension.js +5 -1
- package/dist/cjs/next-schema/nodes/layoutColumn.js +2 -1
- package/dist/cjs/next-schema/nodes/media.js +2 -2
- package/dist/cjs/next-schema/nodes/mediaInline.js +29 -12
- package/dist/cjs/next-schema/nodes/mediaSingle.js +2 -1
- package/dist/cjs/next-schema/nodes/mention.js +2 -1
- package/dist/cjs/next-schema/nodes/placeholder.js +2 -0
- package/dist/cjs/next-schema/nodes/table.js +1 -0
- package/dist/cjs/next-schema/nodes/tableCell.js +2 -2
- package/dist/cjs/next-schema/nodes/tableHeader.js +2 -2
- package/dist/cjs/next-schema/nodes/tableRow.js +2 -1
- package/dist/cjs/next-schema/nodes/task.js +1 -0
- package/dist/es2019/next-schema/full-schema.adf.js +3 -2
- package/dist/es2019/next-schema/generated/markTypes.js +23 -23
- package/dist/es2019/next-schema/generated/nodeTypes.js +135 -201
- package/dist/es2019/next-schema/groups/blockGroup.js +5 -1
- package/dist/es2019/next-schema/groups/inlineGroup.js +1 -3
- package/dist/es2019/next-schema/nodes/blockCard.js +7 -3
- package/dist/es2019/next-schema/nodes/caption.js +1 -0
- package/dist/es2019/next-schema/nodes/codeBlock.js +1 -1
- package/dist/es2019/next-schema/nodes/decisionItem.js +1 -0
- package/dist/es2019/next-schema/nodes/inlineExtension.js +5 -1
- package/dist/es2019/next-schema/nodes/layoutColumn.js +2 -1
- package/dist/es2019/next-schema/nodes/media.js +2 -2
- package/dist/es2019/next-schema/nodes/mediaInline.js +29 -12
- package/dist/es2019/next-schema/nodes/mediaSingle.js +2 -1
- package/dist/es2019/next-schema/nodes/mention.js +2 -1
- package/dist/es2019/next-schema/nodes/placeholder.js +2 -0
- package/dist/es2019/next-schema/nodes/table.js +1 -0
- package/dist/es2019/next-schema/nodes/tableCell.js +2 -2
- package/dist/es2019/next-schema/nodes/tableHeader.js +2 -2
- package/dist/es2019/next-schema/nodes/tableRow.js +2 -1
- package/dist/es2019/next-schema/nodes/task.js +1 -0
- package/dist/esm/next-schema/full-schema.adf.js +3 -2
- package/dist/esm/next-schema/generated/markTypes.js +23 -23
- package/dist/esm/next-schema/generated/nodeTypes.js +135 -201
- package/dist/esm/next-schema/groups/blockGroup.js +5 -1
- package/dist/esm/next-schema/groups/inlineGroup.js +1 -3
- package/dist/esm/next-schema/nodes/blockCard.js +7 -3
- package/dist/esm/next-schema/nodes/caption.js +1 -0
- package/dist/esm/next-schema/nodes/codeBlock.js +1 -1
- package/dist/esm/next-schema/nodes/decisionItem.js +1 -0
- package/dist/esm/next-schema/nodes/inlineExtension.js +5 -1
- package/dist/esm/next-schema/nodes/layoutColumn.js +2 -1
- package/dist/esm/next-schema/nodes/media.js +2 -2
- package/dist/esm/next-schema/nodes/mediaInline.js +29 -12
- package/dist/esm/next-schema/nodes/mediaSingle.js +2 -1
- package/dist/esm/next-schema/nodes/mention.js +2 -1
- package/dist/esm/next-schema/nodes/placeholder.js +2 -0
- package/dist/esm/next-schema/nodes/table.js +1 -0
- package/dist/esm/next-schema/nodes/tableCell.js +2 -2
- package/dist/esm/next-schema/nodes/tableHeader.js +2 -2
- package/dist/esm/next-schema/nodes/tableRow.js +2 -1
- package/dist/esm/next-schema/nodes/task.js +1 -0
- package/dist/types/next-schema/full-schema.adf.d.ts +3 -0
- package/dist/types/next-schema/generated/markTypes.d.ts +36 -36
- package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +4 -4
- package/dist/types/next-schema/generated/nodeTypes.d.ts +59 -120
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +12 -0
- package/dist/types/next-schema/nodes/blockCard.d.ts +3 -0
- package/dist/types/next-schema/nodes/blockquote.d.ts +3 -0
- package/dist/types/next-schema/nodes/bodiedExtension.d.ts +3 -0
- package/dist/types/next-schema/nodes/caption.d.ts +3 -0
- package/dist/types/next-schema/nodes/codeBlock.d.ts +7 -1
- package/dist/types/next-schema/nodes/confluenceUnsupportedBlock.d.ts +3 -0
- package/dist/types/next-schema/nodes/confluenceUnsupportedInline.d.ts +3 -0
- package/dist/types/next-schema/nodes/date.d.ts +3 -0
- package/dist/types/next-schema/nodes/decisionItem.d.ts +3 -0
- package/dist/types/next-schema/nodes/decisionList.d.ts +3 -0
- package/dist/types/next-schema/nodes/embedCard.d.ts +3 -0
- package/dist/types/next-schema/nodes/emoji.d.ts +3 -0
- package/dist/types/next-schema/nodes/expand.d.ts +3 -0
- package/dist/types/next-schema/nodes/extension.d.ts +3 -0
- package/dist/types/next-schema/nodes/extensionFrame.d.ts +3 -0
- package/dist/types/next-schema/nodes/hardBreak.d.ts +3 -0
- package/dist/types/next-schema/nodes/heading.d.ts +3 -0
- package/dist/types/next-schema/nodes/inlineCard.d.ts +3 -0
- package/dist/types/next-schema/nodes/inlineExtension.d.ts +5 -0
- package/dist/types/next-schema/nodes/layoutColumn.d.ts +3 -0
- package/dist/types/next-schema/nodes/layoutSection.d.ts +3 -0
- package/dist/types/next-schema/nodes/list.d.ts +6 -0
- package/dist/types/next-schema/nodes/media.d.ts +3 -0
- package/dist/types/next-schema/nodes/mediaGroup.d.ts +3 -0
- package/dist/types/next-schema/nodes/mediaInline.d.ts +3 -0
- package/dist/types/next-schema/nodes/mediaSingle.d.ts +3 -0
- package/dist/types/next-schema/nodes/mention.d.ts +3 -0
- package/dist/types/next-schema/nodes/multiBodiedExtension.d.ts +3 -0
- package/dist/types/next-schema/nodes/nestedExpand.d.ts +3 -0
- package/dist/types/next-schema/nodes/panel.d.ts +3 -0
- package/dist/types/next-schema/nodes/paragraph.d.ts +3 -0
- package/dist/types/next-schema/nodes/placeholder.d.ts +3 -0
- package/dist/types/next-schema/nodes/rule.d.ts +3 -0
- package/dist/types/next-schema/nodes/status.d.ts +3 -0
- package/dist/types/next-schema/nodes/table.d.ts +3 -0
- package/dist/types/next-schema/nodes/tableCell.d.ts +3 -0
- package/dist/types/next-schema/nodes/tableHeader.d.ts +3 -0
- package/dist/types/next-schema/nodes/tableRow.d.ts +3 -0
- package/dist/types/next-schema/nodes/task.d.ts +6 -0
- package/dist/types/next-schema/nodes/text.d.ts +3 -0
- package/dist/types/next-schema/nodes/unsupportedBlock.d.ts +3 -0
- package/dist/types/next-schema/nodes/unsupportedInline.d.ts +3 -0
- package/package.json +2 -2
- package/schema-generators/__tests__/helpers/_utils.ts +123 -0
- package/schema-generators/__tests__/helpers/utils.unit.ts +66 -0
- package/schema-generators/__tests__/unit/json-full-schema.unit.ts +1142 -1231
- package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +157 -36
@@ -14,6 +14,9 @@ export declare const layoutSection: import("@atlaskit/adf-schema-generator/dist/
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,8 +14,11 @@ export declare const orderedList: import("@atlaskit/adf-schema-generator/dist/ty
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
20
23
|
export declare const bulletList: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
21
24
|
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
@@ -33,6 +36,9 @@ export declare const bulletList: import("@atlaskit/adf-schema-generator/dist/typ
|
|
33
36
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
34
37
|
isolating?: boolean;
|
35
38
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
39
|
+
allowAnyChildMark?: boolean;
|
40
|
+
allowNoChildMark?: boolean;
|
36
41
|
selectable?: boolean;
|
37
42
|
whitespace?: "pre" | "normal";
|
43
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
38
44
|
}>;
|
@@ -14,6 +14,9 @@ export declare const media: import("@atlaskit/adf-schema-generator/dist/types/ad
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const mediaGroup: import("@atlaskit/adf-schema-generator/dist/typ
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const mediaInline: import("@atlaskit/adf-schema-generator/dist/ty
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,8 +14,11 @@ export declare const mediaSingle: import("@atlaskit/adf-schema-generator/dist/ty
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
} & {
|
20
23
|
atom: false;
|
21
24
|
content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentOrSpec[];
|
@@ -14,6 +14,9 @@ export declare const mention: import("@atlaskit/adf-schema-generator/dist/types/
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const multiBodiedExtension: import("@atlaskit/adf-schema-generato
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const nestedExpand: import("@atlaskit/adf-schema-generator/dist/t
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const panel: import("@atlaskit/adf-schema-generator/dist/types/ad
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,8 +14,11 @@ export declare const paragraph: import("@atlaskit/adf-schema-generator/dist/type
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
} & {
|
20
23
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
21
24
|
} & {
|
@@ -14,6 +14,9 @@ export declare const placeholder: import("@atlaskit/adf-schema-generator/dist/ty
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const rule: import("@atlaskit/adf-schema-generator/dist/types/adf
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const status: import("@atlaskit/adf-schema-generator/dist/types/a
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const table: import("@atlaskit/adf-schema-generator/dist/types/ad
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const tableCell: import("@atlaskit/adf-schema-generator/dist/type
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const tableHeader: import("@atlaskit/adf-schema-generator/dist/ty
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const tableRow: import("@atlaskit/adf-schema-generator/dist/types
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,8 +14,11 @@ export declare const taskItem: import("@atlaskit/adf-schema-generator/dist/types
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
20
23
|
export declare const taskList: import("@atlaskit/adf-schema-generator/dist/types/adfNode").ADFNode<[string], {
|
21
24
|
ignore?: import("@atlaskit/adf-schema-generator/dist/types/transforms/transformerNames").TransformerNames[];
|
@@ -33,6 +36,9 @@ export declare const taskList: import("@atlaskit/adf-schema-generator/dist/types
|
|
33
36
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
34
37
|
isolating?: boolean;
|
35
38
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
39
|
+
allowAnyChildMark?: boolean;
|
40
|
+
allowNoChildMark?: boolean;
|
36
41
|
selectable?: boolean;
|
37
42
|
whitespace?: "pre" | "normal";
|
43
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
38
44
|
}>;
|
@@ -14,8 +14,11 @@ export declare const text: import("@atlaskit/adf-schema-generator/dist/types/adf
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
} & {
|
20
23
|
marks: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<import("@atlaskit/adf-schema-generator/dist/types/types/ADFMarkSpec").ADFMarkSpec>[];
|
21
24
|
} & {
|
@@ -14,6 +14,9 @@ export declare const unsupportedBlock: import("@atlaskit/adf-schema-generator/di
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
@@ -14,6 +14,9 @@ export declare const unsupportedInline: import("@atlaskit/adf-schema-generator/d
|
|
14
14
|
group?: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeGroup").ADFNodeGroup;
|
15
15
|
isolating?: boolean;
|
16
16
|
marks?: import("@atlaskit/adf-schema-generator/dist/types/adfMark").ADFMark<unknown>[];
|
17
|
+
allowAnyChildMark?: boolean;
|
18
|
+
allowNoChildMark?: boolean;
|
17
19
|
selectable?: boolean;
|
18
20
|
whitespace?: "pre" | "normal";
|
21
|
+
tableRole?: "table" | "row" | "cell" | "header_cell";
|
19
22
|
}>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "36.
|
3
|
+
"version": "36.15.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.14.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",
|
@@ -0,0 +1,123 @@
|
|
1
|
+
export const filterAndSortMarks = (marks: string, excluded = []) => {
|
2
|
+
return marks
|
3
|
+
.split(' ')
|
4
|
+
.filter((v) => !excluded.includes(v))
|
5
|
+
.sort()
|
6
|
+
.join(' ');
|
7
|
+
};
|
8
|
+
|
9
|
+
/**
|
10
|
+
* filter out the unsupported nodes in content expression
|
11
|
+
* @param skipLists list includes node name need to be excluded
|
12
|
+
* @returns content without node name defined in skipList
|
13
|
+
*/
|
14
|
+
const unSupportedExp =
|
15
|
+
(skipLists: string[] = []) =>
|
16
|
+
(str: string) => {
|
17
|
+
// this is used to treat cases like 'unsupportedBlock*'
|
18
|
+
if (str.endsWith('*')) {
|
19
|
+
return !skipLists.includes(str.substring(0, str.length - 1));
|
20
|
+
}
|
21
|
+
if (str.endsWith('+')) {
|
22
|
+
return !skipLists.includes(str.substring(0, str.length - 1));
|
23
|
+
}
|
24
|
+
return !skipLists.includes(str);
|
25
|
+
};
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Sort the nodes in (), and also exclude the node if matched in skipList
|
29
|
+
* @param input content expression, e.g. "(paragrah | heading)"
|
30
|
+
* @param skipLists a list defined node name can be removed from content expression.
|
31
|
+
* @param enableWrap flag to add back ()
|
32
|
+
* @returns
|
33
|
+
*/
|
34
|
+
const sortAndFilterOrsExp = (
|
35
|
+
input: string,
|
36
|
+
skipLists = [],
|
37
|
+
enableWrap = false,
|
38
|
+
) => {
|
39
|
+
const filteredOr = input.split('|').filter(unSupportedExp(skipLists));
|
40
|
+
if (filteredOr.length === 1) {
|
41
|
+
return `${filteredOr[0]}`;
|
42
|
+
}
|
43
|
+
if (enableWrap) {
|
44
|
+
return `(${filteredOr.sort().join('|')})`;
|
45
|
+
}
|
46
|
+
return `${filteredOr.sort().join('|')}`;
|
47
|
+
};
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Find the string inside () of provided string
|
51
|
+
* @param inputString input string likely have () in it
|
52
|
+
* @returns
|
53
|
+
*/
|
54
|
+
function findStringInParentheses(inputString: string) {
|
55
|
+
const regex = /\((.*?)\)/g;
|
56
|
+
const matches = inputString.match(regex);
|
57
|
+
if (matches) {
|
58
|
+
return matches.map((match) => match.replace('(', '').replace(')', ''));
|
59
|
+
} else {
|
60
|
+
return null;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Format the content expression
|
66
|
+
* @param exp content expression string, e.g. (aTest, bTest)+
|
67
|
+
* @param operatorStart could be {, +, *
|
68
|
+
* @param skipLists
|
69
|
+
* @returns sorted and removed node defined in skipList
|
70
|
+
*/
|
71
|
+
function formatExp(exp: string, operatorStart = '', skipLists = []) {
|
72
|
+
const orEnd = exp.indexOf(operatorStart);
|
73
|
+
const suffix = exp.substring(orEnd);
|
74
|
+
const matches = findStringInParentheses(exp);
|
75
|
+
if (matches) {
|
76
|
+
const temp = sortAndFilterOrsExp(matches[0], skipLists);
|
77
|
+
if (temp.includes('|')) {
|
78
|
+
return `(${temp})${suffix}`;
|
79
|
+
}
|
80
|
+
return `${temp}${suffix}`;
|
81
|
+
}
|
82
|
+
return sortAndFilterOrsExp(exp, skipLists);
|
83
|
+
}
|
84
|
+
|
85
|
+
const expFormatter =
|
86
|
+
(skipLists = []) =>
|
87
|
+
(content: string) => {
|
88
|
+
if (content.includes('|')) {
|
89
|
+
if (content.endsWith('}')) {
|
90
|
+
return formatExp(content, '{', skipLists);
|
91
|
+
}
|
92
|
+
if (content.endsWith('+')) {
|
93
|
+
return formatExp(content, '+', skipLists);
|
94
|
+
}
|
95
|
+
if (content.endsWith('*')) {
|
96
|
+
return formatExp(content, '*', skipLists);
|
97
|
+
}
|
98
|
+
if (!content.includes('+') && !content.includes('*')) {
|
99
|
+
if (content.startsWith('(') && content.endsWith(')')) {
|
100
|
+
const temp = content.substring(1, content.length - 1);
|
101
|
+
return `(${sortAndFilterOrsExp(temp, skipLists)})`;
|
102
|
+
}
|
103
|
+
return sortAndFilterOrsExp(content, skipLists);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
return sortAndFilterOrsExp(content, skipLists);
|
107
|
+
};
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Sort the node inside of () in contents string,
|
111
|
+
* remove spaces around '|', because there were inconsistence in legacy PM schema
|
112
|
+
* remove not supported nodes defined in skipList
|
113
|
+
* @param content contents string, e.g. (aTest | bTest)+ (cTest | dTest)*
|
114
|
+
* @param skipLists a list contains node name can be removed from contents string
|
115
|
+
* @returns sorted content string, without node defined in skipList
|
116
|
+
*/
|
117
|
+
export const formatContent = (content: string, skipLists = []) => {
|
118
|
+
const result = content.replace(/\s*\|\s*/g, '|');
|
119
|
+
if (result.includes(' ')) {
|
120
|
+
return result.split(' ').map(expFormatter(skipLists)).join(' ').trim();
|
121
|
+
}
|
122
|
+
return expFormatter(skipLists)(result).trim();
|
123
|
+
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { filterAndSortMarks, formatContent } from './_utils';
|
2
|
+
|
3
|
+
describe('formatContent', () => {
|
4
|
+
it('should reorder within () with multiple content', () => {
|
5
|
+
expect(formatContent('(dTest | aTest)+ (dTest | aTest)*')).toEqual(
|
6
|
+
'(aTest|dTest)+ (aTest|dTest)*',
|
7
|
+
);
|
8
|
+
});
|
9
|
+
|
10
|
+
it('should reorder within () with multiple content, and if first content has no operator', () => {
|
11
|
+
expect(formatContent('(dTest | aTest) (dTest | aTest)*')).toEqual(
|
12
|
+
'(aTest|dTest) (aTest|dTest)*',
|
13
|
+
);
|
14
|
+
});
|
15
|
+
|
16
|
+
it('should reorder within (), and no operator for single content', () => {
|
17
|
+
expect(formatContent('dTest | aTest')).toEqual('aTest|dTest');
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should keep parentheses with multiple content', () => {
|
21
|
+
expect(formatContent('(taskItem)+ (dTest|aTest)*')).toEqual(
|
22
|
+
'(taskItem)+ (aTest|dTest)*',
|
23
|
+
);
|
24
|
+
});
|
25
|
+
|
26
|
+
it('should keep parentheses with single content', () => {
|
27
|
+
expect(formatContent('(taskItem)+')).toEqual('(taskItem)+');
|
28
|
+
});
|
29
|
+
|
30
|
+
it('should remove unsupported strings and unnessary braces with onePlus and zeroPlus exps', () => {
|
31
|
+
expect(
|
32
|
+
formatContent(
|
33
|
+
'(taskItem|unsupportedBlock)+ (testA|testB|unsupportedBlock)*',
|
34
|
+
['unsupportedBlock'],
|
35
|
+
),
|
36
|
+
).toEqual('taskItem+ (testA|testB)*');
|
37
|
+
});
|
38
|
+
|
39
|
+
it('should remove unsupported strings with range exp', () => {
|
40
|
+
expect(
|
41
|
+
formatContent(
|
42
|
+
'(layoutColumn|unsupportedBlock){1,3} (testA|testB|unsupportedBlock)*',
|
43
|
+
['unsupportedBlock'],
|
44
|
+
),
|
45
|
+
).toEqual('layoutColumn{1,3} (testA|testB)*');
|
46
|
+
});
|
47
|
+
|
48
|
+
it('should remove all unsupported strings in between "|"', () => {
|
49
|
+
expect(
|
50
|
+
formatContent('aTest | unsupportedBlock* | unsupportedBlock+', [
|
51
|
+
'unsupportedBlock',
|
52
|
+
]),
|
53
|
+
).toEqual('aTest');
|
54
|
+
});
|
55
|
+
});
|
56
|
+
|
57
|
+
describe('filterMarks', () => {
|
58
|
+
it('should remove marks if excludes defined', () => {
|
59
|
+
expect(
|
60
|
+
filterAndSortMarks(
|
61
|
+
'unsupportedMark unsupportedNodeAttributes testMarkA testMarkB',
|
62
|
+
['unsupportedMark', 'unsupportedNodeAttributes'],
|
63
|
+
),
|
64
|
+
).toEqual('testMarkA testMarkB');
|
65
|
+
});
|
66
|
+
});
|