reactjs-tiptap-editor 0.2.18 → 0.2.19

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.
@@ -716,9 +716,9 @@ declare module '@tiptap/core' {
716
716
 
717
717
  declare module '@tiptap/core' {
718
718
  interface Commands<ReturnType> {
719
- tableCellBackground: {
720
- setTableCellBackground: (color: string) => ReturnType;
721
- unsetTableCellBackground: () => ReturnType;
719
+ lineHeight: {
720
+ setLineHeight: (lineHeight: string) => ReturnType;
721
+ unsetLineHeight: () => ReturnType;
722
722
  };
723
723
  }
724
724
  }
@@ -726,8 +726,19 @@ declare module '@tiptap/core' {
726
726
 
727
727
  declare module '@tiptap/core' {
728
728
  interface Commands<ReturnType> {
729
- painter: {
730
- setPainter: (marks: Mark[]) => ReturnType;
729
+ imageUpload: {
730
+ /**
731
+ * Add an image
732
+ */
733
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
734
+ /**
735
+ * Update an image
736
+ */
737
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
738
+ /**
739
+ * Set image alignment
740
+ */
741
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
731
742
  };
732
743
  }
733
744
  }
@@ -735,14 +746,9 @@ declare module '@tiptap/core' {
735
746
 
736
747
  declare module '@tiptap/core' {
737
748
  interface Commands<ReturnType> {
738
- iframe: {
739
- /**
740
- * Add an iframe
741
- */
742
- setIframe: (options: {
743
- src: string;
744
- service: string;
745
- }) => ReturnType;
749
+ tableCellBackground: {
750
+ setTableCellBackground: (color: string) => ReturnType;
751
+ unsetTableCellBackground: () => ReturnType;
746
752
  };
747
753
  }
748
754
  }
@@ -750,8 +756,8 @@ declare module '@tiptap/core' {
750
756
 
751
757
  declare module '@tiptap/core' {
752
758
  interface Commands<ReturnType> {
753
- katex: {
754
- setKatex: (arg?: IKatexAttrs) => ReturnType;
759
+ painter: {
760
+ setPainter: (marks: Mark[]) => ReturnType;
755
761
  };
756
762
  }
757
763
  }
@@ -759,9 +765,28 @@ declare module '@tiptap/core' {
759
765
 
760
766
  declare module '@tiptap/core' {
761
767
  interface Commands<ReturnType> {
762
- lineHeight: {
763
- setLineHeight: (lineHeight: string) => ReturnType;
764
- unsetLineHeight: () => ReturnType;
768
+ columns: {
769
+ insertColumns: (attrs?: {
770
+ cols: number;
771
+ }) => ReturnType;
772
+ addColBefore: () => ReturnType;
773
+ addColAfter: () => ReturnType;
774
+ deleteCol: () => ReturnType;
775
+ };
776
+ }
777
+ }
778
+
779
+
780
+ declare module '@tiptap/core' {
781
+ interface Commands<ReturnType> {
782
+ iframe: {
783
+ /**
784
+ * Add an iframe
785
+ */
786
+ setIframe: (options: {
787
+ src: string;
788
+ service: string;
789
+ }) => ReturnType;
765
790
  };
766
791
  }
767
792
  }
@@ -782,20 +807,6 @@ declare module '@tiptap/core' {
782
807
  }
783
808
 
784
809
 
785
- declare module '@tiptap/core' {
786
- interface Commands<ReturnType> {
787
- columns: {
788
- insertColumns: (attrs?: {
789
- cols: number;
790
- }) => ReturnType;
791
- addColBefore: () => ReturnType;
792
- addColAfter: () => ReturnType;
793
- deleteCol: () => ReturnType;
794
- };
795
- }
796
- }
797
-
798
-
799
810
  declare module '@tiptap/core' {
800
811
  interface Commands<ReturnType> {
801
812
  emoji: {
@@ -810,19 +821,8 @@ declare module '@tiptap/core' {
810
821
 
811
822
  declare module '@tiptap/core' {
812
823
  interface Commands<ReturnType> {
813
- imageUpload: {
814
- /**
815
- * Add an image
816
- */
817
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
818
- /**
819
- * Update an image
820
- */
821
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
822
- /**
823
- * Set image alignment
824
- */
825
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
824
+ katex: {
825
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
826
826
  };
827
827
  }
828
828
  }
@@ -849,8 +849,8 @@ declare module '@tiptap/core' {
849
849
 
850
850
  declare module '@tiptap/core' {
851
851
  interface Commands<ReturnType> {
852
- excalidraw: {
853
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
852
+ attachment: {
853
+ setAttachment: (attrs?: unknown) => ReturnType;
854
854
  };
855
855
  }
856
856
  }
@@ -868,19 +868,8 @@ declare module '@tiptap/core' {
868
868
 
869
869
  declare module '@tiptap/core' {
870
870
  interface Commands<ReturnType> {
871
- imageGifUpload: {
872
- /**
873
- * Add an image gif
874
- */
875
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
876
- /**
877
- * Update an image gif
878
- */
879
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
880
- /**
881
- * Set image alignment
882
- */
883
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
871
+ excalidraw: {
872
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
884
873
  };
885
874
  }
886
875
  }
@@ -888,9 +877,14 @@ declare module '@tiptap/core' {
888
877
 
889
878
  declare module '@tiptap/core' {
890
879
  interface Commands<ReturnType> {
891
- mermaid: {
892
- setMermaid: (options: any, replace?: any) => ReturnType;
893
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
880
+ twitter: {
881
+ /**
882
+ * Insert a tweet
883
+ * @param options The tweet attributes
884
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
885
+ */
886
+ setTweet: (options: SetTweetOptions) => ReturnType;
887
+ updateTweet: (options: SetTweetOptions) => ReturnType;
894
888
  };
895
889
  }
896
890
  }
@@ -898,8 +892,9 @@ declare module '@tiptap/core' {
898
892
 
899
893
  declare module '@tiptap/core' {
900
894
  interface Commands<ReturnType> {
901
- attachment: {
902
- setAttachment: (attrs?: unknown) => ReturnType;
895
+ mermaid: {
896
+ setMermaid: (options: any, replace?: any) => ReturnType;
897
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
903
898
  };
904
899
  }
905
900
  }
@@ -907,14 +902,19 @@ declare module '@tiptap/core' {
907
902
 
908
903
  declare module '@tiptap/core' {
909
904
  interface Commands<ReturnType> {
910
- twitter: {
905
+ imageGifUpload: {
911
906
  /**
912
- * Insert a tweet
913
- * @param options The tweet attributes
914
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
907
+ * Add an image gif
915
908
  */
916
- setTweet: (options: SetTweetOptions) => ReturnType;
917
- updateTweet: (options: SetTweetOptions) => ReturnType;
909
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
910
+ /**
911
+ * Update an image gif
912
+ */
913
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
914
+ /**
915
+ * Set image alignment
916
+ */
917
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
918
918
  };
919
919
  }
920
920
  }
@@ -716,9 +716,9 @@ declare module '@tiptap/core' {
716
716
 
717
717
  declare module '@tiptap/core' {
718
718
  interface Commands<ReturnType> {
719
- tableCellBackground: {
720
- setTableCellBackground: (color: string) => ReturnType;
721
- unsetTableCellBackground: () => ReturnType;
719
+ lineHeight: {
720
+ setLineHeight: (lineHeight: string) => ReturnType;
721
+ unsetLineHeight: () => ReturnType;
722
722
  };
723
723
  }
724
724
  }
@@ -726,8 +726,19 @@ declare module '@tiptap/core' {
726
726
 
727
727
  declare module '@tiptap/core' {
728
728
  interface Commands<ReturnType> {
729
- painter: {
730
- setPainter: (marks: Mark[]) => ReturnType;
729
+ imageUpload: {
730
+ /**
731
+ * Add an image
732
+ */
733
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
734
+ /**
735
+ * Update an image
736
+ */
737
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
738
+ /**
739
+ * Set image alignment
740
+ */
741
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
731
742
  };
732
743
  }
733
744
  }
@@ -735,14 +746,9 @@ declare module '@tiptap/core' {
735
746
 
736
747
  declare module '@tiptap/core' {
737
748
  interface Commands<ReturnType> {
738
- iframe: {
739
- /**
740
- * Add an iframe
741
- */
742
- setIframe: (options: {
743
- src: string;
744
- service: string;
745
- }) => ReturnType;
749
+ tableCellBackground: {
750
+ setTableCellBackground: (color: string) => ReturnType;
751
+ unsetTableCellBackground: () => ReturnType;
746
752
  };
747
753
  }
748
754
  }
@@ -750,8 +756,8 @@ declare module '@tiptap/core' {
750
756
 
751
757
  declare module '@tiptap/core' {
752
758
  interface Commands<ReturnType> {
753
- katex: {
754
- setKatex: (arg?: IKatexAttrs) => ReturnType;
759
+ painter: {
760
+ setPainter: (marks: Mark[]) => ReturnType;
755
761
  };
756
762
  }
757
763
  }
@@ -759,9 +765,28 @@ declare module '@tiptap/core' {
759
765
 
760
766
  declare module '@tiptap/core' {
761
767
  interface Commands<ReturnType> {
762
- lineHeight: {
763
- setLineHeight: (lineHeight: string) => ReturnType;
764
- unsetLineHeight: () => ReturnType;
768
+ columns: {
769
+ insertColumns: (attrs?: {
770
+ cols: number;
771
+ }) => ReturnType;
772
+ addColBefore: () => ReturnType;
773
+ addColAfter: () => ReturnType;
774
+ deleteCol: () => ReturnType;
775
+ };
776
+ }
777
+ }
778
+
779
+
780
+ declare module '@tiptap/core' {
781
+ interface Commands<ReturnType> {
782
+ iframe: {
783
+ /**
784
+ * Add an iframe
785
+ */
786
+ setIframe: (options: {
787
+ src: string;
788
+ service: string;
789
+ }) => ReturnType;
765
790
  };
766
791
  }
767
792
  }
@@ -782,20 +807,6 @@ declare module '@tiptap/core' {
782
807
  }
783
808
 
784
809
 
785
- declare module '@tiptap/core' {
786
- interface Commands<ReturnType> {
787
- columns: {
788
- insertColumns: (attrs?: {
789
- cols: number;
790
- }) => ReturnType;
791
- addColBefore: () => ReturnType;
792
- addColAfter: () => ReturnType;
793
- deleteCol: () => ReturnType;
794
- };
795
- }
796
- }
797
-
798
-
799
810
  declare module '@tiptap/core' {
800
811
  interface Commands<ReturnType> {
801
812
  emoji: {
@@ -810,19 +821,8 @@ declare module '@tiptap/core' {
810
821
 
811
822
  declare module '@tiptap/core' {
812
823
  interface Commands<ReturnType> {
813
- imageUpload: {
814
- /**
815
- * Add an image
816
- */
817
- setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
818
- /**
819
- * Update an image
820
- */
821
- updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
822
- /**
823
- * Set image alignment
824
- */
825
- setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
824
+ katex: {
825
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
826
826
  };
827
827
  }
828
828
  }
@@ -849,8 +849,8 @@ declare module '@tiptap/core' {
849
849
 
850
850
  declare module '@tiptap/core' {
851
851
  interface Commands<ReturnType> {
852
- excalidraw: {
853
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
852
+ attachment: {
853
+ setAttachment: (attrs?: unknown) => ReturnType;
854
854
  };
855
855
  }
856
856
  }
@@ -868,19 +868,8 @@ declare module '@tiptap/core' {
868
868
 
869
869
  declare module '@tiptap/core' {
870
870
  interface Commands<ReturnType> {
871
- imageGifUpload: {
872
- /**
873
- * Add an image gif
874
- */
875
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
876
- /**
877
- * Update an image gif
878
- */
879
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
880
- /**
881
- * Set image alignment
882
- */
883
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
871
+ excalidraw: {
872
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
884
873
  };
885
874
  }
886
875
  }
@@ -888,9 +877,14 @@ declare module '@tiptap/core' {
888
877
 
889
878
  declare module '@tiptap/core' {
890
879
  interface Commands<ReturnType> {
891
- mermaid: {
892
- setMermaid: (options: any, replace?: any) => ReturnType;
893
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
880
+ twitter: {
881
+ /**
882
+ * Insert a tweet
883
+ * @param options The tweet attributes
884
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
885
+ */
886
+ setTweet: (options: SetTweetOptions) => ReturnType;
887
+ updateTweet: (options: SetTweetOptions) => ReturnType;
894
888
  };
895
889
  }
896
890
  }
@@ -898,8 +892,9 @@ declare module '@tiptap/core' {
898
892
 
899
893
  declare module '@tiptap/core' {
900
894
  interface Commands<ReturnType> {
901
- attachment: {
902
- setAttachment: (attrs?: unknown) => ReturnType;
895
+ mermaid: {
896
+ setMermaid: (options: any, replace?: any) => ReturnType;
897
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
903
898
  };
904
899
  }
905
900
  }
@@ -907,14 +902,19 @@ declare module '@tiptap/core' {
907
902
 
908
903
  declare module '@tiptap/core' {
909
904
  interface Commands<ReturnType> {
910
- twitter: {
905
+ imageGifUpload: {
911
906
  /**
912
- * Insert a tweet
913
- * @param options The tweet attributes
914
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
907
+ * Add an image gif
915
908
  */
916
- setTweet: (options: SetTweetOptions) => ReturnType;
917
- updateTweet: (options: SetTweetOptions) => ReturnType;
909
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
910
+ /**
911
+ * Update an image gif
912
+ */
913
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
914
+ /**
915
+ * Set image alignment
916
+ */
917
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
918
918
  };
919
919
  }
920
920
  }
@@ -4,8 +4,8 @@ import { jsxs as m, jsx as r, Fragment as ye } from "react/jsx-runtime";
4
4
  import * as J from "react";
5
5
  import dn, { useMemo as P, useState as v, useRef as G, useCallback as F, Fragment as ze, forwardRef as Re, useImperativeHandle as Pe, useEffect as M } from "react";
6
6
  import { ChevronDown as Ie, Check as hn, ChevronUp as un, Copy as mn, CopyCheck as fn, SearchIcon as _n, LoaderIcon as gn, LucideTableProperties as bn, LucideSheet as xn, LucideImage as pn, LucideFile as wn, LucideVideo as yn, LucideAudioLines as kn } from "lucide-react";
7
- import { i as Be, T as ke, a as ve, B as V, b as Ce, g as je, A as x, D as Q, c as Y, d as X, e as vn, f as S, u as De, h as Cn, I as z, j as ne, k as rt, l as Se, m as Nn, n as Oe, P as ie, o as ae, p as oe, q as $e, C as An, H as Tn, L as Ln, r as Sn, M as En, s as Hn, t as Ke, v as me, w as K, E as D, x as Mn, y as zn, V as Rn, z as Ve, F as Ne, G as We, S as Pn, J as In, K as Bn, N as j, O as jn, Q as Dn, U as On, W as $n, X as Fn, Y as st } from "./RichTextEditor-Bja02y2o.js";
8
- import { a3 as Vo, $ as Wo, Z as Go, a0 as Zo, _ as Jo, a1 as Qo, a2 as Yo } from "./RichTextEditor-Bja02y2o.js";
7
+ import { i as Be, T as ke, a as ve, B as V, b as Ce, g as je, A as x, D as Q, c as Y, d as X, e as vn, f as S, u as De, h as Cn, I as z, j as ne, k as rt, l as Se, m as Nn, n as Oe, P as ie, o as ae, p as oe, q as $e, C as An, H as Tn, L as Ln, r as Sn, M as En, s as Hn, t as Ke, v as me, w as K, E as D, x as Mn, y as zn, V as Rn, z as Ve, F as Ne, G as We, S as Pn, J as In, K as Bn, N as j, O as jn, Q as Dn, U as On, W as $n, X as Fn, Y as st } from "./RichTextEditor-aaUynZc2.js";
8
+ import { a3 as Vo, $ as Wo, Z as Go, a0 as Zo, _ as Jo, a1 as Qo, a2 as Yo } from "./RichTextEditor-aaUynZc2.js";
9
9
  import { M as Un, D as ct, u as B, f as qn, g as Kn, h as Ge, i as A, j as lt, k as Vn, T as fe, m as _e, n as ge } from "./index-8id9bPv5.js";
10
10
  import { bundledThemes as dt, bundledLanguages as ht, createHighlighter as Wn } from "shiki";
11
11
  import * as C from "@radix-ui/react-select";
package/lib/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),d=require("./RichTextEditor-CGcy7xvW.cjs"),c=require("./tiptap-Ufn12SjW.cjs");function a(){var r;const e=t.useRef({editor:null}),[i,o]=t.useState(!1),[s,n]=t.useState(null);return t.useEffect(()=>{var u;(u=e.current)!=null&&u.editor&&(o(!0),n(e.current.editor))},[e,(r=e.current)==null?void 0:r.editor]),{isReady:i,editor:s,editorRef:e}}exports.default=d.RichTextEditor;exports.BubbleMenu=c.BubbleMenu;exports.useEditorState=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),d=require("./RichTextEditor-DAqU7JiB.cjs"),c=require("./tiptap-Ufn12SjW.cjs");function a(){var r;const e=t.useRef({editor:null}),[i,o]=t.useState(!1),[s,n]=t.useState(null);return t.useEffect(()=>{var u;(u=e.current)!=null&&u.editor&&(o(!0),n(e.current.editor))},[e,(r=e.current)==null?void 0:r.editor]),{isReady:i,editor:s,editorRef:e}}exports.default=d.RichTextEditor;exports.BubbleMenu=c.BubbleMenu;exports.useEditorState=a;