@netless/appliance-plugin 1.1.7 → 1.1.8
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/cdn/cdn.js +1 -1
- package/cdn/{fullWorker-BEJqjH.js → fullWorker-Bt73U4.js} +7 -7
- package/cdn/{subWorker-CTbbnN.js → subWorker-C1W6w_.js} +7 -7
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/fullWorker.js +7 -7
- package/dist/{index-C-flLj6b.mjs → index-C8bfLLn0.mjs} +862 -855
- package/dist/index-D6M2zcmo.js +1 -0
- package/dist/{index-CPEJsBxo.mjs → index-q_QiZFx8.mjs} +1 -1
- package/dist/{index-DG4OS7jZ.js → index-yV6BCDyw.js} +1 -1
- package/dist/plugin/const.d.ts +4 -0
- package/dist/plugin/types.d.ts +5 -0
- package/dist/subWorker.js +7 -7
- package/package.json +1 -1
- package/dist/index-Cj2T7zY6.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var wn = Object.defineProperty;
|
|
2
2
|
var mn = (a, o, t) => o in a ? wn(a, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[o] = t;
|
|
3
3
|
var g = (a, o, t) => mn(a, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
-
import { toJS as Eo, autorun as
|
|
5
|
-
import { Path as ue, Group as Wt, Rect as
|
|
4
|
+
import { toJS as Eo, autorun as yi, isRoom as ct, isPlayer as Qo, InvisiblePlugin as fs, RoomPhase as gs } from "white-web-sdk";
|
|
5
|
+
import { Path as ue, Group as Wt, Rect as Mi, Polyline as he, Ellipse as vn, Label as In, Scene as ys, Layer as Nn, Sprite as Tn } from "spritejs";
|
|
6
6
|
import { decompress as Sn, compress as kn } from "lz-string";
|
|
7
7
|
import Go from "lineclip";
|
|
8
8
|
import Oo from "eventemitter2";
|
|
9
|
-
import { cloneDeep as dt, isEqual as ft, isSet as Bt, isNumber as ot, isBoolean as Yt, debounce as
|
|
9
|
+
import { cloneDeep as dt, isEqual as ft, isSet as Bt, isNumber as ot, isBoolean as Yt, debounce as Ms, clone as wi, throttle as jt } from "lodash";
|
|
10
10
|
import k, { useContext as xt, useState as st, useMemo as q, useEffect as gt, useRef as De, useCallback as Cn } from "react";
|
|
11
11
|
import Zo, { createPortal as xn } from "react-dom";
|
|
12
12
|
import Ae from "react-draggable";
|
|
13
13
|
import { Resizable as bn } from "re-resizable";
|
|
14
14
|
const $m = "/fullWorker.js", Hm = "/subWorker.js";
|
|
15
|
-
var nt = /* @__PURE__ */ ((a) => (a.selector = "selector", a.clicker = "clicker", a.laserPointer = "laserPointer", a.pencil = "pencil", a.rectangle = "rectangle", a.ellipse = "ellipse", a.shape = "shape", a.eraser = "eraser", a.pencilEraser = "pencilEraser", a.text = "text", a.straight = "straight", a.arrow = "arrow", a.hand = "hand", a.laserPen = "laserPen", a))(nt || {}), et = /* @__PURE__ */ ((a) => (a.Normal = "Normal", a.Stroke = "Stroke", a.Dotted = "Dotted", a.LongDotted = "LongDotted", a))(et || {}), te = /* @__PURE__ */ ((a) => (a.Triangle = "triangle", a.Rhombus = "rhombus", a.Pentagram = "pentagram", a.SpeechBalloon = "speechBalloon", a.Star = "star", a.Polygon = "polygon", a))(te || {}), R = /* @__PURE__ */ ((a) => (a.None = "None", a.ShowFloatBar = "ShowFloatBar", a.ZIndexFloatBar = "ZIndexFloatBar", a.DeleteNode = "DeleteNode", a.CopyNode = "CopyNode", a.ZIndexActive = "ZIndexActive", a.ZIndexNode = "ZIndexNode", a.RotateNode = "RotateNode", a.SetColorNode = "SetColorNode", a.TranslateNode = "TranslateNode", a.ScaleNode = "ScaleNode", a.OriginalEvent = "OriginalEvent", a.CreateScene = "CreateScene", a.ActiveCursor = "ActiveCursor", a.MoveCursor = "MoveCursor", a.CommandEditor = "CommandEditor", a.SetEditorData = "SetEditorData", a.SetFontStyle = "SetFontStyle", a.SetPoint = "SetPoint", a.SetLock = "SetLock", a.SetShapeOpt = "SetShapeOpt", a.CameraChange = "CameraChange", a.ActiveMethod = "ActiveMethod", a))(R || {}), X = /* @__PURE__ */ ((a) => (a.DisplayState = "DisplayState", a.MainEngine = "MainEngine", a.Cursor = "Cursor", a.BindMainView = "BindMainView", a))(X || {}), Ln = /* @__PURE__ */ ((a) => (a[a.MainView = 0] = "MainView", a[a.Plugin = 1] = "Plugin", a[a.Both = 2] = "Both", a))(Ln || {}),
|
|
15
|
+
var nt = /* @__PURE__ */ ((a) => (a.selector = "selector", a.clicker = "clicker", a.laserPointer = "laserPointer", a.pencil = "pencil", a.rectangle = "rectangle", a.ellipse = "ellipse", a.shape = "shape", a.eraser = "eraser", a.pencilEraser = "pencilEraser", a.text = "text", a.straight = "straight", a.arrow = "arrow", a.hand = "hand", a.laserPen = "laserPen", a))(nt || {}), et = /* @__PURE__ */ ((a) => (a.Normal = "Normal", a.Stroke = "Stroke", a.Dotted = "Dotted", a.LongDotted = "LongDotted", a))(et || {}), te = /* @__PURE__ */ ((a) => (a.Triangle = "triangle", a.Rhombus = "rhombus", a.Pentagram = "pentagram", a.SpeechBalloon = "speechBalloon", a.Star = "star", a.Polygon = "polygon", a))(te || {}), R = /* @__PURE__ */ ((a) => (a.None = "None", a.ShowFloatBar = "ShowFloatBar", a.ZIndexFloatBar = "ZIndexFloatBar", a.DeleteNode = "DeleteNode", a.CopyNode = "CopyNode", a.ZIndexActive = "ZIndexActive", a.ZIndexNode = "ZIndexNode", a.RotateNode = "RotateNode", a.SetColorNode = "SetColorNode", a.TranslateNode = "TranslateNode", a.ScaleNode = "ScaleNode", a.OriginalEvent = "OriginalEvent", a.CreateScene = "CreateScene", a.ActiveCursor = "ActiveCursor", a.MoveCursor = "MoveCursor", a.CommandEditor = "CommandEditor", a.SetEditorData = "SetEditorData", a.SetFontStyle = "SetFontStyle", a.SetPoint = "SetPoint", a.SetLock = "SetLock", a.SetShapeOpt = "SetShapeOpt", a.CameraChange = "CameraChange", a.ActiveMethod = "ActiveMethod", a))(R || {}), X = /* @__PURE__ */ ((a) => (a.DisplayState = "DisplayState", a.MainEngine = "MainEngine", a.Cursor = "Cursor", a.BindMainView = "BindMainView", a))(X || {}), Ln = /* @__PURE__ */ ((a) => (a[a.MainView = 0] = "MainView", a[a.Plugin = 1] = "Plugin", a[a.Both = 2] = "Both", a))(Ln || {}), T = /* @__PURE__ */ ((a) => (a[a.Pencil = 1] = "Pencil", a[a.Eraser = 2] = "Eraser", a[a.PencilEraser = 3] = "PencilEraser", a[a.BitMapEraser = 4] = "BitMapEraser", a[a.Selector = 5] = "Selector", a[a.Clicker = 6] = "Clicker", a[a.Arrow = 7] = "Arrow", a[a.Hand = 8] = "Hand", a[a.LaserPen = 9] = "LaserPen", a[a.Text = 10] = "Text", a[a.Straight = 11] = "Straight", a[a.Rectangle = 12] = "Rectangle", a[a.Ellipse = 13] = "Ellipse", a[a.Star = 14] = "Star", a[a.Triangle = 15] = "Triangle", a[a.Rhombus = 16] = "Rhombus", a[a.Polygon = 17] = "Polygon", a[a.SpeechBalloon = 18] = "SpeechBalloon", a[a.Image = 19] = "Image", a))(T || {}), U = /* @__PURE__ */ ((a) => (a[a.Local = 1] = "Local", a[a.Service = 2] = "Service", a[a.Worker = 3] = "Worker", a))(U || {}), P = /* @__PURE__ */ ((a) => (a[a.Pending = 0] = "Pending", a[a.Start = 1] = "Start", a[a.Doing = 2] = "Doing", a[a.Done = 3] = "Done", a[a.Unwritable = 4] = "Unwritable", a))(P || {}), b = /* @__PURE__ */ ((a) => (a[a.None = 0] = "None", a[a.Init = 1] = "Init", a[a.UpdateCamera = 2] = "UpdateCamera", a[a.UpdateTools = 3] = "UpdateTools", a[a.CreateWork = 4] = "CreateWork", a[a.DrawWork = 5] = "DrawWork", a[a.FullWork = 6] = "FullWork", a[a.UpdateNode = 7] = "UpdateNode", a[a.RemoveNode = 8] = "RemoveNode", a[a.Clear = 9] = "Clear", a[a.Select = 10] = "Select", a[a.Destroy = 11] = "Destroy", a[a.Snapshot = 12] = "Snapshot", a[a.BoundingBox = 13] = "BoundingBox", a[a.Cursor = 14] = "Cursor", a[a.TextUpdate = 15] = "TextUpdate", a[a.GetTextActive = 16] = "GetTextActive", a[a.TasksQueue = 17] = "TasksQueue", a[a.CursorHover = 18] = "CursorHover", a[a.CursorBlur = 19] = "CursorBlur", a[a.Console = 20] = "Console", a[a.PriorityWorker = 21] = "PriorityWorker", a[a.PriorityMainThreadWorker = 22] = "PriorityMainThreadWorker", a[a.GetImageBitMap = 23] = "GetImageBitMap", a[a.AuthWriter = 24] = "AuthWriter", a[a.AuthReader = 25] = "AuthReader", a[a.AuthClear = 26] = "AuthClear", a[a.AuthPage = 27] = "AuthPage", a[a.GetVNodeInfo = 28] = "GetVNodeInfo", a))(b || {}), St = /* @__PURE__ */ ((a) => (a[a.None = 0] = "None", a[a.Bg = 1] = "Bg", a[a.ServiceFloat = 2] = "ServiceFloat", a[a.Float = 3] = "Float", a[a.TopFloat = 4] = "TopFloat", a))(St || {}), eo = /* @__PURE__ */ ((a) => (a[a.Cursor = 1] = "Cursor", a[a.TextCreate = 2] = "TextCreate", a))(eo || {}), ke = /* @__PURE__ */ ((a) => (a[a.Top = 1] = "Top", a[a.Bottom = 2] = "Bottom", a))(ke || {}), pt = /* @__PURE__ */ ((a) => (a[a.none = 1] = "none", a[a.all = 2] = "all", a[a.both = 3] = "both", a[a.proportional = 4] = "proportional", a))(pt || {}), zn = /* @__PURE__ */ ((a) => (a[a.Pending = 0] = "Pending", a[a.Start = 1] = "Start", a[a.Doing = 2] = "Doing", a[a.Done = 3] = "Done", a[a.Unwritable = 4] = "Unwritable", a))(zn || {}), oo = /* @__PURE__ */ ((a) => (a[a.inside = 0] = "inside", a[a.outside = 1] = "outside", a[a.intersect = 2] = "intersect", a))(oo || {}), Ot = /* @__PURE__ */ ((a) => (a.renderPage = "renderPage", a.addPage = "addPage", a.deletePage = "deletePage", a.addElement = "addElement", a.deleteElement = "deleteElement", a.clearPage = "clearPage", a.clearViewScenePath = "clearViewScenePath", a.clearView = "clearView", a))(Ot || {}), ee = /* @__PURE__ */ ((a) => (a.setAuth = "setAuth", a.setShow = "addShow", a.setHide = "setHide", a.setClear = "setClear", a))(ee || {}), ze = /* @__PURE__ */ ((a) => (a.Image = "image", a.Iconify = "iconify", a))(ze || {});
|
|
16
16
|
const Pn = {
|
|
17
17
|
linear: (a) => a,
|
|
18
18
|
easeInQuad: (a) => a * a,
|
|
@@ -497,7 +497,7 @@ var qe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
497
497
|
function je(a) {
|
|
498
498
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
499
499
|
}
|
|
500
|
-
var An = typeof qe == "object" && qe && qe.Object === Object && qe,
|
|
500
|
+
var An = typeof qe == "object" && qe && qe.Object === Object && qe, ws = An, jn = ws, En = typeof self == "object" && self && self.Object === Object && self, On = jn || En || Function("return this")(), _t = On, Rn = _t, Yn = Rn.Symbol, Ze = Yn, mi = Ze, ms = Object.prototype, Wn = ms.hasOwnProperty, Un = ms.toString, Be = mi ? mi.toStringTag : void 0;
|
|
501
501
|
function Bn(a) {
|
|
502
502
|
var o = Wn.call(a, Be), t = a[Be];
|
|
503
503
|
try {
|
|
@@ -512,9 +512,9 @@ var Fn = Bn, Vn = Object.prototype, $n = Vn.toString;
|
|
|
512
512
|
function Hn(a) {
|
|
513
513
|
return $n.call(a);
|
|
514
514
|
}
|
|
515
|
-
var Qn = Hn,
|
|
515
|
+
var Qn = Hn, vi = Ze, Gn = Fn, Zn = Qn, Xn = "[object Null]", Jn = "[object Undefined]", Ii = vi ? vi.toStringTag : void 0;
|
|
516
516
|
function qn(a) {
|
|
517
|
-
return a == null ? a === void 0 ? Jn : Xn :
|
|
517
|
+
return a == null ? a === void 0 ? Jn : Xn : Ii && Ii in Object(a) ? Gn(a) : Zn(a);
|
|
518
518
|
}
|
|
519
519
|
var me = qn;
|
|
520
520
|
function Kn(a) {
|
|
@@ -604,12 +604,12 @@ function $r(a) {
|
|
|
604
604
|
var o = Yr(a);
|
|
605
605
|
return o == Br || o == Fr || o == Ur || o == Vr;
|
|
606
606
|
}
|
|
607
|
-
var
|
|
607
|
+
var vs = $r, Hr = _t, Qr = Hr["__core-js_shared__"], Gr = Qr, bo = Gr, Ni = function() {
|
|
608
608
|
var a = /[^.]+$/.exec(bo && bo.keys && bo.keys.IE_PROTO || "");
|
|
609
609
|
return a ? "Symbol(src)_1." + a : "";
|
|
610
610
|
}();
|
|
611
611
|
function Zr(a) {
|
|
612
|
-
return !!
|
|
612
|
+
return !!Ni && Ni in a;
|
|
613
613
|
}
|
|
614
614
|
var Xr = Zr, Jr = Function.prototype, qr = Jr.toString;
|
|
615
615
|
function Kr(a) {
|
|
@@ -625,7 +625,7 @@ function Kr(a) {
|
|
|
625
625
|
}
|
|
626
626
|
return "";
|
|
627
627
|
}
|
|
628
|
-
var
|
|
628
|
+
var Is = Kr, _r = vs, ta = Xr, ea = de, oa = Is, ia = /[\\^$.*+?()[\]{}|]/g, sa = /^\[object .+?Constructor\]$/, na = Function.prototype, ra = Object.prototype, aa = na.toString, ca = ra.hasOwnProperty, la = RegExp(
|
|
629
629
|
"^" + aa.call(ca).replace(ia, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
630
630
|
);
|
|
631
631
|
function ha(a) {
|
|
@@ -643,9 +643,9 @@ function ya(a, o) {
|
|
|
643
643
|
var t = ga(a, o);
|
|
644
644
|
return fa(t) ? t : void 0;
|
|
645
645
|
}
|
|
646
|
-
var ve = ya, Ma = ve, wa = _t, ma = Ma(wa, "Map"), Jo = ma, va = ve, Ia = va(Object, "create"), vo = Ia,
|
|
646
|
+
var ve = ya, Ma = ve, wa = _t, ma = Ma(wa, "Map"), Jo = ma, va = ve, Ia = va(Object, "create"), vo = Ia, Ti = vo;
|
|
647
647
|
function Na() {
|
|
648
|
-
this.__data__ =
|
|
648
|
+
this.__data__ = Ti ? Ti(null) : {}, this.size = 0;
|
|
649
649
|
}
|
|
650
650
|
var Ta = Na;
|
|
651
651
|
function Sa(a) {
|
|
@@ -684,12 +684,12 @@ Oe.prototype.delete = Fa;
|
|
|
684
684
|
Oe.prototype.get = Va;
|
|
685
685
|
Oe.prototype.has = $a;
|
|
686
686
|
Oe.prototype.set = Ha;
|
|
687
|
-
var Qa = Oe,
|
|
687
|
+
var Qa = Oe, Si = Qa, Ga = mo, Za = Jo;
|
|
688
688
|
function Xa() {
|
|
689
689
|
this.size = 0, this.__data__ = {
|
|
690
|
-
hash: new
|
|
690
|
+
hash: new Si(),
|
|
691
691
|
map: new (Za || Ga)(),
|
|
692
|
-
string: new
|
|
692
|
+
string: new Si()
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
695
|
var Ja = Xa;
|
|
@@ -733,7 +733,7 @@ Re.prototype.delete = fc;
|
|
|
733
733
|
Re.prototype.get = gc;
|
|
734
734
|
Re.prototype.has = yc;
|
|
735
735
|
Re.prototype.set = Mc;
|
|
736
|
-
var
|
|
736
|
+
var Ns = Re, wc = mo, mc = Jo, vc = Ns, Ic = 200;
|
|
737
737
|
function Nc(a, o) {
|
|
738
738
|
var t = this.__data__;
|
|
739
739
|
if (t instanceof wc) {
|
|
@@ -754,7 +754,7 @@ Ye.prototype.delete = Cc;
|
|
|
754
754
|
Ye.prototype.get = xc;
|
|
755
755
|
Ye.prototype.has = bc;
|
|
756
756
|
Ye.prototype.set = Lc;
|
|
757
|
-
var
|
|
757
|
+
var Ts = Ye;
|
|
758
758
|
function zc(a, o) {
|
|
759
759
|
for (var t = -1, e = a == null ? 0 : a.length; ++t < e && o(a[t], t, a) !== !1; )
|
|
760
760
|
;
|
|
@@ -766,21 +766,21 @@ var Pc = zc, Dc = ve, Ac = function() {
|
|
|
766
766
|
return a({}, "", {}), a;
|
|
767
767
|
} catch {
|
|
768
768
|
}
|
|
769
|
-
}(),
|
|
769
|
+
}(), Ss = Ac, ki = Ss;
|
|
770
770
|
function jc(a, o, t) {
|
|
771
|
-
o == "__proto__" &&
|
|
771
|
+
o == "__proto__" && ki ? ki(a, o, {
|
|
772
772
|
configurable: !0,
|
|
773
773
|
enumerable: !0,
|
|
774
774
|
value: t,
|
|
775
775
|
writable: !0
|
|
776
776
|
}) : a[o] = t;
|
|
777
777
|
}
|
|
778
|
-
var
|
|
778
|
+
var ks = jc, Ec = ks, Oc = Xo, Rc = Object.prototype, Yc = Rc.hasOwnProperty;
|
|
779
779
|
function Wc(a, o, t) {
|
|
780
780
|
var e = a[o];
|
|
781
781
|
(!(Yc.call(a, o) && Oc(e, t)) || t === void 0 && !(o in a)) && Ec(a, o, t);
|
|
782
782
|
}
|
|
783
|
-
var
|
|
783
|
+
var Cs = Wc, Uc = Cs, Bc = ks;
|
|
784
784
|
function Fc(a, o, t, e) {
|
|
785
785
|
var i = !t;
|
|
786
786
|
t || (t = {});
|
|
@@ -800,11 +800,11 @@ var $c = Vc, Hc = me, Qc = se, Gc = "[object Arguments]";
|
|
|
800
800
|
function Zc(a) {
|
|
801
801
|
return Qc(a) && Hc(a) == Gc;
|
|
802
802
|
}
|
|
803
|
-
var Xc = Zc,
|
|
803
|
+
var Xc = Zc, Ci = Xc, Jc = se, xs = Object.prototype, qc = xs.hasOwnProperty, Kc = xs.propertyIsEnumerable, _c = Ci(/* @__PURE__ */ function() {
|
|
804
804
|
return arguments;
|
|
805
|
-
}()) ?
|
|
805
|
+
}()) ? Ci : function(a) {
|
|
806
806
|
return Jc(a) && qc.call(a, "callee") && !Kc.call(a, "callee");
|
|
807
|
-
},
|
|
807
|
+
}, bs = _c, tl = Array.isArray, Xe = tl, so = { exports: {} };
|
|
808
808
|
function el() {
|
|
809
809
|
return !1;
|
|
810
810
|
}
|
|
@@ -823,7 +823,7 @@ var rl = nl, al = 9007199254740991;
|
|
|
823
823
|
function cl(a) {
|
|
824
824
|
return typeof a == "number" && a > -1 && a % 1 == 0 && a <= al;
|
|
825
825
|
}
|
|
826
|
-
var
|
|
826
|
+
var Ls = cl, ll = me, hl = Ls, ul = se, dl = "[object Arguments]", pl = "[object Array]", fl = "[object Boolean]", gl = "[object Date]", yl = "[object Error]", Ml = "[object Function]", wl = "[object Map]", ml = "[object Number]", vl = "[object Object]", Il = "[object RegExp]", Nl = "[object Set]", Tl = "[object String]", Sl = "[object WeakMap]", kl = "[object ArrayBuffer]", Cl = "[object DataView]", xl = "[object Float32Array]", bl = "[object Float64Array]", Ll = "[object Int8Array]", zl = "[object Int16Array]", Pl = "[object Int32Array]", Dl = "[object Uint8Array]", Al = "[object Uint8ClampedArray]", jl = "[object Uint16Array]", El = "[object Uint32Array]", vt = {};
|
|
827
827
|
vt[xl] = vt[bl] = vt[Ll] = vt[zl] = vt[Pl] = vt[Dl] = vt[Al] = vt[jl] = vt[El] = !0;
|
|
828
828
|
vt[dl] = vt[pl] = vt[kl] = vt[fl] = vt[Cl] = vt[gl] = vt[yl] = vt[Ml] = vt[wl] = vt[ml] = vt[vl] = vt[Il] = vt[Nl] = vt[Tl] = vt[Sl] = !1;
|
|
829
829
|
function Ol(a) {
|
|
@@ -838,7 +838,7 @@ function Yl(a) {
|
|
|
838
838
|
var To = Yl, no = { exports: {} };
|
|
839
839
|
no.exports;
|
|
840
840
|
(function(a, o) {
|
|
841
|
-
var t =
|
|
841
|
+
var t = ws, e = o && !o.nodeType && o, i = e && !0 && a && !a.nodeType && a, s = i && i.exports === e, n = s && t.process, r = function() {
|
|
842
842
|
try {
|
|
843
843
|
var c = i && i.require && i.require("util").types;
|
|
844
844
|
return c || n && n.binding && n.binding("util");
|
|
@@ -847,7 +847,7 @@ no.exports;
|
|
|
847
847
|
}();
|
|
848
848
|
a.exports = r;
|
|
849
849
|
})(no, no.exports);
|
|
850
|
-
var Ko = no.exports, Wl = Rl, Ul = To,
|
|
850
|
+
var Ko = no.exports, Wl = Rl, Ul = To, xi = Ko, bi = xi && xi.isTypedArray, Bl = bi ? Ul(bi) : Wl, zs = Bl, Fl = $c, Vl = bs, $l = Xe, Hl = qo, Ql = rl, Gl = zs, Zl = Object.prototype, Xl = Zl.hasOwnProperty;
|
|
851
851
|
function Jl(a, o) {
|
|
852
852
|
var t = $l(a), e = !t && Vl(a), i = !t && !e && Hl(a), s = !t && !e && !i && Gl(a), n = t || e || i || s, r = n ? Fl(a.length, String) : [], c = r.length;
|
|
853
853
|
for (var l in a)
|
|
@@ -858,7 +858,7 @@ function Jl(a, o) {
|
|
|
858
858
|
Ql(l, c))) && r.push(l);
|
|
859
859
|
return r;
|
|
860
860
|
}
|
|
861
|
-
var
|
|
861
|
+
var Ps = Jl, ql = Object.prototype;
|
|
862
862
|
function Kl(a) {
|
|
863
863
|
var o = a && a.constructor, t = typeof o == "function" && o.prototype || ql;
|
|
864
864
|
return a === t;
|
|
@@ -869,7 +869,7 @@ function _l(a, o) {
|
|
|
869
869
|
return a(o(t));
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
var
|
|
872
|
+
var Ds = _l, th = Ds, eh = th(Object.keys, Object), oh = eh, ih = _o, sh = oh, nh = Object.prototype, rh = nh.hasOwnProperty;
|
|
873
873
|
function ah(a) {
|
|
874
874
|
if (!ih(a))
|
|
875
875
|
return sh(a);
|
|
@@ -878,11 +878,11 @@ function ah(a) {
|
|
|
878
878
|
rh.call(a, t) && t != "constructor" && o.push(t);
|
|
879
879
|
return o;
|
|
880
880
|
}
|
|
881
|
-
var ch = ah, lh =
|
|
881
|
+
var ch = ah, lh = vs, hh = Ls;
|
|
882
882
|
function uh(a) {
|
|
883
883
|
return a != null && hh(a.length) && !lh(a);
|
|
884
884
|
}
|
|
885
|
-
var ti = uh, dh =
|
|
885
|
+
var ti = uh, dh = Ps, ph = ch, fh = ti;
|
|
886
886
|
function gh(a) {
|
|
887
887
|
return fh(a) ? dh(a) : ph(a);
|
|
888
888
|
}
|
|
@@ -907,7 +907,7 @@ function xh(a) {
|
|
|
907
907
|
e == "constructor" && (o || !Ch.call(a, e)) || t.push(e);
|
|
908
908
|
return t;
|
|
909
909
|
}
|
|
910
|
-
var bh = xh, Lh =
|
|
910
|
+
var bh = xh, Lh = Ps, zh = bh, Ph = ti;
|
|
911
911
|
function Dh(a) {
|
|
912
912
|
return Ph(a) ? Lh(a, !0) : zh(a);
|
|
913
913
|
}
|
|
@@ -942,12 +942,12 @@ function Uh(a, o) {
|
|
|
942
942
|
}
|
|
943
943
|
return s;
|
|
944
944
|
}
|
|
945
|
-
var
|
|
945
|
+
var As = Uh;
|
|
946
946
|
function Bh() {
|
|
947
947
|
return [];
|
|
948
948
|
}
|
|
949
|
-
var
|
|
950
|
-
return a == null ? [] : (a = Object(a), Fh(
|
|
949
|
+
var js = Bh, Fh = As, Vh = js, $h = Object.prototype, Hh = $h.propertyIsEnumerable, Li = Object.getOwnPropertySymbols, Qh = Li ? function(a) {
|
|
950
|
+
return a == null ? [] : (a = Object(a), Fh(Li(a), function(o) {
|
|
951
951
|
return Hh.call(a, o);
|
|
952
952
|
}));
|
|
953
953
|
} : Vh, ii = Qh, Gh = No, Zh = ii;
|
|
@@ -960,11 +960,11 @@ function qh(a, o) {
|
|
|
960
960
|
a[i + t] = o[t];
|
|
961
961
|
return a;
|
|
962
962
|
}
|
|
963
|
-
var si = qh, Kh =
|
|
963
|
+
var si = qh, Kh = Ds, _h = Kh(Object.getPrototypeOf, Object), Es = _h, tu = si, eu = Es, ou = ii, iu = js, su = Object.getOwnPropertySymbols, nu = su ? function(a) {
|
|
964
964
|
for (var o = []; a; )
|
|
965
965
|
tu(o, ou(a)), a = eu(a);
|
|
966
966
|
return o;
|
|
967
|
-
} : iu,
|
|
967
|
+
} : iu, Os = nu, ru = No, au = Os;
|
|
968
968
|
function cu(a, o) {
|
|
969
969
|
return ru(a, au(a), o);
|
|
970
970
|
}
|
|
@@ -973,29 +973,29 @@ function du(a, o, t) {
|
|
|
973
973
|
var e = o(a);
|
|
974
974
|
return uu(a) ? e : hu(e, t(a));
|
|
975
975
|
}
|
|
976
|
-
var
|
|
976
|
+
var Rs = du, pu = Rs, fu = ii, gu = ei;
|
|
977
977
|
function yu(a) {
|
|
978
978
|
return pu(a, gu, fu);
|
|
979
979
|
}
|
|
980
|
-
var
|
|
980
|
+
var Ys = yu, Mu = Rs, wu = Os, mu = oi;
|
|
981
981
|
function vu(a) {
|
|
982
982
|
return Mu(a, mu, wu);
|
|
983
983
|
}
|
|
984
|
-
var Iu = vu, Nu = ve, Tu = _t, Su = Nu(Tu, "DataView"), ku = Su, Cu = ve, xu = _t, bu = Cu(xu, "Promise"), Lu = bu, zu = ve, Pu = _t, Du = zu(Pu, "Set"),
|
|
985
|
-
(Ro && fe(new Ro(new ArrayBuffer(1))) !=
|
|
986
|
-
var o =
|
|
984
|
+
var Iu = vu, Nu = ve, Tu = _t, Su = Nu(Tu, "DataView"), ku = Su, Cu = ve, xu = _t, bu = Cu(xu, "Promise"), Lu = bu, zu = ve, Pu = _t, Du = zu(Pu, "Set"), Ws = Du, Au = ve, ju = _t, Eu = Au(ju, "WeakMap"), Ou = Eu, Ro = ku, Yo = Jo, Wo = Lu, Uo = Ws, Bo = Ou, Us = me, We = Is, zi = "[object Map]", Ru = "[object Object]", Pi = "[object Promise]", Di = "[object Set]", Ai = "[object WeakMap]", ji = "[object DataView]", Yu = We(Ro), Wu = We(Yo), Uu = We(Wo), Bu = We(Uo), Fu = We(Bo), fe = Us;
|
|
985
|
+
(Ro && fe(new Ro(new ArrayBuffer(1))) != ji || Yo && fe(new Yo()) != zi || Wo && fe(Wo.resolve()) != Pi || Uo && fe(new Uo()) != Di || Bo && fe(new Bo()) != Ai) && (fe = function(a) {
|
|
986
|
+
var o = Us(a), t = o == Ru ? a.constructor : void 0, e = t ? We(t) : "";
|
|
987
987
|
if (e)
|
|
988
988
|
switch (e) {
|
|
989
989
|
case Yu:
|
|
990
|
-
return
|
|
990
|
+
return ji;
|
|
991
991
|
case Wu:
|
|
992
|
-
return Li;
|
|
993
|
-
case Uu:
|
|
994
992
|
return zi;
|
|
995
|
-
case
|
|
993
|
+
case Uu:
|
|
996
994
|
return Pi;
|
|
997
|
-
case
|
|
995
|
+
case Bu:
|
|
998
996
|
return Di;
|
|
997
|
+
case Fu:
|
|
998
|
+
return Ai;
|
|
999
999
|
}
|
|
1000
1000
|
return o;
|
|
1001
1001
|
});
|
|
@@ -1004,10 +1004,10 @@ function Hu(a) {
|
|
|
1004
1004
|
var o = a.length, t = new a.constructor(o);
|
|
1005
1005
|
return o && typeof a[0] == "string" && $u.call(a, "index") && (t.index = a.index, t.input = a.input), t;
|
|
1006
1006
|
}
|
|
1007
|
-
var Qu = Hu, Gu = _t, Zu = Gu.Uint8Array,
|
|
1007
|
+
var Qu = Hu, Gu = _t, Zu = Gu.Uint8Array, Bs = Zu, Ei = Bs;
|
|
1008
1008
|
function Xu(a) {
|
|
1009
1009
|
var o = new a.constructor(a.byteLength);
|
|
1010
|
-
return new
|
|
1010
|
+
return new Ei(o).set(new Ei(a)), o;
|
|
1011
1011
|
}
|
|
1012
1012
|
var ni = Xu, Ju = ni;
|
|
1013
1013
|
function qu(a, o) {
|
|
@@ -1019,9 +1019,9 @@ function td(a) {
|
|
|
1019
1019
|
var o = new a.constructor(a.source, _u.exec(a));
|
|
1020
1020
|
return o.lastIndex = a.lastIndex, o;
|
|
1021
1021
|
}
|
|
1022
|
-
var ed = td,
|
|
1022
|
+
var ed = td, Oi = Ze, Ri = Oi ? Oi.prototype : void 0, Yi = Ri ? Ri.valueOf : void 0;
|
|
1023
1023
|
function od(a) {
|
|
1024
|
-
return
|
|
1024
|
+
return Yi ? Object(Yi.call(a)) : {};
|
|
1025
1025
|
}
|
|
1026
1026
|
var id = od, sd = ni;
|
|
1027
1027
|
function nd(a, o) {
|
|
@@ -1062,19 +1062,19 @@ function Pd(a, o, t) {
|
|
|
1062
1062
|
return hd(a);
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
var Dd = Pd, Ad = de,
|
|
1065
|
+
var Dd = Pd, Ad = de, Wi = Object.create, jd = /* @__PURE__ */ function() {
|
|
1066
1066
|
function a() {
|
|
1067
1067
|
}
|
|
1068
1068
|
return function(o) {
|
|
1069
1069
|
if (!Ad(o))
|
|
1070
1070
|
return {};
|
|
1071
|
-
if (
|
|
1072
|
-
return
|
|
1071
|
+
if (Wi)
|
|
1072
|
+
return Wi(o);
|
|
1073
1073
|
a.prototype = o;
|
|
1074
1074
|
var t = new a();
|
|
1075
1075
|
return a.prototype = void 0, t;
|
|
1076
1076
|
};
|
|
1077
|
-
}(), Ed = jd, Od = Ed, Rd =
|
|
1077
|
+
}(), Ed = jd, Od = Ed, Rd = Es, Yd = _o;
|
|
1078
1078
|
function Wd(a) {
|
|
1079
1079
|
return typeof a.constructor == "function" && !Yd(a) ? Od(Rd(a)) : {};
|
|
1080
1080
|
}
|
|
@@ -1082,15 +1082,15 @@ var Ud = Wd, Bd = So, Fd = se, Vd = "[object Map]";
|
|
|
1082
1082
|
function $d(a) {
|
|
1083
1083
|
return Fd(a) && Bd(a) == Vd;
|
|
1084
1084
|
}
|
|
1085
|
-
var Hd = $d, Qd = Hd, Gd = To,
|
|
1085
|
+
var Hd = $d, Qd = Hd, Gd = To, Ui = Ko, Bi = Ui && Ui.isMap, Zd = Bi ? Gd(Bi) : Qd, Xd = Zd, Jd = So, qd = se, Kd = "[object Set]";
|
|
1086
1086
|
function _d(a) {
|
|
1087
1087
|
return qd(a) && Jd(a) == Kd;
|
|
1088
1088
|
}
|
|
1089
|
-
var tp = _d, ep = tp, op = To,
|
|
1090
|
-
const sp = /* @__PURE__ */ je(
|
|
1091
|
-
var np =
|
|
1092
|
-
mt[
|
|
1093
|
-
mt[Ap] = mt[
|
|
1089
|
+
var tp = _d, ep = tp, op = To, Fi = Ko, Vi = Fi && Fi.isSet, ip = Vi ? op(Vi) : ep, Fs = ip;
|
|
1090
|
+
const sp = /* @__PURE__ */ je(Fs);
|
|
1091
|
+
var np = Ts, rp = Pc, ap = Cs, cp = mh, lp = Oh, hp = Rh, up = Wh, dp = Jh, pp = lu, fp = Ys, gp = Iu, yp = So, Mp = Qu, wp = Dd, mp = Ud, vp = Xe, Ip = qo, Np = Xd, Tp = de, Sp = Fs, kp = ei, Cp = oi, xp = 1, bp = 2, Lp = 4, Vs = "[object Arguments]", zp = "[object Array]", Pp = "[object Boolean]", Dp = "[object Date]", Ap = "[object Error]", $s = "[object Function]", jp = "[object GeneratorFunction]", Ep = "[object Map]", Op = "[object Number]", Hs = "[object Object]", Rp = "[object RegExp]", Yp = "[object Set]", Wp = "[object String]", Up = "[object Symbol]", Bp = "[object WeakMap]", Fp = "[object ArrayBuffer]", Vp = "[object DataView]", $p = "[object Float32Array]", Hp = "[object Float64Array]", Qp = "[object Int8Array]", Gp = "[object Int16Array]", Zp = "[object Int32Array]", Xp = "[object Uint8Array]", Jp = "[object Uint8ClampedArray]", qp = "[object Uint16Array]", Kp = "[object Uint32Array]", mt = {};
|
|
1092
|
+
mt[Vs] = mt[zp] = mt[Fp] = mt[Vp] = mt[Pp] = mt[Dp] = mt[$p] = mt[Hp] = mt[Qp] = mt[Gp] = mt[Zp] = mt[Ep] = mt[Op] = mt[Hs] = mt[Rp] = mt[Yp] = mt[Wp] = mt[Up] = mt[Xp] = mt[Jp] = mt[qp] = mt[Kp] = !0;
|
|
1093
|
+
mt[Ap] = mt[$s] = mt[Bp] = !1;
|
|
1094
1094
|
function io(a, o, t, e, i, s) {
|
|
1095
1095
|
var n, r = o & xp, c = o & bp, l = o & Lp;
|
|
1096
1096
|
if (t && (n = i ? t(a, e, i, s) : t(a)), n !== void 0)
|
|
@@ -1102,10 +1102,10 @@ function io(a, o, t, e, i, s) {
|
|
|
1102
1102
|
if (n = Mp(a), !r)
|
|
1103
1103
|
return up(a, n);
|
|
1104
1104
|
} else {
|
|
1105
|
-
var u = yp(a), d = u ==
|
|
1105
|
+
var u = yp(a), d = u == $s || u == jp;
|
|
1106
1106
|
if (Ip(a))
|
|
1107
1107
|
return hp(a, r);
|
|
1108
|
-
if (u ==
|
|
1108
|
+
if (u == Hs || u == Vs || d && !i) {
|
|
1109
1109
|
if (n = c || d ? {} : mp(a), !r)
|
|
1110
1110
|
return c ? pp(a, lp(n, a)) : dp(a, cp(n, a));
|
|
1111
1111
|
} else {
|
|
@@ -1120,12 +1120,12 @@ function io(a, o, t, e, i, s) {
|
|
|
1120
1120
|
return p;
|
|
1121
1121
|
s.set(a, n), Sp(a) ? a.forEach(function(M) {
|
|
1122
1122
|
n.add(io(M, o, t, M, a, s));
|
|
1123
|
-
}) : Np(a) && a.forEach(function(M,
|
|
1124
|
-
n.set(
|
|
1123
|
+
}) : Np(a) && a.forEach(function(M, N) {
|
|
1124
|
+
n.set(N, io(M, o, t, N, a, s));
|
|
1125
1125
|
});
|
|
1126
1126
|
var f = l ? c ? gp : fp : c ? Cp : kp, y = h ? void 0 : f(a);
|
|
1127
|
-
return rp(y || a, function(M,
|
|
1128
|
-
y && (
|
|
1127
|
+
return rp(y || a, function(M, N) {
|
|
1128
|
+
y && (N = M, M = a[N]), ap(n, N, io(M, o, t, N, a, s));
|
|
1129
1129
|
}), n;
|
|
1130
1130
|
}
|
|
1131
1131
|
var _p = io, tf = _p, ef = 1, of = 4;
|
|
@@ -1133,10 +1133,10 @@ function sf(a) {
|
|
|
1133
1133
|
return tf(a, ef | of);
|
|
1134
1134
|
}
|
|
1135
1135
|
var nf = sf;
|
|
1136
|
-
const zt = /* @__PURE__ */ je(nf),
|
|
1136
|
+
const zt = /* @__PURE__ */ je(nf), Qs = "1.1.8", rf = "@netless/appliance-plugin", ri = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
|
|
1137
1137
|
if (typeof window < "u") {
|
|
1138
1138
|
let a = window.__netlessUA || "";
|
|
1139
|
-
a += ` ${rf}@${
|
|
1139
|
+
a += ` ${rf}@${Qs}`, window.__netlessUA = a;
|
|
1140
1140
|
}
|
|
1141
1141
|
const Et = {
|
|
1142
1142
|
syncOpt: {
|
|
@@ -1158,6 +1158,10 @@ const Et = {
|
|
|
1158
1158
|
},
|
|
1159
1159
|
pencilEraser: {
|
|
1160
1160
|
useBitMap: !0
|
|
1161
|
+
},
|
|
1162
|
+
strokeWidth: {
|
|
1163
|
+
min: 1,
|
|
1164
|
+
max: 10
|
|
1161
1165
|
}
|
|
1162
1166
|
};
|
|
1163
1167
|
function ce(a, o = !0) {
|
|
@@ -1247,16 +1251,16 @@ const Vt = class Vt {
|
|
|
1247
1251
|
for (const c of e) {
|
|
1248
1252
|
const { thickness: l, op: h } = c;
|
|
1249
1253
|
for (const u of h) {
|
|
1250
|
-
const d = u.map((
|
|
1254
|
+
const d = u.map((N, w) => w % 2 ? N - i[1] : N - i[0]), p = this.computEraserPoints(d, l), f = ce(p, !0), y = {
|
|
1251
1255
|
pos: [0, 0],
|
|
1252
1256
|
d: f,
|
|
1253
1257
|
fillColor: "rgba(0,0,0,1)"
|
|
1254
1258
|
}, M = new ue(y);
|
|
1255
|
-
n && (M.addEventListener("beforerender", ({ detail:
|
|
1256
|
-
const w =
|
|
1259
|
+
n && (M.addEventListener("beforerender", ({ detail: N }) => {
|
|
1260
|
+
const w = N.context;
|
|
1257
1261
|
r ? w.blendFuncSeparate(w.ZERO, w.ZERO, w.ZERO, w.ZERO) : w.globalCompositeOperation = "destination-out";
|
|
1258
|
-
}), M.addEventListener("afterrender", ({ detail:
|
|
1259
|
-
const w =
|
|
1262
|
+
}), M.addEventListener("afterrender", ({ detail: N }) => {
|
|
1263
|
+
const w = N.context;
|
|
1260
1264
|
r ? w.blendFuncSeparate(w.SRC_ALPHA, w.ONE_MINUS_SRC_ALPHA, w.ONE, w.ONE_MINUS_SRC_ALPHA) : w.globalCompositeOperation = "source-over";
|
|
1261
1265
|
})), t.append(M);
|
|
1262
1266
|
}
|
|
@@ -1318,51 +1322,51 @@ const Vt = class Vt {
|
|
|
1318
1322
|
const M = n && zt(n) || i.get(t.name);
|
|
1319
1323
|
if (!M) return;
|
|
1320
1324
|
oe(r) && (t.setAttribute("zIndex", r), M.opt.zIndex = r);
|
|
1321
|
-
const
|
|
1322
|
-
if (
|
|
1325
|
+
const N = t.parent;
|
|
1326
|
+
if (N) {
|
|
1323
1327
|
if (h && d && n) {
|
|
1324
1328
|
const m = [M.op[0], M.op[1]];
|
|
1325
|
-
|
|
1326
|
-
const S = [M.op[0], M.op[1]],
|
|
1327
|
-
if (M.centerPos = [M.centerPos[0] +
|
|
1329
|
+
pi(M.op, u, d, c);
|
|
1330
|
+
const S = [M.op[0], M.op[1]], I = [S[0] - m[0], S[1] - m[1]];
|
|
1331
|
+
if (M.centerPos = [M.centerPos[0] + I[0], M.centerPos[1] + I[1]], M.opt.translate = void 0, M.opt.scale = void 0, M.opt.eraserlines)
|
|
1328
1332
|
for (const v of Object.values(M.opt.eraserlines)) {
|
|
1329
1333
|
const { op: x, thickness: L } = v;
|
|
1330
1334
|
v.thickness = L * Math.max(d[0], d[1]);
|
|
1331
1335
|
for (let A = 0; A < x.length; A++)
|
|
1332
|
-
|
|
1336
|
+
fi(x[A], u, d, c);
|
|
1333
1337
|
}
|
|
1334
1338
|
} else if (c)
|
|
1335
1339
|
if (t.setAttribute("translate", c), M.opt.translate = c, n) {
|
|
1336
|
-
const m = [c[0] *
|
|
1340
|
+
const m = [c[0] * N.worldScaling[0], c[1] * N.worldScaling[1]];
|
|
1337
1341
|
y = Vo(M.rect, m), M.rect = y;
|
|
1338
1342
|
} else {
|
|
1339
|
-
const m = Vt.getRectFromLayer(
|
|
1343
|
+
const m = Vt.getRectFromLayer(N, t.name);
|
|
1340
1344
|
M.rect = m || M.rect;
|
|
1341
1345
|
}
|
|
1342
1346
|
else if (oe(l))
|
|
1343
1347
|
if (t.setAttribute("rotate", l), M.opt.rotate = l, n)
|
|
1344
1348
|
y = un(M.rect, l), M.rect = y;
|
|
1345
1349
|
else {
|
|
1346
|
-
const m = Vt.getRectFromLayer(
|
|
1350
|
+
const m = Vt.getRectFromLayer(N, t.name);
|
|
1347
1351
|
M.rect = m || M.rect;
|
|
1348
1352
|
}
|
|
1349
1353
|
if (p) {
|
|
1350
1354
|
const m = p.get(t.name);
|
|
1351
1355
|
if (m)
|
|
1352
|
-
for (let S = 0,
|
|
1353
|
-
M.op[S] = m[
|
|
1356
|
+
for (let S = 0, I = 0; S < M.op.length; S += 3, I++)
|
|
1357
|
+
M.op[S] = m[I][0], M.op[S + 1] = m[I][1];
|
|
1354
1358
|
}
|
|
1355
1359
|
if (f && ((w = M == null ? void 0 : M.opt) != null && w.thickness) && (M.opt.thickness = f), s && !(h && d && n)) {
|
|
1356
1360
|
if (c) {
|
|
1357
|
-
const m = M.op.map((S,
|
|
1358
|
-
const v =
|
|
1361
|
+
const m = M.op.map((S, I) => {
|
|
1362
|
+
const v = I % 3;
|
|
1359
1363
|
return v === 0 ? S + c[0] : v === 1 ? S + c[1] : S;
|
|
1360
1364
|
});
|
|
1361
1365
|
if (M.op = m, M.centerPos = [M.centerPos[0] + c[0], M.centerPos[1] + c[1]], M != null && M.opt && (M.opt.translate = void 0), M.opt.eraserlines)
|
|
1362
1366
|
for (const S of Object.values(M.opt.eraserlines)) {
|
|
1363
|
-
const { op:
|
|
1364
|
-
for (let v = 0; v <
|
|
1365
|
-
const x =
|
|
1367
|
+
const { op: I } = S;
|
|
1368
|
+
for (let v = 0; v < I.length; v++) {
|
|
1369
|
+
const x = I[v].map((L, A) => A % 2 ? L + c[1] : L + c[0]);
|
|
1366
1370
|
S.op[v] = x;
|
|
1367
1371
|
}
|
|
1368
1372
|
}
|
|
@@ -1370,9 +1374,9 @@ const Vt = class Vt {
|
|
|
1370
1374
|
const m = M.op;
|
|
1371
1375
|
if (EM(m, M.centerPos, l), M.op = m, M != null && M.opt && (M.opt.rotate = void 0), M.opt.eraserlines)
|
|
1372
1376
|
for (const S of Object.values(M.opt.eraserlines)) {
|
|
1373
|
-
const { op:
|
|
1374
|
-
for (let v = 0; v <
|
|
1375
|
-
OM(
|
|
1377
|
+
const { op: I } = S;
|
|
1378
|
+
for (let v = 0; v < I.length; v++)
|
|
1379
|
+
OM(I[v], M.centerPos, l);
|
|
1376
1380
|
}
|
|
1377
1381
|
}
|
|
1378
1382
|
}
|
|
@@ -1413,7 +1417,7 @@ class Gs extends Y {
|
|
|
1413
1417
|
super(t);
|
|
1414
1418
|
g(this, "canRotate", !0);
|
|
1415
1419
|
g(this, "scaleType", pt.all);
|
|
1416
|
-
g(this, "toolsType",
|
|
1420
|
+
g(this, "toolsType", T.Pencil);
|
|
1417
1421
|
g(this, "syncTimestamp");
|
|
1418
1422
|
g(this, "syncIndex", 0);
|
|
1419
1423
|
g(this, "tmpPoints", []);
|
|
@@ -1465,15 +1469,15 @@ class Gs extends Y {
|
|
|
1465
1469
|
type: b.DrawWork,
|
|
1466
1470
|
dataType: U.Local
|
|
1467
1471
|
};
|
|
1468
|
-
const
|
|
1472
|
+
const N = [];
|
|
1469
1473
|
return this.tmpPoints.slice(M).forEach((w) => {
|
|
1470
|
-
|
|
1474
|
+
N.push(w.x, w.y, this.computRadius(w.z, this.workOptions.thickness));
|
|
1471
1475
|
}), {
|
|
1472
1476
|
...this.baseConsumeResult,
|
|
1473
1477
|
type: b.DrawWork,
|
|
1474
1478
|
dataType: U.Local,
|
|
1475
1479
|
rect: f,
|
|
1476
|
-
op: y ?
|
|
1480
|
+
op: y ? N : void 0,
|
|
1477
1481
|
index: y ? M * 3 : void 0,
|
|
1478
1482
|
updateNodeOpt: {
|
|
1479
1483
|
useAnimation: !0
|
|
@@ -1564,14 +1568,14 @@ class Gs extends Y {
|
|
|
1564
1568
|
}
|
|
1565
1569
|
draw(t) {
|
|
1566
1570
|
const { attrs: e, tasks: i, replaceId: s, effects: n, layer: r } = t, { strokeColor: c, strokeType: l, thickness: h, zIndex: u, scale: d, rotate: p, translate: f, eraserlines: y } = this.workOptions;
|
|
1567
|
-
n != null && n.size && (n.forEach((
|
|
1571
|
+
n != null && n.size && (n.forEach((I) => {
|
|
1568
1572
|
var v;
|
|
1569
|
-
(v = r.getElementById(
|
|
1573
|
+
(v = r.getElementById(I + "")) == null || v.remove();
|
|
1570
1574
|
}), n.clear());
|
|
1571
1575
|
let M;
|
|
1572
|
-
const
|
|
1573
|
-
for (let
|
|
1574
|
-
const { pos: v, points: x } = i[
|
|
1576
|
+
const N = [], w = r.worldPosition, m = r.worldScaling;
|
|
1577
|
+
for (let I = 0; I < i.length; I++) {
|
|
1578
|
+
const { pos: v, points: x } = i[I], { ps: L, rect: A } = this.computDrawPoints(x);
|
|
1575
1579
|
let j;
|
|
1576
1580
|
const D = x.length === 1;
|
|
1577
1581
|
l === et.Stroke || D ? j = ce(L, !0) : j = ce(L, !1);
|
|
@@ -1589,24 +1593,24 @@ class Gs extends Y {
|
|
|
1589
1593
|
y: Math.floor((A.y + v[1]) * m[1] + w[1] - Y.SafeBorderPadding),
|
|
1590
1594
|
w: Math.floor(A.w * m[0] + 2 * Y.SafeBorderPadding),
|
|
1591
1595
|
h: Math.floor(A.h * m[1] + 2 * Y.SafeBorderPadding)
|
|
1592
|
-
}),
|
|
1596
|
+
}), N.push(O);
|
|
1593
1597
|
}
|
|
1594
1598
|
d && (e.scale = d), p && (e.rotate = p), f && (e.translate = f);
|
|
1595
1599
|
const S = new Wt();
|
|
1596
1600
|
if (M) {
|
|
1597
1601
|
this.centerPos = Y.getCenterPos(M, r);
|
|
1598
|
-
const
|
|
1602
|
+
const I = l === et.Stroke && !y;
|
|
1599
1603
|
S.attr({
|
|
1600
1604
|
...e,
|
|
1601
1605
|
normalize: !0,
|
|
1602
1606
|
anchor: [0.5, 0.5],
|
|
1603
|
-
bgcolor:
|
|
1607
|
+
bgcolor: I ? c : void 0,
|
|
1604
1608
|
pos: this.centerPos,
|
|
1605
1609
|
size: [(M.w - 2 * Y.SafeBorderPadding) / m[0], (M.h - 2 * Y.SafeBorderPadding) / m[1]],
|
|
1606
1610
|
zIndex: u
|
|
1607
1611
|
});
|
|
1608
|
-
const v =
|
|
1609
|
-
S.append(...v),
|
|
1612
|
+
const v = N.map((x) => (x.pos = [x.pos[0] - this.centerPos[0], x.pos[1] - this.centerPos[1]], new ue(x)));
|
|
1613
|
+
S.append(...v), I && S.seal(), y && this.drawEraserlines({
|
|
1610
1614
|
group: S,
|
|
1611
1615
|
eraserlines: y,
|
|
1612
1616
|
pos: this.centerPos,
|
|
@@ -1614,13 +1618,13 @@ class Gs extends Y {
|
|
|
1614
1618
|
}), this.replace(r, s || e.workId, S);
|
|
1615
1619
|
}
|
|
1616
1620
|
if (d || p || f) {
|
|
1617
|
-
const
|
|
1618
|
-
if (
|
|
1621
|
+
const I = S == null ? void 0 : S.getBoundingClientRect();
|
|
1622
|
+
if (I)
|
|
1619
1623
|
return {
|
|
1620
|
-
x: Math.floor(
|
|
1621
|
-
y: Math.floor(
|
|
1622
|
-
w: Math.floor(
|
|
1623
|
-
h: Math.floor(
|
|
1624
|
+
x: Math.floor(I.x - Y.SafeBorderPadding),
|
|
1625
|
+
y: Math.floor(I.y - Y.SafeBorderPadding),
|
|
1626
|
+
w: Math.floor(I.width + Y.SafeBorderPadding * 2),
|
|
1627
|
+
h: Math.floor(I.height + Y.SafeBorderPadding * 2)
|
|
1624
1628
|
};
|
|
1625
1629
|
}
|
|
1626
1630
|
return M;
|
|
@@ -1682,8 +1686,8 @@ class Gs extends Y {
|
|
|
1682
1686
|
point: new F(p, f, y, t[s].v),
|
|
1683
1687
|
radius: M
|
|
1684
1688
|
}), s > 0 && s < t.length - 1) {
|
|
1685
|
-
const
|
|
1686
|
-
if (
|
|
1689
|
+
const N = t[s].getAngleByPoints(t[s - 1], t[s + 1]);
|
|
1690
|
+
if (N < 90 || N > 270) {
|
|
1687
1691
|
const w = (u = l.pop()) == null ? void 0 : u.point.clone();
|
|
1688
1692
|
w && i.push({
|
|
1689
1693
|
taskId: h,
|
|
@@ -1722,12 +1726,12 @@ class Gs extends Y {
|
|
|
1722
1726
|
if (u.isNear(p, e)) {
|
|
1723
1727
|
if (p.z < this.MAX_REPEAR) {
|
|
1724
1728
|
if (p.setz(Math.min(p.z + 1, this.MAX_REPEAR)), r = Math.min(r, d), h > 1) {
|
|
1725
|
-
let
|
|
1726
|
-
for (;
|
|
1727
|
-
const w = this.tmpPoints[
|
|
1728
|
-
if (this.tmpPoints[
|
|
1729
|
+
let N = h - 1;
|
|
1730
|
+
for (; N > 0; ) {
|
|
1731
|
+
const w = this.tmpPoints[N].distance(this.tmpPoints[N - 1]), m = Math.max(this.tmpPoints[N].z - this.uniThickness * w, 0);
|
|
1732
|
+
if (this.tmpPoints[N - 1].z >= m)
|
|
1729
1733
|
break;
|
|
1730
|
-
this.tmpPoints[
|
|
1734
|
+
this.tmpPoints[N - 1].setz(m), r = Math.min(r, N - 1), N--;
|
|
1731
1735
|
}
|
|
1732
1736
|
}
|
|
1733
1737
|
} else
|
|
@@ -1832,7 +1836,7 @@ class Gs extends Y {
|
|
|
1832
1836
|
class Zs extends Y {
|
|
1833
1837
|
constructor(t) {
|
|
1834
1838
|
super(t);
|
|
1835
|
-
g(this, "toolsType",
|
|
1839
|
+
g(this, "toolsType", T.LaserPen);
|
|
1836
1840
|
g(this, "canRotate", !1);
|
|
1837
1841
|
g(this, "scaleType", pt.none);
|
|
1838
1842
|
g(this, "syncTimestamp");
|
|
@@ -1867,12 +1871,12 @@ class Zs extends Y {
|
|
|
1867
1871
|
anchor: [0.5, 0.5]
|
|
1868
1872
|
}, y = this.getTaskPoints(p);
|
|
1869
1873
|
if (y.length) {
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1874
|
+
const N = Date.now();
|
|
1875
|
+
N - this.syncTimestamp > this.syncUnitTime && (u = !0, this.syncTimestamp = N, this.syncIndex = this.tmpPoints.length), i && this.draw({ attrs: f, tasks: y, isDot: !1, layer: this.drawLayer || this.fullLayer });
|
|
1872
1876
|
}
|
|
1873
1877
|
const M = [];
|
|
1874
|
-
return this.tmpPoints.slice(d).forEach((
|
|
1875
|
-
M.push(
|
|
1878
|
+
return this.tmpPoints.slice(d).forEach((N) => {
|
|
1879
|
+
M.push(N.x, N.y);
|
|
1876
1880
|
}), {
|
|
1877
1881
|
rect: {
|
|
1878
1882
|
x: h.x * this.fullLayer.worldScaling[0] + this.fullLayer.worldPosition[0],
|
|
@@ -2007,10 +2011,10 @@ class Zs extends Y {
|
|
|
2007
2011
|
});
|
|
2008
2012
|
const { vertex: p, fragment: f } = this.workOptions;
|
|
2009
2013
|
if (p && f) {
|
|
2010
|
-
const y = n.renderer.createProgram({ vertex: p, fragment: f }), { width: M, height:
|
|
2014
|
+
const y = n.renderer.createProgram({ vertex: p, fragment: f }), { width: M, height: N } = n.getResolution();
|
|
2011
2015
|
l.setUniforms({
|
|
2012
2016
|
u_time: 0,
|
|
2013
|
-
u_resolution: [M,
|
|
2017
|
+
u_resolution: [M, N]
|
|
2014
2018
|
}), l.setProgram(y);
|
|
2015
2019
|
}
|
|
2016
2020
|
n.appendChild(l), l.transition(r).attr({
|
|
@@ -2071,7 +2075,7 @@ const xe = class xe extends Y {
|
|
|
2071
2075
|
super(t);
|
|
2072
2076
|
g(this, "canRotate", !1);
|
|
2073
2077
|
g(this, "scaleType", pt.none);
|
|
2074
|
-
g(this, "toolsType",
|
|
2078
|
+
g(this, "toolsType", T.Eraser);
|
|
2075
2079
|
g(this, "serviceWork");
|
|
2076
2080
|
g(this, "tmpPoints", []);
|
|
2077
2081
|
g(this, "workOptions");
|
|
@@ -2209,7 +2213,7 @@ var lf = cf;
|
|
|
2209
2213
|
function hf(a) {
|
|
2210
2214
|
return this.__data__.has(a);
|
|
2211
2215
|
}
|
|
2212
|
-
var uf = hf, df =
|
|
2216
|
+
var uf = hf, df = Ns, pf = lf, ff = uf;
|
|
2213
2217
|
function co(a) {
|
|
2214
2218
|
var o = -1, t = a == null ? 0 : a.length;
|
|
2215
2219
|
for (this.__data__ = new df(); ++o < t; )
|
|
@@ -2217,7 +2221,7 @@ function co(a) {
|
|
|
2217
2221
|
}
|
|
2218
2222
|
co.prototype.add = co.prototype.push = pf;
|
|
2219
2223
|
co.prototype.has = ff;
|
|
2220
|
-
var
|
|
2224
|
+
var ai = co;
|
|
2221
2225
|
function gf(a, o) {
|
|
2222
2226
|
for (var t = -1, e = a == null ? 0 : a.length; ++t < e; )
|
|
2223
2227
|
if (o(a[t], t, a))
|
|
@@ -2228,7 +2232,7 @@ var yf = gf;
|
|
|
2228
2232
|
function Mf(a, o) {
|
|
2229
2233
|
return a.has(o);
|
|
2230
2234
|
}
|
|
2231
|
-
var
|
|
2235
|
+
var ci = Mf, wf = ai, mf = yf, vf = ci, If = 1, Nf = 2;
|
|
2232
2236
|
function Tf(a, o, t, e, i, s) {
|
|
2233
2237
|
var n = t & If, r = a.length, c = o.length;
|
|
2234
2238
|
if (r != c && !(n && c > r))
|
|
@@ -2248,8 +2252,8 @@ function Tf(a, o, t, e, i, s) {
|
|
|
2248
2252
|
break;
|
|
2249
2253
|
}
|
|
2250
2254
|
if (p) {
|
|
2251
|
-
if (!mf(o, function(
|
|
2252
|
-
if (!vf(p, w) && (f ===
|
|
2255
|
+
if (!mf(o, function(N, w) {
|
|
2256
|
+
if (!vf(p, w) && (f === N || i(f, N, t, e, s)))
|
|
2253
2257
|
return p.push(w);
|
|
2254
2258
|
})) {
|
|
2255
2259
|
d = !1;
|
|
@@ -2276,7 +2280,7 @@ function Cf(a) {
|
|
|
2276
2280
|
t[++o] = e;
|
|
2277
2281
|
}), t;
|
|
2278
2282
|
}
|
|
2279
|
-
var
|
|
2283
|
+
var li = Cf, $i = Ze, Hi = Bs, xf = Xo, bf = Xs, Lf = kf, zf = li, Pf = 1, Df = 2, Af = "[object Boolean]", jf = "[object Date]", Ef = "[object Error]", Of = "[object Map]", Rf = "[object Number]", Yf = "[object RegExp]", Wf = "[object Set]", Uf = "[object String]", Bf = "[object Symbol]", Ff = "[object ArrayBuffer]", Vf = "[object DataView]", Qi = $i ? $i.prototype : void 0, zo = Qi ? Qi.valueOf : void 0;
|
|
2280
2284
|
function $f(a, o, t, e, i, s, n) {
|
|
2281
2285
|
switch (t) {
|
|
2282
2286
|
case Vf:
|
|
@@ -2284,7 +2288,7 @@ function $f(a, o, t, e, i, s, n) {
|
|
|
2284
2288
|
return !1;
|
|
2285
2289
|
a = a.buffer, o = o.buffer;
|
|
2286
2290
|
case Ff:
|
|
2287
|
-
return !(a.byteLength != o.byteLength || !s(new
|
|
2291
|
+
return !(a.byteLength != o.byteLength || !s(new Hi(a), new Hi(o)));
|
|
2288
2292
|
case Af:
|
|
2289
2293
|
case jf:
|
|
2290
2294
|
case Rf:
|
|
@@ -2312,9 +2316,9 @@ function $f(a, o, t, e, i, s, n) {
|
|
|
2312
2316
|
}
|
|
2313
2317
|
return !1;
|
|
2314
2318
|
}
|
|
2315
|
-
var Hf = $f,
|
|
2319
|
+
var Hf = $f, Gi = Ys, Qf = 1, Gf = Object.prototype, Zf = Gf.hasOwnProperty;
|
|
2316
2320
|
function Xf(a, o, t, e, i, s) {
|
|
2317
|
-
var n = t & Qf, r =
|
|
2321
|
+
var n = t & Qf, r = Gi(a), c = r.length, l = Gi(o), h = l.length;
|
|
2318
2322
|
if (c != h && !n)
|
|
2319
2323
|
return !1;
|
|
2320
2324
|
for (var u = c; u--; ) {
|
|
@@ -2329,35 +2333,35 @@ function Xf(a, o, t, e, i, s) {
|
|
|
2329
2333
|
s.set(a, o), s.set(o, a);
|
|
2330
2334
|
for (var M = n; ++u < c; ) {
|
|
2331
2335
|
d = r[u];
|
|
2332
|
-
var
|
|
2336
|
+
var N = a[d], w = o[d];
|
|
2333
2337
|
if (e)
|
|
2334
|
-
var m = n ? e(w,
|
|
2335
|
-
if (!(m === void 0 ?
|
|
2338
|
+
var m = n ? e(w, N, d, o, a, s) : e(N, w, d, a, o, s);
|
|
2339
|
+
if (!(m === void 0 ? N === w || i(N, w, t, e, s) : m)) {
|
|
2336
2340
|
y = !1;
|
|
2337
2341
|
break;
|
|
2338
2342
|
}
|
|
2339
2343
|
M || (M = d == "constructor");
|
|
2340
2344
|
}
|
|
2341
2345
|
if (y && !M) {
|
|
2342
|
-
var S = a.constructor,
|
|
2343
|
-
S !=
|
|
2346
|
+
var S = a.constructor, I = o.constructor;
|
|
2347
|
+
S != I && "constructor" in a && "constructor" in o && !(typeof S == "function" && S instanceof S && typeof I == "function" && I instanceof I) && (y = !1);
|
|
2344
2348
|
}
|
|
2345
2349
|
return s.delete(a), s.delete(o), y;
|
|
2346
2350
|
}
|
|
2347
|
-
var Jf = Xf, Po =
|
|
2351
|
+
var Jf = Xf, Po = Ts, qf = Xs, Kf = Hf, _f = Jf, Zi = So, Xi = Xe, Ji = qo, tg = zs, eg = 1, qi = "[object Arguments]", Ki = "[object Array]", Ke = "[object Object]", og = Object.prototype, _i = og.hasOwnProperty;
|
|
2348
2352
|
function ig(a, o, t, e, i, s) {
|
|
2349
|
-
var n =
|
|
2350
|
-
c = c ==
|
|
2353
|
+
var n = Xi(a), r = Xi(o), c = n ? Ki : Zi(a), l = r ? Ki : Zi(o);
|
|
2354
|
+
c = c == qi ? Ke : c, l = l == qi ? Ke : l;
|
|
2351
2355
|
var h = c == Ke, u = l == Ke, d = c == l;
|
|
2352
|
-
if (d &&
|
|
2353
|
-
if (!
|
|
2356
|
+
if (d && Ji(a)) {
|
|
2357
|
+
if (!Ji(o))
|
|
2354
2358
|
return !1;
|
|
2355
2359
|
n = !0, h = !1;
|
|
2356
2360
|
}
|
|
2357
2361
|
if (d && !h)
|
|
2358
2362
|
return s || (s = new Po()), n || tg(a) ? qf(a, o, t, e, i, s) : Kf(a, o, c, t, e, i, s);
|
|
2359
2363
|
if (!(t & eg)) {
|
|
2360
|
-
var p = h &&
|
|
2364
|
+
var p = h && _i.call(a, "__wrapped__"), f = u && _i.call(o, "__wrapped__");
|
|
2361
2365
|
if (p || f) {
|
|
2362
2366
|
var y = p ? a.value() : a, M = f ? o.value() : o;
|
|
2363
2367
|
return s || (s = new Po()), i(y, M, t, e, s);
|
|
@@ -2365,9 +2369,9 @@ function ig(a, o, t, e, i, s) {
|
|
|
2365
2369
|
}
|
|
2366
2370
|
return d ? (s || (s = new Po()), _f(a, o, t, e, i, s)) : !1;
|
|
2367
2371
|
}
|
|
2368
|
-
var sg = ig, ng = sg,
|
|
2372
|
+
var sg = ig, ng = sg, ts = se;
|
|
2369
2373
|
function Js(a, o, t, e, i) {
|
|
2370
|
-
return a === o ? !0 : a == null || o == null || !
|
|
2374
|
+
return a === o ? !0 : a == null || o == null || !ts(a) && !ts(o) ? a !== a && o !== o : ng(a, o, t, e, Js, i);
|
|
2371
2375
|
}
|
|
2372
2376
|
var rg = Js, ag = rg;
|
|
2373
2377
|
function cg(a, o) {
|
|
@@ -2377,7 +2381,7 @@ var lg = cg;
|
|
|
2377
2381
|
const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
2378
2382
|
constructor(t) {
|
|
2379
2383
|
super(t);
|
|
2380
|
-
g(this, "toolsType",
|
|
2384
|
+
g(this, "toolsType", T.Selector);
|
|
2381
2385
|
g(this, "tmpPoints", []);
|
|
2382
2386
|
g(this, "workOptions");
|
|
2383
2387
|
g(this, "vNodes");
|
|
@@ -2431,7 +2435,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2431
2435
|
zIndex: 9999
|
|
2432
2436
|
}), l = [];
|
|
2433
2437
|
if (r) {
|
|
2434
|
-
const h = new
|
|
2438
|
+
const h = new Mi({
|
|
2435
2439
|
normalize: !0,
|
|
2436
2440
|
pos: [e.w / 2, e.h / 2],
|
|
2437
2441
|
lineWidth: 1,
|
|
@@ -2446,7 +2450,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2446
2450
|
const d = [
|
|
2447
2451
|
h.rect.x + h.rect.w / 2 - e.x,
|
|
2448
2452
|
h.rect.y + h.rect.h / 2 - e.y
|
|
2449
|
-
], p = new
|
|
2453
|
+
], p = new Mi({
|
|
2450
2454
|
normalize: !0,
|
|
2451
2455
|
pos: d,
|
|
2452
2456
|
lineWidth: 1,
|
|
@@ -2476,7 +2480,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2476
2480
|
let i, s = !0;
|
|
2477
2481
|
for (const n of t.values()) {
|
|
2478
2482
|
const { opt: r, canRotate: c, scaleType: l, toolsType: h } = n;
|
|
2479
|
-
this.selectorColor = this.workOptions.strokeColor, r.strokeColor && (this.strokeColor = r.strokeColor), r.fillColor && (this.fillColor = r.fillColor), r.textOpt && (this.textOpt = r.textOpt), r.thickness && (this.thickness = r.thickness), h !==
|
|
2483
|
+
this.selectorColor = this.workOptions.strokeColor, r.strokeColor && (this.strokeColor = r.strokeColor), r.fillColor && (this.fillColor = r.fillColor), r.textOpt && (this.textOpt = r.textOpt), r.thickness && (this.thickness = r.thickness), h !== T.Pencil && (s = !1), r.strokeType && (this.strokeType = r.strokeType), h === T.SpeechBalloon && (e.add(h), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.placement = r.placement), h === T.Polygon && (e.add(h), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.vertices = r.vertices), h === T.Star && (e.add(h), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.vertices = r.vertices, this.shapeOpt.innerRatio = r.innerRatio, this.shapeOpt.innerVerticeStep = r.innerVerticeStep), h === T.Text && (this.textOpt = r), t.size === 1 && (this.textOpt && (this.canTextEdit = !0), this.canRotate = c, this.scaleType = l), l === pt.none && (this.scaleType = l), h === T.Image && (i = n);
|
|
2480
2484
|
}
|
|
2481
2485
|
s && (this.useStroke = !0), e.size && (this.toolsTypes = [...e]), i && (t.size === 1 ? (this.canLock = !0, i.opt.locked && (this.isLocked = !0, this.scaleType = pt.none, this.canRotate = !1, this.textOpt = void 0, this.fillColor = void 0, this.selectorColor = "rgb(177,177,177)", this.strokeColor = void 0, this.canTextEdit = !1, this.thickness = void 0, this.strokeType = void 0, this.useStroke = void 0)) : t.size > 1 && !i.opt.locked && (this.canLock = !1, this.canRotate = !1));
|
|
2482
2486
|
}
|
|
@@ -2630,15 +2634,15 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2630
2634
|
})), i;
|
|
2631
2635
|
}
|
|
2632
2636
|
isCanFillColor(t) {
|
|
2633
|
-
return t ===
|
|
2637
|
+
return t === T.Ellipse || t === T.Triangle || t === T.Rectangle || t === T.Polygon || t === T.Star || t === T.SpeechBalloon;
|
|
2634
2638
|
}
|
|
2635
2639
|
async updateSelector(t) {
|
|
2636
|
-
var
|
|
2640
|
+
var I;
|
|
2637
2641
|
const { updateSelectorOpt: e, selectIds: i, vNodes: s, willSerializeData: n, worker: r, offset: c } = t, l = this.fullLayer;
|
|
2638
2642
|
if (!l)
|
|
2639
2643
|
return;
|
|
2640
2644
|
let h;
|
|
2641
|
-
const u = /* @__PURE__ */ new Map(), { originPoint: d, workState: p, angle: f, translate: y, dir: M, scale:
|
|
2645
|
+
const u = /* @__PURE__ */ new Map(), { originPoint: d, workState: p, angle: f, translate: y, dir: M, scale: N } = e;
|
|
2642
2646
|
c && (y ? e.translate = [y[0] + c[0], y[1] + c[1]] : e.translate = c);
|
|
2643
2647
|
let w;
|
|
2644
2648
|
if (d || y || oe(f)) {
|
|
@@ -2661,7 +2665,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2661
2665
|
const z = { ...e };
|
|
2662
2666
|
let E;
|
|
2663
2667
|
if (L) {
|
|
2664
|
-
z.thickness && x.opt.thickness && (D = x.opt.thickness !== z.thickness), z.strokeType && ((
|
|
2668
|
+
z.thickness && x.opt.thickness && (D = x.opt.thickness !== z.thickness), z.strokeType && ((I = x.opt) != null && I.strokeType) && (O = x.opt.strokeType !== z.strokeType), E = w == null ? void 0 : w.get(v);
|
|
2665
2669
|
const rt = nn(L);
|
|
2666
2670
|
if (rt == null || rt.updateNodeOpt({
|
|
2667
2671
|
node: j,
|
|
@@ -2669,7 +2673,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2669
2673
|
vNodes: s,
|
|
2670
2674
|
willSerializeData: n,
|
|
2671
2675
|
targetNode: E
|
|
2672
|
-
}), x && r && (n && (z.angle || z.translate) || z.originPoint && z.scenePoint && z.scale || z.pointMap && z.pointMap.has(v) || L ===
|
|
2676
|
+
}), x && r && (n && (z.angle || z.translate) || z.originPoint && z.scenePoint && z.scale || z.pointMap && z.pointMap.has(v) || L === T.Text && (z.fontSize || z.translate || z.textInfos && z.textInfos.get(v)) || L === T.Image && (z.angle || z.translate || z.scale || z.strokeColor && A.type === ze.Iconify) || L === z.toolsType && z.willRefresh || D || O)) {
|
|
2673
2677
|
const tt = r.createWorkShapeNode({
|
|
2674
2678
|
workId: v,
|
|
2675
2679
|
toolsType: L,
|
|
@@ -2677,13 +2681,13 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2677
2681
|
});
|
|
2678
2682
|
tt == null || tt.setWorkId(v);
|
|
2679
2683
|
let H;
|
|
2680
|
-
if (L ===
|
|
2684
|
+
if (L === T.Image)
|
|
2681
2685
|
H = await tt.consumeServiceAsync({
|
|
2682
2686
|
isFullWork: !0,
|
|
2683
2687
|
replaceId: v,
|
|
2684
2688
|
worker: r
|
|
2685
2689
|
});
|
|
2686
|
-
else if (L ===
|
|
2690
|
+
else if (L === T.Text)
|
|
2687
2691
|
H = await tt.consumeServiceAsync({
|
|
2688
2692
|
isFullWork: !0,
|
|
2689
2693
|
replaceId: v
|
|
@@ -2707,7 +2711,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2707
2711
|
}
|
|
2708
2712
|
w && p === P.Done && (s.deleteLastTarget(), w = void 0);
|
|
2709
2713
|
const m = h;
|
|
2710
|
-
if (d && y &&
|
|
2714
|
+
if (d && y && N && M && m && !c) {
|
|
2711
2715
|
const v = [
|
|
2712
2716
|
[m.x, m.y],
|
|
2713
2717
|
[m.x + m.w, m.y],
|
|
@@ -2844,7 +2848,7 @@ class qs extends Y {
|
|
|
2844
2848
|
super(t);
|
|
2845
2849
|
g(this, "canRotate", !1);
|
|
2846
2850
|
g(this, "scaleType", pt.both);
|
|
2847
|
-
g(this, "toolsType",
|
|
2851
|
+
g(this, "toolsType", T.Arrow);
|
|
2848
2852
|
g(this, "tmpPoints", []);
|
|
2849
2853
|
g(this, "workOptions");
|
|
2850
2854
|
g(this, "oldRect");
|
|
@@ -2912,21 +2916,21 @@ class qs extends Y {
|
|
|
2912
2916
|
};
|
|
2913
2917
|
}
|
|
2914
2918
|
draw(t) {
|
|
2915
|
-
const { workId: e, layer: i } = t, { strokeColor: s, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, p = i.worldPosition, f = i.worldScaling, { points: y, pos: M, rect:
|
|
2916
|
-
|
|
2917
|
-
|
|
2919
|
+
const { workId: e, layer: i } = t, { strokeColor: s, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, p = i.worldPosition, f = i.worldScaling, { points: y, pos: M, rect: N, isTriangle: w, trianglePoints: m, trianglePos: S } = this.computDrawPoints(n), I = [
|
|
2920
|
+
N.x + N.w / 2,
|
|
2921
|
+
N.y + N.h / 2
|
|
2918
2922
|
], v = {
|
|
2919
|
-
pos:
|
|
2923
|
+
pos: I,
|
|
2920
2924
|
name: e,
|
|
2921
2925
|
id: e,
|
|
2922
2926
|
zIndex: r,
|
|
2923
2927
|
anchor: [0.5, 0.5],
|
|
2924
|
-
size: [
|
|
2928
|
+
size: [N.w, N.h]
|
|
2925
2929
|
};
|
|
2926
2930
|
c && (v.scale = c), l && (v.rotate = l), h && (v.translate = h);
|
|
2927
2931
|
const x = new Wt(v), L = {
|
|
2928
2932
|
points: m,
|
|
2929
|
-
pos: [S[0] -
|
|
2933
|
+
pos: [S[0] - I[0], S[1] - I[1]],
|
|
2930
2934
|
fillColor: s,
|
|
2931
2935
|
strokeColor: s,
|
|
2932
2936
|
lineWidth: 0,
|
|
@@ -2935,7 +2939,7 @@ class qs extends Y {
|
|
|
2935
2939
|
if (x.append(A), !w && y && M) {
|
|
2936
2940
|
const j = {
|
|
2937
2941
|
points: y,
|
|
2938
|
-
pos: [M[0] -
|
|
2942
|
+
pos: [M[0] - I[0], M[1] - I[1]],
|
|
2939
2943
|
fillColor: s,
|
|
2940
2944
|
strokeColor: s,
|
|
2941
2945
|
lineDash: u === et.Dotted && !w ? [1, n * 2] : u === et.LongDotted && !w ? [n, n * 2] : void 0,
|
|
@@ -2948,7 +2952,7 @@ class qs extends Y {
|
|
|
2948
2952
|
if (d && this.drawEraserlines({
|
|
2949
2953
|
group: x,
|
|
2950
2954
|
eraserlines: d,
|
|
2951
|
-
pos:
|
|
2955
|
+
pos: I,
|
|
2952
2956
|
layer: i
|
|
2953
2957
|
}), this.replace(i, e, x), c || l || h) {
|
|
2954
2958
|
const j = x.getBoundingClientRect();
|
|
@@ -2960,10 +2964,10 @@ class qs extends Y {
|
|
|
2960
2964
|
};
|
|
2961
2965
|
}
|
|
2962
2966
|
return {
|
|
2963
|
-
x: Math.floor(
|
|
2964
|
-
y: Math.floor(
|
|
2965
|
-
w: Math.floor(
|
|
2966
|
-
h: Math.floor(
|
|
2967
|
+
x: Math.floor(N.x * f[0] + p[0] - Y.SafeBorderPadding),
|
|
2968
|
+
y: Math.floor(N.y * f[1] + p[1] - Y.SafeBorderPadding),
|
|
2969
|
+
w: Math.floor(N.w * f[0] + 2 * Y.SafeBorderPadding),
|
|
2970
|
+
h: Math.floor(N.h * f[1] + 2 * Y.SafeBorderPadding)
|
|
2967
2971
|
};
|
|
2968
2972
|
}
|
|
2969
2973
|
computDrawPoints(t) {
|
|
@@ -2972,9 +2976,9 @@ class qs extends Y {
|
|
|
2972
2976
|
computFullArrowPoints(t) {
|
|
2973
2977
|
const e = C.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), i = C.Per(e).mul(t / 2), s = F.Sub(this.tmpPoints[0], i), n = F.Add(this.tmpPoints[0], i), r = C.Mul(e, this.arrowTipWidth), c = C.Sub(this.tmpPoints[1], r), l = F.Sub(c, i), h = F.Add(c, i), u = C.Per(e).mul(t * 1.5), d = F.Sub(c, u), p = F.Add(c, u), f = [this.tmpPoints[0], c], y = [d, this.tmpPoints[1], p], M = [s, n, ...y, l, h];
|
|
2974
2978
|
return {
|
|
2975
|
-
trianglePoints: y.map((
|
|
2979
|
+
trianglePoints: y.map((N) => F.Sub(N, this.tmpPoints[1]).XY).flat(1),
|
|
2976
2980
|
trianglePos: this.tmpPoints[1].XY,
|
|
2977
|
-
points: f.map((
|
|
2981
|
+
points: f.map((N) => F.Sub(N, this.tmpPoints[0]).XY).flat(1),
|
|
2978
2982
|
rect: Mt(M),
|
|
2979
2983
|
isTriangle: !1,
|
|
2980
2984
|
pos: this.tmpPoints[0].XY
|
|
@@ -3036,7 +3040,7 @@ class Ks extends Y {
|
|
|
3036
3040
|
super(t);
|
|
3037
3041
|
g(this, "canRotate", !1);
|
|
3038
3042
|
g(this, "scaleType", pt.all);
|
|
3039
|
-
g(this, "toolsType",
|
|
3043
|
+
g(this, "toolsType", T.Ellipse);
|
|
3040
3044
|
g(this, "tmpPoints", []);
|
|
3041
3045
|
g(this, "workOptions");
|
|
3042
3046
|
g(this, "oldRect");
|
|
@@ -3103,7 +3107,7 @@ class Ks extends Y {
|
|
|
3103
3107
|
};
|
|
3104
3108
|
}
|
|
3105
3109
|
draw(t) {
|
|
3106
|
-
const { workId: e, layer: i, isDrawing: s } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, scale: h, rotate: u, translate: d, strokeType: p, eraserlines: f } = this.workOptions, y = i.worldScaling, { radius: M, rect:
|
|
3110
|
+
const { workId: e, layer: i, isDrawing: s } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, scale: h, rotate: u, translate: d, strokeType: p, eraserlines: f } = this.workOptions, y = i.worldScaling, { radius: M, rect: N, pos: w } = this.computDrawPoints(c), m = {
|
|
3107
3111
|
pos: w,
|
|
3108
3112
|
name: e,
|
|
3109
3113
|
id: e,
|
|
@@ -3121,10 +3125,10 @@ class Ks extends Y {
|
|
|
3121
3125
|
zIndex: l,
|
|
3122
3126
|
pos: w,
|
|
3123
3127
|
anchor: [0.5, 0.5],
|
|
3124
|
-
size: [
|
|
3128
|
+
size: [N.w, N.h]
|
|
3125
3129
|
};
|
|
3126
3130
|
h && (S.scale = h), u && (S.rotate = u), d && (S.translate = d);
|
|
3127
|
-
const
|
|
3131
|
+
const I = new Wt(S);
|
|
3128
3132
|
if (s) {
|
|
3129
3133
|
const L = new ue({
|
|
3130
3134
|
d: "M-4,0H4M0,-4V4",
|
|
@@ -3134,19 +3138,19 @@ class Ks extends Y {
|
|
|
3134
3138
|
lineWidth: 1,
|
|
3135
3139
|
scale: [1 / y[0], 1 / y[1]]
|
|
3136
3140
|
});
|
|
3137
|
-
|
|
3141
|
+
I.append(L);
|
|
3138
3142
|
}
|
|
3139
3143
|
const v = new vn({
|
|
3140
3144
|
...m,
|
|
3141
3145
|
pos: [0, 0]
|
|
3142
3146
|
});
|
|
3143
|
-
|
|
3144
|
-
group:
|
|
3147
|
+
I.append(v), f && this.drawEraserlines({
|
|
3148
|
+
group: I,
|
|
3145
3149
|
eraserlines: f,
|
|
3146
3150
|
pos: w,
|
|
3147
3151
|
layer: i
|
|
3148
|
-
}), this.replace(i, e,
|
|
3149
|
-
const x =
|
|
3152
|
+
}), this.replace(i, e, I);
|
|
3153
|
+
const x = I.getBoundingClientRect();
|
|
3150
3154
|
return {
|
|
3151
3155
|
x: Math.floor(x.x - Y.SafeBorderPadding),
|
|
3152
3156
|
y: Math.floor(x.y - Y.SafeBorderPadding),
|
|
@@ -3208,7 +3212,7 @@ class _s extends Y {
|
|
|
3208
3212
|
super(t);
|
|
3209
3213
|
g(this, "canRotate", !0);
|
|
3210
3214
|
g(this, "scaleType", pt.all);
|
|
3211
|
-
g(this, "toolsType",
|
|
3215
|
+
g(this, "toolsType", T.Rectangle);
|
|
3212
3216
|
g(this, "tmpPoints", []);
|
|
3213
3217
|
g(this, "workOptions");
|
|
3214
3218
|
g(this, "oldRect");
|
|
@@ -3296,7 +3300,7 @@ class _s extends Y {
|
|
|
3296
3300
|
};
|
|
3297
3301
|
}
|
|
3298
3302
|
draw(t) {
|
|
3299
|
-
const { workId: e, layer: i, isDrawing: s, ps: n, replaceId: r } = t, { strokeColor: c, fillColor: l, thickness: h, zIndex: u, scale: d, rotate: p, translate: f, strokeType: y, eraserlines: M } = this.workOptions,
|
|
3303
|
+
const { workId: e, layer: i, isDrawing: s, ps: n, replaceId: r } = t, { strokeColor: c, fillColor: l, thickness: h, zIndex: u, scale: d, rotate: p, translate: f, strokeType: y, eraserlines: M } = this.workOptions, N = i.worldPosition, w = i.worldScaling, { points: m, rect: S, pos: I } = this.computDrawPoints(n), v = {
|
|
3300
3304
|
close: !0,
|
|
3301
3305
|
normalize: !0,
|
|
3302
3306
|
points: m,
|
|
@@ -3307,15 +3311,15 @@ class _s extends Y {
|
|
|
3307
3311
|
lineCap: "round",
|
|
3308
3312
|
lineDash: y === et.Dotted ? [1, h * 2] : y === et.LongDotted ? [h, h * 2] : void 0
|
|
3309
3313
|
}, x = {
|
|
3310
|
-
x: Math.floor(S.x * w[0] +
|
|
3311
|
-
y: Math.floor(S.y * w[1] +
|
|
3314
|
+
x: Math.floor(S.x * w[0] + N[0] - Y.SafeBorderPadding),
|
|
3315
|
+
y: Math.floor(S.y * w[1] + N[1] - Y.SafeBorderPadding),
|
|
3312
3316
|
w: Math.floor(S.w * w[0] + 2 * Y.SafeBorderPadding),
|
|
3313
3317
|
h: Math.floor(S.h * w[0] + 2 * Y.SafeBorderPadding)
|
|
3314
3318
|
}, L = new Wt({
|
|
3315
3319
|
name: e,
|
|
3316
3320
|
id: e,
|
|
3317
3321
|
zIndex: u,
|
|
3318
|
-
pos:
|
|
3322
|
+
pos: I,
|
|
3319
3323
|
anchor: [0.5, 0.5],
|
|
3320
3324
|
size: [
|
|
3321
3325
|
S.w,
|
|
@@ -3342,7 +3346,7 @@ class _s extends Y {
|
|
|
3342
3346
|
if (M && this.drawEraserlines({
|
|
3343
3347
|
group: L,
|
|
3344
3348
|
eraserlines: M,
|
|
3345
|
-
pos:
|
|
3349
|
+
pos: I,
|
|
3346
3350
|
layer: i
|
|
3347
3351
|
}), this.replace(i, r || e, L), d || p || f) {
|
|
3348
3352
|
const j = L.getBoundingClientRect();
|
|
@@ -3401,7 +3405,7 @@ class tn extends Y {
|
|
|
3401
3405
|
super(t);
|
|
3402
3406
|
g(this, "canRotate", !1);
|
|
3403
3407
|
g(this, "scaleType", pt.all);
|
|
3404
|
-
g(this, "toolsType",
|
|
3408
|
+
g(this, "toolsType", T.Star);
|
|
3405
3409
|
g(this, "tmpPoints", []);
|
|
3406
3410
|
g(this, "workOptions");
|
|
3407
3411
|
g(this, "oldRect");
|
|
@@ -3468,9 +3472,9 @@ class tn extends Y {
|
|
|
3468
3472
|
};
|
|
3469
3473
|
}
|
|
3470
3474
|
draw(t) {
|
|
3471
|
-
const { workId: e, layer: i, isDrawing: s } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, innerVerticeStep: u, innerRatio: d, scale: p, rotate: f, translate: y, strokeType: M, eraserlines:
|
|
3475
|
+
const { workId: e, layer: i, isDrawing: s } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, innerVerticeStep: u, innerRatio: d, scale: p, rotate: f, translate: y, strokeType: M, eraserlines: N } = this.workOptions, w = i.worldScaling, { rect: m, pos: S, points: I } = this.computDrawPoints(c, h, u, d), v = {
|
|
3472
3476
|
close: !0,
|
|
3473
|
-
points:
|
|
3477
|
+
points: I,
|
|
3474
3478
|
lineWidth: c,
|
|
3475
3479
|
fillColor: r !== "transparent" && r || void 0,
|
|
3476
3480
|
strokeColor: n,
|
|
@@ -3503,9 +3507,9 @@ class tn extends Y {
|
|
|
3503
3507
|
...v,
|
|
3504
3508
|
pos: [0, 0]
|
|
3505
3509
|
});
|
|
3506
|
-
L.append(A),
|
|
3510
|
+
L.append(A), N && this.drawEraserlines({
|
|
3507
3511
|
group: L,
|
|
3508
|
-
eraserlines:
|
|
3512
|
+
eraserlines: N,
|
|
3509
3513
|
pos: S,
|
|
3510
3514
|
layer: i
|
|
3511
3515
|
}), this.replace(i, e, L);
|
|
@@ -3521,8 +3525,8 @@ class tn extends Y {
|
|
|
3521
3525
|
const n = Mt(this.tmpPoints), r = [Math.floor(n.x + n.w / 2), Math.floor(n.y + n.h / 2)], c = dn(n.w, n.h), l = Math.floor(Math.min(n.w, n.h) / 2), h = s * l, u = [], d = 2 * Math.PI / e;
|
|
3522
3526
|
for (let f = 0; f < e; f++) {
|
|
3523
3527
|
const y = f * d - 0.5 * Math.PI;
|
|
3524
|
-
let M,
|
|
3525
|
-
f % i === 1 ? (M = h * c[0] * Math.cos(y),
|
|
3528
|
+
let M, N;
|
|
3529
|
+
f % i === 1 ? (M = h * c[0] * Math.cos(y), N = h * c[1] * Math.sin(y)) : (M = l * c[0] * Math.cos(y), N = l * c[1] * Math.sin(y), u.push(M, N)), u.push(M, N);
|
|
3526
3530
|
}
|
|
3527
3531
|
return {
|
|
3528
3532
|
rect: Mt(this.tmpPoints, t),
|
|
@@ -3568,7 +3572,7 @@ class tn extends Y {
|
|
|
3568
3572
|
var M;
|
|
3569
3573
|
const { node: e, opt: i, vNodes: s } = t, { strokeColor: n, fillColor: r, toolsType: c, vertices: l, innerVerticeStep: h, innerRatio: u, strokeType: d } = i, p = s.get(e.name), f = p == null ? void 0 : p.opt;
|
|
3570
3574
|
let y = e;
|
|
3571
|
-
return e.tagName === "GROUP" && (y = e.children[0]), n && (y.setAttribute("strokeColor", n), f != null && f.strokeColor && (f.strokeColor = n)), r && (r === "transparent" ? y.setAttribute("fillColor", "rgba(0,0,0,0)") : y.setAttribute("fillColor", r), f != null && f.fillColor && (f.fillColor = r)), c ===
|
|
3575
|
+
return e.tagName === "GROUP" && (y = e.children[0]), n && (y.setAttribute("strokeColor", n), f != null && f.strokeColor && (f.strokeColor = n)), r && (r === "transparent" ? y.setAttribute("fillColor", "rgba(0,0,0,0)") : y.setAttribute("fillColor", r), f != null && f.fillColor && (f.fillColor = r)), c === T.Star && (l && (f.vertices = l), h && (f.innerVerticeStep = h), u && (f.innerRatio = u)), d && (p != null && p.opt) && ((M = p.opt) != null && M.strokeType) && (p.opt.strokeType = d), p && s.setInfo(e.name, { ...p, opt: f }), Y.updateNodeOpt(t);
|
|
3572
3576
|
}
|
|
3573
3577
|
}
|
|
3574
3578
|
class en extends Y {
|
|
@@ -3576,7 +3580,7 @@ class en extends Y {
|
|
|
3576
3580
|
super(t);
|
|
3577
3581
|
g(this, "canRotate", !1);
|
|
3578
3582
|
g(this, "scaleType", pt.all);
|
|
3579
|
-
g(this, "toolsType",
|
|
3583
|
+
g(this, "toolsType", T.Polygon);
|
|
3580
3584
|
g(this, "tmpPoints", []);
|
|
3581
3585
|
g(this, "workOptions");
|
|
3582
3586
|
g(this, "oldRect");
|
|
@@ -3643,7 +3647,7 @@ class en extends Y {
|
|
|
3643
3647
|
};
|
|
3644
3648
|
}
|
|
3645
3649
|
draw(t) {
|
|
3646
|
-
const { workId: e, layer: i, isDrawing: s } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, scale: u, rotate: d, translate: p, strokeType: f, eraserlines: y } = this.workOptions, M = i.worldScaling, { rect:
|
|
3650
|
+
const { workId: e, layer: i, isDrawing: s } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, scale: u, rotate: d, translate: p, strokeType: f, eraserlines: y } = this.workOptions, M = i.worldScaling, { rect: N, pos: w, points: m } = this.computDrawPoints(c, h), S = {
|
|
3647
3651
|
close: !0,
|
|
3648
3652
|
points: m,
|
|
3649
3653
|
lineWidth: c,
|
|
@@ -3653,16 +3657,16 @@ class en extends Y {
|
|
|
3653
3657
|
lineJoin: "round",
|
|
3654
3658
|
lineCap: "round",
|
|
3655
3659
|
lineDash: f === et.Dotted ? [1, c * 2] : f === et.LongDotted ? [c, c * 2] : void 0
|
|
3656
|
-
},
|
|
3660
|
+
}, I = {
|
|
3657
3661
|
name: e,
|
|
3658
3662
|
id: e,
|
|
3659
3663
|
zIndex: l,
|
|
3660
3664
|
pos: w,
|
|
3661
3665
|
anchor: [0.5, 0.5],
|
|
3662
|
-
size: [
|
|
3666
|
+
size: [N.w, N.h]
|
|
3663
3667
|
};
|
|
3664
|
-
u && (
|
|
3665
|
-
const v = new Wt(
|
|
3668
|
+
u && (I.scale = u), d && (I.rotate = d), p && (I.translate = p);
|
|
3669
|
+
const v = new Wt(I);
|
|
3666
3670
|
if (s) {
|
|
3667
3671
|
const A = new ue({
|
|
3668
3672
|
d: "M-4,0H4M0,-4V4",
|
|
@@ -3742,7 +3746,7 @@ class en extends Y {
|
|
|
3742
3746
|
var f;
|
|
3743
3747
|
const { node: e, opt: i, vNodes: s } = t, { strokeColor: n, fillColor: r, toolsType: c, vertices: l, strokeType: h } = i, u = s.get(e.name), d = u == null ? void 0 : u.opt;
|
|
3744
3748
|
let p = e;
|
|
3745
|
-
return e.tagName === "GROUP" && (p = e.children[0]), n && (p.setAttribute("strokeColor", n), d != null && d.strokeColor && (d.strokeColor = n)), r && (r === "transparent" ? p.setAttribute("fillColor", "rgba(0,0,0,0)") : p.setAttribute("fillColor", r), d != null && d.fillColor && (d.fillColor = r)), c ===
|
|
3749
|
+
return e.tagName === "GROUP" && (p = e.children[0]), n && (p.setAttribute("strokeColor", n), d != null && d.strokeColor && (d.strokeColor = n)), r && (r === "transparent" ? p.setAttribute("fillColor", "rgba(0,0,0,0)") : p.setAttribute("fillColor", r), d != null && d.fillColor && (d.fillColor = r)), c === T.Polygon && l && (d.vertices = l), h && (u != null && u.opt) && ((f = u.opt) != null && f.strokeType) && (u.opt.strokeType = h), u && s.setInfo(e.name, { ...u, opt: d }), Y.updateNodeOpt(t);
|
|
3746
3750
|
}
|
|
3747
3751
|
}
|
|
3748
3752
|
class Kt {
|
|
@@ -3812,7 +3816,7 @@ class on extends Y {
|
|
|
3812
3816
|
super(t);
|
|
3813
3817
|
g(this, "canRotate", !1);
|
|
3814
3818
|
g(this, "scaleType", pt.all);
|
|
3815
|
-
g(this, "toolsType",
|
|
3819
|
+
g(this, "toolsType", T.SpeechBalloon);
|
|
3816
3820
|
g(this, "ratio", 0.8);
|
|
3817
3821
|
g(this, "tmpPoints", []);
|
|
3818
3822
|
g(this, "workOptions");
|
|
@@ -3884,8 +3888,8 @@ class on extends Y {
|
|
|
3884
3888
|
};
|
|
3885
3889
|
}
|
|
3886
3890
|
draw(t) {
|
|
3887
|
-
const { workId: e, layer: i } = t, { strokeColor: s, fillColor: n, thickness: r, zIndex: c, placement: l, scale: h, rotate: u, translate: d, strokeType: p, eraserlines: f } = this.workOptions, { rect: y, pos: M, points:
|
|
3888
|
-
points:
|
|
3891
|
+
const { workId: e, layer: i } = t, { strokeColor: s, fillColor: n, thickness: r, zIndex: c, placement: l, scale: h, rotate: u, translate: d, strokeType: p, eraserlines: f } = this.workOptions, { rect: y, pos: M, points: N } = this.computDrawPoints(r, l), w = {
|
|
3892
|
+
points: N.map((x) => x.XY),
|
|
3889
3893
|
lineWidth: r,
|
|
3890
3894
|
fillColor: n !== "transparent" && n || void 0,
|
|
3891
3895
|
strokeColor: s,
|
|
@@ -3904,11 +3908,11 @@ class on extends Y {
|
|
|
3904
3908
|
size: [y.w, y.h]
|
|
3905
3909
|
};
|
|
3906
3910
|
h && (m.scale = h), u && (m.rotate = u), d && (m.translate = d);
|
|
3907
|
-
const S = new Wt(m),
|
|
3911
|
+
const S = new Wt(m), I = new he({
|
|
3908
3912
|
...w,
|
|
3909
3913
|
pos: [0, 0]
|
|
3910
3914
|
});
|
|
3911
|
-
S.append(
|
|
3915
|
+
S.append(I), f && this.drawEraserlines({
|
|
3912
3916
|
group: S,
|
|
3913
3917
|
eraserlines: f,
|
|
3914
3918
|
pos: M,
|
|
@@ -3972,66 +3976,66 @@ class on extends Y {
|
|
|
3972
3976
|
}
|
|
3973
3977
|
}
|
|
3974
3978
|
computDrawPoints(t, e) {
|
|
3975
|
-
const i = Mt(this.tmpPoints), s = this.transformControlPoints(e), n = Math.floor(i.w * 0.1), r = Math.floor(i.h * 0.1), c = [], l = C.Add(s[0], new C(0, r, 0)), h = C.Add(s[0], new C(n, 0, 0)), u = Kt.getBezierPoints(10, l, s[0], h), d = C.Sub(s[1], new C(n, 0, 0)), p = C.Add(s[1], new C(0, r, 0)), f = Kt.getBezierPoints(10, d, s[1], p), y = C.Sub(s[2], new C(0, r, 0)), M = C.Sub(s[2], new C(n, 0, 0)),
|
|
3979
|
+
const i = Mt(this.tmpPoints), s = this.transformControlPoints(e), n = Math.floor(i.w * 0.1), r = Math.floor(i.h * 0.1), c = [], l = C.Add(s[0], new C(0, r, 0)), h = C.Add(s[0], new C(n, 0, 0)), u = Kt.getBezierPoints(10, l, s[0], h), d = C.Sub(s[1], new C(n, 0, 0)), p = C.Add(s[1], new C(0, r, 0)), f = Kt.getBezierPoints(10, d, s[1], p), y = C.Sub(s[2], new C(0, r, 0)), M = C.Sub(s[2], new C(n, 0, 0)), N = Kt.getBezierPoints(10, y, s[2], M), w = C.Add(s[3], new C(n, 0, 0)), m = C.Sub(s[3], new C(0, r, 0)), S = Kt.getBezierPoints(10, w, s[3], m), I = n * (1 - this.ratio) * 10, v = r * (1 - this.ratio) * 10;
|
|
3976
3980
|
switch (e) {
|
|
3977
3981
|
case "bottom": {
|
|
3978
|
-
const A = C.Sub(s[2], new C(n * 5 -
|
|
3979
|
-
c.push(j, D, ...S, ...u, ...f, ...
|
|
3982
|
+
const A = C.Sub(s[2], new C(n * 5 - I / 2, 0, 0)), j = C.Sub(s[2], new C(n * 5, -v, 0)), D = C.Sub(s[2], new C(n * 5 + I / 2, 0, 0));
|
|
3983
|
+
c.push(j, D, ...S, ...u, ...f, ...N, A);
|
|
3980
3984
|
break;
|
|
3981
3985
|
}
|
|
3982
3986
|
case "bottomRight": {
|
|
3983
|
-
const A = C.Sub(s[2], new C(n * 1.1, 0, 0)), j = C.Sub(s[2], new C(n * 1.1 +
|
|
3984
|
-
c.push(j, D, ...S, ...u, ...f, ...
|
|
3987
|
+
const A = C.Sub(s[2], new C(n * 1.1, 0, 0)), j = C.Sub(s[2], new C(n * 1.1 + I / 2, -v, 0)), D = C.Sub(s[2], new C(n * 1.1 + I, 0, 0));
|
|
3988
|
+
c.push(j, D, ...S, ...u, ...f, ...N, A);
|
|
3985
3989
|
break;
|
|
3986
3990
|
}
|
|
3987
3991
|
case "bottomLeft": {
|
|
3988
|
-
const A = C.Add(s[3], new C(n * 1.1 +
|
|
3989
|
-
c.push(j, D, ...S, ...u, ...f, ...
|
|
3992
|
+
const A = C.Add(s[3], new C(n * 1.1 + I, 0, 0)), j = C.Add(s[3], new C(n * 1.1 + I / 2, v, 0)), D = C.Add(s[3], new C(n * 1.1, 0, 0));
|
|
3993
|
+
c.push(j, D, ...S, ...u, ...f, ...N, A);
|
|
3990
3994
|
break;
|
|
3991
3995
|
}
|
|
3992
3996
|
case "top": {
|
|
3993
|
-
const A = C.Sub(s[1], new C(n * 5 -
|
|
3994
|
-
c.push(j, A, ...f, ...
|
|
3997
|
+
const A = C.Sub(s[1], new C(n * 5 - I / 2, 0, 0)), j = C.Sub(s[1], new C(n * 5, v, 0)), D = C.Sub(s[1], new C(n * 5 + I / 2, 0, 0));
|
|
3998
|
+
c.push(j, A, ...f, ...N, ...S, ...u, D);
|
|
3995
3999
|
break;
|
|
3996
4000
|
}
|
|
3997
4001
|
case "topRight": {
|
|
3998
|
-
const A = C.Sub(s[1], new C(n * 1.1, 0, 0)), j = C.Sub(s[1], new C(n * 1.1 +
|
|
3999
|
-
c.push(j, A, ...f, ...
|
|
4002
|
+
const A = C.Sub(s[1], new C(n * 1.1, 0, 0)), j = C.Sub(s[1], new C(n * 1.1 + I / 2, v, 0)), D = C.Sub(s[1], new C(n * 1.1 + I, 0, 0));
|
|
4003
|
+
c.push(j, A, ...f, ...N, ...S, ...u, D);
|
|
4000
4004
|
break;
|
|
4001
4005
|
}
|
|
4002
4006
|
case "topLeft": {
|
|
4003
|
-
const A = C.Add(s[0], new C(n * 1.1 +
|
|
4004
|
-
c.push(j, A, ...f, ...
|
|
4007
|
+
const A = C.Add(s[0], new C(n * 1.1 + I, 0, 0)), j = C.Add(s[0], new C(n * 1.1 + I / 2, -v, 0)), D = C.Add(s[0], new C(n * 1.1, 0, 0));
|
|
4008
|
+
c.push(j, A, ...f, ...N, ...S, ...u, D);
|
|
4005
4009
|
break;
|
|
4006
4010
|
}
|
|
4007
4011
|
case "left": {
|
|
4008
|
-
const A = C.Add(s[0], new C(0, r * 5 - v / 2, 0)), j = C.Add(s[0], new C(-
|
|
4009
|
-
c.push(j, A, ...u, ...f, ...
|
|
4012
|
+
const A = C.Add(s[0], new C(0, r * 5 - v / 2, 0)), j = C.Add(s[0], new C(-I, r * 5, 0)), D = C.Add(s[0], new C(0, r * 5 + v / 2, 0));
|
|
4013
|
+
c.push(j, A, ...u, ...f, ...N, ...S, D);
|
|
4010
4014
|
break;
|
|
4011
4015
|
}
|
|
4012
4016
|
case "leftTop": {
|
|
4013
|
-
const A = C.Add(s[0], new C(0, r * 1.1, 0)), j = C.Add(s[0], new C(-
|
|
4014
|
-
c.push(j, A, ...u, ...f, ...
|
|
4017
|
+
const A = C.Add(s[0], new C(0, r * 1.1, 0)), j = C.Add(s[0], new C(-I, r * 1.1 + v / 2, 0)), D = C.Add(s[0], new C(0, r * 1.1 + v, 0));
|
|
4018
|
+
c.push(j, A, ...u, ...f, ...N, ...S, D);
|
|
4015
4019
|
break;
|
|
4016
4020
|
}
|
|
4017
4021
|
case "leftBottom": {
|
|
4018
|
-
const A = C.Sub(s[3], new C(0, r * 1.1 + v, 0)), j = C.Sub(s[3], new C(
|
|
4019
|
-
c.push(j, A, ...u, ...f, ...
|
|
4022
|
+
const A = C.Sub(s[3], new C(0, r * 1.1 + v, 0)), j = C.Sub(s[3], new C(I, r * 1.1 + v / 2, 0)), D = C.Sub(s[3], new C(0, r * 1.1, 0));
|
|
4023
|
+
c.push(j, A, ...u, ...f, ...N, ...S, D);
|
|
4020
4024
|
break;
|
|
4021
4025
|
}
|
|
4022
4026
|
case "right": {
|
|
4023
|
-
const A = C.Add(s[1], new C(0, r * 5 - v / 2, 0)), j = C.Add(s[1], new C(
|
|
4024
|
-
c.push(j, D, ...
|
|
4027
|
+
const A = C.Add(s[1], new C(0, r * 5 - v / 2, 0)), j = C.Add(s[1], new C(I, r * 5, 0)), D = C.Add(s[1], new C(0, r * 5 + v / 2, 0));
|
|
4028
|
+
c.push(j, D, ...N, ...S, ...u, ...f, A);
|
|
4025
4029
|
break;
|
|
4026
4030
|
}
|
|
4027
4031
|
case "rightTop": {
|
|
4028
|
-
const A = C.Add(s[1], new C(0, r * 1.1, 0)), j = C.Add(s[1], new C(
|
|
4029
|
-
c.push(j, D, ...
|
|
4032
|
+
const A = C.Add(s[1], new C(0, r * 1.1, 0)), j = C.Add(s[1], new C(I, r * 1.1 + v / 2, 0)), D = C.Add(s[1], new C(0, r * 1.1 + v, 0));
|
|
4033
|
+
c.push(j, D, ...N, ...S, ...u, ...f, A);
|
|
4030
4034
|
break;
|
|
4031
4035
|
}
|
|
4032
4036
|
case "rightBottom": {
|
|
4033
|
-
const A = C.Sub(s[2], new C(0, r * 1.1 + v, 0)), j = C.Sub(s[2], new C(-
|
|
4034
|
-
c.push(j, D, ...
|
|
4037
|
+
const A = C.Sub(s[2], new C(0, r * 1.1 + v, 0)), j = C.Sub(s[2], new C(-I, r * 1.1 + v / 2, 0)), D = C.Sub(s[2], new C(0, r * 1.1, 0));
|
|
4038
|
+
c.push(j, D, ...N, ...S, ...u, ...f, A);
|
|
4035
4039
|
break;
|
|
4036
4040
|
}
|
|
4037
4041
|
}
|
|
@@ -4080,7 +4084,7 @@ class on extends Y {
|
|
|
4080
4084
|
var f;
|
|
4081
4085
|
const { node: e, opt: i, vNodes: s } = t, { strokeColor: n, fillColor: r, toolsType: c, placement: l, strokeType: h } = i, u = s.get(e.name), d = u == null ? void 0 : u.opt;
|
|
4082
4086
|
let p = e;
|
|
4083
|
-
return e.tagName === "GROUP" && (p = e.children[0]), n && (p.setAttribute("strokeColor", n), d != null && d.strokeColor && (d.strokeColor = n)), r && (r === "transparent" ? p.setAttribute("fillColor", "rgba(0,0,0,0)") : p.setAttribute("fillColor", r), d != null && d.fillColor && (d.fillColor = r)), c ===
|
|
4087
|
+
return e.tagName === "GROUP" && (p = e.children[0]), n && (p.setAttribute("strokeColor", n), d != null && d.strokeColor && (d.strokeColor = n)), r && (r === "transparent" ? p.setAttribute("fillColor", "rgba(0,0,0,0)") : p.setAttribute("fillColor", r), d != null && d.fillColor && (d.fillColor = r)), c === T.SpeechBalloon && l && (d.placement = l), h && (u != null && u.opt) && ((f = u.opt) != null && f.strokeType) && (u.opt.strokeType = h), u && s.setInfo(e.name, { ...u, opt: d }), Y.updateNodeOpt(t);
|
|
4084
4088
|
}
|
|
4085
4089
|
}
|
|
4086
4090
|
var hg = me, ug = se, dg = "[object Boolean]";
|
|
@@ -4094,7 +4098,7 @@ class sn extends Y {
|
|
|
4094
4098
|
super(t);
|
|
4095
4099
|
g(this, "canRotate", !1);
|
|
4096
4100
|
g(this, "scaleType", pt.both);
|
|
4097
|
-
g(this, "toolsType",
|
|
4101
|
+
g(this, "toolsType", T.Straight);
|
|
4098
4102
|
g(this, "tmpPoints", []);
|
|
4099
4103
|
g(this, "workOptions");
|
|
4100
4104
|
g(this, "oldRect");
|
|
@@ -4162,7 +4166,7 @@ class sn extends Y {
|
|
|
4162
4166
|
};
|
|
4163
4167
|
}
|
|
4164
4168
|
draw(t) {
|
|
4165
|
-
const { workId: e, layer: i } = t, { strokeColor: s, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, p = i.worldPosition, f = i.worldScaling, { d: y, rect: M, isDot:
|
|
4169
|
+
const { workId: e, layer: i } = t, { strokeColor: s, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, p = i.worldPosition, f = i.worldScaling, { d: y, rect: M, isDot: N } = this.computDrawPoints(n, u), w = [
|
|
4166
4170
|
M.x + M.w / 2,
|
|
4167
4171
|
M.y + M.h / 2
|
|
4168
4172
|
], m = new Wt({
|
|
@@ -4179,19 +4183,19 @@ class sn extends Y {
|
|
|
4179
4183
|
d: y,
|
|
4180
4184
|
fillColor: s,
|
|
4181
4185
|
strokeColor: s,
|
|
4182
|
-
lineDash: u === et.Dotted && !
|
|
4183
|
-
lineCap: u === et.Normal ||
|
|
4184
|
-
lineWidth: u === et.Normal ||
|
|
4186
|
+
lineDash: u === et.Dotted && !N ? [1, n * 2] : u === et.LongDotted && !N ? [n, n * 2] : void 0,
|
|
4187
|
+
lineCap: u === et.Normal || N ? void 0 : "round",
|
|
4188
|
+
lineWidth: u === et.Normal || N ? 0 : n
|
|
4185
4189
|
};
|
|
4186
4190
|
c && (S.scale = c), l && (S.rotate = l), h && (S.translate = h);
|
|
4187
|
-
const
|
|
4188
|
-
if (m.append(
|
|
4191
|
+
const I = new ue(S);
|
|
4192
|
+
if (m.append(I), d && this.drawEraserlines({
|
|
4189
4193
|
group: m,
|
|
4190
4194
|
eraserlines: d,
|
|
4191
4195
|
pos: w,
|
|
4192
4196
|
layer: i
|
|
4193
4197
|
}), this.replace(i, e, m), l || c || h) {
|
|
4194
|
-
const x =
|
|
4198
|
+
const x = I.getBoundingClientRect();
|
|
4195
4199
|
return {
|
|
4196
4200
|
x: Math.floor(x.x - Y.SafeBorderPadding),
|
|
4197
4201
|
y: Math.floor(x.y - Y.SafeBorderPadding),
|
|
@@ -4275,7 +4279,7 @@ const ae = class ae extends Y {
|
|
|
4275
4279
|
super(t);
|
|
4276
4280
|
g(this, "canRotate", !1);
|
|
4277
4281
|
g(this, "scaleType", pt.proportional);
|
|
4278
|
-
g(this, "toolsType",
|
|
4282
|
+
g(this, "toolsType", T.Text);
|
|
4279
4283
|
g(this, "tmpPoints", []);
|
|
4280
4284
|
g(this, "workOptions");
|
|
4281
4285
|
g(this, "oldRect");
|
|
@@ -4316,8 +4320,8 @@ const ae = class ae extends Y {
|
|
|
4316
4320
|
h: Math.floor(f.h * u[1]) + 2
|
|
4317
4321
|
};
|
|
4318
4322
|
if (this.replace(i, e, p), s && i && this.workOptions.text) {
|
|
4319
|
-
const M = await ae.createLabels(this.workOptions, i, y), { labels:
|
|
4320
|
-
p.append(...
|
|
4323
|
+
const M = await ae.createLabels(this.workOptions, i, y), { labels: N, maxWidth: w } = M;
|
|
4324
|
+
p.append(...N), y.w = Math.ceil(Math.max(w * i.worldScaling[0], y.w));
|
|
4321
4325
|
}
|
|
4322
4326
|
return l && this.drawEraserlines({
|
|
4323
4327
|
group: p,
|
|
@@ -4382,7 +4386,7 @@ const ae = class ae extends Y {
|
|
|
4382
4386
|
}
|
|
4383
4387
|
static async createLabels(t, e, i) {
|
|
4384
4388
|
var D;
|
|
4385
|
-
const s = [], { x: n, y: r } = i, { width: c, height: l } = (D = e.parent) == null ? void 0 : D.parent, h = Ie(t.text), u = h.length, { fontSize: d, lineHeight: p, bold: f, textAlign: y, italic: M, fontFamily:
|
|
4389
|
+
const s = [], { x: n, y: r } = i, { width: c, height: l } = (D = e.parent) == null ? void 0 : D.parent, h = Ie(t.text), u = h.length, { fontSize: d, lineHeight: p, bold: f, textAlign: y, italic: M, fontFamily: N, verticalAlign: w, fontColor: m, fontBgColor: S, underline: I, lineThrough: v } = t, x = ae.getSafetySnippetRatio(e) || 1, L = Math.floor(d * x), A = ae.getSafetySnippetFontLength(L);
|
|
4386
4390
|
let j = 0;
|
|
4387
4391
|
for (let O = 0; O < u; O++) {
|
|
4388
4392
|
const z = h[O], E = p || L * 1.5;
|
|
@@ -4401,7 +4405,7 @@ const ae = class ae extends Y {
|
|
|
4401
4405
|
anchor: [0, 0],
|
|
4402
4406
|
pos: Z,
|
|
4403
4407
|
text: it,
|
|
4404
|
-
fontFamily:
|
|
4408
|
+
fontFamily: N,
|
|
4405
4409
|
fontSize: L,
|
|
4406
4410
|
lineHeight: E,
|
|
4407
4411
|
strokeColor: m,
|
|
@@ -4424,7 +4428,7 @@ const ae = class ae extends Y {
|
|
|
4424
4428
|
H[0] = G, M === "italic" && (H[0] = H[0] + Q * d), j = Math.max(j, H[0]);
|
|
4425
4429
|
let bt = !0;
|
|
4426
4430
|
if (((tt[0] + H[0]) * e.worldScaling[0] + n <= 0 || tt[0] * e.worldScaling[0] + n >= c || (tt[1] + H[1]) * e.worldScaling[0] + r <= 0 || tt[1] * e.worldScaling[1] + r >= l) && (bt = !1), bt) {
|
|
4427
|
-
if (
|
|
4431
|
+
if (I) {
|
|
4428
4432
|
const J = Math.floor(d / 10), V = {
|
|
4429
4433
|
normalize: !1,
|
|
4430
4434
|
pos: [0, d * 1.1 + J / 2],
|
|
@@ -4470,7 +4474,7 @@ const ae = class ae extends Y {
|
|
|
4470
4474
|
italic: f,
|
|
4471
4475
|
lineThrough: y,
|
|
4472
4476
|
underline: M,
|
|
4473
|
-
fontSize:
|
|
4477
|
+
fontSize: N,
|
|
4474
4478
|
textInfos: w,
|
|
4475
4479
|
zIndex: m
|
|
4476
4480
|
} = i, S = n && zt(n) || s.get(e.name);
|
|
@@ -4482,21 +4486,21 @@ const ae = class ae extends Y {
|
|
|
4482
4486
|
});
|
|
4483
4487
|
})), r && v.fontBgColor && (v.fontBgColor = r, e.children.forEach((x) => {
|
|
4484
4488
|
x.tagName === "GROUP" && x.setAttribute("bgcolor", r);
|
|
4485
|
-
})), p && (v.bold = p), f && (v.italic = f), Ce(y) && (v.lineThrough = y), Ce(M) && (v.underline = M),
|
|
4489
|
+
})), p && (v.bold = p), f && (v.italic = f), Ce(y) && (v.lineThrough = y), Ce(M) && (v.underline = M), N && (v.fontSize = N), h && u && d && n && v.boxPoint) {
|
|
4486
4490
|
const x = w == null ? void 0 : w.get(e.name);
|
|
4487
4491
|
if (x) {
|
|
4488
4492
|
const { fontSize: D, boxSize: O } = x;
|
|
4489
4493
|
v.boxSize = O || v.boxSize, v.fontSize = D || v.fontSize;
|
|
4490
4494
|
}
|
|
4491
4495
|
const L = [v.boxPoint[0], v.boxPoint[1]];
|
|
4492
|
-
|
|
4496
|
+
pi(v.boxPoint, u, d, l);
|
|
4493
4497
|
const A = [S.op[0], S.op[1]], j = [A[0] - L[0], A[1] - L[1]];
|
|
4494
4498
|
if (S.centerPos = [S.centerPos[0] + j[0], S.centerPos[1] + j[1]], S.opt.eraserlines)
|
|
4495
4499
|
for (const D of Object.values(S.opt.eraserlines)) {
|
|
4496
4500
|
const { op: O, thickness: z } = D;
|
|
4497
4501
|
D.thickness = z * Math.max(d[0], d[1]);
|
|
4498
4502
|
for (let E = 0; E < O.length; E++)
|
|
4499
|
-
|
|
4503
|
+
fi(O[E], u, d, l);
|
|
4500
4504
|
}
|
|
4501
4505
|
} else if (l && v.boxPoint && (v.boxPoint = [v.boxPoint[0] + l[0], v.boxPoint[1] + l[1]], S.centerPos = [S.centerPos[0] + l[0], S.centerPos[1] + l[1]], S.opt.eraserlines))
|
|
4502
4506
|
for (const x of Object.values(S.opt.eraserlines)) {
|
|
@@ -4540,7 +4544,7 @@ const be = class be extends Y {
|
|
|
4540
4544
|
super(t);
|
|
4541
4545
|
g(this, "canRotate", !1);
|
|
4542
4546
|
g(this, "scaleType", pt.none);
|
|
4543
|
-
g(this, "toolsType",
|
|
4547
|
+
g(this, "toolsType", T.PencilEraser);
|
|
4544
4548
|
g(this, "serviceWork");
|
|
4545
4549
|
g(this, "tmpPoints", []);
|
|
4546
4550
|
g(this, "workOptions");
|
|
@@ -4596,8 +4600,8 @@ const be = class be extends Y {
|
|
|
4596
4600
|
if (p !== -1 && p > -1) {
|
|
4597
4601
|
const f = [], y = d.slice(0, p + 1);
|
|
4598
4602
|
if (C.Equals(d[p], l[0]) || y.push(l[0].clone().setz(d[p].z)), y.length > 1 && f.push(y), p + l.length - 1 < d.length - 1) {
|
|
4599
|
-
const M = p + l.length - 1,
|
|
4600
|
-
C.Equals(d[M], w) ||
|
|
4603
|
+
const M = p + l.length - 1, N = d.slice(M), w = l[l.length - 1];
|
|
4604
|
+
C.Equals(d[M], w) || N.unshift(w.clone().setz(d[M].z)), N.length > 1 && f.push(N);
|
|
4601
4605
|
}
|
|
4602
4606
|
return h.splice(u, 1, ...f), h;
|
|
4603
4607
|
}
|
|
@@ -4626,7 +4630,7 @@ const be = class be extends Y {
|
|
|
4626
4630
|
return e;
|
|
4627
4631
|
}
|
|
4628
4632
|
isLineEraser(t, e) {
|
|
4629
|
-
return !(t ===
|
|
4633
|
+
return !(t === T.Pencil && !e);
|
|
4630
4634
|
}
|
|
4631
4635
|
remove(t) {
|
|
4632
4636
|
const { curNodeMap: e, removeIds: i, newWorkDatas: s } = t;
|
|
@@ -4643,11 +4647,11 @@ const be = class be extends Y {
|
|
|
4643
4647
|
if (p.length > 1) {
|
|
4644
4648
|
const y = Go.polyline(p.map((M) => M.XY), this.eraserPolyline);
|
|
4645
4649
|
if (y.length && (i.add(c.name), !u)) {
|
|
4646
|
-
const M = this.translateIntersect(y),
|
|
4647
|
-
for (let w = 0; w <
|
|
4650
|
+
const M = this.translateIntersect(y), N = this.cutPolyline(M, p);
|
|
4651
|
+
for (let w = 0; w < N.length; w++) {
|
|
4648
4652
|
const m = `${r}_s_${w}`, S = [];
|
|
4649
|
-
|
|
4650
|
-
S.push((
|
|
4653
|
+
N[w].forEach((I) => {
|
|
4654
|
+
S.push((I.x - this.worldPosition[0]) / this.worldScaling[0], (I.y - this.worldPosition[1]) / this.worldScaling[1], I.z);
|
|
4651
4655
|
}), c.opt && c.toolsType && this.vNodes && (this.vNodes.setInfo(m, {
|
|
4652
4656
|
rect: f,
|
|
4653
4657
|
op: S,
|
|
@@ -4750,7 +4754,7 @@ const He = class He extends Y {
|
|
|
4750
4754
|
super(t);
|
|
4751
4755
|
g(this, "canRotate", !1);
|
|
4752
4756
|
g(this, "scaleType", pt.none);
|
|
4753
|
-
g(this, "toolsType",
|
|
4757
|
+
g(this, "toolsType", T.BitMapEraser);
|
|
4754
4758
|
g(this, "tmpPoints", []);
|
|
4755
4759
|
g(this, "workOptions");
|
|
4756
4760
|
g(this, "worldPosition");
|
|
@@ -4825,10 +4829,10 @@ const He = class He extends Y {
|
|
|
4825
4829
|
Go.polyline(M, d, p);
|
|
4826
4830
|
if (p.length && h.opt)
|
|
4827
4831
|
for (const M of p) {
|
|
4828
|
-
const
|
|
4832
|
+
const N = [];
|
|
4829
4833
|
for (let w = 0; w < M.length; w++)
|
|
4830
|
-
w !== 0 && we(M[w], M[w - 1]) ||
|
|
4831
|
-
f.push(
|
|
4834
|
+
w !== 0 && we(M[w], M[w - 1]) || N.push(...M[w]);
|
|
4835
|
+
f.push(N);
|
|
4832
4836
|
}
|
|
4833
4837
|
h.opt.eraserlines || (h.opt.eraserlines = []), h.opt.eraserlines && (h.opt.eraserlines.push({ op: f, thickness: t }), c.set(l, h));
|
|
4834
4838
|
}
|
|
@@ -4845,13 +4849,13 @@ const He = class He extends Y {
|
|
|
4845
4849
|
});
|
|
4846
4850
|
l == null || l.setWorkId(n);
|
|
4847
4851
|
let h;
|
|
4848
|
-
if (c ===
|
|
4852
|
+
if (c === T.Image)
|
|
4849
4853
|
h = await l.consumeServiceAsync({
|
|
4850
4854
|
isFullWork: !0,
|
|
4851
4855
|
replaceId: n,
|
|
4852
4856
|
worker: s
|
|
4853
4857
|
});
|
|
4854
|
-
else if (c ===
|
|
4858
|
+
else if (c === T.Text)
|
|
4855
4859
|
h = await l.consumeServiceAsync({
|
|
4856
4860
|
isFullWork: !0,
|
|
4857
4861
|
replaceId: n
|
|
@@ -4890,8 +4894,8 @@ const He = class He extends Y {
|
|
|
4890
4894
|
const f = this.tmpPoints.slice(h), y = this.draw({ consumePoints: f, layer: this.fullLayer, thickness: r });
|
|
4891
4895
|
f[0].t - this.syncTimestamp > this.syncUnitTime && (p = !0, this.syncTimestamp = f[0].t, this.syncIndex = this.tmpPoints.length);
|
|
4892
4896
|
const M = [];
|
|
4893
|
-
return this.tmpPoints.slice(d).forEach((
|
|
4894
|
-
M.push(
|
|
4897
|
+
return this.tmpPoints.slice(d).forEach((N) => {
|
|
4898
|
+
M.push(N.x, N.y, r / 2);
|
|
4895
4899
|
}), {
|
|
4896
4900
|
...this.baseConsumeResult,
|
|
4897
4901
|
type: b.DrawWork,
|
|
@@ -4972,74 +4976,74 @@ g(He, "eraserSizes", Object.freeze([
|
|
|
4972
4976
|
let po = He;
|
|
4973
4977
|
function nn(a) {
|
|
4974
4978
|
switch (a) {
|
|
4975
|
-
case
|
|
4979
|
+
case T.Arrow:
|
|
4976
4980
|
return qs;
|
|
4977
|
-
case
|
|
4981
|
+
case T.Pencil:
|
|
4978
4982
|
return Gs;
|
|
4979
|
-
case
|
|
4983
|
+
case T.Straight:
|
|
4980
4984
|
return sn;
|
|
4981
|
-
case
|
|
4985
|
+
case T.Ellipse:
|
|
4982
4986
|
return Ks;
|
|
4983
|
-
case
|
|
4984
|
-
case
|
|
4987
|
+
case T.Polygon:
|
|
4988
|
+
case T.Triangle:
|
|
4985
4989
|
return en;
|
|
4986
|
-
case
|
|
4987
|
-
case
|
|
4990
|
+
case T.Star:
|
|
4991
|
+
case T.Rhombus:
|
|
4988
4992
|
return tn;
|
|
4989
|
-
case
|
|
4993
|
+
case T.Rectangle:
|
|
4990
4994
|
return _s;
|
|
4991
|
-
case
|
|
4995
|
+
case T.SpeechBalloon:
|
|
4992
4996
|
return on;
|
|
4993
|
-
case
|
|
4997
|
+
case T.Text:
|
|
4994
4998
|
return ho;
|
|
4995
|
-
case
|
|
4999
|
+
case T.LaserPen:
|
|
4996
5000
|
return Zs;
|
|
4997
|
-
case
|
|
5001
|
+
case T.Eraser:
|
|
4998
5002
|
return ao;
|
|
4999
|
-
case
|
|
5003
|
+
case T.PencilEraser:
|
|
5000
5004
|
return uo;
|
|
5001
|
-
case
|
|
5005
|
+
case T.BitMapEraser:
|
|
5002
5006
|
return po;
|
|
5003
|
-
case
|
|
5007
|
+
case T.Selector:
|
|
5004
5008
|
return lo;
|
|
5005
|
-
case
|
|
5009
|
+
case T.Image:
|
|
5006
5010
|
return Qe;
|
|
5007
5011
|
}
|
|
5008
5012
|
}
|
|
5009
|
-
function
|
|
5013
|
+
function hi(a, o) {
|
|
5010
5014
|
const { toolsType: t, ...e } = a;
|
|
5011
5015
|
switch (t) {
|
|
5012
|
-
case
|
|
5016
|
+
case T.Arrow:
|
|
5013
5017
|
return new qs(e);
|
|
5014
|
-
case
|
|
5018
|
+
case T.Pencil:
|
|
5015
5019
|
return new Gs(e);
|
|
5016
|
-
case
|
|
5020
|
+
case T.Straight:
|
|
5017
5021
|
return new sn(e);
|
|
5018
|
-
case
|
|
5022
|
+
case T.Ellipse:
|
|
5019
5023
|
return new Ks(e);
|
|
5020
|
-
case
|
|
5021
|
-
case
|
|
5024
|
+
case T.Polygon:
|
|
5025
|
+
case T.Triangle:
|
|
5022
5026
|
return new en(e);
|
|
5023
|
-
case
|
|
5024
|
-
case
|
|
5027
|
+
case T.Star:
|
|
5028
|
+
case T.Rhombus:
|
|
5025
5029
|
return new tn(e);
|
|
5026
|
-
case
|
|
5030
|
+
case T.Rectangle:
|
|
5027
5031
|
return new _s(e);
|
|
5028
|
-
case
|
|
5032
|
+
case T.SpeechBalloon:
|
|
5029
5033
|
return new on(e);
|
|
5030
|
-
case
|
|
5034
|
+
case T.Text:
|
|
5031
5035
|
return new ho(e);
|
|
5032
|
-
case
|
|
5036
|
+
case T.LaserPen:
|
|
5033
5037
|
return new Zs(e);
|
|
5034
|
-
case
|
|
5038
|
+
case T.Eraser:
|
|
5035
5039
|
return new ao(e, o);
|
|
5036
|
-
case
|
|
5040
|
+
case T.BitMapEraser:
|
|
5037
5041
|
return new po(e);
|
|
5038
|
-
case
|
|
5042
|
+
case T.PencilEraser:
|
|
5039
5043
|
return new uo(e, o);
|
|
5040
|
-
case
|
|
5044
|
+
case T.Selector:
|
|
5041
5045
|
return e.vNodes ? new lo({ ...e, vNodes: e.vNodes, drawLayer: e.fullLayer }) : void 0;
|
|
5042
|
-
case
|
|
5046
|
+
case T.Image:
|
|
5043
5047
|
return new Qe(e);
|
|
5044
5048
|
default:
|
|
5045
5049
|
return;
|
|
@@ -5054,7 +5058,7 @@ function rn(a) {
|
|
|
5054
5058
|
}
|
|
5055
5059
|
return o;
|
|
5056
5060
|
}
|
|
5057
|
-
const Qm = "cursorhover",
|
|
5061
|
+
const Qm = "cursorhover", ui = 20, yt = "mainView";
|
|
5058
5062
|
class gg {
|
|
5059
5063
|
constructor(o, t) {
|
|
5060
5064
|
g(this, "viewId");
|
|
@@ -5088,7 +5092,7 @@ class gg {
|
|
|
5088
5092
|
getCanEraserNodes(o) {
|
|
5089
5093
|
const t = /* @__PURE__ */ new Map();
|
|
5090
5094
|
for (const [e, i] of o.entries())
|
|
5091
|
-
i.toolsType ===
|
|
5095
|
+
i.toolsType === T.Image && i.opt.locked || i.toolsType === T.Text && (i.opt.workState === P.Doing || i.opt.workState === P.Start) || this.isCanClearWorkId(e) && t.set(e, i);
|
|
5092
5096
|
return t;
|
|
5093
5097
|
}
|
|
5094
5098
|
getNodesByType(o) {
|
|
@@ -5127,7 +5131,7 @@ class gg {
|
|
|
5127
5131
|
const s = /* @__PURE__ */ new Map();
|
|
5128
5132
|
for (const [n, r] of this.curNodeMap.entries())
|
|
5129
5133
|
if (Ge(o, r.rect)) {
|
|
5130
|
-
if (t && r.toolsType ===
|
|
5134
|
+
if (t && r.toolsType === T.Image && r.opt.locked || e && r.toolsType === T.Text && (r.opt.workState === P.Doing || r.opt.workState === P.Start))
|
|
5131
5135
|
continue;
|
|
5132
5136
|
i = lt(i, r.rect), s.set(n, r);
|
|
5133
5137
|
}
|
|
@@ -5316,14 +5320,14 @@ class yg {
|
|
|
5316
5320
|
}
|
|
5317
5321
|
async loadImageBitMap(o) {
|
|
5318
5322
|
const { toolsType: t, opt: e, workId: i, isSubWorker: s } = o;
|
|
5319
|
-
if (t ===
|
|
5323
|
+
if (t === T.Image && e && i) {
|
|
5320
5324
|
const n = i.toString(), { src: r, type: c, width: l, height: h, strokeColor: u } = e;
|
|
5321
5325
|
if (!r || !c || !l || !h)
|
|
5322
5326
|
return;
|
|
5323
5327
|
let d = r;
|
|
5324
5328
|
if (c === ze.Iconify) {
|
|
5325
|
-
const [M,
|
|
5326
|
-
d = `${r}?width=${M}&height=${
|
|
5329
|
+
const [M, N] = this.getIconSize(l, h, this.dpr);
|
|
5330
|
+
d = `${r}?width=${M}&height=${N}&color=${u}`;
|
|
5327
5331
|
}
|
|
5328
5332
|
if (this.cacheImages.has(d)) {
|
|
5329
5333
|
const M = this.getCachedImages(d);
|
|
@@ -5336,14 +5340,14 @@ class yg {
|
|
|
5336
5340
|
return M;
|
|
5337
5341
|
}
|
|
5338
5342
|
const y = await new Promise((M) => {
|
|
5339
|
-
const
|
|
5343
|
+
const N = this.imageResolveMap.get(d) || {
|
|
5340
5344
|
resolve: void 0,
|
|
5341
5345
|
timer: void 0
|
|
5342
5346
|
};
|
|
5343
|
-
|
|
5347
|
+
N.timer && clearTimeout(N.timer), N.resolve = M, N.timer = setTimeout(() => {
|
|
5344
5348
|
const w = this.imageResolveMap.get(d);
|
|
5345
5349
|
w != null && w.resolve && w.resolve(d);
|
|
5346
|
-
}, 5e3), this.imageResolveMap.set(d,
|
|
5350
|
+
}, 5e3), this.imageResolveMap.set(d, N), this._post({
|
|
5347
5351
|
sp: [{
|
|
5348
5352
|
imageSrc: d,
|
|
5349
5353
|
workId: n,
|
|
@@ -5391,7 +5395,7 @@ class yg {
|
|
|
5391
5395
|
createScene(o) {
|
|
5392
5396
|
const { width: t, height: e } = o, i = new OffscreenCanvas(t, e);
|
|
5393
5397
|
o.contextType && delete o.contextType;
|
|
5394
|
-
const s = new
|
|
5398
|
+
const s = new ys({
|
|
5395
5399
|
container: i,
|
|
5396
5400
|
displayRatio: this.dpr,
|
|
5397
5401
|
depth: !1,
|
|
@@ -5551,7 +5555,7 @@ class Mg {
|
|
|
5551
5555
|
}
|
|
5552
5556
|
createWorkShapeNode(o) {
|
|
5553
5557
|
var t;
|
|
5554
|
-
return
|
|
5558
|
+
return hi({ ...o, vNodes: this.vNodes, fullLayer: this.fullLayer, drawLayer: this.drawLayer }, (t = this.thread) == null ? void 0 : t.serviceWork);
|
|
5555
5559
|
}
|
|
5556
5560
|
setToolsOpt(o) {
|
|
5557
5561
|
var t, e, i;
|
|
@@ -5596,34 +5600,34 @@ var xg = Cg, bg = me, Lg = se, zg = "[object Symbol]";
|
|
|
5596
5600
|
function Pg(a) {
|
|
5597
5601
|
return typeof a == "symbol" || Lg(a) && bg(a) == zg;
|
|
5598
5602
|
}
|
|
5599
|
-
var Dg = Pg, Ag = xg,
|
|
5603
|
+
var Dg = Pg, Ag = xg, es = de, jg = Dg, os = NaN, Eg = /^[-+]0x[0-9a-f]+$/i, Og = /^0b[01]+$/i, Rg = /^0o[0-7]+$/i, Yg = parseInt;
|
|
5600
5604
|
function Wg(a) {
|
|
5601
5605
|
if (typeof a == "number")
|
|
5602
5606
|
return a;
|
|
5603
5607
|
if (jg(a))
|
|
5604
|
-
return
|
|
5605
|
-
if (
|
|
5608
|
+
return os;
|
|
5609
|
+
if (es(a)) {
|
|
5606
5610
|
var o = typeof a.valueOf == "function" ? a.valueOf() : a;
|
|
5607
|
-
a =
|
|
5611
|
+
a = es(o) ? o + "" : o;
|
|
5608
5612
|
}
|
|
5609
5613
|
if (typeof a != "string")
|
|
5610
5614
|
return a === 0 ? a : +a;
|
|
5611
5615
|
a = Ag(a);
|
|
5612
5616
|
var t = Og.test(a);
|
|
5613
|
-
return t || Rg.test(a) ? Yg(a.slice(2), t ? 2 : 8) : Eg.test(a) ?
|
|
5617
|
+
return t || Rg.test(a) ? Yg(a.slice(2), t ? 2 : 8) : Eg.test(a) ? os : +a;
|
|
5614
5618
|
}
|
|
5615
|
-
var Ug = Wg, Bg = de, Do = vg,
|
|
5619
|
+
var Ug = Wg, Bg = de, Do = vg, is = Ug, Fg = "Expected a function", Vg = Math.max, $g = Math.min;
|
|
5616
5620
|
function Hg(a, o, t) {
|
|
5617
5621
|
var e, i, s, n, r, c, l = 0, h = !1, u = !1, d = !0;
|
|
5618
5622
|
if (typeof a != "function")
|
|
5619
5623
|
throw new TypeError(Fg);
|
|
5620
|
-
o =
|
|
5624
|
+
o = is(o) || 0, Bg(t) && (h = !!t.leading, u = "maxWait" in t, s = u ? Vg(is(t.maxWait) || 0, o) : s, d = "trailing" in t ? !!t.trailing : d);
|
|
5621
5625
|
function p(v) {
|
|
5622
5626
|
var x = e, L = i;
|
|
5623
5627
|
return e = i = void 0, l = v, n = a.apply(L, x), n;
|
|
5624
5628
|
}
|
|
5625
5629
|
function f(v) {
|
|
5626
|
-
return l = v, r = setTimeout(
|
|
5630
|
+
return l = v, r = setTimeout(N, o), h ? p(v) : n;
|
|
5627
5631
|
}
|
|
5628
5632
|
function y(v) {
|
|
5629
5633
|
var x = v - c, L = v - l, A = o - x;
|
|
@@ -5633,11 +5637,11 @@ function Hg(a, o, t) {
|
|
|
5633
5637
|
var x = v - c, L = v - l;
|
|
5634
5638
|
return c === void 0 || x >= o || x < 0 || u && L >= s;
|
|
5635
5639
|
}
|
|
5636
|
-
function
|
|
5640
|
+
function N() {
|
|
5637
5641
|
var v = Do();
|
|
5638
5642
|
if (M(v))
|
|
5639
5643
|
return w(v);
|
|
5640
|
-
r = setTimeout(
|
|
5644
|
+
r = setTimeout(N, y(v));
|
|
5641
5645
|
}
|
|
5642
5646
|
function w(v) {
|
|
5643
5647
|
return r = void 0, d && e ? p(v) : (e = i = void 0, n);
|
|
@@ -5648,17 +5652,17 @@ function Hg(a, o, t) {
|
|
|
5648
5652
|
function S() {
|
|
5649
5653
|
return r === void 0 ? n : w(Do());
|
|
5650
5654
|
}
|
|
5651
|
-
function
|
|
5655
|
+
function I() {
|
|
5652
5656
|
var v = Do(), x = M(v);
|
|
5653
5657
|
if (e = arguments, i = this, c = v, x) {
|
|
5654
5658
|
if (r === void 0)
|
|
5655
5659
|
return f(c);
|
|
5656
5660
|
if (u)
|
|
5657
|
-
return clearTimeout(r), r = setTimeout(
|
|
5661
|
+
return clearTimeout(r), r = setTimeout(N, o), p(c);
|
|
5658
5662
|
}
|
|
5659
|
-
return r === void 0 && (r = setTimeout(
|
|
5663
|
+
return r === void 0 && (r = setTimeout(N, o)), n;
|
|
5660
5664
|
}
|
|
5661
|
-
return
|
|
5665
|
+
return I.cancel = m, I.flush = S, I;
|
|
5662
5666
|
}
|
|
5663
5667
|
var Qg = Hg, Gg = Qg, Zg = de, Xg = "Expected a function";
|
|
5664
5668
|
function Jg(a, o, t) {
|
|
@@ -5690,10 +5694,10 @@ function _g(a, o, t) {
|
|
|
5690
5694
|
}
|
|
5691
5695
|
return a.apply(o, t);
|
|
5692
5696
|
}
|
|
5693
|
-
var ty = _g, ey = ty,
|
|
5697
|
+
var ty = _g, ey = ty, ss = Math.max;
|
|
5694
5698
|
function oy(a, o, t) {
|
|
5695
|
-
return o =
|
|
5696
|
-
for (var e = arguments, i = -1, s =
|
|
5699
|
+
return o = ss(o === void 0 ? a.length - 1 : o, 0), function() {
|
|
5700
|
+
for (var e = arguments, i = -1, s = ss(e.length - o, 0), n = Array(s); ++i < s; )
|
|
5697
5701
|
n[i] = e[o + i];
|
|
5698
5702
|
i = -1;
|
|
5699
5703
|
for (var r = Array(o + 1); ++i < o; )
|
|
@@ -5707,8 +5711,8 @@ function sy(a) {
|
|
|
5707
5711
|
return a;
|
|
5708
5712
|
};
|
|
5709
5713
|
}
|
|
5710
|
-
var ny = sy, ry = ny,
|
|
5711
|
-
return
|
|
5714
|
+
var ny = sy, ry = ny, ns = Ss, ay = an, cy = ns ? function(a, o) {
|
|
5715
|
+
return ns(a, "toString", {
|
|
5712
5716
|
configurable: !0,
|
|
5713
5717
|
enumerable: !1,
|
|
5714
5718
|
value: ry(o),
|
|
@@ -5771,7 +5775,7 @@ function Yy(a, o) {
|
|
|
5771
5775
|
i[t] = o(a[t], t, a);
|
|
5772
5776
|
return i;
|
|
5773
5777
|
}
|
|
5774
|
-
var Wy = Yy, Uy =
|
|
5778
|
+
var Wy = Yy, Uy = ai, By = cn, Fy = ln, Vy = Wy, $y = To, Hy = ci, Qy = 200;
|
|
5775
5779
|
function Gy(a, o, t, e) {
|
|
5776
5780
|
var i = -1, s = By, n = !0, r = a.length, c = [], l = o.length;
|
|
5777
5781
|
if (!r)
|
|
@@ -5789,9 +5793,9 @@ function Gy(a, o, t, e) {
|
|
|
5789
5793
|
}
|
|
5790
5794
|
return c;
|
|
5791
5795
|
}
|
|
5792
|
-
var Zy = Gy,
|
|
5796
|
+
var Zy = Gy, rs = Ze, Xy = bs, Jy = Xe, as = rs ? rs.isConcatSpreadable : void 0;
|
|
5793
5797
|
function qy(a) {
|
|
5794
|
-
return Jy(a) || Xy(a) || !!(
|
|
5798
|
+
return Jy(a) || Xy(a) || !!(as && a && a[as]);
|
|
5795
5799
|
}
|
|
5796
5800
|
var Ky = qy, _y = si, tM = Ky;
|
|
5797
5801
|
function hn(a, o, t, e, i) {
|
|
@@ -5805,9 +5809,9 @@ function hn(a, o, t, e, i) {
|
|
|
5805
5809
|
var eM = hn;
|
|
5806
5810
|
function oM() {
|
|
5807
5811
|
}
|
|
5808
|
-
var iM = oM, Ao =
|
|
5812
|
+
var iM = oM, Ao = Ws, sM = iM, nM = li, rM = 1 / 0, aM = Ao && 1 / nM(new Ao([, -0]))[1] == rM ? function(a) {
|
|
5809
5813
|
return new Ao(a);
|
|
5810
|
-
} : sM, cM = aM, lM =
|
|
5814
|
+
} : sM, cM = aM, lM = ai, hM = cn, uM = ln, dM = ci, pM = cM, fM = li, gM = 200;
|
|
5811
5815
|
function yM(a, o, t) {
|
|
5812
5816
|
var e = -1, i = hM, s = a.length, n = !0, r = [], c = r;
|
|
5813
5817
|
if (t)
|
|
@@ -5831,21 +5835,21 @@ function yM(a, o, t) {
|
|
|
5831
5835
|
}
|
|
5832
5836
|
return r;
|
|
5833
5837
|
}
|
|
5834
|
-
var MM = yM, wM = Zy, mM = eM,
|
|
5838
|
+
var MM = yM, wM = Zy, mM = eM, cs = MM;
|
|
5835
5839
|
function vM(a, o, t) {
|
|
5836
5840
|
var e = a.length;
|
|
5837
5841
|
if (e < 2)
|
|
5838
|
-
return e ?
|
|
5842
|
+
return e ? cs(a[0]) : [];
|
|
5839
5843
|
for (var i = -1, s = Array(e); ++i < e; )
|
|
5840
5844
|
for (var n = a[i], r = -1; ++r < e; )
|
|
5841
5845
|
r != i && (s[i] = wM(s[i] || n, a[r], o, t));
|
|
5842
|
-
return
|
|
5846
|
+
return cs(mM(s, 1), o, t);
|
|
5843
5847
|
}
|
|
5844
5848
|
var IM = vM, NM = ti, TM = se;
|
|
5845
5849
|
function SM(a) {
|
|
5846
5850
|
return TM(a) && NM(a);
|
|
5847
5851
|
}
|
|
5848
|
-
var kM = SM, CM =
|
|
5852
|
+
var kM = SM, CM = As, xM = Ty, bM = IM, LM = kM;
|
|
5849
5853
|
xM(function(a) {
|
|
5850
5854
|
return bM(CM(a, LM));
|
|
5851
5855
|
});
|
|
@@ -5860,10 +5864,10 @@ class zM extends Mg {
|
|
|
5860
5864
|
if (e) {
|
|
5861
5865
|
let n, r;
|
|
5862
5866
|
const c = (s = e.getWorkId()) == null ? void 0 : s.toString();
|
|
5863
|
-
return e.toolsType ===
|
|
5867
|
+
return e.toolsType === T.Image ? n = await e.consumeServiceAsync({
|
|
5864
5868
|
isFullWork: !0,
|
|
5865
5869
|
worker: this.thread
|
|
5866
|
-
}) : e.toolsType ===
|
|
5870
|
+
}) : e.toolsType === T.Text ? n = await e.consumeServiceAsync({
|
|
5867
5871
|
isFullWork: !0,
|
|
5868
5872
|
replaceId: c,
|
|
5869
5873
|
isDrawLabel: !0
|
|
@@ -5886,7 +5890,7 @@ class zM extends Mg {
|
|
|
5886
5890
|
}
|
|
5887
5891
|
canUseSubWorker(t) {
|
|
5888
5892
|
const e = this.thread.getPriorityDraw();
|
|
5889
|
-
return e || !e && t !==
|
|
5893
|
+
return e || !e && t !== T.Pencil;
|
|
5890
5894
|
}
|
|
5891
5895
|
async consumeDraw(t) {
|
|
5892
5896
|
const { workId: e } = t, i = e == null ? void 0 : e.toString(), s = i && this.workShapes.get(i);
|
|
@@ -5900,17 +5904,17 @@ class zM extends Mg {
|
|
|
5900
5904
|
}), this.drawWorkActiveId = void 0), !this.drawWorkActiveId && i !== $ && (this.drawWorkActiveId = i);
|
|
5901
5905
|
const n = s.toolsType, r = s.consume({ data: t, drawCount: this.drawCount, isFullWork: !0, isSubWorker: !0 });
|
|
5902
5906
|
switch (n) {
|
|
5903
|
-
case
|
|
5904
|
-
case
|
|
5905
|
-
case
|
|
5906
|
-
case
|
|
5907
|
-
case
|
|
5908
|
-
case
|
|
5909
|
-
case
|
|
5907
|
+
case T.Arrow:
|
|
5908
|
+
case T.Straight:
|
|
5909
|
+
case T.Ellipse:
|
|
5910
|
+
case T.Rectangle:
|
|
5911
|
+
case T.Star:
|
|
5912
|
+
case T.Polygon:
|
|
5913
|
+
case T.SpeechBalloon: {
|
|
5910
5914
|
r && (this.drawCount++, await this.drawShape(r));
|
|
5911
5915
|
break;
|
|
5912
5916
|
}
|
|
5913
|
-
case
|
|
5917
|
+
case T.Pencil: {
|
|
5914
5918
|
r && (this.drawCount++, await this.drawPencil(r, e == null ? void 0 : e.toString()));
|
|
5915
5919
|
break;
|
|
5916
5920
|
}
|
|
@@ -5925,14 +5929,14 @@ class zM extends Mg {
|
|
|
5925
5929
|
if (!s)
|
|
5926
5930
|
return;
|
|
5927
5931
|
switch (s.toolsType) {
|
|
5928
|
-
case
|
|
5929
|
-
case
|
|
5930
|
-
case
|
|
5931
|
-
case
|
|
5932
|
-
case
|
|
5933
|
-
case
|
|
5934
|
-
case
|
|
5935
|
-
case
|
|
5932
|
+
case T.Arrow:
|
|
5933
|
+
case T.Straight:
|
|
5934
|
+
case T.Ellipse:
|
|
5935
|
+
case T.Pencil:
|
|
5936
|
+
case T.Rectangle:
|
|
5937
|
+
case T.Star:
|
|
5938
|
+
case T.Polygon:
|
|
5939
|
+
case T.SpeechBalloon:
|
|
5936
5940
|
this.drawCount = 0, this.fullLayer.removeAllChildren(), this.clearWorkShapeNodeCache(i);
|
|
5937
5941
|
break;
|
|
5938
5942
|
}
|
|
@@ -6018,7 +6022,7 @@ class PM {
|
|
|
6018
6022
|
this.viewId = o.viewId, this.vNodes = o.vNodes, this.topLayer = o.topLayer, this.thread = o.thread, this.post = o.thread.post.bind(o.thread);
|
|
6019
6023
|
}
|
|
6020
6024
|
canUseTopLayer(o) {
|
|
6021
|
-
return o ===
|
|
6025
|
+
return o === T.LaserPen;
|
|
6022
6026
|
}
|
|
6023
6027
|
getWorkShape(o) {
|
|
6024
6028
|
return this.localWorkShapes.get(o);
|
|
@@ -6043,8 +6047,8 @@ class PM {
|
|
|
6043
6047
|
}
|
|
6044
6048
|
createWorkShapeNode(o) {
|
|
6045
6049
|
const { toolsType: t } = o;
|
|
6046
|
-
if (t ===
|
|
6047
|
-
return
|
|
6050
|
+
if (t === T.LaserPen)
|
|
6051
|
+
return hi({ ...o, vNodes: this.vNodes, fullLayer: this.topLayer, drawLayer: this.topLayer });
|
|
6048
6052
|
}
|
|
6049
6053
|
clearAllWorkShapesCache() {
|
|
6050
6054
|
this.localWorkShapes.forEach((o) => {
|
|
@@ -6123,7 +6127,7 @@ class PM {
|
|
|
6123
6127
|
const t = /* @__PURE__ */ new Map(), e = [], i = [], s = [];
|
|
6124
6128
|
for (const [h, u] of this.serviceWorkShapes.entries())
|
|
6125
6129
|
switch (u.toolsType) {
|
|
6126
|
-
case
|
|
6130
|
+
case T.LaserPen: {
|
|
6127
6131
|
const p = this.computNextAnimationIndex(u, 8), f = Math.max(0, u.animationIndex || 0), y = (u.animationWorkData || []).slice(f, p);
|
|
6128
6132
|
if ((u.animationIndex || 0) < p) {
|
|
6129
6133
|
const M = (n = u.node) == null ? void 0 : n.consumeService({
|
|
@@ -6155,7 +6159,7 @@ class PM {
|
|
|
6155
6159
|
for (const [h, u] of this.localWorkShapes.entries()) {
|
|
6156
6160
|
const { result: d, toolsType: p, totalRect: f, isDel: y, workState: M } = u;
|
|
6157
6161
|
switch (p) {
|
|
6158
|
-
case
|
|
6162
|
+
case T.LaserPen: {
|
|
6159
6163
|
if (f && (i.push({
|
|
6160
6164
|
isClear: !0,
|
|
6161
6165
|
rect: f,
|
|
@@ -6477,7 +6481,7 @@ class Qe extends Y {
|
|
|
6477
6481
|
super(t);
|
|
6478
6482
|
g(this, "canRotate", !0);
|
|
6479
6483
|
g(this, "scaleType", pt.all);
|
|
6480
|
-
g(this, "toolsType",
|
|
6484
|
+
g(this, "toolsType", T.Image);
|
|
6481
6485
|
g(this, "tmpPoints", []);
|
|
6482
6486
|
g(this, "workOptions");
|
|
6483
6487
|
g(this, "oldRect");
|
|
@@ -6511,13 +6515,13 @@ class Qe extends Y {
|
|
|
6511
6515
|
pos: [r, c],
|
|
6512
6516
|
layer: e
|
|
6513
6517
|
}), this.replace(e, s || i, f);
|
|
6514
|
-
const
|
|
6515
|
-
if (
|
|
6518
|
+
const N = f.getBoundingClientRect();
|
|
6519
|
+
if (N)
|
|
6516
6520
|
return {
|
|
6517
|
-
x: Math.floor(
|
|
6518
|
-
y: Math.floor(
|
|
6519
|
-
w: Math.floor(
|
|
6520
|
-
h: Math.floor(
|
|
6521
|
+
x: Math.floor(N.x - Y.SafeBorderPadding),
|
|
6522
|
+
y: Math.floor(N.y - Y.SafeBorderPadding),
|
|
6523
|
+
w: Math.floor(N.width + Y.SafeBorderPadding * 2),
|
|
6524
|
+
h: Math.floor(N.height + Y.SafeBorderPadding * 2)
|
|
6521
6525
|
};
|
|
6522
6526
|
}
|
|
6523
6527
|
consumeService() {
|
|
@@ -6559,32 +6563,32 @@ class Qe extends Y {
|
|
|
6559
6563
|
const M = e.parent;
|
|
6560
6564
|
if (M) {
|
|
6561
6565
|
if (f && (y.opt.strokeColor = f), oe(p) && (e.setAttribute("zIndex", p), y.opt.zIndex = p), Ce(d) && (y.opt.locked = d), c && l && h && r) {
|
|
6562
|
-
const { centerX:
|
|
6563
|
-
|
|
6566
|
+
const { centerX: N, centerY: w, width: m, height: S, uniformScale: I } = y.opt, v = I !== !1 ? [h[0], h[0]] : h, x = [N, w], L = [N, w];
|
|
6567
|
+
pi(L, l, v, r);
|
|
6564
6568
|
const A = [L[0] - x[0], L[1] - x[1]];
|
|
6565
6569
|
if (y.centerPos = [y.centerPos[0] + A[0], y.centerPos[1] + A[1]], y.opt.width = Math.round(m * v[0]), y.opt.height = Math.round(S * v[1]), y.opt.centerX = L[0], y.opt.centerY = L[1], y.opt.eraserlines)
|
|
6566
6570
|
for (const j of Object.values(y.opt.eraserlines)) {
|
|
6567
6571
|
const { op: D, thickness: O } = j;
|
|
6568
6572
|
j.thickness = O * Math.max(h[0], h[1]);
|
|
6569
6573
|
for (let z = 0; z < D.length; z++)
|
|
6570
|
-
|
|
6574
|
+
fi(D[z], l, h, r);
|
|
6571
6575
|
}
|
|
6572
6576
|
} else if (r) {
|
|
6573
6577
|
if (y.opt.centerX = y.opt.centerX + r[0], y.opt.centerY = y.opt.centerY + r[1], y.centerPos = [y.centerPos[0] + r[0], y.centerPos[1] + r[1]], y.opt.eraserlines)
|
|
6574
|
-
for (const
|
|
6575
|
-
const { op: w } =
|
|
6578
|
+
for (const N of Object.values(y.opt.eraserlines)) {
|
|
6579
|
+
const { op: w } = N;
|
|
6576
6580
|
for (let m = 0; m < w.length; m++) {
|
|
6577
|
-
const S = w[m].map((
|
|
6578
|
-
|
|
6581
|
+
const S = w[m].map((I, v) => v % 2 ? I + r[1] : I + r[0]);
|
|
6582
|
+
N.op[m] = S;
|
|
6579
6583
|
}
|
|
6580
6584
|
}
|
|
6581
6585
|
} else if (oe(u))
|
|
6582
6586
|
if (y.opt.rotate = u, y.scaleType = Qe.getScaleType(y.opt), n) {
|
|
6583
|
-
const
|
|
6584
|
-
y.rect =
|
|
6587
|
+
const N = un(y.rect, u);
|
|
6588
|
+
y.rect = N;
|
|
6585
6589
|
} else {
|
|
6586
|
-
const
|
|
6587
|
-
y.rect =
|
|
6590
|
+
const N = Y.getRectFromLayer(M, e.name);
|
|
6591
|
+
y.rect = N || y.rect;
|
|
6588
6592
|
}
|
|
6589
6593
|
return y && s.setInfo(e.name, y), y == null ? void 0 : y.rect;
|
|
6590
6594
|
}
|
|
@@ -6597,7 +6601,7 @@ function lt(a, o) {
|
|
|
6597
6601
|
}
|
|
6598
6602
|
return o || a;
|
|
6599
6603
|
}
|
|
6600
|
-
function
|
|
6604
|
+
function di(a, o) {
|
|
6601
6605
|
if (a && o) {
|
|
6602
6606
|
const t = Math.min(a.originX, o.originX), e = Math.min(a.originY, o.originY), i = Math.max(a.originX + a.width, o.originX + o.width), s = Math.max(a.originY + a.height, o.originY + o.height), n = i - t, r = s - e;
|
|
6603
6607
|
return { originX: t, originY: e, width: n, height: r };
|
|
@@ -6657,14 +6661,14 @@ function OM(a, o, t) {
|
|
|
6657
6661
|
a[i] = r.x, a[i + 1] = r.y;
|
|
6658
6662
|
}
|
|
6659
6663
|
}
|
|
6660
|
-
function
|
|
6664
|
+
function pi(a, o, t, e = [0, 0]) {
|
|
6661
6665
|
const i = new C(o[0], o[1]);
|
|
6662
6666
|
for (let s = 0; s < a.length; s += 3) {
|
|
6663
6667
|
const n = new C(a[s], a[s + 1]), r = new C(t[0], t[1]), c = C.ScaleWOrigin(n, r, i);
|
|
6664
6668
|
a[s] = c.x + e[0], a[s + 1] = c.y + e[1];
|
|
6665
6669
|
}
|
|
6666
6670
|
}
|
|
6667
|
-
function
|
|
6671
|
+
function fi(a, o, t, e = [0, 0]) {
|
|
6668
6672
|
const i = new C(o[0], o[1]);
|
|
6669
6673
|
for (let s = 0; s < a.length; s += 2) {
|
|
6670
6674
|
const n = new C(a[s], a[s + 1]), r = new C(t[0], t[1]), c = C.ScaleWOrigin(n, r, i);
|
|
@@ -6803,7 +6807,7 @@ const Rt = class Rt extends $M {
|
|
|
6803
6807
|
return !!(i && Object.keys(i).find((s) => this.isOwn(s) && this.getLocalId(s) === $));
|
|
6804
6808
|
}
|
|
6805
6809
|
addStorageStateListener(t) {
|
|
6806
|
-
this.stateDisposer =
|
|
6810
|
+
this.stateDisposer = yi(async () => {
|
|
6807
6811
|
var c;
|
|
6808
6812
|
const e = this.getNamespaceData(), { diffView: i, diffScenePath: s, diffData: n } = this.diffFunByView(this.serviceStorage, e);
|
|
6809
6813
|
this.serviceStorage = e;
|
|
@@ -6957,18 +6961,18 @@ const Rt = class Rt extends $M {
|
|
|
6957
6961
|
case b.Clear:
|
|
6958
6962
|
const M = {};
|
|
6959
6963
|
f && this.storage[y] && this.storage[y][f] ? (delete this.storage[y][f], this.setState(M, { isSync: p, viewId: y, scenePath: f })) : this.storage[y] && (delete this.storage[y], this.setState(M, { isSync: p, viewId: y, scenePath: "" })), Zt(() => {
|
|
6960
|
-
var
|
|
6961
|
-
this.control.pluginManager.dispatchPluginEvent("syncStorage", y, f), (
|
|
6964
|
+
var I;
|
|
6965
|
+
this.control.pluginManager.dispatchPluginEvent("syncStorage", y, f), (I = this.control.miniMapManager) == null || I.updateMiniMapCamera(y);
|
|
6962
6966
|
}, Rt.syncInterval);
|
|
6963
6967
|
break;
|
|
6964
6968
|
case b.CreateWork:
|
|
6965
6969
|
if (f && i && c && r) {
|
|
6966
|
-
const
|
|
6970
|
+
const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i;
|
|
6967
6971
|
this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
|
|
6968
6972
|
viewId: y,
|
|
6969
6973
|
scenePath: f,
|
|
6970
|
-
elementId:
|
|
6971
|
-
}), this.updateValue(
|
|
6974
|
+
elementId: I.toString()
|
|
6975
|
+
}), this.updateValue(I.toString(), {
|
|
6972
6976
|
type: b.CreateWork,
|
|
6973
6977
|
workId: i,
|
|
6974
6978
|
toolsType: c,
|
|
@@ -6978,15 +6982,15 @@ const Rt = class Rt extends $M {
|
|
|
6978
6982
|
break;
|
|
6979
6983
|
case b.DrawWork:
|
|
6980
6984
|
if (f && i && typeof n == "number" && (u != null && u.length)) {
|
|
6981
|
-
const
|
|
6985
|
+
const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][f] && this.storage[y][f][I] || void 0;
|
|
6982
6986
|
if (v != null && v.ops || (v == null ? void 0 : v.type) === b.FullWork)
|
|
6983
6987
|
return;
|
|
6984
6988
|
const x = n ? ((v == null ? void 0 : v.op) || []).slice(0, n).concat(u) : u || (v == null ? void 0 : v.op), L = c || (v == null ? void 0 : v.toolsType), A = r || (v == null ? void 0 : v.opt), j = h || (v == null ? void 0 : v.updateNodeOpt);
|
|
6985
6989
|
i && L && A && x && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
|
|
6986
6990
|
viewId: y,
|
|
6987
6991
|
scenePath: f,
|
|
6988
|
-
elementId:
|
|
6989
|
-
}), this.updateValue(
|
|
6992
|
+
elementId: I.toString()
|
|
6993
|
+
}), this.updateValue(I.toString(), {
|
|
6990
6994
|
...v,
|
|
6991
6995
|
type: b.DrawWork,
|
|
6992
6996
|
workId: i,
|
|
@@ -7000,15 +7004,15 @@ const Rt = class Rt extends $M {
|
|
|
7000
7004
|
break;
|
|
7001
7005
|
case b.FullWork:
|
|
7002
7006
|
if (f && i) {
|
|
7003
|
-
const
|
|
7007
|
+
const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][f] && this.storage[y][f][I] || void 0, x = h || (v == null ? void 0 : v.updateNodeOpt), L = c || (v == null ? void 0 : v.toolsType), A = r || (v == null ? void 0 : v.opt), j = s || (v == null ? void 0 : v.ops);
|
|
7004
7008
|
L && A && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
|
|
7005
7009
|
viewId: y,
|
|
7006
7010
|
scenePath: f,
|
|
7007
|
-
elementId:
|
|
7008
|
-
}), this.updateValue(
|
|
7011
|
+
elementId: I.toString()
|
|
7012
|
+
}), this.updateValue(I.toString(), {
|
|
7009
7013
|
type: b.FullWork,
|
|
7010
7014
|
updateNodeOpt: x,
|
|
7011
|
-
workId:
|
|
7015
|
+
workId: I,
|
|
7012
7016
|
toolsType: L,
|
|
7013
7017
|
opt: A,
|
|
7014
7018
|
ops: j
|
|
@@ -7020,9 +7024,9 @@ const Rt = class Rt extends $M {
|
|
|
7020
7024
|
break;
|
|
7021
7025
|
case b.RemoveNode:
|
|
7022
7026
|
if (f && (l != null && l.length)) {
|
|
7023
|
-
const
|
|
7027
|
+
const I = l.map((v) => this.isLocalId(v + "") ? this.transformKey(v) : v);
|
|
7024
7028
|
this.storage[y] && this.storage[y][f] && (Object.keys(this.storage[y][f]).map((v) => {
|
|
7025
|
-
|
|
7029
|
+
I != null && I.includes(v) && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.delRenderPageElementId({
|
|
7026
7030
|
viewId: y,
|
|
7027
7031
|
scenePath: f,
|
|
7028
7032
|
elementId: v
|
|
@@ -7035,8 +7039,8 @@ const Rt = class Rt extends $M {
|
|
|
7035
7039
|
break;
|
|
7036
7040
|
case b.UpdateNode:
|
|
7037
7041
|
if (f && i && (h || s || r)) {
|
|
7038
|
-
const
|
|
7039
|
-
v && (v.updateNodeOpt = h, (s || u) && (v.ops = s, v.op = u), r && (v.opt = r), v.type = b.FullWork, this.updateValue(
|
|
7042
|
+
const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][f] && this.storage[y][f][I] || void 0;
|
|
7043
|
+
v && (v.updateNodeOpt = h, (s || u) && (v.ops = s, v.op = u), r && (v.opt = r), v.type = b.FullWork, this.updateValue(I.toString(), v, { isSync: p, viewId: y, scenePath: f }), Zt(() => {
|
|
7040
7044
|
var x;
|
|
7041
7045
|
(x = this.control.miniMapManager) == null || x.updateMiniMapCamera(y);
|
|
7042
7046
|
}, Rt.syncInterval));
|
|
@@ -7045,14 +7049,14 @@ const Rt = class Rt extends $M {
|
|
|
7045
7049
|
case b.Select:
|
|
7046
7050
|
if (!f)
|
|
7047
7051
|
return;
|
|
7048
|
-
let
|
|
7049
|
-
d != null && d.length && (
|
|
7052
|
+
let N;
|
|
7053
|
+
d != null && d.length && (N = d.map((I) => this.isLocalId(I + "") ? this.transformKey(I) : I));
|
|
7050
7054
|
const w = this.transformKey($), m = this.storage[y] && this.storage[y][f] && this.storage[y][f][w] || void 0, S = r || (m == null ? void 0 : m.opt);
|
|
7051
|
-
|
|
7055
|
+
N && this.checkOtherSelector(w, N, { isSync: p, viewId: y, scenePath: f }), this.updateValue(w, N && {
|
|
7052
7056
|
type: b.Select,
|
|
7053
|
-
toolsType:
|
|
7057
|
+
toolsType: T.Selector,
|
|
7054
7058
|
opt: S,
|
|
7055
|
-
selectIds:
|
|
7059
|
+
selectIds: N
|
|
7056
7060
|
}, { isSync: p, viewId: y, scenePath: f });
|
|
7057
7061
|
break;
|
|
7058
7062
|
}
|
|
@@ -7170,7 +7174,7 @@ const Rt = class Rt extends $M {
|
|
|
7170
7174
|
this.removeStorageStateListener(), this.serviceStorage = {}, this.storage = {}, this.removeAuthStateListener(), this.authStorage = {};
|
|
7171
7175
|
}
|
|
7172
7176
|
dispatchPageAuth(t, e = !0) {
|
|
7173
|
-
var l, h, u, d, p, f, y, M,
|
|
7177
|
+
var l, h, u, d, p, f, y, M, N, w, m, S, I, v, x, L, A, j, D, O, z, E, rt, tt, H, Z, Q, G, K, at, bt, it, ht, J, V, ut, wt, Ft;
|
|
7174
7178
|
const { operation: i, viewId: s, scenePath: n, pageId: r, pageData: c } = t;
|
|
7175
7179
|
switch (i) {
|
|
7176
7180
|
case Ot.addPage: {
|
|
@@ -7199,13 +7203,13 @@ const Rt = class Rt extends $M {
|
|
|
7199
7203
|
case Ot.deletePage: {
|
|
7200
7204
|
if (!s || !n || !r)
|
|
7201
7205
|
return;
|
|
7202
|
-
(m = (w = (
|
|
7206
|
+
(m = (w = (N = (M = (y = this.authStorage) == null ? void 0 : y.pageAuth) == null ? void 0 : M[s]) == null ? void 0 : N[n]) == null ? void 0 : w.pages) != null && m[r] && (delete this.authStorage.pageAuth[s][n].pages[r], e && ((S = this.plugin) == null || S.updateAttributes([this.authSpace, "pageAuth", s, n, "pages", r], void 0)));
|
|
7203
7207
|
return;
|
|
7204
7208
|
}
|
|
7205
7209
|
case Ot.clearPage: {
|
|
7206
7210
|
if (!s || !n || !r)
|
|
7207
7211
|
return;
|
|
7208
|
-
(A = (L = (x = (v = (
|
|
7212
|
+
(A = (L = (x = (v = (I = this.authStorage) == null ? void 0 : I.pageAuth) == null ? void 0 : v[s]) == null ? void 0 : x[n]) == null ? void 0 : L.pages) != null && A[r] && (delete this.authStorage.pageAuth[s][n].pages[r], e && ((j = this.plugin) == null || j.updateAttributes([this.authSpace, "pageAuth", s, n, "pages", r], {})));
|
|
7209
7213
|
return;
|
|
7210
7214
|
}
|
|
7211
7215
|
case Ot.addElement: {
|
|
@@ -7235,7 +7239,7 @@ const Rt = class Rt extends $M {
|
|
|
7235
7239
|
}
|
|
7236
7240
|
}
|
|
7237
7241
|
dispatchRenderAuth(t, e = !0) {
|
|
7238
|
-
var l, h, u, d, p, f, y, M,
|
|
7242
|
+
var l, h, u, d, p, f, y, M, N, w, m, S, I, v, x, L, A, j, D, O;
|
|
7239
7243
|
const { operation: i, viewId: s, uid: n, renderData: r, isClear: c } = t;
|
|
7240
7244
|
if (s)
|
|
7241
7245
|
switch (i) {
|
|
@@ -7279,7 +7283,7 @@ const Rt = class Rt extends $M {
|
|
|
7279
7283
|
const z = [this.authSpace];
|
|
7280
7284
|
Object.keys(this.authStorage).length && z.push("renderAuth");
|
|
7281
7285
|
const E = this.authStorage.renderAuth || {};
|
|
7282
|
-
Object.keys(E).length && z.push(s), E[s] = E[s] || {}, this.authStorage.renderAuth = E, Object.keys(E[s]).length && z.push("render"), E[s].render = E[s].render || {}, E[s].render !== !0 && (Object.keys(E[s].render).length && z.push(n), E[s].render[n] = !0), E[s].hide !== !0 && ((p = E[s].hide) != null && p[n]) && (delete E[s].hide[n], e && ((f = this.plugin) == null || f.updateAttributes([this.authSpace, "renderAuth", s, "hide", n], void 0))), e && (z.length === 1 ? (y = this.plugin) == null || y.updateAttributes(z, dt(this.authStorage)) : z.length === 2 ? (M = this.plugin) == null || M.updateAttributes(z, dt(E)) : z.length === 3 ? (
|
|
7286
|
+
Object.keys(E).length && z.push(s), E[s] = E[s] || {}, this.authStorage.renderAuth = E, Object.keys(E[s]).length && z.push("render"), E[s].render = E[s].render || {}, E[s].render !== !0 && (Object.keys(E[s].render).length && z.push(n), E[s].render[n] = !0), E[s].hide !== !0 && ((p = E[s].hide) != null && p[n]) && (delete E[s].hide[n], e && ((f = this.plugin) == null || f.updateAttributes([this.authSpace, "renderAuth", s, "hide", n], void 0))), e && (z.length === 1 ? (y = this.plugin) == null || y.updateAttributes(z, dt(this.authStorage)) : z.length === 2 ? (M = this.plugin) == null || M.updateAttributes(z, dt(E)) : z.length === 3 ? (N = this.plugin) == null || N.updateAttributes(z, dt(E[s])) : (w = this.plugin) == null || w.updateAttributes(z, !0));
|
|
7283
7287
|
return;
|
|
7284
7288
|
}
|
|
7285
7289
|
case ee.setHide: {
|
|
@@ -7288,7 +7292,7 @@ const Rt = class Rt extends $M {
|
|
|
7288
7292
|
const z = [this.authSpace];
|
|
7289
7293
|
Object.keys(this.authStorage).length && z.push("renderAuth");
|
|
7290
7294
|
const E = this.authStorage.renderAuth || {};
|
|
7291
|
-
Object.keys(E).length && z.push(s), E[s] = E[s] || {}, this.authStorage.renderAuth = E, Object.keys(E[s]).length && z.push("hide"), E[s].hide = E[s].hide || {}, E[s].hide !== !0 && (Object.keys(E[s].hide).length && z.push(n), E[s].hide[n] = !0), E[s].render !== !0 && ((m = E[s].render) != null && m[n]) && (delete E[s].render[n], e && ((S = this.plugin) == null || S.updateAttributes([this.authSpace, "renderAuth", s, "render", n], void 0))), e && (z.length === 1 ? (
|
|
7295
|
+
Object.keys(E).length && z.push(s), E[s] = E[s] || {}, this.authStorage.renderAuth = E, Object.keys(E[s]).length && z.push("hide"), E[s].hide = E[s].hide || {}, E[s].hide !== !0 && (Object.keys(E[s].hide).length && z.push(n), E[s].hide[n] = !0), E[s].render !== !0 && ((m = E[s].render) != null && m[n]) && (delete E[s].render[n], e && ((S = this.plugin) == null || S.updateAttributes([this.authSpace, "renderAuth", s, "render", n], void 0))), e && (z.length === 1 ? (I = this.plugin) == null || I.updateAttributes(z, dt(this.authStorage)) : z.length === 2 ? (v = this.plugin) == null || v.updateAttributes(z, dt(E)) : z.length === 3 ? (x = this.plugin) == null || x.updateAttributes(z, dt(E[s])) : (L = this.plugin) == null || L.updateAttributes(z, !0));
|
|
7292
7296
|
return;
|
|
7293
7297
|
}
|
|
7294
7298
|
case ee.setClear: {
|
|
@@ -7303,7 +7307,7 @@ const Rt = class Rt extends $M {
|
|
|
7303
7307
|
}
|
|
7304
7308
|
}
|
|
7305
7309
|
addAuthStateListener(t) {
|
|
7306
|
-
this.authDisposer =
|
|
7310
|
+
this.authDisposer = yi(async () => {
|
|
7307
7311
|
const e = this.getAuthSpaceData(), { renderAuth: i, pageAuth: s } = e;
|
|
7308
7312
|
let n, r;
|
|
7309
7313
|
ft(i, this.authStorage.renderAuth) || (n = this.diffAuthFun(this.authStorage.renderAuth || {}, i || {}), this.authStorage.renderAuth = i), ft(s, this.authStorage.pageAuth) || (r = this.diffAuthPageFun(this.authStorage.pageAuth || {}, s || {}), this.authStorage.pageAuth = s), (n || r) && t(n, r);
|
|
@@ -7476,35 +7480,35 @@ class QM {
|
|
|
7476
7480
|
get interceptors() {
|
|
7477
7481
|
return {
|
|
7478
7482
|
set: (o, t) => {
|
|
7479
|
-
var p, f, y, M,
|
|
7483
|
+
var p, f, y, M, N, w, m, S;
|
|
7480
7484
|
if (!this.collector)
|
|
7481
7485
|
return !0;
|
|
7482
7486
|
const { viewId: e, scenePath: i, canSync: s, canWorker: n, type: r, opt: c, dataType: l } = t;
|
|
7483
7487
|
if (!n && !s)
|
|
7484
7488
|
return !0;
|
|
7485
7489
|
const u = ((p = this.collector) == null ? void 0 : p.isLocalId(o)) ? (f = this.collector) == null ? void 0 : f.transformKey(o) : o, d = ((y = this.collector) == null ? void 0 : y.storage[e]) && this.collector.storage[e][i] && this.collector.storage[e][i][u] || void 0;
|
|
7486
|
-
d ? d.toolsType ===
|
|
7490
|
+
d ? d.toolsType === T.Text && (n && (this.control.worker.queryTaskBatchData({
|
|
7487
7491
|
workId: o,
|
|
7488
7492
|
msgType: b.UpdateNode
|
|
7489
|
-
}).forEach((
|
|
7493
|
+
}).forEach((I) => {
|
|
7490
7494
|
var v;
|
|
7491
|
-
(v = this.control.worker) == null || v.taskBatchData.delete(
|
|
7495
|
+
(v = this.control.worker) == null || v.taskBatchData.delete(I);
|
|
7492
7496
|
}), (m = this.control.worker) == null || m.taskBatchData.add({
|
|
7493
7497
|
workId: o,
|
|
7494
7498
|
msgType: b.UpdateNode,
|
|
7495
7499
|
dataType: l || U.Local,
|
|
7496
|
-
toolsType:
|
|
7500
|
+
toolsType: T.Text,
|
|
7497
7501
|
opt: c,
|
|
7498
7502
|
viewId: e,
|
|
7499
7503
|
scenePath: i,
|
|
7500
7504
|
willRefresh: !0
|
|
7501
7505
|
// willSyncService: canSync
|
|
7502
7506
|
}), (S = this.control.worker) == null || S.runAnimation()), s && Zt(() => {
|
|
7503
|
-
var
|
|
7504
|
-
(
|
|
7507
|
+
var I;
|
|
7508
|
+
(I = this.collector) == null || I.dispatch({
|
|
7505
7509
|
type: b.UpdateNode,
|
|
7506
7510
|
workId: o,
|
|
7507
|
-
toolsType:
|
|
7511
|
+
toolsType: T.Text,
|
|
7508
7512
|
opt: c,
|
|
7509
7513
|
viewId: e,
|
|
7510
7514
|
scenePath: i
|
|
@@ -7512,16 +7516,16 @@ class QM {
|
|
|
7512
7516
|
}, this.control.worker.maxLastSyncTime)) : r === ie.Text && (s && ((M = this.collector) == null || M.dispatch({
|
|
7513
7517
|
type: c.text && b.FullWork || b.CreateWork,
|
|
7514
7518
|
workId: o,
|
|
7515
|
-
toolsType:
|
|
7519
|
+
toolsType: T.Text,
|
|
7516
7520
|
opt: c,
|
|
7517
7521
|
isSync: !0,
|
|
7518
7522
|
viewId: e,
|
|
7519
7523
|
scenePath: i
|
|
7520
|
-
})), n && ((
|
|
7524
|
+
})), n && ((N = this.control.worker) == null || N.taskBatchData.add({
|
|
7521
7525
|
workId: o,
|
|
7522
7526
|
msgType: c.text && b.FullWork || b.CreateWork,
|
|
7523
7527
|
dataType: l || U.Local,
|
|
7524
|
-
toolsType:
|
|
7528
|
+
toolsType: T.Text,
|
|
7525
7529
|
opt: c,
|
|
7526
7530
|
viewId: e,
|
|
7527
7531
|
scenePath: i,
|
|
@@ -7540,7 +7544,7 @@ class QM {
|
|
|
7540
7544
|
return !0;
|
|
7541
7545
|
n && ((r = this.control.worker) == null || r.taskBatchData.add({
|
|
7542
7546
|
workId: o,
|
|
7543
|
-
toolsType:
|
|
7547
|
+
toolsType: T.Text,
|
|
7544
7548
|
msgType: b.RemoveNode,
|
|
7545
7549
|
dataType: U.Local,
|
|
7546
7550
|
viewId: e,
|
|
@@ -7551,7 +7555,7 @@ class QM {
|
|
|
7551
7555
|
(l = this.collector) == null || l.dispatch({
|
|
7552
7556
|
type: b.RemoveNode,
|
|
7553
7557
|
removeIds: [o],
|
|
7554
|
-
toolsType:
|
|
7558
|
+
toolsType: T.Text,
|
|
7555
7559
|
viewId: e,
|
|
7556
7560
|
scenePath: i
|
|
7557
7561
|
});
|
|
@@ -8008,7 +8012,7 @@ class ZM extends Jt {
|
|
|
8008
8012
|
});
|
|
8009
8013
|
break;
|
|
8010
8014
|
}
|
|
8011
|
-
if (p.toolsType ===
|
|
8015
|
+
if (p.toolsType === T.Text && p.opt && p.opt.workState && p.opt.workState !== P.Done) {
|
|
8012
8016
|
const f = p && this.copyText({
|
|
8013
8017
|
viewId: i,
|
|
8014
8018
|
store: p
|
|
@@ -8037,12 +8041,12 @@ class ZM extends Jt {
|
|
|
8037
8041
|
};
|
|
8038
8042
|
}
|
|
8039
8043
|
pasteText(t) {
|
|
8040
|
-
var M,
|
|
8044
|
+
var M, N;
|
|
8041
8045
|
const { bgCenter: e, textCenter: i, store: s, key: n, viewId: r, scenePath: c, undoTickerId: l } = t, h = this.control.viewContainerManager.getView(r);
|
|
8042
8046
|
if (!this.serviceColloctor || !h)
|
|
8043
8047
|
return;
|
|
8044
8048
|
const u = Math.floor(Math.random() * 30 + 1), d = ((M = h.cameraOpt) == null ? void 0 : M.scale) || 1, p = e && i && [e[0] - i[0] + u, e[1] - i[1] + u] || [u / d, u / d], y = (this.serviceColloctor.isLocalId(n) ? n : this.serviceColloctor.getLocalId(n.toString())) + "-" + l;
|
|
8045
|
-
if (s.toolsType ===
|
|
8049
|
+
if (s.toolsType === T.Text && s.opt) {
|
|
8046
8050
|
const w = s.opt;
|
|
8047
8051
|
if (w && w.boxPoint && w.text) {
|
|
8048
8052
|
w.workState = P.Done;
|
|
@@ -8054,7 +8058,7 @@ class ZM extends Jt {
|
|
|
8054
8058
|
x: S[0],
|
|
8055
8059
|
y: S[1],
|
|
8056
8060
|
opt: w,
|
|
8057
|
-
scale: ((
|
|
8061
|
+
scale: ((N = h.cameraOpt) == null ? void 0 : N.scale) || 1,
|
|
8058
8062
|
type: ie.Text,
|
|
8059
8063
|
isActive: !1,
|
|
8060
8064
|
viewId: r,
|
|
@@ -8071,7 +8075,7 @@ class ZM extends Jt {
|
|
|
8071
8075
|
}
|
|
8072
8076
|
}
|
|
8073
8077
|
copySelector(t) {
|
|
8074
|
-
var y, M,
|
|
8078
|
+
var y, M, N, w, m, S, I, v, x;
|
|
8075
8079
|
const { viewId: e, store: i } = t, s = this.control.viewContainerManager.getView(e), n = i.selectIds;
|
|
8076
8080
|
if (!this.serviceColloctor || !(n != null && n.length) || !s)
|
|
8077
8081
|
return;
|
|
@@ -8083,9 +8087,9 @@ class ZM extends Jt {
|
|
|
8083
8087
|
cameraOpt: {
|
|
8084
8088
|
centerX: ((y = s.cameraOpt) == null ? void 0 : y.centerX) || 0,
|
|
8085
8089
|
centerY: ((M = s.cameraOpt) == null ? void 0 : M.centerY) || 0,
|
|
8086
|
-
scale: ((
|
|
8090
|
+
scale: ((N = s.cameraOpt) == null ? void 0 : N.scale) || 1
|
|
8087
8091
|
}
|
|
8088
|
-
}, l = this.control.hasOffscreenCanvas() && ((w = s.displayer.canvasBgRef.current) == null ? void 0 : w.getBoundingClientRect()) || ((m = s.displayer.canvasContainerRef.current) == null ? void 0 : m.getBoundingClientRect()), h = (
|
|
8092
|
+
}, l = this.control.hasOffscreenCanvas() && ((w = s.displayer.canvasBgRef.current) == null ? void 0 : w.getBoundingClientRect()) || ((m = s.displayer.canvasContainerRef.current) == null ? void 0 : m.getBoundingClientRect()), h = (I = (S = s.displayer) == null ? void 0 : S.floatBarRef.current) == null ? void 0 : I.getBoundingClientRect(), u = l && [l.x + l.width / 2, l.y + l.height / 2], d = h && [h.x + h.width / 2, h.y + h.height / 2], p = u && s.viewData && s.viewData.convertToPointInWorld({ x: u[0], y: u[1] }), f = d && s.viewData && s.viewData.convertToPointInWorld({ x: d[0], y: d[1] });
|
|
8089
8093
|
p && f && (c.offset = {
|
|
8090
8094
|
x: p.x - f.x,
|
|
8091
8095
|
y: p.y - f.y
|
|
@@ -8105,9 +8109,9 @@ class ZM extends Jt {
|
|
|
8105
8109
|
if (!e.size || !this.serviceColloctor || !c)
|
|
8106
8110
|
return;
|
|
8107
8111
|
const { offset: l, cameraOpt: h } = i, { scale: u } = h, d = Math.floor(Math.random() * 30 + 1), p = l && [l.x + d, l.y + d] || [d / u, d / u], f = [], y = [];
|
|
8108
|
-
for (const [
|
|
8109
|
-
const S = (this.serviceColloctor.isLocalId(
|
|
8110
|
-
if (w.toolsType ===
|
|
8112
|
+
for (const [N, w] of e.entries()) {
|
|
8113
|
+
const S = (this.serviceColloctor.isLocalId(N) ? N : this.serviceColloctor.getLocalId(N.toString())) + "-" + r, I = { useAnimation: !1 };
|
|
8114
|
+
if (w.toolsType === T.Text && w.opt) {
|
|
8111
8115
|
const v = w.opt;
|
|
8112
8116
|
if (v && v.boxPoint && v.text) {
|
|
8113
8117
|
v.workState = P.Done;
|
|
@@ -8136,7 +8140,7 @@ class ZM extends Jt {
|
|
|
8136
8140
|
});
|
|
8137
8141
|
continue;
|
|
8138
8142
|
}
|
|
8139
|
-
if (w.toolsType ===
|
|
8143
|
+
if (w.toolsType === T.Image && (w.opt.uuid = S, w.opt.centerX = w.opt.centerX + p[0], w.opt.centerY = w.opt.centerY + p[1]), w.ops) {
|
|
8140
8144
|
const v = Ie(w.ops).map((L, A) => {
|
|
8141
8145
|
const j = A % 3;
|
|
8142
8146
|
return j === 0 ? L + p[0] : j === 1 ? L + p[1] : L;
|
|
@@ -8145,14 +8149,14 @@ class ZM extends Jt {
|
|
|
8145
8149
|
}
|
|
8146
8150
|
y.push({
|
|
8147
8151
|
...w,
|
|
8148
|
-
updateNodeOpt:
|
|
8152
|
+
updateNodeOpt: I,
|
|
8149
8153
|
type: b.FullWork,
|
|
8150
8154
|
workId: S,
|
|
8151
8155
|
viewId: s,
|
|
8152
8156
|
scenePath: n
|
|
8153
8157
|
}), f.push([{
|
|
8154
8158
|
...w,
|
|
8155
|
-
updateNodeOpt:
|
|
8159
|
+
updateNodeOpt: I,
|
|
8156
8160
|
workId: S,
|
|
8157
8161
|
msgType: b.FullWork,
|
|
8158
8162
|
dataType: U.Local,
|
|
@@ -8208,31 +8212,31 @@ class XM extends Jt {
|
|
|
8208
8212
|
const { workIds: e, strokeColor: i, fillColor: s, fontColor: n, fontBgColor: r, viewId: c, workState: l, thickness: h, strokeType: u } = t, d = this.control.viewContainerManager.getView(c);
|
|
8209
8213
|
if (!(d != null && d.displayer))
|
|
8210
8214
|
return;
|
|
8211
|
-
const p = d.focusScenePath, f = [...e], y = this.serviceColloctor.storage, M = [],
|
|
8215
|
+
const p = d.focusScenePath, f = [...e], y = this.serviceColloctor.storage, M = [], N = {};
|
|
8212
8216
|
for ((l === P.Start || !this.undoTickerId && l === P.Done) && (this.undoTickerId = Date.now(), this.mainEngine.internalMsgEmitter.emit("addUndoTicker", this.undoTickerId, c)); f.length; ) {
|
|
8213
8217
|
const w = f.pop();
|
|
8214
8218
|
if (!w)
|
|
8215
8219
|
continue;
|
|
8216
|
-
const m = w.toString(), S = this.serviceColloctor.isLocalId(m),
|
|
8220
|
+
const m = w.toString(), S = this.serviceColloctor.isLocalId(m), I = S ? this.serviceColloctor.transformKey(w) : m;
|
|
8217
8221
|
let v = m;
|
|
8218
8222
|
!S && this.serviceColloctor.isOwn(v) && (v = this.serviceColloctor.getLocalId(v));
|
|
8219
|
-
const x = y[c][p][
|
|
8223
|
+
const x = y[c][p][I] || void 0;
|
|
8220
8224
|
if (x) {
|
|
8221
8225
|
const L = x.updateNodeOpt || {};
|
|
8222
8226
|
if (n || r) {
|
|
8223
8227
|
if (n) {
|
|
8224
8228
|
L.fontColor = n;
|
|
8225
8229
|
const [j, D, O, z] = _e(n);
|
|
8226
|
-
|
|
8230
|
+
N.textColor = [j, D, O], N.textOpacity = z;
|
|
8227
8231
|
}
|
|
8228
8232
|
if (r)
|
|
8229
8233
|
if (L.fontBgColor = to(r) ? "transparent" : r, to(r))
|
|
8230
|
-
|
|
8234
|
+
N.textBgColor = void 0, N.textBgOpacity = void 0;
|
|
8231
8235
|
else {
|
|
8232
8236
|
const [j, D, O, z] = _e(r);
|
|
8233
|
-
|
|
8237
|
+
N.textBgColor = [j, D, O], N.textBgOpacity = z;
|
|
8234
8238
|
}
|
|
8235
|
-
if (x.toolsType ===
|
|
8239
|
+
if (x.toolsType === T.Text && x.opt && l !== P.Start) {
|
|
8236
8240
|
this.setTextColor(v, zt(x), L, c), l === P.Done && (this.undoTickerId = void 0);
|
|
8237
8241
|
continue;
|
|
8238
8242
|
}
|
|
@@ -8240,16 +8244,16 @@ class XM extends Jt {
|
|
|
8240
8244
|
if (i) {
|
|
8241
8245
|
L.strokeColor = i;
|
|
8242
8246
|
const [j, D, O, z] = _e(i);
|
|
8243
|
-
|
|
8247
|
+
N.strokeColor = [j, D, O], N.strokeOpacity = z;
|
|
8244
8248
|
}
|
|
8245
8249
|
if (s)
|
|
8246
8250
|
if (L.fillColor = to(s) ? "transparent" : s, to(s))
|
|
8247
|
-
|
|
8251
|
+
N.fillColor = void 0, N.fillOpacity = void 0;
|
|
8248
8252
|
else {
|
|
8249
8253
|
const [j, D, O, z] = _e(s);
|
|
8250
|
-
|
|
8254
|
+
N.fillColor = [j, D, O], N.fillOpacity = z;
|
|
8251
8255
|
}
|
|
8252
|
-
h && (L.thickness = h,
|
|
8256
|
+
h && (L.thickness = h, N.strokeWidth = h), u && (L.strokeType = u, N.strokeType = u);
|
|
8253
8257
|
const A = {
|
|
8254
8258
|
workId: v,
|
|
8255
8259
|
msgType: b.UpdateNode,
|
|
@@ -8269,9 +8273,9 @@ class XM extends Jt {
|
|
|
8269
8273
|
}]);
|
|
8270
8274
|
}
|
|
8271
8275
|
}
|
|
8272
|
-
M.length && (l === P.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(M)), Object.keys(
|
|
8276
|
+
M.length && (l === P.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(M)), Object.keys(N).length && setTimeout(() => {
|
|
8273
8277
|
var w;
|
|
8274
|
-
(w = this.control.room) == null || w.setMemberState(
|
|
8278
|
+
(w = this.control.room) == null || w.setMemberState(N);
|
|
8275
8279
|
}, 0);
|
|
8276
8280
|
}
|
|
8277
8281
|
}
|
|
@@ -8335,11 +8339,11 @@ class JM extends Jt {
|
|
|
8335
8339
|
if (!p)
|
|
8336
8340
|
continue;
|
|
8337
8341
|
const f = p.toString(), y = this.serviceColloctor.isLocalId(f), M = y ? this.serviceColloctor.transformKey(p) : f;
|
|
8338
|
-
let
|
|
8339
|
-
!y && this.serviceColloctor.isOwn(
|
|
8342
|
+
let N = f;
|
|
8343
|
+
!y && this.serviceColloctor.isOwn(N) && (N = this.serviceColloctor.getLocalId(N));
|
|
8340
8344
|
const w = zt(l[s][r][M]);
|
|
8341
8345
|
let m;
|
|
8342
|
-
if (w &&
|
|
8346
|
+
if (w && N === $) {
|
|
8343
8347
|
if (w.selectIds) {
|
|
8344
8348
|
u.push(...w.selectIds), u.sort((x, L) => {
|
|
8345
8349
|
var D, O, z, E;
|
|
@@ -8348,7 +8352,7 @@ class JM extends Jt {
|
|
|
8348
8352
|
});
|
|
8349
8353
|
const S = w.updateNodeOpt || {};
|
|
8350
8354
|
S.zIndexLayer = i;
|
|
8351
|
-
const
|
|
8355
|
+
const I = {
|
|
8352
8356
|
workId: p,
|
|
8353
8357
|
msgType: b.UpdateNode,
|
|
8354
8358
|
dataType: U.Local,
|
|
@@ -8367,7 +8371,7 @@ class JM extends Jt {
|
|
|
8367
8371
|
updateNodeOpt: j.updateNodeOpt,
|
|
8368
8372
|
opt: j.opt
|
|
8369
8373
|
});
|
|
8370
|
-
}),
|
|
8374
|
+
}), I.selectStore = v, I.willSerializeData = !0, h.push([I, {
|
|
8371
8375
|
workId: p,
|
|
8372
8376
|
msgType: b.UpdateNode,
|
|
8373
8377
|
emitEventType: this.emitEventType
|
|
@@ -8402,16 +8406,16 @@ class qM extends Jt {
|
|
|
8402
8406
|
for (p && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", p, r); h.length; ) {
|
|
8403
8407
|
const y = h.pop();
|
|
8404
8408
|
if (!y) continue;
|
|
8405
|
-
const M = y.toString(),
|
|
8409
|
+
const M = y.toString(), N = this.serviceColloctor.isLocalId(M), w = N && this.serviceColloctor.transformKey(y) || M;
|
|
8406
8410
|
let m = M;
|
|
8407
|
-
!
|
|
8411
|
+
!N && this.serviceColloctor.isOwn(m) && (m = this.serviceColloctor.getLocalId(m));
|
|
8408
8412
|
const S = u[r][l][w];
|
|
8409
8413
|
if (S && m === $) {
|
|
8410
8414
|
if (S.selectIds) {
|
|
8411
|
-
const
|
|
8412
|
-
if (n === P.Start && (this.cachePosition =
|
|
8415
|
+
const I = this.control.viewContainerManager.transformToScenePoint([s.x, s.y], r);
|
|
8416
|
+
if (n === P.Start && (this.cachePosition = I), this.cachePosition) {
|
|
8413
8417
|
const v = S.updateNodeOpt || {};
|
|
8414
|
-
v.translate = [
|
|
8418
|
+
v.translate = [I[0] - this.cachePosition[0], I[1] - this.cachePosition[1]], v.workState = n;
|
|
8415
8419
|
const x = {
|
|
8416
8420
|
workId: y,
|
|
8417
8421
|
msgType: b.UpdateNode,
|
|
@@ -8454,12 +8458,12 @@ class KM extends Jt {
|
|
|
8454
8458
|
continue;
|
|
8455
8459
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f ? this.serviceColloctor.transformKey(d) : p, M = r[i][n][y];
|
|
8456
8460
|
if (M) {
|
|
8457
|
-
let
|
|
8458
|
-
if (!f && this.serviceColloctor.isOwn(
|
|
8459
|
-
this.control.textEditorManager.delete(
|
|
8461
|
+
let N = p;
|
|
8462
|
+
if (!f && this.serviceColloctor.isOwn(N) && (N = this.serviceColloctor.getLocalId(N)), M.toolsType === T.Text) {
|
|
8463
|
+
this.control.textEditorManager.delete(N, !0, !0);
|
|
8460
8464
|
continue;
|
|
8461
8465
|
}
|
|
8462
|
-
h.push(
|
|
8466
|
+
h.push(N);
|
|
8463
8467
|
}
|
|
8464
8468
|
}
|
|
8465
8469
|
h.length && (l.push([{
|
|
@@ -8492,7 +8496,7 @@ class _M extends Jt {
|
|
|
8492
8496
|
return { key: t, textInfo: s };
|
|
8493
8497
|
}
|
|
8494
8498
|
async collect(t, e) {
|
|
8495
|
-
var w, m, S,
|
|
8499
|
+
var w, m, S, I, v;
|
|
8496
8500
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8497
8501
|
return;
|
|
8498
8502
|
const { workIds: i, workState: s, viewId: n, originPoint: r, scenePoint: c, dir: l, scale: h, translate: u } = t;
|
|
@@ -8500,8 +8504,8 @@ class _M extends Jt {
|
|
|
8500
8504
|
const d = this.control.viewContainerManager.getView(n);
|
|
8501
8505
|
if (!(d != null && d.displayer))
|
|
8502
8506
|
return;
|
|
8503
|
-
const p = d.focusScenePath, f = [...i], y = (w = this.serviceColloctor) == null ? void 0 : w.storage, M = [],
|
|
8504
|
-
for (
|
|
8507
|
+
const p = d.focusScenePath, f = [...i], y = (w = this.serviceColloctor) == null ? void 0 : w.storage, M = [], N = s === P.Start && Date.now() || void 0;
|
|
8508
|
+
for (N && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", N, n); f.length; ) {
|
|
8505
8509
|
const x = f.pop();
|
|
8506
8510
|
if (!x)
|
|
8507
8511
|
continue;
|
|
@@ -8516,7 +8520,7 @@ class _M extends Jt {
|
|
|
8516
8520
|
for (const rt of O.selectIds) {
|
|
8517
8521
|
const tt = (m = this.serviceColloctor) == null ? void 0 : m.isLocalId(rt), H = tt && ((S = this.serviceColloctor) == null ? void 0 : S.transformKey(rt)) || rt;
|
|
8518
8522
|
let Z = H;
|
|
8519
|
-
!tt && ((
|
|
8523
|
+
!tt && ((I = this.serviceColloctor) != null && I.isOwn(H)) && (Z = this.serviceColloctor.getLocalId(H));
|
|
8520
8524
|
const Q = this.control.textEditorManager.get(Z);
|
|
8521
8525
|
Q && s === P.Start && this.targetText.set(Z, zt(Q));
|
|
8522
8526
|
}
|
|
@@ -8693,7 +8697,7 @@ class tw extends Jt {
|
|
|
8693
8697
|
g(this, "cacheOriginRotate", 0);
|
|
8694
8698
|
}
|
|
8695
8699
|
collect(t, e) {
|
|
8696
|
-
var f, y, M,
|
|
8700
|
+
var f, y, M, N, w;
|
|
8697
8701
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8698
8702
|
return;
|
|
8699
8703
|
const { workIds: i, angle: s, workState: n, viewId: r } = t;
|
|
@@ -8706,15 +8710,15 @@ class tw extends Jt {
|
|
|
8706
8710
|
const m = h.pop();
|
|
8707
8711
|
if (!m)
|
|
8708
8712
|
continue;
|
|
8709
|
-
const S = m.toString(),
|
|
8713
|
+
const S = m.toString(), I = this.serviceColloctor.isLocalId(S), v = I && this.serviceColloctor.transformKey(m) || S;
|
|
8710
8714
|
let x = S;
|
|
8711
|
-
!
|
|
8715
|
+
!I && this.serviceColloctor.isOwn(x) && (x = this.serviceColloctor.getLocalId(x));
|
|
8712
8716
|
const L = u[r][l][v];
|
|
8713
8717
|
if (L && x === $) {
|
|
8714
8718
|
if (((y = L.selectIds) == null ? void 0 : y.length) === 1) {
|
|
8715
8719
|
const A = L.selectIds[0];
|
|
8716
8720
|
if (n === P.Start) {
|
|
8717
|
-
const z = ((M = this.serviceColloctor) == null ? void 0 : M.isLocalId(A)) && ((
|
|
8721
|
+
const z = ((M = this.serviceColloctor) == null ? void 0 : M.isLocalId(A)) && ((N = this.serviceColloctor) == null ? void 0 : N.transformKey(A)) || A, E = u[r][l][z];
|
|
8718
8722
|
this.cacheOriginRotate = ((w = E == null ? void 0 : E.opt) == null ? void 0 : w.rotate) || 0;
|
|
8719
8723
|
}
|
|
8720
8724
|
const j = L.updateNodeOpt || {};
|
|
@@ -8743,15 +8747,15 @@ class tw extends Jt {
|
|
|
8743
8747
|
}
|
|
8744
8748
|
function ew(a) {
|
|
8745
8749
|
switch (a) {
|
|
8746
|
-
case
|
|
8750
|
+
case T.Text:
|
|
8747
8751
|
return ie.Text;
|
|
8748
|
-
case
|
|
8749
|
-
case
|
|
8750
|
-
case
|
|
8751
|
-
case
|
|
8752
|
-
case
|
|
8753
|
-
case
|
|
8754
|
-
case
|
|
8752
|
+
case T.SpeechBalloon:
|
|
8753
|
+
case T.Star:
|
|
8754
|
+
case T.Ellipse:
|
|
8755
|
+
case T.Rectangle:
|
|
8756
|
+
case T.Triangle:
|
|
8757
|
+
case T.Rhombus:
|
|
8758
|
+
case T.Polygon:
|
|
8755
8759
|
return ie.Shape;
|
|
8756
8760
|
}
|
|
8757
8761
|
}
|
|
@@ -8778,7 +8782,7 @@ class ow extends Jt {
|
|
|
8778
8782
|
}
|
|
8779
8783
|
}
|
|
8780
8784
|
async collect(t) {
|
|
8781
|
-
var w, m, S,
|
|
8785
|
+
var w, m, S, I;
|
|
8782
8786
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8783
8787
|
return;
|
|
8784
8788
|
const { workIds: e, bold: i, italic: s, lineThrough: n, underline: r, viewId: c, fontSize: l } = t, h = this.control.viewContainerManager.getView(c);
|
|
@@ -8797,7 +8801,7 @@ class ow extends Jt {
|
|
|
8797
8801
|
const D = p[c][u][A] || void 0;
|
|
8798
8802
|
if (D) {
|
|
8799
8803
|
const O = D.updateNodeOpt || {};
|
|
8800
|
-
if (i && (O.bold = i, f.bold = i === "bold"), s && (O.italic = s, f.italic = s === "italic"), Yt(n) && (O.lineThrough = n, f.lineThrough = n), Yt(r) && (O.underline = r, f.underline = r), l && (O.fontSize = l, f.textSize = l), D.toolsType ===
|
|
8804
|
+
if (i && (O.bold = i, f.bold = i === "bold"), s && (O.italic = s, f.italic = s === "italic"), Yt(n) && (O.lineThrough = n, f.lineThrough = n), Yt(r) && (O.underline = r, f.underline = r), l && (O.fontSize = l, f.textSize = l), D.toolsType === T.Text && D.opt) {
|
|
8801
8805
|
const z = this.setTextStyle(j, dt(D), O, c);
|
|
8802
8806
|
M.push(z);
|
|
8803
8807
|
continue;
|
|
@@ -8807,7 +8811,7 @@ class ow extends Jt {
|
|
|
8807
8811
|
const E = (m = this.serviceColloctor) == null ? void 0 : m.isLocalId(z);
|
|
8808
8812
|
let rt = E && ((S = this.serviceColloctor) == null ? void 0 : S.transformKey(z)) || z;
|
|
8809
8813
|
const tt = p[c][u][rt] || void 0;
|
|
8810
|
-
if (!E && ((
|
|
8814
|
+
if (!E && ((I = this.serviceColloctor) != null && I.isOwn(rt)) && (rt = this.serviceColloctor.getLocalId(rt)), tt && tt.toolsType === T.Text && D.opt) {
|
|
8811
8815
|
const H = this.setTextStyle(rt, dt(tt), O, c);
|
|
8812
8816
|
M.push(H);
|
|
8813
8817
|
continue;
|
|
@@ -8815,8 +8819,8 @@ class ow extends Jt {
|
|
|
8815
8819
|
}
|
|
8816
8820
|
}
|
|
8817
8821
|
}
|
|
8818
|
-
const
|
|
8819
|
-
for (const v of
|
|
8822
|
+
const N = await Promise.all(M);
|
|
8823
|
+
for (const v of N)
|
|
8820
8824
|
if (v) {
|
|
8821
8825
|
const { key: x, textInfo: L } = v;
|
|
8822
8826
|
L && (L.canSync = !0, L.canWorker = !0, this.control.textEditorManager.updateForViewEdited(x, L));
|
|
@@ -8849,9 +8853,9 @@ class iw extends Jt {
|
|
|
8849
8853
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f && this.serviceColloctor.transformKey(d) || p;
|
|
8850
8854
|
let M = p;
|
|
8851
8855
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
8852
|
-
const
|
|
8853
|
-
if (
|
|
8854
|
-
const m =
|
|
8856
|
+
const N = l[n][c][y];
|
|
8857
|
+
if (N && M === $ && N.selectIds) {
|
|
8858
|
+
const m = N.updateNodeOpt || {};
|
|
8855
8859
|
m.pointMap = i, m.workState = s;
|
|
8856
8860
|
const S = {
|
|
8857
8861
|
workId: d,
|
|
@@ -8892,9 +8896,9 @@ class sw extends Jt {
|
|
|
8892
8896
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f ? this.serviceColloctor.transformKey(d) : p;
|
|
8893
8897
|
let M = p;
|
|
8894
8898
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
8895
|
-
const
|
|
8896
|
-
if (
|
|
8897
|
-
const w =
|
|
8899
|
+
const N = l[s][r][y] || void 0;
|
|
8900
|
+
if (N) {
|
|
8901
|
+
const w = N.updateNodeOpt || {};
|
|
8898
8902
|
w.isLocked = i;
|
|
8899
8903
|
const m = {
|
|
8900
8904
|
workId: M,
|
|
@@ -8937,14 +8941,14 @@ class nw extends Jt {
|
|
|
8937
8941
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f ? this.serviceColloctor.transformKey(d) : p;
|
|
8938
8942
|
let M = p;
|
|
8939
8943
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
8940
|
-
const
|
|
8941
|
-
if (
|
|
8944
|
+
const N = l[i][r][y] || void 0;
|
|
8945
|
+
if (N) {
|
|
8942
8946
|
const w = {
|
|
8943
|
-
...
|
|
8947
|
+
...N.updateNodeOpt,
|
|
8944
8948
|
...s,
|
|
8945
8949
|
willRefresh: !0
|
|
8946
8950
|
};
|
|
8947
|
-
if (
|
|
8951
|
+
if (N && M === $) {
|
|
8948
8952
|
const m = {
|
|
8949
8953
|
workId: M,
|
|
8950
8954
|
msgType: b.UpdateNode,
|
|
@@ -9121,7 +9125,7 @@ class aw {
|
|
|
9121
9125
|
this.subLocalWork = new cw(n);
|
|
9122
9126
|
}
|
|
9123
9127
|
createScene(o) {
|
|
9124
|
-
return new
|
|
9128
|
+
return new ys({
|
|
9125
9129
|
displayRatio: this.opt.displayer.dpr,
|
|
9126
9130
|
depth: !1,
|
|
9127
9131
|
desynchronized: !0,
|
|
@@ -9268,14 +9272,14 @@ class cw {
|
|
|
9268
9272
|
this.thread.subLocalLayer.removeAllChildren(), this.workShapes.clear();
|
|
9269
9273
|
}
|
|
9270
9274
|
canUseSubWorkerLayer(o) {
|
|
9271
|
-
return o ===
|
|
9275
|
+
return o === T.Pencil;
|
|
9272
9276
|
}
|
|
9273
9277
|
setToolsOpt(o) {
|
|
9274
9278
|
var t;
|
|
9275
9279
|
this.tmpOpt = o, (t = o.toolsOpt) != null && t.syncUnitTime && (this.syncUnitTime = o.toolsOpt.syncUnitTime);
|
|
9276
9280
|
}
|
|
9277
9281
|
createWorkShapeNode(o) {
|
|
9278
|
-
return
|
|
9282
|
+
return hi({ ...o, fullLayer: this.thread.subLocalLayer, drawLayer: this.thread.subLocalLayer });
|
|
9279
9283
|
}
|
|
9280
9284
|
clearWorkShapeNodeCache(o) {
|
|
9281
9285
|
this.workShapes.delete(o);
|
|
@@ -9387,39 +9391,39 @@ class uw extends hw {
|
|
|
9387
9391
|
get isRunSubWork() {
|
|
9388
9392
|
var e;
|
|
9389
9393
|
const t = (e = this.currentToolsData) == null ? void 0 : e.toolsType;
|
|
9390
|
-
return t ===
|
|
9394
|
+
return t === T.Pencil || t === T.LaserPen || t === T.Arrow || t === T.Straight || t === T.Ellipse || t === T.Rectangle || t === T.Star || t === T.Polygon || t === T.SpeechBalloon;
|
|
9391
9395
|
}
|
|
9392
9396
|
get isCanDrawWork() {
|
|
9393
9397
|
var e;
|
|
9394
9398
|
const t = (e = this.currentToolsData) == null ? void 0 : e.toolsType;
|
|
9395
|
-
return t ===
|
|
9399
|
+
return t === T.Pencil || t === T.LaserPen || t === T.Arrow || t === T.Straight || t === T.Ellipse || t === T.Rectangle || t === T.Star || t === T.Polygon || t === T.SpeechBalloon || t === T.Triangle || t === T.Rhombus || t === T.BitMapEraser;
|
|
9396
9400
|
}
|
|
9397
9401
|
get isUseZIndex() {
|
|
9398
9402
|
var e;
|
|
9399
9403
|
const t = (e = this.currentToolsData) == null ? void 0 : e.toolsType;
|
|
9400
|
-
return t ===
|
|
9404
|
+
return t === T.Pencil || t === T.Arrow || t === T.Straight || t === T.Ellipse || t === T.Rectangle || t === T.Star || t === T.Polygon || t === T.SpeechBalloon || t === T.Text || t === T.Image;
|
|
9401
9405
|
}
|
|
9402
9406
|
get isCanRecordUndoRedo() {
|
|
9403
9407
|
var e;
|
|
9404
9408
|
const t = (e = this.currentToolsData) == null ? void 0 : e.toolsType;
|
|
9405
|
-
return t ===
|
|
9409
|
+
return t === T.Pencil || t === T.Eraser || t === T.BitMapEraser || t === T.Arrow || t === T.Straight || t === T.Ellipse || t === T.Rectangle || t === T.Star || t === T.Polygon || t === T.SpeechBalloon || t === T.Text || t === T.Image;
|
|
9406
9410
|
}
|
|
9407
9411
|
get isCanSentCursor() {
|
|
9408
9412
|
var e;
|
|
9409
9413
|
const t = (e = this.currentToolsData) == null ? void 0 : e.toolsType;
|
|
9410
|
-
return t ===
|
|
9414
|
+
return t === T.Pencil || t === T.Text || t === T.LaserPen || t === T.Arrow || t === T.Straight || t === T.Ellipse || t === T.Rectangle || t === T.Star || t === T.Polygon || t === T.SpeechBalloon || t === T.Triangle || t === T.Rhombus || t === T.Eraser || t === T.PencilEraser || t === T.BitMapEraser;
|
|
9411
9415
|
}
|
|
9412
9416
|
get isCanStartEventConsum() {
|
|
9413
9417
|
var e;
|
|
9414
9418
|
const t = (e = this.currentToolsData) == null ? void 0 : e.toolsType;
|
|
9415
|
-
return t ===
|
|
9419
|
+
return t === T.Selector || t === T.Eraser || t === T.PencilEraser || t === T.BitMapEraser;
|
|
9416
9420
|
}
|
|
9417
9421
|
async init() {
|
|
9418
9422
|
this.destroy(), await this.on(), this.internalMsgEmitterListener(), this.isActive = !0;
|
|
9419
9423
|
}
|
|
9420
9424
|
async useMainThread() {
|
|
9421
9425
|
console.info("no OffscreenCanvas");
|
|
9422
|
-
const { MainThreadManagerImpl: t } = await import("./index-
|
|
9426
|
+
const { MainThreadManagerImpl: t } = await import("./index-q_QiZFx8.mjs");
|
|
9423
9427
|
this.mainThread = new t(this);
|
|
9424
9428
|
}
|
|
9425
9429
|
async on() {
|
|
@@ -9528,11 +9532,11 @@ class uw extends hw {
|
|
|
9528
9532
|
fillColor: f,
|
|
9529
9533
|
willSyncService: y,
|
|
9530
9534
|
isSync: M,
|
|
9531
|
-
imageBitmap:
|
|
9535
|
+
imageBitmap: N,
|
|
9532
9536
|
canvasHeight: w,
|
|
9533
9537
|
canvasWidth: m,
|
|
9534
9538
|
rect: S,
|
|
9535
|
-
op:
|
|
9539
|
+
op: I,
|
|
9536
9540
|
canTextEdit: v,
|
|
9537
9541
|
points: x,
|
|
9538
9542
|
selectorColor: L,
|
|
@@ -9564,9 +9568,9 @@ class uw extends hw {
|
|
|
9564
9568
|
break;
|
|
9565
9569
|
}
|
|
9566
9570
|
case b.Snapshot:
|
|
9567
|
-
if (
|
|
9571
|
+
if (N && J) {
|
|
9568
9572
|
const V = this.snapshotMap.get(J);
|
|
9569
|
-
V && V(
|
|
9573
|
+
V && V(N);
|
|
9570
9574
|
}
|
|
9571
9575
|
break;
|
|
9572
9576
|
case b.BoundingBox:
|
|
@@ -9576,7 +9580,7 @@ class uw extends hw {
|
|
|
9576
9580
|
}
|
|
9577
9581
|
break;
|
|
9578
9582
|
case b.Cursor:
|
|
9579
|
-
|
|
9583
|
+
I && this.control.cursor.collectServiceCursor({ ...c });
|
|
9580
9584
|
break;
|
|
9581
9585
|
case b.Clear:
|
|
9582
9586
|
if (E) {
|
|
@@ -9586,7 +9590,7 @@ class uw extends hw {
|
|
|
9586
9590
|
}
|
|
9587
9591
|
break;
|
|
9588
9592
|
case b.TextUpdate:
|
|
9589
|
-
if (O ===
|
|
9593
|
+
if (O === T.Text && z && E) {
|
|
9590
9594
|
const V = this.viewContainerManager.transformToOriginPoint((u == null ? void 0 : u.boxPoint) || [0, 0], E), ut = (u == null ? void 0 : u.boxSize) || [0, 0], wt = (n = this.viewContainerManager.getView(E)) == null ? void 0 : n.cameraOpt;
|
|
9591
9595
|
u ? this.control.textEditorManager.updateTextForWorker({
|
|
9592
9596
|
x: V[0],
|
|
@@ -9604,7 +9608,7 @@ class uw extends hw {
|
|
|
9604
9608
|
}
|
|
9605
9609
|
break;
|
|
9606
9610
|
case b.GetTextActive:
|
|
9607
|
-
O ===
|
|
9611
|
+
O === T.Text && z && E && this.control.textEditorManager.updateTextForWorker({
|
|
9608
9612
|
workId: z,
|
|
9609
9613
|
isActive: !0,
|
|
9610
9614
|
viewId: E,
|
|
@@ -9654,12 +9658,12 @@ class uw extends hw {
|
|
|
9654
9658
|
collectorAsyncData(t) {
|
|
9655
9659
|
var e, i, s, n;
|
|
9656
9660
|
for (const r of t) {
|
|
9657
|
-
const { type: c, op: l, workId: h, index: u, removeIds: d, ops: p, opt: f, updateNodeOpt: y, toolsType: M, isSync:
|
|
9661
|
+
const { type: c, op: l, workId: h, index: u, removeIds: d, ops: p, opt: f, updateNodeOpt: y, toolsType: M, isSync: N, viewId: w, isLockSentEventCursor: m, nextTasks: S } = r;
|
|
9658
9662
|
if (!w) {
|
|
9659
9663
|
console.error("collectorAsyncData", r);
|
|
9660
9664
|
return;
|
|
9661
9665
|
}
|
|
9662
|
-
const
|
|
9666
|
+
const I = r.scenePath || this.viewContainerManager.getCurScenePath(w);
|
|
9663
9667
|
switch (c) {
|
|
9664
9668
|
case b.None: {
|
|
9665
9669
|
m && Zt(() => {
|
|
@@ -9675,9 +9679,9 @@ class uw extends hw {
|
|
|
9675
9679
|
toolsType: M,
|
|
9676
9680
|
workId: h,
|
|
9677
9681
|
index: u,
|
|
9678
|
-
isSync:
|
|
9682
|
+
isSync: N,
|
|
9679
9683
|
viewId: w,
|
|
9680
|
-
scenePath:
|
|
9684
|
+
scenePath: I,
|
|
9681
9685
|
updateNodeOpt: y
|
|
9682
9686
|
});
|
|
9683
9687
|
break;
|
|
@@ -9690,20 +9694,20 @@ class uw extends hw {
|
|
|
9690
9694
|
updateNodeOpt: y,
|
|
9691
9695
|
opt: f,
|
|
9692
9696
|
toolsType: M,
|
|
9693
|
-
isSync:
|
|
9697
|
+
isSync: N,
|
|
9694
9698
|
viewId: w,
|
|
9695
|
-
scenePath:
|
|
9699
|
+
scenePath: I
|
|
9696
9700
|
}), this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
|
|
9697
9701
|
this.setShapeSelectorByWorkId(this.willSelectorWorkId, w), this.willSelectorWorkId = void 0;
|
|
9698
9702
|
});
|
|
9699
9703
|
break;
|
|
9700
9704
|
}
|
|
9701
9705
|
case b.UpdateNode: {
|
|
9702
|
-
(s = this.collector) == null || s.dispatch({ type: c, updateNodeOpt: y, workId: h, opt: f, ops: p, op: l, isSync:
|
|
9706
|
+
(s = this.collector) == null || s.dispatch({ type: c, updateNodeOpt: y, workId: h, opt: f, ops: p, op: l, isSync: N, viewId: w, scenePath: I });
|
|
9703
9707
|
break;
|
|
9704
9708
|
}
|
|
9705
9709
|
case b.RemoveNode: {
|
|
9706
|
-
d && this.control.textEditorManager.deleteBatch(d, !1, !1), (n = this.collector) == null || n.dispatch({ type: c, removeIds: d, isSync:
|
|
9710
|
+
d && this.control.textEditorManager.deleteBatch(d, !1, !1), (n = this.collector) == null || n.dispatch({ type: c, removeIds: d, isSync: N, viewId: w, scenePath: I }), this.willSelectorWorkId && (d != null && d.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
|
|
9707
9711
|
break;
|
|
9708
9712
|
}
|
|
9709
9713
|
}
|
|
@@ -9719,7 +9723,7 @@ class uw extends hw {
|
|
|
9719
9723
|
return;
|
|
9720
9724
|
const { focusScenePath: s, cameraOpt: n } = i, r = this.viewContainerManager.transformToScenePoint(t, e), c = [];
|
|
9721
9725
|
for (const h of this.localPointsBatchData.keys())
|
|
9722
|
-
if (((l = this.currentToolsData) == null ? void 0 : l.toolsType) ===
|
|
9726
|
+
if (((l = this.currentToolsData) == null ? void 0 : l.toolsType) === T.Text) {
|
|
9723
9727
|
const u = this.getLocalPointInfo(h), d = u == null ? void 0 : u.state;
|
|
9724
9728
|
if (d && d === P.Start) {
|
|
9725
9729
|
const p = this.currentLocalWorkData.toolsOpt;
|
|
@@ -9761,7 +9765,7 @@ class uw extends hw {
|
|
|
9761
9765
|
}
|
|
9762
9766
|
onLocalEventDoing(t, e) {
|
|
9763
9767
|
var s;
|
|
9764
|
-
if (((s = this.currentToolsData) == null ? void 0 : s.toolsType) ===
|
|
9768
|
+
if (((s = this.currentToolsData) == null ? void 0 : s.toolsType) === T.Text)
|
|
9765
9769
|
return;
|
|
9766
9770
|
this.currentLocalWorkData.workState === P.Start && this.setCurrentLocalWorkData({ ...this.currentLocalWorkData, workState: P.Doing });
|
|
9767
9771
|
let i = !1;
|
|
@@ -9779,14 +9783,14 @@ class uw extends hw {
|
|
|
9779
9783
|
onLocalEventStart(t, e) {
|
|
9780
9784
|
var r, c, l, h, u, d;
|
|
9781
9785
|
this.viewContainerManager.focuedViewId !== e && this.viewContainerManager.setFocuedViewId(e), this.isCanDrawWork && this.control.room && !this.control.room.disableDeviceInputs && (this.control.room.disableDeviceInputs = !0);
|
|
9782
|
-
const i = ((r = this.currentToolsData) == null ? void 0 : r.toolsType) ===
|
|
9786
|
+
const i = ((r = this.currentToolsData) == null ? void 0 : r.toolsType) === T.Selector ? $ : Date.now(), s = this.setZIndex(e);
|
|
9783
9787
|
this.setCurrentLocalWorkData({
|
|
9784
9788
|
workState: P.Start,
|
|
9785
9789
|
toolsOpt: s,
|
|
9786
9790
|
viewId: e
|
|
9787
9791
|
});
|
|
9788
9792
|
const n = this.viewContainerManager.transformToScenePoint(t, e);
|
|
9789
|
-
if (this.pushLocalPoint(i, n, P.Start, e, s), ((c = this.currentToolsData) == null ? void 0 : c.toolsType) !==
|
|
9793
|
+
if (this.pushLocalPoint(i, n, P.Start, e, s), ((c = this.currentToolsData) == null ? void 0 : c.toolsType) !== T.Text) {
|
|
9790
9794
|
if (this.control.textEditorManager.checkEmptyTextBlur(), this.isCanRecordUndoRedo && this.internalMsgEmitter.emit("addUndoTicker", i, e), i && s && ((l = this.currentToolsData) != null && l.toolsType) && this.isCanStartEventConsum && this.prepareOnceWork({ workId: i, toolsOpt: s, viewId: e }, (h = this.currentToolsData) == null ? void 0 : h.toolsType), this.maxDrawCount = 0, this.wokerDrawCount = 0, this.subWorkerDrawCount = 0, this.clearReRenders(1 / 0), (u = this.subMainThreadWorker) == null || u.clearDrawCount(e), this.isCanDrawWork) {
|
|
9791
9795
|
const p = this.viewContainerManager.getCurScenePath(e);
|
|
9792
9796
|
p && ((d = this.collector) != null && d.hasSelector(e, p)) && this.blurSelector(e, p);
|
|
@@ -9849,9 +9853,9 @@ class uw extends hw {
|
|
|
9849
9853
|
const s = (r = this.collector) == null ? void 0 : r.uid, n = this.viewContainerManager.getCurScenePath(i);
|
|
9850
9854
|
if (!(s && !this.control.renderControl.isWriteable())) {
|
|
9851
9855
|
switch ((c = this.currentToolsData) == null ? void 0 : c.toolsType) {
|
|
9852
|
-
case
|
|
9853
|
-
case
|
|
9854
|
-
case
|
|
9856
|
+
case T.Eraser:
|
|
9857
|
+
case T.PencilEraser:
|
|
9858
|
+
case T.BitMapEraser: {
|
|
9855
9859
|
if (s && !this.control.renderControl.isClearAble({ uid: s, viewId: i, scenePath: n }))
|
|
9856
9860
|
return;
|
|
9857
9861
|
break;
|
|
@@ -9864,7 +9868,7 @@ class uw extends hw {
|
|
|
9864
9868
|
}
|
|
9865
9869
|
switch (Zt(() => {
|
|
9866
9870
|
this.control.pluginManager.dispatchPluginEvent("localEvent", i, t, e);
|
|
9867
|
-
},
|
|
9871
|
+
}, ui), t) {
|
|
9868
9872
|
case P.Start:
|
|
9869
9873
|
this.setLocalWorkViewId(i), i && this.onLocalEventStart(e, i);
|
|
9870
9874
|
break;
|
|
@@ -9949,7 +9953,7 @@ class uw extends hw {
|
|
|
9949
9953
|
}), this.control.renderControl.destoryByViewId(t, e);
|
|
9950
9954
|
}
|
|
9951
9955
|
onServiceDerive(t, e) {
|
|
9952
|
-
var p, f, y, M,
|
|
9956
|
+
var p, f, y, M, N;
|
|
9953
9957
|
const { newValue: i, oldValue: s, viewId: n, scenePath: r } = e, c = dt(i) || {}, l = t;
|
|
9954
9958
|
let h = c.type;
|
|
9955
9959
|
if (!i && s) {
|
|
@@ -9957,7 +9961,7 @@ class uw extends hw {
|
|
|
9957
9961
|
this.collector.isOwn(l) ? this.blurSelector(n, r) : this.blurSelector(n, r, l);
|
|
9958
9962
|
return;
|
|
9959
9963
|
}
|
|
9960
|
-
if (h = b.RemoveNode, s.toolsType ===
|
|
9964
|
+
if (h = b.RemoveNode, s.toolsType === T.LaserPen)
|
|
9961
9965
|
return;
|
|
9962
9966
|
}
|
|
9963
9967
|
const u = (f = this.viewContainerManager.getView(n)) == null ? void 0 : f.focusScenePath;
|
|
@@ -9967,17 +9971,17 @@ class uw extends hw {
|
|
|
9967
9971
|
if (!this.control.renderControl.isFilterAble({ viewId: n, elementId: t, scenePath: r }, h))
|
|
9968
9972
|
return;
|
|
9969
9973
|
const w = c;
|
|
9970
|
-
if (w.workId = (y = this.collector) != null && y.isOwn(l) ? (M = this.collector) == null ? void 0 : M.getLocalId(l) : l, w.msgType = h, w.toolsType ===
|
|
9971
|
-
var S,
|
|
9972
|
-
return (S = this.collector) != null && S.isOwn(m) ? (
|
|
9973
|
-
})), w && w.toolsType ===
|
|
9974
|
+
if (w.workId = (y = this.collector) != null && y.isOwn(l) ? (M = this.collector) == null ? void 0 : M.getLocalId(l) : l, w.msgType = h, w.toolsType === T.LaserPen && (w.isRunSubWork = !0), w.dataType = U.Service, w.viewId = n, w.scenePath = r, w.selectIds && (w.selectIds = w.selectIds.map((m) => {
|
|
9975
|
+
var S, I;
|
|
9976
|
+
return (S = this.collector) != null && S.isOwn(m) ? (I = this.collector) == null ? void 0 : I.getLocalId(m) : m;
|
|
9977
|
+
})), w && w.toolsType === T.Text || (s == null ? void 0 : s.toolsType) === T.Text) {
|
|
9974
9978
|
this.control.textEditorManager.onServiceDerive(w);
|
|
9975
9979
|
return;
|
|
9976
9980
|
}
|
|
9977
9981
|
this.taskBatchData.add(w);
|
|
9978
9982
|
}
|
|
9979
9983
|
this.runAnimation();
|
|
9980
|
-
const d = e.newValue && ((
|
|
9984
|
+
const d = e.newValue && ((N = e.newValue.opt) == null ? void 0 : N.zIndex);
|
|
9981
9985
|
if (this.zIndexNodeMethod && ot(d)) {
|
|
9982
9986
|
const w = this.zIndexNodeMethod.getMinZIndex(n);
|
|
9983
9987
|
this.zIndexNodeMethod.getMaxZIndex(n) < d && this.zIndexNodeMethod.setMaxZIndex(d, n), w > d && this.zIndexNodeMethod.setMinZIndex(d, n);
|
|
@@ -10000,9 +10004,9 @@ class uw extends hw {
|
|
|
10000
10004
|
continue;
|
|
10001
10005
|
const y = s[p];
|
|
10002
10006
|
if (y.workId = (h = this.collector) != null && h.isOwn(p) ? (u = this.collector) == null ? void 0 : u.getLocalId(p) : p, y.msgType = f, y.dataType = U.Service, y.viewId = t, y.scenePath = e, y.useAnimation = !!r, y.selectIds && (y.selectIds = y.selectIds.map((M) => {
|
|
10003
|
-
var
|
|
10004
|
-
return (
|
|
10005
|
-
})), y.toolsType ===
|
|
10007
|
+
var N, w;
|
|
10008
|
+
return (N = this.collector) != null && N.isOwn(M) ? (w = this.collector) == null ? void 0 : w.getLocalId(M) : M;
|
|
10009
|
+
})), y.toolsType === T.Text) {
|
|
10006
10010
|
this.control.textEditorManager.onServiceDerive(y);
|
|
10007
10011
|
continue;
|
|
10008
10012
|
}
|
|
@@ -10273,7 +10277,7 @@ class uw extends hw {
|
|
|
10273
10277
|
}
|
|
10274
10278
|
hoverCursor(t, e) {
|
|
10275
10279
|
var i;
|
|
10276
|
-
if (((i = this.currentToolsData) == null ? void 0 : i.toolsType) ===
|
|
10280
|
+
if (((i = this.currentToolsData) == null ? void 0 : i.toolsType) === T.Selector) {
|
|
10277
10281
|
const s = this.viewContainerManager.getView(e);
|
|
10278
10282
|
if (s && s.displayer && s.displayer.vDom) {
|
|
10279
10283
|
const c = s.displayer.vDom.state.floatBarData;
|
|
@@ -10304,7 +10308,7 @@ class uw extends hw {
|
|
|
10304
10308
|
}
|
|
10305
10309
|
blurCursor(t) {
|
|
10306
10310
|
var i;
|
|
10307
|
-
if (((i = this.currentToolsData) == null ? void 0 : i.toolsType) !==
|
|
10311
|
+
if (((i = this.currentToolsData) == null ? void 0 : i.toolsType) !== T.Selector)
|
|
10308
10312
|
return;
|
|
10309
10313
|
const e = {
|
|
10310
10314
|
msgType: b.CursorBlur,
|
|
@@ -10326,9 +10330,9 @@ class uw extends hw {
|
|
|
10326
10330
|
return;
|
|
10327
10331
|
const i = (r = this.collector) == null ? void 0 : r.uid, s = this.viewContainerManager.getCurScenePath(e);
|
|
10328
10332
|
switch ((c = this.currentToolsData) == null ? void 0 : c.toolsType) {
|
|
10329
|
-
case
|
|
10330
|
-
case
|
|
10331
|
-
case
|
|
10333
|
+
case T.Eraser:
|
|
10334
|
+
case T.PencilEraser:
|
|
10335
|
+
case T.BitMapEraser: {
|
|
10332
10336
|
if (i && !this.control.renderControl.isClearAble({ uid: i, viewId: e, filterLocalSelf: !1, scenePath: s }))
|
|
10333
10337
|
return;
|
|
10334
10338
|
break;
|
|
@@ -10382,7 +10386,7 @@ class uw extends hw {
|
|
|
10382
10386
|
const f = this.viewContainerManager.mainView;
|
|
10383
10387
|
if (!f)
|
|
10384
10388
|
return;
|
|
10385
|
-
const y = e || ((h = f.cameraOpt) == null ? void 0 : h.width), M = i || ((u = f.cameraOpt) == null ? void 0 : u.height),
|
|
10389
|
+
const y = e || ((h = f.cameraOpt) == null ? void 0 : h.width), M = i || ((u = f.cameraOpt) == null ? void 0 : u.height), N = {
|
|
10386
10390
|
msgType: b.Snapshot,
|
|
10387
10391
|
dataType: U.Local,
|
|
10388
10392
|
scenePath: t,
|
|
@@ -10398,7 +10402,7 @@ class uw extends hw {
|
|
|
10398
10402
|
viewId: f.id
|
|
10399
10403
|
// maxZIndex: this.zIndexNodeMethod?.getMaxZIndex(viewId)
|
|
10400
10404
|
};
|
|
10401
|
-
return this.taskBatchData.add(
|
|
10405
|
+
return this.taskBatchData.add(N), this.runAnimation(), new Promise((w) => {
|
|
10402
10406
|
this.snapshotMap.set(t, w);
|
|
10403
10407
|
}).then((w) => (this.snapshotMap.delete(t), w));
|
|
10404
10408
|
}
|
|
@@ -10436,7 +10440,7 @@ class uw extends hw {
|
|
|
10436
10440
|
this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayer(t), l.zIndex = this.zIndexNodeMethod.getMaxZIndex(t)), this.taskBatchData.add({
|
|
10437
10441
|
msgType: b.FullWork,
|
|
10438
10442
|
dataType: U.Local,
|
|
10439
|
-
toolsType:
|
|
10443
|
+
toolsType: T.Image,
|
|
10440
10444
|
workId: e.uuid,
|
|
10441
10445
|
opt: l,
|
|
10442
10446
|
viewId: t,
|
|
@@ -10464,7 +10468,7 @@ class uw extends hw {
|
|
|
10464
10468
|
this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayer(t), l.zIndex = this.zIndexNodeMethod.getMaxZIndex(t)), this.taskBatchData.add({
|
|
10465
10469
|
msgType: b.FullWork,
|
|
10466
10470
|
dataType: U.Local,
|
|
10467
|
-
toolsType:
|
|
10471
|
+
toolsType: T.Image,
|
|
10468
10472
|
workId: e.uuid,
|
|
10469
10473
|
opt: l,
|
|
10470
10474
|
viewId: t,
|
|
@@ -10484,14 +10488,14 @@ class uw extends hw {
|
|
|
10484
10488
|
if (!l)
|
|
10485
10489
|
return;
|
|
10486
10490
|
for (const [h, u] of Object.entries(l))
|
|
10487
|
-
if (u && u.toolsType ===
|
|
10491
|
+
if (u && u.toolsType === T.Image && u.opt.uuid === e) {
|
|
10488
10492
|
const d = Date.now();
|
|
10489
10493
|
Ct.InternalMsgEmitter.emit("addUndoTicker", d, t);
|
|
10490
10494
|
const p = (r = this.collector) != null && r.isOwn(h) ? (c = this.collector) == null ? void 0 : c.getLocalId(h) : h, f = { ...u.opt, locked: i, type: ze.Image };
|
|
10491
10495
|
this.taskBatchData.add({
|
|
10492
10496
|
msgType: b.FullWork,
|
|
10493
10497
|
dataType: U.Local,
|
|
10494
|
-
toolsType:
|
|
10498
|
+
toolsType: T.Image,
|
|
10495
10499
|
workId: p,
|
|
10496
10500
|
opt: f,
|
|
10497
10501
|
viewId: t,
|
|
@@ -10520,7 +10524,7 @@ class uw extends hw {
|
|
|
10520
10524
|
if (!i)
|
|
10521
10525
|
return e;
|
|
10522
10526
|
for (const s of Object.values(i))
|
|
10523
|
-
if (s && s.toolsType ===
|
|
10527
|
+
if (s && s.toolsType === T.Image) {
|
|
10524
10528
|
const n = s.opt;
|
|
10525
10529
|
e.push({
|
|
10526
10530
|
uuid: n.uuid,
|
|
@@ -10671,7 +10675,7 @@ class dw {
|
|
|
10671
10675
|
}
|
|
10672
10676
|
get isSelector() {
|
|
10673
10677
|
var o;
|
|
10674
|
-
return ((o = this.control.worker.currentToolsData) == null ? void 0 : o.toolsType) ===
|
|
10678
|
+
return ((o = this.control.worker.currentToolsData) == null ? void 0 : o.toolsType) === T.Selector;
|
|
10675
10679
|
}
|
|
10676
10680
|
get collector() {
|
|
10677
10681
|
return this.control.collector;
|
|
@@ -11041,13 +11045,13 @@ class pw {
|
|
|
11041
11045
|
const { render: p, pages: f } = d;
|
|
11042
11046
|
if (!p)
|
|
11043
11047
|
return !0;
|
|
11044
|
-
const y = (u = this.control.collector) == null ? void 0 : u.uid, M = p === "localSelf" ? y : p,
|
|
11045
|
-
if (
|
|
11048
|
+
const y = (u = this.control.collector) == null ? void 0 : u.uid, M = p === "localSelf" ? y : p, N = M && f.get(M) || void 0;
|
|
11049
|
+
if (N)
|
|
11046
11050
|
switch (t) {
|
|
11047
11051
|
case b.RemoveNode:
|
|
11048
11052
|
return !0;
|
|
11049
11053
|
default:
|
|
11050
|
-
return
|
|
11054
|
+
return N.has(s);
|
|
11051
11055
|
}
|
|
11052
11056
|
return !1;
|
|
11053
11057
|
}
|
|
@@ -11201,7 +11205,7 @@ class fw {
|
|
|
11201
11205
|
g(this, "showId");
|
|
11202
11206
|
g(this, "color");
|
|
11203
11207
|
g(this, "timer");
|
|
11204
|
-
g(this, "updateMiniMapCamera",
|
|
11208
|
+
g(this, "updateMiniMapCamera", Ms(async (o) => {
|
|
11205
11209
|
const t = this.maps.get(o);
|
|
11206
11210
|
if (t) {
|
|
11207
11211
|
const e = await this.getMiniMapCamera(o);
|
|
@@ -11279,7 +11283,7 @@ class fw {
|
|
|
11279
11283
|
height: e.height / e.scale
|
|
11280
11284
|
};
|
|
11281
11285
|
let n = await this.control.getBoundingRect(i) || s;
|
|
11282
|
-
n =
|
|
11286
|
+
n = di(n, s) || s;
|
|
11283
11287
|
let r = n.width, c = n.height, l = 1;
|
|
11284
11288
|
const h = r > e.width && Math.min(e.width / r, l) || l, u = c > e.height && Math.min(e.height / c, l) || l;
|
|
11285
11289
|
return h <= u ? (r = h < 1 && e.width || r, c = Math.floor(c * h) + 1, l = h) : h > u && (c = u < 1 && e.height || c, r = Math.floor(r * u) + 1, l = u), {
|
|
@@ -11346,7 +11350,7 @@ class yw {
|
|
|
11346
11350
|
}
|
|
11347
11351
|
const ye = class ye {
|
|
11348
11352
|
constructor(o) {
|
|
11349
|
-
g(this, "version",
|
|
11353
|
+
g(this, "version", Qs);
|
|
11350
11354
|
g(this, "plugin");
|
|
11351
11355
|
g(this, "room");
|
|
11352
11356
|
g(this, "play");
|
|
@@ -11410,7 +11414,7 @@ const ye = class ye {
|
|
|
11410
11414
|
this.priority = o, this.hasOffscreenCanvas() && ((t = this.worker) == null || t.setPriority(o));
|
|
11411
11415
|
}
|
|
11412
11416
|
hasOffscreenCanvas() {
|
|
11413
|
-
return
|
|
11417
|
+
return ri === "worker";
|
|
11414
11418
|
}
|
|
11415
11419
|
bindPlugin(o) {
|
|
11416
11420
|
var t, e;
|
|
@@ -11439,37 +11443,37 @@ const ye = class ye {
|
|
|
11439
11443
|
const t = o.currentApplianceName;
|
|
11440
11444
|
switch (this.hasSwitchToSelectorEffect = !1, t) {
|
|
11441
11445
|
case nt.text:
|
|
11442
|
-
return o.textCompleteToSelector && (this.hasSwitchToSelectorEffect = !0),
|
|
11446
|
+
return o.textCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Text;
|
|
11443
11447
|
case nt.pencil:
|
|
11444
|
-
return o.useLaserPen ?
|
|
11448
|
+
return o.useLaserPen ? T.LaserPen : T.Pencil;
|
|
11445
11449
|
case nt.eraser:
|
|
11446
|
-
return
|
|
11450
|
+
return T.Eraser;
|
|
11447
11451
|
case nt.pencilEraser:
|
|
11448
|
-
return ((e = this.pluginOptions.pencilEraser) == null ? void 0 : e.useBitMap) === !1 ?
|
|
11452
|
+
return ((e = this.pluginOptions.pencilEraser) == null ? void 0 : e.useBitMap) === !1 ? T.PencilEraser : T.BitMapEraser;
|
|
11449
11453
|
case nt.selector:
|
|
11450
|
-
return
|
|
11454
|
+
return T.Selector;
|
|
11451
11455
|
case nt.arrow:
|
|
11452
|
-
return o.arrowCompleteToSelector && (this.hasSwitchToSelectorEffect = !0),
|
|
11456
|
+
return o.arrowCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Arrow;
|
|
11453
11457
|
case nt.straight:
|
|
11454
|
-
return o.straightCompleteToSelector && (this.hasSwitchToSelectorEffect = !0),
|
|
11458
|
+
return o.straightCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Straight;
|
|
11455
11459
|
case nt.ellipse:
|
|
11456
|
-
return o.ellipseCompleteToSelector && (this.hasSwitchToSelectorEffect = !0),
|
|
11460
|
+
return o.ellipseCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Ellipse;
|
|
11457
11461
|
case nt.rectangle:
|
|
11458
|
-
return o.rectangleCompleteToSelector && (this.hasSwitchToSelectorEffect = !0),
|
|
11462
|
+
return o.rectangleCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Rectangle;
|
|
11459
11463
|
case nt.shape:
|
|
11460
11464
|
if (o.shapeCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), o.shapeType === te.Pentagram || o.shapeType === te.Star)
|
|
11461
|
-
return
|
|
11465
|
+
return T.Star;
|
|
11462
11466
|
if (o.shapeType === te.Polygon || o.shapeType === te.Triangle || o.shapeType === te.Rhombus)
|
|
11463
|
-
return
|
|
11467
|
+
return T.Polygon;
|
|
11464
11468
|
if (o.shapeType === te.SpeechBalloon)
|
|
11465
|
-
return
|
|
11469
|
+
return T.SpeechBalloon;
|
|
11466
11470
|
break;
|
|
11467
11471
|
}
|
|
11468
|
-
return
|
|
11472
|
+
return T.Clicker;
|
|
11469
11473
|
}
|
|
11470
11474
|
/** 获取当前工具默认配置 */
|
|
11471
11475
|
getToolsOpt(o, t) {
|
|
11472
|
-
if (o ===
|
|
11476
|
+
if (o === T.Clicker)
|
|
11473
11477
|
return {
|
|
11474
11478
|
toolsType: o,
|
|
11475
11479
|
toolsOpt: {}
|
|
@@ -11480,30 +11484,30 @@ const ye = class ye {
|
|
|
11480
11484
|
isOpacity: (t == null ? void 0 : t.strokeOpacity) && t.strokeOpacity < 1 || (t == null ? void 0 : t.fillOpacity) && t.fillOpacity < 1 || (t == null ? void 0 : t.textOpacity) && t.textOpacity < 1 || (t == null ? void 0 : t.textBgOpacity) && t.textBgOpacity < 1 || !1
|
|
11481
11485
|
};
|
|
11482
11486
|
switch (o) {
|
|
11483
|
-
case
|
|
11487
|
+
case T.Text:
|
|
11484
11488
|
e.fontFamily = window.getComputedStyle(document.documentElement).getPropertyValue("font-family"), e.fontSize = (t == null ? void 0 : t.textSizeOverride) || (t == null ? void 0 : t.textSize) || Number(window.getComputedStyle(document.body).fontSize), e.textAlign = (t == null ? void 0 : t.textAlign) || "left", e.verticalAlign = (t == null ? void 0 : t.verticalAlign) || "middle", e.fontColor = (t == null ? void 0 : t.textColor) && Fe(t.textColor[0], t.textColor[1], t.textColor[2], t.textOpacity || 1) || e.strokeColor || "rgba(0,0,0,1)", e.fontBgColor = Array.isArray(t == null ? void 0 : t.textBgColor) && Fe(t.textBgColor[0], t.textBgColor[1], t.textBgColor[2], t.textBgOpacity || 1) || "transparent", e.bold = (t == null ? void 0 : t.bold) && "bold" || void 0, e.italic = (t == null ? void 0 : t.italic) && "italic" || void 0, e.underline = (t == null ? void 0 : t.underline) || void 0, e.lineThrough = (t == null ? void 0 : t.lineThrough) || void 0, e.text = "", e.strokeColor = void 0;
|
|
11485
11489
|
break;
|
|
11486
|
-
case
|
|
11490
|
+
case T.Pencil:
|
|
11487
11491
|
e.strokeType = (t == null ? void 0 : t.strokeType) || et.Normal;
|
|
11488
11492
|
break;
|
|
11489
|
-
case
|
|
11490
|
-
case
|
|
11491
|
-
case
|
|
11493
|
+
case T.PencilEraser:
|
|
11494
|
+
case T.BitMapEraser:
|
|
11495
|
+
case T.Eraser:
|
|
11492
11496
|
e.thickness = Math.min(3, Math.max(1, Math.floor(t.pencilEraserSize || 1))) - 1;
|
|
11493
11497
|
break;
|
|
11494
|
-
case
|
|
11498
|
+
case T.LaserPen:
|
|
11495
11499
|
e.duration = (t == null ? void 0 : t.duration) || 1, t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === et.Stroke ? e.strokeType = et.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || et.Normal;
|
|
11496
11500
|
break;
|
|
11497
|
-
case
|
|
11498
|
-
case
|
|
11501
|
+
case T.Arrow:
|
|
11502
|
+
case T.Straight:
|
|
11499
11503
|
t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === et.Stroke ? e.strokeType = et.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || et.Normal;
|
|
11500
11504
|
break;
|
|
11501
|
-
case
|
|
11502
|
-
case
|
|
11503
|
-
case
|
|
11504
|
-
case
|
|
11505
|
-
case
|
|
11506
|
-
t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === et.Stroke ? e.strokeType = et.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || et.Normal, o ===
|
|
11505
|
+
case T.Ellipse:
|
|
11506
|
+
case T.Rectangle:
|
|
11507
|
+
case T.Star:
|
|
11508
|
+
case T.Polygon:
|
|
11509
|
+
case T.SpeechBalloon:
|
|
11510
|
+
t != null && t.strokeType && (t == null ? void 0 : t.strokeType) === et.Stroke ? e.strokeType = et.Normal : e.strokeType = (t == null ? void 0 : t.strokeType) || et.Normal, o === T.Star && (t.shapeType === te.Pentagram ? (e.vertices = 10, e.innerVerticeStep = 2, e.innerRatio = 0.4) : t != null && t.vertices && (t != null && t.innerVerticeStep) && (t != null && t.innerRatio) && (e.vertices = t.vertices, e.innerVerticeStep = t.innerVerticeStep, e.innerRatio = t.innerRatio)), o === T.Polygon && (t.shapeType === te.Triangle ? e.vertices = 3 : t.shapeType === te.Rhombus ? e.vertices = 4 : t.vertices && (e.vertices = t.vertices)), e.fillColor = (t == null ? void 0 : t.fillColor) && Fe(t.fillColor[0], t.fillColor[1], t.fillColor[2], t == null ? void 0 : t.fillOpacity) || "transparent", o === T.SpeechBalloon && (e.placement = t.placement || "bottomLeft");
|
|
11507
11511
|
break;
|
|
11508
11512
|
}
|
|
11509
11513
|
return {
|
|
@@ -11515,24 +11519,24 @@ const ye = class ye {
|
|
|
11515
11519
|
effectViewContainer(o) {
|
|
11516
11520
|
var t, e, i, s, n;
|
|
11517
11521
|
switch (o) {
|
|
11518
|
-
case
|
|
11519
|
-
case
|
|
11520
|
-
case
|
|
11521
|
-
case
|
|
11522
|
-
case
|
|
11523
|
-
case
|
|
11524
|
-
case
|
|
11525
|
-
case
|
|
11526
|
-
case
|
|
11527
|
-
case
|
|
11528
|
-
case
|
|
11529
|
-
case
|
|
11530
|
-
case
|
|
11531
|
-
case
|
|
11532
|
-
case
|
|
11522
|
+
case T.Text:
|
|
11523
|
+
case T.Pencil:
|
|
11524
|
+
case T.LaserPen:
|
|
11525
|
+
case T.Arrow:
|
|
11526
|
+
case T.Straight:
|
|
11527
|
+
case T.Rectangle:
|
|
11528
|
+
case T.Ellipse:
|
|
11529
|
+
case T.Star:
|
|
11530
|
+
case T.Polygon:
|
|
11531
|
+
case T.SpeechBalloon:
|
|
11532
|
+
case T.Triangle:
|
|
11533
|
+
case T.Rhombus:
|
|
11534
|
+
case T.Eraser:
|
|
11535
|
+
case T.PencilEraser:
|
|
11536
|
+
case T.BitMapEraser:
|
|
11533
11537
|
this.room.disableDeviceInputs = !0, (t = this.worker) == null || t.abled();
|
|
11534
11538
|
break;
|
|
11535
|
-
case
|
|
11539
|
+
case T.Selector:
|
|
11536
11540
|
this.room.disableDeviceInputs = !1, (e = this.cursor) == null || e.unabled(), (i = this.worker) == null || i.abled();
|
|
11537
11541
|
break;
|
|
11538
11542
|
default:
|
|
@@ -11681,7 +11685,7 @@ const Me = class Me {
|
|
|
11681
11685
|
g(this, "scenePath");
|
|
11682
11686
|
g(this, "tickStartStorerCache");
|
|
11683
11687
|
g(this, "excludeIds", /* @__PURE__ */ new Set());
|
|
11684
|
-
g(this, "onChangeScene",
|
|
11688
|
+
g(this, "onChangeScene", Ms(() => {
|
|
11685
11689
|
const o = this.control.viewContainerManager.getCurScenePath(this.viewId);
|
|
11686
11690
|
if (o) {
|
|
11687
11691
|
let t = this.undoStack.filter((i) => i.scenePath === o).length;
|
|
@@ -11851,7 +11855,7 @@ const Me = class Me {
|
|
|
11851
11855
|
return !!t.includes(e);
|
|
11852
11856
|
}
|
|
11853
11857
|
refreshPlugin(o, t = !1) {
|
|
11854
|
-
var n, r, c, l, h, u, d, p, f, y, M,
|
|
11858
|
+
var n, r, c, l, h, u, d, p, f, y, M, N, w, m, S, I, v, x, L, A, j;
|
|
11855
11859
|
let e;
|
|
11856
11860
|
const { scenePath: i } = o, s = o.data;
|
|
11857
11861
|
if (!(!s || !this.collector))
|
|
@@ -11903,7 +11907,7 @@ const Me = class Me {
|
|
|
11903
11907
|
Q && (z.selectIds = H.filter((G) => !!G));
|
|
11904
11908
|
}
|
|
11905
11909
|
}
|
|
11906
|
-
(
|
|
11910
|
+
(N = this.collector) == null || N.updateValue(D.key, D.data, { isAfterUpdate: !0, viewId: this.viewId, scenePath: i, isSync: !0 });
|
|
11907
11911
|
}
|
|
11908
11912
|
}
|
|
11909
11913
|
break;
|
|
@@ -11924,7 +11928,7 @@ const Me = class Me {
|
|
|
11924
11928
|
let G = !1;
|
|
11925
11929
|
for (const K of Q)
|
|
11926
11930
|
for (let at = 0; at < Z.length; at++)
|
|
11927
|
-
K != null && K.selectIds && ((
|
|
11931
|
+
K != null && K.selectIds && ((I = K.selectIds) != null && I.includes(Z[at])) && (delete Z[at], G = !0);
|
|
11928
11932
|
G && (H.selectIds = Z.filter((K) => !!K));
|
|
11929
11933
|
}
|
|
11930
11934
|
}
|
|
@@ -12013,7 +12017,7 @@ class $e {
|
|
|
12013
12017
|
}
|
|
12014
12018
|
validator(o, t, e) {
|
|
12015
12019
|
var n;
|
|
12016
|
-
const i =
|
|
12020
|
+
const i = wi(o[t]), s = wi(e);
|
|
12017
12021
|
t === "focusScenePath" && e && !ft(i, s) && (this.control.internalSceneChange(o.id, s), (n = this.focuedView) == null || n.displayer.commiter.onChangeScene()), t === "cameraOpt" && !ft(i, s) && this.control.internalCameraChange(o.id, s);
|
|
12018
12022
|
}
|
|
12019
12023
|
destroyAppView(o, t = !1) {
|
|
@@ -12106,9 +12110,9 @@ class $e {
|
|
|
12106
12110
|
}
|
|
12107
12111
|
/** 绘制view */
|
|
12108
12112
|
render(o) {
|
|
12109
|
-
var t, e, i, s, n, r, c, l, h, u, d, p, f, y, M,
|
|
12113
|
+
var t, e, i, s, n, r, c, l, h, u, d, p, f, y, M, N, w;
|
|
12110
12114
|
for (const m of o) {
|
|
12111
|
-
const { rect: S, imageBitmap:
|
|
12115
|
+
const { rect: S, imageBitmap: I, isClear: v, isUnClose: x, drawCanvas: L, clearCanvas: A, viewId: j } = m, D = (t = this.getView(j)) == null ? void 0 : t.displayer;
|
|
12112
12116
|
if (D && S) {
|
|
12113
12117
|
const { dpr: O, canvasBgRef: z, canvasFloatRef: E, canvasServiceFloatRef: rt, canvasTopRef: tt } = D, H = Math.floor(S.w * O), Z = Math.floor(S.h * O), Q = S.x * O, G = S.y * O;
|
|
12114
12118
|
if (v) {
|
|
@@ -12128,27 +12132,27 @@ class $e {
|
|
|
12128
12132
|
}
|
|
12129
12133
|
continue;
|
|
12130
12134
|
}
|
|
12131
|
-
if (L &&
|
|
12135
|
+
if (L && I)
|
|
12132
12136
|
switch (L) {
|
|
12133
12137
|
case St.TopFloat:
|
|
12134
|
-
(d = (u = tt.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(
|
|
12138
|
+
(d = (u = tt.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(I, 0, 0, H, Z, Q, G, H, Z);
|
|
12135
12139
|
break;
|
|
12136
12140
|
case St.Float: {
|
|
12137
|
-
(f = (p = E.current) == null ? void 0 : p.getContext("2d")) == null || f.drawImage(
|
|
12141
|
+
(f = (p = E.current) == null ? void 0 : p.getContext("2d")) == null || f.drawImage(I, 0, 0, H, Z, Q, G, H, Z);
|
|
12138
12142
|
break;
|
|
12139
12143
|
}
|
|
12140
12144
|
case St.ServiceFloat: {
|
|
12141
|
-
(M = (y = rt.current) == null ? void 0 : y.getContext("2d")) == null || M.drawImage(
|
|
12145
|
+
(M = (y = rt.current) == null ? void 0 : y.getContext("2d")) == null || M.drawImage(I, 0, 0, H, Z, Q, G, H, Z);
|
|
12142
12146
|
break;
|
|
12143
12147
|
}
|
|
12144
12148
|
case St.Bg: {
|
|
12145
|
-
(w = (
|
|
12149
|
+
(w = (N = z.current) == null ? void 0 : N.getContext("2d")) == null || w.drawImage(I, 0, 0, H, Z, Q, G, H, Z);
|
|
12146
12150
|
break;
|
|
12147
12151
|
}
|
|
12148
12152
|
}
|
|
12149
12153
|
if (x)
|
|
12150
12154
|
continue;
|
|
12151
|
-
|
|
12155
|
+
I == null || I.close();
|
|
12152
12156
|
}
|
|
12153
12157
|
}
|
|
12154
12158
|
}
|
|
@@ -12271,20 +12275,20 @@ class ww {
|
|
|
12271
12275
|
var t, e;
|
|
12272
12276
|
const o = (e = (t = this.control.worker) == null ? void 0 : t.currentToolsData) == null ? void 0 : e.toolsType;
|
|
12273
12277
|
switch (o) {
|
|
12274
|
-
case
|
|
12275
|
-
case
|
|
12276
|
-
case
|
|
12277
|
-
case
|
|
12278
|
-
case
|
|
12279
|
-
case
|
|
12280
|
-
case
|
|
12281
|
-
case
|
|
12282
|
-
case
|
|
12283
|
-
case
|
|
12284
|
-
case
|
|
12285
|
-
case
|
|
12286
|
-
case
|
|
12287
|
-
this.eventTragetElement && (this.eventTragetElement.className = `netless-whiteboard ${o ===
|
|
12278
|
+
case T.Text:
|
|
12279
|
+
case T.Pencil:
|
|
12280
|
+
case T.LaserPen:
|
|
12281
|
+
case T.Arrow:
|
|
12282
|
+
case T.Straight:
|
|
12283
|
+
case T.Rectangle:
|
|
12284
|
+
case T.Ellipse:
|
|
12285
|
+
case T.Star:
|
|
12286
|
+
case T.Polygon:
|
|
12287
|
+
case T.SpeechBalloon:
|
|
12288
|
+
case T.Eraser:
|
|
12289
|
+
case T.PencilEraser:
|
|
12290
|
+
case T.BitMapEraser:
|
|
12291
|
+
this.eventTragetElement && (this.eventTragetElement.className = `netless-whiteboard ${o === T.Text ? "cursor-text" : o === T.Eraser || o === T.PencilEraser || o === T.BitMapEraser ? "cursor-eraser" : o === T.Pencil || o === T.LaserPen ? "cursor-pencil" : "cursor-arrow"}`);
|
|
12288
12292
|
break;
|
|
12289
12293
|
}
|
|
12290
12294
|
}
|
|
@@ -12428,20 +12432,20 @@ class fn {
|
|
|
12428
12432
|
var e, i;
|
|
12429
12433
|
const o = (i = (e = this.control.worker) == null ? void 0 : e.currentToolsData) == null ? void 0 : i.toolsType, t = this.control.renderControl.isWriteable();
|
|
12430
12434
|
switch (o) {
|
|
12431
|
-
case
|
|
12432
|
-
case
|
|
12433
|
-
case
|
|
12434
|
-
case
|
|
12435
|
-
case
|
|
12436
|
-
case
|
|
12437
|
-
case
|
|
12438
|
-
case
|
|
12439
|
-
case
|
|
12440
|
-
case
|
|
12441
|
-
case
|
|
12442
|
-
case
|
|
12443
|
-
case
|
|
12444
|
-
this.eventTragetElement && (this.eventTragetElement.className = t ? `netless-whiteboard ${o ===
|
|
12435
|
+
case T.Text:
|
|
12436
|
+
case T.Pencil:
|
|
12437
|
+
case T.LaserPen:
|
|
12438
|
+
case T.Arrow:
|
|
12439
|
+
case T.Straight:
|
|
12440
|
+
case T.Rectangle:
|
|
12441
|
+
case T.Ellipse:
|
|
12442
|
+
case T.Star:
|
|
12443
|
+
case T.Polygon:
|
|
12444
|
+
case T.SpeechBalloon:
|
|
12445
|
+
case T.Eraser:
|
|
12446
|
+
case T.PencilEraser:
|
|
12447
|
+
case T.BitMapEraser:
|
|
12448
|
+
this.eventTragetElement && (this.eventTragetElement.className = t ? `netless-whiteboard ${o === T.Text ? "cursor-text" : o === T.Eraser || o === T.PencilEraser || o === T.BitMapEraser ? "cursor-eraser" : o === T.Pencil || o === T.LaserPen ? "cursor-pencil" : "cursor-arrow"}` : "netless-whiteboard");
|
|
12445
12449
|
break;
|
|
12446
12450
|
}
|
|
12447
12451
|
}
|
|
@@ -12601,7 +12605,7 @@ const Aw = (a) => {
|
|
|
12601
12605
|
},
|
|
12602
12606
|
/* @__PURE__ */ k.createElement("img", { alt: "icon", src: Pt("duplicate") })
|
|
12603
12607
|
);
|
|
12604
|
-
},
|
|
12608
|
+
}, ls = (a) => {
|
|
12605
12609
|
const { icon: o, onClickHandler: t, onTouchEndHandler: e } = a;
|
|
12606
12610
|
return /* @__PURE__ */ k.createElement("div", { className: "button normal-button", onClick: t, onTouchEnd: e }, /* @__PURE__ */ k.createElement("img", { src: Pt(o) }));
|
|
12607
12611
|
}, Ew = (a) => {
|
|
@@ -12616,7 +12620,7 @@ const Aw = (a) => {
|
|
|
12616
12620
|
}
|
|
12617
12621
|
}
|
|
12618
12622
|
}, [e == null ? void 0 : e.current, i, s]), l = q(() => o ? /* @__PURE__ */ k.createElement("div", { className: "image-layer-menu", style: c }, /* @__PURE__ */ k.createElement(
|
|
12619
|
-
|
|
12623
|
+
ls,
|
|
12620
12624
|
{
|
|
12621
12625
|
icon: "to-top",
|
|
12622
12626
|
onClickHandler: (d) => {
|
|
@@ -12635,7 +12639,7 @@ const Aw = (a) => {
|
|
|
12635
12639
|
}
|
|
12636
12640
|
}
|
|
12637
12641
|
), /* @__PURE__ */ k.createElement(
|
|
12638
|
-
|
|
12642
|
+
ls,
|
|
12639
12643
|
{
|
|
12640
12644
|
icon: "to-bottom",
|
|
12641
12645
|
onClickHandler: (d) => {
|
|
@@ -12885,29 +12889,32 @@ const Aw = (a) => {
|
|
|
12885
12889
|
}
|
|
12886
12890
|
}, [(e == null ? void 0 : e.current) && i, n == null ? void 0 : n.height]), p = q(() => /* @__PURE__ */ k.createElement(xo, { key: "strokeColors", opacity: h, activeColor: c, setCurOpacity: (w, m, S) => {
|
|
12887
12891
|
S === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), S === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), u(w);
|
|
12888
|
-
const
|
|
12889
|
-
i != null && i.strokeColor && r({ strokeColor:
|
|
12892
|
+
const I = Nt(m, w);
|
|
12893
|
+
i != null && i.strokeColor && r({ strokeColor: I }), _.emitMethod(
|
|
12890
12894
|
X.MainEngine,
|
|
12891
12895
|
R.SetColorNode,
|
|
12892
|
-
{ workIds: [$], strokeColor:
|
|
12896
|
+
{ workIds: [$], strokeColor: I, workState: S, viewId: n == null ? void 0 : n.viewId }
|
|
12893
12897
|
);
|
|
12894
|
-
} }), [h, c, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId, i]), f = q(() =>
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12898
|
+
} }), [h, c, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId, i]), f = q(() => {
|
|
12899
|
+
var w, m;
|
|
12900
|
+
return c && (i != null && i.thickness) ? /* @__PURE__ */ k.createElement(
|
|
12901
|
+
Rw,
|
|
12902
|
+
{
|
|
12903
|
+
key: "strokeThickness",
|
|
12904
|
+
min: Math.min(i.thickness, ((w = n == null ? void 0 : n.control.pluginOptions.strokeWidth) == null ? void 0 : w.min) || 1),
|
|
12905
|
+
max: Math.max(i.thickness, ((m = n == null ? void 0 : n.control.pluginOptions.strokeWidth) == null ? void 0 : m.max) || 10),
|
|
12906
|
+
activeNumber: i.thickness,
|
|
12907
|
+
setActiveNumber: (S, I) => {
|
|
12908
|
+
I === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), I === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), i != null && i.thickness && r({ thickness: S }), _.emitMethod(
|
|
12909
|
+
X.MainEngine,
|
|
12910
|
+
R.SetColorNode,
|
|
12911
|
+
{ workIds: [$], thickness: S, workState: I, viewId: n == null ? void 0 : n.viewId }
|
|
12912
|
+
);
|
|
12913
|
+
},
|
|
12914
|
+
color: c
|
|
12915
|
+
}
|
|
12916
|
+
) : null;
|
|
12917
|
+
}, [c, i == null ? void 0 : i.thickness, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId]), y = q(() => c && (i != null && i.strokeType) ? /* @__PURE__ */ k.createElement(
|
|
12911
12918
|
Yw,
|
|
12912
12919
|
{
|
|
12913
12920
|
key: "strokeType",
|
|
@@ -12945,8 +12952,8 @@ const Aw = (a) => {
|
|
|
12945
12952
|
key: m,
|
|
12946
12953
|
color: S,
|
|
12947
12954
|
activeColor: c,
|
|
12948
|
-
onTouchEndHandler: (
|
|
12949
|
-
|
|
12955
|
+
onTouchEndHandler: (I) => {
|
|
12956
|
+
I.stopPropagation(), l(S);
|
|
12950
12957
|
const v = Nt(S, h);
|
|
12951
12958
|
i != null && i.strokeColor && (i.strokeColor = v, r({ strokeColor: v })), _.emitMethod(
|
|
12952
12959
|
X.MainEngine,
|
|
@@ -12954,8 +12961,8 @@ const Aw = (a) => {
|
|
|
12954
12961
|
{ workIds: [$], workState: P.Done, strokeColor: v, viewId: n == null ? void 0 : n.viewId }
|
|
12955
12962
|
);
|
|
12956
12963
|
},
|
|
12957
|
-
onClickHandler: (
|
|
12958
|
-
|
|
12964
|
+
onClickHandler: (I) => {
|
|
12965
|
+
I.cancelable && I.preventDefault(), I.stopPropagation(), l(S);
|
|
12959
12966
|
const v = Nt(S, h);
|
|
12960
12967
|
i != null && i.strokeColor && (i.strokeColor = v, r({ strokeColor: v })), _.emitMethod(
|
|
12961
12968
|
X.MainEngine,
|
|
@@ -12967,7 +12974,7 @@ const Aw = (a) => {
|
|
|
12967
12974
|
);
|
|
12968
12975
|
}),
|
|
12969
12976
|
p
|
|
12970
|
-
) : null, [o, s, p, c, h, i, n == null ? void 0 : n.viewId, d]),
|
|
12977
|
+
) : null, [o, s, p, c, h, i, n == null ? void 0 : n.viewId, d]), N = q(() => c ? /* @__PURE__ */ k.createElement("div", { className: "color-bar-ring", style: { backgroundColor: Nt(c, h) } }, /* @__PURE__ */ k.createElement("div", { className: "circle" })) : null, [c, h]);
|
|
12971
12978
|
return /* @__PURE__ */ k.createElement(
|
|
12972
12979
|
"div",
|
|
12973
12980
|
{
|
|
@@ -12979,15 +12986,15 @@ const Aw = (a) => {
|
|
|
12979
12986
|
w.cancelable && w.preventDefault(), w.stopPropagation(), w.nativeEvent.stopImmediatePropagation(), t(!o);
|
|
12980
12987
|
}
|
|
12981
12988
|
},
|
|
12982
|
-
|
|
12989
|
+
N,
|
|
12983
12990
|
M
|
|
12984
12991
|
);
|
|
12985
12992
|
}, Uw = (a) => {
|
|
12986
12993
|
const { open: o, setOpen: t, floatBarRef: e } = a, { floatBarData: i, floatBarColors: s, mananger: n, setFloatBarData: r } = xt(kt), [c, l] = st(), [h, u] = st(1);
|
|
12987
12994
|
gt(() => {
|
|
12988
12995
|
if (i != null && i.fillColor) {
|
|
12989
|
-
const [M,
|
|
12990
|
-
l(M), u(
|
|
12996
|
+
const [M, N] = (i == null ? void 0 : i.fillColor) === "transparent" && ["transparent", 1] || ko(i.fillColor);
|
|
12997
|
+
l(M), u(N);
|
|
12991
12998
|
}
|
|
12992
12999
|
}, [i]);
|
|
12993
13000
|
const d = q(() => {
|
|
@@ -13000,13 +13007,13 @@ const Aw = (a) => {
|
|
|
13000
13007
|
return M.top = "inherit", M.bottom = 50, M;
|
|
13001
13008
|
}
|
|
13002
13009
|
}
|
|
13003
|
-
}, [e == null ? void 0 : e.current, i, n == null ? void 0 : n.height]), p = q(() => c && c !== "transparent" ? /* @__PURE__ */ k.createElement(xo, { key: "fillColors", opacity: h || 0, activeColor: c, setCurOpacity: (M,
|
|
13010
|
+
}, [e == null ? void 0 : e.current, i, n == null ? void 0 : n.height]), p = q(() => c && c !== "transparent" ? /* @__PURE__ */ k.createElement(xo, { key: "fillColors", opacity: h || 0, activeColor: c, setCurOpacity: (M, N, w) => {
|
|
13004
13011
|
w === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), w === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), u(M);
|
|
13005
|
-
const m = Nt(
|
|
13012
|
+
const m = Nt(N, M);
|
|
13006
13013
|
i != null && i.fillColor && (i.fillColor = m, r({ fillColor: m })), _.emitMethod(
|
|
13007
13014
|
X.MainEngine,
|
|
13008
13015
|
R.SetColorNode,
|
|
13009
|
-
{ workIds: [$], fillColor: c && Nt(
|
|
13016
|
+
{ workIds: [$], fillColor: c && Nt(N, M), workState: w, viewId: n == null ? void 0 : n.viewId }
|
|
13010
13017
|
);
|
|
13011
13018
|
} }) : null, [c, h, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId, i]), f = q(() => o ? /* @__PURE__ */ k.createElement(
|
|
13012
13019
|
"div",
|
|
@@ -13026,30 +13033,30 @@ const Aw = (a) => {
|
|
|
13026
13033
|
activeColor: c,
|
|
13027
13034
|
onTouchEndHandler: (M) => {
|
|
13028
13035
|
M.stopPropagation(), l("transparent");
|
|
13029
|
-
const
|
|
13030
|
-
i != null && i.fillColor && (i.fillColor =
|
|
13036
|
+
const N = "transparent";
|
|
13037
|
+
i != null && i.fillColor && (i.fillColor = N, r({ fillColor: N })), _.emitMethod(
|
|
13031
13038
|
X.MainEngine,
|
|
13032
13039
|
R.SetColorNode,
|
|
13033
|
-
{ workIds: [$], workState: P.Done, fillColor:
|
|
13040
|
+
{ workIds: [$], workState: P.Done, fillColor: N, viewId: n == null ? void 0 : n.viewId }
|
|
13034
13041
|
);
|
|
13035
13042
|
},
|
|
13036
13043
|
onClickHandler: (M) => {
|
|
13037
13044
|
M.cancelable && M.preventDefault(), M.stopPropagation(), l("transparent");
|
|
13038
|
-
const
|
|
13039
|
-
i != null && i.fillColor && (i.fillColor =
|
|
13045
|
+
const N = "transparent";
|
|
13046
|
+
i != null && i.fillColor && (i.fillColor = N, r({ fillColor: N })), _.emitMethod(
|
|
13040
13047
|
X.MainEngine,
|
|
13041
13048
|
R.SetColorNode,
|
|
13042
|
-
{ workIds: [$], workState: P.Done, fillColor:
|
|
13049
|
+
{ workIds: [$], workState: P.Done, fillColor: N, viewId: n == null ? void 0 : n.viewId }
|
|
13043
13050
|
);
|
|
13044
13051
|
}
|
|
13045
13052
|
}
|
|
13046
13053
|
),
|
|
13047
|
-
s.map((M,
|
|
13054
|
+
s.map((M, N) => {
|
|
13048
13055
|
const w = Je(...M);
|
|
13049
13056
|
return /* @__PURE__ */ k.createElement(
|
|
13050
13057
|
Co,
|
|
13051
13058
|
{
|
|
13052
|
-
key:
|
|
13059
|
+
key: N,
|
|
13053
13060
|
color: w,
|
|
13054
13061
|
activeColor: c,
|
|
13055
13062
|
onTouchEndHandler: (m) => {
|
|
@@ -13112,13 +13119,13 @@ const Aw = (a) => {
|
|
|
13112
13119
|
}
|
|
13113
13120
|
}, [s == null ? void 0 : s.current, l, r]), y = q(() => h && h !== "transparent" ? /* @__PURE__ */ k.createElement(xo, { key: "fontColors", opacity: d, activeColor: h, setCurOpacity: (w, m, S) => {
|
|
13114
13121
|
S === P.Start && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !0), S === P.Done && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !1), p(w);
|
|
13115
|
-
const
|
|
13116
|
-
l != null && l.textOpt && (l.textOpt.fontColor =
|
|
13122
|
+
const I = Nt(m, w);
|
|
13123
|
+
l != null && l.textOpt && (l.textOpt.fontColor = I, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13117
13124
|
X.MainEngine,
|
|
13118
13125
|
R.SetColorNode,
|
|
13119
13126
|
{
|
|
13120
13127
|
workIds: i || [$],
|
|
13121
|
-
fontColor: h &&
|
|
13128
|
+
fontColor: h && I,
|
|
13122
13129
|
workState: S,
|
|
13123
13130
|
viewId: r == null ? void 0 : r.viewId
|
|
13124
13131
|
}
|
|
@@ -13143,8 +13150,8 @@ const Aw = (a) => {
|
|
|
13143
13150
|
key: m,
|
|
13144
13151
|
color: S,
|
|
13145
13152
|
activeColor: h,
|
|
13146
|
-
onTouchEndHandler: (
|
|
13147
|
-
|
|
13153
|
+
onTouchEndHandler: (I) => {
|
|
13154
|
+
I.stopPropagation(), u(S);
|
|
13148
13155
|
const v = Nt(S, d);
|
|
13149
13156
|
l != null && l.textOpt && (l.textOpt.fontColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13150
13157
|
X.MainEngine,
|
|
@@ -13152,8 +13159,8 @@ const Aw = (a) => {
|
|
|
13152
13159
|
{ workIds: i || [$], workState: P.Done, fontColor: v, viewId: r == null ? void 0 : r.viewId }
|
|
13153
13160
|
);
|
|
13154
13161
|
},
|
|
13155
|
-
onClickHandler: (
|
|
13156
|
-
|
|
13162
|
+
onClickHandler: (I) => {
|
|
13163
|
+
I.cancelable && I.preventDefault(), I.stopPropagation(), u(S);
|
|
13157
13164
|
const v = Nt(S, d);
|
|
13158
13165
|
l != null && l.textOpt && (l.textOpt.fontColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13159
13166
|
X.MainEngine,
|
|
@@ -13165,7 +13172,7 @@ const Aw = (a) => {
|
|
|
13165
13172
|
);
|
|
13166
13173
|
}),
|
|
13167
13174
|
y
|
|
13168
|
-
) : null, [o, n, y, h, d, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]),
|
|
13175
|
+
) : null, [o, n, y, h, d, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]), N = q(() => {
|
|
13169
13176
|
const w = h && h !== "transparent" && Nt(h, d) || "transparent";
|
|
13170
13177
|
return /* @__PURE__ */ k.createElement("div", { className: "color-bar" }, /* @__PURE__ */ k.createElement("div", { className: "color-bar-color", style: { backgroundColor: w } }));
|
|
13171
13178
|
}, [h, d]);
|
|
@@ -13181,7 +13188,7 @@ const Aw = (a) => {
|
|
|
13181
13188
|
}
|
|
13182
13189
|
},
|
|
13183
13190
|
/* @__PURE__ */ k.createElement("img", { alt: "icon", src: Pt("font-colors") }),
|
|
13184
|
-
|
|
13191
|
+
N,
|
|
13185
13192
|
M
|
|
13186
13193
|
);
|
|
13187
13194
|
}, Fw = (a) => {
|
|
@@ -13204,8 +13211,8 @@ const Aw = (a) => {
|
|
|
13204
13211
|
}
|
|
13205
13212
|
}, [s == null ? void 0 : s.current, l, r]), y = q(() => h && h !== "transparent" ? /* @__PURE__ */ k.createElement(xo, { key: "fontBgColor", opacity: d || 0, activeColor: h, setCurOpacity: (w, m, S) => {
|
|
13206
13213
|
S === P.Start && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !0), S === P.Done && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !1), p(w);
|
|
13207
|
-
const
|
|
13208
|
-
l != null && l.textOpt && (l.textOpt.fontBgColor =
|
|
13214
|
+
const I = Nt(m, w);
|
|
13215
|
+
l != null && l.textOpt && (l.textOpt.fontBgColor = I, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13209
13216
|
X.MainEngine,
|
|
13210
13217
|
R.SetColorNode,
|
|
13211
13218
|
{
|
|
@@ -13259,8 +13266,8 @@ const Aw = (a) => {
|
|
|
13259
13266
|
key: m,
|
|
13260
13267
|
color: S,
|
|
13261
13268
|
activeColor: h,
|
|
13262
|
-
onTouchEndHandler: (
|
|
13263
|
-
|
|
13269
|
+
onTouchEndHandler: (I) => {
|
|
13270
|
+
I.stopPropagation(), u(S);
|
|
13264
13271
|
const v = Nt(S, d);
|
|
13265
13272
|
l != null && l.textOpt && (l.textOpt.fontBgColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13266
13273
|
X.MainEngine,
|
|
@@ -13268,8 +13275,8 @@ const Aw = (a) => {
|
|
|
13268
13275
|
{ workIds: i || [$], workState: P.Done, fontBgColor: Nt(S, d), viewId: r == null ? void 0 : r.viewId }
|
|
13269
13276
|
);
|
|
13270
13277
|
},
|
|
13271
|
-
onClickHandler: (
|
|
13272
|
-
|
|
13278
|
+
onClickHandler: (I) => {
|
|
13279
|
+
I.cancelable && I.preventDefault(), I.stopPropagation(), u(S);
|
|
13273
13280
|
const v = Nt(S, d);
|
|
13274
13281
|
l != null && l.textOpt && (l.textOpt.fontBgColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13275
13282
|
X.MainEngine,
|
|
@@ -13281,7 +13288,7 @@ const Aw = (a) => {
|
|
|
13281
13288
|
);
|
|
13282
13289
|
}),
|
|
13283
13290
|
y
|
|
13284
|
-
) : null, [o, n, y, d, h, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]),
|
|
13291
|
+
) : null, [o, n, y, d, h, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]), N = q(() => {
|
|
13285
13292
|
const w = h && h !== "transparent" && Nt(h, d) || "transparent";
|
|
13286
13293
|
return /* @__PURE__ */ k.createElement("div", { className: "color-bar", style: { marginTop: 0 } }, /* @__PURE__ */ k.createElement("div", { className: "color-bar-color", style: { backgroundColor: w } }));
|
|
13287
13294
|
}, [h, d]);
|
|
@@ -13297,7 +13304,7 @@ const Aw = (a) => {
|
|
|
13297
13304
|
}
|
|
13298
13305
|
},
|
|
13299
13306
|
/* @__PURE__ */ k.createElement(Ow, null),
|
|
13300
|
-
|
|
13307
|
+
N,
|
|
13301
13308
|
M
|
|
13302
13309
|
);
|
|
13303
13310
|
}, Vw = (a) => {
|
|
@@ -13377,7 +13384,7 @@ const Aw = (a) => {
|
|
|
13377
13384
|
gt(() => {
|
|
13378
13385
|
e != null && e.bold && h(e.bold), Yt(e == null ? void 0 : e.underline) && f(e.underline || !1), Yt(e == null ? void 0 : e.lineThrough) && M(e.lineThrough || !1), e != null && e.italic && d(e.italic);
|
|
13379
13386
|
}, [e]);
|
|
13380
|
-
const
|
|
13387
|
+
const N = q(() => {
|
|
13381
13388
|
if (s && (n != null && n.current) && ot(c == null ? void 0 : c.y) && (r != null && r.height)) {
|
|
13382
13389
|
if (n.current.offsetTop && n.current.offsetTop + c.y > 180) {
|
|
13383
13390
|
const m = {};
|
|
@@ -13391,7 +13398,7 @@ const Aw = (a) => {
|
|
|
13391
13398
|
"div",
|
|
13392
13399
|
{
|
|
13393
13400
|
className: "font-style-menu",
|
|
13394
|
-
style:
|
|
13401
|
+
style: N,
|
|
13395
13402
|
onTouchEnd: (m) => {
|
|
13396
13403
|
m.stopPropagation(), m.nativeEvent.stopImmediatePropagation();
|
|
13397
13404
|
},
|
|
@@ -13403,7 +13410,7 @@ const Aw = (a) => {
|
|
|
13403
13410
|
/* @__PURE__ */ k.createElement($w, { workIds: i || [$], underline: p, setUnderline: f, viewId: r == null ? void 0 : r.viewId }),
|
|
13404
13411
|
/* @__PURE__ */ k.createElement(Hw, { workIds: i || [$], lineThrough: y, setLineThrough: M, viewId: r == null ? void 0 : r.viewId }),
|
|
13405
13412
|
/* @__PURE__ */ k.createElement(Qw, { workIds: i || [$], italic: u, setItalic: d, viewId: r == null ? void 0 : r.viewId })
|
|
13406
|
-
) : null, [o, i, l, r == null ? void 0 : r.viewId, p, y, u,
|
|
13413
|
+
) : null, [o, i, l, r == null ? void 0 : r.viewId, p, y, u, N]);
|
|
13407
13414
|
return /* @__PURE__ */ k.createElement(
|
|
13408
13415
|
"div",
|
|
13409
13416
|
{
|
|
@@ -13497,7 +13504,7 @@ const Aw = (a) => {
|
|
|
13497
13504
|
const M = (m) => {
|
|
13498
13505
|
var S;
|
|
13499
13506
|
(S = o.current) == null || S.blur(), e(!1), w(m);
|
|
13500
|
-
},
|
|
13507
|
+
}, N = q(() => t ? /* @__PURE__ */ k.createElement(Zw, { onClickHandler: M, style: f }) : null, [t, M, f]), w = (m) => {
|
|
13501
13508
|
m > Ht[p] && (m = Ht[p]), m < Ht[0] && (m = Ht[0]), y(m);
|
|
13502
13509
|
};
|
|
13503
13510
|
return gt(() => () => {
|
|
@@ -13527,8 +13534,8 @@ const Aw = (a) => {
|
|
|
13527
13534
|
},
|
|
13528
13535
|
onKeyDown: (m) => {
|
|
13529
13536
|
if (m.key === "Backspace") {
|
|
13530
|
-
const S = window.getSelection(),
|
|
13531
|
-
if (
|
|
13537
|
+
const S = window.getSelection(), I = S == null ? void 0 : S.getRangeAt(0);
|
|
13538
|
+
if (I != null && I.collapsed)
|
|
13532
13539
|
return m.cancelable && m.preventDefault(), document.execCommand("delete", !1), !1;
|
|
13533
13540
|
}
|
|
13534
13541
|
return !1;
|
|
@@ -13536,7 +13543,7 @@ const Aw = (a) => {
|
|
|
13536
13543
|
onKeyUp: (m) => {
|
|
13537
13544
|
var S;
|
|
13538
13545
|
if (o.current) {
|
|
13539
|
-
const
|
|
13546
|
+
const I = o.current.value, v = parseInt(I);
|
|
13540
13547
|
isNaN(v) ? o.current.value = "0" : o.current.value = v.toString(), v && m.key === "Enter" && (w(v), (S = o.current) == null || S.blur(), e(!1));
|
|
13541
13548
|
}
|
|
13542
13549
|
},
|
|
@@ -13571,7 +13578,7 @@ const Aw = (a) => {
|
|
|
13571
13578
|
}
|
|
13572
13579
|
}
|
|
13573
13580
|
)),
|
|
13574
|
-
|
|
13581
|
+
N
|
|
13575
13582
|
);
|
|
13576
13583
|
}, Jw = (a) => {
|
|
13577
13584
|
const { workIds: o, mananger: t, islocked: e } = a;
|
|
@@ -13804,7 +13811,7 @@ const Aw = (a) => {
|
|
|
13804
13811
|
R.SetShapeOpt,
|
|
13805
13812
|
{
|
|
13806
13813
|
workIds: [$],
|
|
13807
|
-
toolsType:
|
|
13814
|
+
toolsType: T.Star,
|
|
13808
13815
|
viewId: o.viewId,
|
|
13809
13816
|
vertices: c
|
|
13810
13817
|
}
|
|
@@ -13815,7 +13822,7 @@ const Aw = (a) => {
|
|
|
13815
13822
|
R.SetShapeOpt,
|
|
13816
13823
|
{
|
|
13817
13824
|
workIds: [$],
|
|
13818
|
-
toolsType:
|
|
13825
|
+
toolsType: T.Star,
|
|
13819
13826
|
viewId: o.viewId,
|
|
13820
13827
|
innerVerticeStep: c
|
|
13821
13828
|
}
|
|
@@ -13826,7 +13833,7 @@ const Aw = (a) => {
|
|
|
13826
13833
|
R.SetShapeOpt,
|
|
13827
13834
|
{
|
|
13828
13835
|
workIds: [$],
|
|
13829
|
-
toolsType:
|
|
13836
|
+
toolsType: T.Star,
|
|
13830
13837
|
viewId: o.viewId,
|
|
13831
13838
|
innerRatio: c
|
|
13832
13839
|
}
|
|
@@ -13840,7 +13847,7 @@ const Aw = (a) => {
|
|
|
13840
13847
|
R.SetShapeOpt,
|
|
13841
13848
|
{
|
|
13842
13849
|
workIds: [$],
|
|
13843
|
-
toolsType:
|
|
13850
|
+
toolsType: T.Polygon,
|
|
13844
13851
|
viewId: o.viewId,
|
|
13845
13852
|
vertices: i
|
|
13846
13853
|
}
|
|
@@ -13854,7 +13861,7 @@ const Aw = (a) => {
|
|
|
13854
13861
|
R.SetShapeOpt,
|
|
13855
13862
|
{
|
|
13856
13863
|
workIds: [$],
|
|
13857
|
-
toolsType:
|
|
13864
|
+
toolsType: T.SpeechBalloon,
|
|
13858
13865
|
viewId: o.viewId,
|
|
13859
13866
|
placement: i
|
|
13860
13867
|
}
|
|
@@ -13867,11 +13874,11 @@ const Aw = (a) => {
|
|
|
13867
13874
|
}, sm = (a) => {
|
|
13868
13875
|
const { toolsTypes: o, style: t, mananger: e, shapeOpt: i } = a, [s, n] = st();
|
|
13869
13876
|
gt(() => {
|
|
13870
|
-
o.includes(
|
|
13877
|
+
o.includes(T.Polygon) ? n(T.Polygon) : o.includes(T.Star) ? n(T.Star) : n(T.SpeechBalloon);
|
|
13871
13878
|
}, [o]);
|
|
13872
13879
|
const r = (u, d) => {
|
|
13873
13880
|
d.cancelable && d.preventDefault(), d == null || d.stopPropagation(), n(u);
|
|
13874
|
-
}, c = q(() => s ===
|
|
13881
|
+
}, c = q(() => s === T.Polygon && e && i.vertices ? /* @__PURE__ */ k.createElement(om, { vertices: i.vertices, mananger: e }) : null, [e, s, i]), l = q(() => s === T.Star && e && i.vertices && i.innerVerticeStep && i.innerRatio ? /* @__PURE__ */ k.createElement(em, { mananger: e, vertices: i.vertices, innerVerticeStep: i.innerVerticeStep, innerRatio: i.innerRatio }) : null, [e, s, i]), h = q(() => s === T.SpeechBalloon && e && i.placement ? /* @__PURE__ */ k.createElement(im, { mananger: e, placement: i.placement }) : null, [e, s, i]);
|
|
13875
13882
|
return /* @__PURE__ */ k.createElement(
|
|
13876
13883
|
"div",
|
|
13877
13884
|
{
|
|
@@ -13881,7 +13888,7 @@ const Aw = (a) => {
|
|
|
13881
13888
|
u.stopPropagation(), u.nativeEvent.stopImmediatePropagation(), u.cancelable && u.preventDefault();
|
|
13882
13889
|
}
|
|
13883
13890
|
},
|
|
13884
|
-
/* @__PURE__ */ k.createElement("div", { className: "shapeOpt-sub-menu-tabs" }, o.includes(
|
|
13891
|
+
/* @__PURE__ */ k.createElement("div", { className: "shapeOpt-sub-menu-tabs" }, o.includes(T.Polygon) && /* @__PURE__ */ k.createElement(jo, { isActive: s === T.Polygon, icon: s === T.Polygon ? "polygon-active" : "polygon", onClickHandler: r.bind(void 0, T.Polygon), onTouchEndHandler: r.bind(void 0, T.Polygon) }) || null, o.includes(T.Star) && /* @__PURE__ */ k.createElement(jo, { isActive: s === T.Star, icon: s === T.Star ? "star-active" : "star", onClickHandler: r.bind(void 0, T.Star), onTouchEndHandler: r.bind(void 0, T.Star) }) || null, o.includes(T.SpeechBalloon) && /* @__PURE__ */ k.createElement(jo, { isActive: s === T.SpeechBalloon, icon: s === T.SpeechBalloon ? "speechBallon-active" : "speechBallon", onClickHandler: r.bind(void 0, T.SpeechBalloon), onTouchEndHandler: r.bind(void 0, T.SpeechBalloon) }) || null),
|
|
13885
13892
|
/* @__PURE__ */ k.createElement("div", { className: "shapeOpt-sub-menu-content" }, c, l, h)
|
|
13886
13893
|
);
|
|
13887
13894
|
}, nm = (a) => {
|
|
@@ -13921,57 +13928,57 @@ const Aw = (a) => {
|
|
|
13921
13928
|
), [l, h] = k.useState(), u = De(null);
|
|
13922
13929
|
gt(() => {
|
|
13923
13930
|
var L, A, j, D;
|
|
13924
|
-
const
|
|
13931
|
+
const I = {}, v = (s == null ? void 0 : s.w) || ((L = o == null ? void 0 : o.boxSize) == null ? void 0 : L[0]) || 0, x = (s == null ? void 0 : s.h) || ((A = o == null ? void 0 : o.boxSize) == null ? void 0 : A[1]) || 0;
|
|
13925
13932
|
if (i && v && x && (n != null && n.width) && (n != null && n.height)) {
|
|
13926
|
-
if (i.y < 60 ? i.y + x < n.height - 60 ?
|
|
13927
|
-
|
|
13933
|
+
if (i.y < 60 ? i.y + x < n.height - 60 ? I.bottom = -120 : i.y + x < n.height ? I.bottom = -58 : i.y > 0 ? I.top = 62 : I.top = -i.y + 62 : I.top = 0, i.x < 0)
|
|
13934
|
+
I.left = -i.x + 3;
|
|
13928
13935
|
else if (i.x + (((j = u.current) == null ? void 0 : j.offsetWidth) || v) > n.width) {
|
|
13929
13936
|
const O = n.width - (((D = u.current) == null ? void 0 : D.offsetWidth) || v) - i.x;
|
|
13930
|
-
|
|
13937
|
+
I.left = O;
|
|
13931
13938
|
}
|
|
13932
|
-
h(
|
|
13939
|
+
h(I);
|
|
13933
13940
|
return;
|
|
13934
13941
|
}
|
|
13935
13942
|
h(void 0);
|
|
13936
13943
|
}, [u, i, s == null ? void 0 : s.w, s == null ? void 0 : s.h, n == null ? void 0 : n.width, n == null ? void 0 : n.height, o == null ? void 0 : o.boxSize]);
|
|
13937
|
-
const d = q(() => s != null && s.fillColor ? /* @__PURE__ */ k.createElement(Uw, { floatBarRef: u, open: r === 3, setOpen: (
|
|
13944
|
+
const d = q(() => s != null && s.fillColor ? /* @__PURE__ */ k.createElement(Uw, { floatBarRef: u, open: r === 3, setOpen: (I) => {
|
|
13938
13945
|
c(
|
|
13939
|
-
|
|
13946
|
+
I === !0 ? 3 : 0
|
|
13940
13947
|
/* FillColor */
|
|
13941
13948
|
);
|
|
13942
|
-
} }) : null, [s == null ? void 0 : s.fillColor, r, u]), p = q(() => s != null && s.strokeColor ? /* @__PURE__ */ k.createElement(Ww, { floatBarRef: u, open: r === 2, setOpen: (
|
|
13949
|
+
} }) : null, [s == null ? void 0 : s.fillColor, r, u]), p = q(() => s != null && s.strokeColor ? /* @__PURE__ */ k.createElement(Ww, { floatBarRef: u, open: r === 2, setOpen: (I) => {
|
|
13943
13950
|
c(
|
|
13944
|
-
|
|
13951
|
+
I === !0 ? 2 : 0
|
|
13945
13952
|
/* StrokeColor */
|
|
13946
13953
|
);
|
|
13947
|
-
} }) : null, [s == null ? void 0 : s.strokeColor, r, u]), f = q(() => o != null && o.fontColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Bw, { floatBarRef: u, open: r === 4, setOpen: (
|
|
13954
|
+
} }) : null, [s == null ? void 0 : s.strokeColor, r, u]), f = q(() => o != null && o.fontColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Bw, { floatBarRef: u, open: r === 4, setOpen: (I) => {
|
|
13948
13955
|
c(
|
|
13949
|
-
|
|
13956
|
+
I === !0 ? 4 : 0
|
|
13950
13957
|
/* TextColor */
|
|
13951
13958
|
);
|
|
13952
|
-
}, textOpt: o, workIds: t }) : null, [o, r, t, n, u]), y = q(() => o != null && o.fontBgColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Fw, { floatBarRef: u, open: r === 5, setOpen: (
|
|
13959
|
+
}, textOpt: o, workIds: t }) : null, [o, r, t, n, u]), y = q(() => o != null && o.fontBgColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Fw, { floatBarRef: u, open: r === 5, setOpen: (I) => {
|
|
13953
13960
|
c(
|
|
13954
|
-
|
|
13961
|
+
I === !0 ? 5 : 0
|
|
13955
13962
|
/* TextBgColor */
|
|
13956
13963
|
);
|
|
13957
|
-
}, textOpt: o, workIds: t }) : null, [o, r, t, n, u]), M = q(() => o && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Gw, { floatBarRef: u, open: r === 6, setOpen: (
|
|
13964
|
+
}, textOpt: o, workIds: t }) : null, [o, r, t, n, u]), M = q(() => o && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Gw, { floatBarRef: u, open: r === 6, setOpen: (I) => {
|
|
13958
13965
|
c(
|
|
13959
|
-
|
|
13966
|
+
I === !0 ? 6 : 0
|
|
13960
13967
|
/* FontStyle */
|
|
13961
13968
|
);
|
|
13962
|
-
}, textOpt: o, workIds: t, style: l }) : null, [o, r, t, n, l, u]),
|
|
13969
|
+
}, textOpt: o, workIds: t, style: l }) : null, [o, r, t, n, l, u]), N = q(() => o && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Xw, { open: r === 7, setOpen: (I) => {
|
|
13963
13970
|
c(
|
|
13964
|
-
|
|
13971
|
+
I === !0 ? 7 : 0
|
|
13965
13972
|
/* FontSize */
|
|
13966
13973
|
);
|
|
13967
|
-
}, textOpt: o, workIds: t, floatBarRef: u }) : null, [o, r, t, n, u]), w = q(() => e ? null : /* @__PURE__ */ k.createElement(Ew, { open: r === 1, setOpen: (
|
|
13974
|
+
}, textOpt: o, workIds: t, floatBarRef: u }) : null, [o, r, t, n, u]), w = q(() => e ? null : /* @__PURE__ */ k.createElement(Ew, { open: r === 1, setOpen: (I) => {
|
|
13968
13975
|
c(
|
|
13969
|
-
|
|
13976
|
+
I === !0 ? 1 : 0
|
|
13970
13977
|
/* Layer */
|
|
13971
13978
|
);
|
|
13972
|
-
}, floatBarRef: u }), [e, r, u]), m = q(() => s != null && s.canLock && n ? /* @__PURE__ */ k.createElement(Jw, { workIds: t, mananger: n, islocked: s.isLocked }) : null, [s, n, t]), S = q(() => n && (n != null && n.viewId) && l && (s != null && s.shapeOpt) && (s != null && s.toolsTypes) ? /* @__PURE__ */ k.createElement(nm, { open: r === 8, setOpen: (
|
|
13979
|
+
}, floatBarRef: u }), [e, r, u]), m = q(() => s != null && s.canLock && n ? /* @__PURE__ */ k.createElement(Jw, { workIds: t, mananger: n, islocked: s.isLocked }) : null, [s, n, t]), S = q(() => n && (n != null && n.viewId) && l && (s != null && s.shapeOpt) && (s != null && s.toolsTypes) ? /* @__PURE__ */ k.createElement(nm, { open: r === 8, setOpen: (I) => {
|
|
13973
13980
|
c(
|
|
13974
|
-
|
|
13981
|
+
I === !0 ? 8 : 0
|
|
13975
13982
|
/* ShapeOpt */
|
|
13976
13983
|
);
|
|
13977
13984
|
}, floatBarRef: u, workIds: t, toolsTypes: s.toolsTypes, shapeOpt: s.shapeOpt }) : null, [s, n, r, l, t, u]);
|
|
@@ -13981,15 +13988,15 @@ const Aw = (a) => {
|
|
|
13981
13988
|
className: "appliance-plugin-floatbtns",
|
|
13982
13989
|
style: l,
|
|
13983
13990
|
ref: u,
|
|
13984
|
-
onMouseOver: (
|
|
13985
|
-
onMouseMove: (
|
|
13991
|
+
onMouseOver: (I) => (I.stopPropagation(), I.cancelable && I.preventDefault(), n == null || n.control.worker.blurCursor(n.viewId), !1),
|
|
13992
|
+
onMouseMove: (I) => (I.stopPropagation(), I.cancelable && I.preventDefault(), !1)
|
|
13986
13993
|
},
|
|
13987
13994
|
n && /* @__PURE__ */ k.createElement(Aw, { workIds: t, mananger: n }),
|
|
13988
13995
|
w,
|
|
13989
13996
|
m,
|
|
13990
13997
|
!!(n != null && n.viewId) && /* @__PURE__ */ k.createElement(jw, { workIds: t, viewId: n.viewId }),
|
|
13991
13998
|
S,
|
|
13992
|
-
|
|
13999
|
+
N,
|
|
13993
14000
|
M,
|
|
13994
14001
|
f,
|
|
13995
14002
|
y,
|
|
@@ -14004,24 +14011,24 @@ const Aw = (a) => {
|
|
|
14004
14011
|
fontColor: f,
|
|
14005
14012
|
lineThrough: y,
|
|
14006
14013
|
textAlign: M,
|
|
14007
|
-
strokeColor:
|
|
14014
|
+
strokeColor: N,
|
|
14008
14015
|
lineHeight: w,
|
|
14009
14016
|
bold: m,
|
|
14010
14017
|
italic: S,
|
|
14011
|
-
uid:
|
|
14018
|
+
uid: I,
|
|
14012
14019
|
workState: v
|
|
14013
14020
|
} = s, x = u, L = w || x * 1.2, A = {
|
|
14014
14021
|
fontSize: `${x}px`,
|
|
14015
14022
|
lineHeight: `${L}px`,
|
|
14016
14023
|
color: f,
|
|
14017
|
-
borderColor:
|
|
14024
|
+
borderColor: N,
|
|
14018
14025
|
minHeight: `${L}px`,
|
|
14019
14026
|
paddingRight: `${S === "italic" ? Math.round(x * 0.3) : 5}px`
|
|
14020
14027
|
};
|
|
14021
14028
|
d && (A.fontFamily = `${d}`), (y || p) && (A.textDecoration = `${y && "line-through" || ""}${p && " underline" || ""}`), m && (A.fontWeight = `${m}`), S && (A.fontStyle = `${S}`), M && (A.textAlign = `${M}`);
|
|
14022
14029
|
function j() {
|
|
14023
14030
|
var O;
|
|
14024
|
-
t && (
|
|
14031
|
+
t && (I && I === ((O = e.control.collector) == null ? void 0 : O.uid) || !I) && e.control.textEditorManager.active(i);
|
|
14025
14032
|
}
|
|
14026
14033
|
const D = q(() => {
|
|
14027
14034
|
const O = [];
|
|
@@ -14083,18 +14090,18 @@ const Aw = (a) => {
|
|
|
14083
14090
|
fontColor: f,
|
|
14084
14091
|
lineThrough: y,
|
|
14085
14092
|
textAlign: M,
|
|
14086
|
-
strokeColor:
|
|
14093
|
+
strokeColor: N,
|
|
14087
14094
|
lineHeight: w,
|
|
14088
14095
|
bold: m,
|
|
14089
14096
|
italic: S
|
|
14090
|
-
} = n,
|
|
14091
|
-
fontSize: `${
|
|
14097
|
+
} = n, I = u, v = w || I * 1.2, x = {
|
|
14098
|
+
fontSize: `${I}px`,
|
|
14092
14099
|
lineHeight: `${v}px`,
|
|
14093
14100
|
color: f,
|
|
14094
|
-
borderColor:
|
|
14101
|
+
borderColor: N,
|
|
14095
14102
|
minHeight: `${v}px`,
|
|
14096
14103
|
pointerEvents: "none",
|
|
14097
|
-
paddingRight: `${S === "italic" ? Math.round(
|
|
14104
|
+
paddingRight: `${S === "italic" ? Math.round(I * 0.3) : 5}px`
|
|
14098
14105
|
};
|
|
14099
14106
|
d && (x.fontFamily = `${d}`), (y || p) && (x.textDecoration = `${y && "line-through" || ""}${p && " underline" || ""}`), M && (x.textAlign = `${M}`), m && (x.fontWeight = `${m}`), S && (x.fontStyle = `${S}`);
|
|
14100
14107
|
const L = q(() => {
|
|
@@ -14136,11 +14143,11 @@ const Aw = (a) => {
|
|
|
14136
14143
|
(a, o) => !(a.workId !== o.workId || a.left !== o.left || a.top !== o.top || !ft(a.data, o.data))
|
|
14137
14144
|
), cm = (a) => {
|
|
14138
14145
|
const { data: o, workId: t, isSelect: e, showFloatBtns: i, handleKeyUp: s, handleFocus: n, updateOptInfo: r, manager: c, runAnimation: l } = a, [h, u] = st(), { opt: d, scale: p, translate: f, x: y, y: M } = o, {
|
|
14139
|
-
fontSize:
|
|
14146
|
+
fontSize: N,
|
|
14140
14147
|
fontFamily: w,
|
|
14141
14148
|
underline: m,
|
|
14142
14149
|
fontColor: S,
|
|
14143
|
-
lineThrough:
|
|
14150
|
+
lineThrough: I,
|
|
14144
14151
|
textAlign: v,
|
|
14145
14152
|
strokeColor: x,
|
|
14146
14153
|
lineHeight: L,
|
|
@@ -14148,7 +14155,7 @@ const Aw = (a) => {
|
|
|
14148
14155
|
italic: j,
|
|
14149
14156
|
boxSize: D
|
|
14150
14157
|
} = d, O = De(null), z = q(() => {
|
|
14151
|
-
const it =
|
|
14158
|
+
const it = N, ht = L || it * 1.2, J = {
|
|
14152
14159
|
fontSize: `${it}px`,
|
|
14153
14160
|
lineHeight: `${ht}px`,
|
|
14154
14161
|
color: S,
|
|
@@ -14157,8 +14164,8 @@ const Aw = (a) => {
|
|
|
14157
14164
|
paddingRight: `${j === "italic" ? Math.round(it * 0.3) : 5}px`,
|
|
14158
14165
|
borderWidth: `${Math.max(Math.round(1 / (p || 1)), 1)}px`
|
|
14159
14166
|
};
|
|
14160
|
-
return w && (J.fontFamily = `${w}`), (
|
|
14161
|
-
}, [A, S, w,
|
|
14167
|
+
return w && (J.fontFamily = `${w}`), (I || m) && (J.textDecoration = `${I && "line-through" || ""} ${m && " underline" || ""}`), v && (J.textAlign = `${v}`), A && (J.fontWeight = `${A}`), j && (J.fontStyle = `${j}`), J;
|
|
14168
|
+
}, [A, S, w, N, j, L, I, p, x, v, m]), E = q(() => {
|
|
14162
14169
|
const it = `scale(${p || 1}) ${f && "translate(" + f[0] + "px," + f[1] + "px)" || ""}`;
|
|
14163
14170
|
return {
|
|
14164
14171
|
left: `${y}px`,
|
|
@@ -14223,7 +14230,7 @@ const Aw = (a) => {
|
|
|
14223
14230
|
(J == null ? void 0 : J.nodeName) === "#text" ? V.setStart(J, ut) : V.setStart(J, ut && 1 || 0), V.collapse(!0), ht.removeAllRanges(), ht.addRange(V);
|
|
14224
14231
|
}
|
|
14225
14232
|
}
|
|
14226
|
-
},
|
|
14233
|
+
}, ui));
|
|
14227
14234
|
}, [H, O.current]), gt(() => {
|
|
14228
14235
|
var it, ht, J, V;
|
|
14229
14236
|
if (H && ((it = O.current) != null && it.offsetWidth || (ht = O.current) != null && ht.offsetHeight || (J = O.current) != null && J.offsetLeft || (V = O.current) != null && V.offsetTop)) {
|
|
@@ -14579,23 +14586,23 @@ const hm = () => {
|
|
|
14579
14586
|
return;
|
|
14580
14587
|
}
|
|
14581
14588
|
c(!0);
|
|
14582
|
-
const
|
|
14583
|
-
i(
|
|
14589
|
+
const I = Math.round(F.GetAngleByPoints(l, u, new F(S.x, S.y))) || 0;
|
|
14590
|
+
i(I), s(R.RotateNode), n != null && n.control.room && (n.control.room.disableDeviceInputs = !0), _.emitMethod(
|
|
14584
14591
|
X.MainEngine,
|
|
14585
14592
|
R.RotateNode,
|
|
14586
|
-
{ workIds: [$], angle:
|
|
14593
|
+
{ workIds: [$], angle: I, workState: P.Start, viewId: n == null ? void 0 : n.viewId }
|
|
14587
14594
|
);
|
|
14588
|
-
},
|
|
14595
|
+
}, N = fo((m, S) => {
|
|
14589
14596
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14590
14597
|
f(!0);
|
|
14591
14598
|
return;
|
|
14592
14599
|
}
|
|
14593
14600
|
c(!1);
|
|
14594
|
-
const
|
|
14595
|
-
i(
|
|
14601
|
+
const I = Math.round(F.GetAngleByPoints(l, u, new F(S.x, S.y))) || 0;
|
|
14602
|
+
i(I), s(R.None), n != null && n.control.room && (n.control.room.disableDeviceInputs = !1), _.emitMethod(
|
|
14596
14603
|
X.MainEngine,
|
|
14597
14604
|
R.RotateNode,
|
|
14598
|
-
{ workIds: [$], angle:
|
|
14605
|
+
{ workIds: [$], angle: I, workState: P.Done, viewId: n == null ? void 0 : n.viewId }
|
|
14599
14606
|
);
|
|
14600
14607
|
}, 100, { leading: !1 }), w = fo((m, S) => {
|
|
14601
14608
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
@@ -14603,11 +14610,11 @@ const hm = () => {
|
|
|
14603
14610
|
return;
|
|
14604
14611
|
}
|
|
14605
14612
|
c(!0);
|
|
14606
|
-
const
|
|
14607
|
-
i(
|
|
14613
|
+
const I = Math.round(F.GetAngleByPoints(l, u, new F(S.x, S.y))) || 0;
|
|
14614
|
+
i(I), s(R.RotateNode), _.emitMethod(
|
|
14608
14615
|
X.MainEngine,
|
|
14609
14616
|
R.RotateNode,
|
|
14610
|
-
{ workIds: [$], angle:
|
|
14617
|
+
{ workIds: [$], angle: I, workState: P.Doing, viewId: n == null ? void 0 : n.viewId }
|
|
14611
14618
|
);
|
|
14612
14619
|
}, 100, { leading: !1 });
|
|
14613
14620
|
return /* @__PURE__ */ k.createElement(
|
|
@@ -14617,7 +14624,7 @@ const hm = () => {
|
|
|
14617
14624
|
handle: ".appliance-plugin-rotate-mouse-pointer",
|
|
14618
14625
|
onStart: M,
|
|
14619
14626
|
onDrag: w,
|
|
14620
|
-
onStop:
|
|
14627
|
+
onStop: N
|
|
14621
14628
|
},
|
|
14622
14629
|
/* @__PURE__ */ k.createElement(
|
|
14623
14630
|
"div",
|
|
@@ -14671,24 +14678,24 @@ const hm = () => {
|
|
|
14671
14678
|
return;
|
|
14672
14679
|
}
|
|
14673
14680
|
m.stopPropagation();
|
|
14674
|
-
const
|
|
14681
|
+
const I = { x: S.x, y: S.y };
|
|
14675
14682
|
t(R.None), n(P.Done), e != null && e.control.room && (e.control.room.disableDeviceInputs = !1), _.emitMethod(
|
|
14676
14683
|
X.MainEngine,
|
|
14677
14684
|
R.TranslateNode,
|
|
14678
|
-
{ workIds: [$], position:
|
|
14685
|
+
{ workIds: [$], position: I, workState: P.Done, viewId: e == null ? void 0 : e.viewId }
|
|
14679
14686
|
);
|
|
14680
14687
|
}, 100, { leading: !1 }), M = jt((m, S) => {
|
|
14681
14688
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), e != null && e.control.worker.isBusy) {
|
|
14682
14689
|
d(!0), n(P.Pending);
|
|
14683
14690
|
return;
|
|
14684
14691
|
}
|
|
14685
|
-
const
|
|
14692
|
+
const I = { x: S.x, y: S.y };
|
|
14686
14693
|
(S.x !== (o == null ? void 0 : o.x) || S.y !== (o == null ? void 0 : o.y)) && (n(P.Doing), _.emitMethod(
|
|
14687
14694
|
X.MainEngine,
|
|
14688
14695
|
R.TranslateNode,
|
|
14689
|
-
{ workIds: [$], position:
|
|
14696
|
+
{ workIds: [$], position: I, workState: P.Doing, viewId: e == null ? void 0 : e.viewId }
|
|
14690
14697
|
));
|
|
14691
|
-
}, 100, { leading: !1 }),
|
|
14698
|
+
}, 100, { leading: !1 }), N = q(() => !!((o == null ? void 0 : o.scaleType) === pt.none && (o != null && o.canLock)), [o]), w = jt((m) => (m.stopPropagation(), m.cancelable && m.preventDefault(), (r == null ? void 0 : r.x) === (o == null ? void 0 : o.x) && (r == null ? void 0 : r.y) === (o == null ? void 0 : o.y) && i(m), !1), 100, { leading: !1 });
|
|
14692
14699
|
return /* @__PURE__ */ k.createElement(
|
|
14693
14700
|
Ae,
|
|
14694
14701
|
{
|
|
@@ -14708,7 +14715,7 @@ const hm = () => {
|
|
|
14708
14715
|
width: o.w,
|
|
14709
14716
|
height: o.h,
|
|
14710
14717
|
zIndex: 2,
|
|
14711
|
-
pointerEvents:
|
|
14718
|
+
pointerEvents: N ? "none" : "auto",
|
|
14712
14719
|
touchAction: "none"
|
|
14713
14720
|
} : void 0,
|
|
14714
14721
|
onClick: (m) => {
|
|
@@ -14738,7 +14745,7 @@ const hm = () => {
|
|
|
14738
14745
|
return;
|
|
14739
14746
|
}
|
|
14740
14747
|
y(!1), (L = u == null ? void 0 : u.control.room) != null && L.disableDeviceInputs && (u.control.room.disableDeviceInputs = !1);
|
|
14741
|
-
},
|
|
14748
|
+
}, N = (x) => [
|
|
14742
14749
|
[x.x, x.y],
|
|
14743
14750
|
[x.x + x.w, x.y],
|
|
14744
14751
|
[x.x + x.w, x.y + x.h],
|
|
@@ -14817,7 +14824,7 @@ const hm = () => {
|
|
|
14817
14824
|
}
|
|
14818
14825
|
}
|
|
14819
14826
|
E[0] = z.w / t.w, E[1] = z.h / t.h;
|
|
14820
|
-
const H =
|
|
14827
|
+
const H = N(z).map((Q) => A.control.viewContainerManager.transformToScenePoint(Q, A.viewId)), Z = w(H, x);
|
|
14821
14828
|
return O && (rt[1] = Z[1] - j[1]), D && (rt[0] = Z[0] - j[0]), { scale: E, translate: rt };
|
|
14822
14829
|
}, S = (x, L) => {
|
|
14823
14830
|
if (x.cancelable && x.preventDefault(), x.stopPropagation(), u != null && u.control.worker.isBusy) {
|
|
@@ -14825,14 +14832,14 @@ const hm = () => {
|
|
|
14825
14832
|
return;
|
|
14826
14833
|
}
|
|
14827
14834
|
if (h != null && h.w && (h != null && h.h) && u) {
|
|
14828
|
-
const A = { x: h.x, y: h.y, w: h.w, h: h.h }, j =
|
|
14835
|
+
const A = { x: h.x, y: h.y, w: h.w, h: h.h }, j = N(A), D = j.map((E) => u.control.viewContainerManager.transformToScenePoint(E, u.viewId)), O = w(j, L), z = w(D, L);
|
|
14829
14836
|
e(A), s(O), r(z), l(L), u != null && u.control.room && (u.control.room.disableDeviceInputs = !0), _.emitMethod(
|
|
14830
14837
|
X.MainEngine,
|
|
14831
14838
|
R.ScaleNode,
|
|
14832
14839
|
{ workIds: [$], originPoint: O, scenePoint: z, workState: P.Start, viewId: u.viewId }
|
|
14833
14840
|
);
|
|
14834
14841
|
}
|
|
14835
|
-
},
|
|
14842
|
+
}, I = jt((x, L, A, j) => {
|
|
14836
14843
|
if (x.cancelable && x.preventDefault(), x.stopPropagation(), !u || !i || !n)
|
|
14837
14844
|
return;
|
|
14838
14845
|
if (u != null && u.control.worker.isBusy) {
|
|
@@ -14893,11 +14900,11 @@ const hm = () => {
|
|
|
14893
14900
|
},
|
|
14894
14901
|
lockAspectRatio: (h == null ? void 0 : h.scaleType) === pt.proportional,
|
|
14895
14902
|
onResizeStart: S,
|
|
14896
|
-
onResize:
|
|
14903
|
+
onResize: I,
|
|
14897
14904
|
onResizeStop: v
|
|
14898
14905
|
}
|
|
14899
14906
|
);
|
|
14900
|
-
},
|
|
14907
|
+
}, hs = (a) => {
|
|
14901
14908
|
const { id: o, pos: t, pointMap: e, type: i } = a, { setOperationType: s, mananger: n, floatBarData: r } = xt(kt), [c, l] = st({ x: 0, y: 0 }), [h, u] = st(P.Pending), [d, p] = st(!1);
|
|
14902
14909
|
gt(() => (_.activeListener(f), () => {
|
|
14903
14910
|
_.unmountActiveListener(f);
|
|
@@ -14930,14 +14937,14 @@ const hm = () => {
|
|
|
14930
14937
|
}
|
|
14931
14938
|
const S = { x: m.x, y: m.y };
|
|
14932
14939
|
if ((S.x !== (t == null ? void 0 : t.x) || S.y !== (t == null ? void 0 : t.y)) && (n != null && n.control.viewContainerManager)) {
|
|
14933
|
-
const
|
|
14934
|
-
v && i === "start" ? v[0] =
|
|
14940
|
+
const I = n.control.viewContainerManager.transformToScenePoint([S.x, S.y], n.viewId), v = e.get(o);
|
|
14941
|
+
v && i === "start" ? v[0] = I : v && i === "end" && (v[1] = I), u(P.Doing), _.emitMethod(
|
|
14935
14942
|
X.MainEngine,
|
|
14936
14943
|
R.SetPoint,
|
|
14937
14944
|
{ workId: $, pointMap: e, workState: P.Doing, viewId: n == null ? void 0 : n.viewId }
|
|
14938
14945
|
);
|
|
14939
14946
|
}
|
|
14940
|
-
}, 100, { leading: !1 }),
|
|
14947
|
+
}, 100, { leading: !1 }), N = jt((w, m) => {
|
|
14941
14948
|
if (w.cancelable && w.preventDefault(), n != null && n.control.worker.isBusy) {
|
|
14942
14949
|
p(!0), u(P.Pending);
|
|
14943
14950
|
return;
|
|
@@ -14945,8 +14952,8 @@ const hm = () => {
|
|
|
14945
14952
|
w.stopPropagation(), s(R.None), u(P.Done);
|
|
14946
14953
|
const S = { x: m.x, y: m.y };
|
|
14947
14954
|
if (n != null && n.control.viewContainerManager) {
|
|
14948
|
-
const
|
|
14949
|
-
v && i === "start" ? v[0] =
|
|
14955
|
+
const I = n.control.viewContainerManager.transformToScenePoint([S.x, S.y], n.viewId), v = e.get(o);
|
|
14956
|
+
v && i === "start" ? v[0] = I : v && i === "end" && (v[1] = I), n != null && n.control.room && (n.control.room.disableDeviceInputs = !1), _.emitMethod(
|
|
14950
14957
|
X.MainEngine,
|
|
14951
14958
|
R.SetPoint,
|
|
14952
14959
|
{ workId: $, pointMap: e, workState: P.Done, viewId: n == null ? void 0 : n.viewId }
|
|
@@ -14960,7 +14967,7 @@ const hm = () => {
|
|
|
14960
14967
|
position: c,
|
|
14961
14968
|
onStart: y,
|
|
14962
14969
|
onDrag: M,
|
|
14963
|
-
onStop:
|
|
14970
|
+
onStop: N
|
|
14964
14971
|
},
|
|
14965
14972
|
/* @__PURE__ */ k.createElement(
|
|
14966
14973
|
"div",
|
|
@@ -14988,7 +14995,7 @@ const hm = () => {
|
|
|
14988
14995
|
}
|
|
14989
14996
|
d[0] && s({ x: d[0][0], y: d[0][1] }), d[1] && r({ x: d[1][0], y: d[1][1] });
|
|
14990
14997
|
}, [e, t == null ? void 0 : t.points, t == null ? void 0 : t.selectIds, c]);
|
|
14991
|
-
const h = q(() => i && (t != null && t.selectIds) ? /* @__PURE__ */ k.createElement(
|
|
14998
|
+
const h = q(() => i && (t != null && t.selectIds) ? /* @__PURE__ */ k.createElement(hs, { pos: i, type: "start", id: t.selectIds[0], pointMap: c }) : null, [i, t == null ? void 0 : t.selectIds, c]), u = q(() => n && (t != null && t.selectIds) ? /* @__PURE__ */ k.createElement(hs, { pos: n, type: "end", id: t.selectIds[0], pointMap: c }) : null, [n, t == null ? void 0 : t.selectIds, c]);
|
|
14992
14999
|
return /* @__PURE__ */ k.createElement("div", { className: `${o}` }, h, u);
|
|
14993
15000
|
}, wm = k.forwardRef((a, o) => {
|
|
14994
15001
|
const { floatBarData: t, operationType: e } = xt(kt), i = q(() => (t == null ? void 0 : t.scaleType) !== pt.all || e === R.RotateNode ? null : /* @__PURE__ */ k.createElement(hm, null), [t, e]), s = q(() => (t == null ? void 0 : t.scaleType) !== pt.both || e === R.RotateNode ? null : /* @__PURE__ */ k.createElement(um, null), [t, e]), n = q(() => (t == null ? void 0 : t.scaleType) !== pt.proportional || e === R.RotateNode ? null : /* @__PURE__ */ k.createElement(dm, null), [t, e]), r = q(() => (t == null ? void 0 : t.scaleType) === pt.none && (t != null && t.canLock) ? /* @__PURE__ */ k.createElement(pm, null) : null, [t]);
|
|
@@ -15188,18 +15195,18 @@ const Cm = (a) => {
|
|
|
15188
15195
|
const u = i.maps.get(o);
|
|
15189
15196
|
u && l(u.miniMapCamera, u.viewCamera);
|
|
15190
15197
|
}, l = (u, d) => {
|
|
15191
|
-
const { width: p, height: f } = s.getBoundingClientRect(), y = Math.min(p / u.width, f / u.height), M = d.width / d.scale,
|
|
15198
|
+
const { width: p, height: f } = s.getBoundingClientRect(), y = Math.min(p / u.width, f / u.height), M = d.width / d.scale, N = d.height / d.scale, w = [d.centerX, d.centerY], m = [u.centerX, u.centerY], S = [w[0] - m[0], w[1] - m[1]], I = Math.min(u.scale * y, u.scale * y), v = [S[0] * I, S[1] * I, M, N, I];
|
|
15192
15199
|
r(v);
|
|
15193
15200
|
}, h = (u) => {
|
|
15194
15201
|
var d;
|
|
15195
15202
|
if (i.control.renderControl.isWriteable()) {
|
|
15196
15203
|
const p = u.nativeEvent.target || u.nativeEvent.srcElement;
|
|
15197
15204
|
if (p && u.nativeEvent && n) {
|
|
15198
|
-
const { width: f, height: y } = p.getBoundingClientRect(), [M,
|
|
15205
|
+
const { width: f, height: y } = p.getBoundingClientRect(), [M, N] = [f / 2, y / 2], [w, m] = [(u.nativeEvent.offsetX - M) / n[4], (u.nativeEvent.offsetY - N) / n[4]], S = i.maps.get(o);
|
|
15199
15206
|
if (S != null && S.viewCamera) {
|
|
15200
|
-
const [
|
|
15207
|
+
const [I, v] = [S.miniMapCamera.centerX + w, S.miniMapCamera.centerY + m];
|
|
15201
15208
|
(d = i.control.room) == null || d.moveCamera({
|
|
15202
|
-
centerX:
|
|
15209
|
+
centerX: I,
|
|
15203
15210
|
centerY: v,
|
|
15204
15211
|
animationMode: "immediately"
|
|
15205
15212
|
});
|
|
@@ -15259,7 +15266,7 @@ const Cm = (a) => {
|
|
|
15259
15266
|
setFloatBarData: () => {
|
|
15260
15267
|
}
|
|
15261
15268
|
});
|
|
15262
|
-
class
|
|
15269
|
+
class gi extends k.Component {
|
|
15263
15270
|
constructor(t) {
|
|
15264
15271
|
var e, i;
|
|
15265
15272
|
super(t);
|
|
@@ -15403,7 +15410,7 @@ class zm extends fn {
|
|
|
15403
15410
|
}
|
|
15404
15411
|
createMainViewDisplayer(t) {
|
|
15405
15412
|
const e = document.createElement("div");
|
|
15406
|
-
return e.className = "appliance-plugin-main-view-displayer", t.appendChild(e), this.eventTragetElement = t.children[0], this.containerOffset = this.getContainerOffset(this.eventTragetElement, this.containerOffset), this.bindToolsClass(), Zo.render(/* @__PURE__ */ k.createElement(
|
|
15413
|
+
return e.className = "appliance-plugin-main-view-displayer", t.appendChild(e), this.eventTragetElement = t.children[0], this.containerOffset = this.getContainerOffset(this.eventTragetElement, this.containerOffset), this.bindToolsClass(), Zo.render(/* @__PURE__ */ k.createElement(gi, { viewId: this.viewId, mananger: this, refs: {
|
|
15407
15414
|
canvasServiceFloatRef: this.canvasServiceFloatRef,
|
|
15408
15415
|
canvasFloatRef: this.canvasFloatRef,
|
|
15409
15416
|
canvasBgRef: this.canvasBgRef,
|
|
@@ -15447,7 +15454,7 @@ class Pm extends ww {
|
|
|
15447
15454
|
}
|
|
15448
15455
|
createAppViewDisplayer(t, e) {
|
|
15449
15456
|
const i = document.createElement("div");
|
|
15450
|
-
return i.className = "appliance-plugin-app-view-displayer", e.appendChild(i), this.eventTragetElement = e.children[0], this.containerOffset = this.getContainerOffset(this.eventTragetElement, this.containerOffset), this.bindToolsClass(), Zo.render(/* @__PURE__ */ k.createElement(
|
|
15457
|
+
return i.className = "appliance-plugin-app-view-displayer", e.appendChild(i), this.eventTragetElement = e.children[0], this.containerOffset = this.getContainerOffset(this.eventTragetElement, this.containerOffset), this.bindToolsClass(), Zo.render(/* @__PURE__ */ k.createElement(gi, { viewId: t, mananger: this, refs: {
|
|
15451
15458
|
canvasServiceFloatRef: this.canvasServiceFloatRef,
|
|
15452
15459
|
canvasFloatRef: this.canvasFloatRef,
|
|
15453
15460
|
canvasBgRef: this.canvasBgRef,
|
|
@@ -15843,12 +15850,12 @@ class re extends Ct {
|
|
|
15843
15850
|
}), this.viewContainerManager.listenerWindowManager(this.windowManager);
|
|
15844
15851
|
}
|
|
15845
15852
|
}
|
|
15846
|
-
const B = class B extends
|
|
15853
|
+
const B = class B extends fs {
|
|
15847
15854
|
constructor() {
|
|
15848
15855
|
super(...arguments);
|
|
15849
15856
|
g(this, "onPhaseChanged", (t) => {
|
|
15850
15857
|
var e;
|
|
15851
|
-
t ===
|
|
15858
|
+
t === gs.Reconnecting && ((e = B.currentManager) == null || e.setSnapshootData());
|
|
15852
15859
|
});
|
|
15853
15860
|
g(this, "updateRoomWritable", () => {
|
|
15854
15861
|
var t;
|
|
@@ -15872,41 +15879,41 @@ const B = class B extends ps {
|
|
|
15872
15879
|
maxScreenshotWidth: 10 * 1024,
|
|
15873
15880
|
maxScreenshotHeight: 10 * 1024,
|
|
15874
15881
|
getBoundingRectAsync: async function(f) {
|
|
15875
|
-
var
|
|
15882
|
+
var N;
|
|
15876
15883
|
B.logger.info("[ApplianceMultiPlugin] getBoundingRectAsync");
|
|
15877
|
-
const y = (t.mainView || i).getBoundingRect(f), M = await ((
|
|
15878
|
-
return !y.width || !y.height ? M :
|
|
15884
|
+
const y = (t.mainView || i).getBoundingRect(f), M = await ((N = B.currentManager) == null ? void 0 : N.getBoundingRect(f));
|
|
15885
|
+
return !y.width || !y.height ? M : di(y, M);
|
|
15879
15886
|
},
|
|
15880
|
-
screenshotToCanvasAsync: async function(f, y, M,
|
|
15887
|
+
screenshotToCanvasAsync: async function(f, y, M, N, w, m) {
|
|
15881
15888
|
var A;
|
|
15882
15889
|
B.logger.info("[ApplianceMultiPlugin] screenshotToCanvasAsync");
|
|
15883
|
-
let S = M,
|
|
15884
|
-
S > this.maxScreenshotWidth && (v = this.maxScreenshotWidth / S * v, S = this.maxScreenshotWidth),
|
|
15890
|
+
let S = M, I = N, v = w.scale;
|
|
15891
|
+
S > this.maxScreenshotWidth && (v = this.maxScreenshotWidth / S * v, S = this.maxScreenshotWidth), I > this.maxScreenshotHeight && (v = Math.min(this.maxScreenshotHeight / I * v, v), I = this.maxScreenshotHeight), w.scale = v;
|
|
15885
15892
|
const x = document.createElement("canvas"), L = x.getContext("2d");
|
|
15886
|
-
x.width = S * (m || 1), x.height =
|
|
15893
|
+
x.width = S * (m || 1), x.height = I * (m || 1), L && ((t.mainView || i).screenshotToCanvas(L, y, S, I, w, m), f.drawImage(x, Math.floor((M - S) / 2), Math.floor((N - I) / 2), S * (m || 1), I * (m || 1), 0, 0, S, I), x.remove()), B.currentManager && await ((A = B.currentManager) == null ? void 0 : A.screenshotToCanvas(f, y, S, I, w, Math.floor((M - S) / 2), Math.floor((N - I) / 2)));
|
|
15887
15894
|
},
|
|
15888
|
-
scenePreviewAsync: async function(f, y, M,
|
|
15889
|
-
B.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || i).scenePreview(f, y, M,
|
|
15895
|
+
scenePreviewAsync: async function(f, y, M, N, w) {
|
|
15896
|
+
B.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || i).scenePreview(f, y, M, N, w);
|
|
15890
15897
|
const m = document.createElement("img");
|
|
15891
15898
|
m.className = "appliance-plugin-fill-scene-snapshot-img", y.append(m), getComputedStyle(y).position || (y.style.position = "relative"), B.currentManager && await B.currentManager.scenePreview(f, m);
|
|
15892
15899
|
},
|
|
15893
|
-
fillSceneSnapshotAsync: async function(f, y, M,
|
|
15894
|
-
B.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), y.innerHTML = "", (t.mainView || i).fillSceneSnapshot(f, y, M,
|
|
15895
|
-
const m = M || t.mainView.size.width, S =
|
|
15896
|
-
let
|
|
15897
|
-
|
|
15900
|
+
fillSceneSnapshotAsync: async function(f, y, M, N, w) {
|
|
15901
|
+
B.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), y.innerHTML = "", (t.mainView || i).fillSceneSnapshot(f, y, M, N, w);
|
|
15902
|
+
const m = M || t.mainView.size.width, S = N || t.mainView.size.height;
|
|
15903
|
+
let I = await this.getBoundingRectAsync(f);
|
|
15904
|
+
I || (I = {
|
|
15898
15905
|
originX: 0,
|
|
15899
15906
|
originY: 0,
|
|
15900
15907
|
width: m,
|
|
15901
15908
|
height: S
|
|
15902
15909
|
});
|
|
15903
|
-
let v = Math.max(
|
|
15910
|
+
let v = Math.max(I == null ? void 0 : I.width, m), x = Math.max(I == null ? void 0 : I.height, S), L = 1;
|
|
15904
15911
|
const A = v > m && Math.min(m / v, L) || L, j = x > S && Math.min(S / x, L) || L;
|
|
15905
15912
|
A <= j ? (v = A < 1 && m || v, x = Math.floor(x * A) + 1, L = A) : A > j && (x = j < 1 && S || x, v = Math.floor(v * j) + 1, L = j);
|
|
15906
15913
|
const D = {
|
|
15907
15914
|
scale: L,
|
|
15908
|
-
centerX:
|
|
15909
|
-
centerY:
|
|
15915
|
+
centerX: I.originX + I.width / 2,
|
|
15916
|
+
centerY: I.originY + I.height / 2
|
|
15910
15917
|
}, O = document.createElement("canvas"), z = O.getContext("2d");
|
|
15911
15918
|
O.width = v, O.height = x, z && await this.screenshotToCanvasAsync(z, f, v, x, D, devicePixelRatio);
|
|
15912
15919
|
const E = document.createElement("img");
|
|
@@ -15972,7 +15979,7 @@ const B = class B extends ps {
|
|
|
15972
15979
|
B.currentManager && (B.logger.info("[ApplianceMultiPlugin] destroy"), B.currentManager.destroy(), B.currentManager = void 0);
|
|
15973
15980
|
},
|
|
15974
15981
|
setMemberState(f) {
|
|
15975
|
-
B.logger.info(
|
|
15982
|
+
B.logger.info(`[ApplianceMultiPlugin] setMemberState ${JSON.stringify(f)}`);
|
|
15976
15983
|
const y = Object.keys(f);
|
|
15977
15984
|
if (ct(i) && i.isWritable) {
|
|
15978
15985
|
y.includes("currentApplianceName") && (f.currentApplianceName && f.currentApplianceName === nt.laserPen ? (f.currentApplianceName = nt.pencil, f.useLaserPen = !0) : f.currentApplianceName && f.currentApplianceName === nt.pencil && (f.useLaserPen = !1)), l.call(t.mainView, f);
|
|
@@ -16083,9 +16090,9 @@ g(B, "kind", "appliance-multi-plugin"), g(B, "currentManager"), g(B, "logger", {
|
|
|
16083
16090
|
displayer: t.displayer,
|
|
16084
16091
|
options: e
|
|
16085
16092
|
}, n = new re(s);
|
|
16086
|
-
B.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"), n.setWindowManager(t), B.currentManager = n;
|
|
16093
|
+
B.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"), n.setWindowManager(t), B.currentManager = n, t.room && t.room.logger.info(`[ApplianceMultiPlugin] use ${ri}`);
|
|
16087
16094
|
});
|
|
16088
|
-
let
|
|
16095
|
+
let us = B;
|
|
16089
16096
|
class Dm extends fn {
|
|
16090
16097
|
constructor(t, e) {
|
|
16091
16098
|
super(t, e);
|
|
@@ -16113,7 +16120,7 @@ class Dm extends fn {
|
|
|
16113
16120
|
}
|
|
16114
16121
|
}
|
|
16115
16122
|
createMainViewDisplayer(t) {
|
|
16116
|
-
return this.vDom || (this.containerOffset = this.getContainerOffset(t, this.containerOffset), this.eventTragetElement = t.parentElement.children[0], t.innerHTML = "", Zo.render(/* @__PURE__ */ k.createElement(
|
|
16123
|
+
return this.vDom || (this.containerOffset = this.getContainerOffset(t, this.containerOffset), this.eventTragetElement = t.parentElement.children[0], t.innerHTML = "", Zo.render(/* @__PURE__ */ k.createElement(gi, { viewId: this.viewId, mananger: this, refs: {
|
|
16117
16124
|
canvasServiceFloatRef: this.canvasServiceFloatRef,
|
|
16118
16125
|
canvasFloatRef: this.canvasFloatRef,
|
|
16119
16126
|
canvasBgRef: this.canvasBgRef,
|
|
@@ -16227,7 +16234,7 @@ class Gt extends Ct {
|
|
|
16227
16234
|
var i;
|
|
16228
16235
|
const e = this.viewContainerManager.mainView;
|
|
16229
16236
|
e && e.cameraOpt && (e.cameraOpt.width !== t.width || e.cameraOpt.height !== t.height) && ((i = this.viewContainerManager.mainView) == null || i.displayer.updateSize()), this.viewContainerManager.setFocuedViewCameraOpt(t);
|
|
16230
|
-
},
|
|
16237
|
+
}, ui, { leading: !1 }));
|
|
16231
16238
|
const e = {
|
|
16232
16239
|
control: this,
|
|
16233
16240
|
internalMsgEmitter: Gt.InternalMsgEmitter,
|
|
@@ -16322,12 +16329,12 @@ class Gt extends Ct {
|
|
|
16322
16329
|
await this.worker.init();
|
|
16323
16330
|
}
|
|
16324
16331
|
}
|
|
16325
|
-
const W = class W extends
|
|
16332
|
+
const W = class W extends fs {
|
|
16326
16333
|
constructor() {
|
|
16327
16334
|
super(...arguments);
|
|
16328
16335
|
g(this, "onPhaseChanged", (t) => {
|
|
16329
16336
|
var e;
|
|
16330
|
-
t ===
|
|
16337
|
+
t === gs.Reconnecting && ((e = W.currentManager) == null || e.setSnapshootData());
|
|
16331
16338
|
});
|
|
16332
16339
|
g(this, "updateRoomWritable", () => {
|
|
16333
16340
|
var t;
|
|
@@ -16357,24 +16364,24 @@ const W = class W extends ps {
|
|
|
16357
16364
|
var M;
|
|
16358
16365
|
W.logger.info("[ApplianceSinglePlugin] getBoundingRectAsync");
|
|
16359
16366
|
const f = t.getBoundingRect(p), y = await ((M = W.currentManager) == null ? void 0 : M.getBoundingRect(p));
|
|
16360
|
-
return !f.width || !f.height ? y :
|
|
16367
|
+
return !f.width || !f.height ? y : di(f, y);
|
|
16361
16368
|
},
|
|
16362
|
-
screenshotToCanvasAsync: async function(p, f, y, M,
|
|
16369
|
+
screenshotToCanvasAsync: async function(p, f, y, M, N, w) {
|
|
16363
16370
|
var L;
|
|
16364
16371
|
W.logger.info("[ApplianceSinglePlugin] screenshotToCanvasAsync");
|
|
16365
|
-
let m = y, S = M,
|
|
16366
|
-
m > this.maxScreenshotWidth && (
|
|
16372
|
+
let m = y, S = M, I = N.scale;
|
|
16373
|
+
m > this.maxScreenshotWidth && (I = this.maxScreenshotWidth / m * I, m = this.maxScreenshotWidth), S > this.maxScreenshotHeight && (I = Math.min(this.maxScreenshotHeight / S * I, I), S = this.maxScreenshotHeight), N.scale = I;
|
|
16367
16374
|
const v = document.createElement("canvas"), x = v.getContext("2d");
|
|
16368
|
-
v.width = m * (w || 1), v.height = S * (w || 1), x && (t.screenshotToCanvas(x, f, m, S,
|
|
16375
|
+
v.width = m * (w || 1), v.height = S * (w || 1), x && (t.screenshotToCanvas(x, f, m, S, N, w), p.drawImage(v, Math.floor((y - m) / 2), Math.floor((M - S) / 2), m * (w || 1), S * (w || 1), 0, 0, m, S), v.remove()), W.currentManager && await ((L = W.currentManager) == null ? void 0 : L.screenshotToCanvas(p, f, m, S, N, Math.floor((y - m) / 2), Math.floor((M - S) / 2)));
|
|
16369
16376
|
},
|
|
16370
|
-
scenePreviewAsync: async function(p, f, y, M,
|
|
16371
|
-
W.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"), t.scenePreview(p, f, y, M,
|
|
16377
|
+
scenePreviewAsync: async function(p, f, y, M, N) {
|
|
16378
|
+
W.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"), t.scenePreview(p, f, y, M, N);
|
|
16372
16379
|
const w = document.createElement("img");
|
|
16373
16380
|
w.className = "appliance-plugin-fill-scene-snapshot-img", f.append(w), getComputedStyle(f).position || (f.style.position = "relative"), W.currentManager && await W.currentManager.scenePreview(p, w);
|
|
16374
16381
|
},
|
|
16375
|
-
fillSceneSnapshotAsync: async function(p, f, y, M,
|
|
16382
|
+
fillSceneSnapshotAsync: async function(p, f, y, M, N) {
|
|
16376
16383
|
var E, rt;
|
|
16377
|
-
W.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"), f.innerHTML = "", t.fillSceneSnapshot(p, f, y, M,
|
|
16384
|
+
W.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"), f.innerHTML = "", t.fillSceneSnapshot(p, f, y, M, N);
|
|
16378
16385
|
const w = y || ((E = t.state.cameraState) == null ? void 0 : E.width) || 0, m = M || ((rt = t.state.cameraState) == null ? void 0 : rt.height) || 0;
|
|
16379
16386
|
let S = await this.getBoundingRectAsync(p);
|
|
16380
16387
|
S || (S = {
|
|
@@ -16383,15 +16390,15 @@ const W = class W extends ps {
|
|
|
16383
16390
|
width: w,
|
|
16384
16391
|
height: m
|
|
16385
16392
|
});
|
|
16386
|
-
let
|
|
16387
|
-
const L =
|
|
16388
|
-
L <= A ? (
|
|
16393
|
+
let I = Math.max(S == null ? void 0 : S.width, w), v = Math.max(S == null ? void 0 : S.height, m), x = 1;
|
|
16394
|
+
const L = I > w && Math.min(w / I, x) || x, A = v > m && Math.min(m / v, x) || x;
|
|
16395
|
+
L <= A ? (I = L < 1 && w || I, v = Math.floor(v * L) + 1, x = L) : L > A && (v = A < 1 && m || v, I = Math.floor(I * A) + 1, x = A);
|
|
16389
16396
|
const j = {
|
|
16390
16397
|
scale: x,
|
|
16391
16398
|
centerX: S.originX + S.width / 2,
|
|
16392
16399
|
centerY: S.originY + S.height / 2
|
|
16393
16400
|
}, D = document.createElement("canvas"), O = D.getContext("2d");
|
|
16394
|
-
D.width =
|
|
16401
|
+
D.width = I, D.height = v, O && await this.screenshotToCanvasAsync(O, p, I, v, j, devicePixelRatio);
|
|
16395
16402
|
const z = document.createElement("img");
|
|
16396
16403
|
z.className = "appliance-plugin-fill-scene-snapshot-img", z.src = D.toDataURL(), z.onload = () => {
|
|
16397
16404
|
D.remove();
|
|
@@ -16455,7 +16462,7 @@ const W = class W extends ps {
|
|
|
16455
16462
|
W.currentManager && (W.logger.info("[ApplianceSinglePlugin] destroy"), W.currentManager.destroy(), W.currentManager = void 0, W.cursorAdapter = void 0);
|
|
16456
16463
|
},
|
|
16457
16464
|
setMemberState(p) {
|
|
16458
|
-
W.logger.info(
|
|
16465
|
+
W.logger.info(`[ApplianceSinglePlugin] setMemberState ${JSON.stringify(p)}`);
|
|
16459
16466
|
const f = Object.keys(p);
|
|
16460
16467
|
if (ct(t) && t.isWritable) {
|
|
16461
16468
|
f.includes("currentApplianceName") && (p.currentApplianceName && p.currentApplianceName === nt.laserPen ? (p.currentApplianceName = nt.pencil, p.useLaserPen = !0) : p.currentApplianceName && p.currentApplianceName === nt.pencil && (p.useLaserPen = !1)), c(p);
|
|
@@ -16579,9 +16586,9 @@ g(W, "kind", "appliance-aids-single-plugin"), g(W, "cursorAdapter"), g(W, "curre
|
|
|
16579
16586
|
displayer: t,
|
|
16580
16587
|
options: e
|
|
16581
16588
|
}, n = new Gt(s);
|
|
16582
|
-
n.init(), W.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"), W.currentManager = n;
|
|
16589
|
+
n.init(), W.logger.info("[ApplianceSinglePlugin] refresh ApplianceSingleManager object"), W.currentManager = n, ct(t) && t.logger.info(`[ApplianceSinglePlugin] use ${ri}`);
|
|
16583
16590
|
});
|
|
16584
|
-
let
|
|
16591
|
+
let ds = W;
|
|
16585
16592
|
const Le = class Le extends k.Component {
|
|
16586
16593
|
constructor() {
|
|
16587
16594
|
super(...arguments);
|
|
@@ -16595,7 +16602,7 @@ const Le = class Le extends k.Component {
|
|
|
16595
16602
|
}
|
|
16596
16603
|
};
|
|
16597
16604
|
g(Le, "emiter");
|
|
16598
|
-
let
|
|
16605
|
+
let ps = Le;
|
|
16599
16606
|
class Zm extends gw {
|
|
16600
16607
|
constructor(t) {
|
|
16601
16608
|
super();
|
|
@@ -16623,7 +16630,7 @@ class Zm extends gw {
|
|
|
16623
16630
|
onCreate() {
|
|
16624
16631
|
}
|
|
16625
16632
|
onSetToolkey(t) {
|
|
16626
|
-
t ===
|
|
16633
|
+
t === T.Pencil ? this.isActive = !0 : (this.isActive && (this.localStorage.length = 0, this.timer && clearTimeout(this.timer), this.timer = void 0, this.iconRect && (this.iconRect = void 0), this.icons.length = 0), this.isActive = !1);
|
|
16627
16634
|
}
|
|
16628
16635
|
syncStorage(t, e) {
|
|
16629
16636
|
if (!this.isActive || t !== this.viewId)
|
|
@@ -16645,7 +16652,7 @@ class Zm extends gw {
|
|
|
16645
16652
|
const i = (r = (n = this.collector) == null ? void 0 : n.storage[t]) == null ? void 0 : r[e];
|
|
16646
16653
|
return i ? Object.keys(i).filter((c) => {
|
|
16647
16654
|
var l, h;
|
|
16648
|
-
return ((l = this.collector) == null ? void 0 : l.isOwn(c)) && ((h = i[c]) == null ? void 0 : h.toolsType) ===
|
|
16655
|
+
return ((l = this.collector) == null ? void 0 : l.isOwn(c)) && ((h = i[c]) == null ? void 0 : h.toolsType) === T.Pencil && !this.excludeStorage.includes(c);
|
|
16649
16656
|
}) : [];
|
|
16650
16657
|
}
|
|
16651
16658
|
async batchLocalDraw() {
|
|
@@ -16735,7 +16742,7 @@ class Zm extends gw {
|
|
|
16735
16742
|
}
|
|
16736
16743
|
localEvent(t, e) {
|
|
16737
16744
|
var i;
|
|
16738
|
-
if (t === this.viewId && ((i = this.control.worker.currentToolsData) == null ? void 0 : i.toolsType) ===
|
|
16745
|
+
if (t === this.viewId && ((i = this.control.worker.currentToolsData) == null ? void 0 : i.toolsType) === T.Pencil)
|
|
16739
16746
|
switch (e) {
|
|
16740
16747
|
case P.Start:
|
|
16741
16748
|
this.timer && (clearTimeout(this.timer), this.timer = void 0);
|
|
@@ -16760,7 +16767,7 @@ class Zm extends gw {
|
|
|
16760
16767
|
}
|
|
16761
16768
|
}
|
|
16762
16769
|
export {
|
|
16763
|
-
|
|
16770
|
+
us as A,
|
|
16764
16771
|
St as B,
|
|
16765
16772
|
Qm as C,
|
|
16766
16773
|
Et as D,
|
|
@@ -16776,15 +16783,15 @@ export {
|
|
|
16776
16783
|
Zm as N,
|
|
16777
16784
|
gw as P,
|
|
16778
16785
|
$t as S,
|
|
16779
|
-
|
|
16786
|
+
ui as T,
|
|
16780
16787
|
gg as V,
|
|
16781
|
-
|
|
16788
|
+
T as a,
|
|
16782
16789
|
U as b,
|
|
16783
16790
|
b as c,
|
|
16784
16791
|
$ as d,
|
|
16785
16792
|
Xt as e,
|
|
16786
16793
|
fo as f,
|
|
16787
|
-
|
|
16794
|
+
hi as g,
|
|
16788
16795
|
R as h,
|
|
16789
16796
|
RM as i,
|
|
16790
16797
|
ze as j,
|
|
@@ -16798,8 +16805,8 @@ export {
|
|
|
16798
16805
|
$m as r,
|
|
16799
16806
|
Hm as s,
|
|
16800
16807
|
Ie as t,
|
|
16801
|
-
|
|
16802
|
-
|
|
16808
|
+
ds as u,
|
|
16809
|
+
ps as v,
|
|
16803
16810
|
nt as w,
|
|
16804
16811
|
et as x,
|
|
16805
16812
|
te as y,
|