reactjs-tiptap-editor 1.0.19 → 1.0.21

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.
Files changed (154) hide show
  1. package/lib/{ActionMenuButton-D3b_bcin.cjs → ActionMenuButton-BVaZBdL3.cjs} +1 -1
  2. package/lib/{ActionMenuButton-B1Nfn5Hm.js → ActionMenuButton-Cpla3oSm.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +23 -23
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +2 -2
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +2 -2
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/Callout-JL3mm4GU.cjs +1 -0
  12. package/lib/Callout-mb31jDcR.js +340 -0
  13. package/lib/Callout.cjs +1 -1
  14. package/lib/Callout.js +8 -222
  15. package/lib/Clear.cjs +1 -1
  16. package/lib/Clear.js +2 -2
  17. package/lib/Code.cjs +1 -1
  18. package/lib/Code.js +2 -2
  19. package/lib/CodeBlock.cjs +20 -44
  20. package/lib/CodeBlock.js +1385 -4011
  21. package/lib/CodeView.cjs +1 -1
  22. package/lib/CodeView.js +2 -2
  23. package/lib/Color.cjs +1 -1
  24. package/lib/Color.js +3 -3
  25. package/lib/Column.cjs +1 -1
  26. package/lib/Column.js +2 -2
  27. package/lib/{Drawer-kEO7KzzC.cjs → Drawer-94nAoli4.cjs} +1 -1
  28. package/lib/{Drawer-B1-7Y4HB.js → Drawer-d9e69c7G.js} +20 -20
  29. package/lib/Drawer.cjs +1 -1
  30. package/lib/Drawer.js +4 -4
  31. package/lib/Emoji.cjs +1 -1
  32. package/lib/Emoji.js +12 -12
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +7 -7
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +2 -2
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +2 -2
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +4 -4
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +4 -4
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +9 -9
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +3 -3
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +3 -3
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +2 -2
  51. package/lib/{Iframe-XlAb03_r.js → Iframe-CkUClxtI.js} +7 -7
  52. package/lib/{Iframe-Bk5OIlvy.cjs → Iframe-qCivhCR5.cjs} +1 -1
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +3 -3
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +6 -6
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +36 -36
  59. package/lib/ImportWord.cjs +1 -1
  60. package/lib/ImportWord.js +13 -13
  61. package/lib/{Indent-ruPuj5xn.js → Indent-BTzj50Sf.js} +2 -2
  62. package/lib/{Indent-XaZNTsOk.cjs → Indent-DtgugDpq.cjs} +1 -1
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +2 -2
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +2 -2
  67. package/lib/{Katex-DKspCn-p.js → Katex-BuFwL_MA.js} +401 -422
  68. package/lib/Katex-RcbH2O5p.cjs +4 -0
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +3 -3
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +3 -3
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-DhesHreq.cjs → LinkEditBlock-CSKh_5n7.cjs} +1 -1
  76. package/lib/{LinkEditBlock-BWm2Ypt2.js → LinkEditBlock-DYOmu7jQ.js} +26 -26
  77. package/lib/MarkdownPaste.cjs +1 -1
  78. package/lib/MarkdownPaste.js +1 -1
  79. package/lib/Mention.cjs +1 -1
  80. package/lib/Mention.js +4 -4
  81. package/lib/Mermaid.cjs +2 -2
  82. package/lib/Mermaid.js +44 -43
  83. package/lib/MoreMark.cjs +1 -1
  84. package/lib/MoreMark.js +5 -5
  85. package/lib/OrderedList.cjs +1 -1
  86. package/lib/OrderedList.js +2 -2
  87. package/lib/SearchAndReplace.cjs +1 -1
  88. package/lib/SearchAndReplace.js +8 -8
  89. package/lib/SlashCommand.cjs +1 -1
  90. package/lib/SlashCommand.js +6 -6
  91. package/lib/{SlashCommandNodeView-Hf2DX4km.js → SlashCommandNodeView-CT_-28t6.js} +6 -6
  92. package/lib/{SlashCommandNodeView-CojfS61Q.cjs → SlashCommandNodeView-CYdYVjeb.cjs} +1 -1
  93. package/lib/Strike.cjs +1 -1
  94. package/lib/Strike.js +2 -2
  95. package/lib/{Table-BTkFUATL.js → Table-CEHV8gmO.js} +35 -35
  96. package/lib/{Table-C1_xLqV0.cjs → Table-DOl6C6To.cjs} +1 -1
  97. package/lib/Table.cjs +1 -1
  98. package/lib/Table.js +1 -1
  99. package/lib/TaskList.cjs +1 -1
  100. package/lib/TaskList.js +2 -2
  101. package/lib/TextAlign.cjs +1 -1
  102. package/lib/TextAlign.js +3 -3
  103. package/lib/TextDirection.cjs +1 -1
  104. package/lib/TextDirection.js +3 -3
  105. package/lib/TextUnderline.cjs +1 -1
  106. package/lib/TextUnderline.js +2 -2
  107. package/lib/{Twitter-Cj-0yyQQ.cjs → Twitter-DDuJwWdF.cjs} +1 -1
  108. package/lib/{Twitter-D5mUTILj.js → Twitter-DxqKzo3U.js} +9 -9
  109. package/lib/Twitter.cjs +1 -1
  110. package/lib/Twitter.js +3 -3
  111. package/lib/Video.cjs +1 -1
  112. package/lib/Video.js +4 -4
  113. package/lib/_commonjsHelpers-B4e78b8K.js +28 -0
  114. package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
  115. package/lib/bubble.cjs +6 -6
  116. package/lib/bubble.js +1841 -1701
  117. package/lib/{clsx-OumA9x-8.js → clsx-Bg-2aTKh.js} +11 -11
  118. package/lib/{clsx-BSBE1eoY.cjs → clsx-DSAWW32g.cjs} +1 -1
  119. package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -0
  120. package/lib/components/Bubble/index.d.ts +1 -0
  121. package/lib/{dropdown-menu-Bragdu5m.js → dropdown-menu-BYbds8yQ.js} +1 -1
  122. package/lib/{dropdown-menu-CUeq1boX.cjs → dropdown-menu-CoZZaqv5.cjs} +1 -1
  123. package/lib/extensions/CodeBlock/CodeBlock.d.ts +3 -18
  124. package/lib/{index-CDFAs4RT.js → index-B1SzsIsE.js} +1020 -1149
  125. package/lib/{index-CnePcUeF.cjs → index-C3dgmjIF.cjs} +1 -1
  126. package/lib/{index-DwSnESy-.cjs → index-C4WLt4NA.cjs} +4 -4
  127. package/lib/{index-BKlbc8Qo.js → index-CbkpBnTX.js} +1 -1
  128. package/lib/{index-CZ1_8JQQ.js → index-CjLxMm5d.js} +1 -1
  129. package/lib/{index-BVRHx_ha.js → index-D0EmqTpe.js} +74 -64
  130. package/lib/{index-cPEuL4Zr.js → index-DXtVL0al.js} +1 -1
  131. package/lib/index-DirFiHQ6.cjs +1 -0
  132. package/lib/{index-CMLwKzI0.cjs → index-DlxZt4_j.cjs} +1 -1
  133. package/lib/{index-B-7eHzaO.js → index-P5_MyY0i.js} +1 -1
  134. package/lib/{index-D7wfvzJg.cjs → index-TcJ2UKnv.cjs} +1 -1
  135. package/lib/{index-COCTP78Y.cjs → index-fbGGohBT.cjs} +1 -1
  136. package/lib/index.cjs +1 -1
  137. package/lib/index.js +12 -12
  138. package/lib/{popover-DCJpsZx0.cjs → popover-BaAurWOZ.cjs} +1 -1
  139. package/lib/{popover-C2BbhsXH.js → popover-CK54Ip2N.js} +1 -1
  140. package/lib/{renderNodeView-CmnUEfby.js → renderNodeView-CbxCTni3.js} +2 -2
  141. package/lib/{renderNodeView-DQjWzXDA.cjs → renderNodeView-DFVrJy0l.cjs} +1 -1
  142. package/lib/{separator-BuG1zwKa.cjs → separator-ByK1SKWn.cjs} +1 -1
  143. package/lib/{separator-lkMWuUvf.js → separator-XZA3-egy.js} +14 -14
  144. package/lib/style.css +1 -1
  145. package/lib/textarea--IMIy9VF.js +20 -0
  146. package/lib/textarea-mwHtiXJV.cjs +1 -0
  147. package/lib/{updatePosition-DYuAiqx-.js → updatePosition-BGD41Hbg.js} +2 -2
  148. package/lib/{updatePosition-D6AScA-1.cjs → updatePosition-CQE1ct18.cjs} +1 -1
  149. package/package.json +4 -2
  150. package/lib/Katex-BFIYLrwm.cjs +0 -4
  151. package/lib/delete-node-CosiBes5.cjs +0 -1
  152. package/lib/delete-node-eQHsyyhR.js +0 -24
  153. package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +0 -1
  154. package/lib/index-BLrMslr7.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-BLrMslr7.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-DirFiHQ6.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { Slot as n } from "@radix-ui/react-slot";
3
3
  import r from "react";
4
- import { i as d, T as m, a as f, B as s, b as u, g } from "./index-CDFAs4RT.js";
4
+ import { i as d, T as m, a as f, B as s, b as u, g } from "./index-B1SzsIsE.js";
5
5
  import "./theme.js";
6
6
  const C = r.forwardRef(
7
7
  ({ asChild: x = !1, tooltip: i, ...t }, l) => {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-DwSnESy-.cjs"),u=require("./clsx-BSBE1eoY.cjs"),s=require("./index-BLrMslr7.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-BqL4vAWE.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-C4WLt4NA.cjs"),u=require("./clsx-DSAWW32g.cjs"),s=require("./index-DirFiHQ6.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-BqL4vAWE.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
2
2
  <path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
3
3
  <path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
4
4
  </svg>`,word:`<svg
package/lib/Attachment.js CHANGED
@@ -1,10 +1,10 @@
1
- import { N as j, m as D } from "./index-BVRHx_ha.js";
2
- import { N as x, c as y, a as P } from "./clsx-OumA9x-8.js";
3
- import { Y as $, Z as R, _ as I, M as Z, $ as O, a0 as W, a1 as N, A as T, u as K, d as Y } from "./index-CDFAs4RT.js";
1
+ import { N as j, m as P } from "./index-D0EmqTpe.js";
2
+ import { N as x, c as y, a as D } from "./clsx-Bg-2aTKh.js";
3
+ import { P as R, Q as $, U as I, F as O, V as W, W as Z, X as N, A as T, u as K, d as Q } from "./index-B1SzsIsE.js";
4
4
  import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
5
- import { useRef as q, useState as G, useCallback as k, useEffect as J } from "react";
5
+ import { useRef as U, useState as X, useCallback as k, useEffect as q } from "react";
6
6
  import "./theme.js";
7
- import { LucideTableProperties as Q, LucideSheet as U, LucideImage as X, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
7
+ import { LucideTableProperties as G, LucideSheet as J, LucideImage as Y, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
8
8
  import { u as ie } from "./index-BlXGgvT-.js";
9
9
  import { g as c } from "./dom-dataset-CIEeltF6.js";
10
10
  const oe = {
@@ -56,14 +56,14 @@ const ae = {
56
56
  audio: /* @__PURE__ */ e(re, {}),
57
57
  video: /* @__PURE__ */ e(te, {}),
58
58
  file: /* @__PURE__ */ e(ee, {}),
59
- image: /* @__PURE__ */ e(X, {}),
59
+ image: /* @__PURE__ */ e(Y, {}),
60
60
  pdf: /* @__PURE__ */ e(I, {}),
61
- word: /* @__PURE__ */ e(R, {}),
62
- excel: /* @__PURE__ */ e(U, {}),
63
- ppt: /* @__PURE__ */ e(Q, {})
61
+ word: /* @__PURE__ */ e($, {}),
62
+ excel: /* @__PURE__ */ e(J, {}),
63
+ ppt: /* @__PURE__ */ e(G, {})
64
64
  };
65
65
  function b(t, o = !1) {
66
- const r = $(t), l = ae[r] || /* @__PURE__ */ e(L, {});
66
+ const r = R(t), l = ae[r] || /* @__PURE__ */ e(L, {});
67
67
  return o ? ne(r) : l;
68
68
  }
69
69
  const se = "_wrap_15oj2_2", M = {
@@ -71,22 +71,22 @@ const se = "_wrap_15oj2_2", M = {
71
71
  };
72
72
  function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
73
73
  var A;
74
- const n = q(null), i = Z(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [F, v] = G(!1), { t: w } = ie(), V = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
74
+ const n = U(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [F, v] = X(!1), { t: w } = ie(), V = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
75
75
  !i || u || n.current.click();
76
- }, [u, i]), _ = k(
76
+ }, [u, i]), B = k(
77
77
  async (C) => {
78
78
  const p = C.target.files && C.target.files[0];
79
79
  if (!p) return;
80
- const S = {
81
- fileName: W(p.name),
80
+ const _ = {
81
+ fileName: Z(p.name),
82
82
  fileSize: p.size,
83
83
  fileType: p.type,
84
- fileExt: O(p.name)
84
+ fileExt: W(p.name)
85
85
  };
86
86
  v(!0);
87
87
  try {
88
88
  const g = await V(p);
89
- r({ ...S, url: g }), v(!1);
89
+ r({ ..._, url: g }), v(!1);
90
90
  } catch (g) {
91
91
  r({
92
92
  error: `File upload fail: ${g && g.message}`
@@ -95,13 +95,13 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
95
95
  },
96
96
  [v, r]
97
97
  );
98
- J(() => {
98
+ q(() => {
99
99
  !u && !a && (m(), r({ hasTrigger: !0 }));
100
100
  }, [u, a, m, r]);
101
- const B = k(() => l(), [t]);
101
+ const S = k(() => l(), [t]);
102
102
  return i && !u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), children: [
103
103
  /* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children: F ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
104
- /* @__PURE__ */ e("input", { hidden: !0, onChange: _, ref: n, type: "file" })
104
+ /* @__PURE__ */ e("input", { hidden: !0, onChange: B, ref: n, type: "file" })
105
105
  ] }) }) : u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: [
106
106
  /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
107
107
  /* @__PURE__ */ e("span", { children: b(E) }),
@@ -116,7 +116,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
116
116
  ")"
117
117
  ] })
118
118
  ] }),
119
- /* @__PURE__ */ e(T, { action: B, icon: "Trash2", tooltip: w("editor.delete") })
119
+ /* @__PURE__ */ e(T, { action: S, icon: "Trash2", tooltip: w("editor.delete") })
120
120
  ] }) }) : H !== "null" ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: /* @__PURE__ */ e("p", { children: H }) }) }) : /* @__PURE__ */ e(L, {});
121
121
  }
122
122
  function xe() {
@@ -127,7 +127,7 @@ function xe() {
127
127
  tooltipOptions: s = {},
128
128
  action: n = void 0,
129
129
  isActive: i = void 0
130
- } = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = Y(i), h = () => {
130
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = Q(i), h = () => {
131
131
  a || n && (n(), d());
132
132
  };
133
133
  return t ? /* @__PURE__ */ e(
@@ -183,7 +183,7 @@ const ce = /* @__PURE__ */ j.create({
183
183
  } = t || {};
184
184
  return [
185
185
  "div",
186
- D(
186
+ P(
187
187
  // @ts-expect-error
188
188
  this.options.HTMLAttributes || {},
189
189
  t || {}
@@ -238,7 +238,7 @@ const ce = /* @__PURE__ */ j.create({
238
238
  };
239
239
  },
240
240
  addNodeView() {
241
- return P(le);
241
+ return D(le);
242
242
  }
243
243
  });
244
244
  export {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-DwSnESy-.cjs"),h=require("./jsx-runtime-C_NLcKys.cjs"),d=require("react/jsx-runtime"),p=require("./index-BLrMslr7.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,b=a.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return h.h("blockquote",{...a.mergeAttributes(this.options.HTMLAttributes,t),children:h.h("slot",{})})},parseMarkdown:(t,e)=>{var o;const n=(o=e.parseBlockChildren)!=null?o:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach((r,i)=>{var s,u;const l=((u=(s=e.renderChild)==null?void 0:s.call(e,r,i))!=null?u:e.renderChildren([r])).split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-C4WLt4NA.cjs"),h=require("./jsx-runtime-C_NLcKys.cjs"),d=require("react/jsx-runtime"),p=require("./index-DirFiHQ6.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,b=a.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return h.h("blockquote",{...a.mergeAttributes(this.options.HTMLAttributes,t),children:h.h("slot",{})})},parseMarkdown:(t,e)=>{var o;const n=(o=e.parseBlockChildren)!=null?o:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach((r,i)=>{var s,u;const l=((u=(s=e.renderChild)==null?void 0:s.call(e,r,i))!=null?u:e.renderChildren([r])).split(`
2
2
  `).map(q=>q.trim()===""?o:`${o} ${q}`);n.push(l.join(`
3
3
  `))}),n.join(`
4
4
  ${o}
package/lib/Blockquote.js CHANGED
@@ -1,7 +1,7 @@
1
- import { N as k, w as h, m as g } from "./index-BVRHx_ha.js";
1
+ import { N as k, w as h, m as g } from "./index-D0EmqTpe.js";
2
2
  import { h as p } from "./jsx-runtime-CT7Pcg-t.js";
3
3
  import { jsx as m, Fragment as b } from "react/jsx-runtime";
4
- import { u as f, d as q, A as v } from "./index-CDFAs4RT.js";
4
+ import { u as f, d as q, A as v } from "./index-B1SzsIsE.js";
5
5
  import "react";
6
6
  import "./theme.js";
7
7
  var B = /^\s*>\s$/, A = k.create({
package/lib/Bold.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-DwSnESy-.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),n=require("./index-BLrMslr7.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||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},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=n.useButtonProps(l.name),{icon:e=void 0,tooltip:r=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:a,update:m}=n.useToggleActive(p),h=()=>{a||d&&(d(),m())};return t?i.jsx(n.ActionButton,{action:h,dataState:g,disabled:a,icon:e,shortcutKeys:s,tooltip:r,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:r,extension:s})=>({component:n.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:r("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-C4WLt4NA.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),n=require("./index-DirFiHQ6.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||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},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=n.useButtonProps(l.name),{icon:e=void 0,tooltip:r=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:a,update:m}=n.useToggleActive(p),h=()=>{a||d&&(d(),m())};return t?i.jsx(n.ActionButton,{action:h,dataState:g,disabled:a,icon:e,shortcutKeys:s,tooltip:r,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:r,extension:s})=>({component:n.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:r("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
package/lib/Bold.js CHANGED
@@ -1,6 +1,6 @@
1
- import { M as _, f as a, h as i, m as y } from "./index-BVRHx_ha.js";
1
+ import { M as _, f as a, h as i, m as y } from "./index-D0EmqTpe.js";
2
2
  import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
3
- import { u as f, d as M, A as u } from "./index-CDFAs4RT.js";
3
+ import { u as f, d as M, A as u } from "./index-B1SzsIsE.js";
4
4
  import { jsx as l, Fragment as k } from "react/jsx-runtime";
5
5
  import "react";
6
6
  import "./theme.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-COCTP78Y.cjs"),s=require("react/jsx-runtime"),n=require("./index-BLrMslr7.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-fbGGohBT.cjs"),s=require("react/jsx-runtime"),n=require("./index-DirFiHQ6.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,6 +1,6 @@
1
- import { B as d } from "./index-cPEuL4Zr.js";
1
+ import { B as d } from "./index-DXtVL0al.js";
2
2
  import { jsx as c, Fragment as m } from "react/jsx-runtime";
3
- import { u as f, d as v, A } from "./index-CDFAs4RT.js";
3
+ import { u as f, d as v, A } from "./index-B1SzsIsE.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  function y() {
@@ -0,0 +1 @@
1
+ "use strict";const S=require("./index-C4WLt4NA.cjs"),p=require("./clsx-DSAWW32g.cjs"),c=require("./index-DirFiHQ6.cjs"),t=require("react/jsx-runtime"),x=require("react");require("./theme.cjs");const l=require("lucide-react"),H=require("@radix-ui/react-select"),_=require("./index-BqL4vAWE.cjs");function T(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>e[i]})}}return r.default=e,Object.freeze(r)}const d=T(x),a=T(H),A=a.Root,L=a.Value,m=d.forwardRef(({className:e,children:r,...i},o)=>t.jsxs(a.Trigger,{ref:o,className:c.cn("richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",e),...i,children:[r,t.jsx(a.Icon,{asChild:!0,children:t.jsx(l.ChevronDown,{className:"richtext-size-4 richtext-opacity-50"})})]}));m.displayName=a.Trigger.displayName;const I=d.forwardRef(({className:e,...r},i)=>t.jsx(a.ScrollUpButton,{ref:i,className:c.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",e),...r,children:t.jsx(l.ChevronUp,{className:"richtext-size-4"})}));I.displayName=a.ScrollUpButton.displayName;const R=d.forwardRef(({className:e,...r},i)=>t.jsx(a.ScrollDownButton,{ref:i,className:c.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",e),...r,children:t.jsx(l.ChevronDown,{className:"richtext-size-4"})}));R.displayName=a.ScrollDownButton.displayName;const b=d.forwardRef(({className:e,children:r,position:i="popper",...o},n)=>t.jsx(a.Portal,{children:t.jsxs(a.Content,{"data-richtext-portal":!0,position:i,ref:n,className:c.cn("richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",i==="popper"&&"data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",e),...o,children:[t.jsx(I,{}),t.jsx(a.Viewport,{className:c.cn("richtext-p-1",i==="popper"&&"richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(R,{})]})}));b.displayName=a.Content.displayName;const U=d.forwardRef(({className:e,...r},i)=>t.jsx(a.Label,{className:c.cn("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",e),ref:i,...r}));U.displayName=a.Label.displayName;const g=d.forwardRef(({className:e,children:r,...i},o)=>t.jsxs(a.Item,{ref:o,className:c.cn("richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...i,children:[t.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-size-3.5 richtext-items-center richtext-justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(l.Check,{className:"richtext-size-4"})})}),t.jsx(a.ItemText,{children:r})]}));g.displayName=a.Item.displayName;const E=d.forwardRef(({className:e,...r},i)=>t.jsx(a.Separator,{className:c.cn("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),ref:i,...r}));E.displayName=a.Separator.displayName;const w=[{value:"note",label:"Note",icon:l.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:l.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:l.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:l.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:l.OctagonAlert,color:"#f85149",background:"#f851491f"}];function W({node:e}){const{type:r="note",title:i="",body:o=""}=e.attrs,h=(w.find(u=>u.value===r)||w[0]).icon;return t.jsx(p.NodeViewWrapper,{children:t.jsxs("div",{className:p.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":r==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":r==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":r==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":r==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":r==="caution"}),children:[t.jsxs("div",{className:p.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":r==="note","richtext-text-[#238636]":r==="tip","richtext-text-[#ab7df8]":r==="important","richtext-text-[#d29922]":r==="warning","richtext-text-[#f85149]":r==="caution"}),children:[t.jsx(h,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),o&&t.jsx("p",{className:"richtext-pl-[28px]",children:o})]})})}const $=[{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 F(){const{t:e}=_.useLocale(),r=c.useEditorInstance(),i=c.useButtonProps(B.name),[o,n]=x.useState(!1),[h,u]=x.useState("note"),[y,j]=x.useState(""),[v,N]=x.useState(""),{icon:D=void 0,tooltip:O=void 0,shortcutKeys:k=void 0,tooltipOptions:z={},isActive:q=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:P,disabled:C}=c.useToggleActive(q),V=()=>{r&&(r.chain().focus().setCallout({type:h,title:y,body:v}).run(),n(!1),u("note"),j(""),N(""))},M=()=>{C||n(!0)};return i?t.jsxs(c.Dialog,{onOpenChange:n,open:o,children:[t.jsx(c.DialogTrigger,{asChild:!0,children:t.jsx(c.ActionButton,{action:M,dataState:P,disabled:C,icon:D,shortcutKeys:k,tooltip:O,tooltipOptions:z})}),t.jsxs(c.DialogContent,{children:[t.jsx(c.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(c.Label,{children:e("editor.callout.dialog.type")}),t.jsxs(A,{onValueChange:u,value:h,children:[t.jsx(m,{children:t.jsx(L,{placeholder:e("editor.callout.dialog.type.placeholder")})}),t.jsx(b,{children:$.map(s=>t.jsx(g,{value:s.value,children:e(`editor.callout.type.${s.value}`)},s.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(c.Label,{children:e("editor.callout.dialog.title.label")}),t.jsx(c.Input,{onChange:s=>j(s.target.value),placeholder:e("editor.callout.dialog.title.placeholder"),value:y})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(c.Label,{children:e("editor.callout.dialog.body.label")}),t.jsx(c.Input,{onChange:s=>N(s.target.value),placeholder:e("editor.callout.dialog.body.placeholder"),value:v})]})]}),t.jsxs(c.DialogFooter,{children:[t.jsx(c.Button,{onClick:()=>n(!1),variant:"outline",children:e("editor.callout.dialog.button.cancel")}),t.jsx(c.Button,{onClick:V,children:e("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function f(e){return r=>r.getAttribute(e)}const B=S.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:r,t:i})=>({component:c.ActionButton,componentProps:{action:()=>!0,isActive:()=>r.isActive("callout"),disabled:!1,icon:"Callout",tooltip:i("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:e}){return["div",S.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addAttributes(){return{type:{default:"",parseHTML:f("type")},title:{default:"",parseHTML:f("title")},body:{default:"",parseHTML:f("body")}}},addCommands(){return{setCallout:e=>({chain:r})=>r().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return p.ReactNodeViewRenderer(W)}});exports.Callout=B;exports.RichTextCallout=F;exports.Select=A;exports.SelectContent=b;exports.SelectItem=g;exports.SelectTrigger=m;exports.SelectValue=L;
@@ -0,0 +1,340 @@
1
+ import { N as U, m as E } from "./index-D0EmqTpe.js";
2
+ import { N as W, c as N, a as F } from "./clsx-Bg-2aTKh.js";
3
+ import { c as l, h as Y, u as _, d as $, D as K, r as q, A as S, s as G, v as J, L as p, j as C, w as Q, B as w } from "./index-B1SzsIsE.js";
4
+ import { jsxs as c, jsx as e, Fragment as X } from "react/jsx-runtime";
5
+ import * as d from "react";
6
+ import { useState as x } from "react";
7
+ import "./theme.js";
8
+ import { ChevronDown as A, Check as Z, ChevronUp as tt, Info as et, Lightbulb as rt, AlertCircle as it, TriangleAlert as at, OctagonAlert as ct } from "lucide-react";
9
+ import * as a from "@radix-ui/react-select";
10
+ import { u as ot } from "./index-BlXGgvT-.js";
11
+ const lt = a.Root, nt = a.Value, L = d.forwardRef(({ className: t, children: r, ...i }, o) => /* @__PURE__ */ c(
12
+ a.Trigger,
13
+ {
14
+ ref: o,
15
+ className: l(
16
+ "richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",
17
+ t
18
+ ),
19
+ ...i,
20
+ children: [
21
+ r,
22
+ /* @__PURE__ */ e(a.Icon, { asChild: !0, children: /* @__PURE__ */ e(A, { className: "richtext-size-4 richtext-opacity-50" }) })
23
+ ]
24
+ }
25
+ ));
26
+ L.displayName = a.Trigger.displayName;
27
+ const I = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
28
+ a.ScrollUpButton,
29
+ {
30
+ ref: i,
31
+ className: l(
32
+ "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
33
+ t
34
+ ),
35
+ ...r,
36
+ children: /* @__PURE__ */ e(tt, { className: "richtext-size-4" })
37
+ }
38
+ ));
39
+ I.displayName = a.ScrollUpButton.displayName;
40
+ const R = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
41
+ a.ScrollDownButton,
42
+ {
43
+ ref: i,
44
+ className: l(
45
+ "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
46
+ t
47
+ ),
48
+ ...r,
49
+ children: /* @__PURE__ */ e(A, { className: "richtext-size-4" })
50
+ }
51
+ ));
52
+ R.displayName = a.ScrollDownButton.displayName;
53
+ const B = d.forwardRef(({ className: t, children: r, position: i = "popper", ...o }, n) => /* @__PURE__ */ e(a.Portal, { children: /* @__PURE__ */ c(
54
+ a.Content,
55
+ {
56
+ "data-richtext-portal": !0,
57
+ position: i,
58
+ ref: n,
59
+ className: l(
60
+ "richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
61
+ i === "popper" && "data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",
62
+ t
63
+ ),
64
+ ...o,
65
+ children: [
66
+ /* @__PURE__ */ e(I, {}),
67
+ /* @__PURE__ */ e(
68
+ a.Viewport,
69
+ {
70
+ className: l(
71
+ "richtext-p-1",
72
+ i === "popper" && "richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"
73
+ ),
74
+ children: r
75
+ }
76
+ ),
77
+ /* @__PURE__ */ e(R, {})
78
+ ]
79
+ }
80
+ ) }));
81
+ B.displayName = a.Content.displayName;
82
+ const st = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
83
+ a.Label,
84
+ {
85
+ className: l(
86
+ "richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",
87
+ t
88
+ ),
89
+ ref: i,
90
+ ...r
91
+ }
92
+ ));
93
+ st.displayName = a.Label.displayName;
94
+ const k = d.forwardRef(({ className: t, children: r, ...i }, o) => /* @__PURE__ */ c(
95
+ a.Item,
96
+ {
97
+ ref: o,
98
+ className: l(
99
+ "richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
100
+ t
101
+ ),
102
+ ...i,
103
+ children: [
104
+ /* @__PURE__ */ e("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-size-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(Z, { className: "richtext-size-4" }) }) }),
105
+ /* @__PURE__ */ e(a.ItemText, { children: r })
106
+ ]
107
+ }
108
+ ));
109
+ k.displayName = a.Item.displayName;
110
+ const dt = d.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ e(
111
+ a.Separator,
112
+ {
113
+ className: l("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", t),
114
+ ref: i,
115
+ ...r
116
+ }
117
+ ));
118
+ dt.displayName = a.Separator.displayName;
119
+ const T = [
120
+ {
121
+ value: "note",
122
+ label: "Note",
123
+ icon: et,
124
+ color: "#1f6feb",
125
+ background: "#1f6feb1f"
126
+ },
127
+ {
128
+ value: "tip",
129
+ label: "Tip",
130
+ icon: rt,
131
+ color: "#238636",
132
+ background: "#2386361f"
133
+ },
134
+ {
135
+ value: "important",
136
+ label: "Important",
137
+ icon: it,
138
+ color: "#ab7df8",
139
+ background: "#ab7df81f"
140
+ },
141
+ {
142
+ value: "warning",
143
+ label: "Warning",
144
+ icon: at,
145
+ color: "#d29922",
146
+ background: "#d299221f"
147
+ },
148
+ {
149
+ value: "caution",
150
+ label: "Caution",
151
+ icon: ct,
152
+ color: "#f85149",
153
+ background: "#f851491f"
154
+ }
155
+ ];
156
+ function ht({ node: t }) {
157
+ const { type: r = "note", title: i = "", body: o = "" } = t.attrs, h = (T.find((u) => u.value === r) || T[0]).icon;
158
+ return /* @__PURE__ */ e(W, { children: /* @__PURE__ */ c(
159
+ "div",
160
+ {
161
+ className: N(
162
+ "richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",
163
+ {
164
+ "richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]": r === "note",
165
+ "richtext-bg-[#2386361f] richtext-border-[#238636]": r === "tip",
166
+ "richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]": r === "important",
167
+ "richtext-bg-[#d299221f] richtext-border-[#d29922]": r === "warning",
168
+ "richtext-bg-[#f851491f] richtext-border-[#f85149]": r === "caution"
169
+ }
170
+ ),
171
+ children: [
172
+ /* @__PURE__ */ c(
173
+ "div",
174
+ {
175
+ className: N("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2", {
176
+ "richtext-text-[#1f6feb]": r === "note",
177
+ "richtext-text-[#238636]": r === "tip",
178
+ "richtext-text-[#ab7df8]": r === "important",
179
+ "richtext-text-[#d29922]": r === "warning",
180
+ "richtext-text-[#f85149]": r === "caution"
181
+ }),
182
+ children: [
183
+ /* @__PURE__ */ e(h, { className: "richtext-size-5" }),
184
+ /* @__PURE__ */ e("span", { className: "richtext-font-semibold", children: i })
185
+ ]
186
+ }
187
+ ),
188
+ o && /* @__PURE__ */ e("p", { className: "richtext-pl-[28px]", children: o })
189
+ ]
190
+ }
191
+ ) });
192
+ }
193
+ const ut = [
194
+ { value: "note", label: "Note", icon: "Info" },
195
+ { value: "tip", label: "Tip", icon: "Lightbulb" },
196
+ { value: "important", label: "Important", icon: "AlertCircle" },
197
+ { value: "warning", label: "Warning", icon: "TriangleAlert" },
198
+ { value: "caution", label: "Caution", icon: "OctagonAlert" }
199
+ ];
200
+ function Ct() {
201
+ const { t } = ot(), r = Y(), i = _(xt.name), [o, n] = x(!1), [h, u] = x("note"), [f, b] = x(""), [g, y] = x(""), {
202
+ icon: D = void 0,
203
+ tooltip: z = void 0,
204
+ shortcutKeys: O = void 0,
205
+ tooltipOptions: V = {},
206
+ isActive: j = void 0
207
+ } = (i == null ? void 0 : i.componentProps) ?? {}, { dataState: H, disabled: v } = $(j), M = () => {
208
+ r && (r.chain().focus().setCallout({ type: h, title: f, body: g }).run(), n(!1), u("note"), b(""), y(""));
209
+ }, P = () => {
210
+ v || n(!0);
211
+ };
212
+ return i ? /* @__PURE__ */ c(K, { onOpenChange: n, open: o, children: [
213
+ /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
214
+ S,
215
+ {
216
+ action: P,
217
+ dataState: H,
218
+ disabled: v,
219
+ icon: D,
220
+ shortcutKeys: O,
221
+ tooltip: z,
222
+ tooltipOptions: V
223
+ }
224
+ ) }),
225
+ /* @__PURE__ */ c(G, { children: [
226
+ /* @__PURE__ */ e(J, { children: t("editor.callout.dialog.title") }),
227
+ /* @__PURE__ */ c("div", { className: "richtext-space-y-4 richtext-py-4", children: [
228
+ /* @__PURE__ */ c("div", { className: "richtext-space-y-2", children: [
229
+ /* @__PURE__ */ e(p, { children: t("editor.callout.dialog.type") }),
230
+ /* @__PURE__ */ c(lt, { onValueChange: u, value: h, children: [
231
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(nt, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
232
+ /* @__PURE__ */ e(B, { children: ut.map((s) => /* @__PURE__ */ e(k, { value: s.value, children: t(`editor.callout.type.${s.value}`) }, s.value)) })
233
+ ] })
234
+ ] }),
235
+ /* @__PURE__ */ c("div", { className: "richtext-space-y-2", children: [
236
+ /* @__PURE__ */ e(p, { children: t("editor.callout.dialog.title.label") }),
237
+ /* @__PURE__ */ e(
238
+ C,
239
+ {
240
+ onChange: (s) => b(s.target.value),
241
+ placeholder: t("editor.callout.dialog.title.placeholder"),
242
+ value: f
243
+ }
244
+ )
245
+ ] }),
246
+ /* @__PURE__ */ c("div", { className: "richtext-space-y-2", children: [
247
+ /* @__PURE__ */ e(p, { children: t("editor.callout.dialog.body.label") }),
248
+ /* @__PURE__ */ e(
249
+ C,
250
+ {
251
+ onChange: (s) => y(s.target.value),
252
+ placeholder: t("editor.callout.dialog.body.placeholder"),
253
+ value: g
254
+ }
255
+ )
256
+ ] })
257
+ ] }),
258
+ /* @__PURE__ */ c(Q, { children: [
259
+ /* @__PURE__ */ e(w, { onClick: () => n(!1), variant: "outline", children: t("editor.callout.dialog.button.cancel") }),
260
+ /* @__PURE__ */ e(w, { onClick: M, children: t("editor.callout.dialog.button.apply") })
261
+ ] })
262
+ ] })
263
+ ] }) : /* @__PURE__ */ e(X, {});
264
+ }
265
+ function m(t) {
266
+ return (r) => r.getAttribute(t);
267
+ }
268
+ const xt = /* @__PURE__ */ U.create({
269
+ name: "callout",
270
+ group: "block",
271
+ selectable: !0,
272
+ atom: !0,
273
+ draggable: !0,
274
+ inline: !1,
275
+ //@ts-expect-error
276
+ addOptions() {
277
+ var t;
278
+ return {
279
+ ...(t = this.parent) == null ? void 0 : t.call(this),
280
+ HTMLAttributes: {
281
+ class: "callout"
282
+ },
283
+ button: ({ editor: r, t: i }) => ({
284
+ component: S,
285
+ componentProps: {
286
+ action: () => !0,
287
+ isActive: () => r.isActive("callout"),
288
+ disabled: !1,
289
+ icon: "Callout",
290
+ tooltip: i("editor.callout.tooltip")
291
+ }
292
+ })
293
+ };
294
+ },
295
+ parseHTML() {
296
+ return [{ tag: "div.callout" }];
297
+ },
298
+ renderHTML({ HTMLAttributes: t }) {
299
+ return [
300
+ "div",
301
+ E(this.options && this.options.HTMLAttributes || {}, t)
302
+ ];
303
+ },
304
+ addAttributes() {
305
+ return {
306
+ type: {
307
+ default: "",
308
+ parseHTML: m("type")
309
+ },
310
+ title: {
311
+ default: "",
312
+ parseHTML: m("title")
313
+ },
314
+ body: {
315
+ default: "",
316
+ parseHTML: m("body")
317
+ }
318
+ };
319
+ },
320
+ addCommands() {
321
+ return {
322
+ setCallout: (t) => ({ chain: r }) => r().insertContent({
323
+ type: this.name,
324
+ attrs: t
325
+ }).run()
326
+ };
327
+ },
328
+ addNodeView() {
329
+ return F(ht);
330
+ }
331
+ });
332
+ export {
333
+ xt as C,
334
+ Ct as R,
335
+ lt as S,
336
+ L as a,
337
+ nt as b,
338
+ B as c,
339
+ k as d
340
+ };
package/lib/Callout.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-DwSnESy-.cjs"),h=require("./clsx-BSBE1eoY.cjs"),e=require("./index-BLrMslr7.cjs"),t=require("react/jsx-runtime"),d=require("react");require("./theme.cjs");const n=require("lucide-react"),k=require("./index-BqL4vAWE.cjs"),j=[{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 q({node:l}){const{type:o="note",title:i="",body:c=""}=l.attrs,s=(j.find(u=>u.value===o)||j[0]).icon;return t.jsx(h.NodeViewWrapper,{children:t.jsxs("div",{className:h.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:[t.jsxs("div",{className:h.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:[t.jsx(s,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),c&&t.jsx("p",{className:"richtext-pl-[28px]",children:c})]})})}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:l}=k.useLocale(),o=e.useEditorInstance(),i=e.useButtonProps(C.name),[c,a]=d.useState(!1),[s,u]=d.useState("note"),[p,b]=d.useState(""),[g,f]=d.useState(""),{icon:y=void 0,tooltip:T=void 0,shortcutKeys:A=void 0,tooltipOptions:L={},isActive:N=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:S,disabled:v}=e.useToggleActive(N),I=()=>{o&&(o.chain().focus().setCallout({type:s,title:p,body:g}).run(),a(!1),u("note"),b(""),f(""))},O=()=>{v||a(!0)};return i?t.jsxs(e.Dialog,{onOpenChange:a,open:c,children:[t.jsx(e.DialogTrigger,{asChild:!0,children:t.jsx(e.ActionButton,{action:O,dataState:S,disabled:v,icon:y,shortcutKeys:A,tooltip:T,tooltipOptions:L})}),t.jsxs(e.DialogContent,{children:[t.jsx(e.DialogTitle,{children:l("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(e.Label,{children:l("editor.callout.dialog.type")}),t.jsxs(e.Select,{onValueChange:u,value:s,children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{placeholder:l("editor.callout.dialog.type.placeholder")})}),t.jsx(e.SelectContent,{children:w.map(r=>t.jsx(e.SelectItem,{value:r.value,children:l(`editor.callout.type.${r.value}`)},r.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.title.label")}),t.jsx(e.Input,{onChange:r=>b(r.target.value),placeholder:l("editor.callout.dialog.title.placeholder"),value:p})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.body.label")}),t.jsx(e.Input,{onChange:r=>f(r.target.value),placeholder:l("editor.callout.dialog.body.placeholder"),value:g})]})]}),t.jsxs(e.DialogFooter,{children:[t.jsx(e.Button,{onClick:()=>a(!1),variant:"outline",children:l("editor.callout.dialog.button.cancel")}),t.jsx(e.Button,{onClick:I,children:l("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function x(l){return o=>o.getAttribute(l)}const C=m.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var l;return{...(l=this.parent)==null?void 0:l.call(this),HTMLAttributes:{class:"callout"},button:({editor:o,t:i})=>({component:e.ActionButton,componentProps:{action:()=>!0,isActive:()=>o.isActive("callout"),disabled:!1,icon:"Callout",tooltip:i("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:l}){return["div",m.mergeAttributes(this.options&&this.options.HTMLAttributes||{},l)]},addAttributes(){return{type:{default:"",parseHTML:x("type")},title:{default:"",parseHTML:x("title")},body:{default:"",parseHTML:x("body")}}},addCommands(){return{setCallout:l=>({chain:o})=>o().insertContent({type:this.name,attrs:l}).run()}},addNodeView(){return h.ReactNodeViewRenderer(q)}});exports.Callout=C;exports.RichTextCallout=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");require("./clsx-DSAWW32g.cjs");require("./index-DirFiHQ6.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");const e=require("./Callout-JL3mm4GU.cjs");exports.Callout=e.Callout;exports.RichTextCallout=e.RichTextCallout;