reactjs-tiptap-editor 1.0.6 → 1.0.8
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-htJNI0Fa.js → ActionMenuButton-Cc0vy5hy.js} +10 -13
- package/lib/ActionMenuButton-t7e5GCJp.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +23 -25
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +5 -6
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +5 -6
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +11 -12
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +9 -10
- package/lib/CodeBlock.cjs +39 -39
- package/lib/CodeBlock.js +837 -946
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +8 -9
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +18 -19
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +5 -6
- package/lib/{Drawer-1211urKj.js → Drawer-C6WTtcd0.js} +16 -17
- package/lib/Drawer-DRdsK4f_.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +15 -16
- package/lib/{Excalidraw-Du3hBR8t.js → Excalidraw-DjO5sCC_.js} +31 -32
- package/lib/Excalidraw-gJ99kWdS.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +17 -18
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +5 -6
- 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/Heading.cjs +1 -1
- package/lib/Heading.js +15 -15
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +7 -8
- package/lib/History.cjs +1 -1
- package/lib/History.js +8 -10
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +5 -6
- package/lib/Icon-DHNSWrSX.cjs +1 -0
- package/lib/{Icon-C-qYUAS1.js → Icon-prdLEHMN.js} +3 -4
- package/lib/{Iframe-DTYTLQE6.js → Iframe-CERKUXQh.js} +13 -14
- package/lib/Iframe-CvymVtpM.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +48 -49
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +22 -23
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.js +10 -11
- package/lib/{Indent-jOPn3eUM.js → Indent-BfEOOT5B.js} +24 -25
- package/lib/Indent-CE6kk62r.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +10 -11
- package/lib/{Katex-CERSrcTP.js → Katex-5KNTSK8T.js} +21 -22
- package/lib/Katex-CJ2Fmvut.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +14 -15
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-B5SdhOfa.js → LinkEditBlock-CFkyS2Ze.js} +55 -56
- package/lib/{LinkEditBlock-DaxljgJC.cjs → LinkEditBlock-D6z0Yohc.cjs} +2 -2
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +138 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +20 -20
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +22 -24
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +5 -6
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +18 -19
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +13 -13
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +5 -6
- package/lib/{Table-39OkCQbu.js → Table-CWbY_hqo.js} +7 -8
- package/lib/Table-D9pRzwFU.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +13 -14
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +17 -19
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +17 -19
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +5 -6
- package/lib/{Twitter-D7PhLycr.js → Twitter-BV7HA-MO.js} +566 -525
- package/lib/Twitter-D7NK3MZe.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +24 -25
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +433 -423
- package/lib/{button-Crm67hfl.js → button-0963_Pa8.js} +3 -4
- package/lib/button-Bxfjx9_Y.cjs +1 -0
- package/lib/{checkbox-DViVmgJ6.js → checkbox-D4p6-UMt.js} +1 -1
- package/lib/{checkbox-NQC2MdGT.cjs → checkbox-Q6FcMQW5.cjs} +1 -1
- package/lib/{dialog-Ce9Cjfft.js → dialog-B-9_Z5j2.js} +1 -1
- package/lib/{dialog-DaHBd2zw.cjs → dialog-D-oYxagG.cjs} +1 -1
- package/lib/{dropdown-menu-CQykJhBs.js → dropdown-menu-par18QL5.js} +1 -1
- package/lib/{dropdown-menu-CSCDQtq0.cjs → dropdown-menu-r8XibZQU.cjs} +1 -1
- package/lib/extensions/Mention/Mention.d.ts +3 -1
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +7 -1
- package/lib/{index-DCJheRBq.cjs → index--nUS7Y66.cjs} +1 -1
- package/lib/{index-DLqogznp.cjs → index-BBNITgNi.cjs} +7 -7
- package/lib/index-BFXkgG1P.cjs +7 -0
- package/lib/{index-prphFVsp.js → index-BQ6ZdLsu.js} +1 -1
- package/lib/{index-DylewabB.cjs → index-BZ6DfR2r.cjs} +1 -1
- package/lib/{index-D-FhWysc.js → index-BimeTI7q.js} +1 -1
- package/lib/{index-TMqmkmT6.cjs → index-CApXPpjF.cjs} +1 -1
- package/lib/{index-nFjllrEl.js → index-CbIQPoF6.js} +19 -18
- package/lib/{index-BeUrdBxf.js → index-EKFybgpP.js} +1 -1
- package/lib/{index-DuZCJJSp.js → index-pgx8gyoC.js} +1118 -504
- package/lib/index.cjs +2 -2
- package/lib/index.js +8 -9
- package/lib/{input-tU3H__39.cjs → input-CZUkD6wF.cjs} +1 -1
- package/lib/{input-DfqFAyKo.js → input-cclJoUeC.js} +1 -1
- package/lib/{isNumber-CTm1pIvN.js → isNumber-8HKEgTkA.js} +1 -1
- package/lib/{isNumber-C2saEiG2.cjs → isNumber-Bv1Qhmw8.cjs} +1 -1
- package/lib/label-CFaBdRGz.cjs +1 -0
- package/lib/label-aveW7pdK.js +18 -0
- package/lib/{popover-CZWSQZ0q.cjs → popover-BWYZO_fD.cjs} +1 -1
- package/lib/{popover-CoepUobG.js → popover-D5YZPv2r.js} +1 -1
- package/lib/{separator-DCQD8P6s.cjs → separator-B978cwAm.cjs} +1 -1
- package/lib/{separator-6SnwzytZ.js → separator-BHjFVmZr.js} +18 -18
- package/lib/{store-726Zjszt.cjs → store-BsBiawfz.cjs} +1 -1
- package/lib/{store-ibARMQ3h.js → store-BsMMRKFd.js} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-DrkJL_C2.js → tabs-Bj8EvAkY.js} +1 -1
- package/lib/{tabs-B_ArrG09.cjs → tabs-CUMyiV80.cjs} +1 -1
- package/lib/{textarea-CmZVZKOo.cjs → textarea-BKb7LDw1.cjs} +1 -1
- package/lib/{textarea-CIs52G8B.js → textarea-CClyW-74.js} +1 -1
- package/lib/{throttle-CGM5M2yG.js → throttle-BIkZV3Y_.js} +1 -1
- package/lib/{throttle-DXN-aiH5.cjs → throttle-BM3Bmbf_.cjs} +1 -1
- package/lib/{updatePosition-DpMKxYdN.js → updatePosition-GLTrgcib.js} +1 -1
- package/lib/{updatePosition-C17CDdjq.cjs → updatePosition-u2mTh3mG.cjs} +1 -1
- package/lib/useButtonProps-B0riSJs9.cjs +1 -0
- package/lib/{useButtonProps-D0SrPzuG.js → useButtonProps-StwAz7Ha.js} +35 -47
- package/package.json +58 -54
- package/lib/ActionMenuButton-DYT5chmX.cjs +0 -1
- package/lib/Drawer-DUFUd5BW.cjs +0 -1
- package/lib/Excalidraw-CajgZDjU.cjs +0 -1
- package/lib/Icon-BjR_or8V.cjs +0 -1
- package/lib/Iframe-CM6mRQmv.cjs +0 -1
- package/lib/Indent-BmhiEb0S.cjs +0 -1
- package/lib/Katex-CUd3LxLh.cjs +0 -4
- package/lib/Table-3VstSlg4.cjs +0 -9
- package/lib/Twitter-DuHPeVW1.cjs +0 -1
- package/lib/button-xNppt_aK.cjs +0 -1
- package/lib/index-BQ17A_37.js +0 -393
- package/lib/index-CNzHZDls.cjs +0 -7
- package/lib/index-DmOTQudI.cjs +0 -1
- package/lib/label-DC33TZy_.js +0 -19
- package/lib/label-DkDE77kc.cjs +0 -1
- package/lib/toggle-DVCNvcqp.cjs +0 -1
- package/lib/toggle-xchtz-Kf.js +0 -92
- package/lib/tooltip-BTFcHrd9.js +0 -24
- package/lib/tooltip-DFjcKu9a.cjs +0 -1
- package/lib/useButtonProps-bei1vI37.cjs +0 -1
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import n from "react";
|
|
3
3
|
import { Slot as r } from "@radix-ui/react-slot";
|
|
4
|
-
import "./index-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { i as f } from "./index-BQ17A_37.js";
|
|
8
|
-
import { T as o, a as s, b as u } from "./tooltip-BTFcHrd9.js";
|
|
9
|
-
const K = n.forwardRef(
|
|
4
|
+
import { i as d, T as m, a as f, b as s, g as u } from "./index-pgx8gyoC.js";
|
|
5
|
+
import { B as o } from "./button-0963_Pa8.js";
|
|
6
|
+
const C = n.forwardRef(
|
|
10
7
|
({ asChild: x = !1, tooltip: i, ...t }, l) => {
|
|
11
8
|
var a;
|
|
12
|
-
const h =
|
|
13
|
-
return /* @__PURE__ */ c(
|
|
14
|
-
/* @__PURE__ */ e(
|
|
15
|
-
x ? r :
|
|
9
|
+
const h = d[t.icon];
|
|
10
|
+
return /* @__PURE__ */ c(m, { children: [
|
|
11
|
+
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(
|
|
12
|
+
x ? r : o,
|
|
16
13
|
{
|
|
17
14
|
className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
|
|
18
15
|
"data-state": t != null && t.dataState ? "on" : "off",
|
|
@@ -26,13 +23,13 @@ const K = n.forwardRef(
|
|
|
26
23
|
] })
|
|
27
24
|
}
|
|
28
25
|
) }),
|
|
29
|
-
i && /* @__PURE__ */ e(
|
|
26
|
+
i && /* @__PURE__ */ e(s, { children: /* @__PURE__ */ c("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
|
|
30
27
|
i && /* @__PURE__ */ e("div", { children: i }),
|
|
31
|
-
/* @__PURE__ */ e("div", { className: "richtext-flex", children: !!((a = t == null ? void 0 : t.shortcutKeys) != null && a.length) && /* @__PURE__ */ e("span", { children:
|
|
28
|
+
/* @__PURE__ */ e("div", { className: "richtext-flex", children: !!((a = t == null ? void 0 : t.shortcutKeys) != null && a.length) && /* @__PURE__ */ e("span", { children: u(t == null ? void 0 : t.shortcutKeys) }) })
|
|
32
29
|
] }) })
|
|
33
30
|
] });
|
|
34
31
|
}
|
|
35
32
|
);
|
|
36
33
|
export {
|
|
37
|
-
|
|
34
|
+
C as A
|
|
38
35
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("react"),d=require("@radix-ui/react-slot"),i=require("./index-BFXkgG1P.cjs"),s=require("./button-Bxfjx9_Y.cjs"),u=a.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var x;const n=i.icons[t.icon],r=h?d.Slot:s.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}),n&&e.jsx(n,{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:!!((x=t==null?void 0:t.shortcutKeys)!=null&&x.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=u;
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-BBNITgNi.cjs"),x=require("./index-BFXkgG1P.cjs"),e=require("react/jsx-runtime"),m=require("react"),v=require("lucide-react"),w=require("./file-i7e4nQY2.cjs"),S=require("./index-FSRjMsxW.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),L=require("./useButtonProps-B0riSJs9.cjs"),_={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
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
fill="currentColor"
|
|
17
17
|
d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
|
|
18
18
|
/>
|
|
19
|
-
</svg>`,excel:'<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-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<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-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function
|
|
19
|
+
</svg>`,excel:'<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-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<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-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function q(t){const n=_[t],a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement,s=["svg",{...Array.from(a.attributes).reduce((i,o)=>(i[o.name]=o.value,i),{})}];return Array.from(a.childNodes).forEach(i=>{if(i.nodeType===1){const o=[i.tagName.toLowerCase(),Array.from(i.attributes).reduce((u,h)=>(u[h.name]=h.value,u),{})];i.textContent&&o.push(i.textContent),s.push(o)}}),s}const R={audio:e.jsx(v.LucideAudioLines,{}),video:e.jsx(v.LucideVideo,{}),file:e.jsx(v.LucideFile,{}),image:e.jsx(v.LucideImage,{}),pdf:e.jsx(x.ExportPdf,{}),word:e.jsx(x.ExportWord,{}),excel:e.jsx(v.LucideSheet,{}),ppt:e.jsx(v.LucideTableProperties,{})};function C(t,n=!1){const r=w.normalizeFileType(t),c=R[r]||e.jsx(e.Fragment,{});return n?q(r):c}const P="_wrap_17afc_2",A={wrap:P};function $({editor:t,node:n,updateAttributes:r,deleteNode:c,extension:a}){var T;const s=m.useRef(null),i=x.useEditableEditor(),{hasTrigger:o,fileName:u,fileSize:h,fileExt:N,fileType:z,url:p,error:M}=n.attrs,[E,y]=m.useState(!1),{t:k}=S.useLocale(),F=(T=a==null?void 0:a.options)==null?void 0:T.upload,f=m.useCallback(()=>{!i||p||s.current.click()},[p,i]),V=m.useCallback(async b=>{const g=b.target.files&&b.target.files[0];if(!g)return;const D={fileName:w.extractFilename(g.name),fileSize:g.size,fileType:g.type,fileExt:w.extractFileExtension(g.name)};y(!0);try{const j=await F(g);r({...D,url:j}),y(!1)}catch(j){r({error:`File upload fail: ${j&&j.message}`||"Unknown error"}),y(!1),s.current.value=""}},[y,r]);m.useEffect(()=>{!p&&!o&&(f(),r({hasTrigger:!0}))},[p,o,f,r]);const B=m.useCallback(()=>c(),[t]);return i&&!p?e.jsx(l.NodeViewWrapper,{children:e.jsxs("div",{className:l.clsx(A.wrap,"render-wrapper"),children:[e.jsx("p",{onClick:f,style:{cursor:"pointer"},children:E?e.jsx("span",{children:k("editor.attachment.uploading")}):e.jsx("span",{children:k("editor.attachment.please_upload")})}),e.jsx("input",{hidden:!0,onChange:V,ref:s,type:"file"})]})}):p?e.jsx(l.NodeViewWrapper,{children:e.jsxs("div",{className:l.clsx(A.wrap,"render-wrapper"),onClick:f,children:[e.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:[e.jsx("span",{children:C(z)}),e.jsxs("span",{children:[u,".",N]}),e.jsxs("span",{children:["(",w.normalizeFileSize(h),")"]})]}),e.jsx(x.ActionButton,{action:B,icon:"Trash2",tooltip:k("editor.delete")})]})}):M!=="null"?e.jsx(l.NodeViewWrapper,{children:e.jsx("div",{className:l.clsx(A.wrap,"render-wrapper"),onClick:f,children:e.jsx("p",{children:M})})}):e.jsx(e.Fragment,{})}function I(){const t=L.useButtonProps(H.name),{icon:n=void 0,tooltip:r=void 0,shortcutKeys:c=void 0,tooltipOptions:a={},action:s=void 0,isActive:i=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o,update:u}=L.useToggleActive(i),h=()=>{o||s&&(s(),u())};return t?e.jsx(x.ActionButton,{action:h,disabled:o,icon:n,shortcutKeys:c,tooltip:r,tooltipOptions:a}):e.jsx(e.Fragment,{})}const H=l.Node3.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"attachment"},button:({editor:n,t:r})=>({component:x.ActionButton,componentProps:{action:()=>n.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:r("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:t}){const{url:n="",fileName:r="",fileSize:c="",fileType:a="",fileExt:s=""}=t||{};return["div",l.mergeAttributes(this.options.HTMLAttributes||{},t||{}),n?["a",{href:n||"#"},["span",{class:"attachment__icon"},C(a,!0)],["span",{class:"attachment__text"},`${r}.${s} (${w.normalizeFileSize(c)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{fileName:{default:null,parseHTML:d.getDatasetAttribute("filename")},fileSize:{default:null,parseHTML:d.getDatasetAttribute("filesize")},fileType:{default:null,parseHTML:d.getDatasetAttribute("filetype")},fileExt:{default:null,parseHTML:d.getDatasetAttribute("fileext")},url:{default:null,parseHTML:d.getDatasetAttribute("url")},hasTrigger:{default:!1,parseHTML:t=>d.getDatasetAttribute("hastrigger")(t)==="true"},error:{default:null,parseHTML:d.getDatasetAttribute("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:n})=>n().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return l.ReactNodeViewRenderer($)}});exports.Attachment=H;exports.RichTextAttachment=I;
|
package/lib/Attachment.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { s as x, C as y, N as j, R as D, m as P } from "./index-
|
|
2
|
-
import { A as T } from "./
|
|
1
|
+
import { s as x, C as y, N as j, R as D, m as P } from "./index-CbIQPoF6.js";
|
|
2
|
+
import { E as R, l as $, k as I, A as T } from "./index-pgx8gyoC.js";
|
|
3
3
|
import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { E as J, a as Q } from "./index-BQ17A_37.js";
|
|
8
|
-
import { n as X, e as Y, a as ee, b } from "./file-BLas99n7.js";
|
|
4
|
+
import { useRef as O, useState as Z, useCallback as k, useEffect as W } from "react";
|
|
5
|
+
import { LucideTableProperties as K, LucideSheet as U, LucideImage as q, LucideFile as G, LucideVideo as J, LucideAudioLines as Q } from "lucide-react";
|
|
6
|
+
import { n as X, e as Y, a as ee, b as N } from "./file-BLas99n7.js";
|
|
9
7
|
import { u as te } from "./index-0OnGZkVF.js";
|
|
10
8
|
import { g as c } from "./dom-dataset-CIEeltF6.js";
|
|
11
|
-
import { u as re, a as ie } from "./useButtonProps-
|
|
9
|
+
import { u as re, a as ie } from "./useButtonProps-StwAz7Ha.js";
|
|
12
10
|
const oe = {
|
|
13
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>',
|
|
14
12
|
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>',
|
|
@@ -55,16 +53,16 @@ function ne(t) {
|
|
|
55
53
|
}), n;
|
|
56
54
|
}
|
|
57
55
|
const ae = {
|
|
58
|
-
audio: /* @__PURE__ */ e(
|
|
59
|
-
video: /* @__PURE__ */ e(
|
|
60
|
-
file: /* @__PURE__ */ e(
|
|
61
|
-
image: /* @__PURE__ */ e(
|
|
62
|
-
pdf: /* @__PURE__ */ e(
|
|
63
|
-
word: /* @__PURE__ */ e(
|
|
64
|
-
excel: /* @__PURE__ */ e(
|
|
65
|
-
ppt: /* @__PURE__ */ e(
|
|
56
|
+
audio: /* @__PURE__ */ e(Q, {}),
|
|
57
|
+
video: /* @__PURE__ */ e(J, {}),
|
|
58
|
+
file: /* @__PURE__ */ e(G, {}),
|
|
59
|
+
image: /* @__PURE__ */ e(q, {}),
|
|
60
|
+
pdf: /* @__PURE__ */ e($, {}),
|
|
61
|
+
word: /* @__PURE__ */ e(R, {}),
|
|
62
|
+
excel: /* @__PURE__ */ e(U, {}),
|
|
63
|
+
ppt: /* @__PURE__ */ e(K, {})
|
|
66
64
|
};
|
|
67
|
-
function
|
|
65
|
+
function b(t, o = !1) {
|
|
68
66
|
const r = X(t), l = ae[r] || /* @__PURE__ */ e(L, {});
|
|
69
67
|
return o ? ne(r) : l;
|
|
70
68
|
}
|
|
@@ -73,7 +71,7 @@ const se = "_wrap_17afc_2", M = {
|
|
|
73
71
|
};
|
|
74
72
|
function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
|
|
75
73
|
var C;
|
|
76
|
-
const n =
|
|
74
|
+
const n = O(null), i = I(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: E, fileType: z, url: u, error: H } = o.attrs, [F, v] = Z(!1), { t: w } = te(), V = (C = s == null ? void 0 : s.options) == null ? void 0 : C.upload, m = k(() => {
|
|
77
75
|
!i || u || n.current.click();
|
|
78
76
|
}, [u, i]), B = k(
|
|
79
77
|
async (A) => {
|
|
@@ -96,7 +94,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
96
94
|
},
|
|
97
95
|
[v, r]
|
|
98
96
|
);
|
|
99
|
-
|
|
97
|
+
W(() => {
|
|
100
98
|
!u && !a && (m(), r({ hasTrigger: !0 }));
|
|
101
99
|
}, [u, a, m, r]);
|
|
102
100
|
const S = k(() => l(), [t]);
|
|
@@ -125,7 +123,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
125
123
|
onClick: m,
|
|
126
124
|
children: [
|
|
127
125
|
/* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
128
|
-
/* @__PURE__ */ e("span", { children:
|
|
126
|
+
/* @__PURE__ */ e("span", { children: b(z) }),
|
|
129
127
|
/* @__PURE__ */ f("span", { children: [
|
|
130
128
|
d,
|
|
131
129
|
".",
|
|
@@ -133,7 +131,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
133
131
|
] }),
|
|
134
132
|
/* @__PURE__ */ f("span", { children: [
|
|
135
133
|
"(",
|
|
136
|
-
|
|
134
|
+
N(h),
|
|
137
135
|
")"
|
|
138
136
|
] })
|
|
139
137
|
] }),
|
|
@@ -156,7 +154,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
156
154
|
}
|
|
157
155
|
) }) : /* @__PURE__ */ e(L, {});
|
|
158
156
|
}
|
|
159
|
-
function
|
|
157
|
+
function xe() {
|
|
160
158
|
const t = re(ce.name), {
|
|
161
159
|
icon: o = void 0,
|
|
162
160
|
tooltip: r = void 0,
|
|
@@ -231,12 +229,12 @@ const ce = /* @__PURE__ */ j.create({
|
|
|
231
229
|
[
|
|
232
230
|
"span",
|
|
233
231
|
{ class: "attachment__icon" },
|
|
234
|
-
|
|
232
|
+
b(s, !0)
|
|
235
233
|
],
|
|
236
234
|
[
|
|
237
235
|
"span",
|
|
238
236
|
{ class: "attachment__text" },
|
|
239
|
-
`${r}.${n} (${
|
|
237
|
+
`${r}.${n} (${N(l)})`
|
|
240
238
|
]
|
|
241
239
|
] : ["div", { class: "attachment__placeholder" }]
|
|
242
240
|
];
|
|
@@ -284,5 +282,5 @@ const ce = /* @__PURE__ */ j.create({
|
|
|
284
282
|
});
|
|
285
283
|
export {
|
|
286
284
|
ce as Attachment,
|
|
287
|
-
|
|
285
|
+
xe as RichTextAttachment
|
|
288
286
|
};
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-BBNITgNi.cjs"),a=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),g=require("./index-BFXkgG1P.cjs");require("react");const p=require("./useButtonProps-B0riSJs9.cjs");var m=/^\s*>\s$/,b=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return a.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:a.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
|
|
2
2
|
`).map(r=>r.trim()===""?o:`${o} ${r}`);n.push(u.join(`
|
|
3
3
|
`))}),n.join(`
|
|
4
4
|
${o}
|
|
5
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[c.wrappingInputRule({find:m,type:this.type})]}});function f(){const t=p.useButtonProps(
|
|
5
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[c.wrappingInputRule({find:m,type:this.type})]}});function f(){const t=p.useButtonProps(h.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:n=void 0,tooltipOptions:i={},action:s=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:u,disabled:r,update:q}=p.useToggleActive(d),k=()=>{r||s&&(s(),q())};return t?l.jsx(g.ActionButton,{action:k,dataState:u,disabled:r,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:i}):l.jsx(l.Fragment,{})}const h=b.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:o,extension:n})=>({componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote"),disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:n.options.shortcutKeys??["shift","mod","B"],tooltip:o("editor.blockquote.tooltip")}})}}});exports.Blockquote=h;exports.RichTextBlockquote=f;
|
package/lib/Blockquote.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { N as m, w as h, m as k } from "./index-
|
|
1
|
+
import { N as m, w as h, m as k } from "./index-CbIQPoF6.js";
|
|
2
2
|
import { h as a } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
3
|
import { jsx as l, Fragment as f } from "react/jsx-runtime";
|
|
4
|
-
import { A as g } from "./
|
|
4
|
+
import { A as g } from "./index-pgx8gyoC.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import "./
|
|
7
|
-
import { u as b, a as q } from "./useButtonProps-D0SrPzuG.js";
|
|
6
|
+
import { u as b, a as q } from "./useButtonProps-StwAz7Ha.js";
|
|
8
7
|
var v = /^\s*>\s$/, B = m.create({
|
|
9
8
|
name: "blockquote",
|
|
10
9
|
addOptions() {
|
|
@@ -56,7 +55,7 @@ ${e}
|
|
|
56
55
|
];
|
|
57
56
|
}
|
|
58
57
|
});
|
|
59
|
-
function
|
|
58
|
+
function H() {
|
|
60
59
|
const t = b(A.name), {
|
|
61
60
|
icon: o = void 0,
|
|
62
61
|
tooltip: e = void 0,
|
|
@@ -105,5 +104,5 @@ const A = /* @__PURE__ */ B.extend({
|
|
|
105
104
|
});
|
|
106
105
|
export {
|
|
107
106
|
A as Blockquote,
|
|
108
|
-
|
|
107
|
+
H as RichTextBlockquote
|
|
109
108
|
};
|
package/lib/Bold.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BBNITgNi.cjs"),a=require("./jsx-runtime-C_NLcKys.cjs"),l=require("./index-BFXkgG1P.cjs"),s=require("react/jsx-runtime");require("react");const u=require("./useButtonProps-B0riSJs9.cjs");var B=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,v=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,M=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return a.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:a.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:B,type:this.type}),o.markInputRule({find:k,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:v,type:this.type})]}});function b(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:p={},action:i=void 0,isActive:g=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:m,disabled:d,update:h}=u.useToggleActive(g),y=()=>{d||i&&(i(),h())};return t?s.jsx(l.ActionButton,{action:y,dataState:m,disabled:d,icon:e,shortcutKeys:n,tooltip:r,tooltipOptions:p}):s.jsx(s.Fragment,{})}const c=M.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r,extension:n})=>({component:l.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:n.options.shortcutKeys??["mod","B"],tooltip:r("editor.bold.tooltip")}})}}});exports.Bold=c;exports.RichTextBold=b;
|
package/lib/Bold.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { M as _, h as a, j as i, m as y } from "./index-
|
|
1
|
+
import { M as _, h as a, j as i, m as y } from "./index-CbIQPoF6.js";
|
|
2
2
|
import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { A as l } from "./
|
|
3
|
+
import { A as l } from "./index-pgx8gyoC.js";
|
|
4
4
|
import { jsx as u, Fragment as f } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
|
-
import "./
|
|
7
|
-
import { u as M, a as v } from "./useButtonProps-D0SrPzuG.js";
|
|
6
|
+
import { u as M, a as v } from "./useButtonProps-StwAz7Ha.js";
|
|
8
7
|
var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, b = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, A = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, R = _.create({
|
|
9
8
|
name: "bold",
|
|
10
9
|
addOptions() {
|
|
@@ -75,7 +74,7 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
75
74
|
];
|
|
76
75
|
}
|
|
77
76
|
});
|
|
78
|
-
function
|
|
77
|
+
function K() {
|
|
79
78
|
const t = M(x.name), {
|
|
80
79
|
icon: e = void 0,
|
|
81
80
|
tooltip: o = void 0,
|
|
@@ -121,5 +120,5 @@ const x = /* @__PURE__ */ R.extend({
|
|
|
121
120
|
});
|
|
122
121
|
export {
|
|
123
122
|
x as Bold,
|
|
124
|
-
|
|
123
|
+
K as RichTextBold
|
|
125
124
|
};
|
package/lib/BulletList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-CApXPpjF.cjs"),s=require("react/jsx-runtime"),B=require("./index-BFXkgG1P.cjs");require("react");const c=require("./useButtonProps-B0riSJs9.cjs");function x(){const t=c.useButtonProps(r.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:l={},action:n=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=c.useToggleActive(d),v=()=>{u||n&&(n(),p())};return t?s.jsx(B.ActionButton,{action:v,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:l}):s.jsx(s.Fragment,{})}const r=m.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=r;exports.RichTextBulletList=x;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { jsx as r, Fragment as
|
|
3
|
-
import { A as f } from "./
|
|
1
|
+
import { B as d } from "./index-BimeTI7q.js";
|
|
2
|
+
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
3
|
+
import { A as f } from "./index-pgx8gyoC.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./
|
|
6
|
-
|
|
7
|
-
function K() {
|
|
5
|
+
import { u as v, a as A } from "./useButtonProps-StwAz7Ha.js";
|
|
6
|
+
function y() {
|
|
8
7
|
const t = v(B.name), {
|
|
9
8
|
icon: o = void 0,
|
|
10
9
|
tooltip: i = void 0,
|
|
@@ -12,13 +11,13 @@ function K() {
|
|
|
12
11
|
tooltipOptions: c = {},
|
|
13
12
|
action: e = void 0,
|
|
14
13
|
isActive: l = void 0
|
|
15
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: a, disabled: n, update:
|
|
16
|
-
n || e && (e(),
|
|
14
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: a, disabled: n, update: u } = A(l), p = () => {
|
|
15
|
+
n || e && (e(), u());
|
|
17
16
|
};
|
|
18
17
|
return t ? /* @__PURE__ */ r(
|
|
19
18
|
f,
|
|
20
19
|
{
|
|
21
|
-
action:
|
|
20
|
+
action: p,
|
|
22
21
|
dataState: a,
|
|
23
22
|
disabled: n,
|
|
24
23
|
icon: o,
|
|
@@ -26,9 +25,9 @@ function K() {
|
|
|
26
25
|
tooltip: i,
|
|
27
26
|
tooltipOptions: c
|
|
28
27
|
}
|
|
29
|
-
) : /* @__PURE__ */ r(
|
|
28
|
+
) : /* @__PURE__ */ r(m, {});
|
|
30
29
|
}
|
|
31
|
-
const B = /* @__PURE__ */
|
|
30
|
+
const B = /* @__PURE__ */ d.extend({
|
|
32
31
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
33
32
|
//@ts-expect-error
|
|
34
33
|
addOptions() {
|
|
@@ -51,5 +50,5 @@ const B = /* @__PURE__ */ m.extend({
|
|
|
51
50
|
});
|
|
52
51
|
export {
|
|
53
52
|
B as BulletList,
|
|
54
|
-
|
|
53
|
+
y as RichTextBulletList
|
|
55
54
|
};
|
package/lib/Clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-BBNITgNi.cjs"),n=require("react/jsx-runtime"),v=require("./index-BFXkgG1P.cjs"),c=require("./useButtonProps-B0riSJs9.cjs");function f(){const t=c.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:i=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=c.useActive(l),d=()=>{r||i&&i()};return t?n.jsx(v.ActionButton,{action:d,disabled:r,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=f;
|
package/lib/Clear.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as p } from "./index-
|
|
1
|
+
import { N as p } from "./index-CbIQPoF6.js";
|
|
2
2
|
import { jsx as e, Fragment as l } from "react/jsx-runtime";
|
|
3
|
-
import { A as m } from "./
|
|
4
|
-
import { u as d, b as f } from "./useButtonProps-
|
|
3
|
+
import { A as m } from "./index-pgx8gyoC.js";
|
|
4
|
+
import { u as d, b as f } from "./useButtonProps-StwAz7Ha.js";
|
|
5
5
|
function b() {
|
|
6
6
|
const o = d(v.name), {
|
|
7
7
|
icon: t = void 0,
|
package/lib/Code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BBNITgNi.cjs"),i=require("react/jsx-runtime"),h=require("./index-BFXkgG1P.cjs");require("react");const a=require("./useButtonProps-B0riSJs9.cjs");var x=/(^|[^`])`([^`]+)`(?!`)$/,C=/(^|[^`])`([^`]+)`(?!`)/g,v=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:x,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:C,type:this.type})]}});function M(){const e=a.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:s=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:d,update:m}=a.useToggleActive(p),g=()=>{d||s&&(s(),m())};return e?i.jsx(h.ActionButton,{action:g,dataState:l,disabled:d,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=v.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=M;
|
package/lib/Code.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { M as m, h as l, j as g, m as h } from "./index-
|
|
1
|
+
import { M as m, h as l, j as g, m as h } from "./index-CbIQPoF6.js";
|
|
2
2
|
import { jsx as a, Fragment as M } from "react/jsx-runtime";
|
|
3
|
-
import { A as v } from "./
|
|
3
|
+
import { A as v } from "./index-pgx8gyoC.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./
|
|
6
|
-
import { u as C, a as f } from "./useButtonProps-D0SrPzuG.js";
|
|
5
|
+
import { u as C, a as f } from "./useButtonProps-StwAz7Ha.js";
|
|
7
6
|
var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|
|
8
7
|
name: "code",
|
|
9
8
|
addOptions() {
|
|
@@ -52,15 +51,15 @@ var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|
|
|
52
51
|
];
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
|
-
function
|
|
54
|
+
function L() {
|
|
56
55
|
const t = C(A.name), {
|
|
57
56
|
icon: e = void 0,
|
|
58
57
|
tooltip: o = void 0,
|
|
59
58
|
shortcutKeys: r = void 0,
|
|
60
|
-
tooltipOptions:
|
|
59
|
+
tooltipOptions: d = {},
|
|
61
60
|
action: n = void 0,
|
|
62
|
-
isActive:
|
|
63
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: u, disabled: s, update: c } = f(
|
|
61
|
+
isActive: i = void 0
|
|
62
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: u, disabled: s, update: c } = f(i), p = () => {
|
|
64
63
|
s || n && (n(), c());
|
|
65
64
|
};
|
|
66
65
|
return t ? /* @__PURE__ */ a(
|
|
@@ -72,7 +71,7 @@ function P() {
|
|
|
72
71
|
icon: e,
|
|
73
72
|
shortcutKeys: r,
|
|
74
73
|
tooltip: o,
|
|
75
|
-
tooltipOptions:
|
|
74
|
+
tooltipOptions: d
|
|
76
75
|
}
|
|
77
76
|
) : /* @__PURE__ */ a(M, {});
|
|
78
77
|
}
|
|
@@ -98,5 +97,5 @@ const A = /* @__PURE__ */ y.extend({
|
|
|
98
97
|
});
|
|
99
98
|
export {
|
|
100
99
|
A as Code,
|
|
101
|
-
|
|
100
|
+
L as RichTextCode
|
|
102
101
|
};
|