reactjs-tiptap-editor 0.3.30 → 0.3.31

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 (224) hide show
  1. package/lib/{ActionMenuButton-wiDnIxE2.cjs → ActionMenuButton-BCgqJsST.cjs} +1 -1
  2. package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-D97K0UWT.js} +5 -5
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +15 -15
  5. package/lib/Attachment.d.ts +15 -15
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +15 -15
  9. package/lib/Blockquote.d.ts +15 -15
  10. package/lib/Blockquote.js +1 -1
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +15 -15
  13. package/lib/Bold.d.ts +15 -15
  14. package/lib/Bold.js +1 -1
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +15 -15
  17. package/lib/BulletList.d.ts +15 -15
  18. package/lib/BulletList.js +1 -1
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +15 -15
  21. package/lib/Clear.d.ts +15 -15
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +15 -15
  25. package/lib/Code.d.ts +15 -15
  26. package/lib/Code.js +1 -1
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +15 -15
  29. package/lib/CodeBlock.d.ts +15 -15
  30. package/lib/CodeBlock.js +3 -2
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +15 -15
  33. package/lib/CodeView.d.ts +15 -15
  34. package/lib/CodeView.js +1 -1
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +15 -15
  37. package/lib/Color.d.ts +15 -15
  38. package/lib/Color.js +2 -2
  39. package/lib/Document.d.cts +15 -15
  40. package/lib/Document.d.ts +15 -15
  41. package/lib/Drawer-5Q_-WRhc.cjs +1 -0
  42. package/lib/{Drawer-BKTU9CpU.js → Drawer-BHkje8ys.js} +250 -249
  43. package/lib/Drawer.cjs +1 -1
  44. package/lib/Drawer.d.cts +15 -15
  45. package/lib/Drawer.d.ts +15 -15
  46. package/lib/Drawer.js +2 -2
  47. package/lib/Emoji.cjs +1 -1
  48. package/lib/Emoji.d.cts +15 -15
  49. package/lib/Emoji.d.ts +15 -15
  50. package/lib/Emoji.js +22 -21
  51. package/lib/Excalidraw-CG498239.js +290 -0
  52. package/lib/Excalidraw-GUVW-IqC.cjs +1 -0
  53. package/lib/Excalidraw.cjs +1 -1
  54. package/lib/Excalidraw.d.cts +15 -15
  55. package/lib/Excalidraw.d.ts +15 -15
  56. package/lib/Excalidraw.js +1 -1
  57. package/lib/ExportPdf.cjs +1 -1
  58. package/lib/ExportPdf.d.cts +15 -15
  59. package/lib/ExportPdf.d.ts +15 -15
  60. package/lib/ExportPdf.js +1 -1
  61. package/lib/ExportWord.cjs +1 -1
  62. package/lib/ExportWord.d.cts +15 -15
  63. package/lib/ExportWord.d.ts +15 -15
  64. package/lib/ExportWord.js +1 -1
  65. package/lib/FontFamily.cjs +1 -1
  66. package/lib/FontFamily.d.cts +15 -15
  67. package/lib/FontFamily.d.ts +15 -15
  68. package/lib/FontFamily.js +11 -10
  69. package/lib/FontSize.cjs +1 -1
  70. package/lib/FontSize.d.cts +15 -15
  71. package/lib/FontSize.d.ts +15 -15
  72. package/lib/FontSize.js +6 -5
  73. package/lib/FormatPainter.cjs +1 -1
  74. package/lib/FormatPainter.d.cts +15 -15
  75. package/lib/FormatPainter.d.ts +15 -15
  76. package/lib/FormatPainter.js +1 -1
  77. package/lib/Heading.cjs +1 -1
  78. package/lib/Heading.d.cts +15 -15
  79. package/lib/Heading.d.ts +15 -15
  80. package/lib/Heading.js +32 -31
  81. package/lib/Highlight.cjs +1 -1
  82. package/lib/Highlight.d.cts +15 -15
  83. package/lib/Highlight.d.ts +15 -15
  84. package/lib/Highlight.js +1 -1
  85. package/lib/History.cjs +1 -1
  86. package/lib/History.d.cts +15 -15
  87. package/lib/History.d.ts +15 -15
  88. package/lib/History.js +1 -1
  89. package/lib/HorizontalRule.cjs +1 -1
  90. package/lib/HorizontalRule.d.cts +15 -15
  91. package/lib/HorizontalRule.d.ts +15 -15
  92. package/lib/HorizontalRule.js +1 -1
  93. package/lib/Iframe.cjs +1 -1
  94. package/lib/Iframe.d.cts +15 -15
  95. package/lib/Iframe.d.ts +15 -15
  96. package/lib/Iframe.js +1 -1
  97. package/lib/Image.cjs +1 -1
  98. package/lib/Image.d.cts +15 -15
  99. package/lib/Image.d.ts +15 -15
  100. package/lib/Image.js +1 -1
  101. package/lib/ImageGif.cjs +1 -1
  102. package/lib/ImageGif.d.cts +15 -15
  103. package/lib/ImageGif.d.ts +15 -15
  104. package/lib/ImageGif.js +1 -1
  105. package/lib/ImportWord.cjs +2 -2
  106. package/lib/ImportWord.d.cts +15 -15
  107. package/lib/ImportWord.d.ts +15 -15
  108. package/lib/ImportWord.js +3 -2
  109. package/lib/Indent.cjs +1 -1
  110. package/lib/Indent.d.cts +15 -15
  111. package/lib/Indent.d.ts +15 -15
  112. package/lib/Indent.js +1 -1
  113. package/lib/Italic.cjs +1 -1
  114. package/lib/Italic.d.cts +15 -15
  115. package/lib/Italic.d.ts +15 -15
  116. package/lib/Italic.js +1 -1
  117. package/lib/Katex.cjs +1 -1
  118. package/lib/Katex.d.cts +15 -15
  119. package/lib/Katex.d.ts +15 -15
  120. package/lib/Katex.js +41 -40
  121. package/lib/LineHeight.cjs +1 -1
  122. package/lib/LineHeight.d.cts +15 -15
  123. package/lib/LineHeight.d.ts +15 -15
  124. package/lib/LineHeight.js +17 -16
  125. package/lib/Link.cjs +1 -1
  126. package/lib/Link.d.cts +15 -15
  127. package/lib/Link.d.ts +15 -15
  128. package/lib/Link.js +1 -1
  129. package/lib/ListItem.d.cts +15 -15
  130. package/lib/ListItem.d.ts +15 -15
  131. package/lib/Mention.d.cts +15 -15
  132. package/lib/Mention.d.ts +15 -15
  133. package/lib/Mermaid.cjs +2 -2
  134. package/lib/Mermaid.d.cts +15 -15
  135. package/lib/Mermaid.d.ts +15 -15
  136. package/lib/Mermaid.js +138 -137
  137. package/lib/MoreMark.cjs +1 -1
  138. package/lib/MoreMark.d.cts +15 -15
  139. package/lib/MoreMark.d.ts +15 -15
  140. package/lib/MoreMark.js +1 -1
  141. package/lib/MultiColumn.cjs +1 -1
  142. package/lib/MultiColumn.d.cts +15 -15
  143. package/lib/MultiColumn.d.ts +15 -15
  144. package/lib/MultiColumn.js +1 -1
  145. package/lib/OrderedList.cjs +1 -1
  146. package/lib/OrderedList.d.cts +15 -15
  147. package/lib/OrderedList.d.ts +15 -15
  148. package/lib/OrderedList.js +1 -1
  149. package/lib/{RichTextEditor-C8Sm1E6J.cjs → RichTextEditor-DWlLqTl9.cjs} +4 -4
  150. package/lib/{RichTextEditor-BQN2eLD_.js → RichTextEditor-KP2Rgcqe.js} +15 -39
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +15 -15
  153. package/lib/SearchAndReplace.d.ts +15 -15
  154. package/lib/SearchAndReplace.js +68 -67
  155. package/lib/Selection.d.cts +15 -15
  156. package/lib/Selection.d.ts +15 -15
  157. package/lib/SlashCommand.cjs +1 -1
  158. package/lib/SlashCommand.d.cts +15 -15
  159. package/lib/SlashCommand.d.ts +15 -15
  160. package/lib/SlashCommand.js +1 -1
  161. package/lib/Strike.cjs +1 -1
  162. package/lib/Strike.d.cts +15 -15
  163. package/lib/Strike.d.ts +15 -15
  164. package/lib/Strike.js +1 -1
  165. package/lib/SubAndSuperScript.cjs +1 -1
  166. package/lib/SubAndSuperScript.d.cts +15 -15
  167. package/lib/SubAndSuperScript.d.ts +15 -15
  168. package/lib/SubAndSuperScript.js +1 -1
  169. package/lib/Table.cjs +1 -1
  170. package/lib/Table.d.cts +15 -15
  171. package/lib/Table.d.ts +15 -15
  172. package/lib/Table.js +2 -1
  173. package/lib/TableOfContent.cjs +1 -1
  174. package/lib/TableOfContent.d.cts +15 -15
  175. package/lib/TableOfContent.d.ts +15 -15
  176. package/lib/TableOfContent.js +50 -49
  177. package/lib/TaskList.cjs +1 -1
  178. package/lib/TaskList.d.cts +15 -15
  179. package/lib/TaskList.d.ts +15 -15
  180. package/lib/TaskList.js +1 -1
  181. package/lib/TextAlign.cjs +1 -1
  182. package/lib/TextAlign.d.cts +15 -15
  183. package/lib/TextAlign.d.ts +15 -15
  184. package/lib/TextAlign.js +8 -7
  185. package/lib/TextBubble.cjs +1 -1
  186. package/lib/TextBubble.d.cts +15 -15
  187. package/lib/TextBubble.d.ts +15 -15
  188. package/lib/TextBubble.js +1 -1
  189. package/lib/TextDirection.cjs +1 -1
  190. package/lib/TextDirection.d.cts +15 -15
  191. package/lib/TextDirection.d.ts +15 -15
  192. package/lib/TextDirection.js +14 -13
  193. package/lib/TextUnderline.cjs +1 -1
  194. package/lib/TextUnderline.d.cts +15 -15
  195. package/lib/TextUnderline.d.ts +15 -15
  196. package/lib/TextUnderline.js +1 -1
  197. package/lib/TrailingNode.d.cts +15 -15
  198. package/lib/TrailingNode.d.ts +15 -15
  199. package/lib/{Twitter-Dg6WWauX.js → Twitter-99ivY5qv.js} +62 -61
  200. package/lib/{Twitter-CL2pu4QM.cjs → Twitter-BvfvUtNT.cjs} +2 -2
  201. package/lib/Twitter.cjs +1 -1
  202. package/lib/Twitter.d.cts +15 -15
  203. package/lib/Twitter.d.ts +15 -15
  204. package/lib/Twitter.js +1 -1
  205. package/lib/Video.cjs +1 -1
  206. package/lib/Video.d.cts +15 -15
  207. package/lib/Video.d.ts +15 -15
  208. package/lib/Video.js +1 -1
  209. package/lib/bubble-extra.cjs +1 -1
  210. package/lib/bubble-extra.d.cts +15 -15
  211. package/lib/bubble-extra.d.ts +15 -15
  212. package/lib/bubble-extra.js +5 -5
  213. package/lib/index.cjs +1 -1
  214. package/lib/index.d.cts +16 -15
  215. package/lib/index.d.ts +16 -15
  216. package/lib/index.js +2 -2
  217. package/lib/locale-bundle.d.cts +15 -15
  218. package/lib/locale-bundle.d.ts +15 -15
  219. package/lib/{textarea-BglwYF6b.js → textarea-CktfkXNe.js} +1 -1
  220. package/lib/{textarea-D5WVZMgt.cjs → textarea-DdH64g04.cjs} +1 -1
  221. package/package.json +1 -1
  222. package/lib/Drawer-CmoEF-Zg.cjs +0 -1
  223. package/lib/Excalidraw-CM74U5tG.js +0 -289
  224. package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
@@ -1,8 +1,8 @@
1
1
  import { h as j, m as te } from "./index-DI9T3iLd.js";
2
- import { d, w as re, x as oe, A as le, y as ne, z as ie, F as se, B as ae, G as ce, J as Z, K as he, N as ue } from "./RichTextEditor-BQN2eLD_.js";
2
+ import { d, w as re, x as oe, A as le, y as ne, z as ie, F as se, B as ae, G as ce, J as Z, K as he, N as ue } from "./RichTextEditor-KP2Rgcqe.js";
3
3
  import { N as de, R as ge } from "./dom-dataset-Di3tIRrR.js";
4
- import { jsx as e, jsxs as x, Fragment as Y } from "react/jsx-runtime";
5
- import { useState as y, useRef as X, useEffect as O, useMemo as D, useCallback as q } from "react";
4
+ import { jsx as e, jsxs as y, Fragment as Y } from "react/jsx-runtime";
5
+ import { useState as M, useRef as X, useEffect as V, useMemo as O, useCallback as P } from "react";
6
6
  import { Color4 as g, Editor as me, makeDropdownToolbar as pe } from "easydrawer";
7
7
  import { s as we, i as ve } from "./shortId-WJVkrvml.js";
8
8
  import { I as K, i as fe, j as J } from "./index-CsK90iVd.js";
@@ -99,7 +99,7 @@ function ke(t) {
99
99
  );
100
100
  }
101
101
  function _e(t) {
102
- return /* @__PURE__ */ x(
102
+ return /* @__PURE__ */ y(
103
103
  "svg",
104
104
  {
105
105
  height: "1em",
@@ -234,7 +234,7 @@ function Ie(t) {
234
234
  width: "1em",
235
235
  xmlns: "http://www.w3.org/2000/svg",
236
236
  ...t,
237
- children: /* @__PURE__ */ x(
237
+ children: /* @__PURE__ */ y(
238
238
  "g",
239
239
  {
240
240
  fill: "none",
@@ -456,8 +456,8 @@ const Ze = [
456
456
  g.fromHex("#AADC99")
457
457
  ];
458
458
  function Xe({ onChange: t }) {
459
- const [r, o] = y(g.blackHighlight);
460
- return /* @__PURE__ */ e("div", { className: l.colorWrap, children: Ze.map((i, s) => /* @__PURE__ */ e(
459
+ const [r, o] = M(g.blackHighlight);
460
+ return /* @__PURE__ */ e("div", { className: l.colorWrap, children: Ze.map((i, m) => /* @__PURE__ */ e(
461
461
  "button",
462
462
  {
463
463
  style: { backgroundColor: i.toHexString() },
@@ -468,13 +468,13 @@ function Xe({ onChange: t }) {
468
468
  o(i), t(i);
469
469
  }
470
470
  },
471
- s
471
+ m
472
472
  )) });
473
473
  }
474
- function V({ onChange: t }) {
475
- const [r, o] = y(g.black);
476
- return /* @__PURE__ */ x(Y, { children: [
477
- /* @__PURE__ */ e("div", { className: l.colorWrap, children: Q.slice(0, 7).map((i, s) => /* @__PURE__ */ e(
474
+ function G({ onChange: t }) {
475
+ const [r, o] = M(g.black);
476
+ return /* @__PURE__ */ y(Y, { children: [
477
+ /* @__PURE__ */ e("div", { className: l.colorWrap, children: Q.slice(0, 7).map((i, m) => /* @__PURE__ */ e(
478
478
  "button",
479
479
  {
480
480
  style: { backgroundColor: i.toHexString() },
@@ -485,9 +485,9 @@ function V({ onChange: t }) {
485
485
  o(i), t(i);
486
486
  }
487
487
  },
488
- s
488
+ m
489
489
  )) }),
490
- /* @__PURE__ */ e("div", { className: l.colorWrap, children: Q.slice(7).map((i, s) => /* @__PURE__ */ e(
490
+ /* @__PURE__ */ e("div", { className: l.colorWrap, children: Q.slice(7).map((i, m) => /* @__PURE__ */ e(
491
491
  "button",
492
492
  {
493
493
  style: { backgroundColor: i.toHexString() },
@@ -498,17 +498,17 @@ function V({ onChange: t }) {
498
498
  o(i), t(i);
499
499
  }
500
500
  },
501
- s
501
+ m
502
502
  )) })
503
503
  ] });
504
504
  }
505
505
  function Ke({ setColorPen: t, setThicknessPen: r }) {
506
- const [o, i] = y(2);
507
- return /* @__PURE__ */ x("div", { className: l.options, children: [
506
+ const [o, i] = M(2);
507
+ return /* @__PURE__ */ y("div", { className: l.options, children: [
508
508
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
509
- V,
509
+ G,
510
510
  {
511
- onChange: (s) => t(s)
511
+ onChange: (m) => t(m)
512
512
  }
513
513
  ) }),
514
514
  /* @__PURE__ */ e("div", { className: l.line }),
@@ -520,8 +520,8 @@ function Ke({ setColorPen: t, setThicknessPen: r }) {
520
520
  step: 0.1,
521
521
  type: "range",
522
522
  value: o,
523
- onChange: (s) => {
524
- r(Number.parseFloat(s.target.value)), i(Number.parseFloat(s.target.value));
523
+ onChange: (m) => {
524
+ r(Number.parseFloat(m.target.value)), i(Number.parseFloat(m.target.value));
525
525
  }
526
526
  }
527
527
  ) })
@@ -540,16 +540,16 @@ function Qe({
540
540
  changeBorderColorShape: r,
541
541
  onThicknessChange: o
542
542
  }) {
543
- return /* @__PURE__ */ x("div", { className: l.options, children: [
543
+ return /* @__PURE__ */ y("div", { className: l.options, children: [
544
544
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
545
- V,
545
+ G,
546
546
  {
547
547
  onChange: (i) => t(i)
548
548
  }
549
549
  ) }),
550
550
  /* @__PURE__ */ e("div", { className: l.line }),
551
551
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
552
- V,
552
+ G,
553
553
  {
554
554
  onChange: (i) => r(i)
555
555
  }
@@ -575,37 +575,37 @@ function Ye(t) {
575
575
  setColorPen: r,
576
576
  refEditor: o,
577
577
  setThicknessPen: i,
578
- setColorHighlight: s,
579
- changeBorderColorShape: C,
580
- onUndo: P,
581
- changeColorShape: _,
582
- changeShape: f,
583
- onThicknessChange: S,
584
- onRedo: b,
585
- onClear: A
586
- } = t, [a, h] = y(null), [T, m] = y(
578
+ setColorHighlight: m,
579
+ changeBorderColorShape: p,
580
+ onUndo: b,
581
+ changeColorShape: A,
582
+ changeShape: T,
583
+ onThicknessChange: z,
584
+ onRedo: x,
585
+ onClear: B
586
+ } = t, [s, c] = M(null), [C, v] = M(
587
587
  0
588
588
  /* square */
589
589
  );
590
- return /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ x(
590
+ return /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ y(
591
591
  "div",
592
592
  {
593
593
  className: l.wrapper,
594
594
  children: [
595
- /* @__PURE__ */ x("div", { className: l.pen, children: [
595
+ /* @__PURE__ */ y("div", { className: l.pen, children: [
596
596
  /* @__PURE__ */ e(
597
597
  "button",
598
598
  {
599
599
  className: d(l.tool, {
600
- [l.active]: a === "select"
600
+ [l.active]: s === "select"
601
601
  }),
602
602
  onClick: () => {
603
603
  const n = o.current.toolController.getPrimaryTools();
604
- if (a === "select") {
605
- h(null), n[0].setEnabled(!1);
604
+ if (s === "select") {
605
+ c(null), n[0].setEnabled(!1);
606
606
  return;
607
607
  }
608
- h("select"), n[0].setEnabled(!0);
608
+ c("select"), n[0].setEnabled(!0);
609
609
  },
610
610
  children: /* @__PURE__ */ e(Ne, {})
611
611
  }
@@ -615,15 +615,15 @@ function Ye(t) {
615
615
  "button",
616
616
  {
617
617
  className: d(l.tool, {
618
- [l.active]: a === "text"
618
+ [l.active]: s === "text"
619
619
  }),
620
620
  onClick: () => {
621
621
  const n = o.current.toolController.getPrimaryTools();
622
- if (o.current.toolController.setToolEnabled(n[1]), a === "text") {
623
- n[1].setEnabled(!1), h(null);
622
+ if (o.current.toolController.setToolEnabled(n[1]), s === "text") {
623
+ n[1].setEnabled(!1), c(null);
624
624
  return;
625
625
  }
626
- h("text"), n[1].setEnabled(!0);
626
+ c("text"), n[1].setEnabled(!0);
627
627
  },
628
628
  children: /* @__PURE__ */ e(Se, {})
629
629
  }
@@ -633,15 +633,15 @@ function Ye(t) {
633
633
  "button",
634
634
  {
635
635
  className: d(l.tool, {
636
- [l.active]: a === "pencil"
636
+ [l.active]: s === "pencil"
637
637
  }),
638
638
  onClick: () => {
639
639
  const n = o.current.toolController.getPrimaryTools();
640
- if (a === "pencil") {
641
- h(null), n[2].setEnabled(!1);
640
+ if (s === "pencil") {
641
+ c(null), n[2].setEnabled(!1);
642
642
  return;
643
643
  }
644
- h("pencil"), n[2].setEnabled(!0);
644
+ c("pencil"), n[2].setEnabled(!0);
645
645
  },
646
646
  children: /* @__PURE__ */ e(ze, {})
647
647
  }
@@ -650,15 +650,15 @@ function Ye(t) {
650
650
  "button",
651
651
  {
652
652
  className: d(l.tool, {
653
- [l.active]: a === "highlighter"
653
+ [l.active]: s === "highlighter"
654
654
  }),
655
655
  onClick: () => {
656
656
  const n = o.current.toolController.getPrimaryTools();
657
- if (a === "highlighter") {
658
- h(null), n[3].setEnabled(!1);
657
+ if (s === "highlighter") {
658
+ c(null), n[3].setEnabled(!1);
659
659
  return;
660
660
  }
661
- h("highlighter"), n[3].setEnabled(!0);
661
+ c("highlighter"), n[3].setEnabled(!0);
662
662
  },
663
663
  children: /* @__PURE__ */ e(ke, {})
664
664
  }
@@ -668,15 +668,15 @@ function Ye(t) {
668
668
  "button",
669
669
  {
670
670
  className: d(l.tool, {
671
- [l.active]: a === "eraser"
671
+ [l.active]: s === "eraser"
672
672
  }),
673
673
  onClick: () => {
674
674
  const n = o.current.toolController.getPrimaryTools();
675
- if (a === "eraser") {
676
- h(null), n[4].setEnabled(!1);
675
+ if (s === "eraser") {
676
+ c(null), n[4].setEnabled(!1);
677
677
  return;
678
678
  }
679
- h("eraser"), n[4].setEnabled(!0);
679
+ c("eraser"), n[4].setEnabled(!0);
680
680
  },
681
681
  children: /* @__PURE__ */ e(_e, {})
682
682
  }
@@ -686,15 +686,15 @@ function Ye(t) {
686
686
  "button",
687
687
  {
688
688
  className: d(l.tool, {
689
- [l.active]: a === "shapes" && T === 0
689
+ [l.active]: s === "shapes" && C === 0
690
690
  /* square */
691
691
  }),
692
692
  onClick: () => {
693
693
  const n = o.current.toolController.getPrimaryTools();
694
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
694
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
695
695
  0
696
696
  /* square */
697
- ), m(
697
+ ), v(
698
698
  0
699
699
  /* square */
700
700
  );
@@ -706,15 +706,15 @@ function Ye(t) {
706
706
  "button",
707
707
  {
708
708
  className: d(l.tool, {
709
- [l.active]: a === "shapes" && T === 1
709
+ [l.active]: s === "shapes" && C === 1
710
710
  /* rectangle */
711
711
  }),
712
712
  onClick: () => {
713
713
  const n = o.current.toolController.getPrimaryTools();
714
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
714
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
715
715
  1
716
716
  /* rectangle */
717
- ), m(
717
+ ), v(
718
718
  1
719
719
  /* rectangle */
720
720
  );
@@ -726,15 +726,15 @@ function Ye(t) {
726
726
  "button",
727
727
  {
728
728
  className: d(l.tool, {
729
- [l.active]: a === "shapes" && T === 2
729
+ [l.active]: s === "shapes" && C === 2
730
730
  /* circle */
731
731
  }),
732
732
  onClick: () => {
733
733
  const n = o.current.toolController.getPrimaryTools();
734
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
734
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
735
735
  2
736
736
  /* circle */
737
- ), m(
737
+ ), v(
738
738
  2
739
739
  /* circle */
740
740
  );
@@ -746,15 +746,15 @@ function Ye(t) {
746
746
  "button",
747
747
  {
748
748
  className: d(l.tool, {
749
- [l.active]: a === "shapes" && T === 3
749
+ [l.active]: s === "shapes" && C === 3
750
750
  /* triangle */
751
751
  }),
752
752
  onClick: () => {
753
753
  const n = o.current.toolController.getPrimaryTools();
754
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
754
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
755
755
  3
756
756
  /* triangle */
757
- ), m(
757
+ ), v(
758
758
  3
759
759
  /* triangle */
760
760
  );
@@ -766,15 +766,15 @@ function Ye(t) {
766
766
  "button",
767
767
  {
768
768
  className: d(l.tool, {
769
- [l.active]: a === "shapes" && T === 4
769
+ [l.active]: s === "shapes" && C === 4
770
770
  /* hexagonal */
771
771
  }),
772
772
  onClick: () => {
773
773
  const n = o.current.toolController.getPrimaryTools();
774
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
774
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
775
775
  4
776
776
  /* hexagonal */
777
- ), m(
777
+ ), v(
778
778
  4
779
779
  /* hexagonal */
780
780
  );
@@ -786,15 +786,15 @@ function Ye(t) {
786
786
  "button",
787
787
  {
788
788
  className: d(l.tool, {
789
- [l.active]: a === "shapes" && T === 5
789
+ [l.active]: s === "shapes" && C === 5
790
790
  /* diamond */
791
791
  }),
792
792
  onClick: () => {
793
793
  const n = o.current.toolController.getPrimaryTools();
794
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
794
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
795
795
  5
796
796
  /* diamond */
797
- ), m(
797
+ ), v(
798
798
  5
799
799
  /* diamond */
800
800
  );
@@ -806,15 +806,15 @@ function Ye(t) {
806
806
  "button",
807
807
  {
808
808
  className: d(l.tool, {
809
- [l.active]: a === "shapes" && T === 6
809
+ [l.active]: s === "shapes" && C === 6
810
810
  /* arrow */
811
811
  }),
812
812
  onClick: () => {
813
813
  const n = o.current.toolController.getPrimaryTools();
814
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
814
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
815
815
  6
816
816
  /* arrow */
817
- ), m(
817
+ ), v(
818
818
  6
819
819
  /* arrow */
820
820
  );
@@ -826,15 +826,15 @@ function Ye(t) {
826
826
  "button",
827
827
  {
828
828
  className: d(l.tool, {
829
- [l.active]: a === "shapes" && T === 7
829
+ [l.active]: s === "shapes" && C === 7
830
830
  /* line */
831
831
  }),
832
832
  onClick: () => {
833
833
  const n = o.current.toolController.getPrimaryTools();
834
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
834
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
835
835
  7
836
836
  /* line */
837
- ), m(
837
+ ), v(
838
838
  7
839
839
  /* line */
840
840
  );
@@ -846,15 +846,15 @@ function Ye(t) {
846
846
  "button",
847
847
  {
848
848
  className: d(l.tool, {
849
- [l.active]: a === "shapes" && T === 8
849
+ [l.active]: s === "shapes" && C === 8
850
850
  /* heart */
851
851
  }),
852
852
  onClick: () => {
853
853
  const n = o.current.toolController.getPrimaryTools();
854
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
854
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
855
855
  8
856
856
  /* heart */
857
- ), m(
857
+ ), v(
858
858
  8
859
859
  /* heart */
860
860
  );
@@ -866,15 +866,15 @@ function Ye(t) {
866
866
  "button",
867
867
  {
868
868
  className: d(l.tool, {
869
- [l.active]: a === "shapes" && T === 9
869
+ [l.active]: s === "shapes" && C === 9
870
870
  /* star */
871
871
  }),
872
872
  onClick: () => {
873
873
  const n = o.current.toolController.getPrimaryTools();
874
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
874
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
875
875
  9
876
876
  /* star */
877
- ), m(
877
+ ), v(
878
878
  9
879
879
  /* star */
880
880
  );
@@ -886,15 +886,15 @@ function Ye(t) {
886
886
  "button",
887
887
  {
888
888
  className: d(l.tool, {
889
- [l.active]: a === "shapes" && T === 10
889
+ [l.active]: s === "shapes" && C === 10
890
890
  /* cloud */
891
891
  }),
892
892
  onClick: () => {
893
893
  const n = o.current.toolController.getPrimaryTools();
894
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
894
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
895
895
  10
896
896
  /* cloud */
897
- ), m(
897
+ ), v(
898
898
  10
899
899
  /* cloud */
900
900
  );
@@ -906,15 +906,15 @@ function Ye(t) {
906
906
  "button",
907
907
  {
908
908
  className: d(l.tool, {
909
- [l.active]: a === "shapes" && T === 11
909
+ [l.active]: s === "shapes" && C === 11
910
910
  /* parallelogram */
911
911
  }),
912
912
  onClick: () => {
913
913
  const n = o.current.toolController.getPrimaryTools();
914
- o.current.toolController.setToolEnabled(n[5]), h("shapes"), n[5].setEnabled(!0), f(
914
+ o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), T(
915
915
  11
916
916
  /* parallelogram */
917
- ), m(
917
+ ), v(
918
918
  11
919
919
  /* parallelogram */
920
920
  );
@@ -927,7 +927,7 @@ function Ye(t) {
927
927
  "button",
928
928
  {
929
929
  className: d(l.tool),
930
- onClick: P,
930
+ onClick: b,
931
931
  children: /* @__PURE__ */ e(Fe, {})
932
932
  }
933
933
  ),
@@ -935,7 +935,7 @@ function Ye(t) {
935
935
  "button",
936
936
  {
937
937
  className: d(l.tool),
938
- onClick: b,
938
+ onClick: x,
939
939
  children: /* @__PURE__ */ e(De, {})
940
940
  }
941
941
  ),
@@ -943,27 +943,27 @@ function Ye(t) {
943
943
  "button",
944
944
  {
945
945
  className: d(l.tool),
946
- onClick: A,
946
+ onClick: B,
947
947
  children: /* @__PURE__ */ e(Oe, {})
948
948
  }
949
949
  )
950
950
  ] }),
951
- /* @__PURE__ */ x("div", { className: l.optionsWrap, children: [
952
- a === "pencil" && /* @__PURE__ */ e(
951
+ /* @__PURE__ */ y("div", { className: l.optionsWrap, children: [
952
+ s === "pencil" && /* @__PURE__ */ e(
953
953
  Ke,
954
954
  {
955
955
  setColorPen: r,
956
956
  setThicknessPen: i
957
957
  }
958
958
  ),
959
- a === "highlighter" && /* @__PURE__ */ e(Je, { setColorHighlight: s }),
960
- a === "shapes" && /* @__PURE__ */ e(
959
+ s === "highlighter" && /* @__PURE__ */ e(Je, { setColorHighlight: m }),
960
+ s === "shapes" && /* @__PURE__ */ e(
961
961
  Qe,
962
962
  {
963
- changeBorderColorShape: C,
964
- changeColorShape: _,
965
- changeShape: f,
966
- onThicknessChange: S
963
+ changeBorderColorShape: p,
964
+ changeColorShape: A,
965
+ changeShape: T,
966
+ onThicknessChange: z
967
967
  }
968
968
  )
969
969
  ] })
@@ -971,89 +971,90 @@ function Ye(t) {
971
971
  }
972
972
  ) });
973
973
  }
974
- let R = !1;
975
- const et = ({ editor: t, upload: r }) => {
976
- const [o, i] = y(!1), s = X(null), C = X(null), P = () => {
974
+ let q = !1;
975
+ const et = ({ editor: t, upload: r, tooltipOptions: o }) => {
976
+ const [i, m] = M(!1), p = X(null), b = X(null), A = () => {
977
977
  (async () => {
978
- const c = document.querySelector("#easydrawer");
979
- c && (s.current = new me(c, {
978
+ const a = document.querySelector("#easydrawer");
979
+ a && (p.current = new me(a, {
980
980
  wheelEventsEnabled: !1,
981
981
  disableZoom: !0
982
- }), C.current = pe(s.current), C.current.addDefaultToolWidgets());
982
+ }), b.current = pe(p.current), b.current.addDefaultToolWidgets());
983
983
  })();
984
984
  };
985
- O(() => {
986
- o && setTimeout(() => {
987
- P();
985
+ V(() => {
986
+ i && setTimeout(() => {
987
+ A();
988
988
  }, 200);
989
- }, [o]);
990
- const _ = async () => {
991
- if (s.current) {
992
- const p = s.current.toSVG(), c = p.outerHTML, w = `drawer-${we()}.svg`;
993
- let N = ve(p.outerHTML);
989
+ }, [i]);
990
+ const T = async () => {
991
+ if (p.current) {
992
+ const f = p.current.toSVG(), a = f.outerHTML, u = `drawer-${we()}.svg`;
993
+ let S = ve(f.outerHTML);
994
994
  if (r) {
995
- const B = ce(N, w);
996
- N = await r(B);
995
+ const I = ce(S, u);
996
+ S = await r(I);
997
997
  }
998
998
  t == null || t.chain().focus().setDrawer(
999
999
  {
1000
1000
  type: "drawer",
1001
- src: N,
1002
- alt: encodeURIComponent(c),
1001
+ src: S,
1002
+ alt: encodeURIComponent(a),
1003
1003
  width: 426,
1004
1004
  height: 212
1005
1005
  },
1006
- !!c
1006
+ !!a
1007
1007
  ).run();
1008
1008
  }
1009
- i(!1);
1010
- }, f = (p) => {
1011
- const c = s.current.toolController.getPrimaryTools()[2], w = C.current.getWidgetById("pen-1");
1012
- c && w && (c.setColor(p), w.serializeState());
1013
- }, S = (p) => {
1014
- const c = s.current.toolController.getPrimaryTools()[2], w = C.current.getWidgetById("pen-1");
1015
- c && w && (c.setThickness(p), w.serializeState());
1016
- }, b = (p) => {
1017
- const c = s.current.toolController.getPrimaryTools()[3], w = C.current.getWidgetById("pen-2");
1018
- c && w && (c.setColor(p), w.serializeState());
1019
- }, A = (p) => {
1020
- const c = C.current.getWidgetById("shape");
1021
- c && c.setShapeType(p);
1022
- }, a = (p) => {
1023
- const c = s.current.toolController.getPrimaryTools()[5], w = C.current.getWidgetById("shape");
1024
- c && w && (c.setColor(p), w.serializeState());
1025
- }, h = (p) => {
1026
- const c = s.current.toolController.getPrimaryTools()[5], w = C.current.getWidgetById("shape");
1027
- c && w && (c.setThickness(p), w.serializeState());
1028
- }, T = (p) => {
1029
- const c = s.current.toolController.getPrimaryTools()[5], w = C.current.getWidgetById("shape");
1030
- c && w && (c.setBorderColor(p), w.serializeState());
1031
- }, m = () => {
1032
- if (R) {
1033
- for (; s.current.history.redoStackSize > 0; )
1034
- s.current.history.redo();
1035
- R = !1;
1009
+ m(!1);
1010
+ }, z = (f) => {
1011
+ const a = p.current.toolController.getPrimaryTools()[2], u = b.current.getWidgetById("pen-1");
1012
+ a && u && (a.setColor(f), u.serializeState());
1013
+ }, x = (f) => {
1014
+ const a = p.current.toolController.getPrimaryTools()[2], u = b.current.getWidgetById("pen-1");
1015
+ a && u && (a.setThickness(f), u.serializeState());
1016
+ }, B = (f) => {
1017
+ const a = p.current.toolController.getPrimaryTools()[3], u = b.current.getWidgetById("pen-2");
1018
+ a && u && (a.setColor(f), u.serializeState());
1019
+ }, s = (f) => {
1020
+ const a = b.current.getWidgetById("shape");
1021
+ a && a.setShapeType(f);
1022
+ }, c = (f) => {
1023
+ const a = p.current.toolController.getPrimaryTools()[5], u = b.current.getWidgetById("shape");
1024
+ a && u && (a.setColor(f), u.serializeState());
1025
+ }, C = (f) => {
1026
+ const a = p.current.toolController.getPrimaryTools()[5], u = b.current.getWidgetById("shape");
1027
+ a && u && (a.setThickness(f), u.serializeState());
1028
+ }, v = (f) => {
1029
+ const a = p.current.toolController.getPrimaryTools()[5], u = b.current.getWidgetById("shape");
1030
+ a && u && (a.setBorderColor(f), u.serializeState());
1031
+ }, n = () => {
1032
+ if (q) {
1033
+ for (; p.current.history.redoStackSize > 0; )
1034
+ p.current.history.redo();
1035
+ q = !1;
1036
1036
  return;
1037
1037
  }
1038
- s.current.history.undo();
1038
+ p.current.history.undo();
1039
1039
  };
1040
- return /* @__PURE__ */ x(
1040
+ return /* @__PURE__ */ y(
1041
1041
  re,
1042
1042
  {
1043
- onOpenChange: i,
1044
- open: o,
1043
+ onOpenChange: m,
1044
+ open: i,
1045
1045
  children: [
1046
1046
  /* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ e(
1047
1047
  le,
1048
1048
  {
1049
- action: () => i(!0),
1049
+ action: () => m(!0),
1050
1050
  icon: "PencilRuler",
1051
- tooltip: "Drawer"
1051
+ tooltip: "Drawer",
1052
+ tooltipOptions: o
1052
1053
  }
1053
1054
  ) }),
1054
- /* @__PURE__ */ x(ne, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
1055
+ /* @__PURE__ */ y(ne, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
1055
1056
  /* @__PURE__ */ e(ie, { children: "Drawer" }),
1056
- /* @__PURE__ */ x("div", { style: { height: "600px", width: "100%", borderWidth: 1, background: "white", position: "relative" }, children: [
1057
+ /* @__PURE__ */ y("div", { style: { height: "600px", width: "100%", borderWidth: 1, background: "white", position: "relative" }, children: [
1057
1058
  /* @__PURE__ */ e(
1058
1059
  "div",
1059
1060
  {
@@ -1064,32 +1065,32 @@ const et = ({ editor: t, upload: r }) => {
1064
1065
  /* @__PURE__ */ e(
1065
1066
  Ye,
1066
1067
  {
1067
- changeBorderColorShape: T,
1068
- changeColorShape: a,
1069
- changeShape: A,
1068
+ changeBorderColorShape: v,
1069
+ changeColorShape: c,
1070
+ changeShape: s,
1070
1071
  onClear: () => {
1071
- if (!R) {
1072
- for (; s.current.history.undoStackSize > 0; )
1073
- m();
1074
- R = !0;
1072
+ if (!q) {
1073
+ for (; p.current.history.undoStackSize > 0; )
1074
+ n();
1075
+ q = !0;
1075
1076
  }
1076
1077
  },
1077
1078
  onRedo: () => {
1078
- R || s.current.history.redo();
1079
+ q || p.current.history.redo();
1079
1080
  },
1080
- onThicknessChange: h,
1081
- onUndo: m,
1082
- refEditor: s,
1083
- setColorHighlight: b,
1084
- setColorPen: f,
1085
- setThicknessPen: S
1081
+ onThicknessChange: C,
1082
+ onUndo: n,
1083
+ refEditor: p,
1084
+ setColorHighlight: B,
1085
+ setColorPen: z,
1086
+ setThicknessPen: x
1086
1087
  }
1087
1088
  )
1088
1089
  ] }),
1089
1090
  /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
1090
1091
  ae,
1091
1092
  {
1092
- onClick: _,
1093
+ onClick: T,
1093
1094
  type: "button",
1094
1095
  children: "Save changes"
1095
1096
  }
@@ -1098,143 +1099,143 @@ const et = ({ editor: t, upload: r }) => {
1098
1099
  ]
1099
1100
  }
1100
1101
  );
1101
- }, I = {
1102
+ }, W = {
1102
1103
  TOP_LEFT: "tl",
1103
1104
  TOP_RIGHT: "tr",
1104
1105
  BOTTOM_LEFT: "bl",
1105
1106
  BOTTOM_RIGHT: "br"
1106
1107
  };
1107
- function tt({ editor: t, node: r, updateAttributes: o, getPos: i, selected: s }) {
1108
- const [C, P] = y({
1108
+ function tt({ editor: t, node: r, updateAttributes: o, getPos: i, selected: m }) {
1109
+ const [p, b] = M({
1109
1110
  width: K,
1110
1111
  height: K
1111
- }), [_, f] = y({
1112
+ }), [A, T] = M({
1112
1113
  width: 0,
1113
1114
  height: 0
1114
- }), [S] = y([
1115
- I.TOP_LEFT,
1116
- I.TOP_RIGHT,
1117
- I.BOTTOM_LEFT,
1118
- I.BOTTOM_RIGHT
1119
- ]), [b, A] = y(!1), [a, h] = y({
1115
+ }), [z] = M([
1116
+ W.TOP_LEFT,
1117
+ W.TOP_RIGHT,
1118
+ W.BOTTOM_LEFT,
1119
+ W.BOTTOM_RIGHT
1120
+ ]), [x, B] = M(!1), [s, c] = M({
1120
1121
  x: 0,
1121
1122
  y: 0,
1122
1123
  w: 0,
1123
1124
  h: 0,
1124
1125
  dir: ""
1125
- }), { align: T } = r == null ? void 0 : r.attrs, m = D(() => {
1126
- const { src: u, alt: H, width: E, height: z } = r == null ? void 0 : r.attrs, k = j(E) ? `${E}px` : E, v = j(z) ? `${z}px` : z;
1126
+ }), { align: C } = r == null ? void 0 : r.attrs, v = O(() => {
1127
+ const { src: h, alt: E, width: L, height: k } = r == null ? void 0 : r.attrs, _ = j(L) ? `${L}px` : L, w = j(k) ? `${k}px` : k;
1127
1128
  return {
1128
- src: u || void 0,
1129
- alt: H || void 0,
1129
+ src: h || void 0,
1130
+ alt: E || void 0,
1130
1131
  style: {
1131
- width: k || void 0,
1132
- height: v || void 0
1132
+ width: _ || void 0,
1133
+ height: w || void 0
1133
1134
  }
1134
1135
  };
1135
- }, [r == null ? void 0 : r.attrs]), n = D(() => {
1136
+ }, [r == null ? void 0 : r.attrs]), n = O(() => {
1136
1137
  const {
1137
- style: { width: u }
1138
- } = m;
1139
- return { width: u === "100%" ? u : void 0 };
1140
- }, [m]);
1141
- function G(u) {
1142
- f({
1143
- width: u.target.width,
1144
- height: u.target.height
1138
+ style: { width: h }
1139
+ } = v;
1140
+ return { width: h === "100%" ? h : void 0 };
1141
+ }, [v]);
1142
+ function $(h) {
1143
+ T({
1144
+ width: h.target.width,
1145
+ height: h.target.height
1145
1146
  });
1146
1147
  }
1147
- function p() {
1148
+ function R() {
1148
1149
  t.commands.setNodeSelection(i());
1149
1150
  }
1150
- const c = q(
1151
+ const f = P(
1151
1152
  Z(() => {
1152
- const { width: u } = getComputedStyle(t.view.dom);
1153
- P((H) => ({
1154
- ...H,
1155
- width: Number.parseInt(u, 10)
1153
+ const { width: h } = getComputedStyle(t.view.dom);
1154
+ b((E) => ({
1155
+ ...E,
1156
+ width: Number.parseInt(h, 10)
1156
1157
  }));
1157
1158
  }, J),
1158
1159
  [t]
1159
1160
  );
1160
- function w(u, H) {
1161
- u.preventDefault(), u.stopPropagation();
1162
- const E = _.width, z = _.height, k = E / z;
1163
- let v = Number(r.attrs.width), L = Number(r.attrs.height);
1164
- const M = C.width;
1165
- v && !L ? (v = v > M ? M : v, L = Math.round(v / k)) : L && !v ? (v = Math.round(L * k), v = v > M ? M : v) : !v && !L ? (v = E > M ? M : E, L = Math.round(v / k)) : v = v > M ? M : v, A(!0), h({
1166
- x: u.clientX,
1167
- y: u.clientY,
1168
- w: v,
1169
- h: L,
1170
- dir: H
1161
+ function a(h, E) {
1162
+ h.preventDefault(), h.stopPropagation();
1163
+ const L = A.width, k = A.height, _ = L / k;
1164
+ let w = Number(r.attrs.width), N = Number(r.attrs.height);
1165
+ const H = p.width;
1166
+ w && !N ? (w = w > H ? H : w, N = Math.round(w / _)) : N && !w ? (w = Math.round(N * _), w = w > H ? H : w) : !w && !N ? (w = L > H ? H : L, N = Math.round(w / _)) : w = w > H ? H : w, B(!0), c({
1167
+ x: h.clientX,
1168
+ y: h.clientY,
1169
+ w,
1170
+ h: N,
1171
+ dir: E
1171
1172
  });
1172
1173
  }
1173
- const N = q(
1174
- Z((u) => {
1175
- if (u.preventDefault(), u.stopPropagation(), !b)
1174
+ const u = P(
1175
+ Z((h) => {
1176
+ if (h.preventDefault(), h.stopPropagation(), !x)
1176
1177
  return;
1177
- const { x: H, w: E, dir: z } = a, k = (u.clientX - H) * (/l/.test(z) ? -1 : 1), { width: v, height: L } = r == null ? void 0 : r.attrs, M = v / L, U = he(E + k, fe, C.width), ee = Math.round(U / M);
1178
+ const { x: E, w: L, dir: k } = s, _ = (h.clientX - E) * (/l/.test(k) ? -1 : 1), { width: w, height: N } = r == null ? void 0 : r.attrs, H = w / N, U = he(L + _, fe, p.width), ee = Math.round(U / H);
1178
1179
  o({
1179
1180
  width: U,
1180
1181
  height: ee
1181
1182
  });
1182
1183
  }, J),
1183
- [b, a, C, o, r == null ? void 0 : r.attrs]
1184
- ), B = q(
1185
- (u) => {
1186
- u.preventDefault(), u.stopPropagation(), b && (h({
1184
+ [x, s, p, o, r == null ? void 0 : r.attrs]
1185
+ ), S = P(
1186
+ (h) => {
1187
+ h.preventDefault(), h.stopPropagation(), x && (c({
1187
1188
  x: 0,
1188
1189
  y: 0,
1189
1190
  w: 0,
1190
1191
  h: 0,
1191
1192
  dir: ""
1192
- }), A(!1), p());
1193
+ }), B(!1), R());
1193
1194
  },
1194
- [b, p]
1195
- ), $ = q(() => {
1196
- document == null || document.addEventListener("mousemove", N, !0), document == null || document.addEventListener("mouseup", B, !0);
1197
- }, [N, B]), W = q(() => {
1198
- document == null || document.removeEventListener("mousemove", N, !0), document == null || document.removeEventListener("mouseup", B, !0);
1199
- }, [N, B]);
1200
- O(() => (b ? $() : W(), () => {
1201
- W();
1202
- }), [b, $, W]);
1203
- const F = D(() => new ResizeObserver(() => c()), [c]);
1204
- return O(() => (F.observe(t.view.dom), () => {
1205
- F.disconnect();
1206
- }), [t.view.dom, F]), /* @__PURE__ */ e(
1195
+ [x, R]
1196
+ ), I = P(() => {
1197
+ document == null || document.addEventListener("mousemove", u, !0), document == null || document.addEventListener("mouseup", S, !0);
1198
+ }, [u, S]), F = P(() => {
1199
+ document == null || document.removeEventListener("mousemove", u, !0), document == null || document.removeEventListener("mouseup", S, !0);
1200
+ }, [u, S]);
1201
+ V(() => (x ? I() : F(), () => {
1202
+ F();
1203
+ }), [x, I, F]);
1204
+ const D = O(() => new ResizeObserver(() => f()), [f]);
1205
+ return V(() => (D.observe(t.view.dom), () => {
1206
+ D.disconnect();
1207
+ }), [t.view.dom, D]), /* @__PURE__ */ e(
1207
1208
  de,
1208
1209
  {
1209
1210
  className: "image-view",
1210
- style: { ...n, width: "100%", textAlign: T },
1211
- children: /* @__PURE__ */ x(
1211
+ style: { ...n, width: "100%", textAlign: C },
1212
+ children: /* @__PURE__ */ y(
1212
1213
  "div",
1213
1214
  {
1214
1215
  "data-drag-handle": !0,
1215
1216
  draggable: "true",
1216
1217
  style: { ...n, background: "#fff" },
1217
- className: `image-view__body ${s ? "image-view__body--focused" : ""} ${b ? "image-view__body--resizing" : ""}`,
1218
+ className: `image-view__body ${m ? "image-view__body--focused" : ""} ${x ? "image-view__body--resizing" : ""}`,
1218
1219
  children: [
1219
1220
  /* @__PURE__ */ e(
1220
1221
  "img",
1221
1222
  {
1222
- alt: m.alt,
1223
+ alt: v.alt,
1223
1224
  className: "image-view__body__image block",
1224
1225
  height: "auto",
1225
- onClick: p,
1226
- onLoad: G,
1227
- src: m.src,
1228
- style: m.style
1226
+ onClick: R,
1227
+ onLoad: $,
1228
+ src: v.src,
1229
+ style: v.style
1229
1230
  }
1230
1231
  ),
1231
- t.view.editable && (s || b) && /* @__PURE__ */ e("div", { className: "image-resizer", children: S == null ? void 0 : S.map((u) => /* @__PURE__ */ e(
1232
+ t.view.editable && (m || x) && /* @__PURE__ */ e("div", { className: "image-resizer", children: z == null ? void 0 : z.map((h) => /* @__PURE__ */ e(
1232
1233
  "span",
1233
1234
  {
1234
- className: `image-resizer__handler image-resizer__handler--${u}`,
1235
- onMouseDown: (H) => w(H, u)
1235
+ className: `image-resizer__handler image-resizer__handler--${h}`,
1236
+ onMouseDown: (E) => a(E, h)
1236
1237
  },
1237
- `image-dir-${u}`
1238
+ `image-dir-${h}`
1238
1239
  )) })
1239
1240
  ]
1240
1241
  }
@@ -1259,7 +1260,7 @@ const ht = /* @__PURE__ */ ue.extend({
1259
1260
  class: "drawer"
1260
1261
  },
1261
1262
  button: ({ editor: r, t: o, extension: i }) => {
1262
- var s;
1263
+ var m;
1263
1264
  return {
1264
1265
  component: et,
1265
1266
  componentProps: {
@@ -1269,7 +1270,7 @@ const ht = /* @__PURE__ */ ue.extend({
1269
1270
  editor: r,
1270
1271
  icon: "PencilRuler",
1271
1272
  tooltip: o("editor.drawer.tooltip"),
1272
- upload: (s = i == null ? void 0 : i.options) == null ? void 0 : s.upload
1273
+ upload: (m = i == null ? void 0 : i.options) == null ? void 0 : m.upload
1273
1274
  }
1274
1275
  };
1275
1276
  }