reactjs-tiptap-editor 1.0.16 → 1.0.17
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-B_E2mbAW.cjs +1 -0
- package/lib/{ActionMenuButton-a8LhmHXe.js → ActionMenuButton-lsIBc9sU.js} +12 -16
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +28 -32
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +11 -13
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +13 -15
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +15 -17
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +56 -62
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +12 -13
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +8 -10
- package/lib/CodeBlock.cjs +29 -29
- package/lib/CodeBlock.js +11 -14
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +9 -11
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +26 -29
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +7 -9
- package/lib/{Drawer-CbOJ1Igo.js → Drawer-DQ4CxBwG.js} +23 -29
- package/lib/Drawer-FUeUKshi.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 +13 -15
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +276 -5
- package/lib/ExportPdf.cjs +2 -2
- package/lib/ExportPdf.js +19 -21
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +8 -10
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +9 -10
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +19 -20
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +27 -28
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +24 -27
- package/lib/History.cjs +1 -1
- package/lib/History.js +25 -28
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +8 -10
- package/lib/{Iframe-CmjbQQcz.js → Iframe-CTajPyzs.js} +34 -38
- package/lib/Iframe-EVWXCqe4.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 +4 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +109 -114
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +15 -18
- package/lib/{Indent-BoG-vpIE.js → Indent-BGEHlRx_.js} +24 -26
- package/lib/Indent-q9cEWAa_.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 +11 -13
- package/lib/Katex-ClqcEnN_.cjs +4 -0
- package/lib/{Katex-ByL9snce.js → Katex-tMh4bfBb.js} +19 -24
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +17 -20
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-Ckih17pU.js → LinkEditBlock-CA5NhP-m.js} +19 -26
- package/lib/LinkEditBlock-DZXk4ln_.cjs +5 -0
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +31 -36
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +25 -29
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +13 -15
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +62 -69
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +5 -5
- package/lib/SlashCommandNodeView-CZoM3ZlS.cjs +1 -0
- package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-DLuqbX2o.js} +64 -69
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +12 -14
- package/lib/{Table-BEwrZVup.js → Table-BC4Lbqzn.js} +27 -29
- package/lib/Table-BmDopO43.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 +18 -20
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +29 -33
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +16 -20
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +7 -9
- package/lib/Twitter-BbMD3Ybp.cjs +1 -0
- package/lib/{Twitter-4U_ZBhpv.js → Twitter-D8Cbgl7g.js} +17 -23
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -270
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +543 -552
- package/lib/{clsx-DSzxBzvL.js → clsx-DaPvp9ji.js} +23 -23
- package/lib/components/ReactBus.d.ts +11 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
- package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-C_F7LEy5.cjs} +1 -1
- package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-q6RL_fkA.js} +1 -1
- package/lib/{index-4bHF5ovf.js → index-BDYJ8Ph2.js} +1 -1
- package/lib/index-BnVcq33n.cjs +1 -0
- package/lib/{index-DR5tIdL7.js → index-Do_dsOGB.js} +1 -1
- package/lib/{index-CpTykZBR.js → index-DqruLhsu.js} +1 -1
- package/lib/{index-D8li6EQ4.js → index-Qcl3BG94.js} +1 -1
- package/lib/index-RcSPeQHn.js +4941 -0
- package/lib/index.cjs +3 -3
- package/lib/index.js +45 -49
- package/lib/{popover-CeY3RbI5.js → popover-CtinPbiy.js} +1 -1
- package/lib/{popover-C6Cya3Cz.cjs → popover-DIMT3pae.cjs} +1 -1
- package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BEkECnnY.js} +2 -2
- package/lib/{select-Doa_-jkZ.cjs → select-CYyIeImH.cjs} +1 -1
- package/lib/{select-F0ZZ3VZB.js → select-CmV5uTXr.js} +1 -1
- package/lib/separator-BLp6xpSY.cjs +1 -0
- package/lib/{separator-Cjn4YH8a.js → separator-C7luvaG8.js} +13 -15
- package/lib/store/store.d.ts +2 -22
- package/lib/style.css +1 -1
- package/lib/{textarea-tOsPnxHf.js → textarea-CkVKMPqK.js} +1 -1
- package/lib/{textarea-BAolHF_W.cjs → textarea-Cn75Cm2n.cjs} +1 -1
- package/lib/{updatePosition-CDK7OR0i.js → updatePosition-DRmKQBGm.js} +2 -2
- package/lib/utils/checkIsVideoUrl.d.ts +1 -0
- package/lib/utils/customEvents/events.constant.d.ts +1 -0
- package/lib/utils/mitt.d.ts +6 -3
- package/package.json +1 -1
- package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
- package/lib/Drawer-DNaDMoAk.cjs +0 -1
- package/lib/Excalidraw-DnHTVOj8.js +0 -355
- package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
- package/lib/Icon-C0TJMAOm.js +0 -12
- package/lib/Icon-DzK0_ztP.cjs +0 -1
- package/lib/Iframe-BSNCsofW.cjs +0 -1
- package/lib/Image-BZEFuS0P.js +0 -925
- package/lib/Image-iKsGKjvg.cjs +0 -1
- package/lib/Indent-Bou16OcB.cjs +0 -1
- package/lib/Katex-BqDocr3a.cjs +0 -4
- package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
- package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
- package/lib/Table-BclWwp6P.cjs +0 -9
- package/lib/Twitter-Dtq6PEMC.cjs +0 -1
- package/lib/button-Bwn6gUuS.js +0 -43
- package/lib/button-CqJztfH2.cjs +0 -1
- package/lib/checkbox-BAzbZY2Y.cjs +0 -1
- package/lib/checkbox-B_rpz5Xq.js +0 -27
- package/lib/dialog-CJvpoeMm.js +0 -101
- package/lib/dialog-CWYTvz5J.cjs +0 -1
- package/lib/events.constant-Dq21NPdV.cjs +0 -1
- package/lib/events.constant-do95b767.js +0 -21
- package/lib/extensions/Image/store.d.ts +0 -4
- package/lib/extensions/Video/store.d.ts +0 -4
- package/lib/file-BLas99n7.js +0 -43
- package/lib/file-i7e4nQY2.cjs +0 -1
- package/lib/index-CL7JP-Xz.js +0 -426
- package/lib/index-Cn-t3Zxw.cjs +0 -1
- package/lib/index-DoiuU6VA.js +0 -2315
- package/lib/index-VhKd73hZ.cjs +0 -1
- package/lib/input-B1egKb-t.js +0 -21
- package/lib/input-ZGRt7lWR.cjs +0 -1
- package/lib/isNumber-BTYSVlKo.cjs +0 -1
- package/lib/isNumber-ClwLypY2.js +0 -15
- package/lib/label-Cjrzc5H2.js +0 -19
- package/lib/label-tzSPdqui.cjs +0 -1
- package/lib/separator-CUh5Y7Rh.cjs +0 -1
- package/lib/store/fast-context.d.ts +0 -7
- package/lib/store-BsJz5QRC.js +0 -10
- package/lib/store-DjkMIIEN.cjs +0 -1
- package/lib/tabs-BP8ypR_m.cjs +0 -1
- package/lib/tabs-CBDjOLl_.js +0 -46
- package/lib/throttle-D040PfWL.js +0 -249
- package/lib/throttle-gTTvqDTW.cjs +0 -1
- package/lib/toggle-C_SSvDRy.cjs +0 -1
- package/lib/toggle-DEerYRil.js +0 -99
- package/lib/tooltip-BJIvosho.js +0 -24
- package/lib/tooltip-FS1rsvd3.cjs +0 -1
- package/lib/useButtonProps-CtZCbMQu.js +0 -136
- package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
- package/lib/utils/_event.d.ts +0 -13
- package/lib/utils/customEvents/customEvents.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("react"),d=require("@radix-ui/react-slot"),i=require("./index-BnVcq33n.cjs");require("./theme.cjs");const s=a.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?d.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;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Slot as
|
|
4
|
-
import "./index-
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { Slot as r } from "@radix-ui/react-slot";
|
|
4
|
+
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-RcSPeQHn.js";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { i as f } from "./index-CL7JP-Xz.js";
|
|
9
|
-
import { T as o, a as s, b as u } from "./tooltip-BJIvosho.js";
|
|
10
|
-
const S = l.forwardRef(
|
|
11
|
-
({ asChild: r = !1, tooltip: i, ...t }, x) => {
|
|
6
|
+
const C = n.forwardRef(
|
|
7
|
+
({ asChild: x = !1, tooltip: i, ...t }, l) => {
|
|
12
8
|
var a;
|
|
13
|
-
const h =
|
|
14
|
-
return /* @__PURE__ */ c(
|
|
15
|
-
/* @__PURE__ */ e(
|
|
16
|
-
|
|
9
|
+
const h = d[t.icon];
|
|
10
|
+
return /* @__PURE__ */ c(m, { children: [
|
|
11
|
+
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(
|
|
12
|
+
x ? r : s,
|
|
17
13
|
{
|
|
18
14
|
className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
|
|
19
15
|
"data-state": t != null && t.dataState ? "on" : "off",
|
|
20
16
|
disabled: t == null ? void 0 : t.disabled,
|
|
21
|
-
ref:
|
|
17
|
+
ref: l,
|
|
22
18
|
variant: "ghost",
|
|
23
19
|
...t,
|
|
24
20
|
children: /* @__PURE__ */ c("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
|
|
@@ -29,11 +25,11 @@ const S = l.forwardRef(
|
|
|
29
25
|
) }),
|
|
30
26
|
i && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ c("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
|
|
31
27
|
i && /* @__PURE__ */ e("div", { children: i }),
|
|
32
|
-
/* @__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: g(t == null ? void 0 : t.shortcutKeys) }) })
|
|
33
29
|
] }) })
|
|
34
30
|
] });
|
|
35
31
|
}
|
|
36
32
|
);
|
|
37
33
|
export {
|
|
38
|
-
|
|
34
|
+
C as A
|
|
39
35
|
};
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),s=require("./index-BnVcq33n.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),D=require("./index-BsFvo9PG.cjs"),u=require("./dom-dataset-BqoJhJXt.cjs"),S={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 B(t){const n=S[t],l=new DOMParser().parseFromString(n,"image/svg+xml").documentElement,o=["svg",{...Array.from(l.attributes).reduce((i,a)=>(i[a.name]=a.value,i),{})}];return Array.from(l.childNodes).forEach(i=>{if(i.nodeType===1){const a=[i.tagName.toLowerCase(),Array.from(i.attributes).reduce((h,p)=>(h[p.name]=p.value,h),{})];i.textContent&&a.push(i.textContent),o.push(a)}}),o}const _={audio:e.jsx(x.LucideAudioLines,{}),video:e.jsx(x.LucideVideo,{}),file:e.jsx(x.LucideFile,{}),image:e.jsx(x.LucideImage,{}),pdf:e.jsx(s.ExportPdf,{}),word:e.jsx(s.ExportWord,{}),excel:e.jsx(x.LucideSheet,{}),ppt:e.jsx(x.LucideTableProperties,{})};function b(t,n=!1){const r=s.normalizeFileType(t),d=_[r]||e.jsx(e.Fragment,{});return n?B(r):d}const R="_wrap_17afc_2",k={wrap:R};function q({editor:t,node:n,updateAttributes:r,deleteNode:d,extension:l}){var M;const o=v.useRef(null),i=s.useEditableEditor(),{hasTrigger:a,fileName:h,fileSize:p,fileExt:C,fileType:H,url:g,error:A}=n.attrs,[N,w]=v.useState(!1),{t:j}=D.useLocale(),z=(M=l==null?void 0:l.options)==null?void 0:M.upload,f=v.useCallback(()=>{!i||g||o.current.click()},[g,i]),E=v.useCallback(async T=>{const m=T.target.files&&T.target.files[0];if(!m)return;const V={fileName:s.extractFilename(m.name),fileSize:m.size,fileType:m.type,fileExt:s.extractFileExtension(m.name)};w(!0);try{const y=await z(m);r({...V,url:y}),w(!1)}catch(y){r({error:`File upload fail: ${y&&y.message}`||"Unknown error"}),w(!1),o.current.value=""}},[w,r]);v.useEffect(()=>{!g&&!a&&(f(),r({hasTrigger:!0}))},[g,a,f,r]);const F=v.useCallback(()=>d(),[t]);return i&&!g?e.jsx(c.NodeViewWrapper,{children:e.jsxs("div",{className:c.clsx(k.wrap,"render-wrapper"),children:[e.jsx("p",{onClick:f,style:{cursor:"pointer"},children:N?e.jsx("span",{children:j("editor.attachment.uploading")}):e.jsx("span",{children:j("editor.attachment.please_upload")})}),e.jsx("input",{hidden:!0,onChange:E,ref:o,type:"file"})]})}):g?e.jsx(c.NodeViewWrapper,{children:e.jsxs("div",{className:c.clsx(k.wrap,"render-wrapper"),onClick:f,children:[e.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:[e.jsx("span",{children:b(H)}),e.jsxs("span",{children:[h,".",C]}),e.jsxs("span",{children:["(",s.normalizeFileSize(p),")"]})]}),e.jsx(s.ActionButton,{action:F,icon:"Trash2",tooltip:j("editor.delete")})]})}):A!=="null"?e.jsx(c.NodeViewWrapper,{children:e.jsx("div",{className:c.clsx(k.wrap,"render-wrapper"),onClick:f,children:e.jsx("p",{children:A})})}):e.jsx(e.Fragment,{})}function P(){const t=s.useButtonProps(L.name),{icon:n=void 0,tooltip:r=void 0,shortcutKeys:d=void 0,tooltipOptions:l={},action:o=void 0,isActive:i=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:a,update:h}=s.useToggleActive(i),p=()=>{a||o&&(o(),h())};return t?e.jsx(s.ActionButton,{action:p,disabled:a,icon:n,shortcutKeys:d,tooltip:r,tooltipOptions:l}):e.jsx(e.Fragment,{})}const L=c.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:s.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:d="",fileType:l="",fileExt:o=""}=t||{};return["div",c.mergeAttributes(this.options.HTMLAttributes||{},t||{}),n?["a",{href:n||"#"},["span",{class:"attachment__icon"},b(l,!0)],["span",{class:"attachment__text"},`${r}.${o} (${s.normalizeFileSize(d)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{fileName:{default:null,parseHTML:u.getDatasetAttribute("filename")},fileSize:{default:null,parseHTML:u.getDatasetAttribute("filesize")},fileType:{default:null,parseHTML:u.getDatasetAttribute("filetype")},fileExt:{default:null,parseHTML:u.getDatasetAttribute("fileext")},url:{default:null,parseHTML:u.getDatasetAttribute("url")},hasTrigger:{default:!1,parseHTML:t=>u.getDatasetAttribute("hastrigger")(t)==="true"},error:{default:null,parseHTML:u.getDatasetAttribute("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:n})=>n().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return c.ReactNodeViewRenderer(q)}});exports.Attachment=L;exports.RichTextAttachment=P;
|
package/lib/Attachment.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { h as x, j as y, N as j, k as
|
|
2
|
-
import { A as T } from "./
|
|
1
|
+
import { h as x, j as y, N as j, k as P, m as D } from "./clsx-DaPvp9ji.js";
|
|
2
|
+
import { P as R, Q as $, U as I, G as O, V as W, W as Z, X as N, A as T, u as U, d as G } from "./index-RcSPeQHn.js";
|
|
3
3
|
import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { a as O } from "./index-DoiuU6VA.js";
|
|
4
|
+
import { useRef as K, useState as Q, useCallback as k, useEffect as X } from "react";
|
|
6
5
|
import "./theme.js";
|
|
7
|
-
import { LucideTableProperties as
|
|
8
|
-
import {
|
|
9
|
-
import { n as X, e as Y, a as ee, b as N } from "./file-BLas99n7.js";
|
|
10
|
-
import { u as te } from "./index-C07N8gA1.js";
|
|
6
|
+
import { LucideTableProperties as q, LucideSheet as J, LucideImage as Y, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
|
|
7
|
+
import { u as ie } from "./index-C07N8gA1.js";
|
|
11
8
|
import { g as c } from "./dom-dataset-CIEeltF6.js";
|
|
12
|
-
import { u as re, a as ie } from "./useButtonProps-CtZCbMQu.js";
|
|
13
9
|
const oe = {
|
|
14
10
|
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>',
|
|
15
11
|
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>',
|
|
@@ -56,17 +52,17 @@ function ne(t) {
|
|
|
56
52
|
}), n;
|
|
57
53
|
}
|
|
58
54
|
const ae = {
|
|
59
|
-
audio: /* @__PURE__ */ e(
|
|
60
|
-
video: /* @__PURE__ */ e(
|
|
61
|
-
file: /* @__PURE__ */ e(
|
|
62
|
-
image: /* @__PURE__ */ e(
|
|
63
|
-
pdf: /* @__PURE__ */ e(
|
|
64
|
-
word: /* @__PURE__ */ e(
|
|
65
|
-
excel: /* @__PURE__ */ e(
|
|
66
|
-
ppt: /* @__PURE__ */ e(
|
|
55
|
+
audio: /* @__PURE__ */ e(re, {}),
|
|
56
|
+
video: /* @__PURE__ */ e(te, {}),
|
|
57
|
+
file: /* @__PURE__ */ e(ee, {}),
|
|
58
|
+
image: /* @__PURE__ */ e(Y, {}),
|
|
59
|
+
pdf: /* @__PURE__ */ e(I, {}),
|
|
60
|
+
word: /* @__PURE__ */ e($, {}),
|
|
61
|
+
excel: /* @__PURE__ */ e(J, {}),
|
|
62
|
+
ppt: /* @__PURE__ */ e(q, {})
|
|
67
63
|
};
|
|
68
64
|
function b(t, o = !1) {
|
|
69
|
-
const r =
|
|
65
|
+
const r = R(t), l = ae[r] || /* @__PURE__ */ e(L, {});
|
|
70
66
|
return o ? ne(r) : l;
|
|
71
67
|
}
|
|
72
68
|
const se = "_wrap_17afc_2", M = {
|
|
@@ -74,7 +70,7 @@ const se = "_wrap_17afc_2", M = {
|
|
|
74
70
|
};
|
|
75
71
|
function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
|
|
76
72
|
var A;
|
|
77
|
-
const n =
|
|
73
|
+
const n = K(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [V, v] = Q(!1), { t: w } = ie(), F = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
|
|
78
74
|
!i || u || n.current.click();
|
|
79
75
|
}, [u, i]), B = k(
|
|
80
76
|
async (C) => {
|
|
@@ -82,14 +78,14 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
82
78
|
if (!p)
|
|
83
79
|
return;
|
|
84
80
|
const _ = {
|
|
85
|
-
fileName:
|
|
81
|
+
fileName: Z(p.name),
|
|
86
82
|
fileSize: p.size,
|
|
87
83
|
fileType: p.type,
|
|
88
|
-
fileExt:
|
|
84
|
+
fileExt: W(p.name)
|
|
89
85
|
};
|
|
90
86
|
v(!0);
|
|
91
87
|
try {
|
|
92
|
-
const g = await
|
|
88
|
+
const g = await F(p);
|
|
93
89
|
r({ ..._, url: g }), v(!1);
|
|
94
90
|
} catch (g) {
|
|
95
91
|
r({ error: `File upload fail: ${g && g.message}` || "Unknown error" }), v(!1), n.current.value = "";
|
|
@@ -97,7 +93,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
97
93
|
},
|
|
98
94
|
[v, r]
|
|
99
95
|
);
|
|
100
|
-
|
|
96
|
+
X(() => {
|
|
101
97
|
!u && !a && (m(), r({ hasTrigger: !0 }));
|
|
102
98
|
}, [u, a, m, r]);
|
|
103
99
|
const S = k(() => l(), [t]);
|
|
@@ -107,7 +103,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
107
103
|
{
|
|
108
104
|
onClick: m,
|
|
109
105
|
style: { cursor: "pointer" },
|
|
110
|
-
children:
|
|
106
|
+
children: V ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") })
|
|
111
107
|
}
|
|
112
108
|
),
|
|
113
109
|
/* @__PURE__ */ e(
|
|
@@ -126,11 +122,11 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
126
122
|
onClick: m,
|
|
127
123
|
children: [
|
|
128
124
|
/* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
129
|
-
/* @__PURE__ */ e("span", { children: b(
|
|
125
|
+
/* @__PURE__ */ e("span", { children: b(E) }),
|
|
130
126
|
/* @__PURE__ */ f("span", { children: [
|
|
131
127
|
d,
|
|
132
128
|
".",
|
|
133
|
-
|
|
129
|
+
z
|
|
134
130
|
] }),
|
|
135
131
|
/* @__PURE__ */ f("span", { children: [
|
|
136
132
|
"(",
|
|
@@ -157,15 +153,15 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
157
153
|
}
|
|
158
154
|
) }) : /* @__PURE__ */ e(L, {});
|
|
159
155
|
}
|
|
160
|
-
function
|
|
161
|
-
const t =
|
|
156
|
+
function we() {
|
|
157
|
+
const t = U(ce.name), {
|
|
162
158
|
icon: o = void 0,
|
|
163
159
|
tooltip: r = void 0,
|
|
164
160
|
shortcutKeys: l = void 0,
|
|
165
161
|
tooltipOptions: s = {},
|
|
166
162
|
action: n = void 0,
|
|
167
163
|
isActive: i = void 0
|
|
168
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } =
|
|
164
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = G(i), h = () => {
|
|
169
165
|
a || n && (n(), d());
|
|
170
166
|
};
|
|
171
167
|
return t ? /* @__PURE__ */ e(
|
|
@@ -221,7 +217,7 @@ const ce = /* @__PURE__ */ j.create({
|
|
|
221
217
|
} = t || {};
|
|
222
218
|
return [
|
|
223
219
|
"div",
|
|
224
|
-
|
|
220
|
+
D(
|
|
225
221
|
// @ts-expect-error
|
|
226
222
|
this.options.HTMLAttributes || {},
|
|
227
223
|
t || {}
|
|
@@ -280,10 +276,10 @@ const ce = /* @__PURE__ */ j.create({
|
|
|
280
276
|
};
|
|
281
277
|
},
|
|
282
278
|
addNodeView() {
|
|
283
|
-
return
|
|
279
|
+
return P(le);
|
|
284
280
|
}
|
|
285
281
|
});
|
|
286
282
|
export {
|
|
287
283
|
ce as Attachment,
|
|
288
|
-
|
|
284
|
+
we as RichTextAttachment
|
|
289
285
|
};
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-BnVcq33n.cjs");require("react");require("./theme.cjs");var g=/^\s*>\s$/,m=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.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:
|
|
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:g,type:this.type})]}});function b(){const t=a.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}=a.useToggleActive(d),k=()=>{r||s&&(s(),q())};return t?l.jsx(a.ActionButton,{action:k,dataState:u,disabled:r,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:i}):l.jsx(l.Fragment,{})}const h=m.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=b;
|
package/lib/Blockquote.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { N as m, w as h, m as k } from "./clsx-
|
|
1
|
+
import { N as m, w as h, m as k } from "./clsx-DaPvp9ji.js";
|
|
2
2
|
import { h as a } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { A as
|
|
3
|
+
import { jsx as d, Fragment as g } from "react/jsx-runtime";
|
|
4
|
+
import { u as f, d as b, A as q } from "./index-RcSPeQHn.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import "./index-DoiuU6VA.js";
|
|
7
6
|
import "./theme.js";
|
|
8
|
-
import { u as b, a as q } from "./useButtonProps-CtZCbMQu.js";
|
|
9
7
|
var v = /^\s*>\s$/, B = m.create({
|
|
10
8
|
name: "blockquote",
|
|
11
9
|
addOptions() {
|
|
@@ -57,19 +55,19 @@ ${e}
|
|
|
57
55
|
];
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
|
-
function
|
|
61
|
-
const t =
|
|
58
|
+
function H() {
|
|
59
|
+
const t = f(A.name), {
|
|
62
60
|
icon: o = void 0,
|
|
63
61
|
tooltip: e = void 0,
|
|
64
62
|
shortcutKeys: n = void 0,
|
|
65
63
|
tooltipOptions: i = {},
|
|
66
64
|
action: s = void 0,
|
|
67
65
|
isActive: u = void 0
|
|
68
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled: r, update:
|
|
69
|
-
r || s && (s(),
|
|
66
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled: r, update: l } = b(u), p = () => {
|
|
67
|
+
r || s && (s(), l());
|
|
70
68
|
};
|
|
71
|
-
return t ? /* @__PURE__ */
|
|
72
|
-
|
|
69
|
+
return t ? /* @__PURE__ */ d(
|
|
70
|
+
q,
|
|
73
71
|
{
|
|
74
72
|
action: p,
|
|
75
73
|
dataState: c,
|
|
@@ -79,7 +77,7 @@ function $() {
|
|
|
79
77
|
tooltip: e,
|
|
80
78
|
tooltipOptions: i
|
|
81
79
|
}
|
|
82
|
-
) : /* @__PURE__ */
|
|
80
|
+
) : /* @__PURE__ */ d(g, {});
|
|
83
81
|
}
|
|
84
82
|
const A = /* @__PURE__ */ B.extend({
|
|
85
83
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -106,5 +104,5 @@ const A = /* @__PURE__ */ B.extend({
|
|
|
106
104
|
});
|
|
107
105
|
export {
|
|
108
106
|
A as Blockquote,
|
|
109
|
-
|
|
107
|
+
H as RichTextBlockquote
|
|
110
108
|
};
|
package/lib/Bold.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 o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-BnVcq33n.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=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 u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.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:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
|
package/lib/Bold.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { M as _, e as
|
|
1
|
+
import { M as _, e as a, f as i, m as y } from "./clsx-DaPvp9ji.js";
|
|
2
2
|
import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { A as l } from "./
|
|
4
|
-
import { jsx as u, Fragment as
|
|
3
|
+
import { u as f, d as M, A as l } from "./index-RcSPeQHn.js";
|
|
4
|
+
import { jsx as u, Fragment as v } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
|
-
import "./index-DoiuU6VA.js";
|
|
7
6
|
import "./theme.js";
|
|
8
|
-
import { u as M, a as v } from "./useButtonProps-CtZCbMQu.js";
|
|
9
7
|
var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, b = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, A = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, R = _.create({
|
|
10
8
|
name: "bold",
|
|
11
9
|
addOptions() {
|
|
@@ -33,7 +31,7 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
33
31
|
];
|
|
34
32
|
},
|
|
35
33
|
renderHTML({ HTMLAttributes: t }) {
|
|
36
|
-
return /* @__PURE__ */ d("strong", { ...
|
|
34
|
+
return /* @__PURE__ */ d("strong", { ...y(this.options.HTMLAttributes, t), children: /* @__PURE__ */ d("slot", {}) });
|
|
37
35
|
},
|
|
38
36
|
markdownTokenName: "strong",
|
|
39
37
|
parseMarkdown: (t, e) => e.applyMark("bold", e.parseInline(t.tokens || [])),
|
|
@@ -53,11 +51,11 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
53
51
|
},
|
|
54
52
|
addInputRules() {
|
|
55
53
|
return [
|
|
56
|
-
|
|
54
|
+
i({
|
|
57
55
|
find: B,
|
|
58
56
|
type: this.type
|
|
59
57
|
}),
|
|
60
|
-
|
|
58
|
+
i({
|
|
61
59
|
find: b,
|
|
62
60
|
type: this.type
|
|
63
61
|
})
|
|
@@ -65,26 +63,26 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
65
63
|
},
|
|
66
64
|
addPasteRules() {
|
|
67
65
|
return [
|
|
68
|
-
|
|
66
|
+
a({
|
|
69
67
|
find: k,
|
|
70
68
|
type: this.type
|
|
71
69
|
}),
|
|
72
|
-
|
|
70
|
+
a({
|
|
73
71
|
find: A,
|
|
74
72
|
type: this.type
|
|
75
73
|
})
|
|
76
74
|
];
|
|
77
75
|
}
|
|
78
76
|
});
|
|
79
|
-
function
|
|
80
|
-
const t =
|
|
77
|
+
function K() {
|
|
78
|
+
const t = f(x.name), {
|
|
81
79
|
icon: e = void 0,
|
|
82
80
|
tooltip: o = void 0,
|
|
83
81
|
shortcutKeys: r = void 0,
|
|
84
82
|
tooltipOptions: p = {},
|
|
85
83
|
action: n = void 0,
|
|
86
84
|
isActive: m = void 0
|
|
87
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled: s, update: g } =
|
|
85
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled: s, update: g } = M(m), h = () => {
|
|
88
86
|
s || n && (n(), g());
|
|
89
87
|
};
|
|
90
88
|
return t ? /* @__PURE__ */ u(
|
|
@@ -98,7 +96,7 @@ function O() {
|
|
|
98
96
|
tooltip: o,
|
|
99
97
|
tooltipOptions: p
|
|
100
98
|
}
|
|
101
|
-
) : /* @__PURE__ */ u(
|
|
99
|
+
) : /* @__PURE__ */ u(v, {});
|
|
102
100
|
}
|
|
103
101
|
const x = /* @__PURE__ */ R.extend({
|
|
104
102
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -122,5 +120,5 @@ const x = /* @__PURE__ */ R.extend({
|
|
|
122
120
|
});
|
|
123
121
|
export {
|
|
124
122
|
x as Bold,
|
|
125
|
-
|
|
123
|
+
K as RichTextBold
|
|
126
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 v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-BnVcq33n.cjs");require("react");require("./theme.cjs");function g(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.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=l;exports.RichTextBulletList=g;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
1
|
+
import { B as d } from "./index-Do_dsOGB.js";
|
|
2
|
+
import { jsx as c, Fragment as m } from "react/jsx-runtime";
|
|
3
|
+
import { u as f, d as v, A } from "./index-RcSPeQHn.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./index-DoiuU6VA.js";
|
|
6
5
|
import "./theme.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const t = v(B.name), {
|
|
6
|
+
function y() {
|
|
7
|
+
const t = f(B.name), {
|
|
10
8
|
icon: o = void 0,
|
|
11
9
|
tooltip: i = void 0,
|
|
12
10
|
shortcutKeys: s = void 0,
|
|
13
|
-
tooltipOptions:
|
|
11
|
+
tooltipOptions: r = {},
|
|
14
12
|
action: e = void 0,
|
|
15
13
|
isActive: l = void 0
|
|
16
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState:
|
|
14
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: u, disabled: n, update: a } = v(l), p = () => {
|
|
17
15
|
n || e && (e(), a());
|
|
18
16
|
};
|
|
19
|
-
return t ? /* @__PURE__ */
|
|
20
|
-
|
|
17
|
+
return t ? /* @__PURE__ */ c(
|
|
18
|
+
A,
|
|
21
19
|
{
|
|
22
|
-
action:
|
|
23
|
-
dataState:
|
|
20
|
+
action: p,
|
|
21
|
+
dataState: u,
|
|
24
22
|
disabled: n,
|
|
25
23
|
icon: o,
|
|
26
24
|
shortcutKeys: s,
|
|
27
25
|
tooltip: i,
|
|
28
|
-
tooltipOptions:
|
|
26
|
+
tooltipOptions: r
|
|
29
27
|
}
|
|
30
|
-
) : /* @__PURE__ */
|
|
28
|
+
) : /* @__PURE__ */ c(m, {});
|
|
31
29
|
}
|
|
32
|
-
const B = /* @__PURE__ */
|
|
30
|
+
const B = /* @__PURE__ */ d.extend({
|
|
33
31
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34
32
|
//@ts-expect-error
|
|
35
33
|
addOptions() {
|
|
@@ -52,5 +50,5 @@ const B = /* @__PURE__ */ m.extend({
|
|
|
52
50
|
});
|
|
53
51
|
export {
|
|
54
52
|
B as BulletList,
|
|
55
|
-
|
|
53
|
+
y as RichTextBulletList
|
|
56
54
|
};
|
package/lib/Callout.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 a=require("./clsx-CXbNJWDD.cjs"),o=require("./index-BnVcq33n.cjs"),t=require("react/jsx-runtime"),x=require("react");require("./theme.cjs");const c=require("lucide-react"),s=require("./select-CYyIeImH.cjs"),k=require("./index-BsFvo9PG.cjs"),j=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function q({node:e}){const{type:l="note",title:r="",body:u=""}=e.attrs,d=(j.find(h=>h.value===l)||j[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":l==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":l==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":l==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":l==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":l==="caution"}),children:[t.jsxs("div",{className:a.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":l==="note","richtext-text-[#238636]":l==="tip","richtext-text-[#ab7df8]":l==="important","richtext-text-[#d29922]":l==="warning","richtext-text-[#f85149]":l==="caution"}),children:[t.jsx(d,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:r})]}),u&&t.jsx("p",{className:"richtext-pl-[28px]",children:u})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:e}=k.useLocale(),l=o.useEditorInstance(),r=o.useButtonProps(C.name),[u,n]=x.useState(!1),[d,h]=x.useState("note"),[b,g]=x.useState(""),[f,v]=x.useState(""),{icon:y=void 0,tooltip:T=void 0,shortcutKeys:A=void 0,tooltipOptions:L={},isActive:N=void 0}=(r==null?void 0:r.componentProps)??{},{dataState:S,disabled:m}=o.useToggleActive(N),I=()=>{l&&(l.chain().focus().setCallout({type:d,title:b,body:f}).run(),n(!1),h("note"),g(""),v(""))},O=()=>{m||n(!0)};return r?t.jsxs(o.Dialog,{onOpenChange:n,open:u,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:O,dataState:S,disabled:m,icon:y,shortcutKeys:A,tooltip:T,tooltipOptions:L})}),t.jsxs(o.DialogContent,{children:[t.jsx(o.DialogTitle,{children:e("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.type")}),t.jsxs(s.Select,{onValueChange:h,value:d,children:[t.jsx(s.SelectTrigger,{children:t.jsx(s.SelectValue,{placeholder:e("editor.callout.dialog.type.placeholder")})}),t.jsx(s.SelectContent,{children:w.map(i=>t.jsx(s.SelectItem,{value:i.value,children:e(`editor.callout.type.${i.value}`)},i.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.title.label")}),t.jsx(o.Input,{onChange:i=>g(i.target.value),placeholder:e("editor.callout.dialog.title.placeholder"),value:b})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.body.label")}),t.jsx(o.Input,{onChange:i=>v(i.target.value),placeholder:e("editor.callout.dialog.body.placeholder"),value:f})]})]}),t.jsxs(o.DialogFooter,{children:[t.jsx(o.Button,{onClick:()=>n(!1),variant:"outline",children:e("editor.callout.dialog.button.cancel")}),t.jsx(o.Button,{onClick:I,children:e("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function p(e){return l=>l.getAttribute(e)}const C=a.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"callout"},button:({editor:l,t:r})=>({component:o.ActionButton,componentProps:{action:()=>!0,isActive:()=>l.isActive("callout"),disabled:!1,icon:"Callout",tooltip:r("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:e}){return["div",a.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addAttributes(){return{type:{default:"",parseHTML:p("type")},title:{default:"",parseHTML:p("title")},body:{default:"",parseHTML:p("body")}}},addCommands(){return{setCallout:e=>({chain:l})=>l().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return a.ReactNodeViewRenderer(q)}});exports.Callout=C;exports.RichTextCallout=M;
|