reactjs-tiptap-editor-pro 0.2.40 → 0.2.42

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/index.d.ts CHANGED
@@ -308,15 +308,29 @@ declare module '@tiptap/core' {
308
308
 
309
309
  declare module '@tiptap/core' {
310
310
  interface Commands<ReturnType> {
311
- indent: {
311
+ lineHeight: {
312
+ setLineHeight: (lineHeight: string) => ReturnType;
313
+ unsetLineHeight: () => ReturnType;
314
+ };
315
+ }
316
+ }
317
+
318
+
319
+ declare module '@tiptap/core' {
320
+ interface Commands<ReturnType> {
321
+ imageUpload: {
312
322
  /**
313
- * Set the indent attribute
323
+ * Add an image
314
324
  */
315
- indent: () => ReturnType;
325
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
316
326
  /**
317
- * Set the outdent attribute
327
+ * Update an image
318
328
  */
319
- outdent: () => ReturnType;
329
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
330
+ /**
331
+ * Set image alignment
332
+ */
333
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
320
334
  };
321
335
  }
322
336
  }
@@ -324,9 +338,9 @@ declare module '@tiptap/core' {
324
338
 
325
339
  declare module '@tiptap/core' {
326
340
  interface Commands<ReturnType> {
327
- lineHeight: {
328
- setLineHeight: (lineHeight: string) => ReturnType;
329
- unsetLineHeight: () => ReturnType;
341
+ tableOfContents: {
342
+ setTableOfContents: () => ReturnType;
343
+ removeTableOfContents: () => ReturnType;
330
344
  };
331
345
  }
332
346
  }
@@ -334,9 +348,15 @@ declare module '@tiptap/core' {
334
348
 
335
349
  declare module '@tiptap/core' {
336
350
  interface Commands<ReturnType> {
337
- tableCellBackground: {
338
- setTableCellBackground: (color: string) => ReturnType;
339
- unsetTableCellBackground: () => ReturnType;
351
+ indent: {
352
+ /**
353
+ * Set the indent attribute
354
+ */
355
+ indent: () => ReturnType;
356
+ /**
357
+ * Set the outdent attribute
358
+ */
359
+ outdent: () => ReturnType;
340
360
  };
341
361
  }
342
362
  }
@@ -344,14 +364,8 @@ declare module '@tiptap/core' {
344
364
 
345
365
  declare module '@tiptap/core' {
346
366
  interface Commands<ReturnType> {
347
- search: {
348
- setSearchTerm: (searchTerm: string) => ReturnType;
349
- setReplaceTerm: (replaceTerm: string) => ReturnType;
350
- replace: () => ReturnType;
351
- replaceAll: () => ReturnType;
352
- goToPrevSearchResult: () => void;
353
- goToNextSearchResult: () => void;
354
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
367
+ exportWord: {
368
+ exportToWord: () => ReturnType;
355
369
  };
356
370
  }
357
371
  }
@@ -359,8 +373,13 @@ declare module '@tiptap/core' {
359
373
 
360
374
  declare module '@tiptap/core' {
361
375
  interface Commands<ReturnType> {
362
- painter: {
363
- setPainter: (marks: Mark[]) => ReturnType;
376
+ columns: {
377
+ insertColumns: (attrs?: {
378
+ cols: number;
379
+ }) => ReturnType;
380
+ addColBefore: () => ReturnType;
381
+ addColAfter: () => ReturnType;
382
+ deleteCol: () => ReturnType;
364
383
  };
365
384
  }
366
385
  }
@@ -368,19 +387,8 @@ declare module '@tiptap/core' {
368
387
 
369
388
  declare module '@tiptap/core' {
370
389
  interface Commands<ReturnType> {
371
- imageUpload: {
372
- /**
373
- * Add an image
374
- */
375
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
376
- /**
377
- * Update an image
378
- */
379
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
380
- /**
381
- * Set image alignment
382
- */
383
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
390
+ katex: {
391
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
384
392
  };
385
393
  }
386
394
  }
@@ -388,11 +396,8 @@ declare module '@tiptap/core' {
388
396
 
389
397
  declare module '@tiptap/core' {
390
398
  interface Commands<ReturnType> {
391
- emoji: {
392
- setEmoji: (emoji: {
393
- name: string;
394
- emoji: string;
395
- }) => ReturnType;
399
+ painter: {
400
+ setPainter: (marks: Mark[]) => ReturnType;
396
401
  };
397
402
  }
398
403
  }
@@ -400,13 +405,10 @@ declare module '@tiptap/core' {
400
405
 
401
406
  declare module '@tiptap/core' {
402
407
  interface Commands<ReturnType> {
403
- iframe: {
404
- /**
405
- * Add an iframe
406
- */
407
- setIframe: (options: {
408
- src: string;
409
- service: string;
408
+ emoji: {
409
+ setEmoji: (emoji: {
410
+ name: string;
411
+ emoji: string;
410
412
  }) => ReturnType;
411
413
  };
412
414
  }
@@ -415,9 +417,14 @@ declare module '@tiptap/core' {
415
417
 
416
418
  declare module '@tiptap/core' {
417
419
  interface Commands<ReturnType> {
418
- tableOfContents: {
419
- setTableOfContents: () => ReturnType;
420
- removeTableOfContents: () => ReturnType;
420
+ search: {
421
+ setSearchTerm: (searchTerm: string) => ReturnType;
422
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
423
+ replace: () => ReturnType;
424
+ replaceAll: () => ReturnType;
425
+ goToPrevSearchResult: () => void;
426
+ goToNextSearchResult: () => void;
427
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
421
428
  };
422
429
  }
423
430
  }
@@ -425,13 +432,14 @@ declare module '@tiptap/core' {
425
432
 
426
433
  declare module '@tiptap/core' {
427
434
  interface Commands<ReturnType> {
428
- columns: {
429
- insertColumns: (attrs?: {
430
- cols: number;
435
+ iframe: {
436
+ /**
437
+ * Add an iframe
438
+ */
439
+ setIframe: (options: {
440
+ src: string;
441
+ service: string;
431
442
  }) => ReturnType;
432
- addColBefore: () => ReturnType;
433
- addColAfter: () => ReturnType;
434
- deleteCol: () => ReturnType;
435
443
  };
436
444
  }
437
445
  }
@@ -439,8 +447,9 @@ declare module '@tiptap/core' {
439
447
 
440
448
  declare module '@tiptap/core' {
441
449
  interface Commands<ReturnType> {
442
- katex: {
443
- setKatex: (arg?: IKatexAttrs) => ReturnType;
450
+ tableCellBackground: {
451
+ setTableCellBackground: (color: string) => ReturnType;
452
+ unsetTableCellBackground: () => ReturnType;
444
453
  };
445
454
  }
446
455
  }
@@ -448,8 +457,8 @@ declare module '@tiptap/core' {
448
457
 
449
458
  declare module '@tiptap/core' {
450
459
  interface Commands<ReturnType> {
451
- exportWord: {
452
- exportToWord: () => ReturnType;
460
+ attachment: {
461
+ setAttachment: (attrs?: unknown) => ReturnType;
453
462
  };
454
463
  }
455
464
  }
@@ -475,21 +484,6 @@ declare module '@tiptap/core' {
475
484
  }
476
485
 
477
486
 
478
- declare module '@tiptap/core' {
479
- interface Commands<ReturnType> {
480
- twitter: {
481
- /**
482
- * Insert a tweet
483
- * @param options The tweet attributes
484
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
485
- */
486
- setTweet: (options: SetTweetOptions) => ReturnType;
487
- updateTweet: (options: SetTweetOptions) => ReturnType;
488
- };
489
- }
490
- }
491
-
492
-
493
487
  declare module '@tiptap/core' {
494
488
  interface Commands<ReturnType> {
495
489
  mermaid: {
@@ -502,8 +496,14 @@ declare module '@tiptap/core' {
502
496
 
503
497
  declare module '@tiptap/core' {
504
498
  interface Commands<ReturnType> {
505
- attachment: {
506
- setAttachment: (attrs?: unknown) => ReturnType;
499
+ twitter: {
500
+ /**
501
+ * Insert a tweet
502
+ * @param options The tweet attributes
503
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
504
+ */
505
+ setTweet: (options: SetTweetOptions) => ReturnType;
506
+ updateTweet: (options: SetTweetOptions) => ReturnType;
507
507
  };
508
508
  }
509
509
  }
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ var me = (e, t, n) => ur(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as ie from "react";
5
5
  import { useRef as ne, useState as I, useEffect as R, useMemo as F, Fragment as Ve, useCallback as O, memo as fr, forwardRef as hr, useId as mr, useImperativeHandle as gr, useLayoutEffect as pr } from "react";
6
6
  import { jsx as a, jsxs as p, Fragment as N } from "react/jsx-runtime";
7
- import { i as Ke, S as re, t as vr, a as Ce, b as oe, r as J, c as Z, f as yr, d as ae, e as wr, D as Xe, g as qe, A as C, h as Ye, j as Je, C as xr, k as Ze, B as Y, s as cn, l as dn, m as un, u as Te, n as vt, o as L, p as U, P as br, q as Cr, v as Tr, L as $e, I as ye, w as se, x as Ae, y as Ar, K as ge, T as fn, M as yt, z as wt, F as Sr, E as hn, G as mn, H as Pr, J as he, N as _r, O as Nr, Q as Er, R as gn, U as $r, V as Or, W as z, X as Rr, Y as Ir, Z as Dr, _ as Br, $ as Mr, a0 as kr, a1 as W, a2 as Lr, a3 as xt, a4 as bt, a5 as Ct, a6 as Tt, a7 as At, a8 as St, a9 as pn, aa as zr, ab as vn, ac as yn, ad as Fr, ae as jr, af as Hr, ag as Pt, ah as Ur, ai as Gr, aj as Wr, ak as Vr, al as Kr, am as _t, an as Nt, ao as Xr, ap as qr, aq as Yr, ar as Jr, as as Zr, at as Qr, au as ei } from "./ColorPicker-DXWTenTy.js";
7
+ import { i as Ke, S as re, t as vr, a as Ce, b as oe, r as J, c as Z, f as yr, d as ae, e as wr, D as Xe, g as qe, A as C, h as Ye, j as Je, C as xr, k as Ze, B as Y, s as cn, l as dn, m as un, u as Te, n as vt, o as L, p as U, P as br, q as Cr, v as Tr, L as $e, I as ye, w as se, x as Ae, y as Ar, K as ge, T as fn, M as yt, z as wt, F as Sr, E as hn, G as mn, H as Pr, J as he, N as _r, O as Nr, Q as Er, R as gn, U as $r, V as Or, W as z, X as Rr, Y as Ir, Z as Dr, _ as Br, $ as Mr, a0 as kr, a1 as W, a2 as Lr, a3 as xt, a4 as bt, a5 as Ct, a6 as Tt, a7 as At, a8 as St, a9 as pn, aa as zr, ab as vn, ac as yn, ad as Fr, ae as jr, af as Hr, ag as Pt, ah as Ur, ai as Gr, aj as Wr, ak as Vr, al as Kr, am as _t, an as Nt, ao as Xr, ap as qr, aq as Yr, ar as Jr, as as Zr, at as Qr, au as ei } from "./ColorPicker-B3iXkFey.js";
8
8
  import { u as D, B as ti, l as B, I as we, V as Et, E as ni } from "./locale-bundle-CT7qZRHF.js";
9
9
  import * as j from "@radix-ui/react-toast";
10
10
  import { X as ri, HelpCircle as ii, Pencil as oi, Trash2 as ai } from "lucide-react";
@@ -920,15 +920,29 @@ declare module '@tiptap/core' {
920
920
 
921
921
  declare module '@tiptap/core' {
922
922
  interface Commands<ReturnType> {
923
- indent: {
923
+ lineHeight: {
924
+ setLineHeight: (lineHeight: string) => ReturnType;
925
+ unsetLineHeight: () => ReturnType;
926
+ };
927
+ }
928
+ }
929
+
930
+
931
+ declare module '@tiptap/core' {
932
+ interface Commands<ReturnType> {
933
+ imageUpload: {
924
934
  /**
925
- * Set the indent attribute
935
+ * Add an image
926
936
  */
927
- indent: () => ReturnType;
937
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
928
938
  /**
929
- * Set the outdent attribute
939
+ * Update an image
930
940
  */
931
- outdent: () => ReturnType;
941
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
942
+ /**
943
+ * Set image alignment
944
+ */
945
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
932
946
  };
933
947
  }
934
948
  }
@@ -936,9 +950,9 @@ declare module '@tiptap/core' {
936
950
 
937
951
  declare module '@tiptap/core' {
938
952
  interface Commands<ReturnType> {
939
- lineHeight: {
940
- setLineHeight: (lineHeight: string) => ReturnType;
941
- unsetLineHeight: () => ReturnType;
953
+ tableOfContents: {
954
+ setTableOfContents: () => ReturnType;
955
+ removeTableOfContents: () => ReturnType;
942
956
  };
943
957
  }
944
958
  }
@@ -946,9 +960,15 @@ declare module '@tiptap/core' {
946
960
 
947
961
  declare module '@tiptap/core' {
948
962
  interface Commands<ReturnType> {
949
- tableCellBackground: {
950
- setTableCellBackground: (color: string) => ReturnType;
951
- unsetTableCellBackground: () => ReturnType;
963
+ indent: {
964
+ /**
965
+ * Set the indent attribute
966
+ */
967
+ indent: () => ReturnType;
968
+ /**
969
+ * Set the outdent attribute
970
+ */
971
+ outdent: () => ReturnType;
952
972
  };
953
973
  }
954
974
  }
@@ -956,14 +976,8 @@ declare module '@tiptap/core' {
956
976
 
957
977
  declare module '@tiptap/core' {
958
978
  interface Commands<ReturnType> {
959
- search: {
960
- setSearchTerm: (searchTerm: string) => ReturnType;
961
- setReplaceTerm: (replaceTerm: string) => ReturnType;
962
- replace: () => ReturnType;
963
- replaceAll: () => ReturnType;
964
- goToPrevSearchResult: () => void;
965
- goToNextSearchResult: () => void;
966
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
979
+ exportWord: {
980
+ exportToWord: () => ReturnType;
967
981
  };
968
982
  }
969
983
  }
@@ -971,8 +985,13 @@ declare module '@tiptap/core' {
971
985
 
972
986
  declare module '@tiptap/core' {
973
987
  interface Commands<ReturnType> {
974
- painter: {
975
- setPainter: (marks: Mark[]) => ReturnType;
988
+ columns: {
989
+ insertColumns: (attrs?: {
990
+ cols: number;
991
+ }) => ReturnType;
992
+ addColBefore: () => ReturnType;
993
+ addColAfter: () => ReturnType;
994
+ deleteCol: () => ReturnType;
976
995
  };
977
996
  }
978
997
  }
@@ -980,19 +999,8 @@ declare module '@tiptap/core' {
980
999
 
981
1000
  declare module '@tiptap/core' {
982
1001
  interface Commands<ReturnType> {
983
- imageUpload: {
984
- /**
985
- * Add an image
986
- */
987
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
988
- /**
989
- * Update an image
990
- */
991
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
992
- /**
993
- * Set image alignment
994
- */
995
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
1002
+ katex: {
1003
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
996
1004
  };
997
1005
  }
998
1006
  }
@@ -1000,11 +1008,8 @@ declare module '@tiptap/core' {
1000
1008
 
1001
1009
  declare module '@tiptap/core' {
1002
1010
  interface Commands<ReturnType> {
1003
- emoji: {
1004
- setEmoji: (emoji: {
1005
- name: string;
1006
- emoji: string;
1007
- }) => ReturnType;
1011
+ painter: {
1012
+ setPainter: (marks: Mark[]) => ReturnType;
1008
1013
  };
1009
1014
  }
1010
1015
  }
@@ -1012,13 +1017,10 @@ declare module '@tiptap/core' {
1012
1017
 
1013
1018
  declare module '@tiptap/core' {
1014
1019
  interface Commands<ReturnType> {
1015
- iframe: {
1016
- /**
1017
- * Add an iframe
1018
- */
1019
- setIframe: (options: {
1020
- src: string;
1021
- service: string;
1020
+ emoji: {
1021
+ setEmoji: (emoji: {
1022
+ name: string;
1023
+ emoji: string;
1022
1024
  }) => ReturnType;
1023
1025
  };
1024
1026
  }
@@ -1027,9 +1029,14 @@ declare module '@tiptap/core' {
1027
1029
 
1028
1030
  declare module '@tiptap/core' {
1029
1031
  interface Commands<ReturnType> {
1030
- tableOfContents: {
1031
- setTableOfContents: () => ReturnType;
1032
- removeTableOfContents: () => ReturnType;
1032
+ search: {
1033
+ setSearchTerm: (searchTerm: string) => ReturnType;
1034
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
1035
+ replace: () => ReturnType;
1036
+ replaceAll: () => ReturnType;
1037
+ goToPrevSearchResult: () => void;
1038
+ goToNextSearchResult: () => void;
1039
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
1033
1040
  };
1034
1041
  }
1035
1042
  }
@@ -1037,13 +1044,14 @@ declare module '@tiptap/core' {
1037
1044
 
1038
1045
  declare module '@tiptap/core' {
1039
1046
  interface Commands<ReturnType> {
1040
- columns: {
1041
- insertColumns: (attrs?: {
1042
- cols: number;
1047
+ iframe: {
1048
+ /**
1049
+ * Add an iframe
1050
+ */
1051
+ setIframe: (options: {
1052
+ src: string;
1053
+ service: string;
1043
1054
  }) => ReturnType;
1044
- addColBefore: () => ReturnType;
1045
- addColAfter: () => ReturnType;
1046
- deleteCol: () => ReturnType;
1047
1055
  };
1048
1056
  }
1049
1057
  }
@@ -1051,8 +1059,9 @@ declare module '@tiptap/core' {
1051
1059
 
1052
1060
  declare module '@tiptap/core' {
1053
1061
  interface Commands<ReturnType> {
1054
- katex: {
1055
- setKatex: (arg?: IKatexAttrs) => ReturnType;
1062
+ tableCellBackground: {
1063
+ setTableCellBackground: (color: string) => ReturnType;
1064
+ unsetTableCellBackground: () => ReturnType;
1056
1065
  };
1057
1066
  }
1058
1067
  }
@@ -1060,8 +1069,8 @@ declare module '@tiptap/core' {
1060
1069
 
1061
1070
  declare module '@tiptap/core' {
1062
1071
  interface Commands<ReturnType> {
1063
- exportWord: {
1064
- exportToWord: () => ReturnType;
1072
+ attachment: {
1073
+ setAttachment: (attrs?: unknown) => ReturnType;
1065
1074
  };
1066
1075
  }
1067
1076
  }
@@ -1087,21 +1096,6 @@ declare module '@tiptap/core' {
1087
1096
  }
1088
1097
 
1089
1098
 
1090
- declare module '@tiptap/core' {
1091
- interface Commands<ReturnType> {
1092
- twitter: {
1093
- /**
1094
- * Insert a tweet
1095
- * @param options The tweet attributes
1096
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1097
- */
1098
- setTweet: (options: SetTweetOptions) => ReturnType;
1099
- updateTweet: (options: SetTweetOptions) => ReturnType;
1100
- };
1101
- }
1102
- }
1103
-
1104
-
1105
1099
  declare module '@tiptap/core' {
1106
1100
  interface Commands<ReturnType> {
1107
1101
  mermaid: {
@@ -1114,8 +1108,14 @@ declare module '@tiptap/core' {
1114
1108
 
1115
1109
  declare module '@tiptap/core' {
1116
1110
  interface Commands<ReturnType> {
1117
- attachment: {
1118
- setAttachment: (attrs?: unknown) => ReturnType;
1111
+ twitter: {
1112
+ /**
1113
+ * Insert a tweet
1114
+ * @param options The tweet attributes
1115
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1116
+ */
1117
+ setTweet: (options: SetTweetOptions) => ReturnType;
1118
+ updateTweet: (options: SetTweetOptions) => ReturnType;
1119
1119
  };
1120
1120
  }
1121
1121
  }