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/Video.d.cts
CHANGED
|
@@ -145,9 +145,11 @@ declare module '@tiptap/core' {
|
|
|
145
145
|
|
|
146
146
|
declare module '@tiptap/core' {
|
|
147
147
|
interface Commands<ReturnType> {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
emoji: {
|
|
149
|
+
setEmoji: (emoji: {
|
|
150
|
+
name: string;
|
|
151
|
+
emoji: string;
|
|
152
|
+
}) => ReturnType;
|
|
151
153
|
};
|
|
152
154
|
}
|
|
153
155
|
}
|
|
@@ -155,11 +157,9 @@ declare module '@tiptap/core' {
|
|
|
155
157
|
|
|
156
158
|
declare module '@tiptap/core' {
|
|
157
159
|
interface Commands<ReturnType> {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
emoji: string;
|
|
162
|
-
}) => ReturnType;
|
|
160
|
+
drawer: {
|
|
161
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
162
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -210,21 +210,6 @@ declare module '@tiptap/core' {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
|
|
213
|
-
declare module '@tiptap/core' {
|
|
214
|
-
interface Commands<ReturnType> {
|
|
215
|
-
iframe: {
|
|
216
|
-
/**
|
|
217
|
-
* Add an iframe
|
|
218
|
-
*/
|
|
219
|
-
setIframe: (options: {
|
|
220
|
-
src: string;
|
|
221
|
-
service: string;
|
|
222
|
-
}) => ReturnType;
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
213
|
declare module '@tiptap/core' {
|
|
229
214
|
interface Commands<ReturnType> {
|
|
230
215
|
imageUpload: {
|
|
@@ -245,6 +230,21 @@ declare module '@tiptap/core' {
|
|
|
245
230
|
}
|
|
246
231
|
|
|
247
232
|
|
|
233
|
+
declare module '@tiptap/core' {
|
|
234
|
+
interface Commands<ReturnType> {
|
|
235
|
+
iframe: {
|
|
236
|
+
/**
|
|
237
|
+
* Add an iframe
|
|
238
|
+
*/
|
|
239
|
+
setIframe: (options: {
|
|
240
|
+
src: string;
|
|
241
|
+
service: string;
|
|
242
|
+
}) => ReturnType;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
248
|
declare module '@tiptap/core' {
|
|
249
249
|
interface Commands<ReturnType> {
|
|
250
250
|
imageGifUpload: {
|
|
@@ -283,8 +283,9 @@ declare module '@tiptap/core' {
|
|
|
283
283
|
|
|
284
284
|
declare module '@tiptap/core' {
|
|
285
285
|
interface Commands<ReturnType> {
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
lineHeight: {
|
|
287
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
288
|
+
unsetLineHeight: () => ReturnType;
|
|
288
289
|
};
|
|
289
290
|
}
|
|
290
291
|
}
|
|
@@ -292,9 +293,8 @@ declare module '@tiptap/core' {
|
|
|
292
293
|
|
|
293
294
|
declare module '@tiptap/core' {
|
|
294
295
|
interface Commands<ReturnType> {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
unsetLineHeight: () => ReturnType;
|
|
296
|
+
katex: {
|
|
297
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
}
|
package/lib/Video.d.ts
CHANGED
|
@@ -145,9 +145,11 @@ declare module '@tiptap/core' {
|
|
|
145
145
|
|
|
146
146
|
declare module '@tiptap/core' {
|
|
147
147
|
interface Commands<ReturnType> {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
emoji: {
|
|
149
|
+
setEmoji: (emoji: {
|
|
150
|
+
name: string;
|
|
151
|
+
emoji: string;
|
|
152
|
+
}) => ReturnType;
|
|
151
153
|
};
|
|
152
154
|
}
|
|
153
155
|
}
|
|
@@ -155,11 +157,9 @@ declare module '@tiptap/core' {
|
|
|
155
157
|
|
|
156
158
|
declare module '@tiptap/core' {
|
|
157
159
|
interface Commands<ReturnType> {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
emoji: string;
|
|
162
|
-
}) => ReturnType;
|
|
160
|
+
drawer: {
|
|
161
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
162
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -210,21 +210,6 @@ declare module '@tiptap/core' {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
|
|
213
|
-
declare module '@tiptap/core' {
|
|
214
|
-
interface Commands<ReturnType> {
|
|
215
|
-
iframe: {
|
|
216
|
-
/**
|
|
217
|
-
* Add an iframe
|
|
218
|
-
*/
|
|
219
|
-
setIframe: (options: {
|
|
220
|
-
src: string;
|
|
221
|
-
service: string;
|
|
222
|
-
}) => ReturnType;
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
213
|
declare module '@tiptap/core' {
|
|
229
214
|
interface Commands<ReturnType> {
|
|
230
215
|
imageUpload: {
|
|
@@ -245,6 +230,21 @@ declare module '@tiptap/core' {
|
|
|
245
230
|
}
|
|
246
231
|
|
|
247
232
|
|
|
233
|
+
declare module '@tiptap/core' {
|
|
234
|
+
interface Commands<ReturnType> {
|
|
235
|
+
iframe: {
|
|
236
|
+
/**
|
|
237
|
+
* Add an iframe
|
|
238
|
+
*/
|
|
239
|
+
setIframe: (options: {
|
|
240
|
+
src: string;
|
|
241
|
+
service: string;
|
|
242
|
+
}) => ReturnType;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
248
|
declare module '@tiptap/core' {
|
|
249
249
|
interface Commands<ReturnType> {
|
|
250
250
|
imageGifUpload: {
|
|
@@ -283,8 +283,9 @@ declare module '@tiptap/core' {
|
|
|
283
283
|
|
|
284
284
|
declare module '@tiptap/core' {
|
|
285
285
|
interface Commands<ReturnType> {
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
lineHeight: {
|
|
287
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
288
|
+
unsetLineHeight: () => ReturnType;
|
|
288
289
|
};
|
|
289
290
|
}
|
|
290
291
|
}
|
|
@@ -292,9 +293,8 @@ declare module '@tiptap/core' {
|
|
|
292
293
|
|
|
293
294
|
declare module '@tiptap/core' {
|
|
294
295
|
interface Commands<ReturnType> {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
unsetLineHeight: () => ReturnType;
|
|
296
|
+
katex: {
|
|
297
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
}
|
package/lib/Video.js
CHANGED
package/lib/bubble-extra.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var V=Object.create;var q=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of G(n))!J.call(e,i)&&i!==s&&q(e,i,{get:()=>n[i],enumerable:!(c=_(n,i))||c.enumerable});return e};var X=(e,n,s)=>(s=e!=null?V(Z(e)):{},Q(n||!e||!e.__esModule?q(s,"default",{value:e,enumerable:!0}):s,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),k=require("./dom-dataset-
|
|
2
|
-
a-->b`,ee=({editor:e,attrs:n,extension:s})=>{const{alt:c,align:i}=n,[r,l]=a.useState(decodeURIComponent(c??$)),[u,x]=a.useState(""),[f,b]=a.useState(!1),p=a.useRef(null),[g,y]=a.useState(null),S=s==null?void 0:s.options.upload,I=a.useCallback(w=>{w&&import("mermaid").then(j=>{y(j.default)})},[]),T=async w=>{try{const{svg:j}=await g.render("mermaid-svg",w);x(j)}catch{x("")}},N=()=>{g.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),T(r)};a.useEffect(()=>{g&&f&&N()},[g,f]),a.useEffect(()=>{g&&f&&T(r)},[g,r]);const A=async()=>{if(r!==""){if(r){const w=p.current.querySelector("svg"),{width:j,height:z}=w.getBoundingClientRect(),m=`mermaid-${E.shortId()}.svg`;let d=E.i(w.outerHTML);if(S){const h=o.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:z},!!r).run(),e==null||e.commands.setAlignImageMermaid(i)}b(!1)}};return t.jsxs(o.Dialog,{onOpenChange:b,open:f,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>b(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:I,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(H.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:w=>l(w.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:p,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:A,type:"button",children:"Save changes"})})]})]})};function K(e,n){const[s,c]=a.useState(void 0);return a.useEffect(()=>{const i=()=>{const r=e.extensionManager.extensions.find(l=>l.name===n);r&&c(r)};return e.on("selectionUpdate",i),e.on("transaction",i),()=>{e.off("selectionUpdate",i),e.off("transaction",i)}},[e,n]),s}const te={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function re({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function ne(e){return e.type.name==="mermaid"}function ie(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,L.Mermaid.name),c=K(e.editor,L.Mermaid.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(ne(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleMermaid(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:te,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(ee,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-mermaid-${u}`):t.jsx(re,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function se(e){const n=e.options.element;v.has("width")||v.set("width",n.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",n.clientWidth);const s={attributes:!0,childList:!0,subtree:!0},c=function(){v.set("width",n.clientWidth)},i=new MutationObserver(c);return i.observe(n,s),e.on("destroy",()=>{i.disconnect()}),{width:v.get("width")}}function oe({editor:e}){const{t:n}=D.useLocale(),{width:s}=se(e),c=o.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:i,createUser:r,width:l,height:u}=c,x=a.useCallback(g=>{e.chain().updateAttributes(M.Excalidraw.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=a.useCallback(()=>{M.triggerOpenExcalidrawSettingModal({...c,editor:e})},[e,c]),b=a.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),p=a.useCallback(()=>o.deleteNode(M.Excalidraw.name,e),[e]);return a.useEffect(()=>{i&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,i,e,f]),t.jsx(k.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:b,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:t.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[t.jsx(o.ActionButton,{icon:"Pencil",action:f,tooltip:n("editor.edit")}),t.jsx(o.SizeSetter,{width:l,maxWidth:s,height:u,onOk:x,children:t.jsx(o.ActionButton,{icon:"Settings",tooltip:n("editor.settings")})}),t.jsx(o.ActionButton,{icon:"Trash2",action:p,tooltip:n("editor.delete")})]})})}function ae({editor:e,disabled:n}){const[s,c]=a.useState(!1),{t:i}=D.useLocale(),r=a.useCallback(({editor:x})=>x.isActive(W.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),c(!1)},u=a.useCallback(()=>o.deleteNode(W.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e,shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{c(!1)}},children:n?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:s?t.jsx(W.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(o.ActionButton,{icon:"Pencil",tooltip:i("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{c(!0)}}),t.jsx(o.ActionButton,{action:u,icon:"Trash",tooltip:i("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function ce({editor:e,...n}){const s=o.useAttributes(e,B.Katex.name,{text:"",defaultShowPicker:!1}),{text:c,defaultShowPicker:i}=s,[r,l]=a.useState(""),[u,x]=a.useState(!1),f=a.useCallback(()=>e.isActive(B.Katex.name),[e]),b=a.useCallback(()=>o.deleteNode(B.Katex.name,e),[e]),p=a.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);a.useEffect(()=>{i&&(x(!0),e.chain().updateAttributes(B.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,i,x]),a.useEffect(()=>{u&&l(c||"")},[u]);const g=a.useMemo(()=>{try{return Y.renderToString(`${r}`)}catch{return r}},[r]),y=a.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:g||""}}):null,[r,g]);return t.jsx(k.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{x(!1)}},children:n!=null&&n.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(H.Textarea,{autoFocus:!0,defaultValue:c,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(o.Button,{className:"richtext-flex-1",onClick:p,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(F.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(o.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(F.Pencil,{size:16})}),t.jsx(o.ActionButton,{action:b,tooltip:"Delete",children:t.jsx(F.Trash2,{size:16})})]})})})}let C=!1;function le({editor:e,attrs:n,extension:s}){const[c,i]=a.useState(!1),r=a.useRef(null),l=a.useRef(null),{alt:u,align:x}=n,f=s==null?void 0:s.options.upload,b=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};a.useEffect(()=>{c&&setTimeout(()=>{b()},200)},[c]);const p=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${E.shortId()}.svg`;let P=E.i(m.outerHTML);if(f){const U=o.dataURLtoFile(P,h);P=await f(U)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}i(!1)},g=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},I=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},T=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},A=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},w=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},z=()=>{if(!C){for(;r.current.history.undoStackSize>0;)w();C=!0}};return t.jsxs(o.Dialog,{onOpenChange:i,open:c,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>i(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(O.ControlDrawer,{changeBorderColorShape:A,changeColorShape:T,changeShape:I,onClear:z,onRedo:j,onThicknessChange:N,onUndo:w,refEditor:r,setColorHighlight:S,setColorPen:g,setThicknessPen:y})]}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:p,type:"button",children:"Save changes"})})]})]})}const de={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function ue({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function he(e){return e.type.name==="drawer"}function xe(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,O.Drawer.name),c=K(e.editor,O.Drawer.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(he(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleDrawer(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:de,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(le,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-drawer-${u}`):t.jsx(ue,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})})}exports.BubbleMenuDrawer=xe;exports.BubbleMenuExcalidraw=oe;exports.BubbleMenuKatex=ce;exports.BubbleMenuMermaid=ie;exports.BubbleMenuTwitter=ae;
|
|
1
|
+
"use strict";var V=Object.create;var q=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of G(n))!J.call(e,i)&&i!==s&&q(e,i,{get:()=>n[i],enumerable:!(c=_(n,i))||c.enumerable});return e};var X=(e,n,s)=>(s=e!=null?V(Z(e)):{},Q(n||!e||!e.__esModule?q(s,"default",{value:e,enumerable:!0}):s,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),k=require("./dom-dataset-Byuf1YmW.cjs"),o=require("./RichTextEditor-CAxwVWUE.cjs"),L=require("./Mermaid.cjs"),E=require("./shortId-Bfj8TyNr.cjs"),H=require("./textarea-BsJTSgT-.cjs"),D=require("./index-C19MB4Al.cjs"),M=require("./Excalidraw-Be_GDV4Q.cjs"),W=require("./Twitter-V0OzBT_E.cjs"),Y=require("katex"),F=require("lucide-react"),B=require("./Katex.cjs"),O=require("./Drawer-BrHHs2E9.cjs"),R=require("easydrawer"),$=`graph TB
|
|
2
|
+
a-->b`,ee=({editor:e,attrs:n,extension:s})=>{const{alt:c,align:i}=n,[r,l]=a.useState(decodeURIComponent(c??$)),[u,x]=a.useState(""),[f,b]=a.useState(!1),p=a.useRef(null),[g,y]=a.useState(null),S=s==null?void 0:s.options.upload,I=a.useCallback(w=>{w&&import("mermaid").then(j=>{y(j.default)})},[]),T=async w=>{try{const{svg:j}=await g.render("mermaid-svg",w);x(j)}catch{x("")}},N=()=>{g.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),T(r)};a.useEffect(()=>{g&&f&&N()},[g,f]),a.useEffect(()=>{g&&f&&T(r)},[g,r]);const A=async()=>{if(r!==""){if(r){const w=p.current.querySelector("svg"),{width:j,height:z}=w.getBoundingClientRect(),m=`mermaid-${E.shortId()}.svg`;let d=E.i(w.outerHTML);if(S){const h=o.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:z},!!r).run(),e==null||e.commands.setAlignImageMermaid(i)}b(!1)}};return t.jsxs(o.Dialog,{onOpenChange:b,open:f,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>b(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:I,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(H.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:w=>l(w.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:p,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:A,type:"button",children:"Save changes"})})]})]})};function K(e,n){const[s,c]=a.useState(void 0);return a.useEffect(()=>{const i=()=>{const r=e.extensionManager.extensions.find(l=>l.name===n);r&&c(r)};return e.on("selectionUpdate",i),e.on("transaction",i),()=>{e.off("selectionUpdate",i),e.off("transaction",i)}},[e,n]),s}const te={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function re({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function ne(e){return e.type.name==="mermaid"}function ie(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,L.Mermaid.name),c=K(e.editor,L.Mermaid.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(ne(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleMermaid(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:te,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(ee,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-mermaid-${u}`):t.jsx(re,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function se(e){const n=e.options.element;v.has("width")||v.set("width",n.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",n.clientWidth);const s={attributes:!0,childList:!0,subtree:!0},c=function(){v.set("width",n.clientWidth)},i=new MutationObserver(c);return i.observe(n,s),e.on("destroy",()=>{i.disconnect()}),{width:v.get("width")}}function oe({editor:e}){const{t:n}=D.useLocale(),{width:s}=se(e),c=o.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:i,createUser:r,width:l,height:u}=c,x=a.useCallback(g=>{e.chain().updateAttributes(M.Excalidraw.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=a.useCallback(()=>{M.triggerOpenExcalidrawSettingModal({...c,editor:e})},[e,c]),b=a.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),p=a.useCallback(()=>o.deleteNode(M.Excalidraw.name,e),[e]);return a.useEffect(()=>{i&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,i,e,f]),t.jsx(k.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:b,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:t.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[t.jsx(o.ActionButton,{icon:"Pencil",action:f,tooltip:n("editor.edit")}),t.jsx(o.SizeSetter,{width:l,maxWidth:s,height:u,onOk:x,children:t.jsx(o.ActionButton,{icon:"Settings",tooltip:n("editor.settings")})}),t.jsx(o.ActionButton,{icon:"Trash2",action:p,tooltip:n("editor.delete")})]})})}function ae({editor:e,disabled:n}){const[s,c]=a.useState(!1),{t:i}=D.useLocale(),r=a.useCallback(({editor:x})=>x.isActive(W.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),c(!1)},u=a.useCallback(()=>o.deleteNode(W.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e,shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{c(!1)}},children:n?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:s?t.jsx(W.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(o.ActionButton,{icon:"Pencil",tooltip:i("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{c(!0)}}),t.jsx(o.ActionButton,{action:u,icon:"Trash",tooltip:i("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function ce({editor:e,...n}){const s=o.useAttributes(e,B.Katex.name,{text:"",defaultShowPicker:!1}),{text:c,defaultShowPicker:i}=s,[r,l]=a.useState(""),[u,x]=a.useState(!1),f=a.useCallback(()=>e.isActive(B.Katex.name),[e]),b=a.useCallback(()=>o.deleteNode(B.Katex.name,e),[e]),p=a.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);a.useEffect(()=>{i&&(x(!0),e.chain().updateAttributes(B.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,i,x]),a.useEffect(()=>{u&&l(c||"")},[u]);const g=a.useMemo(()=>{try{return Y.renderToString(`${r}`)}catch{return r}},[r]),y=a.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:g||""}}):null,[r,g]);return t.jsx(k.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{x(!1)}},children:n!=null&&n.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(H.Textarea,{autoFocus:!0,defaultValue:c,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(o.Button,{className:"richtext-flex-1",onClick:p,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(F.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(o.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(F.Pencil,{size:16})}),t.jsx(o.ActionButton,{action:b,tooltip:"Delete",children:t.jsx(F.Trash2,{size:16})})]})})})}let C=!1;function le({editor:e,attrs:n,extension:s}){const[c,i]=a.useState(!1),r=a.useRef(null),l=a.useRef(null),{alt:u,align:x}=n,f=s==null?void 0:s.options.upload,b=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};a.useEffect(()=>{c&&setTimeout(()=>{b()},200)},[c]);const p=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${E.shortId()}.svg`;let P=E.i(m.outerHTML);if(f){const U=o.dataURLtoFile(P,h);P=await f(U)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}i(!1)},g=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},I=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},T=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},A=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},w=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},z=()=>{if(!C){for(;r.current.history.undoStackSize>0;)w();C=!0}};return t.jsxs(o.Dialog,{onOpenChange:i,open:c,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>i(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(O.ControlDrawer,{changeBorderColorShape:A,changeColorShape:T,changeShape:I,onClear:z,onRedo:j,onThicknessChange:N,onUndo:w,refEditor:r,setColorHighlight:S,setColorPen:g,setThicknessPen:y})]}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:p,type:"button",children:"Save changes"})})]})]})}const de={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function ue({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function he(e){return e.type.name==="drawer"}function xe(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,O.Drawer.name),c=K(e.editor,O.Drawer.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(he(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleDrawer(e.editor),[e.disabled,e.editor,n]);return t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:de,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(le,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-drawer-${u}`):t.jsx(ue,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})}exports.BubbleMenuDrawer=xe;exports.BubbleMenuExcalidraw=oe;exports.BubbleMenuKatex=ce;exports.BubbleMenuMermaid=ie;exports.BubbleMenuTwitter=ae;
|
package/lib/bubble-extra.d.cts
CHANGED
|
@@ -61,9 +61,11 @@ declare module '@tiptap/core' {
|
|
|
61
61
|
|
|
62
62
|
declare module '@tiptap/core' {
|
|
63
63
|
interface Commands<ReturnType> {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
emoji: {
|
|
65
|
+
setEmoji: (emoji: {
|
|
66
|
+
name: string;
|
|
67
|
+
emoji: string;
|
|
68
|
+
}) => ReturnType;
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -71,11 +73,9 @@ declare module '@tiptap/core' {
|
|
|
71
73
|
|
|
72
74
|
declare module '@tiptap/core' {
|
|
73
75
|
interface Commands<ReturnType> {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
emoji: string;
|
|
78
|
-
}) => ReturnType;
|
|
76
|
+
drawer: {
|
|
77
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
78
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -126,21 +126,6 @@ declare module '@tiptap/core' {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
declare module '@tiptap/core' {
|
|
130
|
-
interface Commands<ReturnType> {
|
|
131
|
-
iframe: {
|
|
132
|
-
/**
|
|
133
|
-
* Add an iframe
|
|
134
|
-
*/
|
|
135
|
-
setIframe: (options: {
|
|
136
|
-
src: string;
|
|
137
|
-
service: string;
|
|
138
|
-
}) => ReturnType;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
129
|
declare module '@tiptap/core' {
|
|
145
130
|
interface Commands<ReturnType> {
|
|
146
131
|
imageUpload: {
|
|
@@ -161,6 +146,21 @@ declare module '@tiptap/core' {
|
|
|
161
146
|
}
|
|
162
147
|
|
|
163
148
|
|
|
149
|
+
declare module '@tiptap/core' {
|
|
150
|
+
interface Commands<ReturnType> {
|
|
151
|
+
iframe: {
|
|
152
|
+
/**
|
|
153
|
+
* Add an iframe
|
|
154
|
+
*/
|
|
155
|
+
setIframe: (options: {
|
|
156
|
+
src: string;
|
|
157
|
+
service: string;
|
|
158
|
+
}) => ReturnType;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
164
|
declare module '@tiptap/core' {
|
|
165
165
|
interface Commands<ReturnType> {
|
|
166
166
|
imageGifUpload: {
|
|
@@ -199,8 +199,9 @@ declare module '@tiptap/core' {
|
|
|
199
199
|
|
|
200
200
|
declare module '@tiptap/core' {
|
|
201
201
|
interface Commands<ReturnType> {
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
lineHeight: {
|
|
203
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
204
|
+
unsetLineHeight: () => ReturnType;
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
207
|
}
|
|
@@ -208,9 +209,8 @@ declare module '@tiptap/core' {
|
|
|
208
209
|
|
|
209
210
|
declare module '@tiptap/core' {
|
|
210
211
|
interface Commands<ReturnType> {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
unsetLineHeight: () => ReturnType;
|
|
212
|
+
katex: {
|
|
213
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
}
|
package/lib/bubble-extra.d.ts
CHANGED
|
@@ -61,9 +61,11 @@ declare module '@tiptap/core' {
|
|
|
61
61
|
|
|
62
62
|
declare module '@tiptap/core' {
|
|
63
63
|
interface Commands<ReturnType> {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
emoji: {
|
|
65
|
+
setEmoji: (emoji: {
|
|
66
|
+
name: string;
|
|
67
|
+
emoji: string;
|
|
68
|
+
}) => ReturnType;
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -71,11 +73,9 @@ declare module '@tiptap/core' {
|
|
|
71
73
|
|
|
72
74
|
declare module '@tiptap/core' {
|
|
73
75
|
interface Commands<ReturnType> {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
emoji: string;
|
|
78
|
-
}) => ReturnType;
|
|
76
|
+
drawer: {
|
|
77
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
78
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -126,21 +126,6 @@ declare module '@tiptap/core' {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
declare module '@tiptap/core' {
|
|
130
|
-
interface Commands<ReturnType> {
|
|
131
|
-
iframe: {
|
|
132
|
-
/**
|
|
133
|
-
* Add an iframe
|
|
134
|
-
*/
|
|
135
|
-
setIframe: (options: {
|
|
136
|
-
src: string;
|
|
137
|
-
service: string;
|
|
138
|
-
}) => ReturnType;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
129
|
declare module '@tiptap/core' {
|
|
145
130
|
interface Commands<ReturnType> {
|
|
146
131
|
imageUpload: {
|
|
@@ -161,6 +146,21 @@ declare module '@tiptap/core' {
|
|
|
161
146
|
}
|
|
162
147
|
|
|
163
148
|
|
|
149
|
+
declare module '@tiptap/core' {
|
|
150
|
+
interface Commands<ReturnType> {
|
|
151
|
+
iframe: {
|
|
152
|
+
/**
|
|
153
|
+
* Add an iframe
|
|
154
|
+
*/
|
|
155
|
+
setIframe: (options: {
|
|
156
|
+
src: string;
|
|
157
|
+
service: string;
|
|
158
|
+
}) => ReturnType;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
164
|
declare module '@tiptap/core' {
|
|
165
165
|
interface Commands<ReturnType> {
|
|
166
166
|
imageGifUpload: {
|
|
@@ -199,8 +199,9 @@ declare module '@tiptap/core' {
|
|
|
199
199
|
|
|
200
200
|
declare module '@tiptap/core' {
|
|
201
201
|
interface Commands<ReturnType> {
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
lineHeight: {
|
|
203
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
204
|
+
unsetLineHeight: () => ReturnType;
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
207
|
}
|
|
@@ -208,9 +209,8 @@ declare module '@tiptap/core' {
|
|
|
208
209
|
|
|
209
210
|
declare module '@tiptap/core' {
|
|
210
211
|
interface Commands<ReturnType> {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
unsetLineHeight: () => ReturnType;
|
|
212
|
+
katex: {
|
|
213
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
}
|
package/lib/bubble-extra.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as b, jsx as t, Fragment as
|
|
2
|
-
import { useState as y, useRef as L, useCallback as
|
|
3
|
-
import { B as z } from "./dom-dataset-
|
|
4
|
-
import { w as Z, x as J, A as S, y as Q, z as X, F as Y, B as H, G as ee, O as D, a1 as ce, a2 as te, a3 as R, a4 as se, a5 as le } from "./RichTextEditor-
|
|
1
|
+
import { jsxs as b, jsx as t, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as L, useCallback as w, useEffect as T, useMemo as W, Fragment as G } from "react";
|
|
3
|
+
import { B as z } from "./dom-dataset-Di3tIRrR.js";
|
|
4
|
+
import { w as Z, x as J, A as S, y as Q, z as X, F as Y, B as H, G as ee, O as D, a1 as ce, a2 as te, a3 as R, a4 as se, a5 as le } from "./RichTextEditor-DjTnd5Uu.js";
|
|
5
5
|
import { Mermaid as j } from "./Mermaid.js";
|
|
6
6
|
import { s as re, i as ne } from "./shortId-WJVkrvml.js";
|
|
7
|
-
import { T as ie } from "./textarea-
|
|
7
|
+
import { T as ie } from "./textarea-6c8drwXJ.js";
|
|
8
8
|
import { u as O } from "./index-Tj3Ci7xM.js";
|
|
9
|
-
import { E as I, t as de } from "./Excalidraw-
|
|
10
|
-
import { T as K, F as he } from "./Twitter-
|
|
9
|
+
import { E as I, t as de } from "./Excalidraw-frMX4K62.js";
|
|
10
|
+
import { T as K, F as he } from "./Twitter-dRxbZOad.js";
|
|
11
11
|
import ue from "katex";
|
|
12
12
|
import { HelpCircle as me, Pencil as xe, Trash2 as fe } from "lucide-react";
|
|
13
13
|
import { Katex as P } from "./Katex.js";
|
|
14
|
-
import { C as pe, D as _ } from "./Drawer-
|
|
14
|
+
import { C as pe, D as _ } from "./Drawer-CVuwyG50.js";
|
|
15
15
|
import { Editor as ge, makeDropdownToolbar as be } from "easydrawer";
|
|
16
16
|
const q = `graph TB
|
|
17
17
|
a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
|
|
18
|
-
const { alt: a, align: n } = s, [r, i] = y(decodeURIComponent(a ?? q)), [l, h] = y(""), [m, x] = y(!1), p = L(null), [f, M] = y(null), k = o == null ? void 0 : o.options.upload, A =
|
|
18
|
+
const { alt: a, align: n } = s, [r, i] = y(decodeURIComponent(a ?? q)), [l, h] = y(""), [m, x] = y(!1), p = L(null), [f, M] = y(null), k = o == null ? void 0 : o.options.upload, A = w(
|
|
19
19
|
(g) => {
|
|
20
20
|
g && import("mermaid").then((B) => {
|
|
21
21
|
M(B.default);
|
|
@@ -161,7 +161,7 @@ function ye({ item: e, disabled: s, editor: o }) {
|
|
|
161
161
|
disabled: s || ((n = e == null ? void 0 : e.componentProps) == null ? void 0 : n.disabled),
|
|
162
162
|
editor: o
|
|
163
163
|
}
|
|
164
|
-
) }) : /* @__PURE__ */ t(
|
|
164
|
+
) }) : /* @__PURE__ */ t(v, {});
|
|
165
165
|
}
|
|
166
166
|
function Se(e) {
|
|
167
167
|
return e.type.name === "mermaid";
|
|
@@ -175,7 +175,7 @@ function Ve(e) {
|
|
|
175
175
|
return x = !0, !1;
|
|
176
176
|
}), x;
|
|
177
177
|
}, r = W(() => e.disabled ? [] : ce(e.editor), [e.disabled, e.editor, s]);
|
|
178
|
-
return /* @__PURE__ */ t(
|
|
178
|
+
return /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(
|
|
179
179
|
z,
|
|
180
180
|
{
|
|
181
181
|
editor: e == null ? void 0 : e.editor,
|
|
@@ -197,7 +197,7 @@ function Ve(e) {
|
|
|
197
197
|
item: i
|
|
198
198
|
},
|
|
199
199
|
`bubbleMenu-mermaid-${l}`
|
|
200
|
-
)) }) }) : /* @__PURE__ */ t(
|
|
200
|
+
)) }) }) : /* @__PURE__ */ t(v, {})
|
|
201
201
|
}
|
|
202
202
|
) });
|
|
203
203
|
}
|
|
@@ -218,14 +218,14 @@ function je({ editor: e }) {
|
|
|
218
218
|
createUser: "",
|
|
219
219
|
width: 0,
|
|
220
220
|
height: 0
|
|
221
|
-
}), { defaultShowPicker: n, createUser: r, width: i, height: l } = a, h =
|
|
221
|
+
}), { defaultShowPicker: n, createUser: r, width: i, height: l } = a, h = w(
|
|
222
222
|
(f) => {
|
|
223
223
|
e.chain().updateAttributes(I.name, f).setNodeSelection(e.state.selection.from).focus().run();
|
|
224
224
|
},
|
|
225
225
|
[e]
|
|
226
|
-
), m =
|
|
226
|
+
), m = w(() => {
|
|
227
227
|
de({ ...a, editor: e });
|
|
228
|
-
}, [e, a]), x =
|
|
228
|
+
}, [e, a]), x = w(() => e.isActive(I.name), [e]), p = w(() => R(I.name, e), [e]);
|
|
229
229
|
return T(() => {
|
|
230
230
|
n && (m(), e.chain().updateAttributes(I.name, { defaultShowPicker: !1 }).focus().run());
|
|
231
231
|
}, [r, n, e, m]), /* @__PURE__ */ t(
|
|
@@ -275,10 +275,10 @@ function je({ editor: e }) {
|
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
277
|
function Ke({ editor: e, disabled: s }) {
|
|
278
|
-
const [o, a] = y(!1), { t: n } = O(), r =
|
|
278
|
+
const [o, a] = y(!1), { t: n } = O(), r = w(({ editor: h }) => h.isActive(K.name), []), i = (h) => {
|
|
279
279
|
e.commands.updateTweet({ src: h }), a(!1);
|
|
280
|
-
}, l =
|
|
281
|
-
return /* @__PURE__ */ t(
|
|
280
|
+
}, l = w(() => R(K.name, e), [e]);
|
|
281
|
+
return /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(
|
|
282
282
|
z,
|
|
283
283
|
{
|
|
284
284
|
editor: e,
|
|
@@ -294,7 +294,7 @@ function Ke({ editor: e, disabled: s }) {
|
|
|
294
294
|
a(!1);
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
|
-
children: s ? /* @__PURE__ */ t(
|
|
297
|
+
children: s ? /* @__PURE__ */ t(v, {}) : /* @__PURE__ */ t(v, { children: o ? /* @__PURE__ */ t(
|
|
298
298
|
he,
|
|
299
299
|
{
|
|
300
300
|
editor: e,
|
|
@@ -329,7 +329,7 @@ function _e({ editor: e, ...s }) {
|
|
|
329
329
|
const o = D(e, P.name, {
|
|
330
330
|
text: "",
|
|
331
331
|
defaultShowPicker: !1
|
|
332
|
-
}), { text: a, defaultShowPicker: n } = o, [r, i] = y(""), [l, h] = y(!1), m =
|
|
332
|
+
}), { text: a, defaultShowPicker: n } = o, [r, i] = y(""), [l, h] = y(!1), m = w(() => e.isActive(P.name), [e]), x = w(() => R(P.name, e), [e]), p = w(() => {
|
|
333
333
|
e.chain().focus().setKatex({ text: r }).run(), h(!1);
|
|
334
334
|
}, [e, r]);
|
|
335
335
|
T(() => {
|
|
@@ -370,7 +370,7 @@ function _e({ editor: e, ...s }) {
|
|
|
370
370
|
h(!1);
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
|
-
children: s != null && s.disabled ? /* @__PURE__ */ t(
|
|
373
|
+
children: s != null && s.disabled ? /* @__PURE__ */ t(v, {}) : /* @__PURE__ */ t("div", { className: "richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: l ? /* @__PURE__ */ b(v, { children: [
|
|
374
374
|
/* @__PURE__ */ t(
|
|
375
375
|
ie,
|
|
376
376
|
{
|
|
@@ -574,7 +574,7 @@ function ke({ item: e, disabled: s, editor: o }) {
|
|
|
574
574
|
disabled: s || ((n = e == null ? void 0 : e.componentProps) == null ? void 0 : n.disabled),
|
|
575
575
|
editor: o
|
|
576
576
|
}
|
|
577
|
-
) }) : /* @__PURE__ */ t(
|
|
577
|
+
) }) : /* @__PURE__ */ t(v, {});
|
|
578
578
|
}
|
|
579
579
|
function Be(e) {
|
|
580
580
|
return e.type.name === "drawer";
|
|
@@ -588,7 +588,7 @@ function qe(e) {
|
|
|
588
588
|
return x = !0, !1;
|
|
589
589
|
}), x;
|
|
590
590
|
}, r = W(() => e.disabled ? [] : le(e.editor), [e.disabled, e.editor, s]);
|
|
591
|
-
return /* @__PURE__ */ t(
|
|
591
|
+
return /* @__PURE__ */ t(
|
|
592
592
|
z,
|
|
593
593
|
{
|
|
594
594
|
editor: e == null ? void 0 : e.editor,
|
|
@@ -610,9 +610,9 @@ function qe(e) {
|
|
|
610
610
|
item: i
|
|
611
611
|
},
|
|
612
612
|
`bubbleMenu-drawer-${l}`
|
|
613
|
-
)) }) }) : /* @__PURE__ */ t(
|
|
613
|
+
)) }) }) : /* @__PURE__ */ t(v, {})
|
|
614
614
|
}
|
|
615
|
-
)
|
|
615
|
+
);
|
|
616
616
|
}
|
|
617
617
|
export {
|
|
618
618
|
qe as BubbleMenuDrawer,
|