reactjs-tiptap-editor-pro 0.2.38 → 0.2.39

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.
@@ -725,15 +725,24 @@ declare module '@tiptap/core' {
725
725
 
726
726
  declare module '@tiptap/core' {
727
727
  interface Commands<ReturnType> {
728
- indent: {
729
- /**
730
- * Set the indent attribute
731
- */
732
- indent: () => ReturnType;
728
+ tableCellBackground: {
729
+ setTableCellBackground: (color: string) => ReturnType;
730
+ unsetTableCellBackground: () => ReturnType;
731
+ };
732
+ }
733
+ }
734
+
735
+
736
+ declare module '@tiptap/core' {
737
+ interface Commands<ReturnType> {
738
+ iframe: {
733
739
  /**
734
- * Set the outdent attribute
740
+ * Add an iframe
735
741
  */
736
- outdent: () => ReturnType;
742
+ setIframe: (options: {
743
+ src: string;
744
+ service: string;
745
+ }) => ReturnType;
737
746
  };
738
747
  }
739
748
  }
@@ -741,13 +750,23 @@ declare module '@tiptap/core' {
741
750
 
742
751
  declare module '@tiptap/core' {
743
752
  interface Commands<ReturnType> {
744
- columns: {
745
- insertColumns: (attrs?: {
746
- cols: number;
747
- }) => ReturnType;
748
- addColBefore: () => ReturnType;
749
- addColAfter: () => ReturnType;
750
- deleteCol: () => ReturnType;
753
+ painter: {
754
+ setPainter: (marks: Mark[]) => ReturnType;
755
+ };
756
+ }
757
+ }
758
+
759
+
760
+ declare module '@tiptap/core' {
761
+ interface Commands<ReturnType> {
762
+ search: {
763
+ setSearchTerm: (searchTerm: string) => ReturnType;
764
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
765
+ replace: () => ReturnType;
766
+ replaceAll: () => ReturnType;
767
+ goToPrevSearchResult: () => void;
768
+ goToNextSearchResult: () => void;
769
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
751
770
  };
752
771
  }
753
772
  }
@@ -765,8 +784,11 @@ declare module '@tiptap/core' {
765
784
 
766
785
  declare module '@tiptap/core' {
767
786
  interface Commands<ReturnType> {
768
- painter: {
769
- setPainter: (marks: Mark[]) => ReturnType;
787
+ emoji: {
788
+ setEmoji: (emoji: {
789
+ name: string;
790
+ emoji: string;
791
+ }) => ReturnType;
770
792
  };
771
793
  }
772
794
  }
@@ -774,14 +796,8 @@ declare module '@tiptap/core' {
774
796
 
775
797
  declare module '@tiptap/core' {
776
798
  interface Commands<ReturnType> {
777
- search: {
778
- setSearchTerm: (searchTerm: string) => ReturnType;
779
- setReplaceTerm: (replaceTerm: string) => ReturnType;
780
- replace: () => ReturnType;
781
- replaceAll: () => ReturnType;
782
- goToPrevSearchResult: () => void;
783
- goToNextSearchResult: () => void;
784
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
799
+ katex: {
800
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
785
801
  };
786
802
  }
787
803
  }
@@ -809,14 +825,13 @@ declare module '@tiptap/core' {
809
825
 
810
826
  declare module '@tiptap/core' {
811
827
  interface Commands<ReturnType> {
812
- iframe: {
813
- /**
814
- * Add an iframe
815
- */
816
- setIframe: (options: {
817
- src: string;
818
- service: string;
828
+ columns: {
829
+ insertColumns: (attrs?: {
830
+ cols: number;
819
831
  }) => ReturnType;
832
+ addColBefore: () => ReturnType;
833
+ addColAfter: () => ReturnType;
834
+ deleteCol: () => ReturnType;
820
835
  };
821
836
  }
822
837
  }
@@ -824,11 +839,15 @@ declare module '@tiptap/core' {
824
839
 
825
840
  declare module '@tiptap/core' {
826
841
  interface Commands<ReturnType> {
827
- emoji: {
828
- setEmoji: (emoji: {
829
- name: string;
830
- emoji: string;
831
- }) => ReturnType;
842
+ indent: {
843
+ /**
844
+ * Set the indent attribute
845
+ */
846
+ indent: () => ReturnType;
847
+ /**
848
+ * Set the outdent attribute
849
+ */
850
+ outdent: () => ReturnType;
832
851
  };
833
852
  }
834
853
  }
@@ -836,9 +855,19 @@ declare module '@tiptap/core' {
836
855
 
837
856
  declare module '@tiptap/core' {
838
857
  interface Commands<ReturnType> {
839
- tableCellBackground: {
840
- setTableCellBackground: (color: string) => ReturnType;
841
- unsetTableCellBackground: () => ReturnType;
858
+ imageGifUpload: {
859
+ /**
860
+ * Add an image gif
861
+ */
862
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
863
+ /**
864
+ * Update an image gif
865
+ */
866
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
867
+ /**
868
+ * Set image alignment
869
+ */
870
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
842
871
  };
843
872
  }
844
873
  }
@@ -846,8 +875,9 @@ declare module '@tiptap/core' {
846
875
 
847
876
  declare module '@tiptap/core' {
848
877
  interface Commands<ReturnType> {
849
- katex: {
850
- setKatex: (arg?: IKatexAttrs) => ReturnType;
878
+ drawer: {
879
+ setDrawer: (options: any, replace?: any) => ReturnType;
880
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
851
881
  };
852
882
  }
853
883
  }
@@ -863,15 +893,6 @@ declare module '@tiptap/core' {
863
893
  }
864
894
 
865
895
 
866
- declare module '@tiptap/core' {
867
- interface Commands<ReturnType> {
868
- exportWord: {
869
- exportToWord: () => ReturnType;
870
- };
871
- }
872
- }
873
-
874
-
875
896
  declare module '@tiptap/core' {
876
897
  interface Commands<ReturnType> {
877
898
  attachment: {
@@ -908,29 +929,8 @@ declare module '@tiptap/core' {
908
929
 
909
930
  declare module '@tiptap/core' {
910
931
  interface Commands<ReturnType> {
911
- drawer: {
912
- setDrawer: (options: any, replace?: any) => ReturnType;
913
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
914
- };
915
- }
916
- }
917
-
918
-
919
- declare module '@tiptap/core' {
920
- interface Commands<ReturnType> {
921
- imageGifUpload: {
922
- /**
923
- * Add an image gif
924
- */
925
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
926
- /**
927
- * Update an image gif
928
- */
929
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
930
- /**
931
- * Set image alignment
932
- */
933
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
932
+ exportWord: {
933
+ exportToWord: () => ReturnType;
934
934
  };
935
935
  }
936
936
  }
@@ -725,15 +725,24 @@ declare module '@tiptap/core' {
725
725
 
726
726
  declare module '@tiptap/core' {
727
727
  interface Commands<ReturnType> {
728
- indent: {
729
- /**
730
- * Set the indent attribute
731
- */
732
- indent: () => ReturnType;
728
+ tableCellBackground: {
729
+ setTableCellBackground: (color: string) => ReturnType;
730
+ unsetTableCellBackground: () => ReturnType;
731
+ };
732
+ }
733
+ }
734
+
735
+
736
+ declare module '@tiptap/core' {
737
+ interface Commands<ReturnType> {
738
+ iframe: {
733
739
  /**
734
- * Set the outdent attribute
740
+ * Add an iframe
735
741
  */
736
- outdent: () => ReturnType;
742
+ setIframe: (options: {
743
+ src: string;
744
+ service: string;
745
+ }) => ReturnType;
737
746
  };
738
747
  }
739
748
  }
@@ -741,13 +750,23 @@ declare module '@tiptap/core' {
741
750
 
742
751
  declare module '@tiptap/core' {
743
752
  interface Commands<ReturnType> {
744
- columns: {
745
- insertColumns: (attrs?: {
746
- cols: number;
747
- }) => ReturnType;
748
- addColBefore: () => ReturnType;
749
- addColAfter: () => ReturnType;
750
- deleteCol: () => ReturnType;
753
+ painter: {
754
+ setPainter: (marks: Mark[]) => ReturnType;
755
+ };
756
+ }
757
+ }
758
+
759
+
760
+ declare module '@tiptap/core' {
761
+ interface Commands<ReturnType> {
762
+ search: {
763
+ setSearchTerm: (searchTerm: string) => ReturnType;
764
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
765
+ replace: () => ReturnType;
766
+ replaceAll: () => ReturnType;
767
+ goToPrevSearchResult: () => void;
768
+ goToNextSearchResult: () => void;
769
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
751
770
  };
752
771
  }
753
772
  }
@@ -765,8 +784,11 @@ declare module '@tiptap/core' {
765
784
 
766
785
  declare module '@tiptap/core' {
767
786
  interface Commands<ReturnType> {
768
- painter: {
769
- setPainter: (marks: Mark[]) => ReturnType;
787
+ emoji: {
788
+ setEmoji: (emoji: {
789
+ name: string;
790
+ emoji: string;
791
+ }) => ReturnType;
770
792
  };
771
793
  }
772
794
  }
@@ -774,14 +796,8 @@ declare module '@tiptap/core' {
774
796
 
775
797
  declare module '@tiptap/core' {
776
798
  interface Commands<ReturnType> {
777
- search: {
778
- setSearchTerm: (searchTerm: string) => ReturnType;
779
- setReplaceTerm: (replaceTerm: string) => ReturnType;
780
- replace: () => ReturnType;
781
- replaceAll: () => ReturnType;
782
- goToPrevSearchResult: () => void;
783
- goToNextSearchResult: () => void;
784
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
799
+ katex: {
800
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
785
801
  };
786
802
  }
787
803
  }
@@ -809,14 +825,13 @@ declare module '@tiptap/core' {
809
825
 
810
826
  declare module '@tiptap/core' {
811
827
  interface Commands<ReturnType> {
812
- iframe: {
813
- /**
814
- * Add an iframe
815
- */
816
- setIframe: (options: {
817
- src: string;
818
- service: string;
828
+ columns: {
829
+ insertColumns: (attrs?: {
830
+ cols: number;
819
831
  }) => ReturnType;
832
+ addColBefore: () => ReturnType;
833
+ addColAfter: () => ReturnType;
834
+ deleteCol: () => ReturnType;
820
835
  };
821
836
  }
822
837
  }
@@ -824,11 +839,15 @@ declare module '@tiptap/core' {
824
839
 
825
840
  declare module '@tiptap/core' {
826
841
  interface Commands<ReturnType> {
827
- emoji: {
828
- setEmoji: (emoji: {
829
- name: string;
830
- emoji: string;
831
- }) => ReturnType;
842
+ indent: {
843
+ /**
844
+ * Set the indent attribute
845
+ */
846
+ indent: () => ReturnType;
847
+ /**
848
+ * Set the outdent attribute
849
+ */
850
+ outdent: () => ReturnType;
832
851
  };
833
852
  }
834
853
  }
@@ -836,9 +855,19 @@ declare module '@tiptap/core' {
836
855
 
837
856
  declare module '@tiptap/core' {
838
857
  interface Commands<ReturnType> {
839
- tableCellBackground: {
840
- setTableCellBackground: (color: string) => ReturnType;
841
- unsetTableCellBackground: () => ReturnType;
858
+ imageGifUpload: {
859
+ /**
860
+ * Add an image gif
861
+ */
862
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
863
+ /**
864
+ * Update an image gif
865
+ */
866
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
867
+ /**
868
+ * Set image alignment
869
+ */
870
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
842
871
  };
843
872
  }
844
873
  }
@@ -846,8 +875,9 @@ declare module '@tiptap/core' {
846
875
 
847
876
  declare module '@tiptap/core' {
848
877
  interface Commands<ReturnType> {
849
- katex: {
850
- setKatex: (arg?: IKatexAttrs) => ReturnType;
878
+ drawer: {
879
+ setDrawer: (options: any, replace?: any) => ReturnType;
880
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
851
881
  };
852
882
  }
853
883
  }
@@ -863,15 +893,6 @@ declare module '@tiptap/core' {
863
893
  }
864
894
 
865
895
 
866
- declare module '@tiptap/core' {
867
- interface Commands<ReturnType> {
868
- exportWord: {
869
- exportToWord: () => ReturnType;
870
- };
871
- }
872
- }
873
-
874
-
875
896
  declare module '@tiptap/core' {
876
897
  interface Commands<ReturnType> {
877
898
  attachment: {
@@ -908,29 +929,8 @@ declare module '@tiptap/core' {
908
929
 
909
930
  declare module '@tiptap/core' {
910
931
  interface Commands<ReturnType> {
911
- drawer: {
912
- setDrawer: (options: any, replace?: any) => ReturnType;
913
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
914
- };
915
- }
916
- }
917
-
918
-
919
- declare module '@tiptap/core' {
920
- interface Commands<ReturnType> {
921
- imageGifUpload: {
922
- /**
923
- * Add an image gif
924
- */
925
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
926
- /**
927
- * Update an image gif
928
- */
929
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
930
- /**
931
- * Set image alignment
932
- */
933
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
932
+ exportWord: {
933
+ exportToWord: () => ReturnType;
934
934
  };
935
935
  }
936
936
  }
@@ -5188,14 +5188,15 @@ const hy = Ne.create({
5188
5188
  editor: this.editor,
5189
5189
  char: "/",
5190
5190
  allowSpaces: !0,
5191
- startOfLine: !0,
5191
+ startOfLine: !1,
5192
+ allowedPrefixes: null,
5192
5193
  pluginKey: new Ve(mn),
5193
5194
  allow: ({ state: e, range: t }) => {
5194
- var u, d, f;
5195
- const n = e.doc.resolve(t.from), i = n.depth === 1, r = n.parent.type.name === "paragraph", a = ((u = n.parent.textContent) == null ? void 0 : u.charAt(0)) === "/", o = this.editor.isActive("column"), s = (f = n.parent.textContent) == null ? void 0 : f.slice(
5196
- Math.max(0, (d = n.parent.textContent) == null ? void 0 : d.indexOf("/"))
5197
- ), c = !(s != null && s.endsWith(" "));
5198
- return (i && r && a || o && r && a) && c;
5195
+ var a, o;
5196
+ const n = e.doc.resolve(t.from);
5197
+ return ((o = n.parent.textContent) == null ? void 0 : o.slice(
5198
+ Math.max(0, (a = n.parent.textContent) == null ? void 0 : a.indexOf("/"))
5199
+ )).endsWith("/");
5199
5200
  },
5200
5201
  command: ({ editor: e, range: t, props: n }) => {
5201
5202
  const { view: i } = e;
package/lib/index.d.cts CHANGED
@@ -308,15 +308,24 @@ declare module '@tiptap/core' {
308
308
 
309
309
  declare module '@tiptap/core' {
310
310
  interface Commands<ReturnType> {
311
- indent: {
312
- /**
313
- * Set the indent attribute
314
- */
315
- indent: () => ReturnType;
311
+ tableCellBackground: {
312
+ setTableCellBackground: (color: string) => ReturnType;
313
+ unsetTableCellBackground: () => ReturnType;
314
+ };
315
+ }
316
+ }
317
+
318
+
319
+ declare module '@tiptap/core' {
320
+ interface Commands<ReturnType> {
321
+ iframe: {
316
322
  /**
317
- * Set the outdent attribute
323
+ * Add an iframe
318
324
  */
319
- outdent: () => ReturnType;
325
+ setIframe: (options: {
326
+ src: string;
327
+ service: string;
328
+ }) => ReturnType;
320
329
  };
321
330
  }
322
331
  }
@@ -324,13 +333,23 @@ declare module '@tiptap/core' {
324
333
 
325
334
  declare module '@tiptap/core' {
326
335
  interface Commands<ReturnType> {
327
- columns: {
328
- insertColumns: (attrs?: {
329
- cols: number;
330
- }) => ReturnType;
331
- addColBefore: () => ReturnType;
332
- addColAfter: () => ReturnType;
333
- deleteCol: () => ReturnType;
336
+ painter: {
337
+ setPainter: (marks: Mark[]) => ReturnType;
338
+ };
339
+ }
340
+ }
341
+
342
+
343
+ declare module '@tiptap/core' {
344
+ interface Commands<ReturnType> {
345
+ search: {
346
+ setSearchTerm: (searchTerm: string) => ReturnType;
347
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
348
+ replace: () => ReturnType;
349
+ replaceAll: () => ReturnType;
350
+ goToPrevSearchResult: () => void;
351
+ goToNextSearchResult: () => void;
352
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
334
353
  };
335
354
  }
336
355
  }
@@ -348,8 +367,11 @@ declare module '@tiptap/core' {
348
367
 
349
368
  declare module '@tiptap/core' {
350
369
  interface Commands<ReturnType> {
351
- painter: {
352
- setPainter: (marks: Mark[]) => ReturnType;
370
+ emoji: {
371
+ setEmoji: (emoji: {
372
+ name: string;
373
+ emoji: string;
374
+ }) => ReturnType;
353
375
  };
354
376
  }
355
377
  }
@@ -357,14 +379,8 @@ declare module '@tiptap/core' {
357
379
 
358
380
  declare module '@tiptap/core' {
359
381
  interface Commands<ReturnType> {
360
- search: {
361
- setSearchTerm: (searchTerm: string) => ReturnType;
362
- setReplaceTerm: (replaceTerm: string) => ReturnType;
363
- replace: () => ReturnType;
364
- replaceAll: () => ReturnType;
365
- goToPrevSearchResult: () => void;
366
- goToNextSearchResult: () => void;
367
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
382
+ katex: {
383
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
368
384
  };
369
385
  }
370
386
  }
@@ -392,14 +408,13 @@ declare module '@tiptap/core' {
392
408
 
393
409
  declare module '@tiptap/core' {
394
410
  interface Commands<ReturnType> {
395
- iframe: {
396
- /**
397
- * Add an iframe
398
- */
399
- setIframe: (options: {
400
- src: string;
401
- service: string;
411
+ columns: {
412
+ insertColumns: (attrs?: {
413
+ cols: number;
402
414
  }) => ReturnType;
415
+ addColBefore: () => ReturnType;
416
+ addColAfter: () => ReturnType;
417
+ deleteCol: () => ReturnType;
403
418
  };
404
419
  }
405
420
  }
@@ -407,11 +422,15 @@ declare module '@tiptap/core' {
407
422
 
408
423
  declare module '@tiptap/core' {
409
424
  interface Commands<ReturnType> {
410
- emoji: {
411
- setEmoji: (emoji: {
412
- name: string;
413
- emoji: string;
414
- }) => ReturnType;
425
+ indent: {
426
+ /**
427
+ * Set the indent attribute
428
+ */
429
+ indent: () => ReturnType;
430
+ /**
431
+ * Set the outdent attribute
432
+ */
433
+ outdent: () => ReturnType;
415
434
  };
416
435
  }
417
436
  }
@@ -419,9 +438,19 @@ declare module '@tiptap/core' {
419
438
 
420
439
  declare module '@tiptap/core' {
421
440
  interface Commands<ReturnType> {
422
- tableCellBackground: {
423
- setTableCellBackground: (color: string) => ReturnType;
424
- unsetTableCellBackground: () => ReturnType;
441
+ imageGifUpload: {
442
+ /**
443
+ * Add an image gif
444
+ */
445
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
446
+ /**
447
+ * Update an image gif
448
+ */
449
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
450
+ /**
451
+ * Set image alignment
452
+ */
453
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
425
454
  };
426
455
  }
427
456
  }
@@ -429,8 +458,9 @@ declare module '@tiptap/core' {
429
458
 
430
459
  declare module '@tiptap/core' {
431
460
  interface Commands<ReturnType> {
432
- katex: {
433
- setKatex: (arg?: IKatexAttrs) => ReturnType;
461
+ drawer: {
462
+ setDrawer: (options: any, replace?: any) => ReturnType;
463
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
434
464
  };
435
465
  }
436
466
  }
@@ -446,15 +476,6 @@ declare module '@tiptap/core' {
446
476
  }
447
477
 
448
478
 
449
- declare module '@tiptap/core' {
450
- interface Commands<ReturnType> {
451
- exportWord: {
452
- exportToWord: () => ReturnType;
453
- };
454
- }
455
- }
456
-
457
-
458
479
  declare module '@tiptap/core' {
459
480
  interface Commands<ReturnType> {
460
481
  attachment: {
@@ -491,29 +512,8 @@ declare module '@tiptap/core' {
491
512
 
492
513
  declare module '@tiptap/core' {
493
514
  interface Commands<ReturnType> {
494
- drawer: {
495
- setDrawer: (options: any, replace?: any) => ReturnType;
496
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
497
- };
498
- }
499
- }
500
-
501
-
502
- declare module '@tiptap/core' {
503
- interface Commands<ReturnType> {
504
- imageGifUpload: {
505
- /**
506
- * Add an image gif
507
- */
508
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
509
- /**
510
- * Update an image gif
511
- */
512
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
513
- /**
514
- * Set image alignment
515
- */
516
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
515
+ exportWord: {
516
+ exportToWord: () => ReturnType;
517
517
  };
518
518
  }
519
519
  }