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