mce 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +44 -53
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Aabb2D as xt, Animation as jt, Camera2D as Oi, DEG_TO_RAD as Vi, DrawboardEffect as Vo, Element2D as
|
|
2
|
-
import { Fragment as we, Teleport as No, Transition as Hi, computed as Y, createBlock as Fe, createCommentVNode as _e, createElementBlock as J, createElementVNode as W, createSlots as Do, createStaticVNode as Xi, createTextVNode as mt, createVNode as Me, defineComponent as Se, effectScope as Yi, getCurrentInstance as Qt, guardReactiveProps as yt, h as
|
|
1
|
+
import { Aabb2D as xt, Animation as jt, Camera2D as Oi, DEG_TO_RAD as Vi, DrawboardEffect as Vo, Element2D as Zt, Engine as Fi, IN_BROWSER as Fo, IN_MAC_OS as Ni, Lottie2D as Zo, Node as $n, Obb2D as Hn, Timeline as Di, TimelineNode as Bi, Video2D as Cn, assets as qi, clamp as Ct, customNodes as ji, render as Qn, renderPixels as Ui } from "modern-canvas";
|
|
2
|
+
import { Fragment as we, Teleport as No, Transition as Hi, computed as Y, createBlock as Fe, createCommentVNode as _e, createElementBlock as J, createElementVNode as W, createSlots as Do, createStaticVNode as Xi, createTextVNode as mt, createVNode as Me, defineComponent as Se, effectScope as Yi, getCurrentInstance as Qt, guardReactiveProps as yt, h as Xt, inject as Ot, isReactive as Gi, isRef as Wn, markRaw as bo, mergeModels as lt, mergeProps as ht, nextTick as zt, normalizeClass as De, normalizeProps as gt, normalizeStyle as $e, onActivated as Wi, onBeforeMount as bt, onBeforeUnmount as Qe, onDeactivated as Ki, onMounted as Vt, onScopeDispose as en, onUnmounted as Zi, openBlock as j, provide as Yt, reactive as dt, readonly as Ji, ref as de, renderList as Ie, renderSlot as Ne, resolveComponent as $s, resolveDynamicComponent as Bo, shallowRef as Ut, toDisplayString as be, toRaw as _o, toRef as Wt, toValue as Qi, unref as F, useAttrs as Ls, useId as qo, useModel as tt, useSlots as er, useTemplateRef as nt, vModelCheckbox as tr, vModelSelect as Jo, vModelText as Ln, vShow as zs, watch as Be, withCtx as Te, withDirectives as pt, withKeys as Qo, withModifiers as Je } from "vue";
|
|
3
3
|
import { isClient as nr, onClickOutside as or, useDebounceFn as Rs, useEventListener as Os, useFileDialog as Vs, useImage as sr, useLocalStorage as ir, useResizeObserver as Fs } from "@vueuse/core";
|
|
4
|
-
import { Observable as jo, getDefaultTextStyle as rr, getObjectValueByPath as ar, idGenerator as
|
|
4
|
+
import { Observable as jo, getDefaultTextStyle as rr, getObjectValueByPath as ar, idGenerator as Kt, isCRLF as Xn, isEqualObject as lr, normalizeCRLF as mn, normalizeTextContent as pn, property as Ft, setObjectValueByPath as cr, textContentToString as ao } from "modern-idoc";
|
|
5
5
|
import { cloneDeep as En, get as ur, isEqual as dr, isPlainObject as es, merge as un, set as wo } from "lodash-es";
|
|
6
6
|
import { Text as hr, measureText as ko } from "modern-text";
|
|
7
7
|
import { Fonts as fr } from "modern-font";
|
|
@@ -2613,18 +2613,18 @@ function el(n, e = {}) {
|
|
|
2613
2613
|
let M = n[0], P = n[1], y = n[2], p = n[3], g = 0, x = 0, b = -(P - p), w = M - y, E = 0, I = 0, k = Math.sqrt(b * b + w * w);
|
|
2614
2614
|
b /= k, w /= k, b *= R, w *= R;
|
|
2615
2615
|
const T = c, z = (1 - T) * 2, N = T * 2;
|
|
2616
|
-
h || (l.cap === "round" ? L +=
|
|
2616
|
+
h || (l.cap === "round" ? L += Gt(M - b * (z - N) * 0.5, P - w * (z - N) * 0.5, M - b * z, P - w * z, M + b * N, P + w * N, f, !0) + 2 : l.cap === "square" && (L += ps(M, P, b, w, z, N, !0, f))), f.push(M - b * z, P - w * z), f.push(M + b * N, P + w * N);
|
|
2617
2617
|
for (let U = 1; U < _ - 1; ++U) {
|
|
2618
2618
|
M = n[(U - 1) * 2], P = n[(U - 1) * 2 + 1], y = n[U * 2], p = n[U * 2 + 1], g = n[(U + 1) * 2], x = n[(U + 1) * 2 + 1], b = -(P - p), w = M - y, k = Math.sqrt(b * b + w * w), b /= k, w /= k, b *= R, w *= R, E = -(p - x), I = y - g, k = Math.sqrt(E * E + I * I), E /= k, I /= k, E *= R, I *= R;
|
|
2619
2619
|
const G = y - M, q = P - p, K = y - g, H = x - p, Q = G * K + q * H, $ = q * K - H * G, Z = $ < 0;
|
|
2620
2620
|
if (Math.abs($) < 1e-3 * Math.abs(Q)) {
|
|
2621
|
-
f.push(y - b * z, p - w * z), f.push(y + b * N, p + w * N), Q >= 0 && (l.join === "round" ? L +=
|
|
2621
|
+
f.push(y - b * z, p - w * z), f.push(y + b * N, p + w * N), Q >= 0 && (l.join === "round" ? L += Gt(y, p, y - b * z, p - w * z, y - E * z, p - I * z, f, !1) + 4 : L += 2, f.push(y - E * N, p - I * N), f.push(y + E * z, p + I * z));
|
|
2622
2622
|
continue;
|
|
2623
2623
|
}
|
|
2624
2624
|
const te = (-b + M) * (-w + p) - (-b + y) * (-w + P), ee = (-E + g) * (-I + p) - (-E + y) * (-I + x), ae = (G * ee - K * te) / $, ce = (H * te - q * ee) / $, pe = (ae - y) * (ae - y) + (ce - p) * (ce - p), he = y + (ae - y) * z, ge = p + (ce - p) * z, ve = y - (ae - y) * N, fe = p - (ce - p) * N, Ce = Math.min(G * G + q * q, K * K + H * H), ke = Z ? z : N;
|
|
2625
|
-
pe <= Ce + ke * ke * S ? l.join === "bevel" || pe / S > A ? (Z ? (f.push(he, ge), f.push(y + b * N, p + w * N), f.push(he, ge), f.push(y + E * N, p + I * N)) : (f.push(y - b * z, p - w * z), f.push(ve, fe), f.push(y - E * z, p - I * z), f.push(ve, fe)), L += 2) : l.join === "round" ? Z ? (f.push(he, ge), f.push(y + b * N, p + w * N), L +=
|
|
2625
|
+
pe <= Ce + ke * ke * S ? l.join === "bevel" || pe / S > A ? (Z ? (f.push(he, ge), f.push(y + b * N, p + w * N), f.push(he, ge), f.push(y + E * N, p + I * N)) : (f.push(y - b * z, p - w * z), f.push(ve, fe), f.push(y - E * z, p - I * z), f.push(ve, fe)), L += 2) : l.join === "round" ? Z ? (f.push(he, ge), f.push(y + b * N, p + w * N), L += Gt(y, p, y + b * N, p + w * N, y + E * N, p + I * N, f, !0) + 4, f.push(he, ge), f.push(y + E * N, p + I * N)) : (f.push(y - b * z, p - w * z), f.push(ve, fe), L += Gt(y, p, y - b * z, p - w * z, y - E * z, p - I * z, f, !1) + 4, f.push(y - E * z, p - I * z), f.push(ve, fe)) : (f.push(he, ge), f.push(ve, fe)) : (f.push(y - b * z, p - w * z), f.push(y + b * N, p + w * N), l.join === "round" ? Z ? L += Gt(y, p, y + b * N, p + w * N, y + E * N, p + I * N, f, !0) + 2 : L += Gt(y, p, y - b * z, p - w * z, y - E * z, p - I * z, f, !1) + 2 : l.join === "miter" && pe / S <= A && (Z ? (f.push(ve, fe), f.push(ve, fe)) : (f.push(he, ge), f.push(he, ge)), L += 2), f.push(y - E * z, p - I * z), f.push(y + E * N, p + I * N), L += 2);
|
|
2626
2626
|
}
|
|
2627
|
-
M = n[(_ - 2) * 2], P = n[(_ - 2) * 2 + 1], y = n[(_ - 1) * 2], p = n[(_ - 1) * 2 + 1], b = -(P - p), w = M - y, k = Math.sqrt(b * b + w * w), b /= k, w /= k, b *= R, w *= R, f.push(y - b * z, p - w * z), f.push(y + b * N, p + w * N), h || (l.cap === "round" ? L +=
|
|
2627
|
+
M = n[(_ - 2) * 2], P = n[(_ - 2) * 2 + 1], y = n[(_ - 1) * 2], p = n[(_ - 1) * 2 + 1], b = -(P - p), w = M - y, k = Math.sqrt(b * b + w * w), b /= k, w /= k, b *= R, w *= R, f.push(y - b * z, p - w * z), f.push(y + b * N, p + w * N), h || (l.cap === "round" ? L += Gt(y - b * (z - N) * 0.5, p - w * (z - N) * 0.5, y - b * z, p - w * z, y + b * N, p + w * N, f, !1) + 2 : l.cap === "square" && (L += ps(y, p, b, w, z, N, !1, f)));
|
|
2628
2628
|
const oe = ms * ms;
|
|
2629
2629
|
for (let U = O; U < L + O - 2; ++U)
|
|
2630
2630
|
M = f[U * 2], P = f[U * 2 + 1], y = f[(U + 1) * 2], p = f[(U + 1) * 2 + 1], g = f[(U + 2) * 2], x = f[(U + 2) * 2 + 1], !(Math.abs(M * (p - x) + y * (x - P) + g * (P - p)) < oe) && o.push(U, U + 1, U + 2);
|
|
@@ -2658,7 +2658,7 @@ function ps(n, e, t, o, s, i, r, a) {
|
|
|
2658
2658
|
const f = l + h, _ = c + m, L = d + h, O = u + m;
|
|
2659
2659
|
return a.push(f, _), a.push(L, O), 2;
|
|
2660
2660
|
}
|
|
2661
|
-
function
|
|
2661
|
+
function Gt(n, e, t, o, s, i, r, a) {
|
|
2662
2662
|
const l = t - n, c = o - e;
|
|
2663
2663
|
let d = Math.atan2(l, c), u = Math.atan2(s - n, i - e);
|
|
2664
2664
|
a && d < u ? d += Math.PI * 2 : !a && d > u && (u += Math.PI * 2);
|
|
@@ -5296,7 +5296,7 @@ var cc = class extends jo {
|
|
|
5296
5296
|
_pendingInserts = /* @__PURE__ */ new Map();
|
|
5297
5297
|
indexeddb;
|
|
5298
5298
|
_rx;
|
|
5299
|
-
constructor(n =
|
|
5299
|
+
constructor(n = Kt(), e = rc) {
|
|
5300
5300
|
super(), this.id = n, this._rx = e, this._yDoc = this._rx.markRaw(new ut.Doc({
|
|
5301
5301
|
guid: n,
|
|
5302
5302
|
gc: !0
|
|
@@ -5498,20 +5498,11 @@ var cc = class extends jo {
|
|
|
5498
5498
|
const s = this._nodeMap.get(o);
|
|
5499
5499
|
if (s) n = s;
|
|
5500
5500
|
else {
|
|
5501
|
-
|
|
5502
|
-
const r = (a) => {
|
|
5503
|
-
if (a instanceof Xt && !a.text.base.__markRaw__) {
|
|
5504
|
-
const l = this._rx.markRaw(a.text.base);
|
|
5505
|
-
l.__markRaw__ = !0, l.setPropertyAccessor(a.text), a.text.base = l;
|
|
5506
|
-
}
|
|
5507
|
-
};
|
|
5508
|
-
r(n), n.findOne((a) => (r(a), !1)), n = this._rx.reactive(n), n.parent && (n.parent.children[n.getIndex()] = n);
|
|
5509
|
-
}
|
|
5510
|
-
this._nodeMap.set(o, n), this._flushPendingInserts(o);
|
|
5501
|
+
this._rx.isReactive(n) || (n = this._rx.reactive(n), n.parent && (n.parent.children[n.getIndex()] = n)), this._nodeMap.set(o, n), this._flushPendingInserts(o);
|
|
5511
5502
|
const i = () => {
|
|
5512
5503
|
this._guardedTransact(() => e.set("parentId", n.parent?.id));
|
|
5513
5504
|
};
|
|
5514
|
-
i(), n.on("parented", i), this._proxyProps(n, e), this._proxyProps(n.meta, this._ensureSubMap(e, "meta", n.meta), !0), n instanceof
|
|
5505
|
+
i(), n.on("parented", i), this._proxyProps(n, e), this._proxyProps(n.meta, this._ensureSubMap(e, "meta", n.meta), !0), n instanceof Zt && (lc.forEach((r) => {
|
|
5515
5506
|
this._proxyProps(n[r], this._ensureSubMap(e, r, n[r]));
|
|
5516
5507
|
}), n.text.update(), n.table.isValid() && n.table.update(), n.requestRender()), t || (t = e.get("childrenIds")), t || (t = new ut.Array(), t.push(n.children.map((r) => r.id)), e.set("childrenIds", t)), this._proxyChildren(n, t);
|
|
5517
5508
|
}
|
|
@@ -5656,7 +5647,7 @@ var cc = class extends jo {
|
|
|
5656
5647
|
return G($, "Frame") && (!Z || !!$.parent?.equal(t.value));
|
|
5657
5648
|
}
|
|
5658
5649
|
function U($) {
|
|
5659
|
-
return $ instanceof
|
|
5650
|
+
return $ instanceof Zt;
|
|
5660
5651
|
}
|
|
5661
5652
|
function G($, Z) {
|
|
5662
5653
|
return $.meta.inEditorIs === Z;
|
|
@@ -7792,7 +7783,7 @@ var Wc = Pe((n) => {
|
|
|
7792
7783
|
}
|
|
7793
7784
|
function c(A = o.value[0]) {
|
|
7794
7785
|
if (!A) return;
|
|
7795
|
-
const M =
|
|
7786
|
+
const M = Kt(), P = {
|
|
7796
7787
|
id: M,
|
|
7797
7788
|
name: A.name || "Component",
|
|
7798
7789
|
node: A.toJSON()
|
|
@@ -7943,7 +7934,7 @@ var Wc = Pe((n) => {
|
|
|
7943
7934
|
s("historyChanged", P);
|
|
7944
7935
|
}
|
|
7945
7936
|
function _(P) {
|
|
7946
|
-
P.findOne((y) => (y instanceof
|
|
7937
|
+
P.findOne((y) => (y instanceof Zt && (y.foreground.texture?.destroy(), y.foreground.animatedTexture?.destroy(), y.fill.texture?.destroy(), y.fill.animatedTexture?.destroy(), y.background.texture?.destroy(), y.background.animatedTexture?.destroy()), !1));
|
|
7947
7938
|
}
|
|
7948
7939
|
function L(P) {
|
|
7949
7940
|
if (Array.isArray(P)) return P;
|
|
@@ -8070,7 +8061,7 @@ var Wc = Pe((n) => {
|
|
|
8070
8061
|
return T.style && (delete T.style.left, delete T.style.top), T;
|
|
8071
8062
|
}))}</mce-clipboard>`;
|
|
8072
8063
|
const I = (k) => {
|
|
8073
|
-
if (k instanceof
|
|
8064
|
+
if (k instanceof Zt) {
|
|
8074
8065
|
const T = k.text.base.toString();
|
|
8075
8066
|
x.push(T), b += `<span>${T}</span>`;
|
|
8076
8067
|
}
|
|
@@ -8586,7 +8577,7 @@ function yu() {
|
|
|
8586
8577
|
c.equal(u.value) && (d = h);
|
|
8587
8578
|
}), d;
|
|
8588
8579
|
}
|
|
8589
|
-
return
|
|
8580
|
+
return Yt(Ci, {
|
|
8590
8581
|
selecting: i,
|
|
8591
8582
|
openedItems: t,
|
|
8592
8583
|
dragging: r,
|
|
@@ -8637,7 +8628,7 @@ function gu(n) {
|
|
|
8637
8628
|
id: t,
|
|
8638
8629
|
...n
|
|
8639
8630
|
}, s = Qt();
|
|
8640
|
-
return
|
|
8631
|
+
return Yt(Ei, { id: t }), e.register(s, o), Qe(() => e.unregister(t)), {
|
|
8641
8632
|
...e,
|
|
8642
8633
|
id: t,
|
|
8643
8634
|
dropping: Y(() => e.droppingItemId.value === t),
|
|
@@ -8693,7 +8684,7 @@ function Mu(n) {
|
|
|
8693
8684
|
const e = Ot(Zn);
|
|
8694
8685
|
if (!e) throw new Error("[mce] Could not find injected layout");
|
|
8695
8686
|
const t = n.id ?? `layout-item-${qo()}`, o = Qt();
|
|
8696
|
-
|
|
8687
|
+
Yt(Ti, { id: t });
|
|
8697
8688
|
const s = Ut(!1);
|
|
8698
8689
|
Ki(() => s.value = !0), Wi(() => s.value = !1);
|
|
8699
8690
|
const { layoutItemStyles: i, layoutItemScrimStyles: r } = e.register(o, {
|
|
@@ -8755,7 +8746,7 @@ function Cu(n) {
|
|
|
8755
8746
|
M.push(...y);
|
|
8756
8747
|
}
|
|
8757
8748
|
return Su(M, s, i, a);
|
|
8758
|
-
}), m = Y(() => !Array.from(l.values()).some((A) => A.value)), f = Y(() => h.value[h.value.length - 1].layer), _ =
|
|
8749
|
+
}), m = Y(() => !Array.from(l.values()).some((A) => A.value)), f = Y(() => h.value[h.value.length - 1].layer), _ = Wt(() => ({
|
|
8759
8750
|
"--m-layout-left": Vn(f.value.left),
|
|
8760
8751
|
"--m-layout-right": Vn(f.value.right),
|
|
8761
8752
|
"--m-layout-top": Vn(f.value.top),
|
|
@@ -8772,7 +8763,7 @@ function Cu(n) {
|
|
|
8772
8763
|
})), O = (A) => L.value.find((M) => M.id === A), R = Qt(), S = Ut(!1);
|
|
8773
8764
|
return Vt(() => {
|
|
8774
8765
|
S.value = !0;
|
|
8775
|
-
}),
|
|
8766
|
+
}), Yt(Zn, {
|
|
8776
8767
|
register: (A, { id: M, order: P, position: y, layoutSize: p, elementSize: g, active: x, disableTransitions: b }) => {
|
|
8777
8768
|
r.set(M, P), s.set(M, y), i.set(M, p), a.set(M, x), b && l.set(M, b);
|
|
8778
8769
|
const w = dn(Ti, R?.vnode).indexOf(A);
|
|
@@ -8814,8 +8805,8 @@ function Cu(n) {
|
|
|
8814
8805
|
layoutRect: d,
|
|
8815
8806
|
rootZIndex: t
|
|
8816
8807
|
}), {
|
|
8817
|
-
layoutClasses:
|
|
8818
|
-
layoutStyles:
|
|
8808
|
+
layoutClasses: Wt(() => ["m-layout", { "m-layout--full-height": n.fullHeight }]),
|
|
8809
|
+
layoutStyles: Wt(() => ({
|
|
8819
8810
|
zIndex: e ? t.value : void 0,
|
|
8820
8811
|
position: e ? "relative" : void 0,
|
|
8821
8812
|
overflow: e ? "hidden" : void 0
|
|
@@ -8896,7 +8887,7 @@ function Ai(n = {}) {
|
|
|
8896
8887
|
}
|
|
8897
8888
|
function Au(n = {}) {
|
|
8898
8889
|
let e = Ot(Ro, null);
|
|
8899
|
-
return e || (e = Ai(n),
|
|
8890
|
+
return e || (e = Ai(n), Yt(Ro, e)), e;
|
|
8900
8891
|
}
|
|
8901
8892
|
function Pi() {
|
|
8902
8893
|
const n = Ot(Ro, Tu()), e = Qt();
|
|
@@ -9626,7 +9617,7 @@ var kd = Pe((n) => {
|
|
|
9626
9617
|
name: "json",
|
|
9627
9618
|
handle: (r) => {
|
|
9628
9619
|
const { selected: a = !1, scale: l = 1 } = r;
|
|
9629
|
-
let c =
|
|
9620
|
+
let c = Kt(), d = "Doc", u = [];
|
|
9630
9621
|
Array.isArray(a) ? u = a : (a === !0 && (u = t.value), u.length === 0 && o.value && (c = o.value.id, d = o.value.name, u = o.value.children));
|
|
9631
9622
|
const { left: h, top: m, width: f, height: _ } = e(u, "parent");
|
|
9632
9623
|
return {
|
|
@@ -10035,7 +10026,7 @@ var Dd = /* @__PURE__ */ oo(Vd, [["render", Nd]]), Bd = Pe((n) => {
|
|
|
10035
10026
|
emits: /* @__PURE__ */ lt(["click:item"], ["update:modelValue"]),
|
|
10036
10027
|
setup(n, { expose: e, emit: t }) {
|
|
10037
10028
|
const o = n, s = t, i = tt(n, "modelValue"), r = de(-1), a = nt("overlayTpl"), l = de([]), c = Y(() => !!o.items?.some((S) => "checked" in S)), d = qo(), u = Ot(Ms, null), h = Ut(/* @__PURE__ */ new Set());
|
|
10038
|
-
|
|
10029
|
+
Yt(Ms, {
|
|
10039
10030
|
register: () => h.value.add(d),
|
|
10040
10031
|
unregister: () => h.value.delete(d),
|
|
10041
10032
|
closeParents(S) {
|
|
@@ -10621,11 +10612,11 @@ var Dd = /* @__PURE__ */ oo(Vd, [["render", Nd]]), Bd = Pe((n) => {
|
|
|
10621
10612
|
}
|
|
10622
10613
|
function d(u = {}) {
|
|
10623
10614
|
const { indent: h = 0, node: m } = u;
|
|
10624
|
-
return [
|
|
10615
|
+
return [Xt("div", {
|
|
10625
10616
|
class: ["m-creator__node", s.value === m.name && "m-creator__node--active"],
|
|
10626
10617
|
style: { "--indent-padding": `${h * 16}px` },
|
|
10627
10618
|
onClick: () => s.value = m.name
|
|
10628
|
-
}, m.name), ...m.children.map((f) =>
|
|
10619
|
+
}, m.name), ...m.children.map((f) => Xt(d, {
|
|
10629
10620
|
node: f,
|
|
10630
10621
|
indent: h + 1
|
|
10631
10622
|
}))];
|
|
@@ -11108,7 +11099,7 @@ var Dd = /* @__PURE__ */ oo(Vd, [["render", Nd]]), Bd = Pe((n) => {
|
|
|
11108
11099
|
}],
|
|
11109
11100
|
components: [{
|
|
11110
11101
|
type: "overlay",
|
|
11111
|
-
component: () =>
|
|
11102
|
+
component: () => Xt(_h, { refLines: o.value }),
|
|
11112
11103
|
order: "after",
|
|
11113
11104
|
visible: Y({
|
|
11114
11105
|
get: () => s.value.visible,
|
|
@@ -11759,14 +11750,14 @@ var Dd = /* @__PURE__ */ oo(Vd, [["render", Nd]]), Bd = Pe((n) => {
|
|
|
11759
11750
|
function x() {
|
|
11760
11751
|
const b = h.value;
|
|
11761
11752
|
if (!(o.resizeStrategy !== "lockAspectRatio" || o.lockAspectRatioStrategy !== "diagonal" || !b || !b.startsWith("resize") || b.split("-")[1].length === 1)) {
|
|
11762
|
-
if (b === "resize-t" || b === "resize-r" || b === "resize-tr" || b === "resize-bl") return
|
|
11753
|
+
if (b === "resize-t" || b === "resize-r" || b === "resize-tr" || b === "resize-bl") return Xt("line", {
|
|
11763
11754
|
class: "m-transform__diagonal",
|
|
11764
11755
|
x1: "100%",
|
|
11765
11756
|
y1: "0",
|
|
11766
11757
|
x2: "0",
|
|
11767
11758
|
y2: "100%"
|
|
11768
11759
|
});
|
|
11769
|
-
if (b === "resize-l" || b === "resize-b" || b === "resize-tl" || b === "resize-br") return
|
|
11760
|
+
if (b === "resize-l" || b === "resize-b" || b === "resize-tl" || b === "resize-br") return Xt("line", {
|
|
11770
11761
|
class: "m-transform__diagonal",
|
|
11771
11762
|
x1: "0",
|
|
11772
11763
|
y1: "0",
|
|
@@ -14337,7 +14328,7 @@ var jf = Pe((n) => {
|
|
|
14337
14328
|
},
|
|
14338
14329
|
components: [{
|
|
14339
14330
|
type: "overlay",
|
|
14340
|
-
component: () =>
|
|
14331
|
+
component: () => Xt(Vf, { snapLines: M.value })
|
|
14341
14332
|
}]
|
|
14342
14333
|
};
|
|
14343
14334
|
}, { enforce: "post" }), Uf = ["onPointerdown"], Hf = /* @__PURE__ */ Se({
|
|
@@ -14670,7 +14661,7 @@ var jf = Pe((n) => {
|
|
|
14670
14661
|
events: { docSet: () => e.value = void 0 },
|
|
14671
14662
|
components: [{
|
|
14672
14663
|
type: "overlay",
|
|
14673
|
-
component: () =>
|
|
14664
|
+
component: () => Xt(Xf, {
|
|
14674
14665
|
modelValue: e.value,
|
|
14675
14666
|
"onUpdate:modelValue": (t) => e.value = t
|
|
14676
14667
|
})
|
|
@@ -14777,7 +14768,7 @@ var jf = Pe((n) => {
|
|
|
14777
14768
|
e.value.removeChildren();
|
|
14778
14769
|
const { width: r, height: a } = o.value;
|
|
14779
14770
|
for (let l = 0; l < i; l++) {
|
|
14780
|
-
const c = 10 + Math.random() * 40, d = new
|
|
14771
|
+
const c = 10 + Math.random() * 40, d = new Zt({ style: {
|
|
14781
14772
|
left: Math.random() * (r - c),
|
|
14782
14773
|
top: Math.random() * (a - c),
|
|
14783
14774
|
width: c,
|
|
@@ -15213,7 +15204,7 @@ var jf = Pe((n) => {
|
|
|
15213
15204
|
duration: x
|
|
15214
15205
|
});
|
|
15215
15206
|
}
|
|
15216
|
-
if (p instanceof
|
|
15207
|
+
if (p instanceof Zt) {
|
|
15217
15208
|
for (const x of [
|
|
15218
15209
|
"background",
|
|
15219
15210
|
"foreground",
|
|
@@ -15363,7 +15354,7 @@ var jf = Pe((n) => {
|
|
|
15363
15354
|
function P(p, g) {
|
|
15364
15355
|
if (g.kind !== "animation" || !g.anim || p.target !== p.currentTarget) return;
|
|
15365
15356
|
const x = g.anim, b = e.node;
|
|
15366
|
-
if (!(b instanceof
|
|
15357
|
+
if (!(b instanceof Zt)) return;
|
|
15367
15358
|
const w = p.currentTarget.getBoundingClientRect(), E = x.duration || e.endTime - x.delay || 1, I = 1e3 / s.value, k = x.delay + Ct((p.clientX - w.left) / w.width, 0, 1) * E, T = Ct((Math.round(k / I) * I - x.delay) / E, 0, 1);
|
|
15368
15359
|
r.value = [b], t.value?.transact(() => {
|
|
15369
15360
|
x.keyframes = Sn(S(g), {
|
|
@@ -17253,7 +17244,7 @@ var fv = Pe((n) => {
|
|
|
17253
17244
|
S && (S.variableActiveModes = R);
|
|
17254
17245
|
}
|
|
17255
17246
|
function d(R, S = "Default") {
|
|
17256
|
-
const A =
|
|
17247
|
+
const A = Kt(), M = Kt();
|
|
17257
17248
|
return a(Nl(r(), {
|
|
17258
17249
|
id: A,
|
|
17259
17250
|
name: R,
|
|
@@ -17264,14 +17255,14 @@ var fv = Pe((n) => {
|
|
|
17264
17255
|
})), A;
|
|
17265
17256
|
}
|
|
17266
17257
|
function u(R, S) {
|
|
17267
|
-
const A =
|
|
17258
|
+
const A = Kt();
|
|
17268
17259
|
return a(Dl(r(), R, {
|
|
17269
17260
|
id: A,
|
|
17270
17261
|
name: S
|
|
17271
17262
|
})), A;
|
|
17272
17263
|
}
|
|
17273
17264
|
function h(R, S) {
|
|
17274
|
-
const A =
|
|
17265
|
+
const A = Kt();
|
|
17275
17266
|
return a(Bl(r(), R, {
|
|
17276
17267
|
id: A,
|
|
17277
17268
|
...S
|
|
@@ -17903,10 +17894,10 @@ var xv = { class: "m-panel" }, bv = { class: "m-panel__title" }, _v = /* @__PURE
|
|
|
17903
17894
|
const e = n, { panels: t } = qe(), o = de((e.name ? t.sizeRef(e.name).value : void 0) ?? e.size), s = Y(() => e.resizable ? o.value : e.size), { layoutItemStyles: i } = Mu({
|
|
17904
17895
|
id: e.name,
|
|
17905
17896
|
order: Y(() => Number.parseInt(String(e.order), 10)),
|
|
17906
|
-
position:
|
|
17907
|
-
elementSize:
|
|
17908
|
-
layoutSize:
|
|
17909
|
-
active:
|
|
17897
|
+
position: Wt(() => e.position),
|
|
17898
|
+
elementSize: Wt(() => s.value),
|
|
17899
|
+
layoutSize: Wt(() => s.value),
|
|
17900
|
+
active: Wt(() => e.modelValue)
|
|
17910
17901
|
}), r = Y(() => e.position === "left" || e.position === "right");
|
|
17911
17902
|
function a(c) {
|
|
17912
17903
|
return Math.min(Math.max(c, e.minSize), e.maxSize ?? Number.POSITIVE_INFINITY);
|
|
@@ -17951,7 +17942,7 @@ var xv = { class: "m-panel" }, bv = { class: "m-panel__title" }, _v = /* @__PURE
|
|
|
17951
17942
|
const { item: u, ...h } = d, m = {};
|
|
17952
17943
|
return u.slot && Object.keys(e.slots).forEach((f) => {
|
|
17953
17944
|
f === u.slot ? m.default = e.slots[f] : f.startsWith(`${u.slot}.`) && (m[f.substring(`${u.slot}.`.length)] = e.slots[f]);
|
|
17954
|
-
}),
|
|
17945
|
+
}), Xt(u.component, {
|
|
17955
17946
|
...h,
|
|
17956
17947
|
ref: (f) => l(f, u)
|
|
17957
17948
|
}, m);
|
|
@@ -18109,7 +18100,7 @@ var xv = { class: "m-panel" }, bv = { class: "m-panel__title" }, _v = /* @__PURE
|
|
|
18109
18100
|
setup(n) {
|
|
18110
18101
|
const e = n, t = er();
|
|
18111
18102
|
let o;
|
|
18112
|
-
e.editor ? (o = e.editor,
|
|
18103
|
+
e.editor ? (o = e.editor, Yt(Jn.injectionKey, o)) : o = qe(), o.setup(), Yt(Si, pu({ aliases: o.icons.value }));
|
|
18113
18104
|
const { componentRefs: s, isElement: i, isFrameNode: r, drawboardDom: a, renderEngine: l, camera: c, hoverElement: d, state: u, setCursor: h, exec: m, isLock: f, t: _, selectionAabbInDrawboard: L, selectionMarquee: O, elementSelection: R, drawboardAabb: S, activeTool: A, isContentEditing: M } = o, P = Y(() => e.activeStrategy ?? o.activeStrategy), y = Y(() => e.doubleclickStrategy ?? o.doubleclickStrategy), p = Y(() => e.hoverStrategy ?? o.hoverStrategy), g = nt("overlayContainerTpl"), x = nt("canvasTpl"), b = de(!1);
|
|
18114
18105
|
Au({ attach: Y(() => g.value) }), Fs(x, (q) => {
|
|
18115
18106
|
const { width: K, height: H } = q[0].contentRect;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.32.0",
|
|
5
5
|
"description": "A headless infinite canvas editor framework built on WebGL rendering, supports exporting to image, video, and PPT. Only the ESM.",
|
|
6
6
|
"author": "wxm",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@vueuse/core": "^14.3.0",
|
|
61
61
|
"diff": "^9.0.0",
|
|
62
62
|
"lodash-es": "^4.18.1",
|
|
63
|
-
"modern-canvas": "^0.25.
|
|
63
|
+
"modern-canvas": "^0.25.1",
|
|
64
64
|
"modern-font": "^0.6.1",
|
|
65
65
|
"modern-idoc": "^0.12.3",
|
|
66
66
|
"modern-text": "^2.0.9",
|