reactjs-tiptap-editor 1.0.16 → 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 (263) hide show
  1. package/lib/{ActionMenuButton-a8LhmHXe.js → ActionMenuButton-BOjCHFTA.js} +12 -16
  2. package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +47 -89
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +11 -14
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +13 -16
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +15 -18
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +113 -113
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +12 -14
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +8 -11
  17. package/lib/CodeBlock.cjs +37 -37
  18. package/lib/CodeBlock.js +1566 -1613
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +9 -11
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +62 -82
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +27 -15
  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 +71 -97
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +265 -5
  33. package/lib/ExportPdf.cjs +4 -4
  34. package/lib/ExportPdf.js +20 -31
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +11 -11
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +16 -39
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +25 -41
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +51 -65
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +60 -76
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +322 -320
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +8 -11
  49. package/lib/{Iframe-CmjbQQcz.js → Iframe-AhNV5WH5.js} +52 -65
  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 -5
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +148 -181
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +19 -26
  59. package/lib/{Indent-BoG-vpIE.js → Indent-DZ5PcJA4.js} +24 -30
  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 +11 -14
  65. package/lib/Katex-CIC9ygbL.cjs +4 -0
  66. package/lib/{Katex-ByL9snce.js → Katex-bIgoenn_.js} +243 -262
  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 +23 -34
  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-Ckih17pU.js → LinkEditBlock-D_cF9fnc.js} +324 -381
  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 +125 -154
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +28 -40
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +13 -16
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +114 -186
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +15 -14
  89. package/lib/SlashCommandNodeView-Ba03hlVZ.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-cg0x3NRF.js} +72 -79
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +12 -15
  93. package/lib/{Table-BEwrZVup.js → Table-KqLiT5wG.js} +85 -125
  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 +18 -21
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +65 -78
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +51 -77
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -10
  105. package/lib/Twitter-BIiR78Jh.cjs +1 -0
  106. package/lib/{Twitter-4U_ZBhpv.js → Twitter-C1Lzqc7u.js} +567 -599
  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 +5 -270
  111. package/lib/bubble.cjs +6 -4
  112. package/lib/bubble.js +3719 -3039
  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/ReactBus.d.ts +11 -0
  119. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
  120. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
  121. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
  122. package/lib/components/ui/checkbox.d.ts +1 -1
  123. package/lib/components/ui/dialog.d.ts +1 -1
  124. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  125. package/lib/components/ui/emoji-picker.d.ts +1 -1
  126. package/lib/components/ui/label.d.ts +1 -1
  127. package/lib/components/ui/popover.d.ts +1 -1
  128. package/lib/components/ui/select.d.ts +1 -1
  129. package/lib/components/ui/separator.d.ts +1 -1
  130. package/lib/components/ui/switch.d.ts +1 -1
  131. package/lib/components/ui/tabs.d.ts +1 -1
  132. package/lib/components/ui/toast.d.ts +1 -1
  133. package/lib/components/ui/toggle.d.ts +1 -1
  134. package/lib/components/ui/tooltip.d.ts +1 -1
  135. package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
  136. package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-CexIkt_V.js} +8 -8
  137. package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
  138. package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
  139. package/lib/extensions/Bold/Bold.d.ts +1 -1
  140. package/lib/extensions/Code/Code.d.ts +1 -1
  141. package/lib/extensions/CodeView/CodeView.d.ts +2 -2
  142. package/lib/extensions/Heading/Heading.d.ts +1 -1
  143. package/lib/extensions/Highlight/Highlight.d.ts +1 -1
  144. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
  145. package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
  146. package/lib/extensions/Italic/Italic.d.ts +1 -1
  147. package/lib/extensions/Link/Link.d.ts +1 -1
  148. package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
  149. package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
  150. package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
  151. package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
  152. package/lib/extensions/Strike/Strike.d.ts +1 -1
  153. package/lib/extensions/Table/Table.d.ts +1 -1
  154. package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
  155. package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
  156. package/lib/index-BUTn2LY6.cjs +1 -0
  157. package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
  158. package/lib/{index-CpTykZBR.js → index-BnW6t8z6.js} +23 -23
  159. package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
  160. package/lib/index-BtxvYLJ1.cjs +12 -0
  161. package/lib/{index-DR5tIdL7.js → index-C6xmkxrQ.js} +232 -217
  162. package/lib/index-CJ9pyCM4.cjs +1 -0
  163. package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
  164. package/lib/index-DHUN85fV.js +4855 -0
  165. package/lib/index-DUpSE1Gb.cjs +1 -0
  166. package/lib/index-D_8P0LE5.js +1362 -0
  167. package/lib/{index-4bHF5ovf.js → index-RIXs7STX.js} +1 -1
  168. package/lib/index-mfGK4pFo.js +6469 -0
  169. package/lib/index-zig3Dj7A.cjs +22 -0
  170. package/lib/index.cjs +3 -3
  171. package/lib/index.js +60 -72
  172. package/lib/locale-bundle.cjs +1 -1
  173. package/lib/locale-bundle.js +1 -1
  174. package/lib/plugins/image-upload.d.ts +1 -1
  175. package/lib/popover-BYSZ3zBi.js +24 -0
  176. package/lib/popover-BcHDZqBt.cjs +1 -0
  177. package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BrM5kUj_.js} +2 -2
  178. package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
  179. package/lib/{select-F0ZZ3VZB.js → select-C5SHDLFj.js} +8 -5
  180. package/lib/{select-Doa_-jkZ.cjs → select-DHjzKkcu.cjs} +1 -1
  181. package/lib/separator-BmixLrnJ.cjs +1 -0
  182. package/lib/separator-CFKVxAea.js +293 -0
  183. package/lib/store/editor.d.ts +1 -1
  184. package/lib/store/store.d.ts +2 -22
  185. package/lib/style.css +1 -1
  186. package/lib/{textarea-BAolHF_W.cjs → textarea-CasDcv3u.cjs} +1 -1
  187. package/lib/{textarea-tOsPnxHf.js → textarea-DNLrJoRl.js} +1 -1
  188. package/lib/theme.js +1 -1
  189. package/lib/types.d.ts +3 -3
  190. package/lib/updatePosition-CBRjbQMH.js +16 -0
  191. package/lib/updatePosition-CfmY5Trk.cjs +1 -0
  192. package/lib/utils/checkIsVideoUrl.d.ts +1 -0
  193. package/lib/utils/columns.d.ts +1 -1
  194. package/lib/utils/customEvents/events.constant.d.ts +1 -0
  195. package/lib/utils/mitt.d.ts +6 -3
  196. package/lib/utils/pdf.d.ts +1 -1
  197. package/lib/utils/utils.d.ts +1 -1
  198. package/package.json +262 -247
  199. package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
  200. package/lib/Drawer-CbOJ1Igo.js +0 -1379
  201. package/lib/Drawer-DNaDMoAk.cjs +0 -1
  202. package/lib/Excalidraw-DnHTVOj8.js +0 -355
  203. package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
  204. package/lib/Icon-C0TJMAOm.js +0 -12
  205. package/lib/Icon-DzK0_ztP.cjs +0 -1
  206. package/lib/Iframe-BSNCsofW.cjs +0 -1
  207. package/lib/Image-BZEFuS0P.js +0 -925
  208. package/lib/Image-iKsGKjvg.cjs +0 -1
  209. package/lib/Indent-Bou16OcB.cjs +0 -1
  210. package/lib/Katex-BqDocr3a.cjs +0 -4
  211. package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
  212. package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
  213. package/lib/Table-BclWwp6P.cjs +0 -9
  214. package/lib/Twitter-Dtq6PEMC.cjs +0 -1
  215. package/lib/button-Bwn6gUuS.js +0 -43
  216. package/lib/button-CqJztfH2.cjs +0 -1
  217. package/lib/checkbox-BAzbZY2Y.cjs +0 -1
  218. package/lib/checkbox-B_rpz5Xq.js +0 -27
  219. package/lib/clsx-CXbNJWDD.cjs +0 -54
  220. package/lib/clsx-DSzxBzvL.js +0 -7391
  221. package/lib/dialog-CJvpoeMm.js +0 -101
  222. package/lib/dialog-CWYTvz5J.cjs +0 -1
  223. package/lib/events.constant-Dq21NPdV.cjs +0 -1
  224. package/lib/events.constant-do95b767.js +0 -21
  225. package/lib/extensions/Image/store.d.ts +0 -4
  226. package/lib/extensions/Video/store.d.ts +0 -4
  227. package/lib/file-BLas99n7.js +0 -43
  228. package/lib/file-i7e4nQY2.cjs +0 -1
  229. package/lib/index-BCzvbrf5.cjs +0 -12
  230. package/lib/index-CL7JP-Xz.js +0 -426
  231. package/lib/index-CjhjjJsN.cjs +0 -1
  232. package/lib/index-Cn-t3Zxw.cjs +0 -1
  233. package/lib/index-Cs6cp0Y6.cjs +0 -1
  234. package/lib/index-D8li6EQ4.js +0 -1351
  235. package/lib/index-DoiuU6VA.js +0 -2315
  236. package/lib/index-VhKd73hZ.cjs +0 -1
  237. package/lib/input-B1egKb-t.js +0 -21
  238. package/lib/input-ZGRt7lWR.cjs +0 -1
  239. package/lib/isNumber-BTYSVlKo.cjs +0 -1
  240. package/lib/isNumber-ClwLypY2.js +0 -15
  241. package/lib/label-Cjrzc5H2.js +0 -19
  242. package/lib/label-tzSPdqui.cjs +0 -1
  243. package/lib/popover-C6Cya3Cz.cjs +0 -1
  244. package/lib/popover-CeY3RbI5.js +0 -24
  245. package/lib/separator-CUh5Y7Rh.cjs +0 -1
  246. package/lib/separator-Cjn4YH8a.js +0 -329
  247. package/lib/store/fast-context.d.ts +0 -7
  248. package/lib/store-BsJz5QRC.js +0 -10
  249. package/lib/store-DjkMIIEN.cjs +0 -1
  250. package/lib/tabs-BP8ypR_m.cjs +0 -1
  251. package/lib/tabs-CBDjOLl_.js +0 -46
  252. package/lib/throttle-D040PfWL.js +0 -249
  253. package/lib/throttle-gTTvqDTW.cjs +0 -1
  254. package/lib/toggle-C_SSvDRy.cjs +0 -1
  255. package/lib/toggle-DEerYRil.js +0 -99
  256. package/lib/tooltip-BJIvosho.js +0 -24
  257. package/lib/tooltip-FS1rsvd3.cjs +0 -1
  258. package/lib/updatePosition-CDK7OR0i.js +0 -16
  259. package/lib/updatePosition-Cjuj2E26.cjs +0 -1
  260. package/lib/useButtonProps-CtZCbMQu.js +0 -136
  261. package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
  262. package/lib/utils/_event.d.ts +0 -13
  263. package/lib/utils/customEvents/customEvents.d.ts +0 -3
@@ -1,1379 +0,0 @@
1
- import { h as te, u as Z, m as re, k as oe } from "./clsx-DSzxBzvL.js";
2
- import { a as X, c as le } from "./throttle-D040PfWL.js";
3
- import { jsx as e, jsxs as x, Fragment as U } from "react/jsx-runtime";
4
- import { useState as y, useMemo as V, useCallback as R, useEffect as G, useRef as K } from "react";
5
- import { I as Q, i as Y, j as ne } from "./index-C07N8gA1.js";
6
- import { j as ie, c as se, u as ae, a as ce } from "./useButtonProps-CtZCbMQu.js";
7
- import { Color4 as g, Editor as he, makeDropdownToolbar as ue } from "easydrawer";
8
- import { s as de, i as ge } from "./shortId-WJVkrvml.js";
9
- import { A as me } from "./toggle-DEerYRil.js";
10
- import { D as pe, a as we, b as ve, c as fe, d as Te } from "./dialog-CJvpoeMm.js";
11
- import { c as d } from "./index-DoiuU6VA.js";
12
- import { d as Ce } from "./file-BLas99n7.js";
13
- import { B as be } from "./button-Bwn6gUuS.js";
14
- const W = {
15
- TOP_LEFT: "tl",
16
- TOP_RIGHT: "tr",
17
- BOTTOM_LEFT: "bl",
18
- BOTTOM_RIGHT: "br"
19
- };
20
- function xe({ editor: t, node: r, updateAttributes: o, getPos: i, selected: T }) {
21
- const [H, N] = y({
22
- width: Q,
23
- height: Q
24
- }), [w, h] = y({
25
- width: 0,
26
- height: 0
27
- }), [k] = y([
28
- W.TOP_LEFT,
29
- W.TOP_RIGHT,
30
- W.BOTTOM_LEFT,
31
- W.BOTTOM_RIGHT
32
- ]), [b, B] = y(!1), [a, c] = y({
33
- x: 0,
34
- y: 0,
35
- w: 0,
36
- h: 0,
37
- dir: ""
38
- }), { align: C } = r == null ? void 0 : r.attrs, f = V(() => {
39
- const { src: u, alt: E, width: L, height: _ } = r == null ? void 0 : r.attrs, A = Z(L) ? `${L}px` : L, v = Z(_) ? `${_}px` : _;
40
- return {
41
- src: u || void 0,
42
- alt: E || void 0,
43
- style: {
44
- width: A || void 0,
45
- height: v || void 0
46
- }
47
- };
48
- }, [r == null ? void 0 : r.attrs]), n = V(() => {
49
- const {
50
- style: { width: u }
51
- } = f;
52
- return { width: u === "100%" ? u : void 0 };
53
- }, [f]);
54
- function F(u) {
55
- h({
56
- width: u.target.width,
57
- height: u.target.height
58
- });
59
- }
60
- function P() {
61
- t.commands.setNodeSelection(i());
62
- }
63
- const D = R(
64
- X(() => {
65
- const { width: u } = getComputedStyle(t.view.dom);
66
- N((E) => ({
67
- ...E,
68
- width: Number.parseInt(u, 10)
69
- }));
70
- }, Y),
71
- [t]
72
- );
73
- function O(u, E) {
74
- u.preventDefault(), u.stopPropagation();
75
- const L = w.width, _ = w.height, A = L / _;
76
- let v = Number(r.attrs.width), S = Number(r.attrs.height);
77
- const M = H.width;
78
- v && !S ? (v = v > M ? M : v, S = Math.round(v / A)) : S && !v ? (v = Math.round(S * A), v = v > M ? M : v) : !v && !S ? (v = L > M ? M : L, S = Math.round(v / A)) : v = v > M ? M : v, B(!0), c({
79
- x: u.clientX,
80
- y: u.clientY,
81
- w: v,
82
- h: S,
83
- dir: E
84
- });
85
- }
86
- const m = R(
87
- X((u) => {
88
- if (u.preventDefault(), u.stopPropagation(), !b)
89
- return;
90
- const { x: E, w: L, dir: _ } = a, A = (u.clientX - E) * (/l/.test(_) ? -1 : 1), { width: v, height: S } = r == null ? void 0 : r.attrs, M = v / S, j = ie(L + A, ne, H.width), ee = Math.round(j / M);
91
- o({
92
- width: j,
93
- height: ee
94
- });
95
- }, Y),
96
- [b, a, H, o, r == null ? void 0 : r.attrs]
97
- ), s = R(
98
- (u) => {
99
- u.preventDefault(), u.stopPropagation(), b && (c({
100
- x: 0,
101
- y: 0,
102
- w: 0,
103
- h: 0,
104
- dir: ""
105
- }), B(!1), P());
106
- },
107
- [b, P]
108
- ), p = R(() => {
109
- document == null || document.addEventListener("mousemove", m, !0), document == null || document.addEventListener("mouseup", s, !0);
110
- }, [m, s]), z = R(() => {
111
- document == null || document.removeEventListener("mousemove", m, !0), document == null || document.removeEventListener("mouseup", s, !0);
112
- }, [m, s]);
113
- G(() => (b ? p() : z(), () => {
114
- z();
115
- }), [b, p, z]);
116
- const q = V(() => new ResizeObserver(() => D()), [D]);
117
- return G(() => (q.observe(t.view.dom), () => {
118
- q.disconnect();
119
- }), [t.view.dom, q]), /* @__PURE__ */ e(
120
- te,
121
- {
122
- className: "image-view",
123
- style: { ...n, width: "100%", textAlign: C },
124
- children: /* @__PURE__ */ x(
125
- "div",
126
- {
127
- "data-drag-handle": !0,
128
- draggable: "true",
129
- style: { ...n, background: "#fff" },
130
- className: `image-view__body ${T ? "image-view__body--focused" : ""} ${b ? "image-view__body--resizing" : ""}`,
131
- children: [
132
- /* @__PURE__ */ e(
133
- "img",
134
- {
135
- alt: f.alt,
136
- className: "image-view__body__image block",
137
- height: "auto",
138
- onClick: P,
139
- onLoad: F,
140
- src: f.src,
141
- style: f.style
142
- }
143
- ),
144
- t.view.editable && (T || b) && /* @__PURE__ */ e("div", { className: "image-resizer", children: k == null ? void 0 : k.map((u) => /* @__PURE__ */ e(
145
- "span",
146
- {
147
- className: `image-resizer__handler image-resizer__handler--${u}`,
148
- onMouseDown: (E) => O(E, u)
149
- },
150
- `image-dir-${u}`
151
- )) })
152
- ]
153
- }
154
- )
155
- }
156
- );
157
- }
158
- const ye = "_wrapper_rraz2_1", Me = "_tool_rraz2_17", He = "_active_rraz2_37", Ee = "_pen_rraz2_41", Le = "_line_rraz2_48", Se = "_options_rraz2_56", Ne = "_colorWrap_rraz2_66", ke = "_color_rraz2_66", ze = "_colorActive_rraz2_83", l = {
159
- wrapper: ye,
160
- tool: Me,
161
- active: He,
162
- pen: Ee,
163
- line: Le,
164
- options: Se,
165
- colorWrap: Ne,
166
- color: ke,
167
- colorActive: ze
168
- };
169
- function _e(t) {
170
- return /* @__PURE__ */ e(
171
- "svg",
172
- {
173
- height: "1em",
174
- viewBox: "0 0 24 24",
175
- width: "1em",
176
- xmlns: "http://www.w3.org/2000/svg",
177
- ...t,
178
- children: /* @__PURE__ */ e(
179
- "path",
180
- {
181
- color: "currentColor",
182
- 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",
183
- fill: "none",
184
- stroke: "currentColor",
185
- strokeLinecap: "round",
186
- strokeLinejoin: "round",
187
- strokeWidth: "1.5"
188
- }
189
- )
190
- }
191
- );
192
- }
193
- function Ae(t) {
194
- return /* @__PURE__ */ e(
195
- "svg",
196
- {
197
- height: "1em",
198
- viewBox: "0 0 24 24",
199
- width: "1em",
200
- xmlns: "http://www.w3.org/2000/svg",
201
- ...t,
202
- children: /* @__PURE__ */ e(
203
- "path",
204
- {
205
- 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",
206
- fill: "currentColor"
207
- }
208
- )
209
- }
210
- );
211
- }
212
- function Be(t) {
213
- return /* @__PURE__ */ e(
214
- "svg",
215
- {
216
- height: "1em",
217
- viewBox: "0 0 24 24",
218
- width: "1em",
219
- xmlns: "http://www.w3.org/2000/svg",
220
- ...t,
221
- children: /* @__PURE__ */ e(
222
- "path",
223
- {
224
- 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",
225
- fill: "currentColor"
226
- }
227
- )
228
- }
229
- );
230
- }
231
- function Pe(t) {
232
- return /* @__PURE__ */ e(
233
- "svg",
234
- {
235
- height: "1em",
236
- viewBox: "0 0 256 256",
237
- width: "1em",
238
- xmlns: "http://www.w3.org/2000/svg",
239
- ...t,
240
- children: /* @__PURE__ */ e(
241
- "path",
242
- {
243
- 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",
244
- fill: "currentColor"
245
- }
246
- )
247
- }
248
- );
249
- }
250
- function qe(t) {
251
- return /* @__PURE__ */ x(
252
- "svg",
253
- {
254
- height: "1em",
255
- viewBox: "0 0 16 16",
256
- width: "1em",
257
- xmlns: "http://www.w3.org/2000/svg",
258
- ...t,
259
- children: [
260
- /* @__PURE__ */ e(
261
- "path",
262
- {
263
- 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",
264
- fill: "currentColor"
265
- }
266
- ),
267
- /* @__PURE__ */ e(
268
- "path",
269
- {
270
- 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",
271
- fill: "currentColor"
272
- }
273
- )
274
- ]
275
- }
276
- );
277
- }
278
- function Re(t) {
279
- return /* @__PURE__ */ e(
280
- "svg",
281
- {
282
- height: "1em",
283
- viewBox: "0 0 24 24",
284
- width: "1em",
285
- xmlns: "http://www.w3.org/2000/svg",
286
- ...t,
287
- children: /* @__PURE__ */ e(
288
- "path",
289
- {
290
- d: "M3 3h18v18H3zm2 2v14h14V5z",
291
- fill: "currentColor"
292
- }
293
- )
294
- }
295
- );
296
- }
297
- function Ie(t) {
298
- return /* @__PURE__ */ e(
299
- "svg",
300
- {
301
- height: "1em",
302
- viewBox: "0 0 24 24",
303
- width: "1em",
304
- xmlns: "http://www.w3.org/2000/svg",
305
- ...t,
306
- children: /* @__PURE__ */ e(
307
- "path",
308
- {
309
- d: "M2 20V4h20v16zm2-2h16V6H4zm0 0V6z",
310
- fill: "currentColor"
311
- }
312
- )
313
- }
314
- );
315
- }
316
- function De(t) {
317
- return /* @__PURE__ */ e(
318
- "svg",
319
- {
320
- height: "1em",
321
- viewBox: "0 0 24 24",
322
- width: "1em",
323
- xmlns: "http://www.w3.org/2000/svg",
324
- ...t,
325
- children: /* @__PURE__ */ e(
326
- "path",
327
- {
328
- 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",
329
- fill: "currentColor"
330
- }
331
- )
332
- }
333
- );
334
- }
335
- function We(t) {
336
- return /* @__PURE__ */ e(
337
- "svg",
338
- {
339
- height: "1em",
340
- viewBox: "0 0 24 24",
341
- width: "1em",
342
- xmlns: "http://www.w3.org/2000/svg",
343
- ...t,
344
- children: /* @__PURE__ */ e(
345
- "path",
346
- {
347
- 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",
348
- fill: "none",
349
- stroke: "currentColor",
350
- strokeLinecap: "round",
351
- strokeLinejoin: "round",
352
- strokeWidth: "2"
353
- }
354
- )
355
- }
356
- );
357
- }
358
- function Fe(t) {
359
- return /* @__PURE__ */ e(
360
- "svg",
361
- {
362
- height: "1em",
363
- viewBox: "0 0 24 24",
364
- width: "1em",
365
- xmlns: "http://www.w3.org/2000/svg",
366
- ...t,
367
- children: /* @__PURE__ */ e(
368
- "path",
369
- {
370
- 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",
371
- fill: "currentColor"
372
- }
373
- )
374
- }
375
- );
376
- }
377
- function Oe(t) {
378
- return /* @__PURE__ */ e(
379
- "svg",
380
- {
381
- height: "1em",
382
- viewBox: "0 0 24 24",
383
- width: "1em",
384
- xmlns: "http://www.w3.org/2000/svg",
385
- ...t,
386
- children: /* @__PURE__ */ x(
387
- "g",
388
- {
389
- fill: "none",
390
- fillRule: "evenodd",
391
- children: [
392
- /* @__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" }),
393
- /* @__PURE__ */ e(
394
- "path",
395
- {
396
- 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",
397
- fill: "currentColor"
398
- }
399
- )
400
- ]
401
- }
402
- )
403
- }
404
- );
405
- }
406
- function Ve(t) {
407
- return /* @__PURE__ */ e(
408
- "svg",
409
- {
410
- height: "1em",
411
- viewBox: "0 0 24 24",
412
- width: "1em",
413
- xmlns: "http://www.w3.org/2000/svg",
414
- ...t,
415
- children: /* @__PURE__ */ e(
416
- "path",
417
- {
418
- d: "M16.01 11H4v2h12.01v3L20 12l-3.99-4z",
419
- fill: "currentColor"
420
- }
421
- )
422
- }
423
- );
424
- }
425
- function Ge(t) {
426
- return /* @__PURE__ */ e(
427
- "svg",
428
- {
429
- height: "1em",
430
- viewBox: "0 0 24 24",
431
- width: "1em",
432
- xmlns: "http://www.w3.org/2000/svg",
433
- ...t,
434
- children: /* @__PURE__ */ e(
435
- "path",
436
- {
437
- clipRule: "evenodd",
438
- 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",
439
- fill: "currentColor",
440
- fillRule: "evenodd"
441
- }
442
- )
443
- }
444
- );
445
- }
446
- function $e(t) {
447
- return /* @__PURE__ */ e(
448
- "svg",
449
- {
450
- height: "1em",
451
- viewBox: "0 0 24 24",
452
- width: "1em",
453
- xmlns: "http://www.w3.org/2000/svg",
454
- ...t,
455
- children: /* @__PURE__ */ e(
456
- "path",
457
- {
458
- clipRule: "evenodd",
459
- 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",
460
- fill: "currentColor",
461
- fillRule: "evenodd"
462
- }
463
- )
464
- }
465
- );
466
- }
467
- function Ue(t) {
468
- return /* @__PURE__ */ e(
469
- "svg",
470
- {
471
- height: "1em",
472
- viewBox: "0 0 24 24",
473
- width: "1em",
474
- xmlns: "http://www.w3.org/2000/svg",
475
- ...t,
476
- children: /* @__PURE__ */ e(
477
- "path",
478
- {
479
- d: "M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zm2-4h2V8H9zm4 0h2V8h-2z",
480
- fill: "currentColor"
481
- }
482
- )
483
- }
484
- );
485
- }
486
- function je(t) {
487
- return /* @__PURE__ */ e(
488
- "svg",
489
- {
490
- height: "1em",
491
- viewBox: "0 0 256 256",
492
- width: "1em",
493
- xmlns: "http://www.w3.org/2000/svg",
494
- ...t,
495
- children: /* @__PURE__ */ e(
496
- "path",
497
- {
498
- 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",
499
- fill: "currentColor"
500
- }
501
- )
502
- }
503
- );
504
- }
505
- function Ze(t) {
506
- return /* @__PURE__ */ e(
507
- "svg",
508
- {
509
- height: "1em",
510
- viewBox: "0 0 24 24",
511
- width: "1em",
512
- xmlns: "http://www.w3.org/2000/svg",
513
- ...t,
514
- children: /* @__PURE__ */ e(
515
- "path",
516
- {
517
- 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",
518
- fill: "currentColor"
519
- }
520
- )
521
- }
522
- );
523
- }
524
- function Xe(t) {
525
- return /* @__PURE__ */ e(
526
- "svg",
527
- {
528
- height: "1em",
529
- viewBox: "0 0 24 24",
530
- width: "1em",
531
- xmlns: "http://www.w3.org/2000/svg",
532
- ...t,
533
- children: /* @__PURE__ */ e(
534
- "path",
535
- {
536
- 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",
537
- fill: "currentColor"
538
- }
539
- )
540
- }
541
- );
542
- }
543
- function Ke(t) {
544
- return /* @__PURE__ */ e(
545
- "svg",
546
- {
547
- height: "1em",
548
- viewBox: "0 0 24 24",
549
- width: "1em",
550
- xmlns: "http://www.w3.org/2000/svg",
551
- ...t,
552
- children: /* @__PURE__ */ e(
553
- "path",
554
- {
555
- 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",
556
- fill: "currentColor"
557
- }
558
- )
559
- }
560
- );
561
- }
562
- function Qe(t) {
563
- return /* @__PURE__ */ e(
564
- "svg",
565
- {
566
- height: "1em",
567
- viewBox: "0 0 24 24",
568
- width: "1em",
569
- xmlns: "http://www.w3.org/2000/svg",
570
- ...t,
571
- children: /* @__PURE__ */ e(
572
- "path",
573
- {
574
- 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",
575
- fill: "none",
576
- stroke: "currentColor",
577
- strokeWidth: "2"
578
- }
579
- )
580
- }
581
- );
582
- }
583
- const Ye = [
584
- g.blackHighlight,
585
- g.ofRGBA(166 / 255, 81 / 255, 167 / 255, 0.3),
586
- g.ofRGBA(247 / 255, 78 / 255, 158 / 255, 0.3),
587
- g.ofRGBA(166 / 255, 83 / 255, 88 / 255, 0.3),
588
- g.ofRGBA(246 / 255, 130 / 255, 28 / 255, 0.3),
589
- g.ofRGBA(166 / 255, 198 / 255, 0, 0.3),
590
- g.ofRGBA(98 / 255, 186 / 255, 70 / 255, 0.3)
591
- ], J = [
592
- g.black,
593
- g.fromHex("#007AFF"),
594
- g.fromHex("#A651A7"),
595
- g.fromHex("#F74E9E"),
596
- g.fromHex("#FF5358"),
597
- g.fromHex("#F6821C"),
598
- g.fromHex("#FFC600"),
599
- g.fromHex("#62BA46"),
600
- g.fromHex("#E6BFE8"),
601
- g.fromHex("#FEA3D2"),
602
- g.fromHex("#FFA0A3"),
603
- g.fromHex("#FBC276"),
604
- g.fromHex("#FFFB85"),
605
- g.fromHex("#AADC99")
606
- ];
607
- function Je({ onChange: t }) {
608
- const [r, o] = y(g.blackHighlight);
609
- return /* @__PURE__ */ e("div", { className: l.colorWrap, children: Ye.map((i, T) => /* @__PURE__ */ e(
610
- "button",
611
- {
612
- style: { backgroundColor: i.toHexString() },
613
- className: d(l.color, {
614
- [l.colorActive]: r.toHexString() === i.toHexString()
615
- }),
616
- onClick: () => {
617
- o(i), t(i);
618
- }
619
- },
620
- T
621
- )) });
622
- }
623
- function $({ onChange: t }) {
624
- const [r, o] = y(g.black);
625
- return /* @__PURE__ */ x(U, { children: [
626
- /* @__PURE__ */ e("div", { className: l.colorWrap, children: J.slice(0, 7).map((i, T) => /* @__PURE__ */ e(
627
- "button",
628
- {
629
- style: { backgroundColor: i.toHexString() },
630
- className: d(l.color, {
631
- [l.colorActive]: r.toHexString() === i.toHexString()
632
- }),
633
- onClick: () => {
634
- o(i), t(i);
635
- }
636
- },
637
- T
638
- )) }),
639
- /* @__PURE__ */ e("div", { className: l.colorWrap, children: J.slice(7).map((i, T) => /* @__PURE__ */ e(
640
- "button",
641
- {
642
- style: { backgroundColor: i.toHexString() },
643
- className: d(l.color, {
644
- [l.colorActive]: r.toHexString() === i.toHexString()
645
- }),
646
- onClick: () => {
647
- o(i), t(i);
648
- }
649
- },
650
- T
651
- )) })
652
- ] });
653
- }
654
- function et({ setColorPen: t, setThicknessPen: r }) {
655
- const [o, i] = y(2);
656
- return /* @__PURE__ */ x("div", { className: l.options, children: [
657
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
658
- $,
659
- {
660
- onChange: (T) => t(T)
661
- }
662
- ) }),
663
- /* @__PURE__ */ e("div", { className: l.line }),
664
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
665
- "input",
666
- {
667
- max: 10,
668
- min: 1,
669
- step: 0.1,
670
- type: "range",
671
- value: o,
672
- onChange: (T) => {
673
- r(Number.parseFloat(T.target.value)), i(Number.parseFloat(T.target.value));
674
- }
675
- }
676
- ) })
677
- ] });
678
- }
679
- function tt({ setColorHighlight: t }) {
680
- return /* @__PURE__ */ e("div", { className: l.options, children: /* @__PURE__ */ e(
681
- Je,
682
- {
683
- onChange: (r) => t(r)
684
- }
685
- ) });
686
- }
687
- function rt({
688
- changeColorShape: t,
689
- changeBorderColorShape: r,
690
- onThicknessChange: o
691
- }) {
692
- return /* @__PURE__ */ x("div", { className: l.options, children: [
693
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
694
- $,
695
- {
696
- onChange: (i) => t(i)
697
- }
698
- ) }),
699
- /* @__PURE__ */ e("div", { className: l.line }),
700
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
701
- $,
702
- {
703
- onChange: (i) => r(i)
704
- }
705
- ) }),
706
- /* @__PURE__ */ e("div", { className: l.line }),
707
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
708
- "input",
709
- {
710
- defaultValue: 0,
711
- max: 20,
712
- min: 0,
713
- step: 1,
714
- type: "range",
715
- onChange: (i) => {
716
- o(Number.parseFloat(i.target.value));
717
- }
718
- }
719
- ) })
720
- ] });
721
- }
722
- function ot(t) {
723
- const {
724
- setColorPen: r,
725
- refEditor: o,
726
- setThicknessPen: i,
727
- setColorHighlight: T,
728
- changeBorderColorShape: H,
729
- onUndo: N,
730
- changeColorShape: w,
731
- changeShape: h,
732
- onThicknessChange: k,
733
- onRedo: b,
734
- onClear: B
735
- } = t, [a, c] = y(null), [C, f] = y(
736
- 0
737
- /* square */
738
- );
739
- return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ x(
740
- "div",
741
- {
742
- className: l.wrapper,
743
- children: [
744
- /* @__PURE__ */ x("div", { className: l.pen, children: [
745
- /* @__PURE__ */ e(
746
- "button",
747
- {
748
- className: d(l.tool, {
749
- [l.active]: a === "select"
750
- }),
751
- onClick: () => {
752
- const n = o.current.toolController.getPrimaryTools();
753
- if (a === "select") {
754
- c(null), n[0].setEnabled(!1);
755
- return;
756
- }
757
- c("select"), n[0].setEnabled(!0);
758
- },
759
- children: /* @__PURE__ */ e(_e, {})
760
- }
761
- ),
762
- /* @__PURE__ */ e("div", { className: l.line }),
763
- /* @__PURE__ */ e(
764
- "button",
765
- {
766
- className: d(l.tool, {
767
- [l.active]: a === "text"
768
- }),
769
- onClick: () => {
770
- const n = o.current.toolController.getPrimaryTools();
771
- if (o.current.toolController.setToolEnabled(n[1]), a === "text") {
772
- n[1].setEnabled(!1), c(null);
773
- return;
774
- }
775
- c("text"), n[1].setEnabled(!0);
776
- },
777
- children: /* @__PURE__ */ e(Ae, {})
778
- }
779
- ),
780
- /* @__PURE__ */ e("div", { className: l.line }),
781
- /* @__PURE__ */ e(
782
- "button",
783
- {
784
- className: d(l.tool, {
785
- [l.active]: a === "pencil"
786
- }),
787
- onClick: () => {
788
- const n = o.current.toolController.getPrimaryTools();
789
- if (a === "pencil") {
790
- c(null), n[2].setEnabled(!1);
791
- return;
792
- }
793
- c("pencil"), n[2].setEnabled(!0);
794
- },
795
- children: /* @__PURE__ */ e(Be, {})
796
- }
797
- ),
798
- /* @__PURE__ */ e(
799
- "button",
800
- {
801
- className: d(l.tool, {
802
- [l.active]: a === "highlighter"
803
- }),
804
- onClick: () => {
805
- const n = o.current.toolController.getPrimaryTools();
806
- if (a === "highlighter") {
807
- c(null), n[3].setEnabled(!1);
808
- return;
809
- }
810
- c("highlighter"), n[3].setEnabled(!0);
811
- },
812
- children: /* @__PURE__ */ e(Pe, {})
813
- }
814
- ),
815
- /* @__PURE__ */ e("div", { className: l.line }),
816
- /* @__PURE__ */ e(
817
- "button",
818
- {
819
- className: d(l.tool, {
820
- [l.active]: a === "eraser"
821
- }),
822
- onClick: () => {
823
- const n = o.current.toolController.getPrimaryTools();
824
- if (a === "eraser") {
825
- c(null), n[4].setEnabled(!1);
826
- return;
827
- }
828
- c("eraser"), n[4].setEnabled(!0);
829
- },
830
- children: /* @__PURE__ */ e(qe, {})
831
- }
832
- ),
833
- /* @__PURE__ */ e("div", { className: l.line }),
834
- /* @__PURE__ */ e(
835
- "button",
836
- {
837
- className: d(l.tool, {
838
- [l.active]: a === "shapes" && C === 0
839
- /* square */
840
- }),
841
- onClick: () => {
842
- const n = o.current.toolController.getPrimaryTools();
843
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
844
- 0
845
- /* square */
846
- ), f(
847
- 0
848
- /* square */
849
- );
850
- },
851
- children: /* @__PURE__ */ e(Re, {})
852
- }
853
- ),
854
- /* @__PURE__ */ e(
855
- "button",
856
- {
857
- className: d(l.tool, {
858
- [l.active]: a === "shapes" && C === 1
859
- /* rectangle */
860
- }),
861
- onClick: () => {
862
- const n = o.current.toolController.getPrimaryTools();
863
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
864
- 1
865
- /* rectangle */
866
- ), f(
867
- 1
868
- /* rectangle */
869
- );
870
- },
871
- children: /* @__PURE__ */ e(Ie, {})
872
- }
873
- ),
874
- /* @__PURE__ */ e(
875
- "button",
876
- {
877
- className: d(l.tool, {
878
- [l.active]: a === "shapes" && C === 2
879
- /* circle */
880
- }),
881
- onClick: () => {
882
- const n = o.current.toolController.getPrimaryTools();
883
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
884
- 2
885
- /* circle */
886
- ), f(
887
- 2
888
- /* circle */
889
- );
890
- },
891
- children: /* @__PURE__ */ e(De, {})
892
- }
893
- ),
894
- /* @__PURE__ */ e(
895
- "button",
896
- {
897
- className: d(l.tool, {
898
- [l.active]: a === "shapes" && C === 3
899
- /* triangle */
900
- }),
901
- onClick: () => {
902
- const n = o.current.toolController.getPrimaryTools();
903
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
904
- 3
905
- /* triangle */
906
- ), f(
907
- 3
908
- /* triangle */
909
- );
910
- },
911
- children: /* @__PURE__ */ e(We, {})
912
- }
913
- ),
914
- /* @__PURE__ */ e(
915
- "button",
916
- {
917
- className: d(l.tool, {
918
- [l.active]: a === "shapes" && C === 4
919
- /* hexagonal */
920
- }),
921
- onClick: () => {
922
- const n = o.current.toolController.getPrimaryTools();
923
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
924
- 4
925
- /* hexagonal */
926
- ), f(
927
- 4
928
- /* hexagonal */
929
- );
930
- },
931
- children: /* @__PURE__ */ e(Fe, {})
932
- }
933
- ),
934
- /* @__PURE__ */ e(
935
- "button",
936
- {
937
- className: d(l.tool, {
938
- [l.active]: a === "shapes" && C === 5
939
- /* diamond */
940
- }),
941
- onClick: () => {
942
- const n = o.current.toolController.getPrimaryTools();
943
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
944
- 5
945
- /* diamond */
946
- ), f(
947
- 5
948
- /* diamond */
949
- );
950
- },
951
- children: /* @__PURE__ */ e(Oe, {})
952
- }
953
- ),
954
- /* @__PURE__ */ e(
955
- "button",
956
- {
957
- className: d(l.tool, {
958
- [l.active]: a === "shapes" && C === 6
959
- /* arrow */
960
- }),
961
- onClick: () => {
962
- const n = o.current.toolController.getPrimaryTools();
963
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
964
- 6
965
- /* arrow */
966
- ), f(
967
- 6
968
- /* arrow */
969
- );
970
- },
971
- children: /* @__PURE__ */ e(Ve, {})
972
- }
973
- ),
974
- /* @__PURE__ */ e(
975
- "button",
976
- {
977
- className: d(l.tool, {
978
- [l.active]: a === "shapes" && C === 7
979
- /* line */
980
- }),
981
- onClick: () => {
982
- const n = o.current.toolController.getPrimaryTools();
983
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
984
- 7
985
- /* line */
986
- ), f(
987
- 7
988
- /* line */
989
- );
990
- },
991
- children: /* @__PURE__ */ e(je, {})
992
- }
993
- ),
994
- /* @__PURE__ */ e(
995
- "button",
996
- {
997
- className: d(l.tool, {
998
- [l.active]: a === "shapes" && C === 8
999
- /* heart */
1000
- }),
1001
- onClick: () => {
1002
- const n = o.current.toolController.getPrimaryTools();
1003
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
1004
- 8
1005
- /* heart */
1006
- ), f(
1007
- 8
1008
- /* heart */
1009
- );
1010
- },
1011
- children: /* @__PURE__ */ e(Ze, {})
1012
- }
1013
- ),
1014
- /* @__PURE__ */ e(
1015
- "button",
1016
- {
1017
- className: d(l.tool, {
1018
- [l.active]: a === "shapes" && C === 9
1019
- /* star */
1020
- }),
1021
- onClick: () => {
1022
- const n = o.current.toolController.getPrimaryTools();
1023
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
1024
- 9
1025
- /* star */
1026
- ), f(
1027
- 9
1028
- /* star */
1029
- );
1030
- },
1031
- children: /* @__PURE__ */ e(Xe, {})
1032
- }
1033
- ),
1034
- /* @__PURE__ */ e(
1035
- "button",
1036
- {
1037
- className: d(l.tool, {
1038
- [l.active]: a === "shapes" && C === 10
1039
- /* cloud */
1040
- }),
1041
- onClick: () => {
1042
- const n = o.current.toolController.getPrimaryTools();
1043
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
1044
- 10
1045
- /* cloud */
1046
- ), f(
1047
- 10
1048
- /* cloud */
1049
- );
1050
- },
1051
- children: /* @__PURE__ */ e(Ke, {})
1052
- }
1053
- ),
1054
- /* @__PURE__ */ e(
1055
- "button",
1056
- {
1057
- className: d(l.tool, {
1058
- [l.active]: a === "shapes" && C === 11
1059
- /* parallelogram */
1060
- }),
1061
- onClick: () => {
1062
- const n = o.current.toolController.getPrimaryTools();
1063
- o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
1064
- 11
1065
- /* parallelogram */
1066
- ), f(
1067
- 11
1068
- /* parallelogram */
1069
- );
1070
- },
1071
- children: /* @__PURE__ */ e(Qe, {})
1072
- }
1073
- ),
1074
- /* @__PURE__ */ e("div", { className: l.line }),
1075
- /* @__PURE__ */ e(
1076
- "button",
1077
- {
1078
- className: d(l.tool),
1079
- onClick: N,
1080
- children: /* @__PURE__ */ e(Ge, {})
1081
- }
1082
- ),
1083
- /* @__PURE__ */ e(
1084
- "button",
1085
- {
1086
- className: d(l.tool),
1087
- onClick: b,
1088
- children: /* @__PURE__ */ e($e, {})
1089
- }
1090
- ),
1091
- /* @__PURE__ */ e(
1092
- "button",
1093
- {
1094
- className: d(l.tool),
1095
- onClick: B,
1096
- children: /* @__PURE__ */ e(Ue, {})
1097
- }
1098
- )
1099
- ] }),
1100
- /* @__PURE__ */ x("div", { className: l.optionsWrap, children: [
1101
- a === "pencil" && /* @__PURE__ */ e(
1102
- et,
1103
- {
1104
- setColorPen: r,
1105
- setThicknessPen: i
1106
- }
1107
- ),
1108
- a === "highlighter" && /* @__PURE__ */ e(tt, { setColorHighlight: T }),
1109
- a === "shapes" && /* @__PURE__ */ e(
1110
- rt,
1111
- {
1112
- changeBorderColorShape: H,
1113
- changeColorShape: w,
1114
- changeShape: h,
1115
- onThicknessChange: k
1116
- }
1117
- )
1118
- ] })
1119
- ]
1120
- }
1121
- ) });
1122
- }
1123
- let I = !1;
1124
- function ft() {
1125
- const t = se(), r = ae(lt.name), {
1126
- isActive: o = void 0,
1127
- upload: i
1128
- } = (r == null ? void 0 : r.componentProps) ?? {}, { editorDisabled: T } = ce(o), [H, N] = y(!1), w = K(null), h = K(null), k = () => {
1129
- (async () => {
1130
- const s = document.querySelector("#easydrawer");
1131
- s && (w.current = new he(s, {
1132
- wheelEventsEnabled: !1,
1133
- disableZoom: !0
1134
- }), h.current = ue(w.current), h.current.addDefaultToolWidgets());
1135
- })();
1136
- };
1137
- G(() => {
1138
- H && setTimeout(() => {
1139
- k();
1140
- }, 200);
1141
- }, [H]);
1142
- const b = async () => {
1143
- if (w.current) {
1144
- const m = w.current.toSVG(), s = m.outerHTML, p = `drawer-${de()}.svg`;
1145
- let z = ge(m.outerHTML);
1146
- if (i) {
1147
- const q = Ce(z, p);
1148
- z = await i(q);
1149
- }
1150
- t == null || t.chain().focus().setDrawer(
1151
- {
1152
- type: "drawer",
1153
- src: z,
1154
- alt: encodeURIComponent(s),
1155
- width: 426,
1156
- height: 212
1157
- },
1158
- !!s
1159
- ).run();
1160
- }
1161
- N(!1);
1162
- }, B = (m) => {
1163
- const s = w.current.toolController.getPrimaryTools()[2], p = h.current.getWidgetById("pen-1");
1164
- s && p && (s.setColor(m), p.serializeState());
1165
- }, a = (m) => {
1166
- const s = w.current.toolController.getPrimaryTools()[2], p = h.current.getWidgetById("pen-1");
1167
- s && p && (s.setThickness(m), p.serializeState());
1168
- }, c = (m) => {
1169
- const s = w.current.toolController.getPrimaryTools()[3], p = h.current.getWidgetById("pen-2");
1170
- s && p && (s.setColor(m), p.serializeState());
1171
- }, C = (m) => {
1172
- const s = h.current.getWidgetById("shape");
1173
- s && s.setShapeType(m);
1174
- }, f = (m) => {
1175
- const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
1176
- s && p && (s.setColor(m), p.serializeState());
1177
- }, n = (m) => {
1178
- const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
1179
- s && p && (s.setThickness(m), p.serializeState());
1180
- }, F = (m) => {
1181
- const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
1182
- s && p && (s.setBorderColor(m), p.serializeState());
1183
- }, P = () => {
1184
- if (I) {
1185
- for (; w.current.history.redoStackSize > 0; )
1186
- w.current.history.redo();
1187
- I = !1;
1188
- return;
1189
- }
1190
- w.current.history.undo();
1191
- }, D = () => {
1192
- I || w.current.history.redo();
1193
- }, O = () => {
1194
- if (!I) {
1195
- for (; w.current.history.undoStackSize > 0; )
1196
- P();
1197
- I = !0;
1198
- }
1199
- };
1200
- return r ? /* @__PURE__ */ x(
1201
- pe,
1202
- {
1203
- onOpenChange: N,
1204
- open: H,
1205
- children: [
1206
- /* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ e(
1207
- me,
1208
- {
1209
- disabled: T,
1210
- action: () => {
1211
- T || N(!0);
1212
- },
1213
- icon: "PencilRuler",
1214
- tooltip: "Drawer"
1215
- }
1216
- ) }),
1217
- /* @__PURE__ */ x(ve, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
1218
- /* @__PURE__ */ e(fe, { children: "Drawer" }),
1219
- /* @__PURE__ */ x("div", { style: { height: "600px", width: "100%", borderWidth: 1, background: "white", position: "relative" }, children: [
1220
- /* @__PURE__ */ e(
1221
- "div",
1222
- {
1223
- className: "richtext-size-full",
1224
- id: "easydrawer"
1225
- }
1226
- ),
1227
- /* @__PURE__ */ e(
1228
- ot,
1229
- {
1230
- changeBorderColorShape: F,
1231
- changeColorShape: f,
1232
- changeShape: C,
1233
- onClear: O,
1234
- onRedo: D,
1235
- onThicknessChange: n,
1236
- onUndo: P,
1237
- refEditor: w,
1238
- setColorHighlight: c,
1239
- setColorPen: B,
1240
- setThicknessPen: a
1241
- }
1242
- )
1243
- ] }),
1244
- /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
1245
- be,
1246
- {
1247
- onClick: b,
1248
- type: "button",
1249
- children: "Save changes"
1250
- }
1251
- ) })
1252
- ] })
1253
- ]
1254
- }
1255
- ) : /* @__PURE__ */ e(U, {});
1256
- }
1257
- const lt = /* @__PURE__ */ le.extend({
1258
- name: "richTextDrawer",
1259
- //@ts-expect-error
1260
- addOptions() {
1261
- var t;
1262
- return {
1263
- ...(t = this.parent) == null ? void 0 : t.call(this),
1264
- inline: !1,
1265
- content: "",
1266
- marks: "",
1267
- group: "block",
1268
- draggable: !1,
1269
- selectable: !0,
1270
- atom: !0,
1271
- HTMLAttributes: {
1272
- class: "drawer"
1273
- },
1274
- button: ({ t: r, extension: o }) => {
1275
- var i;
1276
- return {
1277
- componentProps: {
1278
- action: () => !0,
1279
- isActive: () => !1,
1280
- disabled: !1,
1281
- icon: "PencilRuler",
1282
- tooltip: r("editor.drawer.tooltip"),
1283
- upload: (i = o == null ? void 0 : o.options) == null ? void 0 : i.upload
1284
- }
1285
- };
1286
- }
1287
- };
1288
- },
1289
- addAttributes() {
1290
- var t;
1291
- return {
1292
- ...(t = this.parent) == null ? void 0 : t.call(this),
1293
- width: {
1294
- default: null,
1295
- parseHTML: (r) => {
1296
- const o = r.querySelector("img"), i = o == null ? void 0 : o.getAttribute("width");
1297
- return i ? Number.parseInt(i, 10) : 320;
1298
- },
1299
- renderHTML: (r) => ({
1300
- width: r.width
1301
- })
1302
- },
1303
- height: {
1304
- default: null,
1305
- parseHTML: (r) => {
1306
- const o = r.querySelector("img"), i = o == null ? void 0 : o.getAttribute("height");
1307
- return i ? Number.parseInt(i, 10) : 212;
1308
- },
1309
- renderHTML: (r) => ({
1310
- height: r.height
1311
- })
1312
- },
1313
- align: {
1314
- default: "center",
1315
- parseHTML: (r) => r.getAttribute("align"),
1316
- renderHTML: (r) => ({
1317
- align: r.align
1318
- })
1319
- }
1320
- };
1321
- },
1322
- addNodeView() {
1323
- return oe(xe);
1324
- },
1325
- // @ts-ignore
1326
- addCommands() {
1327
- return {
1328
- setDrawer: (t, r) => ({ commands: o, editor: i }) => r ? o.insertContent({
1329
- type: this.name,
1330
- attrs: t
1331
- }) : o.insertContentAt(i.state.selection.anchor, {
1332
- type: this.name,
1333
- attrs: t
1334
- }),
1335
- setAlignImageDrawer: (t) => ({ commands: r }) => r.updateAttributes(this.name, { align: t })
1336
- };
1337
- },
1338
- renderHTML({ HTMLAttributes: t }) {
1339
- const { align: r } = t;
1340
- return [
1341
- "div",
1342
- // Parent element
1343
- {
1344
- style: r ? `text-align: ${r};` : "",
1345
- class: "imageDrawer"
1346
- },
1347
- [
1348
- "img",
1349
- re(
1350
- // @ts-ignore
1351
- this.options.HTMLAttributes,
1352
- t
1353
- )
1354
- ]
1355
- ];
1356
- },
1357
- parseHTML() {
1358
- return [
1359
- {
1360
- tag: "div[class=imageDrawer]",
1361
- getAttrs: (t) => {
1362
- const r = t.querySelector("img"), o = r == null ? void 0 : r.getAttribute("width"), i = r == null ? void 0 : r.getAttribute("height");
1363
- return {
1364
- src: r == null ? void 0 : r.getAttribute("src"),
1365
- alt: r == null ? void 0 : r.getAttribute("alt"),
1366
- width: o ? Number.parseInt(o, 10) : null,
1367
- height: i ? Number.parseInt(i, 10) : null,
1368
- align: (r == null ? void 0 : r.getAttribute("align")) || t.style.textAlign || null
1369
- };
1370
- }
1371
- }
1372
- ];
1373
- }
1374
- });
1375
- export {
1376
- ot as C,
1377
- lt as D,
1378
- ft as R
1379
- };