reactjs-tiptap-editor 1.0.26 → 1.0.29
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-B4KDkZ0z.js → ActionMenuButton-BhiGvRJ7.js} +1 -1
- package/lib/{ActionMenuButton-C3Cfeza9.cjs → ActionMenuButton-qUxkZlQg.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +27 -27
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.js +251 -244
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout-B9uXfbP3.js +340 -0
- package/lib/Callout-C_TXsss3.cjs +1 -0
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +8 -222
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +2 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +3 -3
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +2 -2
- package/lib/{Drawer-D7E9kTca.cjs → Drawer-D3B4lQJF.cjs} +1 -1
- package/lib/{Drawer-DA0FLHs9.js → Drawer-h401Yy6Y.js} +20 -20
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +168 -135
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +5 -5
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.js +2 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +10 -10
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +3 -3
- package/lib/History.cjs +2 -2
- package/lib/History.js +584 -531
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-DZ3r3QzK.js → Iframe-Dhn40BXx.js} +3 -3
- package/lib/{Iframe-OMVd0xa_.cjs → Iframe-bvGuzYwC.cjs} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +9 -6
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +19 -19
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +15 -15
- package/lib/{Indent-kI4G-clX.js → Indent-BK9DvCL7.js} +2 -2
- package/lib/{Indent-QgCoonRk.cjs → Indent-IOByomps.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -2
- package/lib/{Katex-BPbXjcZQ.js → Katex-C_Ah9G9w.js} +7 -6
- package/lib/Katex-oLGrtLTf.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +3 -3
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +4 -4
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-Z7RRurvx.cjs → LinkEditBlock-BojxdGTm.cjs} +2 -2
- package/lib/{LinkEditBlock-BYWwH2_x.js → LinkEditBlock-DRdKXffy.js} +39 -35
- package/lib/MarkdownPaste.cjs +1 -1
- package/lib/MarkdownPaste.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +4 -4
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +62 -61
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +5 -5
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +8 -8
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +7 -7
- package/lib/{SlashCommandNodeView-DPPmYEjC.cjs → SlashCommandNodeView-Dai-O3aD.cjs} +1 -1
- package/lib/{SlashCommandNodeView-C0l3Fb_3.js → SlashCommandNodeView-qwW9cuYt.js} +6 -6
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-DwseaFSD.js → Table-BKM8SvVj.js} +20 -20
- package/lib/{Table-D5G3rfwb.cjs → Table-CWI7tKme.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +3 -3
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +3 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -2
- package/lib/{Twitter-q4ZGZL0i.cjs → Twitter-BfsPzA8_.cjs} +1 -1
- package/lib/{Twitter-DP26Lkn8.js → Twitter-CofLQ-zj.js} +9 -9
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -5
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +2258 -2552
- package/lib/{clsx-DRbkQ4T7.cjs → clsx-DJURdKPs.cjs} +2 -2
- package/lib/{clsx-_bq4MQQ7.js → clsx-b_2OwHLk.js} +19 -19
- package/lib/{dropdown-menu-CURWpB9o.cjs → dropdown-menu-CEMxzgnU.cjs} +1 -1
- package/lib/{dropdown-menu-BKSX4gvT.js → dropdown-menu-CKAKsyqu.js} +1 -1
- package/lib/extensions/Image/Image.d.ts +13 -1
- package/lib/index-BJQ1G8B1.js +311 -0
- package/lib/index-BO82_0q8.cjs +1 -0
- package/lib/{index-DQy9iBzV.js → index-Bn_WPziX.js} +1 -1
- package/lib/{index-BpLw6ebr.cjs → index-CwbGrQFa.cjs} +1 -1
- package/lib/{index-DtyAGMbq.js → index-DKruDABV.js} +1 -1
- package/lib/{index-SEMQrdk2.cjs → index-DN-IR-K0.cjs} +1 -1
- package/lib/{index-C52cuQ_Y.js → index-DRcwHivm.js} +1415 -1350
- package/lib/index-DUeBQoIA.cjs +1 -0
- package/lib/{index-Dbm_Mans.js → index-DeoYYWEA.js} +1 -1
- package/lib/{index-CHVV5iY-.cjs → index-Dgs2thVL.cjs} +1 -1
- package/lib/{index-BaR0Brts.js → index-DjB2kNdz.js} +171 -166
- package/lib/{index-CJMI7Fjf.js → index-DuWMq-Qs.js} +1 -1
- package/lib/{index-BGfIcDCQ.cjs → index-EoGU7W4e.cjs} +1 -1
- package/lib/{index-CDw4Eszh.cjs → index-MDz4NZcT.cjs} +9 -9
- package/lib/{index-Dx-Dh7KS.js → index-n4kM0Ll-.js} +110 -105
- package/lib/{index-BgNKVyMW.cjs → index-qZURFC5Q.cjs} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +12 -12
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/{popover-BB-ZDnqk.js → popover-Beieacfy.js} +1 -1
- package/lib/{popover-CrywEkBR.cjs → popover-Bl1kxRJX.cjs} +1 -1
- package/lib/{renderNodeView-5h3-p80E.cjs → renderNodeView-BIgT6Ghg.cjs} +1 -1
- package/lib/{renderNodeView-DoKZ4GYy.js → renderNodeView-Bi58v3DZ.js} +2 -2
- package/lib/{separator-BGO9AZp4.cjs → separator-DMLtkcoo.cjs} +1 -1
- package/lib/{separator-DuuOJRQd.js → separator-DfvK668q.js} +14 -14
- package/lib/style.css +1 -1
- package/lib/textarea-DV9Fw3y1.cjs +1 -0
- package/lib/textarea-GXaWJbm9.js +20 -0
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +1 -1
- package/lib/{updatePosition-CFTYKYNJ.js → updatePosition-DY1jI7qb.js} +2 -2
- package/lib/{updatePosition-B1oRJE1x.cjs → updatePosition-D_D-TbEu.cjs} +1 -1
- package/package.json +59 -59
- package/lib/Katex-CUofhjB5.cjs +0 -4
- package/lib/index-BG0kQamI.js +0 -285
- package/lib/index-NsYff_Ni.cjs +0 -1
- package/lib/index-aujjnfSJ.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as n } from "@radix-ui/react-slot";
|
|
3
3
|
import r from "react";
|
|
4
|
-
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-
|
|
4
|
+
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-DRcwHivm.js";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
const C = r.forwardRef(
|
|
7
7
|
({ asChild: x = !1, tooltip: i, ...t }, l) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-BO82_0q8.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-EoGU7W4e.cjs"),u=require("./clsx-DJURdKPs.cjs"),s=require("./index-BO82_0q8.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-CwbGrQFa.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
2
2
|
<path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
|
|
3
3
|
<path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
|
|
4
4
|
</svg>`,word:`<svg
|
package/lib/Attachment.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { N as
|
|
2
|
-
import { N as x, c as y, a as
|
|
3
|
-
import {
|
|
1
|
+
import { N as _, m as P } from "./index-n4kM0Ll-.js";
|
|
2
|
+
import { N as x, c as y, a as D } from "./clsx-b_2OwHLk.js";
|
|
3
|
+
import { P as R, Q as $, U as I, j as O, V as W, W as Z, X as N, A as T, u as K, d as Q } from "./index-DRcwHivm.js";
|
|
4
4
|
import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
|
|
5
|
-
import { useRef as
|
|
5
|
+
import { useRef as U, useState as X, useCallback as k, useEffect as q } from "react";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { LucideTableProperties as
|
|
8
|
-
import { u as ie } from "./index-
|
|
7
|
+
import { LucideTableProperties as G, LucideSheet as J, LucideImage as Y, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
|
|
8
|
+
import { u as ie } from "./index-DKruDABV.js";
|
|
9
9
|
import { g as c } from "./dom-dataset-CIEeltF6.js";
|
|
10
10
|
const oe = {
|
|
11
11
|
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
@@ -56,14 +56,14 @@ const ae = {
|
|
|
56
56
|
audio: /* @__PURE__ */ e(re, {}),
|
|
57
57
|
video: /* @__PURE__ */ e(te, {}),
|
|
58
58
|
file: /* @__PURE__ */ e(ee, {}),
|
|
59
|
-
image: /* @__PURE__ */ e(
|
|
59
|
+
image: /* @__PURE__ */ e(Y, {}),
|
|
60
60
|
pdf: /* @__PURE__ */ e(I, {}),
|
|
61
|
-
word: /* @__PURE__ */ e(
|
|
62
|
-
excel: /* @__PURE__ */ e(
|
|
63
|
-
ppt: /* @__PURE__ */ e(
|
|
61
|
+
word: /* @__PURE__ */ e($, {}),
|
|
62
|
+
excel: /* @__PURE__ */ e(J, {}),
|
|
63
|
+
ppt: /* @__PURE__ */ e(G, {})
|
|
64
64
|
};
|
|
65
65
|
function b(t, o = !1) {
|
|
66
|
-
const r =
|
|
66
|
+
const r = R(t), l = ae[r] || /* @__PURE__ */ e(L, {});
|
|
67
67
|
return o ? ne(r) : l;
|
|
68
68
|
}
|
|
69
69
|
const se = "_wrap_15oj2_2", M = {
|
|
@@ -71,22 +71,22 @@ const se = "_wrap_15oj2_2", M = {
|
|
|
71
71
|
};
|
|
72
72
|
function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
|
|
73
73
|
var A;
|
|
74
|
-
const n =
|
|
74
|
+
const n = U(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [V, v] = X(!1), { t: w } = ie(), F = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
|
|
75
75
|
!i || u || n.current.click();
|
|
76
|
-
}, [u, i]),
|
|
76
|
+
}, [u, i]), j = k(
|
|
77
77
|
async (C) => {
|
|
78
78
|
const p = C.target.files && C.target.files[0];
|
|
79
79
|
if (!p) return;
|
|
80
|
-
const
|
|
81
|
-
fileName:
|
|
80
|
+
const S = {
|
|
81
|
+
fileName: Z(p.name),
|
|
82
82
|
fileSize: p.size,
|
|
83
83
|
fileType: p.type,
|
|
84
|
-
fileExt:
|
|
84
|
+
fileExt: W(p.name)
|
|
85
85
|
};
|
|
86
86
|
v(!0);
|
|
87
87
|
try {
|
|
88
|
-
const g = await
|
|
89
|
-
r({ ...
|
|
88
|
+
const g = await F(p);
|
|
89
|
+
r({ ...S, url: g }), v(!1);
|
|
90
90
|
} catch (g) {
|
|
91
91
|
r({
|
|
92
92
|
error: `File upload fail: ${g && g.message}`
|
|
@@ -95,13 +95,13 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
95
95
|
},
|
|
96
96
|
[v, r]
|
|
97
97
|
);
|
|
98
|
-
|
|
98
|
+
q(() => {
|
|
99
99
|
!u && !a && (m(), r({ hasTrigger: !0 }));
|
|
100
100
|
}, [u, a, m, r]);
|
|
101
|
-
const
|
|
101
|
+
const B = k(() => l(), [t]);
|
|
102
102
|
return i && !u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), children: [
|
|
103
|
-
/* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children:
|
|
104
|
-
/* @__PURE__ */ e("input", { hidden: !0, onChange:
|
|
103
|
+
/* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children: V ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
|
|
104
|
+
/* @__PURE__ */ e("input", { hidden: !0, onChange: j, ref: n, type: "file" })
|
|
105
105
|
] }) }) : u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: [
|
|
106
106
|
/* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
107
107
|
/* @__PURE__ */ e("span", { children: b(E) }),
|
|
@@ -116,7 +116,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
116
116
|
")"
|
|
117
117
|
] })
|
|
118
118
|
] }),
|
|
119
|
-
/* @__PURE__ */ e(T, { action:
|
|
119
|
+
/* @__PURE__ */ e(T, { action: B, icon: "Trash2", tooltip: w("editor.delete") })
|
|
120
120
|
] }) }) : H !== "null" ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: /* @__PURE__ */ e("p", { children: H }) }) }) : /* @__PURE__ */ e(L, {});
|
|
121
121
|
}
|
|
122
122
|
function xe() {
|
|
@@ -127,7 +127,7 @@ function xe() {
|
|
|
127
127
|
tooltipOptions: s = {},
|
|
128
128
|
action: n = void 0,
|
|
129
129
|
isActive: i = void 0
|
|
130
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } =
|
|
130
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = Q(i), h = () => {
|
|
131
131
|
a || n && (n(), d());
|
|
132
132
|
};
|
|
133
133
|
return t ? /* @__PURE__ */ e(
|
|
@@ -142,7 +142,7 @@ function xe() {
|
|
|
142
142
|
}
|
|
143
143
|
) : /* @__PURE__ */ e(L, {});
|
|
144
144
|
}
|
|
145
|
-
const ce = /* @__PURE__ */
|
|
145
|
+
const ce = /* @__PURE__ */ _.create({
|
|
146
146
|
name: "attachment",
|
|
147
147
|
content: "",
|
|
148
148
|
marks: "",
|
|
@@ -183,7 +183,7 @@ const ce = /* @__PURE__ */ S.create({
|
|
|
183
183
|
} = t || {};
|
|
184
184
|
return [
|
|
185
185
|
"div",
|
|
186
|
-
|
|
186
|
+
P(
|
|
187
187
|
// @ts-expect-error
|
|
188
188
|
this.options.HTMLAttributes || {},
|
|
189
189
|
t || {}
|
|
@@ -238,7 +238,7 @@ const ce = /* @__PURE__ */ S.create({
|
|
|
238
238
|
};
|
|
239
239
|
},
|
|
240
240
|
addNodeView() {
|
|
241
|
-
return
|
|
241
|
+
return D(le);
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
export {
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-BGfIcDCQ.cjs"),tt=require("./jsx-runtime-C_NLcKys.cjs"),$=require("react/jsx-runtime"),K=require("./index-aujjnfSJ.cjs");require("react");require("./theme.cjs");function at(n,t,e){for(let r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;let i=n.child(r),s=t.child(r);if(i==s){e+=i.nodeSize;continue}if(!i.sameMarkup(s))return e;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)e++;return e}if(i.content.size||s.content.size){let o=at(i.content,s.content,e+1);if(o!=null)return o}e+=i.nodeSize}}function lt(n,t,e,r){for(let i=n.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:e,b:r};let o=n.child(--i),a=t.child(--s),l=o.nodeSize;if(o==a){e-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:e,b:r};if(o.isText&&o.text!=a.text){let u=0,h=Math.min(o.text.length,a.text.length);for(;u<h&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,e--,r--;return{a:e,b:r}}if(o.content.size||a.content.size){let u=lt(o.content,a.content,e-1,r-1);if(u)return u}e-=l,r-=l}}var g=class m{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,e,r,i=0,s){for(let o=0,a=0;a<e;o++){let l=this.content[o],u=a+l.nodeSize;if(u>t&&r(l,i+a,s||null,o)!==!1&&l.content.size){let h=a+1;l.nodesBetween(Math.max(0,t-h),Math.min(l.content.size,e-h),r,i+h)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,i){let s="",o=!0;return this.nodesBetween(t,e,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,e-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(r)&&(i[i.length-1]=e.withText(e.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new m(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let r=[],i=0;if(e>t)for(let s=0,o=0;o<e;s++){let a=this.content[s],l=o+a.nodeSize;l>t&&((o<t||l>e)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),r.push(a),i+=a.nodeSize),o=l}return new m(r,i)}cutByIndex(t,e){return t==e?m.empty:t==0&&e==this.content.length?this:new m(this.content.slice(t,e))}replaceChild(t,e){let r=this.content[t];if(r==e)return this;let i=this.content.slice(),s=this.size+e.nodeSize-r.nodeSize;return i[t]=e,new m(i,s)}addToStart(t){return new m([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new m(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,r=0;e<this.content.length;e++){let i=this.content[e];t(i,r,e),r+=i.nodeSize}}findDiffStart(t,e=0){return at(this,t,e)}findDiffEnd(t,e=this.size,r=t.size){return lt(this,t,e,r)}findIndex(t){if(t==0)return B(0,t);if(t==this.size)return B(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,r=0;;e++){let i=this.child(e),s=r+i.nodeSize;if(s>=t)return s==t?B(e+1,s):B(e,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return m.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return m.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return m.empty;let e,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(e||(e=t.slice(0,i)),e[e.length-1]=s.withText(e[e.length-1].text+s.text)):e&&e.push(s)}return new m(e||t,r)}static from(t){if(!t)return m.empty;if(t instanceof m)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new m([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};g.empty=new g([],0);var W={index:0,offset:0};function B(n,t){return W.index=n,W.offset=t,W}var Ot=class extends Error{},c=class y{constructor(t,e,r){this.content=t,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let r=ht(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return r&&new y(r,this.openStart,this.openEnd)}removeBetween(t,e){return new y(ut(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return y.empty;let r=e.openStart||0,i=e.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new y(g.fromJSON(t,e.content),r,i)}static maxOpen(t,e=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)i++;return new y(t,r,i)}};c.empty=new c(g.empty,0,0);function ut(n,t,e){let{index:r,offset:i}=n.findIndex(t),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(e);if(i==t||s.isText){if(a!=e&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(ut(s.content,t-i-1,e-i-1)))}function ht(n,t,e,r,i,s){let{index:o,offset:a}=n.findIndex(t),l=n.maybeChild(o);if(a==t||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,e)?null:n.cut(0,t).append(e).append(n.cut(t));let u=ht(l.content,t-a-1,e,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return u&&n.replaceChild(o,l.copy(u))}var ct=65535,ft=Math.pow(2,16);function Tt(n,t){return n+t*ft}function et(n){return n&ct}function Et(n){return(n-(n&ct))/ft}var pt=1,mt=2,q=4,dt=8,rt=class{constructor(n,t,e){this.pos=n,this.delInfo=t,this.recover=e}get deleted(){return(this.delInfo&dt)>0}get deletedBefore(){return(this.delInfo&(pt|q))>0}get deletedAfter(){return(this.delInfo&(mt|q))>0}get deletedAcross(){return(this.delInfo&q)>0}},k=class x{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&x.empty)return x.empty}recover(t){let e=0,r=et(t);if(!this.inverted)for(let i=0;i<r;i++)e+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+e+Et(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[a+s],h=this.ranges[a+o],S=l+u;if(t<=S){let j=u?t==l?-1:t==S?1:e:e,T=l+i+(j<0?0:h);if(r)return T;let v=t==(e<0?l:S)?null:Tt(a/3,t-l),_=t==l?mt:t==S?pt:q;return(e<0?t!=l:t!=S)&&(_|=dt),new rt(T,_,v)}i+=h-u}return r?t+i:new rt(t+i,0,null)}touches(t,e){let r=0,i=et(e),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[a+s],h=l+u;if(t<=h&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+e],h=this.ranges[i+r];t(a,a+u,l,l+h),s+=h-u}}invert(){return new x(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?x.empty:new x(t<0?[0,-t,0]:[0,0,t])}};k.empty=new k([]);var V=Object.create(null),p=class{getMap(){return k.empty}merge(n){return null}static fromJSON(n,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let e=V[t.stepType];if(!e)throw new RangeError(`No step type ${t.stepType} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in V)throw new RangeError("Duplicate use of step JSON ID "+n);return V[n]=t,t.prototype.jsonID=n,t}},d=class E{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new E(t,null)}static fail(t){return new E(null,t)}static fromReplace(t,e,r,i){try{return E.ok(t.replace(e,r,i))}catch(s){if(s instanceof Ot)return E.fail(s.message);throw s}}};function Y(n,t,e){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Y(s.content,t,s))),s.isInline&&(s=t(s,e,i)),r.push(s)}return g.fromArray(r)}var St=class I extends p{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new c(Y(e.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),e.openStart,e.openEnd);return d.fromReplace(t,this.from,this.to,s)}invert(){return new gt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new I(e.pos,r.pos,this.mark)}merge(t){return t instanceof I&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new I(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new I(e.from,e.to,t.markFromJSON(e.mark))}};p.jsonID("addMark",St);var gt=class A extends p{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=new c(Y(e.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),e.openStart,e.openEnd);return d.fromReplace(t,this.from,this.to,r)}invert(){return new St(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new A(e.pos,r.pos,this.mark)}merge(t){return t instanceof A&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new A(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new A(e.from,e.to,t.markFromJSON(e.mark))}};p.jsonID("removeMark",gt);var wt=class z extends p{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return d.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new z(this.pos,e.marks[i]);return new z(this.pos,this.mark)}}return new kt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new z(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new z(e.pos,t.markFromJSON(e.mark))}};p.jsonID("addNodeMark",wt);var kt=class Q extends p{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return d.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new wt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Q(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Q(e.pos,t.markFromJSON(e.mark))}};p.jsonID("removeNodeMark",kt);var Z=class w extends p{constructor(t,e,r,i=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=i}apply(t){return this.structure&&U(t,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new k([this.from,this.to-this.from,this.slice.size])}invert(t){return new w(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),r=this.from==this.to&&w.MAP_BIAS<0?e:t.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new w(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(t){if(!(t instanceof w)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?c.empty:new c(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new w(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?c.empty:new c(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new w(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new w(e.from,e.to,c.fromJSON(t,e.slice),!!e.structure)}};Z.MAP_BIAS=1;p.jsonID("replace",Z);var vt=class D extends p{constructor(t,e,r,i,s,o,a=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(t){if(this.structure&&(U(t,this.from,this.gapFrom)||U(t,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return d.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?d.fromReplace(t,this.from,this.to,r):d.fail("Content does not fit in gap")}getMap(){return new k([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new D(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||s>r.pos?null:new D(e.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new D(e.from,e.to,e.gapFrom,e.gapTo,c.fromJSON(t,e.slice),e.insert,!!e.structure)}};p.jsonID("replaceAround",vt);function U(n,t,e){let r=n.resolve(t),i=e-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}var It=class L extends p{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at attribute step's position");let r=Object.create(null);for(let s in e.attrs)r[s]=e.attrs[s];r[this.attr]=this.value;let i=e.type.create(r,null,e.marks);return d.fromReplace(t,this.pos,this.pos+1,new c(g.from(i),0,e.isLeaf?0:1))}getMap(){return k.empty}invert(t){return new L(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new L(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new L(e.pos,e.attr,e.value)}};p.jsonID("attr",It);var At=class X extends p{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let i in t.attrs)e[i]=t.attrs[i];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return d.ok(r)}getMap(){return k.empty}invert(t){return new X(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new X(e.attr,e.value)}};p.jsonID("docAttr",At);var C=class extends Error{};C=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e};C.prototype=Object.create(Error.prototype);C.prototype.constructor=C;C.prototype.name="TransformError";var G=Object.create(null),f=class{constructor(n,t,e){this.$anchor=n,this.$head=t,this.ranges=e||[new zt(n.min(t),n.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let n=this.ranges;for(let t=0;t<n.length;t++)if(n[t].$from.pos!=n[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,t=c.empty){let e=t.content.lastChild,r=null;for(let o=0;o<t.openEnd;o++)r=e,e=e.lastChild;let i=n.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],u=n.mapping.slice(i);n.replaceRange(u.map(a.pos),u.map(l.pos),o?c.empty:t),o==0&&st(n,i,(e?e.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(n,t){let e=n.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],a=n.mapping.slice(e),l=a.map(s.pos),u=a.map(o.pos);i?n.deleteRange(l,u):(n.replaceRangeWith(l,u,t),st(n,e,t.isInline?-1:1))}}static findFrom(n,t,e=!1){let r=n.parent.inlineContent?new R(n):N(n.node(0),n.parent,n.pos,n.index(),t,e);if(r)return r;for(let i=n.depth-1;i>=0;i--){let s=t<0?N(n.node(0),n.node(i),n.before(i+1),n.index(i),t,e):N(n.node(0),n.node(i),n.after(i+1),n.index(i)+1,t,e);if(s)return s}return null}static near(n,t=1){return this.findFrom(n,t)||this.findFrom(n,-t)||new b(n.node(0))}static atStart(n){return N(n,n,0,0,1)||new b(n)}static atEnd(n){return N(n,n,n.content.size,n.childCount,-1)||new b(n)}static fromJSON(n,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let e=G[t.type];if(!e)throw new RangeError(`No selection type ${t.type} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in G)throw new RangeError("Duplicate use of selection JSON ID "+n);return G[n]=t,t.prototype.jsonID=n,t}getBookmark(){return R.between(this.$anchor,this.$head).getBookmark()}};f.prototype.visible=!0;var zt=class{constructor(n,t){this.$from=n,this.$to=t}},nt=!1;function it(n){!nt&&!n.parent.inlineContent&&(nt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var R=class J extends f{constructor(t,e=t){it(t),it(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return f.near(r);let i=t.resolve(e.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(t,e=c.empty){if(super.replace(t,e),e==c.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof J&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new yt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let i=t.resolve(e);return new this(i,r==e?i:t.resolve(r))}static between(t,e,r){let i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){let s=f.findFrom(e,r,!0)||f.findFrom(e,-r,!0);if(s)e=s.$head;else return f.near(e,r)}return t.parent.inlineContent||(i==0?t=e:(t=(f.findFrom(t,-r,!0)||f.findFrom(t,r,!0)).$anchor,t.pos<e.pos!=i<0&&(t=e))),new J(t,e)}};f.jsonID("text",R);var yt=class xt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new xt(t.map(this.anchor),t.map(this.head))}resolve(t){return R.between(t.resolve(this.anchor),t.resolve(this.head))}},O=class M extends f{constructor(t){let e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);super(t,r),this.node=e}map(t,e){let{deleted:r,pos:i}=e.mapResult(this.anchor),s=t.resolve(i);return r?f.near(s):new M(s)}content(){return new c(g.from(this.node),0,0)}eq(t){return t instanceof M&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Jt(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new M(t.resolve(e.anchor))}static create(t,e){return new M(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}};O.prototype.visible=!1;f.jsonID("node",O);var Jt=class Nt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:r}=t.mapResult(this.anchor);return e?new yt(r,r):new Nt(r)}resolve(t){let e=t.resolve(this.anchor),r=e.nodeAfter;return r&&O.isSelectable(r)?new O(e):f.near(e)}},b=class P extends f{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=c.empty){if(e==c.empty){t.delete(0,t.doc.content.size);let r=f.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new P(t)}map(t){return new P(t)}eq(t){return t instanceof P}getBookmark(){return Mt}};f.jsonID("all",b);var Mt={map(){return this},resolve(n){return new b(n)}};function N(n,t,e,r,i,s=!1){if(t.inlineContent)return R.create(n,e);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let a=t.child(o);if(a.isAtom){if(!s&&O.isSelectable(a))return O.create(n,e-(i<0?a.nodeSize:0))}else{let l=N(n,a,e+i,i<0?a.childCount:0,i,s);if(l)return l}e+=a.nodeSize*i}return null}function st(n,t,e){let r=n.steps.length-1;if(r<t)return;let i=n.steps[r];if(!(i instanceof Z||i instanceof vt))return;let s=n.mapping.maps[r],o;s.forEach((a,l,u,h)=>{o==null&&(o=h)}),n.setSelection(f.near(n.doc.resolve(o),e))}function ot(n,t){return!t||!n?n:n.bind(t)}var F=class{constructor(n,t,e){this.name=n,this.init=ot(t.init,e),this.apply=ot(t.apply,e)}};new F("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new F("selection",{init(n,t){return n.selection||f.atStart(t.doc)},apply(n){return n.selection}}),new F("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,r){return r.selection.$cursor?n.storedMarks:null}}),new F("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}});var bt=(n,t)=>{var e;const{state:r,view:i}=n,{selection:s}=r;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0)return!1;const a=o.depth-1,l=o.node(a),u=o.index(a);if(u===0)return!1;if(l.type===t)return n.commands.lift(t.name);const h=l.child(u-1);if(h.type!==t||!((e=h.lastChild)!=null&&e.isTextblock))return!1;const S=o.before(),T=S-1-1,{tr:v}=r;return v.delete(S,o.after()).insert(T,o.parent.content),v.setSelection(R.create(v.doc,T)),i.dispatch(v.scrollIntoView()),!0},Ct=/^\s*>\s$/,Bt=H.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return tt.h("blockquote",{...H.mergeAttributes(this.options.HTMLAttributes,n),children:tt.h("slot",{})})},parseMarkdown:(n,t)=>{var e;const r=(e=t.parseBlockChildren)!=null?e:t.parseChildren;return t.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,t)=>{if(!n.content)return"";const e=">",r=[];return n.content.forEach((i,s)=>{var o,a;const h=((a=(o=t.renderChild)==null?void 0:o.call(t,i,s))!=null?a:t.renderChildren([i])).split(`
|
|
2
|
-
`).map(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./index-EoGU7W4e.cjs"),tt=require("./jsx-runtime-C_NLcKys.cjs"),K=require("react/jsx-runtime"),W=require("./index-BO82_0q8.cjs");require("react");require("./theme.cjs");function at(n,t,e){for(let r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;let i=n.child(r),s=t.child(r);if(i==s){e+=i.nodeSize;continue}if(!i.sameMarkup(s))return e;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)e++;return l&&l<o.length&&l<a.length&&ht(o.charCodeAt(l-1))&&ut(o.charCodeAt(l))&&e--,e}if(i.content.size||s.content.size){let o=at(i.content,s.content,e+1);if(o!=null)return o}e+=i.nodeSize}}function lt(n,t,e,r){for(let i=n.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:e,b:r};let o=n.child(--i),a=t.child(--s),l=o.nodeSize;if(o==a){e-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:e,b:r};if(o.isText&&o.text!=a.text){let u=o.text,h=a.text,f=u.length,k=h.length;for(;f>0&&k>0&&u[f-1]==h[k-1];)f--,k--,e--,r--;return f&&k&&f<u.length&&ht(u.charCodeAt(f-1))&&ut(u.charCodeAt(f))&&(e++,r++),{a:e,b:r}}if(o.content.size||a.content.size){let u=lt(o.content,a.content,e-1,r-1);if(u)return u}e-=l,r-=l}}function ut(n){return n>=56320&&n<57344}function ht(n){return n>=55296&&n<56320}var g=class d{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,e,r,i=0,s){for(let o=0,a=0;a<e;o++){let l=this.content[o],u=a+l.nodeSize;if(u>t&&r(l,i+a,s||null,o)!==!1&&l.content.size){let h=a+1;l.nodesBetween(Math.max(0,t-h),Math.min(l.content.size,e-h),r,i+h)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,i){let s="",o=!0;return this.nodesBetween(t,e,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,e-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(r)&&(i[i.length-1]=e.withText(e.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new d(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let r=[],i=0;if(e>t)for(let s=0,o=0;o<e;s++){let a=this.content[s],l=o+a.nodeSize;l>t&&((o<t||l>e)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),r.push(a),i+=a.nodeSize),o=l}return new d(r,i)}cutByIndex(t,e){return t==e?d.empty:t==0&&e==this.content.length?this:new d(this.content.slice(t,e))}replaceChild(t,e){let r=this.content[t];if(r==e)return this;let i=this.content.slice(),s=this.size+e.nodeSize-r.nodeSize;return i[t]=e,new d(i,s)}addToStart(t){return new d([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new d(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,r=0;e<this.content.length;e++){let i=this.content[e];t(i,r,e),r+=i.nodeSize}}findDiffStart(t,e=0){return at(this,t,e)}findDiffEnd(t,e=this.size,r=t.size){return lt(this,t,e,r)}findIndex(t){if(t==0)return F(0,t);if(t==this.size)return F(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,r=0;;e++){let i=this.child(e),s=r+i.nodeSize;if(s>=t)return s==t?F(e+1,s):F(e,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return d.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return d.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return d.empty;let e,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(e||(e=t.slice(0,i)),e[e.length-1]=s.withText(e[e.length-1].text+s.text)):e&&e.push(s)}return new d(e||t,r)}static from(t){if(!t)return d.empty;if(t instanceof d)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new d([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};g.empty=new g([],0);var V={index:0,offset:0};function F(n,t){return V.index=n,V.offset=t,V}var Tt=class extends Error{},c=class x{constructor(t,e,r){this.content=t,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let r=ft(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return r&&new x(r,this.openStart,this.openEnd)}removeBetween(t,e){return new x(ct(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return x.empty;let r=e.openStart||0,i=e.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new x(g.fromJSON(t,e.content),r,i)}static maxOpen(t,e=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)i++;return new x(t,r,i)}};c.empty=new c(g.empty,0,0);function ct(n,t,e){let{index:r,offset:i}=n.findIndex(t),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(e);if(i==t||s.isText){if(a!=e&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(ct(s.content,t-i-1,e-i-1)))}function ft(n,t,e,r,i,s){let{index:o,offset:a}=n.findIndex(t),l=n.maybeChild(o);if(a==t||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,e)?null:n.cut(0,t).append(e).append(n.cut(t));let u=ft(l.content,t-a-1,e,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return u&&n.replaceChild(o,l.copy(u))}var pt=65535,mt=Math.pow(2,16);function Et(n,t){return n+t*mt}function et(n){return n&pt}function It(n){return(n-(n&pt))/mt}var dt=1,St=2,D=4,gt=8,rt=class{constructor(n,t,e){this.pos=n,this.delInfo=t,this.recover=e}get deleted(){return(this.delInfo>)>0}get deletedBefore(){return(this.delInfo&(dt|D))>0}get deletedAfter(){return(this.delInfo&(St|D))>0}get deletedAcross(){return(this.delInfo&D)>0}},v=class N{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&N.empty)return N.empty}recover(t){let e=0,r=et(t);if(!this.inverted)for(let i=0;i<r;i++)e+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+e+It(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[a+s],h=this.ranges[a+o],f=l+u;if(t<=f){let k=u?t==l?-1:t==f?1:e:e,T=l+i+(k<0?0:h);if(r)return T;let y=t==(e<0?l:f)?null:Et(a/3,t-l),_=t==l?St:t==f?dt:D;return(e<0?t!=l:t!=f)&&(_|=gt),new rt(T,_,y)}i+=h-u}return r?t+i:new rt(t+i,0,null)}touches(t,e){let r=0,i=et(e),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[a+s],h=l+u;if(t<=h&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+e],h=this.ranges[i+r];t(a,a+u,l,l+h),s+=h-u}}invert(){return new N(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?N.empty:new N(t<0?[0,-t,0]:[0,0,t])}};v.empty=new v([]);var G=Object.create(null),m=class{getMap(){return v.empty}merge(n){return null}static fromJSON(n,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let e=G[t.stepType];if(!e)throw new RangeError(`No step type ${t.stepType} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in G)throw new RangeError("Duplicate use of step JSON ID "+n);return G[n]=t,t.prototype.jsonID=n,t}},S=class E{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new E(t,null)}static fail(t){return new E(null,t)}static fromReplace(t,e,r,i){try{return E.ok(t.replace(e,r,i))}catch(s){if(s instanceof Tt)return E.fail(s.message);throw s}}};function Z(n,t,e){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Z(s.content,t,s))),s.isInline&&(s=t(s,e,i)),r.push(s)}return g.fromArray(r)}var wt=class I extends m{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new c(Z(e.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),e.openStart,e.openEnd);return S.fromReplace(t,this.from,this.to,s)}invert(){return new kt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new I(e.pos,r.pos,this.mark)}merge(t){return t instanceof I&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new I(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new I(e.from,e.to,t.markFromJSON(e.mark))}};m.jsonID("addMark",wt);var kt=class z extends m{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=new c(Z(e.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),e.openStart,e.openEnd);return S.fromReplace(t,this.from,this.to,r)}invert(){return new wt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new z(e.pos,r.pos,this.mark)}merge(t){return t instanceof z&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new z(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new z(e.from,e.to,t.markFromJSON(e.mark))}};m.jsonID("removeMark",kt);var vt=class J extends m{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return S.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return S.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new J(this.pos,e.marks[i]);return new J(this.pos,this.mark)}}return new yt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new J(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new J(e.pos,t.markFromJSON(e.mark))}};m.jsonID("addNodeMark",vt);var yt=class U extends m{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return S.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return S.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new vt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new U(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new U(e.pos,t.markFromJSON(e.mark))}};m.jsonID("removeNodeMark",yt);var j=class w extends m{constructor(t,e,r,i=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=i}apply(t){return this.structure&&X(t,this.from,this.to)?S.fail("Structure replace would overwrite content"):S.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new v([this.from,this.to-this.from,this.slice.size])}invert(t){return new w(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),r=this.from==this.to&&w.MAP_BIAS<0?e:t.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new w(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(t){if(!(t instanceof w)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?c.empty:new c(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new w(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?c.empty:new c(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new w(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new w(e.from,e.to,c.fromJSON(t,e.slice),!!e.structure)}};j.MAP_BIAS=1;m.jsonID("replace",j);var xt=class L extends m{constructor(t,e,r,i,s,o,a=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(t){if(this.structure&&(X(t,this.from,this.gapFrom)||X(t,this.gapTo,this.to)))return S.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return S.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?S.fromReplace(t,this.from,this.to,r):S.fail("Content does not fit in gap")}getMap(){return new v([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new L(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||s>r.pos?null:new L(e.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new L(e.from,e.to,e.gapFrom,e.gapTo,c.fromJSON(t,e.slice),e.insert,!!e.structure)}};m.jsonID("replaceAround",xt);function X(n,t,e){let r=n.resolve(t),i=e-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}var zt=class P extends m{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(t){let e=t.nodeAt(this.pos);if(!e)return S.fail("No node at attribute step's position");let r=Object.create(null);for(let s in e.attrs)r[s]=e.attrs[s];r[this.attr]=this.value;let i=e.type.create(r,null,e.marks);return S.fromReplace(t,this.pos,this.pos+1,new c(g.from(i),0,e.isLeaf?0:1))}getMap(){return v.empty}invert(t){return new P(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new P(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new P(e.pos,e.attr,e.value)}};m.jsonID("attr",zt);var Jt=class Y extends m{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let i in t.attrs)e[i]=t.attrs[i];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return S.ok(r)}getMap(){return v.empty}invert(t){return new Y(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Y(e.attr,e.value)}};m.jsonID("docAttr",Jt);var B=class extends Error{};B=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e};B.prototype=Object.create(Error.prototype);B.prototype.constructor=B;B.prototype.name="TransformError";var Q=Object.create(null),p=class{constructor(n,t,e){this.$anchor=n,this.$head=t,this.ranges=e||[new bt(n.min(t),n.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let n=this.ranges;for(let t=0;t<n.length;t++)if(n[t].$from.pos!=n[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,t=c.empty){let e=t.content.lastChild,r=null;for(let o=0;o<t.openEnd;o++)r=e,e=e.lastChild;let i=n.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],u=n.mapping.slice(i);n.replaceRange(u.map(a.pos),u.map(l.pos),o?c.empty:t),o==0&&st(n,i,(e?e.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(n,t){let e=n.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],a=n.mapping.slice(e),l=a.map(s.pos),u=a.map(o.pos);i?n.deleteRange(l,u):(n.replaceRangeWith(l,u,t),st(n,e,t.isInline?-1:1))}}static findFrom(n,t,e=!1){let r=n.parent.inlineContent?new A(n):R(n.node(0),n.parent,n.pos,n.index(),t,e);if(r)return r;for(let i=n.depth-1;i>=0;i--){let s=t<0?R(n.node(0),n.node(i),n.before(i+1),n.index(i),t,e):R(n.node(0),n.node(i),n.after(i+1),n.index(i)+1,t,e);if(s)return s}return null}static near(n,t=1){return this.findFrom(n,t)||this.findFrom(n,-t)||new C(n.node(0))}static atStart(n){return R(n,n,0,0,1)||new C(n)}static atEnd(n){return R(n,n,n.content.size,n.childCount,-1)||new C(n)}static fromJSON(n,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let e=Q[t.type];if(!e)throw new RangeError(`No selection type ${t.type} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in Q)throw new RangeError("Duplicate use of selection JSON ID "+n);return Q[n]=t,t.prototype.jsonID=n,t}getBookmark(){return A.between(this.$anchor,this.$head).getBookmark()}};p.prototype.visible=!0;var bt=class{constructor(n,t){this.$from=n,this.$to=t}},nt=!1;function it(n){!nt&&!n.parent.inlineContent&&(nt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var A=class b extends p{constructor(t,e=t){it(t),it(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return p.near(r);let i=t.resolve(e.map(this.anchor));return new b(i.parent.inlineContent?i:r,r)}replace(t,e=c.empty){if(super.replace(t,e),e==c.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof b&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Nt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new b(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let i=t.resolve(e);return new this(i,r==e?i:t.resolve(r))}static between(t,e,r){let i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){let s=p.findFrom(e,r,!0)||p.findFrom(e,-r,!0);if(s)e=s.$head;else return p.near(e,r)}return t.parent.inlineContent||(i==0?t=e:(t=(p.findFrom(t,-r,!0)||p.findFrom(t,r,!0)).$anchor,t.pos<e.pos!=i<0&&(t=e))),new b(t,e)}};p.jsonID("text",A);var Nt=class Rt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Rt(t.map(this.anchor),t.map(this.head))}resolve(t){return A.between(t.resolve(this.anchor),t.resolve(this.head))}},O=class M extends p{constructor(t){let e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);super(t,r),this.node=e}map(t,e){let{deleted:r,pos:i}=e.mapResult(this.anchor),s=t.resolve(i);return r?p.near(s):new M(s)}content(){return new c(g.from(this.node),0,0)}eq(t){return t instanceof M&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Mt(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new M(t.resolve(e.anchor))}static create(t,e){return new M(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}};O.prototype.visible=!1;p.jsonID("node",O);var Mt=class At{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:r}=t.mapResult(this.anchor);return e?new Nt(r,r):new At(r)}resolve(t){let e=t.resolve(this.anchor),r=e.nodeAfter;return r&&O.isSelectable(r)?new O(e):p.near(e)}},C=class H extends p{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=c.empty){if(e==c.empty){t.delete(0,t.doc.content.size);let r=p.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new H(t)}map(t){return new H(t)}eq(t){return t instanceof H}getBookmark(){return Ct}};p.jsonID("all",C);var Ct={map(){return this},resolve(n){return new C(n)}};function R(n,t,e,r,i,s=!1){if(t.inlineContent)return A.create(n,e);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let a=t.child(o);if(a.isAtom){if(!s&&O.isSelectable(a))return O.create(n,e-(i<0?a.nodeSize:0))}else{let l=R(n,a,e+i,i<0?a.childCount:0,i,s);if(l)return l}e+=a.nodeSize*i}return null}function st(n,t,e){let r=n.steps.length-1;if(r<t)return;let i=n.steps[r];if(!(i instanceof j||i instanceof xt))return;let s=n.mapping.maps[r],o;s.forEach((a,l,u,h)=>{o==null&&(o=h)}),n.setSelection(p.near(n.doc.resolve(o),e))}function ot(n,t){return!t||!n?n:n.bind(t)}var q=class{constructor(n,t,e){this.name=n,this.init=ot(t.init,e),this.apply=ot(t.apply,e)}};new q("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new q("selection",{init(n,t){return n.selection||p.atStart(t.doc)},apply(n){return n.selection}}),new q("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,r){return r.selection.$cursor?n.storedMarks:null}}),new q("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}});var Bt=(n,t)=>{var e;const{state:r,view:i}=n,{selection:s}=r;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0)return!1;const a=o.depth-1,l=o.node(a),u=o.index(a);if(u===0)return!1;if(l.type===t)return n.commands.lift(t.name);const h=l.child(u-1);if(h.type!==t||!((e=h.lastChild)!=null&&e.isTextblock))return!1;const f=o.before(),T=f-1-1,{tr:y}=r;return y.delete(f,o.after()).insert(T,o.parent.content),y.setSelection(A.create(y.doc,T)),i.dispatch(y.scrollIntoView()),!0},Ft=/^\s*>\s$/,qt=$.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return tt.h("blockquote",{...$.mergeAttributes(this.options.HTMLAttributes,n),children:tt.h("slot",{})})},parseMarkdown:(n,t)=>{var e;const r=(e=t.parseBlockChildren)!=null?e:t.parseChildren;return t.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,t)=>{if(!n.content)return"";const e=">",r=[];return n.content.forEach((i,s)=>{var o,a;const h=((a=(o=t.renderChild)==null?void 0:o.call(t,i,s))!=null?a:t.renderChildren([i])).split(`
|
|
2
|
+
`).map(f=>f.trim()===""?e:`${e} ${f}`);r.push(h.join(`
|
|
3
3
|
`))}),r.join(`
|
|
4
4
|
${e}
|
|
5
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>
|
|
5
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Bt(this.editor,this.type)}},addInputRules(){return[$.wrappingInputRule({find:Ft,type:this.type})]}});function Dt(){const n=W.useButtonProps(Ot.name),{icon:t=void 0,tooltip:e=void 0,shortcutKeys:r=void 0,tooltipOptions:i={},action:s=void 0,isActive:o=void 0}=(n==null?void 0:n.componentProps)??{},{dataState:a,disabled:l,update:u}=W.useToggleActive(o),h=()=>{l||s&&(s(),u())};return n?K.jsx(W.ActionButton,{action:h,dataState:a,disabled:l,icon:t,shortcutKeys:r,tooltip:e,tooltipOptions:i}):K.jsx(K.Fragment,{})}const Ot=qt.extend({addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:t,t:e,extension:r})=>({componentProps:{action:()=>t.commands.toggleBlockquote(),isActive:()=>t.isActive("blockquote"),disabled:!t.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:r.options.shortcutKeys??["shift","mod","B"],tooltip:e("editor.blockquote.tooltip")}})}}});exports.Blockquote=Ot;exports.RichTextBlockquote=Dt;
|