reactjs-tiptap-editor 0.2.4 → 0.2.6

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.
@@ -259,6 +259,13 @@ export declare const Column: Node_2<any, any>;
259
259
 
260
260
  export declare const ColumnActionButton: Extension<any, any>;
261
261
 
262
+ export declare const Drawer: Node_2<DrawerOptions, any>;
263
+
264
+ declare interface DrawerOptions extends GeneralOptions<DrawerOptions> {
265
+ /** Function for uploading files */
266
+ upload?: (file: File) => Promise<string>;
267
+ }
268
+
262
269
  export declare const Emoji: Node_2<any, any>;
263
270
 
264
271
  export declare const Excalidraw: Node_2<any, any>;
@@ -690,6 +697,26 @@ declare module '@tiptap/core' {
690
697
  }
691
698
 
692
699
 
700
+ declare module '@tiptap/core' {
701
+ interface Commands<ReturnType> {
702
+ imageUpload: {
703
+ /**
704
+ * Add an image
705
+ */
706
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
707
+ /**
708
+ * Update an image
709
+ */
710
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
711
+ /**
712
+ * Set image alignment
713
+ */
714
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
715
+ };
716
+ }
717
+ }
718
+
719
+
693
720
  declare module '@tiptap/core' {
694
721
  interface Commands<ReturnType> {
695
722
  lineHeight: {
@@ -718,19 +745,8 @@ declare module '@tiptap/core' {
718
745
 
719
746
  declare module '@tiptap/core' {
720
747
  interface Commands<ReturnType> {
721
- imageUpload: {
722
- /**
723
- * Add an image
724
- */
725
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
726
- /**
727
- * Update an image
728
- */
729
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
730
- /**
731
- * Set image alignment
732
- */
733
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
748
+ katex: {
749
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
734
750
  };
735
751
  }
736
752
  }
@@ -738,8 +754,11 @@ declare module '@tiptap/core' {
738
754
 
739
755
  declare module '@tiptap/core' {
740
756
  interface Commands<ReturnType> {
741
- painter: {
742
- setPainter: (marks: Mark[]) => ReturnType;
757
+ emoji: {
758
+ setEmoji: (emoji: {
759
+ name: string;
760
+ emoji: string;
761
+ }) => ReturnType;
743
762
  };
744
763
  }
745
764
  }
@@ -747,9 +766,14 @@ declare module '@tiptap/core' {
747
766
 
748
767
  declare module '@tiptap/core' {
749
768
  interface Commands<ReturnType> {
750
- tableCellBackground: {
751
- setTableCellBackground: (color: string) => ReturnType;
752
- unsetTableCellBackground: () => ReturnType;
769
+ search: {
770
+ setSearchTerm: (searchTerm: string) => ReturnType;
771
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
772
+ replace: () => ReturnType;
773
+ replaceAll: () => ReturnType;
774
+ goToPrevSearchResult: () => void;
775
+ goToNextSearchResult: () => void;
776
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
753
777
  };
754
778
  }
755
779
  }
@@ -757,13 +781,8 @@ declare module '@tiptap/core' {
757
781
 
758
782
  declare module '@tiptap/core' {
759
783
  interface Commands<ReturnType> {
760
- columns: {
761
- insertColumns: (attrs?: {
762
- cols: number;
763
- }) => ReturnType;
764
- addColBefore: () => ReturnType;
765
- addColAfter: () => ReturnType;
766
- deleteCol: () => ReturnType;
784
+ painter: {
785
+ setPainter: (marks: Mark[]) => ReturnType;
767
786
  };
768
787
  }
769
788
  }
@@ -786,20 +805,9 @@ declare module '@tiptap/core' {
786
805
 
787
806
  declare module '@tiptap/core' {
788
807
  interface Commands<ReturnType> {
789
- emoji: {
790
- setEmoji: (emoji: {
791
- name: string;
792
- emoji: string;
793
- }) => ReturnType;
794
- };
795
- }
796
- }
797
-
798
-
799
- declare module '@tiptap/core' {
800
- interface Commands<ReturnType> {
801
- katex: {
802
- setKatex: (arg?: IKatexAttrs) => ReturnType;
808
+ tableCellBackground: {
809
+ setTableCellBackground: (color: string) => ReturnType;
810
+ unsetTableCellBackground: () => ReturnType;
803
811
  };
804
812
  }
805
813
  }
@@ -807,14 +815,13 @@ declare module '@tiptap/core' {
807
815
 
808
816
  declare module '@tiptap/core' {
809
817
  interface Commands<ReturnType> {
810
- search: {
811
- setSearchTerm: (searchTerm: string) => ReturnType;
812
- setReplaceTerm: (replaceTerm: string) => ReturnType;
813
- replace: () => ReturnType;
814
- replaceAll: () => ReturnType;
815
- goToPrevSearchResult: () => void;
816
- goToNextSearchResult: () => void;
817
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
818
+ columns: {
819
+ insertColumns: (attrs?: {
820
+ cols: number;
821
+ }) => ReturnType;
822
+ addColBefore: () => ReturnType;
823
+ addColAfter: () => ReturnType;
824
+ deleteCol: () => ReturnType;
818
825
  };
819
826
  }
820
827
  }
@@ -850,19 +857,24 @@ declare module '@tiptap/core' {
850
857
 
851
858
  declare module '@tiptap/core' {
852
859
  interface Commands<ReturnType> {
853
- imageGifUpload: {
854
- /**
855
- * Add an image gif
856
- */
857
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
858
- /**
859
- * Update an image gif
860
- */
861
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
860
+ mermaid: {
861
+ setMermaid: (options: any, replace?: any) => ReturnType;
862
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
863
+ };
864
+ }
865
+ }
866
+
867
+
868
+ declare module '@tiptap/core' {
869
+ interface Commands<ReturnType> {
870
+ twitter: {
862
871
  /**
863
- * Set image alignment
872
+ * Insert a tweet
873
+ * @param options The tweet attributes
874
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
864
875
  */
865
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
876
+ setTweet: (options: SetTweetOptions) => ReturnType;
877
+ updateTweet: (options: SetTweetOptions) => ReturnType;
866
878
  };
867
879
  }
868
880
  }
@@ -870,8 +882,9 @@ declare module '@tiptap/core' {
870
882
 
871
883
  declare module '@tiptap/core' {
872
884
  interface Commands<ReturnType> {
873
- attachment: {
874
- setAttachment: (attrs?: unknown) => ReturnType;
885
+ drawer: {
886
+ setDrawer: (options: any, replace?: any) => ReturnType;
887
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
875
888
  };
876
889
  }
877
890
  }
@@ -879,9 +892,8 @@ declare module '@tiptap/core' {
879
892
 
880
893
  declare module '@tiptap/core' {
881
894
  interface Commands<ReturnType> {
882
- mermaid: {
883
- setMermaid: (options: any, replace?: any) => ReturnType;
884
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
895
+ attachment: {
896
+ setAttachment: (attrs?: unknown) => ReturnType;
885
897
  };
886
898
  }
887
899
  }
@@ -889,14 +901,19 @@ declare module '@tiptap/core' {
889
901
 
890
902
  declare module '@tiptap/core' {
891
903
  interface Commands<ReturnType> {
892
- twitter: {
904
+ imageGifUpload: {
893
905
  /**
894
- * Insert a tweet
895
- * @param options The tweet attributes
896
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
906
+ * Add an image gif
897
907
  */
898
- setTweet: (options: SetTweetOptions) => ReturnType;
899
- updateTweet: (options: SetTweetOptions) => ReturnType;
908
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
909
+ /**
910
+ * Update an image gif
911
+ */
912
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
913
+ /**
914
+ * Set image alignment
915
+ */
916
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
900
917
  };
901
918
  }
902
919
  }
@@ -259,6 +259,13 @@ export declare const Column: Node_2<any, any>;
259
259
 
260
260
  export declare const ColumnActionButton: Extension<any, any>;
261
261
 
262
+ export declare const Drawer: Node_2<DrawerOptions, any>;
263
+
264
+ declare interface DrawerOptions extends GeneralOptions<DrawerOptions> {
265
+ /** Function for uploading files */
266
+ upload?: (file: File) => Promise<string>;
267
+ }
268
+
262
269
  export declare const Emoji: Node_2<any, any>;
263
270
 
264
271
  export declare const Excalidraw: Node_2<any, any>;
@@ -690,6 +697,26 @@ declare module '@tiptap/core' {
690
697
  }
691
698
 
692
699
 
700
+ declare module '@tiptap/core' {
701
+ interface Commands<ReturnType> {
702
+ imageUpload: {
703
+ /**
704
+ * Add an image
705
+ */
706
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
707
+ /**
708
+ * Update an image
709
+ */
710
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
711
+ /**
712
+ * Set image alignment
713
+ */
714
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
715
+ };
716
+ }
717
+ }
718
+
719
+
693
720
  declare module '@tiptap/core' {
694
721
  interface Commands<ReturnType> {
695
722
  lineHeight: {
@@ -718,19 +745,8 @@ declare module '@tiptap/core' {
718
745
 
719
746
  declare module '@tiptap/core' {
720
747
  interface Commands<ReturnType> {
721
- imageUpload: {
722
- /**
723
- * Add an image
724
- */
725
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
726
- /**
727
- * Update an image
728
- */
729
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
730
- /**
731
- * Set image alignment
732
- */
733
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
748
+ katex: {
749
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
734
750
  };
735
751
  }
736
752
  }
@@ -738,8 +754,11 @@ declare module '@tiptap/core' {
738
754
 
739
755
  declare module '@tiptap/core' {
740
756
  interface Commands<ReturnType> {
741
- painter: {
742
- setPainter: (marks: Mark[]) => ReturnType;
757
+ emoji: {
758
+ setEmoji: (emoji: {
759
+ name: string;
760
+ emoji: string;
761
+ }) => ReturnType;
743
762
  };
744
763
  }
745
764
  }
@@ -747,9 +766,14 @@ declare module '@tiptap/core' {
747
766
 
748
767
  declare module '@tiptap/core' {
749
768
  interface Commands<ReturnType> {
750
- tableCellBackground: {
751
- setTableCellBackground: (color: string) => ReturnType;
752
- unsetTableCellBackground: () => ReturnType;
769
+ search: {
770
+ setSearchTerm: (searchTerm: string) => ReturnType;
771
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
772
+ replace: () => ReturnType;
773
+ replaceAll: () => ReturnType;
774
+ goToPrevSearchResult: () => void;
775
+ goToNextSearchResult: () => void;
776
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
753
777
  };
754
778
  }
755
779
  }
@@ -757,13 +781,8 @@ declare module '@tiptap/core' {
757
781
 
758
782
  declare module '@tiptap/core' {
759
783
  interface Commands<ReturnType> {
760
- columns: {
761
- insertColumns: (attrs?: {
762
- cols: number;
763
- }) => ReturnType;
764
- addColBefore: () => ReturnType;
765
- addColAfter: () => ReturnType;
766
- deleteCol: () => ReturnType;
784
+ painter: {
785
+ setPainter: (marks: Mark[]) => ReturnType;
767
786
  };
768
787
  }
769
788
  }
@@ -786,20 +805,9 @@ declare module '@tiptap/core' {
786
805
 
787
806
  declare module '@tiptap/core' {
788
807
  interface Commands<ReturnType> {
789
- emoji: {
790
- setEmoji: (emoji: {
791
- name: string;
792
- emoji: string;
793
- }) => ReturnType;
794
- };
795
- }
796
- }
797
-
798
-
799
- declare module '@tiptap/core' {
800
- interface Commands<ReturnType> {
801
- katex: {
802
- setKatex: (arg?: IKatexAttrs) => ReturnType;
808
+ tableCellBackground: {
809
+ setTableCellBackground: (color: string) => ReturnType;
810
+ unsetTableCellBackground: () => ReturnType;
803
811
  };
804
812
  }
805
813
  }
@@ -807,14 +815,13 @@ declare module '@tiptap/core' {
807
815
 
808
816
  declare module '@tiptap/core' {
809
817
  interface Commands<ReturnType> {
810
- search: {
811
- setSearchTerm: (searchTerm: string) => ReturnType;
812
- setReplaceTerm: (replaceTerm: string) => ReturnType;
813
- replace: () => ReturnType;
814
- replaceAll: () => ReturnType;
815
- goToPrevSearchResult: () => void;
816
- goToNextSearchResult: () => void;
817
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
818
+ columns: {
819
+ insertColumns: (attrs?: {
820
+ cols: number;
821
+ }) => ReturnType;
822
+ addColBefore: () => ReturnType;
823
+ addColAfter: () => ReturnType;
824
+ deleteCol: () => ReturnType;
818
825
  };
819
826
  }
820
827
  }
@@ -850,19 +857,24 @@ declare module '@tiptap/core' {
850
857
 
851
858
  declare module '@tiptap/core' {
852
859
  interface Commands<ReturnType> {
853
- imageGifUpload: {
854
- /**
855
- * Add an image gif
856
- */
857
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
858
- /**
859
- * Update an image gif
860
- */
861
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
860
+ mermaid: {
861
+ setMermaid: (options: any, replace?: any) => ReturnType;
862
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
863
+ };
864
+ }
865
+ }
866
+
867
+
868
+ declare module '@tiptap/core' {
869
+ interface Commands<ReturnType> {
870
+ twitter: {
862
871
  /**
863
- * Set image alignment
872
+ * Insert a tweet
873
+ * @param options The tweet attributes
874
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
864
875
  */
865
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
876
+ setTweet: (options: SetTweetOptions) => ReturnType;
877
+ updateTweet: (options: SetTweetOptions) => ReturnType;
866
878
  };
867
879
  }
868
880
  }
@@ -870,8 +882,9 @@ declare module '@tiptap/core' {
870
882
 
871
883
  declare module '@tiptap/core' {
872
884
  interface Commands<ReturnType> {
873
- attachment: {
874
- setAttachment: (attrs?: unknown) => ReturnType;
885
+ drawer: {
886
+ setDrawer: (options: any, replace?: any) => ReturnType;
887
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
875
888
  };
876
889
  }
877
890
  }
@@ -879,9 +892,8 @@ declare module '@tiptap/core' {
879
892
 
880
893
  declare module '@tiptap/core' {
881
894
  interface Commands<ReturnType> {
882
- mermaid: {
883
- setMermaid: (options: any, replace?: any) => ReturnType;
884
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
895
+ attachment: {
896
+ setAttachment: (attrs?: unknown) => ReturnType;
885
897
  };
886
898
  }
887
899
  }
@@ -889,14 +901,19 @@ declare module '@tiptap/core' {
889
901
 
890
902
  declare module '@tiptap/core' {
891
903
  interface Commands<ReturnType> {
892
- twitter: {
904
+ imageGifUpload: {
893
905
  /**
894
- * Insert a tweet
895
- * @param options The tweet attributes
896
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
906
+ * Add an image gif
897
907
  */
898
- setTweet: (options: SetTweetOptions) => ReturnType;
899
- updateTweet: (options: SetTweetOptions) => ReturnType;
908
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
909
+ /**
910
+ * Update an image gif
911
+ */
912
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
913
+ /**
914
+ * Set image alignment
915
+ */
916
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
900
917
  };
901
918
  }
902
919
  }