reactjs-tiptap-editor 1.0.12 → 1.0.13
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-CPPHERbq.cjs → ActionMenuButton-DNj0f_A4.cjs} +1 -1
- package/lib/{ActionMenuButton-BKqin6Kz.js → ActionMenuButton-l5rSmAO_.js} +11 -11
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +6 -6
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +4 -4
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +4 -4
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +4 -4
- package/lib/Callout.cjs +1 -0
- package/lib/Callout.js +230 -0
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +4 -4
- package/lib/CodeBlock.cjs +20 -20
- package/lib/CodeBlock.js +90 -89
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +4 -4
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +6 -6
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +4 -4
- package/lib/{Drawer-DUPsBE0H.js → Drawer-Cbi_MURj.js} +16 -16
- package/lib/{Drawer-fplzqNI6.cjs → Drawer-DKU32YW_.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +16 -16
- package/lib/{Excalidraw-BEzpvRLx.js → Excalidraw-CWrVL5hs.js} +30 -30
- package/lib/{Excalidraw-qjnQspLq.cjs → Excalidraw-Kb-TRcWY.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +4 -4
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +4 -4
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +6 -6
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +6 -6
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +14 -14
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +6 -6
- package/lib/History.cjs +1 -1
- package/lib/History.js +13 -13
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +4 -4
- package/lib/{Icon-ONE1AwKo.js → Icon-Ctva8VeB.js} +2 -2
- package/lib/{Icon-CiR8RqdQ.cjs → Icon-yqCglrdK.cjs} +1 -1
- package/lib/{Iframe-DsUNJ2n2.cjs → Iframe-BczF8Hex.cjs} +1 -1
- package/lib/{Iframe-CBTnv2mk.js → Iframe-C942bNjs.js} +12 -12
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +48 -48
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +15 -15
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.js +9 -9
- package/lib/{Indent-B00o0P0M.js → Indent-C_O5WdyR.js} +4 -4
- package/lib/{Indent-CaGP0qTp.cjs → Indent-CkEC7x36.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 +4 -4
- package/lib/{Katex-x370CSXZ.js → Katex-D3PEWimM.js} +24 -24
- package/lib/{Katex-XsfpKgJU.cjs → Katex-DW_HjgNM.cjs} +2 -2
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +14 -14
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-xt88G5fb.cjs → LinkEditBlock-DL1e2ILk.cjs} +2 -2
- package/lib/{LinkEditBlock-C_ipl3EA.js → LinkEditBlock-h5054QDo.js} +31 -31
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +28 -29
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +14 -14
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +4 -4
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +17 -17
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +6 -6
- package/lib/{SlashCommandNodeView-BT5ystah.cjs → SlashCommandNodeView-BqrmHCpu.cjs} +1 -1
- package/lib/{SlashCommandNodeView-DX6axvLs.js → SlashCommandNodeView-DXUqkx82.js} +12 -12
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +4 -4
- package/lib/{Table-DidusYID.js → Table-DdrY4jcM.js} +7 -7
- package/lib/{Table-DSRSwtXx.cjs → Table-kY0nbqJo.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 +4 -4
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +16 -16
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +16 -16
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +4 -4
- package/lib/{Twitter-D58T0Zt3.js → Twitter-B-JQ3ZJ1.js} +18 -18
- package/lib/{Twitter-CBuVBQM1.cjs → Twitter-DjZcVa3l.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +24 -24
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +2083 -1950
- package/lib/button-BS3n6_Aq.cjs +1 -0
- package/lib/{button-9_8t7ca7.js → button-Uv01FNnd.js} +7 -7
- package/lib/{checkbox-BQRKTXXr.cjs → checkbox-C8ByRi7-.cjs} +1 -1
- package/lib/{checkbox-DnkkV6qo.js → checkbox-DEFNwGwb.js} +1 -1
- package/lib/{clsx-DmuN0U_8.js → clsx-BWSGDJNJ.js} +13 -13
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
- package/lib/components/Bubble/index.d.ts +1 -0
- package/lib/components/ui/index.d.ts +1 -0
- package/lib/{dialog-BS3zm-T9.cjs → dialog-Bt5zwGYB.cjs} +1 -1
- package/lib/{dialog-DhayAPvV.js → dialog-DwTMZSt6.js} +1 -1
- package/lib/{dropdown-menu-DQqKeZcx.js → dropdown-menu-BetI14G6.js} +1 -1
- package/lib/{dropdown-menu-CxwWX0yj.cjs → dropdown-menu-Bo68IEOT.cjs} +1 -1
- package/lib/extensions/Callout/Callout.d.ts +18 -0
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
- package/lib/extensions/Callout/index.d.ts +1 -0
- package/lib/{index-D1jd7elj.js → index-BDKHXe7R.js} +1 -1
- package/lib/{index-CKmT9KAQ.js → index-CHKWG6E8.js} +1 -1
- package/lib/{index-EAK64CCA.js → index-CcoWj0mF.js} +131 -130
- package/lib/index-D3RLYf-J.cjs +1 -0
- package/lib/{index-D9JOHlso.js → index-DF5ZPtWM.js} +369 -482
- package/lib/{index-DdEmgiAA.js → index-DJbmnBzK.js} +1 -1
- package/lib/index-Doks9cbR.cjs +1 -0
- package/lib/{index-BDX1uE62.js → index-Dujzr6bY.js} +135 -39
- package/lib/{index-CBFmXCcU.cjs → index-VhKd73hZ.cjs} +1 -1
- package/lib/{index-DvvwJvau.js → index-mR8PNv5P.js} +23 -23
- package/lib/index.cjs +1 -1
- package/lib/index.js +3 -3
- package/lib/{input-YoheBL2D.js → input-DUBdJD3L.js} +5 -5
- package/lib/{input-BJ7ihMq-.cjs → input-Dt_BA_9B.cjs} +1 -1
- package/lib/{isNumber-DmQXlKp3.js → isNumber-CIgubz2e.js} +1 -1
- package/lib/{label-Y7_hvqf2.cjs → label-JNOksCA-.cjs} +1 -1
- package/lib/{label-C8PLcjFI.js → label-topD46-u.js} +2 -2
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +16 -0
- package/lib/locales/fi.d.ts +16 -0
- package/lib/locales/hu.d.ts +16 -0
- package/lib/locales/index.d.ts +96 -0
- package/lib/locales/pt-br.d.ts +16 -0
- package/lib/locales/vi.d.ts +16 -0
- package/lib/locales/zh-cn.d.ts +16 -0
- package/lib/{popover-CWmTzHSy.js → popover-LfNBhRyz.js} +1 -1
- package/lib/{popover-BiSrlM4j.cjs → popover-mL-2sX5r.cjs} +1 -1
- package/lib/select-CwGYPsPq.cjs +1 -0
- package/lib/select-DctYuHLH.js +117 -0
- package/lib/{separator-C-DKMYmg.js → separator-Ddfrhn4D.js} +18 -18
- package/lib/{separator-CJ_adziN.cjs → separator-NoH_SLRW.cjs} +1 -1
- package/lib/{store-BKMaw1AW.cjs → store-CkjKIgjQ.cjs} +1 -1
- package/lib/{store-DG7cMfET.js → store-DNpS8vXA.js} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-DxlKKM-N.js → tabs-BT3AeqQQ.js} +1 -1
- package/lib/{tabs-DpHSMyF_.cjs → tabs-DRSwUeKP.cjs} +1 -1
- package/lib/{textarea-DU9RMi6u.cjs → textarea-BDO6XQoF.cjs} +1 -1
- package/lib/{textarea-D7m-apUh.js → textarea-DZzMEDfZ.js} +1 -1
- package/lib/{throttle-BRtichEP.js → throttle-IERhwcLa.js} +1 -1
- package/lib/{toggle-BYvLnjCL.cjs → toggle-BQHMh_Q-.cjs} +1 -1
- package/lib/{toggle-Bxwwb_Kp.js → toggle-DKHg5sLm.js} +10 -10
- package/lib/{tooltip-COvf4_R-.cjs → tooltip-BYtGp6FM.cjs} +1 -1
- package/lib/{tooltip-BTy5CRrN.js → tooltip-DNKq7zgN.js} +1 -1
- package/lib/{updatePosition-CUukgu-Q.js → updatePosition-Bie75EFq.js} +2 -2
- package/lib/{useButtonProps-CydzndG1.cjs → useButtonProps-DBJkNDS2.cjs} +1 -1
- package/lib/{useButtonProps-CfYtuEnd.js → useButtonProps-DVP4s_ER.js} +3 -3
- package/package.json +1 -1
- package/lib/button-Cs9TroWr.cjs +0 -1
- package/lib/index-CVFzP1Dc.cjs +0 -1
- package/lib/index-CX4pNJlH.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("react"),s=require("@radix-ui/react-slot");require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("react"),s=require("@radix-ui/react-slot");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const d=require("./useButtonProps-DBJkNDS2.cjs"),u=require("./button-BS3n6_Aq.cjs"),m=require("./index-VhKd73hZ.cjs"),c=require("./tooltip-BYtGp6FM.cjs"),f=a.forwardRef(({asChild:h=!1,tooltip:i,...t},r)=>{var x;const n=m.icons[t.icon],l=h?s.Slot:u.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l,{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:r,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"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((x=t==null?void 0:t.shortcutKeys)!=null&&x.length)&&e.jsx("span",{children:d.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=f;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { Slot as n } from "@radix-ui/react-slot";
|
|
4
|
-
import "./index-
|
|
4
|
+
import "./index-DF5ZPtWM.js";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { g as m } from "./useButtonProps-DVP4s_ER.js";
|
|
7
|
+
import { B as d } from "./button-Uv01FNnd.js";
|
|
8
|
+
import { i as f } from "./index-CcoWj0mF.js";
|
|
9
|
+
import { T as o, a as s, b as u } from "./tooltip-DNKq7zgN.js";
|
|
10
10
|
const S = l.forwardRef(
|
|
11
11
|
({ asChild: r = !1, tooltip: i, ...t }, x) => {
|
|
12
12
|
var a;
|
|
13
|
-
const h =
|
|
14
|
-
return /* @__PURE__ */ c(
|
|
15
|
-
/* @__PURE__ */ e(
|
|
16
|
-
r ? n :
|
|
13
|
+
const h = f[t.icon];
|
|
14
|
+
return /* @__PURE__ */ c(o, { children: [
|
|
15
|
+
/* @__PURE__ */ e(s, { asChild: !0, children: /* @__PURE__ */ e(
|
|
16
|
+
r ? n : d,
|
|
17
17
|
{
|
|
18
18
|
className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
|
|
19
19
|
"data-state": t != null && t.dataState ? "on" : "off",
|
|
@@ -27,9 +27,9 @@ const S = l.forwardRef(
|
|
|
27
27
|
] })
|
|
28
28
|
}
|
|
29
29
|
) }),
|
|
30
|
-
i && /* @__PURE__ */ e(
|
|
30
|
+
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
31
|
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:
|
|
32
|
+
/* @__PURE__ */ e("div", { className: "richtext-flex", children: !!((a = t == null ? void 0 : t.shortcutKeys) != null && a.length) && /* @__PURE__ */ e("span", { children: m(t == null ? void 0 : t.shortcutKeys) }) })
|
|
33
33
|
] }) })
|
|
34
34
|
] });
|
|
35
35
|
}
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./clsx-CXbNJWDD.cjs"),A=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./clsx-CXbNJWDD.cjs"),A=require("./toggle-BQHMh_Q-.cjs"),e=require("react/jsx-runtime"),m=require("react"),q=require("./index-D3RLYf-J.cjs");require("./theme.cjs");const v=require("lucide-react"),L=require("./index-VhKd73hZ.cjs"),f=require("./file-i7e4nQY2.cjs"),_=require("./index-Doks9cbR.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),C=require("./useButtonProps-DBJkNDS2.cjs"),R={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,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as T } from "./toggle-
|
|
1
|
+
import { h as x, j as y, N as j, k as D, m as P } from "./clsx-BWSGDJNJ.js";
|
|
2
|
+
import { A as T } from "./toggle-DKHg5sLm.js";
|
|
3
3
|
import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
|
|
4
4
|
import { useRef as R, useState as $, useCallback as k, useEffect as I } from "react";
|
|
5
|
-
import { a as O } from "./index-
|
|
5
|
+
import { a as O } from "./index-DF5ZPtWM.js";
|
|
6
6
|
import "./theme.js";
|
|
7
7
|
import { LucideTableProperties as Z, LucideSheet as W, LucideImage as K, LucideFile as U, LucideVideo as q, LucideAudioLines as G } from "lucide-react";
|
|
8
|
-
import { E as J, a as Q } from "./index-
|
|
8
|
+
import { E as J, a as Q } from "./index-CcoWj0mF.js";
|
|
9
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-
|
|
10
|
+
import { u as te } from "./index-Dujzr6bY.js";
|
|
11
11
|
import { g as c } from "./dom-dataset-CIEeltF6.js";
|
|
12
|
-
import { u as re, a as ie } from "./useButtonProps-
|
|
12
|
+
import { u as re, a as ie } from "./useButtonProps-DVP4s_ER.js";
|
|
13
13
|
const oe = {
|
|
14
14
|
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
15
|
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>',
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),d=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),k=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),d=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),k=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const p=require("./useButtonProps-DBJkNDS2.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 d.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:d.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}
|
package/lib/Blockquote.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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-BWSGDJNJ.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 "./toggle-
|
|
4
|
+
import { A as g } from "./toggle-DKHg5sLm.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-DF5ZPtWM.js";
|
|
7
7
|
import "./theme.js";
|
|
8
|
-
import { u as b, a as q } from "./useButtonProps-
|
|
8
|
+
import { u as b, a as q } from "./useButtonProps-DVP4s_ER.js";
|
|
9
9
|
var v = /^\s*>\s$/, B = m.create({
|
|
10
10
|
name: "blockquote",
|
|
11
11
|
addOptions() {
|
package/lib/Bold.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./clsx-CXbNJWDD.cjs"),a=require("./jsx-runtime-C_NLcKys.cjs"),l=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./clsx-CXbNJWDD.cjs"),a=require("./jsx-runtime-C_NLcKys.cjs"),l=require("./toggle-BQHMh_Q-.cjs"),s=require("react/jsx-runtime");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const u=require("./useButtonProps-DBJkNDS2.cjs");var B=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,v=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,M=r.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",{...r.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[r.markInputRule({find:B,type:this.type}),r.markInputRule({find:k,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:_,type:this.type}),r.markPasteRule({find:v,type:this.type})]}});function b(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:o=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:o,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:o,extension:n})=>({component:l.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:n.options.shortcutKeys??["mod","B"],tooltip:o("editor.bold.tooltip")}})}}});exports.Bold=c;exports.RichTextBold=b;
|
package/lib/Bold.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { M as _, e as i, f as a, m as f } from "./clsx-
|
|
1
|
+
import { M as _, e as i, f as a, m as f } from "./clsx-BWSGDJNJ.js";
|
|
2
2
|
import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { A as l } from "./toggle-
|
|
3
|
+
import { A as l } from "./toggle-DKHg5sLm.js";
|
|
4
4
|
import { jsx as u, Fragment as y } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-DF5ZPtWM.js";
|
|
7
7
|
import "./theme.js";
|
|
8
|
-
import { u as M, a as v } from "./useButtonProps-
|
|
8
|
+
import { u as M, a as v } from "./useButtonProps-DVP4s_ER.js";
|
|
9
9
|
var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, b = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, A = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, R = _.create({
|
|
10
10
|
name: "bold",
|
|
11
11
|
addOptions() {
|
package/lib/BulletList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),m=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),m=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const u=require("./useButtonProps-DBJkNDS2.cjs");function B(){const t=u.useButtonProps(c.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:r,update:p}=u.useToggleActive(d),v=()=>{r||n&&(n(),p())};return t?s.jsx(m.ActionButton,{action:v,dataState:a,disabled:r,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:l}):s.jsx(s.Fragment,{})}const c=g.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=c;exports.RichTextBulletList=B;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as m } from "./index-
|
|
1
|
+
import { B as m } from "./index-DJbmnBzK.js";
|
|
2
2
|
import { jsx as r, Fragment as d } from "react/jsx-runtime";
|
|
3
|
-
import { A as f } from "./toggle-
|
|
3
|
+
import { A as f } from "./toggle-DKHg5sLm.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-DF5ZPtWM.js";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { u as v, a as A } from "./useButtonProps-
|
|
7
|
+
import { u as v, a as A } from "./useButtonProps-DVP4s_ER.js";
|
|
8
8
|
function O() {
|
|
9
9
|
const t = v(B.name), {
|
|
10
10
|
icon: o = void 0,
|
package/lib/Callout.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./clsx-CXbNJWDD.cjs"),L=require("./toggle-BQHMh_Q-.cjs"),e=require("react/jsx-runtime"),x=require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const n=require("lucide-react"),c=require("./dialog-Bt5zwGYB.cjs"),s=require("./select-CwGYPsPq.cjs"),p=require("./useButtonProps-DBJkNDS2.cjs"),R=require("./index-Doks9cbR.cjs"),b=require("./label-JNOksCA-.cjs"),y=require("./input-Dt_BA_9B.cjs"),T=require("./button-BS3n6_Aq.cjs"),A=[{value:"note",label:"Note",icon:n.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:n.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:n.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:n.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:n.OctagonAlert,color:"#f85149",background:"#f851491f"}];function D({node:t}){const{type:o="note",title:l="",body:u=""}=t.attrs,d=(A.find(h=>h.value===o)||A[0]).icon;return e.jsx(i.NodeViewWrapper,{children:e.jsxs("div",{className:i.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":o==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":o==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":o==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":o==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":o==="caution"}),children:[e.jsxs("div",{className:i.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":o==="note","richtext-text-[#238636]":o==="tip","richtext-text-[#ab7df8]":o==="important","richtext-text-[#d29922]":o==="warning","richtext-text-[#f85149]":o==="caution"}),children:[e.jsx(d,{className:"richtext-size-5"}),e.jsx("span",{className:"richtext-font-semibold",children:l})]}),u&&e.jsx("p",{className:"richtext-pl-[28px]",children:u})]})})}const H=[{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 P(){const{t}=R.useLocale(),o=p.useEditorInstance(),l=p.useButtonProps(N.name),[u,a]=x.useState(!1),[d,h]=x.useState("note"),[f,v]=x.useState(""),[m,j]=x.useState(""),{icon:q=void 0,tooltip:S=void 0,shortcutKeys:I=void 0,tooltipOptions:O={},isActive:k=void 0}=(l==null?void 0:l.componentProps)??{},{dataState:w,disabled:C}=p.useToggleActive(k),B=()=>{o&&(o.chain().focus().setCallout({type:d,title:f,body:m}).run(),a(!1),h("note"),v(""),j(""))},M=()=>{C||a(!0)};return l?e.jsxs(c.Dialog,{onOpenChange:a,open:u,children:[e.jsx(c.DialogTrigger,{asChild:!0,children:e.jsx(L.ActionButton,{action:M,dataState:w,disabled:C,icon:q,shortcutKeys:I,tooltip:S,tooltipOptions:O})}),e.jsxs(c.DialogContent,{children:[e.jsx(c.DialogTitle,{children:t("editor.callout.dialog.title")}),e.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[e.jsxs("div",{className:"richtext-space-y-2",children:[e.jsx(b.Label,{children:t("editor.callout.dialog.type")}),e.jsxs(s.Select,{onValueChange:h,value:d,children:[e.jsx(s.SelectTrigger,{children:e.jsx(s.SelectValue,{placeholder:t("editor.callout.dialog.type.placeholder")})}),e.jsx(s.SelectContent,{children:H.map(r=>e.jsx(s.SelectItem,{value:r.value,children:t(`editor.callout.type.${r.value}`)},r.value))})]})]}),e.jsxs("div",{className:"richtext-space-y-2",children:[e.jsx(b.Label,{children:t("editor.callout.dialog.title.label")}),e.jsx(y.Input,{onChange:r=>v(r.target.value),placeholder:t("editor.callout.dialog.title.placeholder"),value:f})]}),e.jsxs("div",{className:"richtext-space-y-2",children:[e.jsx(b.Label,{children:t("editor.callout.dialog.body.label")}),e.jsx(y.Input,{onChange:r=>j(r.target.value),placeholder:t("editor.callout.dialog.body.placeholder"),value:m})]})]}),e.jsxs(c.DialogFooter,{children:[e.jsx(T.Button,{onClick:()=>a(!1),variant:"outline",children:t("editor.callout.dialog.button.cancel")}),e.jsx(T.Button,{onClick:B,children:t("editor.callout.dialog.button.apply")})]})]})]}):e.jsx(e.Fragment,{})}function g(t){return o=>(console.log({element:o}),o.getAttribute(t))}const N=i.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"callout"},button:({editor:o,t:l})=>({component:L.ActionButton,componentProps:{action:()=>!0,isActive:()=>o.isActive("callout"),disabled:!1,icon:"Callout",tooltip:l("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:t}){return console.log({HTMLAttributes:t}),["div",i.mergeAttributes(this.options&&this.options.HTMLAttributes||{},t)]},addAttributes(){return{type:{default:"",parseHTML:g("type")},title:{default:"",parseHTML:g("title")},body:{default:"",parseHTML:g("body")}}},addCommands(){return{setCallout:t=>({chain:o})=>o().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return i.ReactNodeViewRenderer(D)}});exports.Callout=N;exports.RichTextCallout=P;
|
package/lib/Callout.js
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { h as D, j as x, N as B, k as H, m as M } from "./clsx-BWSGDJNJ.js";
|
|
2
|
+
import { A as T } from "./toggle-DKHg5sLm.js";
|
|
3
|
+
import { jsx as o, jsxs as l, Fragment as V } from "react/jsx-runtime";
|
|
4
|
+
import { useState as s } from "react";
|
|
5
|
+
import "./index-DF5ZPtWM.js";
|
|
6
|
+
import "./theme.js";
|
|
7
|
+
import { Info as P, Lightbulb as j, AlertCircle as E, TriangleAlert as R, OctagonAlert as W } from "lucide-react";
|
|
8
|
+
import { D as F, a as U, b as Y, c as _, d as $ } from "./dialog-DwTMZSt6.js";
|
|
9
|
+
import { S as z, a as K, b as q, c as G, d as J } from "./select-DctYuHLH.js";
|
|
10
|
+
import { c as Q, u as X, a as Z } from "./useButtonProps-DVP4s_ER.js";
|
|
11
|
+
import { u as tt } from "./index-Dujzr6bY.js";
|
|
12
|
+
import { L as u } from "./label-topD46-u.js";
|
|
13
|
+
import { I as v } from "./input-DUBdJD3L.js";
|
|
14
|
+
import { B as C } from "./button-Uv01FNnd.js";
|
|
15
|
+
const y = [
|
|
16
|
+
{ value: "note", label: "Note", icon: P, color: "#1f6feb", background: "#1f6feb1f" },
|
|
17
|
+
{ value: "tip", label: "Tip", icon: j, color: "#238636", background: "#2386361f" },
|
|
18
|
+
{ value: "important", label: "Important", icon: E, color: "#ab7df8", background: "#ab7df81f" },
|
|
19
|
+
{ value: "warning", label: "Warning", icon: R, color: "#d29922", background: "#d299221f" },
|
|
20
|
+
{ value: "caution", label: "Caution", icon: W, color: "#f85149", background: "#f851491f" }
|
|
21
|
+
];
|
|
22
|
+
function et({ node: t }) {
|
|
23
|
+
const { type: e = "note", title: r = "", body: n = "" } = t.attrs, c = (y.find((d) => d.value === e) || y[0]).icon;
|
|
24
|
+
return /* @__PURE__ */ o(D, { children: /* @__PURE__ */ l(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: x(
|
|
28
|
+
"richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",
|
|
29
|
+
{
|
|
30
|
+
"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]": e === "note",
|
|
31
|
+
"richtext-bg-[#2386361f] richtext-border-[#238636]": e === "tip",
|
|
32
|
+
"richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]": e === "important",
|
|
33
|
+
"richtext-bg-[#d299221f] richtext-border-[#d29922]": e === "warning",
|
|
34
|
+
"richtext-bg-[#f851491f] richtext-border-[#f85149]": e === "caution"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ l(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: x("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2", {
|
|
42
|
+
"richtext-text-[#1f6feb]": e === "note",
|
|
43
|
+
"richtext-text-[#238636]": e === "tip",
|
|
44
|
+
"richtext-text-[#ab7df8]": e === "important",
|
|
45
|
+
"richtext-text-[#d29922]": e === "warning",
|
|
46
|
+
"richtext-text-[#f85149]": e === "caution"
|
|
47
|
+
}),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ o(c, { className: "richtext-size-5" }),
|
|
50
|
+
/* @__PURE__ */ o("span", { className: "richtext-font-semibold", children: r })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
n && /* @__PURE__ */ o("p", { className: "richtext-pl-[28px]", children: n })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
) });
|
|
58
|
+
}
|
|
59
|
+
const ot = [
|
|
60
|
+
{ value: "note", label: "Note", icon: "Info" },
|
|
61
|
+
{ value: "tip", label: "Tip", icon: "Lightbulb" },
|
|
62
|
+
{ value: "important", label: "Important", icon: "AlertCircle" },
|
|
63
|
+
{ value: "warning", label: "Warning", icon: "TriangleAlert" },
|
|
64
|
+
{ value: "caution", label: "Caution", icon: "OctagonAlert" }
|
|
65
|
+
];
|
|
66
|
+
function xt() {
|
|
67
|
+
const { t } = tt(), e = Q(), r = X(lt.name), [n, i] = s(!1), [c, d] = s("note"), [h, b] = s(""), [f, g] = s(""), {
|
|
68
|
+
icon: A = void 0,
|
|
69
|
+
tooltip: N = void 0,
|
|
70
|
+
shortcutKeys: L = void 0,
|
|
71
|
+
tooltipOptions: I = {},
|
|
72
|
+
isActive: S = void 0
|
|
73
|
+
} = (r == null ? void 0 : r.componentProps) ?? {}, { dataState: k, disabled: m } = Z(S), w = () => {
|
|
74
|
+
e && (e.chain().focus().setCallout({ type: c, title: h, body: f }).run(), i(!1), d("note"), b(""), g(""));
|
|
75
|
+
}, O = () => {
|
|
76
|
+
m || i(!0);
|
|
77
|
+
};
|
|
78
|
+
return r ? /* @__PURE__ */ l(
|
|
79
|
+
F,
|
|
80
|
+
{
|
|
81
|
+
onOpenChange: i,
|
|
82
|
+
open: n,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ o(U, { asChild: !0, children: /* @__PURE__ */ o(
|
|
85
|
+
T,
|
|
86
|
+
{
|
|
87
|
+
action: O,
|
|
88
|
+
dataState: k,
|
|
89
|
+
disabled: m,
|
|
90
|
+
icon: A,
|
|
91
|
+
shortcutKeys: L,
|
|
92
|
+
tooltip: N,
|
|
93
|
+
tooltipOptions: I
|
|
94
|
+
}
|
|
95
|
+
) }),
|
|
96
|
+
/* @__PURE__ */ l(Y, { children: [
|
|
97
|
+
/* @__PURE__ */ o(_, { children: t("editor.callout.dialog.title") }),
|
|
98
|
+
/* @__PURE__ */ l("div", { className: "richtext-space-y-4 richtext-py-4", children: [
|
|
99
|
+
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
100
|
+
/* @__PURE__ */ o(u, { children: t("editor.callout.dialog.type") }),
|
|
101
|
+
/* @__PURE__ */ l(
|
|
102
|
+
z,
|
|
103
|
+
{
|
|
104
|
+
onValueChange: d,
|
|
105
|
+
value: c,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ o(K, { children: /* @__PURE__ */ o(q, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
|
|
108
|
+
/* @__PURE__ */ o(G, { children: ot.map((a) => /* @__PURE__ */ o(
|
|
109
|
+
J,
|
|
110
|
+
{
|
|
111
|
+
value: a.value,
|
|
112
|
+
children: t(`editor.callout.type.${a.value}`)
|
|
113
|
+
},
|
|
114
|
+
a.value
|
|
115
|
+
)) })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
121
|
+
/* @__PURE__ */ o(u, { children: t("editor.callout.dialog.title.label") }),
|
|
122
|
+
/* @__PURE__ */ o(
|
|
123
|
+
v,
|
|
124
|
+
{
|
|
125
|
+
onChange: (a) => b(a.target.value),
|
|
126
|
+
placeholder: t("editor.callout.dialog.title.placeholder"),
|
|
127
|
+
value: h
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
132
|
+
/* @__PURE__ */ o(u, { children: t("editor.callout.dialog.body.label") }),
|
|
133
|
+
/* @__PURE__ */ o(
|
|
134
|
+
v,
|
|
135
|
+
{
|
|
136
|
+
onChange: (a) => g(a.target.value),
|
|
137
|
+
placeholder: t("editor.callout.dialog.body.placeholder"),
|
|
138
|
+
value: f
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ l($, { children: [
|
|
144
|
+
/* @__PURE__ */ o(
|
|
145
|
+
C,
|
|
146
|
+
{
|
|
147
|
+
onClick: () => i(!1),
|
|
148
|
+
variant: "outline",
|
|
149
|
+
children: t("editor.callout.dialog.button.cancel")
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ o(C, { onClick: w, children: t("editor.callout.dialog.button.apply") })
|
|
153
|
+
] })
|
|
154
|
+
] })
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
) : /* @__PURE__ */ o(V, {});
|
|
158
|
+
}
|
|
159
|
+
function p(t) {
|
|
160
|
+
return (e) => (console.log({
|
|
161
|
+
element: e
|
|
162
|
+
}), e.getAttribute(t));
|
|
163
|
+
}
|
|
164
|
+
const lt = /* @__PURE__ */ B.create({
|
|
165
|
+
name: "callout",
|
|
166
|
+
group: "block",
|
|
167
|
+
selectable: !0,
|
|
168
|
+
atom: !0,
|
|
169
|
+
draggable: !0,
|
|
170
|
+
inline: !1,
|
|
171
|
+
//@ts-expect-error
|
|
172
|
+
addOptions() {
|
|
173
|
+
var t;
|
|
174
|
+
return {
|
|
175
|
+
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
176
|
+
HTMLAttributes: {
|
|
177
|
+
class: "callout"
|
|
178
|
+
},
|
|
179
|
+
button: ({ editor: e, t: r }) => ({
|
|
180
|
+
component: T,
|
|
181
|
+
componentProps: {
|
|
182
|
+
action: () => !0,
|
|
183
|
+
isActive: () => e.isActive("callout"),
|
|
184
|
+
disabled: !1,
|
|
185
|
+
icon: "Callout",
|
|
186
|
+
tooltip: r("editor.callout.tooltip")
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
parseHTML() {
|
|
192
|
+
return [{ tag: "div.callout" }];
|
|
193
|
+
},
|
|
194
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
195
|
+
return console.log({
|
|
196
|
+
HTMLAttributes: t
|
|
197
|
+
}), ["div", M(this.options && this.options.HTMLAttributes || {}, t)];
|
|
198
|
+
},
|
|
199
|
+
addAttributes() {
|
|
200
|
+
return {
|
|
201
|
+
type: {
|
|
202
|
+
default: "",
|
|
203
|
+
parseHTML: p("type")
|
|
204
|
+
},
|
|
205
|
+
title: {
|
|
206
|
+
default: "",
|
|
207
|
+
parseHTML: p("title")
|
|
208
|
+
},
|
|
209
|
+
body: {
|
|
210
|
+
default: "",
|
|
211
|
+
parseHTML: p("body")
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
addCommands() {
|
|
216
|
+
return {
|
|
217
|
+
setCallout: (t) => ({ chain: e }) => e().insertContent({
|
|
218
|
+
type: this.name,
|
|
219
|
+
attrs: t
|
|
220
|
+
}).run()
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
addNodeView() {
|
|
224
|
+
return H(et);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
export {
|
|
228
|
+
lt as Callout,
|
|
229
|
+
xt as RichTextCallout
|
|
230
|
+
};
|
package/lib/Clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),v=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),v=require("./toggle-BQHMh_Q-.cjs"),c=require("./useButtonProps-DBJkNDS2.cjs");function f(){const t=c.useButtonProps(s.name),{icon:o=void 0,tooltip:e=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:o,shortcutKeys:a,tooltip:e,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:o,t:e})=>({componentProps:{action:()=>o.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>o.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:e("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=f;
|
package/lib/Clear.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as p } from "./clsx-
|
|
1
|
+
import { N as p } from "./clsx-BWSGDJNJ.js";
|
|
2
2
|
import { jsx as e, Fragment as l } from "react/jsx-runtime";
|
|
3
|
-
import { A as m } from "./toggle-
|
|
4
|
-
import { u as d, b as f } from "./useButtonProps-
|
|
3
|
+
import { A as m } from "./toggle-DKHg5sLm.js";
|
|
4
|
+
import { u as d, b as f } from "./useButtonProps-DVP4s_ER.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("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),h=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),h=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const u=require("./useButtonProps-DBJkNDS2.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=u.useButtonProps(a.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:i=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:d,update:g}=u.useToggleActive(p),m=()=>{d||i&&(i(),g())};return e?s.jsx(h.ActionButton,{action:m,dataState:l,disabled:d,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):s.jsx(s.Fragment,{})}const a=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=a;exports.RichTextCode=M;
|
package/lib/Code.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { M as m, e as l, f as g, m as h } from "./clsx-
|
|
1
|
+
import { M as m, e as l, f as g, m as h } from "./clsx-BWSGDJNJ.js";
|
|
2
2
|
import { jsx as a, Fragment as M } from "react/jsx-runtime";
|
|
3
|
-
import { A as f } from "./toggle-
|
|
3
|
+
import { A as f } from "./toggle-DKHg5sLm.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-DF5ZPtWM.js";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { u as v, a as C } from "./useButtonProps-
|
|
7
|
+
import { u as v, a as C } from "./useButtonProps-DVP4s_ER.js";
|
|
8
8
|
var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|
|
9
9
|
name: "code",
|
|
10
10
|
addOptions() {
|