reactjs-tiptap-editor 0.3.19 → 0.3.21
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-BPq-R8E7.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
- package/lib/{ActionMenuButton-DCACoSG3.js → ActionMenuButton-DXwnYZhJ.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +28 -28
- package/lib/Attachment.d.ts +28 -28
- package/lib/Attachment.js +3 -3
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +28 -28
- package/lib/Blockquote.d.ts +28 -28
- package/lib/Blockquote.js +2 -2
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +28 -28
- package/lib/Bold.d.ts +28 -28
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +28 -28
- package/lib/BulletList.d.ts +28 -28
- package/lib/BulletList.js +2 -2
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +28 -28
- package/lib/Clear.d.ts +28 -28
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +28 -28
- package/lib/Code.d.ts +28 -28
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +28 -28
- package/lib/CodeBlock.d.ts +28 -28
- package/lib/CodeBlock.js +3 -3
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +28 -28
- package/lib/CodeView.d.ts +28 -28
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +28 -28
- package/lib/Color.d.ts +28 -28
- package/lib/Color.js +3 -3
- package/lib/Document.cjs +1 -1
- package/lib/Document.d.cts +28 -28
- package/lib/Document.d.ts +28 -28
- package/lib/Document.js +1 -1
- package/lib/{Drawer-Dwx9V0Xb.cjs → Drawer-BrHHs2E9.cjs} +1 -1
- package/lib/{Drawer-Qh1zEBl3.js → Drawer-CVuwyG50.js} +3 -3
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +28 -28
- package/lib/Drawer.d.ts +28 -28
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +28 -28
- package/lib/Emoji.d.ts +28 -28
- package/lib/Emoji.js +4 -4
- package/lib/{Excalidraw-BP_-zWZH.cjs → Excalidraw-Be_GDV4Q.cjs} +1 -1
- package/lib/{Excalidraw-DD3P3ClH.js → Excalidraw-frMX4K62.js} +3 -3
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +28 -28
- package/lib/Excalidraw.d.ts +28 -28
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +28 -28
- package/lib/ExportPdf.d.ts +28 -28
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +28 -28
- package/lib/ExportWord.d.ts +28 -28
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +28 -28
- package/lib/FontFamily.d.ts +28 -28
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +28 -28
- package/lib/FontSize.d.ts +28 -28
- package/lib/FontSize.js +3 -3
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +28 -28
- package/lib/FormatPainter.d.ts +28 -28
- package/lib/FormatPainter.js +2 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +28 -28
- package/lib/Heading.d.ts +28 -28
- package/lib/Heading.js +3 -3
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +28 -28
- package/lib/Highlight.d.ts +28 -28
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +28 -28
- package/lib/History.d.ts +28 -28
- package/lib/History.js +2 -2
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +28 -28
- package/lib/HorizontalRule.d.ts +28 -28
- package/lib/HorizontalRule.js +2 -2
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +28 -28
- package/lib/Iframe.d.ts +28 -28
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +28 -28
- package/lib/Image.d.ts +28 -28
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +28 -28
- package/lib/ImageGif.d.ts +28 -28
- package/lib/ImageGif.js +3 -3
- package/lib/ImportWord.cjs +74 -74
- package/lib/ImportWord.d.cts +28 -28
- package/lib/ImportWord.d.ts +28 -28
- package/lib/ImportWord.js +5015 -4998
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +28 -28
- package/lib/Indent.d.ts +28 -28
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +28 -28
- package/lib/Italic.d.ts +28 -28
- package/lib/Italic.js +2 -2
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +28 -28
- package/lib/Katex.d.ts +28 -28
- package/lib/Katex.js +4 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +28 -28
- package/lib/LineHeight.d.ts +28 -28
- package/lib/LineHeight.js +2 -2
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +28 -28
- package/lib/Link.d.ts +28 -28
- package/lib/Link.js +2 -2
- package/lib/ListItem.cjs +1 -1
- package/lib/ListItem.d.cts +28 -28
- package/lib/ListItem.d.ts +28 -28
- package/lib/ListItem.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +28 -28
- package/lib/Mention.d.ts +28 -28
- package/lib/Mention.js +123 -91
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +28 -28
- package/lib/Mermaid.d.ts +28 -28
- package/lib/Mermaid.js +4 -4
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +28 -28
- package/lib/MoreMark.d.ts +28 -28
- package/lib/MoreMark.js +3 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +28 -28
- package/lib/MultiColumn.d.ts +28 -28
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +28 -28
- package/lib/OrderedList.d.ts +28 -28
- package/lib/OrderedList.js +2 -2
- package/lib/RichTextEditor-CAxwVWUE.cjs +137 -0
- package/lib/{RichTextEditor-DIvPROxl.js → RichTextEditor-DjTnd5Uu.js} +1607 -1603
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +28 -28
- package/lib/SearchAndReplace.d.ts +28 -28
- package/lib/SearchAndReplace.js +2 -2
- package/lib/Selection.cjs +1 -1
- package/lib/Selection.d.cts +28 -28
- package/lib/Selection.d.ts +28 -28
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +28 -28
- package/lib/SlashCommand.d.ts +28 -28
- package/lib/SlashCommand.js +4 -4
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +28 -28
- package/lib/Strike.d.ts +28 -28
- package/lib/Strike.js +2 -2
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +28 -28
- package/lib/SubAndSuperScript.d.ts +28 -28
- package/lib/SubAndSuperScript.js +3 -3
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +28 -28
- package/lib/Table.d.ts +28 -28
- package/lib/Table.js +2 -2
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +28 -28
- package/lib/TableOfContent.d.ts +28 -28
- package/lib/TableOfContent.js +3 -3
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +28 -28
- package/lib/TaskList.d.ts +28 -28
- package/lib/TaskList.js +37 -33
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +28 -28
- package/lib/TextAlign.d.ts +28 -28
- package/lib/TextAlign.js +2 -2
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +28 -28
- package/lib/TextBubble.d.ts +28 -28
- package/lib/TextBubble.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +28 -28
- package/lib/TextDirection.d.ts +28 -28
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +28 -28
- package/lib/TextUnderline.d.ts +28 -28
- package/lib/TextUnderline.js +2 -2
- package/lib/TrailingNode.cjs +1 -1
- package/lib/TrailingNode.d.cts +28 -28
- package/lib/TrailingNode.d.ts +28 -28
- package/lib/TrailingNode.js +1 -1
- package/lib/{Twitter-Bl5HyIX0.cjs → Twitter-V0OzBT_E.cjs} +1 -1
- package/lib/{Twitter-raSi7ATg.js → Twitter-dRxbZOad.js} +3 -3
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +28 -28
- package/lib/Twitter.d.ts +28 -28
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +28 -28
- package/lib/Video.d.ts +28 -28
- package/lib/Video.js +2 -2
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.d.cts +28 -28
- package/lib/bubble-extra.d.ts +28 -28
- package/lib/bubble-extra.js +25 -25
- package/lib/{dom-dataset-Cuy-pIfj.cjs → dom-dataset-Byuf1YmW.cjs} +5 -5
- package/lib/{dom-dataset-CHDbKz5J.js → dom-dataset-Di3tIRrR.js} +94 -83
- package/lib/index-BI-IcZcN.cjs +1 -0
- package/lib/{index-CSvnpArE.cjs → index-ByRfqzMr.cjs} +2 -2
- package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
- package/lib/index-CbQQFj2T.js +133 -0
- package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
- package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
- package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
- package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +28 -28
- package/lib/index.d.ts +28 -28
- package/lib/index.js +5 -5
- package/lib/locale-bundle.d.cts +28 -28
- package/lib/locale-bundle.d.ts +28 -28
- package/lib/{textarea-DnBlTntN.js → textarea-6c8drwXJ.js} +1 -1
- package/lib/{textarea-DgXP0XRK.cjs → textarea-BsJTSgT-.cjs} +1 -1
- package/package.json +67 -67
- package/lib/RichTextEditor-DszaQdvS.cjs +0 -141
- package/lib/index-Cyh1yoFk.cjs +0 -1
- package/lib/index-oQutU45z.js +0 -129
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
|
}
|
|
@@ -104,21 +104,6 @@ declare module '@tiptap/core' {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
declare module '@tiptap/core' {
|
|
108
|
-
interface Commands<ReturnType> {
|
|
109
|
-
iframe: {
|
|
110
|
-
/**
|
|
111
|
-
* Add an iframe
|
|
112
|
-
*/
|
|
113
|
-
setIframe: (options: {
|
|
114
|
-
src: string;
|
|
115
|
-
service: string;
|
|
116
|
-
}) => ReturnType;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
107
|
declare module '@tiptap/core' {
|
|
123
108
|
interface Commands<ReturnType> {
|
|
124
109
|
imageUpload: {
|
|
@@ -139,6 +124,21 @@ declare module '@tiptap/core' {
|
|
|
139
124
|
}
|
|
140
125
|
|
|
141
126
|
|
|
127
|
+
declare module '@tiptap/core' {
|
|
128
|
+
interface Commands<ReturnType> {
|
|
129
|
+
iframe: {
|
|
130
|
+
/**
|
|
131
|
+
* Add an iframe
|
|
132
|
+
*/
|
|
133
|
+
setIframe: (options: {
|
|
134
|
+
src: string;
|
|
135
|
+
service: string;
|
|
136
|
+
}) => ReturnType;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
142
|
declare module '@tiptap/core' {
|
|
143
143
|
interface Commands<ReturnType> {
|
|
144
144
|
imageGifUpload: {
|
|
@@ -177,8 +177,9 @@ declare module '@tiptap/core' {
|
|
|
177
177
|
|
|
178
178
|
declare module '@tiptap/core' {
|
|
179
179
|
interface Commands<ReturnType> {
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
lineHeight: {
|
|
181
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
182
|
+
unsetLineHeight: () => ReturnType;
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
185
|
}
|
|
@@ -186,9 +187,8 @@ declare module '@tiptap/core' {
|
|
|
186
187
|
|
|
187
188
|
declare module '@tiptap/core' {
|
|
188
189
|
interface Commands<ReturnType> {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
unsetLineHeight: () => ReturnType;
|
|
190
|
+
katex: {
|
|
191
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
}
|
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
|
}
|
|
@@ -104,21 +104,6 @@ declare module '@tiptap/core' {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
declare module '@tiptap/core' {
|
|
108
|
-
interface Commands<ReturnType> {
|
|
109
|
-
iframe: {
|
|
110
|
-
/**
|
|
111
|
-
* Add an iframe
|
|
112
|
-
*/
|
|
113
|
-
setIframe: (options: {
|
|
114
|
-
src: string;
|
|
115
|
-
service: string;
|
|
116
|
-
}) => ReturnType;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
107
|
declare module '@tiptap/core' {
|
|
123
108
|
interface Commands<ReturnType> {
|
|
124
109
|
imageUpload: {
|
|
@@ -139,6 +124,21 @@ declare module '@tiptap/core' {
|
|
|
139
124
|
}
|
|
140
125
|
|
|
141
126
|
|
|
127
|
+
declare module '@tiptap/core' {
|
|
128
|
+
interface Commands<ReturnType> {
|
|
129
|
+
iframe: {
|
|
130
|
+
/**
|
|
131
|
+
* Add an iframe
|
|
132
|
+
*/
|
|
133
|
+
setIframe: (options: {
|
|
134
|
+
src: string;
|
|
135
|
+
service: string;
|
|
136
|
+
}) => ReturnType;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
142
|
declare module '@tiptap/core' {
|
|
143
143
|
interface Commands<ReturnType> {
|
|
144
144
|
imageGifUpload: {
|
|
@@ -177,8 +177,9 @@ declare module '@tiptap/core' {
|
|
|
177
177
|
|
|
178
178
|
declare module '@tiptap/core' {
|
|
179
179
|
interface Commands<ReturnType> {
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
lineHeight: {
|
|
181
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
182
|
+
unsetLineHeight: () => ReturnType;
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
185
|
}
|
|
@@ -186,9 +187,8 @@ declare module '@tiptap/core' {
|
|
|
186
187
|
|
|
187
188
|
declare module '@tiptap/core' {
|
|
188
189
|
interface Commands<ReturnType> {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
unsetLineHeight: () => ReturnType;
|
|
190
|
+
katex: {
|
|
191
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
}
|
package/lib/Mention.js
CHANGED
|
@@ -1,51 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import { N as v, q as L, m as c, a as M } from "./index-DI9T3iLd.js";
|
|
2
|
+
import { S as w } from "./index-CbQQFj2T.js";
|
|
3
|
+
import { c as h, g as f, a as H } from "./dom-dataset-Di3tIRrR.js";
|
|
4
|
+
import S from "tippy.js";
|
|
5
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
6
|
+
import { forwardRef as A, useRef as U, useState as _, useEffect as b, useImperativeHandle as x } from "react";
|
|
7
|
+
import C from "scroll-into-view-if-needed";
|
|
8
|
+
function N({ editor: e, overrideSuggestionOptions: n, extensionName: t, char: r = "@" }) {
|
|
9
|
+
const i = new M();
|
|
10
|
+
return {
|
|
11
|
+
editor: e,
|
|
12
|
+
char: r,
|
|
13
|
+
pluginKey: i,
|
|
14
|
+
command: ({ editor: o, range: l, props: u }) => {
|
|
15
|
+
var a, s, d;
|
|
16
|
+
const p = o.view.state.selection.$to.nodeAfter;
|
|
17
|
+
((a = p == null ? void 0 : p.text) === null || a === void 0 ? void 0 : a.startsWith(" ")) && (l.to += 1), o.chain().focus().insertContentAt(l, [
|
|
18
|
+
{
|
|
19
|
+
type: t,
|
|
20
|
+
attrs: { ...u, mentionSuggestionChar: r }
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: " "
|
|
25
|
+
}
|
|
26
|
+
]).run(), (d = (s = o.view.dom.ownerDocument.defaultView) === null || s === void 0 ? void 0 : s.getSelection()) === null || d === void 0 || d.collapseToEnd();
|
|
27
|
+
},
|
|
28
|
+
allow: ({ state: o, range: l }) => {
|
|
29
|
+
const u = o.doc.resolve(l.from), a = o.schema.nodes[t];
|
|
30
|
+
return !!u.parent.type.contentMatch.matchType(a);
|
|
31
|
+
},
|
|
32
|
+
...n
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function T(e) {
|
|
36
|
+
return (e.options.suggestions.length ? e.options.suggestions : [e.options.suggestion]).map((n) => N({
|
|
37
|
+
// @ts-ignore `editor` can be `undefined` when converting the document to HTML with the HTML utility
|
|
38
|
+
editor: e.editor,
|
|
39
|
+
overrideSuggestionOptions: n,
|
|
40
|
+
extensionName: e.name,
|
|
41
|
+
char: n.char
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
function y(e, n) {
|
|
45
|
+
const t = T(e), r = t.find((i) => i.char === n);
|
|
46
|
+
return r || (t.length ? t[0] : null);
|
|
47
|
+
}
|
|
48
|
+
const R = v.create({
|
|
9
49
|
name: "mention",
|
|
10
50
|
priority: 101,
|
|
11
51
|
addOptions() {
|
|
12
52
|
return {
|
|
13
53
|
HTMLAttributes: {},
|
|
14
|
-
renderText({
|
|
15
|
-
var t;
|
|
16
|
-
return `${
|
|
54
|
+
renderText({ node: e, suggestion: n }) {
|
|
55
|
+
var t, r;
|
|
56
|
+
return `${(t = n == null ? void 0 : n.char) !== null && t !== void 0 ? t : "@"}${(r = e.attrs.label) !== null && r !== void 0 ? r : e.attrs.id}`;
|
|
17
57
|
},
|
|
18
58
|
deleteTriggerWithBackspace: !1,
|
|
19
|
-
renderHTML({ options: e, node: n }) {
|
|
20
|
-
var
|
|
59
|
+
renderHTML({ options: e, node: n, suggestion: t }) {
|
|
60
|
+
var r, i;
|
|
21
61
|
return [
|
|
22
62
|
"span",
|
|
23
63
|
c(this.HTMLAttributes, e.HTMLAttributes),
|
|
24
|
-
`${
|
|
64
|
+
`${(r = t == null ? void 0 : t.char) !== null && r !== void 0 ? r : "@"}${(i = n.attrs.label) !== null && i !== void 0 ? i : n.attrs.id}`
|
|
25
65
|
];
|
|
26
66
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
pluginKey: _,
|
|
30
|
-
command: ({ editor: e, range: n, props: t }) => {
|
|
31
|
-
var r, s, o;
|
|
32
|
-
const a = e.view.state.selection.$to.nodeAfter;
|
|
33
|
-
((r = a == null ? void 0 : a.text) === null || r === void 0 ? void 0 : r.startsWith(" ")) && (n.to += 1), e.chain().focus().insertContentAt(n, [
|
|
34
|
-
{
|
|
35
|
-
type: this.name,
|
|
36
|
-
attrs: t
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
type: "text",
|
|
40
|
-
text: " "
|
|
41
|
-
}
|
|
42
|
-
]).run(), (o = (s = e.view.dom.ownerDocument.defaultView) === null || s === void 0 ? void 0 : s.getSelection()) === null || o === void 0 || o.collapseToEnd();
|
|
43
|
-
},
|
|
44
|
-
allow: ({ state: e, range: n }) => {
|
|
45
|
-
const t = e.doc.resolve(n.from), r = e.schema.nodes[this.name];
|
|
46
|
-
return !!t.parent.type.contentMatch.matchType(r);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
67
|
+
suggestions: [],
|
|
68
|
+
suggestion: {}
|
|
49
69
|
};
|
|
50
70
|
},
|
|
51
71
|
group: "inline",
|
|
@@ -67,6 +87,14 @@ const _ = new b("mention"), x = y.create({
|
|
|
67
87
|
renderHTML: (e) => e.label ? {
|
|
68
88
|
"data-label": e.label
|
|
69
89
|
} : {}
|
|
90
|
+
},
|
|
91
|
+
// When there are multiple types of mentions, this attribute helps distinguish them
|
|
92
|
+
mentionSuggestionChar: {
|
|
93
|
+
default: "@",
|
|
94
|
+
parseHTML: (e) => e.getAttribute("data-mention-suggestion-char"),
|
|
95
|
+
renderHTML: (e) => ({
|
|
96
|
+
"data-mention-suggestion-char": e.mentionSuggestionChar
|
|
97
|
+
})
|
|
70
98
|
}
|
|
71
99
|
};
|
|
72
100
|
},
|
|
@@ -78,88 +106,92 @@ const _ = new b("mention"), x = y.create({
|
|
|
78
106
|
];
|
|
79
107
|
},
|
|
80
108
|
renderHTML({ node: e, HTMLAttributes: n }) {
|
|
109
|
+
const t = y(this, e.attrs.mentionSuggestionChar);
|
|
81
110
|
if (this.options.renderLabel !== void 0)
|
|
82
111
|
return console.warn("renderLabel is deprecated use renderText and renderHTML instead"), [
|
|
83
112
|
"span",
|
|
84
113
|
c({ "data-type": this.name }, this.options.HTMLAttributes, n),
|
|
85
114
|
this.options.renderLabel({
|
|
86
115
|
options: this.options,
|
|
87
|
-
node: e
|
|
116
|
+
node: e,
|
|
117
|
+
suggestion: t
|
|
88
118
|
})
|
|
89
119
|
];
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
options:
|
|
94
|
-
node: e
|
|
120
|
+
const r = { ...this.options };
|
|
121
|
+
r.HTMLAttributes = c({ "data-type": this.name }, this.options.HTMLAttributes, n);
|
|
122
|
+
const i = this.options.renderHTML({
|
|
123
|
+
options: r,
|
|
124
|
+
node: e,
|
|
125
|
+
suggestion: t
|
|
95
126
|
});
|
|
96
|
-
return typeof
|
|
127
|
+
return typeof i == "string" ? [
|
|
97
128
|
"span",
|
|
98
129
|
c({ "data-type": this.name }, this.options.HTMLAttributes, n),
|
|
99
|
-
|
|
100
|
-
] :
|
|
130
|
+
i
|
|
131
|
+
] : i;
|
|
101
132
|
},
|
|
102
133
|
renderText({ node: e }) {
|
|
103
|
-
|
|
134
|
+
const n = {
|
|
104
135
|
options: this.options,
|
|
105
|
-
node: e
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
136
|
+
node: e,
|
|
137
|
+
suggestion: y(this, e.attrs.mentionSuggestionChar)
|
|
138
|
+
};
|
|
139
|
+
return this.options.renderLabel !== void 0 ? (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel(n)) : this.options.renderText(n);
|
|
110
140
|
},
|
|
111
141
|
addKeyboardShortcuts() {
|
|
112
142
|
return {
|
|
113
143
|
Backspace: () => this.editor.commands.command(({ tr: e, state: n }) => {
|
|
114
144
|
let t = !1;
|
|
115
|
-
const { selection: r } = n, { empty:
|
|
116
|
-
|
|
145
|
+
const { selection: r } = n, { empty: i, anchor: o } = r;
|
|
146
|
+
if (!i)
|
|
147
|
+
return !1;
|
|
148
|
+
n.doc.nodesBetween(o - 1, o, (a, s) => {
|
|
149
|
+
if (a.type.name === this.name)
|
|
150
|
+
return t = !0, e.insertText(this.options.deleteTriggerWithBackspace ? "" : this.options.suggestion.char || "", s, s + a.nodeSize), !1;
|
|
151
|
+
});
|
|
152
|
+
let l = new L(), u = 0;
|
|
153
|
+
return n.doc.nodesBetween(o - 1, o, (a, s) => {
|
|
117
154
|
if (a.type.name === this.name)
|
|
118
|
-
return t = !0,
|
|
119
|
-
}), t
|
|
155
|
+
return t = !0, l = a, u = s, !1;
|
|
156
|
+
}), t && e.insertText(this.options.deleteTriggerWithBackspace ? "" : l.attrs.mentionSuggestionChar, u, u + l.nodeSize), t;
|
|
120
157
|
})
|
|
121
158
|
};
|
|
122
159
|
},
|
|
123
160
|
addProseMirrorPlugins() {
|
|
124
|
-
return
|
|
125
|
-
T({
|
|
126
|
-
editor: this.editor,
|
|
127
|
-
...this.options.suggestion
|
|
128
|
-
})
|
|
129
|
-
];
|
|
161
|
+
return T(this).map(w);
|
|
130
162
|
}
|
|
131
|
-
}),
|
|
132
|
-
listUsers:
|
|
133
|
-
itemUser:
|
|
134
|
-
selectedUser:
|
|
135
|
-
},
|
|
136
|
-
const t =
|
|
137
|
-
const d = e.items[
|
|
163
|
+
}), $ = "_listUsers_en3pm_1", k = "_itemUser_en3pm_10", D = "_selectedUser_en3pm_31", g = {
|
|
164
|
+
listUsers: $,
|
|
165
|
+
itemUser: k,
|
|
166
|
+
selectedUser: D
|
|
167
|
+
}, E = A((e, n) => {
|
|
168
|
+
const t = U(null), [r, i] = _(0), o = (s) => {
|
|
169
|
+
const d = e.items[s];
|
|
138
170
|
d && e.command({ id: d, label: d });
|
|
139
|
-
}, a = () => {
|
|
140
|
-
s((r + e.items.length - 1) % e.items.length);
|
|
141
171
|
}, l = () => {
|
|
142
|
-
|
|
143
|
-
},
|
|
172
|
+
i((r + e.items.length - 1) % e.items.length);
|
|
173
|
+
}, u = () => {
|
|
174
|
+
i((r + 1) % e.items.length);
|
|
175
|
+
}, a = () => {
|
|
144
176
|
o(r);
|
|
145
177
|
};
|
|
146
|
-
return
|
|
178
|
+
return b(() => i(0), [e.items]), b(() => {
|
|
147
179
|
if (Number.isNaN(r + 1))
|
|
148
180
|
return;
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
}, [r]),
|
|
152
|
-
onKeyDown: ({ event:
|
|
153
|
-
})), /* @__PURE__ */
|
|
181
|
+
const s = t.current.querySelector(`span:nth-of-type(${r + 1})`);
|
|
182
|
+
s && C(s, { behavior: "smooth", scrollMode: "if-needed" });
|
|
183
|
+
}, [r]), x(n, () => ({
|
|
184
|
+
onKeyDown: ({ event: s }) => s.key === "ArrowUp" ? (l(), !0) : s.key === "ArrowDown" ? (u(), !0) : s.key === "Enter" ? (a(), !0) : !1
|
|
185
|
+
})), /* @__PURE__ */ m("div", { className: h("listUsers", g.listUsers), children: /* @__PURE__ */ m("div", { ref: t, children: e.items.length > 0 ? e.items.map((s, d) => /* @__PURE__ */ m(
|
|
154
186
|
"span",
|
|
155
187
|
{
|
|
156
|
-
className:
|
|
188
|
+
className: h("itemUser", g.itemUser, d === r ? g.selectedUser : ""),
|
|
157
189
|
onClick: () => o(d),
|
|
158
|
-
children:
|
|
190
|
+
children: s
|
|
159
191
|
},
|
|
160
192
|
d
|
|
161
|
-
)) : /* @__PURE__ */
|
|
162
|
-
}),
|
|
193
|
+
)) : /* @__PURE__ */ m("div", { className: h("itemUserEmpty", g.itemUser), children: "Empty" }) }) });
|
|
194
|
+
}), B = [
|
|
163
195
|
{
|
|
164
196
|
id: "1",
|
|
165
197
|
name: "John Doe"
|
|
@@ -176,16 +208,16 @@ const _ = new b("mention"), x = y.create({
|
|
|
176
208
|
id: "4",
|
|
177
209
|
name: "Bob"
|
|
178
210
|
}
|
|
179
|
-
],
|
|
180
|
-
items: async ({ query: e }) =>
|
|
211
|
+
], K = {
|
|
212
|
+
items: async ({ query: e }) => B.map((t) => t.name).filter((t) => t.toLowerCase().startsWith(e.toLowerCase())),
|
|
181
213
|
render: () => {
|
|
182
214
|
let e, n;
|
|
183
215
|
return {
|
|
184
216
|
onStart: (t) => {
|
|
185
|
-
e = new
|
|
217
|
+
e = new H(E, {
|
|
186
218
|
props: t,
|
|
187
219
|
editor: t.editor
|
|
188
|
-
}), n =
|
|
220
|
+
}), n = S("body", {
|
|
189
221
|
getReferenceClientRect: t.clientRect,
|
|
190
222
|
appendTo: () => document.body,
|
|
191
223
|
content: e.element,
|
|
@@ -209,16 +241,16 @@ const _ = new b("mention"), x = y.create({
|
|
|
209
241
|
}
|
|
210
242
|
};
|
|
211
243
|
}
|
|
212
|
-
},
|
|
244
|
+
}, j = /* @__PURE__ */ R.extend({
|
|
213
245
|
addAttributes() {
|
|
214
246
|
return {
|
|
215
247
|
id: {
|
|
216
248
|
default: "",
|
|
217
|
-
parseHTML:
|
|
249
|
+
parseHTML: f("id")
|
|
218
250
|
},
|
|
219
251
|
label: {
|
|
220
252
|
default: "",
|
|
221
|
-
parseHTML:
|
|
253
|
+
parseHTML: f("label")
|
|
222
254
|
}
|
|
223
255
|
};
|
|
224
256
|
}
|
|
@@ -226,8 +258,8 @@ const _ = new b("mention"), x = y.create({
|
|
|
226
258
|
HTMLAttributes: {
|
|
227
259
|
class: "mention"
|
|
228
260
|
},
|
|
229
|
-
suggestion:
|
|
261
|
+
suggestion: K
|
|
230
262
|
});
|
|
231
263
|
export {
|
|
232
|
-
|
|
264
|
+
j as Mention
|
|
233
265
|
};
|
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-
|
|
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-ByRfqzMr.cjs"),u=require("./RichTextEditor-CAxwVWUE.cjs"),F=require("./dom-dataset-Byuf1YmW.cjs"),o=require("react/jsx-runtime"),s=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-BsJTSgT-.cjs"),S=require("./index-C19MB4Al.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
|
}
|
|
@@ -176,21 +176,6 @@ declare module '@tiptap/core' {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
declare module '@tiptap/core' {
|
|
180
|
-
interface Commands<ReturnType> {
|
|
181
|
-
iframe: {
|
|
182
|
-
/**
|
|
183
|
-
* Add an iframe
|
|
184
|
-
*/
|
|
185
|
-
setIframe: (options: {
|
|
186
|
-
src: string;
|
|
187
|
-
service: string;
|
|
188
|
-
}) => ReturnType;
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
179
|
declare module '@tiptap/core' {
|
|
195
180
|
interface Commands<ReturnType> {
|
|
196
181
|
imageUpload: {
|
|
@@ -211,6 +196,21 @@ declare module '@tiptap/core' {
|
|
|
211
196
|
}
|
|
212
197
|
|
|
213
198
|
|
|
199
|
+
declare module '@tiptap/core' {
|
|
200
|
+
interface Commands<ReturnType> {
|
|
201
|
+
iframe: {
|
|
202
|
+
/**
|
|
203
|
+
* Add an iframe
|
|
204
|
+
*/
|
|
205
|
+
setIframe: (options: {
|
|
206
|
+
src: string;
|
|
207
|
+
service: string;
|
|
208
|
+
}) => ReturnType;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
214
|
declare module '@tiptap/core' {
|
|
215
215
|
interface Commands<ReturnType> {
|
|
216
216
|
imageGifUpload: {
|
|
@@ -249,8 +249,9 @@ declare module '@tiptap/core' {
|
|
|
249
249
|
|
|
250
250
|
declare module '@tiptap/core' {
|
|
251
251
|
interface Commands<ReturnType> {
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
lineHeight: {
|
|
253
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
254
|
+
unsetLineHeight: () => ReturnType;
|
|
254
255
|
};
|
|
255
256
|
}
|
|
256
257
|
}
|
|
@@ -258,9 +259,8 @@ declare module '@tiptap/core' {
|
|
|
258
259
|
|
|
259
260
|
declare module '@tiptap/core' {
|
|
260
261
|
interface Commands<ReturnType> {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
unsetLineHeight: () => ReturnType;
|
|
262
|
+
katex: {
|
|
263
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
266
|
}
|