reactjs-tiptap-editor 0.3.21 → 0.3.22
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-BTFBZyG2.cjs → ActionMenuButton-B81uYOvt.cjs} +1 -1
- package/lib/{ActionMenuButton-DXwnYZhJ.js → ActionMenuButton-CtcDNq-L.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +41 -41
- package/lib/Attachment.d.ts +41 -41
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +41 -41
- package/lib/Blockquote.d.ts +41 -41
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +41 -41
- package/lib/Bold.d.ts +41 -41
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +41 -41
- package/lib/BulletList.d.ts +41 -41
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +41 -41
- package/lib/Clear.d.ts +41 -41
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +41 -41
- package/lib/Code.d.ts +41 -41
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +41 -41
- package/lib/CodeBlock.d.ts +41 -41
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +41 -41
- package/lib/CodeView.d.ts +41 -41
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +41 -41
- package/lib/Color.d.ts +41 -41
- package/lib/Color.js +1 -1
- package/lib/Document.d.cts +41 -41
- package/lib/Document.d.ts +41 -41
- package/lib/{Drawer-CVuwyG50.js → Drawer-BI_9XSqI.js} +1 -1
- package/lib/{Drawer-BrHHs2E9.cjs → Drawer-CHGZ5D6j.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +41 -41
- package/lib/Drawer.d.ts +41 -41
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +41 -41
- package/lib/Emoji.d.ts +41 -41
- package/lib/Emoji.js +116 -109
- package/lib/{Excalidraw-frMX4K62.js → Excalidraw-AIzEaOzF.js} +1 -1
- package/lib/{Excalidraw-Be_GDV4Q.cjs → Excalidraw-DOJiMnFl.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +41 -41
- package/lib/Excalidraw.d.ts +41 -41
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +41 -41
- package/lib/ExportPdf.d.ts +41 -41
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +41 -41
- package/lib/ExportWord.d.ts +41 -41
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +41 -41
- package/lib/FontFamily.d.ts +41 -41
- package/lib/FontFamily.js +2 -2
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +41 -41
- package/lib/FontSize.d.ts +41 -41
- package/lib/FontSize.js +2 -2
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +41 -41
- package/lib/FormatPainter.d.ts +41 -41
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +41 -41
- package/lib/Heading.d.ts +41 -41
- package/lib/Heading.js +2 -2
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +41 -41
- package/lib/Highlight.d.ts +41 -41
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +41 -41
- package/lib/History.d.ts +41 -41
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +41 -41
- package/lib/HorizontalRule.d.ts +41 -41
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +41 -41
- package/lib/Iframe.d.ts +41 -41
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +41 -41
- package/lib/Image.d.ts +41 -41
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +41 -41
- package/lib/ImageGif.d.ts +41 -41
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.d.cts +41 -41
- package/lib/ImportWord.d.ts +41 -41
- package/lib/ImportWord.js +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +41 -41
- package/lib/Indent.d.ts +41 -41
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +41 -41
- package/lib/Italic.d.ts +41 -41
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +41 -41
- package/lib/Katex.d.ts +41 -41
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +41 -41
- package/lib/LineHeight.d.ts +41 -41
- package/lib/LineHeight.js +1 -1
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +41 -41
- package/lib/Link.d.ts +41 -41
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +41 -41
- package/lib/ListItem.d.ts +41 -41
- package/lib/Mention.d.cts +41 -41
- package/lib/Mention.d.ts +41 -41
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +41 -41
- package/lib/Mermaid.d.ts +41 -41
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +41 -41
- package/lib/MoreMark.d.ts +41 -41
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +41 -41
- package/lib/MultiColumn.d.ts +41 -41
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +41 -41
- package/lib/OrderedList.d.ts +41 -41
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-DjTnd5Uu.js → RichTextEditor-CtxIf8pq.js} +5 -2
- package/lib/{RichTextEditor-CAxwVWUE.cjs → RichTextEditor-DtxJlApT.cjs} +5 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +41 -41
- package/lib/SearchAndReplace.d.ts +41 -41
- package/lib/SearchAndReplace.js +1 -1
- package/lib/Selection.d.cts +41 -41
- package/lib/Selection.d.ts +41 -41
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +41 -41
- package/lib/SlashCommand.d.ts +41 -41
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +41 -41
- package/lib/Strike.d.ts +41 -41
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +41 -41
- package/lib/SubAndSuperScript.d.ts +41 -41
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +41 -41
- package/lib/Table.d.ts +41 -41
- package/lib/Table.js +1 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +41 -41
- package/lib/TableOfContent.d.ts +41 -41
- package/lib/TableOfContent.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +41 -41
- package/lib/TaskList.d.ts +41 -41
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +41 -41
- package/lib/TextAlign.d.ts +41 -41
- package/lib/TextAlign.js +1 -1
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +41 -41
- package/lib/TextBubble.d.ts +41 -41
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +41 -41
- package/lib/TextDirection.d.ts +41 -41
- package/lib/TextDirection.js +1 -1
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +41 -41
- package/lib/TextUnderline.d.ts +41 -41
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +41 -41
- package/lib/TrailingNode.d.ts +41 -41
- package/lib/{Twitter-dRxbZOad.js → Twitter-CJIud-WM.js} +1 -1
- package/lib/{Twitter-V0OzBT_E.cjs → Twitter-DBA28WG3.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +41 -41
- package/lib/Twitter.d.ts +41 -41
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +41 -41
- package/lib/Video.d.ts +41 -41
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +41 -41
- package/lib/bubble-extra.d.ts +41 -41
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +41 -41
- package/lib/index.d.ts +41 -41
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +41 -41
- package/lib/locale-bundle.d.ts +41 -41
- package/lib/style.css +1 -1
- package/lib/{textarea-BsJTSgT-.cjs → textarea-9iN67tad.cjs} +1 -1
- package/lib/{textarea-6c8drwXJ.js → textarea-BhTw-eGz.js} +1 -1
- package/package.json +2 -2
package/lib/OrderedList.d.ts
CHANGED
|
@@ -110,11 +110,9 @@ declare module '@tiptap/core' {
|
|
|
110
110
|
|
|
111
111
|
declare module '@tiptap/core' {
|
|
112
112
|
interface Commands<ReturnType> {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
emoji: string;
|
|
117
|
-
}) => ReturnType;
|
|
113
|
+
drawer: {
|
|
114
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
115
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
118
116
|
};
|
|
119
117
|
}
|
|
120
118
|
}
|
|
@@ -122,9 +120,11 @@ declare module '@tiptap/core' {
|
|
|
122
120
|
|
|
123
121
|
declare module '@tiptap/core' {
|
|
124
122
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
emoji: {
|
|
124
|
+
setEmoji: (emoji: {
|
|
125
|
+
name: string;
|
|
126
|
+
emoji: string;
|
|
127
|
+
}) => ReturnType;
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -175,6 +175,21 @@ declare module '@tiptap/core' {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
|
|
178
|
+
declare module '@tiptap/core' {
|
|
179
|
+
interface Commands<ReturnType> {
|
|
180
|
+
iframe: {
|
|
181
|
+
/**
|
|
182
|
+
* Add an iframe
|
|
183
|
+
*/
|
|
184
|
+
setIframe: (options: {
|
|
185
|
+
src: string;
|
|
186
|
+
service: string;
|
|
187
|
+
}) => ReturnType;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
178
193
|
declare module '@tiptap/core' {
|
|
179
194
|
interface Commands<ReturnType> {
|
|
180
195
|
imageUpload: {
|
|
@@ -195,21 +210,6 @@ declare module '@tiptap/core' {
|
|
|
195
210
|
}
|
|
196
211
|
|
|
197
212
|
|
|
198
|
-
declare module '@tiptap/core' {
|
|
199
|
-
interface Commands<ReturnType> {
|
|
200
|
-
iframe: {
|
|
201
|
-
/**
|
|
202
|
-
* Add an iframe
|
|
203
|
-
*/
|
|
204
|
-
setIframe: (options: {
|
|
205
|
-
src: string;
|
|
206
|
-
service: string;
|
|
207
|
-
}) => ReturnType;
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
213
|
declare module '@tiptap/core' {
|
|
214
214
|
interface Commands<ReturnType> {
|
|
215
215
|
imageGifUpload: {
|
|
@@ -248,9 +248,8 @@ declare module '@tiptap/core' {
|
|
|
248
248
|
|
|
249
249
|
declare module '@tiptap/core' {
|
|
250
250
|
interface Commands<ReturnType> {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
unsetLineHeight: () => ReturnType;
|
|
251
|
+
katex: {
|
|
252
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
254
253
|
};
|
|
255
254
|
}
|
|
256
255
|
}
|
|
@@ -258,8 +257,9 @@ declare module '@tiptap/core' {
|
|
|
258
257
|
|
|
259
258
|
declare module '@tiptap/core' {
|
|
260
259
|
interface Commands<ReturnType> {
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
lineHeight: {
|
|
261
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
262
|
+
unsetLineHeight: () => ReturnType;
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -316,14 +316,15 @@ declare module '@tiptap/core' {
|
|
|
316
316
|
|
|
317
317
|
declare module '@tiptap/core' {
|
|
318
318
|
interface Commands<ReturnType> {
|
|
319
|
-
|
|
319
|
+
video: {
|
|
320
320
|
/**
|
|
321
|
-
*
|
|
322
|
-
* @param options The tweet attributes
|
|
323
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
321
|
+
* Add an video
|
|
324
322
|
*/
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
324
|
+
/**
|
|
325
|
+
* Update an video
|
|
326
|
+
*/
|
|
327
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
327
328
|
};
|
|
328
329
|
}
|
|
329
330
|
}
|
|
@@ -331,15 +332,14 @@ declare module '@tiptap/core' {
|
|
|
331
332
|
|
|
332
333
|
declare module '@tiptap/core' {
|
|
333
334
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Add an video
|
|
337
|
-
*/
|
|
338
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
335
|
+
twitter: {
|
|
339
336
|
/**
|
|
340
|
-
*
|
|
337
|
+
* Insert a tweet
|
|
338
|
+
* @param options The tweet attributes
|
|
339
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
341
340
|
*/
|
|
342
|
-
|
|
341
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
342
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
345
|
}
|
package/lib/OrderedList.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { N as a, w as i, m as r } from "./index-DI9T3iLd.js";
|
|
2
|
-
import { A as p } from "./RichTextEditor-
|
|
2
|
+
import { A as p } from "./RichTextEditor-CtxIf8pq.js";
|
|
3
3
|
const d = "listItem", o = "textStyle", n = /^(\d+)\.\s$/, u = a.create({
|
|
4
4
|
name: "orderedList",
|
|
5
5
|
addOptions() {
|
|
@@ -12309,6 +12309,8 @@ function X2() {
|
|
|
12309
12309
|
const Y2 = `
|
|
12310
12310
|
.reactjs-tiptap-editor,
|
|
12311
12311
|
.richtext-dialog-content {
|
|
12312
|
+
color: hsl(var(--richtext-foreground));
|
|
12313
|
+
|
|
12312
12314
|
button,
|
|
12313
12315
|
input:where([type=button]),
|
|
12314
12316
|
input:where([type=reset]),
|
|
@@ -12351,7 +12353,6 @@ const Y2 = `
|
|
|
12351
12353
|
border-color: hsl(var(--richtext-border));
|
|
12352
12354
|
}
|
|
12353
12355
|
|
|
12354
|
-
color: hsl(var(--richtext-foreground));
|
|
12355
12356
|
|
|
12356
12357
|
hr {
|
|
12357
12358
|
height: 0;
|
|
@@ -12419,8 +12420,10 @@ const Y2 = `
|
|
|
12419
12420
|
}
|
|
12420
12421
|
}
|
|
12421
12422
|
|
|
12422
|
-
|
|
12423
|
+
div[data-radix-popper-content-wrapper],
|
|
12423
12424
|
div[data-tippy-root] {
|
|
12425
|
+
color: hsl(var(--richtext-foreground));
|
|
12426
|
+
|
|
12424
12427
|
*,
|
|
12425
12428
|
::before,
|
|
12426
12429
|
::after {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
`+b.prev}function Ir(v,b){var ae=V(v),se=[];if(ae){se.length=v.length;for(var ce=0;ce<v.length;ce++)se[ce]=Se(v,ce)?b(v[ce],v):""}var Q=typeof A=="function"?A(v):[],lt;if(D){lt={};for(var bt=0;bt<Q.length;bt++)lt["$"+Q[bt]]=Q[bt]}for(var Ie in v)Se(v,Ie)&&(ae&&String(Number(Ie))===Ie&&Ie<v.length||D&<["$"+Ie]instanceof Symbol||(M.call(/[^\w$]/,Ie)?se.push(b(Ie,v)+": "+b(v[Ie],v)):se.push(Ie+": "+b(v[Ie],v))));if(typeof A=="function")for(var ut=0;ut<Q.length;ut++)H.call(v,Q[ut])&&se.push("["+b(Q[ut])+"]: "+b(v[Q[ut]],v));return se}return ho}var po,gl;function ly(){if(gl)return po;gl=1;var e=$n(),t=Me(),r=function(s,l,u){for(var f=s,d;(d=f.next)!=null;f=d)if(d.key===l)return f.next=d.next,u||(d.next=s.next,s.next=d),d},n=function(s,l){if(s){var u=r(s,l);return u&&u.value}},i=function(s,l,u){var f=r(s,l);f?f.value=u:s.next={key:l,next:s.next,value:u}},o=function(s,l){return s?!!r(s,l):!1},a=function(s,l){if(s)return r(s,l,!0)};return po=function(){var l,u={assert:function(f){if(!u.has(f))throw new t("Side channel does not contain "+e(f))},delete:function(f){var d=l&&l.next,h=a(l,f);return h&&d&&d===h&&(l=void 0),!!h},get:function(f){return n(l,f)},has:function(f){return o(l,f)},set:function(f,d){l||(l={next:void 0}),i(l,f,d)}};return u},po}var mo,xl;function Gd(){if(xl)return mo;xl=1;var e=at(),t=Ae(),r=$n(),n=Me(),i=e("%Map%",!0),o=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),s=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return mo=!!i&&function(){var d,h={assert:function(p){if(!h.has(p))throw new n("Side channel does not contain "+r(p))},delete:function(p){if(d){var m=l(d,p);return u(d)===0&&(d=void 0),m}return!1},get:function(p){if(d)return o(d,p)},has:function(p){return d?s(d,p):!1},set:function(p,m){d||(d=new i),a(d,p,m)}};return h},mo}var go,vl;function uy(){if(vl)return go;vl=1;var e=at(),t=Ae(),r=$n(),n=Gd(),i=Me(),o=e("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return go=o?function(){var d,h,p={assert:function(m){if(!p.has(m))throw new i("Side channel does not contain "+r(m))},delete:function(m){if(o&&m&&(typeof m=="object"||typeof m=="function")){if(d)return u(d,m)}else if(n&&h)return h.delete(m);return!1},get:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?a(d,m):h&&h.get(m)},has:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?l(d,m):!!h&&h.has(m)},set:function(m,x){o&&m&&(typeof m=="object"||typeof m=="function")?(d||(d=new o),s(d,m,x)):n&&(h||(h=n()),h.set(m,x))}};return p}:n,go}var xo,yl;function Vd(){if(yl)return xo;yl=1;var e=Me(),t=$n(),r=ly(),n=Gd(),i=uy(),o=i||n||r;return xo=function(){var s,l={assert:function(u){if(!l.has(u))throw new e("Side channel does not contain "+t(u))},delete:function(u){return!!s&&s.delete(u)},get:function(u){return s&&s.get(u)},has:function(u){return!!s&&s.has(u)},set:function(u,f){s||(s=o()),s.set(u,f)}};return l},xo}var vo,bl;function dy(){if(bl)return vo;bl=1;var e=cs(),t=Vd()(),r=Me(),n={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");if(t.assert(i),!n.has(i,o))throw new r("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var a=t.get(i);return a&&a["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var a=t.get(i);return!!a&&e(a,"$"+o)},set:function(i,o,a){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var s=t.get(i);s||(s={},t.set(i,s)),s["$"+o]=a}};return Object.freeze&&Object.freeze(n),vo=n,vo}var yo,wl;function fy(){if(wl)return yo;wl=1;var e=dy(),t=es(),r=typeof StopIteration=="object"?StopIteration:null;return yo=function(i){if(!r)throw new t("this environment lacks StopIteration");e.set(i,"[[Done]]",!1);var o={next:function(){var s=e.get(this,"[[Iterator]]"),l=!!e.get(s,"[[Done]]");try{return{done:l,value:l?void 0:s.next()}}catch(u){if(e.set(s,"[[Done]]",!0),u!==r)throw u;return{done:!0,value:void 0}}}};return e.set(o,"[[Iterator]]",i),o},yo}var bo,Sl;function Kd(){if(Sl)return bo;Sl=1;var e={}.toString;return bo=Array.isArray||function(t){return e.call(t)=="[object Array]"},bo}var wo,Al;function Xd(){if(Al)return wo;Al=1;var e=Ae(),t=e("String.prototype.valueOf"),r=function(s){try{return t(s),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object String]",o=Ot()();return wo=function(s){return typeof s=="string"?!0:!s||typeof s!="object"?!1:o?r(s):n(s)===i},wo}var So,Cl;function Yd(){if(Cl)return So;Cl=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;e||(r=function(a){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!n&&(r=function(a){return!1}),So=r||function(a){if(!a||typeof a!="object")return!1;try{if(n.call(a),i)try{i.call(a)}catch{return!0}return a instanceof e}catch{}return!1},So}var Ao,jl;function Jd(){if(jl)return Ao;jl=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;t||(r=function(a){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!i&&(r=function(a){return!1}),Ao=r||function(a){if(!a||typeof a!="object")return!1;try{if(i.call(a),n)try{n.call(a)}catch{return!0}return a instanceof t}catch{}return!1},Ao}var El;function hy(){if(El)return tr.exports;El=1;var e=Wd(),t=fy();if(is()()||Ln()()){var r=Symbol.iterator;tr.exports=function(O){if(O!=null&&typeof O[r]<"u")return O[r]();if(e(O))return Array.prototype[r].call(O)}}else{var n=Kd(),i=Xd(),o=at(),a=o("%Map%",!0),s=o("%Set%",!0),l=qd(),u=l("Array.prototype.push"),f=l("String.prototype.charCodeAt"),d=l("String.prototype.slice"),h=function(O,$){var C=O.length;if($+1>=C)return $+1;var A=f(O,$);if(A<55296||A>56319)return $+1;var P=f(O,$+1);return P<56320||P>57343?$+1:$+2},p=function(O){var $=0;return{next:function(){var A=$>=O.length,P;return A||(P=O[$],$+=1),{done:A,value:P}}}},m=function(O,$){if(n(O)||e(O))return p(O);if(i(O)){var C=0;return{next:function(){var P=h(O,C),D=d(O,C,P);return C=P,{done:P>O.length,value:D}}}}if($&&typeof O["_es6-shim iterator_"]<"u")return O["_es6-shim iterator_"]()};if(!a&&!s)tr.exports=function(O){if(O!=null)return m(O,!0)};else{var x=Yd(),g=Jd(),y=l("Map.prototype.forEach",!0),S=l("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var E=l("Map.prototype.iterator",!0),T=l("Set.prototype.iterator",!0);var j=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),M=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0),L=function(O){if(x(O)){if(E)return t(E(O));if(j)return j(O);if(y){var $=[];return y(O,function(A,P){u($,[P,A])}),p($)}}if(g(O)){if(T)return t(T(O));if(M)return M(O);if(S){var C=[];return S(O,function(A){u(C,A)}),p(C)}}};tr.exports=function(O){return L(O)||m(O)}}}return tr.exports}var Co,Tl;function Zd(){if(Tl)return Co;Tl=1;var e=function(t){return t!==t};return Co=function(r,n){return r===0&&n===0?1/r===1/n:!!(r===n||e(r)&&e(n))},Co}var jo,Il;function Qd(){if(Il)return jo;Il=1;var e=Zd();return jo=function(){return typeof Object.is=="function"?Object.is:e},jo}var Eo,Rl;function py(){if(Rl)return Eo;Rl=1;var e=Qd(),t=Pt();return Eo=function(){var n=e();return t(Object,{is:n},{is:function(){return Object.is!==n}}),n},Eo}var To,Pl;function my(){if(Pl)return To;Pl=1;var e=Pt(),t=Kt(),r=Zd(),n=Qd(),i=py(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:i}),To=o,To}var Io,Ol;function ef(){if(Ol)return Io;Ol=1;var e=Kt(),t=Ae(),r=at(),n=r("%ArrayBuffer%",!0),i=t("ArrayBuffer.prototype.byteLength",!0),o=t("Object.prototype.toString"),a=!!n&&!i&&new n(0).slice,s=!!a&&e(a);return Io=i||s?function(u){if(!u||typeof u!="object")return!1;try{return i?i(u):s(u,0),!0}catch{return!1}}:n?function(u){return o(u)==="[object ArrayBuffer]"}:function(u){return!1},Io}var Ro,kl;function gy(){if(kl)return Ro;kl=1;var e=Ae(),t=e("Date.prototype.getDay"),r=function(s){try{return t(s),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Date]",o=Ot()();return Ro=function(s){return typeof s!="object"||s===null?!1:o?r(s):n(s)===i},Ro}var Po,Nl;function tf(){if(Nl)return Po;Nl=1;var e=Ae(),t=Ot()(),r=cs(),n=Rt(),i;if(t){var o=e("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),i=function(h){if(!h||typeof h!="object")return!1;var p=n(h,"lastIndex"),m=p&&r(p,"value");if(!m)return!1;try{o(h,l)}catch(x){return x===a}}}else{var u=e("Object.prototype.toString"),f="[object RegExp]";i=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:u(h)===f}}return Po=i,Po}var Oo,Ml;function xy(){if(Ml)return Oo;Ml=1;var e=Ae(),t=e("SharedArrayBuffer.prototype.byteLength",!0);return Oo=t?function(n){if(!n||typeof n!="object")return!1;try{return t(n),!0}catch{return!1}}:function(n){return!1},Oo}var ko,Ll;function vy(){if(Ll)return ko;Ll=1;var e=Ae(),t=e("Number.prototype.toString"),r=function(s){try{return t(s),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Number]",o=Ot()();return ko=function(s){return typeof s=="number"?!0:!s||typeof s!="object"?!1:o?r(s):n(s)===i},ko}var No,$l;function yy(){if($l)return No;$l=1;var e=Ae(),t=e("Boolean.prototype.toString"),r=e("Object.prototype.toString"),n=function(s){try{return t(s),!0}catch{return!1}},i="[object Boolean]",o=Ot()();return No=function(s){return typeof s=="boolean"?!0:s===null||typeof s!="object"?!1:o?n(s):r(s)===i},No}var zr={exports:{}},Mo,_l;function by(){if(_l)return Mo;_l=1;var e=Ae(),t=tf(),r=e("RegExp.prototype.exec"),n=Me();return Mo=function(o){if(!t(o))throw new n("`regex` must be a RegExp");return function(s){return r(o,s)!==null}},Mo}var Dl;function wy(){if(Dl)return zr.exports;Dl=1;var e=Ae(),t=e("Object.prototype.toString"),r=is()(),n=by();if(r){var i=e("Symbol.prototype.toString"),o=n(/^Symbol\(.*\)$/),a=function(l){return typeof l.valueOf()!="symbol"?!1:o(i(l))};zr.exports=function(l){if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||t(l)!=="[object Symbol]")return!1;try{return a(l)}catch{return!1}}}else zr.exports=function(l){return!1};return zr.exports}var Hr={exports:{}},Lo,Bl;function Sy(){if(Bl)return Lo;Bl=1;var e=typeof BigInt<"u"&&BigInt;return Lo=function(){return typeof e=="function"&&typeof BigInt=="function"&&typeof e(42)=="bigint"&&typeof BigInt(42)=="bigint"},Lo}var zl;function Ay(){if(zl)return Hr.exports;zl=1;var e=Sy()();if(e){var t=BigInt.prototype.valueOf,r=function(i){try{return t.call(i),!0}catch{}return!1};Hr.exports=function(i){return i===null||typeof i>"u"||typeof i=="boolean"||typeof i=="string"||typeof i=="number"||typeof i=="symbol"||typeof i=="function"?!1:typeof i=="bigint"?!0:r(i)}}else Hr.exports=function(i){return!1};return Hr.exports}var $o,Hl;function Cy(){if(Hl)return $o;Hl=1;var e=Xd(),t=vy(),r=yy(),n=wy(),i=Ay();return $o=function(a){if(a==null||typeof a!="object"&&typeof a!="function")return null;if(e(a))return"String";if(t(a))return"Number";if(r(a))return"Boolean";if(n(a))return"Symbol";if(i(a))return"BigInt"},$o}var _o,ql;function jy(){if(ql)return _o;ql=1;var e=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,t=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,r;e||(r=function(a){return!1});var n=e?e.prototype.has:null,i=t?t.prototype.has:null;return!r&&!n&&(r=function(a){return!1}),_o=r||function(a){if(!a||typeof a!="object")return!1;try{if(n.call(a,n),i)try{i.call(a,i)}catch{return!0}return a instanceof e}catch{}return!1},_o}var qr={exports:{}},Fl;function Ey(){if(Fl)return qr.exports;Fl=1;var e=at(),t=Ae(),r=e("%WeakSet%",!0),n=t("WeakSet.prototype.has",!0);if(n){var i=t("WeakMap.prototype.has",!0);qr.exports=function(a){if(!a||typeof a!="object")return!1;try{if(n(a,n),i)try{i(a,i)}catch{return!0}return a instanceof r}catch{}return!1}}else qr.exports=function(a){return!1};return qr.exports}var Do,Ul;function Ty(){if(Ul)return Do;Ul=1;var e=Yd(),t=Jd(),r=jy(),n=Ey();return Do=function(o){if(o&&typeof o=="object"){if(e(o))return"Map";if(t(o))return"Set";if(r(o))return"WeakMap";if(n(o))return"WeakSet"}return!1},Do}var Bo,Wl;function Iy(){if(Wl)return Bo;Wl=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(S){S!==n&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(E){try{var T=e.call(E);return i.test(T)}catch{return!1}},a=function(E){try{return o(E)?!1:(e.call(E),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",u="[object Function]",f="[object GeneratorFunction]",d="[object HTMLAllCollection]",h="[object HTML document.all class]",p="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,x=!(0 in[,]),g=function(){return!1};if(typeof document=="object"){var y=document.all;s.call(y)===s.call(document.all)&&(g=function(E){if((x||!E)&&(typeof E>"u"||typeof E=="object"))try{var T=s.call(E);return(T===d||T===h||T===p||T===l)&&E("")==null}catch{}return!1})}return Bo=t?function(E){if(g(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{t(E,null,r)}catch(T){if(T!==n)return!1}return!o(E)&&a(E)}:function(E){if(g(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(m)return a(E);if(o(E))return!1;var T=s.call(E);return T!==u&&T!==f&&!/^\[object HTML/.test(T)?!1:a(E)},Bo}var zo,Gl;function Ry(){if(Gl)return zo;Gl=1;var e=Iy(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,u,f){for(var d=0,h=l.length;d<h;d++)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))},i=function(l,u,f){for(var d=0,h=l.length;d<h;d++)f==null?u(l.charAt(d),d,l):u.call(f,l.charAt(d),d,l)},o=function(l,u,f){for(var d in l)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))};function a(s){return t.call(s)==="[object Array]"}return zo=function(l,u,f){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=f),a(l)?n(l,u,d):typeof l=="string"?i(l,u,d):o(l,u,d)},zo}var Ho,Vl;function Py(){return Vl||(Vl=1,Ho=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ho}var qo,Kl;function Oy(){if(Kl)return qo;Kl=1;var e=Py(),t=typeof globalThis>"u"?wr:globalThis;return qo=function(){for(var n=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(n[n.length]=e[i]);return n},qo}var Fo,Xl;function ky(){if(Xl)return Fo;Xl=1;var e=Ry(),t=Oy(),r=Kt(),n=Ae(),i=Rt(),o=n("Object.prototype.toString"),a=Ot()(),s=typeof globalThis>"u"?wr:globalThis,l=t(),u=n("String.prototype.slice"),f=Object.getPrototypeOf,d=n("Array.prototype.indexOf",!0)||function(g,y){for(var S=0;S<g.length;S+=1)if(g[S]===y)return S;return-1},h={__proto__:null};a&&i&&f?e(l,function(x){var g=new s[x];if(Symbol.toStringTag in g){var y=f(g),S=i(y,Symbol.toStringTag);if(!S){var E=f(y);S=i(E,Symbol.toStringTag)}h["$"+x]=r(S.get)}}):e(l,function(x){var g=new s[x],y=g.slice||g.set;y&&(h["$"+x]=r(y))});var p=function(g){var y=!1;return e(h,function(S,E){if(!y)try{"$"+S(g)===E&&(y=u(E,1))}catch{}}),y},m=function(g){var y=!1;return e(h,function(S,E){if(!y)try{S(g),y=u(E,1)}catch{}}),y};return Fo=function(g){if(!g||typeof g!="object")return!1;if(!a){var y=u(o(g),8,-1);return d(l,y)>-1?y:y!=="Object"?!1:m(g)}return i?p(g):null},Fo}var Uo,Yl;function Ny(){if(Yl)return Uo;Yl=1;var e=Ae(),t=e("ArrayBuffer.prototype.byteLength",!0),r=ef();return Uo=function(i){return r(i)?t?t(i):i.byteLength:NaN},Uo}var Wo,Jl;function My(){if(Jl)return Wo;Jl=1;var e=ty(),t=qd(),r=oy(),n=at(),i=hy(),o=Vd(),a=my(),s=Wd(),l=Kd(),u=ef(),f=gy(),d=tf(),h=xy(),p=Qa(),m=Cy(),x=Ty(),g=ky(),y=Ny(),S=t("SharedArrayBuffer.prototype.byteLength",!0),E=t("Date.prototype.getTime"),T=Object.getPrototypeOf,j=t("Object.prototype.toString"),M=n("%Set%",!0),L=t("Map.prototype.has",!0),k=t("Map.prototype.get",!0),O=t("Map.prototype.size",!0),$=t("Set.prototype.add",!0),C=t("Set.prototype.delete",!0),A=t("Set.prototype.has",!0),P=t("Set.prototype.size",!0);function D(I,_,X,V){for(var ee=i(I),ie;(ie=ee.next())&&!ie.done;)if(ne(_,ie.value,X,V))return C(I,ie.value),!0;return!1}function U(I){if(typeof I>"u")return null;if(typeof I!="object")return typeof I=="symbol"?!1:typeof I=="string"||typeof I=="number"?+I==+I:!0}function H(I,_,X,V,ee,ie){var F=U(X);if(F!=null)return F;var G=k(_,F),z=e({},ee,{strict:!1});return typeof G>"u"&&!L(_,F)||!ne(V,G,z,ie)?!1:!L(I,F)&&ne(V,G,z,ie)}function K(I,_,X){var V=U(X);return V??(A(_,V)&&!A(I,V))}function te(I,_,X,V,ee,ie){for(var F=i(I),G,z;(G=F.next())&&!G.done;)if(z=G.value,ne(X,z,ee,ie)&&ne(V,k(_,z),ee,ie))return C(I,z),!0;return!1}function ne(I,_,X,V){var ee=X||{};if(ee.strict?a(I,_):I===_)return!0;var ie=m(I),F=m(_);if(ie!==F)return!1;if(!I||!_||typeof I!="object"&&typeof _!="object")return ee.strict?a(I,_):I==_;var G=V.has(I),z=V.has(_),J;if(G&&z){if(V.get(I)===V.get(_))return!0}else J={};return G||V.set(I,J),z||V.set(_,J),$e(I,_,ee,V)}function ve(I){return!I||typeof I!="object"||typeof I.length!="number"||typeof I.copy!="function"||typeof I.slice!="function"||I.length>0&&typeof I[0]!="number"?!1:!!(I.constructor&&I.constructor.isBuffer&&I.constructor.isBuffer(I))}function ge(I,_,X,V){if(P(I)!==P(_))return!1;for(var ee=i(I),ie=i(_),F,G,z;(F=ee.next())&&!F.done;)if(F.value&&typeof F.value=="object")z||(z=new M),$(z,F.value);else if(!A(_,F.value)){if(X.strict||!K(I,_,F.value))return!1;z||(z=new M),$(z,F.value)}if(z){for(;(G=ie.next())&&!G.done;)if(G.value&&typeof G.value=="object"){if(!D(z,G.value,X.strict,V))return!1}else if(!X.strict&&!A(I,G.value)&&!D(z,G.value,X.strict,V))return!1;return P(z)===0}return!0}function Le(I,_,X,V){if(O(I)!==O(_))return!1;for(var ee=i(I),ie=i(_),F,G,z,J,xe,ye;(F=ee.next())&&!F.done;)if(J=F.value[0],xe=F.value[1],J&&typeof J=="object")z||(z=new M),$(z,J);else if(ye=k(_,J),typeof ye>"u"&&!L(_,J)||!ne(xe,ye,X,V)){if(X.strict||!H(I,_,J,xe,X,V))return!1;z||(z=new M),$(z,J)}if(z){for(;(G=ie.next())&&!G.done;)if(J=G.value[0],ye=G.value[1],J&&typeof J=="object"){if(!te(z,I,J,ye,X,V))return!1}else if(!X.strict&&(!I.has(J)||!ne(k(I,J),ye,X,V))&&!te(z,I,J,ye,e({},X,{strict:!1}),V))return!1;return P(z)===0}return!0}function $e(I,_,X,V){var ee,ie;if(typeof I!=typeof _||I==null||_==null||j(I)!==j(_)||s(I)!==s(_))return!1;var F=l(I),G=l(_);if(F!==G)return!1;var z=I instanceof Error,J=_ instanceof Error;if(z!==J||(z||J)&&(I.name!==_.name||I.message!==_.message))return!1;var xe=d(I),ye=d(_);if(xe!==ye||(xe||ye)&&(I.source!==_.source||r(I)!==r(_)))return!1;var be=f(I),Se=f(_);if(be!==Se||(be||Se)&&E(I)!==E(_)||X.strict&&T&&T(I)!==T(_))return!1;var Ce=g(I),Ke=g(_);if(Ce!==Ke)return!1;if(Ce||Ke){if(I.length!==_.length)return!1;for(ee=0;ee<I.length;ee++)if(I[ee]!==_[ee])return!1;return!0}var _e=ve(I),je=ve(_);if(_e!==je)return!1;if(_e||je){if(I.length!==_.length)return!1;for(ee=0;ee<I.length;ee++)if(I[ee]!==_[ee])return!1;return!0}var Xe=u(I),Ye=u(_);if(Xe!==Ye)return!1;if(Xe||Ye)return y(I)!==y(_)?!1:typeof Uint8Array=="function"&&ne(new Uint8Array(I),new Uint8Array(_),X,V);var Je=h(I),Tr=h(_);if(Je!==Tr)return!1;if(Je||Tr)return S(I)!==S(_)?!1:typeof Uint8Array=="function"&&ne(new Uint8Array(I),new Uint8Array(_),X,V);if(typeof I!=typeof _)return!1;var st=p(I),kt=p(_);if(st.length!==kt.length)return!1;for(st.sort(),kt.sort(),ee=st.length-1;ee>=0;ee--)if(st[ee]!=kt[ee])return!1;for(ee=st.length-1;ee>=0;ee--)if(ie=st[ee],!ne(I[ie],_[ie],X,V))return!1;var Xt=x(I),ct=x(_);return Xt!==ct?!1:Xt==="Set"||ct==="Set"?ge(I,_,X,V):Xt==="Map"?Le(I,_,X,V):!0}return Wo=function(_,X,V){return ne(_,X,V,o())},Wo}var Ly=My();const rf=kd(Ly);function $y(e){return e}function nf(e,t,r,n){const i=$y,[o,a]=w.useState(i(r)),s=w.useRef(o);return w.useEffect(()=>{const l=()=>{const u={...r,...e.getAttributes(t)};Object.keys(u).forEach(d=>{(u[d]===null||u[d]===void 0)&&(u[d]=r?r[d]:null)});const f=i(u);rf(s.current,f)||(a(f),s.current=f)};return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e,r,t,i]),o}function _y({editor:e}){const{t}=q.useLocale(),{width:r,height:n,src:i}=nf(e,St.name,{width:0,height:0,src:"",defaultShowPicker:!1}),[o,a]=w.useState(!1),[s,l]=w.useState(""),u=w.useCallback(()=>{a(!1)},[a]);w.useEffect(()=>{o&&l(i)},[o,i]);const f=w.useCallback(()=>{const g=Pd(s);e.chain().updateAttributes(St.name,{src:(g==null?void 0:g.src)||s}).setNodeSelection(e.state.selection.from).focus().run(),a(!1)},[e,s,a]),d=w.useCallback(()=>{window.open(i,"_blank")},[i]),h=w.useCallback(()=>{a(!0)},[a]),p=w.useCallback(g=>{e.chain().updateAttributes(St.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),m=w.useCallback(()=>e.isActive(St.name)&&!i,[e,i]),x=w.useCallback(()=>Wa(St.name,e),[e]);return c.jsxs(c.Fragment,{children:[c.jsx(pe.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"iframe-bubble-menu",shouldShow:m,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:c.jsxs("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:[c.jsx(W,{action:d,icon:"Eye",tooltip:"Visit Link"}),c.jsx(W,{action:h,icon:"Pencil",tooltip:"Open Edit Link"}),c.jsx(Rd,{height:n,onOk:p,width:r,children:c.jsx(W,{icon:"Settings",tooltip:t("editor.settings")})}),c.jsx(W,{action:x,icon:"Trash2",tooltip:t("editor.delete")})]})}),c.jsxs(Cr,{onOpenChange:a,open:o,children:[c.jsx(jr,{}),c.jsxs(Ft,{children:[c.jsx(ud,{children:c.jsx(Ut,{children:"Edit Link Iframe"})}),c.jsx(Te,{autoFocus:!0,onInput:g=>l(g.target.value),placeholder:"Enter link",type:"url",value:s}),c.jsxs(In,{children:[c.jsx(we,{onClick:u,children:"Cancel"}),c.jsx(we,{onClick:f,children:"OK"})]})]})]})]})}function Dy({editor:e,disabled:t,bubbleMenu:r}){const n=e.extensionManager.extensions.map(o=>o.name),i=()=>{var o,a,s,l,u,f,d,h,p,m;return[n.includes("columns")&&!((o=r==null?void 0:r.columnConfig)!=null&&o.hidden)?c.jsx(Q1,{editor:e},"columns"):null,n.includes("table")&&!((a=r==null?void 0:r.tableConfig)!=null&&a.hidden)?c.jsx(M0,{actions:(s=r==null?void 0:r.tableConfig)==null?void 0:s.actions,editor:e},"table"):null,n.includes("link")&&!((l=r==null?void 0:r.linkConfig)!=null&&l.hidden)?c.jsx(c1,{disabled:t,editor:e},"link"):null,n.includes(Ht.name)&&!((u=r==null?void 0:r.imageConfig)!=null&&u.hidden)?c.jsx(G1,{disabled:t,editor:e},"image"):null,n.includes(za.name)&&!((f=r==null?void 0:r.imageGifConfig)!=null&&f.hidden)?c.jsx(V1,{disabled:t,editor:e},"imageGif"):null,n.includes("video")&&!((d=r==null?void 0:r.videoConfig)!=null&&d.hidden)?c.jsx(K1,{disabled:t,editor:e},"video"):null,n.includes("iframe")&&!((h=r==null?void 0:r.iframeConfig)!=null&&h.hidden)?c.jsx(_y,{disabled:t,editor:e},"iframe"):null,(p=r==null?void 0:r.floatingMenuConfig)!=null&&p.hidden?null:c.jsx(l0,{disabled:t,editor:e},"content"),(m=r==null?void 0:r.textConfig)!=null&&m.hidden?null:c.jsx(f0,{disabled:t,editor:e},"text")]};return r!=null&&r.render?r.render({editor:e,disabled:t||!1,extensionsNames:n,bubbleMenu:r},i()):i().filter(Boolean)}function Zl(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:c.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}function of(e){const{t}=q.useLocale(),{highlight:r=!1,disabled:n=!1,selectedColor:i,setSelectedColor:o,onChange:a,colors:s=q.COLORS_LIST}=e,l=w.useMemo(()=>{const p=s,m=[];for(let x=0;x<p.length;x+=10)m.push(p.slice(x,x+10));return m},[s]),[u,f]=w.useState([]),d=p=>{const m=[...u],x=m.indexOf(p);x!==-1&&m.splice(x,1),m.unshift(p),m.length>10&&m.pop(),f(m)};function h(p){if(p===void 0){o==null||o(p),a==null||a(p);return}/^#([\da-f]{3}){1,2}$/i.test(p)&&(o==null||o(p),a==null||a(p),d(p))}return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,className:"!richtext-p-0",disabled:n,children:e==null?void 0:e.children}),c.jsx(It,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:c.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[r?c.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>h(void 0),children:[c.jsx(Zl,{}),c.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.nofill")})]}):c.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{h(void 0)},children:[c.jsx(Zl,{}),c.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.default")})]}),l.map((p,m)=>c.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:p.map((x,g)=>c.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(x),children:c.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:x},children:x===i?c.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:c.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):c.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:c.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${g}`))},m)),c.jsxs("div",{children:[c.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),c.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:u==null?void 0:u.map((p,m)=>c.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(p),children:c.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:p},children:c.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:c.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${m}`))})]}),c.jsx(By,{setColor:h})]})})]})}function By({setColor:e}){const[t,r]=w.useState("#000000"),[n,i]=w.useState(!1),{t:o}=q.useLocale();return w.useEffect(()=>()=>{i(!1)},[]),c.jsxs(Wt,{open:n,children:[c.jsx(Gt,{asChild:!0,children:c.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",onClick:a=>{a.preventDefault(),i(!0)},children:[o("editor.color.more"),"..."]})}),c.jsxs(It,{children:[c.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[c.jsx(Tf.HexColorPicker,{color:t,onChange:r}),c.jsx(Te,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:t.slice(1),onChange:a=>{a.preventDefault(),r(`#${a.target.value}`)}})]}),c.jsx(Be,{className:"richtext-my-[10px]"}),c.jsx(we,{className:"richtext-w-full",onClick:a=>{a.preventDefault(),e(t),i(!1)},children:c.jsx(N.Plus,{size:16})})]})]})}function zy({editor:e,disabled:t,toolbar:r}){const{t:n,lang:i}=q.useLocale(),o=w.useMemo(()=>{const u=[...e.extensionManager.extensions].sort((d,h)=>{const p=d.options.sort??-1,m=h.options.sort??-1;return p-m});let f=[];for(const d of u){const{button:h,divider:p=!1,spacer:m=!1,toolbar:x=!0}=d.options;if(!h||!B1(h)||!x)continue;const g=h({editor:e,extension:d,t:n});if(Array.isArray(g)){const y=g.map((S,E)=>({button:S,divider:E===g.length-1?p:!1,spacer:E===0?m:!1,type:d.type,name:d.name}));f=[...f,...y];continue}f.push({button:g,divider:p,spacer:m,type:d.type,name:d.name})}return f},[e,n,i]),a=l=>c.jsx("div",{className:"richtext-px-1 richtext-py-2 !richtext-border-b",style:{pointerEvents:t?"none":"auto",opacity:t?.5:1},children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1",children:l})}),s=o.map((l,u)=>{var d,h;const f=l.button.component;return c.jsxs("div",{className:"richtext-flex richtext-items-center",children:[(l==null?void 0:l.spacer)&&c.jsx(Be,{orientation:"vertical",className:"!richtext-h-[16px] !richtext-mx-[10px]"}),c.jsx(f,{...l.button.componentProps,disabled:t||((h=(d=l==null?void 0:l.button)==null?void 0:d.componentProps)==null?void 0:h.disabled)}),(l==null?void 0:l.divider)&&c.jsx(Be,{orientation:"vertical",className:"!richtext-h-auto !richtext-mx-2"})]},`toolbar-item-${u}`)});return r&&(r!=null&&r.render)?r.render({editor:e,disabled:t||!1},o,s,a):a(s)}function Hy({editor:e,extensions:t}){const{t:r}=q.useLocale(),n=w.useMemo(()=>{var i,o,a;return(a=(o=(i=t==null?void 0:t.find(s=>s.name==="base-kit"))==null?void 0:i.options)==null?void 0:o.characterCount)==null?void 0:a.limit},[t]);return n?c.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:c.jsx("div",{className:"richtext-flex richtext-flex-col",children:c.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:c.jsxs("span",{children:[e.storage.characterCount.characters(),"/",n," ",r("editor.characters")]})})})}):c.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:c.jsx("div",{className:"richtext-flex richtext-flex-col",children:c.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:c.jsxs("span",{children:[e.storage.characterCount.characters()," ",r("editor.characters")]})})})})}function qy(){const{toasts:e}=Nn();return c.jsxs(nv,{children:[e.map(({id:t,title:r,description:n,action:i,...o})=>c.jsxs(Cd,{...o,children:[c.jsxs("div",{className:"richtext-grid richtext-gap-1",children:[r&&c.jsx(Ed,{children:r}),n&&c.jsx(Td,{children:n})]}),i,c.jsx(jd,{})]},t)),c.jsx(Ad,{})]})}const Fy=`
|
|
9
9
|
.reactjs-tiptap-editor,
|
|
10
10
|
.richtext-dialog-content {
|
|
11
|
+
color: hsl(var(--richtext-foreground));
|
|
12
|
+
|
|
11
13
|
button,
|
|
12
14
|
input:where([type=button]),
|
|
13
15
|
input:where([type=reset]),
|
|
@@ -50,7 +52,6 @@
|
|
|
50
52
|
border-color: hsl(var(--richtext-border));
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
color: hsl(var(--richtext-foreground));
|
|
54
55
|
|
|
55
56
|
hr {
|
|
56
57
|
height: 0;
|
|
@@ -118,8 +119,10 @@
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
div[data-radix-popper-content-wrapper],
|
|
122
123
|
div[data-tippy-root] {
|
|
124
|
+
color: hsl(var(--richtext-foreground));
|
|
125
|
+
|
|
123
126
|
*,
|
|
124
127
|
::before,
|
|
125
128
|
::after {
|
package/lib/SearchAndReplace.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),P=require("scroll-into-view-if-needed"),i=require("react/jsx-runtime"),f=require("react"),c=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),P=require("scroll-into-view-if-needed"),i=require("react/jsx-runtime"),f=require("react"),c=require("./RichTextEditor-DtxJlApT.cjs"),A=require("./index-C19MB4Al.cjs");function w({editor:e,...t}){const{t:s}=A.useLocale(),[a,n]=f.useState(-1),[r,l]=f.useState([]),[o,x]=f.useState(""),[u,h]=f.useState(""),[m,C]=f.useState(!1),[p,I]=f.useState(!1);return f.useEffect(()=>{m||(x(""),h(""),n(-1),l([]),e.commands.setSearchTerm(""),e.commands.setReplaceTerm(""))},[e,m]),f.useEffect(()=>{m&&e&&e.commands&&e.commands.setSearchTerm&&e.commands.setSearchTerm(o)},[m,o,e]),f.useEffect(()=>{m&&e&&e.commands&&e.commands.setReplaceTerm&&e.commands.setReplaceTerm(u)},[m,u,e]),f.useEffect(()=>{if(!e)return;const d=e.extensionManager.extensions.find(R=>R.name===j.name);if(!d)return;const T=()=>{if(!m)return;const R=d?d.storage.currentIndex:-1,v=d?d.storage.results:[];n(E=>E!==R?R:E),l(E=>c.deepEqual(E,v)?E:v)};return c.listenEvent(c.EVENTS.SEARCH_REPLCE,T),()=>{d&&c.listenEvent(c.EVENTS.SEARCH_REPLCE,T)}},[m,e]),i.jsxs(c.Popover,{onOpenChange:C,open:m,children:[i.jsx(c.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:i.jsx(c.ActionButton,{disabled:t==null?void 0:t.disabled,isActive:t==null?void 0:t.isActive,tooltip:t==null?void 0:t.tooltip,children:i.jsx(c.IconComponent,{name:t==null?void 0:t.icon})})}),i.jsxs(c.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[i.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[i.jsx(c.Label,{children:s("editor.search.dialog.text")}),i.jsx("span",{className:"richtext-font-semibold",children:r.length>0?`${a+1}/${r.length}`:"0/0"})]}),i.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[i.jsx(c.Input,{autoFocus:!0,className:"richtext-w-full",onChange:d=>x(d.target.value),placeholder:"Text",required:!0,type:"text",value:o}),i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToPrevSearchResult,children:i.jsx(c.IconComponent,{name:"ChevronUp"})}),i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToNextSearchResult,children:i.jsx(c.IconComponent,{name:"ChevronDown"})})]}),i.jsx(c.Label,{className:"richtext-mb-[6px]",children:s("editor.replace.dialog.text")}),i.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:i.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:i.jsx(c.Input,{className:"richtext-w-80",onChange:d=>h(d.target.value),placeholder:"Text",required:!0,type:"text",value:u})})}),i.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2",children:[i.jsx(c.Switch,{checked:p,onCheckedChange:d=>{I(d),e.commands.setCaseSensitive(d)}}),i.jsx(c.Label,{children:s("editor.replace.caseSensitive")})]}),i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replace,children:s("editor.replace.dialog.text")}),i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replaceAll,children:s("editor.replaceAll.dialog.text")})]})]})]})}const S=(e,t)=>t(e.tr);function V(e,t,s){return RegExp(t?e.replace(/[$()*+./?[\\\]^{|}-]/g,String.raw`\$&`):e,s?"gu":"gui")}function L(e,t,s){const a=[];let n=[];const r=[];let l=0;if(!t)return{decorationsToReturn:[],results:[]};e==null||e.descendants((o,x)=>{o.isText?n[l]?n[l]={text:n[l].text+o.text,pos:n[l].pos}:n[l]={text:`${o.text}`,pos:x}:l+=1}),n=n.filter(Boolean);for(const{text:o,pos:x}of n){const u=[...o.matchAll(t)];for(const h of u){if(h[0]==="")break;h.index!==void 0&&r.push({from:x+h.index,to:x+h.index+h[0].length})}}for(const o of r)a.push(g.Decoration.inline(o.from,o.to,{class:s}));return{decorationsToReturn:a,results:r}}function b(e,t,{state:s,dispatch:a}){if(!t[0])return;const{from:r,to:l}=t[0];a&&a(s.tr.insertText(e,r,l))}function y(e,t,s,a){const n=t+1;if(!a[n])return null;const{from:r,to:l}=a[t],o=l-r-e.length+s,{from:x,to:u}=a[n];return a[n]={to:u-o,from:x-o},[o,a]}function D(e,t,{tr:s,dispatch:a}){let n=0,r=t.slice();if(r.length===0)return!1;for(let l=0;l<r.length;l+=1){const{from:o,to:x}=r[l];s.insertText(e,o,x);const u=y(e,l,n,r);u&&(n=u[0],r=u[1])}return a(s),!0}function N({view:e,tr:t,searchResults:s,searchResultCurrentClass:a,gotoIndex:n}){const r=s[n];if(r){const l=t.setMeta("directDecoration",{fromPos:r.from,toPos:r.to,attrs:{class:a}});return e==null||e.dispatch(l),setTimeout(()=>{const o=window.document.querySelector(`.${a}`);o&&P(o,{behavior:"smooth",scrollMode:"if-needed"})},0),!0}return!1}const j=g.Extension.create({name:"search",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),searchTerm:"",replaceTerm:"",results:[],currentIndex:0,searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!1,onChange:()=>{},button:({editor:t,t:s})=>({component:w,componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!1,disabled:!1,editor:t}})}},addStorage(){return{results:[],currentIndex:-1}},addCommands(){return{setSearchTerm:e=>({state:t,dispatch:s})=>(this.options.searchTerm=e,this.storage.results=[],this.storage.currentIndex=0,c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(t,s),!1),setReplaceTerm:e=>({state:t,dispatch:s})=>(this.options.replaceTerm=e,S(t,s),!1),setCaseSensitive:e=>({state:t,dispatch:s})=>(this.options.caseSensitive=e,S(t,s),!1),replace:()=>({state:e,dispatch:t})=>{const{replaceTerm:s}=this.options,{currentIndex:a,results:n}=this.storage,r=n[a];return r?(b(s,[r],{state:e,dispatch:t}),this.storage.results.splice(a,1)):(b(s,n,{state:e,dispatch:t}),this.storage.results.shift()),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(e,t),!1},replaceAll:()=>({state:e,tr:t,dispatch:s})=>{const{replaceTerm:a}=this.options,{results:n}=this.storage;return D(a,n,{tr:t,dispatch:s}),this.storage.currentIndex=-1,this.storage.results=[],c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(e,s),!1},goToPrevSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:s}=this.options,{currentIndex:a,results:n}=this.storage,r=(a+n.length-1)%n.length;return this.storage.currentIndex=r,c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),N({view:e,tr:t,searchResults:n,searchResultCurrentClass:s,gotoIndex:r})},goToNextSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:s}=this.options,{currentIndex:a,results:n}=this.storage,r=(a+1)%n.length;return this.storage.currentIndex=r,this.options.onChange&&this.options.onChange(),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),N({view:e,tr:t,searchResults:n,searchResultCurrentClass:s,gotoIndex:r})}}},addProseMirrorPlugins(){const e=this;return[new g.Plugin({key:new g.PluginKey("search"),state:{init(){return g.DecorationSet.empty},apply(t){const{doc:s,docChanged:a}=t,{searchTerm:n,searchResultClass:r,searchResultCurrentClass:l,disableRegex:o,caseSensitive:x}=e.options;if(a||n){const{decorationsToReturn:u,results:h}=L(s,V(n,o,x),r);if(e.storage.results=h,e.storage.currentIndex>h.length-1&&(e.storage.currentIndex=0),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),t.getMeta("directDecoration")){const{fromPos:m,toPos:C,attrs:p}=t.getMeta("directDecoration");u.push(g.Decoration.inline(m,C,p))}else h.length>0&&(u[0]=g.Decoration.inline(h[0].from,h[0].to,{class:l}));return g.DecorationSet.create(s,u)}return g.DecorationSet.empty}},props:{decorations(t){return this.getState(t)}}})]}});exports.SearchAndReplace=j;
|
|
@@ -125,11 +125,9 @@ declare module '@tiptap/core' {
|
|
|
125
125
|
|
|
126
126
|
declare module '@tiptap/core' {
|
|
127
127
|
interface Commands<ReturnType> {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
emoji: string;
|
|
132
|
-
}) => ReturnType;
|
|
128
|
+
drawer: {
|
|
129
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
130
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
133
131
|
};
|
|
134
132
|
}
|
|
135
133
|
}
|
|
@@ -137,9 +135,11 @@ declare module '@tiptap/core' {
|
|
|
137
135
|
|
|
138
136
|
declare module '@tiptap/core' {
|
|
139
137
|
interface Commands<ReturnType> {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
emoji: {
|
|
139
|
+
setEmoji: (emoji: {
|
|
140
|
+
name: string;
|
|
141
|
+
emoji: string;
|
|
142
|
+
}) => ReturnType;
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -190,6 +190,21 @@ declare module '@tiptap/core' {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
iframe: {
|
|
196
|
+
/**
|
|
197
|
+
* Add an iframe
|
|
198
|
+
*/
|
|
199
|
+
setIframe: (options: {
|
|
200
|
+
src: string;
|
|
201
|
+
service: string;
|
|
202
|
+
}) => ReturnType;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
193
208
|
declare module '@tiptap/core' {
|
|
194
209
|
interface Commands<ReturnType> {
|
|
195
210
|
imageUpload: {
|
|
@@ -210,21 +225,6 @@ declare module '@tiptap/core' {
|
|
|
210
225
|
}
|
|
211
226
|
|
|
212
227
|
|
|
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
228
|
declare module '@tiptap/core' {
|
|
229
229
|
interface Commands<ReturnType> {
|
|
230
230
|
imageGifUpload: {
|
|
@@ -263,9 +263,8 @@ declare module '@tiptap/core' {
|
|
|
263
263
|
|
|
264
264
|
declare module '@tiptap/core' {
|
|
265
265
|
interface Commands<ReturnType> {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
unsetLineHeight: () => ReturnType;
|
|
266
|
+
katex: {
|
|
267
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
269
268
|
};
|
|
270
269
|
}
|
|
271
270
|
}
|
|
@@ -273,8 +272,9 @@ declare module '@tiptap/core' {
|
|
|
273
272
|
|
|
274
273
|
declare module '@tiptap/core' {
|
|
275
274
|
interface Commands<ReturnType> {
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
lineHeight: {
|
|
276
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
277
|
+
unsetLineHeight: () => ReturnType;
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -331,14 +331,15 @@ declare module '@tiptap/core' {
|
|
|
331
331
|
|
|
332
332
|
declare module '@tiptap/core' {
|
|
333
333
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
334
|
+
video: {
|
|
335
335
|
/**
|
|
336
|
-
*
|
|
337
|
-
* @param options The tweet attributes
|
|
338
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
336
|
+
* Add an video
|
|
339
337
|
*/
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
339
|
+
/**
|
|
340
|
+
* Update an video
|
|
341
|
+
*/
|
|
342
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
342
343
|
};
|
|
343
344
|
}
|
|
344
345
|
}
|
|
@@ -346,15 +347,14 @@ declare module '@tiptap/core' {
|
|
|
346
347
|
|
|
347
348
|
declare module '@tiptap/core' {
|
|
348
349
|
interface Commands<ReturnType> {
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Add an video
|
|
352
|
-
*/
|
|
353
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
350
|
+
twitter: {
|
|
354
351
|
/**
|
|
355
|
-
*
|
|
352
|
+
* Insert a tweet
|
|
353
|
+
* @param options The tweet attributes
|
|
354
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
356
355
|
*/
|
|
357
|
-
|
|
356
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
357
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
|
@@ -125,11 +125,9 @@ declare module '@tiptap/core' {
|
|
|
125
125
|
|
|
126
126
|
declare module '@tiptap/core' {
|
|
127
127
|
interface Commands<ReturnType> {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
emoji: string;
|
|
132
|
-
}) => ReturnType;
|
|
128
|
+
drawer: {
|
|
129
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
130
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
133
131
|
};
|
|
134
132
|
}
|
|
135
133
|
}
|
|
@@ -137,9 +135,11 @@ declare module '@tiptap/core' {
|
|
|
137
135
|
|
|
138
136
|
declare module '@tiptap/core' {
|
|
139
137
|
interface Commands<ReturnType> {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
emoji: {
|
|
139
|
+
setEmoji: (emoji: {
|
|
140
|
+
name: string;
|
|
141
|
+
emoji: string;
|
|
142
|
+
}) => ReturnType;
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -190,6 +190,21 @@ declare module '@tiptap/core' {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
iframe: {
|
|
196
|
+
/**
|
|
197
|
+
* Add an iframe
|
|
198
|
+
*/
|
|
199
|
+
setIframe: (options: {
|
|
200
|
+
src: string;
|
|
201
|
+
service: string;
|
|
202
|
+
}) => ReturnType;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
193
208
|
declare module '@tiptap/core' {
|
|
194
209
|
interface Commands<ReturnType> {
|
|
195
210
|
imageUpload: {
|
|
@@ -210,21 +225,6 @@ declare module '@tiptap/core' {
|
|
|
210
225
|
}
|
|
211
226
|
|
|
212
227
|
|
|
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
228
|
declare module '@tiptap/core' {
|
|
229
229
|
interface Commands<ReturnType> {
|
|
230
230
|
imageGifUpload: {
|
|
@@ -263,9 +263,8 @@ declare module '@tiptap/core' {
|
|
|
263
263
|
|
|
264
264
|
declare module '@tiptap/core' {
|
|
265
265
|
interface Commands<ReturnType> {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
unsetLineHeight: () => ReturnType;
|
|
266
|
+
katex: {
|
|
267
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
269
268
|
};
|
|
270
269
|
}
|
|
271
270
|
}
|
|
@@ -273,8 +272,9 @@ declare module '@tiptap/core' {
|
|
|
273
272
|
|
|
274
273
|
declare module '@tiptap/core' {
|
|
275
274
|
interface Commands<ReturnType> {
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
lineHeight: {
|
|
276
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
277
|
+
unsetLineHeight: () => ReturnType;
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -331,14 +331,15 @@ declare module '@tiptap/core' {
|
|
|
331
331
|
|
|
332
332
|
declare module '@tiptap/core' {
|
|
333
333
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
334
|
+
video: {
|
|
335
335
|
/**
|
|
336
|
-
*
|
|
337
|
-
* @param options The tweet attributes
|
|
338
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
336
|
+
* Add an video
|
|
339
337
|
*/
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
339
|
+
/**
|
|
340
|
+
* Update an video
|
|
341
|
+
*/
|
|
342
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
342
343
|
};
|
|
343
344
|
}
|
|
344
345
|
}
|
|
@@ -346,15 +347,14 @@ declare module '@tiptap/core' {
|
|
|
346
347
|
|
|
347
348
|
declare module '@tiptap/core' {
|
|
348
349
|
interface Commands<ReturnType> {
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Add an video
|
|
352
|
-
*/
|
|
353
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
350
|
+
twitter: {
|
|
354
351
|
/**
|
|
355
|
-
*
|
|
352
|
+
* Insert a tweet
|
|
353
|
+
* @param options The tweet attributes
|
|
354
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
356
355
|
*/
|
|
357
|
-
|
|
356
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
357
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
package/lib/SearchAndReplace.js
CHANGED
|
@@ -2,7 +2,7 @@ import { E as _, P as M, a as $, b as N, D as P } from "./index-DI9T3iLd.js";
|
|
|
2
2
|
import q from "scroll-into-view-if-needed";
|
|
3
3
|
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
4
4
|
import { useState as g, useEffect as E } from "react";
|
|
5
|
-
import { l as k, E as d, P as B, m as j, A as F, k as A, n as O, L as I, o as y, B as T, S as W, p as K, q as R } from "./RichTextEditor-
|
|
5
|
+
import { l as k, E as d, P as B, m as j, A as F, k as A, n as O, L as I, o as y, B as T, S as W, p as K, q as R } from "./RichTextEditor-CtxIf8pq.js";
|
|
6
6
|
import { u as U } from "./index-Tj3Ci7xM.js";
|
|
7
7
|
function z({ editor: e, ...t }) {
|
|
8
8
|
const { t: s } = U(), [c, r] = g(-1), [n, i] = g([]), [a, u] = g(""), [l, h] = g(""), [x, v] = g(!1), [b, V] = g(!1);
|