@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.
Files changed (72) hide show
  1. package/dist/packages/core/src/Editor.d.ts +5 -0
  2. package/dist/packages/core/src/Extension.d.ts +56 -23
  3. package/dist/packages/core/src/Mark.d.ts +72 -31
  4. package/dist/packages/core/src/Node.d.ts +86 -38
  5. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +1 -1
  6. package/dist/packages/core/src/extensions/commands.d.ts +1 -1
  7. package/dist/packages/core/src/extensions/editable.d.ts +1 -1
  8. package/dist/packages/core/src/extensions/focusEvents.d.ts +1 -1
  9. package/dist/packages/core/src/extensions/keymap.d.ts +1 -1
  10. package/dist/packages/core/src/extensions/tabindex.d.ts +1 -1
  11. package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -2
  12. package/dist/packages/core/src/helpers/splitExtensions.d.ts +3 -3
  13. package/dist/packages/core/src/index.d.ts +3 -3
  14. package/dist/packages/core/src/style.d.ts +1 -1
  15. package/dist/packages/core/src/types.d.ts +2 -0
  16. package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -0
  17. package/dist/packages/core/src/utilities/isNumber.d.ts +1 -0
  18. package/dist/packages/extension-blockquote/src/blockquote.d.ts +1 -1
  19. package/dist/packages/extension-bold/src/bold.d.ts +1 -1
  20. package/dist/packages/extension-bubble-menu/src/bubble-menu.d.ts +1 -1
  21. package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +1 -1
  22. package/dist/packages/extension-character-count/src/character-count.d.ts +1 -1
  23. package/dist/packages/extension-code/src/code.d.ts +1 -1
  24. package/dist/packages/extension-code-block/src/code-block.d.ts +1 -1
  25. package/dist/packages/extension-code-block-lowlight/src/code-block-lowlight.d.ts +1 -1
  26. package/dist/packages/extension-collaboration/src/collaboration.d.ts +1 -1
  27. package/dist/packages/extension-collaboration-cursor/src/collaboration-cursor.d.ts +17 -1
  28. package/dist/packages/extension-color/src/color.d.ts +1 -1
  29. package/dist/packages/extension-document/src/document.d.ts +1 -1
  30. package/dist/packages/extension-dropcursor/src/dropcursor.d.ts +1 -1
  31. package/dist/packages/extension-floating-menu/src/floating-menu.d.ts +1 -1
  32. package/dist/packages/extension-focus/src/focus.d.ts +1 -1
  33. package/dist/packages/extension-font-family/src/font-family.d.ts +1 -1
  34. package/dist/packages/extension-gapcursor/src/gapcursor.d.ts +3 -2
  35. package/dist/packages/extension-hard-break/src/hard-break.d.ts +1 -1
  36. package/dist/packages/extension-heading/src/heading.d.ts +1 -1
  37. package/dist/packages/extension-highlight/src/highlight.d.ts +1 -1
  38. package/dist/packages/extension-history/src/history.d.ts +1 -1
  39. package/dist/packages/extension-horizontal-rule/src/horizontal-rule.d.ts +1 -1
  40. package/dist/packages/extension-image/src/image.d.ts +1 -1
  41. package/dist/packages/extension-italic/src/italic.d.ts +1 -1
  42. package/dist/packages/extension-link/src/link.d.ts +1 -1
  43. package/dist/packages/extension-list-item/src/list-item.d.ts +1 -1
  44. package/dist/packages/extension-mention/src/mention.d.ts +1 -1
  45. package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +1 -1
  46. package/dist/packages/extension-paragraph/src/paragraph.d.ts +1 -1
  47. package/dist/packages/extension-placeholder/src/placeholder.d.ts +1 -1
  48. package/dist/packages/extension-strike/src/strike.d.ts +1 -1
  49. package/dist/packages/extension-subscript/src/subscript.d.ts +1 -1
  50. package/dist/packages/extension-superscript/src/superscript.d.ts +1 -1
  51. package/dist/packages/extension-table/src/table.d.ts +3 -2
  52. package/dist/packages/extension-table-cell/src/table-cell.d.ts +1 -1
  53. package/dist/packages/extension-table-header/src/table-header.d.ts +1 -1
  54. package/dist/packages/extension-table-row/src/table-row.d.ts +1 -1
  55. package/dist/packages/extension-task-item/src/task-item.d.ts +1 -1
  56. package/dist/packages/extension-task-list/src/task-list.d.ts +1 -1
  57. package/dist/packages/extension-text/src/text.d.ts +1 -1
  58. package/dist/packages/extension-text-align/src/text-align.d.ts +1 -1
  59. package/dist/packages/extension-text-style/src/text-style.d.ts +1 -1
  60. package/dist/packages/extension-typography/src/typography.d.ts +1 -1
  61. package/dist/packages/extension-underline/src/underline.d.ts +1 -1
  62. package/dist/packages/starter-kit/src/starter-kit.d.ts +1 -1
  63. package/dist/packages/suggestion/src/suggestion.d.ts +4 -1
  64. package/dist/tiptap-react.cjs.js +10 -4
  65. package/dist/tiptap-react.cjs.js.map +1 -1
  66. package/dist/tiptap-react.esm.js +10 -4
  67. package/dist/tiptap-react.esm.js.map +1 -1
  68. package/dist/tiptap-react.umd.js +10 -4
  69. package/dist/tiptap-react.umd.js.map +1 -1
  70. package/package.json +6 -6
  71. package/src/ReactNodeViewRenderer.tsx +4 -4
  72. package/src/useEditor.ts +7 -1
@@ -6,7 +6,7 @@ import { Extensions, Attributes, NodeViewRenderer, GlobalAttributes, RawCommands
6
6
  import { NodeConfig } from '.';
7
7
  import { Editor } from './Editor';
8
8
  declare module '@tiptap/core' {
9
- interface NodeConfig<Options = any> {
9
+ interface NodeConfig<Options = any, Storage = any> {
10
10
  [key: string]: any;
11
11
  /**
12
12
  * Name
@@ -20,13 +20,29 @@ declare module '@tiptap/core' {
20
20
  * Default options
21
21
  */
22
22
  defaultOptions?: Options;
23
+ /**
24
+ * Default Options
25
+ */
26
+ addOptions?: (this: {
27
+ name: string;
28
+ parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addOptions'], undefined>;
29
+ }) => Options;
30
+ /**
31
+ * Default Storage
32
+ */
33
+ addStorage?: (this: {
34
+ name: string;
35
+ options: Options;
36
+ parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addStorage'], undefined>;
37
+ }) => Storage;
23
38
  /**
24
39
  * Global attributes
25
40
  */
26
41
  addGlobalAttributes?: (this: {
27
42
  name: string;
28
43
  options: Options;
29
- parent: ParentConfig<NodeConfig<Options>>['addGlobalAttributes'];
44
+ storage: Storage;
45
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addGlobalAttributes'];
30
46
  }) => GlobalAttributes | {};
31
47
  /**
32
48
  * Raw
@@ -34,9 +50,10 @@ declare module '@tiptap/core' {
34
50
  addCommands?: (this: {
35
51
  name: string;
36
52
  options: Options;
53
+ storage: Storage;
37
54
  editor: Editor;
38
55
  type: NodeType;
39
- parent: ParentConfig<NodeConfig<Options>>['addCommands'];
56
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addCommands'];
40
57
  }) => Partial<RawCommands>;
41
58
  /**
42
59
  * Keyboard shortcuts
@@ -44,9 +61,10 @@ declare module '@tiptap/core' {
44
61
  addKeyboardShortcuts?: (this: {
45
62
  name: string;
46
63
  options: Options;
64
+ storage: Storage;
47
65
  editor: Editor;
48
66
  type: NodeType;
49
- parent: ParentConfig<NodeConfig<Options>>['addKeyboardShortcuts'];
67
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addKeyboardShortcuts'];
50
68
  }) => {
51
69
  [key: string]: KeyboardShortcutCommand;
52
70
  };
@@ -56,9 +74,10 @@ declare module '@tiptap/core' {
56
74
  addInputRules?: (this: {
57
75
  name: string;
58
76
  options: Options;
77
+ storage: Storage;
59
78
  editor: Editor;
60
79
  type: NodeType;
61
- parent: ParentConfig<NodeConfig<Options>>['addInputRules'];
80
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addInputRules'];
62
81
  }) => InputRule[];
63
82
  /**
64
83
  * Paste rules
@@ -66,9 +85,10 @@ declare module '@tiptap/core' {
66
85
  addPasteRules?: (this: {
67
86
  name: string;
68
87
  options: Options;
88
+ storage: Storage;
69
89
  editor: Editor;
70
90
  type: NodeType;
71
- parent: ParentConfig<NodeConfig<Options>>['addPasteRules'];
91
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addPasteRules'];
72
92
  }) => PasteRule[];
73
93
  /**
74
94
  * ProseMirror plugins
@@ -76,9 +96,10 @@ declare module '@tiptap/core' {
76
96
  addProseMirrorPlugins?: (this: {
77
97
  name: string;
78
98
  options: Options;
99
+ storage: Storage;
79
100
  editor: Editor;
80
101
  type: NodeType;
81
- parent: ParentConfig<NodeConfig<Options>>['addProseMirrorPlugins'];
102
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addProseMirrorPlugins'];
82
103
  }) => Plugin[];
83
104
  /**
84
105
  * Extensions
@@ -86,7 +107,8 @@ declare module '@tiptap/core' {
86
107
  addExtensions?: (this: {
87
108
  name: string;
88
109
  options: Options;
89
- parent: ParentConfig<NodeConfig<Options>>['addExtensions'];
110
+ storage: Storage;
111
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addExtensions'];
90
112
  }) => Extensions;
91
113
  /**
92
114
  * Extend Node Schema
@@ -94,7 +116,8 @@ declare module '@tiptap/core' {
94
116
  extendNodeSchema?: ((this: {
95
117
  name: string;
96
118
  options: Options;
97
- parent: ParentConfig<NodeConfig<Options>>['extendNodeSchema'];
119
+ storage: Storage;
120
+ parent: ParentConfig<NodeConfig<Options, Storage>>['extendNodeSchema'];
98
121
  }, extension: Node) => Record<string, any>) | null;
99
122
  /**
100
123
  * Extend Mark Schema
@@ -102,7 +125,8 @@ declare module '@tiptap/core' {
102
125
  extendMarkSchema?: ((this: {
103
126
  name: string;
104
127
  options: Options;
105
- parent: ParentConfig<NodeConfig<Options>>['extendMarkSchema'];
128
+ storage: Storage;
129
+ parent: ParentConfig<NodeConfig<Options, Storage>>['extendMarkSchema'];
106
130
  }, extension: Node) => Record<string, any>) | null;
107
131
  /**
108
132
  * The editor is not ready yet.
@@ -110,9 +134,10 @@ declare module '@tiptap/core' {
110
134
  onBeforeCreate?: ((this: {
111
135
  name: string;
112
136
  options: Options;
137
+ storage: Storage;
113
138
  editor: Editor;
114
139
  type: NodeType;
115
- parent: ParentConfig<NodeConfig<Options>>['onBeforeCreate'];
140
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onBeforeCreate'];
116
141
  }) => void) | null;
117
142
  /**
118
143
  * The editor is ready.
@@ -120,9 +145,10 @@ declare module '@tiptap/core' {
120
145
  onCreate?: ((this: {
121
146
  name: string;
122
147
  options: Options;
148
+ storage: Storage;
123
149
  editor: Editor;
124
150
  type: NodeType;
125
- parent: ParentConfig<NodeConfig<Options>>['onCreate'];
151
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onCreate'];
126
152
  }) => void) | null;
127
153
  /**
128
154
  * The content has changed.
@@ -130,9 +156,10 @@ declare module '@tiptap/core' {
130
156
  onUpdate?: ((this: {
131
157
  name: string;
132
158
  options: Options;
159
+ storage: Storage;
133
160
  editor: Editor;
134
161
  type: NodeType;
135
- parent: ParentConfig<NodeConfig<Options>>['onUpdate'];
162
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onUpdate'];
136
163
  }) => void) | null;
137
164
  /**
138
165
  * The selection has changed.
@@ -140,9 +167,10 @@ declare module '@tiptap/core' {
140
167
  onSelectionUpdate?: ((this: {
141
168
  name: string;
142
169
  options: Options;
170
+ storage: Storage;
143
171
  editor: Editor;
144
172
  type: NodeType;
145
- parent: ParentConfig<NodeConfig<Options>>['onSelectionUpdate'];
173
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onSelectionUpdate'];
146
174
  }) => void) | null;
147
175
  /**
148
176
  * The editor state has changed.
@@ -150,9 +178,10 @@ declare module '@tiptap/core' {
150
178
  onTransaction?: ((this: {
151
179
  name: string;
152
180
  options: Options;
181
+ storage: Storage;
153
182
  editor: Editor;
154
183
  type: NodeType;
155
- parent: ParentConfig<NodeConfig<Options>>['onTransaction'];
184
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onTransaction'];
156
185
  }, props: {
157
186
  transaction: Transaction;
158
187
  }) => void) | null;
@@ -162,9 +191,10 @@ declare module '@tiptap/core' {
162
191
  onFocus?: ((this: {
163
192
  name: string;
164
193
  options: Options;
194
+ storage: Storage;
165
195
  editor: Editor;
166
196
  type: NodeType;
167
- parent: ParentConfig<NodeConfig<Options>>['onFocus'];
197
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onFocus'];
168
198
  }, props: {
169
199
  event: FocusEvent;
170
200
  }) => void) | null;
@@ -174,9 +204,10 @@ declare module '@tiptap/core' {
174
204
  onBlur?: ((this: {
175
205
  name: string;
176
206
  options: Options;
207
+ storage: Storage;
177
208
  editor: Editor;
178
209
  type: NodeType;
179
- parent: ParentConfig<NodeConfig<Options>>['onBlur'];
210
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onBlur'];
180
211
  }, props: {
181
212
  event: FocusEvent;
182
213
  }) => void) | null;
@@ -186,9 +217,10 @@ declare module '@tiptap/core' {
186
217
  onDestroy?: ((this: {
187
218
  name: string;
188
219
  options: Options;
220
+ storage: Storage;
189
221
  editor: Editor;
190
222
  type: NodeType;
191
- parent: ParentConfig<NodeConfig<Options>>['onDestroy'];
223
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onDestroy'];
192
224
  }) => void) | null;
193
225
  /**
194
226
  * Node View
@@ -196,9 +228,10 @@ declare module '@tiptap/core' {
196
228
  addNodeView?: ((this: {
197
229
  name: string;
198
230
  options: Options;
231
+ storage: Storage;
199
232
  editor: Editor;
200
233
  type: NodeType;
201
- parent: ParentConfig<NodeConfig<Options>>['addNodeView'];
234
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addNodeView'];
202
235
  }) => NodeViewRenderer) | null;
203
236
  /**
204
237
  * TopNode
@@ -210,7 +243,8 @@ declare module '@tiptap/core' {
210
243
  content?: NodeSpec['content'] | ((this: {
211
244
  name: string;
212
245
  options: Options;
213
- parent: ParentConfig<NodeConfig<Options>>['content'];
246
+ storage: Storage;
247
+ parent: ParentConfig<NodeConfig<Options, Storage>>['content'];
214
248
  }) => NodeSpec['content']);
215
249
  /**
216
250
  * Marks
@@ -218,7 +252,8 @@ declare module '@tiptap/core' {
218
252
  marks?: NodeSpec['marks'] | ((this: {
219
253
  name: string;
220
254
  options: Options;
221
- parent: ParentConfig<NodeConfig<Options>>['marks'];
255
+ storage: Storage;
256
+ parent: ParentConfig<NodeConfig<Options, Storage>>['marks'];
222
257
  }) => NodeSpec['marks']);
223
258
  /**
224
259
  * Group
@@ -226,7 +261,8 @@ declare module '@tiptap/core' {
226
261
  group?: NodeSpec['group'] | ((this: {
227
262
  name: string;
228
263
  options: Options;
229
- parent: ParentConfig<NodeConfig<Options>>['group'];
264
+ storage: Storage;
265
+ parent: ParentConfig<NodeConfig<Options, Storage>>['group'];
230
266
  }) => NodeSpec['group']);
231
267
  /**
232
268
  * Inline
@@ -234,7 +270,8 @@ declare module '@tiptap/core' {
234
270
  inline?: NodeSpec['inline'] | ((this: {
235
271
  name: string;
236
272
  options: Options;
237
- parent: ParentConfig<NodeConfig<Options>>['inline'];
273
+ storage: Storage;
274
+ parent: ParentConfig<NodeConfig<Options, Storage>>['inline'];
238
275
  }) => NodeSpec['inline']);
239
276
  /**
240
277
  * Atom
@@ -242,7 +279,8 @@ declare module '@tiptap/core' {
242
279
  atom?: NodeSpec['atom'] | ((this: {
243
280
  name: string;
244
281
  options: Options;
245
- parent: ParentConfig<NodeConfig<Options>>['atom'];
282
+ storage: Storage;
283
+ parent: ParentConfig<NodeConfig<Options, Storage>>['atom'];
246
284
  }) => NodeSpec['atom']);
247
285
  /**
248
286
  * Selectable
@@ -250,7 +288,8 @@ declare module '@tiptap/core' {
250
288
  selectable?: NodeSpec['selectable'] | ((this: {
251
289
  name: string;
252
290
  options: Options;
253
- parent: ParentConfig<NodeConfig<Options>>['selectable'];
291
+ storage: Storage;
292
+ parent: ParentConfig<NodeConfig<Options, Storage>>['selectable'];
254
293
  }) => NodeSpec['selectable']);
255
294
  /**
256
295
  * Draggable
@@ -258,7 +297,8 @@ declare module '@tiptap/core' {
258
297
  draggable?: NodeSpec['draggable'] | ((this: {
259
298
  name: string;
260
299
  options: Options;
261
- parent: ParentConfig<NodeConfig<Options>>['draggable'];
300
+ storage: Storage;
301
+ parent: ParentConfig<NodeConfig<Options, Storage>>['draggable'];
262
302
  }) => NodeSpec['draggable']);
263
303
  /**
264
304
  * Code
@@ -266,7 +306,8 @@ declare module '@tiptap/core' {
266
306
  code?: NodeSpec['code'] | ((this: {
267
307
  name: string;
268
308
  options: Options;
269
- parent: ParentConfig<NodeConfig<Options>>['code'];
309
+ storage: Storage;
310
+ parent: ParentConfig<NodeConfig<Options, Storage>>['code'];
270
311
  }) => NodeSpec['code']);
271
312
  /**
272
313
  * Defining
@@ -274,7 +315,8 @@ declare module '@tiptap/core' {
274
315
  defining?: NodeSpec['defining'] | ((this: {
275
316
  name: string;
276
317
  options: Options;
277
- parent: ParentConfig<NodeConfig<Options>>['defining'];
318
+ storage: Storage;
319
+ parent: ParentConfig<NodeConfig<Options, Storage>>['defining'];
278
320
  }) => NodeSpec['defining']);
279
321
  /**
280
322
  * Isolating
@@ -282,7 +324,8 @@ declare module '@tiptap/core' {
282
324
  isolating?: NodeSpec['isolating'] | ((this: {
283
325
  name: string;
284
326
  options: Options;
285
- parent: ParentConfig<NodeConfig<Options>>['isolating'];
327
+ storage: Storage;
328
+ parent: ParentConfig<NodeConfig<Options, Storage>>['isolating'];
286
329
  }) => NodeSpec['isolating']);
287
330
  /**
288
331
  * Parse HTML
@@ -290,7 +333,8 @@ declare module '@tiptap/core' {
290
333
  parseHTML?: (this: {
291
334
  name: string;
292
335
  options: Options;
293
- parent: ParentConfig<NodeConfig<Options>>['parseHTML'];
336
+ storage: Storage;
337
+ parent: ParentConfig<NodeConfig<Options, Storage>>['parseHTML'];
294
338
  }) => NodeSpec['parseDOM'];
295
339
  /**
296
340
  * Render HTML
@@ -298,7 +342,8 @@ declare module '@tiptap/core' {
298
342
  renderHTML?: ((this: {
299
343
  name: string;
300
344
  options: Options;
301
- parent: ParentConfig<NodeConfig<Options>>['renderHTML'];
345
+ storage: Storage;
346
+ parent: ParentConfig<NodeConfig<Options, Storage>>['renderHTML'];
302
347
  }, props: {
303
348
  node: ProseMirrorNode;
304
349
  HTMLAttributes: Record<string, any>;
@@ -309,7 +354,8 @@ declare module '@tiptap/core' {
309
354
  renderText?: ((this: {
310
355
  name: string;
311
356
  options: Options;
312
- parent: ParentConfig<NodeConfig<Options>>['renderText'];
357
+ storage: Storage;
358
+ parent: ParentConfig<NodeConfig<Options, Storage>>['renderText'];
313
359
  }, props: {
314
360
  node: ProseMirrorNode;
315
361
  pos: number;
@@ -322,19 +368,21 @@ declare module '@tiptap/core' {
322
368
  addAttributes?: (this: {
323
369
  name: string;
324
370
  options: Options;
325
- parent: ParentConfig<NodeConfig<Options>>['addAttributes'];
371
+ storage: Storage;
372
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
326
373
  }) => Attributes | {};
327
374
  }
328
375
  }
329
- export declare class Node<Options = any> {
376
+ export declare class Node<Options = any, Storage = any> {
330
377
  type: string;
331
378
  name: string;
332
379
  parent: Node | null;
333
380
  child: Node | null;
334
381
  options: Options;
382
+ storage: Storage;
335
383
  config: NodeConfig;
336
- constructor(config?: Partial<NodeConfig<Options>>);
337
- static create<O>(config?: Partial<NodeConfig<O>>): Node<O>;
338
- configure(options?: Partial<Options>): Node<Options>;
339
- extend<ExtendedOptions = Options>(extendedConfig?: Partial<NodeConfig<ExtendedOptions>>): Node<ExtendedOptions>;
384
+ constructor(config?: Partial<NodeConfig<Options, Storage>>);
385
+ static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>>): Node<O, S>;
386
+ configure(options?: Partial<Options>): Node<Options, Storage>;
387
+ extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>>): Node<ExtendedOptions, ExtendedStorage>;
340
388
  }
@@ -1,2 +1,2 @@
1
1
  import { Extension } from '../Extension';
2
- export declare const ClipboardTextSerializer: Extension<unknown>;
2
+ export declare const ClipboardTextSerializer: Extension<any, any>;
@@ -95,4 +95,4 @@ export { unsetMark };
95
95
  export { updateAttributes };
96
96
  export { wrapIn };
97
97
  export { wrapInList };
98
- export declare const Commands: Extension<unknown>;
98
+ export declare const Commands: Extension<any, any>;
@@ -1,2 +1,2 @@
1
1
  import { Extension } from '../Extension';
2
- export declare const Editable: Extension<unknown>;
2
+ export declare const Editable: Extension<any, any>;
@@ -1,2 +1,2 @@
1
1
  import { Extension } from '../Extension';
2
- export declare const FocusEvents: Extension<unknown>;
2
+ export declare const FocusEvents: Extension<any, any>;
@@ -1,2 +1,2 @@
1
1
  import { Extension } from '../Extension';
2
- export declare const Keymap: Extension<unknown>;
2
+ export declare const Keymap: Extension<any, any>;
@@ -1,2 +1,2 @@
1
1
  import { Extension } from '../Extension';
2
- export declare const Tabindex: Extension<unknown>;
2
+ export declare const Tabindex: Extension<any, any>;
@@ -1,2 +1,2 @@
1
- import { AnyExtension, RemoveThis } from '../types';
2
- export default function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Record<string, any>): RemoveThis<T>;
1
+ import { AnyExtension, RemoveThis, MaybeThisParameterType } from '../types';
2
+ export default function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
@@ -3,7 +3,7 @@ import { Extension } from '../Extension';
3
3
  import { Node } from '../Node';
4
4
  import { Mark } from '../Mark';
5
5
  export default function splitExtensions(extensions: Extensions): {
6
- baseExtensions: Extension<any>[];
7
- nodeExtensions: Node<any>[];
8
- markExtensions: Mark<any>[];
6
+ baseExtensions: Extension<any, any>[];
7
+ nodeExtensions: Node<any, any>[];
8
+ markExtensions: Mark<any, any>[];
9
9
  };
@@ -49,9 +49,9 @@ export { default as isTextSelection } from './helpers/isTextSelection';
49
49
  export { default as posToDOMRect } from './helpers/posToDOMRect';
50
50
  export interface Commands<ReturnType = any> {
51
51
  }
52
- export interface ExtensionConfig<Options = any> {
52
+ export interface ExtensionConfig<Options = any, Storage = any> {
53
53
  }
54
- export interface NodeConfig<Options = any> {
54
+ export interface NodeConfig<Options = any, Storage = any> {
55
55
  }
56
- export interface MarkConfig<Options = any> {
56
+ export interface MarkConfig<Options = any, Storage = any> {
57
57
  }
@@ -1,2 +1,2 @@
1
- declare const style = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}";
1
+ declare const style = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}";
2
2
  export default style;
@@ -12,8 +12,10 @@ export declare type Extensions = AnyExtension[];
12
12
  export declare type ParentConfig<T> = Partial<{
13
13
  [P in keyof T]: Required<T>[P] extends (...args: any) => any ? (...args: Parameters<Required<T>[P]>) => ReturnType<Required<T>[P]> : T[P];
14
14
  }>;
15
+ export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
15
16
  export declare type RemoveThis<T> = T extends (...args: any) => any ? (...args: Parameters<T>) => ReturnType<T> : T;
16
17
  export declare type MaybeReturnType<T> = T extends (...args: any) => any ? ReturnType<T> : T;
18
+ export declare type MaybeThisParameterType<T> = Exclude<T, Primitive> extends (...args: any) => any ? ThisParameterType<Exclude<T, Primitive>> : any;
17
19
  export interface EditorEvents {
18
20
  beforeCreate: {
19
21
  editor: Editor;
@@ -0,0 +1 @@
1
+ export default function findDuplicates(items: any[]): any[];
@@ -0,0 +1 @@
1
+ export default function isNumber(value: any): value is number;
@@ -21,4 +21,4 @@ declare module '@tiptap/core' {
21
21
  }
22
22
  }
23
23
  export declare const inputRegex: RegExp;
24
- export declare const Blockquote: Node<BlockquoteOptions>;
24
+ export declare const Blockquote: Node<BlockquoteOptions, unknown>;
@@ -24,4 +24,4 @@ export declare const starInputRegex: RegExp;
24
24
  export declare const starPasteRegex: RegExp;
25
25
  export declare const underscoreInputRegex: RegExp;
26
26
  export declare const underscorePasteRegex: RegExp;
27
- export declare const Bold: Mark<BoldOptions>;
27
+ export declare const Bold: Mark<BoldOptions, unknown>;
@@ -3,4 +3,4 @@ import { BubbleMenuPluginProps } from './bubble-menu-plugin';
3
3
  export declare type BubbleMenuOptions = Omit<BubbleMenuPluginProps, 'editor' | 'element'> & {
4
4
  element: HTMLElement | null;
5
5
  };
6
- export declare const BubbleMenu: Extension<BubbleMenuOptions>;
6
+ export declare const BubbleMenu: Extension<BubbleMenuOptions, any>;
@@ -13,4 +13,4 @@ declare module '@tiptap/core' {
13
13
  }
14
14
  }
15
15
  export declare const inputRegex: RegExp;
16
- export declare const BulletList: Node<BulletListOptions>;
16
+ export declare const BulletList: Node<BulletListOptions, unknown>;
@@ -4,4 +4,4 @@ export declare const pluginKey: PluginKey<any, any>;
4
4
  export interface CharacterCountOptions {
5
5
  limit?: number;
6
6
  }
7
- export declare const CharacterCount: Extension<CharacterCountOptions>;
7
+ export declare const CharacterCount: Extension<CharacterCountOptions, any>;
@@ -22,4 +22,4 @@ declare module '@tiptap/core' {
22
22
  }
23
23
  export declare const inputRegex: RegExp;
24
24
  export declare const pasteRegex: RegExp;
25
- export declare const Code: Mark<CodeOptions>;
25
+ export declare const Code: Mark<CodeOptions, unknown>;
@@ -23,4 +23,4 @@ declare module '@tiptap/core' {
23
23
  }
24
24
  export declare const backtickInputRegex: RegExp;
25
25
  export declare const tildeInputRegex: RegExp;
26
- export declare const CodeBlock: Node<CodeBlockOptions>;
26
+ export declare const CodeBlock: Node<CodeBlockOptions, unknown>;
@@ -2,4 +2,4 @@ import { CodeBlockOptions } from '@tiptap/extension-code-block';
2
2
  export interface CodeBlockLowlightOptions extends CodeBlockOptions {
3
3
  lowlight: any;
4
4
  }
5
- export declare const CodeBlockLowlight: import("@tiptap/core").Node<CodeBlockLowlightOptions>;
5
+ export declare const CodeBlockLowlight: import("@tiptap/core").Node<CodeBlockLowlightOptions, unknown>;
@@ -27,4 +27,4 @@ export interface CollaborationOptions {
27
27
  */
28
28
  fragment: any;
29
29
  }
30
- export declare const Collaboration: Extension<CollaborationOptions>;
30
+ export declare const Collaboration: Extension<CollaborationOptions, any>;
@@ -1,8 +1,17 @@
1
1
  import { Extension } from '@tiptap/core';
2
+ declare type CollaborationCursorStorage = {
3
+ users: {
4
+ clientId: number;
5
+ [key: string]: any;
6
+ }[];
7
+ };
2
8
  export interface CollaborationCursorOptions {
3
9
  provider: any;
4
10
  user: Record<string, any>;
5
11
  render(user: Record<string, any>): HTMLElement;
12
+ /**
13
+ * @deprecated The "onUpdate" option is deprecated. Please use `editor.storage.collaborationCursor.users` instead. Read more: https://tiptap.dev/api/extensions/collaboration-cursor
14
+ */
6
15
  onUpdate: (users: {
7
16
  clientId: number;
8
17
  [key: string]: any;
@@ -14,8 +23,15 @@ declare module '@tiptap/core' {
14
23
  /**
15
24
  * Update details of the current user
16
25
  */
26
+ updateUser: (attributes: Record<string, any>) => ReturnType;
27
+ /**
28
+ * Update details of the current user
29
+ *
30
+ * @deprecated The "user" command is deprecated. Please use "updateUser" instead. Read more: https://tiptap.dev/api/extensions/collaboration-cursor
31
+ */
17
32
  user: (attributes: Record<string, any>) => ReturnType;
18
33
  };
19
34
  }
20
35
  }
21
- export declare const CollaborationCursor: Extension<CollaborationCursorOptions>;
36
+ export declare const CollaborationCursor: Extension<CollaborationCursorOptions, CollaborationCursorStorage>;
37
+ export {};
@@ -17,5 +17,5 @@ declare module '@tiptap/core' {
17
17
  };
18
18
  }
19
19
  }
20
- export declare const Color: Extension<ColorOptions>;
20
+ export declare const Color: Extension<ColorOptions, any>;
21
21
  export {};
@@ -1,2 +1,2 @@
1
1
  import { Node } from '@tiptap/core';
2
- export declare const Document: Node<unknown>;
2
+ export declare const Document: Node<any, any>;
@@ -4,4 +4,4 @@ export interface DropcursorOptions {
4
4
  width: number | null;
5
5
  class: string | null;
6
6
  }
7
- export declare const Dropcursor: Extension<DropcursorOptions>;
7
+ export declare const Dropcursor: Extension<DropcursorOptions, any>;
@@ -3,4 +3,4 @@ import { FloatingMenuPluginProps } from './floating-menu-plugin';
3
3
  export declare type FloatingMenuOptions = Omit<FloatingMenuPluginProps, 'editor' | 'element'> & {
4
4
  element: HTMLElement | null;
5
5
  };
6
- export declare const FloatingMenu: Extension<FloatingMenuOptions>;
6
+ export declare const FloatingMenu: Extension<FloatingMenuOptions, any>;
@@ -3,4 +3,4 @@ export interface FocusOptions {
3
3
  className: string;
4
4
  mode: 'all' | 'deepest' | 'shallowest';
5
5
  }
6
- export declare const FocusClasses: Extension<FocusOptions>;
6
+ export declare const FocusClasses: Extension<FocusOptions, any>;
@@ -17,5 +17,5 @@ declare module '@tiptap/core' {
17
17
  };
18
18
  }
19
19
  }
20
- export declare const FontFamily: Extension<FontFamilyOptions>;
20
+ export declare const FontFamily: Extension<FontFamilyOptions, any>;
21
21
  export {};
@@ -1,14 +1,15 @@
1
1
  import { Extension, ParentConfig } from '@tiptap/core';
2
2
  declare module '@tiptap/core' {
3
- interface NodeConfig<Options> {
3
+ interface NodeConfig<Options, Storage> {
4
4
  /**
5
5
  * Allow gap cursor
6
6
  */
7
7
  allowGapCursor?: boolean | null | ((this: {
8
8
  name: string;
9
9
  options: Options;
10
+ storage: Storage;
10
11
  parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'];
11
12
  }) => boolean | null);
12
13
  }
13
14
  }
14
- export declare const Gapcursor: Extension<unknown>;
15
+ export declare const Gapcursor: Extension<any, any>;