reactjs-tiptap-editor 1.0.12 → 1.0.14

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 (180) hide show
  1. package/lib/{ActionMenuButton-CPPHERbq.cjs → ActionMenuButton-DNj0f_A4.cjs} +1 -1
  2. package/lib/{ActionMenuButton-BKqin6Kz.js → ActionMenuButton-l5rSmAO_.js} +11 -11
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +6 -6
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +4 -4
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +4 -4
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +4 -4
  11. package/lib/Callout.cjs +1 -0
  12. package/lib/Callout.js +230 -0
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +3 -3
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +4 -4
  17. package/lib/CodeBlock.cjs +20 -20
  18. package/lib/CodeBlock.js +90 -89
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +4 -4
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +6 -6
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +4 -4
  25. package/lib/{Drawer-DUPsBE0H.js → Drawer-Cbi_MURj.js} +16 -16
  26. package/lib/{Drawer-fplzqNI6.cjs → Drawer-DKU32YW_.cjs} +1 -1
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +3 -3
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +16 -16
  31. package/lib/{Excalidraw-BEzpvRLx.js → Excalidraw-CWrVL5hs.js} +30 -30
  32. package/lib/{Excalidraw-qjnQspLq.cjs → Excalidraw-Kb-TRcWY.cjs} +1 -1
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +2 -2
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +4 -4
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +4 -4
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +6 -6
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +6 -6
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +14 -14
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +6 -6
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +13 -13
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +4 -4
  51. package/lib/{Icon-ONE1AwKo.js → Icon-Ctva8VeB.js} +2 -2
  52. package/lib/{Icon-CiR8RqdQ.cjs → Icon-yqCglrdK.cjs} +1 -1
  53. package/lib/{Iframe-DsUNJ2n2.cjs → Iframe-BczF8Hex.cjs} +1 -1
  54. package/lib/{Iframe-CBTnv2mk.js → Iframe-C942bNjs.js} +12 -12
  55. package/lib/Iframe.cjs +1 -1
  56. package/lib/Iframe.js +2 -2
  57. package/lib/Image.cjs +1 -1
  58. package/lib/Image.js +48 -48
  59. package/lib/ImageGif.cjs +1 -1
  60. package/lib/ImageGif.js +15 -15
  61. package/lib/ImportWord.cjs +2 -2
  62. package/lib/ImportWord.js +9 -9
  63. package/lib/{Indent-B00o0P0M.js → Indent-C_O5WdyR.js} +4 -4
  64. package/lib/{Indent-CaGP0qTp.cjs → Indent-CkEC7x36.cjs} +1 -1
  65. package/lib/Indent.cjs +1 -1
  66. package/lib/Indent.js +2 -2
  67. package/lib/Italic.cjs +1 -1
  68. package/lib/Italic.js +4 -4
  69. package/lib/{Katex-x370CSXZ.js → Katex-D3PEWimM.js} +24 -24
  70. package/lib/{Katex-XsfpKgJU.cjs → Katex-DW_HjgNM.cjs} +2 -2
  71. package/lib/Katex.cjs +1 -1
  72. package/lib/Katex.js +2 -2
  73. package/lib/LineHeight.cjs +1 -1
  74. package/lib/LineHeight.js +14 -14
  75. package/lib/Link.cjs +1 -1
  76. package/lib/Link.js +2 -2
  77. package/lib/{LinkEditBlock-xt88G5fb.cjs → LinkEditBlock-DL1e2ILk.cjs} +2 -2
  78. package/lib/{LinkEditBlock-C_ipl3EA.js → LinkEditBlock-h5054QDo.js} +31 -31
  79. package/lib/Mention.js +3 -3
  80. package/lib/Mermaid.cjs +2 -2
  81. package/lib/Mermaid.js +28 -29
  82. package/lib/MoreMark.cjs +1 -1
  83. package/lib/MoreMark.js +14 -14
  84. package/lib/OrderedList.cjs +1 -1
  85. package/lib/OrderedList.js +4 -4
  86. package/lib/SearchAndReplace.cjs +1 -1
  87. package/lib/SearchAndReplace.js +17 -17
  88. package/lib/SlashCommand.cjs +1 -1
  89. package/lib/SlashCommand.js +6 -6
  90. package/lib/{SlashCommandNodeView-BT5ystah.cjs → SlashCommandNodeView-BqrmHCpu.cjs} +1 -1
  91. package/lib/{SlashCommandNodeView-DX6axvLs.js → SlashCommandNodeView-DXUqkx82.js} +12 -12
  92. package/lib/Strike.cjs +1 -1
  93. package/lib/Strike.js +4 -4
  94. package/lib/{Table-DidusYID.js → Table-DdrY4jcM.js} +7 -7
  95. package/lib/{Table-DSRSwtXx.cjs → Table-kY0nbqJo.cjs} +1 -1
  96. package/lib/Table.cjs +1 -1
  97. package/lib/Table.js +1 -1
  98. package/lib/TaskList.cjs +1 -1
  99. package/lib/TaskList.js +4 -4
  100. package/lib/TextAlign.cjs +1 -1
  101. package/lib/TextAlign.js +16 -16
  102. package/lib/TextDirection.cjs +1 -1
  103. package/lib/TextDirection.js +16 -16
  104. package/lib/TextUnderline.cjs +1 -1
  105. package/lib/TextUnderline.js +4 -4
  106. package/lib/{Twitter-D58T0Zt3.js → Twitter-B-JQ3ZJ1.js} +18 -18
  107. package/lib/{Twitter-CBuVBQM1.cjs → Twitter-DjZcVa3l.cjs} +1 -1
  108. package/lib/Twitter.cjs +1 -1
  109. package/lib/Twitter.js +2 -2
  110. package/lib/Video.cjs +1 -1
  111. package/lib/Video.js +24 -24
  112. package/lib/bubble.cjs +4 -4
  113. package/lib/bubble.js +2083 -1950
  114. package/lib/button-BS3n6_Aq.cjs +1 -0
  115. package/lib/{button-9_8t7ca7.js → button-Uv01FNnd.js} +7 -7
  116. package/lib/{checkbox-BQRKTXXr.cjs → checkbox-C8ByRi7-.cjs} +1 -1
  117. package/lib/{checkbox-DnkkV6qo.js → checkbox-DEFNwGwb.js} +1 -1
  118. package/lib/{clsx-DmuN0U_8.js → clsx-BWSGDJNJ.js} +13 -13
  119. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
  120. package/lib/components/Bubble/index.d.ts +1 -0
  121. package/lib/components/ui/index.d.ts +1 -0
  122. package/lib/{dialog-BS3zm-T9.cjs → dialog-Bt5zwGYB.cjs} +1 -1
  123. package/lib/{dialog-DhayAPvV.js → dialog-DwTMZSt6.js} +1 -1
  124. package/lib/{dropdown-menu-DQqKeZcx.js → dropdown-menu-BetI14G6.js} +1 -1
  125. package/lib/{dropdown-menu-CxwWX0yj.cjs → dropdown-menu-Bo68IEOT.cjs} +1 -1
  126. package/lib/extensions/Callout/Callout.d.ts +18 -0
  127. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
  128. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
  129. package/lib/extensions/Callout/index.d.ts +1 -0
  130. package/lib/{index-D1jd7elj.js → index-BDKHXe7R.js} +1 -1
  131. package/lib/{index-CKmT9KAQ.js → index-CHKWG6E8.js} +1 -1
  132. package/lib/{index-EAK64CCA.js → index-CcoWj0mF.js} +131 -130
  133. package/lib/index-D3RLYf-J.cjs +1 -0
  134. package/lib/{index-D9JOHlso.js → index-DF5ZPtWM.js} +369 -482
  135. package/lib/{index-DdEmgiAA.js → index-DJbmnBzK.js} +1 -1
  136. package/lib/index-Doks9cbR.cjs +1 -0
  137. package/lib/{index-BDX1uE62.js → index-Dujzr6bY.js} +135 -39
  138. package/lib/{index-CBFmXCcU.cjs → index-VhKd73hZ.cjs} +1 -1
  139. package/lib/{index-DvvwJvau.js → index-mR8PNv5P.js} +23 -23
  140. package/lib/index.cjs +1 -1
  141. package/lib/index.js +3 -3
  142. package/lib/{input-YoheBL2D.js → input-DUBdJD3L.js} +5 -5
  143. package/lib/{input-BJ7ihMq-.cjs → input-Dt_BA_9B.cjs} +1 -1
  144. package/lib/{isNumber-DmQXlKp3.js → isNumber-CIgubz2e.js} +1 -1
  145. package/lib/{label-Y7_hvqf2.cjs → label-JNOksCA-.cjs} +1 -1
  146. package/lib/{label-C8PLcjFI.js → label-topD46-u.js} +2 -2
  147. package/lib/locale-bundle.cjs +1 -1
  148. package/lib/locale-bundle.js +1 -1
  149. package/lib/locales/en.d.ts +16 -0
  150. package/lib/locales/fi.d.ts +16 -0
  151. package/lib/locales/hu.d.ts +16 -0
  152. package/lib/locales/index.d.ts +96 -0
  153. package/lib/locales/pt-br.d.ts +16 -0
  154. package/lib/locales/vi.d.ts +16 -0
  155. package/lib/locales/zh-cn.d.ts +16 -0
  156. package/lib/{popover-CWmTzHSy.js → popover-LfNBhRyz.js} +1 -1
  157. package/lib/{popover-BiSrlM4j.cjs → popover-mL-2sX5r.cjs} +1 -1
  158. package/lib/select-CwGYPsPq.cjs +1 -0
  159. package/lib/select-DctYuHLH.js +117 -0
  160. package/lib/{separator-C-DKMYmg.js → separator-Ddfrhn4D.js} +18 -18
  161. package/lib/{separator-CJ_adziN.cjs → separator-NoH_SLRW.cjs} +1 -1
  162. package/lib/{store-BKMaw1AW.cjs → store-CkjKIgjQ.cjs} +1 -1
  163. package/lib/{store-DG7cMfET.js → store-DNpS8vXA.js} +1 -1
  164. package/lib/style.css +1 -1
  165. package/lib/{tabs-DxlKKM-N.js → tabs-BT3AeqQQ.js} +1 -1
  166. package/lib/{tabs-DpHSMyF_.cjs → tabs-DRSwUeKP.cjs} +1 -1
  167. package/lib/{textarea-DU9RMi6u.cjs → textarea-BDO6XQoF.cjs} +1 -1
  168. package/lib/{textarea-D7m-apUh.js → textarea-DZzMEDfZ.js} +1 -1
  169. package/lib/{throttle-BRtichEP.js → throttle-IERhwcLa.js} +1 -1
  170. package/lib/{toggle-BYvLnjCL.cjs → toggle-BQHMh_Q-.cjs} +1 -1
  171. package/lib/{toggle-Bxwwb_Kp.js → toggle-DKHg5sLm.js} +10 -10
  172. package/lib/{tooltip-COvf4_R-.cjs → tooltip-BYtGp6FM.cjs} +1 -1
  173. package/lib/{tooltip-BTy5CRrN.js → tooltip-DNKq7zgN.js} +1 -1
  174. package/lib/{updatePosition-CUukgu-Q.js → updatePosition-Bie75EFq.js} +2 -2
  175. package/lib/{useButtonProps-CydzndG1.cjs → useButtonProps-DBJkNDS2.cjs} +1 -1
  176. package/lib/{useButtonProps-CfYtuEnd.js → useButtonProps-DVP4s_ER.js} +3 -3
  177. package/package.json +14 -1
  178. package/lib/button-Cs9TroWr.cjs +0 -1
  179. package/lib/index-CVFzP1Dc.cjs +0 -1
  180. package/lib/index-CX4pNJlH.cjs +0 -1
package/lib/Image.js CHANGED
@@ -1,25 +1,25 @@
1
- import { o as he, m as fe, s as ge } from "./clsx-DmuN0U_8.js";
2
- import { a as q, c as pe } from "./throttle-BRtichEP.js";
1
+ import { h as he, m as fe, k as ge } from "./clsx-BWSGDJNJ.js";
2
+ import { a as q, c as pe } from "./throttle-IERhwcLa.js";
3
3
  import { jsx as o, jsxs as b, Fragment as H } from "react/jsx-runtime";
4
4
  import j, { useState as L, useMemo as P, useCallback as F, useEffect as W, useRef as ae } from "react";
5
- import { I as Z, i as J, j as be, u as ne } from "./index-BDX1uE62.js";
6
- import { i as K, c as xe } from "./isNumber-DmQXlKp3.js";
7
- import { A as ye } from "./toggle-Bxwwb_Kp.js";
8
- import "./index-D9JOHlso.js";
5
+ import { I as Z, i as J, j as be, u as ne } from "./index-Dujzr6bY.js";
6
+ import { i as K, c as xe } from "./isNumber-CIgubz2e.js";
7
+ import { A as ye } from "./toggle-DKHg5sLm.js";
8
+ import "./index-DF5ZPtWM.js";
9
9
  import "./theme.js";
10
- import { B } from "./button-9_8t7ca7.js";
11
- import { I as Q } from "./input-YoheBL2D.js";
12
- import { L as ee } from "./label-C8PLcjFI.js";
13
- import { T as we, a as Ie, b as te, c as ie } from "./tabs-DxlKKM-N.js";
14
- import { u as re } from "./use-toast-Crf7-q5H.js";
15
- import { C as ve } from "./checkbox-DnkkV6qo.js";
16
- import { D as le, a as oe, b as se, c as ce, d as Te } from "./dialog-DhayAPvV.js";
17
- import Ae from "react-image-crop";
18
- import { d as de, c as Ce, u as Ee, a as Me } from "./useButtonProps-CfYtuEnd.js";
19
- import { d as Le, r as Ne } from "./file-BLas99n7.js";
20
- import { I as $ } from "./Icon-ONE1AwKo.js";
21
- import { a as Se } from "./store-DG7cMfET.js";
22
- import { l as _e, E as ze } from "./events.constant-do95b767.js";
10
+ import { D as re, a as le, b as oe, c as se, d as we } from "./dialog-DwTMZSt6.js";
11
+ import Ie from "react-image-crop";
12
+ import { B } from "./button-Uv01FNnd.js";
13
+ import { d as ce, c as ve, u as Te, a as Ae } from "./useButtonProps-DVP4s_ER.js";
14
+ import { d as Ce, r as Ee } from "./file-BLas99n7.js";
15
+ import { u as de } from "./use-toast-Crf7-q5H.js";
16
+ import { I as $ } from "./Icon-Ctva8VeB.js";
17
+ import { a as Me } from "./store-DNpS8vXA.js";
18
+ import { l as Le, E as Ne } from "./events.constant-do95b767.js";
19
+ import { T as Se, a as _e, b as Q, c as ee } from "./tabs-BT3AeqQQ.js";
20
+ import { C as ze } from "./checkbox-DEFNwGwb.js";
21
+ import { L as te } from "./label-topD46-u.js";
22
+ import { I as ie } from "./input-DUBdJD3L.js";
23
23
  const X = {
24
24
  TOP_LEFT: "tl",
25
25
  TOP_RIGHT: "tr",
@@ -233,10 +233,10 @@ function ue(e, t) {
233
233
  }
234
234
  function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
235
235
  var n, y;
236
- const { t: u } = ne(), { toast: g } = re(), [v, m] = L(!1), [x, C] = L(!1), T = j.useRef(null), [_, S] = j.useState(), [k, R] = j.useState(""), M = ae(null), [E, z] = L({
236
+ const { t: u } = ne(), { toast: g } = de(), [v, m] = L(!1), [x, C] = L(!1), T = j.useRef(null), [_, S] = j.useState(), [k, R] = j.useState(""), M = ae(null), [E, z] = L({
237
237
  src: "",
238
238
  file: null
239
- }), A = de(G.name), p = P(() => (A == null ? void 0 : A.options) ?? {}, [A]);
239
+ }), A = ce(G.name), p = P(() => (A == null ? void 0 : A.options) ?? {}, [A]);
240
240
  function c(i) {
241
241
  if (T.current && i.width && i.height) {
242
242
  const r = U(T.current, i);
@@ -264,7 +264,7 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
264
264
  if (!x) {
265
265
  C(!0);
266
266
  try {
267
- const r = Le(k, ((i = E == null ? void 0 : E.file) == null ? void 0 : i.name) || "image.png");
267
+ const r = Ce(k, ((i = E == null ? void 0 : E.file) == null ? void 0 : i.name) || "image.png");
268
268
  let h = "";
269
269
  p.upload ? h = await p.upload(r) : h = URL.createObjectURL(r), e.chain().focus().setImageInline({ src: h, inline: t, alt: f }).run(), m(!1), z({
270
270
  src: "",
@@ -299,7 +299,7 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
299
299
  i.target.value = "";
300
300
  return;
301
301
  }
302
- const l = h[0], w = await Ne(l);
302
+ const l = h[0], w = await Ee(l);
303
303
  m(!0), z({
304
304
  src: w.src,
305
305
  file: l
@@ -319,18 +319,18 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
319
319
  }
320
320
  ),
321
321
  /* @__PURE__ */ b(
322
- le,
322
+ re,
323
323
  {
324
324
  open: v,
325
325
  onOpenChange: (i) => {
326
326
  m(i), i || (z({ src: "", file: null }), N());
327
327
  },
328
328
  children: [
329
- /* @__PURE__ */ o(oe, {}),
330
- /* @__PURE__ */ b(se, { children: [
331
- /* @__PURE__ */ o(ce, { children: u("editor.image.dialog.tab.uploadCrop") }),
329
+ /* @__PURE__ */ o(le, {}),
330
+ /* @__PURE__ */ b(oe, { children: [
331
+ /* @__PURE__ */ o(se, { children: u("editor.image.dialog.tab.uploadCrop") }),
332
332
  /* @__PURE__ */ o("div", { children: E.src && /* @__PURE__ */ o(
333
- Ae,
333
+ Ie,
334
334
  {
335
335
  className: "richtext-w-full",
336
336
  crop: _,
@@ -346,7 +346,7 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
346
346
  )
347
347
  }
348
348
  ) }),
349
- /* @__PURE__ */ b(Te, { children: [
349
+ /* @__PURE__ */ b(we, { children: [
350
350
  /* @__PURE__ */ b(
351
351
  B,
352
352
  {
@@ -415,14 +415,14 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
415
415
  ] });
416
416
  }
417
417
  function lt() {
418
- const { t: e } = ne(), { toast: t } = re(), a = Ce(), s = Ee(G.name), {
418
+ const { t: e } = ne(), { toast: t } = de(), a = ve(), s = Te(G.name), {
419
419
  icon: f,
420
420
  tooltip: u
421
- } = (s == null ? void 0 : s.componentProps) ?? {}, { editorDisabled: g } = Me(), [v, m] = L(!1), [x, C] = L(!1), T = de(G.name), _ = (d) => {
421
+ } = (s == null ? void 0 : s.componentProps) ?? {}, { editorDisabled: g } = Ae(), [v, m] = L(!1), [x, C] = L(!1), T = ce(G.name), _ = (d) => {
422
422
  m(d.detail);
423
423
  }, [S, k] = L(""), [R, M] = L(""), E = ae(null), z = (T == null ? void 0 : T.options.defaultInline) || !1, [A, p] = L(z), c = P(() => T == null ? void 0 : T.options, [T]);
424
424
  W(() => {
425
- const d = _e(ze.UPLOAD_IMAGE(a.id), _);
425
+ const d = Le(Ne.UPLOAD_IMAGE(a.id), _);
426
426
  return () => {
427
427
  d();
428
428
  };
@@ -481,13 +481,13 @@ function lt() {
481
481
  d.preventDefault(), (N = E.current) == null || N.click();
482
482
  }
483
483
  return s ? /* @__PURE__ */ b(
484
- le,
484
+ re,
485
485
  {
486
486
  onOpenChange: m,
487
487
  open: v,
488
488
  children: [
489
489
  /* @__PURE__ */ o(
490
- oe,
490
+ le,
491
491
  {
492
492
  asChild: !0,
493
493
  children: /* @__PURE__ */ o(
@@ -503,21 +503,21 @@ function lt() {
503
503
  )
504
504
  }
505
505
  ),
506
- /* @__PURE__ */ b(se, { children: [
507
- /* @__PURE__ */ o(ce, { children: e("editor.image.dialog.title") }),
506
+ /* @__PURE__ */ b(oe, { children: [
507
+ /* @__PURE__ */ o(se, { children: e("editor.image.dialog.title") }),
508
508
  /* @__PURE__ */ b(
509
- we,
509
+ Se,
510
510
  {
511
511
  activationMode: "manual",
512
512
  defaultValue: c.resourceImage === "both" || c.resourceImage === "upload" ? "upload" : "link",
513
513
  children: [
514
- c.resourceImage === "both" && /* @__PURE__ */ b(Ie, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
515
- /* @__PURE__ */ o(te, { value: "upload", children: e("editor.image.dialog.tab.upload") }),
516
- /* @__PURE__ */ o(te, { value: "link", children: e("editor.image.dialog.tab.url") })
514
+ c.resourceImage === "both" && /* @__PURE__ */ b(_e, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
515
+ /* @__PURE__ */ o(Q, { value: "upload", children: e("editor.image.dialog.tab.upload") }),
516
+ /* @__PURE__ */ o(Q, { value: "link", children: e("editor.image.dialog.tab.url") })
517
517
  ] }),
518
518
  /* @__PURE__ */ b("div", { className: "richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]", children: [
519
519
  /* @__PURE__ */ o(
520
- ve,
520
+ ze,
521
521
  {
522
522
  checked: A,
523
523
  onCheckedChange: (d) => {
@@ -525,12 +525,12 @@ function lt() {
525
525
  }
526
526
  }
527
527
  ),
528
- /* @__PURE__ */ o(ee, { children: e("editor.link.dialog.inline") })
528
+ /* @__PURE__ */ o(te, { children: e("editor.link.dialog.inline") })
529
529
  ] }),
530
530
  c.enableAlt && /* @__PURE__ */ b("div", { className: "richtext-my-[10px] ", children: [
531
- /* @__PURE__ */ o(ee, { className: "mb-[6px]", children: e("editor.imageUpload.alt") }),
531
+ /* @__PURE__ */ o(te, { className: "mb-[6px]", children: e("editor.imageUpload.alt") }),
532
532
  /* @__PURE__ */ o(
533
- Q,
533
+ ie,
534
534
  {
535
535
  onChange: (d) => M(d.target.value),
536
536
  required: !0,
@@ -539,7 +539,7 @@ function lt() {
539
539
  }
540
540
  )
541
541
  ] }),
542
- /* @__PURE__ */ b(ie, { value: "upload", children: [
542
+ /* @__PURE__ */ b(ee, { value: "upload", children: [
543
543
  /* @__PURE__ */ b("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
544
544
  /* @__PURE__ */ o(
545
545
  B,
@@ -568,7 +568,7 @@ function lt() {
568
568
  editor: a,
569
569
  imageInline: A,
570
570
  onClose: () => {
571
- Se.setOpen(a.id, !1), M("");
571
+ Me.setOpen(a.id, !1), M("");
572
572
  }
573
573
  }
574
574
  )
@@ -585,9 +585,9 @@ function lt() {
585
585
  }
586
586
  )
587
587
  ] }),
588
- /* @__PURE__ */ o(ie, { value: "link", children: /* @__PURE__ */ o("form", { onSubmit: D, children: /* @__PURE__ */ b("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
588
+ /* @__PURE__ */ o(ee, { value: "link", children: /* @__PURE__ */ o("form", { onSubmit: D, children: /* @__PURE__ */ b("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
589
589
  /* @__PURE__ */ o(
590
- Q,
590
+ ie,
591
591
  {
592
592
  autoFocus: !0,
593
593
  onChange: (d) => k(d.target.value),
package/lib/ImageGif.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./clsx-CXbNJWDD.cjs"),N=require("./throttle-gTTvqDTW.cjs"),l=require("react/jsx-runtime"),d=require("react"),G=require("./index-CVFzP1Dc.cjs"),L=require("./isNumber-BTYSVlKo.cjs"),W=require("./toggle-BYvLnjCL.cjs");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const D=require("./input-BJ7ihMq-.cjs"),P=require("./popover-BiSrlM4j.cjs"),k=require("./useButtonProps-CydzndG1.cjs"),S={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function B(e){var C,$;const[t,n]=d.useState({width:G.IMAGE_MAX_SIZE,height:G.IMAGE_MAX_SIZE}),[c,i]=d.useState({width:0,height:0}),[r]=d.useState([S.TOP_LEFT,S.TOP_RIGHT,S.BOTTOM_LEFT,S.BOTTOM_RIGHT]),[s,a]=d.useState(!1),[h,b]=d.useState({x:0,y:0,w:0,h:0,dir:""}),{align:x}=(C=e==null?void 0:e.node)==null?void 0:C.attrs,m=d.useMemo(()=>{var v;const{src:o,alt:f,width:w,height:M}=(v=e==null?void 0:e.node)==null?void 0:v.attrs,A=L.isNumber(w)?`${w}px`:w,u=L.isNumber(M)?`${M}px`:M;return{src:o||void 0,alt:f||void 0,style:{width:A||void 0,height:u||void 0}}},[($=e==null?void 0:e.node)==null?void 0:$.attrs]),T=d.useMemo(()=>{const{style:{width:o}}=m;return{width:o==="100%"?o:void 0}},[m]);function g(o){i({width:o.target.width,height:o.target.height})}function _(){const{editor:o,getPos:f}=e;o.commands.setNodeSelection(f())}const y=d.useCallback(N.throttle(()=>{const{editor:o}=e,{width:f}=getComputedStyle(o.view.dom);n(w=>({...w,width:Number.parseInt(f,10)}))},G.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function p(o,f){o.preventDefault(),o.stopPropagation();const w=c.width,M=c.height,A=w/M;let u=Number(e.node.attrs.width),v=Number(e.node.attrs.height);const I=t.width;u&&!v?(u=u>I?I:u,v=Math.round(u/A)):v&&!u?(u=Math.round(v*A),u=u>I?I:u):!u&&!v?(u=w>I?I:w,v=Math.round(u/A)):u=u>I?I:u,a(!0),b({x:o.clientX,y:o.clientY,w:u,h:v,dir:f})}const j=d.useCallback(N.throttle(o=>{if(o.preventDefault(),o.stopPropagation(),!s)return;const{x:f,w,dir:M}=h,A=(o.clientX-f)*(/l/.test(M)?-1:1),u=L.clamp(w+A,G.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:u,height:null})},G.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),E=d.useCallback(o=>{o.preventDefault(),o.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),_())},[s,_]),z=d.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",E,!0)},[j,E]),O=d.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",E,!0)},[j,E]);d.useEffect(()=>(s?z():O(),()=>{O()}),[s,z,O]);const R=d.useMemo(()=>new ResizeObserver(()=>y()),[y]);return d.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(q.NodeViewWrapper,{className:"image-view",style:{...T,width:"100%",textAlign:x},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:T,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:_,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:r==null?void 0:r.map(o=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${o}`,onMouseDown:f=>p(f,o)},`image-dir-${o}`))})]})})}async function F(e){var c;const n=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(c=n==null?void 0:n.data)==null?void 0:c.map(i=>{var r,s,a;return{id:i==null?void 0:i.id,src:(r=i==null?void 0:i.images.original)==null?void 0:r.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function V(e,t){var i;const c=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=c==null?void 0:c.data)==null?void 0:i.map(r=>{var s,a,h;return{id:r==null?void 0:r.id,src:(s=r==null?void 0:r.images.original)==null?void 0:s.url,width:+((a=r==null?void 0:r.images.original)==null?void 0:a.width),height:+((h=r==null?void 0:r.images.original)==null?void 0:h.width)}})}async function X(e){var r,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),n=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(r=n==null?void 0:n.results)==null?void 0:r[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,x,m,T,g,_,y;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(T=(m=(x=a==null?void 0:a.media_formats)==null?void 0:x.gif)==null?void 0:m.dims)==null?void 0:T[0],height:(y=(_=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:_.dims)==null?void 0:y[1]}})}async function Y(e,t){var i;const c=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=c==null?void 0:c.results)==null?void 0:i.map(r=>{var s,a,h,b,x,m,T,g;return{id:r==null?void 0:r.id,src:(a=(s=r==null?void 0:r.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(x=(b=(h=r==null?void 0:r.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:x[0],height:(g=(T=(m=r==null?void 0:r.media_formats)==null?void 0:m.gif)==null?void 0:T.dims)==null?void 0:g[1]}})}function Z(e,t){return{searchTrending:async()=>t?e==="giphy"?F(t):e==="tenor"?X(t):[]:[],searchWord:async i=>t?e==="giphy"?V(i,t):e==="tenor"?Y(i,t):[]:[]}}function U({selectImage:e,apiKey:t,provider:n,children:c}){const[i,r]=d.useState(!1),[s,a]=d.useState([]),{editorDisabled:h}=k.useToggleActive(),b=d.useRef(null),{searchTrending:x,searchWord:m}=Z(n,t);d.useEffect(()=>{(async()=>{const g=await x();a(g)})()},[]);const T=d.useCallback(N.debounce(async g=>{if(!g.target.value){const y=await x();a(y);return}const _=await m(g.target.value);a(_)},350),[]);return l.jsxs(P.Popover,{modal:!0,onOpenChange:r,open:i,children:[l.jsx(P.PopoverTrigger,{asChild:!0,disabled:h,children:c}),l.jsx(P.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(D.Input,{onChange:T,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),r(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function J(){const e=k.useButtonProps(H.name),{action:t,icon:n,tooltip:c,apiKey:i,provider:r}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=k.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(U,{apiKey:i,provider:r,selectImage:a,children:l.jsx(W.ActionButton,{disabled:s,icon:n,tooltip:c})})}const H=N.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:n,t:c})=>{var s,a;const i=((s=n==null?void 0:n.options)==null?void 0:s.provider)||"",r=((a=n==null?void 0:n.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:c("editor.imageGif.tooltip"),apiKey:r,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const n=t.style.width||t.getAttribute("width")||"10";return n===void 0?null:Number.parseInt(`${n}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return q.ReactNodeViewRenderer(B)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:n})=>n.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:n})=>n.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:n})=>n.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",q.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),n=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:n?Number.parseInt(n,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=H;exports.RichTextImageGif=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./clsx-CXbNJWDD.cjs"),N=require("./throttle-gTTvqDTW.cjs"),l=require("react/jsx-runtime"),d=require("react"),G=require("./index-Doks9cbR.cjs"),L=require("./isNumber-BTYSVlKo.cjs"),W=require("./toggle-BQHMh_Q-.cjs");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const k=require("./useButtonProps-DBJkNDS2.cjs"),P=require("./popover-mL-2sX5r.cjs"),D=require("./input-Dt_BA_9B.cjs"),S={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function B(e){var C,$;const[t,n]=d.useState({width:G.IMAGE_MAX_SIZE,height:G.IMAGE_MAX_SIZE}),[c,i]=d.useState({width:0,height:0}),[r]=d.useState([S.TOP_LEFT,S.TOP_RIGHT,S.BOTTOM_LEFT,S.BOTTOM_RIGHT]),[s,a]=d.useState(!1),[h,b]=d.useState({x:0,y:0,w:0,h:0,dir:""}),{align:x}=(C=e==null?void 0:e.node)==null?void 0:C.attrs,m=d.useMemo(()=>{var v;const{src:o,alt:f,width:w,height:M}=(v=e==null?void 0:e.node)==null?void 0:v.attrs,A=L.isNumber(w)?`${w}px`:w,u=L.isNumber(M)?`${M}px`:M;return{src:o||void 0,alt:f||void 0,style:{width:A||void 0,height:u||void 0}}},[($=e==null?void 0:e.node)==null?void 0:$.attrs]),T=d.useMemo(()=>{const{style:{width:o}}=m;return{width:o==="100%"?o:void 0}},[m]);function g(o){i({width:o.target.width,height:o.target.height})}function _(){const{editor:o,getPos:f}=e;o.commands.setNodeSelection(f())}const y=d.useCallback(N.throttle(()=>{const{editor:o}=e,{width:f}=getComputedStyle(o.view.dom);n(w=>({...w,width:Number.parseInt(f,10)}))},G.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function p(o,f){o.preventDefault(),o.stopPropagation();const w=c.width,M=c.height,A=w/M;let u=Number(e.node.attrs.width),v=Number(e.node.attrs.height);const I=t.width;u&&!v?(u=u>I?I:u,v=Math.round(u/A)):v&&!u?(u=Math.round(v*A),u=u>I?I:u):!u&&!v?(u=w>I?I:w,v=Math.round(u/A)):u=u>I?I:u,a(!0),b({x:o.clientX,y:o.clientY,w:u,h:v,dir:f})}const j=d.useCallback(N.throttle(o=>{if(o.preventDefault(),o.stopPropagation(),!s)return;const{x:f,w,dir:M}=h,A=(o.clientX-f)*(/l/.test(M)?-1:1),u=L.clamp(w+A,G.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:u,height:null})},G.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),E=d.useCallback(o=>{o.preventDefault(),o.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),_())},[s,_]),z=d.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",E,!0)},[j,E]),O=d.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",E,!0)},[j,E]);d.useEffect(()=>(s?z():O(),()=>{O()}),[s,z,O]);const R=d.useMemo(()=>new ResizeObserver(()=>y()),[y]);return d.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(q.NodeViewWrapper,{className:"image-view",style:{...T,width:"100%",textAlign:x},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:T,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:_,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:r==null?void 0:r.map(o=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${o}`,onMouseDown:f=>p(f,o)},`image-dir-${o}`))})]})})}async function F(e){var c;const n=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(c=n==null?void 0:n.data)==null?void 0:c.map(i=>{var r,s,a;return{id:i==null?void 0:i.id,src:(r=i==null?void 0:i.images.original)==null?void 0:r.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function V(e,t){var i;const c=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=c==null?void 0:c.data)==null?void 0:i.map(r=>{var s,a,h;return{id:r==null?void 0:r.id,src:(s=r==null?void 0:r.images.original)==null?void 0:s.url,width:+((a=r==null?void 0:r.images.original)==null?void 0:a.width),height:+((h=r==null?void 0:r.images.original)==null?void 0:h.width)}})}async function X(e){var r,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),n=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(r=n==null?void 0:n.results)==null?void 0:r[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,x,m,T,g,_,y;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(T=(m=(x=a==null?void 0:a.media_formats)==null?void 0:x.gif)==null?void 0:m.dims)==null?void 0:T[0],height:(y=(_=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:_.dims)==null?void 0:y[1]}})}async function Y(e,t){var i;const c=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=c==null?void 0:c.results)==null?void 0:i.map(r=>{var s,a,h,b,x,m,T,g;return{id:r==null?void 0:r.id,src:(a=(s=r==null?void 0:r.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(x=(b=(h=r==null?void 0:r.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:x[0],height:(g=(T=(m=r==null?void 0:r.media_formats)==null?void 0:m.gif)==null?void 0:T.dims)==null?void 0:g[1]}})}function Z(e,t){return{searchTrending:async()=>t?e==="giphy"?F(t):e==="tenor"?X(t):[]:[],searchWord:async i=>t?e==="giphy"?V(i,t):e==="tenor"?Y(i,t):[]:[]}}function U({selectImage:e,apiKey:t,provider:n,children:c}){const[i,r]=d.useState(!1),[s,a]=d.useState([]),{editorDisabled:h}=k.useToggleActive(),b=d.useRef(null),{searchTrending:x,searchWord:m}=Z(n,t);d.useEffect(()=>{(async()=>{const g=await x();a(g)})()},[]);const T=d.useCallback(N.debounce(async g=>{if(!g.target.value){const y=await x();a(y);return}const _=await m(g.target.value);a(_)},350),[]);return l.jsxs(P.Popover,{modal:!0,onOpenChange:r,open:i,children:[l.jsx(P.PopoverTrigger,{asChild:!0,disabled:h,children:c}),l.jsx(P.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(D.Input,{onChange:T,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),r(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function J(){const e=k.useButtonProps(H.name),{action:t,icon:n,tooltip:c,apiKey:i,provider:r}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=k.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(U,{apiKey:i,provider:r,selectImage:a,children:l.jsx(W.ActionButton,{disabled:s,icon:n,tooltip:c})})}const H=N.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:n,t:c})=>{var s,a;const i=((s=n==null?void 0:n.options)==null?void 0:s.provider)||"",r=((a=n==null?void 0:n.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:c("editor.imageGif.tooltip"),apiKey:r,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const n=t.style.width||t.getAttribute("width")||"10";return n===void 0?null:Number.parseInt(`${n}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return q.ReactNodeViewRenderer(B)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:n})=>n.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:n})=>n.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:n})=>n.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",q.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),n=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:n?Number.parseInt(n,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=H;exports.RichTextImageGif=J;
package/lib/ImageGif.js CHANGED
@@ -1,15 +1,15 @@
1
- import { o as B, m as q, s as V } from "./clsx-DmuN0U_8.js";
2
- import { a as k, d as X, c as Y } from "./throttle-BRtichEP.js";
1
+ import { h as B, m as q, k as V } from "./clsx-BWSGDJNJ.js";
2
+ import { a as H, d as X, c as Y } from "./throttle-IERhwcLa.js";
3
3
  import { jsx as u, jsxs as P, Fragment as Z } from "react/jsx-runtime";
4
4
  import { useState as G, useMemo as L, useCallback as M, useEffect as z, useRef as U } from "react";
5
- import { I as C, i as j, j as J } from "./index-BDX1uE62.js";
6
- import { i as W, c as Q } from "./isNumber-DmQXlKp3.js";
7
- import { A as K } from "./toggle-Bxwwb_Kp.js";
8
- import "./index-D9JOHlso.js";
5
+ import { I as C, i as j, j as J } from "./index-Dujzr6bY.js";
6
+ import { i as W, c as Q } from "./isNumber-CIgubz2e.js";
7
+ import { A as K } from "./toggle-DKHg5sLm.js";
8
+ import "./index-DF5ZPtWM.js";
9
9
  import "./theme.js";
10
- import { I as ee } from "./input-YoheBL2D.js";
11
- import { P as te, a as re, b as ne } from "./popover-CWmTzHSy.js";
12
- import { u as ie, a as D } from "./useButtonProps-CfYtuEnd.js";
10
+ import { u as ee, a as D } from "./useButtonProps-DVP4s_ER.js";
11
+ import { P as te, a as re, b as ne } from "./popover-LfNBhRyz.js";
12
+ import { I as ie } from "./input-DUBdJD3L.js";
13
13
  const O = {
14
14
  TOP_LEFT: "tl",
15
15
  TOP_RIGHT: "tr",
@@ -17,7 +17,7 @@ const O = {
17
17
  BOTTOM_RIGHT: "br"
18
18
  };
19
19
  function ae(e) {
20
- var R, H;
20
+ var R, k;
21
21
  const [t, n] = G({
22
22
  width: C,
23
23
  height: C
@@ -46,7 +46,7 @@ function ae(e) {
46
46
  height: d || void 0
47
47
  }
48
48
  };
49
- }, [(H = e == null ? void 0 : e.node) == null ? void 0 : H.attrs]), _ = L(() => {
49
+ }, [(k = e == null ? void 0 : e.node) == null ? void 0 : k.attrs]), _ = L(() => {
50
50
  const {
51
51
  style: { width: o }
52
52
  } = m;
@@ -63,7 +63,7 @@ function ae(e) {
63
63
  o.commands.setNodeSelection(g());
64
64
  }
65
65
  const T = M(
66
- k(() => {
66
+ H(() => {
67
67
  const { editor: o } = e, { width: g } = getComputedStyle(o.view.dom);
68
68
  n((f) => ({
69
69
  ...f,
@@ -86,7 +86,7 @@ function ae(e) {
86
86
  });
87
87
  }
88
88
  const N = M(
89
- k((o) => {
89
+ H((o) => {
90
90
  if (o.preventDefault(), o.stopPropagation(), !a)
91
91
  return;
92
92
  const { x: g, w: f, dir: x } = l, A = (o.clientX - g) * (/l/.test(x) ? -1 : 1), d = Q(f + A, J, t.width);
@@ -260,7 +260,7 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
260
260
  side: "bottom",
261
261
  children: t ? /* @__PURE__ */ P(Z, { children: [
262
262
  /* @__PURE__ */ u("div", { className: "richtext-mb-[10px] richtext-w-full", children: /* @__PURE__ */ u(
263
- ee,
263
+ ie,
264
264
  {
265
265
  onChange: _,
266
266
  placeholder: "Search GIF",
@@ -288,7 +288,7 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
288
288
  );
289
289
  }
290
290
  function Ge() {
291
- const e = ie(ue.name), {
291
+ const e = ee(ue.name), {
292
292
  action: t,
293
293
  icon: n,
294
294
  tooltip: c,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Cs=require("./clsx-CXbNJWDD.cjs"),Wn=require("react/jsx-runtime"),xa=require("react"),nn=require("./_commonjsHelpers-BTDuMlIz.cjs"),Ss=require("./toggle-BYvLnjCL.cjs");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const Bs=require("./use-toast-Bz3QCOtE.cjs"),Xn=require("./useButtonProps-CydzndG1.cjs"),ks=require("./index-CVFzP1Dc.cjs");var Ve={},Si="1.13.7",_a=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Yt=Array.prototype,Bi=Object.prototype,Ua=typeof Symbol<"u"?Symbol.prototype:null,Ws=Yt.push,ct=Yt.slice,nt=Bi.toString,Rs=Bi.hasOwnProperty,jc=typeof ArrayBuffer<"u",Os=typeof DataView<"u",Ns=Array.isArray,Ta=Object.keys,wa=Object.create,Ea=jc&&ArrayBuffer.isView,Is=isNaN,Ls=isFinite,Xc=!{toString:null}.propertyIsEnumerable("toString"),Aa=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Ms=Math.pow(2,53)-1;function Me(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),r=Array(t),c=0;c<t;c++)r[c]=arguments[c+n];switch(n){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var i=Array(n+1);for(c=0;c<n;c++)i[c]=arguments[c];return i[n]=r,e.apply(this,i)}}function pn(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function Vc(e){return e===null}function ki(e){return e===void 0}function Wi(e){return e===!0||e===!1||nt.call(e)==="[object Boolean]"}function Hc(e){return!!(e&&e.nodeType===1)}function Le(e){var n="[object "+e+"]";return function(t){return nt.call(t)===n}}const Kt=Le("String"),Ri=Le("Number"),Gc=Le("Date"),Zc=Le("RegExp"),Yc=Le("Error"),Oi=Le("Symbol"),Ni=Le("ArrayBuffer");var Kc=Le("Function"),qs=_a.document&&_a.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof qs!="function"&&(Kc=function(e){return typeof e=="function"||!1});const Ie=Kc,$c=Le("Object");var Qc=Os&&(!/\[native code\]/.test(String(DataView))||$c(new DataView(new ArrayBuffer(8)))),Ii=typeof Map<"u"&&$c(new Map),Ps=Le("DataView");function zs(e){return e!=null&&Ie(e.getInt8)&&Ni(e.buffer)}const tt=Qc?zs:Ps,gn=Ns||Le("Array");function mn(e,n){return e!=null&&Rs.call(e,n)}var Ei=Le("Arguments");(function(){Ei(arguments)||(Ei=function(e){return mn(e,"callee")})})();const $t=Ei;function Jc(e){return!Oi(e)&&Ls(e)&&!isNaN(parseFloat(e))}function Li(e){return Ri(e)&&Is(e)}function Mi(e){return function(){return e}}function eu(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Ms}}function nu(e){return function(n){return n==null?void 0:n[e]}}const Xt=nu("byteLength"),js=eu(Xt);var Xs=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Vs(e){return Ea?Ea(e)&&!tt(e):js(e)&&Xs.test(nt.call(e))}const qi=jc?Vs:Mi(!1),Pe=nu("length");function Hs(e){for(var n={},t=e.length,r=0;r<t;++r)n[e[r]]=!0;return{contains:function(c){return n[c]===!0},push:function(c){return n[c]=!0,e.push(c)}}}function tu(e,n){n=Hs(n);var t=Aa.length,r=e.constructor,c=Ie(r)&&r.prototype||Bi,i="constructor";for(mn(e,i)&&!n.contains(i)&&n.push(i);t--;)i=Aa[t],i in e&&e[i]!==c[i]&&!n.contains(i)&&n.push(i)}function We(e){if(!pn(e))return[];if(Ta)return Ta(e);var n=[];for(var t in e)mn(e,t)&&n.push(t);return Xc&&tu(e,n),n}function ru(e){if(e==null)return!0;var n=Pe(e);return typeof n=="number"&&(gn(e)||Kt(e)||$t(e))?n===0:Pe(We(e))===0}function Pi(e,n){var t=We(n),r=t.length;if(e==null)return!r;for(var c=Object(e),i=0;i<r;i++){var o=t[i];if(n[o]!==c[o]||!(o in c))return!1}return!0}function Ae(e){if(e instanceof Ae)return e;if(!(this instanceof Ae))return new Ae(e);this._wrapped=e}Ae.VERSION=Si;Ae.prototype.value=function(){return this._wrapped};Ae.prototype.valueOf=Ae.prototype.toJSON=Ae.prototype.value;Ae.prototype.toString=function(){return String(this._wrapped)};function Fa(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Xt(e))}var Ca="[object DataView]";function Ai(e,n,t,r){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var c=typeof e;return c!=="function"&&c!=="object"&&typeof n!="object"?!1:iu(e,n,t,r)}function iu(e,n,t,r){e instanceof Ae&&(e=e._wrapped),n instanceof Ae&&(n=n._wrapped);var c=nt.call(e);if(c!==nt.call(n))return!1;if(Qc&&c=="[object Object]"&&tt(e)){if(!tt(n))return!1;c=Ca}switch(c){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return Ua.valueOf.call(e)===Ua.valueOf.call(n);case"[object ArrayBuffer]":case Ca:return iu(Fa(e),Fa(n),t,r)}var i=c==="[object Array]";if(!i&&qi(e)){var o=Xt(e);if(o!==Xt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)return!0;i=!0}if(!i){if(typeof e!="object"||typeof n!="object")return!1;var a=e.constructor,u=n.constructor;if(a!==u&&!(Ie(a)&&a instanceof a&&Ie(u)&&u instanceof u)&&"constructor"in e&&"constructor"in n)return!1}t=t||[],r=r||[];for(var f=t.length;f--;)if(t[f]===e)return r[f]===n;if(t.push(e),r.push(n),i){if(f=e.length,f!==n.length)return!1;for(;f--;)if(!Ai(e[f],n[f],t,r))return!1}else{var b=We(e),g;if(f=b.length,We(n).length!==f)return!1;for(;f--;)if(g=b[f],!(mn(n,g)&&Ai(e[g],n[g],t,r)))return!1}return t.pop(),r.pop(),!0}function au(e,n){return Ai(e,n)}function Pn(e){if(!pn(e))return[];var n=[];for(var t in e)n.push(t);return Xc&&tu(e,n),n}function zi(e){var n=Pe(e);return function(t){if(t==null)return!1;var r=Pn(t);if(Pe(r))return!1;for(var c=0;c<n;c++)if(!Ie(t[e[c]]))return!1;return e!==uu||!Ie(t[ji])}}var ji="forEach",ou="has",Xi=["clear","delete"],cu=["get",ou,"set"],Gs=Xi.concat(ji,cu),uu=Xi.concat(cu),Zs=["add"].concat(Xi,ji,ou);const su=Ii?zi(Gs):Le("Map"),du=Ii?zi(uu):Le("WeakMap"),lu=Ii?zi(Zs):Le("Set"),fu=Le("WeakSet");function Fn(e){for(var n=We(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=e[n[c]];return r}function hu(e){for(var n=We(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=[n[c],e[n[c]]];return r}function Vi(e){for(var n={},t=We(e),r=0,c=t.length;r<c;r++)n[e[t[r]]]=t[r];return n}function rt(e){var n=[];for(var t in e)Ie(e[t])&&n.push(t);return n.sort()}function Hi(e,n){return function(t){var r=arguments.length;if(n&&(t=Object(t)),r<2||t==null)return t;for(var c=1;c<r;c++)for(var i=arguments[c],o=e(i),a=o.length,u=0;u<a;u++){var f=o[u];(!n||t[f]===void 0)&&(t[f]=i[f])}return t}}const Gi=Hi(Pn),Mn=Hi(We),Zi=Hi(Pn,!0);function Ys(){return function(){}}function pu(e){if(!pn(e))return{};if(wa)return wa(e);var n=Ys();n.prototype=e;var t=new n;return n.prototype=null,t}function gu(e,n){var t=pu(e);return n&&Mn(t,n),t}function mu(e){return pn(e)?gn(e)?e.slice():Gi({},e):e}function bu(e,n){return n(e),e}function Yi(e){return gn(e)?e:[e]}Ae.toPath=Yi;function ut(e){return Ae.toPath(e)}function Ki(e,n){for(var t=n.length,r=0;r<t;r++){if(e==null)return;e=e[n[r]]}return t?e:void 0}function $i(e,n,t){var r=Ki(e,ut(n));return ki(r)?t:r}function yu(e,n){n=ut(n);for(var t=n.length,r=0;r<t;r++){var c=n[r];if(!mn(e,c))return!1;e=e[c]}return!!t}function Qt(e){return e}function An(e){return e=Mn({},e),function(n){return Pi(n,e)}}function Jt(e){return e=ut(e),function(n){return Ki(n,e)}}function st(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(r){return e.call(n,r)};case 3:return function(r,c,i){return e.call(n,r,c,i)};case 4:return function(r,c,i,o){return e.call(n,r,c,i,o)}}return function(){return e.apply(n,arguments)}}function Du(e,n,t){return e==null?Qt:Ie(e)?st(e,n,t):pn(e)&&!gn(e)?An(e):Jt(e)}function er(e,n){return Du(e,n,1/0)}Ae.iteratee=er;function ze(e,n,t){return Ae.iteratee!==er?Ae.iteratee(e,n):Du(e,n,t)}function vu(e,n,t){n=ze(n,t);for(var r=We(e),c=r.length,i={},o=0;o<c;o++){var a=r[o];i[a]=n(e[a],a,e)}return i}function Qi(){}function xu(e){return e==null?Qi:function(n){return $i(e,n)}}function _u(e,n,t){var r=Array(Math.max(0,e));n=st(n,t,1);for(var c=0;c<e;c++)r[c]=n(c);return r}function Vt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const qn=Date.now||function(){return new Date().getTime()};function Uu(e){var n=function(i){return e[i]},t="(?:"+We(e).join("|")+")",r=RegExp(t),c=RegExp(t,"g");return function(i){return i=i==null?"":""+i,r.test(i)?i.replace(c,n):i}}const Tu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},wu=Uu(Tu),Ks=Vi(Tu),Eu=Uu(Ks),Au=Ae.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var vr=/(.)^/,$s={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qs=/\\|'|\r|\n|\u2028|\u2029/g;function Js(e){return"\\"+$s[e]}var ed=/^\s*(\w|\$)+\s*$/;function Fu(e,n,t){!n&&t&&(n=t),n=Zi({},n,Ae.templateSettings);var r=RegExp([(n.escape||vr).source,(n.interpolate||vr).source,(n.evaluate||vr).source].join("|")+"|$","g"),c=0,i="__p+='";e.replace(r,function(f,b,g,m,h){return i+=e.slice(c,h).replace(Qs,Js),c=h+f.length,b?i+=`'+
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Cs=require("./clsx-CXbNJWDD.cjs"),Wn=require("react/jsx-runtime"),xa=require("react"),nn=require("./_commonjsHelpers-BTDuMlIz.cjs"),Ss=require("./toggle-BQHMh_Q-.cjs");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const Xn=require("./useButtonProps-DBJkNDS2.cjs"),Bs=require("./index-Doks9cbR.cjs"),ks=require("./use-toast-Bz3QCOtE.cjs");var Ve={},Si="1.13.7",_a=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Yt=Array.prototype,Bi=Object.prototype,Ua=typeof Symbol<"u"?Symbol.prototype:null,Ws=Yt.push,ct=Yt.slice,nt=Bi.toString,Rs=Bi.hasOwnProperty,jc=typeof ArrayBuffer<"u",Os=typeof DataView<"u",Ns=Array.isArray,Ta=Object.keys,wa=Object.create,Ea=jc&&ArrayBuffer.isView,Is=isNaN,Ls=isFinite,Xc=!{toString:null}.propertyIsEnumerable("toString"),Aa=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Ms=Math.pow(2,53)-1;function Me(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),r=Array(t),c=0;c<t;c++)r[c]=arguments[c+n];switch(n){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var i=Array(n+1);for(c=0;c<n;c++)i[c]=arguments[c];return i[n]=r,e.apply(this,i)}}function pn(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function Vc(e){return e===null}function ki(e){return e===void 0}function Wi(e){return e===!0||e===!1||nt.call(e)==="[object Boolean]"}function Hc(e){return!!(e&&e.nodeType===1)}function Le(e){var n="[object "+e+"]";return function(t){return nt.call(t)===n}}const Kt=Le("String"),Ri=Le("Number"),Gc=Le("Date"),Zc=Le("RegExp"),Yc=Le("Error"),Oi=Le("Symbol"),Ni=Le("ArrayBuffer");var Kc=Le("Function"),qs=_a.document&&_a.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof qs!="function"&&(Kc=function(e){return typeof e=="function"||!1});const Ie=Kc,$c=Le("Object");var Qc=Os&&(!/\[native code\]/.test(String(DataView))||$c(new DataView(new ArrayBuffer(8)))),Ii=typeof Map<"u"&&$c(new Map),Ps=Le("DataView");function zs(e){return e!=null&&Ie(e.getInt8)&&Ni(e.buffer)}const tt=Qc?zs:Ps,gn=Ns||Le("Array");function mn(e,n){return e!=null&&Rs.call(e,n)}var Ei=Le("Arguments");(function(){Ei(arguments)||(Ei=function(e){return mn(e,"callee")})})();const $t=Ei;function Jc(e){return!Oi(e)&&Ls(e)&&!isNaN(parseFloat(e))}function Li(e){return Ri(e)&&Is(e)}function Mi(e){return function(){return e}}function eu(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Ms}}function nu(e){return function(n){return n==null?void 0:n[e]}}const Xt=nu("byteLength"),js=eu(Xt);var Xs=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Vs(e){return Ea?Ea(e)&&!tt(e):js(e)&&Xs.test(nt.call(e))}const qi=jc?Vs:Mi(!1),Pe=nu("length");function Hs(e){for(var n={},t=e.length,r=0;r<t;++r)n[e[r]]=!0;return{contains:function(c){return n[c]===!0},push:function(c){return n[c]=!0,e.push(c)}}}function tu(e,n){n=Hs(n);var t=Aa.length,r=e.constructor,c=Ie(r)&&r.prototype||Bi,i="constructor";for(mn(e,i)&&!n.contains(i)&&n.push(i);t--;)i=Aa[t],i in e&&e[i]!==c[i]&&!n.contains(i)&&n.push(i)}function We(e){if(!pn(e))return[];if(Ta)return Ta(e);var n=[];for(var t in e)mn(e,t)&&n.push(t);return Xc&&tu(e,n),n}function ru(e){if(e==null)return!0;var n=Pe(e);return typeof n=="number"&&(gn(e)||Kt(e)||$t(e))?n===0:Pe(We(e))===0}function Pi(e,n){var t=We(n),r=t.length;if(e==null)return!r;for(var c=Object(e),i=0;i<r;i++){var o=t[i];if(n[o]!==c[o]||!(o in c))return!1}return!0}function Ae(e){if(e instanceof Ae)return e;if(!(this instanceof Ae))return new Ae(e);this._wrapped=e}Ae.VERSION=Si;Ae.prototype.value=function(){return this._wrapped};Ae.prototype.valueOf=Ae.prototype.toJSON=Ae.prototype.value;Ae.prototype.toString=function(){return String(this._wrapped)};function Fa(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Xt(e))}var Ca="[object DataView]";function Ai(e,n,t,r){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var c=typeof e;return c!=="function"&&c!=="object"&&typeof n!="object"?!1:iu(e,n,t,r)}function iu(e,n,t,r){e instanceof Ae&&(e=e._wrapped),n instanceof Ae&&(n=n._wrapped);var c=nt.call(e);if(c!==nt.call(n))return!1;if(Qc&&c=="[object Object]"&&tt(e)){if(!tt(n))return!1;c=Ca}switch(c){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return Ua.valueOf.call(e)===Ua.valueOf.call(n);case"[object ArrayBuffer]":case Ca:return iu(Fa(e),Fa(n),t,r)}var i=c==="[object Array]";if(!i&&qi(e)){var o=Xt(e);if(o!==Xt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)return!0;i=!0}if(!i){if(typeof e!="object"||typeof n!="object")return!1;var a=e.constructor,u=n.constructor;if(a!==u&&!(Ie(a)&&a instanceof a&&Ie(u)&&u instanceof u)&&"constructor"in e&&"constructor"in n)return!1}t=t||[],r=r||[];for(var f=t.length;f--;)if(t[f]===e)return r[f]===n;if(t.push(e),r.push(n),i){if(f=e.length,f!==n.length)return!1;for(;f--;)if(!Ai(e[f],n[f],t,r))return!1}else{var b=We(e),g;if(f=b.length,We(n).length!==f)return!1;for(;f--;)if(g=b[f],!(mn(n,g)&&Ai(e[g],n[g],t,r)))return!1}return t.pop(),r.pop(),!0}function au(e,n){return Ai(e,n)}function Pn(e){if(!pn(e))return[];var n=[];for(var t in e)n.push(t);return Xc&&tu(e,n),n}function zi(e){var n=Pe(e);return function(t){if(t==null)return!1;var r=Pn(t);if(Pe(r))return!1;for(var c=0;c<n;c++)if(!Ie(t[e[c]]))return!1;return e!==uu||!Ie(t[ji])}}var ji="forEach",ou="has",Xi=["clear","delete"],cu=["get",ou,"set"],Gs=Xi.concat(ji,cu),uu=Xi.concat(cu),Zs=["add"].concat(Xi,ji,ou);const su=Ii?zi(Gs):Le("Map"),du=Ii?zi(uu):Le("WeakMap"),lu=Ii?zi(Zs):Le("Set"),fu=Le("WeakSet");function Fn(e){for(var n=We(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=e[n[c]];return r}function hu(e){for(var n=We(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=[n[c],e[n[c]]];return r}function Vi(e){for(var n={},t=We(e),r=0,c=t.length;r<c;r++)n[e[t[r]]]=t[r];return n}function rt(e){var n=[];for(var t in e)Ie(e[t])&&n.push(t);return n.sort()}function Hi(e,n){return function(t){var r=arguments.length;if(n&&(t=Object(t)),r<2||t==null)return t;for(var c=1;c<r;c++)for(var i=arguments[c],o=e(i),a=o.length,u=0;u<a;u++){var f=o[u];(!n||t[f]===void 0)&&(t[f]=i[f])}return t}}const Gi=Hi(Pn),Mn=Hi(We),Zi=Hi(Pn,!0);function Ys(){return function(){}}function pu(e){if(!pn(e))return{};if(wa)return wa(e);var n=Ys();n.prototype=e;var t=new n;return n.prototype=null,t}function gu(e,n){var t=pu(e);return n&&Mn(t,n),t}function mu(e){return pn(e)?gn(e)?e.slice():Gi({},e):e}function bu(e,n){return n(e),e}function Yi(e){return gn(e)?e:[e]}Ae.toPath=Yi;function ut(e){return Ae.toPath(e)}function Ki(e,n){for(var t=n.length,r=0;r<t;r++){if(e==null)return;e=e[n[r]]}return t?e:void 0}function $i(e,n,t){var r=Ki(e,ut(n));return ki(r)?t:r}function yu(e,n){n=ut(n);for(var t=n.length,r=0;r<t;r++){var c=n[r];if(!mn(e,c))return!1;e=e[c]}return!!t}function Qt(e){return e}function An(e){return e=Mn({},e),function(n){return Pi(n,e)}}function Jt(e){return e=ut(e),function(n){return Ki(n,e)}}function st(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(r){return e.call(n,r)};case 3:return function(r,c,i){return e.call(n,r,c,i)};case 4:return function(r,c,i,o){return e.call(n,r,c,i,o)}}return function(){return e.apply(n,arguments)}}function Du(e,n,t){return e==null?Qt:Ie(e)?st(e,n,t):pn(e)&&!gn(e)?An(e):Jt(e)}function er(e,n){return Du(e,n,1/0)}Ae.iteratee=er;function ze(e,n,t){return Ae.iteratee!==er?Ae.iteratee(e,n):Du(e,n,t)}function vu(e,n,t){n=ze(n,t);for(var r=We(e),c=r.length,i={},o=0;o<c;o++){var a=r[o];i[a]=n(e[a],a,e)}return i}function Qi(){}function xu(e){return e==null?Qi:function(n){return $i(e,n)}}function _u(e,n,t){var r=Array(Math.max(0,e));n=st(n,t,1);for(var c=0;c<e;c++)r[c]=n(c);return r}function Vt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const qn=Date.now||function(){return new Date().getTime()};function Uu(e){var n=function(i){return e[i]},t="(?:"+We(e).join("|")+")",r=RegExp(t),c=RegExp(t,"g");return function(i){return i=i==null?"":""+i,r.test(i)?i.replace(c,n):i}}const Tu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},wu=Uu(Tu),Ks=Vi(Tu),Eu=Uu(Ks),Au=Ae.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var vr=/(.)^/,$s={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qs=/\\|'|\r|\n|\u2028|\u2029/g;function Js(e){return"\\"+$s[e]}var ed=/^\s*(\w|\$)+\s*$/;function Fu(e,n,t){!n&&t&&(n=t),n=Zi({},n,Ae.templateSettings);var r=RegExp([(n.escape||vr).source,(n.interpolate||vr).source,(n.evaluate||vr).source].join("|")+"|$","g"),c=0,i="__p+='";e.replace(r,function(f,b,g,m,h){return i+=e.slice(c,h).replace(Qs,Js),c=h+f.length,b?i+=`'+
2
2
  ((__t=(`+b+`))==null?'':_.escape(__t))+
3
3
  '`:g?i+=`'+
4
4
  ((__t=(`+g+`))==null?'':__t)+
@@ -228,4 +228,4 @@ Character number: `+n.characterNumber},e.prototype.lineNumber=function(){return
228
228
  `,r:"\r",t:" "};function s(S){return S.replace(/\\(.)/g,function(A,I){return l[I]||I})}var p=n.rules.sequence(n.rules.tokenOfType("open-square-bracket"),n.rules.sequence.cut(),n.rules.sequence.capture(m),n.rules.tokenOfType("equals"),n.rules.sequence.capture(y),n.rules.tokenOfType("close-square-bracket")).map(function(S,A){return{name:S,value:A,append:!1}}),d=n.rules.sequence(n.rules.tokenOfType("dot"),n.rules.sequence.cut(),n.rules.sequence.capture(m)).map(function(S){return{name:"class",value:S,append:!0}}),D=n.rules.firstOf("attribute or class",p,d);function w(S,A){var I=c(A),K=n.Parser(),T=K.parseTokens(S,I);return T.isSuccess()?i.success(T.value()):new i.Result(null,[i.warning(_(A,T))])}function _(S,A){return"Did not understand this style mapping, so ignored it: "+S+`
229
229
  `+A.errors().map(U).join(`
230
230
  `)}function U(S){return"Error was at character number "+S.characterNumber()+": Expected "+S.expected+" but got "+S.actual}var E=a();return Jn}var et={},Mc;function Gl(){if(Mc)return et;Mc=1,et.readOptions=r;var e=ke,n=et._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],t=et._standardOptions={externalFileAccess:!1,transformDocument:i,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function r(o){return o=o||{},e.extend({},t,o,{customStyleMap:c(o.styleMap),readStyleMap:function(){var a=this.customStyleMap;return this.includeEmbeddedStyleMap&&(a=a.concat(c(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(a=a.concat(n)),a}})}function c(o){return o?e.isString(o)?o.split(`
231
- `).map(function(a){return a.trim()}).filter(function(a){return a!==""&&a.charAt(0)!=="#"}):o:[]}function i(o){return o}return et}var Ti={},qc;function Zl(){if(qc)return Ti;qc=1;var e=bn(),n=ms();Ti.openZip=t;function t(r){return r.arrayBuffer?e.resolve(n.openArrayBuffer(r.arrayBuffer)):e.reject(new Error("Could not find file in options"))}return Ti}var wi={},Pc;function Yl(){if(Pc)return wi;Pc=1;var e=Dr(),n=yr();wi.element=t;function t(r){return function(c){return n.elementWithTag(e.element(r),[c])}}return wi}var zc;function Kl(){if(zc)return Ve;zc=1;var e=ke,n=Sl(),t=Bl(),r=Nl().DocumentConverter,c=Il().convertElementToRawText,i=Hl().readStyle,o=Gl().readOptions,a=Zl(),u=cn().Result;Ve.convertToHtml=f,Ve.convertToMarkdown=b,Ve.convert=g,Ve.extractRawText=l,Ve.images=Us(),Ve.transforms=xs(),Ve.underline=Yl(),Ve.embedStyleMap=s,Ve.readEmbeddedStyleMap=m;function f(p,d){return g(p,d)}function b(p,d){var D=Object.create(d||{});return D.outputFormat="markdown",g(p,D)}function g(p,d){return d=o(d),a.openZip(p).tap(function(D){return t.readStyleMap(D).then(function(w){d.embeddedStyleMap=w})}).then(function(D){return n.read(D,p,d).then(function(w){return w.map(d.transformDocument)}).then(function(w){return h(w,d)})})}function m(p){return a.openZip(p).then(t.readStyleMap)}function h(p,d){var D=y(d.readStyleMap()),w=e.extend({},d,{styleMap:D.value}),_=new r(w);return p.flatMapThen(function(U){return D.flatMapThen(function(E){return _.convertToHtml(U)})})}function y(p){return u.combine((p||[]).map(i)).map(function(d){return d.filter(function(D){return!!D})})}function l(p){return a.openZip(p).then(n.read).then(function(d){return d.map(c)})}function s(p,d){return a.openZip(p).tap(function(D){return t.writeStyleMap(D,d)}).then(function(D){return D.toArrayBuffer()}).then(function(D){return{toArrayBuffer:function(){return D},toBuffer:function(){return Buffer.from(D)}}})}return Ve.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)},Ve}var $l=Kl();const Ql=nn.getDefaultExportFromCjs($l);function Jl(e,n){const t=atob(e.split(",")[1]),r=Array.from({length:t.length});for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);const c=new Uint8Array(r);return new Blob([c],{type:n})}function ef(e,n){return new File([e],n,{type:e.type})}function nf(){const e=Xn.useEditorInstance(),n=Xn.useButtonProps(Ci.name),{icon:t=void 0,tooltip:r=void 0,tooltipOptions:c={},isActive:i=void 0,mammothOptions:o,limit:a,convert:u}=(n==null?void 0:n.componentProps)??{},{editorDisabled:f}=Xn.useToggleActive(i),b=Xn.useExtension(Ci.name),{toast:g}=Bs.useToast(),{t:m}=ks.useLocale(),[h,y]=xa.useState(!1),l=xa.useRef(null);function s(){var _;(_=l.current)==null||_.click()}function p(_){const U=_.target.files[0];if(U){if(U.size>a){g({variant:"destructive",title:m("editor.importWord.limitSize")});return}D(U)}}async function d(_){const E=new DOMParser().parseFromString(_,"text/html"),S=E.querySelectorAll("img");if(S.length===0)return E.body.innerHTML;if(Xn.hasExtension(e,"image")){const I=b==null?void 0:b.options;if(I&&typeof I.upload=="function"){const K=[];for(const W of S){const x=W.getAttribute("src"),q=Jl(x,"image/jpeg"),R=ef(q,"image.jpeg");K.push(R)}const T=await I.upload(K);for(const[W,x]of S.entries()){x.setAttribute("src",T[W].src);const q=x.parentElement;(q==null?void 0:q.tagName)==="P"&&(q.insertAdjacentElement("beforebegin",x),!q.hasChildNodes()&&q.textContent===""&&q.remove())}return E.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),E.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),E.body.innerHTML}async function D(_){y(!0);try{if(u){const U=await u(_);w(U)}else{const U=await _.arrayBuffer(),{value:E}=await Ql.convertToHtml({arrayBuffer:U},o);w(E)}}finally{y(!1)}}async function w(_){const U=await d(_);e.chain().setContent(U,!0).run()}return n?Wn.jsxs(Wn.Fragment,{children:[Wn.jsx(Ss.ActionButton,{action:s,disabled:f,icon:t,loading:h,tooltip:r,tooltipOptions:c}),Wn.jsx("input",{accept:".docx",onChange:p,ref:l,type:"file",style:{display:"none"}})]}):Wn.jsx(Wn.Fragment,{})}const Ci=Cs.Extension.create({name:"importWord",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({extension:n,t})=>{const{convert:r,limit:c,mammothOptions:i}=n.options;return{componentProps:{convert:r,limit:c,mammothOptions:i,icon:"Word",shortcutKeys:n.options.shortcutKeys??["alt","mod","S"],tooltip:t("editor.importWord.tooltip")}}}}}});exports.ImportWord=Ci;exports.RichTextImportWord=nf;
231
+ `).map(function(a){return a.trim()}).filter(function(a){return a!==""&&a.charAt(0)!=="#"}):o:[]}function i(o){return o}return et}var Ti={},qc;function Zl(){if(qc)return Ti;qc=1;var e=bn(),n=ms();Ti.openZip=t;function t(r){return r.arrayBuffer?e.resolve(n.openArrayBuffer(r.arrayBuffer)):e.reject(new Error("Could not find file in options"))}return Ti}var wi={},Pc;function Yl(){if(Pc)return wi;Pc=1;var e=Dr(),n=yr();wi.element=t;function t(r){return function(c){return n.elementWithTag(e.element(r),[c])}}return wi}var zc;function Kl(){if(zc)return Ve;zc=1;var e=ke,n=Sl(),t=Bl(),r=Nl().DocumentConverter,c=Il().convertElementToRawText,i=Hl().readStyle,o=Gl().readOptions,a=Zl(),u=cn().Result;Ve.convertToHtml=f,Ve.convertToMarkdown=b,Ve.convert=g,Ve.extractRawText=l,Ve.images=Us(),Ve.transforms=xs(),Ve.underline=Yl(),Ve.embedStyleMap=s,Ve.readEmbeddedStyleMap=m;function f(p,d){return g(p,d)}function b(p,d){var D=Object.create(d||{});return D.outputFormat="markdown",g(p,D)}function g(p,d){return d=o(d),a.openZip(p).tap(function(D){return t.readStyleMap(D).then(function(w){d.embeddedStyleMap=w})}).then(function(D){return n.read(D,p,d).then(function(w){return w.map(d.transformDocument)}).then(function(w){return h(w,d)})})}function m(p){return a.openZip(p).then(t.readStyleMap)}function h(p,d){var D=y(d.readStyleMap()),w=e.extend({},d,{styleMap:D.value}),_=new r(w);return p.flatMapThen(function(U){return D.flatMapThen(function(E){return _.convertToHtml(U)})})}function y(p){return u.combine((p||[]).map(i)).map(function(d){return d.filter(function(D){return!!D})})}function l(p){return a.openZip(p).then(n.read).then(function(d){return d.map(c)})}function s(p,d){return a.openZip(p).tap(function(D){return t.writeStyleMap(D,d)}).then(function(D){return D.toArrayBuffer()}).then(function(D){return{toArrayBuffer:function(){return D},toBuffer:function(){return Buffer.from(D)}}})}return Ve.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)},Ve}var $l=Kl();const Ql=nn.getDefaultExportFromCjs($l);function Jl(e,n){const t=atob(e.split(",")[1]),r=Array.from({length:t.length});for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);const c=new Uint8Array(r);return new Blob([c],{type:n})}function ef(e,n){return new File([e],n,{type:e.type})}function nf(){const e=Xn.useEditorInstance(),n=Xn.useButtonProps(Ci.name),{icon:t=void 0,tooltip:r=void 0,tooltipOptions:c={},isActive:i=void 0,mammothOptions:o,limit:a,convert:u}=(n==null?void 0:n.componentProps)??{},{editorDisabled:f}=Xn.useToggleActive(i),b=Xn.useExtension(Ci.name),{toast:g}=ks.useToast(),{t:m}=Bs.useLocale(),[h,y]=xa.useState(!1),l=xa.useRef(null);function s(){var _;(_=l.current)==null||_.click()}function p(_){const U=_.target.files[0];if(U){if(U.size>a){g({variant:"destructive",title:m("editor.importWord.limitSize")});return}D(U)}}async function d(_){const E=new DOMParser().parseFromString(_,"text/html"),S=E.querySelectorAll("img");if(S.length===0)return E.body.innerHTML;if(Xn.hasExtension(e,"image")){const I=b==null?void 0:b.options;if(I&&typeof I.upload=="function"){const K=[];for(const W of S){const x=W.getAttribute("src"),q=Jl(x,"image/jpeg"),R=ef(q,"image.jpeg");K.push(R)}const T=await I.upload(K);for(const[W,x]of S.entries()){x.setAttribute("src",T[W].src);const q=x.parentElement;(q==null?void 0:q.tagName)==="P"&&(q.insertAdjacentElement("beforebegin",x),!q.hasChildNodes()&&q.textContent===""&&q.remove())}return E.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),E.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),E.body.innerHTML}async function D(_){y(!0);try{if(u){const U=await u(_);w(U)}else{const U=await _.arrayBuffer(),{value:E}=await Ql.convertToHtml({arrayBuffer:U},o);w(E)}}finally{y(!1)}}async function w(_){const U=await d(_);e.chain().setContent(U,!0).run()}return n?Wn.jsxs(Wn.Fragment,{children:[Wn.jsx(Ss.ActionButton,{action:s,disabled:f,icon:t,loading:h,tooltip:r,tooltipOptions:c}),Wn.jsx("input",{accept:".docx",onChange:p,ref:l,type:"file",style:{display:"none"}})]}):Wn.jsx(Wn.Fragment,{})}const Ci=Cs.Extension.create({name:"importWord",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({extension:n,t})=>{const{convert:r,limit:c,mammothOptions:i}=n.options;return{componentProps:{convert:r,limit:c,mammothOptions:i,icon:"Word",shortcutKeys:n.options.shortcutKeys??["alt","mod","S"],tooltip:t("editor.importWord.tooltip")}}}}}});exports.ImportWord=Ci;exports.RichTextImportWord=nf;
package/lib/ImportWord.js CHANGED
@@ -1,13 +1,13 @@
1
- import { E as Fs } from "./clsx-DmuN0U_8.js";
1
+ import { E as Fs } from "./clsx-BWSGDJNJ.js";
2
2
  import { jsx as yr, Fragment as Da, jsxs as Cs } from "react/jsx-runtime";
3
3
  import { useState as Ss, useRef as Bs } from "react";
4
4
  import { g as ks, c as ln, a as Ws } from "./_commonjsHelpers-BItOPCY9.js";
5
- import { A as Rs } from "./toggle-Bxwwb_Kp.js";
6
- import "./index-D9JOHlso.js";
5
+ import { A as Rs } from "./toggle-DKHg5sLm.js";
6
+ import "./index-DF5ZPtWM.js";
7
7
  import "./theme.js";
8
- import { u as Ns } from "./use-toast-Crf7-q5H.js";
9
- import { c as Os, u as Is, a as Ls, d as Ms, j as qs } from "./useButtonProps-CfYtuEnd.js";
10
- import { u as Ps } from "./index-BDX1uE62.js";
8
+ import { c as Ns, u as Os, a as Is, d as Ls, j as Ms } from "./useButtonProps-DVP4s_ER.js";
9
+ import { u as qs } from "./index-Dujzr6bY.js";
10
+ import { u as Ps } from "./use-toast-Crf7-q5H.js";
11
11
  var Ve = {}, Fi = "1.13.7", va = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || Function("return this")() || {}, Gt = Array.prototype, Ci = Object.prototype, xa = typeof Symbol < "u" ? Symbol.prototype : null, zs = Gt.push, at = Gt.slice, Jn = Ci.toString, js = Ci.hasOwnProperty, zc = typeof ArrayBuffer < "u", Xs = typeof DataView < "u", Vs = Array.isArray, _a = Object.keys, Ua = Object.create, Ta = zc && ArrayBuffer.isView, Hs = isNaN, Gs = isFinite, jc = !{ toString: null }.propertyIsEnumerable("toString"), wa = [
12
12
  "valueOf",
13
13
  "isPrototypeOf",
@@ -16551,7 +16551,7 @@ function df(e, n) {
16551
16551
  return new File([e], n, { type: e.type });
16552
16552
  }
16553
16553
  function xf() {
16554
- const e = Os(), n = Is(Pc.name), {
16554
+ const e = Ns(), n = Os(Pc.name), {
16555
16555
  icon: t = void 0,
16556
16556
  tooltip: r = void 0,
16557
16557
  tooltipOptions: c = {},
@@ -16559,7 +16559,7 @@ function xf() {
16559
16559
  mammothOptions: o,
16560
16560
  limit: a,
16561
16561
  convert: u
16562
- } = (n == null ? void 0 : n.componentProps) ?? {}, { editorDisabled: f } = Ls(i), b = Ms(Pc.name), { toast: g } = Ns(), { t: m } = Ps(), [h, y] = Ss(!1), l = Bs(null);
16562
+ } = (n == null ? void 0 : n.componentProps) ?? {}, { editorDisabled: f } = Is(i), b = Ls(Pc.name), { toast: g } = Ps(), { t: m } = qs(), [h, y] = Ss(!1), l = Bs(null);
16563
16563
  function s() {
16564
16564
  var _;
16565
16565
  (_ = l.current) == null || _.click();
@@ -16581,7 +16581,7 @@ function xf() {
16581
16581
  const E = new DOMParser().parseFromString(_, "text/html"), S = E.querySelectorAll("img");
16582
16582
  if (S.length === 0)
16583
16583
  return E.body.innerHTML;
16584
- if (qs(e, "image")) {
16584
+ if (Ms(e, "image")) {
16585
16585
  const I = b == null ? void 0 : b.options;
16586
16586
  if (I && typeof I.upload == "function") {
16587
16587
  const K = [];
@@ -1,11 +1,11 @@
1
- import { l as y, E as x } from "./clsx-DmuN0U_8.js";
1
+ import { s as y, E as x } from "./clsx-BWSGDJNJ.js";
2
2
  import { TextSelection as b, AllSelection as I } from "@tiptap/pm/state";
3
3
  import { jsx as u, Fragment as m, jsxs as A } from "react/jsx-runtime";
4
- import { A as p } from "./toggle-Bxwwb_Kp.js";
4
+ import { A as p } from "./toggle-DKHg5sLm.js";
5
5
  import "react";
6
- import "./index-D9JOHlso.js";
6
+ import "./index-DF5ZPtWM.js";
7
7
  import "./theme.js";
8
- import { u as T, a as K } from "./useButtonProps-CfYtuEnd.js";
8
+ import { u as T, a as K } from "./useButtonProps-DVP4s_ER.js";
9
9
  var a = /* @__PURE__ */ ((t) => (t[t.max = 7] = "max", t[t.min = 0] = "min", t[t.more = 1] = "more", t[t.less = -1] = "less", t))(a || {});
10
10
  function g(t, n, e) {
11
11
  return t < n ? n : t > e ? e : t;
@@ -1 +1 @@
1
- "use strict";const h=require("./clsx-CXbNJWDD.cjs"),m=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),l=require("./toggle-BYvLnjCL.cjs");require("react");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const p=require("./useButtonProps-CydzndG1.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function T(t,e,n){return t<e?e:t>n?n:t}function g(t,e,n,o){const{doc:i,selection:r}=t;if(!i||!r||!(r instanceof m.TextSelection||r instanceof m.AllSelection))return t;const{from:s,to:u}=r;return i.nodesBetween(s,u,(d,I)=>{const b=d.type;return n.includes(b.name)?(t=y(t,I,e),!1):!h.isList(d.type.name,o.extensionManager.extensions)}),t}function y(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const s=T((o.attrs.indent||0)+n,0,7);if(s===o.attrs.indent)return t;const u={...o.attrs,indent:s};return t.setNodeMarkup(e,o.type,u,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:i})=>{const{selection:r}=n;let{tr:s}=n;return s=s.setSelection(r),s=g(s,t,e,i),s.docChanged?(o&&o(s),!0):!1}}function A(){const t=p.useButtonProps(x.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=p.useToggleActive(),i=()=>{o||e!=null&&e.action&&(e==null||e.action())},r=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(l.ActionButton,{action:i,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(l.ActionButton,{action:r,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const x=h.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var i,r;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((r=o.options.shortcutKeys)==null?void 0:r[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=x;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=y;
1
+ "use strict";const h=require("./clsx-CXbNJWDD.cjs"),m=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),l=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const p=require("./useButtonProps-DBJkNDS2.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function T(t,e,n){return t<e?e:t>n?n:t}function g(t,e,n,o){const{doc:i,selection:r}=t;if(!i||!r||!(r instanceof m.TextSelection||r instanceof m.AllSelection))return t;const{from:s,to:u}=r;return i.nodesBetween(s,u,(d,I)=>{const b=d.type;return n.includes(b.name)?(t=y(t,I,e),!1):!h.isList(d.type.name,o.extensionManager.extensions)}),t}function y(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const s=T((o.attrs.indent||0)+n,0,7);if(s===o.attrs.indent)return t;const u={...o.attrs,indent:s};return t.setNodeMarkup(e,o.type,u,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:i})=>{const{selection:r}=n;let{tr:s}=n;return s=s.setSelection(r),s=g(s,t,e,i),s.docChanged?(o&&o(s),!0):!1}}function A(){const t=p.useButtonProps(x.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=p.useToggleActive(),i=()=>{o||e!=null&&e.action&&(e==null||e.action())},r=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(l.ActionButton,{action:i,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(l.ActionButton,{action:r,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const x=h.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var i,r;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((r=o.options.shortcutKeys)==null?void 0:r[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=x;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=y;
package/lib/Indent.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Indent-CaGP0qTp.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Indent-CkEC7x36.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
package/lib/Indent.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./clsx-DmuN0U_8.js";
2
- import { I as o, R as r } from "./Indent-B00o0P0M.js";
1
+ import "./clsx-BWSGDJNJ.js";
2
+ import { I as o, R as r } from "./Indent-C_O5WdyR.js";
3
3
  export {
4
4
  o as Indent,
5
5
  r as RichTextIndent
package/lib/Italic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),y=require("./toggle-BYvLnjCL.cjs");require("react");require("./index-CX4pNJlH.cjs");require("./theme.cjs");const u=require("./useButtonProps-CydzndG1.cjs");var I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,h=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,v=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,f=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,k=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:I,type:this.type}),r.markInputRule({find:v,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:h,type:this.type}),r.markPasteRule({find:f,type:this.type})]}}),M=k;function R(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:l={},action:a=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:o,update:m}=u.useToggleActive(d),g=()=>{o||a&&(a(),m())};return t?s.jsx(y.ActionButton,{action:g,dataState:p,disabled:o,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:l}):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:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=c;exports.RichTextItalic=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),y=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const u=require("./useButtonProps-DBJkNDS2.cjs");var I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,h=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,v=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,f=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,k=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:I,type:this.type}),r.markInputRule({find:v,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:h,type:this.type}),r.markPasteRule({find:f,type:this.type})]}}),M=k;function R(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:l={},action:a=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:o,update:m}=u.useToggleActive(d),g=()=>{o||a&&(a(),m())};return t?s.jsx(y.ActionButton,{action:g,dataState:p,disabled:o,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:l}):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:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=c;exports.RichTextItalic=R;
package/lib/Italic.js CHANGED
@@ -1,10 +1,10 @@
1
- import { M as g, e as n, f as o, m as y } from "./clsx-DmuN0U_8.js";
1
+ import { M as g, e as n, f as o, m as y } from "./clsx-BWSGDJNJ.js";
2
2
  import { jsx as d, Fragment as f } from "react/jsx-runtime";
3
- import { A as h } from "./toggle-Bxwwb_Kp.js";
3
+ import { A as h } from "./toggle-DKHg5sLm.js";
4
4
  import "react";
5
- import "./index-D9JOHlso.js";
5
+ import "./index-DF5ZPtWM.js";
6
6
  import "./theme.js";
7
- import { u as I, a as v } from "./useButtonProps-CfYtuEnd.js";
7
+ import { u as I, a as v } from "./useButtonProps-DVP4s_ER.js";
8
8
  var M = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, k = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, A = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, _ = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, x = g.create({
9
9
  name: "italic",
10
10
  addOptions() {