@atlaskit/adf-schema 25.6.2 → 25.6.4
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/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/index.d.ts +6 -0
- package/dist/types-ts4.5/json-schema/index.d.ts +2 -0
- package/dist/types-ts4.5/schema/bitbucket-schema.d.ts +5 -0
- package/dist/types-ts4.5/schema/confluence-schema.d.ts +9 -0
- package/dist/types-ts4.5/schema/create-schema.d.ts +32 -0
- package/dist/types-ts4.5/schema/default-schema.d.ts +7 -0
- package/dist/types-ts4.5/schema/groups.d.ts +6 -0
- package/dist/types-ts4.5/schema/index.d.ts +9 -0
- package/dist/types-ts4.5/schema/inline-nodes.d.ts +1 -0
- package/dist/types-ts4.5/schema/jira-schema.d.ts +65 -0
- package/dist/types-ts4.5/schema/marks/alignment.d.ts +16 -0
- package/dist/types-ts4.5/schema/marks/annotation.d.ts +32 -0
- package/dist/types-ts4.5/schema/marks/border.d.ts +24 -0
- package/dist/types-ts4.5/schema/marks/breakout.d.ts +12 -0
- package/dist/types-ts4.5/schema/marks/code.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/confluence-inline-comment.d.ts +12 -0
- package/dist/types-ts4.5/schema/marks/data-consumer.d.ts +48 -0
- package/dist/types-ts4.5/schema/marks/em.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/fragment.d.ts +29 -0
- package/dist/types-ts4.5/schema/marks/indentation.d.ts +16 -0
- package/dist/types-ts4.5/schema/marks/index.d.ts +34 -0
- package/dist/types-ts4.5/schema/marks/link.d.ts +35 -0
- package/dist/types-ts4.5/schema/marks/strike.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/strong.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/subsup.d.ts +15 -0
- package/dist/types-ts4.5/schema/marks/text-color.d.ts +22 -0
- package/dist/types-ts4.5/schema/marks/type-ahead-query.d.ts +2 -0
- package/dist/types-ts4.5/schema/marks/underline.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/unsupported-mark.d.ts +2 -0
- package/dist/types-ts4.5/schema/marks/unsupported-node-attributes.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/block-card.d.ts +22 -0
- package/dist/types-ts4.5/schema/nodes/blockquote.d.ts +14 -0
- package/dist/types-ts4.5/schema/nodes/bodied-extension.d.ts +24 -0
- package/dist/types-ts4.5/schema/nodes/bullet-list.d.ts +3 -0
- package/dist/types-ts4.5/schema/nodes/caption.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/code-block.d.ts +31 -0
- package/dist/types-ts4.5/schema/nodes/confluence-jira-issue.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/confluence-unsupported-block.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/confluence-unsupported-inline.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/date.d.ts +14 -0
- package/dist/types-ts4.5/schema/nodes/decision-item.d.ts +17 -0
- package/dist/types-ts4.5/schema/nodes/decision-list.d.ts +18 -0
- package/dist/types-ts4.5/schema/nodes/doc.d.ts +18 -0
- package/dist/types-ts4.5/schema/nodes/embed-card.d.ts +18 -0
- package/dist/types-ts4.5/schema/nodes/emoji.d.ts +14 -0
- package/dist/types-ts4.5/schema/nodes/expand.d.ts +33 -0
- package/dist/types-ts4.5/schema/nodes/extension.d.ts +18 -0
- package/dist/types-ts4.5/schema/nodes/hard-break.d.ts +11 -0
- package/dist/types-ts4.5/schema/nodes/heading.d.ts +36 -0
- package/dist/types-ts4.5/schema/nodes/image.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/index.d.ts +93 -0
- package/dist/types-ts4.5/schema/nodes/inline-card.d.ts +10 -0
- package/dist/types-ts4.5/schema/nodes/inline-extension.d.ts +18 -0
- package/dist/types-ts4.5/schema/nodes/layout-column.d.ts +21 -0
- package/dist/types-ts4.5/schema/nodes/layout-section.d.ts +44 -0
- package/dist/types-ts4.5/schema/nodes/list-item.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/media-group.d.ts +14 -0
- package/dist/types-ts4.5/schema/nodes/media-inline.d.ts +16 -0
- package/dist/types-ts4.5/schema/nodes/media-single.d.ts +61 -0
- package/dist/types-ts4.5/schema/nodes/media.d.ts +62 -0
- package/dist/types-ts4.5/schema/nodes/mention.d.ts +26 -0
- package/dist/types-ts4.5/schema/nodes/nested-expand.d.ts +27 -0
- package/dist/types-ts4.5/schema/nodes/ordered-list.d.ts +4 -0
- package/dist/types-ts4.5/schema/nodes/panel.d.ts +38 -0
- package/dist/types-ts4.5/schema/nodes/paragraph.d.ts +37 -0
- package/dist/types-ts4.5/schema/nodes/placeholder.d.ts +11 -0
- package/dist/types-ts4.5/schema/nodes/rule.d.ts +8 -0
- package/dist/types-ts4.5/schema/nodes/status.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/tableNodes.d.ts +114 -0
- package/dist/types-ts4.5/schema/nodes/task-item.d.ts +17 -0
- package/dist/types-ts4.5/schema/nodes/task-list.d.ts +21 -0
- package/dist/types-ts4.5/schema/nodes/text.d.ts +15 -0
- package/dist/types-ts4.5/schema/nodes/types/block-content.d.ts +22 -0
- package/dist/types-ts4.5/schema/nodes/types/extensions.d.ts +34 -0
- package/dist/types-ts4.5/schema/nodes/types/inline-content.d.ts +32 -0
- package/dist/types-ts4.5/schema/nodes/types/list.d.ts +42 -0
- package/dist/types-ts4.5/schema/nodes/types/mark.d.ts +15 -0
- package/dist/types-ts4.5/schema/nodes/types/non-nestable-block-content.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/types/rich-media-common.d.ts +9 -0
- package/dist/types-ts4.5/schema/nodes/unknown-block.d.ts +3 -0
- package/dist/types-ts4.5/schema/nodes/unsupported-block.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/unsupported-inline.d.ts +2 -0
- package/dist/types-ts4.5/schema/unsupported.d.ts +1 -0
- package/dist/types-ts4.5/steps/analytics.d.ts +59 -0
- package/dist/types-ts4.5/steps/link-meta-step.d.ts +51 -0
- package/dist/types-ts4.5/steps/set-attrs.d.ts +23 -0
- package/dist/types-ts4.5/steps/table/add-column.d.ts +88 -0
- package/dist/types-ts4.5/steps/table/constants.d.ts +4 -0
- package/dist/types-ts4.5/steps/table/sort-column.d.ts +18 -0
- package/dist/types-ts4.5/steps/table/types.d.ts +39 -0
- package/dist/types-ts4.5/steps/table/utils/cell-step.d.ts +51 -0
- package/dist/types-ts4.5/steps/table/utils/cells-at-column.d.ts +20 -0
- package/dist/types-ts4.5/steps/table/utils/find-column.d.ts +8 -0
- package/dist/types-ts4.5/steps/table/utils/get-table-rect-from-doc.d.ts +8 -0
- package/dist/types-ts4.5/steps/table/utils/side-effects/rows.d.ts +25 -0
- package/dist/types-ts4.5/steps/table/utils/side-effects/side-effects.d.ts +15 -0
- package/dist/types-ts4.5/steps/table/utils/side-effects/table.d.ts +16 -0
- package/dist/types-ts4.5/steps/table/utils/side-effects/types.d.ts +33 -0
- package/dist/types-ts4.5/steps/table/utils/table-map.d.ts +6 -0
- package/dist/types-ts4.5/steps/type-ahead.d.ts +35 -0
- package/dist/types-ts4.5/steps.d.ts +10 -0
- package/dist/types-ts4.5/utils/colors.d.ts +74 -0
- package/dist/types-ts4.5/utils/confluence/emoji.d.ts +50 -0
- package/dist/types-ts4.5/utils/extensions.d.ts +3 -0
- package/dist/types-ts4.5/utils/index.d.ts +6 -0
- package/dist/types-ts4.5/utils/parseDOM.d.ts +1 -0
- package/dist/types-ts4.5/utils/url.d.ts +31 -0
- package/dist/types-ts4.5/utils/uuid.d.ts +5 -0
- package/package.json +3 -3
@@ -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 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 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 type NestedExpandDefinition = NestedExpandBaseDefinition & NoMark;
|
27
|
+
export declare const nestedExpand: NodeSpec;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { NodeSpec } from 'prosemirror-model';
|
2
|
+
import { ParagraphDefinition as Paragraph } from './paragraph';
|
3
|
+
import { OrderedListDefinition as OrderedList } from './types/list';
|
4
|
+
import { BulletListDefinition as BulletList } from './types/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 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 type ParagraphWithAlignmentDefinition = ParagraphBaseDefinition & MarksObject<AlignmentMarkDefinition>;
|
32
|
+
/**
|
33
|
+
* @name paragraph_with_indentation_node
|
34
|
+
*/
|
35
|
+
export type ParagraphWithIndentationDefinition = ParagraphBaseDefinition & MarksObject<IndentationMarkDefinition>;
|
36
|
+
export 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,114 @@
|
|
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 './types/list';
|
7
|
+
import { BulletListDefinition as BulletList } from './types/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 type CellDomAttrs = {
|
33
|
+
colspan?: string;
|
34
|
+
rowspan?: string;
|
35
|
+
style?: string;
|
36
|
+
colorname?: string;
|
37
|
+
'data-colwidth'?: string;
|
38
|
+
'data-cell-background'?: string;
|
39
|
+
class?: string;
|
40
|
+
};
|
41
|
+
/**
|
42
|
+
* gets cell dom attributes based on node attributes
|
43
|
+
* @returns CellDomAttrs
|
44
|
+
*/
|
45
|
+
export declare const getCellDomAttrs: (node: PmNode) => CellDomAttrs;
|
46
|
+
export declare const tableBackgroundColorPalette: Map<string, string>;
|
47
|
+
export declare const tableBackgroundBorderColor: string;
|
48
|
+
export declare const tableBackgroundColorNames: Map<string, string>;
|
49
|
+
export type Layout = 'default' | 'full-width' | 'wide';
|
50
|
+
export interface TableAttributes {
|
51
|
+
isNumberColumnEnabled?: boolean;
|
52
|
+
layout?: Layout;
|
53
|
+
__autoSize?: boolean;
|
54
|
+
/**
|
55
|
+
* @minLength 1
|
56
|
+
*/
|
57
|
+
localId?: string;
|
58
|
+
}
|
59
|
+
/**
|
60
|
+
* @name table_node
|
61
|
+
*/
|
62
|
+
export interface TableDefinition {
|
63
|
+
type: 'table';
|
64
|
+
attrs?: TableAttributes;
|
65
|
+
/**
|
66
|
+
* @minItems 1
|
67
|
+
*/
|
68
|
+
content: Array<TableRow>;
|
69
|
+
marks?: Array<FragmentDefinition>;
|
70
|
+
}
|
71
|
+
/**
|
72
|
+
* @name table_row_node
|
73
|
+
*/
|
74
|
+
export interface TableRow {
|
75
|
+
type: 'tableRow';
|
76
|
+
content: Array<TableHeader | TableCell>;
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* @name table_cell_content
|
80
|
+
* @minItems 1
|
81
|
+
* @allowUnsupportedBlock true
|
82
|
+
*/
|
83
|
+
export type TableCellContent = Array<Panel | Paragraph | ParagraphWithMarks | Blockquote | OrderedList | BulletList | Rule | Heading | HeadingWithMarks | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Extension | BlockCard | NestedExpand | EmbedCard>;
|
84
|
+
/**
|
85
|
+
* @name table_cell_node
|
86
|
+
*/
|
87
|
+
export interface TableCell {
|
88
|
+
type: 'tableCell';
|
89
|
+
attrs?: CellAttributes;
|
90
|
+
content: TableCellContent;
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* @name table_header_node
|
94
|
+
*/
|
95
|
+
export interface TableHeader {
|
96
|
+
type: 'tableHeader';
|
97
|
+
attrs?: CellAttributes;
|
98
|
+
content: TableCellContent;
|
99
|
+
}
|
100
|
+
export declare const table: NodeSpec;
|
101
|
+
export declare const tableToJSON: (node: PmNode) => {
|
102
|
+
attrs: {
|
103
|
+
[key: string]: any;
|
104
|
+
};
|
105
|
+
};
|
106
|
+
export declare const tableRow: NodeSpec;
|
107
|
+
export declare const tableCell: NodeSpec;
|
108
|
+
export declare const toJSONTableCell: (node: PmNode) => {
|
109
|
+
attrs: Record<string, any>;
|
110
|
+
};
|
111
|
+
export declare const tableHeader: NodeSpec;
|
112
|
+
export declare const toJSONTableHeader: (node: PmNode) => {
|
113
|
+
attrs: Record<string, any>;
|
114
|
+
};
|
@@ -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 '../types/list';
|
7
|
+
import { BulletListDefinition as BulletList } from '../types/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 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 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 type InlineFormattedText = Text & MarksObject<Link | Em | Strong | Strike | SubSup | Underline | TextColor | Annotation>;
|
17
|
+
/**
|
18
|
+
* @name link_text_inline_node
|
19
|
+
*/
|
20
|
+
export type InlineLinkText = Text & MarksObject<Link>;
|
21
|
+
/**
|
22
|
+
* @name code_inline_node
|
23
|
+
*/
|
24
|
+
export type InlineCode = Text & MarksObject<Code | Link | Annotation>;
|
25
|
+
/**
|
26
|
+
* @name atomic_inline_node
|
27
|
+
*/
|
28
|
+
export type InlineAtomic = HardBreak | Mention | Emoji | InlineExtensionDefinition | Date | Placeholder | InlineCard | Status | MediaInlineDefinition;
|
29
|
+
/**
|
30
|
+
* @name inline_node
|
31
|
+
*/
|
32
|
+
export type Inline = InlineFormattedText | InlineCode | InlineAtomic;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { ParagraphDefinition as Paragraph } from '../paragraph';
|
2
|
+
import { MediaSingleDefinition as MediaSingle } from '../media-single';
|
3
|
+
import { CodeBlockDefinition as CodeBlock } from '../code-block';
|
4
|
+
export interface ListItemArray extends Array<Paragraph | OrderedListDefinition | BulletListDefinition | MediaSingle | CodeBlock> {
|
5
|
+
0: Paragraph | MediaSingle | CodeBlock;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* @name listItem_node
|
9
|
+
*/
|
10
|
+
export interface ListItemDefinition {
|
11
|
+
type: 'listItem';
|
12
|
+
/**
|
13
|
+
* @minItems 1
|
14
|
+
*/
|
15
|
+
content: ListItemArray;
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* @name bulletList_node
|
19
|
+
*/
|
20
|
+
export interface BulletListDefinition {
|
21
|
+
type: 'bulletList';
|
22
|
+
/**
|
23
|
+
* @minItems 1
|
24
|
+
*/
|
25
|
+
content: Array<ListItemDefinition>;
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* @name orderedList_node
|
29
|
+
*/
|
30
|
+
export interface OrderedListDefinition {
|
31
|
+
type: 'orderedList';
|
32
|
+
/**
|
33
|
+
* @minItems 1
|
34
|
+
*/
|
35
|
+
content: Array<ListItemDefinition>;
|
36
|
+
attrs?: {
|
37
|
+
/**
|
38
|
+
* @minimum 0
|
39
|
+
*/
|
40
|
+
order?: number;
|
41
|
+
};
|
42
|
+
}
|
@@ -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 '../types/list';
|
5
|
+
import { BulletListDefinition as BulletList } from '../types/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 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
|
+
type AnalyticsInvertPayload = UndoAnalyticsEventPayload | RedoAnalyticsEventPayload;
|
35
|
+
export 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,51 @@
|
|
1
|
+
import { Node as PMNode, Schema } from 'prosemirror-model';
|
2
|
+
import { ReplaceStep, Step, StepMap, StepResult, Mappable } from 'prosemirror-transform';
|
3
|
+
export declare const stepType = "editor-linking-meta";
|
4
|
+
export declare const invertStepType = "editor-linking-meta-invert";
|
5
|
+
export type LinkStepMetadata = {
|
6
|
+
/**
|
7
|
+
* Editor action performed
|
8
|
+
*/
|
9
|
+
action?: string;
|
10
|
+
/**
|
11
|
+
* Editor input method that triggered the transaction
|
12
|
+
*/
|
13
|
+
inputMethod?: string;
|
14
|
+
/**
|
15
|
+
* The applicable card action for this step
|
16
|
+
* if is RESOLVE then the undo/redo steps should be considered "updates" of a link
|
17
|
+
*/
|
18
|
+
cardAction?: 'RESOLVE';
|
19
|
+
/**
|
20
|
+
* Source UI that tiggered this step, if available/applicable
|
21
|
+
*/
|
22
|
+
sourceEvent?: unknown;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* Custom Prosemirror Step to attach metadata about user interactions with links
|
26
|
+
* Using a Step means that it will work with prosemirror-history and we get utilise when
|
27
|
+
* firing events on history change
|
28
|
+
*/
|
29
|
+
export declare class LinkMetaStep extends Step {
|
30
|
+
private pos;
|
31
|
+
private metadata;
|
32
|
+
private isInverted;
|
33
|
+
constructor(pos: number | null, metadata: LinkStepMetadata, isInverted?: boolean);
|
34
|
+
getMetadata(): LinkStepMetadata;
|
35
|
+
/**
|
36
|
+
* Generate new undo/redo analytics event when step is inverted
|
37
|
+
*/
|
38
|
+
invert(): LinkMetaStep;
|
39
|
+
apply(doc: PMNode): StepResult<any>;
|
40
|
+
map(mapping: Mappable): LinkMetaStep;
|
41
|
+
getMap(): StepMap;
|
42
|
+
merge(): null;
|
43
|
+
toJSON(): {
|
44
|
+
stepType: string;
|
45
|
+
from: number;
|
46
|
+
to: number;
|
47
|
+
};
|
48
|
+
static fromJSON<S extends Schema = any>(_: S, __: {
|
49
|
+
[key: string]: any;
|
50
|
+
}): ReplaceStep<any>;
|
51
|
+
}
|