@tiptap/react 2.0.0-beta.83 → 2.0.0-beta.87
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/dist/packages/core/src/Editor.d.ts +5 -0
- package/dist/packages/core/src/Extension.d.ts +56 -23
- package/dist/packages/core/src/Mark.d.ts +72 -31
- package/dist/packages/core/src/Node.d.ts +86 -38
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +1 -1
- package/dist/packages/core/src/extensions/commands.d.ts +1 -1
- package/dist/packages/core/src/extensions/editable.d.ts +1 -1
- package/dist/packages/core/src/extensions/focusEvents.d.ts +1 -1
- package/dist/packages/core/src/extensions/keymap.d.ts +1 -1
- package/dist/packages/core/src/extensions/tabindex.d.ts +1 -1
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -2
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +3 -3
- package/dist/packages/core/src/index.d.ts +3 -3
- package/dist/packages/core/src/style.d.ts +1 -1
- package/dist/packages/core/src/types.d.ts +2 -0
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -0
- package/dist/packages/core/src/utilities/isNumber.d.ts +1 -0
- package/dist/packages/extension-blockquote/src/blockquote.d.ts +1 -1
- package/dist/packages/extension-bold/src/bold.d.ts +1 -1
- package/dist/packages/extension-bubble-menu/src/bubble-menu.d.ts +1 -1
- package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +1 -1
- package/dist/packages/extension-character-count/src/character-count.d.ts +1 -1
- package/dist/packages/extension-code/src/code.d.ts +1 -1
- package/dist/packages/extension-code-block/src/code-block.d.ts +1 -1
- package/dist/packages/extension-code-block-lowlight/src/code-block-lowlight.d.ts +1 -1
- package/dist/packages/extension-collaboration/src/collaboration.d.ts +1 -1
- package/dist/packages/extension-collaboration-cursor/src/collaboration-cursor.d.ts +17 -1
- package/dist/packages/extension-color/src/color.d.ts +1 -1
- package/dist/packages/extension-document/src/document.d.ts +1 -1
- package/dist/packages/extension-dropcursor/src/dropcursor.d.ts +1 -1
- package/dist/packages/extension-floating-menu/src/floating-menu.d.ts +1 -1
- package/dist/packages/extension-focus/src/focus.d.ts +1 -1
- package/dist/packages/extension-font-family/src/font-family.d.ts +1 -1
- package/dist/packages/extension-gapcursor/src/gapcursor.d.ts +3 -2
- package/dist/packages/extension-hard-break/src/hard-break.d.ts +1 -1
- package/dist/packages/extension-heading/src/heading.d.ts +1 -1
- package/dist/packages/extension-highlight/src/highlight.d.ts +1 -1
- package/dist/packages/extension-history/src/history.d.ts +1 -1
- package/dist/packages/extension-horizontal-rule/src/horizontal-rule.d.ts +1 -1
- package/dist/packages/extension-image/src/image.d.ts +1 -1
- package/dist/packages/extension-italic/src/italic.d.ts +1 -1
- package/dist/packages/extension-link/src/link.d.ts +1 -1
- package/dist/packages/extension-list-item/src/list-item.d.ts +1 -1
- package/dist/packages/extension-mention/src/mention.d.ts +1 -1
- package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +1 -1
- package/dist/packages/extension-paragraph/src/paragraph.d.ts +1 -1
- package/dist/packages/extension-placeholder/src/placeholder.d.ts +1 -1
- package/dist/packages/extension-strike/src/strike.d.ts +1 -1
- package/dist/packages/extension-subscript/src/subscript.d.ts +1 -1
- package/dist/packages/extension-superscript/src/superscript.d.ts +1 -1
- package/dist/packages/extension-table/src/table.d.ts +3 -2
- package/dist/packages/extension-table-cell/src/table-cell.d.ts +1 -1
- package/dist/packages/extension-table-header/src/table-header.d.ts +1 -1
- package/dist/packages/extension-table-row/src/table-row.d.ts +1 -1
- package/dist/packages/extension-task-item/src/task-item.d.ts +1 -1
- package/dist/packages/extension-task-list/src/task-list.d.ts +1 -1
- package/dist/packages/extension-text/src/text.d.ts +1 -1
- package/dist/packages/extension-text-align/src/text-align.d.ts +1 -1
- package/dist/packages/extension-text-style/src/text-style.d.ts +1 -1
- package/dist/packages/extension-typography/src/typography.d.ts +1 -1
- package/dist/packages/extension-underline/src/underline.d.ts +1 -1
- package/dist/packages/starter-kit/src/starter-kit.d.ts +1 -1
- package/dist/packages/suggestion/src/suggestion.d.ts +4 -1
- package/dist/tiptap-react.cjs.js +10 -4
- package/dist/tiptap-react.cjs.js.map +1 -1
- package/dist/tiptap-react.esm.js +10 -4
- package/dist/tiptap-react.esm.js.map +1 -1
- package/dist/tiptap-react.umd.js +10 -4
- package/dist/tiptap-react.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/ReactNodeViewRenderer.tsx +4 -4
- package/src/useEditor.ts +7 -1
|
@@ -16,8 +16,13 @@ export declare class Editor extends EventEmitter<EditorEvents> {
|
|
|
16
16
|
schema: Schema;
|
|
17
17
|
view: EditorView;
|
|
18
18
|
isFocused: boolean;
|
|
19
|
+
extensionStorage: Record<string, any>;
|
|
19
20
|
options: EditorOptions;
|
|
20
21
|
constructor(options?: Partial<EditorOptions>);
|
|
22
|
+
/**
|
|
23
|
+
* Returns the editor storage.
|
|
24
|
+
*/
|
|
25
|
+
get storage(): Record<string, any>;
|
|
21
26
|
/**
|
|
22
27
|
* An object of all registered commands.
|
|
23
28
|
*/
|
|
@@ -7,7 +7,7 @@ import { Mark } from './Mark';
|
|
|
7
7
|
import { Extensions, GlobalAttributes, RawCommands, ParentConfig, KeyboardShortcutCommand } from './types';
|
|
8
8
|
import { ExtensionConfig } from '.';
|
|
9
9
|
declare module '@tiptap/core' {
|
|
10
|
-
interface ExtensionConfig<Options = any> {
|
|
10
|
+
interface ExtensionConfig<Options = any, Storage = any> {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
/**
|
|
13
13
|
* Name
|
|
@@ -21,13 +21,29 @@ declare module '@tiptap/core' {
|
|
|
21
21
|
* Default options
|
|
22
22
|
*/
|
|
23
23
|
defaultOptions?: Options;
|
|
24
|
+
/**
|
|
25
|
+
* Default Options
|
|
26
|
+
*/
|
|
27
|
+
addOptions?: (this: {
|
|
28
|
+
name: string;
|
|
29
|
+
parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addOptions'], undefined>;
|
|
30
|
+
}) => Options;
|
|
31
|
+
/**
|
|
32
|
+
* Default Storage
|
|
33
|
+
*/
|
|
34
|
+
addStorage?: (this: {
|
|
35
|
+
name: string;
|
|
36
|
+
options: Options;
|
|
37
|
+
parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addStorage'], undefined>;
|
|
38
|
+
}) => Storage;
|
|
24
39
|
/**
|
|
25
40
|
* Global attributes
|
|
26
41
|
*/
|
|
27
42
|
addGlobalAttributes?: (this: {
|
|
28
43
|
name: string;
|
|
29
44
|
options: Options;
|
|
30
|
-
|
|
45
|
+
storage: Storage;
|
|
46
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addGlobalAttributes'];
|
|
31
47
|
}) => GlobalAttributes | {};
|
|
32
48
|
/**
|
|
33
49
|
* Raw
|
|
@@ -35,8 +51,9 @@ declare module '@tiptap/core' {
|
|
|
35
51
|
addCommands?: (this: {
|
|
36
52
|
name: string;
|
|
37
53
|
options: Options;
|
|
54
|
+
storage: Storage;
|
|
38
55
|
editor: Editor;
|
|
39
|
-
parent: ParentConfig<ExtensionConfig<Options>>['addCommands'];
|
|
56
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addCommands'];
|
|
40
57
|
}) => Partial<RawCommands>;
|
|
41
58
|
/**
|
|
42
59
|
* Keyboard shortcuts
|
|
@@ -44,8 +61,9 @@ declare module '@tiptap/core' {
|
|
|
44
61
|
addKeyboardShortcuts?: (this: {
|
|
45
62
|
name: string;
|
|
46
63
|
options: Options;
|
|
64
|
+
storage: Storage;
|
|
47
65
|
editor: Editor;
|
|
48
|
-
parent: ParentConfig<ExtensionConfig<Options>>['addKeyboardShortcuts'];
|
|
66
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addKeyboardShortcuts'];
|
|
49
67
|
}) => {
|
|
50
68
|
[key: string]: KeyboardShortcutCommand;
|
|
51
69
|
};
|
|
@@ -55,8 +73,9 @@ declare module '@tiptap/core' {
|
|
|
55
73
|
addInputRules?: (this: {
|
|
56
74
|
name: string;
|
|
57
75
|
options: Options;
|
|
76
|
+
storage: Storage;
|
|
58
77
|
editor: Editor;
|
|
59
|
-
parent: ParentConfig<ExtensionConfig<Options>>['addInputRules'];
|
|
78
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addInputRules'];
|
|
60
79
|
}) => InputRule[];
|
|
61
80
|
/**
|
|
62
81
|
* Paste rules
|
|
@@ -64,8 +83,9 @@ declare module '@tiptap/core' {
|
|
|
64
83
|
addPasteRules?: (this: {
|
|
65
84
|
name: string;
|
|
66
85
|
options: Options;
|
|
86
|
+
storage: Storage;
|
|
67
87
|
editor: Editor;
|
|
68
|
-
parent: ParentConfig<ExtensionConfig<Options>>['addPasteRules'];
|
|
88
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addPasteRules'];
|
|
69
89
|
}) => PasteRule[];
|
|
70
90
|
/**
|
|
71
91
|
* ProseMirror plugins
|
|
@@ -73,8 +93,9 @@ declare module '@tiptap/core' {
|
|
|
73
93
|
addProseMirrorPlugins?: (this: {
|
|
74
94
|
name: string;
|
|
75
95
|
options: Options;
|
|
96
|
+
storage: Storage;
|
|
76
97
|
editor: Editor;
|
|
77
|
-
parent: ParentConfig<ExtensionConfig<Options>>['addProseMirrorPlugins'];
|
|
98
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addProseMirrorPlugins'];
|
|
78
99
|
}) => Plugin[];
|
|
79
100
|
/**
|
|
80
101
|
* Extensions
|
|
@@ -82,7 +103,8 @@ declare module '@tiptap/core' {
|
|
|
82
103
|
addExtensions?: (this: {
|
|
83
104
|
name: string;
|
|
84
105
|
options: Options;
|
|
85
|
-
|
|
106
|
+
storage: Storage;
|
|
107
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addExtensions'];
|
|
86
108
|
}) => Extensions;
|
|
87
109
|
/**
|
|
88
110
|
* Extend Node Schema
|
|
@@ -90,7 +112,8 @@ declare module '@tiptap/core' {
|
|
|
90
112
|
extendNodeSchema?: ((this: {
|
|
91
113
|
name: string;
|
|
92
114
|
options: Options;
|
|
93
|
-
|
|
115
|
+
storage: Storage;
|
|
116
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['extendNodeSchema'];
|
|
94
117
|
}, extension: Node) => Record<string, any>) | null;
|
|
95
118
|
/**
|
|
96
119
|
* Extend Mark Schema
|
|
@@ -98,7 +121,8 @@ declare module '@tiptap/core' {
|
|
|
98
121
|
extendMarkSchema?: ((this: {
|
|
99
122
|
name: string;
|
|
100
123
|
options: Options;
|
|
101
|
-
|
|
124
|
+
storage: Storage;
|
|
125
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['extendMarkSchema'];
|
|
102
126
|
}, extension: Mark) => Record<string, any>) | null;
|
|
103
127
|
/**
|
|
104
128
|
* The editor is not ready yet.
|
|
@@ -106,8 +130,9 @@ declare module '@tiptap/core' {
|
|
|
106
130
|
onBeforeCreate?: ((this: {
|
|
107
131
|
name: string;
|
|
108
132
|
options: Options;
|
|
133
|
+
storage: Storage;
|
|
109
134
|
editor: Editor;
|
|
110
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onBeforeCreate'];
|
|
135
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onBeforeCreate'];
|
|
111
136
|
}) => void) | null;
|
|
112
137
|
/**
|
|
113
138
|
* The editor is ready.
|
|
@@ -115,8 +140,9 @@ declare module '@tiptap/core' {
|
|
|
115
140
|
onCreate?: ((this: {
|
|
116
141
|
name: string;
|
|
117
142
|
options: Options;
|
|
143
|
+
storage: Storage;
|
|
118
144
|
editor: Editor;
|
|
119
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onCreate'];
|
|
145
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onCreate'];
|
|
120
146
|
}) => void) | null;
|
|
121
147
|
/**
|
|
122
148
|
* The content has changed.
|
|
@@ -124,8 +150,9 @@ declare module '@tiptap/core' {
|
|
|
124
150
|
onUpdate?: ((this: {
|
|
125
151
|
name: string;
|
|
126
152
|
options: Options;
|
|
153
|
+
storage: Storage;
|
|
127
154
|
editor: Editor;
|
|
128
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onUpdate'];
|
|
155
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onUpdate'];
|
|
129
156
|
}) => void) | null;
|
|
130
157
|
/**
|
|
131
158
|
* The selection has changed.
|
|
@@ -133,8 +160,9 @@ declare module '@tiptap/core' {
|
|
|
133
160
|
onSelectionUpdate?: ((this: {
|
|
134
161
|
name: string;
|
|
135
162
|
options: Options;
|
|
163
|
+
storage: Storage;
|
|
136
164
|
editor: Editor;
|
|
137
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onSelectionUpdate'];
|
|
165
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onSelectionUpdate'];
|
|
138
166
|
}) => void) | null;
|
|
139
167
|
/**
|
|
140
168
|
* The editor state has changed.
|
|
@@ -142,8 +170,9 @@ declare module '@tiptap/core' {
|
|
|
142
170
|
onTransaction?: ((this: {
|
|
143
171
|
name: string;
|
|
144
172
|
options: Options;
|
|
173
|
+
storage: Storage;
|
|
145
174
|
editor: Editor;
|
|
146
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onTransaction'];
|
|
175
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onTransaction'];
|
|
147
176
|
}, props: {
|
|
148
177
|
transaction: Transaction;
|
|
149
178
|
}) => void) | null;
|
|
@@ -153,8 +182,9 @@ declare module '@tiptap/core' {
|
|
|
153
182
|
onFocus?: ((this: {
|
|
154
183
|
name: string;
|
|
155
184
|
options: Options;
|
|
185
|
+
storage: Storage;
|
|
156
186
|
editor: Editor;
|
|
157
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onFocus'];
|
|
187
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onFocus'];
|
|
158
188
|
}, props: {
|
|
159
189
|
event: FocusEvent;
|
|
160
190
|
}) => void) | null;
|
|
@@ -164,8 +194,9 @@ declare module '@tiptap/core' {
|
|
|
164
194
|
onBlur?: ((this: {
|
|
165
195
|
name: string;
|
|
166
196
|
options: Options;
|
|
197
|
+
storage: Storage;
|
|
167
198
|
editor: Editor;
|
|
168
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onBlur'];
|
|
199
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onBlur'];
|
|
169
200
|
}, props: {
|
|
170
201
|
event: FocusEvent;
|
|
171
202
|
}) => void) | null;
|
|
@@ -175,20 +206,22 @@ declare module '@tiptap/core' {
|
|
|
175
206
|
onDestroy?: ((this: {
|
|
176
207
|
name: string;
|
|
177
208
|
options: Options;
|
|
209
|
+
storage: Storage;
|
|
178
210
|
editor: Editor;
|
|
179
|
-
parent: ParentConfig<ExtensionConfig<Options>>['onDestroy'];
|
|
211
|
+
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onDestroy'];
|
|
180
212
|
}) => void) | null;
|
|
181
213
|
}
|
|
182
214
|
}
|
|
183
|
-
export declare class Extension<Options = any> {
|
|
215
|
+
export declare class Extension<Options = any, Storage = any> {
|
|
184
216
|
type: string;
|
|
185
217
|
name: string;
|
|
186
218
|
parent: Extension | null;
|
|
187
219
|
child: Extension | null;
|
|
188
220
|
options: Options;
|
|
221
|
+
storage: Storage;
|
|
189
222
|
config: ExtensionConfig;
|
|
190
|
-
constructor(config?: Partial<ExtensionConfig<Options>>);
|
|
191
|
-
static create<O>(config?: Partial<ExtensionConfig<O>>): Extension<O>;
|
|
192
|
-
configure(options?: Partial<Options>): Extension<Options>;
|
|
193
|
-
extend<ExtendedOptions = Options>(extendedConfig?: Partial<ExtensionConfig<ExtendedOptions>>): Extension<ExtendedOptions>;
|
|
223
|
+
constructor(config?: Partial<ExtensionConfig<Options, Storage>>);
|
|
224
|
+
static create<O = any, S = any>(config?: Partial<ExtensionConfig<O, S>>): Extension<O, S>;
|
|
225
|
+
configure(options?: Partial<Options>): Extension<Options, Storage>;
|
|
226
|
+
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<ExtensionConfig<ExtendedOptions, ExtendedStorage>>): Extension<ExtendedOptions, ExtendedStorage>;
|
|
194
227
|
}
|
|
@@ -7,7 +7,7 @@ import { Node } from './Node';
|
|
|
7
7
|
import { MarkConfig } from '.';
|
|
8
8
|
import { Editor } from './Editor';
|
|
9
9
|
declare module '@tiptap/core' {
|
|
10
|
-
interface MarkConfig<Options = any> {
|
|
10
|
+
interface MarkConfig<Options = any, Storage = any> {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
/**
|
|
13
13
|
* Name
|
|
@@ -21,13 +21,29 @@ declare module '@tiptap/core' {
|
|
|
21
21
|
* Default options
|
|
22
22
|
*/
|
|
23
23
|
defaultOptions?: Options;
|
|
24
|
+
/**
|
|
25
|
+
* Default Options
|
|
26
|
+
*/
|
|
27
|
+
addOptions?: (this: {
|
|
28
|
+
name: string;
|
|
29
|
+
parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addOptions'], undefined>;
|
|
30
|
+
}) => Options;
|
|
31
|
+
/**
|
|
32
|
+
* Default Storage
|
|
33
|
+
*/
|
|
34
|
+
addStorage?: (this: {
|
|
35
|
+
name: string;
|
|
36
|
+
options: Options;
|
|
37
|
+
parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addStorage'], undefined>;
|
|
38
|
+
}) => Storage;
|
|
24
39
|
/**
|
|
25
40
|
* Global attributes
|
|
26
41
|
*/
|
|
27
42
|
addGlobalAttributes?: (this: {
|
|
28
43
|
name: string;
|
|
29
44
|
options: Options;
|
|
30
|
-
|
|
45
|
+
storage: Storage;
|
|
46
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addGlobalAttributes'];
|
|
31
47
|
}) => GlobalAttributes | {};
|
|
32
48
|
/**
|
|
33
49
|
* Raw
|
|
@@ -35,9 +51,10 @@ declare module '@tiptap/core' {
|
|
|
35
51
|
addCommands?: (this: {
|
|
36
52
|
name: string;
|
|
37
53
|
options: Options;
|
|
54
|
+
storage: Storage;
|
|
38
55
|
editor: Editor;
|
|
39
56
|
type: MarkType;
|
|
40
|
-
parent: ParentConfig<MarkConfig<Options>>['addCommands'];
|
|
57
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addCommands'];
|
|
41
58
|
}) => Partial<RawCommands>;
|
|
42
59
|
/**
|
|
43
60
|
* Keyboard shortcuts
|
|
@@ -45,9 +62,10 @@ declare module '@tiptap/core' {
|
|
|
45
62
|
addKeyboardShortcuts?: (this: {
|
|
46
63
|
name: string;
|
|
47
64
|
options: Options;
|
|
65
|
+
storage: Storage;
|
|
48
66
|
editor: Editor;
|
|
49
67
|
type: MarkType;
|
|
50
|
-
parent: ParentConfig<MarkConfig<Options>>['addKeyboardShortcuts'];
|
|
68
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addKeyboardShortcuts'];
|
|
51
69
|
}) => {
|
|
52
70
|
[key: string]: KeyboardShortcutCommand;
|
|
53
71
|
};
|
|
@@ -57,9 +75,10 @@ declare module '@tiptap/core' {
|
|
|
57
75
|
addInputRules?: (this: {
|
|
58
76
|
name: string;
|
|
59
77
|
options: Options;
|
|
78
|
+
storage: Storage;
|
|
60
79
|
editor: Editor;
|
|
61
80
|
type: MarkType;
|
|
62
|
-
parent: ParentConfig<MarkConfig<Options>>['addInputRules'];
|
|
81
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addInputRules'];
|
|
63
82
|
}) => InputRule[];
|
|
64
83
|
/**
|
|
65
84
|
* Paste rules
|
|
@@ -67,9 +86,10 @@ declare module '@tiptap/core' {
|
|
|
67
86
|
addPasteRules?: (this: {
|
|
68
87
|
name: string;
|
|
69
88
|
options: Options;
|
|
89
|
+
storage: Storage;
|
|
70
90
|
editor: Editor;
|
|
71
91
|
type: MarkType;
|
|
72
|
-
parent: ParentConfig<MarkConfig<Options>>['addPasteRules'];
|
|
92
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addPasteRules'];
|
|
73
93
|
}) => PasteRule[];
|
|
74
94
|
/**
|
|
75
95
|
* ProseMirror plugins
|
|
@@ -77,9 +97,10 @@ declare module '@tiptap/core' {
|
|
|
77
97
|
addProseMirrorPlugins?: (this: {
|
|
78
98
|
name: string;
|
|
79
99
|
options: Options;
|
|
100
|
+
storage: Storage;
|
|
80
101
|
editor: Editor;
|
|
81
102
|
type: MarkType;
|
|
82
|
-
parent: ParentConfig<MarkConfig<Options>>['addProseMirrorPlugins'];
|
|
103
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addProseMirrorPlugins'];
|
|
83
104
|
}) => Plugin[];
|
|
84
105
|
/**
|
|
85
106
|
* Extensions
|
|
@@ -87,7 +108,8 @@ declare module '@tiptap/core' {
|
|
|
87
108
|
addExtensions?: (this: {
|
|
88
109
|
name: string;
|
|
89
110
|
options: Options;
|
|
90
|
-
|
|
111
|
+
storage: Storage;
|
|
112
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addExtensions'];
|
|
91
113
|
}) => Extensions;
|
|
92
114
|
/**
|
|
93
115
|
* Extend Node Schema
|
|
@@ -95,7 +117,8 @@ declare module '@tiptap/core' {
|
|
|
95
117
|
extendNodeSchema?: ((this: {
|
|
96
118
|
name: string;
|
|
97
119
|
options: Options;
|
|
98
|
-
|
|
120
|
+
storage: Storage;
|
|
121
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['extendNodeSchema'];
|
|
99
122
|
}, extension: Node) => Record<string, any>) | null;
|
|
100
123
|
/**
|
|
101
124
|
* Extend Mark Schema
|
|
@@ -103,7 +126,8 @@ declare module '@tiptap/core' {
|
|
|
103
126
|
extendMarkSchema?: ((this: {
|
|
104
127
|
name: string;
|
|
105
128
|
options: Options;
|
|
106
|
-
|
|
129
|
+
storage: Storage;
|
|
130
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['extendMarkSchema'];
|
|
107
131
|
}, extension: Mark) => Record<string, any>) | null;
|
|
108
132
|
/**
|
|
109
133
|
* The editor is not ready yet.
|
|
@@ -111,9 +135,10 @@ declare module '@tiptap/core' {
|
|
|
111
135
|
onBeforeCreate?: ((this: {
|
|
112
136
|
name: string;
|
|
113
137
|
options: Options;
|
|
138
|
+
storage: Storage;
|
|
114
139
|
editor: Editor;
|
|
115
140
|
type: MarkType;
|
|
116
|
-
parent: ParentConfig<MarkConfig<Options>>['onBeforeCreate'];
|
|
141
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onBeforeCreate'];
|
|
117
142
|
}) => void) | null;
|
|
118
143
|
/**
|
|
119
144
|
* The editor is ready.
|
|
@@ -121,9 +146,10 @@ declare module '@tiptap/core' {
|
|
|
121
146
|
onCreate?: ((this: {
|
|
122
147
|
name: string;
|
|
123
148
|
options: Options;
|
|
149
|
+
storage: Storage;
|
|
124
150
|
editor: Editor;
|
|
125
151
|
type: MarkType;
|
|
126
|
-
parent: ParentConfig<MarkConfig<Options>>['onCreate'];
|
|
152
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onCreate'];
|
|
127
153
|
}) => void) | null;
|
|
128
154
|
/**
|
|
129
155
|
* The content has changed.
|
|
@@ -131,9 +157,10 @@ declare module '@tiptap/core' {
|
|
|
131
157
|
onUpdate?: ((this: {
|
|
132
158
|
name: string;
|
|
133
159
|
options: Options;
|
|
160
|
+
storage: Storage;
|
|
134
161
|
editor: Editor;
|
|
135
162
|
type: MarkType;
|
|
136
|
-
parent: ParentConfig<MarkConfig<Options>>['onUpdate'];
|
|
163
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onUpdate'];
|
|
137
164
|
}) => void) | null;
|
|
138
165
|
/**
|
|
139
166
|
* The selection has changed.
|
|
@@ -141,9 +168,10 @@ declare module '@tiptap/core' {
|
|
|
141
168
|
onSelectionUpdate?: ((this: {
|
|
142
169
|
name: string;
|
|
143
170
|
options: Options;
|
|
171
|
+
storage: Storage;
|
|
144
172
|
editor: Editor;
|
|
145
173
|
type: MarkType;
|
|
146
|
-
parent: ParentConfig<MarkConfig<Options>>['onSelectionUpdate'];
|
|
174
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onSelectionUpdate'];
|
|
147
175
|
}) => void) | null;
|
|
148
176
|
/**
|
|
149
177
|
* The editor state has changed.
|
|
@@ -151,9 +179,10 @@ declare module '@tiptap/core' {
|
|
|
151
179
|
onTransaction?: ((this: {
|
|
152
180
|
name: string;
|
|
153
181
|
options: Options;
|
|
182
|
+
storage: Storage;
|
|
154
183
|
editor: Editor;
|
|
155
184
|
type: MarkType;
|
|
156
|
-
parent: ParentConfig<MarkConfig<Options>>['onTransaction'];
|
|
185
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onTransaction'];
|
|
157
186
|
}, props: {
|
|
158
187
|
transaction: Transaction;
|
|
159
188
|
}) => void) | null;
|
|
@@ -163,9 +192,10 @@ declare module '@tiptap/core' {
|
|
|
163
192
|
onFocus?: ((this: {
|
|
164
193
|
name: string;
|
|
165
194
|
options: Options;
|
|
195
|
+
storage: Storage;
|
|
166
196
|
editor: Editor;
|
|
167
197
|
type: MarkType;
|
|
168
|
-
parent: ParentConfig<MarkConfig<Options>>['onFocus'];
|
|
198
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onFocus'];
|
|
169
199
|
}, props: {
|
|
170
200
|
event: FocusEvent;
|
|
171
201
|
}) => void) | null;
|
|
@@ -175,9 +205,10 @@ declare module '@tiptap/core' {
|
|
|
175
205
|
onBlur?: ((this: {
|
|
176
206
|
name: string;
|
|
177
207
|
options: Options;
|
|
208
|
+
storage: Storage;
|
|
178
209
|
editor: Editor;
|
|
179
210
|
type: MarkType;
|
|
180
|
-
parent: ParentConfig<MarkConfig<Options>>['onBlur'];
|
|
211
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onBlur'];
|
|
181
212
|
}, props: {
|
|
182
213
|
event: FocusEvent;
|
|
183
214
|
}) => void) | null;
|
|
@@ -187,9 +218,10 @@ declare module '@tiptap/core' {
|
|
|
187
218
|
onDestroy?: ((this: {
|
|
188
219
|
name: string;
|
|
189
220
|
options: Options;
|
|
221
|
+
storage: Storage;
|
|
190
222
|
editor: Editor;
|
|
191
223
|
type: MarkType;
|
|
192
|
-
parent: ParentConfig<MarkConfig<Options>>['onDestroy'];
|
|
224
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['onDestroy'];
|
|
193
225
|
}) => void) | null;
|
|
194
226
|
/**
|
|
195
227
|
* Keep mark after split node
|
|
@@ -201,7 +233,8 @@ declare module '@tiptap/core' {
|
|
|
201
233
|
inclusive?: MarkSpec['inclusive'] | ((this: {
|
|
202
234
|
name: string;
|
|
203
235
|
options: Options;
|
|
204
|
-
|
|
236
|
+
storage: Storage;
|
|
237
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['inclusive'];
|
|
205
238
|
}) => MarkSpec['inclusive']);
|
|
206
239
|
/**
|
|
207
240
|
* Excludes
|
|
@@ -209,7 +242,8 @@ declare module '@tiptap/core' {
|
|
|
209
242
|
excludes?: MarkSpec['excludes'] | ((this: {
|
|
210
243
|
name: string;
|
|
211
244
|
options: Options;
|
|
212
|
-
|
|
245
|
+
storage: Storage;
|
|
246
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['excludes'];
|
|
213
247
|
}) => MarkSpec['excludes']);
|
|
214
248
|
/**
|
|
215
249
|
* Group
|
|
@@ -217,7 +251,8 @@ declare module '@tiptap/core' {
|
|
|
217
251
|
group?: MarkSpec['group'] | ((this: {
|
|
218
252
|
name: string;
|
|
219
253
|
options: Options;
|
|
220
|
-
|
|
254
|
+
storage: Storage;
|
|
255
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['group'];
|
|
221
256
|
}) => MarkSpec['group']);
|
|
222
257
|
/**
|
|
223
258
|
* Spanning
|
|
@@ -225,7 +260,8 @@ declare module '@tiptap/core' {
|
|
|
225
260
|
spanning?: MarkSpec['spanning'] | ((this: {
|
|
226
261
|
name: string;
|
|
227
262
|
options: Options;
|
|
228
|
-
|
|
263
|
+
storage: Storage;
|
|
264
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['spanning'];
|
|
229
265
|
}) => MarkSpec['spanning']);
|
|
230
266
|
/**
|
|
231
267
|
* Code
|
|
@@ -233,7 +269,8 @@ declare module '@tiptap/core' {
|
|
|
233
269
|
code?: boolean | ((this: {
|
|
234
270
|
name: string;
|
|
235
271
|
options: Options;
|
|
236
|
-
|
|
272
|
+
storage: Storage;
|
|
273
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['code'];
|
|
237
274
|
}) => boolean);
|
|
238
275
|
/**
|
|
239
276
|
* Parse HTML
|
|
@@ -241,7 +278,8 @@ declare module '@tiptap/core' {
|
|
|
241
278
|
parseHTML?: (this: {
|
|
242
279
|
name: string;
|
|
243
280
|
options: Options;
|
|
244
|
-
|
|
281
|
+
storage: Storage;
|
|
282
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['parseHTML'];
|
|
245
283
|
}) => MarkSpec['parseDOM'];
|
|
246
284
|
/**
|
|
247
285
|
* Render HTML
|
|
@@ -249,7 +287,8 @@ declare module '@tiptap/core' {
|
|
|
249
287
|
renderHTML?: ((this: {
|
|
250
288
|
name: string;
|
|
251
289
|
options: Options;
|
|
252
|
-
|
|
290
|
+
storage: Storage;
|
|
291
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['renderHTML'];
|
|
253
292
|
}, props: {
|
|
254
293
|
mark: ProseMirrorMark;
|
|
255
294
|
HTMLAttributes: Record<string, any>;
|
|
@@ -260,19 +299,21 @@ declare module '@tiptap/core' {
|
|
|
260
299
|
addAttributes?: (this: {
|
|
261
300
|
name: string;
|
|
262
301
|
options: Options;
|
|
263
|
-
|
|
302
|
+
storage: Storage;
|
|
303
|
+
parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
|
|
264
304
|
}) => Attributes | {};
|
|
265
305
|
}
|
|
266
306
|
}
|
|
267
|
-
export declare class Mark<Options = any> {
|
|
307
|
+
export declare class Mark<Options = any, Storage = any> {
|
|
268
308
|
type: string;
|
|
269
309
|
name: string;
|
|
270
310
|
parent: Mark | null;
|
|
271
311
|
child: Mark | null;
|
|
272
312
|
options: Options;
|
|
313
|
+
storage: Storage;
|
|
273
314
|
config: MarkConfig;
|
|
274
|
-
constructor(config?: Partial<MarkConfig<Options>>);
|
|
275
|
-
static create<O>(config?: Partial<MarkConfig<O>>): Mark<O>;
|
|
276
|
-
configure(options?: Partial<Options>): Mark<Options>;
|
|
277
|
-
extend<ExtendedOptions = Options>(extendedConfig?: Partial<MarkConfig<ExtendedOptions>>): Mark<ExtendedOptions>;
|
|
315
|
+
constructor(config?: Partial<MarkConfig<Options, Storage>>);
|
|
316
|
+
static create<O = any, S = any>(config?: Partial<MarkConfig<O, S>>): Mark<O, S>;
|
|
317
|
+
configure(options?: Partial<Options>): Mark<Options, Storage>;
|
|
318
|
+
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<MarkConfig<ExtendedOptions, ExtendedStorage>>): Mark<ExtendedOptions, ExtendedStorage>;
|
|
278
319
|
}
|