reactjs-tiptap-editor-pro 0.2.35 → 0.2.36
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/lib/extension-bundle.d.cts +74 -74
- package/lib/extension-bundle.d.ts +74 -74
- package/lib/index.cjs +3 -3
- package/lib/index.d.cts +87 -74
- package/lib/index.d.ts +87 -74
- package/lib/index.js +126 -124
- package/lib/locale-bundle.d.cts +74 -74
- package/lib/locale-bundle.d.ts +74 -74
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ import { BubbleMenu } from '@tiptap/react';
|
|
|
3
3
|
import { default as default_2 } from 'react';
|
|
4
4
|
import { Editor } from '@tiptap/react';
|
|
5
5
|
import { Editor as Editor_2 } from '@tiptap/core';
|
|
6
|
+
import { EditorState } from '@tiptap/pm/state';
|
|
7
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
6
8
|
import { ForwardRefExoticComponent } from 'react';
|
|
7
9
|
import { RefAttributes } from 'react';
|
|
8
10
|
import { TooltipContentProps } from '@radix-ui/react-tooltip';
|
|
@@ -73,6 +75,8 @@ declare interface BubbleMenuProps {
|
|
|
73
75
|
*/
|
|
74
76
|
hidden?: boolean;
|
|
75
77
|
items?: string[];
|
|
78
|
+
filterItem?: (item: any, editor: Editor) => boolean;
|
|
79
|
+
showShow?: (props: ShouldShowProps) => boolean;
|
|
76
80
|
};
|
|
77
81
|
imageConfig?: {
|
|
78
82
|
/**
|
|
@@ -219,6 +223,15 @@ declare interface RichTextEditorProps {
|
|
|
219
223
|
resetCSS?: boolean;
|
|
220
224
|
}
|
|
221
225
|
|
|
226
|
+
declare interface ShouldShowProps {
|
|
227
|
+
editor: Editor;
|
|
228
|
+
view: EditorView;
|
|
229
|
+
state?: EditorState;
|
|
230
|
+
oldState?: EditorState;
|
|
231
|
+
from?: number;
|
|
232
|
+
to?: number;
|
|
233
|
+
}
|
|
234
|
+
|
|
222
235
|
/**
|
|
223
236
|
* Represents the ToolbarItemProps.
|
|
224
237
|
*/
|
|
@@ -301,6 +314,31 @@ declare module '@tiptap/core' {
|
|
|
301
314
|
}
|
|
302
315
|
|
|
303
316
|
|
|
317
|
+
declare module '@tiptap/core' {
|
|
318
|
+
interface Commands<ReturnType> {
|
|
319
|
+
iframe: {
|
|
320
|
+
/**
|
|
321
|
+
* Add an iframe
|
|
322
|
+
*/
|
|
323
|
+
setIframe: (options: {
|
|
324
|
+
src: string;
|
|
325
|
+
service: string;
|
|
326
|
+
}) => ReturnType;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
declare module '@tiptap/core' {
|
|
333
|
+
interface Commands<ReturnType> {
|
|
334
|
+
tableCellBackground: {
|
|
335
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
336
|
+
unsetTableCellBackground: () => ReturnType;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
|
|
304
342
|
declare module '@tiptap/core' {
|
|
305
343
|
interface Commands<ReturnType> {
|
|
306
344
|
imageUpload: {
|
|
@@ -323,13 +361,8 @@ declare module '@tiptap/core' {
|
|
|
323
361
|
|
|
324
362
|
declare module '@tiptap/core' {
|
|
325
363
|
interface Commands<ReturnType> {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
cols: number;
|
|
329
|
-
}) => ReturnType;
|
|
330
|
-
addColBefore: () => ReturnType;
|
|
331
|
-
addColAfter: () => ReturnType;
|
|
332
|
-
deleteCol: () => ReturnType;
|
|
364
|
+
katex: {
|
|
365
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
333
366
|
};
|
|
334
367
|
}
|
|
335
368
|
}
|
|
@@ -337,8 +370,13 @@ declare module '@tiptap/core' {
|
|
|
337
370
|
|
|
338
371
|
declare module '@tiptap/core' {
|
|
339
372
|
interface Commands<ReturnType> {
|
|
340
|
-
|
|
341
|
-
|
|
373
|
+
columns: {
|
|
374
|
+
insertColumns: (attrs?: {
|
|
375
|
+
cols: number;
|
|
376
|
+
}) => ReturnType;
|
|
377
|
+
addColBefore: () => ReturnType;
|
|
378
|
+
addColAfter: () => ReturnType;
|
|
379
|
+
deleteCol: () => ReturnType;
|
|
342
380
|
};
|
|
343
381
|
}
|
|
344
382
|
}
|
|
@@ -362,34 +400,8 @@ declare module '@tiptap/core' {
|
|
|
362
400
|
|
|
363
401
|
declare module '@tiptap/core' {
|
|
364
402
|
interface Commands<ReturnType> {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
unsetTableCellBackground: () => ReturnType;
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
declare module '@tiptap/core' {
|
|
374
|
-
interface Commands<ReturnType> {
|
|
375
|
-
search: {
|
|
376
|
-
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
377
|
-
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
378
|
-
replace: () => ReturnType;
|
|
379
|
-
replaceAll: () => ReturnType;
|
|
380
|
-
goToPrevSearchResult: () => void;
|
|
381
|
-
goToNextSearchResult: () => void;
|
|
382
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
declare module '@tiptap/core' {
|
|
389
|
-
interface Commands<ReturnType> {
|
|
390
|
-
tableOfContents: {
|
|
391
|
-
setTableOfContents: () => ReturnType;
|
|
392
|
-
removeTableOfContents: () => ReturnType;
|
|
403
|
+
exportWord: {
|
|
404
|
+
exportToWord: () => ReturnType;
|
|
393
405
|
};
|
|
394
406
|
}
|
|
395
407
|
}
|
|
@@ -397,8 +409,11 @@ declare module '@tiptap/core' {
|
|
|
397
409
|
|
|
398
410
|
declare module '@tiptap/core' {
|
|
399
411
|
interface Commands<ReturnType> {
|
|
400
|
-
|
|
401
|
-
|
|
412
|
+
emoji: {
|
|
413
|
+
setEmoji: (emoji: {
|
|
414
|
+
name: string;
|
|
415
|
+
emoji: string;
|
|
416
|
+
}) => ReturnType;
|
|
402
417
|
};
|
|
403
418
|
}
|
|
404
419
|
}
|
|
@@ -406,14 +421,8 @@ declare module '@tiptap/core' {
|
|
|
406
421
|
|
|
407
422
|
declare module '@tiptap/core' {
|
|
408
423
|
interface Commands<ReturnType> {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
* Add an iframe
|
|
412
|
-
*/
|
|
413
|
-
setIframe: (options: {
|
|
414
|
-
src: string;
|
|
415
|
-
service: string;
|
|
416
|
-
}) => ReturnType;
|
|
424
|
+
painter: {
|
|
425
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
417
426
|
};
|
|
418
427
|
}
|
|
419
428
|
}
|
|
@@ -421,19 +430,14 @@ declare module '@tiptap/core' {
|
|
|
421
430
|
|
|
422
431
|
declare module '@tiptap/core' {
|
|
423
432
|
interface Commands<ReturnType> {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
433
|
-
/**
|
|
434
|
-
* Set image alignment
|
|
435
|
-
*/
|
|
436
|
-
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
433
|
+
search: {
|
|
434
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
435
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
436
|
+
replace: () => ReturnType;
|
|
437
|
+
replaceAll: () => ReturnType;
|
|
438
|
+
goToPrevSearchResult: () => void;
|
|
439
|
+
goToNextSearchResult: () => void;
|
|
440
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
437
441
|
};
|
|
438
442
|
}
|
|
439
443
|
}
|
|
@@ -441,8 +445,9 @@ declare module '@tiptap/core' {
|
|
|
441
445
|
|
|
442
446
|
declare module '@tiptap/core' {
|
|
443
447
|
interface Commands<ReturnType> {
|
|
444
|
-
|
|
445
|
-
|
|
448
|
+
tableOfContents: {
|
|
449
|
+
setTableOfContents: () => ReturnType;
|
|
450
|
+
removeTableOfContents: () => ReturnType;
|
|
446
451
|
};
|
|
447
452
|
}
|
|
448
453
|
}
|
|
@@ -468,18 +473,6 @@ declare module '@tiptap/core' {
|
|
|
468
473
|
}
|
|
469
474
|
|
|
470
475
|
|
|
471
|
-
declare module '@tiptap/core' {
|
|
472
|
-
interface Commands<ReturnType> {
|
|
473
|
-
emoji: {
|
|
474
|
-
setEmoji: (emoji: {
|
|
475
|
-
name: string;
|
|
476
|
-
emoji: string;
|
|
477
|
-
}) => ReturnType;
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
476
|
declare module '@tiptap/core' {
|
|
484
477
|
interface Commands<ReturnType> {
|
|
485
478
|
twitter: {
|
|
@@ -502,3 +495,23 @@ declare module '@tiptap/core' {
|
|
|
502
495
|
};
|
|
503
496
|
}
|
|
504
497
|
}
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
declare module '@tiptap/core' {
|
|
501
|
+
interface Commands<ReturnType> {
|
|
502
|
+
imageGifUpload: {
|
|
503
|
+
/**
|
|
504
|
+
* Add an image gif
|
|
505
|
+
*/
|
|
506
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
507
|
+
/**
|
|
508
|
+
* Update an image gif
|
|
509
|
+
*/
|
|
510
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
511
|
+
/**
|
|
512
|
+
* Set image alignment
|
|
513
|
+
*/
|
|
514
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { BubbleMenu } from '@tiptap/react';
|
|
|
3
3
|
import { default as default_2 } from 'react';
|
|
4
4
|
import { Editor } from '@tiptap/react';
|
|
5
5
|
import { Editor as Editor_2 } from '@tiptap/core';
|
|
6
|
+
import { EditorState } from '@tiptap/pm/state';
|
|
7
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
6
8
|
import { ForwardRefExoticComponent } from 'react';
|
|
7
9
|
import { RefAttributes } from 'react';
|
|
8
10
|
import { TooltipContentProps } from '@radix-ui/react-tooltip';
|
|
@@ -73,6 +75,8 @@ declare interface BubbleMenuProps {
|
|
|
73
75
|
*/
|
|
74
76
|
hidden?: boolean;
|
|
75
77
|
items?: string[];
|
|
78
|
+
filterItem?: (item: any, editor: Editor) => boolean;
|
|
79
|
+
showShow?: (props: ShouldShowProps) => boolean;
|
|
76
80
|
};
|
|
77
81
|
imageConfig?: {
|
|
78
82
|
/**
|
|
@@ -219,6 +223,15 @@ declare interface RichTextEditorProps {
|
|
|
219
223
|
resetCSS?: boolean;
|
|
220
224
|
}
|
|
221
225
|
|
|
226
|
+
declare interface ShouldShowProps {
|
|
227
|
+
editor: Editor;
|
|
228
|
+
view: EditorView;
|
|
229
|
+
state?: EditorState;
|
|
230
|
+
oldState?: EditorState;
|
|
231
|
+
from?: number;
|
|
232
|
+
to?: number;
|
|
233
|
+
}
|
|
234
|
+
|
|
222
235
|
/**
|
|
223
236
|
* Represents the ToolbarItemProps.
|
|
224
237
|
*/
|
|
@@ -301,6 +314,31 @@ declare module '@tiptap/core' {
|
|
|
301
314
|
}
|
|
302
315
|
|
|
303
316
|
|
|
317
|
+
declare module '@tiptap/core' {
|
|
318
|
+
interface Commands<ReturnType> {
|
|
319
|
+
iframe: {
|
|
320
|
+
/**
|
|
321
|
+
* Add an iframe
|
|
322
|
+
*/
|
|
323
|
+
setIframe: (options: {
|
|
324
|
+
src: string;
|
|
325
|
+
service: string;
|
|
326
|
+
}) => ReturnType;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
declare module '@tiptap/core' {
|
|
333
|
+
interface Commands<ReturnType> {
|
|
334
|
+
tableCellBackground: {
|
|
335
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
336
|
+
unsetTableCellBackground: () => ReturnType;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
|
|
304
342
|
declare module '@tiptap/core' {
|
|
305
343
|
interface Commands<ReturnType> {
|
|
306
344
|
imageUpload: {
|
|
@@ -323,13 +361,8 @@ declare module '@tiptap/core' {
|
|
|
323
361
|
|
|
324
362
|
declare module '@tiptap/core' {
|
|
325
363
|
interface Commands<ReturnType> {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
cols: number;
|
|
329
|
-
}) => ReturnType;
|
|
330
|
-
addColBefore: () => ReturnType;
|
|
331
|
-
addColAfter: () => ReturnType;
|
|
332
|
-
deleteCol: () => ReturnType;
|
|
364
|
+
katex: {
|
|
365
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
333
366
|
};
|
|
334
367
|
}
|
|
335
368
|
}
|
|
@@ -337,8 +370,13 @@ declare module '@tiptap/core' {
|
|
|
337
370
|
|
|
338
371
|
declare module '@tiptap/core' {
|
|
339
372
|
interface Commands<ReturnType> {
|
|
340
|
-
|
|
341
|
-
|
|
373
|
+
columns: {
|
|
374
|
+
insertColumns: (attrs?: {
|
|
375
|
+
cols: number;
|
|
376
|
+
}) => ReturnType;
|
|
377
|
+
addColBefore: () => ReturnType;
|
|
378
|
+
addColAfter: () => ReturnType;
|
|
379
|
+
deleteCol: () => ReturnType;
|
|
342
380
|
};
|
|
343
381
|
}
|
|
344
382
|
}
|
|
@@ -362,34 +400,8 @@ declare module '@tiptap/core' {
|
|
|
362
400
|
|
|
363
401
|
declare module '@tiptap/core' {
|
|
364
402
|
interface Commands<ReturnType> {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
unsetTableCellBackground: () => ReturnType;
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
declare module '@tiptap/core' {
|
|
374
|
-
interface Commands<ReturnType> {
|
|
375
|
-
search: {
|
|
376
|
-
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
377
|
-
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
378
|
-
replace: () => ReturnType;
|
|
379
|
-
replaceAll: () => ReturnType;
|
|
380
|
-
goToPrevSearchResult: () => void;
|
|
381
|
-
goToNextSearchResult: () => void;
|
|
382
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
declare module '@tiptap/core' {
|
|
389
|
-
interface Commands<ReturnType> {
|
|
390
|
-
tableOfContents: {
|
|
391
|
-
setTableOfContents: () => ReturnType;
|
|
392
|
-
removeTableOfContents: () => ReturnType;
|
|
403
|
+
exportWord: {
|
|
404
|
+
exportToWord: () => ReturnType;
|
|
393
405
|
};
|
|
394
406
|
}
|
|
395
407
|
}
|
|
@@ -397,8 +409,11 @@ declare module '@tiptap/core' {
|
|
|
397
409
|
|
|
398
410
|
declare module '@tiptap/core' {
|
|
399
411
|
interface Commands<ReturnType> {
|
|
400
|
-
|
|
401
|
-
|
|
412
|
+
emoji: {
|
|
413
|
+
setEmoji: (emoji: {
|
|
414
|
+
name: string;
|
|
415
|
+
emoji: string;
|
|
416
|
+
}) => ReturnType;
|
|
402
417
|
};
|
|
403
418
|
}
|
|
404
419
|
}
|
|
@@ -406,14 +421,8 @@ declare module '@tiptap/core' {
|
|
|
406
421
|
|
|
407
422
|
declare module '@tiptap/core' {
|
|
408
423
|
interface Commands<ReturnType> {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
* Add an iframe
|
|
412
|
-
*/
|
|
413
|
-
setIframe: (options: {
|
|
414
|
-
src: string;
|
|
415
|
-
service: string;
|
|
416
|
-
}) => ReturnType;
|
|
424
|
+
painter: {
|
|
425
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
417
426
|
};
|
|
418
427
|
}
|
|
419
428
|
}
|
|
@@ -421,19 +430,14 @@ declare module '@tiptap/core' {
|
|
|
421
430
|
|
|
422
431
|
declare module '@tiptap/core' {
|
|
423
432
|
interface Commands<ReturnType> {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
433
|
-
/**
|
|
434
|
-
* Set image alignment
|
|
435
|
-
*/
|
|
436
|
-
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
433
|
+
search: {
|
|
434
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
435
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
436
|
+
replace: () => ReturnType;
|
|
437
|
+
replaceAll: () => ReturnType;
|
|
438
|
+
goToPrevSearchResult: () => void;
|
|
439
|
+
goToNextSearchResult: () => void;
|
|
440
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
437
441
|
};
|
|
438
442
|
}
|
|
439
443
|
}
|
|
@@ -441,8 +445,9 @@ declare module '@tiptap/core' {
|
|
|
441
445
|
|
|
442
446
|
declare module '@tiptap/core' {
|
|
443
447
|
interface Commands<ReturnType> {
|
|
444
|
-
|
|
445
|
-
|
|
448
|
+
tableOfContents: {
|
|
449
|
+
setTableOfContents: () => ReturnType;
|
|
450
|
+
removeTableOfContents: () => ReturnType;
|
|
446
451
|
};
|
|
447
452
|
}
|
|
448
453
|
}
|
|
@@ -468,18 +473,6 @@ declare module '@tiptap/core' {
|
|
|
468
473
|
}
|
|
469
474
|
|
|
470
475
|
|
|
471
|
-
declare module '@tiptap/core' {
|
|
472
|
-
interface Commands<ReturnType> {
|
|
473
|
-
emoji: {
|
|
474
|
-
setEmoji: (emoji: {
|
|
475
|
-
name: string;
|
|
476
|
-
emoji: string;
|
|
477
|
-
}) => ReturnType;
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
476
|
declare module '@tiptap/core' {
|
|
484
477
|
interface Commands<ReturnType> {
|
|
485
478
|
twitter: {
|
|
@@ -502,3 +495,23 @@ declare module '@tiptap/core' {
|
|
|
502
495
|
};
|
|
503
496
|
}
|
|
504
497
|
}
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
declare module '@tiptap/core' {
|
|
501
|
+
interface Commands<ReturnType> {
|
|
502
|
+
imageGifUpload: {
|
|
503
|
+
/**
|
|
504
|
+
* Add an image gif
|
|
505
|
+
*/
|
|
506
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
507
|
+
/**
|
|
508
|
+
* Update an image gif
|
|
509
|
+
*/
|
|
510
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
511
|
+
/**
|
|
512
|
+
* Set image alignment
|
|
513
|
+
*/
|
|
514
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
}
|