@atlaskit/adf-schema 24.0.0 → 24.0.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 +13 -0
- package/dist/cjs/schema/nodes/block-card.js +3 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/schema/nodes/block-card.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/schema/nodes/block-card.js +3 -1
- package/dist/esm/version.json +1 -1
- package/dist/json-schema/package.json +8 -1
- package/dist/types-ts4.0/index.d.ts +4 -0
- package/dist/types-ts4.0/json-schema/index.d.ts +2 -0
- package/dist/types-ts4.0/schema/bitbucket-schema.d.ts +2 -0
- package/dist/types-ts4.0/schema/confluence-schema.d.ts +3 -0
- package/dist/types-ts4.0/schema/create-schema.d.ts +32 -0
- package/dist/types-ts4.0/schema/default-schema.d.ts +7 -0
- package/dist/types-ts4.0/schema/groups.d.ts +6 -0
- package/dist/types-ts4.0/schema/index.d.ts +7 -0
- package/dist/types-ts4.0/schema/inline-nodes.d.ts +1 -0
- package/dist/types-ts4.0/schema/jira-schema.d.ts +26 -0
- package/dist/types-ts4.0/schema/marks/alignment.d.ts +16 -0
- package/dist/types-ts4.0/schema/marks/annotation.d.ts +32 -0
- package/dist/types-ts4.0/schema/marks/breakout.d.ts +12 -0
- package/dist/types-ts4.0/schema/marks/code.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/confluence-inline-comment.d.ts +12 -0
- package/dist/types-ts4.0/schema/marks/data-consumer.d.ts +48 -0
- package/dist/types-ts4.0/schema/marks/em.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/fragment.d.ts +29 -0
- package/dist/types-ts4.0/schema/marks/indentation.d.ts +16 -0
- package/dist/types-ts4.0/schema/marks/index.d.ts +32 -0
- package/dist/types-ts4.0/schema/marks/link.d.ts +35 -0
- package/dist/types-ts4.0/schema/marks/strike.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/strong.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/subsup.d.ts +15 -0
- package/dist/types-ts4.0/schema/marks/text-color.d.ts +21 -0
- package/dist/types-ts4.0/schema/marks/type-ahead-query.d.ts +2 -0
- package/dist/types-ts4.0/schema/marks/underline.d.ts +8 -0
- package/dist/types-ts4.0/schema/marks/unsupported-mark.d.ts +2 -0
- package/dist/types-ts4.0/schema/marks/unsupported-node-attributes.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/block-card.d.ts +22 -0
- package/dist/types-ts4.0/schema/nodes/blockquote.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/bodied-extension.d.ts +24 -0
- package/dist/types-ts4.0/schema/nodes/bullet-list.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/caption.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/code-block.d.ts +31 -0
- package/dist/types-ts4.0/schema/nodes/confluence-jira-issue.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/confluence-unsupported-block.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/confluence-unsupported-inline.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/date.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/decision-item.d.ts +17 -0
- package/dist/types-ts4.0/schema/nodes/decision-list.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/doc.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/embed-card.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/emoji.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/expand.d.ts +33 -0
- package/dist/types-ts4.0/schema/nodes/extension.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/hard-break.d.ts +11 -0
- package/dist/types-ts4.0/schema/nodes/heading.d.ts +36 -0
- package/dist/types-ts4.0/schema/nodes/image.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/index.d.ts +93 -0
- package/dist/types-ts4.0/schema/nodes/inline-card.d.ts +10 -0
- package/dist/types-ts4.0/schema/nodes/inline-extension.d.ts +18 -0
- package/dist/types-ts4.0/schema/nodes/layout-column.d.ts +21 -0
- package/dist/types-ts4.0/schema/nodes/layout-section.d.ts +44 -0
- package/dist/types-ts4.0/schema/nodes/list-item.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/media-group.d.ts +14 -0
- package/dist/types-ts4.0/schema/nodes/media-inline.d.ts +16 -0
- package/dist/types-ts4.0/schema/nodes/media-single.d.ts +61 -0
- package/dist/types-ts4.0/schema/nodes/media.d.ts +60 -0
- package/dist/types-ts4.0/schema/nodes/mention.d.ts +26 -0
- package/dist/types-ts4.0/schema/nodes/nested-expand.d.ts +27 -0
- package/dist/types-ts4.0/schema/nodes/ordered-list.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/panel.d.ts +38 -0
- package/dist/types-ts4.0/schema/nodes/paragraph.d.ts +37 -0
- package/dist/types-ts4.0/schema/nodes/placeholder.d.ts +11 -0
- package/dist/types-ts4.0/schema/nodes/rule.d.ts +8 -0
- package/dist/types-ts4.0/schema/nodes/status.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/tableNodes.d.ts +113 -0
- package/dist/types-ts4.0/schema/nodes/task-item.d.ts +17 -0
- package/dist/types-ts4.0/schema/nodes/task-list.d.ts +21 -0
- package/dist/types-ts4.0/schema/nodes/text.d.ts +15 -0
- package/dist/types-ts4.0/schema/nodes/types/block-content.d.ts +22 -0
- package/dist/types-ts4.0/schema/nodes/types/extensions.d.ts +34 -0
- package/dist/types-ts4.0/schema/nodes/types/inline-content.d.ts +32 -0
- package/dist/types-ts4.0/schema/nodes/types/mark.d.ts +15 -0
- package/dist/types-ts4.0/schema/nodes/types/non-nestable-block-content.d.ts +20 -0
- package/dist/types-ts4.0/schema/nodes/types/rich-media-common.d.ts +9 -0
- package/dist/types-ts4.0/schema/nodes/unknown-block.d.ts +3 -0
- package/dist/types-ts4.0/schema/nodes/unsupported-block.d.ts +2 -0
- package/dist/types-ts4.0/schema/nodes/unsupported-inline.d.ts +2 -0
- package/dist/types-ts4.0/schema/unsupported.d.ts +1 -0
- package/dist/types-ts4.0/steps/analytics.d.ts +59 -0
- package/dist/types-ts4.0/steps/set-attrs.d.ts +23 -0
- package/dist/types-ts4.0/steps/table/add-column.d.ts +88 -0
- package/dist/types-ts4.0/steps/table/constants.d.ts +4 -0
- package/dist/types-ts4.0/steps/table/sort-column.d.ts +18 -0
- package/dist/types-ts4.0/steps/table/types.d.ts +39 -0
- package/dist/types-ts4.0/steps/table/utils/cell-step.d.ts +51 -0
- package/dist/types-ts4.0/steps/table/utils/cells-at-column.d.ts +20 -0
- package/dist/types-ts4.0/steps/table/utils/find-column.d.ts +8 -0
- package/dist/types-ts4.0/steps/table/utils/get-table-rect-from-doc.d.ts +8 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/rows.d.ts +25 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/side-effects.d.ts +15 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/table.d.ts +16 -0
- package/dist/types-ts4.0/steps/table/utils/side-effects/types.d.ts +33 -0
- package/dist/types-ts4.0/steps/table/utils/table-map.d.ts +6 -0
- package/dist/types-ts4.0/steps/type-ahead.d.ts +35 -0
- package/dist/types-ts4.0/steps.d.ts +8 -0
- package/dist/types-ts4.0/utils/colors.d.ts +71 -0
- package/dist/types-ts4.0/utils/confluence/emoji.d.ts +50 -0
- package/dist/types-ts4.0/utils/extensions.d.ts +3 -0
- package/dist/types-ts4.0/utils/index.d.ts +6 -0
- package/dist/types-ts4.0/utils/parseDOM.d.ts +1 -0
- package/dist/types-ts4.0/utils/url.d.ts +23 -0
- package/dist/types-ts4.0/utils/uuid.d.ts +5 -0
- package/json-schema/package.json +8 -1
- package/package.json +11 -4
- package/report.api.md +5 -3
- package/schema/package.json +8 -1
- package/schema-bitbucket/package.json +8 -1
- package/schema-confluence/package.json +8 -1
- package/schema-default/package.json +8 -1
- package/schema-jira/package.json +8 -1
- package/steps/package.json +8 -1
- package/url/package.json +8 -1
@@ -0,0 +1,26 @@
|
|
1
|
+
import { NodeSpec, Node as PMNode } from 'prosemirror-model';
|
2
|
+
export declare enum USER_TYPES {
|
3
|
+
DEFAULT = "DEFAULT",
|
4
|
+
SPECIAL = "SPECIAL",
|
5
|
+
APP = "APP"
|
6
|
+
}
|
7
|
+
export declare type UserType = keyof typeof USER_TYPES;
|
8
|
+
export interface MentionAttributes {
|
9
|
+
id: string;
|
10
|
+
text?: string;
|
11
|
+
userType?: UserType;
|
12
|
+
accessLevel?: string;
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* @name mention_node
|
16
|
+
*/
|
17
|
+
export interface MentionDefinition {
|
18
|
+
type: 'mention';
|
19
|
+
attrs: MentionAttributes;
|
20
|
+
}
|
21
|
+
export declare const mention: NodeSpec;
|
22
|
+
export declare const toJSON: (node: PMNode) => {
|
23
|
+
attrs: {
|
24
|
+
[key: string]: any;
|
25
|
+
};
|
26
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { NoMark } from './types/mark';
|
3
|
+
import { ParagraphDefinition as Paragraph } from './paragraph';
|
4
|
+
import { HeadingDefinition as Heading } from './heading';
|
5
|
+
import { MediaSingleDefinition as MediaSingle } from './media-single';
|
6
|
+
import { MediaGroupDefinition as MediaGroup } from './media-group';
|
7
|
+
/**
|
8
|
+
* @name nestedExpand_content
|
9
|
+
* @minItems 1
|
10
|
+
* @allowUnsupportedBlock true
|
11
|
+
*/
|
12
|
+
export declare type NestedExpandContent = Array<Paragraph | Heading | MediaSingle | MediaGroup>;
|
13
|
+
/**
|
14
|
+
* @name nestedExpand_node
|
15
|
+
*/
|
16
|
+
export interface NestedExpandBaseDefinition {
|
17
|
+
type: 'nestedExpand';
|
18
|
+
attrs: {
|
19
|
+
title?: string;
|
20
|
+
};
|
21
|
+
content: NestedExpandContent;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* @name nestedExpand_with_no_marks_node
|
25
|
+
*/
|
26
|
+
export declare type NestedExpandDefinition = NestedExpandBaseDefinition & NoMark;
|
27
|
+
export declare const nestedExpand: NodeSpec;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { ListItemDefinition as ListItemNode } from './list-item';
|
3
|
+
/**
|
4
|
+
* @name orderedList_node
|
5
|
+
*/
|
6
|
+
export interface OrderedListDefinition {
|
7
|
+
type: 'orderedList';
|
8
|
+
/**
|
9
|
+
* @minItems 1
|
10
|
+
*/
|
11
|
+
content: Array<ListItemNode>;
|
12
|
+
attrs?: {
|
13
|
+
/**
|
14
|
+
* @minimum 1
|
15
|
+
*/
|
16
|
+
order: number;
|
17
|
+
};
|
18
|
+
}
|
19
|
+
export declare const orderedListSelector = ".ak-ol";
|
20
|
+
export declare const orderedList: NodeSpec;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { ParagraphDefinition as Paragraph } from './paragraph';
|
3
|
+
import { OrderedListDefinition as OrderedList } from './ordered-list';
|
4
|
+
import { BulletListDefinition as BulletList } from './bullet-list';
|
5
|
+
import { HeadingDefinition as Heading } from './heading';
|
6
|
+
import { BlockCardDefinition as BlockCard } from './block-card';
|
7
|
+
export declare enum PanelType {
|
8
|
+
INFO = "info",
|
9
|
+
NOTE = "note",
|
10
|
+
TIP = "tip",
|
11
|
+
WARNING = "warning",
|
12
|
+
ERROR = "error",
|
13
|
+
SUCCESS = "success",
|
14
|
+
CUSTOM = "custom"
|
15
|
+
}
|
16
|
+
export interface PanelAttributes {
|
17
|
+
panelType: PanelType;
|
18
|
+
panelIcon?: string;
|
19
|
+
panelIconId?: string;
|
20
|
+
panelIconText?: string;
|
21
|
+
panelColor?: string;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* @name panel_node
|
25
|
+
*/
|
26
|
+
export interface PanelDefinition {
|
27
|
+
type: 'panel';
|
28
|
+
attrs: PanelAttributes;
|
29
|
+
/**
|
30
|
+
* @minItems 1
|
31
|
+
* @allowUnsupportedBlock true
|
32
|
+
*/
|
33
|
+
content: Array<Paragraph | Heading | OrderedList | BulletList | BlockCard>;
|
34
|
+
}
|
35
|
+
export interface DOMAttributes {
|
36
|
+
[propName: string]: string;
|
37
|
+
}
|
38
|
+
export declare const panel: (allowCustomPanel: boolean) => NodeSpec;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { AlignmentMarkDefinition, IndentationMarkDefinition } from '../marks';
|
3
|
+
import { MarksObject, NoMark } from './types/mark';
|
4
|
+
import { Inline } from './types/inline-content';
|
5
|
+
/**
|
6
|
+
* @name paragraph_node
|
7
|
+
*/
|
8
|
+
export interface ParagraphBaseDefinition {
|
9
|
+
type: 'paragraph';
|
10
|
+
/**
|
11
|
+
* @allowUnsupportedInline true
|
12
|
+
*/
|
13
|
+
content?: Array<Inline>;
|
14
|
+
marks?: Array<any>;
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* @name paragraph_with_no_marks_node
|
18
|
+
*/
|
19
|
+
export declare type ParagraphDefinition = ParagraphBaseDefinition & NoMark;
|
20
|
+
/**
|
21
|
+
* NOTE: Need this because TS is too smart and inline everything.
|
22
|
+
* So we need to give them separate identity.
|
23
|
+
* Probably there's a way to solve it but that will need time and exploration.
|
24
|
+
* // http://bit.ly/2raXFX5
|
25
|
+
* type T1 = X | Y
|
26
|
+
* type T2 = A | T1 | B // T2 = A | X | Y | B
|
27
|
+
*/
|
28
|
+
/**
|
29
|
+
* @name paragraph_with_alignment_node
|
30
|
+
*/
|
31
|
+
export declare type ParagraphWithAlignmentDefinition = ParagraphBaseDefinition & MarksObject<AlignmentMarkDefinition>;
|
32
|
+
/**
|
33
|
+
* @name paragraph_with_indentation_node
|
34
|
+
*/
|
35
|
+
export declare type ParagraphWithIndentationDefinition = ParagraphBaseDefinition & MarksObject<IndentationMarkDefinition>;
|
36
|
+
export declare type ParagraphWithMarksDefinition = ParagraphWithAlignmentDefinition | ParagraphWithIndentationDefinition;
|
37
|
+
export declare const paragraph: NodeSpec;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* @name status_node
|
4
|
+
*/
|
5
|
+
export interface StatusDefinition {
|
6
|
+
type: 'status';
|
7
|
+
attrs: {
|
8
|
+
/**
|
9
|
+
* @minLength 1
|
10
|
+
*/
|
11
|
+
text: string;
|
12
|
+
color: 'neutral' | 'purple' | 'blue' | 'red' | 'yellow' | 'green';
|
13
|
+
localId?: string;
|
14
|
+
/**
|
15
|
+
* Supported values are bold and subtle
|
16
|
+
*/
|
17
|
+
style?: string;
|
18
|
+
};
|
19
|
+
}
|
20
|
+
export declare const status: NodeSpec;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import { Node as PmNode, NodeSpec } from 'prosemirror-model';
|
2
|
+
import { CellAttributes } from '@atlaskit/editor-tables/types';
|
3
|
+
import { PanelDefinition as Panel } from './panel';
|
4
|
+
import { ParagraphDefinition as Paragraph, ParagraphWithAlignmentDefinition as ParagraphWithMarks } from './paragraph';
|
5
|
+
import { BlockQuoteDefinition as Blockquote } from './blockquote';
|
6
|
+
import { OrderedListDefinition as OrderedList } from './ordered-list';
|
7
|
+
import { BulletListDefinition as BulletList } from './bullet-list';
|
8
|
+
import { RuleDefinition as Rule } from './rule';
|
9
|
+
import { HeadingDefinition as Heading, HeadingWithMarksDefinition as HeadingWithMarks } from './heading';
|
10
|
+
import { CodeBlockDefinition as CodeBlock } from './code-block';
|
11
|
+
import { MediaGroupDefinition as MediaGroup } from './media-group';
|
12
|
+
import { MediaSingleDefinition as MediaSingle } from './media-single';
|
13
|
+
import { DecisionListDefinition as DecisionList } from './decision-list';
|
14
|
+
import { TaskListDefinition as TaskList } from './task-list';
|
15
|
+
import { ExtensionDefinition as Extension } from './extension';
|
16
|
+
import { BlockCardDefinition as BlockCard } from './block-card';
|
17
|
+
import { EmbedCardDefinition as EmbedCard } from './embed-card';
|
18
|
+
import { NestedExpandDefinition as NestedExpand } from './nested-expand';
|
19
|
+
import { FragmentDefinition } from '../marks/fragment';
|
20
|
+
export type { CellAttributes };
|
21
|
+
export declare const tablePrefixSelector = "pm-table";
|
22
|
+
export declare const tableCellSelector: string;
|
23
|
+
export declare const tableHeaderSelector: string;
|
24
|
+
export declare const tableCellContentWrapperSelector: string;
|
25
|
+
export declare const tableCellContentDomSelector: string;
|
26
|
+
export declare const getCellAttrs: (dom: HTMLElement, defaultValues?: CellAttributes) => {
|
27
|
+
colspan: number;
|
28
|
+
rowspan: number;
|
29
|
+
colwidth: number[] | null;
|
30
|
+
background: string | null;
|
31
|
+
};
|
32
|
+
export declare type CellDomAttrs = {
|
33
|
+
colspan?: string;
|
34
|
+
rowspan?: string;
|
35
|
+
style?: string;
|
36
|
+
colorname?: string;
|
37
|
+
'data-colwidth'?: string;
|
38
|
+
class?: string;
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* gets cell dom attributes based on node attributes
|
42
|
+
* @returns CellDomAttrs
|
43
|
+
*/
|
44
|
+
export declare const getCellDomAttrs: (node: PmNode) => CellDomAttrs;
|
45
|
+
export declare const tableBackgroundColorPalette: Map<string, string>;
|
46
|
+
export declare const tableBackgroundBorderColor: string;
|
47
|
+
export declare const tableBackgroundColorNames: Map<string, string>;
|
48
|
+
export declare type Layout = 'default' | 'full-width' | 'wide';
|
49
|
+
export interface TableAttributes {
|
50
|
+
isNumberColumnEnabled?: boolean;
|
51
|
+
layout?: Layout;
|
52
|
+
__autoSize?: boolean;
|
53
|
+
/**
|
54
|
+
* @minLength 1
|
55
|
+
*/
|
56
|
+
localId?: string;
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* @name table_node
|
60
|
+
*/
|
61
|
+
export interface TableDefinition {
|
62
|
+
type: 'table';
|
63
|
+
attrs?: TableAttributes;
|
64
|
+
/**
|
65
|
+
* @minItems 1
|
66
|
+
*/
|
67
|
+
content: Array<TableRow>;
|
68
|
+
marks?: Array<FragmentDefinition>;
|
69
|
+
}
|
70
|
+
/**
|
71
|
+
* @name table_row_node
|
72
|
+
*/
|
73
|
+
export interface TableRow {
|
74
|
+
type: 'tableRow';
|
75
|
+
content: Array<TableHeader | TableCell>;
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* @name table_cell_content
|
79
|
+
* @minItems 1
|
80
|
+
* @allowUnsupportedBlock true
|
81
|
+
*/
|
82
|
+
export declare type TableCellContent = Array<Panel | Paragraph | ParagraphWithMarks | Blockquote | OrderedList | BulletList | Rule | Heading | HeadingWithMarks | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Extension | BlockCard | NestedExpand | EmbedCard>;
|
83
|
+
/**
|
84
|
+
* @name table_cell_node
|
85
|
+
*/
|
86
|
+
export interface TableCell {
|
87
|
+
type: 'tableCell';
|
88
|
+
attrs?: CellAttributes;
|
89
|
+
content: TableCellContent;
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* @name table_header_node
|
93
|
+
*/
|
94
|
+
export interface TableHeader {
|
95
|
+
type: 'tableHeader';
|
96
|
+
attrs?: CellAttributes;
|
97
|
+
content: TableCellContent;
|
98
|
+
}
|
99
|
+
export declare const table: NodeSpec;
|
100
|
+
export declare const tableToJSON: (node: PmNode) => {
|
101
|
+
attrs: {
|
102
|
+
[key: string]: any;
|
103
|
+
};
|
104
|
+
};
|
105
|
+
export declare const tableRow: NodeSpec;
|
106
|
+
export declare const tableCell: NodeSpec;
|
107
|
+
export declare const toJSONTableCell: (node: PmNode) => {
|
108
|
+
attrs: Record<string, any>;
|
109
|
+
};
|
110
|
+
export declare const tableHeader: NodeSpec;
|
111
|
+
export declare const toJSONTableHeader: (node: PmNode) => {
|
112
|
+
attrs: Record<string, any>;
|
113
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { Inline } from './types/inline-content';
|
3
|
+
/**
|
4
|
+
* @name taskItem_node
|
5
|
+
*/
|
6
|
+
export interface TaskItemDefinition {
|
7
|
+
type: 'taskItem';
|
8
|
+
/**
|
9
|
+
* @allowUnsupportedInline true
|
10
|
+
*/
|
11
|
+
content?: Array<Inline>;
|
12
|
+
attrs: {
|
13
|
+
localId: string;
|
14
|
+
state: 'TODO' | 'DONE';
|
15
|
+
};
|
16
|
+
}
|
17
|
+
export declare const taskItem: NodeSpec;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { TaskItemDefinition as TaskItemNode } from './task-item';
|
3
|
+
export interface TaskListContent extends Array<TaskItemNode | TaskListDefinition> {
|
4
|
+
0: TaskItemNode;
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* @name taskList_node
|
8
|
+
*/
|
9
|
+
export interface TaskListDefinition {
|
10
|
+
type: 'taskList';
|
11
|
+
/**
|
12
|
+
* @minItems 1
|
13
|
+
* @allowUnsupportedBlock true
|
14
|
+
*/
|
15
|
+
content: TaskListContent;
|
16
|
+
attrs: {
|
17
|
+
localId: string;
|
18
|
+
};
|
19
|
+
}
|
20
|
+
export declare const taskListSelector: string;
|
21
|
+
export declare const taskList: NodeSpec;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
/**
|
3
|
+
* @name text_node
|
4
|
+
*/
|
5
|
+
export interface TextDefinition {
|
6
|
+
type: 'text';
|
7
|
+
/**
|
8
|
+
* @minLength 1
|
9
|
+
*/
|
10
|
+
text: string;
|
11
|
+
marks?: Array<any>;
|
12
|
+
}
|
13
|
+
export declare const text: NodeSpec & {
|
14
|
+
toDebugString?: () => string;
|
15
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ExpandDefinition as Expand } from '../expand';
|
2
|
+
import { BodiedExtensionDefinition as BodiedExtension } from '../bodied-extension';
|
3
|
+
import { PanelDefinition as Panel } from '../panel';
|
4
|
+
import { ParagraphDefinition as Paragraph, ParagraphWithMarksDefinition as ParagraphWithMarks } from '../paragraph';
|
5
|
+
import { BlockQuoteDefinition as Blockquote } from '../blockquote';
|
6
|
+
import { OrderedListDefinition as OrderedList } from '../ordered-list';
|
7
|
+
import { BulletListDefinition as BulletList } from '../bullet-list';
|
8
|
+
import { RuleDefinition as Rule } from '../rule';
|
9
|
+
import { HeadingDefinition as Heading, HeadingWithMarksDefinition as HeadingWithMarks } from '../heading';
|
10
|
+
import { CodeBlockDefinition as CodeBlock } from '../code-block';
|
11
|
+
import { MediaGroupDefinition as MediaGroup } from '../media-group';
|
12
|
+
import { MediaSingleDefinition as MediaSingle } from '../media-single';
|
13
|
+
import { DecisionListDefinition as DecisionList } from '../decision-list';
|
14
|
+
import { TaskListDefinition as TaskList } from '../task-list';
|
15
|
+
import { TableDefinition as Table } from '../tableNodes';
|
16
|
+
import { ExtensionDefinition as Extension } from '../extension';
|
17
|
+
import { BlockCardDefinition as BlockCard } from '../block-card';
|
18
|
+
import { EmbedCardDefinition as EmbedCard } from '../embed-card';
|
19
|
+
/**
|
20
|
+
* @name block_content
|
21
|
+
*/
|
22
|
+
export declare type BlockContent = Panel | Paragraph | ParagraphWithMarks | Blockquote | OrderedList | BulletList | Rule | Heading | HeadingWithMarks | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Table | Expand | Extension | BodiedExtension | BlockCard | EmbedCard;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
export declare type Layout = 'default' | 'wide' | 'full-width';
|
2
|
+
export interface ExtensionAttributes {
|
3
|
+
/**
|
4
|
+
* @minLength 1
|
5
|
+
*/
|
6
|
+
extensionKey: string;
|
7
|
+
/**
|
8
|
+
* @minLength 1
|
9
|
+
*/
|
10
|
+
extensionType: string;
|
11
|
+
parameters?: object;
|
12
|
+
text?: string;
|
13
|
+
layout?: Layout;
|
14
|
+
/**
|
15
|
+
* @minLength 1
|
16
|
+
*/
|
17
|
+
localId?: string;
|
18
|
+
}
|
19
|
+
export interface InlineExtensionAttributes {
|
20
|
+
/**
|
21
|
+
* @minLength 1
|
22
|
+
*/
|
23
|
+
extensionKey: string;
|
24
|
+
/**
|
25
|
+
* @minLength 1
|
26
|
+
*/
|
27
|
+
extensionType: string;
|
28
|
+
parameters?: object;
|
29
|
+
text?: string;
|
30
|
+
/**
|
31
|
+
* @minLength 1
|
32
|
+
*/
|
33
|
+
localId?: string;
|
34
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { HardBreakDefinition as HardBreak } from '../hard-break';
|
2
|
+
import { MentionDefinition as Mention } from '../mention';
|
3
|
+
import { EmojiDefinition as Emoji } from '../emoji';
|
4
|
+
import { InlineExtensionDefinition } from '../inline-extension';
|
5
|
+
import { DateDefinition as Date } from '../date';
|
6
|
+
import { PlaceholderDefinition as Placeholder } from '../placeholder';
|
7
|
+
import { InlineCardDefinition as InlineCard } from '../inline-card';
|
8
|
+
import { StatusDefinition as Status } from '../status';
|
9
|
+
import { TextDefinition as Text } from '../text';
|
10
|
+
import { MarksObject } from './mark';
|
11
|
+
import { AnnotationMarkDefinition as Annotation, CodeDefinition as Code, EmDefinition as Em, LinkDefinition as Link, StrikeDefinition as Strike, StrongDefinition as Strong, SubSupDefinition as SubSup, TextColorDefinition as TextColor, UnderlineDefinition as Underline } from '../../marks';
|
12
|
+
import { MediaInlineDefinition } from '../media-inline';
|
13
|
+
/**
|
14
|
+
* @name formatted_text_inline_node
|
15
|
+
*/
|
16
|
+
export declare type InlineFormattedText = Text & MarksObject<Link | Em | Strong | Strike | SubSup | Underline | TextColor | Annotation>;
|
17
|
+
/**
|
18
|
+
* @name link_text_inline_node
|
19
|
+
*/
|
20
|
+
export declare type InlineLinkText = Text & MarksObject<Link>;
|
21
|
+
/**
|
22
|
+
* @name code_inline_node
|
23
|
+
*/
|
24
|
+
export declare type InlineCode = Text & MarksObject<Code | Link | Annotation>;
|
25
|
+
/**
|
26
|
+
* @name atomic_inline_node
|
27
|
+
*/
|
28
|
+
export declare type InlineAtomic = HardBreak | Mention | Emoji | InlineExtensionDefinition | Date | Placeholder | InlineCard | Status | MediaInlineDefinition;
|
29
|
+
/**
|
30
|
+
* @name inline_node
|
31
|
+
*/
|
32
|
+
export declare type Inline = InlineFormattedText | InlineCode | InlineAtomic;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { PanelDefinition as Panel } from '../panel';
|
2
|
+
import { ParagraphDefinition as Paragraph } from '../paragraph';
|
3
|
+
import { BlockQuoteDefinition as Blockquote } from '../blockquote';
|
4
|
+
import { OrderedListDefinition as OrderedList } from '../ordered-list';
|
5
|
+
import { BulletListDefinition as BulletList } from '../bullet-list';
|
6
|
+
import { RuleDefinition as Rule } from '../rule';
|
7
|
+
import { HeadingDefinition as Heading } from '../heading';
|
8
|
+
import { CodeBlockDefinition as CodeBlock } from '../code-block';
|
9
|
+
import { MediaGroupDefinition as MediaGroup } from '../media-group';
|
10
|
+
import { MediaSingleDefinition as MediaSingle } from '../media-single';
|
11
|
+
import { DecisionListDefinition as DecisionList } from '../decision-list';
|
12
|
+
import { TaskListDefinition as TaskList } from '../task-list';
|
13
|
+
import { TableDefinition as Table } from '../tableNodes';
|
14
|
+
import { ExtensionDefinition as Extension } from '../extension';
|
15
|
+
import { BlockCardDefinition as BlockCard } from '../block-card';
|
16
|
+
import { EmbedCardDefinition as EmbedCard } from '../embed-card';
|
17
|
+
/**
|
18
|
+
* @name non_nestable_block_content
|
19
|
+
*/
|
20
|
+
export declare type NonNestableBlockContent = Panel | Paragraph | Blockquote | OrderedList | BulletList | Rule | Heading | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Table | Extension | BlockCard | EmbedCard;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const unsupportedNodeTypesForMediaCards: Set<string>;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { Node as PMNode } from 'prosemirror-model';
|
2
|
+
import { Step, StepResult, StepMap, ReplaceStep, Mappable } from 'prosemirror-transform';
|
3
|
+
export declare const analyticsStepType = "atlaskit-analytics";
|
4
|
+
export declare const analyticsInvertStepType = "atlaskit-analytics-invert";
|
5
|
+
export interface AnalyticsPayload {
|
6
|
+
action: string;
|
7
|
+
actionSubject: string;
|
8
|
+
actionSubjectId?: string | null;
|
9
|
+
attributes?: Record<string, any>;
|
10
|
+
eventType: string;
|
11
|
+
}
|
12
|
+
export interface AnalyticsWithChannel<P extends AnalyticsPayload> {
|
13
|
+
payload: P;
|
14
|
+
channel: string;
|
15
|
+
}
|
16
|
+
declare enum HISTORY_ACTIONS {
|
17
|
+
UNDID = "undid",
|
18
|
+
REDID = "redid"
|
19
|
+
}
|
20
|
+
interface UndoAnalyticsEventPayload {
|
21
|
+
action: HISTORY_ACTIONS.UNDID;
|
22
|
+
actionSubject: string;
|
23
|
+
actionSubjectId?: string;
|
24
|
+
attributes?: Record<string, any>;
|
25
|
+
eventType: string;
|
26
|
+
}
|
27
|
+
interface RedoAnalyticsEventPayload {
|
28
|
+
action: HISTORY_ACTIONS.REDID;
|
29
|
+
actionSubject: string;
|
30
|
+
actionSubjectId?: string;
|
31
|
+
attributes?: Record<string, any>;
|
32
|
+
eventType: string;
|
33
|
+
}
|
34
|
+
declare type AnalyticsInvertPayload = UndoAnalyticsEventPayload | RedoAnalyticsEventPayload;
|
35
|
+
export declare type AnalyticsInvertStep = AnalyticsStep<AnalyticsInvertPayload>;
|
36
|
+
/**
|
37
|
+
* Custom Prosemirror Step to fire our GAS V3 analytics events
|
38
|
+
* Using a Step means that it will work with prosemirror-history and we get
|
39
|
+
* undo/redo events for free
|
40
|
+
*/
|
41
|
+
export declare class AnalyticsStep<P extends AnalyticsPayload> extends Step {
|
42
|
+
analyticsEvents: AnalyticsWithChannel<P>[];
|
43
|
+
pos?: number;
|
44
|
+
private actionsToIgnore;
|
45
|
+
constructor(analyticsEvents: AnalyticsWithChannel<P>[], actionsToIgnore?: string[], pos?: number);
|
46
|
+
/**
|
47
|
+
* Generate new undo/redo analytics event when step is inverted
|
48
|
+
*/
|
49
|
+
invert(): AnalyticsStep<AnalyticsInvertPayload>;
|
50
|
+
apply(doc: PMNode): StepResult<any>;
|
51
|
+
map(mapping: Mappable): AnalyticsStep<P>;
|
52
|
+
getMap(): StepMap;
|
53
|
+
merge(other: Step): AnalyticsStep<P> | null;
|
54
|
+
toJSON(): {
|
55
|
+
stepType: string;
|
56
|
+
};
|
57
|
+
static fromJSON(): ReplaceStep<any>;
|
58
|
+
}
|
59
|
+
export {};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Mappable, Step, StepResult } from 'prosemirror-transform';
|
2
|
+
import { Node as ProseMirrorNode, Schema } from 'prosemirror-model';
|
3
|
+
/**
|
4
|
+
* For more context on what this is about:
|
5
|
+
* @see https://discuss.prosemirror.net/t/preventing-image-placeholder-replacement-from-being-undone/1394
|
6
|
+
*/
|
7
|
+
export declare class SetAttrsStep extends Step {
|
8
|
+
pos: number;
|
9
|
+
attrs: object;
|
10
|
+
constructor(pos: number, attrs: object);
|
11
|
+
apply(doc: ProseMirrorNode): StepResult<any>;
|
12
|
+
invert(doc: ProseMirrorNode): SetAttrsStep;
|
13
|
+
map(mapping: Mappable): SetAttrsStep | null;
|
14
|
+
toJSON(): {
|
15
|
+
stepType: string;
|
16
|
+
pos: number;
|
17
|
+
attrs: object;
|
18
|
+
};
|
19
|
+
static fromJSON(_schema: Schema, json: {
|
20
|
+
pos?: number;
|
21
|
+
attrs: object;
|
22
|
+
}): SetAttrsStep;
|
23
|
+
}
|