mce 0.2.3 → 0.2.5
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/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +781 -751
- package/dist/locale/en.d.ts +1 -1
- package/dist/models/Doc.d.ts +1 -0
- package/dist/typed-plugins.d.ts +0 -1
- package/package.json +3 -3
- package/dist/plugins/preference.d.ts +0 -16
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ref as V, computed as
|
|
2
|
-
import { useFileDialog as
|
|
3
|
-
import { Timeline as
|
|
4
|
-
import { getObjectValueByPath as Dn, setObjectValueByPath as Vn, normalizeTextContent as jn, idGenerator as
|
|
5
|
-
import { saveAs as
|
|
1
|
+
import { ref as V, computed as $, watch as pe, markRaw as fe, warn as Lt, shallowRef as Ze, reactive as Ee, nextTick as Re, inject as Se, provide as De, defineComponent as X, createVNode as H, mergeProps as $e, createElementVNode as F, toValue as yn, getCurrentInstance as Qe, onScopeDispose as gn, createElementBlock as R, openBlock as O, Fragment as se, renderList as _e, unref as S, normalizeStyle as q, normalizeClass as be, onBeforeUnmount as we, readonly as bn, toRef as Te, onMounted as He, useId as Dt, onDeactivated as wn, onActivated as xn, useAttrs as Vt, createBlock as oe, resolveDynamicComponent as jt, useTemplateRef as ce, renderSlot as Q, Teleport as _n, createCommentVNode as ee, mergeModels as Oe, useModel as ke, resolveComponent as kn, withCtx as ne, createTextVNode as Cn, toDisplayString as K, createSlots as pt, normalizeProps as vt, guardReactiveProps as yt, withDirectives as ze, vShow as Xe, vModelText as En, withModifiers as Ke, onBeforeMount as gt, isRef as Tn } from "vue";
|
|
2
|
+
import { useFileDialog as Ut, useEventListener as Xt, isClient as An, useResizeObserver as Ht, useLocalStorage as Sn, onClickOutside as Mn, useMouse as zn, useDebounceFn as Yt } from "@vueuse/core";
|
|
3
|
+
import { Timeline as $n, Engine as On, Camera2D as In, DrawboardEffect as Fn, Element2D as G, IN_BROWSER as bt, clamp as Pn, assets as qt, TimelineNode as Nn, Transform2D as Rn, DEG_TO_RAD as Bn, Node as Ct, render as et, Animation as Ln } from "modern-canvas";
|
|
4
|
+
import { getObjectValueByPath as Dn, setObjectValueByPath as Vn, normalizeTextContent as jn, idGenerator as wt, normalizeElement as Gt, Observable as Wt, Reactivable as Un, property as Ye } from "modern-idoc";
|
|
5
|
+
import { saveAs as Kt } from "file-saver";
|
|
6
6
|
import { Fonts as Xn } from "modern-font";
|
|
7
|
-
import { merge as
|
|
8
|
-
import { measureText as
|
|
7
|
+
import { merge as Jt, throttle as Hn, cloneDeep as Yn } from "lodash-es";
|
|
8
|
+
import { measureText as lt } from "modern-text";
|
|
9
9
|
import { TextEditor as qn } from "modern-text/web-components";
|
|
10
|
-
import * as
|
|
10
|
+
import * as le from "yjs";
|
|
11
11
|
import { useFloating as Gn, offset as Wn, flip as Kn, shift as Jn, autoUpdate as Zn } from "@floating-ui/vue";
|
|
12
|
-
import { vResizeObserver as
|
|
12
|
+
import { vResizeObserver as Zt, vOnLongPress as Qn } from "@vueuse/components";
|
|
13
13
|
const eo = (o) => {
|
|
14
14
|
const {
|
|
15
15
|
emit: e
|
|
@@ -43,7 +43,7 @@ const eo = (o) => {
|
|
|
43
43
|
Vn(e.value, c, u);
|
|
44
44
|
}
|
|
45
45
|
function s(c) {
|
|
46
|
-
return
|
|
46
|
+
return $({
|
|
47
47
|
get: () => t(c),
|
|
48
48
|
set: (u) => n(c, u)
|
|
49
49
|
});
|
|
@@ -54,7 +54,7 @@ const eo = (o) => {
|
|
|
54
54
|
}
|
|
55
55
|
function r() {
|
|
56
56
|
return new Promise((c) => {
|
|
57
|
-
const { onChange: u, open: d } =
|
|
57
|
+
const { onChange: u, open: d } = Ut({
|
|
58
58
|
accept: ".json",
|
|
59
59
|
reset: !0,
|
|
60
60
|
multiple: !1
|
|
@@ -69,7 +69,7 @@ const eo = (o) => {
|
|
|
69
69
|
return new Blob([JSON.stringify(e.value)], { type: "application/json" });
|
|
70
70
|
}
|
|
71
71
|
function l(c = "settings.json") {
|
|
72
|
-
|
|
72
|
+
Kt(
|
|
73
73
|
i(),
|
|
74
74
|
c
|
|
75
75
|
);
|
|
@@ -114,7 +114,7 @@ const eo = (o) => {
|
|
|
114
114
|
}, oo = (o) => {
|
|
115
115
|
const {
|
|
116
116
|
emit: e
|
|
117
|
-
} = o, t = fe(new Xn()), n = V(new
|
|
117
|
+
} = o, t = fe(new Xn()), n = V(new $n({ startTime: 0, endTime: 0, loop: !0, paused: !0 })), s = new On({
|
|
118
118
|
pixelRatio: 2,
|
|
119
119
|
fonts: t,
|
|
120
120
|
timeline: n.value,
|
|
@@ -126,9 +126,9 @@ const eo = (o) => {
|
|
|
126
126
|
s.root.append(a.value), s.root.append(r.value);
|
|
127
127
|
const i = V(s);
|
|
128
128
|
i.value.start();
|
|
129
|
-
const l = V(), c = V({ left: 0, top: 0, width: 0, height: 0 }), u = V(), d = V(), g =
|
|
130
|
-
function f(z,
|
|
131
|
-
switch (v.value = z, y.value =
|
|
129
|
+
const l = V(), c = V({ left: 0, top: 0, width: 0, height: 0 }), u = V(), d = V(), g = $(() => d.value?.root), h = V(), v = V(), y = V();
|
|
130
|
+
function f(z, I) {
|
|
131
|
+
switch (v.value = z, y.value = I, z) {
|
|
132
132
|
case "drawing":
|
|
133
133
|
p("crosshair");
|
|
134
134
|
break;
|
|
@@ -139,10 +139,10 @@ const eo = (o) => {
|
|
|
139
139
|
i.value.input.setCursor(z);
|
|
140
140
|
}
|
|
141
141
|
function _() {
|
|
142
|
-
const { x: z = 0, y:
|
|
142
|
+
const { x: z = 0, y: I = 0 } = h.value ?? {};
|
|
143
143
|
return a.value.toGlobal({
|
|
144
144
|
x: z - c.value.left,
|
|
145
|
-
y:
|
|
145
|
+
y: I - c.value.top
|
|
146
146
|
}, { x: 0, y: 0 });
|
|
147
147
|
}
|
|
148
148
|
Object.assign(o, {
|
|
@@ -231,7 +231,6 @@ const eo = (o) => {
|
|
|
231
231
|
file: "File",
|
|
232
232
|
new: "New",
|
|
233
233
|
open: "Open",
|
|
234
|
-
preferences: "Preferences",
|
|
235
234
|
import: "Import",
|
|
236
235
|
export: "Export",
|
|
237
236
|
"saveAs:png": "Save as PNG",
|
|
@@ -289,16 +288,17 @@ const eo = (o) => {
|
|
|
289
288
|
alignRight: "Align right",
|
|
290
289
|
alignTop: "Align top",
|
|
291
290
|
alignVerticalCenter: "Align vertical center",
|
|
292
|
-
alignBottom: "Align bottom"
|
|
291
|
+
alignBottom: "Align bottom",
|
|
292
|
+
exporting: "Exporting"
|
|
293
293
|
}, ro = (o, e) => {
|
|
294
294
|
const {
|
|
295
295
|
locale: t
|
|
296
|
-
} = e, n =
|
|
296
|
+
} = e, n = $(() => {
|
|
297
297
|
const {
|
|
298
298
|
locale: a,
|
|
299
299
|
fallback: r,
|
|
300
300
|
messages: i = {}
|
|
301
|
-
} =
|
|
301
|
+
} = Jt({
|
|
302
302
|
locale: "en",
|
|
303
303
|
fallback: "en",
|
|
304
304
|
messages: {
|
|
@@ -322,7 +322,7 @@ const eo = (o) => {
|
|
|
322
322
|
const {
|
|
323
323
|
root: e,
|
|
324
324
|
getAncestor: t
|
|
325
|
-
} = o, n =
|
|
325
|
+
} = o, n = $(() => e.value?.children.filter(l) ?? []), s = V(-1), a = $(() => n.value[s.value]), r = $(() => {
|
|
326
326
|
const { left: u = 0, top: d = 0, width: g = 0, height: h = 0 } = a.value?.style ?? {};
|
|
327
327
|
return { left: u, top: d, width: g, height: h };
|
|
328
328
|
}), i = V([]);
|
|
@@ -359,7 +359,7 @@ function Me(o) {
|
|
|
359
359
|
};
|
|
360
360
|
return o.rotate && (e.transform = `rotate(${o.rotate}deg)`), e;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Et(o, e) {
|
|
363
363
|
const t = e.left + e.width, n = e.top + e.height;
|
|
364
364
|
return o.x >= e.left && o.x <= t && o.y >= e.top && o.y <= n;
|
|
365
365
|
}
|
|
@@ -394,7 +394,7 @@ function co(o, e) {
|
|
|
394
394
|
return !0;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Zi(o) {
|
|
398
398
|
if (o.length < 2)
|
|
399
399
|
return {
|
|
400
400
|
left: o[0]?.left ?? 0,
|
|
@@ -414,12 +414,12 @@ function Qi(o) {
|
|
|
414
414
|
return { left: e.x1, top: e.y1, width: e.x2 - e.x1, height: e.y2 - e.y1 };
|
|
415
415
|
}
|
|
416
416
|
function uo(o) {
|
|
417
|
-
|
|
417
|
+
Lt(`mce: ${o}`);
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
419
|
+
function Qi(o) {
|
|
420
|
+
Lt(`mce error: ${o}`);
|
|
421
421
|
}
|
|
422
|
-
const
|
|
422
|
+
const Tt = bt && window.navigator && "clipboard" in navigator, Qt = bt ? window.navigator?.userAgent : "", Fe = /Macintosh|Mac OS X/i.test(Qt), mo = /Windows/i.test(Qt);
|
|
423
423
|
function ho(o, e = {}) {
|
|
424
424
|
const { useCrossOrigin: t = !1, timeout: n } = e;
|
|
425
425
|
return new Promise((s, a) => {
|
|
@@ -452,11 +452,11 @@ const fo = {
|
|
|
452
452
|
"image/heif": [".heif"],
|
|
453
453
|
"image/heic": [".heic"],
|
|
454
454
|
"image/avif": [".avif"]
|
|
455
|
-
},
|
|
456
|
-
function
|
|
457
|
-
const t =
|
|
455
|
+
}, en = Object.values(fo).flat(), ct = new RegExp(`\\.(?:${en.map((o) => o.substring(1)).join("|")})`, "i");
|
|
456
|
+
function ut(o, e) {
|
|
457
|
+
const t = lt({ style: e, content: o }).boundingBox;
|
|
458
458
|
return {
|
|
459
|
-
id:
|
|
459
|
+
id: wt(),
|
|
460
460
|
style: {
|
|
461
461
|
...e,
|
|
462
462
|
width: t.width,
|
|
@@ -466,9 +466,9 @@ function lt(o, e) {
|
|
|
466
466
|
meta: { inPptIs: "Shape" }
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
async function
|
|
469
|
+
async function dt(o) {
|
|
470
470
|
return {
|
|
471
|
-
id:
|
|
471
|
+
id: wt(),
|
|
472
472
|
style: {
|
|
473
473
|
...await ho(o)
|
|
474
474
|
},
|
|
@@ -487,14 +487,14 @@ function vo(o) {
|
|
|
487
487
|
}
|
|
488
488
|
return o;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Ge(o, e = "px") {
|
|
491
491
|
if (o == null || o === "")
|
|
492
492
|
return;
|
|
493
493
|
const t = Number(o);
|
|
494
494
|
return Number.isNaN(t) ? String(o) : Number.isFinite(t) ? `${t}${e}` : void 0;
|
|
495
495
|
}
|
|
496
496
|
function yo() {
|
|
497
|
-
const o =
|
|
497
|
+
const o = Ze(), e = (t) => {
|
|
498
498
|
o.value = t;
|
|
499
499
|
};
|
|
500
500
|
return Object.defineProperty(e, "value", {
|
|
@@ -533,7 +533,7 @@ function tn(o, e) {
|
|
|
533
533
|
}, {});
|
|
534
534
|
}
|
|
535
535
|
const go = crypto.getRandomValues.bind(crypto), bo = () => go(new Uint32Array(1))[0], wo = "10000000-1000-4000-8000" + -1e11;
|
|
536
|
-
function
|
|
536
|
+
function er() {
|
|
537
537
|
return wo.replace(/[018]/g, (o) => (o ^ bo() & 15 >> o / 4).toString(16));
|
|
538
538
|
}
|
|
539
539
|
const xo = [
|
|
@@ -602,18 +602,18 @@ const ko = (o) => {
|
|
|
602
602
|
return u ? c = Array.isArray(u.key) ? u.key : [u.key] : c = [l], c[0].split("+").map((d) => {
|
|
603
603
|
switch (d) {
|
|
604
604
|
case "Control":
|
|
605
|
-
return
|
|
605
|
+
return Fe ? "⌃" : "Ctrl";
|
|
606
606
|
case "Ctrl":
|
|
607
|
-
return
|
|
607
|
+
return Fe ? "⌃" : "Ctrl";
|
|
608
608
|
case "Command":
|
|
609
|
-
return
|
|
609
|
+
return Fe ? "⌘" : mo ? "Win" : "Super";
|
|
610
610
|
case "Alt":
|
|
611
|
-
return
|
|
611
|
+
return Fe ? "⌥" : "Alt";
|
|
612
612
|
case "Shift":
|
|
613
|
-
return
|
|
613
|
+
return Fe ? "⇧" : "Shift";
|
|
614
614
|
case "CommandOrControl":
|
|
615
615
|
case "CmdOrCtrl":
|
|
616
|
-
return
|
|
616
|
+
return Fe ? "⌘" : "Ctrl";
|
|
617
617
|
default:
|
|
618
618
|
return r[d] ?? d.charAt(0).toUpperCase() + d.slice(1);
|
|
619
619
|
}
|
|
@@ -629,7 +629,7 @@ const ko = (o) => {
|
|
|
629
629
|
const {
|
|
630
630
|
exec: l
|
|
631
631
|
} = o;
|
|
632
|
-
|
|
632
|
+
Xt(
|
|
633
633
|
An ? window : void 0,
|
|
634
634
|
"keydown",
|
|
635
635
|
(c) => {
|
|
@@ -666,13 +666,13 @@ const ko = (o) => {
|
|
|
666
666
|
root: e,
|
|
667
667
|
timeline: t,
|
|
668
668
|
renderEngine: n
|
|
669
|
-
} = o, s = V(10), a =
|
|
669
|
+
} = o, s = V(10), a = $({
|
|
670
670
|
get: () => t.value.currentTime,
|
|
671
671
|
set: (c) => {
|
|
672
672
|
const { startTime: u, endTime: d } = t.value;
|
|
673
673
|
t.value.currentTime = Pn(c, u, d);
|
|
674
674
|
}
|
|
675
|
-
}), r =
|
|
675
|
+
}), r = $(() => t.value.startTime), i = $(() => t.value.endTime), l = (c) => {
|
|
676
676
|
const u = { startTime: 0, endTime: 0 };
|
|
677
677
|
function d(h) {
|
|
678
678
|
return h instanceof Nn && (u.startTime = Math.min(u.startTime, h.globalStartTime), u.endTime = Math.max(u.endTime, h.globalEndTime)), h instanceof G && (h.background.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.background.animatedTexture.duration)), h.foreground.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.foreground.animatedTexture.duration)), h.fill.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.fill.animatedTexture.duration)), h.outline.animatedTexture && (u.endTime = Math.max(u.endTime, h.globalStartTime + h.outline.animatedTexture.duration))), !1;
|
|
@@ -692,14 +692,14 @@ const ko = (o) => {
|
|
|
692
692
|
async function u() {
|
|
693
693
|
await n.value.nextTick(), t.value.endTime = e.value ? l(e.value).endTime : 0;
|
|
694
694
|
}
|
|
695
|
-
|
|
695
|
+
qt.on("loaded", u), c("setDoc", u);
|
|
696
696
|
};
|
|
697
697
|
}, Eo = (o, e) => {
|
|
698
698
|
Object.assign(o, {
|
|
699
699
|
upload: async (n) => e.upload ? await e.upload(n) : URL.createObjectURL(n)
|
|
700
700
|
});
|
|
701
701
|
};
|
|
702
|
-
function
|
|
702
|
+
function At(...o) {
|
|
703
703
|
}
|
|
704
704
|
const To = (o) => {
|
|
705
705
|
const {
|
|
@@ -733,9 +733,9 @@ const To = (o) => {
|
|
|
733
733
|
}), h.style.left += f.left, h.style.top += f.top, h.style.width = f.width, h.style.height = f.height, h.updateGlobalTransform(), h.children.forEach((_, z) => {
|
|
734
734
|
if (_ instanceof G) {
|
|
735
735
|
_.updateGlobalTransform();
|
|
736
|
-
const
|
|
737
|
-
x:
|
|
738
|
-
y:
|
|
736
|
+
const I = p[z], E = _.toLocal({
|
|
737
|
+
x: I.left + I.width / 2,
|
|
738
|
+
y: I.top + I.height / 2
|
|
739
739
|
}), C = _.pivot, m = _.style, b = [
|
|
740
740
|
E.x - C.x,
|
|
741
741
|
E.y - C.y
|
|
@@ -751,7 +751,7 @@ const To = (o) => {
|
|
|
751
751
|
h.length === 1 ? y = r(h[0]) : y = { ...l(h), rotate: 0 };
|
|
752
752
|
else if (h instanceof G) {
|
|
753
753
|
const f = h.style;
|
|
754
|
-
|
|
754
|
+
At([f.left, f.top, f.width, f.height, f.rotate]);
|
|
755
755
|
const { rect: p, rotation: _ } = h.getGlobalObb();
|
|
756
756
|
y = {
|
|
757
757
|
left: p.left,
|
|
@@ -803,7 +803,7 @@ const To = (o) => {
|
|
|
803
803
|
}
|
|
804
804
|
else if (h instanceof G) {
|
|
805
805
|
const f = h.style;
|
|
806
|
-
|
|
806
|
+
At([f.left, f.top, f.width, f.height, f.rotate]);
|
|
807
807
|
const p = h.getGlobalAabb();
|
|
808
808
|
y = {
|
|
809
809
|
left: p.left,
|
|
@@ -831,7 +831,7 @@ const To = (o) => {
|
|
|
831
831
|
const v = { ...h }, y = e.value.zoom, f = e.value.position;
|
|
832
832
|
return v.left *= y.x, v.top *= y.y, v.width *= y.x, v.height *= y.y, v.left += f.x, v.top += f.y, v;
|
|
833
833
|
}
|
|
834
|
-
const d =
|
|
834
|
+
const d = $(() => l(t.value?.children ?? [])), g = $(() => l(n.value));
|
|
835
835
|
Object.assign(o, {
|
|
836
836
|
obbToFit: a,
|
|
837
837
|
getObb: r,
|
|
@@ -940,7 +940,7 @@ const To = (o) => {
|
|
|
940
940
|
const u = [];
|
|
941
941
|
for (const v of t.value.values())
|
|
942
942
|
v.accept && u.push(v.accept);
|
|
943
|
-
const d = u.join(","), { onChange: g, open: h } =
|
|
943
|
+
const d = u.join(","), { onChange: g, open: h } = Ut({
|
|
944
944
|
accept: d,
|
|
945
945
|
reset: !0,
|
|
946
946
|
multiple: l
|
|
@@ -962,13 +962,13 @@ const To = (o) => {
|
|
|
962
962
|
return "version" in s && "elements" in s && console.log(s), s;
|
|
963
963
|
}
|
|
964
964
|
});
|
|
965
|
-
},
|
|
965
|
+
}, $o = (o) => {
|
|
966
966
|
const {
|
|
967
967
|
renderEngine: e,
|
|
968
968
|
rootAabb: t,
|
|
969
969
|
currentFrameAabb: n,
|
|
970
970
|
config: s
|
|
971
|
-
} = o, a =
|
|
971
|
+
} = o, a = $(() => s.value.viewMode === "frame" ? n.value : t.value);
|
|
972
972
|
function r(i, l) {
|
|
973
973
|
function c() {
|
|
974
974
|
const g = e.value.view;
|
|
@@ -1009,7 +1009,7 @@ const To = (o) => {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
pe(() => s.value.viewMode, d), c("setCurrentFrame", d), c("setDoc", d);
|
|
1011
1011
|
};
|
|
1012
|
-
},
|
|
1012
|
+
}, Oo = (o) => {
|
|
1013
1013
|
const {
|
|
1014
1014
|
config: e
|
|
1015
1015
|
} = o;
|
|
@@ -1025,7 +1025,7 @@ const To = (o) => {
|
|
|
1025
1025
|
u,
|
|
1026
1026
|
{ ...f.parent.style },
|
|
1027
1027
|
{ ...f.parent.parent.style }
|
|
1028
|
-
), f.content)).join(""), { boundingBox: g } =
|
|
1028
|
+
), f.content)).join(""), { boundingBox: g } = lt({
|
|
1029
1029
|
style: {
|
|
1030
1030
|
...r.style.toJSON(),
|
|
1031
1031
|
width: "auto"
|
|
@@ -1069,7 +1069,7 @@ const To = (o) => {
|
|
|
1069
1069
|
c.height = "auto";
|
|
1070
1070
|
break;
|
|
1071
1071
|
}
|
|
1072
|
-
const { boundingBox: u } =
|
|
1072
|
+
const { boundingBox: u } = lt({
|
|
1073
1073
|
style: c,
|
|
1074
1074
|
content: l.text.content
|
|
1075
1075
|
});
|
|
@@ -1140,20 +1140,20 @@ const To = (o) => {
|
|
|
1140
1140
|
const W = (j ? b : [b]).map((he) => {
|
|
1141
1141
|
const Y = e.value.addElement(he, { parentId: x?.id, regenId: A });
|
|
1142
1142
|
if (x) {
|
|
1143
|
-
const { width: xe, height:
|
|
1143
|
+
const { width: xe, height: ae } = x.style, ve = xe / 2, ye = ae / 2;
|
|
1144
1144
|
if (Y.style.width || (Y.style.width = ve), Y.style.height || (Y.style.height = ye), T) {
|
|
1145
|
-
const J = Y.style.width / Y.style.height, me = J > 1 ? ve : ye * J,
|
|
1145
|
+
const J = Y.style.width / Y.style.height, me = J > 1 ? ve : ye * J, ue = J > 1 ? ve / J : ye;
|
|
1146
1146
|
E(
|
|
1147
1147
|
Y,
|
|
1148
1148
|
me / Y.style.width,
|
|
1149
|
-
|
|
1149
|
+
ue / Y.style.height,
|
|
1150
1150
|
{
|
|
1151
1151
|
deep: !0,
|
|
1152
1152
|
textFontSizeToFit: !0
|
|
1153
1153
|
}
|
|
1154
1154
|
);
|
|
1155
1155
|
}
|
|
1156
|
-
w && (Y.style.left = Math.round(xe - Y.style.width) / 2, Y.style.top = Math.round(
|
|
1156
|
+
w && (Y.style.left = Math.round(xe - Y.style.width) / 2, Y.style.top = Math.round(ae - Y.style.height) / 2);
|
|
1157
1157
|
} else
|
|
1158
1158
|
w && (Y.style.top = Math.round(N), Y.style.left = Math.round(L), N += Y.style.height + g.value.frameGap);
|
|
1159
1159
|
return Y;
|
|
@@ -1175,9 +1175,9 @@ const To = (o) => {
|
|
|
1175
1175
|
b === f.value[0]?.id && (f.value = []), e.value?.deleteElement(b);
|
|
1176
1176
|
}
|
|
1177
1177
|
function z(b, k) {
|
|
1178
|
-
|
|
1178
|
+
I(b)?.setProperties(k);
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function I(b) {
|
|
1181
1181
|
return e.value?.nodeMap?.get(b);
|
|
1182
1182
|
}
|
|
1183
1183
|
function E(b, k, x, w = {}) {
|
|
@@ -1209,7 +1209,7 @@ const To = (o) => {
|
|
|
1209
1209
|
addElement: p,
|
|
1210
1210
|
deleteElement: _,
|
|
1211
1211
|
updateElement: z,
|
|
1212
|
-
getElement:
|
|
1212
|
+
getElement: I,
|
|
1213
1213
|
resizeElement: E,
|
|
1214
1214
|
pointerActivateElement: C,
|
|
1215
1215
|
selectArea: m
|
|
@@ -1227,7 +1227,7 @@ const To = (o) => {
|
|
|
1227
1227
|
config: c
|
|
1228
1228
|
} = o;
|
|
1229
1229
|
function u(y = {}, f) {
|
|
1230
|
-
const p =
|
|
1230
|
+
const p = Gt({
|
|
1231
1231
|
...y,
|
|
1232
1232
|
id: void 0,
|
|
1233
1233
|
name: "Frame",
|
|
@@ -1274,7 +1274,7 @@ const To = (o) => {
|
|
|
1274
1274
|
setCurrentFrame: v
|
|
1275
1275
|
});
|
|
1276
1276
|
};
|
|
1277
|
-
function
|
|
1277
|
+
function Ie(o) {
|
|
1278
1278
|
return new Promise((e, t) => {
|
|
1279
1279
|
o.onerror = (n) => t(new Error(n.target.error)), o.onsuccess = (n) => e(n.target.result);
|
|
1280
1280
|
});
|
|
@@ -1291,7 +1291,7 @@ function No(o, e) {
|
|
|
1291
1291
|
});
|
|
1292
1292
|
}
|
|
1293
1293
|
function Ro(o) {
|
|
1294
|
-
return
|
|
1294
|
+
return Ie(indexedDB.deleteDatabase(o));
|
|
1295
1295
|
}
|
|
1296
1296
|
function Bo(o, e) {
|
|
1297
1297
|
return e.forEach((t) => o.createObjectStore.apply(o, t));
|
|
@@ -1301,22 +1301,22 @@ function Ue(o, e, t = "readwrite") {
|
|
|
1301
1301
|
return e.map((s) => Yo(n, s));
|
|
1302
1302
|
}
|
|
1303
1303
|
function nn(o, e) {
|
|
1304
|
-
return
|
|
1304
|
+
return Ie(o.count(e));
|
|
1305
1305
|
}
|
|
1306
1306
|
function Lo(o, e) {
|
|
1307
|
-
return
|
|
1307
|
+
return Ie(o.get(e));
|
|
1308
1308
|
}
|
|
1309
1309
|
function on(o, e) {
|
|
1310
|
-
return
|
|
1310
|
+
return Ie(o.delete(e));
|
|
1311
1311
|
}
|
|
1312
1312
|
function Do(o, e, t) {
|
|
1313
|
-
return
|
|
1313
|
+
return Ie(o.put(e, t));
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
return
|
|
1315
|
+
function mt(o, e) {
|
|
1316
|
+
return Ie(o.add(e));
|
|
1317
1317
|
}
|
|
1318
1318
|
function Vo(o, e, t) {
|
|
1319
|
-
return
|
|
1319
|
+
return Ie(o.getAll(e, t));
|
|
1320
1320
|
}
|
|
1321
1321
|
function jo(o, e, t) {
|
|
1322
1322
|
let n = null;
|
|
@@ -1355,15 +1355,15 @@ function qo(o, e) {
|
|
|
1355
1355
|
function Go(o, e) {
|
|
1356
1356
|
return IDBKeyRange.lowerBound(o, e);
|
|
1357
1357
|
}
|
|
1358
|
-
const
|
|
1358
|
+
const at = "custom", sn = "updates", an = 500;
|
|
1359
1359
|
function rn(o, e, t) {
|
|
1360
1360
|
const [n] = Ue(
|
|
1361
1361
|
o.db,
|
|
1362
1362
|
[sn]
|
|
1363
1363
|
), s = Go(o._dbref, !1);
|
|
1364
1364
|
return Vo(n, s).then((a) => {
|
|
1365
|
-
o._destroyed || (e?.(n),
|
|
1366
|
-
a.forEach((r) =>
|
|
1365
|
+
o._destroyed || (e?.(n), le.transact(o.doc, () => {
|
|
1366
|
+
a.forEach((r) => le.applyUpdate(o.doc, r));
|
|
1367
1367
|
}, o, !1), t?.(n));
|
|
1368
1368
|
}).then(() => Uo(n).then((a) => {
|
|
1369
1369
|
o._dbref = a + 1;
|
|
@@ -1373,7 +1373,7 @@ function rn(o, e, t) {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
function Wo(o, e = !0) {
|
|
1375
1375
|
return rn(o).then((t) => {
|
|
1376
|
-
(e || o._dbsize >= an) &&
|
|
1376
|
+
(e || o._dbsize >= an) && mt(t, le.encodeStateAsUpdate(o.doc)).then(() => on(
|
|
1377
1377
|
t,
|
|
1378
1378
|
qo(o._dbref, !0)
|
|
1379
1379
|
)).then(() => nn(t).then((n) => {
|
|
@@ -1381,7 +1381,7 @@ function Wo(o, e = !0) {
|
|
|
1381
1381
|
}));
|
|
1382
1382
|
});
|
|
1383
1383
|
}
|
|
1384
|
-
class Ko extends
|
|
1384
|
+
class Ko extends Wt {
|
|
1385
1385
|
constructor(e, t) {
|
|
1386
1386
|
super(), this.name = e, this.doc = t, this._db = No(e, (n) => {
|
|
1387
1387
|
Bo(n, [
|
|
@@ -1391,7 +1391,7 @@ class Ko extends Gt {
|
|
|
1391
1391
|
}), this.whenSynced = new Promise((n) => this.on("synced", () => n(this))), this._db.then((n) => {
|
|
1392
1392
|
this.db = n, rn(
|
|
1393
1393
|
this,
|
|
1394
|
-
(s) =>
|
|
1394
|
+
(s) => mt(s, le.encodeStateAsUpdate(t)),
|
|
1395
1395
|
() => {
|
|
1396
1396
|
this._destroyed || (this.synced = !0, this.emit("synced", this));
|
|
1397
1397
|
}
|
|
@@ -1399,7 +1399,7 @@ class Ko extends Gt {
|
|
|
1399
1399
|
}), this._storeUpdate = (n, s) => {
|
|
1400
1400
|
if (this.db && s !== this) {
|
|
1401
1401
|
const [a] = Ue(this.db, [sn]);
|
|
1402
|
-
|
|
1402
|
+
mt(a, n), ++this._dbsize >= an && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
|
|
1403
1403
|
Wo(this, !1), this._storeTimeoutId = null;
|
|
1404
1404
|
}, this._storeTimeout));
|
|
1405
1405
|
}
|
|
@@ -1427,26 +1427,26 @@ class Ko extends Gt {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
get(e) {
|
|
1429
1429
|
return this._db.then((t) => {
|
|
1430
|
-
const [n] = Ue(t, [
|
|
1430
|
+
const [n] = Ue(t, [at], "readonly");
|
|
1431
1431
|
return Lo(n, e);
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
1434
|
set(e, t) {
|
|
1435
1435
|
return this._db.then((n) => {
|
|
1436
|
-
const [s] = Ue(n, [
|
|
1436
|
+
const [s] = Ue(n, [at]);
|
|
1437
1437
|
return Do(s, t, e);
|
|
1438
1438
|
});
|
|
1439
1439
|
}
|
|
1440
1440
|
del(e) {
|
|
1441
1441
|
return this._db.then((t) => {
|
|
1442
|
-
const [n] = Ue(t, [
|
|
1442
|
+
const [n] = Ue(t, [at]);
|
|
1443
1443
|
return on(n, e);
|
|
1444
1444
|
});
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
1447
|
class ln extends Un {
|
|
1448
|
-
constructor(e =
|
|
1449
|
-
super(), this.id = e, this._yDoc = fe(new
|
|
1448
|
+
constructor(e = wt()) {
|
|
1449
|
+
super(), this.id = e, this._yDoc = fe(new le.Doc({ guid: this.id })), this._yDoc.on("update", (...t) => this.emit("update", ...t)), this._yProps = fe(this._yDoc.getMap("props")), this._propertyAccessor = {
|
|
1450
1450
|
getProperty: (t) => this._yProps.doc ? this._yProps.get(t) : void 0,
|
|
1451
1451
|
setProperty: (t, n) => {
|
|
1452
1452
|
this.transact(() => this._yProps.set(t, n));
|
|
@@ -1459,7 +1459,7 @@ class ln extends Un {
|
|
|
1459
1459
|
indexeddb;
|
|
1460
1460
|
_ready = !1;
|
|
1461
1461
|
_setupUndoManager(e = []) {
|
|
1462
|
-
const t = fe(new
|
|
1462
|
+
const t = fe(new le.UndoManager([
|
|
1463
1463
|
this._yProps,
|
|
1464
1464
|
...e
|
|
1465
1465
|
], {
|
|
@@ -1521,23 +1521,23 @@ var Jo = Object.defineProperty, Zo = (o, e, t, n) => {
|
|
|
1521
1521
|
return s && Jo(e, t, s), s;
|
|
1522
1522
|
};
|
|
1523
1523
|
function Qo(o, e = {}, t, n = !1) {
|
|
1524
|
-
const s =
|
|
1524
|
+
const s = Gt({
|
|
1525
1525
|
...e,
|
|
1526
1526
|
id: n ? void 0 : e.id,
|
|
1527
1527
|
meta: {
|
|
1528
1528
|
inCanvasIs: "Element2D",
|
|
1529
1529
|
...e?.meta ?? {}
|
|
1530
1530
|
}
|
|
1531
|
-
}), a = s.id, r = new
|
|
1531
|
+
}), a = s.id, r = new le.Array();
|
|
1532
1532
|
for (const i in s)
|
|
1533
1533
|
o.set(i, s[i]);
|
|
1534
|
-
return o.set("id", a), o.set("parentId", t), o.set("name", s.name ?? a), o.set("childrenIds", r), o.set("meta", new
|
|
1534
|
+
return o.set("id", a), o.set("parentId", t), o.set("name", s.name ?? a), o.set("childrenIds", r), o.set("meta", new le.Map(Object.entries(s.meta ?? {}))), s?.meta?.inCanvasIs === "Element2D" && (o.set("style", new le.Map(Object.entries(s.style ?? {}))), o.set("background", new le.Map(Object.entries(s.background ?? {}))), o.set("shape", new le.Map(Object.entries(s.shape ?? {}))), o.set("fill", new le.Map(Object.entries(s.fill ?? {}))), o.set("outline", new le.Map(Object.entries(s.outline ?? {}))), o.set("text", new le.Map(Object.entries(s.text ?? {}))), o.set("foreground", new le.Map(Object.entries(s.foreground ?? {}))), o.set("shadow", new le.Map(Object.entries(s.shadow ?? {})))), {
|
|
1535
1535
|
normalized: s,
|
|
1536
1536
|
yChildrenIds: r
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
1539
|
function cn(o, e, t = !1) {
|
|
1540
|
-
const n = [], s = new
|
|
1540
|
+
const n = [], s = new le.Map(), { normalized: a, yChildrenIds: r } = Qo(s, o, e, t), i = a.id;
|
|
1541
1541
|
return n.push({ id: i, element: s }), a.children?.forEach((l) => {
|
|
1542
1542
|
const c = cn(l, i, t);
|
|
1543
1543
|
r.push([c[0].id]), n.push(...c);
|
|
@@ -1546,7 +1546,7 @@ function cn(o, e, t = !1) {
|
|
|
1546
1546
|
class un extends ln {
|
|
1547
1547
|
_yChildren;
|
|
1548
1548
|
_yChildrenIds;
|
|
1549
|
-
root =
|
|
1549
|
+
root = Ee(new Ct());
|
|
1550
1550
|
nodeMap = /* @__PURE__ */ new Map();
|
|
1551
1551
|
get meta() {
|
|
1552
1552
|
return this.root.meta;
|
|
@@ -1572,7 +1572,7 @@ class un extends ln {
|
|
|
1572
1572
|
}
|
|
1573
1573
|
async load(e) {
|
|
1574
1574
|
return super.load(async () => {
|
|
1575
|
-
await e?.(), this._yChildren.size || (this.init(), await
|
|
1575
|
+
await e?.(), this._yChildren.size || (this.init(), await Re()), this._proxyProps(this.root, this._yProps);
|
|
1576
1576
|
const t = this._yProps.get("meta");
|
|
1577
1577
|
t && this._proxyProps(this.root.meta, t, !0), this._proxyChildren(this.root, this._yChildrenIds), this._yChildrenIds.forEach((n) => {
|
|
1578
1578
|
const s = this._yChildren.get(n);
|
|
@@ -1583,9 +1583,12 @@ class un extends ln {
|
|
|
1583
1583
|
_isSelfTransaction(e) {
|
|
1584
1584
|
return !e.origin || e.origin === this._yDoc.clientID;
|
|
1585
1585
|
}
|
|
1586
|
+
_debug(...e) {
|
|
1587
|
+
}
|
|
1586
1588
|
_onChildrenChange(e, t) {
|
|
1587
1589
|
if (this._isSelfTransaction(t))
|
|
1588
1590
|
return;
|
|
1591
|
+
this._debug("_onChildrenChange", e);
|
|
1589
1592
|
const { keysChanged: n, changes: s } = e;
|
|
1590
1593
|
n.forEach((a) => {
|
|
1591
1594
|
const r = s.keys.get(a), i = this._yChildren.get(a);
|
|
@@ -1633,7 +1636,7 @@ class un extends ln {
|
|
|
1633
1636
|
}
|
|
1634
1637
|
set(e) {
|
|
1635
1638
|
const { children: t = [], meta: n = {}, ...s } = e;
|
|
1636
|
-
return this.reset(), this.addElements(t), this.setProperties(s), this._yProps.set("meta", new
|
|
1639
|
+
return this.reset(), this.addElements(t), this.setProperties(s), this._yProps.set("meta", new le.Map(Object.entries(n))), this;
|
|
1637
1640
|
}
|
|
1638
1641
|
_deleteElement(e) {
|
|
1639
1642
|
const t = this.nodeMap.get(e), n = this._yChildren.get(e);
|
|
@@ -1678,7 +1681,7 @@ class un extends ln {
|
|
|
1678
1681
|
}
|
|
1679
1682
|
e.setPropertyAccessor(s);
|
|
1680
1683
|
const a = (r, i) => {
|
|
1681
|
-
this._isSelfTransaction(i) || this.transact(() => {
|
|
1684
|
+
this._isSelfTransaction(i) || (this._debug("_proxyProps", r, e), this.transact(() => {
|
|
1682
1685
|
const { keysChanged: l, changes: c } = r;
|
|
1683
1686
|
l.forEach((u) => {
|
|
1684
1687
|
const d = c.keys.get(u), g = d?.oldValue;
|
|
@@ -1688,11 +1691,11 @@ class un extends ln {
|
|
|
1688
1691
|
this.undoManager.stopCapturing(), e[u] = t.get(u), e.requestUpdate(u, t.get(u), g);
|
|
1689
1692
|
break;
|
|
1690
1693
|
case "delete":
|
|
1691
|
-
this.undoManager.stopCapturing(), e[u] = void 0, e.requestUpdate(u,
|
|
1694
|
+
this.undoManager.stopCapturing(), e[u] = void 0, e.requestUpdate(u, e[u], g);
|
|
1692
1695
|
break;
|
|
1693
1696
|
}
|
|
1694
1697
|
});
|
|
1695
|
-
}, !1);
|
|
1698
|
+
}, !1));
|
|
1696
1699
|
};
|
|
1697
1700
|
e._yMap = fe(t), e._yMapObserveFn && t.unobserve(e._yMapObserveFn), e._yMapObserveFn = fe(a), t.observe(a);
|
|
1698
1701
|
}
|
|
@@ -1704,6 +1707,7 @@ class un extends ln {
|
|
|
1704
1707
|
const n = (s, a) => {
|
|
1705
1708
|
if (this._isSelfTransaction(a))
|
|
1706
1709
|
return;
|
|
1710
|
+
this._debug("_proxyChildren", s, e);
|
|
1707
1711
|
const r = e.children;
|
|
1708
1712
|
let i = 0;
|
|
1709
1713
|
s.changes.delta.forEach((l) => {
|
|
@@ -1746,8 +1750,8 @@ class un extends ln {
|
|
|
1746
1750
|
_getOrCreateNode(e) {
|
|
1747
1751
|
const t = e.get("id");
|
|
1748
1752
|
let n = this.nodeMap.get(t);
|
|
1749
|
-
return n || (this.undoManager.addToScope(e), n =
|
|
1750
|
-
|
|
1753
|
+
return n || (this.undoManager.addToScope(e), n = Ee(
|
|
1754
|
+
Ct.parse({
|
|
1751
1755
|
meta: {
|
|
1752
1756
|
inCanvasIs: e.get("meta")?.get("inCanvasIs")
|
|
1753
1757
|
}
|
|
@@ -1764,12 +1768,12 @@ class un extends ln {
|
|
|
1764
1768
|
Zo([
|
|
1765
1769
|
Ye({ default: "doc" })
|
|
1766
1770
|
], un.prototype, "name");
|
|
1767
|
-
var es = Object.defineProperty,
|
|
1771
|
+
var es = Object.defineProperty, tt = (o, e, t, n) => {
|
|
1768
1772
|
for (var s = void 0, a = o.length - 1, r; a >= 0; a--)
|
|
1769
1773
|
(r = o[a]) && (s = r(e, t, s) || s);
|
|
1770
1774
|
return s && es(e, t, s), s;
|
|
1771
1775
|
};
|
|
1772
|
-
class
|
|
1776
|
+
class nt extends ln {
|
|
1773
1777
|
docs = /* @__PURE__ */ new Map();
|
|
1774
1778
|
set(e = {}) {
|
|
1775
1779
|
return super.reset(), this.setProperties(e), this;
|
|
@@ -1780,18 +1784,18 @@ class tt extends ln {
|
|
|
1780
1784
|
return this.docs.set(e.id, e), e;
|
|
1781
1785
|
}
|
|
1782
1786
|
}
|
|
1783
|
-
|
|
1787
|
+
tt([
|
|
1784
1788
|
Ye()
|
|
1785
|
-
],
|
|
1786
|
-
|
|
1789
|
+
], nt.prototype, "name");
|
|
1790
|
+
tt([
|
|
1787
1791
|
Ye()
|
|
1788
|
-
],
|
|
1789
|
-
|
|
1792
|
+
], nt.prototype, "type");
|
|
1793
|
+
tt([
|
|
1790
1794
|
Ye()
|
|
1791
|
-
],
|
|
1792
|
-
|
|
1795
|
+
], nt.prototype, "createdAt");
|
|
1796
|
+
tt([
|
|
1793
1797
|
Ye()
|
|
1794
|
-
],
|
|
1798
|
+
], nt.prototype, "updatedAt");
|
|
1795
1799
|
const ts = (o, e) => {
|
|
1796
1800
|
const {
|
|
1797
1801
|
workspace: t,
|
|
@@ -1819,7 +1823,7 @@ const ts = (o, e) => {
|
|
|
1819
1823
|
console.error(z);
|
|
1820
1824
|
}
|
|
1821
1825
|
typeof p != "string" && _.set(p);
|
|
1822
|
-
}), _.on("update", Hn((z,
|
|
1826
|
+
}), _.on("update", Hn((z, I) => a("updateDoc", z, I), 200)), t.value?.addDoc(_), n.value?.destroy(), n.value = _, s.value.root.appendChild(_.root), i(0), a("setDoc", _);
|
|
1823
1827
|
} finally {
|
|
1824
1828
|
l.value = void 0;
|
|
1825
1829
|
}
|
|
@@ -1859,7 +1863,7 @@ const ts = (o, e) => {
|
|
|
1859
1863
|
async function u(h) {
|
|
1860
1864
|
await o.waitUntilFontLoad();
|
|
1861
1865
|
let v;
|
|
1862
|
-
return h instanceof G ? v = h.toJSON() : v = { ...h }, v.style ??= {}, v.style.top = 0, v.style.left = 0, await
|
|
1866
|
+
return h instanceof G ? v = h.toJSON() : v = { ...h }, v.style ??= {}, v.style.top = 0, v.style.left = 0, await et({
|
|
1863
1867
|
width: v.style.width,
|
|
1864
1868
|
height: v.style.height,
|
|
1865
1869
|
fonts: i,
|
|
@@ -1887,12 +1891,12 @@ const ts = (o, e) => {
|
|
|
1887
1891
|
p.fillStyle = "rgba(0, 0, 0, 0)", p.clearRect(0, 0, h.width, h.height);
|
|
1888
1892
|
const { zoom: _, position: z } = s.value;
|
|
1889
1893
|
h.width = y.width, h.height = y.height;
|
|
1890
|
-
const
|
|
1894
|
+
const I = y.width * _.x, E = y.height * _.y;
|
|
1891
1895
|
p.drawImage(
|
|
1892
1896
|
v,
|
|
1893
1897
|
(y.left * _.x + z.x) * f,
|
|
1894
1898
|
(y.top * _.x + z.y) * f,
|
|
1895
|
-
|
|
1899
|
+
I * f,
|
|
1896
1900
|
E * f,
|
|
1897
1901
|
0,
|
|
1898
1902
|
0,
|
|
@@ -1944,8 +1948,8 @@ const ts = (o, e) => {
|
|
|
1944
1948
|
So,
|
|
1945
1949
|
Mo,
|
|
1946
1950
|
zo,
|
|
1947
|
-
Oo,
|
|
1948
1951
|
$o,
|
|
1952
|
+
Oo,
|
|
1949
1953
|
Io,
|
|
1950
1954
|
Fo,
|
|
1951
1955
|
Po,
|
|
@@ -1955,13 +1959,13 @@ const ts = (o, e) => {
|
|
|
1955
1959
|
function ss(o, e) {
|
|
1956
1960
|
return o < e ? -1 : o === e ? 0 : 1;
|
|
1957
1961
|
}
|
|
1958
|
-
function
|
|
1962
|
+
function it(o, e) {
|
|
1959
1963
|
return o === e;
|
|
1960
1964
|
}
|
|
1961
|
-
function
|
|
1965
|
+
function Ne(o) {
|
|
1962
1966
|
return typeof o > "u";
|
|
1963
1967
|
}
|
|
1964
|
-
class
|
|
1968
|
+
class xt {
|
|
1965
1969
|
/**
|
|
1966
1970
|
* First node in the list
|
|
1967
1971
|
* @type {Object}
|
|
@@ -1997,7 +2001,7 @@ class bt {
|
|
|
1997
2001
|
* or if the element is undefined.
|
|
1998
2002
|
*/
|
|
1999
2003
|
add(e, t) {
|
|
2000
|
-
if (
|
|
2004
|
+
if (Ne(t) && (t = this.nElements), t < 0 || t > this.nElements || Ne(e))
|
|
2001
2005
|
return !1;
|
|
2002
2006
|
const n = this.createNode(e);
|
|
2003
2007
|
if (this.nElements === 0 || this.lastNode === null)
|
|
@@ -2064,8 +2068,8 @@ class bt {
|
|
|
2064
2068
|
* element.
|
|
2065
2069
|
*/
|
|
2066
2070
|
indexOf(e, t) {
|
|
2067
|
-
const n = t ||
|
|
2068
|
-
if (
|
|
2071
|
+
const n = t || it;
|
|
2072
|
+
if (Ne(e))
|
|
2069
2073
|
return -1;
|
|
2070
2074
|
let s = this.firstNode, a = 0;
|
|
2071
2075
|
for (; s !== null; ) {
|
|
@@ -2112,8 +2116,8 @@ class bt {
|
|
|
2112
2116
|
* @return {boolean} true if the list contained the specified element.
|
|
2113
2117
|
*/
|
|
2114
2118
|
remove(e, t) {
|
|
2115
|
-
const n = t ||
|
|
2116
|
-
if (this.nElements < 1 ||
|
|
2119
|
+
const n = t || it;
|
|
2120
|
+
if (this.nElements < 1 || Ne(e))
|
|
2117
2121
|
return !1;
|
|
2118
2122
|
let s = null, a = this.firstNode;
|
|
2119
2123
|
for (; a !== null; ) {
|
|
@@ -2140,8 +2144,8 @@ class bt {
|
|
|
2140
2144
|
* @return {boolean} true if this list is equal to the given list.
|
|
2141
2145
|
*/
|
|
2142
2146
|
equals(e, t) {
|
|
2143
|
-
const n = t ||
|
|
2144
|
-
return !(e instanceof
|
|
2147
|
+
const n = t || it;
|
|
2148
|
+
return !(e instanceof xt) || this.size() !== e.size() ? !1 : this.equalsAux(this.firstNode, e.firstNode, n);
|
|
2145
2149
|
}
|
|
2146
2150
|
/**
|
|
2147
2151
|
* @private
|
|
@@ -2260,7 +2264,7 @@ class as {
|
|
|
2260
2264
|
* @constructor
|
|
2261
2265
|
*/
|
|
2262
2266
|
constructor() {
|
|
2263
|
-
this.list = new
|
|
2267
|
+
this.list = new xt();
|
|
2264
2268
|
}
|
|
2265
2269
|
/**
|
|
2266
2270
|
* Inserts the specified element into the end of this queue.
|
|
@@ -2397,7 +2401,7 @@ class is {
|
|
|
2397
2401
|
* @return {boolean} true if this tree did not already contain the specified element.
|
|
2398
2402
|
*/
|
|
2399
2403
|
add(e) {
|
|
2400
|
-
return
|
|
2404
|
+
return Ne(e) ? !1 : this.insertNode(this.createNode(e)) !== null ? (this.nElements++, !0) : !1;
|
|
2401
2405
|
}
|
|
2402
2406
|
/**
|
|
2403
2407
|
* Removes all of the elements from this tree.
|
|
@@ -2426,7 +2430,7 @@ class is {
|
|
|
2426
2430
|
* false otherwise.
|
|
2427
2431
|
*/
|
|
2428
2432
|
contains(e) {
|
|
2429
|
-
return
|
|
2433
|
+
return Ne(e) ? !1 : this.searchNode(this.root, e) !== null;
|
|
2430
2434
|
}
|
|
2431
2435
|
/**
|
|
2432
2436
|
* 搜索元素
|
|
@@ -2663,12 +2667,12 @@ class is {
|
|
|
2663
2667
|
};
|
|
2664
2668
|
}
|
|
2665
2669
|
}
|
|
2666
|
-
class
|
|
2670
|
+
class St extends is {
|
|
2667
2671
|
}
|
|
2668
|
-
function
|
|
2672
|
+
function Pe(o, e, t) {
|
|
2669
2673
|
return { pos: o, type: e, box: t };
|
|
2670
2674
|
}
|
|
2671
|
-
function
|
|
2675
|
+
function We(o) {
|
|
2672
2676
|
const e = "box" in o ? o.box : o;
|
|
2673
2677
|
return {
|
|
2674
2678
|
left: e.hl.pos,
|
|
@@ -2677,10 +2681,10 @@ function Ge(o) {
|
|
|
2677
2681
|
height: e.vb.pos - e.vt.pos
|
|
2678
2682
|
};
|
|
2679
2683
|
}
|
|
2680
|
-
function
|
|
2684
|
+
function Mt(o) {
|
|
2681
2685
|
return o === "vt" ? "vb" : o === "vb" ? "vt" : o === "hl" ? "hr" : o === "hr" ? "hl" : o;
|
|
2682
2686
|
}
|
|
2683
|
-
function
|
|
2687
|
+
function rt(o) {
|
|
2684
2688
|
return ["vt", "hl"].includes(o.type);
|
|
2685
2689
|
}
|
|
2686
2690
|
const rs = (o) => {
|
|
@@ -2696,38 +2700,38 @@ const rs = (o) => {
|
|
|
2696
2700
|
return;
|
|
2697
2701
|
const C = {};
|
|
2698
2702
|
let m, b, k, x;
|
|
2699
|
-
return E.instanceId ? (C.id = E.instanceId, { top: m, left: b, height: k, width: x } = s(E)) : (C.id = Math.random(), { top: m, left: b, height: k, width: x } = E), C.vt =
|
|
2703
|
+
return E.instanceId ? (C.id = E.instanceId, { top: m, left: b, height: k, width: x } = s(E)) : (C.id = Math.random(), { top: m, left: b, height: k, width: x } = E), C.vt = Pe(m, "vt", C), C.vm = Pe(m + k / 2, "vm", C), C.vb = Pe(m + k, "vb", C), C.hl = Pe(b, "hl", C), C.hm = Pe(b + x / 2, "hm", C), C.hr = Pe(b + x, "hr", C), C;
|
|
2700
2704
|
}
|
|
2701
|
-
const i =
|
|
2705
|
+
const i = $(() => 4), l = $(() => new Set(
|
|
2702
2706
|
[
|
|
2703
2707
|
t.value[0]?.instanceId
|
|
2704
2708
|
].filter(Boolean)
|
|
2705
|
-
)), c =
|
|
2709
|
+
)), c = $(() => {
|
|
2706
2710
|
if (t.value[0])
|
|
2707
2711
|
return r(t.value[0]);
|
|
2708
|
-
}), u =
|
|
2712
|
+
}), u = $(() => {
|
|
2709
2713
|
const E = t.value[0].parent;
|
|
2710
2714
|
return E instanceof G ? E : void 0;
|
|
2711
|
-
}), d =
|
|
2715
|
+
}), d = $(() => r(
|
|
2712
2716
|
u.value ?? { left: 0, top: 0, width: 0, height: 0 }
|
|
2713
|
-
)), g =
|
|
2717
|
+
)), g = $(() => {
|
|
2714
2718
|
const E = [
|
|
2715
2719
|
...u.value?.children ?? a.value?.children ?? []
|
|
2716
2720
|
];
|
|
2717
2721
|
return e.value && u.value?.equal(e.value) && E.push(u.value), E.filter((C) => !l.value.has(C.instanceId)).map((C) => r(C)).filter(Boolean);
|
|
2718
|
-
}), h =
|
|
2722
|
+
}), h = $(() => g.value.reduce(
|
|
2719
2723
|
(E, C) => ([C.vt, C.vm, C.vb].forEach((m) => E.vLines.add(m)), [C.hl, C.hm, C.hr].forEach((m) => E.hLines.add(m)), E),
|
|
2720
2724
|
{
|
|
2721
|
-
vLines: new
|
|
2722
|
-
hLines: new
|
|
2725
|
+
vLines: new St((E, C) => E.pos - C.pos),
|
|
2726
|
+
hLines: new St((E, C) => E.pos - C.pos)
|
|
2723
2727
|
}
|
|
2724
2728
|
));
|
|
2725
2729
|
function v(E) {
|
|
2726
2730
|
return E.box?.id === -1;
|
|
2727
2731
|
}
|
|
2728
2732
|
function y(E, C) {
|
|
2729
|
-
const m = ["vt", "vb"].includes(C.type) ? "vertical" : "horizontal", b = m === "vertical" ? "horizontal" : "vertical", k =
|
|
2730
|
-
let x =
|
|
2733
|
+
const m = ["vt", "vb"].includes(C.type) ? "vertical" : "horizontal", b = m === "vertical" ? "horizontal" : "vertical", k = rt(C);
|
|
2734
|
+
let x = Mt(C.type);
|
|
2731
2735
|
if (k) {
|
|
2732
2736
|
if (C.pos > d.value[x].pos)
|
|
2733
2737
|
return [];
|
|
@@ -2744,14 +2748,14 @@ const rs = (o) => {
|
|
|
2744
2748
|
} else if (C.pos > P.pos)
|
|
2745
2749
|
return;
|
|
2746
2750
|
const B = v(P);
|
|
2747
|
-
x !== P.type && !B || Be(
|
|
2751
|
+
x !== P.type && !B || Be(We(C), We(P), b) && (!B && T && T.box.id !== P.box.id && Be(We(T), We(P), m) || (T = P, w.push(P), x = Mt(x)));
|
|
2748
2752
|
};
|
|
2749
2753
|
return k ? E.outorderTraversal(M) : E.inorderTraversal(M), w;
|
|
2750
2754
|
}
|
|
2751
2755
|
function f(E, C) {
|
|
2752
2756
|
if (!E.length)
|
|
2753
2757
|
return [];
|
|
2754
|
-
const m =
|
|
2758
|
+
const m = rt(C), b = E[0].pos;
|
|
2755
2759
|
let k = Math.abs(C.pos - b);
|
|
2756
2760
|
const x = [];
|
|
2757
2761
|
E = [C].concat(E);
|
|
@@ -2773,7 +2777,7 @@ const rs = (o) => {
|
|
|
2773
2777
|
pos: m ? b + k : b - k
|
|
2774
2778
|
}, x);
|
|
2775
2779
|
}
|
|
2776
|
-
const p =
|
|
2780
|
+
const p = $(() => {
|
|
2777
2781
|
if (!c.value)
|
|
2778
2782
|
return [];
|
|
2779
2783
|
const { vLines: E, hLines: C } = h.value, m = c.value, b = { vt: [], vb: [], hl: [], hr: [] }, k = [];
|
|
@@ -2802,7 +2806,7 @@ const rs = (o) => {
|
|
|
2802
2806
|
if (T && P && (!v(T) || !v(P))) {
|
|
2803
2807
|
const A = Math.abs(M.pos - T.pos), N = Math.abs(B.pos - P.pos);
|
|
2804
2808
|
if (Math.abs(A - N) < i.value) {
|
|
2805
|
-
const L =
|
|
2809
|
+
const L = rt(M);
|
|
2806
2810
|
k.push({
|
|
2807
2811
|
target: T,
|
|
2808
2812
|
source: M,
|
|
@@ -2829,7 +2833,7 @@ const rs = (o) => {
|
|
|
2829
2833
|
}
|
|
2830
2834
|
}
|
|
2831
2835
|
}), k;
|
|
2832
|
-
}), _ = (E) => E, z =
|
|
2836
|
+
}), _ = (E) => E, z = $(() => {
|
|
2833
2837
|
if (n.value !== "transforming")
|
|
2834
2838
|
return [];
|
|
2835
2839
|
const E = { left: 0, top: 0 };
|
|
@@ -2880,7 +2884,7 @@ const rs = (o) => {
|
|
|
2880
2884
|
return M;
|
|
2881
2885
|
});
|
|
2882
2886
|
});
|
|
2883
|
-
function
|
|
2887
|
+
function I(E = !1) {
|
|
2884
2888
|
const C = [], m = [];
|
|
2885
2889
|
for (const b of p.value) {
|
|
2886
2890
|
const { target: k, source: x, type: w } = b, T = k.box, M = x.box;
|
|
@@ -2901,7 +2905,7 @@ const rs = (o) => {
|
|
|
2901
2905
|
}
|
|
2902
2906
|
return Object.assign(o, {
|
|
2903
2907
|
auxiliaryLines: z,
|
|
2904
|
-
getAdsorptionPoints:
|
|
2908
|
+
getAdsorptionPoints: I
|
|
2905
2909
|
}), {
|
|
2906
2910
|
name: "mce:auxiliary"
|
|
2907
2911
|
};
|
|
@@ -2914,7 +2918,7 @@ const rs = (o) => {
|
|
|
2914
2918
|
} = o, a = V();
|
|
2915
2919
|
async function r() {
|
|
2916
2920
|
const u = e.value.length === 1 ? [e.value[0].toJSON()] : e.value.map((d) => d.toJSON());
|
|
2917
|
-
if (
|
|
2921
|
+
if (Tt) {
|
|
2918
2922
|
const d = "text/html";
|
|
2919
2923
|
await navigator.clipboard.write([
|
|
2920
2924
|
new ClipboardItem({
|
|
@@ -2930,7 +2934,7 @@ const rs = (o) => {
|
|
|
2930
2934
|
await r(), t("delete");
|
|
2931
2935
|
}
|
|
2932
2936
|
async function l() {
|
|
2933
|
-
if (
|
|
2937
|
+
if (Tt) {
|
|
2934
2938
|
const u = await navigator.clipboard.read(), d = [];
|
|
2935
2939
|
for (const g of u)
|
|
2936
2940
|
for (const h of g.types) {
|
|
@@ -2940,7 +2944,7 @@ const rs = (o) => {
|
|
|
2940
2944
|
else
|
|
2941
2945
|
switch (v.type) {
|
|
2942
2946
|
case "text/plain":
|
|
2943
|
-
d.push(
|
|
2947
|
+
d.push(ut(await v.text()));
|
|
2944
2948
|
break;
|
|
2945
2949
|
case "text/html": {
|
|
2946
2950
|
const y = new DOMParser().parseFromString(await v.text(), "text/html"), f = y.querySelector("mce-clipboard");
|
|
@@ -2955,7 +2959,7 @@ const rs = (o) => {
|
|
|
2955
2959
|
new Uint8Array(
|
|
2956
2960
|
atob(
|
|
2957
2961
|
p.getAttribute("data-clipboard")?.replace(/\s+/g, "") ?? ""
|
|
2958
|
-
).split("").map((
|
|
2962
|
+
).split("").map((I) => I.charCodeAt(0))
|
|
2959
2963
|
)
|
|
2960
2964
|
)
|
|
2961
2965
|
), z = new Blob([_], {
|
|
@@ -3114,14 +3118,14 @@ const rs = (o) => {
|
|
|
3114
3118
|
fonts: t,
|
|
3115
3119
|
to: n
|
|
3116
3120
|
} = o, s = e.gifWorkerUrl;
|
|
3117
|
-
return
|
|
3121
|
+
return qt.gifWorkerUrl = s, {
|
|
3118
3122
|
name: "mce:gif",
|
|
3119
3123
|
exporters: [
|
|
3120
3124
|
{
|
|
3121
3125
|
name: "gif",
|
|
3122
3126
|
handle: async (a) => {
|
|
3123
3127
|
const { Encoder: r } = await import("modern-gif"), { onProgress: i, ...l } = a, c = n("json", l), { startTime: u, endTime: d } = c.meta, g = Math.floor(c.style.width), h = Math.floor(c.style.height), v = new r({ width: g, height: h, workerUrl: s });
|
|
3124
|
-
return await
|
|
3128
|
+
return await et({
|
|
3125
3129
|
data: c,
|
|
3126
3130
|
width: g,
|
|
3127
3131
|
height: h,
|
|
@@ -3233,7 +3237,7 @@ const rs = (o) => {
|
|
|
3233
3237
|
to: s,
|
|
3234
3238
|
fonts: a,
|
|
3235
3239
|
upload: r
|
|
3236
|
-
} = o, i = async (u, d) => n(await
|
|
3240
|
+
} = o, i = async (u, d) => n(await dt(u), {
|
|
3237
3241
|
sizeToFit: !0,
|
|
3238
3242
|
positionToFit: !0,
|
|
3239
3243
|
...d
|
|
@@ -3249,7 +3253,7 @@ const rs = (o) => {
|
|
|
3249
3253
|
return {
|
|
3250
3254
|
name: u,
|
|
3251
3255
|
handle: async (d) => {
|
|
3252
|
-
const g = await s("json", d), h = await
|
|
3256
|
+
const g = await s("json", d), h = await et({
|
|
3253
3257
|
data: g,
|
|
3254
3258
|
fonts: a,
|
|
3255
3259
|
width: g.style.width,
|
|
@@ -3278,9 +3282,9 @@ const rs = (o) => {
|
|
|
3278
3282
|
loaders: [
|
|
3279
3283
|
{
|
|
3280
3284
|
name: "image",
|
|
3281
|
-
accept:
|
|
3282
|
-
test: (u) => !!(u instanceof Blob && u.type.startsWith("image/") || u instanceof File &&
|
|
3283
|
-
load: async (u) => await
|
|
3285
|
+
accept: en.join(","),
|
|
3286
|
+
test: (u) => !!(u instanceof Blob && u.type.startsWith("image/") || u instanceof File && ct.test(u.name)),
|
|
3287
|
+
load: async (u) => await dt(await r(u))
|
|
3284
3288
|
}
|
|
3285
3289
|
]
|
|
3286
3290
|
};
|
|
@@ -3444,7 +3448,7 @@ const rs = (o) => {
|
|
|
3444
3448
|
selection: s,
|
|
3445
3449
|
textSelection: a,
|
|
3446
3450
|
config: r
|
|
3447
|
-
} = o, i =
|
|
3451
|
+
} = o, i = $(() => s.value.length > 0), l = $(() => ({
|
|
3448
3452
|
key: "export",
|
|
3449
3453
|
children: [
|
|
3450
3454
|
{ key: "saveAs:png" },
|
|
@@ -3457,27 +3461,25 @@ const rs = (o) => {
|
|
|
3457
3461
|
{ key: "saveAs:pptx" },
|
|
3458
3462
|
{ key: "saveAs:json" }
|
|
3459
3463
|
]
|
|
3460
|
-
})), c =
|
|
3464
|
+
})), c = $(() => ({
|
|
3461
3465
|
key: "file",
|
|
3462
3466
|
children: [
|
|
3463
3467
|
{ key: "new" },
|
|
3464
3468
|
{ key: "open" },
|
|
3465
3469
|
{ type: "divider" },
|
|
3466
3470
|
{ key: "import" },
|
|
3467
|
-
l.value
|
|
3468
|
-
{ type: "divider" },
|
|
3469
|
-
{ key: "preferences" }
|
|
3471
|
+
l.value
|
|
3470
3472
|
]
|
|
3471
|
-
})), u =
|
|
3473
|
+
})), u = $(() => [
|
|
3472
3474
|
{ key: "undo", disabled: !e.value },
|
|
3473
3475
|
{ key: "redo", disabled: !t.value }
|
|
3474
|
-
]), d =
|
|
3476
|
+
]), d = $(() => [
|
|
3475
3477
|
{ key: "copy", disabled: !i.value },
|
|
3476
3478
|
{ key: "cut", disabled: !i.value },
|
|
3477
3479
|
{ key: "paste", disabled: !n.value },
|
|
3478
3480
|
{ key: "duplicate", disabled: !i.value },
|
|
3479
3481
|
{ key: "delete", disabled: !i.value }
|
|
3480
|
-
]), g =
|
|
3482
|
+
]), g = $(() => ({
|
|
3481
3483
|
key: "select",
|
|
3482
3484
|
children: [
|
|
3483
3485
|
{ key: "selectAll" },
|
|
@@ -3486,7 +3488,7 @@ const rs = (o) => {
|
|
|
3486
3488
|
{ key: "previousSelection", disabled: !i.value },
|
|
3487
3489
|
{ key: "nextSelection", disabled: !i.value }
|
|
3488
3490
|
]
|
|
3489
|
-
})), h =
|
|
3491
|
+
})), h = $(() => ({
|
|
3490
3492
|
key: "edit",
|
|
3491
3493
|
children: [
|
|
3492
3494
|
...u.value,
|
|
@@ -3495,7 +3497,7 @@ const rs = (o) => {
|
|
|
3495
3497
|
{ type: "divider" },
|
|
3496
3498
|
...g.value.children
|
|
3497
3499
|
]
|
|
3498
|
-
})), v =
|
|
3500
|
+
})), v = $(() => ({
|
|
3499
3501
|
key: "zoom",
|
|
3500
3502
|
children: [
|
|
3501
3503
|
{ key: "zoomIn" },
|
|
@@ -3504,7 +3506,7 @@ const rs = (o) => {
|
|
|
3504
3506
|
{ key: "zoomToFit" },
|
|
3505
3507
|
{ key: "zoomToSelection", disabled: !i.value }
|
|
3506
3508
|
]
|
|
3507
|
-
})), y =
|
|
3509
|
+
})), y = $(() => ({
|
|
3508
3510
|
key: "view",
|
|
3509
3511
|
children: [
|
|
3510
3512
|
{ key: "view:checkerboard", checked: r.value.checkerboard },
|
|
@@ -3517,10 +3519,10 @@ const rs = (o) => {
|
|
|
3517
3519
|
{ type: "divider" },
|
|
3518
3520
|
...v.value.children
|
|
3519
3521
|
]
|
|
3520
|
-
})), f =
|
|
3522
|
+
})), f = $(() => [
|
|
3521
3523
|
{ key: "group/ungroup", disabled: !i.value },
|
|
3522
3524
|
{ key: "frame/unframe", disabled: !i.value }
|
|
3523
|
-
]), p =
|
|
3525
|
+
]), p = $(() => ({
|
|
3524
3526
|
key: "layerOrder",
|
|
3525
3527
|
children: [
|
|
3526
3528
|
{ key: "bringToFront", disabled: !i.value },
|
|
@@ -3528,16 +3530,16 @@ const rs = (o) => {
|
|
|
3528
3530
|
{ key: "sendBackward", disabled: !i.value },
|
|
3529
3531
|
{ key: "sendToBack", disabled: !i.value }
|
|
3530
3532
|
]
|
|
3531
|
-
})), _ =
|
|
3533
|
+
})), _ = $(() => ({
|
|
3532
3534
|
key: "flip",
|
|
3533
3535
|
children: [
|
|
3534
3536
|
{ key: "flipHorizontal", disabled: !i.value },
|
|
3535
3537
|
{ key: "flipVertical", disabled: !i.value }
|
|
3536
3538
|
]
|
|
3537
|
-
})), z =
|
|
3539
|
+
})), z = $(() => [
|
|
3538
3540
|
{ key: "hide/show", disabled: !i.value },
|
|
3539
3541
|
{ key: "lock/unlock", disabled: !i.value }
|
|
3540
|
-
]),
|
|
3542
|
+
]), I = $(() => ({
|
|
3541
3543
|
key: "object",
|
|
3542
3544
|
children: [
|
|
3543
3545
|
...f.value,
|
|
@@ -3548,25 +3550,25 @@ const rs = (o) => {
|
|
|
3548
3550
|
{ type: "divider" },
|
|
3549
3551
|
...z.value
|
|
3550
3552
|
]
|
|
3551
|
-
})), E =
|
|
3553
|
+
})), E = $(() => [
|
|
3552
3554
|
{ key: "alignLeft", disabled: !i.value },
|
|
3553
3555
|
{ key: "alignHorizontalCenter", disabled: !i.value },
|
|
3554
3556
|
{ key: "alignRight", disabled: !i.value },
|
|
3555
3557
|
{ key: "alignTop", disabled: !i.value },
|
|
3556
3558
|
{ key: "alignVerticalCenter", disabled: !i.value },
|
|
3557
3559
|
{ key: "alignBottom", disabled: !i.value }
|
|
3558
|
-
]), C =
|
|
3560
|
+
]), C = $(() => ({
|
|
3559
3561
|
key: "layerPosition",
|
|
3560
3562
|
children: [
|
|
3561
3563
|
...E.value
|
|
3562
3564
|
]
|
|
3563
|
-
})), m =
|
|
3565
|
+
})), m = $(() => [
|
|
3564
3566
|
c.value,
|
|
3565
3567
|
h.value,
|
|
3566
3568
|
y.value,
|
|
3567
|
-
|
|
3569
|
+
I.value,
|
|
3568
3570
|
C.value
|
|
3569
|
-
]), b =
|
|
3571
|
+
]), b = $(() => s.value.length > 0 ? a.value ? [
|
|
3570
3572
|
...d.value
|
|
3571
3573
|
] : [
|
|
3572
3574
|
...d.value,
|
|
@@ -3663,20 +3665,20 @@ const rs = (o) => {
|
|
|
3663
3665
|
throw new Error("Failed to parse encoding configuration");
|
|
3664
3666
|
const _ = new s(h);
|
|
3665
3667
|
let z = 1;
|
|
3666
|
-
return await
|
|
3668
|
+
return await et({
|
|
3667
3669
|
data: i,
|
|
3668
3670
|
width: u,
|
|
3669
3671
|
height: d,
|
|
3670
3672
|
fonts: e,
|
|
3671
|
-
onFrame: async (
|
|
3672
|
-
const m = await createImageBitmap(new ImageData(
|
|
3673
|
+
onFrame: async (I, { duration: E, progress: C }) => {
|
|
3674
|
+
const m = await createImageBitmap(new ImageData(I, u, d));
|
|
3673
3675
|
await _.encode({
|
|
3674
3676
|
data: m,
|
|
3675
3677
|
timestamp: z,
|
|
3676
3678
|
duration: E
|
|
3677
3679
|
}), m.close(), z += E, a?.(C);
|
|
3678
3680
|
},
|
|
3679
|
-
keyframes: Array.from({ length: ~~((c - l) / v) }, (
|
|
3681
|
+
keyframes: Array.from({ length: ~~((c - l) / v) }, (I, E) => l + E * v)
|
|
3680
3682
|
}), await _.flush();
|
|
3681
3683
|
}
|
|
3682
3684
|
}
|
|
@@ -3792,11 +3794,11 @@ const rs = (o) => {
|
|
|
3792
3794
|
presetShapeDefinitions: c,
|
|
3793
3795
|
upload: async (d, g) => {
|
|
3794
3796
|
const h = g.image;
|
|
3795
|
-
let v =
|
|
3797
|
+
let v = $t(g.image);
|
|
3796
3798
|
const y = As(d);
|
|
3797
3799
|
if (!v) {
|
|
3798
3800
|
const f = Ss(y);
|
|
3799
|
-
f && (v =
|
|
3801
|
+
f && (v = $t(f));
|
|
3800
3802
|
}
|
|
3801
3803
|
return await t(
|
|
3802
3804
|
new File([y], h, {
|
|
@@ -3815,7 +3817,7 @@ const rs = (o) => {
|
|
|
3815
3817
|
}
|
|
3816
3818
|
]
|
|
3817
3819
|
};
|
|
3818
|
-
},
|
|
3820
|
+
}, zt = {
|
|
3819
3821
|
jpeg: "image/jpeg",
|
|
3820
3822
|
jpg: "image/jpeg",
|
|
3821
3823
|
png: "image/png",
|
|
@@ -3826,9 +3828,9 @@ const rs = (o) => {
|
|
|
3826
3828
|
emf: "image/emf",
|
|
3827
3829
|
wmf: "image/wmf"
|
|
3828
3830
|
};
|
|
3829
|
-
function
|
|
3831
|
+
function $t(o) {
|
|
3830
3832
|
const e = o.split("."), t = e[e.length - 1].toLowerCase();
|
|
3831
|
-
return t in
|
|
3833
|
+
return t in zt ? zt[t] : null;
|
|
3832
3834
|
}
|
|
3833
3835
|
function As(o) {
|
|
3834
3836
|
const e = atob(o), t = e.length, n = new ArrayBuffer(t), s = new Uint8Array(n);
|
|
@@ -3867,42 +3869,27 @@ function Ss(o) {
|
|
|
3867
3869
|
}
|
|
3868
3870
|
}
|
|
3869
3871
|
const Ms = (o) => {
|
|
3870
|
-
const e = V(!1);
|
|
3871
|
-
function t() {
|
|
3872
|
-
e.value = !e.value;
|
|
3873
|
-
}
|
|
3874
|
-
return Object.assign(o, {
|
|
3875
|
-
preferencesVisible: e
|
|
3876
|
-
}), {
|
|
3877
|
-
name: "mce:preferences",
|
|
3878
|
-
commands: [
|
|
3879
|
-
{ command: "preferences", handle: t }
|
|
3880
|
-
],
|
|
3881
|
-
hotkeys: [
|
|
3882
|
-
{ command: "preferences", key: "CmdOrCtrl+,", editable: !1, system: !0 }
|
|
3883
|
-
]
|
|
3884
|
-
};
|
|
3885
|
-
}, zs = (o) => {
|
|
3886
3872
|
const {
|
|
3887
|
-
to: e
|
|
3873
|
+
to: e,
|
|
3874
|
+
root: t
|
|
3888
3875
|
} = o;
|
|
3889
3876
|
return {
|
|
3890
3877
|
name: "mce:saveAs",
|
|
3891
3878
|
commands: [
|
|
3892
|
-
{ command: "saveAs", handle: async (
|
|
3879
|
+
{ command: "saveAs", handle: async (s, a = {}) => {
|
|
3893
3880
|
const {
|
|
3894
|
-
filename:
|
|
3895
|
-
...
|
|
3896
|
-
} =
|
|
3897
|
-
let
|
|
3881
|
+
filename: r = t.value?.meta.name ?? "download",
|
|
3882
|
+
...i
|
|
3883
|
+
} = a;
|
|
3884
|
+
let l = await e(s, {
|
|
3898
3885
|
selected: !0,
|
|
3899
|
-
...
|
|
3886
|
+
...i
|
|
3900
3887
|
});
|
|
3901
|
-
|
|
3888
|
+
l instanceof Blob || (l = new Blob([JSON.stringify(l)], { type: "application/json" })), Kt(l, `${r}.${s}`);
|
|
3902
3889
|
} }
|
|
3903
3890
|
]
|
|
3904
3891
|
};
|
|
3905
|
-
},
|
|
3892
|
+
}, zs = (o) => {
|
|
3906
3893
|
const {
|
|
3907
3894
|
selection: e,
|
|
3908
3895
|
root: t
|
|
@@ -3956,7 +3943,7 @@ const Ms = (o) => {
|
|
|
3956
3943
|
addElement: s
|
|
3957
3944
|
} = o, a = (l = t("clickEditText"), c = {}) => {
|
|
3958
3945
|
const { style: u, ...d } = c;
|
|
3959
|
-
return s(
|
|
3946
|
+
return s(ut(l, u), {
|
|
3960
3947
|
sizeToFit: !0,
|
|
3961
3948
|
positionToFit: !0,
|
|
3962
3949
|
...d
|
|
@@ -3980,11 +3967,11 @@ const Ms = (o) => {
|
|
|
3980
3967
|
name: "txt",
|
|
3981
3968
|
accept: ".txt",
|
|
3982
3969
|
test: (l) => !!(l instanceof Blob && l.type.startsWith("text/plain") || l instanceof File && i.test(l.name)),
|
|
3983
|
-
load: async (l) =>
|
|
3970
|
+
load: async (l) => ut(await l.text())
|
|
3984
3971
|
}
|
|
3985
3972
|
]
|
|
3986
3973
|
};
|
|
3987
|
-
},
|
|
3974
|
+
}, Os = (o) => {
|
|
3988
3975
|
const {
|
|
3989
3976
|
selection: e,
|
|
3990
3977
|
getAabbInDrawboard: t,
|
|
@@ -4000,7 +3987,7 @@ const Ms = (o) => {
|
|
|
4000
3987
|
);
|
|
4001
3988
|
}
|
|
4002
3989
|
};
|
|
4003
|
-
},
|
|
3990
|
+
}, Is = () => {
|
|
4004
3991
|
async function o(e) {
|
|
4005
3992
|
try {
|
|
4006
3993
|
const n = (await fetch(e, { method: "HEAD" })).headers.get("Content-Type");
|
|
@@ -4014,16 +4001,16 @@ const Ms = (o) => {
|
|
|
4014
4001
|
loaders: [
|
|
4015
4002
|
{
|
|
4016
4003
|
name: "url",
|
|
4017
|
-
test: (e) => typeof e == "string" && e.startsWith("http"),
|
|
4004
|
+
test: (e) => typeof e == "string" && (e.startsWith("http") || ct.test(e)),
|
|
4018
4005
|
load: async (e) => {
|
|
4019
|
-
if (
|
|
4020
|
-
return await
|
|
4006
|
+
if (ct.test(e) || await o(e))
|
|
4007
|
+
return await dt(e);
|
|
4021
4008
|
throw new Error(`Failed to load url, ${e}`);
|
|
4022
4009
|
}
|
|
4023
4010
|
}
|
|
4024
4011
|
]
|
|
4025
4012
|
};
|
|
4026
|
-
},
|
|
4013
|
+
}, Fs = (o) => {
|
|
4027
4014
|
const {
|
|
4028
4015
|
config: e
|
|
4029
4016
|
} = o;
|
|
@@ -4037,7 +4024,7 @@ const Ms = (o) => {
|
|
|
4037
4024
|
{ command: "view:ruler", key: "Shift+R" }
|
|
4038
4025
|
]
|
|
4039
4026
|
};
|
|
4040
|
-
},
|
|
4027
|
+
}, Ps = (o) => {
|
|
4041
4028
|
const {
|
|
4042
4029
|
selection: e
|
|
4043
4030
|
} = o;
|
|
@@ -4067,7 +4054,7 @@ const Ms = (o) => {
|
|
|
4067
4054
|
{ command: "hide/show", key: "Shift+CmdOrCtrl+h" }
|
|
4068
4055
|
]
|
|
4069
4056
|
};
|
|
4070
|
-
}, Ot = { left: 0, top: 0, bottom: 0, right: 0 },
|
|
4057
|
+
}, Ot = { left: 0, top: 0, bottom: 0, right: 0 }, Ns = (o) => {
|
|
4071
4058
|
const {
|
|
4072
4059
|
camera: e,
|
|
4073
4060
|
drawboardAabb: t,
|
|
@@ -4093,15 +4080,15 @@ const Ms = (o) => {
|
|
|
4093
4080
|
...s.value.zoomToFitOffset
|
|
4094
4081
|
};
|
|
4095
4082
|
s.value.scrollbar && (_.right += 8, _.bottom += 8), s.value.ruler && (_.left += 16, _.top += 16);
|
|
4096
|
-
const z = t.value.width - (_.left + _.right),
|
|
4083
|
+
const z = t.value.width - (_.left + _.right), I = t.value.height - (_.top + _.bottom), E = p.left, C = p.top, m = p.width, b = p.height;
|
|
4097
4084
|
if (m && b) {
|
|
4098
|
-
const k = z / m, x =
|
|
4085
|
+
const k = z / m, x = I / b;
|
|
4099
4086
|
e.value.setZoom(
|
|
4100
4087
|
y === "contain" ? Math.min(k, x) : Math.max(k, x)
|
|
4101
4088
|
);
|
|
4102
4089
|
const w = e.value.zoom.x;
|
|
4103
4090
|
let T = _.left, M = _.top;
|
|
4104
|
-
k < x ? M += (
|
|
4091
|
+
k < x ? M += (I - b * w) / 2 : T += (z - m * w) / 2, e.value.position.set(
|
|
4105
4092
|
-E * w + T,
|
|
4106
4093
|
-C * w + M
|
|
4107
4094
|
);
|
|
@@ -4144,13 +4131,13 @@ const Ms = (o) => {
|
|
|
4144
4131
|
drawboardDom: y,
|
|
4145
4132
|
config: f
|
|
4146
4133
|
} = o;
|
|
4147
|
-
pe(() => f.value.viewMode, g),
|
|
4148
|
-
const { left: _, top: z, width:
|
|
4149
|
-
t.value = { left: C, top: m, width:
|
|
4134
|
+
pe(() => f.value.viewMode, g), Ht(y, (p) => {
|
|
4135
|
+
const { left: _, top: z, width: I, height: E } = p[0].contentRect, { left: C = _, top: m = z } = y.value?.getBoundingClientRect() ?? {};
|
|
4136
|
+
t.value = { left: C, top: m, width: I, height: E }, g();
|
|
4150
4137
|
});
|
|
4151
4138
|
}
|
|
4152
4139
|
};
|
|
4153
|
-
},
|
|
4140
|
+
}, Rs = [
|
|
4154
4141
|
rs,
|
|
4155
4142
|
ls,
|
|
4156
4143
|
cs,
|
|
@@ -4173,15 +4160,14 @@ const Ms = (o) => {
|
|
|
4173
4160
|
Ts,
|
|
4174
4161
|
Ms,
|
|
4175
4162
|
zs,
|
|
4176
|
-
Os,
|
|
4177
4163
|
$s,
|
|
4164
|
+
Os,
|
|
4178
4165
|
Is,
|
|
4179
4166
|
Fs,
|
|
4180
4167
|
Ps,
|
|
4181
|
-
Ns
|
|
4182
|
-
Rs
|
|
4168
|
+
Ns
|
|
4183
4169
|
];
|
|
4184
|
-
class Le extends
|
|
4170
|
+
class Le extends Wt {
|
|
4185
4171
|
static injectionKey = Symbol.for("EditorKey");
|
|
4186
4172
|
debug = V(!1);
|
|
4187
4173
|
onEmit;
|
|
@@ -4207,7 +4193,7 @@ class Le extends Gt {
|
|
|
4207
4193
|
os,
|
|
4208
4194
|
e
|
|
4209
4195
|
), this.use([
|
|
4210
|
-
...
|
|
4196
|
+
...Rs,
|
|
4211
4197
|
...n
|
|
4212
4198
|
], e);
|
|
4213
4199
|
}
|
|
@@ -4272,19 +4258,19 @@ class Le extends Gt {
|
|
|
4272
4258
|
e.provide(Le.injectionKey, this);
|
|
4273
4259
|
};
|
|
4274
4260
|
}
|
|
4275
|
-
function
|
|
4261
|
+
function tr(o) {
|
|
4276
4262
|
return o;
|
|
4277
4263
|
}
|
|
4278
|
-
function
|
|
4264
|
+
function nr(o) {
|
|
4279
4265
|
return o;
|
|
4280
4266
|
}
|
|
4281
4267
|
function de() {
|
|
4282
4268
|
return Se(Le.injectionKey);
|
|
4283
4269
|
}
|
|
4284
|
-
function
|
|
4270
|
+
function Bs(o = new Le()) {
|
|
4285
4271
|
return De(Le.injectionKey, o), o;
|
|
4286
4272
|
}
|
|
4287
|
-
function
|
|
4273
|
+
function _t() {
|
|
4288
4274
|
return {
|
|
4289
4275
|
icon: {
|
|
4290
4276
|
type: [String, Function, Object, Array]
|
|
@@ -4298,9 +4284,9 @@ function wt() {
|
|
|
4298
4284
|
const dn = X({
|
|
4299
4285
|
name: "MceSvgIcon",
|
|
4300
4286
|
inheritAttrs: !1,
|
|
4301
|
-
props:
|
|
4287
|
+
props: _t(),
|
|
4302
4288
|
setup(o, { attrs: e }) {
|
|
4303
|
-
return () => H(o.tag,
|
|
4289
|
+
return () => H(o.tag, $e(e, { style: null }), {
|
|
4304
4290
|
default: () => [
|
|
4305
4291
|
F("svg", {
|
|
4306
4292
|
class: "mce-icon__svg",
|
|
@@ -4321,9 +4307,9 @@ const dn = X({
|
|
|
4321
4307
|
]
|
|
4322
4308
|
});
|
|
4323
4309
|
}
|
|
4324
|
-
}),
|
|
4310
|
+
}), It = X({
|
|
4325
4311
|
name: "MceComponentIcon",
|
|
4326
|
-
props:
|
|
4312
|
+
props: _t(),
|
|
4327
4313
|
setup(o, { slots: e }) {
|
|
4328
4314
|
return () => H(o.tag, null, {
|
|
4329
4315
|
default: () => [
|
|
@@ -4332,16 +4318,16 @@ const dn = X({
|
|
|
4332
4318
|
});
|
|
4333
4319
|
}
|
|
4334
4320
|
});
|
|
4335
|
-
function
|
|
4321
|
+
function Ls(o) {
|
|
4336
4322
|
const e = Se(mn);
|
|
4337
4323
|
if (!e)
|
|
4338
4324
|
throw new Error("Missing Mce Icons provide!");
|
|
4339
4325
|
return {
|
|
4340
|
-
iconData:
|
|
4326
|
+
iconData: $(() => {
|
|
4341
4327
|
const n = yn(o);
|
|
4342
4328
|
if (!n)
|
|
4343
4329
|
return {
|
|
4344
|
-
component:
|
|
4330
|
+
component: It
|
|
4345
4331
|
};
|
|
4346
4332
|
let s = n;
|
|
4347
4333
|
if (typeof s == "string" && (s = s.trim(), s.startsWith("$") && (s = e.aliases?.[s.slice(1)])), s || console.warn(`Could not find aliased icon "${n}"`), Array.isArray(s))
|
|
@@ -4351,7 +4337,7 @@ function Ds(o) {
|
|
|
4351
4337
|
};
|
|
4352
4338
|
if (typeof s != "string")
|
|
4353
4339
|
return {
|
|
4354
|
-
component:
|
|
4340
|
+
component: It,
|
|
4355
4341
|
icon: s
|
|
4356
4342
|
};
|
|
4357
4343
|
const a = Object.keys(e.sets).find((l) => typeof s == "string" && s.startsWith(`${l}:`)), r = a ? s.slice(a.length + 1) : s;
|
|
@@ -4362,7 +4348,7 @@ function Ds(o) {
|
|
|
4362
4348
|
})
|
|
4363
4349
|
};
|
|
4364
4350
|
}
|
|
4365
|
-
const
|
|
4351
|
+
const Ds = {
|
|
4366
4352
|
play: "M8 5.14v14l11-7z",
|
|
4367
4353
|
pause: "M14 19h4V5h-4M6 19h4V5H6z",
|
|
4368
4354
|
gps: "M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7",
|
|
@@ -4370,19 +4356,19 @@ const Vs = {
|
|
|
4370
4356
|
mouseLeftClick: "M13 9V1.07A8.01 8.01 0 0 1 19.75 7c.16.64.25 1.31.25 2zm4.66-2c-.48-1.35-1.43-2.5-2.66-3.19V7zM6 15v-2h12v2c0 1.59-.63 3.12-1.76 4.24A5.97 5.97 0 0 1 12 21a5.97 5.97 0 0 1-4.24-1.76A5.97 5.97 0 0 1 6 15m-2 0c0 2.12.84 4.16 2.34 5.66S9.88 23 12 23s4.16-.84 5.66-2.34S20 17.12 20 15v-4H4zm7-6V1.07C7.06 1.56 4 4.92 4 9z",
|
|
4371
4357
|
mouseRightClick: "M13 9V1.07c3.94.49 7 3.85 7 7.93zm-2 0V1.07A8.01 8.01 0 0 0 4.25 7C4.09 7.64 4 8.31 4 9zM6.34 7C6.82 5.65 7.78 4.5 9 3.81V7zM6 15v-2h12v2c0 1.59-.63 3.12-1.76 4.24A5.97 5.97 0 0 1 12 21a5.97 5.97 0 0 1-4.24-1.76A5.97 5.97 0 0 1 6 15m-2 0c0 2.12.84 4.16 2.34 5.66S9.88 23 12 23s4.16-.84 5.66-2.34S20 17.12 20 15v-4H4z",
|
|
4372
4358
|
check: "M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"
|
|
4373
|
-
},
|
|
4359
|
+
}, Vs = {
|
|
4374
4360
|
component: dn
|
|
4375
4361
|
}, mn = Symbol.for("mce:icons");
|
|
4376
|
-
function
|
|
4377
|
-
return
|
|
4362
|
+
function js(o = {}) {
|
|
4363
|
+
return Jt({
|
|
4378
4364
|
defaultSet: "svg",
|
|
4379
|
-
aliases:
|
|
4365
|
+
aliases: Ds,
|
|
4380
4366
|
sets: {
|
|
4381
|
-
svg:
|
|
4367
|
+
svg: Vs
|
|
4382
4368
|
}
|
|
4383
4369
|
}, o);
|
|
4384
4370
|
}
|
|
4385
|
-
const
|
|
4371
|
+
const ht = Symbol.for("MceOverlaySymbol"), qe = tn({
|
|
4386
4372
|
location: String,
|
|
4387
4373
|
offset: Number,
|
|
4388
4374
|
target: Object,
|
|
@@ -4391,9 +4377,9 @@ const dt = Symbol.for("MceOverlaySymbol"), nt = tn({
|
|
|
4391
4377
|
default: void 0
|
|
4392
4378
|
}
|
|
4393
4379
|
}, "makeMceOverlayProps");
|
|
4394
|
-
let
|
|
4395
|
-
function
|
|
4396
|
-
return
|
|
4380
|
+
let Us;
|
|
4381
|
+
function Xs() {
|
|
4382
|
+
return Us ??= hn();
|
|
4397
4383
|
}
|
|
4398
4384
|
function hn(o = {}) {
|
|
4399
4385
|
const e = V([]);
|
|
@@ -4401,19 +4387,19 @@ function hn(o = {}) {
|
|
|
4401
4387
|
register: (t) => {
|
|
4402
4388
|
const n = e.value.push(t);
|
|
4403
4389
|
return {
|
|
4404
|
-
index:
|
|
4390
|
+
index: $(() => n),
|
|
4405
4391
|
attach: o.attach
|
|
4406
4392
|
};
|
|
4407
4393
|
},
|
|
4408
4394
|
unregister: (t) => e.value.splice(e.value.indexOf(t), 1)
|
|
4409
4395
|
};
|
|
4410
4396
|
}
|
|
4411
|
-
function
|
|
4412
|
-
let e = Se(
|
|
4413
|
-
return e || (e = hn(o), De(
|
|
4397
|
+
function Hs(o = {}) {
|
|
4398
|
+
let e = Se(ht, null);
|
|
4399
|
+
return e || (e = hn(o), De(ht, e)), e;
|
|
4414
4400
|
}
|
|
4415
|
-
function
|
|
4416
|
-
const o = Se(
|
|
4401
|
+
function Ys() {
|
|
4402
|
+
const o = Se(ht, Xs()), e = Qe();
|
|
4417
4403
|
if (!e)
|
|
4418
4404
|
throw new Error("Failed to useOverlayRoot, vm is null");
|
|
4419
4405
|
const t = o.register(e.uid);
|
|
@@ -4421,36 +4407,36 @@ function qs() {
|
|
|
4421
4407
|
o.unregister(e.uid);
|
|
4422
4408
|
}), t;
|
|
4423
4409
|
}
|
|
4424
|
-
const
|
|
4410
|
+
const qs = tn({
|
|
4425
4411
|
resizeStrategy: Function,
|
|
4426
4412
|
activeStrategy: Function,
|
|
4427
4413
|
hoverStrategy: Function
|
|
4428
|
-
}, "makeMceStrategyProps"),
|
|
4414
|
+
}, "makeMceStrategyProps"), Gs = (o) => {
|
|
4429
4415
|
switch (o.meta?.inPptIs) {
|
|
4430
4416
|
case "Picture":
|
|
4431
4417
|
return "diagonalAspectRatio";
|
|
4432
4418
|
}
|
|
4433
4419
|
return o.foreground.isValid() ? "diagonalAspectRatio" : "free";
|
|
4434
|
-
},
|
|
4420
|
+
}, Ws = (o) => {
|
|
4435
4421
|
const { element: e, oldElement: t, isExcluded: n } = o;
|
|
4436
4422
|
if (e && !n(e))
|
|
4437
4423
|
return e.equal(t) && e.text.isValid() ? {
|
|
4438
4424
|
element: e,
|
|
4439
4425
|
state: "typing"
|
|
4440
4426
|
} : e;
|
|
4441
|
-
},
|
|
4427
|
+
}, Ks = (o) => {
|
|
4442
4428
|
const { element: e, isExcluded: t, oldElement: n } = o;
|
|
4443
4429
|
if (e && !t(e))
|
|
4444
4430
|
return e.equal(n) ? {
|
|
4445
4431
|
element: e,
|
|
4446
4432
|
cursor: "move"
|
|
4447
4433
|
} : e;
|
|
4448
|
-
},
|
|
4434
|
+
}, Js = { class: "mce-auxiliary" }, Zs = /* @__PURE__ */ X({
|
|
4449
4435
|
__name: "Auxiliary",
|
|
4450
4436
|
setup(o) {
|
|
4451
4437
|
const { auxiliaryLines: e } = de();
|
|
4452
|
-
return (t, n) => (
|
|
4453
|
-
(
|
|
4438
|
+
return (t, n) => (O(), R("div", Js, [
|
|
4439
|
+
(O(!0), R(se, null, _e(S(e), (s, a) => (O(), R("div", {
|
|
4454
4440
|
key: a,
|
|
4455
4441
|
class: be(s.class),
|
|
4456
4442
|
style: q({
|
|
@@ -4463,9 +4449,9 @@ const Gs = tn({
|
|
|
4463
4449
|
]));
|
|
4464
4450
|
}
|
|
4465
4451
|
});
|
|
4466
|
-
function
|
|
4452
|
+
function Qs(o, e = "content") {
|
|
4467
4453
|
const t = yo(), n = V();
|
|
4468
|
-
if (
|
|
4454
|
+
if (bt) {
|
|
4469
4455
|
const s = new ResizeObserver((a) => {
|
|
4470
4456
|
o?.(a, s), a.length && (e === "content" ? n.value = a[0].contentRect : n.value = a[0].target.getBoundingClientRect());
|
|
4471
4457
|
});
|
|
@@ -4482,8 +4468,8 @@ function ea(o, e = "content") {
|
|
|
4482
4468
|
contentRect: bn(n)
|
|
4483
4469
|
};
|
|
4484
4470
|
}
|
|
4485
|
-
const
|
|
4486
|
-
function
|
|
4471
|
+
const Je = Symbol.for("mce:layout"), fn = Symbol.for("mce:layout-item"), Ft = 1e3;
|
|
4472
|
+
function ea() {
|
|
4487
4473
|
return {
|
|
4488
4474
|
overlaps: {
|
|
4489
4475
|
type: Array,
|
|
@@ -4492,7 +4478,7 @@ function ta() {
|
|
|
4492
4478
|
fullHeight: Boolean
|
|
4493
4479
|
};
|
|
4494
4480
|
}
|
|
4495
|
-
function
|
|
4481
|
+
function ta() {
|
|
4496
4482
|
return {
|
|
4497
4483
|
name: {
|
|
4498
4484
|
type: String
|
|
@@ -4504,8 +4490,8 @@ function na() {
|
|
|
4504
4490
|
absolute: Boolean
|
|
4505
4491
|
};
|
|
4506
4492
|
}
|
|
4507
|
-
function
|
|
4508
|
-
const o = Se(
|
|
4493
|
+
function na() {
|
|
4494
|
+
const o = Se(Je);
|
|
4509
4495
|
if (!o)
|
|
4510
4496
|
throw new Error("[mce] Could not find injected layout");
|
|
4511
4497
|
return {
|
|
@@ -4514,25 +4500,25 @@ function oa() {
|
|
|
4514
4500
|
mainStyles: o.mainStyles
|
|
4515
4501
|
};
|
|
4516
4502
|
}
|
|
4517
|
-
function
|
|
4518
|
-
const e = Se(
|
|
4503
|
+
function oa(o) {
|
|
4504
|
+
const e = Se(Je);
|
|
4519
4505
|
if (!e)
|
|
4520
4506
|
throw new Error("[mce] Could not find injected layout");
|
|
4521
|
-
const t = o.id ?? `layout-item-${
|
|
4507
|
+
const t = o.id ?? `layout-item-${Dt()}`, n = Qe();
|
|
4522
4508
|
De(fn, { id: t });
|
|
4523
|
-
const s =
|
|
4509
|
+
const s = Ze(!1);
|
|
4524
4510
|
wn(() => s.value = !0), xn(() => s.value = !1);
|
|
4525
4511
|
const {
|
|
4526
4512
|
layoutItemStyles: a,
|
|
4527
4513
|
layoutItemScrimStyles: r
|
|
4528
4514
|
} = e.register(n, {
|
|
4529
4515
|
...o,
|
|
4530
|
-
active:
|
|
4516
|
+
active: $(() => s.value ? !1 : o.active.value),
|
|
4531
4517
|
id: t
|
|
4532
4518
|
});
|
|
4533
4519
|
return we(() => e.unregister(t)), { layoutItemStyles: a, layoutRect: e.layoutRect, layoutItemScrimStyles: r };
|
|
4534
4520
|
}
|
|
4535
|
-
function
|
|
4521
|
+
function sa(o, e, t, n) {
|
|
4536
4522
|
let s = { top: 0, left: 0, right: 0, bottom: 0 };
|
|
4537
4523
|
const a = [{ id: "", layer: { ...s } }];
|
|
4538
4524
|
for (const r of o) {
|
|
@@ -4550,8 +4536,8 @@ function aa(o, e, t, n) {
|
|
|
4550
4536
|
}
|
|
4551
4537
|
return a;
|
|
4552
4538
|
}
|
|
4553
|
-
function
|
|
4554
|
-
const e = Se(
|
|
4539
|
+
function aa(o) {
|
|
4540
|
+
const e = Se(Je, null), t = $(() => e ? e.rootZIndex.value - 100 : Ft), n = V([]), s = Ee(/* @__PURE__ */ new Map()), a = Ee(/* @__PURE__ */ new Map()), r = Ee(/* @__PURE__ */ new Map()), i = Ee(/* @__PURE__ */ new Map()), l = Ee(/* @__PURE__ */ new Map()), { resizeRef: c, contentRect: u } = Qs(), d = $(() => {
|
|
4555
4541
|
const C = /* @__PURE__ */ new Map(), m = o.overlaps ?? [];
|
|
4556
4542
|
for (const b of m.filter((k) => k.includes(":"))) {
|
|
4557
4543
|
const [k, x] = b.split(":");
|
|
@@ -4561,20 +4547,20 @@ function ia(o) {
|
|
|
4561
4547
|
!w || !T || !M || !P || (C.set(x, { position: w.value, amount: Number.parseInt(String(M.value), 10) }), C.set(k, { position: T.value, amount: -Number.parseInt(String(P.value), 10) }));
|
|
4562
4548
|
}
|
|
4563
4549
|
return C;
|
|
4564
|
-
}), g =
|
|
4550
|
+
}), g = $(() => {
|
|
4565
4551
|
const C = [...new Set([...r.values()].map((b) => b.value))].sort((b, k) => b - k), m = [];
|
|
4566
4552
|
for (const b of C) {
|
|
4567
4553
|
const k = n.value.filter((x) => r.get(x)?.value === b);
|
|
4568
4554
|
m.push(...k);
|
|
4569
4555
|
}
|
|
4570
|
-
return
|
|
4571
|
-
}), h =
|
|
4572
|
-
"--mce-layout-left":
|
|
4573
|
-
"--mce-layout-right":
|
|
4574
|
-
"--mce-layout-top":
|
|
4575
|
-
"--mce-layout-bottom":
|
|
4556
|
+
return sa(m, s, a, i);
|
|
4557
|
+
}), h = $(() => !Array.from(l.values()).some((C) => C.value)), v = $(() => g.value[g.value.length - 1].layer), y = Te(() => ({
|
|
4558
|
+
"--mce-layout-left": Ge(v.value.left),
|
|
4559
|
+
"--mce-layout-right": Ge(v.value.right),
|
|
4560
|
+
"--mce-layout-top": Ge(v.value.top),
|
|
4561
|
+
"--mce-layout-bottom": Ge(v.value.bottom),
|
|
4576
4562
|
...h.value ? void 0 : { transition: "none" }
|
|
4577
|
-
})), f =
|
|
4563
|
+
})), f = $(() => g.value.slice(1).map(({ id: C }, m) => {
|
|
4578
4564
|
const { layer: b } = g.value[m], k = a.get(C), x = s.get(C);
|
|
4579
4565
|
return {
|
|
4580
4566
|
id: C,
|
|
@@ -4582,10 +4568,10 @@ function ia(o) {
|
|
|
4582
4568
|
size: Number(k.value),
|
|
4583
4569
|
position: x.value
|
|
4584
4570
|
};
|
|
4585
|
-
})), p = (C) => f.value.find((m) => m.id === C), _ =
|
|
4571
|
+
})), p = (C) => f.value.find((m) => m.id === C), _ = Qe(), z = Ze(!1);
|
|
4586
4572
|
He(() => {
|
|
4587
4573
|
z.value = !0;
|
|
4588
|
-
}), De(
|
|
4574
|
+
}), De(Je, {
|
|
4589
4575
|
register: (C, {
|
|
4590
4576
|
id: m,
|
|
4591
4577
|
order: b,
|
|
@@ -4599,29 +4585,29 @@ function ia(o) {
|
|
|
4599
4585
|
r.set(m, b), s.set(m, k), a.set(m, x), i.set(m, T), M && l.set(m, M);
|
|
4600
4586
|
const A = je(fn, _?.vnode).indexOf(C);
|
|
4601
4587
|
A > -1 ? n.value.splice(A, 0, m) : n.value.push(m);
|
|
4602
|
-
const N =
|
|
4588
|
+
const N = $(() => f.value.findIndex((U) => U.id === m)), L = $(() => t.value + g.value.length * 2 - N.value * 2), j = $(() => {
|
|
4603
4589
|
const U = k.value === "left" || k.value === "right", W = k.value === "right", Z = k.value === "bottom", he = w.value ?? x.value, Y = he === 0 ? "%" : "px", xe = {
|
|
4604
4590
|
[k.value]: 0,
|
|
4605
4591
|
zIndex: L.value,
|
|
4606
4592
|
transform: `translate${U ? "X" : "Y"}(${(T.value ? 0 : -(he === 0 ? 100 : he)) * (W || Z ? -1 : 1)}${Y})`,
|
|
4607
|
-
position: P.value || t.value !==
|
|
4593
|
+
position: P.value || t.value !== Ft ? "absolute" : "fixed",
|
|
4608
4594
|
...h.value ? void 0 : { transition: "none" }
|
|
4609
4595
|
};
|
|
4610
4596
|
if (!z.value)
|
|
4611
4597
|
return xe;
|
|
4612
|
-
const
|
|
4613
|
-
|
|
4598
|
+
const ae = f.value[N.value];
|
|
4599
|
+
ae || uo(`[mce] Could not find layout item "${m}"`);
|
|
4614
4600
|
const ve = d.value.get(m);
|
|
4615
|
-
return ve && (
|
|
4601
|
+
return ve && (ae[ve.position] += ve.amount), {
|
|
4616
4602
|
...xe,
|
|
4617
|
-
height: U ? `calc(100% - ${
|
|
4618
|
-
left: W ? void 0 : `${
|
|
4619
|
-
right: W ? `${
|
|
4620
|
-
top: k.value !== "bottom" ? `${
|
|
4621
|
-
bottom: k.value !== "top" ? `${
|
|
4622
|
-
width: U ? w.value ? `${w.value}px` : void 0 : `calc(100% - ${
|
|
4603
|
+
height: U ? `calc(100% - ${ae.top}px - ${ae.bottom}px)` : w.value ? `${w.value}px` : void 0,
|
|
4604
|
+
left: W ? void 0 : `${ae.left}px`,
|
|
4605
|
+
right: W ? `${ae.right}px` : void 0,
|
|
4606
|
+
top: k.value !== "bottom" ? `${ae.top}px` : void 0,
|
|
4607
|
+
bottom: k.value !== "top" ? `${ae.bottom}px` : void 0,
|
|
4608
|
+
width: U ? w.value ? `${w.value}px` : void 0 : `calc(100% - ${ae.left}px - ${ae.right}px)`
|
|
4623
4609
|
};
|
|
4624
|
-
}), D =
|
|
4610
|
+
}), D = $(() => ({
|
|
4625
4611
|
zIndex: L.value - 1
|
|
4626
4612
|
}));
|
|
4627
4613
|
return { layoutItemStyles: j, layoutItemScrimStyles: D, zIndex: L };
|
|
@@ -4636,16 +4622,16 @@ function ia(o) {
|
|
|
4636
4622
|
layoutRect: u,
|
|
4637
4623
|
rootZIndex: t
|
|
4638
4624
|
});
|
|
4639
|
-
const
|
|
4625
|
+
const I = Te(() => [
|
|
4640
4626
|
"mce-layout",
|
|
4641
4627
|
{ "mce-layout--full-height": o.fullHeight }
|
|
4642
|
-
]), E =
|
|
4628
|
+
]), E = Te(() => ({
|
|
4643
4629
|
zIndex: e ? t.value : void 0,
|
|
4644
4630
|
position: e ? "relative" : void 0,
|
|
4645
4631
|
overflow: e ? "hidden" : void 0
|
|
4646
4632
|
}));
|
|
4647
4633
|
return {
|
|
4648
|
-
layoutClasses:
|
|
4634
|
+
layoutClasses: I,
|
|
4649
4635
|
layoutStyles: E,
|
|
4650
4636
|
getLayoutItem: p,
|
|
4651
4637
|
items: f,
|
|
@@ -4653,15 +4639,15 @@ function ia(o) {
|
|
|
4653
4639
|
layoutRef: c
|
|
4654
4640
|
};
|
|
4655
4641
|
}
|
|
4656
|
-
const
|
|
4642
|
+
const Pt = Symbol.for("MceMenuSymbol"), Ae = /* @__PURE__ */ X({
|
|
4657
4643
|
__name: "Icon",
|
|
4658
4644
|
props: {
|
|
4659
4645
|
disabled: Boolean,
|
|
4660
|
-
...
|
|
4646
|
+
..._t()
|
|
4661
4647
|
},
|
|
4662
4648
|
setup(o) {
|
|
4663
|
-
const e = o, t =
|
|
4664
|
-
return (a, r) => (
|
|
4649
|
+
const e = o, t = Vt(), { iconData: n } = Ls($(() => e.icon)), s = !!(t.onClick || t.onClickOnce);
|
|
4650
|
+
return (a, r) => (O(), oe(jt(S(n).component), {
|
|
4665
4651
|
icon: S(n).icon,
|
|
4666
4652
|
tag: e.tag,
|
|
4667
4653
|
class: be(["mce-icon", {
|
|
@@ -4672,7 +4658,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4672
4658
|
tabindex: s ? e.disabled ? -1 : 0 : void 0
|
|
4673
4659
|
}, null, 8, ["icon", "tag", "class", "role", "aria-hidden", "tabindex"]));
|
|
4674
4660
|
}
|
|
4675
|
-
}),
|
|
4661
|
+
}), ot = /* @__PURE__ */ X({
|
|
4676
4662
|
inheritAttrs: !1,
|
|
4677
4663
|
__name: "Overlay",
|
|
4678
4664
|
props: {
|
|
@@ -4680,11 +4666,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4680
4666
|
type: Boolean,
|
|
4681
4667
|
default: !1
|
|
4682
4668
|
},
|
|
4683
|
-
...
|
|
4669
|
+
...qe()
|
|
4684
4670
|
},
|
|
4685
4671
|
emits: ["click:outside", "update:modelValue"],
|
|
4686
4672
|
setup(o, { expose: e, emit: t }) {
|
|
4687
|
-
const n = o, s = t, a =
|
|
4673
|
+
const n = o, s = t, a = Ys(), r = $({
|
|
4688
4674
|
get: () => n.modelValue,
|
|
4689
4675
|
set: (p) => s("update:modelValue", p)
|
|
4690
4676
|
}), i = V(), l = {
|
|
@@ -4701,18 +4687,18 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4701
4687
|
height: 0
|
|
4702
4688
|
};
|
|
4703
4689
|
}
|
|
4704
|
-
}, c =
|
|
4705
|
-
placement:
|
|
4690
|
+
}, c = $(() => typeof n.target == "object" && !(n.target instanceof Element) && "x" in n.target && "y" in n.target ? l : n.target ?? i.value), u = ce("contentElTpl"), d = $(() => n.attach ?? a.attach?.value ?? "body"), { floatingStyles: g, update: h } = Gn(c, u, {
|
|
4691
|
+
placement: $(() => n.location),
|
|
4706
4692
|
whileElementsMounted: Zn,
|
|
4707
4693
|
middleware: [
|
|
4708
4694
|
Wn(() => n.offset ?? 0),
|
|
4709
4695
|
Kn(),
|
|
4710
4696
|
Jn({ padding: 20 })
|
|
4711
4697
|
]
|
|
4712
|
-
}), v =
|
|
4698
|
+
}), v = $(() => ({
|
|
4713
4699
|
...g.value,
|
|
4714
4700
|
zIndex: 2e3 + a.index.value
|
|
4715
|
-
})), y =
|
|
4701
|
+
})), y = $(() => ({
|
|
4716
4702
|
ref: (p) => i.value = p
|
|
4717
4703
|
}));
|
|
4718
4704
|
let f = [];
|
|
@@ -4726,41 +4712,41 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4726
4712
|
);
|
|
4727
4713
|
f = [
|
|
4728
4714
|
_,
|
|
4729
|
-
|
|
4715
|
+
Xt("pointerdown", p, { passive: !0, capture: !0 })
|
|
4730
4716
|
];
|
|
4731
4717
|
}), we(() => f.forEach((p) => p())), e({
|
|
4732
4718
|
activatorEl: i,
|
|
4733
4719
|
target: c,
|
|
4734
4720
|
contentEl: u,
|
|
4735
4721
|
updateLocation: h
|
|
4736
|
-
}), (p, _) => (
|
|
4737
|
-
|
|
4722
|
+
}), (p, _) => (O(), R(se, null, [
|
|
4723
|
+
Q(p.$slots, "activator", {
|
|
4738
4724
|
props: y.value,
|
|
4739
4725
|
isActive: r.value
|
|
4740
4726
|
}),
|
|
4741
|
-
(
|
|
4727
|
+
(O(), oe(_n, {
|
|
4742
4728
|
disabled: d.value === !1,
|
|
4743
4729
|
to: typeof d.value == "boolean" ? void 0 : d.value
|
|
4744
4730
|
}, [
|
|
4745
|
-
r.value ? (
|
|
4731
|
+
r.value ? (O(), R("div", $e({
|
|
4746
4732
|
key: 0,
|
|
4747
4733
|
ref: "contentElTpl",
|
|
4748
4734
|
class: "mce-overlay",
|
|
4749
4735
|
style: v.value
|
|
4750
4736
|
}, p.$attrs), [
|
|
4751
|
-
|
|
4752
|
-
], 16)) :
|
|
4737
|
+
Q(p.$slots, "default")
|
|
4738
|
+
], 16)) : ee("", !0)
|
|
4753
4739
|
], 8, ["disabled", "to"]))
|
|
4754
4740
|
], 64));
|
|
4755
4741
|
}
|
|
4756
|
-
}),
|
|
4742
|
+
}), ia = ["onMouseenter"], ra = ["onClick"], la = { class: "mce-list-item__prepend" }, ca = { class: "mce-list-item__title" }, ua = {
|
|
4757
4743
|
key: 0,
|
|
4758
4744
|
class: "mce-list-item__append"
|
|
4759
|
-
},
|
|
4745
|
+
}, da = /* @__PURE__ */ X({
|
|
4760
4746
|
name: "MceMenu",
|
|
4761
4747
|
__name: "Menu",
|
|
4762
|
-
props: /* @__PURE__ */
|
|
4763
|
-
...
|
|
4748
|
+
props: /* @__PURE__ */ Oe({
|
|
4749
|
+
...qe(),
|
|
4764
4750
|
items: Object,
|
|
4765
4751
|
openOnHover: Boolean,
|
|
4766
4752
|
persistent: Boolean
|
|
@@ -4768,10 +4754,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4768
4754
|
modelValue: { type: Boolean },
|
|
4769
4755
|
modelModifiers: {}
|
|
4770
4756
|
}),
|
|
4771
|
-
emits: /* @__PURE__ */
|
|
4757
|
+
emits: /* @__PURE__ */ Oe(["click:item"], ["update:modelValue"]),
|
|
4772
4758
|
setup(o, { expose: e, emit: t }) {
|
|
4773
|
-
const n = o, s = t, a =
|
|
4774
|
-
De(
|
|
4759
|
+
const n = o, s = t, a = ke(o, "modelValue"), r = V(-1), i = ce("overlayTpl"), l = ce("menuItemTplRefs"), c = Dt(), u = Se(Pt, null), d = Ze(/* @__PURE__ */ new Set());
|
|
4760
|
+
De(Pt, {
|
|
4775
4761
|
register: () => d.value.add(c),
|
|
4776
4762
|
unregister: () => d.value.delete(c),
|
|
4777
4763
|
closeParents(p) {
|
|
@@ -4780,7 +4766,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4780
4766
|
}), we(() => {
|
|
4781
4767
|
u?.unregister();
|
|
4782
4768
|
});
|
|
4783
|
-
const g =
|
|
4769
|
+
const g = $(() => {
|
|
4784
4770
|
const p = {};
|
|
4785
4771
|
return n.openOnHover && (p.onMouseenter = () => a.value = !0), p;
|
|
4786
4772
|
});
|
|
@@ -4801,10 +4787,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4801
4787
|
updateLocation: v
|
|
4802
4788
|
}), (p, _) => {
|
|
4803
4789
|
const z = kn("MceMenu");
|
|
4804
|
-
return
|
|
4790
|
+
return O(), oe(ot, {
|
|
4805
4791
|
ref: "overlayTpl",
|
|
4806
4792
|
modelValue: a.value,
|
|
4807
|
-
"onUpdate:modelValue": _[2] || (_[2] = (
|
|
4793
|
+
"onUpdate:modelValue": _[2] || (_[2] = (I) => a.value = I),
|
|
4808
4794
|
location: n.location,
|
|
4809
4795
|
offset: n.offset,
|
|
4810
4796
|
target: n.target,
|
|
@@ -4812,55 +4798,55 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4812
4798
|
class: "mce-menu",
|
|
4813
4799
|
"onClick:outside": h
|
|
4814
4800
|
}, {
|
|
4815
|
-
activator:
|
|
4816
|
-
|
|
4817
|
-
props: {
|
|
4801
|
+
activator: ne((I) => [
|
|
4802
|
+
Q(p.$slots, "activator", $e(I, {
|
|
4803
|
+
props: { ...I.props, ...g.value }
|
|
4818
4804
|
}))
|
|
4819
4805
|
]),
|
|
4820
|
-
default:
|
|
4821
|
-
o.items?.length ? (
|
|
4806
|
+
default: ne(() => [
|
|
4807
|
+
o.items?.length ? (O(), R("div", {
|
|
4822
4808
|
key: 0,
|
|
4823
4809
|
class: "mce-list",
|
|
4824
4810
|
onMouseleave: f
|
|
4825
4811
|
}, [
|
|
4826
|
-
(
|
|
4827
|
-
|
|
4812
|
+
(O(!0), R(se, null, _e(o.items, (I, E) => (O(), R(se, { key: E }, [
|
|
4813
|
+
I.type === "divider" ? (O(), R("div", {
|
|
4828
4814
|
key: 0,
|
|
4829
4815
|
ref_for: !0,
|
|
4830
4816
|
ref: "menuItemTplRefs",
|
|
4831
4817
|
class: "mce-list__divider"
|
|
4832
|
-
}, null, 512)) : (
|
|
4818
|
+
}, null, 512)) : (O(), R("div", {
|
|
4833
4819
|
key: 1,
|
|
4834
4820
|
ref_for: !0,
|
|
4835
4821
|
ref: "menuItemTplRefs",
|
|
4836
4822
|
class: "mce-list__item",
|
|
4837
|
-
onMouseenter: (C) =>
|
|
4823
|
+
onMouseenter: (C) => I.disabled ? r.value = -1 : r.value = E
|
|
4838
4824
|
}, [
|
|
4839
4825
|
F("div", {
|
|
4840
4826
|
class: be(["mce-list-item", [
|
|
4841
|
-
|
|
4827
|
+
I.disabled && "mce-list-item--disabled",
|
|
4842
4828
|
r.value === E && "mce-list-item--opened"
|
|
4843
4829
|
]]),
|
|
4844
|
-
onClick: (C) => y(
|
|
4830
|
+
onClick: (C) => y(I, E, C)
|
|
4845
4831
|
}, [
|
|
4846
|
-
F("div",
|
|
4847
|
-
|
|
4832
|
+
F("div", la, [
|
|
4833
|
+
I.checked ? (O(), oe(Ae, {
|
|
4848
4834
|
key: 0,
|
|
4849
4835
|
icon: "$check"
|
|
4850
|
-
})) :
|
|
4836
|
+
})) : ee("", !0)
|
|
4851
4837
|
]),
|
|
4852
|
-
F("div",
|
|
4853
|
-
|
|
4854
|
-
Cn(K(
|
|
4838
|
+
F("div", ca, [
|
|
4839
|
+
Q(p.$slots, "title", { item: I }, () => [
|
|
4840
|
+
Cn(K(I.key), 1)
|
|
4855
4841
|
])
|
|
4856
4842
|
]),
|
|
4857
|
-
|
|
4858
|
-
H(
|
|
4859
|
-
])) :
|
|
4860
|
-
], 10,
|
|
4861
|
-
], 40,
|
|
4843
|
+
I.children?.length ? (O(), R("div", ua, [
|
|
4844
|
+
H(Ae, { icon: "$menuRight" })
|
|
4845
|
+
])) : ee("", !0)
|
|
4846
|
+
], 10, ra)
|
|
4847
|
+
], 40, ia))
|
|
4862
4848
|
], 64))), 128)),
|
|
4863
|
-
r.value > -1 && o.items?.[r.value]?.children?.length ? (
|
|
4849
|
+
r.value > -1 && o.items?.[r.value]?.children?.length ? (O(), oe(z, {
|
|
4864
4850
|
key: 0,
|
|
4865
4851
|
"open-on-hover": "",
|
|
4866
4852
|
items: o.items?.[r.value]?.children,
|
|
@@ -4869,27 +4855,27 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4869
4855
|
target: l.value?.[r.value],
|
|
4870
4856
|
attach: !1,
|
|
4871
4857
|
offset: 16,
|
|
4872
|
-
"onUpdate:modelValue": _[0] || (_[0] = (
|
|
4873
|
-
"onClick:item": _[1] || (_[1] = (
|
|
4874
|
-
},
|
|
4858
|
+
"onUpdate:modelValue": _[0] || (_[0] = (I) => r.value = -1),
|
|
4859
|
+
"onClick:item": _[1] || (_[1] = (I, E) => s("click:item", I, E))
|
|
4860
|
+
}, pt({ _: 2 }, [
|
|
4875
4861
|
p.$slots.title ? {
|
|
4876
4862
|
name: "title",
|
|
4877
|
-
fn:
|
|
4878
|
-
|
|
4863
|
+
fn: ne((I) => [
|
|
4864
|
+
Q(p.$slots, "title", vt(yt(I)))
|
|
4879
4865
|
]),
|
|
4880
4866
|
key: "0"
|
|
4881
4867
|
} : void 0
|
|
4882
|
-
]), 1032, ["items", "model-value", "target"])) :
|
|
4883
|
-
], 32)) :
|
|
4868
|
+
]), 1032, ["items", "model-value", "target"])) : ee("", !0)
|
|
4869
|
+
], 32)) : ee("", !0)
|
|
4884
4870
|
]),
|
|
4885
4871
|
_: 3
|
|
4886
4872
|
}, 8, ["modelValue", "location", "offset", "target", "attach"]);
|
|
4887
4873
|
};
|
|
4888
4874
|
}
|
|
4889
|
-
}),
|
|
4875
|
+
}), ma = { class: "mce-context-menu__title" }, ha = {
|
|
4890
4876
|
key: 0,
|
|
4891
4877
|
class: "mce-context-menu__kbd"
|
|
4892
|
-
},
|
|
4878
|
+
}, fa = /* @__PURE__ */ X({
|
|
4893
4879
|
__name: "ContextMenu",
|
|
4894
4880
|
props: {
|
|
4895
4881
|
modelValue: { type: Boolean },
|
|
@@ -4909,7 +4895,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4909
4895
|
getKbd: r,
|
|
4910
4896
|
t: i,
|
|
4911
4897
|
hotkeys: l
|
|
4912
|
-
} = de(), c =
|
|
4898
|
+
} = de(), c = ke(o, "modelValue"), u = ke(o, "position"), d = ce("menuTplRef");
|
|
4913
4899
|
function g() {
|
|
4914
4900
|
d.value?.updateLocation();
|
|
4915
4901
|
}
|
|
@@ -4929,7 +4915,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4929
4915
|
}
|
|
4930
4916
|
return e({
|
|
4931
4917
|
updateLocation: g
|
|
4932
|
-
}), (y, f) => (
|
|
4918
|
+
}), (y, f) => (O(), oe(da, {
|
|
4933
4919
|
ref: "menuTplRef",
|
|
4934
4920
|
modelValue: c.value,
|
|
4935
4921
|
"onUpdate:modelValue": f[0] || (f[0] = (p) => c.value = p),
|
|
@@ -4943,17 +4929,17 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4943
4929
|
}),
|
|
4944
4930
|
"onClick:item": v
|
|
4945
4931
|
}, {
|
|
4946
|
-
title:
|
|
4947
|
-
F("span",
|
|
4948
|
-
S(l).has(p.key) ? (
|
|
4932
|
+
title: ne(({ item: p }) => [
|
|
4933
|
+
F("span", ma, K(S(i)(p.key)), 1),
|
|
4934
|
+
S(l).has(p.key) ? (O(), R("span", ha, K(S(r)(p.key)), 1)) : ee("", !0)
|
|
4949
4935
|
]),
|
|
4950
4936
|
_: 1
|
|
4951
4937
|
}, 8, ["modelValue", "target", "items", "style"]));
|
|
4952
4938
|
}
|
|
4953
|
-
}),
|
|
4939
|
+
}), pa = {
|
|
4954
4940
|
key: 0,
|
|
4955
4941
|
class: "mce-drawing__content"
|
|
4956
|
-
},
|
|
4942
|
+
}, va = /* @__PURE__ */ X({
|
|
4957
4943
|
__name: "Drawing",
|
|
4958
4944
|
setup(o) {
|
|
4959
4945
|
const {
|
|
@@ -4971,7 +4957,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4971
4957
|
});
|
|
4972
4958
|
t.value?.callback?.(d), r(void 0);
|
|
4973
4959
|
}
|
|
4974
|
-
return (u, d) => S(e) === "drawing" ? (
|
|
4960
|
+
return (u, d) => S(e) === "drawing" ? (O(), R("div", {
|
|
4975
4961
|
key: 0,
|
|
4976
4962
|
class: "mce-drawing",
|
|
4977
4963
|
style: q({
|
|
@@ -4980,13 +4966,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4980
4966
|
}),
|
|
4981
4967
|
onMousedown: c
|
|
4982
4968
|
}, [
|
|
4983
|
-
S(t)?.content ? (
|
|
4984
|
-
], 36)) :
|
|
4969
|
+
S(t)?.content ? (O(), R("div", pa, K(S(n)(S(t).content)), 1)) : ee("", !0)
|
|
4970
|
+
], 36)) : ee("", !0);
|
|
4985
4971
|
}
|
|
4986
|
-
}),
|
|
4972
|
+
}), ya = /* @__PURE__ */ X({
|
|
4987
4973
|
__name: "Floatbar",
|
|
4988
4974
|
props: {
|
|
4989
|
-
...
|
|
4975
|
+
...qe({
|
|
4990
4976
|
location: "top-start",
|
|
4991
4977
|
offset: 8
|
|
4992
4978
|
})
|
|
@@ -4996,7 +4982,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
4996
4982
|
getAabbInDrawboard: n,
|
|
4997
4983
|
selection: s,
|
|
4998
4984
|
isFrame: a
|
|
4999
|
-
} = de(), r =
|
|
4985
|
+
} = de(), r = ce("overlayTpl");
|
|
5000
4986
|
function i() {
|
|
5001
4987
|
r.value?.updateLocation();
|
|
5002
4988
|
}
|
|
@@ -5004,7 +4990,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5004
4990
|
deep: !0
|
|
5005
4991
|
}), e({
|
|
5006
4992
|
updateLocation: i
|
|
5007
|
-
}), (l, c) => (
|
|
4993
|
+
}), (l, c) => (O(), oe(ot, {
|
|
5008
4994
|
ref: "overlayTpl",
|
|
5009
4995
|
class: "mce-floatbar",
|
|
5010
4996
|
location: t.location,
|
|
@@ -5013,13 +4999,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5013
4999
|
attach: !1,
|
|
5014
5000
|
"model-value": !0
|
|
5015
5001
|
}, {
|
|
5016
|
-
default:
|
|
5017
|
-
S(s).length > 0 ?
|
|
5002
|
+
default: ne(() => [
|
|
5003
|
+
S(s).length > 0 ? Q(l.$slots, "default", { key: 0 }) : ee("", !0)
|
|
5018
5004
|
]),
|
|
5019
5005
|
_: 3
|
|
5020
5006
|
}, 8, ["location", "offset", "target"]));
|
|
5021
5007
|
}
|
|
5022
|
-
}),
|
|
5008
|
+
}), ga = /* @__PURE__ */ X({
|
|
5023
5009
|
__name: "Frame",
|
|
5024
5010
|
props: {
|
|
5025
5011
|
modelValue: { required: !0 },
|
|
@@ -5027,7 +5013,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5027
5013
|
},
|
|
5028
5014
|
emits: ["update:modelValue"],
|
|
5029
5015
|
setup(o) {
|
|
5030
|
-
const e =
|
|
5016
|
+
const e = ke(o, "modelValue"), t = ce("inputTpl"), {
|
|
5031
5017
|
getObbInDrawboard: n,
|
|
5032
5018
|
hoverElement: s,
|
|
5033
5019
|
selection: a,
|
|
@@ -5036,12 +5022,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5036
5022
|
exec: l
|
|
5037
5023
|
} = de(), c = V(!1);
|
|
5038
5024
|
async function u() {
|
|
5039
|
-
c.value = !0, await
|
|
5025
|
+
c.value = !0, await Re(), t.value && (t.value.focus(), t.value.select());
|
|
5040
5026
|
}
|
|
5041
5027
|
async function d(g) {
|
|
5042
|
-
c.value || (a.value = [e.value], await
|
|
5028
|
+
c.value || (a.value = [e.value], await Re(), l("startTransform", g));
|
|
5043
5029
|
}
|
|
5044
|
-
return (g, h) => ze((
|
|
5030
|
+
return (g, h) => ze((O(), R("div", {
|
|
5045
5031
|
style: q(S(Me)(S(n)(e.value))),
|
|
5046
5032
|
class: be(["mce-frame", [
|
|
5047
5033
|
S(i).frameOutline && "mce-frame--outline"
|
|
@@ -5070,18 +5056,18 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5070
5056
|
[Xe, e.value.visible]
|
|
5071
5057
|
]);
|
|
5072
5058
|
}
|
|
5073
|
-
}),
|
|
5059
|
+
}), ba = /* @__PURE__ */ X({
|
|
5074
5060
|
__name: "Frames",
|
|
5075
5061
|
setup(o) {
|
|
5076
5062
|
const {
|
|
5077
5063
|
frames: e
|
|
5078
5064
|
} = de();
|
|
5079
|
-
return (t, n) => (
|
|
5065
|
+
return (t, n) => (O(!0), R(se, null, _e(S(e), (s, a) => (O(), oe(ga, {
|
|
5080
5066
|
key: a,
|
|
5081
5067
|
"model-value": s
|
|
5082
5068
|
}, null, 8, ["model-value"]))), 128));
|
|
5083
5069
|
}
|
|
5084
|
-
}),
|
|
5070
|
+
}), wa = /* @__PURE__ */ X({
|
|
5085
5071
|
__name: "GoBackSelectedArea",
|
|
5086
5072
|
setup(o) {
|
|
5087
5073
|
const {
|
|
@@ -5090,28 +5076,28 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5090
5076
|
aabbToDrawboardAabb: n,
|
|
5091
5077
|
exec: s,
|
|
5092
5078
|
t: a
|
|
5093
|
-
} = de(), r =
|
|
5079
|
+
} = de(), r = $(() => e.value.width && e.value.height && !Be(
|
|
5094
5080
|
t.value,
|
|
5095
5081
|
n(e.value)
|
|
5096
5082
|
));
|
|
5097
|
-
return (i, l) => r.value ? (
|
|
5083
|
+
return (i, l) => r.value ? (O(), R("div", {
|
|
5098
5084
|
key: 0,
|
|
5099
5085
|
class: "mce-back-selected-aera",
|
|
5100
|
-
onClick: l[0] || (l[0] =
|
|
5086
|
+
onClick: l[0] || (l[0] = Ke((c) => S(s)("zoomToSelection"), ["prevent"]))
|
|
5101
5087
|
}, [
|
|
5102
|
-
H(
|
|
5088
|
+
H(Ae, { icon: "$gps" }),
|
|
5103
5089
|
F("span", null, K(S(a)("goBackSelectedArea")), 1)
|
|
5104
|
-
])) :
|
|
5090
|
+
])) : ee("", !0);
|
|
5105
5091
|
}
|
|
5106
|
-
}),
|
|
5092
|
+
}), xa = ["data-name"], _a = /* @__PURE__ */ X({
|
|
5107
5093
|
__name: "Hover",
|
|
5108
5094
|
setup(o) {
|
|
5109
5095
|
const {
|
|
5110
5096
|
selection: e,
|
|
5111
5097
|
hoverElement: t,
|
|
5112
5098
|
getObbInDrawboard: n
|
|
5113
|
-
} = de(), s =
|
|
5114
|
-
return (a, r) => S(t) && !S(t).equal(S(e)[0]) ? (
|
|
5099
|
+
} = de(), s = $(() => n(t.value));
|
|
5100
|
+
return (a, r) => S(t) && !S(t).equal(S(e)[0]) ? (O(), R("div", {
|
|
5115
5101
|
key: 0,
|
|
5116
5102
|
class: "mce-hover",
|
|
5117
5103
|
"data-name": S(t).name,
|
|
@@ -5119,12 +5105,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5119
5105
|
borderColor: "currentcolor",
|
|
5120
5106
|
...S(Me)(s.value)
|
|
5121
5107
|
})
|
|
5122
|
-
}, null, 12,
|
|
5108
|
+
}, null, 12, xa)) : ee("", !0);
|
|
5123
5109
|
}
|
|
5124
|
-
}),
|
|
5110
|
+
}), ka = /* @__PURE__ */ X({
|
|
5125
5111
|
__name: "Tooltip",
|
|
5126
|
-
props: /* @__PURE__ */
|
|
5127
|
-
...
|
|
5112
|
+
props: /* @__PURE__ */ Oe({
|
|
5113
|
+
...qe({
|
|
5128
5114
|
location: "right",
|
|
5129
5115
|
offset: 8
|
|
5130
5116
|
})
|
|
@@ -5134,13 +5120,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5134
5120
|
}),
|
|
5135
5121
|
emits: ["update:modelValue"],
|
|
5136
5122
|
setup(o, { expose: e }) {
|
|
5137
|
-
const t = o, n =
|
|
5123
|
+
const t = o, n = ke(o, "modelValue"), s = ce("overlayTpl");
|
|
5138
5124
|
function a() {
|
|
5139
5125
|
s.value?.updateLocation();
|
|
5140
5126
|
}
|
|
5141
5127
|
return e({
|
|
5142
5128
|
updateLocation: a
|
|
5143
|
-
}), (r, i) => (
|
|
5129
|
+
}), (r, i) => (O(), oe(ot, {
|
|
5144
5130
|
ref: "overlayTpl",
|
|
5145
5131
|
modelValue: n.value,
|
|
5146
5132
|
"onUpdate:modelValue": i[0] || (i[0] = (l) => n.value = l),
|
|
@@ -5149,22 +5135,22 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5149
5135
|
offset: t.offset,
|
|
5150
5136
|
target: t.target,
|
|
5151
5137
|
attach: t.attach
|
|
5152
|
-
},
|
|
5153
|
-
default:
|
|
5154
|
-
n.value ?
|
|
5138
|
+
}, pt({
|
|
5139
|
+
default: ne(() => [
|
|
5140
|
+
n.value ? Q(r.$slots, "default", { key: 0 }) : ee("", !0)
|
|
5155
5141
|
]),
|
|
5156
5142
|
_: 2
|
|
5157
5143
|
}, [
|
|
5158
5144
|
r.$slots.activator ? {
|
|
5159
5145
|
name: "activator",
|
|
5160
|
-
fn:
|
|
5161
|
-
|
|
5146
|
+
fn: ne((l) => [
|
|
5147
|
+
Q(r.$slots, "activator", vt(yt(l)))
|
|
5162
5148
|
]),
|
|
5163
5149
|
key: "0"
|
|
5164
5150
|
} : void 0
|
|
5165
5151
|
]), 1032, ["modelValue", "location", "offset", "target", "attach"]));
|
|
5166
5152
|
}
|
|
5167
|
-
}),
|
|
5153
|
+
}), Ca = ["width", "height"], Ea = ["onDblclick", "onMousedown", "onMousemove"], Ta = { style: { "font-size": "12px", "text-wrap": "nowrap" } }, ft = /* @__PURE__ */ X({
|
|
5168
5154
|
inheritAttrs: !1,
|
|
5169
5155
|
__name: "Ruler",
|
|
5170
5156
|
props: {
|
|
@@ -5181,7 +5167,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5181
5167
|
labelFormat: { type: Function, default: (o) => String(o) }
|
|
5182
5168
|
},
|
|
5183
5169
|
setup(o, { expose: e }) {
|
|
5184
|
-
const t = o, n =
|
|
5170
|
+
const t = o, n = Vt(), s = $(() => t.pixelRatio), a = V(), r = V({ x: 0, y: 0 }), i = ce("canvasTpl"), l = "OffscreenCanvas" in window ? new OffscreenCanvas(t.size, t.size) : document.createElement("canvas"), c = l.getContext("2d"), u = V(), d = Ee({
|
|
5185
5171
|
text: "#000",
|
|
5186
5172
|
border: "#000"
|
|
5187
5173
|
});
|
|
@@ -5204,7 +5190,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5204
5190
|
const D = N, U = t.size - L;
|
|
5205
5191
|
c.save(), t.vertical && (c.translate(0, t.size), c.scale(1, -1)), c.fillText(A, D, U), c.restore();
|
|
5206
5192
|
}
|
|
5207
|
-
const f =
|
|
5193
|
+
const f = $(() => {
|
|
5208
5194
|
const A = Math.max(t.unit / t.zoom, 1), N = t.unitFractions, L = Math.floor(Math.log10(A)), j = A / 10 ** L;
|
|
5209
5195
|
let D = N[N.length - 1];
|
|
5210
5196
|
for (const U of N)
|
|
@@ -5213,17 +5199,17 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5213
5199
|
break;
|
|
5214
5200
|
}
|
|
5215
5201
|
return D * 10 ** L;
|
|
5216
|
-
}), p =
|
|
5202
|
+
}), p = $(() => {
|
|
5217
5203
|
const A = -t.position / t.zoom;
|
|
5218
5204
|
return Math.floor(A / f.value) * f.value;
|
|
5219
|
-
}), _ =
|
|
5205
|
+
}), _ = $(() => {
|
|
5220
5206
|
const N = ((t.vertical ? u.value?.height : u.value?.width) ?? 0) / t.zoom;
|
|
5221
5207
|
return p.value + Math.ceil(N / f.value) * f.value;
|
|
5222
5208
|
});
|
|
5223
5209
|
function z(A) {
|
|
5224
5210
|
return Math.round(A * t.zoom + t.position);
|
|
5225
5211
|
}
|
|
5226
|
-
function
|
|
5212
|
+
function I(A) {
|
|
5227
5213
|
return Math.round((A - t.position) / t.zoom);
|
|
5228
5214
|
}
|
|
5229
5215
|
function E() {
|
|
@@ -5260,7 +5246,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5260
5246
|
},
|
|
5261
5247
|
{ immediate: !0, deep: !0 }
|
|
5262
5248
|
);
|
|
5263
|
-
const C =
|
|
5249
|
+
const C = Yt(() => {
|
|
5264
5250
|
if (!i.value)
|
|
5265
5251
|
return;
|
|
5266
5252
|
const A = i.value.parentElement.getBoundingClientRect();
|
|
@@ -5276,12 +5262,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5276
5262
|
}), we(() => {
|
|
5277
5263
|
l.width = 0, l.height = 0;
|
|
5278
5264
|
});
|
|
5279
|
-
const m = V([]), b = V(), k =
|
|
5265
|
+
const m = V([]), b = V(), k = $(() => {
|
|
5280
5266
|
const A = [...m.value];
|
|
5281
5267
|
return typeof b.value == "number" && A.unshift(b.value), A;
|
|
5282
5268
|
});
|
|
5283
5269
|
function x(A) {
|
|
5284
|
-
return
|
|
5270
|
+
return I(
|
|
5285
5271
|
t.vertical ? A.clientY - u.value.top : A.clientX - u.value.left
|
|
5286
5272
|
);
|
|
5287
5273
|
}
|
|
@@ -5310,8 +5296,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5310
5296
|
}
|
|
5311
5297
|
return e({
|
|
5312
5298
|
box: u
|
|
5313
|
-
}), (A, N) => (
|
|
5314
|
-
ze((
|
|
5299
|
+
}), (A, N) => (O(), R(se, null, [
|
|
5300
|
+
ze((O(), R("div", $e({
|
|
5315
5301
|
class: ["mce-ruler", [
|
|
5316
5302
|
`mce-ruler--${t.vertical ? "vertical" : "horizontal"}`
|
|
5317
5303
|
]],
|
|
@@ -5326,11 +5312,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5326
5312
|
class: "mce-ruler__canvas",
|
|
5327
5313
|
width: t.size,
|
|
5328
5314
|
height: t.size
|
|
5329
|
-
}, null, 8,
|
|
5315
|
+
}, null, 8, Ca)
|
|
5330
5316
|
], 16)), [
|
|
5331
|
-
[S(
|
|
5317
|
+
[S(Zt), S(C)]
|
|
5332
5318
|
]),
|
|
5333
|
-
(
|
|
5319
|
+
(O(!0), R(se, null, _e(k.value, (L, j) => (O(), R("div", {
|
|
5334
5320
|
key: j,
|
|
5335
5321
|
class: be(["mce-ruler-refline", {
|
|
5336
5322
|
"mce-ruler-refline--vertical": t.vertical,
|
|
@@ -5347,20 +5333,20 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5347
5333
|
onMousedown: (D) => B(D, j),
|
|
5348
5334
|
onMousemove: () => a.value = `${L}`,
|
|
5349
5335
|
onMouseleave: M
|
|
5350
|
-
}, null, 46,
|
|
5351
|
-
H(
|
|
5336
|
+
}, null, 46, Ea))), 128)),
|
|
5337
|
+
H(ka, {
|
|
5352
5338
|
"model-value": !!a.value,
|
|
5353
5339
|
target: r.value,
|
|
5354
5340
|
offset: 24
|
|
5355
5341
|
}, {
|
|
5356
|
-
default:
|
|
5357
|
-
F("div",
|
|
5342
|
+
default: ne(() => [
|
|
5343
|
+
F("div", Ta, K(a.value), 1)
|
|
5358
5344
|
]),
|
|
5359
5345
|
_: 1
|
|
5360
5346
|
}, 8, ["model-value", "target"])
|
|
5361
5347
|
], 64));
|
|
5362
5348
|
}
|
|
5363
|
-
}),
|
|
5349
|
+
}), Aa = { class: "mce-rulers" }, Sa = /* @__PURE__ */ X({
|
|
5364
5350
|
inheritAttrs: !1,
|
|
5365
5351
|
__name: "Rulers",
|
|
5366
5352
|
setup(o) {
|
|
@@ -5368,9 +5354,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5368
5354
|
camera: e,
|
|
5369
5355
|
getAabbInDrawboard: t,
|
|
5370
5356
|
selection: n
|
|
5371
|
-
} = de(), s =
|
|
5372
|
-
return (a, r) => (
|
|
5373
|
-
H(
|
|
5357
|
+
} = de(), s = $(() => t(n.value));
|
|
5358
|
+
return (a, r) => (O(), R("div", Aa, [
|
|
5359
|
+
H(ft, {
|
|
5374
5360
|
refline: "",
|
|
5375
5361
|
zoom: S(e).zoom.x,
|
|
5376
5362
|
position: S(e).position.x,
|
|
@@ -5378,7 +5364,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5378
5364
|
axis: "",
|
|
5379
5365
|
size: 16
|
|
5380
5366
|
}, null, 8, ["zoom", "position", "selected"]),
|
|
5381
|
-
H(
|
|
5367
|
+
H(ft, {
|
|
5382
5368
|
refline: "",
|
|
5383
5369
|
zoom: S(e).zoom.y,
|
|
5384
5370
|
position: S(e).position.y,
|
|
@@ -5390,12 +5376,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5390
5376
|
r[0] || (r[0] = F("div", { class: "mce-rulers__left-top" }, null, -1))
|
|
5391
5377
|
]));
|
|
5392
5378
|
}
|
|
5393
|
-
}),
|
|
5379
|
+
}), Ma = {
|
|
5394
5380
|
ref: "trackTplRef",
|
|
5395
5381
|
class: "mce-scrollbar__track"
|
|
5396
|
-
},
|
|
5382
|
+
}, za = 50, Nt = 50, Rt = /* @__PURE__ */ X({
|
|
5397
5383
|
__name: "Scrollbar",
|
|
5398
|
-
props: /* @__PURE__ */
|
|
5384
|
+
props: /* @__PURE__ */ Oe({
|
|
5399
5385
|
zoom: {},
|
|
5400
5386
|
length: {},
|
|
5401
5387
|
vertical: { type: Boolean },
|
|
@@ -5406,16 +5392,16 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5406
5392
|
modelValue: { required: !0 },
|
|
5407
5393
|
modelModifiers: {}
|
|
5408
5394
|
}),
|
|
5409
|
-
emits: /* @__PURE__ */
|
|
5395
|
+
emits: /* @__PURE__ */ Oe(["scroll"], ["update:modelValue"]),
|
|
5410
5396
|
setup(o, { emit: e }) {
|
|
5411
|
-
const t = o, n = e, s = (w, T, M) => w * (1 - M) + T * M, a = (w, T) => s(w / 2, 1 - w / 2, T), r =
|
|
5397
|
+
const t = o, n = e, s = (w, T, M) => w * (1 - M) + T * M, a = (w, T) => s(w / 2, 1 - w / 2, T), r = ke(o, "modelValue"), i = ce("trackTplRef"), l = ce("thumbTplRef"), c = V(0), u = $(
|
|
5412
5398
|
() => t.infinite ? t.length * t.zoom + c.value + Math.abs(r.value) * 2 : r.value > 0 ? r.value + t.length * t.zoom : Math.max(c.value - r.value, t.length * t.zoom)
|
|
5413
|
-
), d =
|
|
5399
|
+
), d = $(
|
|
5414
5400
|
() => t.infinite ? Math.abs(r.value) - r.value : r.value > 0 ? 0 : -r.value
|
|
5415
|
-
), g =
|
|
5401
|
+
), g = $(() => Math.max(0.05, Math.min(1, c.value / u.value))), h = $(() => d.value / (u.value - c.value) * (1 - g.value)), v = Yt(() => {
|
|
5416
5402
|
const w = i.value?.getBoundingClientRect() ?? { width: 0, height: 0 };
|
|
5417
5403
|
c.value = t.vertical ? w.height : w.width;
|
|
5418
|
-
}, 50), y =
|
|
5404
|
+
}, 50), y = $(() => t.infinite ? a(g.value, h.value) : h.value), f = $(() => 1 - y.value - g.value), p = $(() => t.vertical ? `${y.value * 100}%` : "0%"), _ = $(() => t.vertical ? `${f.value * 100}%` : "50%"), z = $(() => t.vertical ? "0%" : `${y.value * 100}%`), I = $(() => t.vertical ? "50%" : `${f.value * 100}%`);
|
|
5419
5405
|
function E(w) {
|
|
5420
5406
|
n("scroll", w - r.value), r.value = w;
|
|
5421
5407
|
}
|
|
@@ -5441,14 +5427,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5441
5427
|
return;
|
|
5442
5428
|
}
|
|
5443
5429
|
}
|
|
5444
|
-
C(
|
|
5430
|
+
C(za * M), b = setTimeout(() => k(w), Nt);
|
|
5445
5431
|
}
|
|
5446
5432
|
function x() {
|
|
5447
5433
|
clearTimeout(b);
|
|
5448
5434
|
}
|
|
5449
5435
|
return we(() => {
|
|
5450
5436
|
x();
|
|
5451
|
-
}), (w, T) => ze((
|
|
5437
|
+
}), (w, T) => ze((O(), R("div", {
|
|
5452
5438
|
class: be(["mce-scrollbar", {
|
|
5453
5439
|
"mce-scrollbar--vertical": t.vertical,
|
|
5454
5440
|
"mce-scrollbar--horizontal": !t.vertical
|
|
@@ -5459,7 +5445,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5459
5445
|
[t.vertical ? "top" : "left"]: `${t.offset}px`
|
|
5460
5446
|
})
|
|
5461
5447
|
}, [
|
|
5462
|
-
F("div",
|
|
5448
|
+
F("div", Ma, [
|
|
5463
5449
|
ze(F("div", {
|
|
5464
5450
|
ref: "thumbTplRef",
|
|
5465
5451
|
class: be(["mce-scrollbar__thumb", {
|
|
@@ -5469,15 +5455,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5469
5455
|
top: p.value,
|
|
5470
5456
|
bottom: _.value,
|
|
5471
5457
|
left: z.value,
|
|
5472
|
-
right:
|
|
5458
|
+
right: I.value
|
|
5473
5459
|
})
|
|
5474
5460
|
}, null, 6), [
|
|
5475
5461
|
[Xe, t.infinite || g.value < 1]
|
|
5476
5462
|
])
|
|
5477
5463
|
], 512)
|
|
5478
5464
|
], 6)), [
|
|
5479
|
-
[S(
|
|
5480
|
-
[S(Qn), [k, { delay:
|
|
5465
|
+
[S(Zt), S(v)],
|
|
5466
|
+
[S(Qn), [k, { delay: Nt, onMouseUp: x }]]
|
|
5481
5467
|
]);
|
|
5482
5468
|
}
|
|
5483
5469
|
}), $a = /* @__PURE__ */ X({
|
|
@@ -5493,15 +5479,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5493
5479
|
camera: t,
|
|
5494
5480
|
viewAabb: n
|
|
5495
5481
|
} = de();
|
|
5496
|
-
return (s, a) => (
|
|
5497
|
-
H(
|
|
5482
|
+
return (s, a) => (O(), R(se, null, [
|
|
5483
|
+
H(Rt, $e(e, {
|
|
5498
5484
|
modelValue: S(t).position.y,
|
|
5499
5485
|
"onUpdate:modelValue": a[0] || (a[0] = (r) => S(t).position.y = r),
|
|
5500
5486
|
zoom: S(t).zoom.y,
|
|
5501
5487
|
vertical: "",
|
|
5502
5488
|
length: S(n).height
|
|
5503
5489
|
}), null, 16, ["modelValue", "zoom", "length"]),
|
|
5504
|
-
H(
|
|
5490
|
+
H(Rt, $e(e, {
|
|
5505
5491
|
modelValue: S(t).position.x,
|
|
5506
5492
|
"onUpdate:modelValue": a[1] || (a[1] = (r) => S(t).position.x = r),
|
|
5507
5493
|
zoom: S(t).zoom.x,
|
|
@@ -5509,10 +5495,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5509
5495
|
}), null, 16, ["modelValue", "zoom", "length"])
|
|
5510
5496
|
], 64));
|
|
5511
5497
|
}
|
|
5512
|
-
}),
|
|
5498
|
+
}), Oa = { class: "mce-transformable__svg" }, Ia = { "pointer-events": "all" }, Fa = ["x", "y", "width", "height", "aria-label", "fill"], Pa = ["cx", "cy", "r", "aria-label", "fill"], Na = ["x", "y", "width", "height", "aria-label", "cursor", "onPointerdown"], Ra = {
|
|
5513
5499
|
key: 0,
|
|
5514
5500
|
class: "mce-transformable__tip"
|
|
5515
|
-
},
|
|
5501
|
+
}, Ba = /* @__PURE__ */ X({
|
|
5516
5502
|
__name: "Transformable",
|
|
5517
5503
|
props: {
|
|
5518
5504
|
tag: { default: "div" },
|
|
@@ -5561,13 +5547,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5561
5547
|
"resize-top-right": (m) => _("resizeBevel", 180 + m),
|
|
5562
5548
|
"resize-bottom-right": (m) => _("resizeBevel", 90 + m),
|
|
5563
5549
|
"resize-bottom-left": (m) => _("resizeBevel", 180 + m)
|
|
5564
|
-
}, r =
|
|
5550
|
+
}, r = ke(n, "modelValue"), i = $({
|
|
5565
5551
|
get: () => {
|
|
5566
5552
|
let { left: m = 0, top: b = 0, width: k = 0, height: x = 0, rotate: w = 0 } = r.value ?? {};
|
|
5567
5553
|
return Number.isNaN(Number(k)) && (k = 0), Number.isNaN(Number(x)) && (x = 0), { left: m, top: b, width: k, height: x, rotate: w };
|
|
5568
5554
|
},
|
|
5569
5555
|
set: (m) => r.value = m
|
|
5570
|
-
}), l = V(!1), c = V(), u =
|
|
5556
|
+
}), l = V(!1), c = V(), u = $(() => {
|
|
5571
5557
|
const { width: m = 0, height: b = 0 } = i.value, k = 6, x = k / 2, w = 8, T = w / 2, M = 12;
|
|
5572
5558
|
let P;
|
|
5573
5559
|
return n.handleStrategy === "point" ? P = [
|
|
@@ -5607,19 +5593,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5607
5593
|
{ type: "rotate-bottom-left", x: -M - T, y: b + T, width: M, height: M },
|
|
5608
5594
|
{ type: "rotate-bottom-right", x: m + T, y: b + T, width: M, height: M }
|
|
5609
5595
|
], P.filter((B) => n.handles.includes(B.type)).map((B) => (B.width = Math.max(B.width, 0), B.height = Math.max(B.height, 0), B));
|
|
5610
|
-
}), d = V(), g =
|
|
5596
|
+
}), d = V(), g = $(() => {
|
|
5611
5597
|
const { width: m = 0, height: b = 0 } = i.value;
|
|
5612
5598
|
return {
|
|
5613
5599
|
width: n.initialSize && !m ? void 0 : `${m}px`,
|
|
5614
5600
|
height: n.initialSize && !b ? void 0 : `${b}px`
|
|
5615
5601
|
};
|
|
5616
|
-
}), h =
|
|
5602
|
+
}), h = $(() => {
|
|
5617
5603
|
const { left: m = 0, top: b = 0, rotate: k = 0 } = i.value, x = k * Math.PI / 180, w = Math.cos(x), T = Math.sin(x);
|
|
5618
5604
|
return {
|
|
5619
5605
|
...g.value,
|
|
5620
5606
|
transform: `matrix(${w}, ${T}, ${-T}, ${w}, ${m}, ${b})`
|
|
5621
5607
|
};
|
|
5622
|
-
}), v =
|
|
5608
|
+
}), v = $(() => n.visibility === "auto" && l.value), y = $(() => n.tipFormat?.("size"));
|
|
5623
5609
|
function f(m, b) {
|
|
5624
5610
|
if (m && m.button !== void 0 && m.button !== 0)
|
|
5625
5611
|
return !1;
|
|
@@ -5634,7 +5620,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5634
5620
|
y: x
|
|
5635
5621
|
};
|
|
5636
5622
|
A || (U.x += B.x + B.width / 2, U.y += B.y + B.height / 2);
|
|
5637
|
-
const W =
|
|
5623
|
+
const W = I(
|
|
5638
5624
|
U,
|
|
5639
5625
|
D,
|
|
5640
5626
|
A ? 0 : M
|
|
@@ -5650,7 +5636,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5650
5636
|
l.value = !0, s("start", i.value);
|
|
5651
5637
|
}
|
|
5652
5638
|
!n.threshold && !l.value && xe();
|
|
5653
|
-
function
|
|
5639
|
+
function ae(ye) {
|
|
5654
5640
|
const J = {};
|
|
5655
5641
|
Y || (Y = { x: ye.clientX, y: ye.clientY });
|
|
5656
5642
|
const me = {
|
|
@@ -5662,56 +5648,56 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5662
5648
|
return;
|
|
5663
5649
|
xe();
|
|
5664
5650
|
}
|
|
5665
|
-
const
|
|
5651
|
+
const ue = {
|
|
5666
5652
|
x: W.x + me.x,
|
|
5667
5653
|
y: W.y + me.y
|
|
5668
5654
|
};
|
|
5669
5655
|
if (A) {
|
|
5670
5656
|
if (!n.moveable)
|
|
5671
5657
|
return;
|
|
5672
|
-
J.left =
|
|
5658
|
+
J.left = ue.x, J.top = ue.y;
|
|
5673
5659
|
} else if (N) {
|
|
5674
5660
|
const ge = Math.atan2(
|
|
5675
|
-
|
|
5676
|
-
|
|
5661
|
+
ue.y - D.y,
|
|
5662
|
+
ue.x - D.x
|
|
5677
5663
|
) / (Math.PI / 180);
|
|
5678
5664
|
J.rotate = (M + ge - he + 360) % 360;
|
|
5679
5665
|
} else if (j) {
|
|
5680
|
-
const ge =
|
|
5666
|
+
const ge = I(ue, W, -M), re = I(
|
|
5681
5667
|
L ? { x: ge.x, y: W.y } : { x: W.x, y: ge.y },
|
|
5682
5668
|
W,
|
|
5683
5669
|
M
|
|
5684
5670
|
), Ve = {
|
|
5685
|
-
x:
|
|
5686
|
-
y:
|
|
5687
|
-
},
|
|
5688
|
-
L ? (J.width =
|
|
5671
|
+
x: re.x - (re.x - Z.x) / 2,
|
|
5672
|
+
y: re.y + (Z.y - re.y) / 2
|
|
5673
|
+
}, Ce = C(re, Z);
|
|
5674
|
+
L ? (J.width = Ce, P && n.resizeStrategy === "aspectRatio" && (J.height = Ce / P)) : (J.height = Ce, P && n.resizeStrategy === "aspectRatio" && (J.width = Ce * P)), J.left = Ve.x - (L ? Ce : w) / 2, J.top = Ve.y - (L ? T : Ce) / 2;
|
|
5689
5675
|
} else {
|
|
5690
5676
|
if (P && (n.resizeStrategy === "aspectRatio" || n.resizeStrategy === "diagonalAspectRatio")) {
|
|
5691
|
-
let
|
|
5677
|
+
let st = 1;
|
|
5692
5678
|
switch (B.type) {
|
|
5693
5679
|
case "resize-top-right":
|
|
5694
5680
|
case "resize-bottom-left":
|
|
5695
|
-
|
|
5681
|
+
st = -1;
|
|
5696
5682
|
break;
|
|
5697
5683
|
}
|
|
5698
|
-
me.x > me.y ? (
|
|
5684
|
+
me.x > me.y ? (ue.x = W.x + me.x, ue.y = W.y + st * me.x / P) : (ue.x = W.x + st * me.y * P, ue.y = W.y + me.y);
|
|
5699
5685
|
}
|
|
5700
|
-
const ge = E(
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
], [Ve,
|
|
5704
|
-
J.width =
|
|
5686
|
+
const ge = E(ue, Z), re = [
|
|
5687
|
+
I(ue, ge, -M),
|
|
5688
|
+
I(Z, ge, -M)
|
|
5689
|
+
], [Ve, Ce] = re[0].x > re[1].x ? [re[1].x, re[0].x] : [re[0].x, re[1].x], [kt, vn] = re[0].y > re[1].y ? [re[1].y, re[0].y] : [re[0].y, re[1].y];
|
|
5690
|
+
J.width = Ce - Ve, J.height = vn - kt, J.left = Ve, J.top = kt;
|
|
5705
5691
|
}
|
|
5706
5692
|
if ("width" in J && J.width <= 0 || "height" in J && J.height <= 0)
|
|
5707
5693
|
return;
|
|
5708
|
-
const
|
|
5709
|
-
i.value =
|
|
5694
|
+
const te = { ...i.value }, ie = { ...i.value, ...J };
|
|
5695
|
+
i.value = ie, s("move", ie, te);
|
|
5710
5696
|
}
|
|
5711
5697
|
function ve() {
|
|
5712
|
-
window.removeEventListener("pointermove",
|
|
5698
|
+
window.removeEventListener("pointermove", ae), window.removeEventListener("pointerup", ve, !0), l.value = !1, s("end", i.value);
|
|
5713
5699
|
}
|
|
5714
|
-
return window.addEventListener("pointermove",
|
|
5700
|
+
return window.addEventListener("pointermove", ae), window.addEventListener("pointerup", ve, !0), !0;
|
|
5715
5701
|
}
|
|
5716
5702
|
const p = {
|
|
5717
5703
|
rotate: '<path d="M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill="white"/>',
|
|
@@ -5725,7 +5711,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5725
5711
|
function z(m) {
|
|
5726
5712
|
return m === "move" ? "move" : `url("data:image/svg+xml,${a[m](i.value.rotate ?? 0)}") 16 16, pointer`;
|
|
5727
5713
|
}
|
|
5728
|
-
function
|
|
5714
|
+
function I(m, b, k) {
|
|
5729
5715
|
const x = k * Math.PI / 180, w = Math.cos(x), T = Math.sin(x);
|
|
5730
5716
|
return {
|
|
5731
5717
|
x: (m.x - b.x) * w - (m.y - b.y) * T + b.x,
|
|
@@ -5742,9 +5728,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5742
5728
|
return Math.sqrt((m.x - b.x) ** 2 + (m.y - b.y) ** 2);
|
|
5743
5729
|
}
|
|
5744
5730
|
return He(async () => {
|
|
5745
|
-
const b =
|
|
5731
|
+
const b = Qe()?.proxy?.$el;
|
|
5746
5732
|
if (b && n.initialSize) {
|
|
5747
|
-
await
|
|
5733
|
+
await Re();
|
|
5748
5734
|
let k, x;
|
|
5749
5735
|
const w = getComputedStyle(b);
|
|
5750
5736
|
if (w.width.endsWith("px") && w.height.endsWith("px") ? (k = Number(w.width.replace("px", "")), x = Number(w.height.replace("px", ""))) : { width: k, height: x } = b.getBoundingClientRect(), k && x)
|
|
@@ -5764,12 +5750,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5764
5750
|
start: f,
|
|
5765
5751
|
activeHandle: c,
|
|
5766
5752
|
transforming: l
|
|
5767
|
-
}), (m, b) => (
|
|
5753
|
+
}), (m, b) => (O(), oe(jt(o.tag), {
|
|
5768
5754
|
class: "mce-transformable",
|
|
5769
5755
|
style: q(h.value)
|
|
5770
5756
|
}, {
|
|
5771
|
-
default:
|
|
5772
|
-
|
|
5757
|
+
default: ne(() => [
|
|
5758
|
+
Q(m.$slots, "default", {
|
|
5773
5759
|
value: S(r),
|
|
5774
5760
|
moveProps: {
|
|
5775
5761
|
onPointerdown: f,
|
|
@@ -5777,7 +5763,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5777
5763
|
},
|
|
5778
5764
|
start: f
|
|
5779
5765
|
}),
|
|
5780
|
-
(
|
|
5766
|
+
(O(), R("svg", Oa, [
|
|
5781
5767
|
F("rect", {
|
|
5782
5768
|
width: "100%",
|
|
5783
5769
|
height: "100%",
|
|
@@ -5789,10 +5775,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5789
5775
|
strokeWidth: v.value ? "0.5px" : void 0
|
|
5790
5776
|
})
|
|
5791
5777
|
}, null, 4),
|
|
5792
|
-
F("g",
|
|
5793
|
-
(
|
|
5794
|
-
(o.handleStrategy === "point" ? k.type.startsWith("resize") : k.type === "resize-top-left" || k.type === "resize-top-right" || k.type === "resize-bottom-left" || k.type === "resize-bottom-right") ? (
|
|
5795
|
-
n.handleShape === "rect" ? (
|
|
5778
|
+
F("g", Ia, [
|
|
5779
|
+
(O(!0), R(se, null, _e(u.value.filter((k) => !(!o.resizable && k.type.startsWith("resize") || !o.rotatable && k.type.startsWith("rotate") || !o.moveable && k.type === "move")), (k, x) => (O(), R(se, { key: x }, [
|
|
5780
|
+
(o.handleStrategy === "point" ? k.type.startsWith("resize") : k.type === "resize-top-left" || k.type === "resize-top-right" || k.type === "resize-bottom-left" || k.type === "resize-bottom-right") ? (O(), R(se, { key: 0 }, [
|
|
5781
|
+
n.handleShape === "rect" ? (O(), R("rect", {
|
|
5796
5782
|
key: 0,
|
|
5797
5783
|
x: k.x,
|
|
5798
5784
|
y: k.y,
|
|
@@ -5804,7 +5790,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5804
5790
|
style: q({
|
|
5805
5791
|
opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
|
|
5806
5792
|
})
|
|
5807
|
-
}, null, 12,
|
|
5793
|
+
}, null, 12, Fa)) : (O(), R("circle", {
|
|
5808
5794
|
key: 1,
|
|
5809
5795
|
cx: k.x + k.width / 2,
|
|
5810
5796
|
cy: k.y + k.width / 2,
|
|
@@ -5815,8 +5801,8 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5815
5801
|
style: q({
|
|
5816
5802
|
opacity: o.visibility === "none" || l.value && o.visibility !== "visible" ? 0 : void 0
|
|
5817
5803
|
})
|
|
5818
|
-
}, null, 12,
|
|
5819
|
-
], 64)) :
|
|
5804
|
+
}, null, 12, Pa))
|
|
5805
|
+
], 64)) : ee("", !0),
|
|
5820
5806
|
F("rect", {
|
|
5821
5807
|
ref_for: !0,
|
|
5822
5808
|
ref_key: "handlesRef",
|
|
@@ -5832,22 +5818,22 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5832
5818
|
}),
|
|
5833
5819
|
cursor: l.value ? "auto" : z(k.type),
|
|
5834
5820
|
onPointerdown: (w) => f(w, x)
|
|
5835
|
-
}, null, 44,
|
|
5821
|
+
}, null, 44, Na)
|
|
5836
5822
|
], 64))), 128))
|
|
5837
5823
|
]),
|
|
5838
5824
|
F("g", {
|
|
5839
5825
|
"pointer-events": "all",
|
|
5840
5826
|
style: q(v.value ? { opacity: ".4", strokeWidth: "0.5px" } : void 0)
|
|
5841
5827
|
}, [
|
|
5842
|
-
|
|
5828
|
+
Q(m.$slots, "svg", { box: i.value })
|
|
5843
5829
|
], 4)
|
|
5844
5830
|
])),
|
|
5845
|
-
y.value ? (
|
|
5831
|
+
y.value ? (O(), R("div", Ra, K(y.value), 1)) : ee("", !0)
|
|
5846
5832
|
]),
|
|
5847
5833
|
_: 3
|
|
5848
5834
|
}, 8, ["style"]));
|
|
5849
5835
|
}
|
|
5850
|
-
}),
|
|
5836
|
+
}), La = /* @__PURE__ */ X({
|
|
5851
5837
|
inheritAttrs: !1,
|
|
5852
5838
|
__name: "Selector",
|
|
5853
5839
|
props: {
|
|
@@ -5868,21 +5854,21 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5868
5854
|
isFrame: g,
|
|
5869
5855
|
isLock: h,
|
|
5870
5856
|
config: v
|
|
5871
|
-
} = de(), y =
|
|
5872
|
-
|
|
5857
|
+
} = de(), y = ce("transformableRef");
|
|
5858
|
+
gt(() => {
|
|
5873
5859
|
u({ command: "startTransform", handle: (E) => !!y.value?.start(E) });
|
|
5874
5860
|
}), we(() => {
|
|
5875
5861
|
d("startTransform");
|
|
5876
5862
|
});
|
|
5877
|
-
const f =
|
|
5863
|
+
const f = $(() => {
|
|
5878
5864
|
if (a.value.length !== 1)
|
|
5879
5865
|
return [];
|
|
5880
5866
|
const E = [];
|
|
5881
5867
|
return a.value[0]?.findAncestor((C) => (C instanceof G && E.push(l(C)), !1)), E;
|
|
5882
|
-
}), p =
|
|
5868
|
+
}), p = $(() => n.value !== "selecting" && a.value.length === 1 ? [] : a.value.map((E) => ({
|
|
5883
5869
|
name: E.name,
|
|
5884
5870
|
box: l(E)
|
|
5885
|
-
}))), _ =
|
|
5871
|
+
}))), _ = $(() => l(a.value)), z = $({
|
|
5886
5872
|
get: () => _.value,
|
|
5887
5873
|
set: (E) => {
|
|
5888
5874
|
const C = r.value.zoom, m = _.value, b = {
|
|
@@ -5909,14 +5895,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5909
5895
|
});
|
|
5910
5896
|
}
|
|
5911
5897
|
});
|
|
5912
|
-
function
|
|
5898
|
+
function I() {
|
|
5913
5899
|
const E = a.value.length === 1 ? a.value[0].style : c(a.value);
|
|
5914
5900
|
return `${Number(E.width.toFixed(2))} × ${Number(E.height.toFixed(2))}`;
|
|
5915
5901
|
}
|
|
5916
5902
|
return e({
|
|
5917
5903
|
transformable: y
|
|
5918
|
-
}), (E, C) => (
|
|
5919
|
-
(
|
|
5904
|
+
}), (E, C) => (O(), R(se, null, [
|
|
5905
|
+
(O(!0), R(se, null, _e(f.value, (m, b) => (O(), R("div", {
|
|
5920
5906
|
key: b,
|
|
5921
5907
|
class: "mce-parent-element-obb",
|
|
5922
5908
|
style: q({
|
|
@@ -5924,15 +5910,15 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5924
5910
|
...S(Me)(m)
|
|
5925
5911
|
})
|
|
5926
5912
|
}, null, 4))), 128)),
|
|
5927
|
-
S(n) === "selecting" ? (
|
|
5913
|
+
S(n) === "selecting" ? (O(), R("div", {
|
|
5928
5914
|
key: 0,
|
|
5929
5915
|
class: "mce-selected-area",
|
|
5930
5916
|
style: q({
|
|
5931
5917
|
borderColor: "currentcolor",
|
|
5932
5918
|
...S(Me)(t.selectedArea)
|
|
5933
5919
|
})
|
|
5934
|
-
}, null, 4)) :
|
|
5935
|
-
(
|
|
5920
|
+
}, null, 4)) : ee("", !0),
|
|
5921
|
+
(O(!0), R(se, null, _e(p.value, (m, b) => (O(), R("div", {
|
|
5936
5922
|
key: b,
|
|
5937
5923
|
class: "mce-element-obb",
|
|
5938
5924
|
style: q({
|
|
@@ -5940,7 +5926,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5940
5926
|
...S(Me)(m.box)
|
|
5941
5927
|
})
|
|
5942
5928
|
}, null, 4))), 128)),
|
|
5943
|
-
z.value.width && z.value.height ? (
|
|
5929
|
+
z.value.width && z.value.height ? (O(), oe(Ba, {
|
|
5944
5930
|
key: 1,
|
|
5945
5931
|
ref: "transformableRef",
|
|
5946
5932
|
modelValue: z.value,
|
|
@@ -5951,35 +5937,35 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5951
5937
|
"handle-shape": S(v).handleShape,
|
|
5952
5938
|
class: "mce-selection-obb",
|
|
5953
5939
|
"border-style": S(a).length > 1 ? "dashed" : "solid",
|
|
5954
|
-
"tip-format":
|
|
5940
|
+
"tip-format": I,
|
|
5955
5941
|
onMove: C[1] || (C[1] = () => !S(n) && (n.value = "transforming")),
|
|
5956
5942
|
onEnd: C[2] || (C[2] = () => S(n) === "transforming" && (n.value = void 0))
|
|
5957
|
-
},
|
|
5943
|
+
}, pt({ _: 2 }, [
|
|
5958
5944
|
E.$slots.transformable ? {
|
|
5959
5945
|
name: "svg",
|
|
5960
|
-
fn:
|
|
5961
|
-
|
|
5946
|
+
fn: ne((m) => [
|
|
5947
|
+
Q(E.$slots, "transformable", vt(yt(m)))
|
|
5962
5948
|
]),
|
|
5963
5949
|
key: "0"
|
|
5964
5950
|
} : void 0
|
|
5965
|
-
]), 1032, ["modelValue", "visibility", "moveable", "resize-strategy", "handle-shape", "border-style"])) :
|
|
5966
|
-
z.value.width && z.value.height && E.$slots.default ? (
|
|
5951
|
+
]), 1032, ["modelValue", "visibility", "moveable", "resize-strategy", "handle-shape", "border-style"])) : ee("", !0),
|
|
5952
|
+
z.value.width && z.value.height && E.$slots.default ? (O(), R("div", {
|
|
5967
5953
|
key: 2,
|
|
5968
5954
|
style: q([{ position: "absolute" }, S(Me)(z.value)])
|
|
5969
5955
|
}, [
|
|
5970
|
-
|
|
5971
|
-
], 4)) :
|
|
5956
|
+
Q(E.$slots, "default", { box: z.value })
|
|
5957
|
+
], 4)) : ee("", !0)
|
|
5972
5958
|
], 64));
|
|
5973
5959
|
}
|
|
5974
|
-
}),
|
|
5960
|
+
}), Da = /* @__PURE__ */ X({
|
|
5975
5961
|
__name: "Setup",
|
|
5976
5962
|
setup(o) {
|
|
5977
5963
|
return de().setup(), (e, t) => null;
|
|
5978
5964
|
}
|
|
5979
|
-
}),
|
|
5965
|
+
}), Va = /* @__PURE__ */ X({
|
|
5980
5966
|
__name: "Layout",
|
|
5981
5967
|
props: {
|
|
5982
|
-
...
|
|
5968
|
+
...ea()
|
|
5983
5969
|
},
|
|
5984
5970
|
setup(o, { expose: e }) {
|
|
5985
5971
|
const t = o, {
|
|
@@ -5988,19 +5974,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
5988
5974
|
items: a,
|
|
5989
5975
|
getLayoutItem: r,
|
|
5990
5976
|
layoutRef: i
|
|
5991
|
-
} =
|
|
5977
|
+
} = aa(t);
|
|
5992
5978
|
return e({
|
|
5993
5979
|
items: a,
|
|
5994
5980
|
getLayoutItem: r
|
|
5995
|
-
}), (l, c) => (
|
|
5981
|
+
}), (l, c) => (O(), R("div", {
|
|
5996
5982
|
ref: S(i),
|
|
5997
5983
|
class: be([S(n)]),
|
|
5998
5984
|
style: q([S(s)])
|
|
5999
5985
|
}, [
|
|
6000
|
-
|
|
5986
|
+
Q(l.$slots, "default")
|
|
6001
5987
|
], 6));
|
|
6002
5988
|
}
|
|
6003
|
-
}),
|
|
5989
|
+
}), Bt = /* @__PURE__ */ X({
|
|
6004
5990
|
__name: "LayoutItem",
|
|
6005
5991
|
props: {
|
|
6006
5992
|
position: {
|
|
@@ -6012,57 +5998,57 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6012
5998
|
default: 300
|
|
6013
5999
|
},
|
|
6014
6000
|
modelValue: Boolean,
|
|
6015
|
-
...
|
|
6001
|
+
...ta()
|
|
6016
6002
|
},
|
|
6017
6003
|
setup(o) {
|
|
6018
|
-
const e = o, { layoutItemStyles: t } =
|
|
6004
|
+
const e = o, { layoutItemStyles: t } = oa({
|
|
6019
6005
|
id: e.name,
|
|
6020
|
-
order:
|
|
6021
|
-
position:
|
|
6022
|
-
elementSize:
|
|
6023
|
-
layoutSize:
|
|
6024
|
-
active:
|
|
6025
|
-
absolute:
|
|
6006
|
+
order: $(() => Number.parseInt(String(e.order), 10)),
|
|
6007
|
+
position: Te(() => e.position),
|
|
6008
|
+
elementSize: Te(() => e.size),
|
|
6009
|
+
layoutSize: Te(() => e.size),
|
|
6010
|
+
active: Te(() => e.modelValue),
|
|
6011
|
+
absolute: Te(() => e.absolute)
|
|
6026
6012
|
});
|
|
6027
|
-
return (n, s) => (
|
|
6013
|
+
return (n, s) => (O(), R("div", {
|
|
6028
6014
|
class: be(["mce-layout-item", [
|
|
6029
6015
|
`mce-layout-item--${e.position}`
|
|
6030
6016
|
]]),
|
|
6031
6017
|
style: q([S(t)])
|
|
6032
6018
|
}, [
|
|
6033
|
-
|
|
6019
|
+
Q(n.$slots, "default")
|
|
6034
6020
|
], 6));
|
|
6035
6021
|
}
|
|
6036
|
-
}),
|
|
6022
|
+
}), ja = {
|
|
6037
6023
|
key: 0,
|
|
6038
6024
|
class: "mce-main__scroller"
|
|
6039
|
-
},
|
|
6025
|
+
}, Ua = /* @__PURE__ */ X({
|
|
6040
6026
|
__name: "Main",
|
|
6041
6027
|
props: {
|
|
6042
6028
|
scrollable: Boolean
|
|
6043
6029
|
},
|
|
6044
6030
|
setup(o) {
|
|
6045
|
-
const e = o, { mainStyles: t } =
|
|
6046
|
-
return (n, s) => (
|
|
6031
|
+
const e = o, { mainStyles: t } = na();
|
|
6032
|
+
return (n, s) => (O(), R("main", {
|
|
6047
6033
|
class: be(["mce-main", [
|
|
6048
6034
|
{ "mce-main--scrollable": e.scrollable }
|
|
6049
6035
|
]]),
|
|
6050
6036
|
style: q([S(t)])
|
|
6051
6037
|
}, [
|
|
6052
|
-
e.scrollable ? (
|
|
6053
|
-
|
|
6054
|
-
])) :
|
|
6038
|
+
e.scrollable ? (O(), R("div", ja, [
|
|
6039
|
+
Q(n.$slots, "default")
|
|
6040
|
+
])) : Q(n.$slots, "default", { key: 1 })
|
|
6055
6041
|
], 6));
|
|
6056
6042
|
}
|
|
6057
|
-
}),
|
|
6043
|
+
}), Xa = { class: "progress-indicator" }, Ha = {
|
|
6058
6044
|
key: 0,
|
|
6059
6045
|
class: "progress-indicator__status"
|
|
6060
|
-
},
|
|
6046
|
+
}, Ya = { class: "progress-indicator__bar" }, qa = {
|
|
6061
6047
|
key: 1,
|
|
6062
6048
|
class: "progress-indicator__bar-indeterminate"
|
|
6063
|
-
},
|
|
6049
|
+
}, Ga = /* @__PURE__ */ X({
|
|
6064
6050
|
__name: "ProgressIndicator",
|
|
6065
|
-
props: /* @__PURE__ */
|
|
6051
|
+
props: /* @__PURE__ */ Oe({
|
|
6066
6052
|
label: {},
|
|
6067
6053
|
indeterminate: { type: Boolean }
|
|
6068
6054
|
}, {
|
|
@@ -6071,11 +6057,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6071
6057
|
}),
|
|
6072
6058
|
emits: ["update:modelValue"],
|
|
6073
6059
|
setup(o) {
|
|
6074
|
-
const e =
|
|
6075
|
-
return (t, n) => (
|
|
6076
|
-
o.label ? (
|
|
6077
|
-
F("div",
|
|
6078
|
-
o.indeterminate ? (
|
|
6060
|
+
const e = ke(o, "modelValue");
|
|
6061
|
+
return (t, n) => (O(), R("div", Xa, [
|
|
6062
|
+
o.label ? (O(), R("span", Ha, K(o.label), 1)) : ee("", !0),
|
|
6063
|
+
F("div", Ya, [
|
|
6064
|
+
o.indeterminate ? (O(), R("div", qa)) : (O(), R("div", {
|
|
6079
6065
|
key: 0,
|
|
6080
6066
|
class: "progress-indicator__bar-fill",
|
|
6081
6067
|
style: q({ width: `${e.value * 100}%` })
|
|
@@ -6088,7 +6074,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6088
6074
|
for (const [n, s] of e)
|
|
6089
6075
|
t[n] = s;
|
|
6090
6076
|
return t;
|
|
6091
|
-
},
|
|
6077
|
+
}, Wa = /* @__PURE__ */ pn(Ga, [["__scopeId", "data-v-c4234331"]]), Ka = { class: "mce-statusbar" }, Ja = { class: "mce-statusbar__main" }, Za = { class: "mce-statusbar__item" }, Qa = { class: "mce-statusbar__kbd" }, ei = { class: "mce-statusbar__kbd" }, ti = { class: "mce-statusbar__item" }, ni = { class: "mce-statusbar__kbd" }, oi = { class: "mce-statusbar__item" }, si = { class: "mce-statusbar__item" }, ai = { class: "mce-statusbar__kbd" }, ii = { class: "mce-statusbar__item" }, ri = { class: "mce-statusbar__kbd" }, li = { key: 2 }, ci = { class: "mce-statusbar__item" }, ui = { class: "mce-statusbar__item" }, di = { class: "mce-statusbar__kbd" }, mi = { class: "mce-statusbar__item" }, hi = { class: "mce-statusbar__item" }, fi = { class: "mce-statusbar__kbd" }, pi = { class: "mce-statusbar__item" }, vi = { class: "mce-statusbar__progress" }, yi = /* @__PURE__ */ X({
|
|
6092
6078
|
__name: "Statusbar",
|
|
6093
6079
|
setup(o) {
|
|
6094
6080
|
const {
|
|
@@ -6098,70 +6084,70 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6098
6084
|
exporting: s,
|
|
6099
6085
|
exportProgress: a
|
|
6100
6086
|
} = de();
|
|
6101
|
-
return (r, i) => (
|
|
6102
|
-
F("div",
|
|
6103
|
-
S(e) === "typing" ? (
|
|
6104
|
-
F("div",
|
|
6105
|
-
F("span",
|
|
6106
|
-
F("span",
|
|
6087
|
+
return (r, i) => (O(), R("div", Ka, [
|
|
6088
|
+
F("div", Ja, [
|
|
6089
|
+
S(e) === "typing" ? (O(), R(se, { key: 0 }, [
|
|
6090
|
+
F("div", Za, [
|
|
6091
|
+
F("span", Qa, K(S(n)("Command")), 1),
|
|
6092
|
+
F("span", ei, K(S(n)("Enter")), 1)
|
|
6107
6093
|
]),
|
|
6108
6094
|
i[1] || (i[1] = F("span", null, "/", -1)),
|
|
6109
|
-
F("div",
|
|
6110
|
-
F("span",
|
|
6095
|
+
F("div", ti, [
|
|
6096
|
+
F("span", ni, K(S(n)("Escape")), 1),
|
|
6111
6097
|
F("span", null, K(S(t)("commitChanges")), 1)
|
|
6112
6098
|
])
|
|
6113
|
-
], 64)) : S(e) === "transforming" ? (
|
|
6114
|
-
F("div",
|
|
6115
|
-
H(
|
|
6099
|
+
], 64)) : S(e) === "transforming" ? (O(), R(se, { key: 1 }, [
|
|
6100
|
+
F("div", oi, [
|
|
6101
|
+
H(Ae, { icon: "$mouseRightClick" })
|
|
6116
6102
|
]),
|
|
6117
6103
|
i[2] || (i[2] = F("span", null, " / ", -1)),
|
|
6118
|
-
F("div",
|
|
6119
|
-
F("span",
|
|
6104
|
+
F("div", si, [
|
|
6105
|
+
F("span", ai, K(S(n)("Escape")), 1),
|
|
6120
6106
|
F("span", null, K(S(t)("cancel")), 1)
|
|
6121
6107
|
]),
|
|
6122
6108
|
i[3] || (i[3] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
|
|
6123
|
-
F("div",
|
|
6124
|
-
F("span",
|
|
6109
|
+
F("div", ii, [
|
|
6110
|
+
F("span", ri, K(S(n)("Shift")), 1),
|
|
6125
6111
|
F("span", null, K(S(t)("constrainToAxis")), 1)
|
|
6126
6112
|
])
|
|
6127
|
-
], 64)) : S(e) ? (
|
|
6128
|
-
F("div",
|
|
6129
|
-
H(
|
|
6113
|
+
], 64)) : S(e) ? (O(), R("span", li, K(S(t)(S(e))), 1)) : (O(), R(se, { key: 3 }, [
|
|
6114
|
+
F("div", ci, [
|
|
6115
|
+
H(Ae, { icon: "$mouseLeftClick" }),
|
|
6130
6116
|
F("span", null, K(S(t)("selectObject")), 1)
|
|
6131
6117
|
]),
|
|
6132
6118
|
i[4] || (i[4] = F("span", null, " + ", -1)),
|
|
6133
|
-
F("div",
|
|
6134
|
-
F("span",
|
|
6119
|
+
F("div", ui, [
|
|
6120
|
+
F("span", di, K(S(n)("Shift")), 1),
|
|
6135
6121
|
F("span", null, K(S(t)("extend")), 1)
|
|
6136
6122
|
]),
|
|
6137
6123
|
i[5] || (i[5] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
|
|
6138
|
-
F("div",
|
|
6139
|
-
H(
|
|
6124
|
+
F("div", mi, [
|
|
6125
|
+
H(Ae, { icon: "$mouseLeftClick" }),
|
|
6140
6126
|
F("span", null, K(S(t)("selectArea")), 1)
|
|
6141
6127
|
]),
|
|
6142
6128
|
i[6] || (i[6] = F("span", null, " + ", -1)),
|
|
6143
|
-
F("div",
|
|
6144
|
-
F("span",
|
|
6129
|
+
F("div", hi, [
|
|
6130
|
+
F("span", fi, K(S(n)("Shift")), 1),
|
|
6145
6131
|
F("span", null, K(S(t)("extend")), 1)
|
|
6146
6132
|
]),
|
|
6147
6133
|
i[7] || (i[7] = F("div", { class: "mce-statusbar__divider" }, null, -1)),
|
|
6148
|
-
F("div",
|
|
6149
|
-
H(
|
|
6134
|
+
F("div", pi, [
|
|
6135
|
+
H(Ae, { icon: "$mouseLeftClick" }),
|
|
6150
6136
|
F("span", null, K(S(t)("dragSelected")), 1)
|
|
6151
6137
|
])
|
|
6152
6138
|
], 64))
|
|
6153
6139
|
]),
|
|
6154
|
-
F("div",
|
|
6155
|
-
S(s) ? (
|
|
6140
|
+
F("div", vi, [
|
|
6141
|
+
S(s) ? (O(), oe(Wa, {
|
|
6156
6142
|
key: 0,
|
|
6157
6143
|
modelValue: S(a),
|
|
6158
6144
|
"onUpdate:modelValue": i[0] || (i[0] = (l) => Tn(a) ? a.value = l : null),
|
|
6159
6145
|
label: S(t)("exporting")
|
|
6160
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
6146
|
+
}, null, 8, ["modelValue", "label"])) : ee("", !0)
|
|
6161
6147
|
])
|
|
6162
6148
|
]));
|
|
6163
6149
|
}
|
|
6164
|
-
}),
|
|
6150
|
+
}), gi = /* @__PURE__ */ pn(yi, [["__scopeId", "data-v-36c89bd7"]]), bi = /* @__PURE__ */ X({
|
|
6165
6151
|
__name: "TextEditor",
|
|
6166
6152
|
setup(o, { expose: e }) {
|
|
6167
6153
|
const {
|
|
@@ -6173,13 +6159,13 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6173
6159
|
registerCommand: i,
|
|
6174
6160
|
unregisterCommand: l,
|
|
6175
6161
|
camera: c
|
|
6176
|
-
} = de(), u = V(), d =
|
|
6162
|
+
} = de(), u = V(), d = $(() => {
|
|
6177
6163
|
const { zoom: f, position: p } = c.value;
|
|
6178
6164
|
return {
|
|
6179
6165
|
transformOrigin: "left top",
|
|
6180
6166
|
transform: `translate(${p.x}px, ${p.y}px) scale(${f.x}, ${f.y})`
|
|
6181
6167
|
};
|
|
6182
|
-
}), g =
|
|
6168
|
+
}), g = $(() => {
|
|
6183
6169
|
const f = t.value[0], p = r(f), _ = f?.text.base?.boundingBox;
|
|
6184
6170
|
return _ && (p.left += _.left, p.top += _.top), {
|
|
6185
6171
|
...Me(p)
|
|
@@ -6198,11 +6184,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6198
6184
|
return !1;
|
|
6199
6185
|
p.text.isValid() || p.text.setContent(" "), p.text.update(), n.value = "typing";
|
|
6200
6186
|
const _ = u.value;
|
|
6201
|
-
return _.set(p.text.base), await
|
|
6187
|
+
return _.set(p.text.base), await Re(), _.pointerdown(f);
|
|
6202
6188
|
}
|
|
6203
|
-
return
|
|
6189
|
+
return gt(() => i({ command: "startTyping", handle: y })), we(() => l("startTyping")), e({
|
|
6204
6190
|
textEditor: u
|
|
6205
|
-
}), (f, p) => ze((
|
|
6191
|
+
}), (f, p) => ze((O(), R("div", {
|
|
6206
6192
|
class: "mce-text-editor",
|
|
6207
6193
|
style: q({
|
|
6208
6194
|
...d.value
|
|
@@ -6230,24 +6216,24 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6230
6216
|
[Xe, S(t)[0] && S(n) === "typing"]
|
|
6231
6217
|
]);
|
|
6232
6218
|
}
|
|
6233
|
-
}),
|
|
6219
|
+
}), wi = { class: "mce-payhead" }, xi = /* @__PURE__ */ X({
|
|
6234
6220
|
__name: "Playhead",
|
|
6235
6221
|
setup(o) {
|
|
6236
|
-
return (e, t) => (
|
|
6222
|
+
return (e, t) => (O(), R("div", wi, [...t[0] || (t[0] = [
|
|
6237
6223
|
F("header", { class: "mce-payhead__header" }, null, -1),
|
|
6238
6224
|
F("main", { class: "mce-payhead__main" }, null, -1)
|
|
6239
6225
|
])]));
|
|
6240
6226
|
}
|
|
6241
|
-
}),
|
|
6227
|
+
}), _i = {
|
|
6242
6228
|
key: 0,
|
|
6243
6229
|
class: "mce-segment__edge mce-segment__edge--front"
|
|
6244
|
-
},
|
|
6230
|
+
}, ki = {
|
|
6245
6231
|
class: "mce-segment__node",
|
|
6246
6232
|
style: { overflow: "hidden" }
|
|
6247
|
-
},
|
|
6233
|
+
}, Ci = {
|
|
6248
6234
|
key: 1,
|
|
6249
6235
|
class: "mce-segment__edge mce-segment__edge--end"
|
|
6250
|
-
},
|
|
6236
|
+
}, Ei = /* @__PURE__ */ X({
|
|
6251
6237
|
__name: "Segment",
|
|
6252
6238
|
props: {
|
|
6253
6239
|
node: {},
|
|
@@ -6255,46 +6241,46 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6255
6241
|
active: { type: Boolean }
|
|
6256
6242
|
},
|
|
6257
6243
|
setup(o) {
|
|
6258
|
-
const e = o, t =
|
|
6244
|
+
const e = o, t = $(() => {
|
|
6259
6245
|
const n = { left: 0, top: 0, width: 0 };
|
|
6260
6246
|
return n.left = e.node.delay / e.msPerPx, n.width = e.node.duration / e.msPerPx, n.width ? n.width = `${n.width}px` : n.width = "100%", {
|
|
6261
6247
|
width: n.width,
|
|
6262
6248
|
transform: `matrix(1, 0, 0, 1, ${n.left}, ${n.top})`
|
|
6263
6249
|
};
|
|
6264
6250
|
});
|
|
6265
|
-
return (n, s) => (
|
|
6251
|
+
return (n, s) => (O(), R("div", {
|
|
6266
6252
|
class: be(["mce-segment", [
|
|
6267
6253
|
`mce-segment--${o.node.meta.inEditorIs}`,
|
|
6268
6254
|
o.active && "mce-segment--active"
|
|
6269
6255
|
]]),
|
|
6270
6256
|
style: q(t.value)
|
|
6271
6257
|
}, [
|
|
6272
|
-
o.active ? (
|
|
6273
|
-
F("span",
|
|
6274
|
-
o.active ? (
|
|
6258
|
+
o.active ? (O(), R("div", _i)) : ee("", !0),
|
|
6259
|
+
F("span", ki, K(e.node.name), 1),
|
|
6260
|
+
o.active ? (O(), R("div", Ci)) : ee("", !0)
|
|
6275
6261
|
], 6));
|
|
6276
6262
|
}
|
|
6277
|
-
}),
|
|
6263
|
+
}), Ti = { class: "mce-track" }, Ai = /* @__PURE__ */ X({
|
|
6278
6264
|
__name: "Track",
|
|
6279
6265
|
setup(o) {
|
|
6280
|
-
return (e, t) => (
|
|
6281
|
-
|
|
6266
|
+
return (e, t) => (O(), R("div", Ti, [
|
|
6267
|
+
Q(e.$slots, "default")
|
|
6282
6268
|
]));
|
|
6283
6269
|
}
|
|
6284
|
-
}),
|
|
6270
|
+
}), Si = /* @__PURE__ */ X({
|
|
6285
6271
|
__name: "Trackhead",
|
|
6286
6272
|
props: {
|
|
6287
6273
|
node: {}
|
|
6288
6274
|
},
|
|
6289
6275
|
setup(o) {
|
|
6290
|
-
return (e, t) => (
|
|
6276
|
+
return (e, t) => (O(), R("div", {
|
|
6291
6277
|
class: "mce-trackhead",
|
|
6292
6278
|
style: q({
|
|
6293
6279
|
height: `var(--timeline-track-height__${o.node.meta.inEditorIs}, 22px)`
|
|
6294
6280
|
})
|
|
6295
6281
|
}, K(o.node.meta.inEditorIs), 5));
|
|
6296
6282
|
}
|
|
6297
|
-
}),
|
|
6283
|
+
}), Mi = { class: "mce-timeline__toolbar" }, zi = { class: "mce-timeline__main" }, $i = { class: "mce-timeline__left" }, Oi = { class: "mce-timeline__left-wrapper" }, Ii = { class: "mce-timeline__right-wrapper" }, Fi = { class: "mce-timeline__ruler" }, Pi = { class: "mce-timeline__track" }, Ni = 0.02, Ri = /* @__PURE__ */ X({
|
|
6298
6284
|
__name: "Timeline",
|
|
6299
6285
|
setup(o) {
|
|
6300
6286
|
const {
|
|
@@ -6304,12 +6290,12 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6304
6290
|
timeline: s,
|
|
6305
6291
|
endTime: a,
|
|
6306
6292
|
selection: r
|
|
6307
|
-
} = de(), i = V(1e3 / 30), l =
|
|
6293
|
+
} = de(), i = V(1e3 / 30), l = ce("rulerTpl"), c = V(!0), u = V([0, 0]), d = $(() => e.value?.findAll((z) => !!(z instanceof G && z.children.some((I) => I instanceof Ln))) ?? []);
|
|
6308
6294
|
function g(z) {
|
|
6309
6295
|
if (z.ctrlKey) {
|
|
6310
6296
|
if (!(z.wheelDeltaY ? Math.abs(Math.abs(z.wheelDeltaY) - Math.abs(3 * z.deltaY)) < 3 : z.deltaMode === 0)) {
|
|
6311
6297
|
z.preventDefault();
|
|
6312
|
-
const E = t.value, C = Math.log(E), m = -z.deltaY *
|
|
6298
|
+
const E = t.value, C = Math.log(E), m = -z.deltaY * Ni, b = C + m;
|
|
6313
6299
|
t.value = Math.exp(b);
|
|
6314
6300
|
}
|
|
6315
6301
|
} else
|
|
@@ -6319,11 +6305,11 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6319
6305
|
];
|
|
6320
6306
|
}
|
|
6321
6307
|
function h(z) {
|
|
6322
|
-
const
|
|
6323
|
-
if (
|
|
6324
|
-
n.value = (z.clientX -
|
|
6308
|
+
const I = l.value?.box;
|
|
6309
|
+
if (I) {
|
|
6310
|
+
n.value = (z.clientX - I.left + u.value[0]) * t.value;
|
|
6325
6311
|
const E = (m) => {
|
|
6326
|
-
n.value = (m.clientX -
|
|
6312
|
+
n.value = (m.clientX - I.left + u.value[0]) * t.value;
|
|
6327
6313
|
}, C = () => {
|
|
6328
6314
|
window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", C);
|
|
6329
6315
|
};
|
|
@@ -6332,7 +6318,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6332
6318
|
}
|
|
6333
6319
|
function v(z) {
|
|
6334
6320
|
if (z % 30 === 0) {
|
|
6335
|
-
const
|
|
6321
|
+
const I = Math.floor(z / 30 / 60), E = Math.floor(z / 30) % 60, C = String(I).padStart(2, "0"), m = String(E).padStart(2, "0");
|
|
6336
6322
|
return `${C}:${m}`;
|
|
6337
6323
|
}
|
|
6338
6324
|
return `${Math.floor(z % 30)}f`;
|
|
@@ -6341,10 +6327,10 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6341
6327
|
function f() {
|
|
6342
6328
|
c.value = !1;
|
|
6343
6329
|
let z;
|
|
6344
|
-
function
|
|
6345
|
-
z !== void 0 && E !== void 0 && s.value.addTime(E - z), z = E, y = requestAnimationFrame(
|
|
6330
|
+
function I(E) {
|
|
6331
|
+
z !== void 0 && E !== void 0 && s.value.addTime(E - z), z = E, y = requestAnimationFrame(I);
|
|
6346
6332
|
}
|
|
6347
|
-
|
|
6333
|
+
I();
|
|
6348
6334
|
}
|
|
6349
6335
|
function p() {
|
|
6350
6336
|
c.value = !0, y !== void 0 && (cancelAnimationFrame(y), y = void 0);
|
|
@@ -6352,30 +6338,30 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6352
6338
|
function _() {
|
|
6353
6339
|
c.value ? f() : p();
|
|
6354
6340
|
}
|
|
6355
|
-
return we(p), (z,
|
|
6341
|
+
return we(p), (z, I) => (O(), R("div", {
|
|
6356
6342
|
class: "mce-timeline",
|
|
6357
|
-
onWheel:
|
|
6343
|
+
onWheel: I[0] || (I[0] = Ke(() => {
|
|
6358
6344
|
}, ["prevent"]))
|
|
6359
6345
|
}, [
|
|
6360
|
-
F("div",
|
|
6346
|
+
F("div", Mi, [
|
|
6361
6347
|
F("div", {
|
|
6362
6348
|
class: "mce-timeline__play",
|
|
6363
6349
|
onClick: _
|
|
6364
6350
|
}, [
|
|
6365
|
-
H(
|
|
6351
|
+
H(Ae, {
|
|
6366
6352
|
icon: c.value ? "$play" : "$pause"
|
|
6367
6353
|
}, null, 8, ["icon"])
|
|
6368
6354
|
])
|
|
6369
6355
|
]),
|
|
6370
|
-
F("div",
|
|
6356
|
+
F("div", zi, [
|
|
6371
6357
|
F("div", $i, [
|
|
6372
|
-
F("div",
|
|
6358
|
+
F("div", Oi, [
|
|
6373
6359
|
F("div", {
|
|
6374
6360
|
style: q({
|
|
6375
6361
|
transform: `translateY(${u.value[1]}px)`
|
|
6376
6362
|
})
|
|
6377
6363
|
}, [
|
|
6378
|
-
(
|
|
6364
|
+
(O(!0), R(se, null, _e(d.value, (E, C) => (O(), oe(Si, {
|
|
6379
6365
|
key: C,
|
|
6380
6366
|
node: E
|
|
6381
6367
|
}, null, 8, ["node"]))), 128))
|
|
@@ -6387,9 +6373,9 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6387
6373
|
onWheel: g,
|
|
6388
6374
|
onMousedown: h
|
|
6389
6375
|
}, [
|
|
6390
|
-
F("div",
|
|
6391
|
-
F("div",
|
|
6392
|
-
H(
|
|
6376
|
+
F("div", Ii, [
|
|
6377
|
+
F("div", Fi, [
|
|
6378
|
+
H(ft, {
|
|
6393
6379
|
ref: "rulerTpl",
|
|
6394
6380
|
zoom: 1 / S(t) * i.value,
|
|
6395
6381
|
unit: 100,
|
|
@@ -6399,27 +6385,27 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6399
6385
|
"label-format": v
|
|
6400
6386
|
}, null, 8, ["zoom", "position"])
|
|
6401
6387
|
]),
|
|
6402
|
-
F("div",
|
|
6388
|
+
F("div", Pi, [
|
|
6403
6389
|
F("div", {
|
|
6404
6390
|
style: q({
|
|
6405
6391
|
width: `${S(a) / S(t)}px`,
|
|
6406
6392
|
transform: `translate(${u.value[0]}px, ${u.value[1]}px)`
|
|
6407
6393
|
})
|
|
6408
6394
|
}, [
|
|
6409
|
-
(
|
|
6410
|
-
default:
|
|
6411
|
-
H(
|
|
6395
|
+
(O(!0), R(se, null, _e(d.value, (E, C) => (O(), oe(Ai, { key: C }, {
|
|
6396
|
+
default: ne(() => [
|
|
6397
|
+
H(Ei, {
|
|
6412
6398
|
node: E,
|
|
6413
6399
|
"ms-per-px": S(t),
|
|
6414
6400
|
active: S(r).some((m) => m.equal(E)),
|
|
6415
|
-
onMousedown:
|
|
6401
|
+
onMousedown: Ke((m) => r.value = [E], ["stop"])
|
|
6416
6402
|
}, null, 8, ["node", "ms-per-px", "active", "onMousedown"])
|
|
6417
6403
|
]),
|
|
6418
6404
|
_: 2
|
|
6419
6405
|
}, 1024))), 128))
|
|
6420
6406
|
], 4)
|
|
6421
6407
|
]),
|
|
6422
|
-
H(
|
|
6408
|
+
H(xi, {
|
|
6423
6409
|
style: q({
|
|
6424
6410
|
transform: `translate(${u.value[0] + Math.ceil(S(n) / S(t))}px, 0px)`
|
|
6425
6411
|
})
|
|
@@ -6429,19 +6415,19 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6429
6415
|
])
|
|
6430
6416
|
], 32));
|
|
6431
6417
|
}
|
|
6432
|
-
}),
|
|
6418
|
+
}), Bi = ["data-pixel-ratio"], Li = {
|
|
6433
6419
|
ref: "canvasTpl",
|
|
6434
6420
|
class: "mce-editor__canvas"
|
|
6435
|
-
},
|
|
6421
|
+
}, Di = {
|
|
6436
6422
|
ref: "overlayContainerTpl",
|
|
6437
6423
|
class: "mce-editor__overlay-container"
|
|
6438
|
-
},
|
|
6424
|
+
}, or = /* @__PURE__ */ X({
|
|
6439
6425
|
__name: "EditorLayout",
|
|
6440
6426
|
props: {
|
|
6441
|
-
...
|
|
6442
|
-
resizeStrategy:
|
|
6443
|
-
activeStrategy:
|
|
6444
|
-
hoverStrategy:
|
|
6427
|
+
...qs({
|
|
6428
|
+
resizeStrategy: Gs,
|
|
6429
|
+
activeStrategy: Ws,
|
|
6430
|
+
hoverStrategy: Ks
|
|
6445
6431
|
}),
|
|
6446
6432
|
editor: Le
|
|
6447
6433
|
},
|
|
@@ -6449,7 +6435,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6449
6435
|
setup(o, { emit: e }) {
|
|
6450
6436
|
const t = o, n = e;
|
|
6451
6437
|
let s;
|
|
6452
|
-
t.editor ? s =
|
|
6438
|
+
t.editor ? s = Bs(t.editor) : s = de(), De(mn, js());
|
|
6453
6439
|
const {
|
|
6454
6440
|
config: a,
|
|
6455
6441
|
drawboardDom: r,
|
|
@@ -6466,14 +6452,14 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6466
6452
|
selection: p,
|
|
6467
6453
|
getAabbInDrawboard: _,
|
|
6468
6454
|
drawboardAabb: z,
|
|
6469
|
-
drawboardPointer:
|
|
6470
|
-
} = s, E =
|
|
6471
|
-
|
|
6472
|
-
attach:
|
|
6473
|
-
}),
|
|
6455
|
+
drawboardPointer: I
|
|
6456
|
+
} = s, E = ce("overlayContainerTpl"), C = ce("canvasTpl"), m = ce("selectorTpl"), b = ce("textEditorTpl"), k = V({ left: 0, top: 0, width: 0, height: 0 });
|
|
6457
|
+
Hs({
|
|
6458
|
+
attach: $(() => E.value)
|
|
6459
|
+
}), Ht(C, (A) => {
|
|
6474
6460
|
const { width: N, height: L } = A[0].contentRect;
|
|
6475
6461
|
i.value.resize(N, L);
|
|
6476
|
-
}),
|
|
6462
|
+
}), gt(() => {
|
|
6477
6463
|
i.value.on("pointerdown", T), i.value.on("pointermove", M), i.value.on("pointerover", P);
|
|
6478
6464
|
}), He(() => {
|
|
6479
6465
|
c(C.value, r.value);
|
|
@@ -6485,7 +6471,7 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6485
6471
|
}
|
|
6486
6472
|
function w(A) {
|
|
6487
6473
|
let N, L;
|
|
6488
|
-
if (
|
|
6474
|
+
if (Et(
|
|
6489
6475
|
{ x: A.clientX, y: A.clientY },
|
|
6490
6476
|
_(p.value)
|
|
6491
6477
|
))
|
|
@@ -6506,32 +6492,32 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6506
6492
|
return;
|
|
6507
6493
|
const N = p.value[0], L = A.target, j = { x: A.clientX, y: A.clientY };
|
|
6508
6494
|
let D = { ...j }, U = !1, W = !1, Z = [], he;
|
|
6509
|
-
const Y =
|
|
6495
|
+
const Y = Et({
|
|
6510
6496
|
x: j.x + -z.value.left,
|
|
6511
6497
|
y: j.y + -z.value.top
|
|
6512
6498
|
}, _(p.value));
|
|
6513
6499
|
if (A.button === 2) {
|
|
6514
6500
|
if (!Y) {
|
|
6515
|
-
const
|
|
6501
|
+
const te = t.activeStrategy({
|
|
6516
6502
|
element: L,
|
|
6517
6503
|
oldElement: N,
|
|
6518
6504
|
event: A,
|
|
6519
6505
|
isExcluded: x
|
|
6520
6506
|
});
|
|
6521
|
-
|
|
6507
|
+
te && !(te instanceof G) ? Z = te.element ? [te.element] : [] : Z = te ? [te] : [], p.value = Z;
|
|
6522
6508
|
}
|
|
6523
6509
|
return;
|
|
6524
6510
|
}
|
|
6525
|
-
function xe(
|
|
6526
|
-
const
|
|
6511
|
+
function xe(te) {
|
|
6512
|
+
const ie = t.activeStrategy({
|
|
6527
6513
|
element: L,
|
|
6528
6514
|
oldElement: N,
|
|
6529
|
-
event:
|
|
6515
|
+
event: te,
|
|
6530
6516
|
isExcluded: x
|
|
6531
6517
|
});
|
|
6532
|
-
|
|
6518
|
+
ie && !(ie instanceof G) ? Z = ie.element ? [ie.element] : [] : Z = ie ? [ie] : [], p.value = Z;
|
|
6533
6519
|
}
|
|
6534
|
-
function
|
|
6520
|
+
function ae() {
|
|
6535
6521
|
d.value !== "selecting" && (d.value = "selecting"), k.value = {
|
|
6536
6522
|
left: Math.min(j.x, D.x) - z.value.left,
|
|
6537
6523
|
top: Math.min(j.y, D.y) - z.value.top,
|
|
@@ -6540,55 +6526,55 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6540
6526
|
}, Z = v(k.value);
|
|
6541
6527
|
}
|
|
6542
6528
|
function ve() {
|
|
6543
|
-
const
|
|
6529
|
+
const te = t.activeStrategy({
|
|
6544
6530
|
element: L,
|
|
6545
6531
|
oldElement: N,
|
|
6546
6532
|
event: A,
|
|
6547
6533
|
isExcluded: () => !1
|
|
6548
6534
|
});
|
|
6549
|
-
let
|
|
6550
|
-
|
|
6535
|
+
let ie;
|
|
6536
|
+
te && !(te instanceof G) ? (ie = te.element, he = te.state) : ie = te, ie && (A?.ctrlKey || A?.shiftKey || A?.metaKey) ? p.value.findIndex((ge) => ge.equal(ie)) > -1 ? Z = p.value.filter((ge) => !ge.equal(ie)) : Z = [...p.value, ie] : Z = ie ? [ie] : [];
|
|
6551
6537
|
}
|
|
6552
6538
|
function ye() {
|
|
6553
6539
|
return !U && (Math.abs(D.x - j.x) >= 3 || Math.abs(D.y - j.y) >= 3);
|
|
6554
6540
|
}
|
|
6555
|
-
function J(
|
|
6556
|
-
Y ? ye() && (U = !0, y("startTransform")) : L && !h(L) && ye() && (U = !0, xe(
|
|
6541
|
+
function J(te) {
|
|
6542
|
+
Y ? ye() && (U = !0, y("startTransform")) : L && !h(L) && ye() && (U = !0, xe(te), Re(() => {
|
|
6557
6543
|
W || y("startTransform");
|
|
6558
6544
|
}));
|
|
6559
6545
|
}
|
|
6560
|
-
function me(
|
|
6561
|
-
D = { x:
|
|
6546
|
+
function me(te) {
|
|
6547
|
+
D = { x: te.clientX, y: te.clientY }, Y || (!L || h(L)) && ae();
|
|
6562
6548
|
}
|
|
6563
|
-
async function
|
|
6549
|
+
async function ue(te) {
|
|
6564
6550
|
if (d.value && (d.value = void 0), !U) {
|
|
6565
6551
|
if (L && ve(), p.value = Z, he && Z[0] && !f(Z[0]))
|
|
6566
6552
|
switch (he) {
|
|
6567
6553
|
case "typing": {
|
|
6568
|
-
await y("startTyping",
|
|
6554
|
+
await y("startTyping", te);
|
|
6569
6555
|
break;
|
|
6570
6556
|
}
|
|
6571
6557
|
}
|
|
6572
6558
|
w(A);
|
|
6573
6559
|
}
|
|
6574
|
-
i.value.off("pointermove", J), document.removeEventListener("pointermove", me), document.removeEventListener("pointerup",
|
|
6560
|
+
i.value.off("pointermove", J), document.removeEventListener("pointermove", me), document.removeEventListener("pointerup", ue), W = !0;
|
|
6575
6561
|
}
|
|
6576
|
-
i.value.on("pointermove", J), document.addEventListener("pointermove", me), document.addEventListener("pointerup",
|
|
6562
|
+
i.value.on("pointermove", J), document.addEventListener("pointermove", me), document.addEventListener("pointerup", ue);
|
|
6577
6563
|
}
|
|
6578
6564
|
function M(A) {
|
|
6579
|
-
A.srcElement === r.value && (
|
|
6565
|
+
A.srcElement === r.value && (I.value = { x: A.clientX, y: A.clientY }, !(l.value.grabbing || A.button === 1 || d.value && d.value !== "typing") && w(A));
|
|
6580
6566
|
}
|
|
6581
6567
|
function P() {
|
|
6582
|
-
|
|
6568
|
+
I.value = void 0, u.value = void 0, g(void 0);
|
|
6583
6569
|
}
|
|
6584
6570
|
function B() {
|
|
6585
6571
|
r.value && (r.value.scrollLeft && (r.value.scrollLeft = 0), r.value.scrollTop && (r.value.scrollTop = 0));
|
|
6586
6572
|
}
|
|
6587
|
-
return (A, N) => (
|
|
6588
|
-
default:
|
|
6589
|
-
H(
|
|
6590
|
-
H(
|
|
6591
|
-
default:
|
|
6573
|
+
return (A, N) => (O(), oe(Va, { class: "mce-editor" }, {
|
|
6574
|
+
default: ne(() => [
|
|
6575
|
+
H(Da),
|
|
6576
|
+
H(Ua, null, {
|
|
6577
|
+
default: ne(() => [
|
|
6592
6578
|
F("div", {
|
|
6593
6579
|
ref_key: "drawboardDom",
|
|
6594
6580
|
ref: r,
|
|
@@ -6596,137 +6582,181 @@ const Ft = Symbol.for("MceMenuSymbol"), Te = /* @__PURE__ */ X({
|
|
|
6596
6582
|
"data-pixel-ratio": S(i).pixelRatio,
|
|
6597
6583
|
onDblclick: N[0] || (N[0] = (L) => n("dblclick:drawboard", L)),
|
|
6598
6584
|
onScroll: B,
|
|
6599
|
-
onWheel: N[1] || (N[1] =
|
|
6585
|
+
onWheel: N[1] || (N[1] = Ke(() => {
|
|
6600
6586
|
}, ["prevent"]))
|
|
6601
6587
|
}, [
|
|
6602
|
-
F("canvas",
|
|
6603
|
-
H(
|
|
6604
|
-
H(
|
|
6605
|
-
H(
|
|
6606
|
-
H(
|
|
6607
|
-
H(
|
|
6608
|
-
H(
|
|
6588
|
+
F("canvas", Li, null, 512),
|
|
6589
|
+
H(bi, { ref: "textEditorTpl" }, null, 512),
|
|
6590
|
+
H(Zs),
|
|
6591
|
+
H(_a),
|
|
6592
|
+
H(ba),
|
|
6593
|
+
H(va),
|
|
6594
|
+
H(La, {
|
|
6609
6595
|
ref: "selectorTpl",
|
|
6610
6596
|
"selected-area": k.value,
|
|
6611
6597
|
"resize-strategy": S(p)[0] ? t.resizeStrategy(S(p)[0]) : void 0
|
|
6612
6598
|
}, {
|
|
6613
|
-
transformable:
|
|
6614
|
-
|
|
6599
|
+
transformable: ne(({ box: L }) => [
|
|
6600
|
+
Q(A.$slots, "transformer", { box: L })
|
|
6615
6601
|
]),
|
|
6616
|
-
default:
|
|
6617
|
-
|
|
6602
|
+
default: ne(({ box: L }) => [
|
|
6603
|
+
Q(A.$slots, "selector", { box: L })
|
|
6618
6604
|
]),
|
|
6619
6605
|
_: 3
|
|
6620
6606
|
}, 8, ["selected-area", "resize-strategy"]),
|
|
6621
|
-
S(a).scrollbar ? (
|
|
6622
|
-
A.$slots.floatbar ? (
|
|
6607
|
+
S(a).scrollbar ? (O(), oe($a, { key: 0 })) : ee("", !0),
|
|
6608
|
+
A.$slots.floatbar ? (O(), oe(ya, {
|
|
6623
6609
|
key: 1,
|
|
6624
6610
|
target: S(d) === "typing" ? b.value?.textEditor : m.value?.transformable?.$el
|
|
6625
6611
|
}, {
|
|
6626
|
-
default:
|
|
6627
|
-
|
|
6612
|
+
default: ne(() => [
|
|
6613
|
+
Q(A.$slots, "floatbar")
|
|
6628
6614
|
]),
|
|
6629
6615
|
_: 3
|
|
6630
|
-
}, 8, ["target"])) :
|
|
6631
|
-
H(
|
|
6632
|
-
H(
|
|
6633
|
-
S(a).ruler ? (
|
|
6634
|
-
|
|
6635
|
-
], 40,
|
|
6616
|
+
}, 8, ["target"])) : ee("", !0),
|
|
6617
|
+
H(fa),
|
|
6618
|
+
H(wa),
|
|
6619
|
+
S(a).ruler ? (O(), oe(Sa, { key: 2 })) : ee("", !0),
|
|
6620
|
+
Q(A.$slots, "drawboard")
|
|
6621
|
+
], 40, Bi)
|
|
6636
6622
|
]),
|
|
6637
6623
|
_: 3
|
|
6638
6624
|
}),
|
|
6639
|
-
|
|
6640
|
-
H(
|
|
6625
|
+
Q(A.$slots, "default"),
|
|
6626
|
+
H(Bt, {
|
|
6641
6627
|
modelValue: S(a).statusbar,
|
|
6642
6628
|
"onUpdate:modelValue": N[2] || (N[2] = (L) => S(a).statusbar = L),
|
|
6643
6629
|
position: "bottom",
|
|
6644
6630
|
size: 24
|
|
6645
6631
|
}, {
|
|
6646
|
-
default:
|
|
6647
|
-
H(
|
|
6632
|
+
default: ne(() => [
|
|
6633
|
+
H(gi)
|
|
6648
6634
|
]),
|
|
6649
6635
|
_: 1
|
|
6650
6636
|
}, 8, ["modelValue"]),
|
|
6651
|
-
H(
|
|
6637
|
+
H(Bt, {
|
|
6652
6638
|
modelValue: S(a).timeline,
|
|
6653
6639
|
"onUpdate:modelValue": N[3] || (N[3] = (L) => S(a).timeline = L),
|
|
6654
6640
|
position: "bottom",
|
|
6655
6641
|
size: 160
|
|
6656
6642
|
}, {
|
|
6657
|
-
default:
|
|
6658
|
-
H(
|
|
6643
|
+
default: ne(() => [
|
|
6644
|
+
H(Ri)
|
|
6659
6645
|
]),
|
|
6660
6646
|
_: 1
|
|
6661
6647
|
}, 8, ["modelValue"]),
|
|
6662
|
-
F("div",
|
|
6648
|
+
F("div", Di, null, 512)
|
|
6663
6649
|
]),
|
|
6664
6650
|
_: 3
|
|
6665
6651
|
}));
|
|
6666
6652
|
}
|
|
6653
|
+
}), sr = /* @__PURE__ */ X({
|
|
6654
|
+
__name: "Dialog",
|
|
6655
|
+
props: /* @__PURE__ */ Oe({
|
|
6656
|
+
...qe()
|
|
6657
|
+
}, {
|
|
6658
|
+
modelValue: { type: Boolean },
|
|
6659
|
+
modelModifiers: {}
|
|
6660
|
+
}),
|
|
6661
|
+
emits: ["update:modelValue"],
|
|
6662
|
+
setup(o, { expose: e }) {
|
|
6663
|
+
const t = o, n = ke(o, "modelValue"), s = ce("overlayTpl"), a = $(() => ({
|
|
6664
|
+
onClick: () => n.value = !0
|
|
6665
|
+
}));
|
|
6666
|
+
function r() {
|
|
6667
|
+
s.value?.updateLocation();
|
|
6668
|
+
}
|
|
6669
|
+
return e({
|
|
6670
|
+
isActive: n,
|
|
6671
|
+
updateLocation: r
|
|
6672
|
+
}), (i, l) => (O(), oe(ot, {
|
|
6673
|
+
ref: "overlayTpl",
|
|
6674
|
+
modelValue: n.value,
|
|
6675
|
+
"onUpdate:modelValue": l[0] || (l[0] = (c) => n.value = c),
|
|
6676
|
+
location: t.location,
|
|
6677
|
+
offset: t.offset,
|
|
6678
|
+
target: t.target,
|
|
6679
|
+
attach: t.attach,
|
|
6680
|
+
class: "mce-dialog"
|
|
6681
|
+
}, {
|
|
6682
|
+
activator: ne((c) => [
|
|
6683
|
+
Q(i.$slots, "activator", $e(c, {
|
|
6684
|
+
props: { ...c.props, ...a.value }
|
|
6685
|
+
}))
|
|
6686
|
+
]),
|
|
6687
|
+
default: ne(() => [
|
|
6688
|
+
Q(i.$slots, "default")
|
|
6689
|
+
]),
|
|
6690
|
+
_: 3
|
|
6691
|
+
}, 8, ["modelValue", "location", "offset", "target", "attach"]));
|
|
6692
|
+
}
|
|
6667
6693
|
});
|
|
6668
6694
|
export {
|
|
6695
|
+
sr as Dialog,
|
|
6669
6696
|
un as Doc,
|
|
6670
6697
|
Le as Editor,
|
|
6671
|
-
|
|
6672
|
-
|
|
6698
|
+
or as EditorLayout,
|
|
6699
|
+
Bt as EditorLayoutItem,
|
|
6673
6700
|
mn as IconsSymbol,
|
|
6674
|
-
|
|
6701
|
+
It as MceComponentIcon,
|
|
6675
6702
|
fn as MceLayoutItemKey,
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6703
|
+
Je as MceLayoutKey,
|
|
6704
|
+
Pt as MceMenuSymbol,
|
|
6705
|
+
ht as MceOverlaySymbol,
|
|
6679
6706
|
dn as MceSvgIcon,
|
|
6707
|
+
da as Menu,
|
|
6680
6708
|
ln as Model,
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6709
|
+
ft as Ruler,
|
|
6710
|
+
Tt as SUPPORTS_CLIPBOARD,
|
|
6711
|
+
Rt as Scrollbar,
|
|
6712
|
+
Ba as Transformable,
|
|
6713
|
+
Qt as USER_AGENT,
|
|
6714
|
+
nt as Workspace,
|
|
6685
6715
|
Me as boundingBoxToStyle,
|
|
6686
|
-
|
|
6716
|
+
Qi as consoleError,
|
|
6687
6717
|
uo as consoleWarn,
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6718
|
+
Ge as convertToUnit,
|
|
6719
|
+
js as createIcons,
|
|
6720
|
+
dt as createImageElement,
|
|
6721
|
+
aa as createLayout,
|
|
6722
|
+
ut as createTextElement,
|
|
6723
|
+
Ws as defaultActiveStrategy,
|
|
6724
|
+
Ks as defaultHoverStrategy,
|
|
6725
|
+
Gs as defaultResizeStrategy,
|
|
6726
|
+
nr as defineMixin,
|
|
6727
|
+
tr as definePlugin,
|
|
6698
6728
|
je as findChildrenWithProvide,
|
|
6699
6729
|
ho as getImageSizeFromUrl,
|
|
6700
6730
|
go as getRandomValues,
|
|
6701
6731
|
cn as iElementToYElements,
|
|
6702
|
-
|
|
6703
|
-
|
|
6732
|
+
ct as imageExtRe,
|
|
6733
|
+
en as imageExts,
|
|
6704
6734
|
fo as imageMimeTypeExtMap,
|
|
6705
6735
|
po as isClickInsideElement,
|
|
6706
|
-
|
|
6736
|
+
Fe as isMac,
|
|
6707
6737
|
Be as isOverlappingAabb,
|
|
6708
6738
|
co as isOverlappingObb,
|
|
6709
|
-
|
|
6739
|
+
Et as isPointInsideAabb,
|
|
6710
6740
|
mo as isWindows,
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6741
|
+
_t as makeIconProps,
|
|
6742
|
+
ta as makeLayoutItemProps,
|
|
6743
|
+
ea as makeLayoutProps,
|
|
6744
|
+
qe as makeMceOverlayProps,
|
|
6745
|
+
qs as makeMceStrategyProps,
|
|
6746
|
+
Zi as minBoundingBox,
|
|
6717
6747
|
os as mixins,
|
|
6718
|
-
|
|
6748
|
+
Rs as plugins,
|
|
6719
6749
|
tn as propsFactory,
|
|
6720
|
-
|
|
6721
|
-
|
|
6750
|
+
Bs as provideEditor,
|
|
6751
|
+
Hs as provideOverlay,
|
|
6722
6752
|
vo as refElement,
|
|
6723
6753
|
yo as templateRef,
|
|
6724
6754
|
bo as uint32,
|
|
6725
6755
|
de as useEditor,
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6756
|
+
Ls as useIcon,
|
|
6757
|
+
na as useLayout,
|
|
6758
|
+
oa as useLayoutItem,
|
|
6759
|
+
Ys as useOverlay,
|
|
6760
|
+
Qs as useResizeObserver,
|
|
6761
|
+
er as uuidv4
|
|
6732
6762
|
};
|