reactjs-tiptap-editor 0.3.30 → 0.3.31
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-wiDnIxE2.cjs → ActionMenuButton-BCgqJsST.cjs} +1 -1
- package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-D97K0UWT.js} +5 -5
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +15 -15
- package/lib/Attachment.d.ts +15 -15
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +15 -15
- package/lib/Blockquote.d.ts +15 -15
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +15 -15
- package/lib/Bold.d.ts +15 -15
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +15 -15
- package/lib/BulletList.d.ts +15 -15
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +15 -15
- package/lib/Clear.d.ts +15 -15
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +15 -15
- package/lib/Code.d.ts +15 -15
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +15 -15
- package/lib/CodeBlock.d.ts +15 -15
- package/lib/CodeBlock.js +3 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +15 -15
- package/lib/CodeView.d.ts +15 -15
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +15 -15
- package/lib/Color.d.ts +15 -15
- package/lib/Color.js +2 -2
- package/lib/Document.d.cts +15 -15
- package/lib/Document.d.ts +15 -15
- package/lib/Drawer-5Q_-WRhc.cjs +1 -0
- package/lib/{Drawer-BKTU9CpU.js → Drawer-BHkje8ys.js} +250 -249
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +15 -15
- package/lib/Drawer.d.ts +15 -15
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +15 -15
- package/lib/Emoji.d.ts +15 -15
- package/lib/Emoji.js +22 -21
- package/lib/Excalidraw-CG498239.js +290 -0
- package/lib/Excalidraw-GUVW-IqC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +15 -15
- package/lib/Excalidraw.d.ts +15 -15
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +15 -15
- package/lib/ExportPdf.d.ts +15 -15
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +15 -15
- package/lib/ExportWord.d.ts +15 -15
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +15 -15
- package/lib/FontFamily.d.ts +15 -15
- package/lib/FontFamily.js +11 -10
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +15 -15
- package/lib/FontSize.d.ts +15 -15
- package/lib/FontSize.js +6 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +15 -15
- package/lib/FormatPainter.d.ts +15 -15
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +15 -15
- package/lib/Heading.d.ts +15 -15
- package/lib/Heading.js +32 -31
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +15 -15
- package/lib/Highlight.d.ts +15 -15
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +15 -15
- package/lib/History.d.ts +15 -15
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +15 -15
- package/lib/HorizontalRule.d.ts +15 -15
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +15 -15
- package/lib/Iframe.d.ts +15 -15
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +15 -15
- package/lib/Image.d.ts +15 -15
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +15 -15
- package/lib/ImageGif.d.ts +15 -15
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.d.cts +15 -15
- package/lib/ImportWord.d.ts +15 -15
- package/lib/ImportWord.js +3 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +15 -15
- package/lib/Indent.d.ts +15 -15
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +15 -15
- package/lib/Italic.d.ts +15 -15
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +15 -15
- package/lib/Katex.d.ts +15 -15
- package/lib/Katex.js +41 -40
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +15 -15
- package/lib/LineHeight.d.ts +15 -15
- package/lib/LineHeight.js +17 -16
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +15 -15
- package/lib/Link.d.ts +15 -15
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +15 -15
- package/lib/ListItem.d.ts +15 -15
- package/lib/Mention.d.cts +15 -15
- package/lib/Mention.d.ts +15 -15
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +15 -15
- package/lib/Mermaid.d.ts +15 -15
- package/lib/Mermaid.js +138 -137
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +15 -15
- package/lib/MoreMark.d.ts +15 -15
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +15 -15
- package/lib/MultiColumn.d.ts +15 -15
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +15 -15
- package/lib/OrderedList.d.ts +15 -15
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-C8Sm1E6J.cjs → RichTextEditor-DWlLqTl9.cjs} +4 -4
- package/lib/{RichTextEditor-BQN2eLD_.js → RichTextEditor-KP2Rgcqe.js} +15 -39
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +15 -15
- package/lib/SearchAndReplace.d.ts +15 -15
- package/lib/SearchAndReplace.js +68 -67
- package/lib/Selection.d.cts +15 -15
- package/lib/Selection.d.ts +15 -15
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +15 -15
- package/lib/SlashCommand.d.ts +15 -15
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +15 -15
- package/lib/Strike.d.ts +15 -15
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +15 -15
- package/lib/SubAndSuperScript.d.ts +15 -15
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +15 -15
- package/lib/Table.d.ts +15 -15
- package/lib/Table.js +2 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +15 -15
- package/lib/TableOfContent.d.ts +15 -15
- package/lib/TableOfContent.js +50 -49
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +15 -15
- package/lib/TaskList.d.ts +15 -15
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +15 -15
- package/lib/TextAlign.d.ts +15 -15
- package/lib/TextAlign.js +8 -7
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +15 -15
- package/lib/TextBubble.d.ts +15 -15
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +15 -15
- package/lib/TextDirection.d.ts +15 -15
- package/lib/TextDirection.js +14 -13
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +15 -15
- package/lib/TextUnderline.d.ts +15 -15
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +15 -15
- package/lib/TrailingNode.d.ts +15 -15
- package/lib/{Twitter-Dg6WWauX.js → Twitter-99ivY5qv.js} +62 -61
- package/lib/{Twitter-CL2pu4QM.cjs → Twitter-BvfvUtNT.cjs} +2 -2
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +15 -15
- package/lib/Twitter.d.ts +15 -15
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +15 -15
- package/lib/Video.d.ts +15 -15
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +15 -15
- package/lib/bubble-extra.d.ts +15 -15
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +16 -15
- package/lib/index.d.ts +16 -15
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +15 -15
- package/lib/locale-bundle.d.ts +15 -15
- package/lib/{textarea-BglwYF6b.js → textarea-CktfkXNe.js} +1 -1
- package/lib/{textarea-D5WVZMgt.cjs → textarea-DdH64g04.cjs} +1 -1
- package/package.json +1 -1
- package/lib/Drawer-CmoEF-Zg.cjs +0 -1
- package/lib/Excalidraw-CM74U5tG.js +0 -289
- package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
|
@@ -5900,6 +5900,7 @@ function ix(e) {
|
|
|
5900
5900
|
F,
|
|
5901
5901
|
{
|
|
5902
5902
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
5903
|
+
tooltipOptions: e == null ? void 0 : e.tooltipOptions,
|
|
5903
5904
|
isActive: e == null ? void 0 : e.isActive,
|
|
5904
5905
|
disabled: e == null ? void 0 : e.disabled,
|
|
5905
5906
|
children: /* @__PURE__ */ l(ye, { name: e == null ? void 0 : e.icon })
|
|
@@ -6800,7 +6801,8 @@ function xx(e) {
|
|
|
6800
6801
|
{
|
|
6801
6802
|
action: () => i(!0),
|
|
6802
6803
|
icon: e.icon,
|
|
6803
|
-
tooltip: e.tooltip
|
|
6804
|
+
tooltip: e.tooltip,
|
|
6805
|
+
tooltipOptions: e.tooltipOptions
|
|
6804
6806
|
}
|
|
6805
6807
|
) }),
|
|
6806
6808
|
/* @__PURE__ */ R(Rr, { children: [
|
|
@@ -7344,41 +7346,9 @@ const Rx = {
|
|
|
7344
7346
|
props: {
|
|
7345
7347
|
handlePaste: (r, n) => {
|
|
7346
7348
|
var a;
|
|
7347
|
-
|
|
7348
|
-
return;
|
|
7349
|
-
if ([...n.clipboardData.files || []].some((s) => s.type === "text/html"))
|
|
7350
|
-
return !1;
|
|
7351
|
-
if (n.clipboardData.items.length == 2) {
|
|
7352
|
-
n.clipboardData.items[0].getAsString((s) => {
|
|
7353
|
-
let c = "";
|
|
7354
|
-
if (s.replace(/src\s*=\s*"(.*)"/, (u, f) => c = f), c && typeof c == "string") {
|
|
7355
|
-
const u = r.state.schema.nodes.image.create({
|
|
7356
|
-
src: c
|
|
7357
|
-
}), f = r.state.tr.replaceSelectionWith(u);
|
|
7358
|
-
r.dispatch(f);
|
|
7359
|
-
}
|
|
7360
|
-
});
|
|
7361
|
-
return;
|
|
7362
|
-
}
|
|
7363
|
-
return Tx(r, n, t);
|
|
7349
|
+
return n.clipboardData && n.clipboardData.files && ((a = n.clipboardData.files) == null ? void 0 : a.length) ? [...n.clipboardData.files || []].some((s) => s.type === "text/html") ? !1 : Tx(r, n, t) : void 0;
|
|
7364
7350
|
},
|
|
7365
|
-
handleDrop: (r, n, i, o) =>
|
|
7366
|
-
if (!(n instanceof DragEvent) || !n.dataTransfer)
|
|
7367
|
-
return !1;
|
|
7368
|
-
if (n.dataTransfer.items.length == 2) {
|
|
7369
|
-
n.dataTransfer.items[0].getAsString((a) => {
|
|
7370
|
-
let s = "";
|
|
7371
|
-
if (a.replace(/src\s*=\s*"(.*)"/, (c, u) => s = u), s && typeof s == "string") {
|
|
7372
|
-
const c = r.state.schema.nodes.image.create({
|
|
7373
|
-
src: s
|
|
7374
|
-
}), u = r.state.tr.replaceSelectionWith(c);
|
|
7375
|
-
r.dispatch(u);
|
|
7376
|
-
}
|
|
7377
|
-
});
|
|
7378
|
-
return;
|
|
7379
|
-
}
|
|
7380
|
-
return Ex(r, n, o, t), !1;
|
|
7381
|
-
}
|
|
7351
|
+
handleDrop: (r, n, i, o) => (!(n instanceof DragEvent) || !n.dataTransfer || Ex(r, n, o, t), !1)
|
|
7382
7352
|
}
|
|
7383
7353
|
})
|
|
7384
7354
|
];
|
|
@@ -7510,7 +7480,8 @@ function Lx({ editor: e, icon: t, provider: r, apiKey: n, ...i }) {
|
|
|
7510
7480
|
F,
|
|
7511
7481
|
{
|
|
7512
7482
|
icon: t,
|
|
7513
|
-
tooltip: i == null ? void 0 : i.tooltip
|
|
7483
|
+
tooltip: i == null ? void 0 : i.tooltip,
|
|
7484
|
+
tooltipOptions: i == null ? void 0 : i.tooltipOptions
|
|
7514
7485
|
}
|
|
7515
7486
|
)
|
|
7516
7487
|
}
|
|
@@ -7840,7 +7811,8 @@ function Dx(e) {
|
|
|
7840
7811
|
{
|
|
7841
7812
|
action: () => c(!0),
|
|
7842
7813
|
icon: e.icon,
|
|
7843
|
-
tooltip: e.tooltip
|
|
7814
|
+
tooltip: e.tooltip,
|
|
7815
|
+
tooltipOptions: e.tooltipOptions
|
|
7844
7816
|
}
|
|
7845
7817
|
) }),
|
|
7846
7818
|
/* @__PURE__ */ R(Rr, { children: [
|
|
@@ -12322,7 +12294,7 @@ function Z2({ editor: e, disabled: t, toolbar: r }) {
|
|
|
12322
12294
|
children: /* @__PURE__ */ l("div", { className: "richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1", children: c })
|
|
12323
12295
|
}
|
|
12324
12296
|
), s = o.map((c, u) => {
|
|
12325
|
-
var d, h;
|
|
12297
|
+
var d, h, p, m;
|
|
12326
12298
|
const f = c.button.component;
|
|
12327
12299
|
return /* @__PURE__ */ R("div", { className: "richtext-flex richtext-items-center", children: [
|
|
12328
12300
|
(c == null ? void 0 : c.spacer) && /* @__PURE__ */ l(Ge, { orientation: "vertical", className: "!richtext-h-[16px] !richtext-mx-[10px]" }),
|
|
@@ -12330,7 +12302,11 @@ function Z2({ editor: e, disabled: t, toolbar: r }) {
|
|
|
12330
12302
|
f,
|
|
12331
12303
|
{
|
|
12332
12304
|
...c.button.componentProps,
|
|
12333
|
-
disabled: t || ((h = (d = c == null ? void 0 : c.button) == null ? void 0 : d.componentProps) == null ? void 0 : h.disabled)
|
|
12305
|
+
disabled: t || ((h = (d = c == null ? void 0 : c.button) == null ? void 0 : d.componentProps) == null ? void 0 : h.disabled),
|
|
12306
|
+
tooltipOptions: {
|
|
12307
|
+
...(m = (p = c == null ? void 0 : c.button) == null ? void 0 : p.componentProps) == null ? void 0 : m.tooltipOptions,
|
|
12308
|
+
side: (r == null ? void 0 : r.tooltipSide) ?? "top"
|
|
12309
|
+
}
|
|
12334
12310
|
}
|
|
12335
12311
|
),
|
|
12336
12312
|
(c == null ? void 0 : c.divider) && /* @__PURE__ */ l(Ge, { orientation: "vertical", className: "!richtext-h-auto !richtext-mx-2" })
|
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"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),P=require("scroll-into-view-if-needed"),a=require("react/jsx-runtime"),f=require("react"),c=require("./RichTextEditor-DWlLqTl9.cjs"),A=require("./index-D_A0TBRA.cjs");function w({editor:e,...t}){const{t:s}=A.useLocale(),[i,n]=f.useState(-1),[r,l]=f.useState([]),[o,x]=f.useState(""),[u,h]=f.useState(""),[m,C]=f.useState(!1),[T,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 p=()=>{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,p),()=>{d&&c.listenEvent(c.EVENTS.SEARCH_REPLCE,p)}},[m,e]),a.jsxs(c.Popover,{onOpenChange:C,open:m,children:[a.jsx(c.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:a.jsx(c.ActionButton,{disabled:t==null?void 0:t.disabled,isActive:t==null?void 0:t.isActive,tooltip:t==null?void 0:t.tooltip,tooltipOptions:t==null?void 0:t.tooltipOptions,children:a.jsx(c.IconComponent,{name:t==null?void 0:t.icon})})}),a.jsxs(c.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[a.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[a.jsx(c.Label,{children:s("editor.search.dialog.text")}),a.jsx("span",{className:"richtext-font-semibold",children:r.length>0?`${i+1}/${r.length}`:"0/0"})]}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[a.jsx(c.Input,{autoFocus:!0,className:"richtext-w-full",onChange:d=>x(d.target.value),placeholder:"Text",required:!0,type:"text",value:o}),a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToPrevSearchResult,children:a.jsx(c.IconComponent,{name:"ChevronUp"})}),a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToNextSearchResult,children:a.jsx(c.IconComponent,{name:"ChevronDown"})})]}),a.jsx(c.Label,{className:"richtext-mb-[6px]",children:s("editor.replace.dialog.text")}),a.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(c.Input,{className:"richtext-w-80",onChange:d=>h(d.target.value),placeholder:"Text",required:!0,type:"text",value:u})})}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2",children:[a.jsx(c.Switch,{checked:T,onCheckedChange:d=>{I(d),e.commands.setCaseSensitive(d)}}),a.jsx(c.Label,{children:s("editor.replace.caseSensitive")})]}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replace,children:s("editor.replace.dialog.text")}),a.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 i=[];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)i.push(g.Decoration.inline(o.from,o.to,{class:s}));return{decorationsToReturn:i,results:r}}function b(e,t,{state:s,dispatch:i}){if(!t[0])return;const{from:r,to:l}=t[0];i&&i(s.tr.insertText(e,r,l))}function y(e,t,s,i){const n=t+1;if(!i[n])return null;const{from:r,to:l}=i[t],o=l-r-e.length+s,{from:x,to:u}=i[n];return i[n]={to:u-o,from:x-o},[o,i]}function D(e,t,{tr:s,dispatch:i}){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 i(s),!0}function N({view:e,tr:t,searchResults:s,searchResultCurrentClass:i,gotoIndex:n}){const r=s[n];if(r){const l=t.setMeta("directDecoration",{fromPos:r.from,toPos:r.to,attrs:{class:i}});return e==null||e.dispatch(l),setTimeout(()=>{const o=window.document.querySelector(`.${i}`);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:i,results:n}=this.storage,r=n[i];return r?(b(s,[r],{state:e,dispatch:t}),this.storage.results.splice(i,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:i}=this.options,{results:n}=this.storage;return D(i,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:i,results:n}=this.storage,r=(i+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:i,results:n}=this.storage,r=(i+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:i}=t,{searchTerm:n,searchResultClass:r,searchResultCurrentClass:l,disableRegex:o,caseSensitive:x}=e.options;if(i||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:T}=t.getMeta("directDecoration");u.push(g.Decoration.inline(m,C,T))}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;
|
|
@@ -201,6 +201,21 @@ declare module '@tiptap/core' {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
|
|
204
|
+
declare module '@tiptap/core' {
|
|
205
|
+
interface Commands<ReturnType> {
|
|
206
|
+
iframe: {
|
|
207
|
+
/**
|
|
208
|
+
* Add an iframe
|
|
209
|
+
*/
|
|
210
|
+
setIframe: (options: {
|
|
211
|
+
src: string;
|
|
212
|
+
service: string;
|
|
213
|
+
}) => ReturnType;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
204
219
|
declare module '@tiptap/core' {
|
|
205
220
|
interface Commands<ReturnType> {
|
|
206
221
|
imageUpload: {
|
|
@@ -221,21 +236,6 @@ declare module '@tiptap/core' {
|
|
|
221
236
|
}
|
|
222
237
|
|
|
223
238
|
|
|
224
|
-
declare module '@tiptap/core' {
|
|
225
|
-
interface Commands<ReturnType> {
|
|
226
|
-
iframe: {
|
|
227
|
-
/**
|
|
228
|
-
* Add an iframe
|
|
229
|
-
*/
|
|
230
|
-
setIframe: (options: {
|
|
231
|
-
src: string;
|
|
232
|
-
service: string;
|
|
233
|
-
}) => ReturnType;
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
239
|
declare module '@tiptap/core' {
|
|
240
240
|
interface Commands<ReturnType> {
|
|
241
241
|
imageGifUpload: {
|
|
@@ -201,6 +201,21 @@ declare module '@tiptap/core' {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
|
|
204
|
+
declare module '@tiptap/core' {
|
|
205
|
+
interface Commands<ReturnType> {
|
|
206
|
+
iframe: {
|
|
207
|
+
/**
|
|
208
|
+
* Add an iframe
|
|
209
|
+
*/
|
|
210
|
+
setIframe: (options: {
|
|
211
|
+
src: string;
|
|
212
|
+
service: string;
|
|
213
|
+
}) => ReturnType;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
204
219
|
declare module '@tiptap/core' {
|
|
205
220
|
interface Commands<ReturnType> {
|
|
206
221
|
imageUpload: {
|
|
@@ -221,21 +236,6 @@ declare module '@tiptap/core' {
|
|
|
221
236
|
}
|
|
222
237
|
|
|
223
238
|
|
|
224
|
-
declare module '@tiptap/core' {
|
|
225
|
-
interface Commands<ReturnType> {
|
|
226
|
-
iframe: {
|
|
227
|
-
/**
|
|
228
|
-
* Add an iframe
|
|
229
|
-
*/
|
|
230
|
-
setIframe: (options: {
|
|
231
|
-
src: string;
|
|
232
|
-
service: string;
|
|
233
|
-
}) => ReturnType;
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
239
|
declare module '@tiptap/core' {
|
|
240
240
|
interface Commands<ReturnType> {
|
|
241
241
|
imageGifUpload: {
|
package/lib/SearchAndReplace.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
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
|
-
import { useState as g, useEffect as
|
|
5
|
-
import { l as k, E as d, P as B, m as
|
|
4
|
+
import { useState as g, useEffect as p } from "react";
|
|
5
|
+
import { l as k, E as d, P as B, m as O, A as j, k as A, n as F, L as I, o as y, B as T, S as W, p as K, q as R } from "./RichTextEditor-KP2Rgcqe.js";
|
|
6
6
|
import { u as U } from "./index-CsK90iVd.js";
|
|
7
7
|
function z({ editor: e, ...t }) {
|
|
8
|
-
const { t: s } = U(), [c,
|
|
9
|
-
return
|
|
10
|
-
x || (u(""), h(""),
|
|
11
|
-
}, [e, x]),
|
|
8
|
+
const { t: s } = U(), [c, n] = g(-1), [r, i] = g([]), [a, u] = g(""), [l, h] = g(""), [x, v] = g(!1), [b, V] = g(!1);
|
|
9
|
+
return p(() => {
|
|
10
|
+
x || (u(""), h(""), n(-1), i([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
|
|
11
|
+
}, [e, x]), p(() => {
|
|
12
12
|
x && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(a);
|
|
13
|
-
}, [x, a, e]),
|
|
13
|
+
}, [x, a, e]), p(() => {
|
|
14
14
|
x && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(l);
|
|
15
|
-
}, [x, l, e]),
|
|
15
|
+
}, [x, l, e]), p(() => {
|
|
16
16
|
if (!e)
|
|
17
17
|
return;
|
|
18
|
-
const m = e.extensionManager.extensions.find((
|
|
18
|
+
const m = e.extensionManager.extensions.find((E) => E.name === Y.name);
|
|
19
19
|
if (!m)
|
|
20
20
|
return;
|
|
21
21
|
const w = () => {
|
|
22
22
|
if (!x)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const E = m ? m.storage.currentIndex : -1, L = m ? m.storage.results : [];
|
|
25
|
+
n((C) => C !== E ? E : C), i((C) => K(C, L) ? C : L);
|
|
26
26
|
};
|
|
27
27
|
return k(d.SEARCH_REPLCE, w), () => {
|
|
28
28
|
m && k(d.SEARCH_REPLCE, w);
|
|
@@ -34,23 +34,24 @@ function z({ editor: e, ...t }) {
|
|
|
34
34
|
open: x,
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ o(
|
|
37
|
-
|
|
37
|
+
O,
|
|
38
38
|
{
|
|
39
39
|
asChild: !0,
|
|
40
40
|
disabled: t == null ? void 0 : t.disabled,
|
|
41
41
|
children: /* @__PURE__ */ o(
|
|
42
|
-
|
|
42
|
+
j,
|
|
43
43
|
{
|
|
44
44
|
disabled: t == null ? void 0 : t.disabled,
|
|
45
45
|
isActive: t == null ? void 0 : t.isActive,
|
|
46
46
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
47
|
+
tooltipOptions: t == null ? void 0 : t.tooltipOptions,
|
|
47
48
|
children: /* @__PURE__ */ o(A, { name: t == null ? void 0 : t.icon })
|
|
48
49
|
}
|
|
49
50
|
)
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
53
|
/* @__PURE__ */ f(
|
|
53
|
-
|
|
54
|
+
F,
|
|
54
55
|
{
|
|
55
56
|
align: "start",
|
|
56
57
|
className: "richtext-w-full",
|
|
@@ -59,7 +60,7 @@ function z({ editor: e, ...t }) {
|
|
|
59
60
|
children: [
|
|
60
61
|
/* @__PURE__ */ f("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
|
|
61
62
|
/* @__PURE__ */ o(I, { children: s("editor.search.dialog.text") }),
|
|
62
|
-
/* @__PURE__ */ o("span", { className: "richtext-font-semibold", children:
|
|
63
|
+
/* @__PURE__ */ o("span", { className: "richtext-font-semibold", children: r.length > 0 ? `${c + 1}/${r.length}` : "0/0" })
|
|
63
64
|
] }),
|
|
64
65
|
/* @__PURE__ */ f("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: [
|
|
65
66
|
/* @__PURE__ */ o(
|
|
@@ -78,7 +79,7 @@ function z({ editor: e, ...t }) {
|
|
|
78
79
|
T,
|
|
79
80
|
{
|
|
80
81
|
className: "richtext-flex-1",
|
|
81
|
-
disabled:
|
|
82
|
+
disabled: r.length === 0,
|
|
82
83
|
onClick: e.commands.goToPrevSearchResult,
|
|
83
84
|
children: /* @__PURE__ */ o(A, { name: "ChevronUp" })
|
|
84
85
|
}
|
|
@@ -87,7 +88,7 @@ function z({ editor: e, ...t }) {
|
|
|
87
88
|
T,
|
|
88
89
|
{
|
|
89
90
|
className: "richtext-flex-1",
|
|
90
|
-
disabled:
|
|
91
|
+
disabled: r.length === 0,
|
|
91
92
|
onClick: e.commands.goToNextSearchResult,
|
|
92
93
|
children: /* @__PURE__ */ o(A, { name: "ChevronDown" })
|
|
93
94
|
}
|
|
@@ -122,7 +123,7 @@ function z({ editor: e, ...t }) {
|
|
|
122
123
|
T,
|
|
123
124
|
{
|
|
124
125
|
className: "richtext-flex-1",
|
|
125
|
-
disabled:
|
|
126
|
+
disabled: r.length === 0,
|
|
126
127
|
onClick: e.commands.replace,
|
|
127
128
|
children: s("editor.replace.dialog.text")
|
|
128
129
|
}
|
|
@@ -131,7 +132,7 @@ function z({ editor: e, ...t }) {
|
|
|
131
132
|
T,
|
|
132
133
|
{
|
|
133
134
|
className: "richtext-flex-1",
|
|
134
|
-
disabled:
|
|
135
|
+
disabled: r.length === 0,
|
|
135
136
|
onClick: e.commands.replaceAll,
|
|
136
137
|
children: s("editor.replaceAll.dialog.text")
|
|
137
138
|
}
|
|
@@ -144,78 +145,78 @@ function z({ editor: e, ...t }) {
|
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
|
-
const
|
|
148
|
+
const S = (e, t) => t(e.tr);
|
|
148
149
|
function G(e, t, s) {
|
|
149
150
|
return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, s ? "gu" : "gui");
|
|
150
151
|
}
|
|
151
152
|
function J(e, t, s) {
|
|
152
153
|
const c = [];
|
|
153
|
-
let
|
|
154
|
-
const
|
|
154
|
+
let n = [];
|
|
155
|
+
const r = [];
|
|
155
156
|
let i = 0;
|
|
156
157
|
if (!t)
|
|
157
158
|
return { decorationsToReturn: [], results: [] };
|
|
158
159
|
e == null || e.descendants((a, u) => {
|
|
159
|
-
a.isText ?
|
|
160
|
-
text:
|
|
161
|
-
pos:
|
|
162
|
-
} :
|
|
160
|
+
a.isText ? n[i] ? n[i] = {
|
|
161
|
+
text: n[i].text + a.text,
|
|
162
|
+
pos: n[i].pos
|
|
163
|
+
} : n[i] = {
|
|
163
164
|
text: `${a.text}`,
|
|
164
165
|
pos: u
|
|
165
166
|
} : i += 1;
|
|
166
|
-
}),
|
|
167
|
-
for (const { text: a, pos: u } of
|
|
167
|
+
}), n = n.filter(Boolean);
|
|
168
|
+
for (const { text: a, pos: u } of n) {
|
|
168
169
|
const l = [...a.matchAll(t)];
|
|
169
170
|
for (const h of l) {
|
|
170
171
|
if (h[0] === "")
|
|
171
172
|
break;
|
|
172
|
-
h.index !== void 0 &&
|
|
173
|
+
h.index !== void 0 && r.push({
|
|
173
174
|
from: u + h.index,
|
|
174
175
|
to: u + h.index + h[0].length
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
|
-
for (const a of
|
|
179
|
+
for (const a of r)
|
|
179
180
|
c.push(N.inline(a.from, a.to, { class: s }));
|
|
180
181
|
return {
|
|
181
182
|
decorationsToReturn: c,
|
|
182
|
-
results:
|
|
183
|
+
results: r
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
186
|
function D(e, t, { state: s, dispatch: c }) {
|
|
186
187
|
if (!t[0])
|
|
187
188
|
return;
|
|
188
|
-
const { from:
|
|
189
|
-
c && c(s.tr.insertText(e,
|
|
189
|
+
const { from: r, to: i } = t[0];
|
|
190
|
+
c && c(s.tr.insertText(e, r, i));
|
|
190
191
|
}
|
|
191
192
|
function Q(e, t, s, c) {
|
|
192
|
-
const
|
|
193
|
-
if (!c[
|
|
193
|
+
const n = t + 1;
|
|
194
|
+
if (!c[n])
|
|
194
195
|
return null;
|
|
195
|
-
const { from:
|
|
196
|
-
return c[
|
|
196
|
+
const { from: r, to: i } = c[t], a = i - r - e.length + s, { from: u, to: l } = c[n];
|
|
197
|
+
return c[n] = {
|
|
197
198
|
to: l - a,
|
|
198
199
|
from: u - a
|
|
199
200
|
}, [a, c];
|
|
200
201
|
}
|
|
201
202
|
function X(e, t, { tr: s, dispatch: c }) {
|
|
202
|
-
let
|
|
203
|
-
if (
|
|
203
|
+
let n = 0, r = t.slice();
|
|
204
|
+
if (r.length === 0)
|
|
204
205
|
return !1;
|
|
205
|
-
for (let i = 0; i <
|
|
206
|
-
const { from: a, to: u } =
|
|
206
|
+
for (let i = 0; i < r.length; i += 1) {
|
|
207
|
+
const { from: a, to: u } = r[i];
|
|
207
208
|
s.insertText(e, a, u);
|
|
208
|
-
const l = Q(e, i,
|
|
209
|
-
l && (
|
|
209
|
+
const l = Q(e, i, n, r);
|
|
210
|
+
l && (n = l[0], r = l[1]);
|
|
210
211
|
}
|
|
211
212
|
return c(s), !0;
|
|
212
213
|
}
|
|
213
|
-
function H({ view: e, tr: t, searchResults: s, searchResultCurrentClass: c, gotoIndex:
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
214
|
+
function H({ view: e, tr: t, searchResults: s, searchResultCurrentClass: c, gotoIndex: n }) {
|
|
215
|
+
const r = s[n];
|
|
216
|
+
if (r) {
|
|
216
217
|
const i = t.setMeta("directDecoration", {
|
|
217
|
-
fromPos:
|
|
218
|
-
toPos:
|
|
218
|
+
fromPos: r.from,
|
|
219
|
+
toPos: r.to,
|
|
219
220
|
attrs: { class: c }
|
|
220
221
|
});
|
|
221
222
|
return e == null || e.dispatch(i), setTimeout(() => {
|
|
@@ -263,35 +264,35 @@ const Y = /* @__PURE__ */ _.create({
|
|
|
263
264
|
},
|
|
264
265
|
addCommands() {
|
|
265
266
|
return {
|
|
266
|
-
setSearchTerm: (e) => ({ state: t, dispatch: s }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, R(d.SEARCH_REPLCE),
|
|
267
|
-
setReplaceTerm: (e) => ({ state: t, dispatch: s }) => (this.options.replaceTerm = e,
|
|
268
|
-
setCaseSensitive: (e) => ({ state: t, dispatch: s }) => (this.options.caseSensitive = e,
|
|
267
|
+
setSearchTerm: (e) => ({ state: t, dispatch: s }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, R(d.SEARCH_REPLCE), S(t, s), !1),
|
|
268
|
+
setReplaceTerm: (e) => ({ state: t, dispatch: s }) => (this.options.replaceTerm = e, S(t, s), !1),
|
|
269
|
+
setCaseSensitive: (e) => ({ state: t, dispatch: s }) => (this.options.caseSensitive = e, S(t, s), !1),
|
|
269
270
|
replace: () => ({ state: e, dispatch: t }) => {
|
|
270
|
-
const { replaceTerm: s } = this.options, { currentIndex: c, results:
|
|
271
|
-
return
|
|
271
|
+
const { replaceTerm: s } = this.options, { currentIndex: c, results: n } = this.storage, r = n[c];
|
|
272
|
+
return r ? (D(s, [r], { state: e, dispatch: t }), this.storage.results.splice(c, 1)) : (D(s, n, { state: e, dispatch: t }), this.storage.results.shift()), R(d.SEARCH_REPLCE), S(e, t), !1;
|
|
272
273
|
},
|
|
273
274
|
replaceAll: () => ({ state: e, tr: t, dispatch: s }) => {
|
|
274
|
-
const { replaceTerm: c } = this.options, { results:
|
|
275
|
-
return X(c,
|
|
275
|
+
const { replaceTerm: c } = this.options, { results: n } = this.storage;
|
|
276
|
+
return X(c, n, { tr: t, dispatch: s }), this.storage.currentIndex = -1, this.storage.results = [], R(d.SEARCH_REPLCE), S(e, s), !1;
|
|
276
277
|
},
|
|
277
278
|
goToPrevSearchResult: () => ({ view: e, tr: t }) => {
|
|
278
|
-
const { searchResultCurrentClass: s } = this.options, { currentIndex: c, results:
|
|
279
|
-
return this.storage.currentIndex =
|
|
279
|
+
const { searchResultCurrentClass: s } = this.options, { currentIndex: c, results: n } = this.storage, r = (c + n.length - 1) % n.length;
|
|
280
|
+
return this.storage.currentIndex = r, R(d.SEARCH_REPLCE), H({
|
|
280
281
|
view: e,
|
|
281
282
|
tr: t,
|
|
282
|
-
searchResults:
|
|
283
|
+
searchResults: n,
|
|
283
284
|
searchResultCurrentClass: s,
|
|
284
|
-
gotoIndex:
|
|
285
|
+
gotoIndex: r
|
|
285
286
|
});
|
|
286
287
|
},
|
|
287
288
|
goToNextSearchResult: () => ({ view: e, tr: t }) => {
|
|
288
|
-
const { searchResultCurrentClass: s } = this.options, { currentIndex: c, results:
|
|
289
|
-
return this.storage.currentIndex =
|
|
289
|
+
const { searchResultCurrentClass: s } = this.options, { currentIndex: c, results: n } = this.storage, r = (c + 1) % n.length;
|
|
290
|
+
return this.storage.currentIndex = r, this.options.onChange && this.options.onChange(), R(d.SEARCH_REPLCE), H({
|
|
290
291
|
view: e,
|
|
291
292
|
tr: t,
|
|
292
|
-
searchResults:
|
|
293
|
+
searchResults: n,
|
|
293
294
|
searchResultCurrentClass: s,
|
|
294
|
-
gotoIndex:
|
|
295
|
+
gotoIndex: r
|
|
295
296
|
});
|
|
296
297
|
}
|
|
297
298
|
};
|
|
@@ -306,12 +307,12 @@ const Y = /* @__PURE__ */ _.create({
|
|
|
306
307
|
return P.empty;
|
|
307
308
|
},
|
|
308
309
|
apply(t) {
|
|
309
|
-
const { doc: s, docChanged: c } = t, { searchTerm:
|
|
310
|
-
if (c ||
|
|
310
|
+
const { doc: s, docChanged: c } = t, { searchTerm: n, searchResultClass: r, searchResultCurrentClass: i, disableRegex: a, caseSensitive: u } = e.options;
|
|
311
|
+
if (c || n) {
|
|
311
312
|
const { decorationsToReturn: l, results: h } = J(
|
|
312
313
|
s,
|
|
313
|
-
G(
|
|
314
|
-
|
|
314
|
+
G(n, a, u),
|
|
315
|
+
r
|
|
315
316
|
);
|
|
316
317
|
if (e.storage.results = h, e.storage.currentIndex > h.length - 1 && (e.storage.currentIndex = 0), R(d.SEARCH_REPLCE), t.getMeta("directDecoration")) {
|
|
317
318
|
const { fromPos: x, toPos: v, attrs: b } = t.getMeta("directDecoration");
|
package/lib/Selection.d.cts
CHANGED
|
@@ -113,6 +113,21 @@ declare module '@tiptap/core' {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
declare module '@tiptap/core' {
|
|
117
|
+
interface Commands<ReturnType> {
|
|
118
|
+
iframe: {
|
|
119
|
+
/**
|
|
120
|
+
* Add an iframe
|
|
121
|
+
*/
|
|
122
|
+
setIframe: (options: {
|
|
123
|
+
src: string;
|
|
124
|
+
service: string;
|
|
125
|
+
}) => ReturnType;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
116
131
|
declare module '@tiptap/core' {
|
|
117
132
|
interface Commands<ReturnType> {
|
|
118
133
|
imageUpload: {
|
|
@@ -133,21 +148,6 @@ declare module '@tiptap/core' {
|
|
|
133
148
|
}
|
|
134
149
|
|
|
135
150
|
|
|
136
|
-
declare module '@tiptap/core' {
|
|
137
|
-
interface Commands<ReturnType> {
|
|
138
|
-
iframe: {
|
|
139
|
-
/**
|
|
140
|
-
* Add an iframe
|
|
141
|
-
*/
|
|
142
|
-
setIframe: (options: {
|
|
143
|
-
src: string;
|
|
144
|
-
service: string;
|
|
145
|
-
}) => ReturnType;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
151
|
declare module '@tiptap/core' {
|
|
152
152
|
interface Commands<ReturnType> {
|
|
153
153
|
imageGifUpload: {
|
package/lib/Selection.d.ts
CHANGED
|
@@ -113,6 +113,21 @@ declare module '@tiptap/core' {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
declare module '@tiptap/core' {
|
|
117
|
+
interface Commands<ReturnType> {
|
|
118
|
+
iframe: {
|
|
119
|
+
/**
|
|
120
|
+
* Add an iframe
|
|
121
|
+
*/
|
|
122
|
+
setIframe: (options: {
|
|
123
|
+
src: string;
|
|
124
|
+
service: string;
|
|
125
|
+
}) => ReturnType;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
116
131
|
declare module '@tiptap/core' {
|
|
117
132
|
interface Commands<ReturnType> {
|
|
118
133
|
imageUpload: {
|
|
@@ -133,21 +148,6 @@ declare module '@tiptap/core' {
|
|
|
133
148
|
}
|
|
134
149
|
|
|
135
150
|
|
|
136
|
-
declare module '@tiptap/core' {
|
|
137
|
-
interface Commands<ReturnType> {
|
|
138
|
-
iframe: {
|
|
139
|
-
/**
|
|
140
|
-
* Add an iframe
|
|
141
|
-
*/
|
|
142
|
-
setIframe: (options: {
|
|
143
|
-
src: string;
|
|
144
|
-
service: string;
|
|
145
|
-
}) => ReturnType;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
151
|
declare module '@tiptap/core' {
|
|
152
152
|
interface Commands<ReturnType> {
|
|
153
153
|
imageGifUpload: {
|