reactjs-tiptap-editor 0.2.5 → 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>;
@@ -692,15 +699,19 @@ declare module '@tiptap/core' {
692
699
 
693
700
  declare module '@tiptap/core' {
694
701
  interface Commands<ReturnType> {
695
- indent: {
702
+ imageUpload: {
696
703
  /**
697
- * Set the indent attribute
704
+ * Add an image
698
705
  */
699
- indent: () => ReturnType;
706
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
700
707
  /**
701
- * Set the outdent attribute
708
+ * Update an image
702
709
  */
703
- outdent: () => ReturnType;
710
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
711
+ /**
712
+ * Set image alignment
713
+ */
714
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
704
715
  };
705
716
  }
706
717
  }
@@ -718,19 +729,15 @@ declare module '@tiptap/core' {
718
729
 
719
730
  declare module '@tiptap/core' {
720
731
  interface Commands<ReturnType> {
721
- imageUpload: {
722
- /**
723
- * Add an image
724
- */
725
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
732
+ indent: {
726
733
  /**
727
- * Update an image
734
+ * Set the indent attribute
728
735
  */
729
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
736
+ indent: () => ReturnType;
730
737
  /**
731
- * Set image alignment
738
+ * Set the outdent attribute
732
739
  */
733
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
740
+ outdent: () => ReturnType;
734
741
  };
735
742
  }
736
743
  }
@@ -738,8 +745,8 @@ declare module '@tiptap/core' {
738
745
 
739
746
  declare module '@tiptap/core' {
740
747
  interface Commands<ReturnType> {
741
- painter: {
742
- setPainter: (marks: Mark[]) => ReturnType;
748
+ katex: {
749
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
743
750
  };
744
751
  }
745
752
  }
@@ -747,13 +754,35 @@ declare module '@tiptap/core' {
747
754
 
748
755
  declare module '@tiptap/core' {
749
756
  interface Commands<ReturnType> {
750
- columns: {
751
- insertColumns: (attrs?: {
752
- cols: number;
757
+ emoji: {
758
+ setEmoji: (emoji: {
759
+ name: string;
760
+ emoji: string;
753
761
  }) => ReturnType;
754
- addColBefore: () => ReturnType;
755
- addColAfter: () => ReturnType;
756
- deleteCol: () => ReturnType;
762
+ };
763
+ }
764
+ }
765
+
766
+
767
+ declare module '@tiptap/core' {
768
+ interface Commands<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;
777
+ };
778
+ }
779
+ }
780
+
781
+
782
+ declare module '@tiptap/core' {
783
+ interface Commands<ReturnType> {
784
+ painter: {
785
+ setPainter: (marks: Mark[]) => ReturnType;
757
786
  };
758
787
  }
759
788
  }
@@ -786,11 +815,13 @@ declare module '@tiptap/core' {
786
815
 
787
816
  declare module '@tiptap/core' {
788
817
  interface Commands<ReturnType> {
789
- emoji: {
790
- setEmoji: (emoji: {
791
- name: string;
792
- emoji: string;
818
+ columns: {
819
+ insertColumns: (attrs?: {
820
+ cols: number;
793
821
  }) => ReturnType;
822
+ addColBefore: () => ReturnType;
823
+ addColAfter: () => ReturnType;
824
+ deleteCol: () => ReturnType;
794
825
  };
795
826
  }
796
827
  }
@@ -798,8 +829,8 @@ declare module '@tiptap/core' {
798
829
 
799
830
  declare module '@tiptap/core' {
800
831
  interface Commands<ReturnType> {
801
- katex: {
802
- setKatex: (arg?: IKatexAttrs) => ReturnType;
832
+ exportWord: {
833
+ exportToWord: () => ReturnType;
803
834
  };
804
835
  }
805
836
  }
@@ -807,14 +838,9 @@ declare module '@tiptap/core' {
807
838
 
808
839
  declare module '@tiptap/core' {
809
840
  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;
841
+ tableOfContents: {
842
+ setTableOfContents: () => ReturnType;
843
+ removeTableOfContents: () => ReturnType;
818
844
  };
819
845
  }
820
846
  }
@@ -822,8 +848,8 @@ declare module '@tiptap/core' {
822
848
 
823
849
  declare module '@tiptap/core' {
824
850
  interface Commands<ReturnType> {
825
- exportWord: {
826
- exportToWord: () => ReturnType;
851
+ excalidraw: {
852
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
827
853
  };
828
854
  }
829
855
  }
@@ -831,9 +857,9 @@ declare module '@tiptap/core' {
831
857
 
832
858
  declare module '@tiptap/core' {
833
859
  interface Commands<ReturnType> {
834
- tableOfContents: {
835
- setTableOfContents: () => ReturnType;
836
- removeTableOfContents: () => ReturnType;
860
+ mermaid: {
861
+ setMermaid: (options: any, replace?: any) => ReturnType;
862
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
837
863
  };
838
864
  }
839
865
  }
@@ -841,8 +867,24 @@ declare module '@tiptap/core' {
841
867
 
842
868
  declare module '@tiptap/core' {
843
869
  interface Commands<ReturnType> {
844
- excalidraw: {
845
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
870
+ twitter: {
871
+ /**
872
+ * Insert a tweet
873
+ * @param options The tweet attributes
874
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
875
+ */
876
+ setTweet: (options: SetTweetOptions) => ReturnType;
877
+ updateTweet: (options: SetTweetOptions) => ReturnType;
878
+ };
879
+ }
880
+ }
881
+
882
+
883
+ declare module '@tiptap/core' {
884
+ interface Commands<ReturnType> {
885
+ drawer: {
886
+ setDrawer: (options: any, replace?: any) => ReturnType;
887
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
846
888
  };
847
889
  }
848
890
  }
@@ -875,28 +917,3 @@ declare module '@tiptap/core' {
875
917
  };
876
918
  }
877
919
  }
878
-
879
-
880
- declare module '@tiptap/core' {
881
- interface Commands<ReturnType> {
882
- twitter: {
883
- /**
884
- * Insert a tweet
885
- * @param options The tweet attributes
886
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
887
- */
888
- setTweet: (options: SetTweetOptions) => ReturnType;
889
- updateTweet: (options: SetTweetOptions) => ReturnType;
890
- };
891
- }
892
- }
893
-
894
-
895
- declare module '@tiptap/core' {
896
- interface Commands<ReturnType> {
897
- mermaid: {
898
- setMermaid: (options: any, replace?: any) => ReturnType;
899
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
900
- };
901
- }
902
- }
@@ -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>;
@@ -692,15 +699,19 @@ declare module '@tiptap/core' {
692
699
 
693
700
  declare module '@tiptap/core' {
694
701
  interface Commands<ReturnType> {
695
- indent: {
702
+ imageUpload: {
696
703
  /**
697
- * Set the indent attribute
704
+ * Add an image
698
705
  */
699
- indent: () => ReturnType;
706
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
700
707
  /**
701
- * Set the outdent attribute
708
+ * Update an image
702
709
  */
703
- outdent: () => ReturnType;
710
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
711
+ /**
712
+ * Set image alignment
713
+ */
714
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
704
715
  };
705
716
  }
706
717
  }
@@ -718,19 +729,15 @@ declare module '@tiptap/core' {
718
729
 
719
730
  declare module '@tiptap/core' {
720
731
  interface Commands<ReturnType> {
721
- imageUpload: {
722
- /**
723
- * Add an image
724
- */
725
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
732
+ indent: {
726
733
  /**
727
- * Update an image
734
+ * Set the indent attribute
728
735
  */
729
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
736
+ indent: () => ReturnType;
730
737
  /**
731
- * Set image alignment
738
+ * Set the outdent attribute
732
739
  */
733
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
740
+ outdent: () => ReturnType;
734
741
  };
735
742
  }
736
743
  }
@@ -738,8 +745,8 @@ declare module '@tiptap/core' {
738
745
 
739
746
  declare module '@tiptap/core' {
740
747
  interface Commands<ReturnType> {
741
- painter: {
742
- setPainter: (marks: Mark[]) => ReturnType;
748
+ katex: {
749
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
743
750
  };
744
751
  }
745
752
  }
@@ -747,13 +754,35 @@ declare module '@tiptap/core' {
747
754
 
748
755
  declare module '@tiptap/core' {
749
756
  interface Commands<ReturnType> {
750
- columns: {
751
- insertColumns: (attrs?: {
752
- cols: number;
757
+ emoji: {
758
+ setEmoji: (emoji: {
759
+ name: string;
760
+ emoji: string;
753
761
  }) => ReturnType;
754
- addColBefore: () => ReturnType;
755
- addColAfter: () => ReturnType;
756
- deleteCol: () => ReturnType;
762
+ };
763
+ }
764
+ }
765
+
766
+
767
+ declare module '@tiptap/core' {
768
+ interface Commands<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;
777
+ };
778
+ }
779
+ }
780
+
781
+
782
+ declare module '@tiptap/core' {
783
+ interface Commands<ReturnType> {
784
+ painter: {
785
+ setPainter: (marks: Mark[]) => ReturnType;
757
786
  };
758
787
  }
759
788
  }
@@ -786,11 +815,13 @@ declare module '@tiptap/core' {
786
815
 
787
816
  declare module '@tiptap/core' {
788
817
  interface Commands<ReturnType> {
789
- emoji: {
790
- setEmoji: (emoji: {
791
- name: string;
792
- emoji: string;
818
+ columns: {
819
+ insertColumns: (attrs?: {
820
+ cols: number;
793
821
  }) => ReturnType;
822
+ addColBefore: () => ReturnType;
823
+ addColAfter: () => ReturnType;
824
+ deleteCol: () => ReturnType;
794
825
  };
795
826
  }
796
827
  }
@@ -798,8 +829,8 @@ declare module '@tiptap/core' {
798
829
 
799
830
  declare module '@tiptap/core' {
800
831
  interface Commands<ReturnType> {
801
- katex: {
802
- setKatex: (arg?: IKatexAttrs) => ReturnType;
832
+ exportWord: {
833
+ exportToWord: () => ReturnType;
803
834
  };
804
835
  }
805
836
  }
@@ -807,14 +838,9 @@ declare module '@tiptap/core' {
807
838
 
808
839
  declare module '@tiptap/core' {
809
840
  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;
841
+ tableOfContents: {
842
+ setTableOfContents: () => ReturnType;
843
+ removeTableOfContents: () => ReturnType;
818
844
  };
819
845
  }
820
846
  }
@@ -822,8 +848,8 @@ declare module '@tiptap/core' {
822
848
 
823
849
  declare module '@tiptap/core' {
824
850
  interface Commands<ReturnType> {
825
- exportWord: {
826
- exportToWord: () => ReturnType;
851
+ excalidraw: {
852
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
827
853
  };
828
854
  }
829
855
  }
@@ -831,9 +857,9 @@ declare module '@tiptap/core' {
831
857
 
832
858
  declare module '@tiptap/core' {
833
859
  interface Commands<ReturnType> {
834
- tableOfContents: {
835
- setTableOfContents: () => ReturnType;
836
- removeTableOfContents: () => ReturnType;
860
+ mermaid: {
861
+ setMermaid: (options: any, replace?: any) => ReturnType;
862
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
837
863
  };
838
864
  }
839
865
  }
@@ -841,8 +867,24 @@ declare module '@tiptap/core' {
841
867
 
842
868
  declare module '@tiptap/core' {
843
869
  interface Commands<ReturnType> {
844
- excalidraw: {
845
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
870
+ twitter: {
871
+ /**
872
+ * Insert a tweet
873
+ * @param options The tweet attributes
874
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
875
+ */
876
+ setTweet: (options: SetTweetOptions) => ReturnType;
877
+ updateTweet: (options: SetTweetOptions) => ReturnType;
878
+ };
879
+ }
880
+ }
881
+
882
+
883
+ declare module '@tiptap/core' {
884
+ interface Commands<ReturnType> {
885
+ drawer: {
886
+ setDrawer: (options: any, replace?: any) => ReturnType;
887
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
846
888
  };
847
889
  }
848
890
  }
@@ -875,28 +917,3 @@ declare module '@tiptap/core' {
875
917
  };
876
918
  }
877
919
  }
878
-
879
-
880
- declare module '@tiptap/core' {
881
- interface Commands<ReturnType> {
882
- twitter: {
883
- /**
884
- * Insert a tweet
885
- * @param options The tweet attributes
886
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
887
- */
888
- setTweet: (options: SetTweetOptions) => ReturnType;
889
- updateTweet: (options: SetTweetOptions) => ReturnType;
890
- };
891
- }
892
- }
893
-
894
-
895
- declare module '@tiptap/core' {
896
- interface Commands<ReturnType> {
897
- mermaid: {
898
- setMermaid: (options: any, replace?: any) => ReturnType;
899
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
900
- };
901
- }
902
- }