reactjs-tiptap-editor 0.4.1 → 1.0.0
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.
- package/lib/ActionMenuButton-BKOg7hkq.js +38 -0
- package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +43 -55
- package/lib/Attachment.d.ts +43 -55
- package/lib/Attachment.js +129 -99
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.d.cts +43 -55
- package/lib/Blockquote.d.ts +43 -55
- package/lib/Blockquote.js +50 -22
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +43 -55
- package/lib/Bold.d.ts +43 -55
- package/lib/Bold.js +48 -20
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +43 -55
- package/lib/BulletList.d.ts +43 -55
- package/lib/BulletList.js +38 -9
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +43 -55
- package/lib/Clear.d.ts +43 -55
- package/lib/Clear.js +32 -6
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +43 -55
- package/lib/Code.d.ts +43 -55
- package/lib/Code.js +53 -25
- package/lib/CodeBlock.cjs +35 -35
- package/lib/CodeBlock.d.cts +43 -55
- package/lib/CodeBlock.d.ts +43 -55
- package/lib/CodeBlock.js +605 -590
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +44 -56
- package/lib/CodeView.d.ts +44 -56
- package/lib/CodeView.js +49 -21
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +47 -55
- package/lib/Color.d.ts +47 -55
- package/lib/Color.js +123 -79
- package/lib/Column.cjs +1 -0
- package/lib/{Document.d.cts → Column.d.cts} +49 -58
- package/lib/{Document.d.ts → Column.d.ts} +49 -58
- package/lib/Column.js +217 -0
- package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
- package/lib/Drawer-SRhwOc6T.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +43 -55
- package/lib/Drawer.d.ts +43 -55
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +43 -60
- package/lib/Emoji.d.ts +43 -60
- package/lib/Emoji.js +377 -392
- package/lib/Excalidraw-DwBRXEtC.js +345 -0
- package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +43 -55
- package/lib/Excalidraw.d.ts +43 -55
- package/lib/Excalidraw.js +6 -4
- package/lib/ExportPdf.cjs +5 -5
- package/lib/ExportPdf.d.cts +43 -55
- package/lib/ExportPdf.d.ts +43 -55
- package/lib/ExportPdf.js +60 -32
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +44 -56
- package/lib/ExportWord.d.ts +44 -56
- package/lib/ExportWord.js +84 -21
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +57 -58
- package/lib/FontFamily.d.ts +57 -58
- package/lib/FontFamily.js +72 -74
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +54 -58
- package/lib/FontSize.d.ts +54 -58
- package/lib/FontSize.js +72 -64
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +57 -55
- package/lib/Heading.d.ts +57 -55
- package/lib/Heading.js +91 -73
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +47 -55
- package/lib/Highlight.d.ts +47 -55
- package/lib/Highlight.js +152 -21
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +45 -55
- package/lib/History.d.ts +45 -55
- package/lib/History.js +976 -53
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +43 -55
- package/lib/HorizontalRule.d.ts +43 -55
- package/lib/HorizontalRule.js +97 -17
- package/lib/Icon-DUpv2cI6.cjs +1 -0
- package/lib/Icon-jKs8Hr6p.js +11 -0
- package/lib/Iframe-CmXkEqOd.js +431 -0
- package/lib/Iframe-Cvca2G7X.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +42 -61
- package/lib/Iframe.d.ts +42 -61
- package/lib/Iframe.js +6 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +43 -56
- package/lib/Image.d.ts +43 -56
- package/lib/Image.js +848 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +44 -58
- package/lib/ImageGif.d.ts +44 -58
- package/lib/ImageGif.js +424 -5
- package/lib/ImportWord.cjs +48 -48
- package/lib/ImportWord.d.cts +44 -56
- package/lib/ImportWord.d.ts +44 -56
- package/lib/ImportWord.js +2596 -2588
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +43 -55
- package/lib/Indent.d.ts +43 -55
- package/lib/Indent.js +97 -27
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +43 -55
- package/lib/Italic.d.ts +43 -55
- package/lib/Italic.js +47 -19
- package/lib/Katex-DsYXsjSS.js +2740 -0
- package/lib/Katex-XfrNne6U.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +43 -55
- package/lib/Katex.d.ts +43 -55
- package/lib/Katex.js +5 -196
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +45 -61
- package/lib/LineHeight.d.ts +45 -61
- package/lib/LineHeight.js +71 -112
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +44 -58
- package/lib/Link.d.ts +44 -58
- package/lib/Link.js +3 -3
- package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
- package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +40 -55
- package/lib/Mention.d.ts +40 -55
- package/lib/Mention.js +114 -130
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +43 -55
- package/lib/Mermaid.d.ts +43 -55
- package/lib/Mermaid.js +177 -165
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +58 -57
- package/lib/MoreMark.d.ts +58 -57
- package/lib/MoreMark.js +125 -55
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +43 -55
- package/lib/OrderedList.d.ts +43 -55
- package/lib/OrderedList.js +37 -9
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +43 -58
- package/lib/SearchAndReplace.d.ts +43 -58
- package/lib/SearchAndReplace.js +221 -197
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +55 -62
- package/lib/SlashCommand.d.ts +55 -62
- package/lib/SlashCommand.js +235 -249
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +43 -55
- package/lib/Strike.d.ts +43 -55
- package/lib/Strike.js +39 -11
- package/lib/Table-B1j1Ebmh.cjs +9 -0
- package/lib/Table-Db8TcQX8.js +1984 -0
- package/lib/Table.cjs +1 -9
- package/lib/Table.d.cts +44 -58
- package/lib/Table.d.ts +44 -58
- package/lib/Table.js +3 -558
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +43 -55
- package/lib/TaskList.d.ts +43 -55
- package/lib/TaskList.js +38 -10
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +56 -55
- package/lib/TextAlign.d.ts +56 -55
- package/lib/TextAlign.js +108 -101
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +72 -55
- package/lib/TextDirection.d.ts +72 -55
- package/lib/TextDirection.js +105 -112
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +43 -55
- package/lib/TextUnderline.d.ts +43 -55
- package/lib/TextUnderline.js +46 -18
- package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
- package/lib/Twitter-CtVTIWJW.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +43 -55
- package/lib/Twitter.d.ts +43 -55
- package/lib/Twitter.js +5 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +43 -55
- package/lib/Video.d.ts +43 -55
- package/lib/Video.js +261 -4
- package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
- package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
- package/lib/bubble.cjs +2 -0
- package/lib/{bubble-extra.d.cts → bubble.d.cts} +69 -70
- package/lib/{bubble-extra.d.ts → bubble.d.ts} +69 -70
- package/lib/bubble.js +1925 -0
- package/lib/button-B12K7BJ4.cjs +1 -0
- package/lib/button-DXMsXUEn.js +43 -0
- package/lib/clsx-C11secjj.cjs +1 -0
- package/lib/clsx-OuTLNxxd.js +16 -0
- package/lib/delete-node-CosiBes5.cjs +1 -0
- package/lib/delete-node-IyVmiRbI.js +22 -0
- package/lib/dialog-CaCS-W5S.cjs +1 -0
- package/lib/dialog-PtQivpHS.js +100 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
- package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
- package/lib/file-BLas99n7.js +43 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
- package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
- package/lib/icons-Cllpys39.js +362 -0
- package/lib/icons-CqHjeW5T.cjs +1 -0
- package/lib/index-BH4bc3jN.cjs +33 -0
- package/lib/index-BPfVXs5_.js +2380 -0
- package/lib/index-Bnmd0WvY.js +1631 -0
- package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
- package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
- package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
- package/lib/index-DV5kbgRU.cjs +1 -0
- package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
- package/lib/index-Dfmm6FTT.cjs +1 -0
- package/lib/index-DnWWK9F_.js +6374 -0
- package/lib/index-DzcKxutn.js +632 -0
- package/lib/index-DzvuNTxo.cjs +4 -0
- package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
- package/lib/index-RfTlOzIr.cjs +22 -0
- package/lib/index.cjs +132 -1
- package/lib/index.d.cts +45 -296
- package/lib/index.d.ts +45 -296
- package/lib/index.js +243 -2
- package/lib/input-_ECRfn3Y.cjs +1 -0
- package/lib/input-wJ9PDEzZ.js +21 -0
- package/lib/isNumber-ClPupm7P.cjs +1 -0
- package/lib/isNumber-fpLGS0AZ.js +15 -0
- package/lib/label-BkgAe7IY.cjs +1 -0
- package/lib/label-CGdLYWv7.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +5421 -73
- package/lib/locale-bundle.d.ts +5421 -73
- package/lib/locale-bundle.js +9 -7
- package/lib/popover-BgmUNMHj.cjs +1 -0
- package/lib/popover-CAuEW0Mr.js +23 -0
- package/lib/separator-CuBW_w98.js +328 -0
- package/lib/separator-DRIrVZ2N.cjs +1 -0
- package/lib/store-DX599H5W.js +10 -0
- package/lib/store-WStcMOiW.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/switch-CnLJ7Y-b.cjs +1 -0
- package/lib/switch-Coix_FA1.js +27 -0
- package/lib/tabs-B5mVSN1I.js +46 -0
- package/lib/tabs-BoLCMcCI.cjs +1 -0
- package/lib/textarea-B-6zTKQz.cjs +1 -0
- package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
- package/lib/theme-B7aAsK_T.js +15 -0
- package/lib/theme-D8_cxGqB.cjs +1 -0
- package/lib/throttle-CdwDrFpn.js +249 -0
- package/lib/throttle-qX7Yjtsg.cjs +1 -0
- package/lib/toggle-Cdp4IT2U.js +85 -0
- package/lib/toggle-D41PzQLJ.cjs +1 -0
- package/lib/tooltip-BuEiE96N.cjs +1 -0
- package/lib/tooltip-CopwsU8q.js +23 -0
- package/lib/updatePosition-8Sdem5jb.cjs +1 -0
- package/lib/updatePosition-BPmcE0YD.js +215 -0
- package/lib/use-toast-Bz3QCOtE.cjs +1 -0
- package/lib/use-toast-Crf7-q5H.js +98 -0
- package/lib/useButtonProps-BsEd4zYM.js +141 -0
- package/lib/useButtonProps-C6Vpn190.cjs +1 -0
- package/package.json +22 -105
- package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
- package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
- package/lib/BaseKit.cjs +0 -3
- package/lib/BaseKit.d.cts +0 -481
- package/lib/BaseKit.d.ts +0 -481
- package/lib/BaseKit.js +0 -132
- package/lib/Document.cjs +0 -1
- package/lib/Document.js +0 -9
- package/lib/Drawer-CdvCMSzN.cjs +0 -1
- package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
- package/lib/Excalidraw-CVWz2Vyn.js +0 -290
- package/lib/FormatPainter.cjs +0 -1
- package/lib/FormatPainter.d.cts +0 -372
- package/lib/FormatPainter.d.ts +0 -372
- package/lib/FormatPainter.js +0 -76
- package/lib/ListItem.cjs +0 -1
- package/lib/ListItem.d.cts +0 -290
- package/lib/ListItem.d.ts +0 -290
- package/lib/ListItem.js +0 -7
- package/lib/MultiColumn.cjs +0 -1
- package/lib/MultiColumn.d.cts +0 -294
- package/lib/MultiColumn.d.ts +0 -294
- package/lib/MultiColumn.js +0 -8
- package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
- package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
- package/lib/Selection.cjs +0 -1
- package/lib/Selection.d.cts +0 -289
- package/lib/Selection.d.ts +0 -289
- package/lib/Selection.js +0 -25
- package/lib/SubAndSuperScript.cjs +0 -1
- package/lib/SubAndSuperScript.d.cts +0 -377
- package/lib/SubAndSuperScript.d.ts +0 -377
- package/lib/SubAndSuperScript.js +0 -43
- package/lib/TableOfContent.cjs +0 -1
- package/lib/TableOfContent.d.cts +0 -291
- package/lib/TableOfContent.d.ts +0 -291
- package/lib/TableOfContent.js +0 -185
- package/lib/TextBubble.cjs +0 -1
- package/lib/TextBubble.d.cts +0 -362
- package/lib/TextBubble.d.ts +0 -362
- package/lib/TextBubble.js +0 -133
- package/lib/TrailingNode.cjs +0 -1
- package/lib/TrailingNode.d.cts +0 -297
- package/lib/TrailingNode.d.ts +0 -297
- package/lib/TrailingNode.js +0 -41
- package/lib/Twitter-Cutpkh3h.cjs +0 -1
- package/lib/bubble-extra.cjs +0 -2
- package/lib/bubble-extra.js +0 -631
- package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
- package/lib/dom-dataset-lYeH6gfI.js +0 -2361
- package/lib/index-6D1J-A-o.cjs +0 -1
- package/lib/index-B96Cclrj.cjs +0 -3
- package/lib/index-BBz7Nmv9.js +0 -55
- package/lib/index-CUogRI7j.cjs +0 -1
- package/lib/index-DF2Lp4HZ.cjs +0 -100
- package/lib/index-D_L6n8O8.js +0 -76
- package/lib/index-Dbvi-Bvh.cjs +0 -1
- package/lib/index-DpCrt7xs.cjs +0 -1
- package/lib/index-DsAX1Vq8.cjs +0 -1
- package/lib/index-Dy4DlW9o.js +0 -12
- package/lib/index-J3jHHZ4d.js +0 -200
- package/lib/index-VvXaaKe3.js +0 -898
- package/lib/index-kbO3iWqL.js +0 -13432
- package/lib/textarea-DFo_aXnj.cjs +0 -1
|
@@ -1,23 +1,173 @@
|
|
|
1
|
-
import { q as j, m as te } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { N as
|
|
4
|
-
import { jsx as e, jsxs as
|
|
5
|
-
import { useState as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { q as j, m as te } from "./index-DnWWK9F_.js";
|
|
2
|
+
import { a as X, c as re } from "./throttle-CdwDrFpn.js";
|
|
3
|
+
import { N as oe, R as le } from "./index-DzcKxutn.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 R, useEffect as G, useRef as K } from "react";
|
|
6
|
+
import { I as Q, m as Y, n as ne } from "./index-DYkucCoF.js";
|
|
7
|
+
import { i as ie, u as se, a as ae } from "./useButtonProps-BsEd4zYM.js";
|
|
8
|
+
import { Color4 as g, Editor as ce, makeDropdownToolbar as he } from "easydrawer";
|
|
9
|
+
import { s as ue, i as de } from "./shortId-WJVkrvml.js";
|
|
10
|
+
import { A as ge } from "./toggle-Cdp4IT2U.js";
|
|
11
|
+
import { D as me, a as pe, b as we, c as ve, d as fe } from "./dialog-PtQivpHS.js";
|
|
12
|
+
import { c as d, a as Te } from "./index-BPfVXs5_.js";
|
|
13
|
+
import { d as Ce } from "./file-BLas99n7.js";
|
|
14
|
+
import { B as be } from "./button-DXMsXUEn.js";
|
|
15
|
+
const W = {
|
|
16
|
+
TOP_LEFT: "tl",
|
|
17
|
+
TOP_RIGHT: "tr",
|
|
18
|
+
BOTTOM_LEFT: "bl",
|
|
19
|
+
BOTTOM_RIGHT: "br"
|
|
20
|
+
};
|
|
21
|
+
function xe({ editor: t, node: r, updateAttributes: o, getPos: i, selected: T }) {
|
|
22
|
+
const [H, S] = y({
|
|
23
|
+
width: Q,
|
|
24
|
+
height: Q
|
|
25
|
+
}), [w, h] = y({
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 0
|
|
28
|
+
}), [k] = y([
|
|
29
|
+
W.TOP_LEFT,
|
|
30
|
+
W.TOP_RIGHT,
|
|
31
|
+
W.BOTTOM_LEFT,
|
|
32
|
+
W.BOTTOM_RIGHT
|
|
33
|
+
]), [b, B] = y(!1), [a, c] = y({
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
36
|
+
w: 0,
|
|
37
|
+
h: 0,
|
|
38
|
+
dir: ""
|
|
39
|
+
}), { align: C } = r == null ? void 0 : r.attrs, f = V(() => {
|
|
40
|
+
const { src: u, alt: E, width: L, height: _ } = r == null ? void 0 : r.attrs, A = j(L) ? `${L}px` : L, v = j(_) ? `${_}px` : _;
|
|
41
|
+
return {
|
|
42
|
+
src: u || void 0,
|
|
43
|
+
alt: E || void 0,
|
|
44
|
+
style: {
|
|
45
|
+
width: A || void 0,
|
|
46
|
+
height: v || void 0
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}, [r == null ? void 0 : r.attrs]), n = V(() => {
|
|
50
|
+
const {
|
|
51
|
+
style: { width: u }
|
|
52
|
+
} = f;
|
|
53
|
+
return { width: u === "100%" ? u : void 0 };
|
|
54
|
+
}, [f]);
|
|
55
|
+
function F(u) {
|
|
56
|
+
h({
|
|
57
|
+
width: u.target.width,
|
|
58
|
+
height: u.target.height
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function P() {
|
|
62
|
+
t.commands.setNodeSelection(i());
|
|
63
|
+
}
|
|
64
|
+
const D = R(
|
|
65
|
+
X(() => {
|
|
66
|
+
const { width: u } = getComputedStyle(t.view.dom);
|
|
67
|
+
S((E) => ({
|
|
68
|
+
...E,
|
|
69
|
+
width: Number.parseInt(u, 10)
|
|
70
|
+
}));
|
|
71
|
+
}, Y),
|
|
72
|
+
[t]
|
|
73
|
+
);
|
|
74
|
+
function O(u, E) {
|
|
75
|
+
u.preventDefault(), u.stopPropagation();
|
|
76
|
+
const L = w.width, _ = w.height, A = L / _;
|
|
77
|
+
let v = Number(r.attrs.width), N = Number(r.attrs.height);
|
|
78
|
+
const M = H.width;
|
|
79
|
+
v && !N ? (v = v > M ? M : v, N = Math.round(v / A)) : N && !v ? (v = Math.round(N * A), v = v > M ? M : v) : !v && !N ? (v = L > M ? M : L, N = Math.round(v / A)) : v = v > M ? M : v, B(!0), c({
|
|
80
|
+
x: u.clientX,
|
|
81
|
+
y: u.clientY,
|
|
82
|
+
w: v,
|
|
83
|
+
h: N,
|
|
84
|
+
dir: E
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const m = R(
|
|
88
|
+
X((u) => {
|
|
89
|
+
if (u.preventDefault(), u.stopPropagation(), !b)
|
|
90
|
+
return;
|
|
91
|
+
const { x: E, w: L, dir: _ } = a, A = (u.clientX - E) * (/l/.test(_) ? -1 : 1), { width: v, height: N } = r == null ? void 0 : r.attrs, M = v / N, Z = ie(L + A, ne, H.width), ee = Math.round(Z / M);
|
|
92
|
+
o({
|
|
93
|
+
width: Z,
|
|
94
|
+
height: ee
|
|
95
|
+
});
|
|
96
|
+
}, Y),
|
|
97
|
+
[b, a, H, o, r == null ? void 0 : r.attrs]
|
|
98
|
+
), s = R(
|
|
99
|
+
(u) => {
|
|
100
|
+
u.preventDefault(), u.stopPropagation(), b && (c({
|
|
101
|
+
x: 0,
|
|
102
|
+
y: 0,
|
|
103
|
+
w: 0,
|
|
104
|
+
h: 0,
|
|
105
|
+
dir: ""
|
|
106
|
+
}), B(!1), P());
|
|
107
|
+
},
|
|
108
|
+
[b, P]
|
|
109
|
+
), p = R(() => {
|
|
110
|
+
document == null || document.addEventListener("mousemove", m, !0), document == null || document.addEventListener("mouseup", s, !0);
|
|
111
|
+
}, [m, s]), z = R(() => {
|
|
112
|
+
document == null || document.removeEventListener("mousemove", m, !0), document == null || document.removeEventListener("mouseup", s, !0);
|
|
113
|
+
}, [m, s]);
|
|
114
|
+
G(() => (b ? p() : z(), () => {
|
|
115
|
+
z();
|
|
116
|
+
}), [b, p, z]);
|
|
117
|
+
const q = V(() => new ResizeObserver(() => D()), [D]);
|
|
118
|
+
return G(() => (q.observe(t.view.dom), () => {
|
|
119
|
+
q.disconnect();
|
|
120
|
+
}), [t.view.dom, q]), /* @__PURE__ */ e(
|
|
121
|
+
oe,
|
|
122
|
+
{
|
|
123
|
+
className: "image-view",
|
|
124
|
+
style: { ...n, width: "100%", textAlign: C },
|
|
125
|
+
children: /* @__PURE__ */ x(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
"data-drag-handle": !0,
|
|
129
|
+
draggable: "true",
|
|
130
|
+
style: { ...n, background: "#fff" },
|
|
131
|
+
className: `image-view__body ${T ? "image-view__body--focused" : ""} ${b ? "image-view__body--resizing" : ""}`,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ e(
|
|
134
|
+
"img",
|
|
135
|
+
{
|
|
136
|
+
alt: f.alt,
|
|
137
|
+
className: "image-view__body__image block",
|
|
138
|
+
height: "auto",
|
|
139
|
+
onClick: P,
|
|
140
|
+
onLoad: F,
|
|
141
|
+
src: f.src,
|
|
142
|
+
style: f.style
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
t.view.editable && (T || b) && /* @__PURE__ */ e("div", { className: "image-resizer", children: k == null ? void 0 : k.map((u) => /* @__PURE__ */ e(
|
|
146
|
+
"span",
|
|
147
|
+
{
|
|
148
|
+
className: `image-resizer__handler image-resizer__handler--${u}`,
|
|
149
|
+
onMouseDown: (E) => O(E, u)
|
|
150
|
+
},
|
|
151
|
+
`image-dir-${u}`
|
|
152
|
+
)) })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
const ye = "_wrapper_rraz2_1", Me = "_tool_rraz2_17", He = "_active_rraz2_37", Ee = "_pen_rraz2_41", Le = "_line_rraz2_48", Ne = "_options_rraz2_56", Se = "_colorWrap_rraz2_66", ke = "_color_rraz2_66", ze = "_colorActive_rraz2_83", l = {
|
|
160
|
+
wrapper: ye,
|
|
161
|
+
tool: Me,
|
|
162
|
+
active: He,
|
|
163
|
+
pen: Ee,
|
|
164
|
+
line: Le,
|
|
165
|
+
options: Ne,
|
|
166
|
+
colorWrap: Se,
|
|
167
|
+
color: ke,
|
|
168
|
+
colorActive: ze
|
|
19
169
|
};
|
|
20
|
-
function
|
|
170
|
+
function _e(t) {
|
|
21
171
|
return /* @__PURE__ */ e(
|
|
22
172
|
"svg",
|
|
23
173
|
{
|
|
@@ -41,7 +191,7 @@ function Ne(t) {
|
|
|
41
191
|
}
|
|
42
192
|
);
|
|
43
193
|
}
|
|
44
|
-
function
|
|
194
|
+
function Ae(t) {
|
|
45
195
|
return /* @__PURE__ */ e(
|
|
46
196
|
"svg",
|
|
47
197
|
{
|
|
@@ -60,7 +210,7 @@ function Se(t) {
|
|
|
60
210
|
}
|
|
61
211
|
);
|
|
62
212
|
}
|
|
63
|
-
function
|
|
213
|
+
function Be(t) {
|
|
64
214
|
return /* @__PURE__ */ e(
|
|
65
215
|
"svg",
|
|
66
216
|
{
|
|
@@ -79,7 +229,7 @@ function ze(t) {
|
|
|
79
229
|
}
|
|
80
230
|
);
|
|
81
231
|
}
|
|
82
|
-
function
|
|
232
|
+
function Pe(t) {
|
|
83
233
|
return /* @__PURE__ */ e(
|
|
84
234
|
"svg",
|
|
85
235
|
{
|
|
@@ -98,8 +248,8 @@ function ke(t) {
|
|
|
98
248
|
}
|
|
99
249
|
);
|
|
100
250
|
}
|
|
101
|
-
function
|
|
102
|
-
return /* @__PURE__ */
|
|
251
|
+
function qe(t) {
|
|
252
|
+
return /* @__PURE__ */ x(
|
|
103
253
|
"svg",
|
|
104
254
|
{
|
|
105
255
|
height: "1em",
|
|
@@ -126,7 +276,7 @@ function _e(t) {
|
|
|
126
276
|
}
|
|
127
277
|
);
|
|
128
278
|
}
|
|
129
|
-
function
|
|
279
|
+
function Re(t) {
|
|
130
280
|
return /* @__PURE__ */ e(
|
|
131
281
|
"svg",
|
|
132
282
|
{
|
|
@@ -145,7 +295,7 @@ function Ae(t) {
|
|
|
145
295
|
}
|
|
146
296
|
);
|
|
147
297
|
}
|
|
148
|
-
function
|
|
298
|
+
function Ie(t) {
|
|
149
299
|
return /* @__PURE__ */ e(
|
|
150
300
|
"svg",
|
|
151
301
|
{
|
|
@@ -164,7 +314,7 @@ function Be(t) {
|
|
|
164
314
|
}
|
|
165
315
|
);
|
|
166
316
|
}
|
|
167
|
-
function
|
|
317
|
+
function De(t) {
|
|
168
318
|
return /* @__PURE__ */ e(
|
|
169
319
|
"svg",
|
|
170
320
|
{
|
|
@@ -183,7 +333,7 @@ function qe(t) {
|
|
|
183
333
|
}
|
|
184
334
|
);
|
|
185
335
|
}
|
|
186
|
-
function
|
|
336
|
+
function We(t) {
|
|
187
337
|
return /* @__PURE__ */ e(
|
|
188
338
|
"svg",
|
|
189
339
|
{
|
|
@@ -206,7 +356,7 @@ function Pe(t) {
|
|
|
206
356
|
}
|
|
207
357
|
);
|
|
208
358
|
}
|
|
209
|
-
function
|
|
359
|
+
function Fe(t) {
|
|
210
360
|
return /* @__PURE__ */ e(
|
|
211
361
|
"svg",
|
|
212
362
|
{
|
|
@@ -225,7 +375,7 @@ function Re(t) {
|
|
|
225
375
|
}
|
|
226
376
|
);
|
|
227
377
|
}
|
|
228
|
-
function
|
|
378
|
+
function Oe(t) {
|
|
229
379
|
return /* @__PURE__ */ e(
|
|
230
380
|
"svg",
|
|
231
381
|
{
|
|
@@ -234,7 +384,7 @@ function Ie(t) {
|
|
|
234
384
|
width: "1em",
|
|
235
385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
236
386
|
...t,
|
|
237
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ x(
|
|
238
388
|
"g",
|
|
239
389
|
{
|
|
240
390
|
fill: "none",
|
|
@@ -254,7 +404,7 @@ function Ie(t) {
|
|
|
254
404
|
}
|
|
255
405
|
);
|
|
256
406
|
}
|
|
257
|
-
function
|
|
407
|
+
function Ve(t) {
|
|
258
408
|
return /* @__PURE__ */ e(
|
|
259
409
|
"svg",
|
|
260
410
|
{
|
|
@@ -273,7 +423,7 @@ function We(t) {
|
|
|
273
423
|
}
|
|
274
424
|
);
|
|
275
425
|
}
|
|
276
|
-
function
|
|
426
|
+
function Ge(t) {
|
|
277
427
|
return /* @__PURE__ */ e(
|
|
278
428
|
"svg",
|
|
279
429
|
{
|
|
@@ -294,7 +444,7 @@ function Fe(t) {
|
|
|
294
444
|
}
|
|
295
445
|
);
|
|
296
446
|
}
|
|
297
|
-
function
|
|
447
|
+
function $e(t) {
|
|
298
448
|
return /* @__PURE__ */ e(
|
|
299
449
|
"svg",
|
|
300
450
|
{
|
|
@@ -315,7 +465,7 @@ function De(t) {
|
|
|
315
465
|
}
|
|
316
466
|
);
|
|
317
467
|
}
|
|
318
|
-
function
|
|
468
|
+
function Ue(t) {
|
|
319
469
|
return /* @__PURE__ */ e(
|
|
320
470
|
"svg",
|
|
321
471
|
{
|
|
@@ -334,7 +484,7 @@ function Oe(t) {
|
|
|
334
484
|
}
|
|
335
485
|
);
|
|
336
486
|
}
|
|
337
|
-
function
|
|
487
|
+
function Ze(t) {
|
|
338
488
|
return /* @__PURE__ */ e(
|
|
339
489
|
"svg",
|
|
340
490
|
{
|
|
@@ -353,7 +503,7 @@ function Ve(t) {
|
|
|
353
503
|
}
|
|
354
504
|
);
|
|
355
505
|
}
|
|
356
|
-
function
|
|
506
|
+
function je(t) {
|
|
357
507
|
return /* @__PURE__ */ e(
|
|
358
508
|
"svg",
|
|
359
509
|
{
|
|
@@ -372,7 +522,7 @@ function Ge(t) {
|
|
|
372
522
|
}
|
|
373
523
|
);
|
|
374
524
|
}
|
|
375
|
-
function
|
|
525
|
+
function Xe(t) {
|
|
376
526
|
return /* @__PURE__ */ e(
|
|
377
527
|
"svg",
|
|
378
528
|
{
|
|
@@ -391,7 +541,7 @@ function $e(t) {
|
|
|
391
541
|
}
|
|
392
542
|
);
|
|
393
543
|
}
|
|
394
|
-
function
|
|
544
|
+
function Ke(t) {
|
|
395
545
|
return /* @__PURE__ */ e(
|
|
396
546
|
"svg",
|
|
397
547
|
{
|
|
@@ -410,7 +560,7 @@ function Ue(t) {
|
|
|
410
560
|
}
|
|
411
561
|
);
|
|
412
562
|
}
|
|
413
|
-
function
|
|
563
|
+
function Qe(t) {
|
|
414
564
|
return /* @__PURE__ */ e(
|
|
415
565
|
"svg",
|
|
416
566
|
{
|
|
@@ -431,7 +581,7 @@ function je(t) {
|
|
|
431
581
|
}
|
|
432
582
|
);
|
|
433
583
|
}
|
|
434
|
-
const
|
|
584
|
+
const Ye = [
|
|
435
585
|
g.blackHighlight,
|
|
436
586
|
g.ofRGBA(166 / 255, 81 / 255, 167 / 255, 0.3),
|
|
437
587
|
g.ofRGBA(247 / 255, 78 / 255, 158 / 255, 0.3),
|
|
@@ -439,7 +589,7 @@ const Ze = [
|
|
|
439
589
|
g.ofRGBA(246 / 255, 130 / 255, 28 / 255, 0.3),
|
|
440
590
|
g.ofRGBA(166 / 255, 198 / 255, 0, 0.3),
|
|
441
591
|
g.ofRGBA(98 / 255, 186 / 255, 70 / 255, 0.3)
|
|
442
|
-
],
|
|
592
|
+
], J = [
|
|
443
593
|
g.black,
|
|
444
594
|
g.fromHex("#007AFF"),
|
|
445
595
|
g.fromHex("#A651A7"),
|
|
@@ -455,9 +605,9 @@ const Ze = [
|
|
|
455
605
|
g.fromHex("#FFFB85"),
|
|
456
606
|
g.fromHex("#AADC99")
|
|
457
607
|
];
|
|
458
|
-
function
|
|
459
|
-
const [r, o] =
|
|
460
|
-
return /* @__PURE__ */ e("div", { className: l.colorWrap, children:
|
|
608
|
+
function Je({ onChange: t }) {
|
|
609
|
+
const [r, o] = y(g.blackHighlight);
|
|
610
|
+
return /* @__PURE__ */ e("div", { className: l.colorWrap, children: Ye.map((i, T) => /* @__PURE__ */ e(
|
|
461
611
|
"button",
|
|
462
612
|
{
|
|
463
613
|
style: { backgroundColor: i.toHexString() },
|
|
@@ -468,13 +618,13 @@ function Xe({ onChange: t }) {
|
|
|
468
618
|
o(i), t(i);
|
|
469
619
|
}
|
|
470
620
|
},
|
|
471
|
-
|
|
621
|
+
T
|
|
472
622
|
)) });
|
|
473
623
|
}
|
|
474
|
-
function
|
|
475
|
-
const [r, o] =
|
|
476
|
-
return /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */ e("div", { className: l.colorWrap, children:
|
|
624
|
+
function $({ onChange: t }) {
|
|
625
|
+
const [r, o] = y(g.black);
|
|
626
|
+
return /* @__PURE__ */ x(U, { children: [
|
|
627
|
+
/* @__PURE__ */ e("div", { className: l.colorWrap, children: J.slice(0, 7).map((i, T) => /* @__PURE__ */ e(
|
|
478
628
|
"button",
|
|
479
629
|
{
|
|
480
630
|
style: { backgroundColor: i.toHexString() },
|
|
@@ -485,9 +635,9 @@ function G({ onChange: t }) {
|
|
|
485
635
|
o(i), t(i);
|
|
486
636
|
}
|
|
487
637
|
},
|
|
488
|
-
|
|
638
|
+
T
|
|
489
639
|
)) }),
|
|
490
|
-
/* @__PURE__ */ e("div", { className: l.colorWrap, children:
|
|
640
|
+
/* @__PURE__ */ e("div", { className: l.colorWrap, children: J.slice(7).map((i, T) => /* @__PURE__ */ e(
|
|
491
641
|
"button",
|
|
492
642
|
{
|
|
493
643
|
style: { backgroundColor: i.toHexString() },
|
|
@@ -498,17 +648,17 @@ function G({ onChange: t }) {
|
|
|
498
648
|
o(i), t(i);
|
|
499
649
|
}
|
|
500
650
|
},
|
|
501
|
-
|
|
651
|
+
T
|
|
502
652
|
)) })
|
|
503
653
|
] });
|
|
504
654
|
}
|
|
505
|
-
function
|
|
506
|
-
const [o, i] =
|
|
507
|
-
return /* @__PURE__ */
|
|
655
|
+
function et({ setColorPen: t, setThicknessPen: r }) {
|
|
656
|
+
const [o, i] = y(2);
|
|
657
|
+
return /* @__PURE__ */ x("div", { className: l.options, children: [
|
|
508
658
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
509
|
-
|
|
659
|
+
$,
|
|
510
660
|
{
|
|
511
|
-
onChange: (
|
|
661
|
+
onChange: (T) => t(T)
|
|
512
662
|
}
|
|
513
663
|
) }),
|
|
514
664
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
@@ -520,36 +670,36 @@ function Ke({ setColorPen: t, setThicknessPen: r }) {
|
|
|
520
670
|
step: 0.1,
|
|
521
671
|
type: "range",
|
|
522
672
|
value: o,
|
|
523
|
-
onChange: (
|
|
524
|
-
r(Number.parseFloat(
|
|
673
|
+
onChange: (T) => {
|
|
674
|
+
r(Number.parseFloat(T.target.value)), i(Number.parseFloat(T.target.value));
|
|
525
675
|
}
|
|
526
676
|
}
|
|
527
677
|
) })
|
|
528
678
|
] });
|
|
529
679
|
}
|
|
530
|
-
function
|
|
680
|
+
function tt({ setColorHighlight: t }) {
|
|
531
681
|
return /* @__PURE__ */ e("div", { className: l.options, children: /* @__PURE__ */ e(
|
|
532
|
-
|
|
682
|
+
Je,
|
|
533
683
|
{
|
|
534
684
|
onChange: (r) => t(r)
|
|
535
685
|
}
|
|
536
686
|
) });
|
|
537
687
|
}
|
|
538
|
-
function
|
|
688
|
+
function rt({
|
|
539
689
|
changeColorShape: t,
|
|
540
690
|
changeBorderColorShape: r,
|
|
541
691
|
onThicknessChange: o
|
|
542
692
|
}) {
|
|
543
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ x("div", { className: l.options, children: [
|
|
544
694
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
545
|
-
|
|
695
|
+
$,
|
|
546
696
|
{
|
|
547
697
|
onChange: (i) => t(i)
|
|
548
698
|
}
|
|
549
699
|
) }),
|
|
550
700
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
551
701
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
552
|
-
|
|
702
|
+
$,
|
|
553
703
|
{
|
|
554
704
|
onChange: (i) => r(i)
|
|
555
705
|
}
|
|
@@ -570,44 +720,44 @@ function Ye({
|
|
|
570
720
|
) })
|
|
571
721
|
] });
|
|
572
722
|
}
|
|
573
|
-
function
|
|
723
|
+
function ot(t) {
|
|
574
724
|
const {
|
|
575
725
|
setColorPen: r,
|
|
576
726
|
refEditor: o,
|
|
577
727
|
setThicknessPen: i,
|
|
578
|
-
setColorHighlight:
|
|
579
|
-
changeBorderColorShape:
|
|
580
|
-
onUndo:
|
|
581
|
-
changeColorShape:
|
|
582
|
-
changeShape:
|
|
583
|
-
onThicknessChange:
|
|
584
|
-
onRedo:
|
|
728
|
+
setColorHighlight: T,
|
|
729
|
+
changeBorderColorShape: H,
|
|
730
|
+
onUndo: S,
|
|
731
|
+
changeColorShape: w,
|
|
732
|
+
changeShape: h,
|
|
733
|
+
onThicknessChange: k,
|
|
734
|
+
onRedo: b,
|
|
585
735
|
onClear: B
|
|
586
|
-
} = t, [
|
|
736
|
+
} = t, [a, c] = y(null), [C, f] = y(
|
|
587
737
|
0
|
|
588
738
|
/* square */
|
|
589
739
|
);
|
|
590
|
-
return /* @__PURE__ */ e(
|
|
740
|
+
return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ x(
|
|
591
741
|
"div",
|
|
592
742
|
{
|
|
593
743
|
className: l.wrapper,
|
|
594
744
|
children: [
|
|
595
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ x("div", { className: l.pen, children: [
|
|
596
746
|
/* @__PURE__ */ e(
|
|
597
747
|
"button",
|
|
598
748
|
{
|
|
599
749
|
className: d(l.tool, {
|
|
600
|
-
[l.active]:
|
|
750
|
+
[l.active]: a === "select"
|
|
601
751
|
}),
|
|
602
752
|
onClick: () => {
|
|
603
753
|
const n = o.current.toolController.getPrimaryTools();
|
|
604
|
-
if (
|
|
754
|
+
if (a === "select") {
|
|
605
755
|
c(null), n[0].setEnabled(!1);
|
|
606
756
|
return;
|
|
607
757
|
}
|
|
608
758
|
c("select"), n[0].setEnabled(!0);
|
|
609
759
|
},
|
|
610
|
-
children: /* @__PURE__ */ e(
|
|
760
|
+
children: /* @__PURE__ */ e(_e, {})
|
|
611
761
|
}
|
|
612
762
|
),
|
|
613
763
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
@@ -615,17 +765,17 @@ function Je(t) {
|
|
|
615
765
|
"button",
|
|
616
766
|
{
|
|
617
767
|
className: d(l.tool, {
|
|
618
|
-
[l.active]:
|
|
768
|
+
[l.active]: a === "text"
|
|
619
769
|
}),
|
|
620
770
|
onClick: () => {
|
|
621
771
|
const n = o.current.toolController.getPrimaryTools();
|
|
622
|
-
if (o.current.toolController.setToolEnabled(n[1]),
|
|
772
|
+
if (o.current.toolController.setToolEnabled(n[1]), a === "text") {
|
|
623
773
|
n[1].setEnabled(!1), c(null);
|
|
624
774
|
return;
|
|
625
775
|
}
|
|
626
776
|
c("text"), n[1].setEnabled(!0);
|
|
627
777
|
},
|
|
628
|
-
children: /* @__PURE__ */ e(
|
|
778
|
+
children: /* @__PURE__ */ e(Ae, {})
|
|
629
779
|
}
|
|
630
780
|
),
|
|
631
781
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
@@ -633,34 +783,34 @@ function Je(t) {
|
|
|
633
783
|
"button",
|
|
634
784
|
{
|
|
635
785
|
className: d(l.tool, {
|
|
636
|
-
[l.active]:
|
|
786
|
+
[l.active]: a === "pencil"
|
|
637
787
|
}),
|
|
638
788
|
onClick: () => {
|
|
639
789
|
const n = o.current.toolController.getPrimaryTools();
|
|
640
|
-
if (
|
|
790
|
+
if (a === "pencil") {
|
|
641
791
|
c(null), n[2].setEnabled(!1);
|
|
642
792
|
return;
|
|
643
793
|
}
|
|
644
794
|
c("pencil"), n[2].setEnabled(!0);
|
|
645
795
|
},
|
|
646
|
-
children: /* @__PURE__ */ e(
|
|
796
|
+
children: /* @__PURE__ */ e(Be, {})
|
|
647
797
|
}
|
|
648
798
|
),
|
|
649
799
|
/* @__PURE__ */ e(
|
|
650
800
|
"button",
|
|
651
801
|
{
|
|
652
802
|
className: d(l.tool, {
|
|
653
|
-
[l.active]:
|
|
803
|
+
[l.active]: a === "highlighter"
|
|
654
804
|
}),
|
|
655
805
|
onClick: () => {
|
|
656
806
|
const n = o.current.toolController.getPrimaryTools();
|
|
657
|
-
if (
|
|
807
|
+
if (a === "highlighter") {
|
|
658
808
|
c(null), n[3].setEnabled(!1);
|
|
659
809
|
return;
|
|
660
810
|
}
|
|
661
811
|
c("highlighter"), n[3].setEnabled(!0);
|
|
662
812
|
},
|
|
663
|
-
children: /* @__PURE__ */ e(
|
|
813
|
+
children: /* @__PURE__ */ e(Pe, {})
|
|
664
814
|
}
|
|
665
815
|
),
|
|
666
816
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
@@ -668,17 +818,17 @@ function Je(t) {
|
|
|
668
818
|
"button",
|
|
669
819
|
{
|
|
670
820
|
className: d(l.tool, {
|
|
671
|
-
[l.active]:
|
|
821
|
+
[l.active]: a === "eraser"
|
|
672
822
|
}),
|
|
673
823
|
onClick: () => {
|
|
674
824
|
const n = o.current.toolController.getPrimaryTools();
|
|
675
|
-
if (
|
|
825
|
+
if (a === "eraser") {
|
|
676
826
|
c(null), n[4].setEnabled(!1);
|
|
677
827
|
return;
|
|
678
828
|
}
|
|
679
829
|
c("eraser"), n[4].setEnabled(!0);
|
|
680
830
|
},
|
|
681
|
-
children: /* @__PURE__ */ e(
|
|
831
|
+
children: /* @__PURE__ */ e(qe, {})
|
|
682
832
|
}
|
|
683
833
|
),
|
|
684
834
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
@@ -686,240 +836,240 @@ function Je(t) {
|
|
|
686
836
|
"button",
|
|
687
837
|
{
|
|
688
838
|
className: d(l.tool, {
|
|
689
|
-
[l.active]:
|
|
839
|
+
[l.active]: a === "shapes" && C === 0
|
|
690
840
|
/* square */
|
|
691
841
|
}),
|
|
692
842
|
onClick: () => {
|
|
693
843
|
const n = o.current.toolController.getPrimaryTools();
|
|
694
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
844
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
695
845
|
0
|
|
696
846
|
/* square */
|
|
697
|
-
),
|
|
847
|
+
), f(
|
|
698
848
|
0
|
|
699
849
|
/* square */
|
|
700
850
|
);
|
|
701
851
|
},
|
|
702
|
-
children: /* @__PURE__ */ e(
|
|
852
|
+
children: /* @__PURE__ */ e(Re, {})
|
|
703
853
|
}
|
|
704
854
|
),
|
|
705
855
|
/* @__PURE__ */ e(
|
|
706
856
|
"button",
|
|
707
857
|
{
|
|
708
858
|
className: d(l.tool, {
|
|
709
|
-
[l.active]:
|
|
859
|
+
[l.active]: a === "shapes" && C === 1
|
|
710
860
|
/* rectangle */
|
|
711
861
|
}),
|
|
712
862
|
onClick: () => {
|
|
713
863
|
const n = o.current.toolController.getPrimaryTools();
|
|
714
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
864
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
715
865
|
1
|
|
716
866
|
/* rectangle */
|
|
717
|
-
),
|
|
867
|
+
), f(
|
|
718
868
|
1
|
|
719
869
|
/* rectangle */
|
|
720
870
|
);
|
|
721
871
|
},
|
|
722
|
-
children: /* @__PURE__ */ e(
|
|
872
|
+
children: /* @__PURE__ */ e(Ie, {})
|
|
723
873
|
}
|
|
724
874
|
),
|
|
725
875
|
/* @__PURE__ */ e(
|
|
726
876
|
"button",
|
|
727
877
|
{
|
|
728
878
|
className: d(l.tool, {
|
|
729
|
-
[l.active]:
|
|
879
|
+
[l.active]: a === "shapes" && C === 2
|
|
730
880
|
/* circle */
|
|
731
881
|
}),
|
|
732
882
|
onClick: () => {
|
|
733
883
|
const n = o.current.toolController.getPrimaryTools();
|
|
734
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
884
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
735
885
|
2
|
|
736
886
|
/* circle */
|
|
737
|
-
),
|
|
887
|
+
), f(
|
|
738
888
|
2
|
|
739
889
|
/* circle */
|
|
740
890
|
);
|
|
741
891
|
},
|
|
742
|
-
children: /* @__PURE__ */ e(
|
|
892
|
+
children: /* @__PURE__ */ e(De, {})
|
|
743
893
|
}
|
|
744
894
|
),
|
|
745
895
|
/* @__PURE__ */ e(
|
|
746
896
|
"button",
|
|
747
897
|
{
|
|
748
898
|
className: d(l.tool, {
|
|
749
|
-
[l.active]:
|
|
899
|
+
[l.active]: a === "shapes" && C === 3
|
|
750
900
|
/* triangle */
|
|
751
901
|
}),
|
|
752
902
|
onClick: () => {
|
|
753
903
|
const n = o.current.toolController.getPrimaryTools();
|
|
754
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
904
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
755
905
|
3
|
|
756
906
|
/* triangle */
|
|
757
|
-
),
|
|
907
|
+
), f(
|
|
758
908
|
3
|
|
759
909
|
/* triangle */
|
|
760
910
|
);
|
|
761
911
|
},
|
|
762
|
-
children: /* @__PURE__ */ e(
|
|
912
|
+
children: /* @__PURE__ */ e(We, {})
|
|
763
913
|
}
|
|
764
914
|
),
|
|
765
915
|
/* @__PURE__ */ e(
|
|
766
916
|
"button",
|
|
767
917
|
{
|
|
768
918
|
className: d(l.tool, {
|
|
769
|
-
[l.active]:
|
|
919
|
+
[l.active]: a === "shapes" && C === 4
|
|
770
920
|
/* hexagonal */
|
|
771
921
|
}),
|
|
772
922
|
onClick: () => {
|
|
773
923
|
const n = o.current.toolController.getPrimaryTools();
|
|
774
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
924
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
775
925
|
4
|
|
776
926
|
/* hexagonal */
|
|
777
|
-
),
|
|
927
|
+
), f(
|
|
778
928
|
4
|
|
779
929
|
/* hexagonal */
|
|
780
930
|
);
|
|
781
931
|
},
|
|
782
|
-
children: /* @__PURE__ */ e(
|
|
932
|
+
children: /* @__PURE__ */ e(Fe, {})
|
|
783
933
|
}
|
|
784
934
|
),
|
|
785
935
|
/* @__PURE__ */ e(
|
|
786
936
|
"button",
|
|
787
937
|
{
|
|
788
938
|
className: d(l.tool, {
|
|
789
|
-
[l.active]:
|
|
939
|
+
[l.active]: a === "shapes" && C === 5
|
|
790
940
|
/* diamond */
|
|
791
941
|
}),
|
|
792
942
|
onClick: () => {
|
|
793
943
|
const n = o.current.toolController.getPrimaryTools();
|
|
794
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
944
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
795
945
|
5
|
|
796
946
|
/* diamond */
|
|
797
|
-
),
|
|
947
|
+
), f(
|
|
798
948
|
5
|
|
799
949
|
/* diamond */
|
|
800
950
|
);
|
|
801
951
|
},
|
|
802
|
-
children: /* @__PURE__ */ e(
|
|
952
|
+
children: /* @__PURE__ */ e(Oe, {})
|
|
803
953
|
}
|
|
804
954
|
),
|
|
805
955
|
/* @__PURE__ */ e(
|
|
806
956
|
"button",
|
|
807
957
|
{
|
|
808
958
|
className: d(l.tool, {
|
|
809
|
-
[l.active]:
|
|
959
|
+
[l.active]: a === "shapes" && C === 6
|
|
810
960
|
/* arrow */
|
|
811
961
|
}),
|
|
812
962
|
onClick: () => {
|
|
813
963
|
const n = o.current.toolController.getPrimaryTools();
|
|
814
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
964
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
815
965
|
6
|
|
816
966
|
/* arrow */
|
|
817
|
-
),
|
|
967
|
+
), f(
|
|
818
968
|
6
|
|
819
969
|
/* arrow */
|
|
820
970
|
);
|
|
821
971
|
},
|
|
822
|
-
children: /* @__PURE__ */ e(
|
|
972
|
+
children: /* @__PURE__ */ e(Ve, {})
|
|
823
973
|
}
|
|
824
974
|
),
|
|
825
975
|
/* @__PURE__ */ e(
|
|
826
976
|
"button",
|
|
827
977
|
{
|
|
828
978
|
className: d(l.tool, {
|
|
829
|
-
[l.active]:
|
|
979
|
+
[l.active]: a === "shapes" && C === 7
|
|
830
980
|
/* line */
|
|
831
981
|
}),
|
|
832
982
|
onClick: () => {
|
|
833
983
|
const n = o.current.toolController.getPrimaryTools();
|
|
834
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
984
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
835
985
|
7
|
|
836
986
|
/* line */
|
|
837
|
-
),
|
|
987
|
+
), f(
|
|
838
988
|
7
|
|
839
989
|
/* line */
|
|
840
990
|
);
|
|
841
991
|
},
|
|
842
|
-
children: /* @__PURE__ */ e(
|
|
992
|
+
children: /* @__PURE__ */ e(Ze, {})
|
|
843
993
|
}
|
|
844
994
|
),
|
|
845
995
|
/* @__PURE__ */ e(
|
|
846
996
|
"button",
|
|
847
997
|
{
|
|
848
998
|
className: d(l.tool, {
|
|
849
|
-
[l.active]:
|
|
999
|
+
[l.active]: a === "shapes" && C === 8
|
|
850
1000
|
/* heart */
|
|
851
1001
|
}),
|
|
852
1002
|
onClick: () => {
|
|
853
1003
|
const n = o.current.toolController.getPrimaryTools();
|
|
854
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
1004
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
855
1005
|
8
|
|
856
1006
|
/* heart */
|
|
857
|
-
),
|
|
1007
|
+
), f(
|
|
858
1008
|
8
|
|
859
1009
|
/* heart */
|
|
860
1010
|
);
|
|
861
1011
|
},
|
|
862
|
-
children: /* @__PURE__ */ e(
|
|
1012
|
+
children: /* @__PURE__ */ e(je, {})
|
|
863
1013
|
}
|
|
864
1014
|
),
|
|
865
1015
|
/* @__PURE__ */ e(
|
|
866
1016
|
"button",
|
|
867
1017
|
{
|
|
868
1018
|
className: d(l.tool, {
|
|
869
|
-
[l.active]:
|
|
1019
|
+
[l.active]: a === "shapes" && C === 9
|
|
870
1020
|
/* star */
|
|
871
1021
|
}),
|
|
872
1022
|
onClick: () => {
|
|
873
1023
|
const n = o.current.toolController.getPrimaryTools();
|
|
874
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
1024
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
875
1025
|
9
|
|
876
1026
|
/* star */
|
|
877
|
-
),
|
|
1027
|
+
), f(
|
|
878
1028
|
9
|
|
879
1029
|
/* star */
|
|
880
1030
|
);
|
|
881
1031
|
},
|
|
882
|
-
children: /* @__PURE__ */ e(
|
|
1032
|
+
children: /* @__PURE__ */ e(Xe, {})
|
|
883
1033
|
}
|
|
884
1034
|
),
|
|
885
1035
|
/* @__PURE__ */ e(
|
|
886
1036
|
"button",
|
|
887
1037
|
{
|
|
888
1038
|
className: d(l.tool, {
|
|
889
|
-
[l.active]:
|
|
1039
|
+
[l.active]: a === "shapes" && C === 10
|
|
890
1040
|
/* cloud */
|
|
891
1041
|
}),
|
|
892
1042
|
onClick: () => {
|
|
893
1043
|
const n = o.current.toolController.getPrimaryTools();
|
|
894
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
1044
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
895
1045
|
10
|
|
896
1046
|
/* cloud */
|
|
897
|
-
),
|
|
1047
|
+
), f(
|
|
898
1048
|
10
|
|
899
1049
|
/* cloud */
|
|
900
1050
|
);
|
|
901
1051
|
},
|
|
902
|
-
children: /* @__PURE__ */ e(
|
|
1052
|
+
children: /* @__PURE__ */ e(Ke, {})
|
|
903
1053
|
}
|
|
904
1054
|
),
|
|
905
1055
|
/* @__PURE__ */ e(
|
|
906
1056
|
"button",
|
|
907
1057
|
{
|
|
908
1058
|
className: d(l.tool, {
|
|
909
|
-
[l.active]:
|
|
1059
|
+
[l.active]: a === "shapes" && C === 11
|
|
910
1060
|
/* parallelogram */
|
|
911
1061
|
}),
|
|
912
1062
|
onClick: () => {
|
|
913
1063
|
const n = o.current.toolController.getPrimaryTools();
|
|
914
|
-
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0),
|
|
1064
|
+
o.current.toolController.setToolEnabled(n[5]), c("shapes"), n[5].setEnabled(!0), h(
|
|
915
1065
|
11
|
|
916
1066
|
/* parallelogram */
|
|
917
|
-
),
|
|
1067
|
+
), f(
|
|
918
1068
|
11
|
|
919
1069
|
/* parallelogram */
|
|
920
1070
|
);
|
|
921
1071
|
},
|
|
922
|
-
children: /* @__PURE__ */ e(
|
|
1072
|
+
children: /* @__PURE__ */ e(Qe, {})
|
|
923
1073
|
}
|
|
924
1074
|
),
|
|
925
1075
|
/* @__PURE__ */ e("div", { className: l.line }),
|
|
@@ -927,16 +1077,16 @@ function Je(t) {
|
|
|
927
1077
|
"button",
|
|
928
1078
|
{
|
|
929
1079
|
className: d(l.tool),
|
|
930
|
-
onClick:
|
|
931
|
-
children: /* @__PURE__ */ e(
|
|
1080
|
+
onClick: S,
|
|
1081
|
+
children: /* @__PURE__ */ e(Ge, {})
|
|
932
1082
|
}
|
|
933
1083
|
),
|
|
934
1084
|
/* @__PURE__ */ e(
|
|
935
1085
|
"button",
|
|
936
1086
|
{
|
|
937
1087
|
className: d(l.tool),
|
|
938
|
-
onClick:
|
|
939
|
-
children: /* @__PURE__ */ e(
|
|
1088
|
+
onClick: b,
|
|
1089
|
+
children: /* @__PURE__ */ e($e, {})
|
|
940
1090
|
}
|
|
941
1091
|
),
|
|
942
1092
|
/* @__PURE__ */ e(
|
|
@@ -944,26 +1094,26 @@ function Je(t) {
|
|
|
944
1094
|
{
|
|
945
1095
|
className: d(l.tool),
|
|
946
1096
|
onClick: B,
|
|
947
|
-
children: /* @__PURE__ */ e(
|
|
1097
|
+
children: /* @__PURE__ */ e(Ue, {})
|
|
948
1098
|
}
|
|
949
1099
|
)
|
|
950
1100
|
] }),
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
|
|
953
|
-
|
|
1101
|
+
/* @__PURE__ */ x("div", { className: l.optionsWrap, children: [
|
|
1102
|
+
a === "pencil" && /* @__PURE__ */ e(
|
|
1103
|
+
et,
|
|
954
1104
|
{
|
|
955
1105
|
setColorPen: r,
|
|
956
1106
|
setThicknessPen: i
|
|
957
1107
|
}
|
|
958
1108
|
),
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1109
|
+
a === "highlighter" && /* @__PURE__ */ e(tt, { setColorHighlight: T }),
|
|
1110
|
+
a === "shapes" && /* @__PURE__ */ e(
|
|
1111
|
+
rt,
|
|
962
1112
|
{
|
|
963
|
-
changeBorderColorShape:
|
|
964
|
-
changeColorShape:
|
|
965
|
-
changeShape:
|
|
966
|
-
onThicknessChange:
|
|
1113
|
+
changeBorderColorShape: H,
|
|
1114
|
+
changeColorShape: w,
|
|
1115
|
+
changeShape: h,
|
|
1116
|
+
onThicknessChange: k
|
|
967
1117
|
}
|
|
968
1118
|
)
|
|
969
1119
|
] })
|
|
@@ -971,90 +1121,103 @@ function Je(t) {
|
|
|
971
1121
|
}
|
|
972
1122
|
) });
|
|
973
1123
|
}
|
|
974
|
-
let
|
|
975
|
-
|
|
976
|
-
const
|
|
1124
|
+
let I = !1;
|
|
1125
|
+
function Tt() {
|
|
1126
|
+
const t = Te(), r = se(lt.name), {
|
|
1127
|
+
isActive: o = void 0,
|
|
1128
|
+
upload: i
|
|
1129
|
+
} = (r == null ? void 0 : r.componentProps) ?? {}, { editorDisabled: T } = ae(o), [H, S] = y(!1), w = K(null), h = K(null), k = () => {
|
|
977
1130
|
(async () => {
|
|
978
|
-
const
|
|
979
|
-
|
|
1131
|
+
const s = document.querySelector("#easydrawer");
|
|
1132
|
+
s && (w.current = new ce(s, {
|
|
980
1133
|
wheelEventsEnabled: !1,
|
|
981
1134
|
disableZoom: !0
|
|
982
|
-
}),
|
|
1135
|
+
}), h.current = he(w.current), h.current.addDefaultToolWidgets());
|
|
983
1136
|
})();
|
|
984
1137
|
};
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1138
|
+
G(() => {
|
|
1139
|
+
H && setTimeout(() => {
|
|
1140
|
+
k();
|
|
988
1141
|
}, 200);
|
|
989
|
-
}, [
|
|
990
|
-
const
|
|
991
|
-
if (
|
|
992
|
-
const
|
|
993
|
-
let
|
|
994
|
-
if (
|
|
995
|
-
const
|
|
996
|
-
|
|
1142
|
+
}, [H]);
|
|
1143
|
+
const b = async () => {
|
|
1144
|
+
if (w.current) {
|
|
1145
|
+
const m = w.current.toSVG(), s = m.outerHTML, p = `drawer-${ue()}.svg`;
|
|
1146
|
+
let z = de(m.outerHTML);
|
|
1147
|
+
if (i) {
|
|
1148
|
+
const q = Ce(z, p);
|
|
1149
|
+
z = await i(q);
|
|
997
1150
|
}
|
|
998
1151
|
t == null || t.chain().focus().setDrawer(
|
|
999
1152
|
{
|
|
1000
1153
|
type: "drawer",
|
|
1001
|
-
src:
|
|
1002
|
-
alt: encodeURIComponent(
|
|
1154
|
+
src: z,
|
|
1155
|
+
alt: encodeURIComponent(s),
|
|
1003
1156
|
width: 426,
|
|
1004
1157
|
height: 212
|
|
1005
1158
|
},
|
|
1006
|
-
!!
|
|
1159
|
+
!!s
|
|
1007
1160
|
).run();
|
|
1008
1161
|
}
|
|
1009
|
-
|
|
1010
|
-
},
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
},
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
},
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
-
},
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
},
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
},
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
},
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
},
|
|
1032
|
-
if (
|
|
1033
|
-
for (;
|
|
1034
|
-
|
|
1035
|
-
|
|
1162
|
+
S(!1);
|
|
1163
|
+
}, B = (m) => {
|
|
1164
|
+
const s = w.current.toolController.getPrimaryTools()[2], p = h.current.getWidgetById("pen-1");
|
|
1165
|
+
s && p && (s.setColor(m), p.serializeState());
|
|
1166
|
+
}, a = (m) => {
|
|
1167
|
+
const s = w.current.toolController.getPrimaryTools()[2], p = h.current.getWidgetById("pen-1");
|
|
1168
|
+
s && p && (s.setThickness(m), p.serializeState());
|
|
1169
|
+
}, c = (m) => {
|
|
1170
|
+
const s = w.current.toolController.getPrimaryTools()[3], p = h.current.getWidgetById("pen-2");
|
|
1171
|
+
s && p && (s.setColor(m), p.serializeState());
|
|
1172
|
+
}, C = (m) => {
|
|
1173
|
+
const s = h.current.getWidgetById("shape");
|
|
1174
|
+
s && s.setShapeType(m);
|
|
1175
|
+
}, f = (m) => {
|
|
1176
|
+
const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
|
|
1177
|
+
s && p && (s.setColor(m), p.serializeState());
|
|
1178
|
+
}, n = (m) => {
|
|
1179
|
+
const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
|
|
1180
|
+
s && p && (s.setThickness(m), p.serializeState());
|
|
1181
|
+
}, F = (m) => {
|
|
1182
|
+
const s = w.current.toolController.getPrimaryTools()[5], p = h.current.getWidgetById("shape");
|
|
1183
|
+
s && p && (s.setBorderColor(m), p.serializeState());
|
|
1184
|
+
}, P = () => {
|
|
1185
|
+
if (I) {
|
|
1186
|
+
for (; w.current.history.redoStackSize > 0; )
|
|
1187
|
+
w.current.history.redo();
|
|
1188
|
+
I = !1;
|
|
1036
1189
|
return;
|
|
1037
1190
|
}
|
|
1038
|
-
|
|
1191
|
+
w.current.history.undo();
|
|
1192
|
+
}, D = () => {
|
|
1193
|
+
I || w.current.history.redo();
|
|
1194
|
+
}, O = () => {
|
|
1195
|
+
if (!I) {
|
|
1196
|
+
for (; w.current.history.undoStackSize > 0; )
|
|
1197
|
+
P();
|
|
1198
|
+
I = !0;
|
|
1199
|
+
}
|
|
1039
1200
|
};
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
|
|
1201
|
+
return r ? /* @__PURE__ */ x(
|
|
1202
|
+
me,
|
|
1042
1203
|
{
|
|
1043
|
-
onOpenChange:
|
|
1044
|
-
open:
|
|
1204
|
+
onOpenChange: S,
|
|
1205
|
+
open: H,
|
|
1045
1206
|
children: [
|
|
1046
|
-
/* @__PURE__ */ e(
|
|
1047
|
-
|
|
1207
|
+
/* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1208
|
+
ge,
|
|
1048
1209
|
{
|
|
1049
|
-
|
|
1210
|
+
disabled: T,
|
|
1211
|
+
action: () => {
|
|
1212
|
+
T || S(!0);
|
|
1213
|
+
},
|
|
1050
1214
|
icon: "PencilRuler",
|
|
1051
|
-
tooltip: "Drawer"
|
|
1052
|
-
tooltipOptions: o
|
|
1215
|
+
tooltip: "Drawer"
|
|
1053
1216
|
}
|
|
1054
1217
|
) }),
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
/* @__PURE__ */ e(
|
|
1057
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ x(we, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
1219
|
+
/* @__PURE__ */ e(ve, { children: "Drawer" }),
|
|
1220
|
+
/* @__PURE__ */ x("div", { style: { height: "600px", width: "100%", borderWidth: 1, background: "white", position: "relative" }, children: [
|
|
1058
1221
|
/* @__PURE__ */ e(
|
|
1059
1222
|
"div",
|
|
1060
1223
|
{
|
|
@@ -1063,34 +1226,26 @@ const et = ({ editor: t, upload: r, tooltipOptions: o }) => {
|
|
|
1063
1226
|
}
|
|
1064
1227
|
),
|
|
1065
1228
|
/* @__PURE__ */ e(
|
|
1066
|
-
|
|
1229
|
+
ot,
|
|
1067
1230
|
{
|
|
1068
|
-
changeBorderColorShape:
|
|
1069
|
-
changeColorShape:
|
|
1070
|
-
changeShape:
|
|
1071
|
-
onClear:
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
P || p.current.history.redo();
|
|
1080
|
-
},
|
|
1081
|
-
onThicknessChange: C,
|
|
1082
|
-
onUndo: n,
|
|
1083
|
-
refEditor: p,
|
|
1084
|
-
setColorHighlight: B,
|
|
1085
|
-
setColorPen: z,
|
|
1086
|
-
setThicknessPen: x
|
|
1231
|
+
changeBorderColorShape: F,
|
|
1232
|
+
changeColorShape: f,
|
|
1233
|
+
changeShape: C,
|
|
1234
|
+
onClear: O,
|
|
1235
|
+
onRedo: D,
|
|
1236
|
+
onThicknessChange: n,
|
|
1237
|
+
onUndo: P,
|
|
1238
|
+
refEditor: w,
|
|
1239
|
+
setColorHighlight: c,
|
|
1240
|
+
setColorPen: B,
|
|
1241
|
+
setThicknessPen: a
|
|
1087
1242
|
}
|
|
1088
1243
|
)
|
|
1089
1244
|
] }),
|
|
1090
|
-
/* @__PURE__ */ e(
|
|
1091
|
-
|
|
1245
|
+
/* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e(
|
|
1246
|
+
be,
|
|
1092
1247
|
{
|
|
1093
|
-
onClick:
|
|
1248
|
+
onClick: b,
|
|
1094
1249
|
type: "button",
|
|
1095
1250
|
children: "Save changes"
|
|
1096
1251
|
}
|
|
@@ -1098,154 +1253,10 @@ const et = ({ editor: t, upload: r, tooltipOptions: o }) => {
|
|
|
1098
1253
|
] })
|
|
1099
1254
|
]
|
|
1100
1255
|
}
|
|
1101
|
-
);
|
|
1102
|
-
}, W = {
|
|
1103
|
-
TOP_LEFT: "tl",
|
|
1104
|
-
TOP_RIGHT: "tr",
|
|
1105
|
-
BOTTOM_LEFT: "bl",
|
|
1106
|
-
BOTTOM_RIGHT: "br"
|
|
1107
|
-
};
|
|
1108
|
-
function tt({ editor: t, node: r, updateAttributes: o, getPos: i, selected: m }) {
|
|
1109
|
-
const [p, b] = M({
|
|
1110
|
-
width: K,
|
|
1111
|
-
height: K
|
|
1112
|
-
}), [A, T] = M({
|
|
1113
|
-
width: 0,
|
|
1114
|
-
height: 0
|
|
1115
|
-
}), [z] = M([
|
|
1116
|
-
W.TOP_LEFT,
|
|
1117
|
-
W.TOP_RIGHT,
|
|
1118
|
-
W.BOTTOM_LEFT,
|
|
1119
|
-
W.BOTTOM_RIGHT
|
|
1120
|
-
]), [x, B] = M(!1), [s, c] = M({
|
|
1121
|
-
x: 0,
|
|
1122
|
-
y: 0,
|
|
1123
|
-
w: 0,
|
|
1124
|
-
h: 0,
|
|
1125
|
-
dir: ""
|
|
1126
|
-
}), { align: C } = r == null ? void 0 : r.attrs, v = O(() => {
|
|
1127
|
-
const { src: h, alt: E, width: L, height: k } = r == null ? void 0 : r.attrs, _ = j(L) ? `${L}px` : L, w = j(k) ? `${k}px` : k;
|
|
1128
|
-
return {
|
|
1129
|
-
src: h || void 0,
|
|
1130
|
-
alt: E || void 0,
|
|
1131
|
-
style: {
|
|
1132
|
-
width: _ || void 0,
|
|
1133
|
-
height: w || void 0
|
|
1134
|
-
}
|
|
1135
|
-
};
|
|
1136
|
-
}, [r == null ? void 0 : r.attrs]), n = O(() => {
|
|
1137
|
-
const {
|
|
1138
|
-
style: { width: h }
|
|
1139
|
-
} = v;
|
|
1140
|
-
return { width: h === "100%" ? h : void 0 };
|
|
1141
|
-
}, [v]);
|
|
1142
|
-
function $(h) {
|
|
1143
|
-
T({
|
|
1144
|
-
width: h.target.width,
|
|
1145
|
-
height: h.target.height
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
function R() {
|
|
1149
|
-
t.commands.setNodeSelection(i());
|
|
1150
|
-
}
|
|
1151
|
-
const f = q(
|
|
1152
|
-
Z(() => {
|
|
1153
|
-
const { width: h } = getComputedStyle(t.view.dom);
|
|
1154
|
-
b((E) => ({
|
|
1155
|
-
...E,
|
|
1156
|
-
width: Number.parseInt(h, 10)
|
|
1157
|
-
}));
|
|
1158
|
-
}, Q),
|
|
1159
|
-
[t]
|
|
1160
|
-
);
|
|
1161
|
-
function a(h, E) {
|
|
1162
|
-
h.preventDefault(), h.stopPropagation();
|
|
1163
|
-
const L = A.width, k = A.height, _ = L / k;
|
|
1164
|
-
let w = Number(r.attrs.width), N = Number(r.attrs.height);
|
|
1165
|
-
const H = p.width;
|
|
1166
|
-
w && !N ? (w = w > H ? H : w, N = Math.round(w / _)) : N && !w ? (w = Math.round(N * _), w = w > H ? H : w) : !w && !N ? (w = L > H ? H : L, N = Math.round(w / _)) : w = w > H ? H : w, B(!0), c({
|
|
1167
|
-
x: h.clientX,
|
|
1168
|
-
y: h.clientY,
|
|
1169
|
-
w,
|
|
1170
|
-
h: N,
|
|
1171
|
-
dir: E
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
|
-
const u = q(
|
|
1175
|
-
Z((h) => {
|
|
1176
|
-
if (h.preventDefault(), h.stopPropagation(), !x)
|
|
1177
|
-
return;
|
|
1178
|
-
const { x: E, w: L, dir: k } = s, _ = (h.clientX - E) * (/l/.test(k) ? -1 : 1), { width: w, height: N } = r == null ? void 0 : r.attrs, H = w / N, U = he(L + _, fe, p.width), ee = Math.round(U / H);
|
|
1179
|
-
o({
|
|
1180
|
-
width: U,
|
|
1181
|
-
height: ee
|
|
1182
|
-
});
|
|
1183
|
-
}, Q),
|
|
1184
|
-
[x, s, p, o, r == null ? void 0 : r.attrs]
|
|
1185
|
-
), S = q(
|
|
1186
|
-
(h) => {
|
|
1187
|
-
h.preventDefault(), h.stopPropagation(), x && (c({
|
|
1188
|
-
x: 0,
|
|
1189
|
-
y: 0,
|
|
1190
|
-
w: 0,
|
|
1191
|
-
h: 0,
|
|
1192
|
-
dir: ""
|
|
1193
|
-
}), B(!1), R());
|
|
1194
|
-
},
|
|
1195
|
-
[x, R]
|
|
1196
|
-
), I = q(() => {
|
|
1197
|
-
document == null || document.addEventListener("mousemove", u, !0), document == null || document.addEventListener("mouseup", S, !0);
|
|
1198
|
-
}, [u, S]), F = q(() => {
|
|
1199
|
-
document == null || document.removeEventListener("mousemove", u, !0), document == null || document.removeEventListener("mouseup", S, !0);
|
|
1200
|
-
}, [u, S]);
|
|
1201
|
-
V(() => (x ? I() : F(), () => {
|
|
1202
|
-
F();
|
|
1203
|
-
}), [x, I, F]);
|
|
1204
|
-
const D = O(() => new ResizeObserver(() => f()), [f]);
|
|
1205
|
-
return V(() => (D.observe(t.view.dom), () => {
|
|
1206
|
-
D.disconnect();
|
|
1207
|
-
}), [t.view.dom, D]), /* @__PURE__ */ e(
|
|
1208
|
-
de,
|
|
1209
|
-
{
|
|
1210
|
-
className: "image-view",
|
|
1211
|
-
style: { ...n, width: "100%", textAlign: C },
|
|
1212
|
-
children: /* @__PURE__ */ y(
|
|
1213
|
-
"div",
|
|
1214
|
-
{
|
|
1215
|
-
"data-drag-handle": !0,
|
|
1216
|
-
draggable: "true",
|
|
1217
|
-
style: { ...n, background: "#fff" },
|
|
1218
|
-
className: `image-view__body ${m ? "image-view__body--focused" : ""} ${x ? "image-view__body--resizing" : ""}`,
|
|
1219
|
-
children: [
|
|
1220
|
-
/* @__PURE__ */ e(
|
|
1221
|
-
"img",
|
|
1222
|
-
{
|
|
1223
|
-
alt: v.alt,
|
|
1224
|
-
className: "image-view__body__image block",
|
|
1225
|
-
height: "auto",
|
|
1226
|
-
onClick: R,
|
|
1227
|
-
onLoad: $,
|
|
1228
|
-
src: v.src,
|
|
1229
|
-
style: v.style
|
|
1230
|
-
}
|
|
1231
|
-
),
|
|
1232
|
-
t.view.editable && (m || x) && /* @__PURE__ */ e("div", { className: "image-resizer", children: z == null ? void 0 : z.map((h) => /* @__PURE__ */ e(
|
|
1233
|
-
"span",
|
|
1234
|
-
{
|
|
1235
|
-
className: `image-resizer__handler image-resizer__handler--${h}`,
|
|
1236
|
-
onMouseDown: (E) => a(E, h)
|
|
1237
|
-
},
|
|
1238
|
-
`image-dir-${h}`
|
|
1239
|
-
)) })
|
|
1240
|
-
]
|
|
1241
|
-
}
|
|
1242
|
-
)
|
|
1243
|
-
}
|
|
1244
|
-
);
|
|
1256
|
+
) : /* @__PURE__ */ e(U, {});
|
|
1245
1257
|
}
|
|
1246
|
-
const
|
|
1247
|
-
name: "
|
|
1248
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1258
|
+
const lt = /* @__PURE__ */ re.extend({
|
|
1259
|
+
name: "richTextDrawer",
|
|
1249
1260
|
//@ts-expect-error
|
|
1250
1261
|
addOptions() {
|
|
1251
1262
|
var t;
|
|
@@ -1261,18 +1272,16 @@ const ht = /* @__PURE__ */ ue.extend({
|
|
|
1261
1272
|
HTMLAttributes: {
|
|
1262
1273
|
class: "drawer"
|
|
1263
1274
|
},
|
|
1264
|
-
button: ({
|
|
1265
|
-
var
|
|
1275
|
+
button: ({ t: r, extension: o }) => {
|
|
1276
|
+
var i;
|
|
1266
1277
|
return {
|
|
1267
|
-
component: et,
|
|
1268
1278
|
componentProps: {
|
|
1269
1279
|
action: () => !0,
|
|
1270
1280
|
isActive: () => !1,
|
|
1271
1281
|
disabled: !1,
|
|
1272
|
-
editor: r,
|
|
1273
1282
|
icon: "PencilRuler",
|
|
1274
|
-
tooltip:
|
|
1275
|
-
upload: (
|
|
1283
|
+
tooltip: r("editor.drawer.tooltip"),
|
|
1284
|
+
upload: (i = o == null ? void 0 : o.options) == null ? void 0 : i.upload
|
|
1276
1285
|
}
|
|
1277
1286
|
};
|
|
1278
1287
|
}
|
|
@@ -1312,7 +1321,7 @@ const ht = /* @__PURE__ */ ue.extend({
|
|
|
1312
1321
|
};
|
|
1313
1322
|
},
|
|
1314
1323
|
addNodeView() {
|
|
1315
|
-
return
|
|
1324
|
+
return le(xe);
|
|
1316
1325
|
},
|
|
1317
1326
|
// @ts-ignore
|
|
1318
1327
|
addCommands() {
|
|
@@ -1365,6 +1374,7 @@ const ht = /* @__PURE__ */ ue.extend({
|
|
|
1365
1374
|
}
|
|
1366
1375
|
});
|
|
1367
1376
|
export {
|
|
1368
|
-
|
|
1369
|
-
|
|
1377
|
+
ot as C,
|
|
1378
|
+
lt as D,
|
|
1379
|
+
Tt as R
|
|
1370
1380
|
};
|