reactjs-tiptap-editor 1.0.6 → 1.0.8

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 (176) hide show
  1. package/lib/{ActionMenuButton-htJNI0Fa.js → ActionMenuButton-Cc0vy5hy.js} +10 -13
  2. package/lib/ActionMenuButton-t7e5GCJp.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +23 -25
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +5 -6
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +5 -6
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +11 -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 +9 -10
  15. package/lib/CodeBlock.cjs +39 -39
  16. package/lib/CodeBlock.js +837 -946
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +8 -9
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +18 -19
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +5 -6
  23. package/lib/{Drawer-1211urKj.js → Drawer-C6WTtcd0.js} +16 -17
  24. package/lib/Drawer-DRdsK4f_.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 +15 -16
  29. package/lib/{Excalidraw-Du3hBR8t.js → Excalidraw-DjO5sCC_.js} +31 -32
  30. package/lib/Excalidraw-gJ99kWdS.cjs +1 -0
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +2 -2
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +17 -18
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +5 -6
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +5 -5
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +5 -5
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +15 -15
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +7 -8
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +8 -10
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +5 -6
  49. package/lib/Icon-DHNSWrSX.cjs +1 -0
  50. package/lib/{Icon-C-qYUAS1.js → Icon-prdLEHMN.js} +3 -4
  51. package/lib/{Iframe-DTYTLQE6.js → Iframe-CERKUXQh.js} +13 -14
  52. package/lib/Iframe-CvymVtpM.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 +48 -49
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +22 -23
  59. package/lib/ImportWord.cjs +2 -2
  60. package/lib/ImportWord.js +10 -11
  61. package/lib/{Indent-jOPn3eUM.js → Indent-BfEOOT5B.js} +24 -25
  62. package/lib/Indent-CE6kk62r.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 +10 -11
  67. package/lib/{Katex-CERSrcTP.js → Katex-5KNTSK8T.js} +21 -22
  68. package/lib/Katex-CJ2Fmvut.cjs +4 -0
  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 +14 -15
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-B5SdhOfa.js → LinkEditBlock-CFkyS2Ze.js} +55 -56
  76. package/lib/{LinkEditBlock-DaxljgJC.cjs → LinkEditBlock-D6z0Yohc.cjs} +2 -2
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +138 -132
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +20 -20
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +22 -24
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +5 -6
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +18 -19
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +13 -13
  89. package/lib/Strike.cjs +1 -1
  90. package/lib/Strike.js +5 -6
  91. package/lib/{Table-39OkCQbu.js → Table-CWbY_hqo.js} +7 -8
  92. package/lib/Table-D9pRzwFU.cjs +9 -0
  93. package/lib/Table.cjs +1 -1
  94. package/lib/Table.js +1 -1
  95. package/lib/TaskList.cjs +1 -1
  96. package/lib/TaskList.js +13 -14
  97. package/lib/TextAlign.cjs +1 -1
  98. package/lib/TextAlign.js +17 -19
  99. package/lib/TextDirection.cjs +1 -1
  100. package/lib/TextDirection.js +17 -19
  101. package/lib/TextUnderline.cjs +1 -1
  102. package/lib/TextUnderline.js +5 -6
  103. package/lib/{Twitter-D7PhLycr.js → Twitter-BV7HA-MO.js} +566 -525
  104. package/lib/Twitter-D7NK3MZe.cjs +1 -0
  105. package/lib/Twitter.cjs +1 -1
  106. package/lib/Twitter.js +2 -2
  107. package/lib/Video.cjs +1 -1
  108. package/lib/Video.js +24 -25
  109. package/lib/bubble.cjs +4 -4
  110. package/lib/bubble.js +433 -423
  111. package/lib/{button-Crm67hfl.js → button-0963_Pa8.js} +3 -4
  112. package/lib/button-Bxfjx9_Y.cjs +1 -0
  113. package/lib/{checkbox-DViVmgJ6.js → checkbox-D4p6-UMt.js} +1 -1
  114. package/lib/{checkbox-NQC2MdGT.cjs → checkbox-Q6FcMQW5.cjs} +1 -1
  115. package/lib/{dialog-Ce9Cjfft.js → dialog-B-9_Z5j2.js} +1 -1
  116. package/lib/{dialog-DaHBd2zw.cjs → dialog-D-oYxagG.cjs} +1 -1
  117. package/lib/{dropdown-menu-CQykJhBs.js → dropdown-menu-par18QL5.js} +1 -1
  118. package/lib/{dropdown-menu-CSCDQtq0.cjs → dropdown-menu-r8XibZQU.cjs} +1 -1
  119. package/lib/extensions/Mention/Mention.d.ts +3 -1
  120. package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +7 -1
  121. package/lib/{index-DCJheRBq.cjs → index--nUS7Y66.cjs} +1 -1
  122. package/lib/{index-DLqogznp.cjs → index-BBNITgNi.cjs} +7 -7
  123. package/lib/index-BFXkgG1P.cjs +7 -0
  124. package/lib/{index-prphFVsp.js → index-BQ6ZdLsu.js} +1 -1
  125. package/lib/{index-DylewabB.cjs → index-BZ6DfR2r.cjs} +1 -1
  126. package/lib/{index-D-FhWysc.js → index-BimeTI7q.js} +1 -1
  127. package/lib/{index-TMqmkmT6.cjs → index-CApXPpjF.cjs} +1 -1
  128. package/lib/{index-nFjllrEl.js → index-CbIQPoF6.js} +19 -18
  129. package/lib/{index-BeUrdBxf.js → index-EKFybgpP.js} +1 -1
  130. package/lib/{index-DuZCJJSp.js → index-pgx8gyoC.js} +1118 -504
  131. package/lib/index.cjs +2 -2
  132. package/lib/index.js +8 -9
  133. package/lib/{input-tU3H__39.cjs → input-CZUkD6wF.cjs} +1 -1
  134. package/lib/{input-DfqFAyKo.js → input-cclJoUeC.js} +1 -1
  135. package/lib/{isNumber-CTm1pIvN.js → isNumber-8HKEgTkA.js} +1 -1
  136. package/lib/{isNumber-C2saEiG2.cjs → isNumber-Bv1Qhmw8.cjs} +1 -1
  137. package/lib/label-CFaBdRGz.cjs +1 -0
  138. package/lib/label-aveW7pdK.js +18 -0
  139. package/lib/{popover-CZWSQZ0q.cjs → popover-BWYZO_fD.cjs} +1 -1
  140. package/lib/{popover-CoepUobG.js → popover-D5YZPv2r.js} +1 -1
  141. package/lib/{separator-DCQD8P6s.cjs → separator-B978cwAm.cjs} +1 -1
  142. package/lib/{separator-6SnwzytZ.js → separator-BHjFVmZr.js} +18 -18
  143. package/lib/{store-726Zjszt.cjs → store-BsBiawfz.cjs} +1 -1
  144. package/lib/{store-ibARMQ3h.js → store-BsMMRKFd.js} +1 -1
  145. package/lib/style.css +1 -1
  146. package/lib/{tabs-DrkJL_C2.js → tabs-Bj8EvAkY.js} +1 -1
  147. package/lib/{tabs-B_ArrG09.cjs → tabs-CUMyiV80.cjs} +1 -1
  148. package/lib/{textarea-CmZVZKOo.cjs → textarea-BKb7LDw1.cjs} +1 -1
  149. package/lib/{textarea-CIs52G8B.js → textarea-CClyW-74.js} +1 -1
  150. package/lib/{throttle-CGM5M2yG.js → throttle-BIkZV3Y_.js} +1 -1
  151. package/lib/{throttle-DXN-aiH5.cjs → throttle-BM3Bmbf_.cjs} +1 -1
  152. package/lib/{updatePosition-DpMKxYdN.js → updatePosition-GLTrgcib.js} +1 -1
  153. package/lib/{updatePosition-C17CDdjq.cjs → updatePosition-u2mTh3mG.cjs} +1 -1
  154. package/lib/useButtonProps-B0riSJs9.cjs +1 -0
  155. package/lib/{useButtonProps-D0SrPzuG.js → useButtonProps-StwAz7Ha.js} +35 -47
  156. package/package.json +58 -54
  157. package/lib/ActionMenuButton-DYT5chmX.cjs +0 -1
  158. package/lib/Drawer-DUFUd5BW.cjs +0 -1
  159. package/lib/Excalidraw-CajgZDjU.cjs +0 -1
  160. package/lib/Icon-BjR_or8V.cjs +0 -1
  161. package/lib/Iframe-CM6mRQmv.cjs +0 -1
  162. package/lib/Indent-BmhiEb0S.cjs +0 -1
  163. package/lib/Katex-CUd3LxLh.cjs +0 -4
  164. package/lib/Table-3VstSlg4.cjs +0 -9
  165. package/lib/Twitter-DuHPeVW1.cjs +0 -1
  166. package/lib/button-xNppt_aK.cjs +0 -1
  167. package/lib/index-BQ17A_37.js +0 -393
  168. package/lib/index-CNzHZDls.cjs +0 -7
  169. package/lib/index-DmOTQudI.cjs +0 -1
  170. package/lib/label-DC33TZy_.js +0 -19
  171. package/lib/label-DkDE77kc.cjs +0 -1
  172. package/lib/toggle-DVCNvcqp.cjs +0 -1
  173. package/lib/toggle-xchtz-Kf.js +0 -92
  174. package/lib/tooltip-BTFcHrd9.js +0 -24
  175. package/lib/tooltip-DFjcKu9a.cjs +0 -1
  176. package/lib/useButtonProps-bei1vI37.cjs +0 -1
package/lib/Image.js CHANGED
@@ -1,24 +1,23 @@
1
- import { s as he, m as fe, R as ge } from "./index-nFjllrEl.js";
2
- import { a as q, c as pe } from "./throttle-CGM5M2yG.js";
1
+ import { s as he, m as fe, R as ge } from "./index-CbIQPoF6.js";
2
+ import { a as q, c as pe } from "./throttle-BIkZV3Y_.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
5
  import { I as Z, j as J, k as be, u as ne } from "./index-0OnGZkVF.js";
6
- import { i as K, c as xe } from "./isNumber-CTm1pIvN.js";
7
- import { A as ye } from "./toggle-xchtz-Kf.js";
8
- import "./index-DuZCJJSp.js";
9
- import { D as re, a as le, b as oe, c as se, d as we } from "./dialog-Ce9Cjfft.js";
10
- import Ie from "react-image-crop";
11
- import { B } from "./button-Crm67hfl.js";
12
- import { d as ve, r as Te } from "./file-BLas99n7.js";
13
- import { d as ce, c as Ae, u as Ce, a as Ee } from "./useButtonProps-D0SrPzuG.js";
14
- import { u as de } from "./use-toast-Crf7-q5H.js";
15
- import { I as $ } from "./Icon-C-qYUAS1.js";
16
- import { a as Me } from "./store-ibARMQ3h.js";
17
- import { l as Le, E as Ne } from "./events.constant-wrlJ_7JZ.js";
18
- import { T as Se, a as _e, b as Q, c as ee } from "./tabs-DrkJL_C2.js";
19
- import { C as ze } from "./checkbox-DViVmgJ6.js";
20
- import { L as te } from "./label-DC33TZy_.js";
21
- import { I as ie } from "./input-DfqFAyKo.js";
6
+ import { i as K, c as xe } from "./isNumber-8HKEgTkA.js";
7
+ import { A as ye } from "./index-pgx8gyoC.js";
8
+ import { B } from "./button-0963_Pa8.js";
9
+ import { I as Q } from "./input-cclJoUeC.js";
10
+ import { L as ee } from "./label-aveW7pdK.js";
11
+ import { T as we, a as Ie, b as te, c as ie } from "./tabs-Bj8EvAkY.js";
12
+ import { u as re } from "./use-toast-Crf7-q5H.js";
13
+ import { C as ve } from "./checkbox-D4p6-UMt.js";
14
+ import { D as le, a as oe, b as se, c as ce, d as Te } from "./dialog-B-9_Z5j2.js";
15
+ import Ae from "react-image-crop";
16
+ import { d as Ce, r as Ee } from "./file-BLas99n7.js";
17
+ import { d as de, c as Me, u as Le, a as Ne } from "./useButtonProps-StwAz7Ha.js";
18
+ import { I as $ } from "./Icon-prdLEHMN.js";
19
+ import { a as Se } from "./store-BsMMRKFd.js";
20
+ import { l as _e, E as ze } from "./events.constant-wrlJ_7JZ.js";
22
21
  const X = {
23
22
  TOP_LEFT: "tl",
24
23
  TOP_RIGHT: "tr",
@@ -232,10 +231,10 @@ function ue(e, t) {
232
231
  }
233
232
  function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
234
233
  var n, y;
235
- 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({
234
+ 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
235
  src: "",
237
236
  file: null
238
- }), A = ce(G.name), p = P(() => (A == null ? void 0 : A.options) ?? {}, [A]);
237
+ }), A = de(G.name), p = P(() => (A == null ? void 0 : A.options) ?? {}, [A]);
239
238
  function c(i) {
240
239
  if (T.current && i.width && i.height) {
241
240
  const r = U(T.current, i);
@@ -263,7 +262,7 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
263
262
  if (!x) {
264
263
  C(!0);
265
264
  try {
266
- const r = ve(k, ((i = E == null ? void 0 : E.file) == null ? void 0 : i.name) || "image.png");
265
+ const r = Ce(k, ((i = E == null ? void 0 : E.file) == null ? void 0 : i.name) || "image.png");
267
266
  let h = "";
268
267
  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({
269
268
  src: "",
@@ -298,7 +297,7 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
298
297
  i.target.value = "";
299
298
  return;
300
299
  }
301
- const l = h[0], w = await Te(l);
300
+ const l = h[0], w = await Ee(l);
302
301
  m(!0), z({
303
302
  src: w.src,
304
303
  file: l
@@ -318,18 +317,18 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
318
317
  }
319
318
  ),
320
319
  /* @__PURE__ */ b(
321
- re,
320
+ le,
322
321
  {
323
322
  open: v,
324
323
  onOpenChange: (i) => {
325
324
  m(i), i || (z({ src: "", file: null }), N());
326
325
  },
327
326
  children: [
328
- /* @__PURE__ */ o(le, {}),
329
- /* @__PURE__ */ b(oe, { children: [
330
- /* @__PURE__ */ o(se, { children: u("editor.image.dialog.tab.uploadCrop") }),
327
+ /* @__PURE__ */ o(oe, {}),
328
+ /* @__PURE__ */ b(se, { children: [
329
+ /* @__PURE__ */ o(ce, { children: u("editor.image.dialog.tab.uploadCrop") }),
331
330
  /* @__PURE__ */ o("div", { children: E.src && /* @__PURE__ */ o(
332
- Ie,
331
+ Ae,
333
332
  {
334
333
  className: "richtext-w-full",
335
334
  crop: _,
@@ -345,7 +344,7 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
345
344
  )
346
345
  }
347
346
  ) }),
348
- /* @__PURE__ */ b(we, { children: [
347
+ /* @__PURE__ */ b(Te, { children: [
349
348
  /* @__PURE__ */ b(
350
349
  B,
351
350
  {
@@ -413,15 +412,15 @@ function Ue({ editor: e, imageInline: t, onClose: a, disabled: s, alt: f }) {
413
412
  )
414
413
  ] });
415
414
  }
416
- function rt() {
417
- const { t: e } = ne(), { toast: t } = de(), a = Ae(), s = Ce(G.name), {
415
+ function nt() {
416
+ const { t: e } = ne(), { toast: t } = re(), a = Me(), s = Le(G.name), {
418
417
  icon: f,
419
418
  tooltip: u
420
- } = (s == null ? void 0 : s.componentProps) ?? {}, { editorDisabled: g } = Ee(), [v, m] = L(!1), [x, C] = L(!1), T = ce(G.name), _ = (d) => {
419
+ } = (s == null ? void 0 : s.componentProps) ?? {}, { editorDisabled: g } = Ne(), [v, m] = L(!1), [x, C] = L(!1), T = de(G.name), _ = (d) => {
421
420
  m(d.detail);
422
421
  }, [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]);
423
422
  W(() => {
424
- const d = Le(Ne.UPLOAD_IMAGE(a.id), _);
423
+ const d = _e(ze.UPLOAD_IMAGE(a.id), _);
425
424
  return () => {
426
425
  d();
427
426
  };
@@ -480,13 +479,13 @@ function rt() {
480
479
  d.preventDefault(), (N = E.current) == null || N.click();
481
480
  }
482
481
  return s ? /* @__PURE__ */ b(
483
- re,
482
+ le,
484
483
  {
485
484
  onOpenChange: m,
486
485
  open: v,
487
486
  children: [
488
487
  /* @__PURE__ */ o(
489
- le,
488
+ oe,
490
489
  {
491
490
  asChild: !0,
492
491
  children: /* @__PURE__ */ o(
@@ -502,21 +501,21 @@ function rt() {
502
501
  )
503
502
  }
504
503
  ),
505
- /* @__PURE__ */ b(oe, { children: [
506
- /* @__PURE__ */ o(se, { children: e("editor.image.dialog.title") }),
504
+ /* @__PURE__ */ b(se, { children: [
505
+ /* @__PURE__ */ o(ce, { children: e("editor.image.dialog.title") }),
507
506
  /* @__PURE__ */ b(
508
- Se,
507
+ we,
509
508
  {
510
509
  activationMode: "manual",
511
510
  defaultValue: c.resourceImage === "both" || c.resourceImage === "upload" ? "upload" : "link",
512
511
  children: [
513
- c.resourceImage === "both" && /* @__PURE__ */ b(_e, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
514
- /* @__PURE__ */ o(Q, { value: "upload", children: e("editor.image.dialog.tab.upload") }),
515
- /* @__PURE__ */ o(Q, { value: "link", children: e("editor.image.dialog.tab.url") })
512
+ c.resourceImage === "both" && /* @__PURE__ */ b(Ie, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
513
+ /* @__PURE__ */ o(te, { value: "upload", children: e("editor.image.dialog.tab.upload") }),
514
+ /* @__PURE__ */ o(te, { value: "link", children: e("editor.image.dialog.tab.url") })
516
515
  ] }),
517
516
  /* @__PURE__ */ b("div", { className: "richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]", children: [
518
517
  /* @__PURE__ */ o(
519
- ze,
518
+ ve,
520
519
  {
521
520
  checked: A,
522
521
  onCheckedChange: (d) => {
@@ -524,12 +523,12 @@ function rt() {
524
523
  }
525
524
  }
526
525
  ),
527
- /* @__PURE__ */ o(te, { children: e("editor.link.dialog.inline") })
526
+ /* @__PURE__ */ o(ee, { children: e("editor.link.dialog.inline") })
528
527
  ] }),
529
528
  c.enableAlt && /* @__PURE__ */ b("div", { className: "richtext-my-[10px] ", children: [
530
- /* @__PURE__ */ o(te, { className: "mb-[6px]", children: e("editor.imageUpload.alt") }),
529
+ /* @__PURE__ */ o(ee, { className: "mb-[6px]", children: e("editor.imageUpload.alt") }),
531
530
  /* @__PURE__ */ o(
532
- ie,
531
+ Q,
533
532
  {
534
533
  onChange: (d) => M(d.target.value),
535
534
  required: !0,
@@ -538,7 +537,7 @@ function rt() {
538
537
  }
539
538
  )
540
539
  ] }),
541
- /* @__PURE__ */ b(ee, { value: "upload", children: [
540
+ /* @__PURE__ */ b(ie, { value: "upload", children: [
542
541
  /* @__PURE__ */ b("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
543
542
  /* @__PURE__ */ o(
544
543
  B,
@@ -567,7 +566,7 @@ function rt() {
567
566
  editor: a,
568
567
  imageInline: A,
569
568
  onClose: () => {
570
- Me.setOpen(a.id, !1), M("");
569
+ Se.setOpen(a.id, !1), M("");
571
570
  }
572
571
  }
573
572
  )
@@ -584,9 +583,9 @@ function rt() {
584
583
  }
585
584
  )
586
585
  ] }),
587
- /* @__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: [
586
+ /* @__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
587
  /* @__PURE__ */ o(
589
- ie,
588
+ Q,
590
589
  {
591
590
  autoFocus: !0,
592
591
  onChange: (d) => k(d.target.value),
@@ -825,5 +824,5 @@ const De = {
825
824
  });
826
825
  export {
827
826
  G as Image,
828
- rt as RichTextImage
827
+ nt as RichTextImage
829
828
  };
package/lib/ImageGif.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./index-DLqogznp.cjs"),N=require("./throttle-DXN-aiH5.cjs"),l=require("react/jsx-runtime"),u=require("react"),G=require("./index-FSRjMsxW.cjs"),L=require("./isNumber-C2saEiG2.cjs"),W=require("./toggle-DVCNvcqp.cjs");require("./index-CNzHZDls.cjs");const k=require("./useButtonProps-bei1vI37.cjs"),P=require("./popover-CZWSQZ0q.cjs"),D=require("./input-tU3H__39.cjs"),S={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function B(e){var z,C;const[t,r]=u.useState({width:G.IMAGE_MAX_SIZE,height:G.IMAGE_MAX_SIZE}),[c,i]=u.useState({width:0,height:0}),[n]=u.useState([S.TOP_LEFT,S.TOP_RIGHT,S.BOTTOM_LEFT,S.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:x}=(z=e==null?void 0:e.node)==null?void 0:z.attrs,m=u.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,d=L.isNumber(M)?`${M}px`:M;return{src:o||void 0,alt:f||void 0,style:{width:A||void 0,height:d||void 0}}},[(C=e==null?void 0:e.node)==null?void 0:C.attrs]),T=u.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=u.useCallback(N.throttle(()=>{const{editor:o}=e,{width:f}=getComputedStyle(o.view.dom);r(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 d=Number(e.node.attrs.width),v=Number(e.node.attrs.height);const I=t.width;d&&!v?(d=d>I?I:d,v=Math.round(d/A)):v&&!d?(d=Math.round(v*A),d=d>I?I:d):!d&&!v?(d=w>I?I:w,v=Math.round(d/A)):d=d>I?I:d,a(!0),b({x:o.clientX,y:o.clientY,w:d,h:v,dir:f})}const j=u.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),d=L.clamp(w+A,G.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},G.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),E=u.useCallback(o=>{o.preventDefault(),o.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),_())},[s,_]),q=u.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",E,!0)},[j,E]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",E,!0)},[j,E]);u.useEffect(()=>(s?q():O(),()=>{O()}),[s,q,O]);const R=u.useMemo(()=>new ResizeObserver(()=>y()),[y]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx($.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:n==null?void 0:n.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 r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(c=r==null?void 0:r.data)==null?void 0:c.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.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(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function X(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[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(n=>{var s,a,h,b,x,m,T,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(x=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:x[0],height:(g=(T=(m=n==null?void 0:n.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:r,children:c}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=k.useToggleActive(),b=u.useRef(null),{searchTrending:x,searchWord:m}=Z(r,t);u.useEffect(()=>{(async()=>{const g=await x();a(g)})()},[]);const T=u.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:n,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),n(!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:r,tooltip:c,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=k.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(U,{apiKey:i,provider:n,selectImage:a,children:l.jsx(W.ActionButton,{disabled:s,icon:r,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:r,t:c})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.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:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return $.ReactNodeViewRenderer(B)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",$.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=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:r?Number.parseInt(r,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 $=require("./index-BBNITgNi.cjs"),N=require("./throttle-BM3Bmbf_.cjs"),l=require("react/jsx-runtime"),u=require("react"),G=require("./index-FSRjMsxW.cjs"),L=require("./isNumber-Bv1Qhmw8.cjs"),W=require("./index-BFXkgG1P.cjs"),D=require("./input-CZUkD6wF.cjs"),P=require("./popover-BWYZO_fD.cjs"),k=require("./useButtonProps-B0riSJs9.cjs"),S={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function B(e){var C,q;const[t,r]=u.useState({width:G.IMAGE_MAX_SIZE,height:G.IMAGE_MAX_SIZE}),[c,i]=u.useState({width:0,height:0}),[n]=u.useState([S.TOP_LEFT,S.TOP_RIGHT,S.BOTTOM_LEFT,S.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.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=u.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,d=L.isNumber(M)?`${M}px`:M;return{src:o||void 0,alt:f||void 0,style:{width:A||void 0,height:d||void 0}}},[(q=e==null?void 0:e.node)==null?void 0:q.attrs]),T=u.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=u.useCallback(N.throttle(()=>{const{editor:o}=e,{width:f}=getComputedStyle(o.view.dom);r(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 d=Number(e.node.attrs.width),v=Number(e.node.attrs.height);const I=t.width;d&&!v?(d=d>I?I:d,v=Math.round(d/A)):v&&!d?(d=Math.round(v*A),d=d>I?I:d):!d&&!v?(d=w>I?I:w,v=Math.round(d/A)):d=d>I?I:d,a(!0),b({x:o.clientX,y:o.clientY,w:d,h:v,dir:f})}const j=u.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),d=L.clamp(w+A,G.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},G.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),E=u.useCallback(o=>{o.preventDefault(),o.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),_())},[s,_]),z=u.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",E,!0)},[j,E]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",E,!0)},[j,E]);u.useEffect(()=>(s?z():O(),()=>{O()}),[s,z,O]);const R=u.useMemo(()=>new ResizeObserver(()=>y()),[y]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx($.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:n==null?void 0:n.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 r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(c=r==null?void 0:r.data)==null?void 0:c.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.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(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function X(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[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(n=>{var s,a,h,b,x,m,T,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(x=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:x[0],height:(g=(T=(m=n==null?void 0:n.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:r,children:c}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=k.useToggleActive(),b=u.useRef(null),{searchTrending:x,searchWord:m}=Z(r,t);u.useEffect(()=>{(async()=>{const g=await x();a(g)})()},[]);const T=u.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:n,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),n(!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:r,tooltip:c,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=k.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(U,{apiKey:i,provider:n,selectImage:a,children:l.jsx(W.ActionButton,{disabled:s,icon:r,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:r,t:c})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.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:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return $.ReactNodeViewRenderer(B)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",$.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=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:r?Number.parseInt(r,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,14 +1,13 @@
1
- import { s as B, m as q, R as V } from "./index-nFjllrEl.js";
2
- import { a as H, d as X, c as Y } from "./throttle-CGM5M2yG.js";
3
- import { jsx as u, jsxs as P, Fragment as Z } from "react/jsx-runtime";
4
- import { useState as G, useMemo as L, useCallback as M, useEffect as z, useRef as U } from "react";
1
+ import { s as B, m as q, R as V } from "./index-CbIQPoF6.js";
2
+ import { a as H, d as X, c as Y } from "./throttle-BIkZV3Y_.js";
3
+ import { jsx as u, jsxs as p, Fragment as Z } from "react/jsx-runtime";
4
+ import { useState as G, useMemo as P, useCallback as M, useEffect as z, useRef as U } from "react";
5
5
  import { I as C, j, k as J } from "./index-0OnGZkVF.js";
6
- import { i as W, c as Q } from "./isNumber-CTm1pIvN.js";
7
- import { A as K } from "./toggle-xchtz-Kf.js";
8
- import "./index-DuZCJJSp.js";
9
- import { u as ee, a as D } from "./useButtonProps-D0SrPzuG.js";
10
- import { P as te, a as re, b as ne } from "./popover-CoepUobG.js";
11
- import { I as ie } from "./input-DfqFAyKo.js";
6
+ import { i as W, c as Q } from "./isNumber-8HKEgTkA.js";
7
+ import { A as K } from "./index-pgx8gyoC.js";
8
+ import { I as ee } from "./input-cclJoUeC.js";
9
+ import { P as te, a as re, b as ne } from "./popover-D5YZPv2r.js";
10
+ import { u as ie, a as D } from "./useButtonProps-StwAz7Ha.js";
12
11
  const O = {
13
12
  TOP_LEFT: "tl",
14
13
  TOP_RIGHT: "tr",
@@ -34,7 +33,7 @@ function ae(e) {
34
33
  w: 0,
35
34
  h: 0,
36
35
  dir: ""
37
- }), { align: b } = ($ = e == null ? void 0 : e.node) == null ? void 0 : $.attrs, g = L(() => {
36
+ }), { align: b } = ($ = e == null ? void 0 : e.node) == null ? void 0 : $.attrs, g = P(() => {
38
37
  var w;
39
38
  const { src: o, alt: m, width: f, height: x } = (w = e == null ? void 0 : e.node) == null ? void 0 : w.attrs, A = W(f) ? `${f}px` : f, d = W(x) ? `${x}px` : x;
40
39
  return {
@@ -45,7 +44,7 @@ function ae(e) {
45
44
  height: d || void 0
46
45
  }
47
46
  };
48
- }, [(k = e == null ? void 0 : e.node) == null ? void 0 : k.attrs]), _ = L(() => {
47
+ }, [(k = e == null ? void 0 : e.node) == null ? void 0 : k.attrs]), _ = P(() => {
49
48
  const {
50
49
  style: { width: o }
51
50
  } = g;
@@ -114,15 +113,15 @@ function ae(e) {
114
113
  z(() => (a ? R() : S(), () => {
115
114
  S();
116
115
  }), [a, R, S]);
117
- const p = L(() => new ResizeObserver(() => T()), [T]);
118
- return z(() => (p.observe(e.editor.view.dom), () => {
119
- p.disconnect();
120
- }), [e.editor.view.dom, p]), /* @__PURE__ */ u(
116
+ const L = P(() => new ResizeObserver(() => T()), [T]);
117
+ return z(() => (L.observe(e.editor.view.dom), () => {
118
+ L.disconnect();
119
+ }), [e.editor.view.dom, L]), /* @__PURE__ */ u(
121
120
  B,
122
121
  {
123
122
  className: "image-view",
124
123
  style: { ..._, width: "100%", textAlign: b },
125
- children: /* @__PURE__ */ P(
124
+ children: /* @__PURE__ */ p(
126
125
  "div",
127
126
  {
128
127
  "data-drag-handle": !0,
@@ -235,7 +234,7 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
235
234
  // Adjust the debounce delay as needed
236
235
  []
237
236
  );
238
- return /* @__PURE__ */ P(
237
+ return /* @__PURE__ */ p(
239
238
  te,
240
239
  {
241
240
  modal: !0,
@@ -257,9 +256,9 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
257
256
  className: "richtext-size-full richtext-p-2",
258
257
  hideWhenDetached: !0,
259
258
  side: "bottom",
260
- children: t ? /* @__PURE__ */ P(Z, { children: [
259
+ children: t ? /* @__PURE__ */ p(Z, { children: [
261
260
  /* @__PURE__ */ u("div", { className: "richtext-mb-[10px] richtext-w-full", children: /* @__PURE__ */ u(
262
- ie,
261
+ ee,
263
262
  {
264
263
  onChange: _,
265
264
  placeholder: "Search GIF",
@@ -286,8 +285,8 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
286
285
  }
287
286
  );
288
287
  }
289
- function Ae() {
290
- const e = ee(ue.name), {
288
+ function xe() {
289
+ const e = ie(ue.name), {
291
290
  action: t,
292
291
  icon: n,
293
292
  tooltip: c,
@@ -429,5 +428,5 @@ const ue = /* @__PURE__ */ Y.extend({
429
428
  });
430
429
  export {
431
430
  ue as ImageGif,
432
- Ae as RichTextImageGif
431
+ xe as RichTextImageGif
433
432
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Cs=require("./index-DLqogznp.cjs"),Wn=require("react/jsx-runtime"),xa=require("react"),nn=require("./_commonjsHelpers-BTDuMlIz.cjs"),Ss=require("./toggle-DVCNvcqp.cjs");require("./index-CNzHZDls.cjs");const Xn=require("./useButtonProps-bei1vI37.cjs"),Bs=require("./index-FSRjMsxW.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 $t=Le("String"),Ri=Le("Number"),Gc=Le("Date"),Zc=Le("RegExp"),Yc=Le("Error"),Oi=Le("Symbol"),Ni=Le("ArrayBuffer");var $c=Le("Function"),qs=_a.document&&_a.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof qs!="function"&&($c=function(e){return typeof e=="function"||!1});const Ie=$c,Kc=Le("Object");var Qc=Os&&(!/\[native code\]/.test(String(DataView))||Kc(new DataView(new ArrayBuffer(8)))),Ii=typeof Map<"u"&&Kc(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 Kt=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)||$t(e)||Kt(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 $i(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 Ki(e,n,t){var r=$i(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 $i(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 Ki(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),$s=Vi(Tu),Eu=Uu($s),Au=Ae.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var vr=/(.)^/,Ks={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qs=/\\|'|\r|\n|\u2028|\u2029/g;function Js(e){return"\\"+Ks[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("./index-BBNITgNi.cjs"),Wn=require("react/jsx-runtime"),xa=require("react"),nn=require("./_commonjsHelpers-BTDuMlIz.cjs"),Ss=require("./index-BFXkgG1P.cjs"),Bs=require("./use-toast-Bz3QCOtE.cjs"),Xn=require("./useButtonProps-B0riSJs9.cjs"),ks=require("./index-FSRjMsxW.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 $t=Le("String"),Ri=Le("Number"),Gc=Le("Date"),Zc=Le("RegExp"),Yc=Le("Error"),Oi=Le("Symbol"),Ni=Le("ArrayBuffer");var $c=Le("Function"),qs=_a.document&&_a.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof qs!="function"&&($c=function(e){return typeof e=="function"||!1});const Ie=$c,Kc=Le("Object");var Qc=Os&&(!/\[native code\]/.test(String(DataView))||Kc(new DataView(new ArrayBuffer(8)))),Ii=typeof Map<"u"&&Kc(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 Kt=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)||$t(e)||Kt(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 $i(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 Ki(e,n,t){var r=$i(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 $i(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 Ki(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),$s=Vi(Tu),Eu=Uu($s),Au=Ae.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var vr=/(.)^/,Ks={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qs=/\\|'|\r|\n|\u2028|\u2029/g;function Js(e){return"\\"+Ks[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),$=n.Parser(),T=$.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 $l(){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 Kl=$l();const Ql=nn.getDefaultExportFromCjs(Kl);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 $=[];for(const W of S){const x=W.getAttribute("src"),q=Jl(x,"image/jpeg"),R=ef(q,"image.jpeg");$.push(R)}const T=await I.upload($);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 $l(){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 Kl=$l();const Ql=nn.getDefaultExportFromCjs(Kl);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 $=[];for(const W of S){const x=W.getAttribute("src"),q=Jl(x,"image/jpeg"),R=ef(q,"image.jpeg");$.push(R)}const T=await I.upload($);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,12 +1,11 @@
1
- import { E as Fs } from "./index-nFjllrEl.js";
1
+ import { E as Fs } from "./index-CbIQPoF6.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-xchtz-Kf.js";
6
- import "./index-DuZCJJSp.js";
7
- import { c as Ns, u as Os, a as Is, d as Ls, j as Ms } from "./useButtonProps-D0SrPzuG.js";
8
- import { u as qs } from "./index-0OnGZkVF.js";
9
- import { u as Ps } from "./use-toast-Crf7-q5H.js";
5
+ import { A as Rs } from "./index-pgx8gyoC.js";
6
+ import { u as Ns } from "./use-toast-Crf7-q5H.js";
7
+ import { c as Os, u as Is, a as Ls, d as Ms, h as qs } from "./useButtonProps-StwAz7Ha.js";
8
+ import { u as Ps } from "./index-0OnGZkVF.js";
10
9
  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 = [
11
10
  "valueOf",
12
11
  "isPrototypeOf",
@@ -16549,8 +16548,8 @@ function sf(e, n) {
16549
16548
  function df(e, n) {
16550
16549
  return new File([e], n, { type: e.type });
16551
16550
  }
16552
- function vf() {
16553
- const e = Ns(), n = Os(Pc.name), {
16551
+ function Df() {
16552
+ const e = Os(), n = Is(Pc.name), {
16554
16553
  icon: t = void 0,
16555
16554
  tooltip: r = void 0,
16556
16555
  tooltipOptions: c = {},
@@ -16558,7 +16557,7 @@ function vf() {
16558
16557
  mammothOptions: o,
16559
16558
  limit: a,
16560
16559
  convert: u
16561
- } = (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);
16560
+ } = (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
16561
  function s() {
16563
16562
  var _;
16564
16563
  (_ = l.current) == null || _.click();
@@ -16580,7 +16579,7 @@ function vf() {
16580
16579
  const E = new DOMParser().parseFromString(_, "text/html"), S = E.querySelectorAll("img");
16581
16580
  if (S.length === 0)
16582
16581
  return E.body.innerHTML;
16583
- if (Ms(e, "image")) {
16582
+ if (qs(e, "image")) {
16584
16583
  const I = b == null ? void 0 : b.options;
16585
16584
  if (I && typeof I.upload == "function") {
16586
16585
  const K = [];
@@ -16679,5 +16678,5 @@ const Pc = /* @__PURE__ */ Fs.create({
16679
16678
  });
16680
16679
  export {
16681
16680
  Pc as ImportWord,
16682
- vf as RichTextImportWord
16681
+ Df as RichTextImportWord
16683
16682
  };