reactjs-tiptap-editor 1.0.17 → 1.0.18

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 (212) hide show
  1. package/lib/{ActionMenuButton-lsIBc9sU.js → ActionMenuButton-BOjCHFTA.js} +6 -6
  2. package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +40 -78
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +2 -3
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +2 -3
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -3
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +105 -99
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +2 -3
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +2 -3
  17. package/lib/CodeBlock.cjs +38 -38
  18. package/lib/CodeBlock.js +1561 -1605
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +2 -2
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +46 -63
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +24 -10
  25. package/lib/Drawer-DwrlY_lY.cjs +1 -0
  26. package/lib/Drawer-DxOoRiGQ.js +1099 -0
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +6 -5
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +69 -93
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +99 -110
  33. package/lib/ExportPdf.cjs +4 -4
  34. package/lib/ExportPdf.js +4 -13
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +9 -7
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +12 -34
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +12 -27
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +34 -47
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +39 -52
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +318 -313
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +2 -3
  49. package/lib/{Iframe-CTajPyzs.js → Iframe-AhNV5WH5.js} +25 -34
  50. package/lib/Iframe-C6pBw-AF.cjs +1 -0
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +5 -4
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +5 -4
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +63 -91
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +7 -11
  59. package/lib/{Indent-BGEHlRx_.js → Indent-DZ5PcJA4.js} +3 -7
  60. package/lib/Indent-Do-X0AsY.cjs +1 -0
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +2 -3
  65. package/lib/Katex-CIC9ygbL.cjs +4 -0
  66. package/lib/{Katex-tMh4bfBb.js → Katex-bIgoenn_.js} +241 -255
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +5 -4
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +13 -21
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
  74. package/lib/{LinkEditBlock-CA5NhP-m.js → LinkEditBlock-D_cF9fnc.js} +320 -370
  75. package/lib/MarkdownPaste.cjs +58 -0
  76. package/lib/MarkdownPaste.js +1656 -0
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +22 -17
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +118 -142
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +10 -18
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +2 -3
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +68 -133
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +15 -14
  89. package/lib/{SlashCommandNodeView-CZoM3ZlS.cjs → SlashCommandNodeView-Ba03hlVZ.cjs} +1 -1
  90. package/lib/{SlashCommandNodeView-DLuqbX2o.js → SlashCommandNodeView-cg0x3NRF.js} +15 -17
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +2 -3
  93. package/lib/{Table-BC4Lbqzn.js → Table-KqLiT5wG.js} +95 -133
  94. package/lib/Table-ddU2LSc6.cjs +9 -0
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +2 -3
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +51 -60
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +47 -69
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +2 -3
  105. package/lib/Twitter-BIiR78Jh.cjs +1 -0
  106. package/lib/{Twitter-D8Cbgl7g.js → Twitter-C1Lzqc7u.js} +567 -593
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +4 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +3 -3
  111. package/lib/bubble.cjs +6 -4
  112. package/lib/bubble.js +3712 -3023
  113. package/lib/clsx-BWE7vnna.cjs +33 -0
  114. package/lib/clsx-eGVyq7ot.js +1062 -0
  115. package/lib/components/ActionButton.d.ts +2 -2
  116. package/lib/components/ActionMenuButton.d.ts +1 -1
  117. package/lib/components/Bubble/formatBubble.d.ts +5 -5
  118. package/lib/components/ui/checkbox.d.ts +1 -1
  119. package/lib/components/ui/dialog.d.ts +1 -1
  120. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  121. package/lib/components/ui/emoji-picker.d.ts +1 -1
  122. package/lib/components/ui/label.d.ts +1 -1
  123. package/lib/components/ui/popover.d.ts +1 -1
  124. package/lib/components/ui/select.d.ts +1 -1
  125. package/lib/components/ui/separator.d.ts +1 -1
  126. package/lib/components/ui/switch.d.ts +1 -1
  127. package/lib/components/ui/tabs.d.ts +1 -1
  128. package/lib/components/ui/toast.d.ts +1 -1
  129. package/lib/components/ui/toggle.d.ts +1 -1
  130. package/lib/components/ui/tooltip.d.ts +1 -1
  131. package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
  132. package/lib/{dropdown-menu-q6RL_fkA.js → dropdown-menu-CexIkt_V.js} +8 -8
  133. package/lib/{dropdown-menu-C_F7LEy5.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
  134. package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
  135. package/lib/extensions/Bold/Bold.d.ts +1 -1
  136. package/lib/extensions/Code/Code.d.ts +1 -1
  137. package/lib/extensions/CodeView/CodeView.d.ts +2 -2
  138. package/lib/extensions/Heading/Heading.d.ts +1 -1
  139. package/lib/extensions/Highlight/Highlight.d.ts +1 -1
  140. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
  141. package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
  142. package/lib/extensions/Italic/Italic.d.ts +1 -1
  143. package/lib/extensions/Link/Link.d.ts +1 -1
  144. package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
  145. package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
  146. package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
  147. package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
  148. package/lib/extensions/Strike/Strike.d.ts +1 -1
  149. package/lib/extensions/Table/Table.d.ts +1 -1
  150. package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
  151. package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
  152. package/lib/index-BUTn2LY6.cjs +1 -0
  153. package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
  154. package/lib/{index-DqruLhsu.js → index-BnW6t8z6.js} +23 -23
  155. package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
  156. package/lib/index-BtxvYLJ1.cjs +12 -0
  157. package/lib/{index-Do_dsOGB.js → index-C6xmkxrQ.js} +232 -217
  158. package/lib/index-CJ9pyCM4.cjs +1 -0
  159. package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
  160. package/lib/{index-RcSPeQHn.js → index-DHUN85fV.js} +571 -657
  161. package/lib/index-DUpSE1Gb.cjs +1 -0
  162. package/lib/index-D_8P0LE5.js +1362 -0
  163. package/lib/{index-BDYJ8Ph2.js → index-RIXs7STX.js} +1 -1
  164. package/lib/index-mfGK4pFo.js +6469 -0
  165. package/lib/index-zig3Dj7A.cjs +22 -0
  166. package/lib/index.cjs +1 -1
  167. package/lib/index.js +26 -34
  168. package/lib/locale-bundle.cjs +1 -1
  169. package/lib/locale-bundle.js +1 -1
  170. package/lib/plugins/image-upload.d.ts +1 -1
  171. package/lib/popover-BYSZ3zBi.js +24 -0
  172. package/lib/popover-BcHDZqBt.cjs +1 -0
  173. package/lib/{renderNodeView-BEkECnnY.js → renderNodeView-BrM5kUj_.js} +2 -2
  174. package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
  175. package/lib/{select-CmV5uTXr.js → select-C5SHDLFj.js} +8 -5
  176. package/lib/{select-CYyIeImH.cjs → select-DHjzKkcu.cjs} +1 -1
  177. package/lib/{separator-BLp6xpSY.cjs → separator-BmixLrnJ.cjs} +1 -1
  178. package/lib/separator-CFKVxAea.js +293 -0
  179. package/lib/store/editor.d.ts +1 -1
  180. package/lib/store/store.d.ts +1 -1
  181. package/lib/style.css +1 -1
  182. package/lib/{textarea-Cn75Cm2n.cjs → textarea-CasDcv3u.cjs} +1 -1
  183. package/lib/{textarea-CkVKMPqK.js → textarea-DNLrJoRl.js} +1 -1
  184. package/lib/theme.js +1 -1
  185. package/lib/types.d.ts +3 -3
  186. package/lib/updatePosition-CBRjbQMH.js +16 -0
  187. package/lib/updatePosition-CfmY5Trk.cjs +1 -0
  188. package/lib/utils/columns.d.ts +1 -1
  189. package/lib/utils/pdf.d.ts +1 -1
  190. package/lib/utils/utils.d.ts +1 -1
  191. package/package.json +262 -247
  192. package/lib/ActionMenuButton-B_E2mbAW.cjs +0 -1
  193. package/lib/Drawer-DQ4CxBwG.js +0 -1373
  194. package/lib/Drawer-FUeUKshi.cjs +0 -1
  195. package/lib/Iframe-EVWXCqe4.cjs +0 -1
  196. package/lib/Indent-q9cEWAa_.cjs +0 -1
  197. package/lib/Katex-ClqcEnN_.cjs +0 -4
  198. package/lib/LinkEditBlock-DZXk4ln_.cjs +0 -5
  199. package/lib/Table-BmDopO43.cjs +0 -9
  200. package/lib/Twitter-BbMD3Ybp.cjs +0 -1
  201. package/lib/clsx-CXbNJWDD.cjs +0 -54
  202. package/lib/clsx-DaPvp9ji.js +0 -7391
  203. package/lib/index-BCzvbrf5.cjs +0 -12
  204. package/lib/index-BnVcq33n.cjs +0 -1
  205. package/lib/index-CjhjjJsN.cjs +0 -1
  206. package/lib/index-Cs6cp0Y6.cjs +0 -1
  207. package/lib/index-Qcl3BG94.js +0 -1351
  208. package/lib/popover-CtinPbiy.js +0 -24
  209. package/lib/popover-DIMT3pae.cjs +0 -1
  210. package/lib/separator-C7luvaG8.js +0 -327
  211. package/lib/updatePosition-Cjuj2E26.cjs +0 -1
  212. package/lib/updatePosition-DRmKQBGm.js +0 -16
@@ -0,0 +1,1099 @@
1
+ import { q as Z, m as te } from "./index-mfGK4pFo.js";
2
+ import { v as X, w as oe, c as d, h as re, u as le, d as ne, D as ie, m as se, A as ae, n as ce, o as he, p as ue, B as de, x as ge, y as me } from "./index-DHUN85fV.js";
3
+ import { N as pe, a as we } from "./clsx-eGVyq7ot.js";
4
+ import { jsx as e, jsxs as x, Fragment as U } from "react/jsx-runtime";
5
+ import { useState as y, useMemo as V, useCallback as q, useEffect as G, useRef as K } from "react";
6
+ import { I as Q, i as Y, j as ve } from "./index-BlXGgvT-.js";
7
+ import { Color4 as g, Editor as fe, makeDropdownToolbar as Te } from "easydrawer";
8
+ import { s as Ce, i as be } from "./shortId-WJVkrvml.js";
9
+ const W = {
10
+ TOP_LEFT: "tl",
11
+ TOP_RIGHT: "tr",
12
+ BOTTOM_LEFT: "bl",
13
+ BOTTOM_RIGHT: "br"
14
+ };
15
+ function xe({ editor: t, node: o, updateAttributes: r, getPos: i, selected: T }) {
16
+ const [H, S] = y({
17
+ width: Q,
18
+ height: Q
19
+ }), [w, h] = y({
20
+ width: 0,
21
+ height: 0
22
+ }), [k] = y([
23
+ W.TOP_LEFT,
24
+ W.TOP_RIGHT,
25
+ W.BOTTOM_LEFT,
26
+ W.BOTTOM_RIGHT
27
+ ]), [b, B] = y(!1), [a, c] = y({
28
+ x: 0,
29
+ y: 0,
30
+ w: 0,
31
+ h: 0,
32
+ dir: ""
33
+ }), { align: C } = o == null ? void 0 : o.attrs, f = V(() => {
34
+ const { src: u, alt: E, width: L, height: A } = o == null ? void 0 : o.attrs, z = Z(L) ? `${L}px` : L, v = Z(A) ? `${A}px` : A;
35
+ return {
36
+ src: u || void 0,
37
+ alt: E || void 0,
38
+ style: {
39
+ width: z || void 0,
40
+ height: v || void 0
41
+ }
42
+ };
43
+ }, [o == null ? void 0 : o.attrs]), n = V(() => {
44
+ const {
45
+ style: { width: u }
46
+ } = f;
47
+ return { width: u === "100%" ? u : void 0 };
48
+ }, [f]);
49
+ function F(u) {
50
+ h({
51
+ width: u.target.width,
52
+ height: u.target.height
53
+ });
54
+ }
55
+ const P = q(() => {
56
+ t.commands.setNodeSelection(i());
57
+ }, []), D = q(
58
+ X(() => {
59
+ const { width: u } = getComputedStyle(t.view.dom);
60
+ S((E) => ({
61
+ ...E,
62
+ width: Number.parseInt(u, 10)
63
+ }));
64
+ }, Y),
65
+ [t]
66
+ );
67
+ function O(u, E) {
68
+ u.preventDefault(), u.stopPropagation();
69
+ const L = w.width, A = w.height, z = L / A;
70
+ let v = Number(o.attrs.width), N = Number(o.attrs.height);
71
+ const M = H.width;
72
+ v && !N ? (v = v > M ? M : v, N = Math.round(v / z)) : N && !v ? (v = Math.round(N * z), v = v > M ? M : v) : !v && !N ? (v = L > M ? M : L, N = Math.round(v / z)) : v = v > M ? M : v, B(!0), c({
73
+ x: u.clientX,
74
+ y: u.clientY,
75
+ w: v,
76
+ h: N,
77
+ dir: E
78
+ });
79
+ }
80
+ const m = q(
81
+ X((u) => {
82
+ if (u.preventDefault(), u.stopPropagation(), !b)
83
+ return;
84
+ const { x: E, w: L, dir: A } = a, z = (u.clientX - E) * (/l/.test(A) ? -1 : 1), { width: v, height: N } = o == null ? void 0 : o.attrs, M = v / N, j = oe(L + z, ve, H.width), ee = Math.round(j / M);
85
+ r({
86
+ width: j,
87
+ height: ee
88
+ });
89
+ }, Y),
90
+ [b, a, H, r, o == null ? void 0 : o.attrs]
91
+ ), s = q(
92
+ (u) => {
93
+ u.preventDefault(), u.stopPropagation(), b && (c({
94
+ x: 0,
95
+ y: 0,
96
+ w: 0,
97
+ h: 0,
98
+ dir: ""
99
+ }), B(!1), P());
100
+ },
101
+ [b, P]
102
+ ), p = q(() => {
103
+ document == null || document.addEventListener("mousemove", m, !0), document == null || document.addEventListener("mouseup", s, !0);
104
+ }, [m, s]), _ = q(() => {
105
+ document == null || document.removeEventListener("mousemove", m, !0), document == null || document.removeEventListener("mouseup", s, !0);
106
+ }, [m, s]);
107
+ G(() => (b ? p() : _(), () => {
108
+ _();
109
+ }), [b, p, _]);
110
+ const R = V(() => new ResizeObserver(() => D()), [D]);
111
+ return G(() => (R.observe(t.view.dom), () => {
112
+ R.disconnect();
113
+ }), [t.view.dom, R]), /* @__PURE__ */ e(
114
+ pe,
115
+ {
116
+ className: "image-view",
117
+ style: { ...n, width: "100%", textAlign: C },
118
+ children: /* @__PURE__ */ x(
119
+ "div",
120
+ {
121
+ "data-drag-handle": !0,
122
+ draggable: "true",
123
+ style: { ...n, background: "#fff" },
124
+ className: `image-view__body ${T ? "image-view__body--focused" : ""} ${b ? "image-view__body--resizing" : ""}`,
125
+ children: [
126
+ /* @__PURE__ */ e(
127
+ "img",
128
+ {
129
+ alt: f.alt,
130
+ className: "image-view__body__image block",
131
+ height: "auto",
132
+ onClick: P,
133
+ onLoad: F,
134
+ src: f.src,
135
+ style: f.style
136
+ }
137
+ ),
138
+ t.view.editable && (T || b) && /* @__PURE__ */ e("div", { className: "image-resizer", children: k == null ? void 0 : k.map((u) => /* @__PURE__ */ e(
139
+ "span",
140
+ {
141
+ className: `image-resizer__handler image-resizer__handler--${u}`,
142
+ onMouseDown: (E) => O(E, u)
143
+ },
144
+ `image-dir-${u}`
145
+ )) })
146
+ ]
147
+ }
148
+ )
149
+ }
150
+ );
151
+ }
152
+ function ye(t) {
153
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
154
+ "path",
155
+ {
156
+ color: "currentColor",
157
+ d: "M2 9.2v3.6M12.8 2H9.2M7.5 20H9M20 7.5V9M2.133 4.699c.155-.727.415-1.274.854-1.712c.426-.426.954-.684 1.652-.84m15.228 2.552c-.155-.727-.415-1.274-.854-1.712c-.417-.417-.932-.673-1.608-.83M4.64 19.853c-.698-.156-1.226-.414-1.652-.84c-.43-.43-.69-.965-.845-1.673m11.638 3.626c-1.812.125-3.607-8.326-2.374-9.559s9.684.561 9.559 2.373c-.087 1.187-2.095 1.656-2.037 2.711c.018.309.408.59 1.188 1.154c.543.39 1.096.77 1.629 1.175a.66.66 0 0 1 .234.687a3.35 3.35 0 0 1-2.472 2.473a.66.66 0 0 1-.688-.235c-.404-.533-.784-1.086-1.175-1.628c-.563-.78-.844-1.17-1.153-1.188c-1.055-.059-1.524 1.95-2.71 2.037",
158
+ fill: "none",
159
+ stroke: "currentColor",
160
+ strokeLinecap: "round",
161
+ strokeLinejoin: "round",
162
+ strokeWidth: "1.5"
163
+ }
164
+ ) });
165
+ }
166
+ function Me(t) {
167
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
168
+ "path",
169
+ {
170
+ d: "M20.06 18a4 4 0 0 1-.2-.89c-.67.7-1.48 1.05-2.41 1.05c-.83 0-1.52-.24-2.05-.71c-.53-.45-.8-1.06-.8-1.79c0-.88.33-1.56 1-2.05s1.61-.73 2.83-.73h1.4v-.64q0-.735-.45-1.17c-.3-.29-.75-.43-1.33-.43c-.52 0-.95.12-1.3.36c-.35.25-.52.54-.52.89h-1.46c0-.43.15-.84.45-1.24c.28-.4.71-.71 1.22-.94c.51-.21 1.06-.35 1.69-.35c.98 0 1.74.24 2.29.73s.84 1.16.86 2.02V16c0 .8.1 1.42.3 1.88V18zm-2.4-1.12c.45 0 .88-.11 1.29-.32c.4-.21.7-.49.88-.83v-1.57H18.7c-1.77 0-2.66.47-2.66 1.41c0 .43.15.73.46.96c.3.23.68.35 1.16.35m-12.2-3.17h4.07L7.5 8.29zM6.64 6h1.72l4.71 12h-1.93l-.97-2.57H4.82L3.86 18H1.93z",
171
+ fill: "currentColor"
172
+ }
173
+ ) });
174
+ }
175
+ function He(t) {
176
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
177
+ "path",
178
+ {
179
+ d: "M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z",
180
+ fill: "currentColor"
181
+ }
182
+ ) });
183
+ }
184
+ function Ee(t) {
185
+ return /* @__PURE__ */ e(
186
+ "svg",
187
+ {
188
+ height: "1em",
189
+ viewBox: "0 0 256 256",
190
+ width: "1em",
191
+ xmlns: "http://www.w3.org/2000/svg",
192
+ ...t,
193
+ children: /* @__PURE__ */ e(
194
+ "path",
195
+ {
196
+ d: "M253.66 106.34a8 8 0 0 0-11.32 0L192 156.69L107.31 72l50.35-50.34a8 8 0 1 0-11.32-11.32L96 60.69a16 16 0 0 0-2.82 18.81L72 100.69a16 16 0 0 0 0 22.62l4.69 4.69l-58.35 58.34a8 8 0 0 0 3.13 13.25l72 24A7.9 7.9 0 0 0 96 224a8 8 0 0 0 5.66-2.34L136 187.31l4.69 4.69a16 16 0 0 0 22.62 0l21.19-21.18a16 16 0 0 0 18.81-2.82l50.35-50.34a8 8 0 0 0 0-11.32M93.84 206.85l-55-18.35L88 139.31L124.69 176ZM152 180.69L83.31 112L104 91.31L172.69 160Z",
197
+ fill: "currentColor"
198
+ }
199
+ )
200
+ }
201
+ );
202
+ }
203
+ function Le(t) {
204
+ return /* @__PURE__ */ x("svg", { height: "1em", viewBox: "0 0 16 16", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
205
+ /* @__PURE__ */ e(
206
+ "path",
207
+ {
208
+ d: "m2.648 9.937l7.29-7.288a2.21 2.21 0 0 1 3.124 0l2.29 2.288a2.21 2.21 0 0 1 0 3.126L10.413 13H12.5a.5.5 0 0 1 0 1H4.501a2.2 2.2 0 0 1-1.563-.647l.707-.707c.227.226.535.354.856.354h4.005a1.2 1.2 0 0 0 .848-.354l1.292-1.293l-4-4l-3.29 3.291a1.21 1.21 0 0 0 0 1.712l.29.29l-.708.707l-.29-.29a2.21 2.21 0 0 1 0-3.126M8 6h6.89a1.2 1.2 0 0 0-.246-.356L14 5H9zm2-2h3l-.645-.644a1.21 1.21 0 0 0-1.71 0zm4.89 3H7.708l1 1H14l.644-.644A1.2 1.2 0 0 0 14.891 7zM9.708 9l1.646 1.646L13 9z",
209
+ fill: "currentColor"
210
+ }
211
+ ),
212
+ /* @__PURE__ */ e(
213
+ "path",
214
+ {
215
+ d: "M14 11.5a.5.5 0 1 1-1 0a.5.5 0 0 1 1 0m1.5-.5a.5.5 0 1 0 0-1a.5.5 0 0 0 0 1m-1 2a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z",
216
+ fill: "currentColor"
217
+ }
218
+ )
219
+ ] });
220
+ }
221
+ function Ne(t) {
222
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e("path", { d: "M3 3h18v18H3zm2 2v14h14V5z", fill: "currentColor" }) });
223
+ }
224
+ function Se(t) {
225
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e("path", { d: "M2 20V4h20v16zm2-2h16V6H4zm0 0V6z", fill: "currentColor" }) });
226
+ }
227
+ function ke(t) {
228
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
229
+ "path",
230
+ {
231
+ d: "M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8",
232
+ fill: "currentColor"
233
+ }
234
+ ) });
235
+ }
236
+ function _e(t) {
237
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
238
+ "path",
239
+ {
240
+ d: "M10.363 3.591L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0z",
241
+ fill: "none",
242
+ stroke: "currentColor",
243
+ strokeLinecap: "round",
244
+ strokeLinejoin: "round",
245
+ strokeWidth: "2"
246
+ }
247
+ ) });
248
+ }
249
+ function Ae(t) {
250
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
251
+ "path",
252
+ {
253
+ d: "m6.8 21l-5.2-9l5.2-9h10.4l5.2 9l-5.2 9zm1.15-2h8.1l4.025-7l-4.025-7h-8.1L3.9 12zM12 12",
254
+ fill: "currentColor"
255
+ }
256
+ ) });
257
+ }
258
+ function ze(t) {
259
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ x("g", { fill: "none", fillRule: "evenodd", children: [
260
+ /* @__PURE__ */ e("path", { d: "m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z" }),
261
+ /* @__PURE__ */ e(
262
+ "path",
263
+ {
264
+ d: "M10.586 2.807a2 2 0 0 1 2.828 0l7.778 7.779a2 2 0 0 1 0 2.828l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.828zM12 4.222L4.222 12L12 19.778L19.778 12z",
265
+ fill: "currentColor"
266
+ }
267
+ )
268
+ ] }) });
269
+ }
270
+ function Be(t) {
271
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e("path", { d: "M16.01 11H4v2h12.01v3L20 12l-3.99-4z", fill: "currentColor" }) });
272
+ }
273
+ function Pe(t) {
274
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
275
+ "path",
276
+ {
277
+ clipRule: "evenodd",
278
+ d: "M7.53 3.47a.75.75 0 0 1 0 1.06L5.81 6.25H15a5.75 5.75 0 0 1 0 11.5H8a.75.75 0 0 1 0-1.5h7a4.25 4.25 0 0 0 0-8.5H5.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0",
279
+ fill: "currentColor",
280
+ fillRule: "evenodd"
281
+ }
282
+ ) });
283
+ }
284
+ function qe(t) {
285
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
286
+ "path",
287
+ {
288
+ clipRule: "evenodd",
289
+ d: "M16.47 3.47a.75.75 0 0 1 1.06 0l3 3a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06l1.72-1.72H9a4.25 4.25 0 0 0 0 8.5h7a.75.75 0 0 1 0 1.5H9a5.75 5.75 0 0 1 0-11.5h9.19l-1.72-1.72a.75.75 0 0 1 0-1.06",
290
+ fill: "currentColor",
291
+ fillRule: "evenodd"
292
+ }
293
+ ) });
294
+ }
295
+ function Re(t) {
296
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
297
+ "path",
298
+ {
299
+ d: "M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zm2-4h2V8H9zm4 0h2V8h-2z",
300
+ fill: "currentColor"
301
+ }
302
+ ) });
303
+ }
304
+ function Ie(t) {
305
+ return /* @__PURE__ */ e(
306
+ "svg",
307
+ {
308
+ height: "1em",
309
+ viewBox: "0 0 256 256",
310
+ width: "1em",
311
+ xmlns: "http://www.w3.org/2000/svg",
312
+ ...t,
313
+ children: /* @__PURE__ */ e(
314
+ "path",
315
+ {
316
+ d: "M211.81 83.79a28 28 0 0 1-33.12 4.83l-90.07 90.07a28 28 0 1 1-44.43-6.48a28 28 0 0 1 33.12-4.83l90.07-90.07a28 28 0 1 1 44.43 6.48",
317
+ fill: "currentColor"
318
+ }
319
+ )
320
+ }
321
+ );
322
+ }
323
+ function De(t) {
324
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
325
+ "path",
326
+ {
327
+ d: "M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125M11.05 6.75q-.725-1.025-1.55-1.563t-2-.537q-1.5 0-2.5 1t-1 2.5q0 1.3.925 2.763t2.213 2.837t2.65 2.575T12 18.3q.85-.775 2.213-1.975t2.65-2.575t2.212-2.837T20 8.15q0-1.5-1-2.5t-2.5-1q-1.175 0-2 .538T12.95 6.75q-.175.25-.425.375T12 7.25t-.525-.125t-.425-.375m.95 4.725",
328
+ fill: "currentColor"
329
+ }
330
+ ) });
331
+ }
332
+ function We(t) {
333
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
334
+ "path",
335
+ {
336
+ d: "m7.625 6.4l2.8-3.625q.3-.4.713-.587T12 2t.863.188t.712.587l2.8 3.625l4.25 1.425q.65.2 1.025.738t.375 1.187q0 .3-.088.6t-.287.575l-2.75 3.9l.1 4.1q.025.875-.575 1.475t-1.4.6q-.05 0-.55-.075L12 19.675l-4.475 1.25q-.125.05-.275.063T6.975 21q-.8 0-1.4-.6T5 18.925l.1-4.125l-2.725-3.875q-.2-.275-.288-.575T2 9.75q0-.625.363-1.162t1.012-.763zM8.85 8.125L4 9.725L7.1 14.2L7 18.975l5-1.375l5 1.4l-.1-4.8L20 9.775l-4.85-1.65L12 4zM12 11.5",
337
+ fill: "currentColor"
338
+ }
339
+ ) });
340
+ }
341
+ function Fe(t) {
342
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
343
+ "path",
344
+ {
345
+ d: "M12.01 6c2.61 0 4.89 1.86 5.4 4.43l.3 1.5l1.52.11c1.56.11 2.78 1.41 2.78 2.96c0 1.65-1.35 3-3 3h-13c-2.21 0-4-1.79-4-4c0-2.05 1.53-3.76 3.56-3.97l1.07-.11l.5-.95A5.46 5.46 0 0 1 12.01 6m0-2C9.12 4 6.6 5.64 5.35 8.04C2.35 8.36.01 10.91.01 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.64-4.96C18.68 6.59 15.65 4 12.01 4",
346
+ fill: "currentColor"
347
+ }
348
+ ) });
349
+ }
350
+ function Oe(t) {
351
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
352
+ "path",
353
+ {
354
+ d: "M5.586 6.45A2 2 0 0 1 7.509 5h11.84a2 2 0 0 1 1.923 2.55l-2.858 10A2 2 0 0 1 16.491 19H4.651a2 2 0 0 1-1.923-2.55z",
355
+ fill: "none",
356
+ stroke: "currentColor",
357
+ strokeWidth: "2"
358
+ }
359
+ ) });
360
+ }
361
+ const Ve = "_wrapper_pva9d_1", Ge = "_tool_pva9d_17", $e = "_active_pva9d_37", Ue = "_pen_pva9d_41", je = "_line_pva9d_48", Ze = "_options_pva9d_56", Xe = "_colorWrap_pva9d_66", Ke = "_color_pva9d_66", Qe = "_colorActive_pva9d_83", l = {
362
+ wrapper: Ve,
363
+ tool: Ge,
364
+ active: $e,
365
+ pen: Ue,
366
+ line: je,
367
+ options: Ze,
368
+ colorWrap: Xe,
369
+ color: Ke,
370
+ colorActive: Qe
371
+ }, Ye = [
372
+ g.blackHighlight,
373
+ g.ofRGBA(166 / 255, 81 / 255, 167 / 255, 0.3),
374
+ g.ofRGBA(247 / 255, 78 / 255, 158 / 255, 0.3),
375
+ g.ofRGBA(166 / 255, 83 / 255, 88 / 255, 0.3),
376
+ g.ofRGBA(246 / 255, 130 / 255, 28 / 255, 0.3),
377
+ g.ofRGBA(166 / 255, 198 / 255, 0, 0.3),
378
+ g.ofRGBA(98 / 255, 186 / 255, 70 / 255, 0.3)
379
+ ], J = [
380
+ g.black,
381
+ g.fromHex("#007AFF"),
382
+ g.fromHex("#A651A7"),
383
+ g.fromHex("#F74E9E"),
384
+ g.fromHex("#FF5358"),
385
+ g.fromHex("#F6821C"),
386
+ g.fromHex("#FFC600"),
387
+ g.fromHex("#62BA46"),
388
+ g.fromHex("#E6BFE8"),
389
+ g.fromHex("#FEA3D2"),
390
+ g.fromHex("#FFA0A3"),
391
+ g.fromHex("#FBC276"),
392
+ g.fromHex("#FFFB85"),
393
+ g.fromHex("#AADC99")
394
+ ];
395
+ function Je({ onChange: t }) {
396
+ const [o, r] = y(g.blackHighlight);
397
+ return /* @__PURE__ */ e("div", { className: l.colorWrap, children: Ye.map((i, T) => /* @__PURE__ */ e(
398
+ "button",
399
+ {
400
+ style: { backgroundColor: i.toHexString() },
401
+ className: d(l.color, {
402
+ [l.colorActive]: o.toHexString() === i.toHexString()
403
+ }),
404
+ onClick: () => {
405
+ r(i), t(i);
406
+ }
407
+ },
408
+ T
409
+ )) });
410
+ }
411
+ function $({ onChange: t }) {
412
+ const [o, r] = y(g.black);
413
+ return /* @__PURE__ */ x(U, { children: [
414
+ /* @__PURE__ */ e("div", { className: l.colorWrap, children: J.slice(0, 7).map((i, T) => /* @__PURE__ */ e(
415
+ "button",
416
+ {
417
+ style: { backgroundColor: i.toHexString() },
418
+ className: d(l.color, {
419
+ [l.colorActive]: o.toHexString() === i.toHexString()
420
+ }),
421
+ onClick: () => {
422
+ r(i), t(i);
423
+ }
424
+ },
425
+ T
426
+ )) }),
427
+ /* @__PURE__ */ e("div", { className: l.colorWrap, children: J.slice(7).map((i, T) => /* @__PURE__ */ e(
428
+ "button",
429
+ {
430
+ style: { backgroundColor: i.toHexString() },
431
+ className: d(l.color, {
432
+ [l.colorActive]: o.toHexString() === i.toHexString()
433
+ }),
434
+ onClick: () => {
435
+ r(i), t(i);
436
+ }
437
+ },
438
+ T
439
+ )) })
440
+ ] });
441
+ }
442
+ function et({ setColorPen: t, setThicknessPen: o }) {
443
+ const [r, i] = y(2);
444
+ return /* @__PURE__ */ x("div", { className: l.options, children: [
445
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e($, { onChange: (T) => t(T) }) }),
446
+ /* @__PURE__ */ e("div", { className: l.line }),
447
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
448
+ "input",
449
+ {
450
+ max: 10,
451
+ min: 1,
452
+ step: 0.1,
453
+ type: "range",
454
+ value: r,
455
+ onChange: (T) => {
456
+ o(Number.parseFloat(T.target.value)), i(Number.parseFloat(T.target.value));
457
+ }
458
+ }
459
+ ) })
460
+ ] });
461
+ }
462
+ function tt({ setColorHighlight: t }) {
463
+ return /* @__PURE__ */ e("div", { className: l.options, children: /* @__PURE__ */ e(Je, { onChange: (o) => t(o) }) });
464
+ }
465
+ function ot({ changeColorShape: t, changeBorderColorShape: o, onThicknessChange: r }) {
466
+ return /* @__PURE__ */ x("div", { className: l.options, children: [
467
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e($, { onChange: (i) => t(i) }) }),
468
+ /* @__PURE__ */ e("div", { className: l.line }),
469
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e($, { onChange: (i) => o(i) }) }),
470
+ /* @__PURE__ */ e("div", { className: l.line }),
471
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
472
+ "input",
473
+ {
474
+ defaultValue: 0,
475
+ max: 20,
476
+ min: 0,
477
+ step: 1,
478
+ type: "range",
479
+ onChange: (i) => {
480
+ r(Number.parseFloat(i.target.value));
481
+ }
482
+ }
483
+ ) })
484
+ ] });
485
+ }
486
+ function rt(t) {
487
+ const {
488
+ setColorPen: o,
489
+ refEditor: r,
490
+ setThicknessPen: i,
491
+ setColorHighlight: T,
492
+ changeBorderColorShape: H,
493
+ onUndo: S,
494
+ changeColorShape: w,
495
+ changeShape: h,
496
+ onThicknessChange: k,
497
+ onRedo: b,
498
+ onClear: B
499
+ } = t, [a, c] = y(null), [C, f] = y(
500
+ 0
501
+ /* square */
502
+ );
503
+ return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ x("div", { className: l.wrapper, children: [
504
+ /* @__PURE__ */ x("div", { className: l.pen, children: [
505
+ /* @__PURE__ */ e(
506
+ "button",
507
+ {
508
+ className: d(l.tool, {
509
+ [l.active]: a === "select"
510
+ }),
511
+ onClick: () => {
512
+ const n = r.current.toolController.getPrimaryTools();
513
+ if (a === "select") {
514
+ c(null), n[0].setEnabled(!1);
515
+ return;
516
+ }
517
+ c("select"), n[0].setEnabled(!0);
518
+ },
519
+ children: /* @__PURE__ */ e(ye, {})
520
+ }
521
+ ),
522
+ /* @__PURE__ */ e("div", { className: l.line }),
523
+ /* @__PURE__ */ e(
524
+ "button",
525
+ {
526
+ className: d(l.tool, {
527
+ [l.active]: a === "text"
528
+ }),
529
+ onClick: () => {
530
+ const n = r.current.toolController.getPrimaryTools();
531
+ if (r.current.toolController.setToolEnabled(n[1]), a === "text") {
532
+ n[1].setEnabled(!1), c(null);
533
+ return;
534
+ }
535
+ c("text"), n[1].setEnabled(!0);
536
+ },
537
+ children: /* @__PURE__ */ e(Me, {})
538
+ }
539
+ ),
540
+ /* @__PURE__ */ e("div", { className: l.line }),
541
+ /* @__PURE__ */ e(
542
+ "button",
543
+ {
544
+ className: d(l.tool, {
545
+ [l.active]: a === "pencil"
546
+ }),
547
+ onClick: () => {
548
+ const n = r.current.toolController.getPrimaryTools();
549
+ if (a === "pencil") {
550
+ c(null), n[2].setEnabled(!1);
551
+ return;
552
+ }
553
+ c("pencil"), n[2].setEnabled(!0);
554
+ },
555
+ children: /* @__PURE__ */ e(He, {})
556
+ }
557
+ ),
558
+ /* @__PURE__ */ e(
559
+ "button",
560
+ {
561
+ className: d(l.tool, {
562
+ [l.active]: a === "highlighter"
563
+ }),
564
+ onClick: () => {
565
+ const n = r.current.toolController.getPrimaryTools();
566
+ if (a === "highlighter") {
567
+ c(null), n[3].setEnabled(!1);
568
+ return;
569
+ }
570
+ c("highlighter"), n[3].setEnabled(!0);
571
+ },
572
+ children: /* @__PURE__ */ e(Ee, {})
573
+ }
574
+ ),
575
+ /* @__PURE__ */ e("div", { className: l.line }),
576
+ /* @__PURE__ */ e(
577
+ "button",
578
+ {
579
+ className: d(l.tool, {
580
+ [l.active]: a === "eraser"
581
+ }),
582
+ onClick: () => {
583
+ const n = r.current.toolController.getPrimaryTools();
584
+ if (a === "eraser") {
585
+ c(null), n[4].setEnabled(!1);
586
+ return;
587
+ }
588
+ c("eraser"), n[4].setEnabled(!0);
589
+ },
590
+ children: /* @__PURE__ */ e(Le, {})
591
+ }
592
+ ),
593
+ /* @__PURE__ */ e("div", { className: l.line }),
594
+ /* @__PURE__ */ e(
595
+ "button",
596
+ {
597
+ className: d(l.tool, {
598
+ [l.active]: a === "shapes" && C === 0
599
+ /* square */
600
+ }),
601
+ onClick: () => {
602
+ const n = r.current.toolController.getPrimaryTools();
603
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
604
+ 0
605
+ /* square */
606
+ ), f(
607
+ 0
608
+ /* square */
609
+ );
610
+ },
611
+ children: /* @__PURE__ */ e(Ne, {})
612
+ }
613
+ ),
614
+ /* @__PURE__ */ e(
615
+ "button",
616
+ {
617
+ className: d(l.tool, {
618
+ [l.active]: a === "shapes" && C === 1
619
+ /* rectangle */
620
+ }),
621
+ onClick: () => {
622
+ const n = r.current.toolController.getPrimaryTools();
623
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
624
+ 1
625
+ /* rectangle */
626
+ ), f(
627
+ 1
628
+ /* rectangle */
629
+ );
630
+ },
631
+ children: /* @__PURE__ */ e(Se, {})
632
+ }
633
+ ),
634
+ /* @__PURE__ */ e(
635
+ "button",
636
+ {
637
+ className: d(l.tool, {
638
+ [l.active]: a === "shapes" && C === 2
639
+ /* circle */
640
+ }),
641
+ onClick: () => {
642
+ const n = r.current.toolController.getPrimaryTools();
643
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
644
+ 2
645
+ /* circle */
646
+ ), f(
647
+ 2
648
+ /* circle */
649
+ );
650
+ },
651
+ children: /* @__PURE__ */ e(ke, {})
652
+ }
653
+ ),
654
+ /* @__PURE__ */ e(
655
+ "button",
656
+ {
657
+ className: d(l.tool, {
658
+ [l.active]: a === "shapes" && C === 3
659
+ /* triangle */
660
+ }),
661
+ onClick: () => {
662
+ const n = r.current.toolController.getPrimaryTools();
663
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
664
+ 3
665
+ /* triangle */
666
+ ), f(
667
+ 3
668
+ /* triangle */
669
+ );
670
+ },
671
+ children: /* @__PURE__ */ e(_e, {})
672
+ }
673
+ ),
674
+ /* @__PURE__ */ e(
675
+ "button",
676
+ {
677
+ className: d(l.tool, {
678
+ [l.active]: a === "shapes" && C === 4
679
+ /* hexagonal */
680
+ }),
681
+ onClick: () => {
682
+ const n = r.current.toolController.getPrimaryTools();
683
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
684
+ 4
685
+ /* hexagonal */
686
+ ), f(
687
+ 4
688
+ /* hexagonal */
689
+ );
690
+ },
691
+ children: /* @__PURE__ */ e(Ae, {})
692
+ }
693
+ ),
694
+ /* @__PURE__ */ e(
695
+ "button",
696
+ {
697
+ className: d(l.tool, {
698
+ [l.active]: a === "shapes" && C === 5
699
+ /* diamond */
700
+ }),
701
+ onClick: () => {
702
+ const n = r.current.toolController.getPrimaryTools();
703
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
704
+ 5
705
+ /* diamond */
706
+ ), f(
707
+ 5
708
+ /* diamond */
709
+ );
710
+ },
711
+ children: /* @__PURE__ */ e(ze, {})
712
+ }
713
+ ),
714
+ /* @__PURE__ */ e(
715
+ "button",
716
+ {
717
+ className: d(l.tool, {
718
+ [l.active]: a === "shapes" && C === 6
719
+ /* arrow */
720
+ }),
721
+ onClick: () => {
722
+ const n = r.current.toolController.getPrimaryTools();
723
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
724
+ 6
725
+ /* arrow */
726
+ ), f(
727
+ 6
728
+ /* arrow */
729
+ );
730
+ },
731
+ children: /* @__PURE__ */ e(Be, {})
732
+ }
733
+ ),
734
+ /* @__PURE__ */ e(
735
+ "button",
736
+ {
737
+ className: d(l.tool, {
738
+ [l.active]: a === "shapes" && C === 7
739
+ /* line */
740
+ }),
741
+ onClick: () => {
742
+ const n = r.current.toolController.getPrimaryTools();
743
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
744
+ 7
745
+ /* line */
746
+ ), f(
747
+ 7
748
+ /* line */
749
+ );
750
+ },
751
+ children: /* @__PURE__ */ e(Ie, {})
752
+ }
753
+ ),
754
+ /* @__PURE__ */ e(
755
+ "button",
756
+ {
757
+ className: d(l.tool, {
758
+ [l.active]: a === "shapes" && C === 8
759
+ /* heart */
760
+ }),
761
+ onClick: () => {
762
+ const n = r.current.toolController.getPrimaryTools();
763
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
764
+ 8
765
+ /* heart */
766
+ ), f(
767
+ 8
768
+ /* heart */
769
+ );
770
+ },
771
+ children: /* @__PURE__ */ e(De, {})
772
+ }
773
+ ),
774
+ /* @__PURE__ */ e(
775
+ "button",
776
+ {
777
+ className: d(l.tool, {
778
+ [l.active]: a === "shapes" && C === 9
779
+ /* star */
780
+ }),
781
+ onClick: () => {
782
+ const n = r.current.toolController.getPrimaryTools();
783
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
784
+ 9
785
+ /* star */
786
+ ), f(
787
+ 9
788
+ /* star */
789
+ );
790
+ },
791
+ children: /* @__PURE__ */ e(We, {})
792
+ }
793
+ ),
794
+ /* @__PURE__ */ e(
795
+ "button",
796
+ {
797
+ className: d(l.tool, {
798
+ [l.active]: a === "shapes" && C === 10
799
+ /* cloud */
800
+ }),
801
+ onClick: () => {
802
+ const n = r.current.toolController.getPrimaryTools();
803
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
804
+ 10
805
+ /* cloud */
806
+ ), f(
807
+ 10
808
+ /* cloud */
809
+ );
810
+ },
811
+ children: /* @__PURE__ */ e(Fe, {})
812
+ }
813
+ ),
814
+ /* @__PURE__ */ e(
815
+ "button",
816
+ {
817
+ className: d(l.tool, {
818
+ [l.active]: a === "shapes" && C === 11
819
+ /* parallelogram */
820
+ }),
821
+ onClick: () => {
822
+ const n = r.current.toolController.getPrimaryTools();
823
+ r.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
824
+ 11
825
+ /* parallelogram */
826
+ ), f(
827
+ 11
828
+ /* parallelogram */
829
+ );
830
+ },
831
+ children: /* @__PURE__ */ e(Oe, {})
832
+ }
833
+ ),
834
+ /* @__PURE__ */ e("div", { className: l.line }),
835
+ /* @__PURE__ */ e("button", { className: d(l.tool), onClick: S, children: /* @__PURE__ */ e(Pe, {}) }),
836
+ /* @__PURE__ */ e("button", { className: d(l.tool), onClick: b, children: /* @__PURE__ */ e(qe, {}) }),
837
+ /* @__PURE__ */ e("button", { className: d(l.tool), onClick: B, children: /* @__PURE__ */ e(Re, {}) })
838
+ ] }),
839
+ /* @__PURE__ */ x("div", { className: l.optionsWrap, children: [
840
+ a === "pencil" && /* @__PURE__ */ e(et, { setColorPen: o, setThicknessPen: i }),
841
+ a === "highlighter" && /* @__PURE__ */ e(tt, { setColorHighlight: T }),
842
+ a === "shapes" && /* @__PURE__ */ e(
843
+ ot,
844
+ {
845
+ changeBorderColorShape: H,
846
+ changeColorShape: w,
847
+ changeShape: h,
848
+ onThicknessChange: k
849
+ }
850
+ )
851
+ ] })
852
+ ] }) });
853
+ }
854
+ let I = !1;
855
+ function gt() {
856
+ const t = re(), o = le(lt.name), { isActive: r = void 0, upload: i } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: T } = ne(r), [H, S] = y(!1), w = K(null), h = K(null), k = () => {
857
+ (async () => {
858
+ const s = document.querySelector("#easydrawer");
859
+ s && (w.current = new fe(s, {
860
+ wheelEventsEnabled: !1,
861
+ disableZoom: !0
862
+ }), h.current = Te(w.current), h.current.addDefaultToolWidgets());
863
+ })();
864
+ };
865
+ G(() => {
866
+ H && setTimeout(() => {
867
+ k();
868
+ }, 200);
869
+ }, [H]);
870
+ const b = async () => {
871
+ if (w.current) {
872
+ const m = w.current.toSVG(), s = m.outerHTML, p = `drawer-${Ce()}.svg`;
873
+ let _ = be(m.outerHTML);
874
+ if (i) {
875
+ const R = ge(_, p);
876
+ _ = await i(R);
877
+ }
878
+ t == null || t.chain().focus().setDrawer(
879
+ {
880
+ type: "drawer",
881
+ src: _,
882
+ alt: encodeURIComponent(s),
883
+ width: 426,
884
+ height: 212
885
+ },
886
+ !!s
887
+ ).run();
888
+ }
889
+ S(!1);
890
+ }, B = (m) => {
891
+ const s = w.current.toolController.getPrimaryTools()[2], p = h.current.getWidgetById("pen-1");
892
+ s && p && (s.setColor(m), p.serializeState());
893
+ }, a = (m) => {
894
+ const s = w.current.toolController.getPrimaryTools()[2], p = h.current.getWidgetById("pen-1");
895
+ s && p && (s.setThickness(m), p.serializeState());
896
+ }, c = (m) => {
897
+ const s = w.current.toolController.getPrimaryTools()[3], p = h.current.getWidgetById("pen-2");
898
+ s && p && (s.setColor(m), p.serializeState());
899
+ }, C = (m) => {
900
+ const s = h.current.getWidgetById("shape");
901
+ s && s.setShapeType(m);
902
+ }, f = (m) => {
903
+ const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
904
+ s && p && (s.setColor(m), p.serializeState());
905
+ }, n = (m) => {
906
+ const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
907
+ s && p && (s.setThickness(m), p.serializeState());
908
+ }, F = (m) => {
909
+ const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
910
+ s && p && (s.setBorderColor(m), p.serializeState());
911
+ }, P = () => {
912
+ if (I) {
913
+ for (; w.current.history.redoStackSize > 0; )
914
+ w.current.history.redo();
915
+ I = !1;
916
+ return;
917
+ }
918
+ w.current.history.undo();
919
+ }, D = () => {
920
+ I || w.current.history.redo();
921
+ }, O = () => {
922
+ if (!I) {
923
+ for (; w.current.history.undoStackSize > 0; )
924
+ P();
925
+ I = !0;
926
+ }
927
+ };
928
+ return o ? /* @__PURE__ */ x(ie, { onOpenChange: S, open: H, children: [
929
+ /* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ e(
930
+ ae,
931
+ {
932
+ disabled: T,
933
+ action: () => {
934
+ T || S(!0);
935
+ },
936
+ icon: "PencilRuler",
937
+ tooltip: "Drawer"
938
+ }
939
+ ) }),
940
+ /* @__PURE__ */ x(ce, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
941
+ /* @__PURE__ */ e(he, { children: "Drawer" }),
942
+ /* @__PURE__ */ x(
943
+ "div",
944
+ {
945
+ style: {
946
+ height: "600px",
947
+ width: "100%",
948
+ borderWidth: 1,
949
+ background: "white",
950
+ position: "relative"
951
+ },
952
+ children: [
953
+ /* @__PURE__ */ e("div", { className: "richtext-size-full", id: "easydrawer" }),
954
+ /* @__PURE__ */ e(
955
+ rt,
956
+ {
957
+ changeBorderColorShape: F,
958
+ changeColorShape: f,
959
+ changeShape: C,
960
+ onClear: O,
961
+ onRedo: D,
962
+ onThicknessChange: n,
963
+ onUndo: P,
964
+ refEditor: w,
965
+ setColorHighlight: c,
966
+ setColorPen: B,
967
+ setThicknessPen: a
968
+ }
969
+ )
970
+ ]
971
+ }
972
+ ),
973
+ /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(de, { onClick: b, type: "button", children: "Save changes" }) })
974
+ ] })
975
+ ] }) : /* @__PURE__ */ e(U, {});
976
+ }
977
+ const lt = /* @__PURE__ */ me.extend({
978
+ name: "richTextDrawer",
979
+ //@ts-expect-error
980
+ addOptions() {
981
+ var t;
982
+ return {
983
+ ...(t = this.parent) == null ? void 0 : t.call(this),
984
+ inline: !1,
985
+ content: "",
986
+ marks: "",
987
+ group: "block",
988
+ draggable: !1,
989
+ selectable: !0,
990
+ atom: !0,
991
+ HTMLAttributes: {
992
+ class: "drawer"
993
+ },
994
+ button: ({ t: o, extension: r }) => {
995
+ var i;
996
+ return {
997
+ componentProps: {
998
+ action: () => !0,
999
+ isActive: () => !1,
1000
+ disabled: !1,
1001
+ icon: "PencilRuler",
1002
+ tooltip: o("editor.drawer.tooltip"),
1003
+ upload: (i = r == null ? void 0 : r.options) == null ? void 0 : i.upload
1004
+ }
1005
+ };
1006
+ }
1007
+ };
1008
+ },
1009
+ addAttributes() {
1010
+ var t;
1011
+ return {
1012
+ ...(t = this.parent) == null ? void 0 : t.call(this),
1013
+ width: {
1014
+ default: null,
1015
+ parseHTML: (o) => {
1016
+ const r = o.querySelector("img"), i = r == null ? void 0 : r.getAttribute("width");
1017
+ return i ? Number.parseInt(i, 10) : 320;
1018
+ },
1019
+ renderHTML: (o) => ({
1020
+ width: o.width
1021
+ })
1022
+ },
1023
+ height: {
1024
+ default: null,
1025
+ parseHTML: (o) => {
1026
+ const r = o.querySelector("img"), i = r == null ? void 0 : r.getAttribute("height");
1027
+ return i ? Number.parseInt(i, 10) : 212;
1028
+ },
1029
+ renderHTML: (o) => ({
1030
+ height: o.height
1031
+ })
1032
+ },
1033
+ align: {
1034
+ default: "center",
1035
+ parseHTML: (o) => o.getAttribute("align"),
1036
+ renderHTML: (o) => ({
1037
+ align: o.align
1038
+ })
1039
+ }
1040
+ };
1041
+ },
1042
+ addNodeView() {
1043
+ return we(xe);
1044
+ },
1045
+ // @ts-ignore
1046
+ addCommands() {
1047
+ return {
1048
+ setDrawer: (t, o) => ({ commands: r, editor: i }) => o ? r.insertContent({
1049
+ type: this.name,
1050
+ attrs: t
1051
+ }) : r.insertContentAt(i.state.selection.anchor, {
1052
+ type: this.name,
1053
+ attrs: t
1054
+ }),
1055
+ setAlignImageDrawer: (t) => ({ commands: o }) => o.updateAttributes(this.name, { align: t })
1056
+ };
1057
+ },
1058
+ renderHTML({ HTMLAttributes: t }) {
1059
+ const { align: o } = t;
1060
+ return [
1061
+ "div",
1062
+ // Parent element
1063
+ {
1064
+ style: o ? `text-align: ${o};` : "",
1065
+ class: "imageDrawer"
1066
+ },
1067
+ [
1068
+ "img",
1069
+ te(
1070
+ // @ts-ignore
1071
+ this.options.HTMLAttributes,
1072
+ t
1073
+ )
1074
+ ]
1075
+ ];
1076
+ },
1077
+ parseHTML() {
1078
+ return [
1079
+ {
1080
+ tag: "div[class=imageDrawer]",
1081
+ getAttrs: (t) => {
1082
+ const o = t.querySelector("img"), r = o == null ? void 0 : o.getAttribute("width"), i = o == null ? void 0 : o.getAttribute("height");
1083
+ return {
1084
+ src: o == null ? void 0 : o.getAttribute("src"),
1085
+ alt: o == null ? void 0 : o.getAttribute("alt"),
1086
+ width: r ? Number.parseInt(r, 10) : null,
1087
+ height: i ? Number.parseInt(i, 10) : null,
1088
+ align: (o == null ? void 0 : o.getAttribute("align")) || t.style.textAlign || null
1089
+ };
1090
+ }
1091
+ }
1092
+ ];
1093
+ }
1094
+ });
1095
+ export {
1096
+ rt as C,
1097
+ lt as D,
1098
+ gt as R
1099
+ };