reactjs-tiptap-editor 1.0.10 → 1.0.12

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 (209) hide show
  1. package/lib/{ActionMenuButton-CKTxYtl7.js → ActionMenuButton-BKqin6Kz.js} +17 -13
  2. package/lib/ActionMenuButton-CPPHERbq.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +24 -21
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +7 -5
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +11 -9
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +14 -12
  11. package/lib/Clear.cjs +1 -1
  12. package/lib/Clear.js +3 -3
  13. package/lib/Code.cjs +1 -1
  14. package/lib/Code.js +11 -9
  15. package/lib/CodeBlock.cjs +22 -22
  16. package/lib/CodeBlock.js +102 -100
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +10 -8
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +20 -18
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +7 -5
  23. package/lib/{Drawer-Cfx115up.js → Drawer-DUPsBE0H.js} +10 -9
  24. package/lib/Drawer-fplzqNI6.cjs +1 -0
  25. package/lib/Drawer.cjs +1 -1
  26. package/lib/Drawer.js +3 -3
  27. package/lib/Emoji.cjs +1 -1
  28. package/lib/Emoji.js +11 -9
  29. package/lib/{Excalidraw-CO93Tsmb.js → Excalidraw-BEzpvRLx.js} +20 -19
  30. package/lib/Excalidraw-qjnQspLq.cjs +1 -0
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +2 -2
  33. package/lib/ExportPdf.cjs +2 -2
  34. package/lib/ExportPdf.js +7 -5
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +7 -5
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +9 -8
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +13 -12
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +25 -24
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +9 -7
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +18 -15
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +7 -5
  49. package/lib/Icon-CiR8RqdQ.cjs +1 -0
  50. package/lib/Icon-ONE1AwKo.js +12 -0
  51. package/lib/{Iframe-DwhclppJ.js → Iframe-CBTnv2mk.js} +41 -39
  52. package/lib/Iframe-DsUNJ2n2.cjs +1 -0
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +2 -2
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +25 -23
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +53 -51
  59. package/lib/ImportWord.cjs +31 -31
  60. package/lib/ImportWord.js +8 -6
  61. package/lib/{Indent-BOsymiZ7.js → Indent-B00o0P0M.js} +26 -24
  62. package/lib/Indent-CaGP0qTp.cjs +1 -0
  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 +12 -10
  67. package/lib/Katex-XsfpKgJU.cjs +4 -0
  68. package/lib/{Katex-BYK-b9X2.js → Katex-x370CSXZ.js} +12 -10
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +2 -2
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +10 -8
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-DgrLUMsJ.js → LinkEditBlock-C_ipl3EA.js} +23 -21
  76. package/lib/{LinkEditBlock-4-iRXH7m.cjs → LinkEditBlock-xt88G5fb.cjs} +2 -2
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +3 -3
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +18 -17
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +25 -22
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +10 -8
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +43 -41
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +6 -6
  89. package/lib/SlashCommandNodeView-BT5ystah.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-BpNNU7Sm.js → SlashCommandNodeView-DX6axvLs.js} +75 -66
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +7 -5
  93. package/lib/Table-DSRSwtXx.cjs +9 -0
  94. package/lib/{Table-CT9R9Sdq.js → Table-DidusYID.js} +10 -8
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +15 -13
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +20 -17
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +20 -17
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -5
  105. package/lib/Twitter-CBuVBQM1.cjs +1 -0
  106. package/lib/{Twitter-mowilxRd.js → Twitter-D58T0Zt3.js} +51 -49
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +2 -2
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +13 -11
  111. package/lib/bubble.cjs +4 -4
  112. package/lib/bubble.js +403 -407
  113. package/lib/{button-CBO-WDXK.js → button-9_8t7ca7.js} +4 -3
  114. package/lib/button-Cs9TroWr.cjs +1 -0
  115. package/lib/{checkbox-DUcLSGZD.cjs → checkbox-BQRKTXXr.cjs} +1 -1
  116. package/lib/{checkbox-D1h32VWM.js → checkbox-DnkkV6qo.js} +1 -1
  117. package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
  118. package/lib/{index-sVScpCFG.js → clsx-DmuN0U_8.js} +228 -228
  119. package/lib/{dialog-DY868Uji.cjs → dialog-BS3zm-T9.cjs} +1 -1
  120. package/lib/{dialog-DSvgtlDI.js → dialog-DhayAPvV.js} +1 -1
  121. package/lib/{dropdown-menu-BripAeGB.cjs → dropdown-menu-CxwWX0yj.cjs} +1 -1
  122. package/lib/{dropdown-menu-B88Qn2KR.js → dropdown-menu-DQqKeZcx.js} +1 -1
  123. package/lib/events.constant-Dq21NPdV.cjs +1 -0
  124. package/lib/events.constant-do95b767.js +21 -0
  125. package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
  126. package/lib/{index-0OnGZkVF.js → index-BDX1uE62.js} +78 -312
  127. package/lib/index-CBFmXCcU.cjs +1 -0
  128. package/lib/{index-DmPwbBqm.js → index-CKmT9KAQ.js} +1 -1
  129. package/lib/index-CVFzP1Dc.cjs +1 -0
  130. package/lib/index-CX4pNJlH.cjs +1 -0
  131. package/lib/index-CjhjjJsN.cjs +1 -0
  132. package/lib/index-Cs6cp0Y6.cjs +1 -0
  133. package/lib/{index-9A6-kVBM.js → index-D1jd7elj.js} +1 -1
  134. package/lib/{index-BIqaogQg.js → index-D9JOHlso.js} +449 -1216
  135. package/lib/{index-DRHrDScg.js → index-DdEmgiAA.js} +1 -1
  136. package/lib/{index-DKt5wfAc.js → index-DvvwJvau.js} +23 -23
  137. package/lib/index-EAK64CCA.js +425 -0
  138. package/lib/{index--nUS7Y66.cjs → index-neeeY2o7.cjs} +3 -3
  139. package/lib/index.cjs +9 -2
  140. package/lib/index.js +142 -26
  141. package/lib/{input-BeD5GdMv.cjs → input-BJ7ihMq-.cjs} +1 -1
  142. package/lib/{input-Bx4uo4gO.js → input-YoheBL2D.js} +1 -1
  143. package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
  144. package/lib/{isNumber-DF0fU3ob.js → isNumber-DmQXlKp3.js} +1 -1
  145. package/lib/label-C8PLcjFI.js +19 -0
  146. package/lib/label-Y7_hvqf2.cjs +1 -0
  147. package/lib/locale-bundle.cjs +1 -1
  148. package/lib/locale-bundle.js +6 -7
  149. package/lib/locales/index.d.ts +3 -4316
  150. package/lib/{popover-Csk538NC.cjs → popover-BiSrlM4j.cjs} +1 -1
  151. package/lib/{popover-BVX8otO9.js → popover-CWmTzHSy.js} +1 -1
  152. package/lib/react-BEoMZB61.cjs +1 -0
  153. package/lib/react-c9FSfB30.js +27 -0
  154. package/lib/separator-C-DKMYmg.js +329 -0
  155. package/lib/separator-CJ_adziN.cjs +1 -0
  156. package/lib/store/EditorEditableReactive.d.ts +1 -0
  157. package/lib/store/ThemeColorReactive.d.ts +1 -0
  158. package/lib/store/commandList.d.ts +1 -1
  159. package/lib/store/store.d.ts +6 -7
  160. package/lib/store-BKMaw1AW.cjs +1 -0
  161. package/lib/store-DG7cMfET.js +10 -0
  162. package/lib/style.css +1 -1
  163. package/lib/{tabs-DOasUMDU.cjs → tabs-DpHSMyF_.cjs} +1 -1
  164. package/lib/{tabs-BKpr0QQB.js → tabs-DxlKKM-N.js} +1 -1
  165. package/lib/{textarea-Ba9OOzba.js → textarea-D7m-apUh.js} +1 -1
  166. package/lib/{textarea-D9egO4qC.cjs → textarea-DU9RMi6u.cjs} +1 -1
  167. package/lib/theme/theme.d.ts +5 -0
  168. package/lib/theme.cjs +1 -1
  169. package/lib/theme.js +37 -8
  170. package/lib/{throttle-DsowOft0.js → throttle-BRtichEP.js} +1 -1
  171. package/lib/throttle-gTTvqDTW.cjs +1 -0
  172. package/lib/toggle-BYvLnjCL.cjs +1 -0
  173. package/lib/toggle-Bxwwb_Kp.js +99 -0
  174. package/lib/tooltip-BTy5CRrN.js +24 -0
  175. package/lib/tooltip-COvf4_R-.cjs +1 -0
  176. package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-CUukgu-Q.js} +2 -2
  177. package/lib/updatePosition-Cjuj2E26.cjs +1 -0
  178. package/lib/{useButtonProps-C_bqxmHi.js → useButtonProps-CfYtuEnd.js} +48 -36
  179. package/lib/useButtonProps-CydzndG1.cjs +1 -0
  180. package/lib/utils/customEvents/events.constant.d.ts +0 -5
  181. package/package.json +3 -3
  182. package/lib/ActionMenuButton-BPdRqzDX.cjs +0 -1
  183. package/lib/Drawer-hHj4Opkg.cjs +0 -1
  184. package/lib/Excalidraw-8pWJ17Ye.cjs +0 -1
  185. package/lib/Icon-D7GJZzoa.js +0 -10
  186. package/lib/Icon-gtc3g-VK.cjs +0 -1
  187. package/lib/Iframe-BmXO2c65.cjs +0 -1
  188. package/lib/Indent-DPkMWfcv.cjs +0 -1
  189. package/lib/Katex-B1XbT8-X.cjs +0 -4
  190. package/lib/SlashCommandNodeView-CQvMTXys.cjs +0 -1
  191. package/lib/Table-LnWGm2m8.cjs +0 -9
  192. package/lib/Twitter-Bo4JkBTL.cjs +0 -1
  193. package/lib/button-wt49IYwP.cjs +0 -1
  194. package/lib/events.constant-DQYeJpu5.cjs +0 -1
  195. package/lib/events.constant-wrlJ_7JZ.js +0 -26
  196. package/lib/index-BZ6DfR2r.cjs +0 -1
  197. package/lib/index-BvIJKpX1.cjs +0 -8
  198. package/lib/index-Cv9Z6dyV.cjs +0 -1
  199. package/lib/index-FSRjMsxW.cjs +0 -1
  200. package/lib/label--161UPH6.cjs +0 -1
  201. package/lib/label-uKG7RzFU.js +0 -18
  202. package/lib/separator-DLRVddHS.cjs +0 -1
  203. package/lib/separator-DtrEdjAF.js +0 -241
  204. package/lib/store/ProviderUniqueId.d.ts +0 -6
  205. package/lib/store-B8IkVz1J.cjs +0 -1
  206. package/lib/store-CsIFDUKR.js +0 -10
  207. package/lib/throttle-BM3Bmbf_.cjs +0 -1
  208. package/lib/updatePosition-M2IyqkI1.cjs +0 -1
  209. package/lib/useButtonProps-DEtmDVPr.cjs +0 -1
@@ -1,20 +1,24 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import n from "react";
3
- import { Slot as r } from "@radix-ui/react-slot";
4
- import { i as d, T as m, a as f, b as s, g as u } from "./index-BIqaogQg.js";
5
- import { B as o } from "./button-CBO-WDXK.js";
6
- const C = n.forwardRef(
7
- ({ asChild: x = !1, tooltip: i, ...t }, l) => {
2
+ import l from "react";
3
+ import { Slot as n } from "@radix-ui/react-slot";
4
+ import "./index-D9JOHlso.js";
5
+ import "./theme.js";
6
+ import { B as m } from "./button-9_8t7ca7.js";
7
+ import { T as d, a as f, b as o } from "./tooltip-BTy5CRrN.js";
8
+ import { g as s } from "./useButtonProps-CfYtuEnd.js";
9
+ import { i as u } from "./index-EAK64CCA.js";
10
+ const S = l.forwardRef(
11
+ ({ asChild: r = !1, tooltip: i, ...t }, x) => {
8
12
  var a;
9
- const h = d[t.icon];
10
- return /* @__PURE__ */ c(m, { children: [
13
+ const h = u[t.icon];
14
+ return /* @__PURE__ */ c(d, { children: [
11
15
  /* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(
12
- x ? r : o,
16
+ r ? n : m,
13
17
  {
14
18
  className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
15
19
  "data-state": t != null && t.dataState ? "on" : "off",
16
20
  disabled: t == null ? void 0 : t.disabled,
17
- ref: l,
21
+ ref: x,
18
22
  variant: "ghost",
19
23
  ...t,
20
24
  children: /* @__PURE__ */ c("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
@@ -23,13 +27,13 @@ const C = n.forwardRef(
23
27
  ] })
24
28
  }
25
29
  ) }),
26
- i && /* @__PURE__ */ e(s, { children: /* @__PURE__ */ c("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
30
+ i && /* @__PURE__ */ e(o, { children: /* @__PURE__ */ c("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
27
31
  i && /* @__PURE__ */ e("div", { children: i }),
28
- /* @__PURE__ */ e("div", { className: "richtext-flex", children: !!((a = t == null ? void 0 : t.shortcutKeys) != null && a.length) && /* @__PURE__ */ e("span", { children: u(t == null ? void 0 : t.shortcutKeys) }) })
32
+ /* @__PURE__ */ e("div", { className: "richtext-flex", children: !!((a = t == null ? void 0 : t.shortcutKeys) != null && a.length) && /* @__PURE__ */ e("span", { children: s(t == null ? void 0 : t.shortcutKeys) }) })
29
33
  ] }) })
30
34
  ] });
31
35
  }
32
36
  );
33
37
  export {
34
- C as A
38
+ S as A
35
39
  };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("react"),s=require("@radix-ui/react-slot");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const d=require("./button-Cs9TroWr.cjs"),c=require("./tooltip-COvf4_R-.cjs"),u=require("./useButtonProps-CydzndG1.cjs"),m=require("./index-CBFmXCcU.cjs"),f=a.forwardRef(({asChild:h=!1,tooltip:i,...t},r)=>{var x;const n=m.icons[t.icon],l=h?s.Slot:d.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:u.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=f;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-BBNITgNi.cjs"),x=require("./index-BvIJKpX1.cjs"),e=require("react/jsx-runtime"),m=require("react"),v=require("lucide-react"),w=require("./file-i7e4nQY2.cjs"),S=require("./index-FSRjMsxW.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),L=require("./useButtonProps-DEtmDVPr.cjs"),_={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./clsx-CXbNJWDD.cjs"),A=require("./toggle-BYvLnjCL.cjs"),e=require("react/jsx-runtime"),m=require("react"),q=require("./index-CX4pNJlH.cjs");require("./theme.cjs");const v=require("lucide-react"),L=require("./index-CBFmXCcU.cjs"),f=require("./file-i7e4nQY2.cjs"),_=require("./index-CVFzP1Dc.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),C=require("./useButtonProps-CydzndG1.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
@@ -16,4 +16,4 @@
16
16
  fill="currentColor"
17
17
  d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
18
18
  />
19
- </svg>`,excel:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function q(t){const n=_[t],a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement,s=["svg",{...Array.from(a.attributes).reduce((i,o)=>(i[o.name]=o.value,i),{})}];return Array.from(a.childNodes).forEach(i=>{if(i.nodeType===1){const o=[i.tagName.toLowerCase(),Array.from(i.attributes).reduce((u,h)=>(u[h.name]=h.value,u),{})];i.textContent&&o.push(i.textContent),s.push(o)}}),s}const R={audio:e.jsx(v.LucideAudioLines,{}),video:e.jsx(v.LucideVideo,{}),file:e.jsx(v.LucideFile,{}),image:e.jsx(v.LucideImage,{}),pdf:e.jsx(x.ExportPdf,{}),word:e.jsx(x.ExportWord,{}),excel:e.jsx(v.LucideSheet,{}),ppt:e.jsx(v.LucideTableProperties,{})};function C(t,n=!1){const r=w.normalizeFileType(t),c=R[r]||e.jsx(e.Fragment,{});return n?q(r):c}const P="_wrap_17afc_2",A={wrap:P};function $({editor:t,node:n,updateAttributes:r,deleteNode:c,extension:a}){var T;const s=m.useRef(null),i=x.useEditableEditor(),{hasTrigger:o,fileName:u,fileSize:h,fileExt:N,fileType:z,url:p,error:M}=n.attrs,[E,y]=m.useState(!1),{t:k}=S.useLocale(),F=(T=a==null?void 0:a.options)==null?void 0:T.upload,f=m.useCallback(()=>{!i||p||s.current.click()},[p,i]),V=m.useCallback(async b=>{const g=b.target.files&&b.target.files[0];if(!g)return;const D={fileName:w.extractFilename(g.name),fileSize:g.size,fileType:g.type,fileExt:w.extractFileExtension(g.name)};y(!0);try{const j=await F(g);r({...D,url:j}),y(!1)}catch(j){r({error:`File upload fail: ${j&&j.message}`||"Unknown error"}),y(!1),s.current.value=""}},[y,r]);m.useEffect(()=>{!p&&!o&&(f(),r({hasTrigger:!0}))},[p,o,f,r]);const B=m.useCallback(()=>c(),[t]);return i&&!p?e.jsx(l.NodeViewWrapper,{children:e.jsxs("div",{className:l.clsx(A.wrap,"render-wrapper"),children:[e.jsx("p",{onClick:f,style:{cursor:"pointer"},children:E?e.jsx("span",{children:k("editor.attachment.uploading")}):e.jsx("span",{children:k("editor.attachment.please_upload")})}),e.jsx("input",{hidden:!0,onChange:V,ref:s,type:"file"})]})}):p?e.jsx(l.NodeViewWrapper,{children:e.jsxs("div",{className:l.clsx(A.wrap,"render-wrapper"),onClick:f,children:[e.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:[e.jsx("span",{children:C(z)}),e.jsxs("span",{children:[u,".",N]}),e.jsxs("span",{children:["(",w.normalizeFileSize(h),")"]})]}),e.jsx(x.ActionButton,{action:B,icon:"Trash2",tooltip:k("editor.delete")})]})}):M!=="null"?e.jsx(l.NodeViewWrapper,{children:e.jsx("div",{className:l.clsx(A.wrap,"render-wrapper"),onClick:f,children:e.jsx("p",{children:M})})}):e.jsx(e.Fragment,{})}function I(){const t=L.useButtonProps(H.name),{icon:n=void 0,tooltip:r=void 0,shortcutKeys:c=void 0,tooltipOptions:a={},action:s=void 0,isActive:i=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o,update:u}=L.useToggleActive(i),h=()=>{o||s&&(s(),u())};return t?e.jsx(x.ActionButton,{action:h,disabled:o,icon:n,shortcutKeys:c,tooltip:r,tooltipOptions:a}):e.jsx(e.Fragment,{})}const H=l.Node3.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"attachment"},button:({editor:n,t:r})=>({component:x.ActionButton,componentProps:{action:()=>n.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:r("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:t}){const{url:n="",fileName:r="",fileSize:c="",fileType:a="",fileExt:s=""}=t||{};return["div",l.mergeAttributes(this.options.HTMLAttributes||{},t||{}),n?["a",{href:n||"#"},["span",{class:"attachment__icon"},C(a,!0)],["span",{class:"attachment__text"},`${r}.${s} (${w.normalizeFileSize(c)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{fileName:{default:null,parseHTML:d.getDatasetAttribute("filename")},fileSize:{default:null,parseHTML:d.getDatasetAttribute("filesize")},fileType:{default:null,parseHTML:d.getDatasetAttribute("filetype")},fileExt:{default:null,parseHTML:d.getDatasetAttribute("fileext")},url:{default:null,parseHTML:d.getDatasetAttribute("url")},hasTrigger:{default:!1,parseHTML:t=>d.getDatasetAttribute("hastrigger")(t)==="true"},error:{default:null,parseHTML:d.getDatasetAttribute("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:n})=>n().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return l.ReactNodeViewRenderer($)}});exports.Attachment=H;exports.RichTextAttachment=I;
19
+ </svg>`,excel:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function P(t){const n=R[t],a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement,s=["svg",{...Array.from(a.attributes).reduce((i,o)=>(i[o.name]=o.value,i),{})}];return Array.from(a.childNodes).forEach(i=>{if(i.nodeType===1){const o=[i.tagName.toLowerCase(),Array.from(i.attributes).reduce((u,h)=>(u[h.name]=h.value,u),{})];i.textContent&&o.push(i.textContent),s.push(o)}}),s}const $={audio:e.jsx(v.LucideAudioLines,{}),video:e.jsx(v.LucideVideo,{}),file:e.jsx(v.LucideFile,{}),image:e.jsx(v.LucideImage,{}),pdf:e.jsx(L.ExportPdf,{}),word:e.jsx(L.ExportWord,{}),excel:e.jsx(v.LucideSheet,{}),ppt:e.jsx(v.LucideTableProperties,{})};function H(t,n=!1){const r=f.normalizeFileType(t),c=$[r]||e.jsx(e.Fragment,{});return n?P(r):c}const I="_wrap_17afc_2",k={wrap:I};function O({editor:t,node:n,updateAttributes:r,deleteNode:c,extension:a}){var T;const s=m.useRef(null),i=q.useEditableEditor(),{hasTrigger:o,fileName:u,fileSize:h,fileExt:z,fileType:E,url:p,error:M}=n.attrs,[F,w]=m.useState(!1),{t:j}=_.useLocale(),V=(T=a==null?void 0:a.options)==null?void 0:T.upload,x=m.useCallback(()=>{!i||p||s.current.click()},[p,i]),B=m.useCallback(async b=>{const g=b.target.files&&b.target.files[0];if(!g)return;const S={fileName:f.extractFilename(g.name),fileSize:g.size,fileType:g.type,fileExt:f.extractFileExtension(g.name)};w(!0);try{const y=await V(g);r({...S,url:y}),w(!1)}catch(y){r({error:`File upload fail: ${y&&y.message}`||"Unknown error"}),w(!1),s.current.value=""}},[w,r]);m.useEffect(()=>{!p&&!o&&(x(),r({hasTrigger:!0}))},[p,o,x,r]);const D=m.useCallback(()=>c(),[t]);return i&&!p?e.jsx(l.NodeViewWrapper,{children:e.jsxs("div",{className:l.clsx(k.wrap,"render-wrapper"),children:[e.jsx("p",{onClick:x,style:{cursor:"pointer"},children:F?e.jsx("span",{children:j("editor.attachment.uploading")}):e.jsx("span",{children:j("editor.attachment.please_upload")})}),e.jsx("input",{hidden:!0,onChange:B,ref:s,type:"file"})]})}):p?e.jsx(l.NodeViewWrapper,{children:e.jsxs("div",{className:l.clsx(k.wrap,"render-wrapper"),onClick:x,children:[e.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:[e.jsx("span",{children:H(E)}),e.jsxs("span",{children:[u,".",z]}),e.jsxs("span",{children:["(",f.normalizeFileSize(h),")"]})]}),e.jsx(A.ActionButton,{action:D,icon:"Trash2",tooltip:j("editor.delete")})]})}):M!=="null"?e.jsx(l.NodeViewWrapper,{children:e.jsx("div",{className:l.clsx(k.wrap,"render-wrapper"),onClick:x,children:e.jsx("p",{children:M})})}):e.jsx(e.Fragment,{})}function W(){const t=C.useButtonProps(N.name),{icon:n=void 0,tooltip:r=void 0,shortcutKeys:c=void 0,tooltipOptions:a={},action:s=void 0,isActive:i=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o,update:u}=C.useToggleActive(i),h=()=>{o||s&&(s(),u())};return t?e.jsx(A.ActionButton,{action:h,disabled:o,icon:n,shortcutKeys:c,tooltip:r,tooltipOptions:a}):e.jsx(e.Fragment,{})}const N=l.Node3.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"attachment"},button:({editor:n,t:r})=>({component:A.ActionButton,componentProps:{action:()=>n.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:r("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:t}){const{url:n="",fileName:r="",fileSize:c="",fileType:a="",fileExt:s=""}=t||{};return["div",l.mergeAttributes(this.options.HTMLAttributes||{},t||{}),n?["a",{href:n||"#"},["span",{class:"attachment__icon"},H(a,!0)],["span",{class:"attachment__text"},`${r}.${s} (${f.normalizeFileSize(c)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{fileName:{default:null,parseHTML:d.getDatasetAttribute("filename")},fileSize:{default:null,parseHTML:d.getDatasetAttribute("filesize")},fileType:{default:null,parseHTML:d.getDatasetAttribute("filetype")},fileExt:{default:null,parseHTML:d.getDatasetAttribute("fileext")},url:{default:null,parseHTML:d.getDatasetAttribute("url")},hasTrigger:{default:!1,parseHTML:t=>d.getDatasetAttribute("hastrigger")(t)==="true"},error:{default:null,parseHTML:d.getDatasetAttribute("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:n})=>n().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return l.ReactNodeViewRenderer(O)}});exports.Attachment=N;exports.RichTextAttachment=W;
package/lib/Attachment.js CHANGED
@@ -1,12 +1,15 @@
1
- import { q as x, C as y, N as j, u as D, m as P } from "./index-sVScpCFG.js";
2
- import { E as R, l as $, k as I, A as T } from "./index-BIqaogQg.js";
1
+ import { o as x, B as y, N as j, s as D, m as P } from "./clsx-DmuN0U_8.js";
2
+ import { A as T } from "./toggle-Bxwwb_Kp.js";
3
3
  import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
4
- import { useRef as O, useState as Z, useCallback as k, useEffect as W } from "react";
5
- import { LucideTableProperties as q, LucideSheet as K, LucideImage as U, LucideFile as G, LucideVideo as J, LucideAudioLines as Q } from "lucide-react";
4
+ import { useRef as R, useState as $, useCallback as k, useEffect as I } from "react";
5
+ import { a as O } from "./index-D9JOHlso.js";
6
+ import "./theme.js";
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-EAK64CCA.js";
6
9
  import { n as X, e as Y, a as ee, b as N } from "./file-BLas99n7.js";
7
- import { u as te } from "./index-0OnGZkVF.js";
10
+ import { u as te } from "./index-BDX1uE62.js";
8
11
  import { g as c } from "./dom-dataset-CIEeltF6.js";
9
- import { u as re, a as ie } from "./useButtonProps-C_bqxmHi.js";
12
+ import { u as re, a as ie } from "./useButtonProps-CfYtuEnd.js";
10
13
  const oe = {
11
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>',
12
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>',
@@ -53,14 +56,14 @@ function ne(t) {
53
56
  }), n;
54
57
  }
55
58
  const ae = {
56
- audio: /* @__PURE__ */ e(Q, {}),
57
- video: /* @__PURE__ */ e(J, {}),
58
- file: /* @__PURE__ */ e(G, {}),
59
- image: /* @__PURE__ */ e(U, {}),
60
- pdf: /* @__PURE__ */ e($, {}),
61
- word: /* @__PURE__ */ e(R, {}),
62
- excel: /* @__PURE__ */ e(K, {}),
63
- ppt: /* @__PURE__ */ e(q, {})
59
+ audio: /* @__PURE__ */ e(G, {}),
60
+ video: /* @__PURE__ */ e(q, {}),
61
+ file: /* @__PURE__ */ e(U, {}),
62
+ image: /* @__PURE__ */ e(K, {}),
63
+ pdf: /* @__PURE__ */ e(Q, {}),
64
+ word: /* @__PURE__ */ e(J, {}),
65
+ excel: /* @__PURE__ */ e(W, {}),
66
+ ppt: /* @__PURE__ */ e(Z, {})
64
67
  };
65
68
  function b(t, o = !1) {
66
69
  const r = X(t), l = ae[r] || /* @__PURE__ */ e(L, {});
@@ -70,12 +73,12 @@ const se = "_wrap_17afc_2", M = {
70
73
  wrap: se
71
74
  };
72
75
  function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
73
- var C;
74
- const n = O(null), i = I(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: E, fileType: z, url: u, error: H } = o.attrs, [F, v] = Z(!1), { t: w } = te(), V = (C = s == null ? void 0 : s.options) == null ? void 0 : C.upload, m = k(() => {
76
+ var A;
77
+ const n = R(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: E, fileType: z, url: u, error: H } = o.attrs, [F, v] = $(!1), { t: w } = te(), V = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
75
78
  !i || u || n.current.click();
76
79
  }, [u, i]), B = k(
77
- async (A) => {
78
- const p = A.target.files && A.target.files[0];
80
+ async (C) => {
81
+ const p = C.target.files && C.target.files[0];
79
82
  if (!p)
80
83
  return;
81
84
  const _ = {
@@ -94,7 +97,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
94
97
  },
95
98
  [v, r]
96
99
  );
97
- W(() => {
100
+ I(() => {
98
101
  !u && !a && (m(), r({ hasTrigger: !0 }));
99
102
  }, [u, a, m, r]);
100
103
  const S = k(() => l(), [t]);
@@ -154,7 +157,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
154
157
  }
155
158
  ) }) : /* @__PURE__ */ e(L, {});
156
159
  }
157
- function xe() {
160
+ function Me() {
158
161
  const t = re(ce.name), {
159
162
  icon: o = void 0,
160
163
  tooltip: r = void 0,
@@ -282,5 +285,5 @@ const ce = /* @__PURE__ */ j.create({
282
285
  });
283
286
  export {
284
287
  ce as Attachment,
285
- xe as RichTextAttachment
288
+ Me as RichTextAttachment
286
289
  };
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-BBNITgNi.cjs"),a=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),g=require("./index-BvIJKpX1.cjs");require("react");const p=require("./useButtonProps-DEtmDVPr.cjs");var m=/^\s*>\s$/,b=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return a.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:a.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
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-BYvLnjCL.cjs");require("react");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const p=require("./useButtonProps-CydzndG1.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}
5
- `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[c.wrappingInputRule({find:m,type:this.type})]}});function f(){const t=p.useButtonProps(h.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:n=void 0,tooltipOptions:i={},action:s=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:u,disabled:r,update:q}=p.useToggleActive(d),k=()=>{r||s&&(s(),q())};return t?l.jsx(g.ActionButton,{action:k,dataState:u,disabled:r,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:i}):l.jsx(l.Fragment,{})}const h=b.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:o,extension:n})=>({componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote"),disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:n.options.shortcutKeys??["shift","mod","B"],tooltip:o("editor.blockquote.tooltip")}})}}});exports.Blockquote=h;exports.RichTextBlockquote=f;
5
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[c.wrappingInputRule({find:m,type:this.type})]}});function f(){const t=p.useButtonProps(q.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:n=void 0,tooltipOptions:i={},action:s=void 0,isActive:a=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:u,disabled:r,update:h}=p.useToggleActive(a),g=()=>{r||s&&(s(),h())};return t?l.jsx(k.ActionButton,{action:g,dataState:u,disabled:r,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:i}):l.jsx(l.Fragment,{})}const q=b.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:o,extension:n})=>({componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote"),disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:n.options.shortcutKeys??["shift","mod","B"],tooltip:o("editor.blockquote.tooltip")}})}}});exports.Blockquote=q;exports.RichTextBlockquote=f;
package/lib/Blockquote.js CHANGED
@@ -1,9 +1,11 @@
1
- import { N as m, w as h, m as k } from "./index-sVScpCFG.js";
1
+ import { N as m, w as h, m as k } from "./clsx-DmuN0U_8.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 "./index-BIqaogQg.js";
4
+ import { A as g } from "./toggle-Bxwwb_Kp.js";
5
5
  import "react";
6
- import { u as b, a as q } from "./useButtonProps-C_bqxmHi.js";
6
+ import "./index-D9JOHlso.js";
7
+ import "./theme.js";
8
+ import { u as b, a as q } from "./useButtonProps-CfYtuEnd.js";
7
9
  var v = /^\s*>\s$/, B = m.create({
8
10
  name: "blockquote",
9
11
  addOptions() {
@@ -55,7 +57,7 @@ ${e}
55
57
  ];
56
58
  }
57
59
  });
58
- function H() {
60
+ function $() {
59
61
  const t = b(A.name), {
60
62
  icon: o = void 0,
61
63
  tooltip: e = void 0,
@@ -104,5 +106,5 @@ const A = /* @__PURE__ */ B.extend({
104
106
  });
105
107
  export {
106
108
  A as Blockquote,
107
- H as RichTextBlockquote
109
+ $ as RichTextBlockquote
108
110
  };
package/lib/Bold.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BBNITgNi.cjs"),a=require("./jsx-runtime-C_NLcKys.cjs"),l=require("./index-BvIJKpX1.cjs"),s=require("react/jsx-runtime");require("react");const u=require("./useButtonProps-DEtmDVPr.cjs");var B=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,v=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,M=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return a.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:a.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:B,type:this.type}),o.markInputRule({find:k,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:v,type:this.type})]}});function b(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:p={},action:i=void 0,isActive:g=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:m,disabled:d,update:h}=u.useToggleActive(g),y=()=>{d||i&&(i(),h())};return t?s.jsx(l.ActionButton,{action:y,dataState:m,disabled:d,icon:e,shortcutKeys:n,tooltip:r,tooltipOptions:p}):s.jsx(s.Fragment,{})}const c=M.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r,extension:n})=>({component:l.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:n.options.shortcutKeys??["mod","B"],tooltip:r("editor.bold.tooltip")}})}}});exports.Bold=c;exports.RichTextBold=b;
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-BYvLnjCL.cjs"),s=require("react/jsx-runtime");require("react");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const u=require("./useButtonProps-CydzndG1.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,9 +1,11 @@
1
- import { M as _, f as a, h as i, m as f } from "./index-sVScpCFG.js";
1
+ import { M as _, e as i, f as a, m as f } from "./clsx-DmuN0U_8.js";
2
2
  import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
3
- import { A as l } from "./index-BIqaogQg.js";
3
+ import { A as l } from "./toggle-Bxwwb_Kp.js";
4
4
  import { jsx as u, Fragment as y } from "react/jsx-runtime";
5
5
  import "react";
6
- import { u as M, a as v } from "./useButtonProps-C_bqxmHi.js";
6
+ import "./index-D9JOHlso.js";
7
+ import "./theme.js";
8
+ import { u as M, a as v } from "./useButtonProps-CfYtuEnd.js";
7
9
  var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, b = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, A = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, R = _.create({
8
10
  name: "bold",
9
11
  addOptions() {
@@ -51,11 +53,11 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
51
53
  },
52
54
  addInputRules() {
53
55
  return [
54
- i({
56
+ a({
55
57
  find: B,
56
58
  type: this.type
57
59
  }),
58
- i({
60
+ a({
59
61
  find: b,
60
62
  type: this.type
61
63
  })
@@ -63,18 +65,18 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
63
65
  },
64
66
  addPasteRules() {
65
67
  return [
66
- a({
68
+ i({
67
69
  find: k,
68
70
  type: this.type
69
71
  }),
70
- a({
72
+ i({
71
73
  find: A,
72
74
  type: this.type
73
75
  })
74
76
  ];
75
77
  }
76
78
  });
77
- function K() {
79
+ function O() {
78
80
  const t = M(x.name), {
79
81
  icon: e = void 0,
80
82
  tooltip: o = void 0,
@@ -120,5 +122,5 @@ const x = /* @__PURE__ */ R.extend({
120
122
  });
121
123
  export {
122
124
  x as Bold,
123
- K as RichTextBold
125
+ O as RichTextBold
124
126
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-CApXPpjF.cjs"),s=require("react/jsx-runtime"),B=require("./index-BvIJKpX1.cjs");require("react");const c=require("./useButtonProps-DEtmDVPr.cjs");function x(){const t=c.useButtonProps(r.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:l={},action:n=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=c.useToggleActive(d),v=()=>{u||n&&(n(),p())};return t?s.jsx(B.ActionButton,{action:v,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:l}):s.jsx(s.Fragment,{})}const r=m.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=r;exports.RichTextBulletList=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),m=require("./toggle-BYvLnjCL.cjs");require("react");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const u=require("./useButtonProps-CydzndG1.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,9 +1,11 @@
1
- import { B as d } from "./index-DRHrDScg.js";
2
- import { jsx as r, Fragment as m } from "react/jsx-runtime";
3
- import { A as f } from "./index-BIqaogQg.js";
1
+ import { B as m } from "./index-DdEmgiAA.js";
2
+ import { jsx as r, Fragment as d } from "react/jsx-runtime";
3
+ import { A as f } from "./toggle-Bxwwb_Kp.js";
4
4
  import "react";
5
- import { u as v, a as A } from "./useButtonProps-C_bqxmHi.js";
6
- function y() {
5
+ import "./index-D9JOHlso.js";
6
+ import "./theme.js";
7
+ import { u as v, a as A } from "./useButtonProps-CfYtuEnd.js";
8
+ function O() {
7
9
  const t = v(B.name), {
8
10
  icon: o = void 0,
9
11
  tooltip: i = void 0,
@@ -11,23 +13,23 @@ function y() {
11
13
  tooltipOptions: c = {},
12
14
  action: e = void 0,
13
15
  isActive: l = void 0
14
- } = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: a, disabled: n, update: u } = A(l), p = () => {
15
- n || e && (e(), u());
16
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: p, disabled: n, update: a } = A(l), u = () => {
17
+ n || e && (e(), a());
16
18
  };
17
19
  return t ? /* @__PURE__ */ r(
18
20
  f,
19
21
  {
20
- action: p,
21
- dataState: a,
22
+ action: u,
23
+ dataState: p,
22
24
  disabled: n,
23
25
  icon: o,
24
26
  shortcutKeys: s,
25
27
  tooltip: i,
26
28
  tooltipOptions: c
27
29
  }
28
- ) : /* @__PURE__ */ r(m, {});
30
+ ) : /* @__PURE__ */ r(d, {});
29
31
  }
30
- const B = /* @__PURE__ */ d.extend({
32
+ const B = /* @__PURE__ */ m.extend({
31
33
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
32
34
  //@ts-expect-error
33
35
  addOptions() {
@@ -50,5 +52,5 @@ const B = /* @__PURE__ */ d.extend({
50
52
  });
51
53
  export {
52
54
  B as BulletList,
53
- y as RichTextBulletList
55
+ O as RichTextBulletList
54
56
  };
package/lib/Clear.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-BBNITgNi.cjs"),n=require("react/jsx-runtime"),v=require("./index-BvIJKpX1.cjs"),c=require("./useButtonProps-DEtmDVPr.cjs");function f(){const t=c.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:i=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=c.useActive(l),d=()=>{r||i&&i()};return t?n.jsx(v.ActionButton,{action:d,disabled:r,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),v=require("./toggle-BYvLnjCL.cjs"),c=require("./useButtonProps-CydzndG1.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 "./index-sVScpCFG.js";
1
+ import { N as p } from "./clsx-DmuN0U_8.js";
2
2
  import { jsx as e, Fragment as l } from "react/jsx-runtime";
3
- import { A as m } from "./index-BIqaogQg.js";
4
- import { u as d, b as f } from "./useButtonProps-C_bqxmHi.js";
3
+ import { A as m } from "./toggle-Bxwwb_Kp.js";
4
+ import { u as d, b as f } from "./useButtonProps-CfYtuEnd.js";
5
5
  function b() {
6
6
  const o = d(v.name), {
7
7
  icon: t = void 0,
package/lib/Code.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BBNITgNi.cjs"),i=require("react/jsx-runtime"),h=require("./index-BvIJKpX1.cjs");require("react");const a=require("./useButtonProps-DEtmDVPr.cjs");var x=/(^|[^`])`([^`]+)`(?!`)$/,C=/(^|[^`])`([^`]+)`(?!`)/g,v=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:x,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:C,type:this.type})]}});function M(){const e=a.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:s=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:d,update:m}=a.useToggleActive(p),g=()=>{d||s&&(s(),m())};return e?i.jsx(h.ActionButton,{action:g,dataState:l,disabled:d,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=v.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),h=require("./toggle-BYvLnjCL.cjs");require("react");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const u=require("./useButtonProps-CydzndG1.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,8 +1,10 @@
1
- import { M as m, f as l, h as g, m as h } from "./index-sVScpCFG.js";
1
+ import { M as m, e as l, f as g, m as h } from "./clsx-DmuN0U_8.js";
2
2
  import { jsx as a, Fragment as M } from "react/jsx-runtime";
3
- import { A as f } from "./index-BIqaogQg.js";
3
+ import { A as f } from "./toggle-Bxwwb_Kp.js";
4
4
  import "react";
5
- import { u as v, a as C } from "./useButtonProps-C_bqxmHi.js";
5
+ import "./index-D9JOHlso.js";
6
+ import "./theme.js";
7
+ import { u as v, a as C } from "./useButtonProps-CfYtuEnd.js";
6
8
  var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
7
9
  name: "code",
8
10
  addOptions() {
@@ -51,15 +53,15 @@ var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
51
53
  ];
52
54
  }
53
55
  });
54
- function L() {
56
+ function w() {
55
57
  const t = v(A.name), {
56
58
  icon: e = void 0,
57
59
  tooltip: o = void 0,
58
60
  shortcutKeys: r = void 0,
59
- tooltipOptions: d = {},
61
+ tooltipOptions: i = {},
60
62
  action: n = void 0,
61
- isActive: i = void 0
62
- } = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: u, disabled: s, update: c } = C(i), p = () => {
63
+ isActive: d = void 0
64
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: u, disabled: s, update: c } = C(d), p = () => {
63
65
  s || n && (n(), c());
64
66
  };
65
67
  return t ? /* @__PURE__ */ a(
@@ -71,7 +73,7 @@ function L() {
71
73
  icon: e,
72
74
  shortcutKeys: r,
73
75
  tooltip: o,
74
- tooltipOptions: d
76
+ tooltipOptions: i
75
77
  }
76
78
  ) : /* @__PURE__ */ a(M, {});
77
79
  }
@@ -97,5 +99,5 @@ const A = /* @__PURE__ */ y.extend({
97
99
  });
98
100
  export {
99
101
  A as Code,
100
- L as RichTextCode
102
+ w as RichTextCode
101
103
  };