reactjs-tiptap-editor 0.3.13 → 0.3.15
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/{ActionMenuButton-Cbbnqd-L.cjs → ActionMenuButton-BiJA06nt.cjs} +1 -1
- package/lib/{ActionMenuButton-BfH5nAGi.js → ActionMenuButton-cLs916Iz.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +8 -8
- package/lib/Attachment.d.ts +8 -8
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +8 -8
- package/lib/Blockquote.d.ts +8 -8
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +8 -8
- package/lib/Bold.d.ts +8 -8
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +8 -8
- package/lib/BulletList.d.ts +8 -8
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +8 -8
- package/lib/Clear.d.ts +8 -8
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +8 -8
- package/lib/Code.d.ts +8 -8
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +8 -8
- package/lib/CodeBlock.d.ts +8 -8
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +8 -8
- package/lib/CodeView.d.ts +8 -8
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +8 -8
- package/lib/Color.d.ts +8 -8
- package/lib/Color.js +1 -1
- package/lib/Document.d.cts +8 -8
- package/lib/Document.d.ts +8 -8
- package/lib/{Drawer-jPHImfyr.cjs → Drawer-Ctp3RrUF.cjs} +1 -1
- package/lib/{Drawer-DUXFBfgE.js → Drawer-mxoHuP24.js} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +8 -8
- package/lib/Drawer.d.ts +8 -8
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +8 -8
- package/lib/Emoji.d.ts +8 -8
- package/lib/Emoji.js +1 -1
- package/lib/{Excalidraw-BBOIIhij.js → Excalidraw-BIN8ca6O.js} +1 -1
- package/lib/{Excalidraw-CwZ3g3p-.cjs → Excalidraw-D2cIInsp.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +8 -8
- package/lib/Excalidraw.d.ts +8 -8
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +29 -5
- package/lib/ExportPdf.d.cts +91 -9
- package/lib/ExportPdf.d.ts +91 -9
- package/lib/ExportPdf.js +75 -35
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +8 -8
- package/lib/ExportWord.d.ts +8 -8
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +8 -8
- package/lib/FontFamily.d.ts +8 -8
- package/lib/FontFamily.js +2 -2
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +8 -8
- package/lib/FontSize.d.ts +8 -8
- package/lib/FontSize.js +2 -2
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +8 -8
- package/lib/FormatPainter.d.ts +8 -8
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +8 -8
- package/lib/Heading.d.ts +8 -8
- package/lib/Heading.js +2 -2
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +8 -8
- package/lib/Highlight.d.ts +8 -8
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +8 -8
- package/lib/History.d.ts +8 -8
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +8 -8
- package/lib/HorizontalRule.d.ts +8 -8
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +8 -8
- package/lib/Iframe.d.ts +8 -8
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +8 -8
- package/lib/Image.d.ts +8 -8
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +8 -8
- package/lib/ImageGif.d.ts +8 -8
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.d.cts +8 -8
- package/lib/ImportWord.d.ts +8 -8
- package/lib/ImportWord.js +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +8 -8
- package/lib/Indent.d.ts +8 -8
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +8 -8
- package/lib/Italic.d.ts +8 -8
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +8 -8
- package/lib/Katex.d.ts +8 -8
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +8 -8
- package/lib/LineHeight.d.ts +8 -8
- package/lib/LineHeight.js +1 -1
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +8 -8
- package/lib/Link.d.ts +8 -8
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +8 -8
- package/lib/ListItem.d.ts +8 -8
- package/lib/Mention.d.cts +8 -8
- package/lib/Mention.d.ts +8 -8
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +8 -8
- package/lib/Mermaid.d.ts +8 -8
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +8 -8
- package/lib/MoreMark.d.ts +8 -8
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +8 -8
- package/lib/MultiColumn.d.ts +8 -8
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +8 -8
- package/lib/OrderedList.d.ts +8 -8
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-OW4s40FH.js → RichTextEditor-1N7Gl9vo.js} +1033 -1025
- package/lib/{RichTextEditor-C3sK_Ys3.cjs → RichTextEditor-B_I3q8FW.cjs} +7 -7
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +8 -8
- package/lib/SearchAndReplace.d.ts +8 -8
- package/lib/SearchAndReplace.js +1 -1
- package/lib/Selection.d.cts +8 -8
- package/lib/Selection.d.ts +8 -8
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +8 -8
- package/lib/SlashCommand.d.ts +8 -8
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +8 -8
- package/lib/Strike.d.ts +8 -8
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +8 -8
- package/lib/SubAndSuperScript.d.ts +8 -8
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +8 -8
- package/lib/Table.d.ts +8 -8
- package/lib/Table.js +1 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +8 -8
- package/lib/TableOfContent.d.ts +8 -8
- package/lib/TableOfContent.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +8 -8
- package/lib/TaskList.d.ts +8 -8
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +8 -8
- package/lib/TextAlign.d.ts +8 -8
- package/lib/TextAlign.js +1 -1
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +8 -8
- package/lib/TextBubble.d.ts +8 -8
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +8 -8
- package/lib/TextDirection.d.ts +8 -8
- package/lib/TextDirection.js +1 -1
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +8 -8
- package/lib/TextUnderline.d.ts +8 -8
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +8 -8
- package/lib/TrailingNode.d.ts +8 -8
- package/lib/{Twitter-2LOf4hFb.js → Twitter-ClB1gNOp.js} +1 -1
- package/lib/{Twitter-Cg58uzB-.cjs → Twitter-CvLMjYUZ.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +8 -8
- package/lib/Twitter.d.ts +8 -8
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +8 -8
- package/lib/Video.d.ts +8 -8
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +8 -8
- package/lib/bubble-extra.d.ts +8 -8
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +8 -8
- package/lib/index.d.ts +8 -8
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +8 -8
- package/lib/locale-bundle.d.ts +8 -8
- package/lib/{textarea-DNz8Tnud.cjs → textarea-BIoxUMDS.cjs} +1 -1
- package/lib/{textarea-DM-_io94.js → textarea-rOG4VKVx.js} +1 -1
- package/package.json +1 -1
package/lib/ListItem.d.cts
CHANGED
|
@@ -36,9 +36,11 @@ declare module '@tiptap/core' {
|
|
|
36
36
|
|
|
37
37
|
declare module '@tiptap/core' {
|
|
38
38
|
interface Commands<ReturnType> {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
emoji: {
|
|
40
|
+
setEmoji: (emoji: {
|
|
41
|
+
name: string;
|
|
42
|
+
emoji: string;
|
|
43
|
+
}) => ReturnType;
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -46,11 +48,9 @@ declare module '@tiptap/core' {
|
|
|
46
48
|
|
|
47
49
|
declare module '@tiptap/core' {
|
|
48
50
|
interface Commands<ReturnType> {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
emoji: string;
|
|
53
|
-
}) => ReturnType;
|
|
51
|
+
drawer: {
|
|
52
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
53
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
package/lib/ListItem.d.ts
CHANGED
|
@@ -36,9 +36,11 @@ declare module '@tiptap/core' {
|
|
|
36
36
|
|
|
37
37
|
declare module '@tiptap/core' {
|
|
38
38
|
interface Commands<ReturnType> {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
emoji: {
|
|
40
|
+
setEmoji: (emoji: {
|
|
41
|
+
name: string;
|
|
42
|
+
emoji: string;
|
|
43
|
+
}) => ReturnType;
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -46,11 +48,9 @@ declare module '@tiptap/core' {
|
|
|
46
48
|
|
|
47
49
|
declare module '@tiptap/core' {
|
|
48
50
|
interface Commands<ReturnType> {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
emoji: string;
|
|
53
|
-
}) => ReturnType;
|
|
51
|
+
drawer: {
|
|
52
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
53
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
package/lib/Mention.d.cts
CHANGED
|
@@ -39,9 +39,11 @@ declare module '@tiptap/core' {
|
|
|
39
39
|
|
|
40
40
|
declare module '@tiptap/core' {
|
|
41
41
|
interface Commands<ReturnType> {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
emoji: {
|
|
43
|
+
setEmoji: (emoji: {
|
|
44
|
+
name: string;
|
|
45
|
+
emoji: string;
|
|
46
|
+
}) => ReturnType;
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -49,11 +51,9 @@ declare module '@tiptap/core' {
|
|
|
49
51
|
|
|
50
52
|
declare module '@tiptap/core' {
|
|
51
53
|
interface Commands<ReturnType> {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
emoji: string;
|
|
56
|
-
}) => ReturnType;
|
|
54
|
+
drawer: {
|
|
55
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
56
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
}
|
package/lib/Mention.d.ts
CHANGED
|
@@ -39,9 +39,11 @@ declare module '@tiptap/core' {
|
|
|
39
39
|
|
|
40
40
|
declare module '@tiptap/core' {
|
|
41
41
|
interface Commands<ReturnType> {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
emoji: {
|
|
43
|
+
setEmoji: (emoji: {
|
|
44
|
+
name: string;
|
|
45
|
+
emoji: string;
|
|
46
|
+
}) => ReturnType;
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -49,11 +51,9 @@ declare module '@tiptap/core' {
|
|
|
49
51
|
|
|
50
52
|
declare module '@tiptap/core' {
|
|
51
53
|
interface Commands<ReturnType> {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
emoji: string;
|
|
56
|
-
}) => ReturnType;
|
|
54
|
+
drawer: {
|
|
55
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
56
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
}
|
package/lib/Mermaid.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var G=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var J=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of U(e))!Y.call(t,l)&&l!==r&&G(t,l,{get:()=>e[l],enumerable:!(a=X(e,l))||a.enumerable});return t};var K=(t,e,r)=>(r=t!=null?W(Z(t)):{},J(e||!t||!t.__esModule?G(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-CSvnpArE.cjs"),u=require("./RichTextEditor-
|
|
1
|
+
"use strict";var W=Object.create;var G=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var J=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of U(e))!Y.call(t,l)&&l!==r&&G(t,l,{get:()=>e[l],enumerable:!(a=X(e,l))||a.enumerable});return t};var K=(t,e,r)=>(r=t!=null?W(Z(t)):{},J(e||!t||!t.__esModule?G(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-CSvnpArE.cjs"),u=require("./RichTextEditor-B_I3q8FW.cjs"),F=require("./dom-dataset-Cuy-pIfj.cjs"),o=require("react/jsx-runtime"),s=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-BIoxUMDS.cjs"),S=require("./index-Dz3YxLE7.cjs"),$=`graph TB
|
|
2
2
|
a-->b`,ee=({editor:t,upload:e})=>{const[r,a]=s.useState($),[l,v]=s.useState(""),[T,y]=s.useState(!1),A=s.useRef(null),[d,h]=s.useState(null),E=s.useCallback(c=>{c&&import("mermaid").then(x=>{h(x.default)})},[]),_=async c=>{try{const{svg:x}=await d.render("mermaid-svg",c);v(x)}catch{v("")}},L=()=>{d.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),_(r)};s.useEffect(()=>{d&&T&&L()},[d,T]),s.useEffect(()=>{d&&T&&_(r)},[d&&r]);const R=async()=>{if(r!==""){if(r){const c=A.current.querySelector("svg"),{width:x,height:j}=c.getBoundingClientRect(),I=`mermaid-${P.shortId()}.svg`;let M=P.i(c.outerHTML);if(e){console.log({src:M});const H=u.dataURLtoFile(M,I);M=await e(H)}t==null||t.chain().focus().setMermaid({type:"mermaid",src:M,alt:encodeURIComponent(r),width:x,height:j},!!r).run()}y(!1)}};return o.jsxs(u.Dialog,{onOpenChange:y,open:T,children:[o.jsx(u.DialogTrigger,{asChild:!0,children:o.jsx(u.ActionButton,{action:()=>y(!0),icon:"Mermaid",tooltip:"Mermaid"})}),o.jsxs(u.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[o.jsx(u.DialogTitle,{children:"Mermaid"}),o.jsx("div",{ref:E,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:o.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[o.jsx(Q.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:c=>a(c.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),o.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:l},ref:A,style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),o.jsx(u.DialogFooter,{children:o.jsx(u.Button,{onClick:R,type:"button",children:"Save changes"})})]})]})},O={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function te({editor:t,node:e,updateAttributes:r,getPos:a,selected:l}){const[v,T]=s.useState({width:S.IMAGE_MAX_SIZE,height:S.IMAGE_MAX_SIZE}),[y,A]=s.useState({width:0,height:0}),[d]=s.useState([O.TOP_LEFT,O.TOP_RIGHT,O.BOTTOM_LEFT,O.BOTTOM_RIGHT]),[h,E]=s.useState(!1),[_,L]=s.useState({x:0,y:0,w:0,h:0,dir:""}),{align:R}=e==null?void 0:e.attrs,c=s.useMemo(()=>{const{src:i,alt:m,width:f,height:b}=e==null?void 0:e.attrs,w=q.isNumber(f)?`${f}px`:f,n=q.isNumber(b)?`${b}px`:b;return{src:i||void 0,alt:m||void 0,style:{width:w||void 0,height:n||void 0}}},[e==null?void 0:e.attrs]),x=s.useMemo(()=>{const{style:{width:i}}=c;return{width:i==="100%"?i:void 0}},[c]);function j(i){A({width:i.target.width,height:i.target.height})}function I(){t.commands.setNodeSelection(a())}const M=s.useCallback(u.throttle(()=>{const{width:i}=getComputedStyle(t.view.dom);T(m=>({...m,width:Number.parseInt(i,10)}))},S.IMAGE_THROTTLE_WAIT_TIME),[t]);function H(i,m){i.preventDefault(),i.stopPropagation();const f=y.width,b=y.height,w=f/b;let n=Number(e.attrs.width),p=Number(e.attrs.height);const g=v.width;n&&!p?(n=n>g?g:n,p=Math.round(n/w)):p&&!n?(n=Math.round(p*w),n=n>g?g:n):!n&&!p?(n=f>g?g:f,p=Math.round(n/w)):n=n>g?g:n,E(!0),L({x:i.clientX,y:i.clientY,w:n,h:p,dir:m})}const N=s.useCallback(u.throttle(i=>{if(i.preventDefault(),i.stopPropagation(),!h)return;const{x:m,w:f,dir:b}=_,w=(i.clientX-m)*(/l/.test(b)?-1:1),{width:n,height:p}=e==null?void 0:e.attrs,g=n/p,B=u.clamp(f+w,S.IMAGE_MIN_SIZE,v.width),V=Math.round(B/g);r({width:B,height:V})},S.IMAGE_THROTTLE_WAIT_TIME),[h,_,v,r,e==null?void 0:e.attrs]),C=s.useCallback(i=>{i.preventDefault(),i.stopPropagation(),h&&(L({x:0,y:0,w:0,h:0,dir:""}),E(!1),I())},[h,I]),D=s.useCallback(()=>{document==null||document.addEventListener("mousemove",N,!0),document==null||document.addEventListener("mouseup",C,!0)},[N,C]),z=s.useCallback(()=>{document==null||document.removeEventListener("mousemove",N,!0),document==null||document.removeEventListener("mouseup",C,!0)},[N,C]);s.useEffect(()=>(h?D():z(),()=>{z()}),[h,D,z]);const k=s.useMemo(()=>new ResizeObserver(()=>M()),[M]);return s.useEffect(()=>(k.observe(t.view.dom),()=>{k.disconnect()}),[t.view.dom,k]),o.jsx(F.NodeViewWrapper,{className:"image-view",style:{...x,width:"100%",textAlign:R},children:o.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:{...x,background:"#fff"},className:`image-view__body ${l?"image-view__body--focused":""} ${h?"image-view__body--resizing":""}`,children:[o.jsx("img",{alt:c.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:j,src:c.src,style:c.style}),t.view.editable&&(l||h)&&o.jsx("div",{className:"image-resizer",children:d==null?void 0:d.map(i=>o.jsx("span",{className:`image-resizer__handler image-resizer__handler--${i}`,onMouseDown:m=>H(m,i)},`image-dir-${i}`))})]})})}const re=u.Image.extend({name:"mermaid",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"mermaid"},button:({editor:e,t:r,extension:a})=>{var l;return{component:ee,componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,editor:e,icon:"Mermaid",tooltip:r("editor.mermaid.tooltip"),upload:(l=a==null?void 0:a.options)==null?void 0:l.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>{const r=e.querySelector("img"),a=r==null?void 0:r.getAttribute("width");return a?Number.parseInt(a,10):320},renderHTML:e=>({width:e.width})},height:{default:null,parseHTML:e=>{const r=e.querySelector("img"),a=r==null?void 0:r.getAttribute("height");return a?Number.parseInt(a,10):212},renderHTML:e=>({height:e.height})},align:{default:"center",parseHTML:e=>e.getAttribute("align"),renderHTML:e=>({align:e.align})}}},addNodeView(){return F.ReactNodeViewRenderer(te)},addCommands(){return{setMermaid:(t,e)=>({commands:r,editor:a})=>e?r.insertContent({type:this.name,attrs:t}):r.insertContentAt(a.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageMermaid:t=>({commands:e})=>e.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:e}=t;return["div",{style:e?`text-align: ${e};`:"",class:"imageMermaid"},["img",q.mergeAttributes(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageMermaid]",getAttrs:t=>{const e=t.querySelector("img"),r=e==null?void 0:e.getAttribute("width"),a=e==null?void 0:e.getAttribute("height");return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),width:r?Number.parseInt(r,10):null,height:a?Number.parseInt(a,10):null,align:(e==null?void 0:e.getAttribute("align"))||t.style.textAlign||null}}}]}});exports.Mermaid=re;
|
package/lib/Mermaid.d.cts
CHANGED
|
@@ -111,9 +111,11 @@ declare module '@tiptap/core' {
|
|
|
111
111
|
|
|
112
112
|
declare module '@tiptap/core' {
|
|
113
113
|
interface Commands<ReturnType> {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
emoji: {
|
|
115
|
+
setEmoji: (emoji: {
|
|
116
|
+
name: string;
|
|
117
|
+
emoji: string;
|
|
118
|
+
}) => ReturnType;
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
}
|
|
@@ -121,11 +123,9 @@ declare module '@tiptap/core' {
|
|
|
121
123
|
|
|
122
124
|
declare module '@tiptap/core' {
|
|
123
125
|
interface Commands<ReturnType> {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
emoji: string;
|
|
128
|
-
}) => ReturnType;
|
|
126
|
+
drawer: {
|
|
127
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
128
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
}
|
package/lib/Mermaid.d.ts
CHANGED
|
@@ -111,9 +111,11 @@ declare module '@tiptap/core' {
|
|
|
111
111
|
|
|
112
112
|
declare module '@tiptap/core' {
|
|
113
113
|
interface Commands<ReturnType> {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
emoji: {
|
|
115
|
+
setEmoji: (emoji: {
|
|
116
|
+
name: string;
|
|
117
|
+
emoji: string;
|
|
118
|
+
}) => ReturnType;
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
}
|
|
@@ -121,11 +123,9 @@ declare module '@tiptap/core' {
|
|
|
121
123
|
|
|
122
124
|
declare module '@tiptap/core' {
|
|
123
125
|
interface Commands<ReturnType> {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
emoji: string;
|
|
128
|
-
}) => ReturnType;
|
|
126
|
+
drawer: {
|
|
127
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
128
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
}
|
package/lib/Mermaid.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h as $, m as X } from "./index-BWx1Mchx.js";
|
|
2
|
-
import { w as Z, x as J, A as K, y as Y, z as Q, F as tt, B as et, G as rt, J as V, K as it, N as at } from "./RichTextEditor-
|
|
2
|
+
import { w as Z, x as J, A as K, y as Y, z as Q, F as tt, B as et, G as rt, J as V, K as it, N as at } from "./RichTextEditor-1N7Gl9vo.js";
|
|
3
3
|
import { N as st, R as nt } from "./dom-dataset-CHDbKz5J.js";
|
|
4
4
|
import { jsxs as C, jsx as o } from "react/jsx-runtime";
|
|
5
5
|
import { useState as g, useRef as ot, useCallback as y, useEffect as E, useMemo as k } from "react";
|
|
6
6
|
import { s as lt, i as ct } from "./shortId-WJVkrvml.js";
|
|
7
|
-
import { T as ht } from "./textarea-
|
|
7
|
+
import { T as ht } from "./textarea-rOG4VKVx.js";
|
|
8
8
|
import { I as q, h as dt, i as W } from "./index-D-DR0FPY.js";
|
|
9
9
|
const j = `graph TB
|
|
10
10
|
a-->b`, ut = ({ editor: r, upload: t }) => {
|
package/lib/MoreMark.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CSvnpArE.cjs"),l=require("./index-h9_SDuwc.cjs"),c=require("react/jsx-runtime"),x=require("react"),s=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CSvnpArE.cjs"),l=require("./index-h9_SDuwc.cjs"),c=require("react/jsx-runtime"),x=require("react"),s=require("./RichTextEditor-B_I3q8FW.cjs");function b(t){var n;const i=x.useMemo(()=>{var r;const e=(r=t==null?void 0:t.items)==null?void 0:r.find(u=>u.isActive());return e&&!e.default?{...e,icon:e!=null&&e.icon?e==null?void 0:e.icon:t==null?void 0:t.icon}:{title:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return c.jsxs(s.DropdownMenu,{children:[c.jsx(s.DropdownMenuTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:c.jsx(s.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:t==null?void 0:t.disabled,icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,children:c.jsx(s.MenuDown,{className:"richtext-size-3 richtext-text-gray-500"})})}),c.jsx(s.DropdownMenuContent,{className:"w-full",children:(n=t==null?void 0:t.items)==null?void 0:n.map((e,o)=>c.jsxs(s.DropdownMenuCheckboxItem,{checked:i.title===e.title,className:"richtext-flex richtext-items-center richtext-gap-3",onClick:e.action,children:[c.jsx(s.IconComponent,{name:e==null?void 0:e.icon}),c.jsx("span",{className:"richtext-ml-1",children:e.title}),!!(e!=null&&e.shortcutKeys)&&c.jsx("span",{className:"richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",children:s.getShortcutKeys(e.shortcutKeys)})]},`more-mark-${o}`))})]})}const m=h.Extension.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:i,extension:n,t:e}){const o=n.options.subscript,r=n.options.superscript,u={action:()=>i.commands.toggleSubscript(),isActive:()=>i.isActive("subscript")||!1,disabled:!i.can().toggleSubscript(),icon:"Subscript",title:e("editor.subscript.tooltip"),shortcutKeys:["mod","."]},d={action:()=>i.commands.toggleSuperscript(),isActive:()=>i.isActive("superscript")||!1,disabled:!i.can().toggleSuperscript(),icon:"Superscript",title:e("editor.superscript.tooltip"),shortcutKeys:["mod",","]},a=[];return o!==!1&&a.push(u),r!==!1&&a.push(d),{component:b,componentProps:{icon:"Type",tooltip:e("editor.moremark"),disabled:!i.isEditable,items:a}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(l.Subscript.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(l.Superscript.configure(this.options.superscript)),t}});exports.MoreMark=m;
|
package/lib/MoreMark.d.cts
CHANGED
|
@@ -122,9 +122,11 @@ declare module '@tiptap/core' {
|
|
|
122
122
|
|
|
123
123
|
declare module '@tiptap/core' {
|
|
124
124
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
emoji: {
|
|
126
|
+
setEmoji: (emoji: {
|
|
127
|
+
name: string;
|
|
128
|
+
emoji: string;
|
|
129
|
+
}) => ReturnType;
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -132,11 +134,9 @@ declare module '@tiptap/core' {
|
|
|
132
134
|
|
|
133
135
|
declare module '@tiptap/core' {
|
|
134
136
|
interface Commands<ReturnType> {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
emoji: string;
|
|
139
|
-
}) => ReturnType;
|
|
137
|
+
drawer: {
|
|
138
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
139
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
}
|
package/lib/MoreMark.d.ts
CHANGED
|
@@ -122,9 +122,11 @@ declare module '@tiptap/core' {
|
|
|
122
122
|
|
|
123
123
|
declare module '@tiptap/core' {
|
|
124
124
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
emoji: {
|
|
126
|
+
setEmoji: (emoji: {
|
|
127
|
+
name: string;
|
|
128
|
+
emoji: string;
|
|
129
|
+
}) => ReturnType;
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -132,11 +134,9 @@ declare module '@tiptap/core' {
|
|
|
132
134
|
|
|
133
135
|
declare module '@tiptap/core' {
|
|
134
136
|
interface Commands<ReturnType> {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
emoji: string;
|
|
139
|
-
}) => ReturnType;
|
|
137
|
+
drawer: {
|
|
138
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
139
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
}
|
package/lib/MoreMark.js
CHANGED
|
@@ -2,7 +2,7 @@ import { E as h } from "./index-BWx1Mchx.js";
|
|
|
2
2
|
import { S as d, a as m } from "./index-DEFQHExY.js";
|
|
3
3
|
import { jsxs as u, jsx as c } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo as f } from "react";
|
|
5
|
-
import { D as x, e as b, A as g, M, f as S, h as k, k as A, g as w } from "./RichTextEditor-
|
|
5
|
+
import { D as x, e as b, A as g, M, f as S, h as k, k as A, g as w } from "./RichTextEditor-1N7Gl9vo.js";
|
|
6
6
|
function y(t) {
|
|
7
7
|
var s;
|
|
8
8
|
const i = f(() => {
|
package/lib/MultiColumn.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSvnpArE.cjs");const o=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CSvnpArE.cjs");const o=require("./RichTextEditor-B_I3q8FW.cjs");exports.Column=o.Column;exports.ColumnActionButton=o.ColumnActionButton;exports.EXTENSION_PRIORITY_HIGHEST=o.EXTENSION_PRIORITY_HIGHEST;exports.MultiColumn=o.MultiColumn;
|
package/lib/MultiColumn.d.cts
CHANGED
|
@@ -44,9 +44,11 @@ declare module '@tiptap/core' {
|
|
|
44
44
|
|
|
45
45
|
declare module '@tiptap/core' {
|
|
46
46
|
interface Commands<ReturnType> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
emoji: {
|
|
48
|
+
setEmoji: (emoji: {
|
|
49
|
+
name: string;
|
|
50
|
+
emoji: string;
|
|
51
|
+
}) => ReturnType;
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -54,11 +56,9 @@ declare module '@tiptap/core' {
|
|
|
54
56
|
|
|
55
57
|
declare module '@tiptap/core' {
|
|
56
58
|
interface Commands<ReturnType> {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
emoji: string;
|
|
61
|
-
}) => ReturnType;
|
|
59
|
+
drawer: {
|
|
60
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
61
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
}
|
package/lib/MultiColumn.d.ts
CHANGED
|
@@ -44,9 +44,11 @@ declare module '@tiptap/core' {
|
|
|
44
44
|
|
|
45
45
|
declare module '@tiptap/core' {
|
|
46
46
|
interface Commands<ReturnType> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
emoji: {
|
|
48
|
+
setEmoji: (emoji: {
|
|
49
|
+
name: string;
|
|
50
|
+
emoji: string;
|
|
51
|
+
}) => ReturnType;
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -54,11 +56,9 @@ declare module '@tiptap/core' {
|
|
|
54
56
|
|
|
55
57
|
declare module '@tiptap/core' {
|
|
56
58
|
interface Commands<ReturnType> {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
emoji: string;
|
|
61
|
-
}) => ReturnType;
|
|
59
|
+
drawer: {
|
|
60
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
61
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
}
|
package/lib/MultiColumn.js
CHANGED
package/lib/OrderedList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CSvnpArE.cjs"),n=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CSvnpArE.cjs"),n=require("./RichTextEditor-B_I3q8FW.cjs"),a="listItem",r="textStyle",o=/^(\d+)\.\s$/,d=i.Node.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...s}=t;return e===1?["ol",i.mergeAttributes(this.options.HTMLAttributes,s),0]:["ol",i.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(a,this.editor.getAttributes(r)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=i.wrappingInputRule({find:o,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,s)=>s.childCount+s.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=i.wrappingInputRule({find:o,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(r)}),joinPredicate:(e,s)=>s.childCount+s.attrs.start===+e[1],editor:this.editor})),[t]}}),u=d.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:s})=>({component:n.ActionButton,componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList")||!1,disabled:!1,icon:"ListOrdered",shortcutKeys:["mod","shift","7"],tooltip:s("editor.orderedlist.tooltip")}})}}});exports.OrderedList=u;
|
package/lib/OrderedList.d.cts
CHANGED
|
@@ -110,9 +110,11 @@ declare module '@tiptap/core' {
|
|
|
110
110
|
|
|
111
111
|
declare module '@tiptap/core' {
|
|
112
112
|
interface Commands<ReturnType> {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
emoji: {
|
|
114
|
+
setEmoji: (emoji: {
|
|
115
|
+
name: string;
|
|
116
|
+
emoji: string;
|
|
117
|
+
}) => ReturnType;
|
|
116
118
|
};
|
|
117
119
|
}
|
|
118
120
|
}
|
|
@@ -120,11 +122,9 @@ declare module '@tiptap/core' {
|
|
|
120
122
|
|
|
121
123
|
declare module '@tiptap/core' {
|
|
122
124
|
interface Commands<ReturnType> {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
emoji: string;
|
|
127
|
-
}) => ReturnType;
|
|
125
|
+
drawer: {
|
|
126
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
127
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
}
|
package/lib/OrderedList.d.ts
CHANGED
|
@@ -110,9 +110,11 @@ declare module '@tiptap/core' {
|
|
|
110
110
|
|
|
111
111
|
declare module '@tiptap/core' {
|
|
112
112
|
interface Commands<ReturnType> {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
emoji: {
|
|
114
|
+
setEmoji: (emoji: {
|
|
115
|
+
name: string;
|
|
116
|
+
emoji: string;
|
|
117
|
+
}) => ReturnType;
|
|
116
118
|
};
|
|
117
119
|
}
|
|
118
120
|
}
|
|
@@ -120,11 +122,9 @@ declare module '@tiptap/core' {
|
|
|
120
122
|
|
|
121
123
|
declare module '@tiptap/core' {
|
|
122
124
|
interface Commands<ReturnType> {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
emoji: string;
|
|
127
|
-
}) => ReturnType;
|
|
125
|
+
drawer: {
|
|
126
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
127
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
}
|
package/lib/OrderedList.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { N as a, w as i, m as r } from "./index-BWx1Mchx.js";
|
|
2
|
-
import { A as p } from "./RichTextEditor-
|
|
2
|
+
import { A as p } from "./RichTextEditor-1N7Gl9vo.js";
|
|
3
3
|
const d = "listItem", o = "textStyle", n = /^(\d+)\.\s$/, u = a.create({
|
|
4
4
|
name: "orderedList",
|
|
5
5
|
addOptions() {
|