vue-data-ui 3.2.2 → 3.2.3
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/dist/{Arrow-BWqgcDpl.js → Arrow-Bb0bGghy.js} +1 -1
- package/dist/{BaseDraggableDialog-Cg4ZF9cb.js → BaseDraggableDialog-CHhZIht2.js} +2 -2
- package/dist/{BaseIcon-e63bhLIi.js → BaseIcon-Bz-1GQhu.js} +10 -3
- package/dist/ColorPicker-B-WUqMoV.js +238 -0
- package/dist/{DataTable-dv6G7Krn.js → DataTable-BvjacRbw.js} +2 -2
- package/dist/{Legend-CVcdvTLM.js → Legend-BpoFJ8fc.js} +2 -2
- package/dist/{NonSvgPenAndPaper-DSmotL8i.js → NonSvgPenAndPaper-l9giyY1Z.js} +3 -3
- package/dist/{PackageVersion-C3Vg-vTM.js → PackageVersion-oBQ8brnx.js} +1 -1
- package/dist/{PenAndPaper-CplrzuG7.js → PenAndPaper-CR8q353D.js} +3 -3
- package/dist/{Shape-D_vfF7sk.js → Shape-C_C_OmqR.js} +1 -1
- package/dist/{Slicer-BO2wNLcR.js → Slicer-BA2GhOmY.js} +63 -63
- package/dist/{SparkTooltip-B82G5-BO.js → SparkTooltip-Dz1PDE_h.js} +1 -1
- package/dist/{Title-DlqxaiIs.js → Title-C__lOIPC.js} +1 -1
- package/dist/{Tooltip-BKqK7z38.js → Tooltip-BOXz8skU.js} +1 -1
- package/dist/{UserOptions-C9IFsUt0.js → UserOptions-DsTgvAok.js} +2 -2
- package/dist/components/arrow.js +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +5 -0
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-icon.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/{dom-to-png-1edcjS0-.js → dom-to-png-BgvOdfyW.js} +1 -1
- package/dist/{img-A48JwXxj.js → img-DjWwQXVS.js} +1 -1
- package/dist/{lib-CDp2KgIU.js → lib-BEpWEyMm.js} +56 -56
- package/dist/{pdf-BZV8MuXM.js → pdf-YD0ShN36.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +14 -3
- package/dist/{useAutoSizeLabelsInsideViewbox-C2IsrQqi.js → useAutoSizeLabelsInsideViewbox-BVJkib7z.js} +1 -1
- package/dist/{useNestedProp-Cwtenuui.js → useNestedProp-CLD3Gk9S.js} +17 -13
- package/dist/{usePrinter-DU_Pi3Rq.js → usePrinter-w23K-ezx.js} +2 -2
- package/dist/{vue-data-ui-BHJOTOQY.js → vue-data-ui-hSWsJzdK.js} +64 -64
- package/dist/vue-data-ui.js +96 -96
- package/dist/{vue-ui-3d-bar-rxghnZJO.js → vue-ui-3d-bar-B45AYk-O.js} +6 -6
- package/dist/vue-ui-accordion-Cv7OaVUI.js +78 -0
- package/dist/{vue-ui-age-pyramid-gT_SnI-F.js → vue-ui-age-pyramid-CJ66TbYc.js} +6 -6
- package/dist/vue-ui-annotator-DOO0qej9.js +2959 -0
- package/dist/{vue-ui-bullet-DREbhLhy.js → vue-ui-bullet-D_V1l1Jt.js} +15 -15
- package/dist/{vue-ui-candlestick-D4P15Ci1.js → vue-ui-candlestick-DrkWrGT2.js} +33 -33
- package/dist/{vue-ui-carousel-table-C24KX4gd.js → vue-ui-carousel-table-0zk2YkV7.js} +4 -4
- package/dist/{vue-ui-chestnut-BbQknrj0.js → vue-ui-chestnut-CAGkS9Lt.js} +32 -32
- package/dist/{vue-ui-chord-BM4_D9kI.js → vue-ui-chord-CHAaUGaZ.js} +53 -53
- package/dist/{vue-ui-circle-pack-S4Asc9CS.js → vue-ui-circle-pack-CBySiQot.js} +29 -29
- package/dist/{vue-ui-cursor-F9MXsQ1K.js → vue-ui-cursor-Cbt_0B5t.js} +2 -2
- package/dist/{vue-ui-dashboard-D6LHLdFS.js → vue-ui-dashboard-BAOd1hi1.js} +67 -67
- package/dist/{vue-ui-digits-B_8VzLOS.js → vue-ui-digits-ChAz3jSS.js} +2 -2
- package/dist/{vue-ui-donut-B7T8_tP1.js → vue-ui-donut-BgYaWImK.js} +8 -8
- package/dist/{vue-ui-donut-evolution-DOn-7PnK.js → vue-ui-donut-evolution-UWyvIsbE.js} +55 -55
- package/dist/{vue-ui-dumbbell-Ch66pFUG.js → vue-ui-dumbbell-B5IHRXdS.js} +7 -7
- package/dist/{vue-ui-flow-DPcsRLJJ.js → vue-ui-flow-DB4sLZG4.js} +63 -63
- package/dist/{vue-ui-funnel-BdcKoacQ.js → vue-ui-funnel-COZLSfZ8.js} +36 -36
- package/dist/{vue-ui-galaxy-D3c-O1Op.js → vue-ui-galaxy-S8pIdU78.js} +46 -46
- package/dist/{vue-ui-gauge-D1zbKzZQ.js → vue-ui-gauge-BVaE3IZt.js} +59 -59
- package/dist/{vue-ui-gizmo-CcrANrSX.js → vue-ui-gizmo-BmJ01zdG.js} +3 -3
- package/dist/{vue-ui-heatmap-CcvV9Y14.js → vue-ui-heatmap-DiAryN8L.js} +7 -7
- package/dist/{vue-ui-history-plot-a0mLhd0L.js → vue-ui-history-plot-eeYk4C28.js} +44 -44
- package/dist/{vue-ui-kpi-BwUpplcm.js → vue-ui-kpi-D7WXGb3K.js} +3 -3
- package/dist/{vue-ui-mini-loader-DBPZOqZA.js → vue-ui-mini-loader-CKMzFSG5.js} +2 -2
- package/dist/{vue-ui-molecule-xsgartoC.js → vue-ui-molecule-daI3rmbc.js} +5 -5
- package/dist/{vue-ui-mood-radar-kl2d5QsL.js → vue-ui-mood-radar-CawOBU0s.js} +7 -7
- package/dist/{vue-ui-nested-donuts-D9I8_VnP.js → vue-ui-nested-donuts-Ci7qxsh6.js} +70 -70
- package/dist/{vue-ui-onion-BlxsHavW.js → vue-ui-onion-CUkVuewC.js} +8 -8
- package/dist/{vue-ui-parallel-coordinate-plot-DHH6lrbW.js → vue-ui-parallel-coordinate-plot-D7UkjkUV.js} +35 -35
- package/dist/{vue-ui-quadrant-DyIQZUPC.js → vue-ui-quadrant-B9VZz5d6.js} +8 -8
- package/dist/{vue-ui-quick-chart-Jfr_Ezh9.js → vue-ui-quick-chart-BQgH4Aap.js} +55 -55
- package/dist/{vue-ui-radar-BL_dJV12.js → vue-ui-radar-DvZ8XcZC.js} +54 -54
- package/dist/{vue-ui-rating-LiragGSU.js → vue-ui-rating-C0Ubexdn.js} +2 -2
- package/dist/{vue-ui-relation-circle-BrR2W_6V.js → vue-ui-relation-circle-Bal5QL_Z.js} +25 -25
- package/dist/{vue-ui-ridgeline-CpaOYplC.js → vue-ui-ridgeline-DbRZFJcN.js} +27 -27
- package/dist/{vue-ui-rings-B9TGOwFE.js → vue-ui-rings-BJ_Dmy5i.js} +38 -38
- package/dist/{vue-ui-scatter-Bq4pSRu_.js → vue-ui-scatter-bljL9Bav.js} +49 -49
- package/dist/{vue-ui-skeleton-BlVnOk2o.js → vue-ui-skeleton-DZPi12tE.js} +3 -3
- package/dist/{vue-ui-smiley-DyP9gKYe.js → vue-ui-smiley-DxC8rN5b.js} +2 -2
- package/dist/{vue-ui-spark-trend-Pvdqnqia.js → vue-ui-spark-trend-CqMF642_.js} +22 -22
- package/dist/{vue-ui-sparkbar-DF6eDrxt.js → vue-ui-sparkbar-BcyaivMe.js} +3 -3
- package/dist/{vue-ui-sparkgauge-BR7oFSSF.js → vue-ui-sparkgauge-BkIUpzkZ.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-CkOGqy2h.js → vue-ui-sparkhistogram-DnPdJk3e.js} +4 -4
- package/dist/{vue-ui-sparkline-DF8bLc-F.js → vue-ui-sparkline-F7h636hU.js} +29 -29
- package/dist/{vue-ui-sparkstackbar-DMkn-0FV.js → vue-ui-sparkstackbar-B-Du5D3w.js} +3 -3
- package/dist/{vue-ui-stackbar-CUXktGA-.js → vue-ui-stackbar-BNOfLkY2.js} +38 -38
- package/dist/{vue-ui-strip-plot-ibdxtil6.js → vue-ui-strip-plot-DNPM01M_.js} +7 -7
- package/dist/{vue-ui-table-BocHahKB.js → vue-ui-table-__ABUm9x.js} +17 -17
- package/dist/{vue-ui-table-heatmap-B03YDYck.js → vue-ui-table-heatmap-D-iueyM0.js} +13 -13
- package/dist/{vue-ui-table-sparkline-8mOvfeTL.js → vue-ui-table-sparkline-B5QdvlV7.js} +4 -4
- package/dist/{vue-ui-thermometer-Dq_nJLiU.js → vue-ui-thermometer-DID_4Y6w.js} +7 -7
- package/dist/{vue-ui-timer-BLveMseW.js → vue-ui-timer-CjJmpXoF.js} +27 -27
- package/dist/{vue-ui-tiremarks-DMG1_YzV.js → vue-ui-tiremarks-wDKOTVny.js} +6 -6
- package/dist/{vue-ui-treemap-io-J9w5R.js → vue-ui-treemap-DFo4w0cb.js} +8 -8
- package/dist/{vue-ui-vertical-bar-DqnTF6h2.js → vue-ui-vertical-bar-BEdckhBh.js} +30 -30
- package/dist/{vue-ui-waffle-X9DHHqlw.js → vue-ui-waffle-D5i1Q6tF.js} +75 -75
- package/dist/{vue-ui-wheel-BLBwVpV8.js → vue-ui-wheel-DJlN8joO.js} +6 -6
- package/dist/{vue-ui-word-cloud-0GXQqY8G.js → vue-ui-word-cloud-B7Y2UrwO.js} +28 -28
- package/dist/{vue-ui-world-5OHPVwxv.js → vue-ui-world-DzF8YW_Q.js} +6 -6
- package/dist/{vue-ui-xy-HW0T1CD8.js → vue-ui-xy-DGln2YgO.js} +9 -9
- package/dist/{vue-ui-xy-canvas-C4FbbXNQ.js → vue-ui-xy-canvas-DF2Ts-g3.js} +10 -10
- package/package.json +1 -1
- package/dist/ColorPicker-BO4ntExI.js +0 -135
- package/dist/vue-ui-accordion-BWnxgda4.js +0 -76
- package/dist/vue-ui-annotator-BkHDHfHG.js +0 -2182
|
@@ -0,0 +1,2959 @@
|
|
|
1
|
+
import { computed as L, ref as R, watch as E, onMounted as H, onBeforeUnmount as U, createBlock as x, openBlock as c, Teleport as K, createElementBlock as p, createCommentVNode as a, normalizeStyle as b, normalizeClass as g, createElementVNode as n, renderSlot as B, resolveComponent as v, createVNode as T, withCtx as N, createTextVNode as F, toDisplayString as f, withDirectives as M, vModelCheckbox as G, vModelText as D, withModifiers as A, Fragment as X, renderList as Y } from "vue";
|
|
2
|
+
import { a6 as V, t as q, c as J, at as Z } from "./lib-BEpWEyMm.js";
|
|
3
|
+
import { u as Q } from "./useNestedProp-CLD3Gk9S.js";
|
|
4
|
+
import { d as $ } from "./dom-to-png-BgvOdfyW.js";
|
|
5
|
+
import { u as ee } from "./usePrinter-w23K-ezx.js";
|
|
6
|
+
import te from "./BaseIcon-Bz-1GQhu.js";
|
|
7
|
+
import oe from "./vue-ui-accordion-Cv7OaVUI.js";
|
|
8
|
+
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
import { C as se } from "./ColorPicker-B-WUqMoV.js";
|
|
10
|
+
function ie(e) {
|
|
11
|
+
const o = (y) => e.isMacLike ? y.metaKey : y.ctrlKey, l = (y) => {
|
|
12
|
+
const S = y;
|
|
13
|
+
if (!S) return !1;
|
|
14
|
+
const O = (S.tagName || "").toLowerCase();
|
|
15
|
+
return S.isContentEditable || O === "input" || O === "textarea" || O === "select";
|
|
16
|
+
}, r = (y) => !!(!e.isSummaryOpen || l(y.target) || e.isWriting), s = () => {
|
|
17
|
+
e.isDeleteMode = !1, e.isMoveMode = !1, e.isResizeMode = !1, e.isSelectMode = !1, e.isDrawMode = !1, e.isTextMode = !1, e.activeShape = void 0, e.showCaret = !1;
|
|
18
|
+
}, t = (y) => {
|
|
19
|
+
switch (s(), y) {
|
|
20
|
+
case "m":
|
|
21
|
+
e.isMoveMode = !0;
|
|
22
|
+
break;
|
|
23
|
+
// Move
|
|
24
|
+
case "r":
|
|
25
|
+
e.isResizeMode = !0;
|
|
26
|
+
break;
|
|
27
|
+
// Resize
|
|
28
|
+
case "d":
|
|
29
|
+
e.isDeleteMode = !0;
|
|
30
|
+
break;
|
|
31
|
+
// Delete
|
|
32
|
+
case "g":
|
|
33
|
+
e.isSelectMode = !0, e.setShapeTo("group"), e.activeShape = "group";
|
|
34
|
+
break;
|
|
35
|
+
// Select/Group
|
|
36
|
+
case "t":
|
|
37
|
+
e.isTextMode = !0, e.isWriting = !1, e.showCaret = !1;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}, h = (y) => {
|
|
41
|
+
switch (y) {
|
|
42
|
+
case "c":
|
|
43
|
+
e.setShapeTo("circle");
|
|
44
|
+
break;
|
|
45
|
+
case "s":
|
|
46
|
+
e.setShapeTo("rect");
|
|
47
|
+
break;
|
|
48
|
+
case "a":
|
|
49
|
+
e.setShapeTo("arrow");
|
|
50
|
+
break;
|
|
51
|
+
case "l":
|
|
52
|
+
e.setShapeTo("line");
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}, u = (y, S) => {
|
|
56
|
+
const O = e.lastSelectedShape;
|
|
57
|
+
if (!O) return;
|
|
58
|
+
const C = (z, W) => {
|
|
59
|
+
typeof O[z] == "number" && (O[z] += W);
|
|
60
|
+
};
|
|
61
|
+
switch (O.type) {
|
|
62
|
+
case "rect":
|
|
63
|
+
case "circle":
|
|
64
|
+
case "text":
|
|
65
|
+
C("x", y), C("y", S);
|
|
66
|
+
break;
|
|
67
|
+
case "arrow":
|
|
68
|
+
C("x", y), C("y", S), C("endX", y), C("endY", S);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}, I = () => {
|
|
72
|
+
const y = e.lastSelectedShape;
|
|
73
|
+
y && (e.shapes = e.shapes.filter((S) => S.id !== y.id), e.lastSelectedShape = void 0);
|
|
74
|
+
};
|
|
75
|
+
let w = !1, d = null;
|
|
76
|
+
const i = () => {
|
|
77
|
+
w || (w = !0, e.history?.begin?.("nudge"));
|
|
78
|
+
}, k = () => {
|
|
79
|
+
w && (clearTimeout(d), d = setTimeout(() => {
|
|
80
|
+
w = !1, e.history?.end?.();
|
|
81
|
+
}, 160));
|
|
82
|
+
}, m = () => {
|
|
83
|
+
clearTimeout(d), w && e.history?.end?.(), w = !1;
|
|
84
|
+
}, P = (y) => {
|
|
85
|
+
if (o(y) && !y.shiftKey && y.key.toLowerCase() === "z") {
|
|
86
|
+
if (r(y)) return;
|
|
87
|
+
y.preventDefault(), e.undoLastShape?.();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (o(y) && y.shiftKey && y.key.toLowerCase() === "z" || o(y) && y.key.toLowerCase() === "y") {
|
|
91
|
+
if (r(y)) return;
|
|
92
|
+
y.preventDefault(), typeof e.redoLastShape == "function" ? e.redoLastShape() : e.history?.redo?.();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (r(y)) return;
|
|
96
|
+
const S = y.key.toLowerCase();
|
|
97
|
+
if (S === "escape") {
|
|
98
|
+
y.preventDefault(), s();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (S === "delete" || S === "backspace") {
|
|
102
|
+
y.preventDefault(), I();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (["m", "r", "d", "g", "t"].includes(S)) {
|
|
106
|
+
y.preventDefault(), t(S);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (["c", "a", "l", "s"].includes(S)) {
|
|
110
|
+
y.preventDefault(), h(S);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (y.key === "ArrowUp" || y.key === "ArrowDown" || y.key === "ArrowLeft" || y.key === "ArrowRight") {
|
|
114
|
+
y.preventDefault(), i();
|
|
115
|
+
const C = y.shiftKey ? 10 : 1;
|
|
116
|
+
y.key === "ArrowUp" && u(0, -C), y.key === "ArrowDown" && u(0, C), y.key === "ArrowLeft" && u(-C, 0), y.key === "ArrowRight" && u(C, 0), k();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}, _ = (y) => {
|
|
120
|
+
y.key.startsWith("Arrow") && k();
|
|
121
|
+
};
|
|
122
|
+
return window.addEventListener("keydown", P, { passive: !1 }), window.addEventListener("keyup", _, { passive: !0 }), function() {
|
|
123
|
+
window.removeEventListener("keydown", P, { passive: !1 }), window.removeEventListener("keyup", _, { passive: !0 }), m();
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const le = { class: "teleport-tooltip__inner" }, re = {
|
|
127
|
+
__name: "TeleportedTooltip",
|
|
128
|
+
props: {
|
|
129
|
+
show: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: !1
|
|
132
|
+
},
|
|
133
|
+
x: {
|
|
134
|
+
type: Number,
|
|
135
|
+
required: !0
|
|
136
|
+
},
|
|
137
|
+
y: {
|
|
138
|
+
type: Number,
|
|
139
|
+
required: !0
|
|
140
|
+
},
|
|
141
|
+
placement: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: "top"
|
|
144
|
+
},
|
|
145
|
+
styleObject: {
|
|
146
|
+
type: Object,
|
|
147
|
+
default() {
|
|
148
|
+
return {};
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
delay: {
|
|
152
|
+
type: Number,
|
|
153
|
+
default: 0
|
|
154
|
+
},
|
|
155
|
+
delayIn: {
|
|
156
|
+
type: Number,
|
|
157
|
+
default: 300
|
|
158
|
+
},
|
|
159
|
+
delayOut: {
|
|
160
|
+
type: Number,
|
|
161
|
+
default: 0
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
setup(e) {
|
|
165
|
+
const o = e, l = L(() => o.delayIn ?? o.delay), r = L(() => o.delayOut ?? o.delay), s = R(!1);
|
|
166
|
+
let t = null, h = null;
|
|
167
|
+
function u() {
|
|
168
|
+
t && (clearTimeout(t), t = null), h && (clearTimeout(h), h = null);
|
|
169
|
+
}
|
|
170
|
+
function I() {
|
|
171
|
+
u();
|
|
172
|
+
const i = Math.max(0, l.value || 0);
|
|
173
|
+
i === 0 ? s.value = !0 : t = setTimeout(() => {
|
|
174
|
+
s.value = !0, t = null;
|
|
175
|
+
}, i);
|
|
176
|
+
}
|
|
177
|
+
function w() {
|
|
178
|
+
u();
|
|
179
|
+
const i = Math.max(0, r.value || 0);
|
|
180
|
+
i === 0 ? s.value = !1 : h = setTimeout(() => {
|
|
181
|
+
s.value = !1, h = null;
|
|
182
|
+
}, i);
|
|
183
|
+
}
|
|
184
|
+
E(() => o.show, (i) => {
|
|
185
|
+
i ? I() : w();
|
|
186
|
+
}, { immediate: !0 }), H(() => {
|
|
187
|
+
o.show && I();
|
|
188
|
+
}), U(() => {
|
|
189
|
+
u();
|
|
190
|
+
});
|
|
191
|
+
const d = L(() => ({
|
|
192
|
+
position: "fixed",
|
|
193
|
+
zIndex: 2147483647,
|
|
194
|
+
top: `${o.y}px`,
|
|
195
|
+
left: `${o.x}px`,
|
|
196
|
+
transform: o.placement === "bottom" ? "translate(-50%, 8px)" : "translate(-50%, -100%)",
|
|
197
|
+
pointerEvents: "none",
|
|
198
|
+
...o.styleObject
|
|
199
|
+
}));
|
|
200
|
+
return (i, k) => (c(), x(K, { to: "body" }, [
|
|
201
|
+
s.value ? (c(), p("div", {
|
|
202
|
+
key: 0,
|
|
203
|
+
class: g(["teleport-tooltip", e.placement]),
|
|
204
|
+
style: b(d.value),
|
|
205
|
+
role: "tooltip",
|
|
206
|
+
"aria-hidden": "false"
|
|
207
|
+
}, [
|
|
208
|
+
n("div", le, [
|
|
209
|
+
B(i.$slots, "default", {}, void 0, !0)
|
|
210
|
+
])
|
|
211
|
+
], 6)) : a("", !0)
|
|
212
|
+
]));
|
|
213
|
+
}
|
|
214
|
+
}, ne = /* @__PURE__ */ j(re, [["__scopeId", "data-v-430dd7ad"]]), de = {
|
|
215
|
+
props: {
|
|
216
|
+
config: {
|
|
217
|
+
type: Object,
|
|
218
|
+
default() {
|
|
219
|
+
return {};
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
dataset: {
|
|
223
|
+
type: Object,
|
|
224
|
+
default() {
|
|
225
|
+
return {
|
|
226
|
+
shapes: [],
|
|
227
|
+
lastSelectedShape: void 0
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
components: {
|
|
233
|
+
Accordion: oe,
|
|
234
|
+
BaseIcon: te,
|
|
235
|
+
ColorPicker: se,
|
|
236
|
+
TeleportedTooltip: ne
|
|
237
|
+
},
|
|
238
|
+
data() {
|
|
239
|
+
return {
|
|
240
|
+
activeShape: void 0,
|
|
241
|
+
strokeSize: 1,
|
|
242
|
+
currentPointer: {
|
|
243
|
+
start: {
|
|
244
|
+
x: 0,
|
|
245
|
+
y: 0
|
|
246
|
+
},
|
|
247
|
+
end: {
|
|
248
|
+
x: 0,
|
|
249
|
+
end: 0
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
currentTarget: void 0,
|
|
253
|
+
hoveredShapeId: void 0,
|
|
254
|
+
isBold: !1,
|
|
255
|
+
isBulletTextMode: !1,
|
|
256
|
+
isDash: !1,
|
|
257
|
+
isDeleteMode: !1,
|
|
258
|
+
isDrawing: !1,
|
|
259
|
+
isDrawingNewShape: !0,
|
|
260
|
+
isDrawMode: !1,
|
|
261
|
+
isItalic: !1,
|
|
262
|
+
isMouseDown: !1,
|
|
263
|
+
isMoveMode: !1,
|
|
264
|
+
isPrinting: !1,
|
|
265
|
+
isResizeMode: !1,
|
|
266
|
+
isSelectMode: !1,
|
|
267
|
+
isSummaryOpen: !1,
|
|
268
|
+
isTextMode: !1,
|
|
269
|
+
isUnderline: !1,
|
|
270
|
+
isWriting: !1,
|
|
271
|
+
lastSelectedShape: this.dataset.lastSelectedShape,
|
|
272
|
+
pointerPosition: {
|
|
273
|
+
x: 0,
|
|
274
|
+
y: 0
|
|
275
|
+
},
|
|
276
|
+
preventEdit: !0,
|
|
277
|
+
selectedGroup: [],
|
|
278
|
+
shapes: this.dataset.shapes ? this.dataset.shapes : [],
|
|
279
|
+
shapesOrder: [],
|
|
280
|
+
step: Math.round(Math.random()) * 1e5,
|
|
281
|
+
svgHeight: 1e3,
|
|
282
|
+
svgWidth: 1e3,
|
|
283
|
+
options: {
|
|
284
|
+
arrow: {
|
|
285
|
+
color: "grey",
|
|
286
|
+
filled: !0
|
|
287
|
+
},
|
|
288
|
+
circle: {
|
|
289
|
+
color: "grey",
|
|
290
|
+
filled: !1,
|
|
291
|
+
radius: 3,
|
|
292
|
+
strokeWidth: 2
|
|
293
|
+
},
|
|
294
|
+
rect: {
|
|
295
|
+
color: "grey",
|
|
296
|
+
filled: !1,
|
|
297
|
+
strokeWidth: 2,
|
|
298
|
+
height: 12,
|
|
299
|
+
width: 12
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
selectedColor: "#000000",
|
|
303
|
+
showCaret: !1,
|
|
304
|
+
sizeRatio: 1,
|
|
305
|
+
slottedSvg: void 0,
|
|
306
|
+
sourceWidth: 1,
|
|
307
|
+
sourceHeight: 1,
|
|
308
|
+
textAlign: "start",
|
|
309
|
+
textFont: 20,
|
|
310
|
+
transparency: 100,
|
|
311
|
+
transparencyCodes: Z,
|
|
312
|
+
dragOffset: null,
|
|
313
|
+
showTooltip: !1,
|
|
314
|
+
tooltipKey: null,
|
|
315
|
+
tooltipPos: { x: 0, y: 0 },
|
|
316
|
+
tooltipAnchor: null,
|
|
317
|
+
history: [],
|
|
318
|
+
isMacLike: !1,
|
|
319
|
+
_onKeydown: null,
|
|
320
|
+
_historySize: { undo: 0, redo: 0 },
|
|
321
|
+
_rafId: null,
|
|
322
|
+
_lastPointerId: null,
|
|
323
|
+
_captureEl: null
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
watch: {
|
|
327
|
+
shapes: {
|
|
328
|
+
handler(e) {
|
|
329
|
+
e.length === 0 && (this.lastSelectedShape = void 0);
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
isTextMode: {
|
|
333
|
+
handler(e) {
|
|
334
|
+
this.showCaret = e;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
computed: {
|
|
339
|
+
FINAL_CONFIG() {
|
|
340
|
+
const e = Q().vue_ui_annotator;
|
|
341
|
+
if (!Object.keys(this.config || {}).length)
|
|
342
|
+
return e;
|
|
343
|
+
const o = this.treeShake({
|
|
344
|
+
defaultConfig: e,
|
|
345
|
+
userConfig: this.config
|
|
346
|
+
});
|
|
347
|
+
return this.convertConfigColors(o);
|
|
348
|
+
},
|
|
349
|
+
tooltipStyleObject() {
|
|
350
|
+
const e = this.FINAL_CONFIG.style.tooltips;
|
|
351
|
+
return {
|
|
352
|
+
backgroundColor: e.backgroundColor,
|
|
353
|
+
color: e.color,
|
|
354
|
+
border: e.border,
|
|
355
|
+
borderRadius: `${e.borderRadius}px`,
|
|
356
|
+
boxShadow: e.boxShadow
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
canSelect() {
|
|
360
|
+
return this.shapes.filter((e) => !["line", "group"].includes(e.type)).length > 1;
|
|
361
|
+
},
|
|
362
|
+
colorTransparency() {
|
|
363
|
+
return this.transparencyCodes[this.transparency > 98 ? 98 : this.transparency];
|
|
364
|
+
},
|
|
365
|
+
cursorClass() {
|
|
366
|
+
switch (!0) {
|
|
367
|
+
case this.isDeleteMode:
|
|
368
|
+
return "default";
|
|
369
|
+
case this.isMoveMode:
|
|
370
|
+
return "move";
|
|
371
|
+
case this.isTextMode:
|
|
372
|
+
return "text";
|
|
373
|
+
case this.isResizeMode:
|
|
374
|
+
return "se-resize";
|
|
375
|
+
default:
|
|
376
|
+
return "";
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
records() {
|
|
380
|
+
return this.shapes;
|
|
381
|
+
},
|
|
382
|
+
userShapes() {
|
|
383
|
+
return this.records.map((e) => {
|
|
384
|
+
switch (!0) {
|
|
385
|
+
case (e && e.type === "arrow"):
|
|
386
|
+
const o = e.strokeWidth > 3 ? 5 : 10, l = e.strokeWidth > 3 ? 2.5 : 5;
|
|
387
|
+
return {
|
|
388
|
+
html: `
|
|
389
|
+
<defs>
|
|
390
|
+
<marker
|
|
391
|
+
id="${e.id}"
|
|
392
|
+
markerWidth="${o}"
|
|
393
|
+
markerHeight="${o}"
|
|
394
|
+
refX="0"
|
|
395
|
+
refY="${l}"
|
|
396
|
+
orient="auto"
|
|
397
|
+
>
|
|
398
|
+
<polygon
|
|
399
|
+
points="0 0,${o} ${l}, 0 ${o}"
|
|
400
|
+
fill="${e.color}"
|
|
401
|
+
/>
|
|
402
|
+
</marker>
|
|
403
|
+
</defs>
|
|
404
|
+
${this.includeSelectionIndicator(e)}
|
|
405
|
+
<g id="${e.id}">
|
|
406
|
+
<path
|
|
407
|
+
style="stroke-linecap: round !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
|
|
408
|
+
stroke="${e.color}"
|
|
409
|
+
id="${e.id}"
|
|
410
|
+
d="M${e.x},${e.y} ${e.endX},${e.endY}"
|
|
411
|
+
stroke-width="${e.strokeWidth}"
|
|
412
|
+
marker-end="url(#${e.id})"
|
|
413
|
+
/>
|
|
414
|
+
</g>
|
|
415
|
+
<g id="${e.id}">
|
|
416
|
+
<rect
|
|
417
|
+
id="${e.id}"
|
|
418
|
+
x="${e.x - 10}"
|
|
419
|
+
y="${e.y - 10}"
|
|
420
|
+
height="20"
|
|
421
|
+
width="20"
|
|
422
|
+
fill="rgba(0,0,0,0.3)"
|
|
423
|
+
style="display:${this.isResizeMode || this.isMoveMode ? "initial" : "none"}; rx:1 !important; ry:1 !important;"
|
|
424
|
+
/>
|
|
425
|
+
</g>
|
|
426
|
+
${this.includeDeleteButton(e)}
|
|
427
|
+
</g>
|
|
428
|
+
`,
|
|
429
|
+
id: e.id
|
|
430
|
+
};
|
|
431
|
+
case (e && e.type === "circle"):
|
|
432
|
+
return {
|
|
433
|
+
html: `
|
|
434
|
+
<g id="${e.id}">
|
|
435
|
+
${this.includeSelectionIndicator(e)}
|
|
436
|
+
<circle
|
|
437
|
+
id="${e.id}"
|
|
438
|
+
cx="${e.x}"
|
|
439
|
+
cy="${e.y}"
|
|
440
|
+
r="${e.circleRadius ? e.circleRadius : Number.MIN_VALUE}"
|
|
441
|
+
fill="${e.isFilled ? e.color + e.alpha : "rgba(255,255,255,0.001)"}"
|
|
442
|
+
stroke="${e.color + e.alpha}"
|
|
443
|
+
stroke-width="${e.strokeWidth}"
|
|
444
|
+
style="${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
|
|
445
|
+
>
|
|
446
|
+
</circle>
|
|
447
|
+
</g>
|
|
448
|
+
|
|
449
|
+
${this.includeDeleteButton(e)}`,
|
|
450
|
+
id: e.id
|
|
451
|
+
};
|
|
452
|
+
case (e && e.type === "group"):
|
|
453
|
+
return {
|
|
454
|
+
html: `<g id="${e.id}">
|
|
455
|
+
<rect
|
|
456
|
+
id="${this.isResizeMode ? "" : e.id}"
|
|
457
|
+
x="${e.x}"
|
|
458
|
+
y="${e.y}"
|
|
459
|
+
fill="transparent"
|
|
460
|
+
height="${e.rectHeight}"
|
|
461
|
+
width="${e.rectWidth}"
|
|
462
|
+
stroke="grey"
|
|
463
|
+
stroke-width="1"
|
|
464
|
+
style="rx:1 !important; ry:1 !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}; display:${this.isSelectMode || this.isDeleteMode || this.hoveredShapeId && this.hoveredShapeId === e.id ? "initial" : "none"};"
|
|
465
|
+
/>
|
|
466
|
+
<g id="${e.id}">
|
|
467
|
+
${e.content ? e.content : ""}
|
|
468
|
+
</g>
|
|
469
|
+
${this.includeDeleteButton(e)}
|
|
470
|
+
</g> `,
|
|
471
|
+
id: e.id
|
|
472
|
+
};
|
|
473
|
+
case (e && e.type === "rect"):
|
|
474
|
+
return {
|
|
475
|
+
html: `<g id="${e.id}">
|
|
476
|
+
${this.includeSelectionIndicator(e)}
|
|
477
|
+
<rect
|
|
478
|
+
id="${this.isResizeMode ? "" : e.id}"
|
|
479
|
+
x="${e.x}"
|
|
480
|
+
y="${e.y}"
|
|
481
|
+
fill="${e.isFilled ? e.color + e.alpha : "rgba(255,255,255,0.001)"}"
|
|
482
|
+
height="${e.rectHeight}"
|
|
483
|
+
width="${e.rectWidth}"
|
|
484
|
+
stroke="${e.color + e.alpha}"
|
|
485
|
+
stroke-width="${e.strokeWidth}"
|
|
486
|
+
style="rx:1 !important; ry:1 !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
|
|
487
|
+
/>
|
|
488
|
+
<rect id="${e.id}"
|
|
489
|
+
x="${e.x + e.rectWidth}"
|
|
490
|
+
y="${e.y + e.rectHeight}"
|
|
491
|
+
height="20"
|
|
492
|
+
width="20"
|
|
493
|
+
fill="rgba(0,0,0,0.3)"
|
|
494
|
+
style="display:${this.isResizeMode ? "initial" : "none"}; rx:1 !important; ry:1 !important;"
|
|
495
|
+
/>
|
|
496
|
+
${this.includeDeleteButton(e)}
|
|
497
|
+
</g> `,
|
|
498
|
+
id: e.id
|
|
499
|
+
};
|
|
500
|
+
case (e && e.type === "line"):
|
|
501
|
+
return {
|
|
502
|
+
html: `
|
|
503
|
+
<g id="${e.id}">
|
|
504
|
+
<path
|
|
505
|
+
id="${e.id}"
|
|
506
|
+
d="M${e.path ? e.path : ""}"
|
|
507
|
+
style="stroke:${e.color + e.alpha} !important; fill:none; stroke-width:${e.strokeWidth} !important; stroke-linecap: round !important; stroke-linejoin: round !important;"
|
|
508
|
+
/>
|
|
509
|
+
${this.includeDeleteButton(e)}
|
|
510
|
+
</g>
|
|
511
|
+
`,
|
|
512
|
+
id: e.id
|
|
513
|
+
};
|
|
514
|
+
case (e && e.type === "text"):
|
|
515
|
+
const r = e.textContent.split(""), s = [];
|
|
516
|
+
for (let t = 0; t < r.length; t += 1)
|
|
517
|
+
s.push(`
|
|
518
|
+
${e.isBulletTextMode ? `<tspan x="${e.x - e.fontSize}" y="${e.y + e.fontSize * t}" id="${e.id}" font-size="${e.fontSize / 2}">⬤</tspan>` : ""}
|
|
519
|
+
<tspan id="${e.id}" x="${e.x}" y="${e.y + e.fontSize * t}">
|
|
520
|
+
${r[t]}
|
|
521
|
+
</tspan>`);
|
|
522
|
+
return {
|
|
523
|
+
html: `
|
|
524
|
+
${this.includeSelectionIndicator(e)}
|
|
525
|
+
${this.computeTextElement(
|
|
526
|
+
e,
|
|
527
|
+
s,
|
|
528
|
+
e.isBulletTextMode
|
|
529
|
+
)}
|
|
530
|
+
`,
|
|
531
|
+
id: e.id
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
setup() {
|
|
538
|
+
const e = "annotations", o = R(J()), { isImaging: l, generateImage: r } = ee({
|
|
539
|
+
elementId: o.value,
|
|
540
|
+
fileName: e
|
|
541
|
+
});
|
|
542
|
+
return {
|
|
543
|
+
uid: o,
|
|
544
|
+
isImaging: l,
|
|
545
|
+
generateImage: r
|
|
546
|
+
};
|
|
547
|
+
},
|
|
548
|
+
mounted() {
|
|
549
|
+
const e = this.$refs.drawSvgContainer;
|
|
550
|
+
let o = !1;
|
|
551
|
+
this.walkTheDOM(e, (s) => {
|
|
552
|
+
if (!o && ["DIV", "svg", "section", "canvas"].includes(s.tagName)) {
|
|
553
|
+
this.slottedSvg = s, o = !0;
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
}), this.isMacLike = (() => {
|
|
557
|
+
if (typeof navigator > "u") return !1;
|
|
558
|
+
const s = navigator.userAgentData?.platform ?? "";
|
|
559
|
+
if (s) return /mac|ios/i.test(s);
|
|
560
|
+
const t = navigator.userAgent ?? "";
|
|
561
|
+
return /(Mac|iPhone|iPad|iPod)/i.test(t);
|
|
562
|
+
})();
|
|
563
|
+
const l = this.slottedSvg.getBoundingClientRect();
|
|
564
|
+
if (this.sizeRatio = l.height / l.width, this.svgWidth = 1e3, this.svgHeight = this.sizeRatio * 1e3, this.sourceWidth = l.width, this.sourceHeight = l.height, new ResizeObserver((s) => {
|
|
565
|
+
s.forEach((t) => {
|
|
566
|
+
this.sourceWidth = t.contentRect.width, this.sourceHeight = t.contentRect.height, this.sizeRatio = t.contentRect.height / t.contentRect.width, this.svgHeight = this.sizeRatio * 1e3;
|
|
567
|
+
});
|
|
568
|
+
}).observe(this.slottedSvg), this._onKeydown = (s) => this.write(s), window.addEventListener("keydown", this._onKeydown), this.history = this.makeHistory(), this.history.size) {
|
|
569
|
+
const s = this.history.size();
|
|
570
|
+
this._historySize.undo = s.undo, this._historySize.redo = s.redo;
|
|
571
|
+
}
|
|
572
|
+
this._unregisterShortcuts = ie(this);
|
|
573
|
+
},
|
|
574
|
+
beforeUnmount() {
|
|
575
|
+
this.hideTooltip(), this._rafId && cancelAnimationFrame(this._rafId), this._onKeydown && window.removeEventListener("keydown", this._onKeydown);
|
|
576
|
+
},
|
|
577
|
+
unmounted() {
|
|
578
|
+
this._unregisterShortcuts && this._unregisterShortcuts();
|
|
579
|
+
},
|
|
580
|
+
destroyed() {
|
|
581
|
+
window.removeEventListener("keydown", (e) => {
|
|
582
|
+
this.write(e);
|
|
583
|
+
});
|
|
584
|
+
},
|
|
585
|
+
methods: {
|
|
586
|
+
treeShake: q,
|
|
587
|
+
convertConfigColors: V,
|
|
588
|
+
_tickDraw() {
|
|
589
|
+
if (!this.isDrawing) {
|
|
590
|
+
this._rafId = null;
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
this.drawUp(), this._rafId = requestAnimationFrame(() => this._tickDraw());
|
|
594
|
+
},
|
|
595
|
+
bringToFrontById(e) {
|
|
596
|
+
const o = this.shapes.findIndex((l) => l.id === e);
|
|
597
|
+
if (o > -1 && o !== this.shapes.length - 1) {
|
|
598
|
+
const [l] = this.shapes.splice(o, 1);
|
|
599
|
+
this.shapes.push(l);
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
_shapeIdUnderPointer(e) {
|
|
603
|
+
const o = (t) => !!t && this.shapes.some((h) => h.id === t);
|
|
604
|
+
if (o(e?.target?.id)) return e.target.id;
|
|
605
|
+
const l = this.$refs.mainSvg?.querySelector(".annotator__glass");
|
|
606
|
+
if (!l) return null;
|
|
607
|
+
const r = l.style.pointerEvents;
|
|
608
|
+
l.style.pointerEvents = "none";
|
|
609
|
+
const s = document.elementFromPoint(e.clientX, e.clientY);
|
|
610
|
+
return l.style.pointerEvents = r || "all", o(s?.id) ? s.id : null;
|
|
611
|
+
},
|
|
612
|
+
makeHistory(e = {}) {
|
|
613
|
+
const {
|
|
614
|
+
maxEntries: o = 200,
|
|
615
|
+
maxBytes: l = 2e6
|
|
616
|
+
} = e, r = { open: !1, before: null, undo: [], redo: [] }, s = { undo: 0, redo: 0 }, t = (d) => typeof d == "string" ? d.length * 2 : 0, h = () => JSON.stringify({
|
|
617
|
+
shapes: this.copy(this.shapes),
|
|
618
|
+
lastSelectedShape: this.copy(this.lastSelectedShape)
|
|
619
|
+
}), u = (d) => {
|
|
620
|
+
const i = JSON.parse(d);
|
|
621
|
+
this.shapes = i.shapes, this.lastSelectedShape = i.lastSelectedShape;
|
|
622
|
+
}, I = () => {
|
|
623
|
+
this._historySize.undo = r.undo.length, this._historySize.redo = r.redo.length;
|
|
624
|
+
}, w = (d, i) => {
|
|
625
|
+
const k = r[d];
|
|
626
|
+
for (k.push(i), s[d] += t(i); k.length > o || s[d] > l; ) {
|
|
627
|
+
const m = k.shift();
|
|
628
|
+
s[d] -= t(m);
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
return {
|
|
632
|
+
begin() {
|
|
633
|
+
r.open || (r.open = !0, r.before = h());
|
|
634
|
+
},
|
|
635
|
+
end() {
|
|
636
|
+
if (!r.open) return;
|
|
637
|
+
r.open = !1, h() !== r.before && (w("undo", r.before), r.redo.length = 0, s.redo = 0), r.before = null, I();
|
|
638
|
+
},
|
|
639
|
+
undo() {
|
|
640
|
+
const d = r.undo.pop();
|
|
641
|
+
if (!d) return;
|
|
642
|
+
s.undo -= t(d);
|
|
643
|
+
const i = h();
|
|
644
|
+
w("redo", i), u(d), I();
|
|
645
|
+
},
|
|
646
|
+
redo() {
|
|
647
|
+
const d = r.redo.pop();
|
|
648
|
+
if (!d) return;
|
|
649
|
+
s.redo -= t(d);
|
|
650
|
+
const i = h();
|
|
651
|
+
w("undo", i), u(d), I();
|
|
652
|
+
},
|
|
653
|
+
size() {
|
|
654
|
+
return {
|
|
655
|
+
undo: r.undo.length,
|
|
656
|
+
redo: r.redo.length,
|
|
657
|
+
approxBytes: { undo: s.undo, redo: s.redo }
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
},
|
|
662
|
+
showToolTipFor(e, o, l = "top") {
|
|
663
|
+
this.tooltipKey = e, this.tooltipAnchor = o.currentTarget || o.target, this.updateTooltipPosition(), this.showTooltip = !0, window.addEventListener("scroll", this.updateTooltipPosition, !0), window.addEventListener("resize", this.updateTooltipPosition, { passive: !0 }), this.tooltipPlacement = l;
|
|
664
|
+
},
|
|
665
|
+
hideTooltip() {
|
|
666
|
+
this.showTooltip = !1, this.tooltipKey = null, this.tooltipAnchor = null, window.removeEventListener("scroll", this.updateTooltipPosition, !0), window.removeEventListener("resize", this.updateTooltipPosition);
|
|
667
|
+
},
|
|
668
|
+
updateTooltipPosition() {
|
|
669
|
+
if (!this.tooltipAnchor) return;
|
|
670
|
+
const e = this.tooltipAnchor.getBoundingClientRect();
|
|
671
|
+
this.tooltipPos = { x: e.left + e.width / 2, y: e.top };
|
|
672
|
+
},
|
|
673
|
+
initDragOffset(e) {
|
|
674
|
+
const o = e?.target && e.target.id || this.currentTarget && this.currentTarget.id, l = this.shapes.find((t) => t.id === o);
|
|
675
|
+
if (!l) {
|
|
676
|
+
this.dragOffset = null;
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
this.lastSelectedShape = l;
|
|
680
|
+
const r = this.pointerPosition.x, s = this.pointerPosition.y;
|
|
681
|
+
switch (l.type) {
|
|
682
|
+
case "rect":
|
|
683
|
+
case "circle":
|
|
684
|
+
case "text":
|
|
685
|
+
this.dragOffset = { dx: r - l.x, dy: s - l.y };
|
|
686
|
+
break;
|
|
687
|
+
case "arrow":
|
|
688
|
+
this.dragOffset = {
|
|
689
|
+
dx: r - l.x,
|
|
690
|
+
dy: s - l.y,
|
|
691
|
+
endDx: r - l.endX,
|
|
692
|
+
endDy: s - l.endY
|
|
693
|
+
};
|
|
694
|
+
break;
|
|
695
|
+
case "group":
|
|
696
|
+
this.dragOffset = { dx: r - (l.x || 0), dy: s - (l.y || 0) };
|
|
697
|
+
break;
|
|
698
|
+
default:
|
|
699
|
+
this.dragOffset = { dx: 0, dy: 0 };
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
bringShapeTo(e) {
|
|
704
|
+
const o = this.shapes.find(
|
|
705
|
+
(l) => l.id === this.lastSelectedShape.id
|
|
706
|
+
);
|
|
707
|
+
switch (!0) {
|
|
708
|
+
case e === "front":
|
|
709
|
+
this.shapes = this.shapes.filter((l) => l.id !== o.id), this.shapes.push(o);
|
|
710
|
+
break;
|
|
711
|
+
case e === "back":
|
|
712
|
+
this.shapes = this.shapes.filter((l) => l.id !== o.id), this.shapes = [o, ...this.shapes];
|
|
713
|
+
break;
|
|
714
|
+
default:
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
clickSvg(e) {
|
|
719
|
+
if (this.isDeleteMode)
|
|
720
|
+
return;
|
|
721
|
+
e.preventDefault(), e.stopPropagation(), this.deleteEmptyTextElement(), this.isTextMode ? (this.isWriting = !0, this.showCaret = !0) : (this.isWriting = !1, this.showCaret = !1, this.isTextMode = !1);
|
|
722
|
+
let o = `text_${Math.random() * 1e4}_${Math.random() * 99999}`;
|
|
723
|
+
if (this.isWriting) {
|
|
724
|
+
this.history?.begin(), this.shapes.push({
|
|
725
|
+
id: o,
|
|
726
|
+
type: "text",
|
|
727
|
+
lines: 0,
|
|
728
|
+
x: this.pointerPosition.x,
|
|
729
|
+
y: this.pointerPosition.y,
|
|
730
|
+
textContent: "",
|
|
731
|
+
fontSize: this.copy(this.textFont),
|
|
732
|
+
textAlign: this.copy(this.textAlign),
|
|
733
|
+
isBold: this.copy(this.isBold),
|
|
734
|
+
isItalic: this.copy(this.isItalic),
|
|
735
|
+
isUnderline: this.copy(this.isUnderline),
|
|
736
|
+
color: this.copy(this.selectedColor),
|
|
737
|
+
isBulletTextMode: this.copy(this.isBulletTextMode)
|
|
738
|
+
}), this.currentTarget = this.shapes.at(-1), this.lastSelectedShape = this.shapes.at(-1), this.history?.end();
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
const l = () => {
|
|
742
|
+
this.isDash = this.shapes.find((s) => s.id === e.target.id).isDash;
|
|
743
|
+
}, r = () => {
|
|
744
|
+
this.strokeSize = this.shapes.find(
|
|
745
|
+
(s) => s.id === e.target.id
|
|
746
|
+
).strokeWidth;
|
|
747
|
+
};
|
|
748
|
+
if (this.isSelectMode = !1, e.target.id.includes("arrow")) {
|
|
749
|
+
this.activeShape = "arrow", l(), r();
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
if (e.target.id.includes("circle")) {
|
|
753
|
+
this.activeShape = "circle", this.options.circle.filled = this.shapes.find(
|
|
754
|
+
(s) => s.id === e.target.id
|
|
755
|
+
).isFilled, l(), r();
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
if (e.target.id.includes("rect")) {
|
|
759
|
+
this.activeShape = "rect", this.options.rect.filled = this.shapes.find(
|
|
760
|
+
(s) => s.id === e.target.id
|
|
761
|
+
).isFilled, l(), r();
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
if (e.target.id.includes("line")) {
|
|
765
|
+
this.activeShape = "line", r();
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
if (e.target.id.includes("text")) {
|
|
769
|
+
this.isTextMode = !0, this.isWriting = !0, this.showCaret = !0;
|
|
770
|
+
const s = this.shapes.find((t) => t.id === e.target.id);
|
|
771
|
+
s && s.textAlign && (this.textAlign = this.shapes.find(
|
|
772
|
+
(t) => t.id === e.target.id
|
|
773
|
+
).textAlign), s && (this.isBulletTextMode = this.shapes.find(
|
|
774
|
+
(t) => t.id === e.target.id
|
|
775
|
+
).isBulletTextMode);
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
copyPaste() {
|
|
780
|
+
const e = {
|
|
781
|
+
...this.lastSelectedShape,
|
|
782
|
+
id: `${this.lastSelectedShape.id}_copy`,
|
|
783
|
+
x: this.lastSelectedShape.x - 100 < 0 ? 1 : this.lastSelectedShape.x - 100,
|
|
784
|
+
y: this.lastSelectedShape.y - 100 < 0 ? 1 : this.lastSelectedShape.y - 100
|
|
785
|
+
};
|
|
786
|
+
this.shapes.push(e);
|
|
787
|
+
},
|
|
788
|
+
includeDeleteButton(e, o = !1) {
|
|
789
|
+
switch (!0) {
|
|
790
|
+
case e.type === "circle":
|
|
791
|
+
return `
|
|
792
|
+
<g id="${e.id}" style="display:${this.isDeleteMode ? "initial" : "none"};">
|
|
793
|
+
<circle id="${e.id}" cx="${e.x}" cy="${e.y}" r="12" fill="red"/>
|
|
794
|
+
<line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x - 4}" y1="${e.y - 4}" x2="${e.x + 4}" y2="${e.y + 4}"/>
|
|
795
|
+
<line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + 4}" y1="${e.y - 4}" x2="${e.x - 4}" y2="${e.y + 4}"/>
|
|
796
|
+
</g>
|
|
797
|
+
`;
|
|
798
|
+
case e.type === "text":
|
|
799
|
+
let l, r = [-8, -12, -4, -12, -4];
|
|
800
|
+
switch (!0) {
|
|
801
|
+
case e.textAlign === "start":
|
|
802
|
+
o ? l = [-20, -24, -16, -16, -24] : l = [-16, -20, -12, -12, -20];
|
|
803
|
+
break;
|
|
804
|
+
case e.textAlign === "middle":
|
|
805
|
+
l = [0, -4, 4, 4, -4], r = [-32, -36, -28, -36, -28];
|
|
806
|
+
break;
|
|
807
|
+
case e.textAlign === "end":
|
|
808
|
+
l = [16, 20, 12, 12, 20];
|
|
809
|
+
break;
|
|
810
|
+
default:
|
|
811
|
+
l = [0, 0, 0];
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
814
|
+
return `
|
|
815
|
+
<g id="${e.id}" style="display:${this.isDeleteMode ? "initial" : "none"};">
|
|
816
|
+
<circle id="${e.id}" cx="${e.x + l[0]}" cy="${e.y + r[0]}" r="12" fill="red"/>
|
|
817
|
+
<line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + l[1]}" y1="${e.y + r[1]}" x2="${e.x + l[2]}" y2="${e.y + r[2]}"/>
|
|
818
|
+
<line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + l[3]}" y1="${e.y + r[3]}" x2="${e.x + l[4]}" y2="${e.y + r[4]}"/>
|
|
819
|
+
</g>
|
|
820
|
+
`;
|
|
821
|
+
default:
|
|
822
|
+
return `
|
|
823
|
+
<g id="${e.id}" style="display:${this.isDeleteMode ? "initial" : "none"};">
|
|
824
|
+
<circle id="${e.id}" cx="${e.x - 4}" cy="${e.y - 4}" r="12" fill="red"/>
|
|
825
|
+
<line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x - 8}" y1="${e.y - 8}" x2="${e.x}" y2="${e.y}"/>
|
|
826
|
+
<line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x}" y1="${e.y - 8}" x2="${e.x - 8}" y2="${e.y}"/>
|
|
827
|
+
</g>
|
|
828
|
+
`;
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
includeSelectionIndicator(e) {
|
|
832
|
+
if (e)
|
|
833
|
+
switch (!0) {
|
|
834
|
+
case e.type === "rect":
|
|
835
|
+
return `
|
|
836
|
+
<rect
|
|
837
|
+
id="${e.id}"
|
|
838
|
+
style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === e.id ? "initial" : "none"}"
|
|
839
|
+
x="${e.x - 20}"
|
|
840
|
+
y="${e.y - 20}"
|
|
841
|
+
height="${e.rectHeight + 40}"
|
|
842
|
+
width="${e.rectWidth + 40}"
|
|
843
|
+
fill="transparent"
|
|
844
|
+
stroke="grey"
|
|
845
|
+
/>
|
|
846
|
+
`;
|
|
847
|
+
case e.type === "circle":
|
|
848
|
+
return `
|
|
849
|
+
<rect
|
|
850
|
+
id="${e.id}"
|
|
851
|
+
style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === e.id ? "initial" : "none"}"
|
|
852
|
+
x="${e.x - e.circleRadius - 20}"
|
|
853
|
+
y="${e.y - e.circleRadius - 20}"
|
|
854
|
+
height="${e.circleRadius * 2 + 40}"
|
|
855
|
+
width="${e.circleRadius * 2 + 40}"
|
|
856
|
+
fill="transparent"
|
|
857
|
+
stroke="grey"
|
|
858
|
+
/>
|
|
859
|
+
`;
|
|
860
|
+
case e.type === "arrow":
|
|
861
|
+
const o = e.endX - e.x > 0, l = e.endY - e.y > 0;
|
|
862
|
+
return `
|
|
863
|
+
<rect
|
|
864
|
+
id="${e.id}"
|
|
865
|
+
style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === e.id ? "initial" : "none"}"
|
|
866
|
+
x="${o ? e.x - 20 : e.endX - 20}"
|
|
867
|
+
y="${l ? e.y - 20 : e.endY - 20}"
|
|
868
|
+
height="${l ? e.endY - e.y + 40 : e.y - e.endY + 40}"
|
|
869
|
+
width="${o ? e.endX - e.x + 40 : e.x - e.endX + 40}"
|
|
870
|
+
fill="transparent"
|
|
871
|
+
stroke="grey"
|
|
872
|
+
/>
|
|
873
|
+
`;
|
|
874
|
+
case e.type === "text":
|
|
875
|
+
const r = this.$refs.mainSvg ? Array.from(this.$refs.mainSvg.getElementsByTagName("text")).find(
|
|
876
|
+
(I) => I.id === e.id
|
|
877
|
+
) : null;
|
|
878
|
+
if (!r)
|
|
879
|
+
return;
|
|
880
|
+
const { x: s, y: t, width: h, height: u } = r.getBBox();
|
|
881
|
+
return `
|
|
882
|
+
<rect
|
|
883
|
+
id="${e.id}"
|
|
884
|
+
style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === e.id ? "initial" : "none"}"
|
|
885
|
+
x="${s - 20}"
|
|
886
|
+
y="${t - 20}"
|
|
887
|
+
height="${u + 40}"
|
|
888
|
+
width="${h + 40}"
|
|
889
|
+
fill="transparent"
|
|
890
|
+
stroke="grey"
|
|
891
|
+
/>
|
|
892
|
+
`;
|
|
893
|
+
default:
|
|
894
|
+
return "";
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
allowEditAndHoverShapes(e) {
|
|
898
|
+
e.preventDefault(), this.preventEdit = !1, e.target && e.target.id && (this.hoveredShapeId = e.target.id);
|
|
899
|
+
},
|
|
900
|
+
setSelectedTextAlignTo(e) {
|
|
901
|
+
!this.lastSelectedShape || this.lastSelectedShape.type !== "text" || (this.lastSelectedShape.textAlign = e);
|
|
902
|
+
},
|
|
903
|
+
undoLastShape() {
|
|
904
|
+
this.history?.undo?.();
|
|
905
|
+
},
|
|
906
|
+
redoLastShape() {
|
|
907
|
+
this.history?.redo?.();
|
|
908
|
+
},
|
|
909
|
+
write(e) {
|
|
910
|
+
if (this.preventEdit)
|
|
911
|
+
return;
|
|
912
|
+
e.preventDefault();
|
|
913
|
+
const o = e.keyCode;
|
|
914
|
+
if (!this.isWriting)
|
|
915
|
+
return;
|
|
916
|
+
this.showCaret = !0;
|
|
917
|
+
let l;
|
|
918
|
+
if (this.lastSelectedShape.type === "text" ? l = this.shapes.find((s) => s.id === this.lastSelectedShape.id) : l = this.shapes.at(-1), this.currentTarget = l, l.type !== "text")
|
|
919
|
+
return;
|
|
920
|
+
this.currentTarget.isBold = this.copy(this.isBold), this.currentTarget.isItalic = this.copy(this.isItalic), this.currentTarget.isUnderline = this.copy(this.isUnderline);
|
|
921
|
+
const r = [
|
|
922
|
+
16,
|
|
923
|
+
17,
|
|
924
|
+
18,
|
|
925
|
+
20,
|
|
926
|
+
27,
|
|
927
|
+
33,
|
|
928
|
+
34,
|
|
929
|
+
35,
|
|
930
|
+
36,
|
|
931
|
+
37,
|
|
932
|
+
38,
|
|
933
|
+
39,
|
|
934
|
+
40,
|
|
935
|
+
45,
|
|
936
|
+
91,
|
|
937
|
+
112,
|
|
938
|
+
113,
|
|
939
|
+
114,
|
|
940
|
+
115,
|
|
941
|
+
116,
|
|
942
|
+
117,
|
|
943
|
+
118,
|
|
944
|
+
119,
|
|
945
|
+
120,
|
|
946
|
+
121,
|
|
947
|
+
122,
|
|
948
|
+
123,
|
|
949
|
+
221,
|
|
950
|
+
255,
|
|
951
|
+
"Unidentified"
|
|
952
|
+
];
|
|
953
|
+
switch (!0) {
|
|
954
|
+
case o === 8:
|
|
955
|
+
l.textContent = l.textContent.slice(0, -1);
|
|
956
|
+
break;
|
|
957
|
+
case o === 9:
|
|
958
|
+
l.textContent += " ";
|
|
959
|
+
break;
|
|
960
|
+
case o === 13:
|
|
961
|
+
l.lines += 1, l.textContent += "";
|
|
962
|
+
return;
|
|
963
|
+
case r.includes(o):
|
|
964
|
+
return;
|
|
965
|
+
default:
|
|
966
|
+
l.textContent += e.key;
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
groupShapes() {
|
|
970
|
+
if (this.selectedGroup = [], this.activeShape !== "group") {
|
|
971
|
+
this.isSelectMode = !1, this.shapes = this.shapes.filter((o) => o.type !== "group");
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
const e = this.shapes.at(-1);
|
|
975
|
+
if (this.shapes.forEach((o) => {
|
|
976
|
+
if (o.type !== "group")
|
|
977
|
+
switch (!0) {
|
|
978
|
+
case o.type === "arrow":
|
|
979
|
+
const l = o.x <= o.endX && o.y <= o.endY && e.x <= o.x && e.y <= o.y && e.x + e.rectWidth >= o.endX && e.y + e.rectHeight >= o.endY, r = o.endY < o.y && o.x < o.endX && e.x <= o.x && e.y <= o.y && e.x + e.rectWidth >= o.endX && e.y + e.rectHeight >= o.y, s = o.x > o.endX && o.y < o.endY && e.x <= o.endX && e.y <= o.endY && e.x + e.rectWidth >= o.x && e.y + e.rectHeight >= o.endY, t = o.x > o.endX && o.y > o.endY && e.x <= o.endX && e.y <= o.endY && e.x + e.rectWidth >= o.x && e.y + e.rectHeight >= o.y;
|
|
980
|
+
(l || r || s || t) && this.selectedGroup.push(o);
|
|
981
|
+
break;
|
|
982
|
+
case o.type === "circle":
|
|
983
|
+
e.x <= o.x + o.circleRadius && e.y <= o.y + o.circleRadius && o.x + o.circleRadius <= e.x + e.rectWidth && o.y + o.circleRadius <= e.y + e.rectHeight && this.selectedGroup.push(o);
|
|
984
|
+
break;
|
|
985
|
+
case o.type === "rect":
|
|
986
|
+
e.x <= o.x && e.y <= o.y && o.x <= e.x + e.rectWidth && o.y <= e.y + e.rectHeight && o.x + o.rectWidth <= e.x + e.rectWidth && o.y + o.rectHeight <= e.y + e.rectHeight && o.rectWidth <= e.rectWidth && o.rectHeight <= e.rectHeight && this.selectedGroup.push(o);
|
|
987
|
+
break;
|
|
988
|
+
case o.type === "text":
|
|
989
|
+
e.x <= o.x && e.y <= o.y && this.selectedGroup.push(o);
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
}), this.selectedGroup = this.selectedGroup.map((o) => ({
|
|
993
|
+
...o,
|
|
994
|
+
id: e.id,
|
|
995
|
+
oldId: o.id,
|
|
996
|
+
diffX: o.x - e.x,
|
|
997
|
+
diffY: o.y - e.y,
|
|
998
|
+
diffEndX: o.endX ? o.endX - e.x : 0,
|
|
999
|
+
diffEndY: o.endY ? o.endY - e.y : 0
|
|
1000
|
+
})), e.source = this.selectedGroup, this.selectedGroup.length > 1) {
|
|
1001
|
+
const o = this.copy(this.selectedGroup).map((l) => l.oldId);
|
|
1002
|
+
this.shapes = this.shapes.filter((l) => !o.includes(l.id)), this.selectedGroup.forEach((l) => {
|
|
1003
|
+
switch (!0) {
|
|
1004
|
+
case l.type === "circle":
|
|
1005
|
+
e.content += `
|
|
1006
|
+
<circle
|
|
1007
|
+
id="${l.id}"
|
|
1008
|
+
cx="${l.x}"
|
|
1009
|
+
cy="${l.y}"
|
|
1010
|
+
r="${l.circleRadius ? l.circleRadius : Number.MIN_VALUE}"
|
|
1011
|
+
fill="${l.isFilled ? l.color + l.alpha : "rgba(255,255,255,0.001)"}"
|
|
1012
|
+
stroke="${l.color + l.alpha}"
|
|
1013
|
+
stroke-width="${l.strokeWidth}"
|
|
1014
|
+
style="${l.isDash ? `stroke-dasharray: ${l.strokeWidth * 3}` : ""}"
|
|
1015
|
+
/>
|
|
1016
|
+
`;
|
|
1017
|
+
break;
|
|
1018
|
+
case l.type === "rect":
|
|
1019
|
+
e.content += `
|
|
1020
|
+
<rect
|
|
1021
|
+
id="${this.isResizeMode ? "" : l.id}"
|
|
1022
|
+
x="${l.x}"
|
|
1023
|
+
y="${l.y}"
|
|
1024
|
+
fill="${l.isFilled ? l.color + l.alpha : "rgba(255,255,255,0.001)"}"
|
|
1025
|
+
height="${l.rectHeight}"
|
|
1026
|
+
width="${l.rectWidth}"
|
|
1027
|
+
stroke="${l.color + l.alpha}"
|
|
1028
|
+
stroke-width="${l.strokeWidth}"
|
|
1029
|
+
style="rx:1 !important; ry:1 !important; ${l.isDash ? `stroke-dasharray: ${l.strokeWidth * 3}` : ""}"
|
|
1030
|
+
/>
|
|
1031
|
+
`;
|
|
1032
|
+
break;
|
|
1033
|
+
case l.type === "arrow":
|
|
1034
|
+
const r = l.strokeWidth > 3 ? 5 : 10, s = l.strokeWidth > 3 ? 2.5 : 5, t = Date.now();
|
|
1035
|
+
e.content += `
|
|
1036
|
+
<g id="${l.id}">
|
|
1037
|
+
<defs>
|
|
1038
|
+
<marker
|
|
1039
|
+
id="${t}"
|
|
1040
|
+
markerWidth="${r}"
|
|
1041
|
+
markerHeight="${r}"
|
|
1042
|
+
refX="0"
|
|
1043
|
+
refY="${s}"
|
|
1044
|
+
orient="auto"
|
|
1045
|
+
>
|
|
1046
|
+
<polygon
|
|
1047
|
+
points="0 0,${r} ${s}, 0 ${r}"
|
|
1048
|
+
fill="${l.color}"
|
|
1049
|
+
/>
|
|
1050
|
+
</marker>
|
|
1051
|
+
</defs>
|
|
1052
|
+
|
|
1053
|
+
<path
|
|
1054
|
+
style="stroke-linecap: round !important; ${l.isDash ? `stroke-dasharray: ${l.strokeWidth * 3}` : ""}"
|
|
1055
|
+
stroke="${l.color}"
|
|
1056
|
+
id="${l.id}"
|
|
1057
|
+
d="M${l.x},${l.y} ${l.endX},${l.endY}"
|
|
1058
|
+
stroke-width="${l.strokeWidth}"
|
|
1059
|
+
marker-end="url(#${t})"
|
|
1060
|
+
/>
|
|
1061
|
+
</g>
|
|
1062
|
+
`;
|
|
1063
|
+
break;
|
|
1064
|
+
case l.type === "text":
|
|
1065
|
+
const h = l.textContent.split(""), u = [];
|
|
1066
|
+
for (let I = 0; I < h.length; I += 1)
|
|
1067
|
+
u.push(`
|
|
1068
|
+
${l.isBulletTextMode ? `<tspan x="${l.x - l.fontSize}" y="${l.y + l.fontSize * I}" id="${l.id}" font-size="${l.fontSize / 2}">⬤</tspan>` : ""}
|
|
1069
|
+
<tspan id="${l.id}" x="${l.x}" y="${l.y + l.fontSize * I}">
|
|
1070
|
+
${h[I]}
|
|
1071
|
+
</tspan>`);
|
|
1072
|
+
e.content += `
|
|
1073
|
+
${this.computeTextElement(l, u, l.isBulletTextMode)}
|
|
1074
|
+
`;
|
|
1075
|
+
break;
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
} else
|
|
1079
|
+
this.shapes = this.shapes.filter((o) => o.id !== e.id);
|
|
1080
|
+
},
|
|
1081
|
+
moveGroup(e) {
|
|
1082
|
+
e.content = "";
|
|
1083
|
+
const o = e.x || 0, l = e.y || 0;
|
|
1084
|
+
(e.source || []).forEach((r) => {
|
|
1085
|
+
switch (r.type) {
|
|
1086
|
+
case "circle": {
|
|
1087
|
+
const s = o + r.diffX, t = l + r.diffY;
|
|
1088
|
+
e.content += `
|
|
1089
|
+
<circle
|
|
1090
|
+
id="${r.id}"
|
|
1091
|
+
cx="${s}"
|
|
1092
|
+
cy="${t}"
|
|
1093
|
+
r="${r.circleRadius ? r.circleRadius : Number.MIN_VALUE}"
|
|
1094
|
+
fill="${r.isFilled ? r.color + r.alpha : "rgba(255,255,255,0.001)"}"
|
|
1095
|
+
stroke="${r.color + r.alpha}"
|
|
1096
|
+
stroke-width="${r.strokeWidth}"
|
|
1097
|
+
style="${r.isDash ? `stroke-dasharray: ${r.strokeWidth * 3}` : ""}"
|
|
1098
|
+
/>
|
|
1099
|
+
`;
|
|
1100
|
+
break;
|
|
1101
|
+
}
|
|
1102
|
+
case "rect": {
|
|
1103
|
+
const s = o + r.diffX, t = l + r.diffY;
|
|
1104
|
+
e.content += `
|
|
1105
|
+
<rect
|
|
1106
|
+
id="${this.isResizeMode ? "" : r.id}"
|
|
1107
|
+
x="${s}"
|
|
1108
|
+
y="${t}"
|
|
1109
|
+
fill="${r.isFilled ? r.color + r.alpha : "rgba(255,255,255,0.001)"}"
|
|
1110
|
+
height="${r.rectHeight}"
|
|
1111
|
+
width="${r.rectWidth}"
|
|
1112
|
+
stroke="${r.color + r.alpha}"
|
|
1113
|
+
stroke-width="${r.strokeWidth}"
|
|
1114
|
+
style="rx:1 !important; ry:1 !important; ${r.isDash ? `stroke-dasharray: ${r.strokeWidth * 3}` : ""}"
|
|
1115
|
+
/>
|
|
1116
|
+
`;
|
|
1117
|
+
break;
|
|
1118
|
+
}
|
|
1119
|
+
case "arrow": {
|
|
1120
|
+
const s = o + r.diffX, t = l + r.diffY, h = o + r.diffEndX, u = l + r.diffEndY, I = r.strokeWidth > 3 ? 5 : 10, w = r.strokeWidth > 3 ? 2.5 : 5, d = `m_${r.id}_${Math.random().toString(36).slice(2)}`;
|
|
1121
|
+
e.content += `
|
|
1122
|
+
<g id="${r.id}">
|
|
1123
|
+
<defs>
|
|
1124
|
+
<marker
|
|
1125
|
+
id="${d}"
|
|
1126
|
+
markerWidth="${I}"
|
|
1127
|
+
markerHeight="${I}"
|
|
1128
|
+
refX="0"
|
|
1129
|
+
refY="${w}"
|
|
1130
|
+
orient="auto">
|
|
1131
|
+
<polygon points="0 0,${I} ${w}, 0 ${I}" fill="${r.color}" />
|
|
1132
|
+
</marker>
|
|
1133
|
+
</defs>
|
|
1134
|
+
<path
|
|
1135
|
+
style="stroke-linecap: round !important; ${r.isDash ? `stroke-dasharray: ${r.strokeWidth * 3}` : ""}"
|
|
1136
|
+
stroke="${r.color}"
|
|
1137
|
+
id="${r.id}"
|
|
1138
|
+
d="M${s},${t} ${h},${u}"
|
|
1139
|
+
stroke-width="${r.strokeWidth}"
|
|
1140
|
+
marker-end="url(#${d})"
|
|
1141
|
+
/>
|
|
1142
|
+
</g>
|
|
1143
|
+
`;
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
case "text": {
|
|
1147
|
+
const t = (r.textContent || "").split("").map((h, u) => `
|
|
1148
|
+
${r.isBulletTextMode ? `<tspan x="${o + r.diffX - r.fontSize}" y="${l + r.diffY + r.fontSize * u}" id="${r.id}" font-size="${r.fontSize / 2}">⬤</tspan>` : ""}
|
|
1149
|
+
<tspan id="${r.id}" x="${o + r.diffX}" y="${l + r.diffY + r.fontSize * u}">
|
|
1150
|
+
${h}
|
|
1151
|
+
</tspan>
|
|
1152
|
+
`).join("");
|
|
1153
|
+
e.content += `
|
|
1154
|
+
<g id="${r.id}">
|
|
1155
|
+
<text
|
|
1156
|
+
style="user-select:none; height:100px;"
|
|
1157
|
+
id="${r.id}"
|
|
1158
|
+
x="${o + r.diffX}"
|
|
1159
|
+
y="${l + r.diffY}"
|
|
1160
|
+
text-anchor="${r.textAlign}"
|
|
1161
|
+
font-size="${r.fontSize}"
|
|
1162
|
+
fill="${r.color}"
|
|
1163
|
+
font-weight="${r.isBold ? "bold" : "normal"}"
|
|
1164
|
+
font-style="${r.isItalic ? "italic" : "normal"}"
|
|
1165
|
+
text-decoration="${r.isUnderline ? "underline" : "none"}">
|
|
1166
|
+
${t}
|
|
1167
|
+
</text>
|
|
1168
|
+
</g>
|
|
1169
|
+
`;
|
|
1170
|
+
break;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
},
|
|
1175
|
+
onPointerOut(e) {
|
|
1176
|
+
const o = this.$refs.mainSvg;
|
|
1177
|
+
e.relatedTarget && o && o.contains(e.relatedTarget) || (this.preventEdit = !0, this.hoveredShapeId = void 0);
|
|
1178
|
+
},
|
|
1179
|
+
chooseAction(e) {
|
|
1180
|
+
if (this.isDeleteMode) {
|
|
1181
|
+
this.isMouseDown = !1;
|
|
1182
|
+
return;
|
|
1183
|
+
}
|
|
1184
|
+
if (e.preventDefault(), e.stopPropagation(), this.isMouseDown = !0, e.pointerId != null) {
|
|
1185
|
+
try {
|
|
1186
|
+
this.$refs.mainSvg?.setPointerCapture?.(e.pointerId);
|
|
1187
|
+
} catch {
|
|
1188
|
+
}
|
|
1189
|
+
this.lastPointerId = e.pointerId;
|
|
1190
|
+
} else
|
|
1191
|
+
this.lastPointerId = null;
|
|
1192
|
+
if ((this.isDrawMode || this.isMoveMode || this.isResizeMode || this.isSelectMode) && this.history?.begin?.(), this.isDrawMode) {
|
|
1193
|
+
this.drawDown();
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
if (this.isMoveMode) {
|
|
1197
|
+
const o = this._shapeIdUnderPointer(e) || this.hoveredShapeId || this.lastSelectedShape?.id;
|
|
1198
|
+
o && (this.bringToFrontById(o), this.currentTarget = { id: o }), this.initDragOffset(e);
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
chooseMove(e) {
|
|
1202
|
+
this.isDeleteMode || (e.preventDefault(), e.stopPropagation(), e.target.localName !== "svg" && (this.currentTarget = e.target), this.isMoveMode && this.isMouseDown ? this.moveDown() : this.isResizeMode && this.isMouseDown && this.resize());
|
|
1203
|
+
},
|
|
1204
|
+
computeCaretPosition(e) {
|
|
1205
|
+
switch (!0) {
|
|
1206
|
+
case e.textAlign === "middle":
|
|
1207
|
+
return `<path class="vue-ui-annotator-caret" stroke="black" stroke-width="2" d="M${e.x},${e.y - e.fontSize} ${e.x},${e.y - e.fontSize - 15}" /> <path class="vue-ui-annotator-caret" stroke="black" stroke-width="2" d="M${e.x - 3},${e.y - e.fontSize - 5} ${e.x},${e.y - e.fontSize} ${e.x + 3},${e.y - e.fontSize - 5}"/>`;
|
|
1208
|
+
case e.textAlign === "start":
|
|
1209
|
+
const o = e.isBulletTextMode ? e.fontSize : 0;
|
|
1210
|
+
return `<path class="vue-ui-annotator-caret" d="M${e.x - 20 - o},${e.y - e.fontSize / 6} ${e.x - 5 - o},${e.y - e.fontSize / 6}" stroke="black" stroke-width="2" />
|
|
1211
|
+
<path class="vue-ui-annotator-caret" d="M${e.x - 10 - o},${e.y - e.fontSize / 3} ${e.x - 5 - o},${e.y - e.fontSize / 6} ${e.x - 10 - o},${e.y}" stroke="black" stroke-width="2">`;
|
|
1212
|
+
case e.textAlign === "end":
|
|
1213
|
+
return `<path class="vue-ui-annotator-caret" d="M${e.x + 20},${e.y - e.fontSize / 6} ${e.x + 5},${e.y - e.fontSize / 6}" stroke="black" stroke-width="2" />
|
|
1214
|
+
<path class="vue-ui-annotator-caret" d="M${e.x + 10},${e.y - e.fontSize / 3} ${e.x + 5},${e.y - e.fontSize / 6} ${e.x + 10},${e.y}" stroke="black" stroke-width="2">`;
|
|
1215
|
+
default:
|
|
1216
|
+
return "";
|
|
1217
|
+
}
|
|
1218
|
+
},
|
|
1219
|
+
computeTextElement(e, o, l = !1) {
|
|
1220
|
+
switch (!0) {
|
|
1221
|
+
case e.textAlign === "start":
|
|
1222
|
+
return `
|
|
1223
|
+
<g id="${e.id}">
|
|
1224
|
+
<rect
|
|
1225
|
+
id="${e.id}"
|
|
1226
|
+
style="display:${this.lastSelectedShape && this.lastSelectedShape.id === e.id ? "initial" : "none"};"
|
|
1227
|
+
x="${e.x}"
|
|
1228
|
+
y="${e.y - 50}"
|
|
1229
|
+
height="${e.lines === 0 || e.lines === 1 ? e.fontSize * 4 : e.fontSize * 2 * e.lines}"
|
|
1230
|
+
width="100"
|
|
1231
|
+
fill="rgba(0,0,0,0)"
|
|
1232
|
+
/>
|
|
1233
|
+
<text
|
|
1234
|
+
style="user-select:none; height:100px;"
|
|
1235
|
+
id="${e.id}"
|
|
1236
|
+
x="${e.x}"
|
|
1237
|
+
y="${e.y}"
|
|
1238
|
+
text-anchor="${e.textAlign}"
|
|
1239
|
+
font-size="${e.fontSize}"
|
|
1240
|
+
fill="${e.color}"
|
|
1241
|
+
font-weight="${e.isBold ? "bold" : "normal"}"
|
|
1242
|
+
font-style="${e.isItalic ? "italic" : "normal"}"
|
|
1243
|
+
text-decoration="${e.isUnderline ? "underline" : "none"}"
|
|
1244
|
+
>
|
|
1245
|
+
${o.join("")}
|
|
1246
|
+
</text>
|
|
1247
|
+
${this.showCaret && this.lastSelectedShape && this.lastSelectedShape.id === e.id ? this.computeCaretPosition(e) : ""}
|
|
1248
|
+
${this.includeDeleteButton(e, l)}
|
|
1249
|
+
</g>
|
|
1250
|
+
`;
|
|
1251
|
+
case e.textAlign === "middle":
|
|
1252
|
+
return `
|
|
1253
|
+
<g id="${e.id}">
|
|
1254
|
+
<rect
|
|
1255
|
+
id="${e.id}"
|
|
1256
|
+
style="display:${this.lastSelectedShape && this.lastSelectedShape.id === e.id ? "initial" : "none"};"
|
|
1257
|
+
x="${e.x - 50}"
|
|
1258
|
+
y="${e.y - 50}"
|
|
1259
|
+
height="${e.lines === 0 || e.lines === 1 ? e.fontSize * 4 : e.fontSize * 2 * e.lines}"
|
|
1260
|
+
width="100"
|
|
1261
|
+
fill="rgba(0,0,0,0)"
|
|
1262
|
+
/>
|
|
1263
|
+
<text
|
|
1264
|
+
style="user-select:none; height:100px;"
|
|
1265
|
+
id="${e.id}"
|
|
1266
|
+
x="${e.x}"
|
|
1267
|
+
y="${e.y}"
|
|
1268
|
+
text-anchor="${e.textAlign}"
|
|
1269
|
+
font-size="${e.fontSize}"
|
|
1270
|
+
fill="${e.color}"
|
|
1271
|
+
font-weight="${e.isBold ? "bold" : "normal"}"
|
|
1272
|
+
font-style="${e.isItalic ? "italic" : "normal"}"
|
|
1273
|
+
text-decoration="${e.isUnderline ? "underline" : "none"}"
|
|
1274
|
+
>
|
|
1275
|
+
${o.join("")}
|
|
1276
|
+
</text>
|
|
1277
|
+
${this.showCaret && this.lastSelectedShape && this.lastSelectedShape.id === e.id ? this.computeCaretPosition(e) : ""}
|
|
1278
|
+
${this.includeDeleteButton(e)}
|
|
1279
|
+
</g>
|
|
1280
|
+
`;
|
|
1281
|
+
case e.textAlign === "end":
|
|
1282
|
+
return `
|
|
1283
|
+
<g id="${e.id}">
|
|
1284
|
+
<rect
|
|
1285
|
+
id="${e.id}"
|
|
1286
|
+
style="display:${this.lastSelectedShape && this.lastSelectedShape.id === e.id ? "initial" : "none"};"
|
|
1287
|
+
x="${e.x - 100}"
|
|
1288
|
+
y="${e.y - 50}"
|
|
1289
|
+
height="${e.lines === 0 || e.lines === 1 ? e.fontSize * 4 : e.fontSize * 2 * e.lines}"
|
|
1290
|
+
width="100"
|
|
1291
|
+
fill="rgba(0,0,0,0)"
|
|
1292
|
+
/>
|
|
1293
|
+
<text
|
|
1294
|
+
style="user-select:none; height:100px;"
|
|
1295
|
+
id="${e.id}"
|
|
1296
|
+
x="${e.x}"
|
|
1297
|
+
y="${e.y}"
|
|
1298
|
+
text-anchor="${e.textAlign}"
|
|
1299
|
+
font-size="${e.fontSize}"
|
|
1300
|
+
fill="${e.color}"
|
|
1301
|
+
font-weight="${e.isBold ? "bold" : "normal"}"
|
|
1302
|
+
font-style="${e.isItalic ? "italic" : "normal"}"
|
|
1303
|
+
text-decoration="${e.isUnderline ? "underline" : "none"}"
|
|
1304
|
+
>
|
|
1305
|
+
${o.join("")}
|
|
1306
|
+
</text>
|
|
1307
|
+
${this.showCaret && this.lastSelectedShape && this.lastSelectedShape.id === e.id ? this.computeCaretPosition(e) : ""}
|
|
1308
|
+
${this.includeDeleteButton(e)}
|
|
1309
|
+
</g>
|
|
1310
|
+
`;
|
|
1311
|
+
default:
|
|
1312
|
+
return "";
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
copy(e) {
|
|
1316
|
+
if (e == null) return e;
|
|
1317
|
+
try {
|
|
1318
|
+
return typeof structuredClone == "function" ? structuredClone(e) : JSON.parse(JSON.stringify(e));
|
|
1319
|
+
} catch {
|
|
1320
|
+
return Array.isArray(e) ? e.map((o) => this.copy(o)) : typeof e == "object" ? Object.fromEntries(
|
|
1321
|
+
Object.entries(e).map(([o, l]) => [o, this.copy(l)])
|
|
1322
|
+
) : e;
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
clickShape(e) {
|
|
1326
|
+
const o = e.target.id;
|
|
1327
|
+
switch (!0) {
|
|
1328
|
+
case this.isDeleteMode:
|
|
1329
|
+
this.history?.begin(), this.shapes = [...this.shapes].filter((l) => l.id !== o), this.lastSelectedShape = void 0, this.history?.end();
|
|
1330
|
+
return;
|
|
1331
|
+
default:
|
|
1332
|
+
this.lastSelectedShape = this.shapes.find((l) => l.id === o);
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
deleteEmptyTextElement() {
|
|
1337
|
+
!this.lastSelectedShape || !this.lastSelectedShape.id.includes("text") || this.lastSelectedShape.textContent === "" && (this.shapes = this.shapes.filter(
|
|
1338
|
+
(e) => e.id !== this.lastSelectedShape.id
|
|
1339
|
+
), this.lastSelectedShape = this.shapes.at(-1));
|
|
1340
|
+
},
|
|
1341
|
+
drawUp(e = !1) {
|
|
1342
|
+
if (!this.activeShape || !this.isDrawing)
|
|
1343
|
+
return;
|
|
1344
|
+
this.currentPointer.end = {
|
|
1345
|
+
x: this.pointerPosition.x,
|
|
1346
|
+
y: this.pointerPosition.y
|
|
1347
|
+
};
|
|
1348
|
+
let o;
|
|
1349
|
+
this.shapes.length > 0 && this.currentTarget && (o = [...this.shapes].find(
|
|
1350
|
+
(u) => u.id === this.currentTarget.id
|
|
1351
|
+
));
|
|
1352
|
+
let l, r, s;
|
|
1353
|
+
o && (l = o.x - this.currentPointer.end.x, r = o.y - this.currentPointer.end.y, s = Math.sqrt(l * l + r * r));
|
|
1354
|
+
let t, h;
|
|
1355
|
+
switch (e ? (t = Math.max(this.currentPointer.end.x, o.x), h = Math.min(this.currentPointer.end.x, o.x), Math.max(this.currentPointer.end.y, o.y), Math.min(this.currentPointer.end.y, o.y)) : (t = Math.max(this.currentPointer.end.x, this.currentPointer.start.x), h = Math.min(this.currentPointer.end.x, this.currentPointer.start.x), Math.max(this.currentPointer.end.y, this.currentPointer.start.y), Math.min(this.currentPointer.end.y, this.currentPointer.start.y)), !0) {
|
|
1356
|
+
case this.activeShape === "arrow":
|
|
1357
|
+
this.shapes.at(-1).endX = this.currentPointer.end.x, this.shapes.at(-1).endY = this.currentPointer.end.y;
|
|
1358
|
+
break;
|
|
1359
|
+
case this.activeShape === "circle":
|
|
1360
|
+
const u = 20;
|
|
1361
|
+
this.shapes.at(-1).circleRadius = this.isDrawingNewShape ? this.copy(t - h) + u : s + u;
|
|
1362
|
+
break;
|
|
1363
|
+
case this.activeShape === "line":
|
|
1364
|
+
this.shapes.at(
|
|
1365
|
+
-1
|
|
1366
|
+
).path += ` ${this.pointerPosition.x} ${this.pointerPosition.y} `;
|
|
1367
|
+
break;
|
|
1368
|
+
case ["rect", "group"].includes(this.activeShape):
|
|
1369
|
+
const I = 20;
|
|
1370
|
+
this.shapes.at(-1).rectWidth = this.copy(this.currentPointer.end.x - this.shapes.at(-1).x) > 0 ? this.copy(this.currentPointer.end.x - this.shapes.at(-1).x) : I, this.shapes.at(-1).rectHeight = this.copy(this.currentPointer.end.y - this.shapes.at(-1).y) > 0 ? this.copy(this.currentPointer.end.y - this.shapes.at(-1).y) : I;
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
drawDown() {
|
|
1374
|
+
if (this.isDrawing = !0, !this.activeShape && !this.isSelectMode || !this.isDrawing)
|
|
1375
|
+
return;
|
|
1376
|
+
this.isDrawingNewShape = !0, this.currentPointer.start = {
|
|
1377
|
+
x: this.pointerPosition.x,
|
|
1378
|
+
y: this.pointerPosition.y
|
|
1379
|
+
};
|
|
1380
|
+
let e = `${this.isSelectMode ? "group" : this.activeShape}_${Math.random() * 1e4}_${Date.now()}`;
|
|
1381
|
+
switch (!0) {
|
|
1382
|
+
case this.activeShape === "arrow":
|
|
1383
|
+
this.shapes.push({
|
|
1384
|
+
id: e,
|
|
1385
|
+
x: this.pointerPosition.x,
|
|
1386
|
+
y: this.pointerPosition.y,
|
|
1387
|
+
endX: this.pointerPosition.x,
|
|
1388
|
+
endY: this.pointerPosition.y,
|
|
1389
|
+
type: this.activeShape,
|
|
1390
|
+
color: this.copy(this.selectedColor),
|
|
1391
|
+
strokeWidth: this.copy(Math.abs(this.strokeSize)),
|
|
1392
|
+
isDash: this.copy(this.isDash)
|
|
1393
|
+
}), this.lastSelectedShape = this.shapes.at(-1);
|
|
1394
|
+
break;
|
|
1395
|
+
case this.activeShape === "circle":
|
|
1396
|
+
this.shapes.push({
|
|
1397
|
+
alpha: this.options.circle.filled ? this.colorTransparency : "",
|
|
1398
|
+
id: e,
|
|
1399
|
+
color: this.copy(this.selectedColor),
|
|
1400
|
+
isFilled: this.copy(this.options.circle.filled),
|
|
1401
|
+
circleRadius: this.copy(this.options.circle.radius),
|
|
1402
|
+
circleStrokeWidth: this.copy(this.options.circle.strokeWidth),
|
|
1403
|
+
type: this.activeShape,
|
|
1404
|
+
x: this.pointerPosition.x,
|
|
1405
|
+
y: this.pointerPosition.y,
|
|
1406
|
+
strokeWidth: this.copy(Math.abs(this.strokeSize)),
|
|
1407
|
+
isDash: this.copy(this.isDash)
|
|
1408
|
+
}), this.lastSelectedShape = this.shapes.at(-1);
|
|
1409
|
+
break;
|
|
1410
|
+
case this.activeShape === "line":
|
|
1411
|
+
this.shapes.push({
|
|
1412
|
+
alpha: this.copy(this.colorTransparency),
|
|
1413
|
+
id: e,
|
|
1414
|
+
x: this.pointerPosition.x,
|
|
1415
|
+
y: this.pointerPosition.y,
|
|
1416
|
+
type: this.activeShape,
|
|
1417
|
+
color: this.copy(this.selectedColor),
|
|
1418
|
+
strokeWidth: this.copy(Math.abs(this.strokeSize)),
|
|
1419
|
+
isDash: this.copy(this.isDash),
|
|
1420
|
+
path: `${this.pointerPosition.x} ${this.pointerPosition.y}`
|
|
1421
|
+
}), this.lastSelectedShape = this.shapes.at(-1);
|
|
1422
|
+
break;
|
|
1423
|
+
case this.activeShape === "rect":
|
|
1424
|
+
this.shapes.push({
|
|
1425
|
+
alpha: this.options.rect.filled ? this.colorTransparency : "",
|
|
1426
|
+
id: e,
|
|
1427
|
+
color: this.copy(this.selectedColor),
|
|
1428
|
+
isFilled: this.copy(this.options.rect.filled),
|
|
1429
|
+
rectStrokeWidth: this.copy(this.options.rect.strokeWidth),
|
|
1430
|
+
rectHeight: this.copy(this.options.rect.height),
|
|
1431
|
+
rectWidth: this.copy(this.options.rect.width),
|
|
1432
|
+
type: this.activeShape,
|
|
1433
|
+
x: this.pointerPosition.x,
|
|
1434
|
+
y: this.pointerPosition.y,
|
|
1435
|
+
strokeWidth: this.copy(Math.abs(this.strokeSize)),
|
|
1436
|
+
isDash: this.copy(this.isDash)
|
|
1437
|
+
}), this.lastSelectedShape = this.shapes.at(-1);
|
|
1438
|
+
break;
|
|
1439
|
+
case this.activeShape === "group":
|
|
1440
|
+
this.shapes.push({
|
|
1441
|
+
alpha: 1,
|
|
1442
|
+
id: `group_${Math.random() * 1e4}_${Date.now()}`,
|
|
1443
|
+
x: this.pointerPosition.x,
|
|
1444
|
+
y: this.pointerPosition.y,
|
|
1445
|
+
isFilled: !1,
|
|
1446
|
+
rectHeight: this.copy(this.options.rect.height),
|
|
1447
|
+
rectWidth: this.copy(this.options.rect.width),
|
|
1448
|
+
rectStrokeWidth: 1,
|
|
1449
|
+
type: "group",
|
|
1450
|
+
color: "grey",
|
|
1451
|
+
strokeWidth: 1,
|
|
1452
|
+
isDash: !0,
|
|
1453
|
+
content: ""
|
|
1454
|
+
});
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
this._rafId || (this._rafId = requestAnimationFrame(() => this._tickDraw()));
|
|
1458
|
+
},
|
|
1459
|
+
move(e) {
|
|
1460
|
+
if (!e || !e.id || e.type === "line" || !this.dragOffset && (this.initDragOffset({ target: { id: e.id } }), !this.dragOffset))
|
|
1461
|
+
return;
|
|
1462
|
+
const { dx: o, dy: l, endDx: r, endDy: s } = this.dragOffset, t = this.pointerPosition.x, h = this.pointerPosition.y;
|
|
1463
|
+
switch (this.lastSelectedShape = e, e.type) {
|
|
1464
|
+
case "arrow":
|
|
1465
|
+
e.x = t - o, e.y = h - l, e.endX = t - (r ?? o), e.endY = h - (s ?? l);
|
|
1466
|
+
break;
|
|
1467
|
+
case "circle":
|
|
1468
|
+
e.x = t - o, e.y = h - l;
|
|
1469
|
+
break;
|
|
1470
|
+
case "rect":
|
|
1471
|
+
e.x = t - o, e.y = h - l;
|
|
1472
|
+
break;
|
|
1473
|
+
case "text":
|
|
1474
|
+
e.x = t - o, e.y = h - l;
|
|
1475
|
+
break;
|
|
1476
|
+
case "group":
|
|
1477
|
+
e.x = t - o, e.y = h - l, this.moveGroup(e);
|
|
1478
|
+
break;
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
moveDown() {
|
|
1482
|
+
const e = this.currentTarget?.id || this.hoveredShapeId;
|
|
1483
|
+
if (!e) return;
|
|
1484
|
+
const o = this.shapes.find((l) => l.id === e);
|
|
1485
|
+
o && this.move(o);
|
|
1486
|
+
},
|
|
1487
|
+
print() {
|
|
1488
|
+
this.isPrinting = !0, this.isDeleteMode = !1, this.isMoveMode = !1, this.isResizeMode = !1, this.isTextMode = !1, this.isWriting = !1, this.isSelectMode = !1, this.activeShape = void 0, this.showCaret = !1, this.$nextTick(async () => {
|
|
1489
|
+
const e = this.$refs.drawSvgContainer;
|
|
1490
|
+
this.walkTheDOM(e, (o) => {
|
|
1491
|
+
o && o.nodeType === 1 && (o.setAttribute("font-family", "Helvetica"), o.style.fontFamily = "Helvetica");
|
|
1492
|
+
});
|
|
1493
|
+
try {
|
|
1494
|
+
let o;
|
|
1495
|
+
try {
|
|
1496
|
+
o = (await import("jspdf")).default;
|
|
1497
|
+
} catch {
|
|
1498
|
+
throw new Error("jspdf is not installed. Run npm install jspdf");
|
|
1499
|
+
}
|
|
1500
|
+
const l = await $({
|
|
1501
|
+
container: e,
|
|
1502
|
+
scale: 2
|
|
1503
|
+
}), r = new Image();
|
|
1504
|
+
r.src = l, r.onload = () => {
|
|
1505
|
+
const s = {
|
|
1506
|
+
width: 595.28,
|
|
1507
|
+
height: 841.89
|
|
1508
|
+
}, t = r.width, h = r.height, u = t / s.width * s.height, I = s.width, w = I / t * h, d = new o("", "pt", "a4");
|
|
1509
|
+
let i = 0, k = h;
|
|
1510
|
+
if (k < u)
|
|
1511
|
+
d.addImage(l, "PNG", 0, 0, I, w, "", "FAST");
|
|
1512
|
+
else
|
|
1513
|
+
for (; k > 0; )
|
|
1514
|
+
d.addImage(l, "PNG", 0, i, I, w, "", "FAST"), k -= u, i -= s.height, k > 0 && d.addPage();
|
|
1515
|
+
d.save(`${(/* @__PURE__ */ new Date()).toLocaleDateString()}_annotations.pdf`);
|
|
1516
|
+
};
|
|
1517
|
+
} catch (o) {
|
|
1518
|
+
console.error("Error generating image:", o);
|
|
1519
|
+
} finally {
|
|
1520
|
+
this.isPrinting = !1, this.walkTheDOM(e, (o) => {
|
|
1521
|
+
o && o.nodeType === 1 && (o.setAttribute("font-family", this.FINAL_CONFIG.style.fontFamily), o.style.fontFamily = this.FINAL_CONFIG.style.fontFamily);
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
});
|
|
1525
|
+
},
|
|
1526
|
+
resetDraw(e) {
|
|
1527
|
+
if (!this.isDeleteMode && e && (e.preventDefault(), e.stopPropagation()), this.isDrawing = !1, this.isMouseDown = !1, this.dragOffset = null, this.lastPointerId != null) {
|
|
1528
|
+
try {
|
|
1529
|
+
this.$refs.mainSvg?.releasePointerCapture?.(this.lastPointerId);
|
|
1530
|
+
} catch {
|
|
1531
|
+
}
|
|
1532
|
+
this.lastPointerId = null;
|
|
1533
|
+
}
|
|
1534
|
+
this._rafId && (cancelAnimationFrame(this._rafId), this._rafId = null), this.isSelectMode && this.groupShapes(), this.history?.end();
|
|
1535
|
+
},
|
|
1536
|
+
resize() {
|
|
1537
|
+
this.isDrawingNewShape = !1;
|
|
1538
|
+
const e = this.currentTarget.id;
|
|
1539
|
+
if (!e)
|
|
1540
|
+
return;
|
|
1541
|
+
this.isDrawing = !0;
|
|
1542
|
+
const o = this.shapes.find((l) => l.id === e);
|
|
1543
|
+
this.activeShape = o.type, this.shapes = this.shapes.filter((l) => l.id !== e), this.shapes.push(o), this.drawUp(!0);
|
|
1544
|
+
},
|
|
1545
|
+
setFillOfSelectedRect() {
|
|
1546
|
+
!this.lastSelectedShape || !this.lastSelectedShape.id.includes("rect") || (this.lastSelectedShape.isFilled = !this.lastSelectedShape.isFilled);
|
|
1547
|
+
},
|
|
1548
|
+
setFillOfSelectedCircle() {
|
|
1549
|
+
!this.lastSelectedShape || !this.lastSelectedShape.id.includes("circle") || (this.lastSelectedShape.isFilled = !this.lastSelectedShape.isFilled);
|
|
1550
|
+
},
|
|
1551
|
+
setColorOfSelectedShape() {
|
|
1552
|
+
this.lastSelectedShape && (this.lastSelectedShape.color = this.copy(this.selectedColor), !["arrow", "text"].includes(this.lastSelectedShape.id) && (this.lastSelectedShape.alpha = this.copy(this.colorTransparency)));
|
|
1553
|
+
},
|
|
1554
|
+
setSelectedShapeToDash() {
|
|
1555
|
+
!this.lastSelectedShape || this.lastSelectedShape.type === "text" || (this.lastSelectedShape.isDash = this.copy(this.isDash));
|
|
1556
|
+
},
|
|
1557
|
+
setTransparencyOfSelectedShape() {
|
|
1558
|
+
!this.lastSelectedShape || ["arrow", "text"].includes(this.lastSelectedShape.id) || (this.lastSelectedShape.alpha = this.copy(this.colorTransparency));
|
|
1559
|
+
},
|
|
1560
|
+
setStrokeWidthOfSelectedShape() {
|
|
1561
|
+
!this.lastSelectedShape || !["arrow", "circle", "rect", "line"].includes(this.lastSelectedShape.type) || (this.lastSelectedShape.strokeWidth = this.copy(Math.abs(this.strokeSize)));
|
|
1562
|
+
},
|
|
1563
|
+
setCurrentStyleOfSelectedText() {
|
|
1564
|
+
!this.lastSelectedShape || this.lastSelectedShape.type !== "text" || (this.lastSelectedShape.isBold = this.copy(this.isBold), this.lastSelectedShape.isItalic = this.copy(this.isItalic), this.lastSelectedShape.isUnderline = this.copy(this.isUnderline), this.lastSelectedShape.fontSize = this.copy(this.textFont), this.lastSelectedShape.isBulletTextMode = this.copy(this.isBulletTextMode));
|
|
1565
|
+
},
|
|
1566
|
+
setPointer(e) {
|
|
1567
|
+
e.preventDefault();
|
|
1568
|
+
const l = this.$refs.mainSvg.getBoundingClientRect();
|
|
1569
|
+
let r, s;
|
|
1570
|
+
e.touches && e.touches.length > 0 ? (r = e.touches[0].clientX, s = e.touches[0].clientY) : (r = e.clientX, s = e.clientY), this.pointerPosition.x = (r - l.left) / l.width * this.svgWidth, this.pointerPosition.y = (s - l.top) / l.height * this.svgHeight;
|
|
1571
|
+
},
|
|
1572
|
+
setShapeTo(e) {
|
|
1573
|
+
if (this.showCaret = !1, this.deleteEmptyTextElement(), e === this.activeShape) {
|
|
1574
|
+
this.activeShape = void 0, this.isDrawMode = !1;
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
this.isDrawMode = !0, this.isDeleteMode = !1, this.isMoveMode = !1, this.isResizeMode = !1, this.isTextMode = !1, this.activeShape = e;
|
|
1578
|
+
},
|
|
1579
|
+
toggleSummary() {
|
|
1580
|
+
this.isSummaryOpen = !this.isSummaryOpen, this.isSummaryOpen || (this.isMoveMode = !1, this.isResizeMode = !1, this.isTextMode = !1, this.isWriting = !1, this.activeShape = void 0, this.showCaret = !1, this.isDeleteMode = !1, this.isWriting = !1), this.$emit("toggleOpenState", { isOpen: this.isSummaryOpen });
|
|
1581
|
+
},
|
|
1582
|
+
walkTheDOM(e, o) {
|
|
1583
|
+
for (o(e), e = e.firstChild; e; )
|
|
1584
|
+
this.walkTheDOM(e, o), e = e.nextSibling;
|
|
1585
|
+
},
|
|
1586
|
+
save() {
|
|
1587
|
+
this.$emit("saveAnnotations", {
|
|
1588
|
+
shapes: this.shapes,
|
|
1589
|
+
lastSelectedShape: this.lastSelectedShape
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
}, ue = { class: "vue-ui-annotator" }, he = { "data-dom-to-png-ignore": "" }, ce = ["disabled"], ye = ["disabled"], ae = ["disabled"], fe = ["disabled"], be = ["disabled"], Fe = ["disabled"], Ie = ["disabled"], Ne = ["disabled"], ge = ["disabled"], xe = {
|
|
1594
|
+
class: "tool-selection",
|
|
1595
|
+
style: { "margin-top": "6px" }
|
|
1596
|
+
}, pe = {
|
|
1597
|
+
viewBox: "0 0 12 12",
|
|
1598
|
+
style: { width: "100%" }
|
|
1599
|
+
}, we = ["fill"], Se = { key: 0 }, Te = { class: "tool-input" }, ke = ["checked"], Ce = {
|
|
1600
|
+
viewBox: "0 0 12 12",
|
|
1601
|
+
style: { width: "100%" }
|
|
1602
|
+
}, Oe = ["fill"], Me = { key: 1 }, ve = { class: "tool-input" }, Ae = ["checked"], me = {
|
|
1603
|
+
viewBox: "0 0 24 24",
|
|
1604
|
+
style: { width: "100%" }
|
|
1605
|
+
}, Le = ["stroke"], Ge = { key: 2 }, De = { style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" } }, Pe = { class: "tool-input" }, _e = { key: 3 }, ze = { style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" } }, Re = { class: "tool-input" }, Be = {
|
|
1606
|
+
viewBox: "0 0 24 24",
|
|
1607
|
+
height: "24",
|
|
1608
|
+
width: "24",
|
|
1609
|
+
style: { "margin-bottom": "-5px", "margin-top": "-10px" }
|
|
1610
|
+
}, je = ["checked"], We = { key: 4 }, Ee = { style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" } }, He = { class: "tool-input" }, Ue = { key: 5 }, Ke = { key: 6 }, Xe = ["disabled"], Ye = { key: 7 }, Ve = ["disabled"], qe = { key: 8 }, Je = { key: 9 }, Ze = { key: 10 }, Qe = { key: 11 }, $e = {
|
|
1611
|
+
style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" },
|
|
1612
|
+
class: "tooltip"
|
|
1613
|
+
}, et = { style: { display: "flex", "flex-direction": "column", "align-items": "start", "justify-content": "center" } }, tt = {
|
|
1614
|
+
class: "tool-input",
|
|
1615
|
+
style: { "font-variant-numeric": "tabular-nums" }
|
|
1616
|
+
}, ot = ["id"], st = ["viewBox", "width", "height"], it = ["width", "height", "pointer-events"], lt = ["innerHTML"], rt = ["height", "viewBox", "width"], nt = ["cx", "cy"];
|
|
1617
|
+
function dt(e, o, l, r, s, t) {
|
|
1618
|
+
const h = v("BaseIcon"), u = v("TeleportedTooltip"), I = v("ColorPicker"), w = v("Accordion");
|
|
1619
|
+
return c(), p("div", ue, [
|
|
1620
|
+
n("div", he, [
|
|
1621
|
+
T(w, {
|
|
1622
|
+
config: {
|
|
1623
|
+
maxHeight: 1e3,
|
|
1624
|
+
head: {
|
|
1625
|
+
backgroundColor: t.FINAL_CONFIG.style.backgroundColor,
|
|
1626
|
+
color: t.FINAL_CONFIG.style.color,
|
|
1627
|
+
iconColor: t.FINAL_CONFIG.style.color,
|
|
1628
|
+
iconSize: 20,
|
|
1629
|
+
icon: s.isSummaryOpen ? "close" : "annotator",
|
|
1630
|
+
padding: "6px"
|
|
1631
|
+
},
|
|
1632
|
+
body: {
|
|
1633
|
+
backgroundColor: t.FINAL_CONFIG.style.backgroundColor,
|
|
1634
|
+
color: t.FINAL_CONFIG.style.color
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
onToggle: t.toggleSummary
|
|
1638
|
+
}, {
|
|
1639
|
+
title: N(({ color: d }) => [
|
|
1640
|
+
n("div", {
|
|
1641
|
+
style: b({ color: d })
|
|
1642
|
+
}, f(t.FINAL_CONFIG.translations.title), 5)
|
|
1643
|
+
]),
|
|
1644
|
+
content: N(({ backgroundColor: d }) => [
|
|
1645
|
+
n("div", {
|
|
1646
|
+
class: "tool-selection",
|
|
1647
|
+
style: b({
|
|
1648
|
+
backgroundColor: d
|
|
1649
|
+
})
|
|
1650
|
+
}, [
|
|
1651
|
+
n("button", {
|
|
1652
|
+
disabled: s.shapes.length === 0,
|
|
1653
|
+
style: b({
|
|
1654
|
+
background: s.isMoveMode ? t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1655
|
+
border: s.isMoveMode ? t.FINAL_CONFIG.style.buttons.controls.selected.border : t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1656
|
+
color: s.isMoveMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1657
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1658
|
+
}),
|
|
1659
|
+
class: g({
|
|
1660
|
+
"button-tool": !0,
|
|
1661
|
+
"button-tool--selected": s.isMoveMode,
|
|
1662
|
+
tooltip: !0
|
|
1663
|
+
}),
|
|
1664
|
+
onClick: o[0] || (o[0] = (i) => {
|
|
1665
|
+
t.deleteEmptyTextElement(), s.isMoveMode = !s.isMoveMode, s.activeShape = void 0, s.isDeleteMode = !1, s.isDrawMode = !1, s.isResizeMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.showCaret = !1;
|
|
1666
|
+
}),
|
|
1667
|
+
onMouseenter: o[1] || (o[1] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("move", i, "top")),
|
|
1668
|
+
onMouseleave: o[2] || (o[2] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1669
|
+
onFocus: o[3] || (o[3] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("move", i, "top")),
|
|
1670
|
+
onBlur: o[4] || (o[4] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1671
|
+
}, [
|
|
1672
|
+
T(h, {
|
|
1673
|
+
name: "move",
|
|
1674
|
+
stroke: s.isMoveMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color
|
|
1675
|
+
}, null, 8, ["stroke"]),
|
|
1676
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1677
|
+
key: 0,
|
|
1678
|
+
show: s.showTooltip && s.tooltipKey === "move",
|
|
1679
|
+
x: s.tooltipPos.x,
|
|
1680
|
+
y: s.tooltipPos.y - 6,
|
|
1681
|
+
placement: "top",
|
|
1682
|
+
styleObject: t.tooltipStyleObject
|
|
1683
|
+
}, {
|
|
1684
|
+
default: N(() => [
|
|
1685
|
+
F(f(t.FINAL_CONFIG.translations.tooltipMove) + " ", 1),
|
|
1686
|
+
o[150] || (o[150] = n("kbd", null, "M", -1))
|
|
1687
|
+
]),
|
|
1688
|
+
_: 1
|
|
1689
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1690
|
+
], 46, ce),
|
|
1691
|
+
n("button", {
|
|
1692
|
+
disabled: s.shapes.length === 0 || s.activeShape === "line",
|
|
1693
|
+
style: b({
|
|
1694
|
+
background: s.isResizeMode ? t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1695
|
+
border: s.isResizeMode ? t.FINAL_CONFIG.style.buttons.controls.selected.border : t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1696
|
+
color: s.isResizeMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1697
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1698
|
+
}),
|
|
1699
|
+
class: g({
|
|
1700
|
+
"button-tool": !0,
|
|
1701
|
+
"button-tool--selected": s.isResizeMode,
|
|
1702
|
+
tooltip: !0
|
|
1703
|
+
}),
|
|
1704
|
+
onClick: o[5] || (o[5] = (i) => {
|
|
1705
|
+
t.deleteEmptyTextElement(), s.isResizeMode = !s.isResizeMode, s.isMoveMode = !1, s.isDeleteMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.activeShape = void 0, s.showCaret = !1;
|
|
1706
|
+
}),
|
|
1707
|
+
onMouseenter: o[6] || (o[6] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("resize", i, "top")),
|
|
1708
|
+
onMouseleave: o[7] || (o[7] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1709
|
+
onFocus: o[8] || (o[8] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("resize", i, "top")),
|
|
1710
|
+
onBlur: o[9] || (o[9] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1711
|
+
}, [
|
|
1712
|
+
T(h, {
|
|
1713
|
+
name: "resize",
|
|
1714
|
+
stroke: s.isResizeMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color
|
|
1715
|
+
}, null, 8, ["stroke"]),
|
|
1716
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1717
|
+
key: 0,
|
|
1718
|
+
show: s.showTooltip && s.tooltipKey === "resize",
|
|
1719
|
+
x: s.tooltipPos.x,
|
|
1720
|
+
y: s.tooltipPos.y - 6,
|
|
1721
|
+
placement: "top",
|
|
1722
|
+
styleObject: t.tooltipStyleObject
|
|
1723
|
+
}, {
|
|
1724
|
+
default: N(() => [
|
|
1725
|
+
F(f(t.FINAL_CONFIG.translations.tooltipResize) + " ", 1),
|
|
1726
|
+
o[151] || (o[151] = n("kbd", null, "R", -1))
|
|
1727
|
+
]),
|
|
1728
|
+
_: 1
|
|
1729
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1730
|
+
], 46, ye),
|
|
1731
|
+
n("button", {
|
|
1732
|
+
disabled: s.shapes.length === 0,
|
|
1733
|
+
style: b({
|
|
1734
|
+
background: s.isDeleteMode ? t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1735
|
+
border: s.isDeleteMode ? t.FINAL_CONFIG.style.buttons.controls.selected.border : t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1736
|
+
color: s.isDeleteMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1737
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1738
|
+
}),
|
|
1739
|
+
class: g({
|
|
1740
|
+
"button-tool": !0,
|
|
1741
|
+
"button-tool--selected": s.isDeleteMode,
|
|
1742
|
+
tooltip: !0
|
|
1743
|
+
}),
|
|
1744
|
+
onClick: o[10] || (o[10] = (i) => {
|
|
1745
|
+
t.deleteEmptyTextElement(), s.isDeleteMode = !s.isDeleteMode, s.isMoveMode = !1, s.isResizeMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.activeShape = void 0, s.showCaret = !1;
|
|
1746
|
+
}),
|
|
1747
|
+
onMouseenter: o[11] || (o[11] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("delete", i, "top")),
|
|
1748
|
+
onMouseleave: o[12] || (o[12] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1749
|
+
onFocus: o[13] || (o[13] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("delete", i, "top")),
|
|
1750
|
+
onBlur: o[14] || (o[14] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1751
|
+
}, [
|
|
1752
|
+
T(h, {
|
|
1753
|
+
name: "trash",
|
|
1754
|
+
stroke: s.isDeleteMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color
|
|
1755
|
+
}, null, 8, ["stroke"]),
|
|
1756
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1757
|
+
key: 0,
|
|
1758
|
+
show: s.showTooltip && s.tooltipKey === "delete",
|
|
1759
|
+
x: s.tooltipPos.x,
|
|
1760
|
+
y: s.tooltipPos.y - 6,
|
|
1761
|
+
placement: "top",
|
|
1762
|
+
styleObject: t.tooltipStyleObject
|
|
1763
|
+
}, {
|
|
1764
|
+
default: N(() => [
|
|
1765
|
+
F(f(t.FINAL_CONFIG.translations.tooltipDelete) + " ", 1),
|
|
1766
|
+
o[152] || (o[152] = n("kbd", null, "D", -1))
|
|
1767
|
+
]),
|
|
1768
|
+
_: 1
|
|
1769
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1770
|
+
], 46, ae),
|
|
1771
|
+
n("button", {
|
|
1772
|
+
disabled: !t.canSelect,
|
|
1773
|
+
style: b({
|
|
1774
|
+
background: s.isSelectMode ? t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1775
|
+
border: s.isSelectMode ? t.FINAL_CONFIG.style.buttons.controls.selected.border : t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1776
|
+
color: s.isSelectMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1777
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1778
|
+
}),
|
|
1779
|
+
class: g({
|
|
1780
|
+
"button-tool": !0,
|
|
1781
|
+
"button-tool--selected": s.isSelectMode,
|
|
1782
|
+
tooltip: !0
|
|
1783
|
+
}),
|
|
1784
|
+
onClick: o[15] || (o[15] = (i) => {
|
|
1785
|
+
t.deleteEmptyTextElement(), t.setShapeTo("group"), s.isSelectMode = !s.isSelectMode, s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isTextMode = !1, s.isWriting = !1, s.activeShape = "group", s.showCaret = !1;
|
|
1786
|
+
}),
|
|
1787
|
+
onMouseenter: o[16] || (o[16] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("selectAndGroup", i, "top")),
|
|
1788
|
+
onMouseleave: o[17] || (o[17] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1789
|
+
onFocus: o[18] || (o[18] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("selectAndGroup", i, "top")),
|
|
1790
|
+
onBlur: o[19] || (o[19] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1791
|
+
}, [
|
|
1792
|
+
T(h, {
|
|
1793
|
+
name: "selectAndGroup",
|
|
1794
|
+
stroke: s.isSelectMode ? t.FINAL_CONFIG.style.buttons.controls.selected.color : t.FINAL_CONFIG.style.buttons.controls.color
|
|
1795
|
+
}, null, 8, ["stroke"]),
|
|
1796
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1797
|
+
key: 0,
|
|
1798
|
+
show: s.showTooltip && s.tooltipKey === "selectAndGroup",
|
|
1799
|
+
x: s.tooltipPos.x,
|
|
1800
|
+
y: s.tooltipPos.y - 6,
|
|
1801
|
+
placement: "top",
|
|
1802
|
+
styleObject: t.tooltipStyleObject
|
|
1803
|
+
}, {
|
|
1804
|
+
default: N(() => [
|
|
1805
|
+
F(f(t.FINAL_CONFIG.translations.tooltipGroup) + " ", 1),
|
|
1806
|
+
o[153] || (o[153] = n("kbd", null, "G", -1))
|
|
1807
|
+
]),
|
|
1808
|
+
_: 1
|
|
1809
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1810
|
+
], 46, fe),
|
|
1811
|
+
n("button", {
|
|
1812
|
+
disabled: s.shapes.length === 0,
|
|
1813
|
+
style: b({
|
|
1814
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1815
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1816
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1817
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1818
|
+
}),
|
|
1819
|
+
class: g({ "button-tool": !0, tooltip: !0 }),
|
|
1820
|
+
onClick: o[20] || (o[20] = (i) => {
|
|
1821
|
+
s.isResizeMode = !1, s.isMoveMode = !0, s.isDeleteMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.showCaret = !1, t.bringShapeTo("front");
|
|
1822
|
+
}),
|
|
1823
|
+
onMouseenter: o[21] || (o[21] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("bringToFront", i, "top")),
|
|
1824
|
+
onMouseleave: o[22] || (o[22] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1825
|
+
onFocus: o[23] || (o[23] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("bringToFront", i, "top")),
|
|
1826
|
+
onBlur: o[24] || (o[24] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1827
|
+
}, [
|
|
1828
|
+
T(h, {
|
|
1829
|
+
name: "bringToFront",
|
|
1830
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color
|
|
1831
|
+
}, null, 8, ["stroke"]),
|
|
1832
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1833
|
+
key: 0,
|
|
1834
|
+
show: s.showTooltip && s.tooltipKey === "bringToFront",
|
|
1835
|
+
x: s.tooltipPos.x,
|
|
1836
|
+
y: s.tooltipPos.y - 6,
|
|
1837
|
+
placement: "top",
|
|
1838
|
+
styleObject: t.tooltipStyleObject
|
|
1839
|
+
}, {
|
|
1840
|
+
default: N(() => [
|
|
1841
|
+
F(f(t.FINAL_CONFIG.translations.tooltipBringToFront), 1)
|
|
1842
|
+
]),
|
|
1843
|
+
_: 1
|
|
1844
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1845
|
+
], 44, be),
|
|
1846
|
+
n("button", {
|
|
1847
|
+
disabled: s.shapes.length === 0,
|
|
1848
|
+
style: b({
|
|
1849
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1850
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1851
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1852
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1853
|
+
}),
|
|
1854
|
+
class: g({ "button-tool": !0, tooltip: !0 }),
|
|
1855
|
+
onClick: o[25] || (o[25] = (i) => {
|
|
1856
|
+
s.isResizeMode = !1, s.isMoveMode = !0, s.isDeleteMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.showCaret = !1, t.bringShapeTo("back");
|
|
1857
|
+
}),
|
|
1858
|
+
onMouseenter: o[26] || (o[26] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("bringToBack", i, "top")),
|
|
1859
|
+
onMouseleave: o[27] || (o[27] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1860
|
+
onFocus: o[28] || (o[28] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("bringToBack", i, "top")),
|
|
1861
|
+
onBlur: o[29] || (o[29] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1862
|
+
}, [
|
|
1863
|
+
T(h, {
|
|
1864
|
+
name: "bringToBack",
|
|
1865
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color
|
|
1866
|
+
}, null, 8, ["stroke"]),
|
|
1867
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1868
|
+
key: 0,
|
|
1869
|
+
show: s.showTooltip && s.tooltipKey === "bringToBack",
|
|
1870
|
+
x: s.tooltipPos.x,
|
|
1871
|
+
y: s.tooltipPos.y - 6,
|
|
1872
|
+
placement: "top",
|
|
1873
|
+
styleObject: t.tooltipStyleObject
|
|
1874
|
+
}, {
|
|
1875
|
+
default: N(() => [
|
|
1876
|
+
F(f(t.FINAL_CONFIG.translations.tooltipBringToBack), 1)
|
|
1877
|
+
]),
|
|
1878
|
+
_: 1
|
|
1879
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1880
|
+
], 44, Fe),
|
|
1881
|
+
n("button", {
|
|
1882
|
+
disabled: s.shapes.length === 0 || s.activeShape === "line",
|
|
1883
|
+
style: b({
|
|
1884
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1885
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1886
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1887
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1888
|
+
}),
|
|
1889
|
+
class: g({ "button-tool": !0, tooltip: !0 }),
|
|
1890
|
+
onClick: o[30] || (o[30] = (i) => {
|
|
1891
|
+
t.deleteEmptyTextElement(), s.isResizeMode = !1, s.isMoveMode = !0, s.isDeleteMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.showCaret = !1, t.copyPaste();
|
|
1892
|
+
}),
|
|
1893
|
+
onMouseenter: o[31] || (o[31] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("duplicate", i, "top")),
|
|
1894
|
+
onMouseleave: o[32] || (o[32] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1895
|
+
onFocus: o[33] || (o[33] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("duplicate", i, "top")),
|
|
1896
|
+
onBlur: o[34] || (o[34] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1897
|
+
}, [
|
|
1898
|
+
T(h, {
|
|
1899
|
+
name: "copy",
|
|
1900
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1901
|
+
size: 18
|
|
1902
|
+
}, null, 8, ["stroke"]),
|
|
1903
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1904
|
+
key: 0,
|
|
1905
|
+
show: s.showTooltip && s.tooltipKey === "duplicate",
|
|
1906
|
+
x: s.tooltipPos.x,
|
|
1907
|
+
y: s.tooltipPos.y - 6,
|
|
1908
|
+
placement: "top",
|
|
1909
|
+
styleObject: t.tooltipStyleObject
|
|
1910
|
+
}, {
|
|
1911
|
+
default: N(() => [
|
|
1912
|
+
F(f(t.FINAL_CONFIG.translations.tooltipDuplicate), 1)
|
|
1913
|
+
]),
|
|
1914
|
+
_: 1
|
|
1915
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1916
|
+
], 44, Ie),
|
|
1917
|
+
n("button", {
|
|
1918
|
+
disabled: s._historySize.undo === 0,
|
|
1919
|
+
style: b({
|
|
1920
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1921
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1922
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1923
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1924
|
+
}),
|
|
1925
|
+
class: g({ "button-tool": !0, "button-tool--one-shot": !0, tooltip: !0 }),
|
|
1926
|
+
onClick: o[35] || (o[35] = (i) => {
|
|
1927
|
+
s.isResizeMode = !1, s.isMoveMode = !1, s.isDeleteMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.activeShape = void 0, s.showCaret = !1, t.undoLastShape();
|
|
1928
|
+
}),
|
|
1929
|
+
onMouseenter: o[36] || (o[36] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("undoLast", i, "top")),
|
|
1930
|
+
onMouseleave: o[37] || (o[37] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1931
|
+
onFocus: o[38] || (o[38] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("undoLast", i, "top")),
|
|
1932
|
+
onBlur: o[39] || (o[39] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1933
|
+
}, [
|
|
1934
|
+
T(h, {
|
|
1935
|
+
name: "refresh",
|
|
1936
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1937
|
+
size: 20
|
|
1938
|
+
}, null, 8, ["stroke"]),
|
|
1939
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1940
|
+
key: 0,
|
|
1941
|
+
show: s.showTooltip && s.tooltipKey === "undoLast",
|
|
1942
|
+
x: s.tooltipPos.x,
|
|
1943
|
+
y: s.tooltipPos.y - 6,
|
|
1944
|
+
placement: "top",
|
|
1945
|
+
styleObject: t.tooltipStyleObject
|
|
1946
|
+
}, {
|
|
1947
|
+
default: N(() => [
|
|
1948
|
+
F(f(t.FINAL_CONFIG.translations.tooltipUndo) + " ", 1),
|
|
1949
|
+
n("kbd", null, f(s.isMacLike ? "⌘" : "Ctrl"), 1),
|
|
1950
|
+
o[154] || (o[154] = n("kbd", null, "Z", -1))
|
|
1951
|
+
]),
|
|
1952
|
+
_: 1
|
|
1953
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1954
|
+
], 44, Ne),
|
|
1955
|
+
n("button", {
|
|
1956
|
+
disabled: s._historySize.redo === 0,
|
|
1957
|
+
style: b({
|
|
1958
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
1959
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
1960
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1961
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
1962
|
+
}),
|
|
1963
|
+
class: g({ "button-tool": !0, "button-tool--one-shot": !0, tooltip: !0 }),
|
|
1964
|
+
onClick: o[40] || (o[40] = (i) => {
|
|
1965
|
+
s.isResizeMode = !1, s.isMoveMode = !1, s.isDeleteMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.isTextMode = !1, s.isWriting = !1, s.activeShape = void 0, s.showCaret = !1, t.redoLastShape();
|
|
1966
|
+
}),
|
|
1967
|
+
onMouseenter: o[41] || (o[41] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("redoLast", i, "top")),
|
|
1968
|
+
onMouseleave: o[42] || (o[42] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
1969
|
+
onFocus: o[43] || (o[43] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("redoLast", i, "top")),
|
|
1970
|
+
onBlur: o[44] || (o[44] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
1971
|
+
}, [
|
|
1972
|
+
T(h, {
|
|
1973
|
+
name: "refresh",
|
|
1974
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
1975
|
+
size: 20,
|
|
1976
|
+
style: {
|
|
1977
|
+
transform: "rotateX(0deg) rotateY(180deg)"
|
|
1978
|
+
}
|
|
1979
|
+
}, null, 8, ["stroke"]),
|
|
1980
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
1981
|
+
key: 0,
|
|
1982
|
+
show: s.showTooltip && s.tooltipKey === "redoLast",
|
|
1983
|
+
x: s.tooltipPos.x,
|
|
1984
|
+
y: s.tooltipPos.y - 6,
|
|
1985
|
+
placement: "top",
|
|
1986
|
+
styleObject: t.tooltipStyleObject
|
|
1987
|
+
}, {
|
|
1988
|
+
default: N(() => [
|
|
1989
|
+
F(f(t.FINAL_CONFIG.translations.tooltipRedo) + " ", 1),
|
|
1990
|
+
n("kbd", null, f(s.isMacLike ? "⌘" : "Ctrl"), 1),
|
|
1991
|
+
o[155] || (o[155] = n("kbd", null, "Y", -1))
|
|
1992
|
+
]),
|
|
1993
|
+
_: 1
|
|
1994
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
1995
|
+
], 44, ge),
|
|
1996
|
+
t.FINAL_CONFIG.style.showPrint ? (c(), p("button", {
|
|
1997
|
+
key: 0,
|
|
1998
|
+
style: b({
|
|
1999
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
2000
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
2001
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
2002
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2003
|
+
}),
|
|
2004
|
+
class: g({ "button-tool": !0, tooltip: !0 }),
|
|
2005
|
+
onClick: o[45] || (o[45] = (...i) => t.print && t.print(...i)),
|
|
2006
|
+
onMouseenter: o[46] || (o[46] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("printPdf", i, "top")),
|
|
2007
|
+
onMouseleave: o[47] || (o[47] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2008
|
+
onFocus: o[48] || (o[48] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("printPdf", i, "top")),
|
|
2009
|
+
onBlur: o[49] || (o[49] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2010
|
+
}, [
|
|
2011
|
+
T(h, {
|
|
2012
|
+
name: "printer",
|
|
2013
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color
|
|
2014
|
+
}, null, 8, ["stroke"]),
|
|
2015
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2016
|
+
key: 0,
|
|
2017
|
+
show: s.showTooltip && s.tooltipKey === "printPdf",
|
|
2018
|
+
x: s.tooltipPos.x,
|
|
2019
|
+
y: s.tooltipPos.y - 6,
|
|
2020
|
+
placement: "top",
|
|
2021
|
+
styleObject: t.tooltipStyleObject
|
|
2022
|
+
}, {
|
|
2023
|
+
default: N(() => [
|
|
2024
|
+
F(f(t.FINAL_CONFIG.translations.tooltipPdf), 1)
|
|
2025
|
+
]),
|
|
2026
|
+
_: 1
|
|
2027
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2028
|
+
], 36)) : a("", !0),
|
|
2029
|
+
t.FINAL_CONFIG.style.showImage ? (c(), p("button", {
|
|
2030
|
+
key: 1,
|
|
2031
|
+
style: b({
|
|
2032
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
2033
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
2034
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
2035
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2036
|
+
}),
|
|
2037
|
+
class: g({ "button-tool": !0, tooltip: !0 }),
|
|
2038
|
+
onClick: o[50] || (o[50] = (...i) => r.generateImage && r.generateImage(...i)),
|
|
2039
|
+
onMouseenter: o[51] || (o[51] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("printImage", i, "top")),
|
|
2040
|
+
onMouseleave: o[52] || (o[52] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2041
|
+
onFocus: o[53] || (o[53] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("printImage", i, "top")),
|
|
2042
|
+
onBlur: o[54] || (o[54] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2043
|
+
}, [
|
|
2044
|
+
T(h, {
|
|
2045
|
+
name: "image",
|
|
2046
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
2047
|
+
size: 20
|
|
2048
|
+
}, null, 8, ["stroke"]),
|
|
2049
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2050
|
+
key: 0,
|
|
2051
|
+
show: s.showTooltip && s.tooltipKey === "printImage",
|
|
2052
|
+
x: s.tooltipPos.x,
|
|
2053
|
+
y: s.tooltipPos.y - 6,
|
|
2054
|
+
placement: "top",
|
|
2055
|
+
styleObject: t.tooltipStyleObject
|
|
2056
|
+
}, {
|
|
2057
|
+
default: N(() => [
|
|
2058
|
+
F(f(t.FINAL_CONFIG.translations.tooltipImage), 1)
|
|
2059
|
+
]),
|
|
2060
|
+
_: 1
|
|
2061
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2062
|
+
], 36)) : a("", !0),
|
|
2063
|
+
t.FINAL_CONFIG.style.showSave && e.$attrs.onSaveAnnotations ? (c(), p("button", {
|
|
2064
|
+
key: 2,
|
|
2065
|
+
style: b({
|
|
2066
|
+
background: t.FINAL_CONFIG.style.buttons.controls.backgroundColor,
|
|
2067
|
+
border: t.FINAL_CONFIG.style.buttons.controls.border,
|
|
2068
|
+
color: t.FINAL_CONFIG.style.buttons.controls.color,
|
|
2069
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2070
|
+
}),
|
|
2071
|
+
class: g({ "button-tool": !0, tooltip: !0 }),
|
|
2072
|
+
onClick: o[55] || (o[55] = (...i) => t.save && t.save(...i)),
|
|
2073
|
+
onMouseenter: o[56] || (o[56] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("saveAction", i, "top")),
|
|
2074
|
+
onMouseleave: o[57] || (o[57] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2075
|
+
onFocus: o[58] || (o[58] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("saveAction", i, "top")),
|
|
2076
|
+
onBlur: o[59] || (o[59] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2077
|
+
}, [
|
|
2078
|
+
T(h, {
|
|
2079
|
+
name: "save",
|
|
2080
|
+
stroke: t.FINAL_CONFIG.style.buttons.controls.color
|
|
2081
|
+
}, null, 8, ["stroke"]),
|
|
2082
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2083
|
+
key: 0,
|
|
2084
|
+
show: s.showTooltip && s.tooltipKey === "saveAction",
|
|
2085
|
+
x: s.tooltipPos.x,
|
|
2086
|
+
y: s.tooltipPos.y - 6,
|
|
2087
|
+
placement: "top",
|
|
2088
|
+
styleObject: t.tooltipStyleObject
|
|
2089
|
+
}, {
|
|
2090
|
+
default: N(() => [
|
|
2091
|
+
F(f(t.FINAL_CONFIG.translations.tooltipSave), 1)
|
|
2092
|
+
]),
|
|
2093
|
+
_: 1
|
|
2094
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2095
|
+
], 36)) : a("", !0)
|
|
2096
|
+
], 4),
|
|
2097
|
+
n("div", xe, [
|
|
2098
|
+
n("button", {
|
|
2099
|
+
class: g({
|
|
2100
|
+
"button-tool": !0,
|
|
2101
|
+
"button-tool--selected": s.activeShape === "circle",
|
|
2102
|
+
tooltip: !0
|
|
2103
|
+
}),
|
|
2104
|
+
style: b({
|
|
2105
|
+
background: s.activeShape === "circle" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2106
|
+
border: s.activeShape === "circle" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2107
|
+
color: s.activeShape === "circle" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2108
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2109
|
+
}),
|
|
2110
|
+
onClick: o[60] || (o[60] = (i) => {
|
|
2111
|
+
t.setShapeTo("circle"), s.isSelectMode = !1;
|
|
2112
|
+
}),
|
|
2113
|
+
onMouseenter: o[61] || (o[61] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setCircle", i, "top")),
|
|
2114
|
+
onMouseleave: o[62] || (o[62] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2115
|
+
onFocus: o[63] || (o[63] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setCircle", i, "top")),
|
|
2116
|
+
onBlur: o[64] || (o[64] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2117
|
+
}, [
|
|
2118
|
+
(c(), p("svg", pe, [
|
|
2119
|
+
n("circle", {
|
|
2120
|
+
cx: 6,
|
|
2121
|
+
cy: 6,
|
|
2122
|
+
r: "4",
|
|
2123
|
+
fill: s.options.circle.filled ? (s.activeShape === "circle", s.selectedColor + t.colorTransparency) : "none",
|
|
2124
|
+
stroke: "currentColor"
|
|
2125
|
+
}, null, 8, we)
|
|
2126
|
+
])),
|
|
2127
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2128
|
+
key: 0,
|
|
2129
|
+
show: s.showTooltip && s.tooltipKey === "setCircle",
|
|
2130
|
+
x: s.tooltipPos.x,
|
|
2131
|
+
y: s.tooltipPos.y - 6,
|
|
2132
|
+
placement: "top",
|
|
2133
|
+
styleObject: t.tooltipStyleObject
|
|
2134
|
+
}, {
|
|
2135
|
+
default: N(() => [
|
|
2136
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeCircle) + " ", 1),
|
|
2137
|
+
o[156] || (o[156] = n("kbd", null, "C", -1))
|
|
2138
|
+
]),
|
|
2139
|
+
_: 1
|
|
2140
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2141
|
+
], 38),
|
|
2142
|
+
s.activeShape === "circle" ? (c(), p("div", Se, [
|
|
2143
|
+
n("label", Te, [
|
|
2144
|
+
F(f(t.FINAL_CONFIG.translations.filled) + " ", 1),
|
|
2145
|
+
M(n("input", {
|
|
2146
|
+
type: "checkbox",
|
|
2147
|
+
"onUpdate:modelValue": o[65] || (o[65] = (i) => s.options.circle.filled = i),
|
|
2148
|
+
onChange: o[66] || (o[66] = (...i) => t.setFillOfSelectedCircle && t.setFillOfSelectedCircle(...i)),
|
|
2149
|
+
checked: s.options.circle.filled,
|
|
2150
|
+
style: b({
|
|
2151
|
+
all: "revert",
|
|
2152
|
+
appearance: "auto",
|
|
2153
|
+
"-webkit-appearance": "auto",
|
|
2154
|
+
accentColor: t.FINAL_CONFIG.style.color + " !important"
|
|
2155
|
+
})
|
|
2156
|
+
}, null, 44, ke), [
|
|
2157
|
+
[G, s.options.circle.filled]
|
|
2158
|
+
])
|
|
2159
|
+
])
|
|
2160
|
+
])) : a("", !0),
|
|
2161
|
+
n("button", {
|
|
2162
|
+
class: g({
|
|
2163
|
+
"button-tool": !0,
|
|
2164
|
+
"button-tool--selected": s.activeShape === "rect",
|
|
2165
|
+
tooltip: !0
|
|
2166
|
+
}),
|
|
2167
|
+
style: b({
|
|
2168
|
+
background: s.activeShape === "rect" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2169
|
+
border: s.activeShape === "rect" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2170
|
+
color: s.activeShape === "rect" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2171
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2172
|
+
}),
|
|
2173
|
+
onClick: o[67] || (o[67] = (i) => {
|
|
2174
|
+
t.setShapeTo("rect"), s.isSelectMode = !1;
|
|
2175
|
+
}),
|
|
2176
|
+
onMouseenter: o[68] || (o[68] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setRect", i, "top")),
|
|
2177
|
+
onMouseleave: o[69] || (o[69] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2178
|
+
onFocus: o[70] || (o[70] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setRect", i, "top")),
|
|
2179
|
+
onBlur: o[71] || (o[71] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2180
|
+
}, [
|
|
2181
|
+
(c(), p("svg", Ce, [
|
|
2182
|
+
n("rect", {
|
|
2183
|
+
x: "3",
|
|
2184
|
+
y: "3",
|
|
2185
|
+
style: { rx: "0 !important", ry: "0 !important" },
|
|
2186
|
+
height: "6",
|
|
2187
|
+
width: "6",
|
|
2188
|
+
fill: s.options.rect.filled ? (s.activeShape === "rect", s.selectedColor + t.colorTransparency) : "none",
|
|
2189
|
+
stroke: "currentColor"
|
|
2190
|
+
}, null, 8, Oe)
|
|
2191
|
+
])),
|
|
2192
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2193
|
+
key: 0,
|
|
2194
|
+
show: s.showTooltip && s.tooltipKey === "setRect",
|
|
2195
|
+
x: s.tooltipPos.x,
|
|
2196
|
+
y: s.tooltipPos.y - 6,
|
|
2197
|
+
placement: "top",
|
|
2198
|
+
styleObject: t.tooltipStyleObject
|
|
2199
|
+
}, {
|
|
2200
|
+
default: N(() => [
|
|
2201
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeRect) + " ", 1),
|
|
2202
|
+
o[157] || (o[157] = n("kbd", null, "S", -1))
|
|
2203
|
+
]),
|
|
2204
|
+
_: 1
|
|
2205
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2206
|
+
], 38),
|
|
2207
|
+
s.activeShape === "rect" ? (c(), p("div", Me, [
|
|
2208
|
+
n("label", ve, [
|
|
2209
|
+
F(f(t.FINAL_CONFIG.translations.filled) + " ", 1),
|
|
2210
|
+
M(n("input", {
|
|
2211
|
+
type: "checkbox",
|
|
2212
|
+
"onUpdate:modelValue": o[72] || (o[72] = (i) => s.options.rect.filled = i),
|
|
2213
|
+
onChange: o[73] || (o[73] = (...i) => t.setFillOfSelectedRect && t.setFillOfSelectedRect(...i)),
|
|
2214
|
+
checked: s.options.rect.filled,
|
|
2215
|
+
style: b({
|
|
2216
|
+
all: "revert",
|
|
2217
|
+
appearance: "auto",
|
|
2218
|
+
"-webkit-appearance": "auto",
|
|
2219
|
+
accentColor: t.FINAL_CONFIG.style.color + " !important"
|
|
2220
|
+
})
|
|
2221
|
+
}, null, 44, Ae), [
|
|
2222
|
+
[G, s.options.rect.filled]
|
|
2223
|
+
])
|
|
2224
|
+
])
|
|
2225
|
+
])) : a("", !0),
|
|
2226
|
+
n("button", {
|
|
2227
|
+
class: g({
|
|
2228
|
+
"button-tool": !0,
|
|
2229
|
+
"button-tool--selected": s.activeShape === "arrow",
|
|
2230
|
+
tooltip: !0
|
|
2231
|
+
}),
|
|
2232
|
+
style: b({
|
|
2233
|
+
background: s.activeShape === "arrow" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2234
|
+
border: s.activeShape === "arrow" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2235
|
+
color: s.activeShape === "arrow" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2236
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2237
|
+
}),
|
|
2238
|
+
onClick: o[74] || (o[74] = (i) => {
|
|
2239
|
+
t.setShapeTo("arrow"), s.isSelectMode = !1;
|
|
2240
|
+
}),
|
|
2241
|
+
onMouseenter: o[75] || (o[75] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setArrow", i, "top")),
|
|
2242
|
+
onMouseleave: o[76] || (o[76] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2243
|
+
onFocus: o[77] || (o[77] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setArrow", i, "top")),
|
|
2244
|
+
onBlur: o[78] || (o[78] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2245
|
+
}, [
|
|
2246
|
+
(c(), p("svg", me, [
|
|
2247
|
+
n("path", {
|
|
2248
|
+
stroke: s.options.arrow.filled ? s.activeShape === "arrow" ? "white" : "grey" : "none",
|
|
2249
|
+
"stroke-width": "2",
|
|
2250
|
+
d: "M5,19 19,5 14,5 19,10.5 19,5",
|
|
2251
|
+
fill: "none",
|
|
2252
|
+
"stroke-linecap": "round",
|
|
2253
|
+
"stroke-linejoin": "round"
|
|
2254
|
+
}, null, 8, Le)
|
|
2255
|
+
])),
|
|
2256
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2257
|
+
key: 0,
|
|
2258
|
+
show: s.showTooltip && s.tooltipKey === "setArrow",
|
|
2259
|
+
x: s.tooltipPos.x,
|
|
2260
|
+
y: s.tooltipPos.y - 6,
|
|
2261
|
+
placement: "top",
|
|
2262
|
+
styleObject: t.tooltipStyleObject
|
|
2263
|
+
}, {
|
|
2264
|
+
default: N(() => [
|
|
2265
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeArrow) + " ", 1),
|
|
2266
|
+
o[158] || (o[158] = n("kbd", null, "A", -1))
|
|
2267
|
+
]),
|
|
2268
|
+
_: 1
|
|
2269
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2270
|
+
], 38),
|
|
2271
|
+
n("button", {
|
|
2272
|
+
class: g({
|
|
2273
|
+
"button-tool": !0,
|
|
2274
|
+
"button-tool--selected": s.activeShape === "line",
|
|
2275
|
+
tooltip: !0
|
|
2276
|
+
}),
|
|
2277
|
+
style: b({
|
|
2278
|
+
background: s.activeShape === "line" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2279
|
+
border: s.activeShape === "line" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2280
|
+
color: s.activeShape === "line" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2281
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2282
|
+
}),
|
|
2283
|
+
onClick: o[79] || (o[79] = (i) => {
|
|
2284
|
+
t.setShapeTo("line"), s.isSelectMode = !1;
|
|
2285
|
+
}),
|
|
2286
|
+
onMouseenter: o[80] || (o[80] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setFreehand", i, "top")),
|
|
2287
|
+
onMouseleave: o[81] || (o[81] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2288
|
+
onFocus: o[82] || (o[82] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setFreehand", i, "top")),
|
|
2289
|
+
onBlur: o[83] || (o[83] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2290
|
+
}, [
|
|
2291
|
+
o[160] || (o[160] = n("svg", {
|
|
2292
|
+
width: "80%",
|
|
2293
|
+
viewBox: "0 0 24 24",
|
|
2294
|
+
"stroke-width": "2",
|
|
2295
|
+
stroke: "currentColor",
|
|
2296
|
+
fill: "none",
|
|
2297
|
+
"stroke-linecap": "round",
|
|
2298
|
+
"stroke-linejoin": "round"
|
|
2299
|
+
}, [
|
|
2300
|
+
n("path", {
|
|
2301
|
+
stroke: "none",
|
|
2302
|
+
d: "M0 0h24v24H0z",
|
|
2303
|
+
fill: "none"
|
|
2304
|
+
}),
|
|
2305
|
+
n("path", { d: "M3 15c2 3 4 4 7 4s7 -3 7 -7s-3 -7 -6 -7s-5 1.5 -5 4s2 5 6 5s8.408 -2.453 10 -5" })
|
|
2306
|
+
], -1)),
|
|
2307
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2308
|
+
key: 0,
|
|
2309
|
+
show: s.showTooltip && s.tooltipKey === "setFreehand",
|
|
2310
|
+
x: s.tooltipPos.x,
|
|
2311
|
+
y: s.tooltipPos.y - 6,
|
|
2312
|
+
placement: "top",
|
|
2313
|
+
styleObject: t.tooltipStyleObject
|
|
2314
|
+
}, {
|
|
2315
|
+
default: N(() => [
|
|
2316
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeFreehand) + " ", 1),
|
|
2317
|
+
o[159] || (o[159] = n("kbd", null, "L", -1))
|
|
2318
|
+
]),
|
|
2319
|
+
_: 1
|
|
2320
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2321
|
+
], 38),
|
|
2322
|
+
["arrow", "circle", "rect", "line"].includes(s.activeShape) ? (c(), p("div", Ge, [
|
|
2323
|
+
n("div", De, [
|
|
2324
|
+
n("label", Pe, [
|
|
2325
|
+
F(f(t.FINAL_CONFIG.translations.thickness) + " ", 1),
|
|
2326
|
+
M(n("input", {
|
|
2327
|
+
type: "number",
|
|
2328
|
+
"onUpdate:modelValue": o[84] || (o[84] = (i) => s.strokeSize = i),
|
|
2329
|
+
onInput: o[85] || (o[85] = (...i) => t.setStrokeWidthOfSelectedShape && t.setStrokeWidthOfSelectedShape(...i)),
|
|
2330
|
+
min: 1,
|
|
2331
|
+
style: { padding: "0 4px", width: "40px", border: "1px solid #dadada", "border-radius": "3px" }
|
|
2332
|
+
}, null, 544), [
|
|
2333
|
+
[D, s.strokeSize]
|
|
2334
|
+
])
|
|
2335
|
+
])
|
|
2336
|
+
])
|
|
2337
|
+
])) : a("", !0),
|
|
2338
|
+
["arrow", "circle", "rect"].includes(s.activeShape) ? (c(), p("div", _e, [
|
|
2339
|
+
n("div", ze, [
|
|
2340
|
+
n("label", Re, [
|
|
2341
|
+
F(f(t.FINAL_CONFIG.translations.dashedLines) + " ", 1),
|
|
2342
|
+
(c(), p("svg", Be, [...o[161] || (o[161] = [
|
|
2343
|
+
n("line", {
|
|
2344
|
+
x1: "0",
|
|
2345
|
+
x2: "24",
|
|
2346
|
+
y1: "12",
|
|
2347
|
+
y2: "12",
|
|
2348
|
+
"stroke-width": "2",
|
|
2349
|
+
stroke: "black",
|
|
2350
|
+
"stroke-dasharray": "3"
|
|
2351
|
+
}, null, -1)
|
|
2352
|
+
])])),
|
|
2353
|
+
M(n("input", {
|
|
2354
|
+
name: "dashStyle",
|
|
2355
|
+
type: "checkbox",
|
|
2356
|
+
"onUpdate:modelValue": o[86] || (o[86] = (i) => s.isDash = i),
|
|
2357
|
+
onChange: o[87] || (o[87] = (...i) => t.setSelectedShapeToDash && t.setSelectedShapeToDash(...i)),
|
|
2358
|
+
checked: s.isDash,
|
|
2359
|
+
style: b({
|
|
2360
|
+
all: "revert",
|
|
2361
|
+
appearance: "auto",
|
|
2362
|
+
"-webkit-appearance": "auto",
|
|
2363
|
+
accentColor: t.FINAL_CONFIG.style.color + " !important"
|
|
2364
|
+
})
|
|
2365
|
+
}, null, 44, je), [
|
|
2366
|
+
[G, s.isDash]
|
|
2367
|
+
])
|
|
2368
|
+
])
|
|
2369
|
+
])
|
|
2370
|
+
])) : a("", !0),
|
|
2371
|
+
n("button", {
|
|
2372
|
+
class: g({
|
|
2373
|
+
"button-tool": !0,
|
|
2374
|
+
"button-tool--selected": s.isTextMode,
|
|
2375
|
+
tooltip: !0
|
|
2376
|
+
}),
|
|
2377
|
+
style: b({
|
|
2378
|
+
background: s.isTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2379
|
+
border: s.isTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2380
|
+
color: s.isTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2381
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2382
|
+
}),
|
|
2383
|
+
onClick: o[88] || (o[88] = (i) => {
|
|
2384
|
+
t.deleteEmptyTextElement(), s.isTextMode = !s.isTextMode, s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isSelectMode = !1, s.isDrawMode = !1, s.activeShape = void 0;
|
|
2385
|
+
}),
|
|
2386
|
+
onMouseenter: o[89] || (o[89] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setText", i, "top")),
|
|
2387
|
+
onMouseleave: o[90] || (o[90] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2388
|
+
onFocus: o[91] || (o[91] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setText", i, "top")),
|
|
2389
|
+
onBlur: o[92] || (o[92] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2390
|
+
}, [
|
|
2391
|
+
T(h, {
|
|
2392
|
+
name: "text",
|
|
2393
|
+
stroke: s.isTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color
|
|
2394
|
+
}, null, 8, ["stroke"]),
|
|
2395
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2396
|
+
key: 0,
|
|
2397
|
+
show: s.showTooltip && s.tooltipKey === "setText",
|
|
2398
|
+
x: s.tooltipPos.x,
|
|
2399
|
+
y: s.tooltipPos.y - 6,
|
|
2400
|
+
placement: "top",
|
|
2401
|
+
styleObject: t.tooltipStyleObject
|
|
2402
|
+
}, {
|
|
2403
|
+
default: N(() => [
|
|
2404
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeText) + " ", 1),
|
|
2405
|
+
o[162] || (o[162] = n("kbd", null, "T", -1))
|
|
2406
|
+
]),
|
|
2407
|
+
_: 1
|
|
2408
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2409
|
+
], 38),
|
|
2410
|
+
s.isTextMode ? (c(), p("div", We, [
|
|
2411
|
+
n("div", Ee, [
|
|
2412
|
+
n("label", He, [
|
|
2413
|
+
F(f(t.FINAL_CONFIG.translations.fontSize) + " ", 1),
|
|
2414
|
+
M(n("input", {
|
|
2415
|
+
type: "number",
|
|
2416
|
+
"onUpdate:modelValue": o[93] || (o[93] = (i) => s.textFont = i),
|
|
2417
|
+
onInput: o[94] || (o[94] = (...i) => t.setCurrentStyleOfSelectedText && t.setCurrentStyleOfSelectedText(...i)),
|
|
2418
|
+
style: { padding: "0 4px", width: "40px", border: "1px solid #dadada", "border-radius": "3px" }
|
|
2419
|
+
}, null, 544), [
|
|
2420
|
+
[D, s.textFont]
|
|
2421
|
+
])
|
|
2422
|
+
])
|
|
2423
|
+
])
|
|
2424
|
+
])) : a("", !0),
|
|
2425
|
+
s.isTextMode ? (c(), p("div", Ue, [
|
|
2426
|
+
n("button", {
|
|
2427
|
+
class: g({
|
|
2428
|
+
"button-tool": !0,
|
|
2429
|
+
"button-tool--selected": s.textAlign === "start",
|
|
2430
|
+
tooltip: !0
|
|
2431
|
+
}),
|
|
2432
|
+
style: b({
|
|
2433
|
+
background: s.textAlign === "start" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2434
|
+
border: s.textAlign === "start" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2435
|
+
color: s.textAlign === "start" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2436
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2437
|
+
}),
|
|
2438
|
+
onClick: o[95] || (o[95] = (i) => {
|
|
2439
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.textAlign = "start", t.setSelectedTextAlignTo("start");
|
|
2440
|
+
}),
|
|
2441
|
+
onMouseenter: o[96] || (o[96] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setAlignStart", i, "top")),
|
|
2442
|
+
onMouseleave: o[97] || (o[97] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2443
|
+
onFocus: o[98] || (o[98] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setAlignStart", i, "top")),
|
|
2444
|
+
onBlur: o[99] || (o[99] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2445
|
+
}, [
|
|
2446
|
+
o[163] || (o[163] = n("svg", {
|
|
2447
|
+
width: "80%",
|
|
2448
|
+
viewBox: "0 0 24 24",
|
|
2449
|
+
"stroke-width": "2",
|
|
2450
|
+
stroke: "currentColor",
|
|
2451
|
+
fill: "none",
|
|
2452
|
+
"stroke-linecap": "round",
|
|
2453
|
+
"stroke-linejoin": "round"
|
|
2454
|
+
}, [
|
|
2455
|
+
n("path", {
|
|
2456
|
+
stroke: "none",
|
|
2457
|
+
d: "M0 0h24v24H0z",
|
|
2458
|
+
fill: "none"
|
|
2459
|
+
}),
|
|
2460
|
+
n("path", { d: "M4 6l16 0" }),
|
|
2461
|
+
n("path", { d: "M4 12l10 0" }),
|
|
2462
|
+
n("path", { d: "M4 18l14 0" })
|
|
2463
|
+
], -1)),
|
|
2464
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2465
|
+
key: 0,
|
|
2466
|
+
show: s.showTooltip && s.tooltipKey === "setAlignStart",
|
|
2467
|
+
x: s.tooltipPos.x,
|
|
2468
|
+
y: s.tooltipPos.y - 6,
|
|
2469
|
+
placement: "top",
|
|
2470
|
+
styleObject: t.tooltipStyleObject
|
|
2471
|
+
}, {
|
|
2472
|
+
default: N(() => [
|
|
2473
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextLeft), 1)
|
|
2474
|
+
]),
|
|
2475
|
+
_: 1
|
|
2476
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2477
|
+
], 38)
|
|
2478
|
+
])) : a("", !0),
|
|
2479
|
+
s.isTextMode ? (c(), p("div", Ke, [
|
|
2480
|
+
n("button", {
|
|
2481
|
+
class: g({
|
|
2482
|
+
"button-tool": !0,
|
|
2483
|
+
"button-tool--selected": s.textAlign === "middle",
|
|
2484
|
+
tooltip: !0
|
|
2485
|
+
}),
|
|
2486
|
+
style: b({
|
|
2487
|
+
background: s.textAlign === "middle" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2488
|
+
border: s.textAlign === "middle" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2489
|
+
color: s.textAlign === "middle" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2490
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2491
|
+
}),
|
|
2492
|
+
disabled: s.isBulletTextMode,
|
|
2493
|
+
onClick: o[100] || (o[100] = (i) => {
|
|
2494
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.textAlign = "middle", t.setSelectedTextAlignTo("middle");
|
|
2495
|
+
}),
|
|
2496
|
+
onMouseenter: o[101] || (o[101] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setAlignMiddle", i, "top")),
|
|
2497
|
+
onMouseleave: o[102] || (o[102] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2498
|
+
onFocus: o[103] || (o[103] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setAlignMiddle", i, "top")),
|
|
2499
|
+
onBlur: o[104] || (o[104] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2500
|
+
}, [
|
|
2501
|
+
o[164] || (o[164] = n("svg", {
|
|
2502
|
+
width: "80%",
|
|
2503
|
+
viewBox: "0 0 24 24",
|
|
2504
|
+
"stroke-width": "2",
|
|
2505
|
+
stroke: "currentColor",
|
|
2506
|
+
fill: "none",
|
|
2507
|
+
"stroke-linecap": "round",
|
|
2508
|
+
"stroke-linejoin": "round"
|
|
2509
|
+
}, [
|
|
2510
|
+
n("path", {
|
|
2511
|
+
stroke: "none",
|
|
2512
|
+
d: "M0 0h24v24H0z",
|
|
2513
|
+
fill: "none"
|
|
2514
|
+
}),
|
|
2515
|
+
n("path", { d: "M4 6l16 0" }),
|
|
2516
|
+
n("path", { d: "M8 12l8 0" }),
|
|
2517
|
+
n("path", { d: "M6 18l12 0" })
|
|
2518
|
+
], -1)),
|
|
2519
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2520
|
+
key: 0,
|
|
2521
|
+
show: s.showTooltip && s.tooltipKey === "setAlignMiddle",
|
|
2522
|
+
x: s.tooltipPos.x,
|
|
2523
|
+
y: s.tooltipPos.y - 6,
|
|
2524
|
+
placement: "top",
|
|
2525
|
+
styleObject: t.tooltipStyleObject
|
|
2526
|
+
}, {
|
|
2527
|
+
default: N(() => [
|
|
2528
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextCenter), 1)
|
|
2529
|
+
]),
|
|
2530
|
+
_: 1
|
|
2531
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2532
|
+
], 46, Xe)
|
|
2533
|
+
])) : a("", !0),
|
|
2534
|
+
s.isTextMode ? (c(), p("div", Ye, [
|
|
2535
|
+
n("button", {
|
|
2536
|
+
class: g({
|
|
2537
|
+
"button-tool": !0,
|
|
2538
|
+
"button-tool--selected": s.textAlign === "end",
|
|
2539
|
+
tooltip: !0
|
|
2540
|
+
}),
|
|
2541
|
+
style: b({
|
|
2542
|
+
background: s.textAlign === "end" ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2543
|
+
border: s.textAlign === "end" ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2544
|
+
color: s.textAlign === "end" ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2545
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2546
|
+
}),
|
|
2547
|
+
disabled: s.isBulletTextMode,
|
|
2548
|
+
onClick: o[105] || (o[105] = (i) => {
|
|
2549
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.textAlign = "end", t.setSelectedTextAlignTo("end");
|
|
2550
|
+
}),
|
|
2551
|
+
onMouseenter: o[106] || (o[106] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setAlignEnd", i, "top")),
|
|
2552
|
+
onMouseleave: o[107] || (o[107] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2553
|
+
onFocus: o[108] || (o[108] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setAlignEnd", i, "top")),
|
|
2554
|
+
onBlur: o[109] || (o[109] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2555
|
+
}, [
|
|
2556
|
+
o[165] || (o[165] = n("svg", {
|
|
2557
|
+
width: "80%",
|
|
2558
|
+
viewBox: "0 0 24 24",
|
|
2559
|
+
"stroke-width": "2",
|
|
2560
|
+
stroke: "currentColor",
|
|
2561
|
+
fill: "none",
|
|
2562
|
+
"stroke-linecap": "round",
|
|
2563
|
+
"stroke-linejoin": "round"
|
|
2564
|
+
}, [
|
|
2565
|
+
n("path", {
|
|
2566
|
+
stroke: "none",
|
|
2567
|
+
d: "M0 0h24v24H0z",
|
|
2568
|
+
fill: "none"
|
|
2569
|
+
}),
|
|
2570
|
+
n("path", { d: "M4 6l16 0" }),
|
|
2571
|
+
n("path", { d: "M10 12l10 0" }),
|
|
2572
|
+
n("path", { d: "M6 18l14 0" })
|
|
2573
|
+
], -1)),
|
|
2574
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2575
|
+
key: 0,
|
|
2576
|
+
show: s.showTooltip && s.tooltipKey === "setAlignEnd",
|
|
2577
|
+
x: s.tooltipPos.x,
|
|
2578
|
+
y: s.tooltipPos.y - 6,
|
|
2579
|
+
placement: "top",
|
|
2580
|
+
styleObject: t.tooltipStyleObject
|
|
2581
|
+
}, {
|
|
2582
|
+
default: N(() => [
|
|
2583
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextRight), 1)
|
|
2584
|
+
]),
|
|
2585
|
+
_: 1
|
|
2586
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2587
|
+
], 46, Ve)
|
|
2588
|
+
])) : a("", !0),
|
|
2589
|
+
s.isTextMode ? (c(), p("div", qe, [
|
|
2590
|
+
n("button", {
|
|
2591
|
+
class: g({
|
|
2592
|
+
"button-tool": !0,
|
|
2593
|
+
"button-tool--selected": s.isBulletTextMode,
|
|
2594
|
+
tooltip: !0
|
|
2595
|
+
}),
|
|
2596
|
+
style: b({
|
|
2597
|
+
background: s.isBulletTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2598
|
+
border: s.isBulletTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2599
|
+
color: s.isBulletTextMode ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2600
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2601
|
+
}),
|
|
2602
|
+
onClick: o[110] || (o[110] = (i) => {
|
|
2603
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.isBulletTextMode = !s.isBulletTextMode, s.textAlign = "start", t.setSelectedTextAlignTo("start"), t.setCurrentStyleOfSelectedText();
|
|
2604
|
+
}),
|
|
2605
|
+
onMouseenter: o[111] || (o[111] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setBulletMode", i, "top")),
|
|
2606
|
+
onMouseleave: o[112] || (o[112] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2607
|
+
onFocus: o[113] || (o[113] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setBulletMode", i, "top")),
|
|
2608
|
+
onBlur: o[114] || (o[114] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2609
|
+
}, [
|
|
2610
|
+
o[166] || (o[166] = n("svg", {
|
|
2611
|
+
width: "100%",
|
|
2612
|
+
viewBox: "0 0 24 24",
|
|
2613
|
+
"stroke-width": "2",
|
|
2614
|
+
stroke: "currentColor",
|
|
2615
|
+
fill: "none",
|
|
2616
|
+
"stroke-linecap": "round",
|
|
2617
|
+
"stroke-linejoin": "round"
|
|
2618
|
+
}, [
|
|
2619
|
+
n("path", {
|
|
2620
|
+
stroke: "none",
|
|
2621
|
+
d: "M0 0h24v24H0z",
|
|
2622
|
+
fill: "none"
|
|
2623
|
+
}),
|
|
2624
|
+
n("path", { d: "M9 6l11 0" }),
|
|
2625
|
+
n("path", { d: "M9 12l11 0" }),
|
|
2626
|
+
n("path", { d: "M9 18l11 0" }),
|
|
2627
|
+
n("path", { d: "M5 6l0 .01" }),
|
|
2628
|
+
n("path", { d: "M5 12l0 .01" }),
|
|
2629
|
+
n("path", { d: "M5 18l0 .01" })
|
|
2630
|
+
], -1)),
|
|
2631
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2632
|
+
key: 0,
|
|
2633
|
+
show: s.showTooltip && s.tooltipKey === "setBulletMode",
|
|
2634
|
+
x: s.tooltipPos.x,
|
|
2635
|
+
y: s.tooltipPos.y - 6,
|
|
2636
|
+
placement: "top",
|
|
2637
|
+
styleObject: t.tooltipStyleObject
|
|
2638
|
+
}, {
|
|
2639
|
+
default: N(() => [
|
|
2640
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextBullet), 1)
|
|
2641
|
+
]),
|
|
2642
|
+
_: 1
|
|
2643
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2644
|
+
], 38)
|
|
2645
|
+
])) : a("", !0),
|
|
2646
|
+
s.isTextMode ? (c(), p("div", Je, [
|
|
2647
|
+
n("button", {
|
|
2648
|
+
class: g({
|
|
2649
|
+
"button-tool": !0,
|
|
2650
|
+
"button-tool--selected": s.isBold,
|
|
2651
|
+
tooltip: !0
|
|
2652
|
+
}),
|
|
2653
|
+
style: b({
|
|
2654
|
+
background: s.isBold ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2655
|
+
border: s.isBold ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2656
|
+
color: s.isBold ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2657
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2658
|
+
}),
|
|
2659
|
+
onClick: o[115] || (o[115] = (i) => {
|
|
2660
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.isBold = !s.isBold, t.setCurrentStyleOfSelectedText();
|
|
2661
|
+
}),
|
|
2662
|
+
onMouseenter: o[116] || (o[116] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setBold", i, "top")),
|
|
2663
|
+
onMouseleave: o[117] || (o[117] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2664
|
+
onFocus: o[118] || (o[118] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setBold", i, "top")),
|
|
2665
|
+
onBlur: o[119] || (o[119] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2666
|
+
}, [
|
|
2667
|
+
o[167] || (o[167] = n("svg", {
|
|
2668
|
+
width: "100%",
|
|
2669
|
+
viewBox: "0 0 24 24",
|
|
2670
|
+
"stroke-width": "3",
|
|
2671
|
+
stroke: "currentColor",
|
|
2672
|
+
fill: "none",
|
|
2673
|
+
"stroke-linecap": "round",
|
|
2674
|
+
"stroke-linejoin": "round"
|
|
2675
|
+
}, [
|
|
2676
|
+
n("path", {
|
|
2677
|
+
stroke: "none",
|
|
2678
|
+
d: "M0 0h24v24H0z",
|
|
2679
|
+
fill: "none"
|
|
2680
|
+
}),
|
|
2681
|
+
n("path", { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" }),
|
|
2682
|
+
n("path", { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" })
|
|
2683
|
+
], -1)),
|
|
2684
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2685
|
+
key: 0,
|
|
2686
|
+
show: s.showTooltip && s.tooltipKey === "setBold",
|
|
2687
|
+
x: s.tooltipPos.x,
|
|
2688
|
+
y: s.tooltipPos.y - 6,
|
|
2689
|
+
placement: "top",
|
|
2690
|
+
styleObject: t.tooltipStyleObject
|
|
2691
|
+
}, {
|
|
2692
|
+
default: N(() => [
|
|
2693
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextBold), 1)
|
|
2694
|
+
]),
|
|
2695
|
+
_: 1
|
|
2696
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2697
|
+
], 38)
|
|
2698
|
+
])) : a("", !0),
|
|
2699
|
+
s.isTextMode ? (c(), p("div", Ze, [
|
|
2700
|
+
n("button", {
|
|
2701
|
+
class: g({
|
|
2702
|
+
"button-tool": !0,
|
|
2703
|
+
"button-tool--selected": s.isItalic,
|
|
2704
|
+
tooltip: !0
|
|
2705
|
+
}),
|
|
2706
|
+
style: b({
|
|
2707
|
+
background: s.isItalic ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2708
|
+
border: s.isItalic ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2709
|
+
color: s.isItalic ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2710
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2711
|
+
}),
|
|
2712
|
+
onClick: o[120] || (o[120] = (i) => {
|
|
2713
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.isItalic = !s.isItalic, t.setCurrentStyleOfSelectedText();
|
|
2714
|
+
}),
|
|
2715
|
+
onMouseenter: o[121] || (o[121] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setItalic", i, "top")),
|
|
2716
|
+
onMouseleave: o[122] || (o[122] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2717
|
+
onFocus: o[123] || (o[123] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setItalic", i, "top")),
|
|
2718
|
+
onBlur: o[124] || (o[124] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2719
|
+
}, [
|
|
2720
|
+
o[168] || (o[168] = n("svg", {
|
|
2721
|
+
width: "100%",
|
|
2722
|
+
height: "44",
|
|
2723
|
+
viewBox: "0 0 24 24",
|
|
2724
|
+
"stroke-width": "2",
|
|
2725
|
+
stroke: "currentColor",
|
|
2726
|
+
fill: "none",
|
|
2727
|
+
"stroke-linecap": "round",
|
|
2728
|
+
"stroke-linejoin": "round"
|
|
2729
|
+
}, [
|
|
2730
|
+
n("path", {
|
|
2731
|
+
stroke: "none",
|
|
2732
|
+
d: "M0 0h24v24H0z",
|
|
2733
|
+
fill: "none"
|
|
2734
|
+
}),
|
|
2735
|
+
n("path", { d: "M11 5l6 0" }),
|
|
2736
|
+
n("path", { d: "M7 19l6 0" }),
|
|
2737
|
+
n("path", { d: "M14 5l-4 14" })
|
|
2738
|
+
], -1)),
|
|
2739
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2740
|
+
key: 0,
|
|
2741
|
+
show: s.showTooltip && s.tooltipKey === "setItalic",
|
|
2742
|
+
x: s.tooltipPos.x,
|
|
2743
|
+
y: s.tooltipPos.y - 6,
|
|
2744
|
+
placement: "top",
|
|
2745
|
+
styleObject: t.tooltipStyleObject
|
|
2746
|
+
}, {
|
|
2747
|
+
default: N(() => [
|
|
2748
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextItalic), 1)
|
|
2749
|
+
]),
|
|
2750
|
+
_: 1
|
|
2751
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2752
|
+
], 38)
|
|
2753
|
+
])) : a("", !0),
|
|
2754
|
+
s.isTextMode ? (c(), p("div", Qe, [
|
|
2755
|
+
n("button", {
|
|
2756
|
+
class: g({
|
|
2757
|
+
"button-tool": !0,
|
|
2758
|
+
"button-tool--selected": s.isUnderline,
|
|
2759
|
+
tooltip: !0
|
|
2760
|
+
}),
|
|
2761
|
+
style: b({
|
|
2762
|
+
background: s.isUnderline ? t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
|
|
2763
|
+
border: s.isUnderline ? t.FINAL_CONFIG.style.buttons.shapes.selected.border : t.FINAL_CONFIG.style.buttons.shapes.border,
|
|
2764
|
+
color: s.isUnderline ? t.FINAL_CONFIG.style.buttons.shapes.selected.color : t.FINAL_CONFIG.style.buttons.shapes.color,
|
|
2765
|
+
borderRadius: `${t.FINAL_CONFIG.style.buttons.borderRadius}px`
|
|
2766
|
+
}),
|
|
2767
|
+
onClick: o[125] || (o[125] = (i) => {
|
|
2768
|
+
s.isDeleteMode = !1, s.isMoveMode = !1, s.isResizeMode = !1, s.isDrawMode = !1, s.isSelectMode = !1, s.activeShape = void 0, s.isUnderline = !s.isUnderline, t.setCurrentStyleOfSelectedText();
|
|
2769
|
+
}),
|
|
2770
|
+
onMouseenter: o[126] || (o[126] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setUnderline", i, "top")),
|
|
2771
|
+
onMouseleave: o[127] || (o[127] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2772
|
+
onFocus: o[128] || (o[128] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setUnderline", i, "top")),
|
|
2773
|
+
onBlur: o[129] || (o[129] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2774
|
+
}, [
|
|
2775
|
+
o[169] || (o[169] = n("svg", {
|
|
2776
|
+
width: "100%",
|
|
2777
|
+
viewBox: "0 0 24 24",
|
|
2778
|
+
"stroke-width": "2",
|
|
2779
|
+
stroke: "currentColor",
|
|
2780
|
+
fill: "none",
|
|
2781
|
+
"stroke-linecap": "round",
|
|
2782
|
+
"stroke-linejoin": "round"
|
|
2783
|
+
}, [
|
|
2784
|
+
n("path", {
|
|
2785
|
+
stroke: "none",
|
|
2786
|
+
d: "M0 0h24v24H0z",
|
|
2787
|
+
fill: "none"
|
|
2788
|
+
}),
|
|
2789
|
+
n("path", { d: "M7 5v5a5 5 0 0 0 10 0v-5" }),
|
|
2790
|
+
n("path", { d: "M5 19h14" })
|
|
2791
|
+
], -1)),
|
|
2792
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2793
|
+
key: 0,
|
|
2794
|
+
show: s.showTooltip && s.tooltipKey === "setUnderline",
|
|
2795
|
+
x: s.tooltipPos.x,
|
|
2796
|
+
y: s.tooltipPos.y - 6,
|
|
2797
|
+
placement: "top",
|
|
2798
|
+
styleObject: t.tooltipStyleObject
|
|
2799
|
+
}, {
|
|
2800
|
+
default: N(() => [
|
|
2801
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeTextUnderline), 1)
|
|
2802
|
+
]),
|
|
2803
|
+
_: 1
|
|
2804
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2805
|
+
], 38)
|
|
2806
|
+
])) : a("", !0),
|
|
2807
|
+
n("div", $e, [
|
|
2808
|
+
n("button", {
|
|
2809
|
+
class: g({
|
|
2810
|
+
"button-tool": !0,
|
|
2811
|
+
tooltip: !0
|
|
2812
|
+
}),
|
|
2813
|
+
style: {
|
|
2814
|
+
borderRadius: "6px"
|
|
2815
|
+
},
|
|
2816
|
+
onMouseenter: o[131] || (o[131] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setColor", i, "top")),
|
|
2817
|
+
onMouseleave: o[132] || (o[132] = (...i) => t.hideTooltip && t.hideTooltip(...i)),
|
|
2818
|
+
onFocus: o[133] || (o[133] = (i) => t.FINAL_CONFIG.style.showTooltips && t.showToolTipFor("setColor", i, "top")),
|
|
2819
|
+
onBlur: o[134] || (o[134] = (...i) => t.hideTooltip && t.hideTooltip(...i))
|
|
2820
|
+
}, [
|
|
2821
|
+
T(I, {
|
|
2822
|
+
value: s.selectedColor,
|
|
2823
|
+
"onUpdate:value": o[130] || (o[130] = (i) => s.selectedColor = i),
|
|
2824
|
+
backgroundColor: t.FINAL_CONFIG.style.backgroundColor,
|
|
2825
|
+
buttonBorderColor: t.FINAL_CONFIG.style.color,
|
|
2826
|
+
teleported: ""
|
|
2827
|
+
}, null, 8, ["value", "backgroundColor", "buttonBorderColor"])
|
|
2828
|
+
], 32),
|
|
2829
|
+
t.FINAL_CONFIG.style.showTooltips ? (c(), x(u, {
|
|
2830
|
+
key: 0,
|
|
2831
|
+
show: s.showTooltip && s.tooltipKey === "setColor",
|
|
2832
|
+
x: s.tooltipPos.x,
|
|
2833
|
+
y: s.tooltipPos.y - 6,
|
|
2834
|
+
placement: "top",
|
|
2835
|
+
styleObject: t.tooltipStyleObject
|
|
2836
|
+
}, {
|
|
2837
|
+
default: N(() => [
|
|
2838
|
+
F(f(t.FINAL_CONFIG.translations.tooltipShapeColor), 1)
|
|
2839
|
+
]),
|
|
2840
|
+
_: 1
|
|
2841
|
+
}, 8, ["show", "x", "y", "styleObject"])) : a("", !0)
|
|
2842
|
+
]),
|
|
2843
|
+
n("div", et, [
|
|
2844
|
+
n("label", tt, [
|
|
2845
|
+
F(f(t.FINAL_CONFIG.translations.colorAlpha) + ": " + f(s.transparency > 98 ? 100 : s.transparency) + " % ", 1),
|
|
2846
|
+
M(n("input", {
|
|
2847
|
+
name: "colorTransparency",
|
|
2848
|
+
type: "range",
|
|
2849
|
+
"onUpdate:modelValue": o[135] || (o[135] = (i) => s.transparency = i),
|
|
2850
|
+
onInput: o[136] || (o[136] = (...i) => t.setTransparencyOfSelectedShape && t.setTransparencyOfSelectedShape(...i)),
|
|
2851
|
+
min: 0,
|
|
2852
|
+
max: 100,
|
|
2853
|
+
style: b({
|
|
2854
|
+
width: "100%",
|
|
2855
|
+
accentColor: t.FINAL_CONFIG.style.color + " !important"
|
|
2856
|
+
})
|
|
2857
|
+
}, null, 36), [
|
|
2858
|
+
[D, s.transparency]
|
|
2859
|
+
])
|
|
2860
|
+
])
|
|
2861
|
+
])
|
|
2862
|
+
])
|
|
2863
|
+
]),
|
|
2864
|
+
_: 1
|
|
2865
|
+
}, 8, ["config", "onToggle"])
|
|
2866
|
+
]),
|
|
2867
|
+
n("div", {
|
|
2868
|
+
class: "annotator annotator__wrapper",
|
|
2869
|
+
ref: "drawSvgContainer",
|
|
2870
|
+
style: { position: "relative" },
|
|
2871
|
+
id: r.uid,
|
|
2872
|
+
"data-annotator-content": ""
|
|
2873
|
+
}, [
|
|
2874
|
+
n("div", {
|
|
2875
|
+
class: "annotator__content-layer",
|
|
2876
|
+
style: b(`${s.isSummaryOpen ? "pointer-events: none;" : ""}`)
|
|
2877
|
+
}, [
|
|
2878
|
+
B(e.$slots, "default", {}, void 0, !0)
|
|
2879
|
+
], 4),
|
|
2880
|
+
s.isSummaryOpen || t.FINAL_CONFIG.alwaysVisible ? (c(), p("svg", {
|
|
2881
|
+
id: "annotatorSvg",
|
|
2882
|
+
key: s.step,
|
|
2883
|
+
ref: "mainSvg",
|
|
2884
|
+
class: g({ annotator__overlay: !0, draw: !0, "draw--free": s.activeShape === "line" }),
|
|
2885
|
+
viewBox: `0 0 ${s.svgWidth} ${s.svgHeight}`,
|
|
2886
|
+
width: s.sourceWidth,
|
|
2887
|
+
height: s.sourceHeight,
|
|
2888
|
+
onPointerdown: o[142] || (o[142] = (d) => t.chooseAction(d)),
|
|
2889
|
+
onPointerup: o[143] || (o[143] = (d) => t.resetDraw(d)),
|
|
2890
|
+
onTouchend: o[144] || (o[144] = (d) => t.resetDraw(d)),
|
|
2891
|
+
onTouchstart: o[145] || (o[145] = (d) => {
|
|
2892
|
+
t.setPointer(d), t.clickSvg(d);
|
|
2893
|
+
}),
|
|
2894
|
+
onPointermove: o[146] || (o[146] = (d) => {
|
|
2895
|
+
t.setPointer(d), t.chooseMove(d);
|
|
2896
|
+
}),
|
|
2897
|
+
onPointerout: o[147] || (o[147] = (d) => t.onPointerOut(d)),
|
|
2898
|
+
onPointerover: o[148] || (o[148] = (d) => t.allowEditAndHoverShapes(d)),
|
|
2899
|
+
onClick: o[149] || (o[149] = (d) => t.clickSvg(d)),
|
|
2900
|
+
style: b({
|
|
2901
|
+
position: "absolute",
|
|
2902
|
+
top: 0,
|
|
2903
|
+
left: 0,
|
|
2904
|
+
cursor: t.cursorClass,
|
|
2905
|
+
fontFamily: "Helvetica",
|
|
2906
|
+
zIndex: 1e8,
|
|
2907
|
+
pointerEvents: s.isSummaryOpen ? "all" : "none"
|
|
2908
|
+
})
|
|
2909
|
+
}, [
|
|
2910
|
+
n("rect", {
|
|
2911
|
+
class: "annotator__glass",
|
|
2912
|
+
x: "0",
|
|
2913
|
+
y: "0",
|
|
2914
|
+
width: s.svgWidth,
|
|
2915
|
+
height: s.svgHeight,
|
|
2916
|
+
fill: "transparent",
|
|
2917
|
+
"pointer-events": s.isSummaryOpen ? "all" : "none",
|
|
2918
|
+
style: { cursor: "inherit" },
|
|
2919
|
+
onPointerdown: o[137] || (o[137] = A((d) => t.chooseAction(d), ["stop", "prevent"])),
|
|
2920
|
+
onPointermove: o[138] || (o[138] = A((d) => {
|
|
2921
|
+
t.setPointer(d), t.chooseMove(d);
|
|
2922
|
+
}, ["stop", "prevent"])),
|
|
2923
|
+
onPointerup: o[139] || (o[139] = A((...d) => t.resetDraw && t.resetDraw(...d), ["stop", "prevent"])),
|
|
2924
|
+
onClick: o[140] || (o[140] = A(() => {
|
|
2925
|
+
}, ["stop", "prevent"]))
|
|
2926
|
+
}, null, 40, it),
|
|
2927
|
+
(c(!0), p(X, null, Y(t.userShapes, (d) => (c(), p("g", {
|
|
2928
|
+
key: d.id,
|
|
2929
|
+
innerHTML: d.html,
|
|
2930
|
+
onClick: o[141] || (o[141] = (i) => {
|
|
2931
|
+
t.clickShape(i), s.isMoveMode = !1;
|
|
2932
|
+
})
|
|
2933
|
+
}, null, 8, lt))), 128))
|
|
2934
|
+
], 46, st)) : a("", !0),
|
|
2935
|
+
s.isPrinting || r.isImaging ? (c(), p("svg", {
|
|
2936
|
+
key: 1,
|
|
2937
|
+
style: { position: "absolute", top: "0", left: "0" },
|
|
2938
|
+
height: s.sourceHeight,
|
|
2939
|
+
viewBox: `0 0 ${s.svgWidth} ${s.svgHeight}`,
|
|
2940
|
+
width: s.sourceWidth,
|
|
2941
|
+
"data-dom-to-png-ignore": ""
|
|
2942
|
+
}, [
|
|
2943
|
+
n("circle", {
|
|
2944
|
+
class: "animated-circle-print",
|
|
2945
|
+
cx: s.svgWidth / 2,
|
|
2946
|
+
cy: s.svgHeight / 2,
|
|
2947
|
+
r: "50",
|
|
2948
|
+
stroke: "#6376DD",
|
|
2949
|
+
"stroke-width": "10",
|
|
2950
|
+
fill: "none"
|
|
2951
|
+
}, null, 8, nt)
|
|
2952
|
+
], 8, rt)) : a("", !0)
|
|
2953
|
+
], 8, ot)
|
|
2954
|
+
]);
|
|
2955
|
+
}
|
|
2956
|
+
const Nt = /* @__PURE__ */ j(de, [["render", dt], ["__scopeId", "data-v-06580658"]]);
|
|
2957
|
+
export {
|
|
2958
|
+
Nt as default
|
|
2959
|
+
};
|