@netless/appliance-plugin 1.1.9 → 1.1.10
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-DzU-Co.js → fullWorker-B5am5t.js} +58 -58
- package/cdn/{subWorker-B5ZQoK.js → subWorker-BNBv5T.js} +58 -58
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/core/enum.d.ts +3 -1
- package/dist/core/mainEngine.d.ts +1 -0
- package/dist/core/mainThread/base.d.ts +1 -0
- package/dist/core/mainThread/workerMainThread.d.ts +1 -0
- package/dist/core/tools/pencilEraserBitMap.d.ts +6 -1
- package/dist/core/worker/base.d.ts +2 -1
- package/dist/core/worker/workerManager.d.ts +2 -0
- package/dist/fullWorker.js +58 -58
- package/dist/{index-rRQeW_6Z.mjs → index-BxY7kerI.mjs} +227 -215
- package/dist/index-C2jNkleW.js +1 -0
- package/dist/{index-D8AMdzYo.mjs → index-DCVJNFKI.mjs} +730 -644
- package/dist/index-vs0uTdYT.js +1 -0
- package/dist/subWorker.js +58 -58
- package/package.json +1 -1
- package/dist/index-B90iIvel.js +0 -1
- package/dist/index-CpjV7Ujm.js +0 -1
|
@@ -12,7 +12,7 @@ import Xo, { 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 Vm = "/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 || {}),
|
|
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 || {}), ee = /* @__PURE__ */ ((a) => (a.Triangle = "triangle", a.Rhombus = "rhombus", a.Pentagram = "pentagram", a.SpeechBalloon = "speechBalloon", a.Star = "star", a.Polygon = "polygon", a))(ee || {}), 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 || {}), S = /* @__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))(S || {}), 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[a.UpdateDpr = 29] = "UpdateDpr", a))(b || {}), It = /* @__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))(It || {}), 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 || {}), Rt = /* @__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))(Rt || {}), oe = /* @__PURE__ */ ((a) => (a.setAuth = "setAuth", a.setShow = "addShow", a.setHide = "setHide", a.setClear = "setClear", a))(oe || {}), 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, ws = An, jn = ws, En = typeof self == "object" && self && self.Object === Object && self, On = jn || En || Function("return this")(),
|
|
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")(), te = On, Rn = te, Yn = Rn.Symbol, Ze = Yn, vi = Ze, ms = Object.prototype, Wn = ms.hasOwnProperty, Un = ms.toString, Be = vi ? vi.toStringTag : void 0;
|
|
501
501
|
function Bn(a) {
|
|
502
502
|
var o = Wn.call(a, Be), t = a[Be];
|
|
503
503
|
try {
|
|
@@ -525,7 +525,7 @@ function or(a) {
|
|
|
525
525
|
return typeof a == "number" || tr(a) && _n(a) == er;
|
|
526
526
|
}
|
|
527
527
|
var ir = or;
|
|
528
|
-
const
|
|
528
|
+
const _t = /* @__PURE__ */ je(ir);
|
|
529
529
|
function sr() {
|
|
530
530
|
this.__data__ = [], this.size = 0;
|
|
531
531
|
}
|
|
@@ -604,7 +604,7 @@ function Vr(a) {
|
|
|
604
604
|
var o = Yr(a);
|
|
605
605
|
return o == Br || o == Fr || o == Ur || o == $r;
|
|
606
606
|
}
|
|
607
|
-
var vs = Vr, Hr =
|
|
607
|
+
var vs = Vr, Hr = te, Qr = Hr["__core-js_shared__"], Gr = Qr, bo = Gr, Ti = function() {
|
|
608
608
|
var a = /[^.]+$/.exec(bo && bo.keys && bo.keys.IE_PROTO || "");
|
|
609
609
|
return a ? "Symbol(src)_1." + a : "";
|
|
610
610
|
}();
|
|
@@ -643,7 +643,7 @@ 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 =
|
|
646
|
+
var ve = ya, Ma = ve, wa = te, ma = Ma(wa, "Map"), qo = ma, va = ve, Ia = va(Object, "create"), vo = Ia, Si = vo;
|
|
647
647
|
function Na() {
|
|
648
648
|
this.__data__ = Si ? Si(null) : {}, this.size = 0;
|
|
649
649
|
}
|
|
@@ -811,7 +811,7 @@ function el() {
|
|
|
811
811
|
var ol = el;
|
|
812
812
|
so.exports;
|
|
813
813
|
(function(a, o) {
|
|
814
|
-
var t =
|
|
814
|
+
var t = te, e = ol, i = o && !o.nodeType && o, s = i && !0 && a && !a.nodeType && a, n = s && s.exports === i, r = n ? t.Buffer : void 0, c = r ? r.isBuffer : void 0, l = c || e;
|
|
815
815
|
a.exports = l;
|
|
816
816
|
})(so, so.exports);
|
|
817
817
|
var Ko = so.exports, il = 9007199254740991, sl = /^(?:0|[1-9]\d*)$/;
|
|
@@ -918,7 +918,7 @@ function Eh(a, o) {
|
|
|
918
918
|
var Oh = Eh, ro = { exports: {} };
|
|
919
919
|
ro.exports;
|
|
920
920
|
(function(a, o) {
|
|
921
|
-
var t =
|
|
921
|
+
var t = te, e = o && !o.nodeType && o, i = e && !0 && a && !a.nodeType && a, s = i && i.exports === e, n = s ? t.Buffer : void 0, r = n ? n.allocUnsafe : void 0;
|
|
922
922
|
function c(l, h) {
|
|
923
923
|
if (h)
|
|
924
924
|
return l.slice();
|
|
@@ -981,7 +981,7 @@ var Ys = yu, Mu = Rs, wu = Os, mu = ii;
|
|
|
981
981
|
function vu(a) {
|
|
982
982
|
return Mu(a, mu, wu);
|
|
983
983
|
}
|
|
984
|
-
var Iu = vu, Nu = ve, Tu =
|
|
984
|
+
var Iu = vu, Nu = ve, Tu = te, Su = Nu(Tu, "DataView"), ku = Su, Cu = ve, xu = te, bu = Cu(xu, "Promise"), Lu = bu, zu = ve, Pu = te, Du = zu(Pu, "Set"), Ws = Du, Au = ve, ju = te, Eu = Au(ju, "WeakMap"), Ou = Eu, Ro = ku, Yo = qo, Wo = Lu, Uo = Ws, Bo = Ou, Us = me, We = Is, Pi = "[object Map]", Ru = "[object Object]", Di = "[object Promise]", Ai = "[object Set]", ji = "[object WeakMap]", Ei = "[object DataView]", Yu = We(Ro), Wu = We(Yo), Uu = We(Wo), Bu = We(Uo), Fu = We(Bo), fe = Us;
|
|
985
985
|
(Ro && fe(new Ro(new ArrayBuffer(1))) != Ei || Yo && fe(new Yo()) != Pi || Wo && fe(Wo.resolve()) != Di || Uo && fe(new Uo()) != Ai || Bo && fe(new Bo()) != ji) && (fe = function(a) {
|
|
986
986
|
var o = Us(a), t = o == Ru ? a.constructor : void 0, e = t ? We(t) : "";
|
|
987
987
|
if (e)
|
|
@@ -1004,7 +1004,7 @@ function Hu(a) {
|
|
|
1004
1004
|
var o = a.length, t = new a.constructor(o);
|
|
1005
1005
|
return o && typeof a[0] == "string" && Vu.call(a, "index") && (t.index = a.index, t.input = a.input), t;
|
|
1006
1006
|
}
|
|
1007
|
-
var Qu = Hu, Gu =
|
|
1007
|
+
var Qu = Hu, Gu = te, Zu = Gu.Uint8Array, Bs = Zu, Oi = Bs;
|
|
1008
1008
|
function Xu(a) {
|
|
1009
1009
|
var o = new a.constructor(a.byteLength);
|
|
1010
1010
|
return new Oi(o).set(new Oi(a)), o;
|
|
@@ -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, T) {
|
|
1124
|
+
n.set(T, io(M, o, t, T, 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, T) {
|
|
1128
|
+
y && (T = M, M = a[T]), ap(n, T, io(M, o, t, T, a, s));
|
|
1129
1129
|
}), n;
|
|
1130
1130
|
}
|
|
1131
1131
|
var _p = io, tf = _p, ef = 1, of = 4;
|
|
@@ -1133,7 +1133,7 @@ function sf(a) {
|
|
|
1133
1133
|
return tf(a, ef | of);
|
|
1134
1134
|
}
|
|
1135
1135
|
var nf = sf;
|
|
1136
|
-
const Pt = /* @__PURE__ */ je(nf), Qs = "1.1.
|
|
1136
|
+
const Pt = /* @__PURE__ */ je(nf), Qs = "1.1.10", rf = "@netless/appliance-plugin", ai = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
|
|
1137
1137
|
if (typeof window < "u") {
|
|
1138
1138
|
let a = window.__netlessUA || "";
|
|
1139
1139
|
a += ` ${rf}@${Qs}`, window.__netlessUA = a;
|
|
@@ -1164,7 +1164,7 @@ const Ot = {
|
|
|
1164
1164
|
max: 10
|
|
1165
1165
|
}
|
|
1166
1166
|
};
|
|
1167
|
-
function
|
|
1167
|
+
function le(a, o = !0) {
|
|
1168
1168
|
const t = a.length;
|
|
1169
1169
|
if (t < 2)
|
|
1170
1170
|
return "";
|
|
@@ -1233,7 +1233,7 @@ const $t = class $t {
|
|
|
1233
1233
|
if (n.length !== 1)
|
|
1234
1234
|
return;
|
|
1235
1235
|
const r = n[0], { pos: c, zIndex: l, scale: h, angle: u, translate: d } = o, p = {};
|
|
1236
|
-
|
|
1236
|
+
_t(l) && (p.zIndex = l), c && (p.pos = [c[0], c[1]]), h && (p.scale = h), u && (p.rotate = u), d && (p.translate = d), r.attr(p);
|
|
1237
1237
|
const f = r == null ? void 0 : r.getBoundingClientRect();
|
|
1238
1238
|
return f && (t = lt(t, {
|
|
1239
1239
|
x: Math.floor(f.x - $t.SafeBorderPadding),
|
|
@@ -1251,16 +1251,16 @@ const $t = class $t {
|
|
|
1251
1251
|
for (const c of e) {
|
|
1252
1252
|
const { thickness: l, op: h } = c;
|
|
1253
1253
|
for (const u of h) {
|
|
1254
|
-
const d = u.map((
|
|
1254
|
+
const d = u.map((T, w) => w % 2 ? T - i[1] : T - i[0]), p = this.computEraserPoints(d, l), f = le(p, !0), y = {
|
|
1255
1255
|
pos: [0, 0],
|
|
1256
1256
|
d: f,
|
|
1257
1257
|
fillColor: "rgba(0,0,0,1)"
|
|
1258
1258
|
}, M = new ue(y);
|
|
1259
|
-
n && (M.addEventListener("beforerender", ({ detail:
|
|
1260
|
-
const w =
|
|
1259
|
+
n && (M.addEventListener("beforerender", ({ detail: T }) => {
|
|
1260
|
+
const w = T.context;
|
|
1261
1261
|
r ? w.blendFuncSeparate(w.ZERO, w.ZERO, w.ZERO, w.ZERO) : w.globalCompositeOperation = "destination-out";
|
|
1262
|
-
}), M.addEventListener("afterrender", ({ detail:
|
|
1263
|
-
const w =
|
|
1262
|
+
}), M.addEventListener("afterrender", ({ detail: T }) => {
|
|
1263
|
+
const w = T.context;
|
|
1264
1264
|
r ? w.blendFuncSeparate(w.SRC_ALPHA, w.ONE_MINUS_SRC_ALPHA, w.ONE, w.ONE_MINUS_SRC_ALPHA) : w.globalCompositeOperation = "source-over";
|
|
1265
1265
|
})), t.append(M);
|
|
1266
1266
|
}
|
|
@@ -1321,13 +1321,13 @@ const $t = class $t {
|
|
|
1321
1321
|
let y;
|
|
1322
1322
|
const M = n && Pt(n) || i.get(t.name);
|
|
1323
1323
|
if (!M) return;
|
|
1324
|
-
|
|
1325
|
-
const
|
|
1326
|
-
if (
|
|
1324
|
+
_t(r) && (t.setAttribute("zIndex", r), M.opt.zIndex = r);
|
|
1325
|
+
const T = t.parent;
|
|
1326
|
+
if (T) {
|
|
1327
1327
|
if (h && d && n) {
|
|
1328
1328
|
const m = [M.op[0], M.op[1]];
|
|
1329
1329
|
fi(M.op, u, d, c);
|
|
1330
|
-
const
|
|
1330
|
+
const I = [M.op[0], M.op[1]], N = [I[0] - m[0], I[1] - m[1]];
|
|
1331
1331
|
if (M.centerPos = [M.centerPos[0] + N[0], M.centerPos[1] + N[1]], M.opt.translate = void 0, M.opt.scale = void 0, M.opt.eraserlines)
|
|
1332
1332
|
for (const v of Object.values(M.opt.eraserlines)) {
|
|
1333
1333
|
const { op: x, thickness: L } = v;
|
|
@@ -1337,44 +1337,44 @@ const $t = class $t {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
} else if (c)
|
|
1339
1339
|
if (t.setAttribute("translate", c), M.opt.translate = c, n) {
|
|
1340
|
-
const m = [c[0] *
|
|
1340
|
+
const m = [c[0] * T.worldScaling[0], c[1] * T.worldScaling[1]];
|
|
1341
1341
|
y = $o(M.rect, m), M.rect = y;
|
|
1342
1342
|
} else {
|
|
1343
|
-
const m = $t.getRectFromLayer(
|
|
1343
|
+
const m = $t.getRectFromLayer(T, t.name);
|
|
1344
1344
|
M.rect = m || M.rect;
|
|
1345
1345
|
}
|
|
1346
|
-
else if (
|
|
1346
|
+
else if (_t(l))
|
|
1347
1347
|
if (t.setAttribute("rotate", l), M.opt.rotate = l, n)
|
|
1348
1348
|
y = un(M.rect, l), M.rect = y;
|
|
1349
1349
|
else {
|
|
1350
|
-
const m = $t.getRectFromLayer(
|
|
1350
|
+
const m = $t.getRectFromLayer(T, t.name);
|
|
1351
1351
|
M.rect = m || M.rect;
|
|
1352
1352
|
}
|
|
1353
1353
|
if (p) {
|
|
1354
1354
|
const m = p.get(t.name);
|
|
1355
1355
|
if (m)
|
|
1356
|
-
for (let
|
|
1357
|
-
M.op[
|
|
1356
|
+
for (let I = 0, N = 0; I < M.op.length; I += 3, N++)
|
|
1357
|
+
M.op[I] = m[N][0], M.op[I + 1] = m[N][1];
|
|
1358
1358
|
}
|
|
1359
1359
|
if (f && ((w = M == null ? void 0 : M.opt) != null && w.thickness) && (M.opt.thickness = f), s && !(h && d && n)) {
|
|
1360
1360
|
if (c) {
|
|
1361
|
-
const m = M.op.map((
|
|
1361
|
+
const m = M.op.map((I, N) => {
|
|
1362
1362
|
const v = N % 3;
|
|
1363
|
-
return v === 0 ?
|
|
1363
|
+
return v === 0 ? I + c[0] : v === 1 ? I + c[1] : I;
|
|
1364
1364
|
});
|
|
1365
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)
|
|
1366
|
-
for (const
|
|
1367
|
-
const { op: N } =
|
|
1366
|
+
for (const I of Object.values(M.opt.eraserlines)) {
|
|
1367
|
+
const { op: N } = I;
|
|
1368
1368
|
for (let v = 0; v < N.length; v++) {
|
|
1369
1369
|
const x = N[v].map((L, A) => A % 2 ? L + c[1] : L + c[0]);
|
|
1370
|
-
|
|
1370
|
+
I.op[v] = x;
|
|
1371
1371
|
}
|
|
1372
1372
|
}
|
|
1373
|
-
} else if (
|
|
1373
|
+
} else if (_t(l)) {
|
|
1374
1374
|
const m = M.op;
|
|
1375
1375
|
if (EM(m, M.centerPos, l), M.op = m, M != null && M.opt && (M.opt.rotate = void 0), M.opt.eraserlines)
|
|
1376
|
-
for (const
|
|
1377
|
-
const { op: N } =
|
|
1376
|
+
for (const I of Object.values(M.opt.eraserlines)) {
|
|
1377
|
+
const { op: N } = I;
|
|
1378
1378
|
for (let v = 0; v < N.length; v++)
|
|
1379
1379
|
OM(N[v], M.centerPos, l);
|
|
1380
1380
|
}
|
|
@@ -1469,15 +1469,15 @@ class Gs extends Y {
|
|
|
1469
1469
|
type: b.DrawWork,
|
|
1470
1470
|
dataType: U.Local
|
|
1471
1471
|
};
|
|
1472
|
-
const
|
|
1472
|
+
const T = [];
|
|
1473
1473
|
return this.tmpPoints.slice(M).forEach((w) => {
|
|
1474
|
-
|
|
1474
|
+
T.push(w.x, w.y, this.computRadius(w.z, this.workOptions.thickness));
|
|
1475
1475
|
}), {
|
|
1476
1476
|
...this.baseConsumeResult,
|
|
1477
1477
|
type: b.DrawWork,
|
|
1478
1478
|
dataType: U.Local,
|
|
1479
1479
|
rect: f,
|
|
1480
|
-
op: y ?
|
|
1480
|
+
op: y ? T : void 0,
|
|
1481
1481
|
index: y ? M * 3 : void 0,
|
|
1482
1482
|
updateNodeOpt: {
|
|
1483
1483
|
useAnimation: !0
|
|
@@ -1573,12 +1573,12 @@ class Gs extends Y {
|
|
|
1573
1573
|
(v = r.getElementById(N + "")) == null || v.remove();
|
|
1574
1574
|
}), n.clear());
|
|
1575
1575
|
let M;
|
|
1576
|
-
const
|
|
1576
|
+
const T = [], w = r.worldPosition, m = r.worldScaling;
|
|
1577
1577
|
for (let N = 0; N < i.length; N++) {
|
|
1578
1578
|
const { pos: v, points: x } = i[N], { ps: L, rect: A } = this.computDrawPoints(x);
|
|
1579
1579
|
let j;
|
|
1580
1580
|
const D = x.length === 1;
|
|
1581
|
-
l === et.Stroke || D ? j =
|
|
1581
|
+
l === et.Stroke || D ? j = le(L, !0) : j = le(L, !1);
|
|
1582
1582
|
const O = {
|
|
1583
1583
|
pos: v,
|
|
1584
1584
|
d: j,
|
|
@@ -1593,14 +1593,14 @@ class Gs extends Y {
|
|
|
1593
1593
|
y: Math.floor((A.y + v[1]) * m[1] + w[1] - Y.SafeBorderPadding),
|
|
1594
1594
|
w: Math.floor(A.w * m[0] + 2 * Y.SafeBorderPadding),
|
|
1595
1595
|
h: Math.floor(A.h * m[1] + 2 * Y.SafeBorderPadding)
|
|
1596
|
-
}),
|
|
1596
|
+
}), T.push(O);
|
|
1597
1597
|
}
|
|
1598
1598
|
d && (e.scale = d), p && (e.rotate = p), f && (e.translate = f);
|
|
1599
|
-
const
|
|
1599
|
+
const I = new Wt();
|
|
1600
1600
|
if (M) {
|
|
1601
1601
|
this.centerPos = Y.getCenterPos(M, r);
|
|
1602
1602
|
const N = l === et.Stroke && !y;
|
|
1603
|
-
|
|
1603
|
+
I.attr({
|
|
1604
1604
|
...e,
|
|
1605
1605
|
normalize: !0,
|
|
1606
1606
|
anchor: [0.5, 0.5],
|
|
@@ -1609,16 +1609,16 @@ class Gs extends Y {
|
|
|
1609
1609
|
size: [(M.w - 2 * Y.SafeBorderPadding) / m[0], (M.h - 2 * Y.SafeBorderPadding) / m[1]],
|
|
1610
1610
|
zIndex: u
|
|
1611
1611
|
});
|
|
1612
|
-
const v =
|
|
1613
|
-
|
|
1614
|
-
group:
|
|
1612
|
+
const v = T.map((x) => (x.pos = [x.pos[0] - this.centerPos[0], x.pos[1] - this.centerPos[1]], new ue(x)));
|
|
1613
|
+
I.append(...v), N && I.seal(), y && this.drawEraserlines({
|
|
1614
|
+
group: I,
|
|
1615
1615
|
eraserlines: y,
|
|
1616
1616
|
pos: this.centerPos,
|
|
1617
1617
|
layer: r
|
|
1618
|
-
}), this.replace(r, s || e.workId,
|
|
1618
|
+
}), this.replace(r, s || e.workId, I);
|
|
1619
1619
|
}
|
|
1620
1620
|
if (d || p || f) {
|
|
1621
|
-
const N =
|
|
1621
|
+
const N = I == null ? void 0 : I.getBoundingClientRect();
|
|
1622
1622
|
if (N)
|
|
1623
1623
|
return {
|
|
1624
1624
|
x: Math.floor(N.x - Y.SafeBorderPadding),
|
|
@@ -1686,8 +1686,8 @@ class Gs extends Y {
|
|
|
1686
1686
|
point: new F(p, f, y, t[s].v),
|
|
1687
1687
|
radius: M
|
|
1688
1688
|
}), s > 0 && s < t.length - 1) {
|
|
1689
|
-
const
|
|
1690
|
-
if (
|
|
1689
|
+
const T = t[s].getAngleByPoints(t[s - 1], t[s + 1]);
|
|
1690
|
+
if (T < 90 || T > 270) {
|
|
1691
1691
|
const w = (u = l.pop()) == null ? void 0 : u.point.clone();
|
|
1692
1692
|
w && i.push({
|
|
1693
1693
|
taskId: h,
|
|
@@ -1697,9 +1697,9 @@ class Gs extends Y {
|
|
|
1697
1697
|
radius: M
|
|
1698
1698
|
}]
|
|
1699
1699
|
}), n = t[s].x, r = t[s].y, c = [n, r];
|
|
1700
|
-
const m = d.x - n,
|
|
1700
|
+
const m = d.x - n, I = d.y - r;
|
|
1701
1701
|
l = [{
|
|
1702
|
-
point: new F(m,
|
|
1702
|
+
point: new F(m, I, y),
|
|
1703
1703
|
radius: M
|
|
1704
1704
|
}], h = Date.now();
|
|
1705
1705
|
}
|
|
@@ -1726,12 +1726,12 @@ class Gs extends Y {
|
|
|
1726
1726
|
if (u.isNear(p, e)) {
|
|
1727
1727
|
if (p.z < this.MAX_REPEAR) {
|
|
1728
1728
|
if (p.setz(Math.min(p.z + 1, this.MAX_REPEAR)), r = Math.min(r, d), h > 1) {
|
|
1729
|
-
let
|
|
1730
|
-
for (;
|
|
1731
|
-
const w = this.tmpPoints[
|
|
1732
|
-
if (this.tmpPoints[
|
|
1729
|
+
let T = h - 1;
|
|
1730
|
+
for (; T > 0; ) {
|
|
1731
|
+
const w = this.tmpPoints[T].distance(this.tmpPoints[T - 1]), m = Math.max(this.tmpPoints[T].z - this.uniThickness * w, 0);
|
|
1732
|
+
if (this.tmpPoints[T - 1].z >= m)
|
|
1733
1733
|
break;
|
|
1734
|
-
this.tmpPoints[
|
|
1734
|
+
this.tmpPoints[T - 1].setz(m), r = Math.min(r, T - 1), T--;
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
1737
|
} else
|
|
@@ -1871,12 +1871,12 @@ class Zs extends Y {
|
|
|
1871
1871
|
anchor: [0.5, 0.5]
|
|
1872
1872
|
}, y = this.getTaskPoints(p);
|
|
1873
1873
|
if (y.length) {
|
|
1874
|
-
const
|
|
1875
|
-
|
|
1874
|
+
const T = Date.now();
|
|
1875
|
+
T - this.syncTimestamp > this.syncUnitTime && (u = !0, this.syncTimestamp = T, this.syncIndex = this.tmpPoints.length), i && this.draw({ attrs: f, tasks: y, isDot: !1, layer: this.drawLayer || this.fullLayer });
|
|
1876
1876
|
}
|
|
1877
1877
|
const M = [];
|
|
1878
|
-
return this.tmpPoints.slice(d).forEach((
|
|
1879
|
-
M.push(
|
|
1878
|
+
return this.tmpPoints.slice(d).forEach((T) => {
|
|
1879
|
+
M.push(T.x, T.y);
|
|
1880
1880
|
}), {
|
|
1881
1881
|
rect: {
|
|
1882
1882
|
x: h.x * this.fullLayer.worldScaling[0] + this.fullLayer.worldPosition[0],
|
|
@@ -2004,17 +2004,17 @@ class Zs extends Y {
|
|
|
2004
2004
|
for (const c of i) {
|
|
2005
2005
|
const l = new ue(), { pos: h, points: u } = c;
|
|
2006
2006
|
let d;
|
|
2007
|
-
s ? d =
|
|
2007
|
+
s ? d = le(u, !0) : d = le(u, !1), l.attr({
|
|
2008
2008
|
...e,
|
|
2009
2009
|
pos: h,
|
|
2010
2010
|
d
|
|
2011
2011
|
});
|
|
2012
2012
|
const { vertex: p, fragment: f } = this.workOptions;
|
|
2013
2013
|
if (p && f) {
|
|
2014
|
-
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: T } = n.getResolution();
|
|
2015
2015
|
l.setUniforms({
|
|
2016
2016
|
u_time: 0,
|
|
2017
|
-
u_resolution: [M,
|
|
2017
|
+
u_resolution: [M, T]
|
|
2018
2018
|
}), l.setProgram(y);
|
|
2019
2019
|
}
|
|
2020
2020
|
n.appendChild(l), l.transition(r).attr({
|
|
@@ -2252,8 +2252,8 @@ function Tf(a, o, t, e, i, s) {
|
|
|
2252
2252
|
break;
|
|
2253
2253
|
}
|
|
2254
2254
|
if (p) {
|
|
2255
|
-
if (!mf(o, function(
|
|
2256
|
-
if (!vf(p, w) && (f ===
|
|
2255
|
+
if (!mf(o, function(T, w) {
|
|
2256
|
+
if (!vf(p, w) && (f === T || i(f, T, t, e, s)))
|
|
2257
2257
|
return p.push(w);
|
|
2258
2258
|
})) {
|
|
2259
2259
|
d = !1;
|
|
@@ -2333,18 +2333,18 @@ function Xf(a, o, t, e, i, s) {
|
|
|
2333
2333
|
s.set(a, o), s.set(o, a);
|
|
2334
2334
|
for (var M = n; ++u < c; ) {
|
|
2335
2335
|
d = r[u];
|
|
2336
|
-
var
|
|
2336
|
+
var T = a[d], w = o[d];
|
|
2337
2337
|
if (e)
|
|
2338
|
-
var m = n ? e(w,
|
|
2339
|
-
if (!(m === void 0 ?
|
|
2338
|
+
var m = n ? e(w, T, d, o, a, s) : e(T, w, d, a, o, s);
|
|
2339
|
+
if (!(m === void 0 ? T === w || i(T, w, t, e, s) : m)) {
|
|
2340
2340
|
y = !1;
|
|
2341
2341
|
break;
|
|
2342
2342
|
}
|
|
2343
2343
|
M || (M = d == "constructor");
|
|
2344
2344
|
}
|
|
2345
2345
|
if (y && !M) {
|
|
2346
|
-
var
|
|
2347
|
-
|
|
2346
|
+
var I = a.constructor, N = o.constructor;
|
|
2347
|
+
I != N && "constructor" in a && "constructor" in o && !(typeof I == "function" && I instanceof I && typeof N == "function" && N instanceof N) && (y = !1);
|
|
2348
2348
|
}
|
|
2349
2349
|
return s.delete(a), s.delete(o), y;
|
|
2350
2350
|
}
|
|
@@ -2642,10 +2642,10 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2642
2642
|
if (!l)
|
|
2643
2643
|
return;
|
|
2644
2644
|
let h;
|
|
2645
|
-
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: T } = e;
|
|
2646
2646
|
c && (y ? e.translate = [y[0] + c[0], y[1] + c[1]] : e.translate = c);
|
|
2647
2647
|
let w;
|
|
2648
|
-
if (d || y ||
|
|
2648
|
+
if (d || y || _t(f)) {
|
|
2649
2649
|
if (p === P.Start && i)
|
|
2650
2650
|
return s.setTargetAssignKeys(i), {
|
|
2651
2651
|
type: b.Select,
|
|
@@ -2711,7 +2711,7 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
w && p === P.Done && (s.deleteLastTarget(), w = void 0);
|
|
2713
2713
|
const m = h;
|
|
2714
|
-
if (d && y &&
|
|
2714
|
+
if (d && y && T && M && m && !c) {
|
|
2715
2715
|
const v = [
|
|
2716
2716
|
[m.x, m.y],
|
|
2717
2717
|
[m.x + m.w, m.y],
|
|
@@ -2746,13 +2746,13 @@ const we = /* @__PURE__ */ je(lg), Mo = class Mo extends Y {
|
|
|
2746
2746
|
subNodeMap: u,
|
|
2747
2747
|
intersectRect: m
|
|
2748
2748
|
});
|
|
2749
|
-
const
|
|
2749
|
+
const I = lt(this.oldSelectRect, m);
|
|
2750
2750
|
return this.oldSelectRect = m, {
|
|
2751
2751
|
type: b.Select,
|
|
2752
2752
|
dataType: U.Local,
|
|
2753
2753
|
selectRect: m,
|
|
2754
2754
|
renderRect: h,
|
|
2755
|
-
rect: lt(
|
|
2755
|
+
rect: lt(I, m),
|
|
2756
2756
|
selectIds: i
|
|
2757
2757
|
};
|
|
2758
2758
|
}
|
|
@@ -2916,21 +2916,21 @@ class qs extends Y {
|
|
|
2916
2916
|
};
|
|
2917
2917
|
}
|
|
2918
2918
|
draw(t) {
|
|
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:
|
|
2920
|
-
|
|
2921
|
-
|
|
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: T, isTriangle: w, trianglePoints: m, trianglePos: I } = this.computDrawPoints(n), N = [
|
|
2920
|
+
T.x + T.w / 2,
|
|
2921
|
+
T.y + T.h / 2
|
|
2922
2922
|
], v = {
|
|
2923
2923
|
pos: N,
|
|
2924
2924
|
name: e,
|
|
2925
2925
|
id: e,
|
|
2926
2926
|
zIndex: r,
|
|
2927
2927
|
anchor: [0.5, 0.5],
|
|
2928
|
-
size: [
|
|
2928
|
+
size: [T.w, T.h]
|
|
2929
2929
|
};
|
|
2930
2930
|
c && (v.scale = c), l && (v.rotate = l), h && (v.translate = h);
|
|
2931
2931
|
const x = new Wt(v), L = {
|
|
2932
2932
|
points: m,
|
|
2933
|
-
pos: [
|
|
2933
|
+
pos: [I[0] - N[0], I[1] - N[1]],
|
|
2934
2934
|
fillColor: s,
|
|
2935
2935
|
strokeColor: s,
|
|
2936
2936
|
lineWidth: 0,
|
|
@@ -2964,10 +2964,10 @@ class qs extends Y {
|
|
|
2964
2964
|
};
|
|
2965
2965
|
}
|
|
2966
2966
|
return {
|
|
2967
|
-
x: Math.floor(
|
|
2968
|
-
y: Math.floor(
|
|
2969
|
-
w: Math.floor(
|
|
2970
|
-
h: Math.floor(
|
|
2967
|
+
x: Math.floor(T.x * f[0] + p[0] - Y.SafeBorderPadding),
|
|
2968
|
+
y: Math.floor(T.y * f[1] + p[1] - Y.SafeBorderPadding),
|
|
2969
|
+
w: Math.floor(T.w * f[0] + 2 * Y.SafeBorderPadding),
|
|
2970
|
+
h: Math.floor(T.h * f[1] + 2 * Y.SafeBorderPadding)
|
|
2971
2971
|
};
|
|
2972
2972
|
}
|
|
2973
2973
|
computDrawPoints(t) {
|
|
@@ -2976,9 +2976,9 @@ class qs extends Y {
|
|
|
2976
2976
|
computFullArrowPoints(t) {
|
|
2977
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];
|
|
2978
2978
|
return {
|
|
2979
|
-
trianglePoints: y.map((
|
|
2979
|
+
trianglePoints: y.map((T) => F.Sub(T, this.tmpPoints[1]).XY).flat(1),
|
|
2980
2980
|
trianglePos: this.tmpPoints[1].XY,
|
|
2981
|
-
points: f.map((
|
|
2981
|
+
points: f.map((T) => F.Sub(T, this.tmpPoints[0]).XY).flat(1),
|
|
2982
2982
|
rect: Mt(M),
|
|
2983
2983
|
isTriangle: !1,
|
|
2984
2984
|
pos: this.tmpPoints[0].XY
|
|
@@ -3107,7 +3107,7 @@ class Ks extends Y {
|
|
|
3107
3107
|
};
|
|
3108
3108
|
}
|
|
3109
3109
|
draw(t) {
|
|
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:
|
|
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: T, pos: w } = this.computDrawPoints(c), m = {
|
|
3111
3111
|
pos: w,
|
|
3112
3112
|
name: e,
|
|
3113
3113
|
id: e,
|
|
@@ -3119,16 +3119,16 @@ class Ks extends Y {
|
|
|
3119
3119
|
lineJoin: "round",
|
|
3120
3120
|
lineCap: "round",
|
|
3121
3121
|
lineDash: p === et.Dotted ? [1, c * 2] : p === et.LongDotted ? [c, c * 2] : void 0
|
|
3122
|
-
},
|
|
3122
|
+
}, I = {
|
|
3123
3123
|
name: e,
|
|
3124
3124
|
id: e,
|
|
3125
3125
|
zIndex: l,
|
|
3126
3126
|
pos: w,
|
|
3127
3127
|
anchor: [0.5, 0.5],
|
|
3128
|
-
size: [
|
|
3128
|
+
size: [T.w, T.h]
|
|
3129
3129
|
};
|
|
3130
|
-
h && (
|
|
3131
|
-
const N = new Wt(
|
|
3130
|
+
h && (I.scale = h), u && (I.rotate = u), d && (I.translate = d);
|
|
3131
|
+
const N = new Wt(I);
|
|
3132
3132
|
if (s) {
|
|
3133
3133
|
const L = new ue({
|
|
3134
3134
|
d: "M-4,0H4M0,-4V4",
|
|
@@ -3300,7 +3300,7 @@ class _s extends Y {
|
|
|
3300
3300
|
};
|
|
3301
3301
|
}
|
|
3302
3302
|
draw(t) {
|
|
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,
|
|
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, T = i.worldPosition, w = i.worldScaling, { points: m, rect: I, pos: N } = this.computDrawPoints(n), v = {
|
|
3304
3304
|
close: !0,
|
|
3305
3305
|
normalize: !0,
|
|
3306
3306
|
points: m,
|
|
@@ -3311,10 +3311,10 @@ class _s extends Y {
|
|
|
3311
3311
|
lineCap: "round",
|
|
3312
3312
|
lineDash: y === et.Dotted ? [1, h * 2] : y === et.LongDotted ? [h, h * 2] : void 0
|
|
3313
3313
|
}, x = {
|
|
3314
|
-
x: Math.floor(
|
|
3315
|
-
y: Math.floor(
|
|
3316
|
-
w: Math.floor(
|
|
3317
|
-
h: Math.floor(
|
|
3314
|
+
x: Math.floor(I.x * w[0] + T[0] - Y.SafeBorderPadding),
|
|
3315
|
+
y: Math.floor(I.y * w[1] + T[1] - Y.SafeBorderPadding),
|
|
3316
|
+
w: Math.floor(I.w * w[0] + 2 * Y.SafeBorderPadding),
|
|
3317
|
+
h: Math.floor(I.h * w[0] + 2 * Y.SafeBorderPadding)
|
|
3318
3318
|
}, L = new Wt({
|
|
3319
3319
|
name: e,
|
|
3320
3320
|
id: e,
|
|
@@ -3322,8 +3322,8 @@ class _s extends Y {
|
|
|
3322
3322
|
pos: N,
|
|
3323
3323
|
anchor: [0.5, 0.5],
|
|
3324
3324
|
size: [
|
|
3325
|
-
|
|
3326
|
-
|
|
3325
|
+
I.w,
|
|
3326
|
+
I.h
|
|
3327
3327
|
],
|
|
3328
3328
|
scale: d,
|
|
3329
3329
|
rotate: p,
|
|
@@ -3472,7 +3472,7 @@ class tn extends Y {
|
|
|
3472
3472
|
};
|
|
3473
3473
|
}
|
|
3474
3474
|
draw(t) {
|
|
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:
|
|
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: T } = this.workOptions, w = i.worldScaling, { rect: m, pos: I, points: N } = this.computDrawPoints(c, h, u, d), v = {
|
|
3476
3476
|
close: !0,
|
|
3477
3477
|
points: N,
|
|
3478
3478
|
lineWidth: c,
|
|
@@ -3486,7 +3486,7 @@ class tn extends Y {
|
|
|
3486
3486
|
name: e,
|
|
3487
3487
|
id: e,
|
|
3488
3488
|
zIndex: l,
|
|
3489
|
-
pos:
|
|
3489
|
+
pos: I,
|
|
3490
3490
|
anchor: [0.5, 0.5],
|
|
3491
3491
|
size: [m.w, m.h]
|
|
3492
3492
|
};
|
|
@@ -3507,10 +3507,10 @@ class tn extends Y {
|
|
|
3507
3507
|
...v,
|
|
3508
3508
|
pos: [0, 0]
|
|
3509
3509
|
});
|
|
3510
|
-
L.append(A),
|
|
3510
|
+
L.append(A), T && this.drawEraserlines({
|
|
3511
3511
|
group: L,
|
|
3512
|
-
eraserlines:
|
|
3513
|
-
pos:
|
|
3512
|
+
eraserlines: T,
|
|
3513
|
+
pos: I,
|
|
3514
3514
|
layer: i
|
|
3515
3515
|
}), this.replace(i, e, L);
|
|
3516
3516
|
const j = L.getBoundingClientRect();
|
|
@@ -3525,8 +3525,8 @@ class tn extends Y {
|
|
|
3525
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;
|
|
3526
3526
|
for (let f = 0; f < e; f++) {
|
|
3527
3527
|
const y = f * d - 0.5 * Math.PI;
|
|
3528
|
-
let M,
|
|
3529
|
-
f % i === 1 ? (M = h * c[0] * Math.cos(y),
|
|
3528
|
+
let M, T;
|
|
3529
|
+
f % i === 1 ? (M = h * c[0] * Math.cos(y), T = h * c[1] * Math.sin(y)) : (M = l * c[0] * Math.cos(y), T = l * c[1] * Math.sin(y), u.push(M, T)), u.push(M, T);
|
|
3530
3530
|
}
|
|
3531
3531
|
return {
|
|
3532
3532
|
rect: Mt(this.tmpPoints, t),
|
|
@@ -3647,7 +3647,7 @@ class en extends Y {
|
|
|
3647
3647
|
};
|
|
3648
3648
|
}
|
|
3649
3649
|
draw(t) {
|
|
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:
|
|
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: T, pos: w, points: m } = this.computDrawPoints(c, h), I = {
|
|
3651
3651
|
close: !0,
|
|
3652
3652
|
points: m,
|
|
3653
3653
|
lineWidth: c,
|
|
@@ -3663,7 +3663,7 @@ class en extends Y {
|
|
|
3663
3663
|
zIndex: l,
|
|
3664
3664
|
pos: w,
|
|
3665
3665
|
anchor: [0.5, 0.5],
|
|
3666
|
-
size: [
|
|
3666
|
+
size: [T.w, T.h]
|
|
3667
3667
|
};
|
|
3668
3668
|
u && (N.scale = u), d && (N.rotate = d), p && (N.translate = p);
|
|
3669
3669
|
const v = new Wt(N);
|
|
@@ -3679,7 +3679,7 @@ class en extends Y {
|
|
|
3679
3679
|
v.append(A);
|
|
3680
3680
|
}
|
|
3681
3681
|
const x = new he({
|
|
3682
|
-
...
|
|
3682
|
+
...I,
|
|
3683
3683
|
pos: [0, 0]
|
|
3684
3684
|
});
|
|
3685
3685
|
v.append(x), y && this.drawEraserlines({
|
|
@@ -3888,8 +3888,8 @@ class on extends Y {
|
|
|
3888
3888
|
};
|
|
3889
3889
|
}
|
|
3890
3890
|
draw(t) {
|
|
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:
|
|
3892
|
-
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: T } = this.computDrawPoints(r, l), w = {
|
|
3892
|
+
points: T.map((x) => x.XY),
|
|
3893
3893
|
lineWidth: r,
|
|
3894
3894
|
fillColor: n !== "transparent" && n || void 0,
|
|
3895
3895
|
strokeColor: s,
|
|
@@ -3908,17 +3908,17 @@ class on extends Y {
|
|
|
3908
3908
|
size: [y.w, y.h]
|
|
3909
3909
|
};
|
|
3910
3910
|
h && (m.scale = h), u && (m.rotate = u), d && (m.translate = d);
|
|
3911
|
-
const
|
|
3911
|
+
const I = new Wt(m), N = new he({
|
|
3912
3912
|
...w,
|
|
3913
3913
|
pos: [0, 0]
|
|
3914
3914
|
});
|
|
3915
|
-
|
|
3916
|
-
group:
|
|
3915
|
+
I.append(N), f && this.drawEraserlines({
|
|
3916
|
+
group: I,
|
|
3917
3917
|
eraserlines: f,
|
|
3918
3918
|
pos: M,
|
|
3919
3919
|
layer: i
|
|
3920
|
-
}), this.replace(i, e,
|
|
3921
|
-
const v =
|
|
3920
|
+
}), this.replace(i, e, I);
|
|
3921
|
+
const v = I.getBoundingClientRect();
|
|
3922
3922
|
return {
|
|
3923
3923
|
x: Math.floor(v.x - Y.SafeBorderPadding),
|
|
3924
3924
|
y: Math.floor(v.y - Y.SafeBorderPadding),
|
|
@@ -3976,66 +3976,66 @@ class on extends Y {
|
|
|
3976
3976
|
}
|
|
3977
3977
|
}
|
|
3978
3978
|
computDrawPoints(t, e) {
|
|
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)),
|
|
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)), T = 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)), I = Kt.getBezierPoints(10, w, s[3], m), N = n * (1 - this.ratio) * 10, v = r * (1 - this.ratio) * 10;
|
|
3980
3980
|
switch (e) {
|
|
3981
3981
|
case "bottom": {
|
|
3982
3982
|
const A = C.Sub(s[2], new C(n * 5 - N / 2, 0, 0)), j = C.Sub(s[2], new C(n * 5, -v, 0)), D = C.Sub(s[2], new C(n * 5 + N / 2, 0, 0));
|
|
3983
|
-
c.push(j, D, ...
|
|
3983
|
+
c.push(j, D, ...I, ...u, ...f, ...T, A);
|
|
3984
3984
|
break;
|
|
3985
3985
|
}
|
|
3986
3986
|
case "bottomRight": {
|
|
3987
3987
|
const A = C.Sub(s[2], new C(n * 1.1, 0, 0)), j = C.Sub(s[2], new C(n * 1.1 + N / 2, -v, 0)), D = C.Sub(s[2], new C(n * 1.1 + N, 0, 0));
|
|
3988
|
-
c.push(j, D, ...
|
|
3988
|
+
c.push(j, D, ...I, ...u, ...f, ...T, A);
|
|
3989
3989
|
break;
|
|
3990
3990
|
}
|
|
3991
3991
|
case "bottomLeft": {
|
|
3992
3992
|
const A = C.Add(s[3], new C(n * 1.1 + N, 0, 0)), j = C.Add(s[3], new C(n * 1.1 + N / 2, v, 0)), D = C.Add(s[3], new C(n * 1.1, 0, 0));
|
|
3993
|
-
c.push(j, D, ...
|
|
3993
|
+
c.push(j, D, ...I, ...u, ...f, ...T, A);
|
|
3994
3994
|
break;
|
|
3995
3995
|
}
|
|
3996
3996
|
case "top": {
|
|
3997
3997
|
const A = C.Sub(s[1], new C(n * 5 - N / 2, 0, 0)), j = C.Sub(s[1], new C(n * 5, v, 0)), D = C.Sub(s[1], new C(n * 5 + N / 2, 0, 0));
|
|
3998
|
-
c.push(j, A, ...f, ...
|
|
3998
|
+
c.push(j, A, ...f, ...T, ...I, ...u, D);
|
|
3999
3999
|
break;
|
|
4000
4000
|
}
|
|
4001
4001
|
case "topRight": {
|
|
4002
4002
|
const A = C.Sub(s[1], new C(n * 1.1, 0, 0)), j = C.Sub(s[1], new C(n * 1.1 + N / 2, v, 0)), D = C.Sub(s[1], new C(n * 1.1 + N, 0, 0));
|
|
4003
|
-
c.push(j, A, ...f, ...
|
|
4003
|
+
c.push(j, A, ...f, ...T, ...I, ...u, D);
|
|
4004
4004
|
break;
|
|
4005
4005
|
}
|
|
4006
4006
|
case "topLeft": {
|
|
4007
4007
|
const A = C.Add(s[0], new C(n * 1.1 + N, 0, 0)), j = C.Add(s[0], new C(n * 1.1 + N / 2, -v, 0)), D = C.Add(s[0], new C(n * 1.1, 0, 0));
|
|
4008
|
-
c.push(j, A, ...f, ...
|
|
4008
|
+
c.push(j, A, ...f, ...T, ...I, ...u, D);
|
|
4009
4009
|
break;
|
|
4010
4010
|
}
|
|
4011
4011
|
case "left": {
|
|
4012
4012
|
const A = C.Add(s[0], new C(0, r * 5 - v / 2, 0)), j = C.Add(s[0], new C(-N, r * 5, 0)), D = C.Add(s[0], new C(0, r * 5 + v / 2, 0));
|
|
4013
|
-
c.push(j, A, ...u, ...f, ...
|
|
4013
|
+
c.push(j, A, ...u, ...f, ...T, ...I, D);
|
|
4014
4014
|
break;
|
|
4015
4015
|
}
|
|
4016
4016
|
case "leftTop": {
|
|
4017
4017
|
const A = C.Add(s[0], new C(0, r * 1.1, 0)), j = C.Add(s[0], new C(-N, 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, ...
|
|
4018
|
+
c.push(j, A, ...u, ...f, ...T, ...I, D);
|
|
4019
4019
|
break;
|
|
4020
4020
|
}
|
|
4021
4021
|
case "leftBottom": {
|
|
4022
4022
|
const A = C.Sub(s[3], new C(0, r * 1.1 + v, 0)), j = C.Sub(s[3], new C(N, 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, ...
|
|
4023
|
+
c.push(j, A, ...u, ...f, ...T, ...I, D);
|
|
4024
4024
|
break;
|
|
4025
4025
|
}
|
|
4026
4026
|
case "right": {
|
|
4027
4027
|
const A = C.Add(s[1], new C(0, r * 5 - v / 2, 0)), j = C.Add(s[1], new C(N, r * 5, 0)), D = C.Add(s[1], new C(0, r * 5 + v / 2, 0));
|
|
4028
|
-
c.push(j, D, ...
|
|
4028
|
+
c.push(j, D, ...T, ...I, ...u, ...f, A);
|
|
4029
4029
|
break;
|
|
4030
4030
|
}
|
|
4031
4031
|
case "rightTop": {
|
|
4032
4032
|
const A = C.Add(s[1], new C(0, r * 1.1, 0)), j = C.Add(s[1], new C(N, r * 1.1 + v / 2, 0)), D = C.Add(s[1], new C(0, r * 1.1 + v, 0));
|
|
4033
|
-
c.push(j, D, ...
|
|
4033
|
+
c.push(j, D, ...T, ...I, ...u, ...f, A);
|
|
4034
4034
|
break;
|
|
4035
4035
|
}
|
|
4036
4036
|
case "rightBottom": {
|
|
4037
4037
|
const A = C.Sub(s[2], new C(0, r * 1.1 + v, 0)), j = C.Sub(s[2], new C(-N, r * 1.1 + v / 2, 0)), D = C.Sub(s[2], new C(0, r * 1.1, 0));
|
|
4038
|
-
c.push(j, D, ...
|
|
4038
|
+
c.push(j, D, ...T, ...I, ...u, ...f, A);
|
|
4039
4039
|
break;
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
@@ -4166,7 +4166,7 @@ class sn extends Y {
|
|
|
4166
4166
|
};
|
|
4167
4167
|
}
|
|
4168
4168
|
draw(t) {
|
|
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:
|
|
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: T } = this.computDrawPoints(n, u), w = [
|
|
4170
4170
|
M.x + M.w / 2,
|
|
4171
4171
|
M.y + M.h / 2
|
|
4172
4172
|
], m = new Wt({
|
|
@@ -4177,18 +4177,18 @@ class sn extends Y {
|
|
|
4177
4177
|
id: e,
|
|
4178
4178
|
normalize: !0,
|
|
4179
4179
|
zIndex: r
|
|
4180
|
-
}),
|
|
4180
|
+
}), I = {
|
|
4181
4181
|
pos: [0, 0],
|
|
4182
4182
|
normalize: !0,
|
|
4183
4183
|
d: y,
|
|
4184
4184
|
fillColor: s,
|
|
4185
4185
|
strokeColor: s,
|
|
4186
|
-
lineDash: u === et.Dotted && !
|
|
4187
|
-
lineCap: u === et.Normal ||
|
|
4188
|
-
lineWidth: u === et.Normal ||
|
|
4186
|
+
lineDash: u === et.Dotted && !T ? [1, n * 2] : u === et.LongDotted && !T ? [n, n * 2] : void 0,
|
|
4187
|
+
lineCap: u === et.Normal || T ? void 0 : "round",
|
|
4188
|
+
lineWidth: u === et.Normal || T ? 0 : n
|
|
4189
4189
|
};
|
|
4190
|
-
c && (
|
|
4191
|
-
const N = new ue(
|
|
4190
|
+
c && (I.scale = c), l && (I.rotate = l), h && (I.translate = h);
|
|
4191
|
+
const N = new ue(I);
|
|
4192
4192
|
if (m.append(N), d && this.drawEraserlines({
|
|
4193
4193
|
group: m,
|
|
4194
4194
|
eraserlines: d,
|
|
@@ -4216,7 +4216,7 @@ class sn extends Y {
|
|
|
4216
4216
|
computFullPoints(t, e) {
|
|
4217
4217
|
const i = C.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), s = C.Per(i).mul(t / 2), n = F.Sub(this.tmpPoints[0], s), r = F.Add(this.tmpPoints[0], s), c = F.Sub(this.tmpPoints[1], s), l = F.Add(this.tmpPoints[1], s), h = F.GetSemicircleStroke(this.tmpPoints[1], c, -1, 8), u = F.GetSemicircleStroke(this.tmpPoints[0], r, -1, 8), d = [n, c, ...h, l, r, ...u];
|
|
4218
4218
|
let p;
|
|
4219
|
-
return e !== et.Normal ? p =
|
|
4219
|
+
return e !== et.Normal ? p = le(this.tmpPoints, !1) : p = le(d, !0), {
|
|
4220
4220
|
d: p,
|
|
4221
4221
|
rect: Mt(d),
|
|
4222
4222
|
isDot: !1,
|
|
@@ -4226,7 +4226,7 @@ class sn extends Y {
|
|
|
4226
4226
|
computDotPoints(t) {
|
|
4227
4227
|
const e = F.GetDotStroke(this.tmpPoints[0], t / 2, 8);
|
|
4228
4228
|
return {
|
|
4229
|
-
d:
|
|
4229
|
+
d: le(e, !0),
|
|
4230
4230
|
rect: Mt(e),
|
|
4231
4231
|
isDot: !0,
|
|
4232
4232
|
pos: this.tmpPoints[0].XY
|
|
@@ -4274,7 +4274,7 @@ class sn extends Y {
|
|
|
4274
4274
|
}) : (e.setAttribute("strokeColor", n), e.setAttribute("fillColor", n)), (l = c == null ? void 0 : c.opt) != null && l.strokeColor && (c.opt.strokeColor = n)), r && (c != null && c.opt) && ((h = c.opt) != null && h.strokeType) && (c.opt.strokeType = r), c && s.setInfo(e.name, c), Y.updateNodeOpt(t);
|
|
4275
4275
|
}
|
|
4276
4276
|
}
|
|
4277
|
-
const
|
|
4277
|
+
const ce = class ce extends Y {
|
|
4278
4278
|
constructor(t) {
|
|
4279
4279
|
super(t);
|
|
4280
4280
|
g(this, "canRotate", !1);
|
|
@@ -4320,8 +4320,8 @@ const ae = class ae extends Y {
|
|
|
4320
4320
|
h: Math.floor(f.h * u[1]) + 2
|
|
4321
4321
|
};
|
|
4322
4322
|
if (this.replace(i, e, p), s && i && this.workOptions.text) {
|
|
4323
|
-
const M = await
|
|
4324
|
-
p.append(...
|
|
4323
|
+
const M = await ce.createLabels(this.workOptions, i, y), { labels: T, maxWidth: w } = M;
|
|
4324
|
+
p.append(...T), y.w = Math.ceil(Math.max(w * i.worldScaling[0], y.w));
|
|
4325
4325
|
}
|
|
4326
4326
|
return l && this.drawEraserlines({
|
|
4327
4327
|
group: p,
|
|
@@ -4357,7 +4357,7 @@ const ae = class ae extends Y {
|
|
|
4357
4357
|
const i = this.workId.toString(), { fontColor: s, fontBgColor: n, bold: r, italic: c, lineThrough: l, underline: h, zIndex: u } = t, d = (f = this.vNodes) == null ? void 0 : f.get(i);
|
|
4358
4358
|
if (!d)
|
|
4359
4359
|
return;
|
|
4360
|
-
s && (d.opt.fontColor = s), n && (d.opt.fontBgColor = n), r && (d.opt.bold = r), c && (d.opt.italic = c), Ce(l) && (d.opt.lineThrough = l), Ce(h) && (d.opt.underline = h),
|
|
4360
|
+
s && (d.opt.fontColor = s), n && (d.opt.fontBgColor = n), r && (d.opt.bold = r), c && (d.opt.italic = c), Ce(l) && (d.opt.lineThrough = l), Ce(h) && (d.opt.underline = h), _t(u) && (d.opt.zIndex = u), this.oldRect = d.rect;
|
|
4361
4361
|
const p = await this.draw({
|
|
4362
4362
|
workId: i,
|
|
4363
4363
|
layer: this.fullLayer,
|
|
@@ -4382,11 +4382,11 @@ const ae = class ae extends Y {
|
|
|
4382
4382
|
return i >= 0.2 && i < 1 ? s = i * e : i <= 2 && i >= 1 ? s = i * e * 1.6 : i > 2 && i <= 3 ? s = i * e * 1.4 : i > 3 && i <= 4 ? s = i * e * 0.8 : i > 4 && (s = i * e * 0.6), Math.floor(s * 1e3) / 1e3;
|
|
4383
4383
|
}
|
|
4384
4384
|
static getSafetySnippetFontLength(t) {
|
|
4385
|
-
return Math.floor(
|
|
4385
|
+
return Math.floor(ce.textImageSnippetSize * 3 / 4 / t) || 1;
|
|
4386
4386
|
}
|
|
4387
4387
|
static async createLabels(t, e, i) {
|
|
4388
4388
|
var D;
|
|
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:
|
|
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: T, verticalAlign: w, fontColor: m, fontBgColor: I, underline: N, lineThrough: v } = t, x = ce.getSafetySnippetRatio(e) || 1, L = Math.floor(d * x), A = ce.getSafetySnippetFontLength(L);
|
|
4390
4390
|
let j = 0;
|
|
4391
4391
|
for (let O = 0; O < u; O++) {
|
|
4392
4392
|
const z = h[O], E = p || L * 1.5;
|
|
@@ -4405,7 +4405,7 @@ const ae = class ae extends Y {
|
|
|
4405
4405
|
anchor: [0, 0],
|
|
4406
4406
|
pos: Z,
|
|
4407
4407
|
text: it,
|
|
4408
|
-
fontFamily:
|
|
4408
|
+
fontFamily: T,
|
|
4409
4409
|
fontSize: L,
|
|
4410
4410
|
lineHeight: E,
|
|
4411
4411
|
strokeColor: m,
|
|
@@ -4419,8 +4419,8 @@ const ae = class ae extends Y {
|
|
|
4419
4419
|
if ($) {
|
|
4420
4420
|
const wt = $.rect && $.rect[2], Ft = $.rect && $.rect[3];
|
|
4421
4421
|
if (wt && Ft) {
|
|
4422
|
-
const
|
|
4423
|
-
G =
|
|
4422
|
+
const St = wt / x, Nt = Ft / x;
|
|
4423
|
+
G = St + G, M === "italic" && (f === "bold" ? G = G - Q * d * 1.2 : G = G - Q * d), ((Z[0] + tt[0] + St) * e.worldScaling[0] + n <= 0 || (Z[0] + tt[0]) * e.worldScaling[0] + n >= c || (Z[1] + tt[1] + Nt) * e.worldScaling[1] + r <= 0 || (Z[1] + tt[1]) * e.worldScaling[1] + r >= l) && (J.disconnect(), ut = !1), ut && K.push(J);
|
|
4424
4424
|
}
|
|
4425
4425
|
}
|
|
4426
4426
|
at += A;
|
|
@@ -4454,7 +4454,7 @@ const ae = class ae extends Y {
|
|
|
4454
4454
|
pos: tt,
|
|
4455
4455
|
anchor: [0, 0],
|
|
4456
4456
|
size: H,
|
|
4457
|
-
bgcolor:
|
|
4457
|
+
bgcolor: I
|
|
4458
4458
|
}, ht = new Wt(it);
|
|
4459
4459
|
ht.append(...K), s.push(ht);
|
|
4460
4460
|
}
|
|
@@ -4474,19 +4474,19 @@ const ae = class ae extends Y {
|
|
|
4474
4474
|
italic: f,
|
|
4475
4475
|
lineThrough: y,
|
|
4476
4476
|
underline: M,
|
|
4477
|
-
fontSize:
|
|
4477
|
+
fontSize: T,
|
|
4478
4478
|
textInfos: w,
|
|
4479
4479
|
zIndex: m
|
|
4480
|
-
} = i,
|
|
4481
|
-
if (!
|
|
4482
|
-
const v =
|
|
4483
|
-
if (
|
|
4480
|
+
} = i, I = n && Pt(n) || s.get(e.name);
|
|
4481
|
+
if (!I || !e.parent) return;
|
|
4482
|
+
const v = I.opt;
|
|
4483
|
+
if (_t(m) && (e.setAttribute("zIndex", m), I.opt.zIndex = m), c && v.fontColor && (v.fontColor = c, e.children.forEach((x) => {
|
|
4484
4484
|
x.tagName === "GROUP" && x.children.forEach((L) => {
|
|
4485
4485
|
L.tagName === "LABEL" ? (L.setAttribute("fillColor", c), L.setAttribute("strokeColor", c)) : L.tagName === "POLYLINE" && L.setAttribute("strokeColor", c);
|
|
4486
4486
|
});
|
|
4487
4487
|
})), r && v.fontBgColor && (v.fontBgColor = r, e.children.forEach((x) => {
|
|
4488
4488
|
x.tagName === "GROUP" && x.setAttribute("bgcolor", r);
|
|
4489
|
-
})), 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), T && (v.fontSize = T), h && u && d && n && v.boxPoint) {
|
|
4490
4490
|
const x = w == null ? void 0 : w.get(e.name);
|
|
4491
4491
|
if (x) {
|
|
4492
4492
|
const { fontSize: D, boxSize: O } = x;
|
|
@@ -4494,23 +4494,23 @@ const ae = class ae extends Y {
|
|
|
4494
4494
|
}
|
|
4495
4495
|
const L = [v.boxPoint[0], v.boxPoint[1]];
|
|
4496
4496
|
fi(v.boxPoint, u, d, l);
|
|
4497
|
-
const A = [
|
|
4498
|
-
if (
|
|
4499
|
-
for (const D of Object.values(
|
|
4497
|
+
const A = [I.op[0], I.op[1]], j = [A[0] - L[0], A[1] - L[1]];
|
|
4498
|
+
if (I.centerPos = [I.centerPos[0] + j[0], I.centerPos[1] + j[1]], I.opt.eraserlines)
|
|
4499
|
+
for (const D of Object.values(I.opt.eraserlines)) {
|
|
4500
4500
|
const { op: O, thickness: z } = D;
|
|
4501
4501
|
D.thickness = z * Math.max(d[0], d[1]);
|
|
4502
4502
|
for (let E = 0; E < O.length; E++)
|
|
4503
4503
|
gi(O[E], u, d, l);
|
|
4504
4504
|
}
|
|
4505
|
-
} else if (l && v.boxPoint && (v.boxPoint = [v.boxPoint[0] + l[0], v.boxPoint[1] + l[1]],
|
|
4506
|
-
for (const x of Object.values(
|
|
4505
|
+
} else if (l && v.boxPoint && (v.boxPoint = [v.boxPoint[0] + l[0], v.boxPoint[1] + l[1]], I.centerPos = [I.centerPos[0] + l[0], I.centerPos[1] + l[1]], I.opt.eraserlines))
|
|
4506
|
+
for (const x of Object.values(I.opt.eraserlines)) {
|
|
4507
4507
|
const { op: L } = x;
|
|
4508
4508
|
for (let A = 0; A < L.length; A++) {
|
|
4509
4509
|
const j = L[A].map((D, O) => O % 2 ? D + l[1] : D + l[0]);
|
|
4510
4510
|
x.op[A] = j;
|
|
4511
4511
|
}
|
|
4512
4512
|
}
|
|
4513
|
-
return
|
|
4513
|
+
return I && s.setInfo(e.name, I), I == null ? void 0 : I.rect;
|
|
4514
4514
|
}
|
|
4515
4515
|
static getRectFromLayer(t, e) {
|
|
4516
4516
|
const i = t.getElementsByName(e)[0];
|
|
@@ -4537,8 +4537,8 @@ const ae = class ae extends Y {
|
|
|
4537
4537
|
}
|
|
4538
4538
|
};
|
|
4539
4539
|
// 4k
|
|
4540
|
-
g(
|
|
4541
|
-
let ho =
|
|
4540
|
+
g(ce, "textImageSnippetSize", 1024 * 4), g(ce, "SafeBorderPadding", 30);
|
|
4541
|
+
let ho = ce;
|
|
4542
4542
|
const be = class be extends Y {
|
|
4543
4543
|
constructor(t, e) {
|
|
4544
4544
|
super(t);
|
|
@@ -4600,8 +4600,8 @@ const be = class be extends Y {
|
|
|
4600
4600
|
if (p !== -1 && p > -1) {
|
|
4601
4601
|
const f = [], y = d.slice(0, p + 1);
|
|
4602
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) {
|
|
4603
|
-
const M = p + l.length - 1,
|
|
4604
|
-
C.Equals(d[M], w) ||
|
|
4603
|
+
const M = p + l.length - 1, T = d.slice(M), w = l[l.length - 1];
|
|
4604
|
+
C.Equals(d[M], w) || T.unshift(w.clone().setz(d[M].z)), T.length > 1 && f.push(T);
|
|
4605
4605
|
}
|
|
4606
4606
|
return h.splice(u, 1, ...f), h;
|
|
4607
4607
|
}
|
|
@@ -4647,21 +4647,21 @@ const be = class be extends Y {
|
|
|
4647
4647
|
if (p.length > 1) {
|
|
4648
4648
|
const y = Go.polyline(p.map((M) => M.XY), this.eraserPolyline);
|
|
4649
4649
|
if (y.length && (i.add(c.name), !u)) {
|
|
4650
|
-
const M = this.translateIntersect(y),
|
|
4651
|
-
for (let w = 0; w <
|
|
4652
|
-
const m = `${r}_s_${w}`,
|
|
4653
|
-
|
|
4654
|
-
|
|
4650
|
+
const M = this.translateIntersect(y), T = this.cutPolyline(M, p);
|
|
4651
|
+
for (let w = 0; w < T.length; w++) {
|
|
4652
|
+
const m = `${r}_s_${w}`, I = [];
|
|
4653
|
+
T[w].forEach((N) => {
|
|
4654
|
+
I.push((N.x - this.worldPosition[0]) / this.worldScaling[0], (N.y - this.worldPosition[1]) / this.worldScaling[1], N.z);
|
|
4655
4655
|
}), c.opt && c.toolsType && this.vNodes && (this.vNodes.setInfo(m, {
|
|
4656
4656
|
rect: f,
|
|
4657
|
-
op:
|
|
4657
|
+
op: I,
|
|
4658
4658
|
opt: c.opt,
|
|
4659
4659
|
canRotate: c.canRotate,
|
|
4660
4660
|
scaleType: c.scaleType,
|
|
4661
4661
|
toolsType: c.toolsType
|
|
4662
4662
|
}), s.set(m, {
|
|
4663
4663
|
workId: m,
|
|
4664
|
-
op:
|
|
4664
|
+
op: I,
|
|
4665
4665
|
opt: c.opt,
|
|
4666
4666
|
toolsType: c.toolsType
|
|
4667
4667
|
}));
|
|
@@ -4807,71 +4807,80 @@ const He = class He extends Y {
|
|
|
4807
4807
|
return;
|
|
4808
4808
|
const n = [];
|
|
4809
4809
|
let r = 0;
|
|
4810
|
-
for (let
|
|
4811
|
-
const
|
|
4812
|
-
if (
|
|
4813
|
-
const
|
|
4814
|
-
(
|
|
4810
|
+
for (let h = 1; h < this.tmpPoints.length; h++) {
|
|
4811
|
+
const u = this.tmpPoints[h - 1], d = this.tmpPoints[h];
|
|
4812
|
+
if (h === 1 && r === 0 && (n[r] = [u.XY]), n[r].push(d.XY), h < this.tmpPoints.length - 1) {
|
|
4813
|
+
const p = d.getAngleByPoints(u, this.tmpPoints[h + 1]);
|
|
4814
|
+
(p < 90 || p > 270) && (r++, n[r] = [d.XY]);
|
|
4815
4815
|
}
|
|
4816
4816
|
}
|
|
4817
4817
|
this.tmpPoints.length === 1 && n.length === 0 && n.push([this.tmpPoints[0].XY, this.tmpPoints[0].XY]);
|
|
4818
|
-
const c = /* @__PURE__ */ new Map();
|
|
4819
|
-
for (const [
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4818
|
+
const c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
|
|
4819
|
+
for (const [h, u] of s.entries()) {
|
|
4820
|
+
if (this.isTransparentRect(u.rect)) {
|
|
4821
|
+
l.add(h);
|
|
4822
|
+
continue;
|
|
4823
|
+
}
|
|
4824
|
+
let p = $o(u.rect, [-e[0], -e[1]]);
|
|
4825
|
+
p = {
|
|
4826
|
+
x: p.x / this.worldScaling[0],
|
|
4827
|
+
y: p.y / this.worldScaling[1],
|
|
4828
|
+
w: p.w / this.worldScaling[0],
|
|
4829
|
+
h: p.h / this.worldScaling[1]
|
|
4826
4830
|
};
|
|
4827
|
-
const
|
|
4828
|
-
for (const
|
|
4829
|
-
Go.polyline(
|
|
4830
|
-
if (
|
|
4831
|
-
for (const
|
|
4832
|
-
const
|
|
4833
|
-
for (let
|
|
4834
|
-
|
|
4835
|
-
|
|
4831
|
+
const f = [p.x, p.y, p.x + p.w, p.y + p.h], y = [], M = [];
|
|
4832
|
+
for (const w of n)
|
|
4833
|
+
Go.polyline(w, f, y);
|
|
4834
|
+
if (y.length && u.opt)
|
|
4835
|
+
for (const w of y) {
|
|
4836
|
+
const m = [];
|
|
4837
|
+
for (let I = 0; I < w.length; I++)
|
|
4838
|
+
I !== 0 && we(w[I], w[I - 1]) || m.push(...w[I]);
|
|
4839
|
+
M.push(m);
|
|
4836
4840
|
}
|
|
4837
|
-
|
|
4841
|
+
u.opt.eraserlines || (u.opt.eraserlines = []), u.opt.eraserlines && (u.opt.eraserlines.push({ op: M, thickness: t }), c.set(h, u));
|
|
4838
4842
|
}
|
|
4839
|
-
return c;
|
|
4843
|
+
return { willUpdateNodes: c, willDeleteNodes: l };
|
|
4840
4844
|
}
|
|
4841
4845
|
async reRenderEffectNodes(t) {
|
|
4846
|
+
var r;
|
|
4842
4847
|
let e;
|
|
4843
|
-
const { willUpdateNodes: i,
|
|
4844
|
-
|
|
4845
|
-
const
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
h = await l.consumeServiceAsync({
|
|
4854
|
-
isFullWork: !0,
|
|
4855
|
-
replaceId: n,
|
|
4856
|
-
worker: s
|
|
4848
|
+
const { willUpdateNodes: i, willDeleteNodes: s, worker: n } = t;
|
|
4849
|
+
if (s != null && s.size)
|
|
4850
|
+
for (const c of s.keys())
|
|
4851
|
+
this.replace(this.fullLayer, c), (r = this.vNodes) == null || r.delete(c);
|
|
4852
|
+
if (i != null && i.size)
|
|
4853
|
+
for (const [c, l] of i.entries()) {
|
|
4854
|
+
const { toolsType: h } = l, u = n.createWorkShapeNode({
|
|
4855
|
+
workId: c,
|
|
4856
|
+
toolsType: h,
|
|
4857
|
+
toolsOpt: l.opt
|
|
4857
4858
|
});
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
});
|
|
4863
|
-
else
|
|
4864
|
-
try {
|
|
4865
|
-
h = l == null ? void 0 : l.consumeService({
|
|
4866
|
-
op: r.op,
|
|
4859
|
+
u == null || u.setWorkId(c);
|
|
4860
|
+
let d;
|
|
4861
|
+
if (h === S.Image)
|
|
4862
|
+
d = await u.consumeServiceAsync({
|
|
4867
4863
|
isFullWork: !0,
|
|
4868
|
-
replaceId:
|
|
4864
|
+
replaceId: c,
|
|
4865
|
+
worker: n
|
|
4869
4866
|
});
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4867
|
+
else if (h === S.Text)
|
|
4868
|
+
d = await u.consumeServiceAsync({
|
|
4869
|
+
isFullWork: !0,
|
|
4870
|
+
replaceId: c
|
|
4871
|
+
});
|
|
4872
|
+
else
|
|
4873
|
+
try {
|
|
4874
|
+
d = u == null ? void 0 : u.consumeService({
|
|
4875
|
+
op: l.op,
|
|
4876
|
+
isFullWork: !0,
|
|
4877
|
+
replaceId: c
|
|
4878
|
+
});
|
|
4879
|
+
} catch {
|
|
4880
|
+
continue;
|
|
4881
|
+
}
|
|
4882
|
+
d && (e = lt(e, d));
|
|
4883
|
+
}
|
|
4875
4884
|
return e;
|
|
4876
4885
|
}
|
|
4877
4886
|
consume(t) {
|
|
@@ -4894,8 +4903,8 @@ const He = class He extends Y {
|
|
|
4894
4903
|
const f = this.tmpPoints.slice(h), y = this.draw({ consumePoints: f, layer: this.fullLayer, thickness: r });
|
|
4895
4904
|
f[0].t - this.syncTimestamp > this.syncUnitTime && (p = !0, this.syncTimestamp = f[0].t, this.syncIndex = this.tmpPoints.length);
|
|
4896
4905
|
const M = [];
|
|
4897
|
-
return this.tmpPoints.slice(d).forEach((
|
|
4898
|
-
M.push(
|
|
4906
|
+
return this.tmpPoints.slice(d).forEach((T) => {
|
|
4907
|
+
M.push(T.x, T.y, r / 2);
|
|
4899
4908
|
}), {
|
|
4900
4909
|
...this.baseConsumeResult,
|
|
4901
4910
|
type: b.DrawWork,
|
|
@@ -4932,26 +4941,58 @@ const He = class He extends Y {
|
|
|
4932
4941
|
h: Math.floor(c.h * this.worldScaling[1] + 2 * Y.SafeBorderPadding)
|
|
4933
4942
|
}, c;
|
|
4934
4943
|
}
|
|
4944
|
+
isTransparentRectByGL(t, e) {
|
|
4945
|
+
const { x: i, y: s, w: n, h: r } = e, c = new Uint8Array(n * r * 4);
|
|
4946
|
+
t.readPixels(i, t.drawingBufferHeight - s - r, n, r, t.RGBA, t.UNSIGNED_BYTE, c);
|
|
4947
|
+
let l = !0;
|
|
4948
|
+
for (let h = 0; h < c.length; h += 4)
|
|
4949
|
+
if (c[h + 3] !== 0) {
|
|
4950
|
+
l = !1;
|
|
4951
|
+
break;
|
|
4952
|
+
}
|
|
4953
|
+
return l;
|
|
4954
|
+
}
|
|
4955
|
+
isTransparentRectByCanvas(t, e) {
|
|
4956
|
+
const i = t.getContext("2d", { willReadFrequently: !0 });
|
|
4957
|
+
if (!i)
|
|
4958
|
+
return !1;
|
|
4959
|
+
const { x: s, y: n, w: r, h: c } = e, l = i.getImageData(s, n, r, c);
|
|
4960
|
+
let h = !0;
|
|
4961
|
+
for (let u = 0; u < l.data.length; u += 4)
|
|
4962
|
+
if (l.data[u + 3] !== 0) {
|
|
4963
|
+
h = !1;
|
|
4964
|
+
break;
|
|
4965
|
+
}
|
|
4966
|
+
return h;
|
|
4967
|
+
}
|
|
4968
|
+
isTransparentRect(t) {
|
|
4969
|
+
const e = this.fullLayer.parent.displayRatio || 1, i = Math.floor(t.x * e), s = Math.floor(t.y * e), n = Math.floor(t.w * e), r = Math.floor(t.h * e), c = this.fullLayer.renderer.glRenderer;
|
|
4970
|
+
if (c)
|
|
4971
|
+
return this.isTransparentRectByGL(c, { x: i, y: s, w: n, h: r });
|
|
4972
|
+
const l = this.fullLayer.renderer.canvas;
|
|
4973
|
+
return l && this.isTransparentRectByCanvas(l, { x: i, y: s, w: n, h: r }) || !1;
|
|
4974
|
+
}
|
|
4935
4975
|
consumeAll() {
|
|
4976
|
+
var u;
|
|
4936
4977
|
const t = this.fullLayer.getElementsByName(this.workId);
|
|
4937
4978
|
let e;
|
|
4938
|
-
if (t.length && (e = Y.getRectFromLayer(this.fullLayer, this.workId)), t.forEach((
|
|
4939
|
-
|
|
4979
|
+
if (t.length && (e = Y.getRectFromLayer(this.fullLayer, this.workId)), t.forEach((d) => {
|
|
4980
|
+
d.remove(), d.disconnect();
|
|
4940
4981
|
}), !this.tmpPoints.length)
|
|
4941
4982
|
return {
|
|
4942
4983
|
type: b.None,
|
|
4943
4984
|
...this.baseConsumeResult
|
|
4944
4985
|
};
|
|
4945
4986
|
const { thickness: i } = this.workOptions, { width: s, height: n } = He.eraserSizes[i], r = Math.max(s, n) / this.worldScaling[0], c = this.getChangeNodes(r);
|
|
4946
|
-
if (!(c != null && c.size)
|
|
4987
|
+
if (!c || c && !((u = c.willUpdateNodes) != null && u.size) && !c.willDeleteNodes.size)
|
|
4947
4988
|
return {
|
|
4948
4989
|
type: b.FullWork,
|
|
4949
4990
|
...this.baseConsumeResult,
|
|
4950
4991
|
rect: e
|
|
4951
4992
|
};
|
|
4952
4993
|
const l = [];
|
|
4953
|
-
this.tmpPoints.map((
|
|
4954
|
-
l.push(
|
|
4994
|
+
this.tmpPoints.map((d) => {
|
|
4995
|
+
l.push(d.x, d.y, r / 2);
|
|
4955
4996
|
});
|
|
4956
4997
|
const h = Xt(l);
|
|
4957
4998
|
return {
|
|
@@ -4960,7 +5001,8 @@ const He = class He extends Y {
|
|
|
4960
5001
|
dataType: U.Local,
|
|
4961
5002
|
rect: e,
|
|
4962
5003
|
ops: h,
|
|
4963
|
-
willUpdateNodes: c
|
|
5004
|
+
willUpdateNodes: c.willUpdateNodes,
|
|
5005
|
+
willDeleteNodes: c.willDeleteNodes
|
|
4964
5006
|
};
|
|
4965
5007
|
}
|
|
4966
5008
|
clearTmpPoints() {
|
|
@@ -5246,6 +5288,9 @@ class yg {
|
|
|
5246
5288
|
const t = Ot.bufferSize.full, e = Ot.bufferSize.sub;
|
|
5247
5289
|
this.fullLayer = this.createLayer("fullLayer", this.scene, { ...o.layerOpt, bufferSize: this.viewId === yt ? t : e });
|
|
5248
5290
|
}
|
|
5291
|
+
async updateDpr(o) {
|
|
5292
|
+
this.dpr = o, this.scene.displayRatio = o;
|
|
5293
|
+
}
|
|
5249
5294
|
getCachedImages(o) {
|
|
5250
5295
|
var t;
|
|
5251
5296
|
return (t = this.cacheImages.get(o)) == null ? void 0 : t.imageBitmap;
|
|
@@ -5277,8 +5322,11 @@ class yg {
|
|
|
5277
5322
|
this.isSafari = o;
|
|
5278
5323
|
}
|
|
5279
5324
|
async on(o) {
|
|
5280
|
-
const { msgType: t, toolsType: e, opt: i, imageSrc: s, imageBitmap: n, workId: r } = o;
|
|
5325
|
+
const { msgType: t, toolsType: e, opt: i, imageSrc: s, imageBitmap: n, workId: r, dpr: c } = o;
|
|
5281
5326
|
switch (t) {
|
|
5327
|
+
case b.UpdateDpr:
|
|
5328
|
+
_t(c) && await this.updateDpr(c);
|
|
5329
|
+
break;
|
|
5282
5330
|
case b.UpdateCamera:
|
|
5283
5331
|
await this.updateCamera(o);
|
|
5284
5332
|
break;
|
|
@@ -5290,26 +5338,26 @@ class yg {
|
|
|
5290
5338
|
break;
|
|
5291
5339
|
case b.UpdateTools:
|
|
5292
5340
|
if (e && i) {
|
|
5293
|
-
const
|
|
5341
|
+
const l = {
|
|
5294
5342
|
toolsType: e,
|
|
5295
5343
|
toolsOpt: i
|
|
5296
5344
|
};
|
|
5297
|
-
this.localWork.setToolsOpt(
|
|
5345
|
+
this.localWork.setToolsOpt(l);
|
|
5298
5346
|
}
|
|
5299
5347
|
break;
|
|
5300
5348
|
case b.GetImageBitMap:
|
|
5301
5349
|
if (s && n && r) {
|
|
5302
|
-
const
|
|
5350
|
+
const l = r.toString();
|
|
5303
5351
|
this.cacheImages.set(s, {
|
|
5304
5352
|
imageBitmap: n,
|
|
5305
|
-
workId:
|
|
5353
|
+
workId: l
|
|
5306
5354
|
});
|
|
5307
|
-
const
|
|
5308
|
-
if (
|
|
5309
|
-
const { resolve:
|
|
5310
|
-
|
|
5355
|
+
const h = this.imageResolveMap.get(s);
|
|
5356
|
+
if (h) {
|
|
5357
|
+
const { resolve: u, timer: d } = h;
|
|
5358
|
+
d && clearTimeout(d), u && u(s);
|
|
5311
5359
|
}
|
|
5312
|
-
this.deleteCachedImagesByWorkId(
|
|
5360
|
+
this.deleteCachedImagesByWorkId(l, s);
|
|
5313
5361
|
}
|
|
5314
5362
|
break;
|
|
5315
5363
|
}
|
|
@@ -5326,8 +5374,8 @@ class yg {
|
|
|
5326
5374
|
return;
|
|
5327
5375
|
let d = r;
|
|
5328
5376
|
if (c === ze.Iconify) {
|
|
5329
|
-
const [M,
|
|
5330
|
-
d = `${r}?width=${M}&height=${
|
|
5377
|
+
const [M, T] = this.getIconSize(l, h, this.dpr);
|
|
5378
|
+
d = `${r}?width=${M}&height=${T}&color=${u}`;
|
|
5331
5379
|
}
|
|
5332
5380
|
if (this.cacheImages.has(d)) {
|
|
5333
5381
|
const M = this.getCachedImages(d);
|
|
@@ -5340,14 +5388,14 @@ class yg {
|
|
|
5340
5388
|
return M;
|
|
5341
5389
|
}
|
|
5342
5390
|
const y = await new Promise((M) => {
|
|
5343
|
-
const
|
|
5391
|
+
const T = this.imageResolveMap.get(d) || {
|
|
5344
5392
|
resolve: void 0,
|
|
5345
5393
|
timer: void 0
|
|
5346
5394
|
};
|
|
5347
|
-
|
|
5395
|
+
T.timer && clearTimeout(T.timer), T.resolve = M, T.timer = setTimeout(() => {
|
|
5348
5396
|
const w = this.imageResolveMap.get(d);
|
|
5349
5397
|
w != null && w.resolve && w.resolve(d);
|
|
5350
|
-
}, 5e3), this.imageResolveMap.set(d,
|
|
5398
|
+
}, 5e3), this.imageResolveMap.set(d, T), this._post({
|
|
5351
5399
|
sp: [{
|
|
5352
5400
|
imageSrc: d,
|
|
5353
5401
|
workId: n,
|
|
@@ -5480,7 +5528,7 @@ class yg {
|
|
|
5480
5528
|
}
|
|
5481
5529
|
l || t.push(c);
|
|
5482
5530
|
}
|
|
5483
|
-
|
|
5531
|
+
_t(r.drawCount) && (e = r.drawCount);
|
|
5484
5532
|
}
|
|
5485
5533
|
return this.combinePostMsg.clear(), {
|
|
5486
5534
|
render: o,
|
|
@@ -5584,7 +5632,7 @@ class Mg {
|
|
|
5584
5632
|
}
|
|
5585
5633
|
}
|
|
5586
5634
|
}
|
|
5587
|
-
var wg =
|
|
5635
|
+
var wg = te, mg = function() {
|
|
5588
5636
|
return wg.Date.now();
|
|
5589
5637
|
}, vg = mg, Ig = /\s/;
|
|
5590
5638
|
function Ng(a) {
|
|
@@ -5627,7 +5675,7 @@ function Hg(a, o, t) {
|
|
|
5627
5675
|
return e = i = void 0, l = v, n = a.apply(L, x), n;
|
|
5628
5676
|
}
|
|
5629
5677
|
function f(v) {
|
|
5630
|
-
return l = v, r = setTimeout(
|
|
5678
|
+
return l = v, r = setTimeout(T, o), h ? p(v) : n;
|
|
5631
5679
|
}
|
|
5632
5680
|
function y(v) {
|
|
5633
5681
|
var x = v - c, L = v - l, A = o - x;
|
|
@@ -5637,11 +5685,11 @@ function Hg(a, o, t) {
|
|
|
5637
5685
|
var x = v - c, L = v - l;
|
|
5638
5686
|
return c === void 0 || x >= o || x < 0 || u && L >= s;
|
|
5639
5687
|
}
|
|
5640
|
-
function
|
|
5688
|
+
function T() {
|
|
5641
5689
|
var v = Do();
|
|
5642
5690
|
if (M(v))
|
|
5643
5691
|
return w(v);
|
|
5644
|
-
r = setTimeout(
|
|
5692
|
+
r = setTimeout(T, y(v));
|
|
5645
5693
|
}
|
|
5646
5694
|
function w(v) {
|
|
5647
5695
|
return r = void 0, d && e ? p(v) : (e = i = void 0, n);
|
|
@@ -5649,7 +5697,7 @@ function Hg(a, o, t) {
|
|
|
5649
5697
|
function m() {
|
|
5650
5698
|
r !== void 0 && clearTimeout(r), l = 0, e = c = i = r = void 0;
|
|
5651
5699
|
}
|
|
5652
|
-
function
|
|
5700
|
+
function I() {
|
|
5653
5701
|
return r === void 0 ? n : w(Do());
|
|
5654
5702
|
}
|
|
5655
5703
|
function N() {
|
|
@@ -5658,11 +5706,11 @@ function Hg(a, o, t) {
|
|
|
5658
5706
|
if (r === void 0)
|
|
5659
5707
|
return f(c);
|
|
5660
5708
|
if (u)
|
|
5661
|
-
return clearTimeout(r), r = setTimeout(
|
|
5709
|
+
return clearTimeout(r), r = setTimeout(T, o), p(c);
|
|
5662
5710
|
}
|
|
5663
|
-
return r === void 0 && (r = setTimeout(
|
|
5711
|
+
return r === void 0 && (r = setTimeout(T, o)), n;
|
|
5664
5712
|
}
|
|
5665
|
-
return N.cancel = m, N.flush =
|
|
5713
|
+
return N.cancel = m, N.flush = I, N;
|
|
5666
5714
|
}
|
|
5667
5715
|
var Qg = Hg, Gg = Qg, Zg = de, Xg = "Expected a function";
|
|
5668
5716
|
function Jg(a, o, t) {
|
|
@@ -5951,13 +5999,13 @@ class zM extends Mg {
|
|
|
5951
5999
|
n.push(
|
|
5952
6000
|
{
|
|
5953
6001
|
rect: $e(s),
|
|
5954
|
-
clearCanvas:
|
|
6002
|
+
clearCanvas: It.Float,
|
|
5955
6003
|
isClear: !0,
|
|
5956
6004
|
viewId: this.viewId
|
|
5957
6005
|
},
|
|
5958
6006
|
{
|
|
5959
6007
|
rect: $e(s),
|
|
5960
|
-
drawCanvas:
|
|
6008
|
+
drawCanvas: It.Float,
|
|
5961
6009
|
viewId: this.viewId
|
|
5962
6010
|
}
|
|
5963
6011
|
), await this._post({
|
|
@@ -5985,7 +6033,7 @@ class zM extends Mg {
|
|
|
5985
6033
|
render: [{
|
|
5986
6034
|
rect: t == null ? void 0 : t.rect,
|
|
5987
6035
|
workId: e,
|
|
5988
|
-
drawCanvas:
|
|
6036
|
+
drawCanvas: It.Float,
|
|
5989
6037
|
viewId: this.viewId
|
|
5990
6038
|
}],
|
|
5991
6039
|
sp: (t == null ? void 0 : t.op) && [t]
|
|
@@ -5997,11 +6045,11 @@ class zM extends Mg {
|
|
|
5997
6045
|
render: [{
|
|
5998
6046
|
rect: (t == null ? void 0 : t.rect) && $e(t.rect),
|
|
5999
6047
|
isClear: !0,
|
|
6000
|
-
clearCanvas:
|
|
6048
|
+
clearCanvas: It.Float,
|
|
6001
6049
|
viewId: this.viewId
|
|
6002
6050
|
}, {
|
|
6003
6051
|
rect: (t == null ? void 0 : t.rect) && $e(t.rect),
|
|
6004
|
-
drawCanvas:
|
|
6052
|
+
drawCanvas: It.Float,
|
|
6005
6053
|
viewId: this.viewId
|
|
6006
6054
|
}]
|
|
6007
6055
|
});
|
|
@@ -6142,11 +6190,11 @@ class PM {
|
|
|
6142
6190
|
if (i.push({
|
|
6143
6191
|
isClear: !0,
|
|
6144
6192
|
rect: u.totalRect,
|
|
6145
|
-
clearCanvas:
|
|
6193
|
+
clearCanvas: It.TopFloat,
|
|
6146
6194
|
viewId: this.viewId
|
|
6147
6195
|
}), e.push({
|
|
6148
6196
|
rect: u.totalRect,
|
|
6149
|
-
drawCanvas:
|
|
6197
|
+
drawCanvas: It.TopFloat,
|
|
6150
6198
|
viewId: this.viewId
|
|
6151
6199
|
}), u.isDel) {
|
|
6152
6200
|
(c = u.node) == null || c.clearTmpPoints(), this.serviceWorkShapes.delete(h);
|
|
@@ -6163,11 +6211,11 @@ class PM {
|
|
|
6163
6211
|
if (f && (i.push({
|
|
6164
6212
|
isClear: !0,
|
|
6165
6213
|
rect: f,
|
|
6166
|
-
clearCanvas:
|
|
6214
|
+
clearCanvas: It.TopFloat,
|
|
6167
6215
|
viewId: this.viewId
|
|
6168
6216
|
}), e.push({
|
|
6169
6217
|
rect: f,
|
|
6170
|
-
drawCanvas:
|
|
6218
|
+
drawCanvas: It.TopFloat,
|
|
6171
6219
|
viewId: this.viewId
|
|
6172
6220
|
})), y) {
|
|
6173
6221
|
u.node.clearTmpPoints(), this.localWorkShapes.delete(h), s.push({
|
|
@@ -6266,7 +6314,7 @@ class DM extends yg {
|
|
|
6266
6314
|
if (e && this.snapshotFullLayer)
|
|
6267
6315
|
return this.snapshotFullLayer;
|
|
6268
6316
|
switch (t) {
|
|
6269
|
-
case
|
|
6317
|
+
case It.TopFloat:
|
|
6270
6318
|
return this.topLayer;
|
|
6271
6319
|
default:
|
|
6272
6320
|
return this.fullLayer;
|
|
@@ -6353,7 +6401,7 @@ class DM extends yg {
|
|
|
6353
6401
|
}), this.topLayer.removeAllChildren()), await this.post({
|
|
6354
6402
|
render: [{
|
|
6355
6403
|
isClearAll: !0,
|
|
6356
|
-
clearCanvas:
|
|
6404
|
+
clearCanvas: It.TopFloat,
|
|
6357
6405
|
viewId: this.viewId
|
|
6358
6406
|
}],
|
|
6359
6407
|
sp: [{
|
|
@@ -6369,18 +6417,31 @@ class DM extends yg {
|
|
|
6369
6417
|
const { width: e, height: i } = t;
|
|
6370
6418
|
super.updateLayer(t), this.topLayer && (this.topLayer.parent.setAttribute("width", e), this.topLayer.parent.setAttribute("height", i), this.topLayer.setAttribute("size", [e, i]), this.topLayer.setAttribute("pos", [e * 0.5, i * 0.5])), this.snapshotFullLayer && (this.snapshotFullLayer.parent.setAttribute("width", e), this.snapshotFullLayer.parent.setAttribute("height", i), this.snapshotFullLayer.setAttribute("size", [e, i]), this.snapshotFullLayer.setAttribute("pos", [e * 0.5, i * 0.5]));
|
|
6371
6419
|
}
|
|
6420
|
+
async updateDpr(t) {
|
|
6421
|
+
super.updateDpr(t);
|
|
6422
|
+
const e = !!this.topLayerWork.localWorkShapes.size, i = !!this.localWork.getWorkShapes().size, s = [];
|
|
6423
|
+
i && s.push({
|
|
6424
|
+
isClearAll: !0,
|
|
6425
|
+
clearCanvas: It.Float,
|
|
6426
|
+
viewId: this.viewId
|
|
6427
|
+
}), e && s.push({
|
|
6428
|
+
isClearAll: !0,
|
|
6429
|
+
clearCanvas: It.TopFloat,
|
|
6430
|
+
viewId: this.viewId
|
|
6431
|
+
}), s.length && await this.post({ render: s });
|
|
6432
|
+
}
|
|
6372
6433
|
async updateCamera(t) {
|
|
6373
6434
|
const e = [], { cameraOpt: i } = t;
|
|
6374
6435
|
if (i && !we(this.cameraOpt, i)) {
|
|
6375
6436
|
const s = !!this.topLayerWork.localWorkShapes.size, n = !!this.localWork.getWorkShapes().size;
|
|
6376
6437
|
if (n && this.localWork.workShapesDone(), this.setCameraOpt(i), n && e.push({
|
|
6377
6438
|
isClearAll: !0,
|
|
6378
|
-
clearCanvas:
|
|
6439
|
+
clearCanvas: It.Float,
|
|
6379
6440
|
viewId: this.viewId
|
|
6380
6441
|
}), s) {
|
|
6381
6442
|
e.push({
|
|
6382
6443
|
isClearAll: !0,
|
|
6383
|
-
clearCanvas:
|
|
6444
|
+
clearCanvas: It.TopFloat,
|
|
6384
6445
|
viewId: this.viewId
|
|
6385
6446
|
});
|
|
6386
6447
|
for (const [r, c] of this.topLayerWork.localWorkShapes.entries())
|
|
@@ -6434,7 +6495,7 @@ class DM extends yg {
|
|
|
6434
6495
|
var r, c;
|
|
6435
6496
|
const { scenePath: e, curCameraOpt: i, options: s } = t;
|
|
6436
6497
|
((r = this.snapshotFullLayer) == null ? void 0 : r.parent).render();
|
|
6437
|
-
const n = await this.getRectImageBitmap({ rect: this.getSceneRect(), drawCanvas:
|
|
6498
|
+
const n = await this.getRectImageBitmap({ rect: this.getSceneRect(), drawCanvas: It.None }, !0, s);
|
|
6438
6499
|
n && (this._post({
|
|
6439
6500
|
sp: [{
|
|
6440
6501
|
type: b.Snapshot,
|
|
@@ -6515,13 +6576,13 @@ class Qe extends Y {
|
|
|
6515
6576
|
pos: [r, c],
|
|
6516
6577
|
layer: e
|
|
6517
6578
|
}), this.replace(e, s || i, f);
|
|
6518
|
-
const
|
|
6519
|
-
if (
|
|
6579
|
+
const T = f.getBoundingClientRect();
|
|
6580
|
+
if (T)
|
|
6520
6581
|
return {
|
|
6521
|
-
x: Math.floor(
|
|
6522
|
-
y: Math.floor(
|
|
6523
|
-
w: Math.floor(
|
|
6524
|
-
h: Math.floor(
|
|
6582
|
+
x: Math.floor(T.x - Y.SafeBorderPadding),
|
|
6583
|
+
y: Math.floor(T.y - Y.SafeBorderPadding),
|
|
6584
|
+
w: Math.floor(T.width + Y.SafeBorderPadding * 2),
|
|
6585
|
+
h: Math.floor(T.height + Y.SafeBorderPadding * 2)
|
|
6525
6586
|
};
|
|
6526
6587
|
}
|
|
6527
6588
|
consumeService() {
|
|
@@ -6562,11 +6623,11 @@ class Qe extends Y {
|
|
|
6562
6623
|
if (!y) return;
|
|
6563
6624
|
const M = e.parent;
|
|
6564
6625
|
if (M) {
|
|
6565
|
-
if (f && (y.opt.strokeColor = f),
|
|
6566
|
-
const { centerX:
|
|
6626
|
+
if (f && (y.opt.strokeColor = f), _t(p) && (e.setAttribute("zIndex", p), y.opt.zIndex = p), Ce(d) && (y.opt.locked = d), c && l && h && r) {
|
|
6627
|
+
const { centerX: T, centerY: w, width: m, height: I, uniformScale: N } = y.opt, v = N !== !1 ? [h[0], h[0]] : h, x = [T, w], L = [T, w];
|
|
6567
6628
|
fi(L, l, v, r);
|
|
6568
6629
|
const A = [L[0] - x[0], L[1] - x[1]];
|
|
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(
|
|
6630
|
+
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(I * v[1]), y.opt.centerX = L[0], y.opt.centerY = L[1], y.opt.eraserlines)
|
|
6570
6631
|
for (const j of Object.values(y.opt.eraserlines)) {
|
|
6571
6632
|
const { op: D, thickness: O } = j;
|
|
6572
6633
|
j.thickness = O * Math.max(h[0], h[1]);
|
|
@@ -6575,20 +6636,20 @@ class Qe extends Y {
|
|
|
6575
6636
|
}
|
|
6576
6637
|
} else if (r) {
|
|
6577
6638
|
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)
|
|
6578
|
-
for (const
|
|
6579
|
-
const { op: w } =
|
|
6639
|
+
for (const T of Object.values(y.opt.eraserlines)) {
|
|
6640
|
+
const { op: w } = T;
|
|
6580
6641
|
for (let m = 0; m < w.length; m++) {
|
|
6581
|
-
const
|
|
6582
|
-
|
|
6642
|
+
const I = w[m].map((N, v) => v % 2 ? N + r[1] : N + r[0]);
|
|
6643
|
+
T.op[m] = I;
|
|
6583
6644
|
}
|
|
6584
6645
|
}
|
|
6585
|
-
} else if (
|
|
6646
|
+
} else if (_t(u))
|
|
6586
6647
|
if (y.opt.rotate = u, y.scaleType = Qe.getScaleType(y.opt), n) {
|
|
6587
|
-
const
|
|
6588
|
-
y.rect =
|
|
6648
|
+
const T = un(y.rect, u);
|
|
6649
|
+
y.rect = T;
|
|
6589
6650
|
} else {
|
|
6590
|
-
const
|
|
6591
|
-
y.rect =
|
|
6651
|
+
const T = Y.getRectFromLayer(M, e.name);
|
|
6652
|
+
y.rect = T || y.rect;
|
|
6592
6653
|
}
|
|
6593
6654
|
return y && s.setInfo(e.name, y), y == null ? void 0 : y.rect;
|
|
6594
6655
|
}
|
|
@@ -6727,7 +6788,7 @@ const Zt = (a, o) => new Promise(function(t) {
|
|
|
6727
6788
|
a();
|
|
6728
6789
|
}, () => {
|
|
6729
6790
|
a();
|
|
6730
|
-
}),
|
|
6791
|
+
}), re = (a) => {
|
|
6731
6792
|
const o = (a == null ? void 0 : a.webkitBackingStorePixelRatio) || (a == null ? void 0 : a.mozBackingStorePixelRatio) || (a == null ? void 0 : a.msBackingStorePixelRatio) || (a == null ? void 0 : a.oBackingStorePixelRatio) || (a == null ? void 0 : a.backingStorePixelRatio) || 1;
|
|
6732
6793
|
return Math.max(1, (window.devicePixelRatio || 1) / o);
|
|
6733
6794
|
}, Gm = (a, o) => a.x + a.w < o.x || a.x > o.x + o.w || a.y + a.h < o.y || a.y > o.y + o.h ? oo.outside : a.x >= o.x && a.y >= o.y && a.x + a.w <= o.x + o.w && a.y + a.h <= o.y + o.h ? oo.inside : oo.intersect;
|
|
@@ -6780,25 +6841,27 @@ const kt = class kt extends VM {
|
|
|
6780
6841
|
g(this, "asyncClockState", !1);
|
|
6781
6842
|
g(this, "limitNums", /* @__PURE__ */ new Map());
|
|
6782
6843
|
g(this, "limitComponents", Zo((t, e) => {
|
|
6783
|
-
var n, r, c, l, h, u;
|
|
6784
|
-
const i = Object.keys(this.storage[t][e]).length;
|
|
6844
|
+
var n, r, c, l, h, u, d, p;
|
|
6845
|
+
const i = ((r = (n = this.storage) == null ? void 0 : n[t]) == null ? void 0 : r[e]) && Object.keys(this.storage[t][e]).length || 0;
|
|
6846
|
+
if (i === 0)
|
|
6847
|
+
return;
|
|
6785
6848
|
let s = this.limitNums.get(`${t}/${e}`);
|
|
6786
6849
|
if (!s) {
|
|
6787
|
-
const
|
|
6788
|
-
this.limitNums.set(`${t}/${e}`,
|
|
6850
|
+
const f = this.getLimitNum(i);
|
|
6851
|
+
this.limitNums.set(`${t}/${e}`, f), s = f;
|
|
6789
6852
|
}
|
|
6790
6853
|
if (s > 0 && i >= s) {
|
|
6791
|
-
const
|
|
6792
|
-
if ((
|
|
6793
|
-
this.control.room.logger.error(`exceeds the limit of ${s} components, current: ${i}`), (
|
|
6794
|
-
var
|
|
6795
|
-
(
|
|
6854
|
+
const f = kt.componentsLimits.indexOf(s), y = f >= 0 && f < kt.componentsLimits.length - 1;
|
|
6855
|
+
if ((h = (l = (c = this.control.room) == null ? void 0 : c.callbacks) == null ? void 0 : l.listeners) != null && h.map.onObjectsLimit && ((d = (u = this.control.room) == null ? void 0 : u.callbacks) == null || d.dispatch("onObjectsLimit", (T) => T(s, y))), !y) {
|
|
6856
|
+
this.control.room.logger.error(`exceeds the limit of ${s} components, current: ${i}`), (p = this.control.room) == null || p.disconnect().then(() => {
|
|
6857
|
+
var T, w, m, I, N;
|
|
6858
|
+
(m = (w = (T = this.control.room) == null ? void 0 : T.callbacks) == null ? void 0 : w.listeners) != null && m.map.onKickedWithReason && ((N = (I = this.control.room) == null ? void 0 : I.callbacks) == null || N.dispatch("onKickedWithReason", (v) => v("kickByAdmin")));
|
|
6796
6859
|
});
|
|
6797
6860
|
return;
|
|
6798
6861
|
}
|
|
6799
6862
|
console.warn(`exceeds the limit of ${s} components, current: ${i}`);
|
|
6800
|
-
const
|
|
6801
|
-
this.limitNums.set(`${t}/${e}`,
|
|
6863
|
+
const M = y ? kt.componentsLimits[f + 1] : 0;
|
|
6864
|
+
this.limitNums.set(`${t}/${e}`, M);
|
|
6802
6865
|
}
|
|
6803
6866
|
}, 2e3, { maxWait: 5e3 }));
|
|
6804
6867
|
g(this, "clearLimitComponents", (t, e) => {
|
|
@@ -7092,14 +7155,14 @@ const kt = class kt extends VM {
|
|
|
7092
7155
|
case b.Select:
|
|
7093
7156
|
if (!f)
|
|
7094
7157
|
return;
|
|
7095
|
-
let
|
|
7096
|
-
d != null && d.length && (
|
|
7097
|
-
const w = this.transformKey(V), m = this.storage[y] && this.storage[y][f] && this.storage[y][f][w] || void 0,
|
|
7098
|
-
|
|
7158
|
+
let T;
|
|
7159
|
+
d != null && d.length && (T = d.map((N) => this.isLocalId(N + "") ? this.transformKey(N) : N));
|
|
7160
|
+
const w = this.transformKey(V), m = this.storage[y] && this.storage[y][f] && this.storage[y][f][w] || void 0, I = r || (m == null ? void 0 : m.opt);
|
|
7161
|
+
T && this.checkOtherSelector(w, T, { isSync: p, viewId: y, scenePath: f }), this.updateValue(w, T && {
|
|
7099
7162
|
type: b.Select,
|
|
7100
7163
|
toolsType: S.Selector,
|
|
7101
|
-
opt:
|
|
7102
|
-
selectIds:
|
|
7164
|
+
opt: I,
|
|
7165
|
+
selectIds: T
|
|
7103
7166
|
}, { isSync: p, viewId: y, scenePath: f });
|
|
7104
7167
|
break;
|
|
7105
7168
|
}
|
|
@@ -7217,24 +7280,24 @@ const kt = class kt extends VM {
|
|
|
7217
7280
|
this.removeStorageStateListener(), this.serviceStorage = {}, this.storage = {}, this.removeAuthStateListener(), this.authStorage = {};
|
|
7218
7281
|
}
|
|
7219
7282
|
dispatchPageAuth(t, e = !0) {
|
|
7220
|
-
var l, h, u, d, p, f, y, M,
|
|
7283
|
+
var l, h, u, d, p, f, y, M, T, w, m, I, N, v, x, L, A, j, D, O, z, E, rt, tt, H, Z, Q, G, K, at, Lt, it, ht, J, $, ut, wt, Ft;
|
|
7221
7284
|
const { operation: i, viewId: s, scenePath: n, pageId: r, pageData: c } = t;
|
|
7222
7285
|
switch (i) {
|
|
7223
7286
|
case Rt.addPage: {
|
|
7224
7287
|
if (!s || !n || !r)
|
|
7225
7288
|
return;
|
|
7226
|
-
const
|
|
7227
|
-
Object.keys(this.authStorage).length &&
|
|
7228
|
-
const
|
|
7229
|
-
this.authStorage.pageAuth =
|
|
7289
|
+
const St = [this.authSpace];
|
|
7290
|
+
Object.keys(this.authStorage).length && St.push("pageAuth");
|
|
7291
|
+
const Nt = this.authStorage.pageAuth || {};
|
|
7292
|
+
this.authStorage.pageAuth = Nt, Object.keys(Nt).length && St.push(s), Nt[s] = Nt[s] || {}, Object.keys(Nt[s]).length && St.push(n), Nt[s][n] = Nt[s][n] || {
|
|
7230
7293
|
render: (c == null ? void 0 : c.render) || "localSelf",
|
|
7231
7294
|
pages: {}
|
|
7232
|
-
}, Object.keys(
|
|
7295
|
+
}, Object.keys(Nt[s][n].pages).length && St.push("pages", r);
|
|
7233
7296
|
const pe = {};
|
|
7234
7297
|
if (c != null && c.elementIds)
|
|
7235
7298
|
for (const zt of c.elementIds.keys())
|
|
7236
7299
|
pe[zt] = !0;
|
|
7237
|
-
|
|
7300
|
+
Nt[s][n].pages[r] = pe, e && (St.length === 1 ? (l = this.plugin) == null || l.updateAttributes(St, dt(this.authStorage)) : St.length === 2 ? (h = this.plugin) == null || h.updateAttributes(St, dt(Nt)) : St.length === 3 ? (u = this.plugin) == null || u.updateAttributes(St, dt(Nt[s])) : St.length === 4 ? (d = this.plugin) == null || d.updateAttributes(St, dt(Nt[s][n])) : (p = this.plugin) == null || p.updateAttributes(St, dt(pe)));
|
|
7238
7301
|
return;
|
|
7239
7302
|
}
|
|
7240
7303
|
case Rt.renderPage: {
|
|
@@ -7246,7 +7309,7 @@ const kt = class kt extends VM {
|
|
|
7246
7309
|
case Rt.deletePage: {
|
|
7247
7310
|
if (!s || !n || !r)
|
|
7248
7311
|
return;
|
|
7249
|
-
(m = (w = (
|
|
7312
|
+
(m = (w = (T = (M = (y = this.authStorage) == null ? void 0 : y.pageAuth) == null ? void 0 : M[s]) == null ? void 0 : T[n]) == null ? void 0 : w.pages) != null && m[r] && (delete this.authStorage.pageAuth[s][n].pages[r], e && ((I = this.plugin) == null || I.updateAttributes([this.authSpace, "pageAuth", s, n, "pages", r], void 0)));
|
|
7250
7313
|
return;
|
|
7251
7314
|
}
|
|
7252
7315
|
case Rt.clearPage: {
|
|
@@ -7282,11 +7345,11 @@ const kt = class kt extends VM {
|
|
|
7282
7345
|
}
|
|
7283
7346
|
}
|
|
7284
7347
|
dispatchRenderAuth(t, e = !0) {
|
|
7285
|
-
var l, h, u, d, p, f, y, M,
|
|
7348
|
+
var l, h, u, d, p, f, y, M, T, w, m, I, N, v, x, L, A, j, D, O;
|
|
7286
7349
|
const { operation: i, viewId: s, uid: n, renderData: r, isClear: c } = t;
|
|
7287
7350
|
if (s)
|
|
7288
7351
|
switch (i) {
|
|
7289
|
-
case
|
|
7352
|
+
case oe.setAuth: {
|
|
7290
7353
|
if (!r || r.render === void 0 && r.hide === void 0 && r.clear === void 0) {
|
|
7291
7354
|
this.authStorage.renderAuth && this.authStorage.renderAuth[s] && (delete this.authStorage.renderAuth[s], e && ((l = this.plugin) == null || l.updateAttributes([this.authSpace, "renderAuth", s], void 0)));
|
|
7292
7355
|
return;
|
|
@@ -7320,25 +7383,25 @@ const kt = class kt extends VM {
|
|
|
7320
7383
|
e && (z.length === 1 ? (h = this.plugin) == null || h.updateAttributes(z, dt(this.authStorage)) : z.length === 2 ? (u = this.plugin) == null || u.updateAttributes(z, dt(E)) : (d = this.plugin) == null || d.updateAttributes(z, dt(E[s])));
|
|
7321
7384
|
return;
|
|
7322
7385
|
}
|
|
7323
|
-
case
|
|
7386
|
+
case oe.setShow: {
|
|
7324
7387
|
if (!n)
|
|
7325
7388
|
return;
|
|
7326
7389
|
const z = [this.authSpace];
|
|
7327
7390
|
Object.keys(this.authStorage).length && z.push("renderAuth");
|
|
7328
7391
|
const E = this.authStorage.renderAuth || {};
|
|
7329
|
-
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 ? (
|
|
7392
|
+
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 ? (T = this.plugin) == null || T.updateAttributes(z, dt(E[s])) : (w = this.plugin) == null || w.updateAttributes(z, !0));
|
|
7330
7393
|
return;
|
|
7331
7394
|
}
|
|
7332
|
-
case
|
|
7395
|
+
case oe.setHide: {
|
|
7333
7396
|
if (!n)
|
|
7334
7397
|
return;
|
|
7335
7398
|
const z = [this.authSpace];
|
|
7336
7399
|
Object.keys(this.authStorage).length && z.push("renderAuth");
|
|
7337
7400
|
const E = this.authStorage.renderAuth || {};
|
|
7338
|
-
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 && ((
|
|
7401
|
+
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 && ((I = this.plugin) == null || I.updateAttributes([this.authSpace, "renderAuth", s, "render", n], void 0))), e && (z.length === 1 ? (N = this.plugin) == null || N.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));
|
|
7339
7402
|
return;
|
|
7340
7403
|
}
|
|
7341
|
-
case
|
|
7404
|
+
case oe.setClear: {
|
|
7342
7405
|
if (!n)
|
|
7343
7406
|
return;
|
|
7344
7407
|
const z = [this.authSpace];
|
|
@@ -7523,7 +7586,7 @@ class QM {
|
|
|
7523
7586
|
get interceptors() {
|
|
7524
7587
|
return {
|
|
7525
7588
|
set: (o, t) => {
|
|
7526
|
-
var p, f, y, M,
|
|
7589
|
+
var p, f, y, M, T, w, m, I;
|
|
7527
7590
|
if (!this.collector)
|
|
7528
7591
|
return !0;
|
|
7529
7592
|
const { viewId: e, scenePath: i, canSync: s, canWorker: n, type: r, opt: c, dataType: l } = t;
|
|
@@ -7546,7 +7609,7 @@ class QM {
|
|
|
7546
7609
|
scenePath: i,
|
|
7547
7610
|
willRefresh: !0
|
|
7548
7611
|
// willSyncService: canSync
|
|
7549
|
-
}), (
|
|
7612
|
+
}), (I = this.control.worker) == null || I.runAnimation()), s && Zt(() => {
|
|
7550
7613
|
var N;
|
|
7551
7614
|
(N = this.collector) == null || N.dispatch({
|
|
7552
7615
|
type: b.UpdateNode,
|
|
@@ -7564,7 +7627,7 @@ class QM {
|
|
|
7564
7627
|
isSync: !0,
|
|
7565
7628
|
viewId: e,
|
|
7566
7629
|
scenePath: i
|
|
7567
|
-
})), n && ((
|
|
7630
|
+
})), n && ((T = this.control.worker) == null || T.taskBatchData.add({
|
|
7568
7631
|
workId: o,
|
|
7569
7632
|
msgType: c.text && b.FullWork || b.CreateWork,
|
|
7570
7633
|
dataType: l || U.Local,
|
|
@@ -8084,7 +8147,7 @@ class ZM extends Jt {
|
|
|
8084
8147
|
};
|
|
8085
8148
|
}
|
|
8086
8149
|
pasteText(t) {
|
|
8087
|
-
var M,
|
|
8150
|
+
var M, T;
|
|
8088
8151
|
const { bgCenter: e, textCenter: i, store: s, key: n, viewId: r, scenePath: c, undoTickerId: l } = t, h = this.control.viewContainerManager.getView(r);
|
|
8089
8152
|
if (!this.serviceColloctor || !h)
|
|
8090
8153
|
return;
|
|
@@ -8095,13 +8158,13 @@ class ZM extends Jt {
|
|
|
8095
8158
|
w.workState = P.Done;
|
|
8096
8159
|
const m = w.boxPoint;
|
|
8097
8160
|
w.boxPoint = [m[0] + p[0], m[1] + p[1]], w.workState = P.Done;
|
|
8098
|
-
const
|
|
8161
|
+
const I = this.control.viewContainerManager.transformToOriginPoint(w.boxPoint, r);
|
|
8099
8162
|
this.control.textEditorManager.createTextForMasterController({
|
|
8100
8163
|
workId: y,
|
|
8101
|
-
x:
|
|
8102
|
-
y:
|
|
8164
|
+
x: I[0],
|
|
8165
|
+
y: I[1],
|
|
8103
8166
|
opt: w,
|
|
8104
|
-
scale: ((
|
|
8167
|
+
scale: ((T = h.cameraOpt) == null ? void 0 : T.scale) || 1,
|
|
8105
8168
|
type: ie.Text,
|
|
8106
8169
|
isActive: !1,
|
|
8107
8170
|
viewId: r,
|
|
@@ -8118,7 +8181,7 @@ class ZM extends Jt {
|
|
|
8118
8181
|
}
|
|
8119
8182
|
}
|
|
8120
8183
|
copySelector(t) {
|
|
8121
|
-
var y, M,
|
|
8184
|
+
var y, M, T, w, m, I, N, v, x;
|
|
8122
8185
|
const { viewId: e, store: i } = t, s = this.control.viewContainerManager.getView(e), n = i.selectIds;
|
|
8123
8186
|
if (!this.serviceColloctor || !(n != null && n.length) || !s)
|
|
8124
8187
|
return;
|
|
@@ -8130,9 +8193,9 @@ class ZM extends Jt {
|
|
|
8130
8193
|
cameraOpt: {
|
|
8131
8194
|
centerX: ((y = s.cameraOpt) == null ? void 0 : y.centerX) || 0,
|
|
8132
8195
|
centerY: ((M = s.cameraOpt) == null ? void 0 : M.centerY) || 0,
|
|
8133
|
-
scale: ((
|
|
8196
|
+
scale: ((T = s.cameraOpt) == null ? void 0 : T.scale) || 1
|
|
8134
8197
|
}
|
|
8135
|
-
}, 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 = (N = (
|
|
8198
|
+
}, 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 = (N = (I = s.displayer) == null ? void 0 : I.floatBarRef.current) == null ? void 0 : N.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] });
|
|
8136
8199
|
p && f && (c.offset = {
|
|
8137
8200
|
x: p.x - f.x,
|
|
8138
8201
|
y: p.y - f.y
|
|
@@ -8152,8 +8215,8 @@ class ZM extends Jt {
|
|
|
8152
8215
|
if (!e.size || !this.serviceColloctor || !c)
|
|
8153
8216
|
return;
|
|
8154
8217
|
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 = [];
|
|
8155
|
-
for (const [
|
|
8156
|
-
const
|
|
8218
|
+
for (const [T, w] of e.entries()) {
|
|
8219
|
+
const I = (this.serviceColloctor.isLocalId(T) ? T : this.serviceColloctor.getLocalId(T.toString())) + "-" + r, N = { useAnimation: !1 };
|
|
8157
8220
|
if (w.toolsType === S.Text && w.opt) {
|
|
8158
8221
|
const v = w.opt;
|
|
8159
8222
|
if (v && v.boxPoint && v.text) {
|
|
@@ -8162,7 +8225,7 @@ class ZM extends Jt {
|
|
|
8162
8225
|
v.boxPoint = [x[0] + p[0], x[1] + p[1]], v.workState = P.Done;
|
|
8163
8226
|
const L = this.control.viewContainerManager.transformToOriginPoint(v.boxPoint, s);
|
|
8164
8227
|
this.control.textEditorManager.createTextForMasterController({
|
|
8165
|
-
workId:
|
|
8228
|
+
workId: I,
|
|
8166
8229
|
x: L[0],
|
|
8167
8230
|
y: L[1],
|
|
8168
8231
|
opt: v,
|
|
@@ -8177,13 +8240,13 @@ class ZM extends Jt {
|
|
|
8177
8240
|
...w,
|
|
8178
8241
|
opt: v,
|
|
8179
8242
|
type: b.FullWork,
|
|
8180
|
-
workId:
|
|
8243
|
+
workId: I,
|
|
8181
8244
|
viewId: s,
|
|
8182
8245
|
scenePath: n
|
|
8183
8246
|
});
|
|
8184
8247
|
continue;
|
|
8185
8248
|
}
|
|
8186
|
-
if (w.toolsType === S.Image && (w.opt.uuid =
|
|
8249
|
+
if (w.toolsType === S.Image && (w.opt.uuid = I, w.opt.centerX = w.opt.centerX + p[0], w.opt.centerY = w.opt.centerY + p[1]), w.ops) {
|
|
8187
8250
|
const v = Ie(w.ops).map((L, A) => {
|
|
8188
8251
|
const j = A % 3;
|
|
8189
8252
|
return j === 0 ? L + p[0] : j === 1 ? L + p[1] : L;
|
|
@@ -8194,20 +8257,20 @@ class ZM extends Jt {
|
|
|
8194
8257
|
...w,
|
|
8195
8258
|
updateNodeOpt: N,
|
|
8196
8259
|
type: b.FullWork,
|
|
8197
|
-
workId:
|
|
8260
|
+
workId: I,
|
|
8198
8261
|
viewId: s,
|
|
8199
8262
|
scenePath: n
|
|
8200
8263
|
}), f.push([{
|
|
8201
8264
|
...w,
|
|
8202
8265
|
updateNodeOpt: N,
|
|
8203
|
-
workId:
|
|
8266
|
+
workId: I,
|
|
8204
8267
|
msgType: b.FullWork,
|
|
8205
8268
|
dataType: U.Local,
|
|
8206
8269
|
emitEventType: R.CopyNode,
|
|
8207
8270
|
willSyncService: !1,
|
|
8208
8271
|
willRefresh: !0,
|
|
8209
8272
|
viewId: s
|
|
8210
|
-
}, { workId:
|
|
8273
|
+
}, { workId: I, msgType: b.FullWork, emitEventType: R.CopyNode }]);
|
|
8211
8274
|
}
|
|
8212
8275
|
f.length && this.collectForLocalWorker(f), y.length && this.collectForServiceWorker(y);
|
|
8213
8276
|
}
|
|
@@ -8215,7 +8278,7 @@ class ZM extends Jt {
|
|
|
8215
8278
|
function Je(a, o, t) {
|
|
8216
8279
|
return "#" + ((a << 16) + (o << 8) + t).toString(16).padStart(6, "0");
|
|
8217
8280
|
}
|
|
8218
|
-
function
|
|
8281
|
+
function Tt(a, o = 1) {
|
|
8219
8282
|
return "rgba(" + parseInt("0x" + a.slice(1, 3)) + "," + parseInt("0x" + a.slice(3, 5)) + "," + parseInt("0x" + a.slice(5, 7)) + "," + o + ")";
|
|
8220
8283
|
}
|
|
8221
8284
|
function Fe(a, o, t, e = 1) {
|
|
@@ -8255,14 +8318,14 @@ class XM extends Jt {
|
|
|
8255
8318
|
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);
|
|
8256
8319
|
if (!(d != null && d.displayer))
|
|
8257
8320
|
return;
|
|
8258
|
-
const p = d.focusScenePath, f = [...e], y = this.serviceColloctor.storage, M = [],
|
|
8321
|
+
const p = d.focusScenePath, f = [...e], y = this.serviceColloctor.storage, M = [], T = {};
|
|
8259
8322
|
for ((l === P.Start || !this.undoTickerId && l === P.Done) && (this.undoTickerId = Date.now(), this.mainEngine.internalMsgEmitter.emit("addUndoTicker", this.undoTickerId, c)); f.length; ) {
|
|
8260
8323
|
const w = f.pop();
|
|
8261
8324
|
if (!w)
|
|
8262
8325
|
continue;
|
|
8263
|
-
const m = w.toString(),
|
|
8326
|
+
const m = w.toString(), I = this.serviceColloctor.isLocalId(m), N = I ? this.serviceColloctor.transformKey(w) : m;
|
|
8264
8327
|
let v = m;
|
|
8265
|
-
!
|
|
8328
|
+
!I && this.serviceColloctor.isOwn(v) && (v = this.serviceColloctor.getLocalId(v));
|
|
8266
8329
|
const x = y[c][p][N] || void 0;
|
|
8267
8330
|
if (x) {
|
|
8268
8331
|
const L = x.updateNodeOpt || {};
|
|
@@ -8270,14 +8333,14 @@ class XM extends Jt {
|
|
|
8270
8333
|
if (n) {
|
|
8271
8334
|
L.fontColor = n;
|
|
8272
8335
|
const [j, D, O, z] = _e(n);
|
|
8273
|
-
|
|
8336
|
+
T.textColor = [j, D, O], T.textOpacity = z;
|
|
8274
8337
|
}
|
|
8275
8338
|
if (r)
|
|
8276
8339
|
if (L.fontBgColor = to(r) ? "transparent" : r, to(r))
|
|
8277
|
-
|
|
8340
|
+
T.textBgColor = void 0, T.textBgOpacity = void 0;
|
|
8278
8341
|
else {
|
|
8279
8342
|
const [j, D, O, z] = _e(r);
|
|
8280
|
-
|
|
8343
|
+
T.textBgColor = [j, D, O], T.textBgOpacity = z;
|
|
8281
8344
|
}
|
|
8282
8345
|
if (x.toolsType === S.Text && x.opt && l !== P.Start) {
|
|
8283
8346
|
this.setTextColor(v, Pt(x), L, c), l === P.Done && (this.undoTickerId = void 0);
|
|
@@ -8287,16 +8350,16 @@ class XM extends Jt {
|
|
|
8287
8350
|
if (i) {
|
|
8288
8351
|
L.strokeColor = i;
|
|
8289
8352
|
const [j, D, O, z] = _e(i);
|
|
8290
|
-
|
|
8353
|
+
T.strokeColor = [j, D, O], T.strokeOpacity = z;
|
|
8291
8354
|
}
|
|
8292
8355
|
if (s)
|
|
8293
8356
|
if (L.fillColor = to(s) ? "transparent" : s, to(s))
|
|
8294
|
-
|
|
8357
|
+
T.fillColor = void 0, T.fillOpacity = void 0;
|
|
8295
8358
|
else {
|
|
8296
8359
|
const [j, D, O, z] = _e(s);
|
|
8297
|
-
|
|
8360
|
+
T.fillColor = [j, D, O], T.fillOpacity = z;
|
|
8298
8361
|
}
|
|
8299
|
-
h && (L.thickness = h,
|
|
8362
|
+
h && (L.thickness = h, T.strokeWidth = h), u && (L.strokeType = u, T.strokeType = u);
|
|
8300
8363
|
const A = {
|
|
8301
8364
|
workId: v,
|
|
8302
8365
|
msgType: b.UpdateNode,
|
|
@@ -8316,9 +8379,9 @@ class XM extends Jt {
|
|
|
8316
8379
|
}]);
|
|
8317
8380
|
}
|
|
8318
8381
|
}
|
|
8319
|
-
M.length && (l === P.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(M)), Object.keys(
|
|
8382
|
+
M.length && (l === P.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(M)), Object.keys(T).length && setTimeout(() => {
|
|
8320
8383
|
var w;
|
|
8321
|
-
(w = this.control.room) == null || w.setMemberState(
|
|
8384
|
+
(w = this.control.room) == null || w.setMemberState(T);
|
|
8322
8385
|
}, 0);
|
|
8323
8386
|
}
|
|
8324
8387
|
}
|
|
@@ -8382,24 +8445,24 @@ class JM extends Jt {
|
|
|
8382
8445
|
if (!p)
|
|
8383
8446
|
continue;
|
|
8384
8447
|
const f = p.toString(), y = this.serviceColloctor.isLocalId(f), M = y ? this.serviceColloctor.transformKey(p) : f;
|
|
8385
|
-
let
|
|
8386
|
-
!y && this.serviceColloctor.isOwn(
|
|
8448
|
+
let T = f;
|
|
8449
|
+
!y && this.serviceColloctor.isOwn(T) && (T = this.serviceColloctor.getLocalId(T));
|
|
8387
8450
|
const w = Pt(l[s][r][M]);
|
|
8388
8451
|
let m;
|
|
8389
|
-
if (w &&
|
|
8452
|
+
if (w && T === V) {
|
|
8390
8453
|
if (w.selectIds) {
|
|
8391
8454
|
u.push(...w.selectIds), u.sort((x, L) => {
|
|
8392
8455
|
var D, O, z, E;
|
|
8393
8456
|
const A = ((O = (D = l[d(x, this.serviceColloctor)]) == null ? void 0 : D.opt) == null ? void 0 : O.zIndex) || 0, j = ((E = (z = l[d(x, this.serviceColloctor)]) == null ? void 0 : z.opt) == null ? void 0 : E.zIndex) || 0;
|
|
8394
8457
|
return A > j ? 1 : x < L ? -1 : 0;
|
|
8395
8458
|
});
|
|
8396
|
-
const
|
|
8397
|
-
|
|
8459
|
+
const I = w.updateNodeOpt || {};
|
|
8460
|
+
I.zIndexLayer = i;
|
|
8398
8461
|
const N = {
|
|
8399
8462
|
workId: p,
|
|
8400
8463
|
msgType: b.UpdateNode,
|
|
8401
8464
|
dataType: U.Local,
|
|
8402
|
-
updateNodeOpt:
|
|
8465
|
+
updateNodeOpt: I,
|
|
8403
8466
|
emitEventType: this.emitEventType,
|
|
8404
8467
|
willRefreshSelector: !0,
|
|
8405
8468
|
willSyncService: !0,
|
|
@@ -8410,7 +8473,7 @@ class JM extends Jt {
|
|
|
8410
8473
|
const L = (D = this.serviceColloctor) == null ? void 0 : D.isLocalId(x);
|
|
8411
8474
|
let A = L && ((O = this.serviceColloctor) == null ? void 0 : O.transformKey(x)) || x;
|
|
8412
8475
|
const j = l[s][r][A];
|
|
8413
|
-
!L && ((z = this.serviceColloctor) != null && z.isOwn(A)) && (A = this.serviceColloctor.getLocalId(A)),
|
|
8476
|
+
!L && ((z = this.serviceColloctor) != null && z.isOwn(A)) && (A = this.serviceColloctor.getLocalId(A)), I.zIndex = m, j != null && j.opt && (j.opt.zIndex = m), j != null && j.opt && v.set(A, {
|
|
8414
8477
|
updateNodeOpt: j.updateNodeOpt,
|
|
8415
8478
|
opt: j.opt
|
|
8416
8479
|
});
|
|
@@ -8449,15 +8512,15 @@ class qM extends Jt {
|
|
|
8449
8512
|
for (p && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", p, r); h.length; ) {
|
|
8450
8513
|
const y = h.pop();
|
|
8451
8514
|
if (!y) continue;
|
|
8452
|
-
const M = y.toString(),
|
|
8515
|
+
const M = y.toString(), T = this.serviceColloctor.isLocalId(M), w = T && this.serviceColloctor.transformKey(y) || M;
|
|
8453
8516
|
let m = M;
|
|
8454
|
-
!
|
|
8455
|
-
const
|
|
8456
|
-
if (
|
|
8457
|
-
if (
|
|
8517
|
+
!T && this.serviceColloctor.isOwn(m) && (m = this.serviceColloctor.getLocalId(m));
|
|
8518
|
+
const I = u[r][l][w];
|
|
8519
|
+
if (I && m === V) {
|
|
8520
|
+
if (I.selectIds) {
|
|
8458
8521
|
const N = this.control.viewContainerManager.transformToScenePoint([s.x, s.y], r);
|
|
8459
8522
|
if (n === P.Start && (this.cachePosition = N), this.cachePosition) {
|
|
8460
|
-
const v =
|
|
8523
|
+
const v = I.updateNodeOpt || {};
|
|
8461
8524
|
v.translate = [N[0] - this.cachePosition[0], N[1] - this.cachePosition[1]], v.workState = n;
|
|
8462
8525
|
const x = {
|
|
8463
8526
|
workId: y,
|
|
@@ -8501,12 +8564,12 @@ class KM extends Jt {
|
|
|
8501
8564
|
continue;
|
|
8502
8565
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f ? this.serviceColloctor.transformKey(d) : p, M = r[i][n][y];
|
|
8503
8566
|
if (M) {
|
|
8504
|
-
let
|
|
8505
|
-
if (!f && this.serviceColloctor.isOwn(
|
|
8506
|
-
this.control.textEditorManager.delete(
|
|
8567
|
+
let T = p;
|
|
8568
|
+
if (!f && this.serviceColloctor.isOwn(T) && (T = this.serviceColloctor.getLocalId(T)), M.toolsType === S.Text) {
|
|
8569
|
+
this.control.textEditorManager.delete(T, !0, !0);
|
|
8507
8570
|
continue;
|
|
8508
8571
|
}
|
|
8509
|
-
h.push(
|
|
8572
|
+
h.push(T);
|
|
8510
8573
|
}
|
|
8511
8574
|
}
|
|
8512
8575
|
h.length && (l.push([{
|
|
@@ -8539,7 +8602,7 @@ class _M extends Jt {
|
|
|
8539
8602
|
return { key: t, textInfo: s };
|
|
8540
8603
|
}
|
|
8541
8604
|
async collect(t, e) {
|
|
8542
|
-
var w, m,
|
|
8605
|
+
var w, m, I, N, v;
|
|
8543
8606
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8544
8607
|
return;
|
|
8545
8608
|
const { workIds: i, workState: s, viewId: n, originPoint: r, scenePoint: c, dir: l, scale: h, translate: u } = t;
|
|
@@ -8547,8 +8610,8 @@ class _M extends Jt {
|
|
|
8547
8610
|
const d = this.control.viewContainerManager.getView(n);
|
|
8548
8611
|
if (!(d != null && d.displayer))
|
|
8549
8612
|
return;
|
|
8550
|
-
const p = d.focusScenePath, f = [...i], y = (w = this.serviceColloctor) == null ? void 0 : w.storage, M = [],
|
|
8551
|
-
for (
|
|
8613
|
+
const p = d.focusScenePath, f = [...i], y = (w = this.serviceColloctor) == null ? void 0 : w.storage, M = [], T = s === P.Start && Date.now() || void 0;
|
|
8614
|
+
for (T && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", T, n); f.length; ) {
|
|
8552
8615
|
const x = f.pop();
|
|
8553
8616
|
if (!x)
|
|
8554
8617
|
continue;
|
|
@@ -8561,7 +8624,7 @@ class _M extends Jt {
|
|
|
8561
8624
|
if (z.dir = l, z.originPoint = r, z.scenePoint = c, z.workState = s, z.scale = h, z.translate = u, s === P.Start) {
|
|
8562
8625
|
this.cacheTextInfo.clear();
|
|
8563
8626
|
for (const rt of O.selectIds) {
|
|
8564
|
-
const tt = (m = this.serviceColloctor) == null ? void 0 : m.isLocalId(rt), H = tt && ((
|
|
8627
|
+
const tt = (m = this.serviceColloctor) == null ? void 0 : m.isLocalId(rt), H = tt && ((I = this.serviceColloctor) == null ? void 0 : I.transformKey(rt)) || rt;
|
|
8565
8628
|
let Z = H;
|
|
8566
8629
|
!tt && ((N = this.serviceColloctor) != null && N.isOwn(H)) && (Z = this.serviceColloctor.getLocalId(H));
|
|
8567
8630
|
const Q = this.control.textEditorManager.get(Z);
|
|
@@ -8740,7 +8803,7 @@ class tw extends Jt {
|
|
|
8740
8803
|
g(this, "cacheOriginRotate", 0);
|
|
8741
8804
|
}
|
|
8742
8805
|
collect(t, e) {
|
|
8743
|
-
var f, y, M,
|
|
8806
|
+
var f, y, M, T, w;
|
|
8744
8807
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8745
8808
|
return;
|
|
8746
8809
|
const { workIds: i, angle: s, workState: n, viewId: r } = t;
|
|
@@ -8753,15 +8816,15 @@ class tw extends Jt {
|
|
|
8753
8816
|
const m = h.pop();
|
|
8754
8817
|
if (!m)
|
|
8755
8818
|
continue;
|
|
8756
|
-
const
|
|
8757
|
-
let x =
|
|
8819
|
+
const I = m.toString(), N = this.serviceColloctor.isLocalId(I), v = N && this.serviceColloctor.transformKey(m) || I;
|
|
8820
|
+
let x = I;
|
|
8758
8821
|
!N && this.serviceColloctor.isOwn(x) && (x = this.serviceColloctor.getLocalId(x));
|
|
8759
8822
|
const L = u[r][l][v];
|
|
8760
8823
|
if (L && x === V) {
|
|
8761
8824
|
if (((y = L.selectIds) == null ? void 0 : y.length) === 1) {
|
|
8762
8825
|
const A = L.selectIds[0];
|
|
8763
8826
|
if (n === P.Start) {
|
|
8764
|
-
const z = ((M = this.serviceColloctor) == null ? void 0 : M.isLocalId(A)) && ((
|
|
8827
|
+
const z = ((M = this.serviceColloctor) == null ? void 0 : M.isLocalId(A)) && ((T = this.serviceColloctor) == null ? void 0 : T.transformKey(A)) || A, E = u[r][l][z];
|
|
8765
8828
|
this.cacheOriginRotate = ((w = E == null ? void 0 : E.opt) == null ? void 0 : w.rotate) || 0;
|
|
8766
8829
|
}
|
|
8767
8830
|
const j = L.updateNodeOpt || {};
|
|
@@ -8825,7 +8888,7 @@ class ow extends Jt {
|
|
|
8825
8888
|
}
|
|
8826
8889
|
}
|
|
8827
8890
|
async collect(t) {
|
|
8828
|
-
var w, m,
|
|
8891
|
+
var w, m, I, N;
|
|
8829
8892
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8830
8893
|
return;
|
|
8831
8894
|
const { workIds: e, bold: i, italic: s, lineThrough: n, underline: r, viewId: c, fontSize: l } = t, h = this.control.viewContainerManager.getView(c);
|
|
@@ -8852,7 +8915,7 @@ class ow extends Jt {
|
|
|
8852
8915
|
if (D && j === V && ((w = D.selectIds) != null && w.length))
|
|
8853
8916
|
for (const z of D.selectIds) {
|
|
8854
8917
|
const E = (m = this.serviceColloctor) == null ? void 0 : m.isLocalId(z);
|
|
8855
|
-
let rt = E && ((
|
|
8918
|
+
let rt = E && ((I = this.serviceColloctor) == null ? void 0 : I.transformKey(z)) || z;
|
|
8856
8919
|
const tt = p[c][u][rt] || void 0;
|
|
8857
8920
|
if (!E && ((N = this.serviceColloctor) != null && N.isOwn(rt)) && (rt = this.serviceColloctor.getLocalId(rt)), tt && tt.toolsType === S.Text && D.opt) {
|
|
8858
8921
|
const H = this.setTextStyle(rt, dt(tt), O, c);
|
|
@@ -8862,8 +8925,8 @@ class ow extends Jt {
|
|
|
8862
8925
|
}
|
|
8863
8926
|
}
|
|
8864
8927
|
}
|
|
8865
|
-
const
|
|
8866
|
-
for (const v of
|
|
8928
|
+
const T = await Promise.all(M);
|
|
8929
|
+
for (const v of T)
|
|
8867
8930
|
if (v) {
|
|
8868
8931
|
const { key: x, textInfo: L } = v;
|
|
8869
8932
|
L && (L.canSync = !0, L.canWorker = !0, this.control.textEditorManager.updateForViewEdited(x, L));
|
|
@@ -8896,11 +8959,11 @@ class iw extends Jt {
|
|
|
8896
8959
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f && this.serviceColloctor.transformKey(d) || p;
|
|
8897
8960
|
let M = p;
|
|
8898
8961
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
8899
|
-
const
|
|
8900
|
-
if (
|
|
8901
|
-
const m =
|
|
8962
|
+
const T = l[n][c][y];
|
|
8963
|
+
if (T && M === V && T.selectIds) {
|
|
8964
|
+
const m = T.updateNodeOpt || {};
|
|
8902
8965
|
m.pointMap = i, m.workState = s;
|
|
8903
|
-
const
|
|
8966
|
+
const I = {
|
|
8904
8967
|
workId: d,
|
|
8905
8968
|
msgType: b.UpdateNode,
|
|
8906
8969
|
dataType: U.Local,
|
|
@@ -8910,7 +8973,7 @@ class iw extends Jt {
|
|
|
8910
8973
|
willSyncService: !0,
|
|
8911
8974
|
viewId: n
|
|
8912
8975
|
};
|
|
8913
|
-
s === P.Done && (
|
|
8976
|
+
s === P.Done && (I.undoTickerId = this.undoTickerId), h.push([I, {
|
|
8914
8977
|
workId: d,
|
|
8915
8978
|
msgType: b.UpdateNode,
|
|
8916
8979
|
emitEventType: this.emitEventType
|
|
@@ -8939,9 +9002,9 @@ class sw extends Jt {
|
|
|
8939
9002
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f ? this.serviceColloctor.transformKey(d) : p;
|
|
8940
9003
|
let M = p;
|
|
8941
9004
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
8942
|
-
const
|
|
8943
|
-
if (
|
|
8944
|
-
const w =
|
|
9005
|
+
const T = l[s][r][y] || void 0;
|
|
9006
|
+
if (T) {
|
|
9007
|
+
const w = T.updateNodeOpt || {};
|
|
8945
9008
|
w.isLocked = i;
|
|
8946
9009
|
const m = {
|
|
8947
9010
|
workId: M,
|
|
@@ -8984,14 +9047,14 @@ class nw extends Jt {
|
|
|
8984
9047
|
const p = d.toString(), f = this.serviceColloctor.isLocalId(p), y = f ? this.serviceColloctor.transformKey(d) : p;
|
|
8985
9048
|
let M = p;
|
|
8986
9049
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
8987
|
-
const
|
|
8988
|
-
if (
|
|
9050
|
+
const T = l[i][r][y] || void 0;
|
|
9051
|
+
if (T) {
|
|
8989
9052
|
const w = {
|
|
8990
|
-
...
|
|
9053
|
+
...T.updateNodeOpt,
|
|
8991
9054
|
...s,
|
|
8992
9055
|
willRefresh: !0
|
|
8993
9056
|
};
|
|
8994
|
-
if (
|
|
9057
|
+
if (T && M === V) {
|
|
8995
9058
|
const m = {
|
|
8996
9059
|
workId: M,
|
|
8997
9060
|
msgType: b.UpdateNode,
|
|
@@ -9197,6 +9260,9 @@ class aw {
|
|
|
9197
9260
|
const { width: t, height: e } = o;
|
|
9198
9261
|
this.subLocalLayer.parent.setAttribute("width", t), this.subLocalLayer.parent.setAttribute("height", e), this.subLocalLayer.setAttribute("size", [t, e]), this.subLocalLayer.setAttribute("pos", [t * 0.5, e * 0.5]);
|
|
9199
9262
|
}
|
|
9263
|
+
updateDpr(o) {
|
|
9264
|
+
this.scene.displayRatio = o;
|
|
9265
|
+
}
|
|
9200
9266
|
on(o) {
|
|
9201
9267
|
const { msgType: t, toolsType: e, opt: i, dataType: s, workId: n, workState: r } = o, c = n == null ? void 0 : n.toString();
|
|
9202
9268
|
switch (t) {
|
|
@@ -9206,6 +9272,9 @@ class aw {
|
|
|
9206
9272
|
case b.Clear:
|
|
9207
9273
|
this.clearAll();
|
|
9208
9274
|
break;
|
|
9275
|
+
case b.UpdateDpr:
|
|
9276
|
+
ot(o.dpr) && this.updateDpr(o.dpr);
|
|
9277
|
+
break;
|
|
9209
9278
|
case b.UpdateCamera:
|
|
9210
9279
|
this.updateCamera(o);
|
|
9211
9280
|
break;
|
|
@@ -9466,7 +9535,7 @@ class uw extends hw {
|
|
|
9466
9535
|
}
|
|
9467
9536
|
async useMainThread() {
|
|
9468
9537
|
console.info("no OffscreenCanvas");
|
|
9469
|
-
const { MainThreadManagerImpl: t } = await import("./index-
|
|
9538
|
+
const { MainThreadManagerImpl: t } = await import("./index-BxY7kerI.mjs");
|
|
9470
9539
|
this.mainThread = new t(this);
|
|
9471
9540
|
}
|
|
9472
9541
|
async on() {
|
|
@@ -9575,10 +9644,10 @@ class uw extends hw {
|
|
|
9575
9644
|
fillColor: f,
|
|
9576
9645
|
willSyncService: y,
|
|
9577
9646
|
isSync: M,
|
|
9578
|
-
imageBitmap:
|
|
9647
|
+
imageBitmap: T,
|
|
9579
9648
|
canvasHeight: w,
|
|
9580
9649
|
canvasWidth: m,
|
|
9581
|
-
rect:
|
|
9650
|
+
rect: I,
|
|
9582
9651
|
op: N,
|
|
9583
9652
|
canTextEdit: v,
|
|
9584
9653
|
points: x,
|
|
@@ -9611,15 +9680,15 @@ class uw extends hw {
|
|
|
9611
9680
|
break;
|
|
9612
9681
|
}
|
|
9613
9682
|
case b.Snapshot:
|
|
9614
|
-
if (
|
|
9683
|
+
if (T && J) {
|
|
9615
9684
|
const $ = this.snapshotMap.get(J);
|
|
9616
|
-
$ && $(
|
|
9685
|
+
$ && $(T);
|
|
9617
9686
|
}
|
|
9618
9687
|
break;
|
|
9619
9688
|
case b.BoundingBox:
|
|
9620
|
-
if (
|
|
9689
|
+
if (I && J) {
|
|
9621
9690
|
const $ = this.boundingRectMap.get(J);
|
|
9622
|
-
$ && $(
|
|
9691
|
+
$ && $(I);
|
|
9623
9692
|
}
|
|
9624
9693
|
break;
|
|
9625
9694
|
case b.Cursor:
|
|
@@ -9701,7 +9770,7 @@ class uw extends hw {
|
|
|
9701
9770
|
collectorAsyncData(t) {
|
|
9702
9771
|
var e, i, s, n;
|
|
9703
9772
|
for (const r of t) {
|
|
9704
|
-
const { type: c, op: l, workId: h, index: u, removeIds: d, ops: p, opt: f, updateNodeOpt: y, toolsType: M, isSync:
|
|
9773
|
+
const { type: c, op: l, workId: h, index: u, removeIds: d, ops: p, opt: f, updateNodeOpt: y, toolsType: M, isSync: T, viewId: w, isLockSentEventCursor: m, nextTasks: I } = r;
|
|
9705
9774
|
if (!w) {
|
|
9706
9775
|
console.error("collectorAsyncData", r);
|
|
9707
9776
|
return;
|
|
@@ -9722,7 +9791,7 @@ class uw extends hw {
|
|
|
9722
9791
|
toolsType: M,
|
|
9723
9792
|
workId: h,
|
|
9724
9793
|
index: u,
|
|
9725
|
-
isSync:
|
|
9794
|
+
isSync: T,
|
|
9726
9795
|
viewId: w,
|
|
9727
9796
|
scenePath: N,
|
|
9728
9797
|
updateNodeOpt: y
|
|
@@ -9737,7 +9806,7 @@ class uw extends hw {
|
|
|
9737
9806
|
updateNodeOpt: y,
|
|
9738
9807
|
opt: f,
|
|
9739
9808
|
toolsType: M,
|
|
9740
|
-
isSync:
|
|
9809
|
+
isSync: T,
|
|
9741
9810
|
viewId: w,
|
|
9742
9811
|
scenePath: N
|
|
9743
9812
|
}), this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
|
|
@@ -9746,16 +9815,16 @@ class uw extends hw {
|
|
|
9746
9815
|
break;
|
|
9747
9816
|
}
|
|
9748
9817
|
case b.UpdateNode: {
|
|
9749
|
-
(s = this.collector) == null || s.dispatch({ type: c, updateNodeOpt: y, workId: h, opt: f, ops: p, op: l, isSync:
|
|
9818
|
+
(s = this.collector) == null || s.dispatch({ type: c, updateNodeOpt: y, workId: h, opt: f, ops: p, op: l, isSync: T, viewId: w, scenePath: N });
|
|
9750
9819
|
break;
|
|
9751
9820
|
}
|
|
9752
9821
|
case b.RemoveNode: {
|
|
9753
|
-
d && this.control.textEditorManager.deleteBatch(d, !1, !1), (n = this.collector) == null || n.dispatch({ type: c, removeIds: d, isSync:
|
|
9822
|
+
d && this.control.textEditorManager.deleteBatch(d, !1, !1), (n = this.collector) == null || n.dispatch({ type: c, removeIds: d, isSync: T, viewId: w, scenePath: N }), this.willSelectorWorkId && (d != null && d.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
|
|
9754
9823
|
break;
|
|
9755
9824
|
}
|
|
9756
9825
|
}
|
|
9757
|
-
|
|
9758
|
-
this.collectorAsyncData(
|
|
9826
|
+
I && Zt(() => {
|
|
9827
|
+
this.collectorAsyncData(I);
|
|
9759
9828
|
}, this.maxLastSyncTime);
|
|
9760
9829
|
}
|
|
9761
9830
|
}
|
|
@@ -9996,7 +10065,7 @@ class uw extends hw {
|
|
|
9996
10065
|
}), this.control.renderControl.destoryByViewId(t, e);
|
|
9997
10066
|
}
|
|
9998
10067
|
onServiceDerive(t, e) {
|
|
9999
|
-
var p, f, y, M,
|
|
10068
|
+
var p, f, y, M, T;
|
|
10000
10069
|
const { newValue: i, oldValue: s, viewId: n, scenePath: r } = e, c = dt(i) || {}, l = t;
|
|
10001
10070
|
let h = c.type;
|
|
10002
10071
|
if (!i && s) {
|
|
@@ -10015,8 +10084,8 @@ class uw extends hw {
|
|
|
10015
10084
|
return;
|
|
10016
10085
|
const w = c;
|
|
10017
10086
|
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 === S.LaserPen && (w.isRunSubWork = !0), w.dataType = U.Service, w.viewId = n, w.scenePath = r, w.selectIds && (w.selectIds = w.selectIds.map((m) => {
|
|
10018
|
-
var
|
|
10019
|
-
return (
|
|
10087
|
+
var I, N;
|
|
10088
|
+
return (I = this.collector) != null && I.isOwn(m) ? (N = this.collector) == null ? void 0 : N.getLocalId(m) : m;
|
|
10020
10089
|
})), w && w.toolsType === S.Text || (s == null ? void 0 : s.toolsType) === S.Text) {
|
|
10021
10090
|
this.control.textEditorManager.onServiceDerive(w);
|
|
10022
10091
|
return;
|
|
@@ -10024,7 +10093,7 @@ class uw extends hw {
|
|
|
10024
10093
|
this.taskBatchData.add(w);
|
|
10025
10094
|
}
|
|
10026
10095
|
this.runAnimation();
|
|
10027
|
-
const d = e.newValue && ((
|
|
10096
|
+
const d = e.newValue && ((T = e.newValue.opt) == null ? void 0 : T.zIndex);
|
|
10028
10097
|
if (this.zIndexNodeMethod && ot(d)) {
|
|
10029
10098
|
const w = this.zIndexNodeMethod.getMinZIndex(n);
|
|
10030
10099
|
this.zIndexNodeMethod.getMaxZIndex(n) < d && this.zIndexNodeMethod.setMaxZIndex(d, n), w > d && this.zIndexNodeMethod.setMinZIndex(d, n);
|
|
@@ -10047,8 +10116,8 @@ class uw extends hw {
|
|
|
10047
10116
|
continue;
|
|
10048
10117
|
const y = s[p];
|
|
10049
10118
|
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) => {
|
|
10050
|
-
var
|
|
10051
|
-
return (
|
|
10119
|
+
var T, w;
|
|
10120
|
+
return (T = this.collector) != null && T.isOwn(M) ? (w = this.collector) == null ? void 0 : w.getLocalId(M) : M;
|
|
10052
10121
|
})), y.toolsType === S.Text) {
|
|
10053
10122
|
this.control.textEditorManager.onServiceDerive(y);
|
|
10054
10123
|
continue;
|
|
@@ -10142,6 +10211,21 @@ class uw extends hw {
|
|
|
10142
10211
|
destroyTaskQueue() {
|
|
10143
10212
|
this.useTasksqueue = !1, this.useTasksClockId && (clearTimeout(this.useTasksClockId), this.useTasksClockId = void 0), this.mainTasksqueueCount = void 0, this.workerTasksqueueCount = void 0;
|
|
10144
10213
|
}
|
|
10214
|
+
updateDpr(t, e) {
|
|
10215
|
+
this.queryTaskBatchData({
|
|
10216
|
+
msgType: b.UpdateDpr,
|
|
10217
|
+
dataType: U.Local,
|
|
10218
|
+
viewId: t
|
|
10219
|
+
}).forEach((i) => {
|
|
10220
|
+
this.taskBatchData.delete(i);
|
|
10221
|
+
}), this.taskBatchData.add({
|
|
10222
|
+
dataType: U.Local,
|
|
10223
|
+
msgType: b.UpdateDpr,
|
|
10224
|
+
viewId: t,
|
|
10225
|
+
dpr: e,
|
|
10226
|
+
isRunSubWork: !0
|
|
10227
|
+
}), this.runAnimation();
|
|
10228
|
+
}
|
|
10145
10229
|
updateCamera(t, e) {
|
|
10146
10230
|
var i;
|
|
10147
10231
|
this.useTasksqueue || ((i = this.methodBuilder) == null || i.pause(), this.blurCursor(t), this.checkDrawingWork(t), this.useTasksqueue = !0, this.mainTasksqueueCount = 1, this.workerTasksqueueCount = 1), this.useTasksqueue && (this.tasksqueue.set(t, {
|
|
@@ -10429,7 +10513,7 @@ class uw extends hw {
|
|
|
10429
10513
|
const f = this.viewContainerManager.mainView;
|
|
10430
10514
|
if (!f)
|
|
10431
10515
|
return;
|
|
10432
|
-
const y = e || ((h = f.cameraOpt) == null ? void 0 : h.width), M = i || ((u = f.cameraOpt) == null ? void 0 : u.height),
|
|
10516
|
+
const y = e || ((h = f.cameraOpt) == null ? void 0 : h.width), M = i || ((u = f.cameraOpt) == null ? void 0 : u.height), T = {
|
|
10433
10517
|
msgType: b.Snapshot,
|
|
10434
10518
|
dataType: U.Local,
|
|
10435
10519
|
scenePath: t,
|
|
@@ -10445,7 +10529,7 @@ class uw extends hw {
|
|
|
10445
10529
|
viewId: f.id
|
|
10446
10530
|
// maxZIndex: this.zIndexNodeMethod?.getMaxZIndex(viewId)
|
|
10447
10531
|
};
|
|
10448
|
-
return this.taskBatchData.add(
|
|
10532
|
+
return this.taskBatchData.add(T), this.runAnimation(), new Promise((w) => {
|
|
10449
10533
|
this.snapshotMap.set(t, w);
|
|
10450
10534
|
}).then((w) => (this.snapshotMap.delete(t), w));
|
|
10451
10535
|
}
|
|
@@ -11088,13 +11172,13 @@ class pw {
|
|
|
11088
11172
|
const { render: p, pages: f } = d;
|
|
11089
11173
|
if (!p)
|
|
11090
11174
|
return !0;
|
|
11091
|
-
const y = (u = this.control.collector) == null ? void 0 : u.uid, M = p === "localSelf" ? y : p,
|
|
11092
|
-
if (
|
|
11175
|
+
const y = (u = this.control.collector) == null ? void 0 : u.uid, M = p === "localSelf" ? y : p, T = M && f.get(M) || void 0;
|
|
11176
|
+
if (T)
|
|
11093
11177
|
switch (t) {
|
|
11094
11178
|
case b.RemoveNode:
|
|
11095
11179
|
return !0;
|
|
11096
11180
|
default:
|
|
11097
|
-
return
|
|
11181
|
+
return T.has(s);
|
|
11098
11182
|
}
|
|
11099
11183
|
return !1;
|
|
11100
11184
|
}
|
|
@@ -11130,7 +11214,7 @@ class pw {
|
|
|
11130
11214
|
} else
|
|
11131
11215
|
this.renderUids.delete(t);
|
|
11132
11216
|
i && ((n = this.control.collector) == null || n.dispatchRenderAuth({
|
|
11133
|
-
operation:
|
|
11217
|
+
operation: oe.setAuth,
|
|
11134
11218
|
viewId: t,
|
|
11135
11219
|
renderData: s
|
|
11136
11220
|
}, i)), this.renderEffect(t);
|
|
@@ -11141,10 +11225,10 @@ class pw {
|
|
|
11141
11225
|
let n;
|
|
11142
11226
|
switch (e) {
|
|
11143
11227
|
case "show":
|
|
11144
|
-
s ? (s.render || (s.render = /* @__PURE__ */ new Set()), Bt(s.render) && s.render.add(t), Bt(s.hide) && s.hide.delete(t)) : this.renderUids.set(o, { render: /* @__PURE__ */ new Set([t]) }), n =
|
|
11228
|
+
s ? (s.render || (s.render = /* @__PURE__ */ new Set()), Bt(s.render) && s.render.add(t), Bt(s.hide) && s.hide.delete(t)) : this.renderUids.set(o, { render: /* @__PURE__ */ new Set([t]) }), n = oe.setShow;
|
|
11145
11229
|
break;
|
|
11146
11230
|
case "hide":
|
|
11147
|
-
s ? (s.hide || (s.hide = /* @__PURE__ */ new Set()), Bt(s.hide) && s.hide.add(t), Bt(s.render) && s.render.delete(t)) : this.renderUids.set(o, { hide: /* @__PURE__ */ new Set([t]) }), n =
|
|
11231
|
+
s ? (s.hide || (s.hide = /* @__PURE__ */ new Set()), Bt(s.hide) && s.hide.add(t), Bt(s.render) && s.render.delete(t)) : this.renderUids.set(o, { hide: /* @__PURE__ */ new Set([t]) }), n = oe.setHide;
|
|
11148
11232
|
break;
|
|
11149
11233
|
}
|
|
11150
11234
|
s ? this.renderUids.set(o, s) : this.renderUids.delete(o), i && n && ((r = this.control.collector) == null || r.dispatchRenderAuth({
|
|
@@ -11157,7 +11241,7 @@ class pw {
|
|
|
11157
11241
|
var n;
|
|
11158
11242
|
const s = this.renderUids.get(o);
|
|
11159
11243
|
e ? s ? (s.clear || (s.clear = /* @__PURE__ */ new Set()), Bt(s.clear) && s.clear.add(t)) : this.renderUids.set(o, { clear: /* @__PURE__ */ new Set([t]) }) : s && Bt(s.clear) && s.clear.has(t) && s.clear.delete(t), s ? this.renderUids.set(o, s) : this.renderUids.delete(o), i && ((n = this.control.collector) == null || n.dispatchRenderAuth({
|
|
11160
|
-
operation:
|
|
11244
|
+
operation: oe.setClear,
|
|
11161
11245
|
viewId: o,
|
|
11162
11246
|
uid: t,
|
|
11163
11247
|
isClear: e
|
|
@@ -11194,7 +11278,7 @@ class pw {
|
|
|
11194
11278
|
destoryByViewId(o, t = !1) {
|
|
11195
11279
|
var e;
|
|
11196
11280
|
this.renderUids.has(o) && (this.renderUids.delete(o), t || (e = this.control.collector) == null || e.dispatchRenderAuth({
|
|
11197
|
-
operation:
|
|
11281
|
+
operation: oe.setAuth,
|
|
11198
11282
|
viewId: o
|
|
11199
11283
|
})), this.pageAuth.has(o) && this.control.renderControl.delViewPage(o, !t);
|
|
11200
11284
|
}
|
|
@@ -11504,11 +11588,11 @@ const ye = class ye {
|
|
|
11504
11588
|
case nt.rectangle:
|
|
11505
11589
|
return o.rectangleCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), S.Rectangle;
|
|
11506
11590
|
case nt.shape:
|
|
11507
|
-
if (o.shapeCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), o.shapeType ===
|
|
11591
|
+
if (o.shapeCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), o.shapeType === ee.Pentagram || o.shapeType === ee.Star)
|
|
11508
11592
|
return S.Star;
|
|
11509
|
-
if (o.shapeType ===
|
|
11593
|
+
if (o.shapeType === ee.Polygon || o.shapeType === ee.Triangle || o.shapeType === ee.Rhombus)
|
|
11510
11594
|
return S.Polygon;
|
|
11511
|
-
if (o.shapeType ===
|
|
11595
|
+
if (o.shapeType === ee.SpeechBalloon)
|
|
11512
11596
|
return S.SpeechBalloon;
|
|
11513
11597
|
break;
|
|
11514
11598
|
}
|
|
@@ -11550,7 +11634,7 @@ const ye = class ye {
|
|
|
11550
11634
|
case S.Star:
|
|
11551
11635
|
case S.Polygon:
|
|
11552
11636
|
case S.SpeechBalloon:
|
|
11553
|
-
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 === S.Star && (t.shapeType ===
|
|
11637
|
+
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 === S.Star && (t.shapeType === ee.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 === S.Polygon && (t.shapeType === ee.Triangle ? e.vertices = 3 : t.shapeType === ee.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 === S.SpeechBalloon && (e.placement = t.placement || "bottomLeft");
|
|
11554
11638
|
break;
|
|
11555
11639
|
}
|
|
11556
11640
|
return {
|
|
@@ -11898,7 +11982,7 @@ const Me = class Me {
|
|
|
11898
11982
|
return !!t.includes(e);
|
|
11899
11983
|
}
|
|
11900
11984
|
refreshPlugin(o, t = !1) {
|
|
11901
|
-
var n, r, c, l, h, u, d, p, f, y, M,
|
|
11985
|
+
var n, r, c, l, h, u, d, p, f, y, M, T, w, m, I, N, v, x, L, A, j;
|
|
11902
11986
|
let e;
|
|
11903
11987
|
const { scenePath: i } = o, s = o.data;
|
|
11904
11988
|
if (!(!s || !this.collector))
|
|
@@ -11950,7 +12034,7 @@ const Me = class Me {
|
|
|
11950
12034
|
Q && (z.selectIds = H.filter((G) => !!G));
|
|
11951
12035
|
}
|
|
11952
12036
|
}
|
|
11953
|
-
(
|
|
12037
|
+
(T = this.collector) == null || T.updateValue(D.key, D.data, { isAfterUpdate: !0, viewId: this.viewId, scenePath: i, isSync: !0 });
|
|
11954
12038
|
}
|
|
11955
12039
|
}
|
|
11956
12040
|
break;
|
|
@@ -11958,7 +12042,7 @@ const Me = class Me {
|
|
|
11958
12042
|
if (e = t ? this.isNewEffectiveScene(D, tt) : this.isOldEffectiveScene(D, tt, i), e) {
|
|
11959
12043
|
if (t && Array.isArray(z) && z.length === 2) {
|
|
11960
12044
|
const H = z[1];
|
|
11961
|
-
if ((w = H.updateNodeOpt) != null && w.useAnimation && (H.updateNodeOpt.useAnimation = !1), ((m = this.collector) == null ? void 0 : m.getLocalId(D.key)) === V && ((
|
|
12045
|
+
if ((w = H.updateNodeOpt) != null && w.useAnimation && (H.updateNodeOpt.useAnimation = !1), ((m = this.collector) == null ? void 0 : m.getLocalId(D.key)) === V && ((I = this.collector) != null && I.isOwn(D.key))) {
|
|
11962
12046
|
const Z = H.selectIds;
|
|
11963
12047
|
if (Z) {
|
|
11964
12048
|
const Q = tt.filter((K) => {
|
|
@@ -12153,23 +12237,23 @@ class Ve {
|
|
|
12153
12237
|
}
|
|
12154
12238
|
/** 绘制view */
|
|
12155
12239
|
render(o) {
|
|
12156
|
-
var t, e, i, s, n, r, c, l, h, u, d, p, f, y, M,
|
|
12240
|
+
var t, e, i, s, n, r, c, l, h, u, d, p, f, y, M, T, w;
|
|
12157
12241
|
for (const m of o) {
|
|
12158
|
-
const { rect:
|
|
12159
|
-
if (D &&
|
|
12160
|
-
const { dpr: O, canvasBgRef: z, canvasFloatRef: E, canvasServiceFloatRef: rt, canvasTopRef: tt } = D, H = Math.floor(
|
|
12242
|
+
const { rect: I, imageBitmap: N, isClear: v, isUnClose: x, drawCanvas: L, clearCanvas: A, viewId: j } = m, D = (t = this.getView(j)) == null ? void 0 : t.displayer;
|
|
12243
|
+
if (D && I) {
|
|
12244
|
+
const { dpr: O, canvasBgRef: z, canvasFloatRef: E, canvasServiceFloatRef: rt, canvasTopRef: tt } = D, H = Math.floor(I.w * O), Z = Math.floor(I.h * O), Q = I.x * O, G = I.y * O;
|
|
12161
12245
|
if (v) {
|
|
12162
12246
|
switch (A) {
|
|
12163
|
-
case
|
|
12247
|
+
case It.TopFloat:
|
|
12164
12248
|
(i = (e = tt.current) == null ? void 0 : e.getContext("2d")) == null || i.clearRect(Q, G, H, Z);
|
|
12165
12249
|
break;
|
|
12166
|
-
case
|
|
12250
|
+
case It.Float:
|
|
12167
12251
|
(n = (s = E.current) == null ? void 0 : s.getContext("2d")) == null || n.clearRect(Q, G, H, Z);
|
|
12168
12252
|
break;
|
|
12169
|
-
case
|
|
12253
|
+
case It.ServiceFloat:
|
|
12170
12254
|
(c = (r = rt.current) == null ? void 0 : r.getContext("2d")) == null || c.clearRect(Q, G, H, Z);
|
|
12171
12255
|
break;
|
|
12172
|
-
case
|
|
12256
|
+
case It.Bg:
|
|
12173
12257
|
(h = (l = z.current) == null ? void 0 : l.getContext("2d")) == null || h.clearRect(Q, G, H, Z);
|
|
12174
12258
|
break;
|
|
12175
12259
|
}
|
|
@@ -12177,19 +12261,19 @@ class Ve {
|
|
|
12177
12261
|
}
|
|
12178
12262
|
if (L && N)
|
|
12179
12263
|
switch (L) {
|
|
12180
|
-
case
|
|
12264
|
+
case It.TopFloat:
|
|
12181
12265
|
(d = (u = tt.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(N, 0, 0, H, Z, Q, G, H, Z);
|
|
12182
12266
|
break;
|
|
12183
|
-
case
|
|
12267
|
+
case It.Float: {
|
|
12184
12268
|
(f = (p = E.current) == null ? void 0 : p.getContext("2d")) == null || f.drawImage(N, 0, 0, H, Z, Q, G, H, Z);
|
|
12185
12269
|
break;
|
|
12186
12270
|
}
|
|
12187
|
-
case
|
|
12271
|
+
case It.ServiceFloat: {
|
|
12188
12272
|
(M = (y = rt.current) == null ? void 0 : y.getContext("2d")) == null || M.drawImage(N, 0, 0, H, Z, Q, G, H, Z);
|
|
12189
12273
|
break;
|
|
12190
12274
|
}
|
|
12191
|
-
case
|
|
12192
|
-
(w = (
|
|
12275
|
+
case It.Bg: {
|
|
12276
|
+
(w = (T = z.current) == null ? void 0 : T.getContext("2d")) == null || w.drawImage(N, 0, 0, H, Z, Q, G, H, Z);
|
|
12193
12277
|
break;
|
|
12194
12278
|
}
|
|
12195
12279
|
}
|
|
@@ -12737,7 +12821,7 @@ const Aw = (a) => {
|
|
|
12737
12821
|
onClick: e,
|
|
12738
12822
|
onTouchEnd: i
|
|
12739
12823
|
},
|
|
12740
|
-
/* @__PURE__ */ k.createElement("div", { className: "circle", style: { backgroundColor:
|
|
12824
|
+
/* @__PURE__ */ k.createElement("div", { className: "circle", style: { backgroundColor: Tt(o, 1) } })
|
|
12741
12825
|
);
|
|
12742
12826
|
}, xo = (a) => {
|
|
12743
12827
|
const { opacity: o, activeColor: t, setCurOpacity: e } = a, [i, s] = st({ x: 108, y: 0 });
|
|
@@ -12771,7 +12855,7 @@ const Aw = (a) => {
|
|
|
12771
12855
|
{
|
|
12772
12856
|
className: "range-color",
|
|
12773
12857
|
style: {
|
|
12774
|
-
background: `linear-gradient(to right, ${
|
|
12858
|
+
background: `linear-gradient(to right, ${Tt(t, 0)}, ${Tt(t, 1)})`
|
|
12775
12859
|
}
|
|
12776
12860
|
}
|
|
12777
12861
|
),
|
|
@@ -12790,7 +12874,7 @@ const Aw = (a) => {
|
|
|
12790
12874
|
{
|
|
12791
12875
|
className: "circle",
|
|
12792
12876
|
style: {
|
|
12793
|
-
backgroundColor:
|
|
12877
|
+
backgroundColor: Tt(t, o)
|
|
12794
12878
|
},
|
|
12795
12879
|
onClick: (l) => {
|
|
12796
12880
|
l.cancelable && l.preventDefault(), l.stopPropagation();
|
|
@@ -12930,13 +13014,13 @@ const Aw = (a) => {
|
|
|
12930
13014
|
return w.top = "inherit", w.bottom = 50, w;
|
|
12931
13015
|
}
|
|
12932
13016
|
}
|
|
12933
|
-
}, [(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,
|
|
12934
|
-
|
|
12935
|
-
const N =
|
|
13017
|
+
}, [(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, I) => {
|
|
13018
|
+
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), u(w);
|
|
13019
|
+
const N = Tt(m, w);
|
|
12936
13020
|
i != null && i.strokeColor && r({ strokeColor: N }), _.emitMethod(
|
|
12937
13021
|
X.MainEngine,
|
|
12938
13022
|
R.SetColorNode,
|
|
12939
|
-
{ workIds: [V], strokeColor: N, workState:
|
|
13023
|
+
{ workIds: [V], strokeColor: N, workState: I, viewId: n == null ? void 0 : n.viewId }
|
|
12940
13024
|
);
|
|
12941
13025
|
} }), [h, c, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId, i]), f = q(() => {
|
|
12942
13026
|
var w, m;
|
|
@@ -12947,11 +13031,11 @@ const Aw = (a) => {
|
|
|
12947
13031
|
min: Math.min(i.thickness, ((w = n == null ? void 0 : n.control.pluginOptions.strokeWidth) == null ? void 0 : w.min) || 1),
|
|
12948
13032
|
max: Math.max(i.thickness, ((m = n == null ? void 0 : n.control.pluginOptions.strokeWidth) == null ? void 0 : m.max) || 10),
|
|
12949
13033
|
activeNumber: i.thickness,
|
|
12950
|
-
setActiveNumber: (
|
|
12951
|
-
N === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), N === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), i != null && i.thickness && r({ thickness:
|
|
13034
|
+
setActiveNumber: (I, N) => {
|
|
13035
|
+
N === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), N === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), i != null && i.thickness && r({ thickness: I }), _.emitMethod(
|
|
12952
13036
|
X.MainEngine,
|
|
12953
13037
|
R.SetColorNode,
|
|
12954
|
-
{ workIds: [V], thickness:
|
|
13038
|
+
{ workIds: [V], thickness: I, workState: N, viewId: n == null ? void 0 : n.viewId }
|
|
12955
13039
|
);
|
|
12956
13040
|
},
|
|
12957
13041
|
color: c
|
|
@@ -12988,16 +13072,16 @@ const Aw = (a) => {
|
|
|
12988
13072
|
f,
|
|
12989
13073
|
/* @__PURE__ */ k.createElement("div", { className: "font-colors-line" }),
|
|
12990
13074
|
s.concat().map((w, m) => {
|
|
12991
|
-
const
|
|
13075
|
+
const I = Je(...w);
|
|
12992
13076
|
return /* @__PURE__ */ k.createElement(
|
|
12993
13077
|
Co,
|
|
12994
13078
|
{
|
|
12995
13079
|
key: m,
|
|
12996
|
-
color:
|
|
13080
|
+
color: I,
|
|
12997
13081
|
activeColor: c,
|
|
12998
13082
|
onTouchEndHandler: (N) => {
|
|
12999
|
-
N.stopPropagation(), l(
|
|
13000
|
-
const v =
|
|
13083
|
+
N.stopPropagation(), l(I);
|
|
13084
|
+
const v = Tt(I, h);
|
|
13001
13085
|
i != null && i.strokeColor && (i.strokeColor = v, r({ strokeColor: v })), _.emitMethod(
|
|
13002
13086
|
X.MainEngine,
|
|
13003
13087
|
R.SetColorNode,
|
|
@@ -13005,8 +13089,8 @@ const Aw = (a) => {
|
|
|
13005
13089
|
);
|
|
13006
13090
|
},
|
|
13007
13091
|
onClickHandler: (N) => {
|
|
13008
|
-
N.cancelable && N.preventDefault(), N.stopPropagation(), l(
|
|
13009
|
-
const v =
|
|
13092
|
+
N.cancelable && N.preventDefault(), N.stopPropagation(), l(I);
|
|
13093
|
+
const v = Tt(I, h);
|
|
13010
13094
|
i != null && i.strokeColor && (i.strokeColor = v, r({ strokeColor: v })), _.emitMethod(
|
|
13011
13095
|
X.MainEngine,
|
|
13012
13096
|
R.SetColorNode,
|
|
@@ -13017,7 +13101,7 @@ const Aw = (a) => {
|
|
|
13017
13101
|
);
|
|
13018
13102
|
}),
|
|
13019
13103
|
p
|
|
13020
|
-
) : null, [o, s, p, c, h, i, n == null ? void 0 : n.viewId, d]),
|
|
13104
|
+
) : null, [o, s, p, c, h, i, n == null ? void 0 : n.viewId, d]), T = q(() => c ? /* @__PURE__ */ k.createElement("div", { className: "color-bar-ring", style: { backgroundColor: Tt(c, h) } }, /* @__PURE__ */ k.createElement("div", { className: "circle" })) : null, [c, h]);
|
|
13021
13105
|
return /* @__PURE__ */ k.createElement(
|
|
13022
13106
|
"div",
|
|
13023
13107
|
{
|
|
@@ -13029,15 +13113,15 @@ const Aw = (a) => {
|
|
|
13029
13113
|
w.cancelable && w.preventDefault(), w.stopPropagation(), w.nativeEvent.stopImmediatePropagation(), t(!o);
|
|
13030
13114
|
}
|
|
13031
13115
|
},
|
|
13032
|
-
|
|
13116
|
+
T,
|
|
13033
13117
|
M
|
|
13034
13118
|
);
|
|
13035
13119
|
}, Uw = (a) => {
|
|
13036
13120
|
const { open: o, setOpen: t, floatBarRef: e } = a, { floatBarData: i, floatBarColors: s, mananger: n, setFloatBarData: r } = bt(Ct), [c, l] = st(), [h, u] = st(1);
|
|
13037
13121
|
gt(() => {
|
|
13038
13122
|
if (i != null && i.fillColor) {
|
|
13039
|
-
const [M,
|
|
13040
|
-
l(M), u(
|
|
13123
|
+
const [M, T] = (i == null ? void 0 : i.fillColor) === "transparent" && ["transparent", 1] || ko(i.fillColor);
|
|
13124
|
+
l(M), u(T);
|
|
13041
13125
|
}
|
|
13042
13126
|
}, [i]);
|
|
13043
13127
|
const d = q(() => {
|
|
@@ -13050,13 +13134,13 @@ const Aw = (a) => {
|
|
|
13050
13134
|
return M.top = "inherit", M.bottom = 50, M;
|
|
13051
13135
|
}
|
|
13052
13136
|
}
|
|
13053
|
-
}, [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,
|
|
13137
|
+
}, [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, T, w) => {
|
|
13054
13138
|
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);
|
|
13055
|
-
const m =
|
|
13139
|
+
const m = Tt(T, M);
|
|
13056
13140
|
i != null && i.fillColor && (i.fillColor = m, r({ fillColor: m })), _.emitMethod(
|
|
13057
13141
|
X.MainEngine,
|
|
13058
13142
|
R.SetColorNode,
|
|
13059
|
-
{ workIds: [V], fillColor: c &&
|
|
13143
|
+
{ workIds: [V], fillColor: c && Tt(T, M), workState: w, viewId: n == null ? void 0 : n.viewId }
|
|
13060
13144
|
);
|
|
13061
13145
|
} }) : null, [c, h, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId, i]), f = q(() => o ? /* @__PURE__ */ k.createElement(
|
|
13062
13146
|
"div",
|
|
@@ -13076,48 +13160,48 @@ const Aw = (a) => {
|
|
|
13076
13160
|
activeColor: c,
|
|
13077
13161
|
onTouchEndHandler: (M) => {
|
|
13078
13162
|
M.stopPropagation(), l("transparent");
|
|
13079
|
-
const
|
|
13080
|
-
i != null && i.fillColor && (i.fillColor =
|
|
13163
|
+
const T = "transparent";
|
|
13164
|
+
i != null && i.fillColor && (i.fillColor = T, r({ fillColor: T })), _.emitMethod(
|
|
13081
13165
|
X.MainEngine,
|
|
13082
13166
|
R.SetColorNode,
|
|
13083
|
-
{ workIds: [V], workState: P.Done, fillColor:
|
|
13167
|
+
{ workIds: [V], workState: P.Done, fillColor: T, viewId: n == null ? void 0 : n.viewId }
|
|
13084
13168
|
);
|
|
13085
13169
|
},
|
|
13086
13170
|
onClickHandler: (M) => {
|
|
13087
13171
|
M.cancelable && M.preventDefault(), M.stopPropagation(), l("transparent");
|
|
13088
|
-
const
|
|
13089
|
-
i != null && i.fillColor && (i.fillColor =
|
|
13172
|
+
const T = "transparent";
|
|
13173
|
+
i != null && i.fillColor && (i.fillColor = T, r({ fillColor: T })), _.emitMethod(
|
|
13090
13174
|
X.MainEngine,
|
|
13091
13175
|
R.SetColorNode,
|
|
13092
|
-
{ workIds: [V], workState: P.Done, fillColor:
|
|
13176
|
+
{ workIds: [V], workState: P.Done, fillColor: T, viewId: n == null ? void 0 : n.viewId }
|
|
13093
13177
|
);
|
|
13094
13178
|
}
|
|
13095
13179
|
}
|
|
13096
13180
|
),
|
|
13097
|
-
s.map((M,
|
|
13181
|
+
s.map((M, T) => {
|
|
13098
13182
|
const w = Je(...M);
|
|
13099
13183
|
return /* @__PURE__ */ k.createElement(
|
|
13100
13184
|
Co,
|
|
13101
13185
|
{
|
|
13102
|
-
key:
|
|
13186
|
+
key: T,
|
|
13103
13187
|
color: w,
|
|
13104
13188
|
activeColor: c,
|
|
13105
13189
|
onTouchEndHandler: (m) => {
|
|
13106
13190
|
m.cancelable && m.preventDefault(), m.stopPropagation(), l(w);
|
|
13107
|
-
const
|
|
13108
|
-
i != null && i.fillColor && (i.fillColor =
|
|
13191
|
+
const I = Tt(w, h);
|
|
13192
|
+
i != null && i.fillColor && (i.fillColor = I, r({ fillColor: I })), _.emitMethod(
|
|
13109
13193
|
X.MainEngine,
|
|
13110
13194
|
R.SetColorNode,
|
|
13111
|
-
{ workIds: [V], workState: P.Done, fillColor:
|
|
13195
|
+
{ workIds: [V], workState: P.Done, fillColor: I, viewId: n == null ? void 0 : n.viewId }
|
|
13112
13196
|
);
|
|
13113
13197
|
},
|
|
13114
13198
|
onClickHandler: (m) => {
|
|
13115
13199
|
m.cancelable && m.preventDefault(), m.stopPropagation(), l(w);
|
|
13116
|
-
const
|
|
13117
|
-
i != null && i.fillColor && (i.fillColor =
|
|
13200
|
+
const I = Tt(w, h);
|
|
13201
|
+
i != null && i.fillColor && (i.fillColor = I, r({ fillColor: I })), _.emitMethod(
|
|
13118
13202
|
X.MainEngine,
|
|
13119
13203
|
R.SetColorNode,
|
|
13120
|
-
{ workIds: [V], workState: P.Done, fillColor:
|
|
13204
|
+
{ workIds: [V], workState: P.Done, fillColor: I, viewId: n == null ? void 0 : n.viewId }
|
|
13121
13205
|
);
|
|
13122
13206
|
}
|
|
13123
13207
|
}
|
|
@@ -13125,7 +13209,7 @@ const Aw = (a) => {
|
|
|
13125
13209
|
}),
|
|
13126
13210
|
p
|
|
13127
13211
|
) : null, [o, c, s, p, i, n == null ? void 0 : n.viewId, h, d]), y = q(() => {
|
|
13128
|
-
const M = c && c !== "transparent" &&
|
|
13212
|
+
const M = c && c !== "transparent" && Tt(c, h) || "transparent";
|
|
13129
13213
|
return /* @__PURE__ */ k.createElement("div", { className: "color-bar-fill" }, /* @__PURE__ */ k.createElement("div", { className: "circle", style: { backgroundColor: M } }));
|
|
13130
13214
|
}, [c, h]);
|
|
13131
13215
|
return /* @__PURE__ */ k.createElement(
|
|
@@ -13160,16 +13244,16 @@ const Aw = (a) => {
|
|
|
13160
13244
|
return w.top = "inherit", w.bottom = 50, w;
|
|
13161
13245
|
}
|
|
13162
13246
|
}
|
|
13163
|
-
}, [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,
|
|
13164
|
-
|
|
13165
|
-
const N =
|
|
13247
|
+
}, [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, I) => {
|
|
13248
|
+
I === P.Start && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !0), I === P.Done && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !1), p(w);
|
|
13249
|
+
const N = Tt(m, w);
|
|
13166
13250
|
l != null && l.textOpt && (l.textOpt.fontColor = N, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13167
13251
|
X.MainEngine,
|
|
13168
13252
|
R.SetColorNode,
|
|
13169
13253
|
{
|
|
13170
13254
|
workIds: i || [V],
|
|
13171
13255
|
fontColor: h && N,
|
|
13172
|
-
workState:
|
|
13256
|
+
workState: I,
|
|
13173
13257
|
viewId: r == null ? void 0 : r.viewId
|
|
13174
13258
|
}
|
|
13175
13259
|
);
|
|
@@ -13186,16 +13270,16 @@ const Aw = (a) => {
|
|
|
13186
13270
|
}
|
|
13187
13271
|
},
|
|
13188
13272
|
n.map((w, m) => {
|
|
13189
|
-
const
|
|
13273
|
+
const I = Je(...w);
|
|
13190
13274
|
return /* @__PURE__ */ k.createElement(
|
|
13191
13275
|
Co,
|
|
13192
13276
|
{
|
|
13193
13277
|
key: m,
|
|
13194
|
-
color:
|
|
13278
|
+
color: I,
|
|
13195
13279
|
activeColor: h,
|
|
13196
13280
|
onTouchEndHandler: (N) => {
|
|
13197
|
-
N.stopPropagation(), u(
|
|
13198
|
-
const v =
|
|
13281
|
+
N.stopPropagation(), u(I);
|
|
13282
|
+
const v = Tt(I, d);
|
|
13199
13283
|
l != null && l.textOpt && (l.textOpt.fontColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13200
13284
|
X.MainEngine,
|
|
13201
13285
|
R.SetColorNode,
|
|
@@ -13203,8 +13287,8 @@ const Aw = (a) => {
|
|
|
13203
13287
|
);
|
|
13204
13288
|
},
|
|
13205
13289
|
onClickHandler: (N) => {
|
|
13206
|
-
N.cancelable && N.preventDefault(), N.stopPropagation(), u(
|
|
13207
|
-
const v =
|
|
13290
|
+
N.cancelable && N.preventDefault(), N.stopPropagation(), u(I);
|
|
13291
|
+
const v = Tt(I, d);
|
|
13208
13292
|
l != null && l.textOpt && (l.textOpt.fontColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13209
13293
|
X.MainEngine,
|
|
13210
13294
|
R.SetColorNode,
|
|
@@ -13215,8 +13299,8 @@ const Aw = (a) => {
|
|
|
13215
13299
|
);
|
|
13216
13300
|
}),
|
|
13217
13301
|
y
|
|
13218
|
-
) : null, [o, n, y, h, d, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]),
|
|
13219
|
-
const w = h && h !== "transparent" &&
|
|
13302
|
+
) : null, [o, n, y, h, d, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]), T = q(() => {
|
|
13303
|
+
const w = h && h !== "transparent" && Tt(h, d) || "transparent";
|
|
13220
13304
|
return /* @__PURE__ */ k.createElement("div", { className: "color-bar" }, /* @__PURE__ */ k.createElement("div", { className: "color-bar-color", style: { backgroundColor: w } }));
|
|
13221
13305
|
}, [h, d]);
|
|
13222
13306
|
return /* @__PURE__ */ k.createElement(
|
|
@@ -13231,7 +13315,7 @@ const Aw = (a) => {
|
|
|
13231
13315
|
}
|
|
13232
13316
|
},
|
|
13233
13317
|
/* @__PURE__ */ k.createElement("img", { alt: "icon", src: Dt("font-colors") }),
|
|
13234
|
-
|
|
13318
|
+
T,
|
|
13235
13319
|
M
|
|
13236
13320
|
);
|
|
13237
13321
|
}, Fw = (a) => {
|
|
@@ -13252,16 +13336,16 @@ const Aw = (a) => {
|
|
|
13252
13336
|
return w.top = "inherit", w.bottom = 50, w;
|
|
13253
13337
|
}
|
|
13254
13338
|
}
|
|
13255
|
-
}, [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,
|
|
13256
|
-
|
|
13257
|
-
const N =
|
|
13339
|
+
}, [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, I) => {
|
|
13340
|
+
I === P.Start && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !0), I === P.Done && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !1), p(w);
|
|
13341
|
+
const N = Tt(m, w);
|
|
13258
13342
|
l != null && l.textOpt && (l.textOpt.fontBgColor = N, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13259
13343
|
X.MainEngine,
|
|
13260
13344
|
R.SetColorNode,
|
|
13261
13345
|
{
|
|
13262
13346
|
workIds: i || [V],
|
|
13263
|
-
fontBgColor: h &&
|
|
13264
|
-
workState:
|
|
13347
|
+
fontBgColor: h && Tt(m, w),
|
|
13348
|
+
workState: I,
|
|
13265
13349
|
viewId: r == null ? void 0 : r.viewId
|
|
13266
13350
|
}
|
|
13267
13351
|
);
|
|
@@ -13302,37 +13386,37 @@ const Aw = (a) => {
|
|
|
13302
13386
|
}
|
|
13303
13387
|
),
|
|
13304
13388
|
n.map((w, m) => {
|
|
13305
|
-
const
|
|
13389
|
+
const I = Je(...w);
|
|
13306
13390
|
return /* @__PURE__ */ k.createElement(
|
|
13307
13391
|
Co,
|
|
13308
13392
|
{
|
|
13309
13393
|
key: m,
|
|
13310
|
-
color:
|
|
13394
|
+
color: I,
|
|
13311
13395
|
activeColor: h,
|
|
13312
13396
|
onTouchEndHandler: (N) => {
|
|
13313
|
-
N.stopPropagation(), u(
|
|
13314
|
-
const v =
|
|
13397
|
+
N.stopPropagation(), u(I);
|
|
13398
|
+
const v = Tt(I, d);
|
|
13315
13399
|
l != null && l.textOpt && (l.textOpt.fontBgColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13316
13400
|
X.MainEngine,
|
|
13317
13401
|
R.SetColorNode,
|
|
13318
|
-
{ workIds: i || [V], workState: P.Done, fontBgColor:
|
|
13402
|
+
{ workIds: i || [V], workState: P.Done, fontBgColor: Tt(I, d), viewId: r == null ? void 0 : r.viewId }
|
|
13319
13403
|
);
|
|
13320
13404
|
},
|
|
13321
13405
|
onClickHandler: (N) => {
|
|
13322
|
-
N.cancelable && N.preventDefault(), N.stopPropagation(), u(
|
|
13323
|
-
const v =
|
|
13406
|
+
N.cancelable && N.preventDefault(), N.stopPropagation(), u(I);
|
|
13407
|
+
const v = Tt(I, d);
|
|
13324
13408
|
l != null && l.textOpt && (l.textOpt.fontBgColor = v, c({ textOpt: l.textOpt })), _.emitMethod(
|
|
13325
13409
|
X.MainEngine,
|
|
13326
13410
|
R.SetColorNode,
|
|
13327
|
-
{ workIds: i || [V], workState: P.Done, fontBgColor:
|
|
13411
|
+
{ workIds: i || [V], workState: P.Done, fontBgColor: Tt(I, d), viewId: r == null ? void 0 : r.viewId }
|
|
13328
13412
|
);
|
|
13329
13413
|
}
|
|
13330
13414
|
}
|
|
13331
13415
|
);
|
|
13332
13416
|
}),
|
|
13333
13417
|
y
|
|
13334
|
-
) : null, [o, n, y, d, h, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]),
|
|
13335
|
-
const w = h && h !== "transparent" &&
|
|
13418
|
+
) : null, [o, n, y, d, h, l == null ? void 0 : l.textOpt, i, r == null ? void 0 : r.viewId, f]), T = q(() => {
|
|
13419
|
+
const w = h && h !== "transparent" && Tt(h, d) || "transparent";
|
|
13336
13420
|
return /* @__PURE__ */ k.createElement("div", { className: "color-bar", style: { marginTop: 0 } }, /* @__PURE__ */ k.createElement("div", { className: "color-bar-color", style: { backgroundColor: w } }));
|
|
13337
13421
|
}, [h, d]);
|
|
13338
13422
|
return /* @__PURE__ */ k.createElement(
|
|
@@ -13347,7 +13431,7 @@ const Aw = (a) => {
|
|
|
13347
13431
|
}
|
|
13348
13432
|
},
|
|
13349
13433
|
/* @__PURE__ */ k.createElement(Ow, null),
|
|
13350
|
-
|
|
13434
|
+
T,
|
|
13351
13435
|
M
|
|
13352
13436
|
);
|
|
13353
13437
|
}, $w = (a) => {
|
|
@@ -13427,7 +13511,7 @@ const Aw = (a) => {
|
|
|
13427
13511
|
gt(() => {
|
|
13428
13512
|
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);
|
|
13429
13513
|
}, [e]);
|
|
13430
|
-
const
|
|
13514
|
+
const T = q(() => {
|
|
13431
13515
|
if (s && (n != null && n.current) && ot(c == null ? void 0 : c.y) && (r != null && r.height)) {
|
|
13432
13516
|
if (n.current.offsetTop && n.current.offsetTop + c.y > 180) {
|
|
13433
13517
|
const m = {};
|
|
@@ -13441,7 +13525,7 @@ const Aw = (a) => {
|
|
|
13441
13525
|
"div",
|
|
13442
13526
|
{
|
|
13443
13527
|
className: "font-style-menu",
|
|
13444
|
-
style:
|
|
13528
|
+
style: T,
|
|
13445
13529
|
onTouchEnd: (m) => {
|
|
13446
13530
|
m.stopPropagation(), m.nativeEvent.stopImmediatePropagation();
|
|
13447
13531
|
},
|
|
@@ -13453,7 +13537,7 @@ const Aw = (a) => {
|
|
|
13453
13537
|
/* @__PURE__ */ k.createElement(Vw, { workIds: i || [V], underline: p, setUnderline: f, viewId: r == null ? void 0 : r.viewId }),
|
|
13454
13538
|
/* @__PURE__ */ k.createElement(Hw, { workIds: i || [V], lineThrough: y, setLineThrough: M, viewId: r == null ? void 0 : r.viewId }),
|
|
13455
13539
|
/* @__PURE__ */ k.createElement(Qw, { workIds: i || [V], italic: u, setItalic: d, viewId: r == null ? void 0 : r.viewId })
|
|
13456
|
-
) : null, [o, i, l, r == null ? void 0 : r.viewId, p, y, u,
|
|
13540
|
+
) : null, [o, i, l, r == null ? void 0 : r.viewId, p, y, u, T]);
|
|
13457
13541
|
return /* @__PURE__ */ k.createElement(
|
|
13458
13542
|
"div",
|
|
13459
13543
|
{
|
|
@@ -13545,9 +13629,9 @@ const Aw = (a) => {
|
|
|
13545
13629
|
});
|
|
13546
13630
|
}
|
|
13547
13631
|
const M = (m) => {
|
|
13548
|
-
var
|
|
13549
|
-
(
|
|
13550
|
-
},
|
|
13632
|
+
var I;
|
|
13633
|
+
(I = o.current) == null || I.blur(), e(!1), w(m);
|
|
13634
|
+
}, T = q(() => t ? /* @__PURE__ */ k.createElement(Zw, { onClickHandler: M, style: f }) : null, [t, M, f]), w = (m) => {
|
|
13551
13635
|
m > Ht[p] && (m = Ht[p]), m < Ht[0] && (m = Ht[0]), y(m);
|
|
13552
13636
|
};
|
|
13553
13637
|
return gt(() => () => {
|
|
@@ -13577,17 +13661,17 @@ const Aw = (a) => {
|
|
|
13577
13661
|
},
|
|
13578
13662
|
onKeyDown: (m) => {
|
|
13579
13663
|
if (m.key === "Backspace") {
|
|
13580
|
-
const
|
|
13664
|
+
const I = window.getSelection(), N = I == null ? void 0 : I.getRangeAt(0);
|
|
13581
13665
|
if (N != null && N.collapsed)
|
|
13582
13666
|
return m.cancelable && m.preventDefault(), document.execCommand("delete", !1), !1;
|
|
13583
13667
|
}
|
|
13584
13668
|
return !1;
|
|
13585
13669
|
},
|
|
13586
13670
|
onKeyUp: (m) => {
|
|
13587
|
-
var
|
|
13671
|
+
var I;
|
|
13588
13672
|
if (o.current) {
|
|
13589
13673
|
const N = o.current.value, v = parseInt(N);
|
|
13590
|
-
isNaN(v) ? o.current.value = "0" : o.current.value = v.toString(), v && m.key === "Enter" && (w(v), (
|
|
13674
|
+
isNaN(v) ? o.current.value = "0" : o.current.value = v.toString(), v && m.key === "Enter" && (w(v), (I = o.current) == null || I.blur(), e(!1));
|
|
13591
13675
|
}
|
|
13592
13676
|
},
|
|
13593
13677
|
onFocus: () => {
|
|
@@ -13621,7 +13705,7 @@ const Aw = (a) => {
|
|
|
13621
13705
|
}
|
|
13622
13706
|
}
|
|
13623
13707
|
)),
|
|
13624
|
-
|
|
13708
|
+
T
|
|
13625
13709
|
);
|
|
13626
13710
|
}, Jw = (a) => {
|
|
13627
13711
|
const { workIds: o, mananger: t, islocked: e } = a;
|
|
@@ -14009,7 +14093,7 @@ const Aw = (a) => {
|
|
|
14009
14093
|
N === !0 ? 6 : 0
|
|
14010
14094
|
/* FontStyle */
|
|
14011
14095
|
);
|
|
14012
|
-
}, textOpt: o, workIds: t, style: l }) : null, [o, r, t, n, l, u]),
|
|
14096
|
+
}, textOpt: o, workIds: t, style: l }) : null, [o, r, t, n, l, u]), T = q(() => o && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Xw, { open: r === 7, setOpen: (N) => {
|
|
14013
14097
|
c(
|
|
14014
14098
|
N === !0 ? 7 : 0
|
|
14015
14099
|
/* FontSize */
|
|
@@ -14019,7 +14103,7 @@ const Aw = (a) => {
|
|
|
14019
14103
|
N === !0 ? 1 : 0
|
|
14020
14104
|
/* Layer */
|
|
14021
14105
|
);
|
|
14022
|
-
}, 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]),
|
|
14106
|
+
}, 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]), I = q(() => n && (n != null && n.viewId) && l && (s != null && s.shapeOpt) && (s != null && s.toolsTypes) ? /* @__PURE__ */ k.createElement(nm, { open: r === 8, setOpen: (N) => {
|
|
14023
14107
|
c(
|
|
14024
14108
|
N === !0 ? 8 : 0
|
|
14025
14109
|
/* ShapeOpt */
|
|
@@ -14038,8 +14122,8 @@ const Aw = (a) => {
|
|
|
14038
14122
|
w,
|
|
14039
14123
|
m,
|
|
14040
14124
|
!!(n != null && n.viewId) && /* @__PURE__ */ k.createElement(jw, { workIds: t, viewId: n.viewId }),
|
|
14041
|
-
T,
|
|
14042
14125
|
I,
|
|
14126
|
+
T,
|
|
14043
14127
|
M,
|
|
14044
14128
|
f,
|
|
14045
14129
|
y,
|
|
@@ -14054,21 +14138,21 @@ const Aw = (a) => {
|
|
|
14054
14138
|
fontColor: f,
|
|
14055
14139
|
lineThrough: y,
|
|
14056
14140
|
textAlign: M,
|
|
14057
|
-
strokeColor:
|
|
14141
|
+
strokeColor: T,
|
|
14058
14142
|
lineHeight: w,
|
|
14059
14143
|
bold: m,
|
|
14060
|
-
italic:
|
|
14144
|
+
italic: I,
|
|
14061
14145
|
uid: N,
|
|
14062
14146
|
workState: v
|
|
14063
14147
|
} = s, x = u, L = w || x * 1.2, A = {
|
|
14064
14148
|
fontSize: `${x}px`,
|
|
14065
14149
|
lineHeight: `${L}px`,
|
|
14066
14150
|
color: f,
|
|
14067
|
-
borderColor:
|
|
14151
|
+
borderColor: T,
|
|
14068
14152
|
minHeight: `${L}px`,
|
|
14069
|
-
paddingRight: `${
|
|
14153
|
+
paddingRight: `${I === "italic" ? Math.round(x * 0.3) : 5}px`
|
|
14070
14154
|
};
|
|
14071
|
-
d && (A.fontFamily = `${d}`), (y || p) && (A.textDecoration = `${y && "line-through" || ""}${p && " underline" || ""}`), m && (A.fontWeight = `${m}`),
|
|
14155
|
+
d && (A.fontFamily = `${d}`), (y || p) && (A.textDecoration = `${y && "line-through" || ""}${p && " underline" || ""}`), m && (A.fontWeight = `${m}`), I && (A.fontStyle = `${I}`), M && (A.textAlign = `${M}`);
|
|
14072
14156
|
function j() {
|
|
14073
14157
|
var O;
|
|
14074
14158
|
t && (N && N === ((O = e.control.collector) == null ? void 0 : O.uid) || !N) && e.control.textEditorManager.active(i);
|
|
@@ -14133,20 +14217,20 @@ const Aw = (a) => {
|
|
|
14133
14217
|
fontColor: f,
|
|
14134
14218
|
lineThrough: y,
|
|
14135
14219
|
textAlign: M,
|
|
14136
|
-
strokeColor:
|
|
14220
|
+
strokeColor: T,
|
|
14137
14221
|
lineHeight: w,
|
|
14138
14222
|
bold: m,
|
|
14139
|
-
italic:
|
|
14223
|
+
italic: I
|
|
14140
14224
|
} = n, N = u, v = w || N * 1.2, x = {
|
|
14141
14225
|
fontSize: `${N}px`,
|
|
14142
14226
|
lineHeight: `${v}px`,
|
|
14143
14227
|
color: f,
|
|
14144
|
-
borderColor:
|
|
14228
|
+
borderColor: T,
|
|
14145
14229
|
minHeight: `${v}px`,
|
|
14146
14230
|
pointerEvents: "none",
|
|
14147
|
-
paddingRight: `${
|
|
14231
|
+
paddingRight: `${I === "italic" ? Math.round(N * 0.3) : 5}px`
|
|
14148
14232
|
};
|
|
14149
|
-
d && (x.fontFamily = `${d}`), (y || p) && (x.textDecoration = `${y && "line-through" || ""}${p && " underline" || ""}`), M && (x.textAlign = `${M}`), m && (x.fontWeight = `${m}`),
|
|
14233
|
+
d && (x.fontFamily = `${d}`), (y || p) && (x.textDecoration = `${y && "line-through" || ""}${p && " underline" || ""}`), M && (x.textAlign = `${M}`), m && (x.fontWeight = `${m}`), I && (x.fontStyle = `${I}`);
|
|
14150
14234
|
const L = q(() => {
|
|
14151
14235
|
const A = [];
|
|
14152
14236
|
if (n.text) {
|
|
@@ -14186,10 +14270,10 @@ const Aw = (a) => {
|
|
|
14186
14270
|
(a, o) => !(a.workId !== o.workId || a.left !== o.left || a.top !== o.top || !ft(a.data, o.data))
|
|
14187
14271
|
), cm = (a) => {
|
|
14188
14272
|
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, {
|
|
14189
|
-
fontSize:
|
|
14273
|
+
fontSize: T,
|
|
14190
14274
|
fontFamily: w,
|
|
14191
14275
|
underline: m,
|
|
14192
|
-
fontColor:
|
|
14276
|
+
fontColor: I,
|
|
14193
14277
|
lineThrough: N,
|
|
14194
14278
|
textAlign: v,
|
|
14195
14279
|
strokeColor: x,
|
|
@@ -14198,17 +14282,17 @@ const Aw = (a) => {
|
|
|
14198
14282
|
italic: j,
|
|
14199
14283
|
boxSize: D
|
|
14200
14284
|
} = d, O = De(null), z = q(() => {
|
|
14201
|
-
const it =
|
|
14285
|
+
const it = T, ht = L || it * 1.2, J = {
|
|
14202
14286
|
fontSize: `${it}px`,
|
|
14203
14287
|
lineHeight: `${ht}px`,
|
|
14204
|
-
color:
|
|
14288
|
+
color: I,
|
|
14205
14289
|
borderColor: x,
|
|
14206
14290
|
minHeight: `${ht}px`,
|
|
14207
14291
|
paddingRight: `${j === "italic" ? Math.round(it * 0.3) : 5}px`,
|
|
14208
14292
|
borderWidth: `${Math.max(Math.round(1 / (p || 1)), 1)}px`
|
|
14209
14293
|
};
|
|
14210
14294
|
return w && (J.fontFamily = `${w}`), (N || m) && (J.textDecoration = `${N && "line-through" || ""} ${m && " underline" || ""}`), v && (J.textAlign = `${v}`), A && (J.fontWeight = `${A}`), j && (J.fontStyle = `${j}`), J;
|
|
14211
|
-
}, [A,
|
|
14295
|
+
}, [A, I, w, T, j, L, N, p, x, v, m]), E = q(() => {
|
|
14212
14296
|
const it = `scale(${p || 1}) ${f && "translate(" + f[0] + "px," + f[1] + "px)" || ""}`;
|
|
14213
14297
|
return {
|
|
14214
14298
|
left: `${y}px`,
|
|
@@ -14301,8 +14385,8 @@ const Aw = (a) => {
|
|
|
14301
14385
|
function G(it, ht) {
|
|
14302
14386
|
const J = window == null ? void 0 : window.getSelection();
|
|
14303
14387
|
if (J != null && J.rangeCount && it && J && J.anchorNode) {
|
|
14304
|
-
const $ = J.anchorOffset, ut = J.anchorNode.textContent || "", wt = ut.slice(0, $) || "", Ft = ut.slice($) || "",
|
|
14305
|
-
K(
|
|
14388
|
+
const $ = J.anchorOffset, ut = J.anchorNode.textContent || "", wt = ut.slice(0, $) || "", Ft = ut.slice($) || "", St = wt.concat(it) || "";
|
|
14389
|
+
K(St, Ft, ht);
|
|
14306
14390
|
}
|
|
14307
14391
|
}
|
|
14308
14392
|
function K(it, ht, J) {
|
|
@@ -14311,34 +14395,34 @@ const Aw = (a) => {
|
|
|
14311
14395
|
const ut = it.split(/\n/);
|
|
14312
14396
|
let wt = $.anchorNode.parentNode;
|
|
14313
14397
|
wt === J && (wt = $.anchorNode);
|
|
14314
|
-
const Ft = [...J.childNodes],
|
|
14315
|
-
let
|
|
14398
|
+
const Ft = [...J.childNodes], St = [];
|
|
14399
|
+
let Nt, pe = $.anchorOffset;
|
|
14316
14400
|
for (; Ft.length; ) {
|
|
14317
14401
|
const zt = Ft.pop();
|
|
14318
14402
|
if (zt) {
|
|
14319
14403
|
if (zt === wt) {
|
|
14320
14404
|
let qt = ut[0];
|
|
14321
|
-
ut.length === 1 && (pe = ut[0].length, qt = ut[0].concat(ht)), wt.nodeName === "#text" ? (wt.textContent = qt,
|
|
14405
|
+
ut.length === 1 && (pe = ut[0].length, qt = ut[0].concat(ht)), wt.nodeName === "#text" ? (wt.textContent = qt, Nt = wt) : wt.nodeName === "DIV" && (wt.innerText = qt, Nt = wt.childNodes[0]);
|
|
14322
14406
|
break;
|
|
14323
14407
|
}
|
|
14324
|
-
|
|
14408
|
+
St.push(zt), J.removeChild(zt);
|
|
14325
14409
|
}
|
|
14326
14410
|
}
|
|
14327
14411
|
if (ut.length > 1)
|
|
14328
14412
|
for (let zt = 1; zt < ut.length; zt++) {
|
|
14329
14413
|
let qt = ut[zt];
|
|
14330
14414
|
const Ue = document.createElement("div");
|
|
14331
|
-
d.fontBgColor && (Ue.style.backgroundColor = d.fontBgColor), zt === ut.length - 1 && (pe = qt.length, qt = qt.concat(ht)), qt === "" ? Ue.innerHTML = "<br/>" : Ue.innerText = qt, J.appendChild(Ue), zt === ut.length - 1 && (
|
|
14415
|
+
d.fontBgColor && (Ue.style.backgroundColor = d.fontBgColor), zt === ut.length - 1 && (pe = qt.length, qt = qt.concat(ht)), qt === "" ? Ue.innerHTML = "<br/>" : Ue.innerText = qt, J.appendChild(Ue), zt === ut.length - 1 && (Nt = Ue.childNodes[0]);
|
|
14332
14416
|
}
|
|
14333
|
-
if (
|
|
14334
|
-
|
|
14335
|
-
for (const zt of
|
|
14417
|
+
if (St.length) {
|
|
14418
|
+
St.reverse();
|
|
14419
|
+
for (const zt of St)
|
|
14336
14420
|
J.appendChild(zt);
|
|
14337
14421
|
}
|
|
14338
|
-
if (
|
|
14422
|
+
if (Nt && Nt.nodeName === "#text") {
|
|
14339
14423
|
$.deleteFromDocument();
|
|
14340
|
-
const zt = document.createRange(), qt = Math.min(pe, (
|
|
14341
|
-
zt.setStart(
|
|
14424
|
+
const zt = document.createRange(), qt = Math.min(pe, (Nt == null ? void 0 : Nt.length) || 0);
|
|
14425
|
+
zt.setStart(Nt, qt), zt.collapse(!0), $.removeAllRanges(), $.addRange(zt);
|
|
14342
14426
|
}
|
|
14343
14427
|
}
|
|
14344
14428
|
function at(it) {
|
|
@@ -14610,50 +14694,50 @@ const hm = () => {
|
|
|
14610
14694
|
_.unmountActiveListener(y);
|
|
14611
14695
|
}), []);
|
|
14612
14696
|
const y = (m) => {
|
|
14613
|
-
var
|
|
14697
|
+
var I;
|
|
14614
14698
|
if (!m) {
|
|
14615
14699
|
f(!0), c(!1), s(R.None);
|
|
14616
14700
|
return;
|
|
14617
14701
|
}
|
|
14618
|
-
f(!1), (
|
|
14702
|
+
f(!1), (I = n == null ? void 0 : n.control.room) != null && I.disableDeviceInputs && (n.control.room.disableDeviceInputs = !1);
|
|
14619
14703
|
};
|
|
14620
14704
|
gt(() => {
|
|
14621
14705
|
if (t) {
|
|
14622
|
-
const m = Math.floor(t.w / 2),
|
|
14623
|
-
d(new F(m,
|
|
14706
|
+
const m = Math.floor(t.w / 2), I = Math.floor(-t.h / 2);
|
|
14707
|
+
d(new F(m, I)), h(new F());
|
|
14624
14708
|
}
|
|
14625
14709
|
}, [t]);
|
|
14626
|
-
const M = (m,
|
|
14710
|
+
const M = (m, I) => {
|
|
14627
14711
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14628
14712
|
f(!0);
|
|
14629
14713
|
return;
|
|
14630
14714
|
}
|
|
14631
14715
|
c(!0);
|
|
14632
|
-
const N = Math.round(F.GetAngleByPoints(l, u, new F(
|
|
14716
|
+
const N = Math.round(F.GetAngleByPoints(l, u, new F(I.x, I.y))) || 0;
|
|
14633
14717
|
i(N), s(R.RotateNode), n != null && n.control.room && (n.control.room.disableDeviceInputs = !0), _.emitMethod(
|
|
14634
14718
|
X.MainEngine,
|
|
14635
14719
|
R.RotateNode,
|
|
14636
14720
|
{ workIds: [V], angle: N, workState: P.Start, viewId: n == null ? void 0 : n.viewId }
|
|
14637
14721
|
);
|
|
14638
|
-
},
|
|
14722
|
+
}, T = fo((m, I) => {
|
|
14639
14723
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14640
14724
|
f(!0);
|
|
14641
14725
|
return;
|
|
14642
14726
|
}
|
|
14643
14727
|
c(!1);
|
|
14644
|
-
const N = Math.round(F.GetAngleByPoints(l, u, new F(
|
|
14728
|
+
const N = Math.round(F.GetAngleByPoints(l, u, new F(I.x, I.y))) || 0;
|
|
14645
14729
|
i(N), s(R.None), n != null && n.control.room && (n.control.room.disableDeviceInputs = !1), _.emitMethod(
|
|
14646
14730
|
X.MainEngine,
|
|
14647
14731
|
R.RotateNode,
|
|
14648
14732
|
{ workIds: [V], angle: N, workState: P.Done, viewId: n == null ? void 0 : n.viewId }
|
|
14649
14733
|
);
|
|
14650
|
-
}, 100, { leading: !1 }), w = fo((m,
|
|
14734
|
+
}, 100, { leading: !1 }), w = fo((m, I) => {
|
|
14651
14735
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14652
14736
|
f(!0);
|
|
14653
14737
|
return;
|
|
14654
14738
|
}
|
|
14655
14739
|
c(!0);
|
|
14656
|
-
const N = Math.round(F.GetAngleByPoints(l, u, new F(
|
|
14740
|
+
const N = Math.round(F.GetAngleByPoints(l, u, new F(I.x, I.y))) || 0;
|
|
14657
14741
|
i(N), s(R.RotateNode), _.emitMethod(
|
|
14658
14742
|
X.MainEngine,
|
|
14659
14743
|
R.RotateNode,
|
|
@@ -14667,7 +14751,7 @@ const hm = () => {
|
|
|
14667
14751
|
handle: ".appliance-plugin-rotate-mouse-pointer",
|
|
14668
14752
|
onStart: M,
|
|
14669
14753
|
onDrag: w,
|
|
14670
|
-
onStop:
|
|
14754
|
+
onStop: T
|
|
14671
14755
|
},
|
|
14672
14756
|
/* @__PURE__ */ k.createElement(
|
|
14673
14757
|
"div",
|
|
@@ -14689,12 +14773,12 @@ const hm = () => {
|
|
|
14689
14773
|
_.unmountActiveListener(p);
|
|
14690
14774
|
}), []);
|
|
14691
14775
|
const p = (m) => {
|
|
14692
|
-
var
|
|
14776
|
+
var I;
|
|
14693
14777
|
if (!m || o != null && o.isLocked) {
|
|
14694
14778
|
d(!0), n(P.Pending), t(R.None);
|
|
14695
14779
|
return;
|
|
14696
14780
|
}
|
|
14697
|
-
d(!1), (
|
|
14781
|
+
d(!1), (I = e == null ? void 0 : e.control.room) != null && I.disableDeviceInputs && (e.control.room.disableDeviceInputs = !1);
|
|
14698
14782
|
};
|
|
14699
14783
|
gt(() => {
|
|
14700
14784
|
if (o != null && o.isLocked || e != null && e.control.worker.isBusy) {
|
|
@@ -14715,30 +14799,30 @@ const hm = () => {
|
|
|
14715
14799
|
R.TranslateNode,
|
|
14716
14800
|
{ workIds: [V], position: { x: o == null ? void 0 : o.x, y: o == null ? void 0 : o.y }, workState: P.Start, viewId: e == null ? void 0 : e.viewId }
|
|
14717
14801
|
));
|
|
14718
|
-
}, y = Et((m,
|
|
14802
|
+
}, y = Et((m, I) => {
|
|
14719
14803
|
if (m.cancelable && m.preventDefault(), e != null && e.control.worker.isBusy) {
|
|
14720
14804
|
d(!0), n(P.Pending);
|
|
14721
14805
|
return;
|
|
14722
14806
|
}
|
|
14723
14807
|
m.stopPropagation();
|
|
14724
|
-
const N = { x:
|
|
14808
|
+
const N = { x: I.x, y: I.y };
|
|
14725
14809
|
t(R.None), n(P.Done), e != null && e.control.room && (e.control.room.disableDeviceInputs = !1), _.emitMethod(
|
|
14726
14810
|
X.MainEngine,
|
|
14727
14811
|
R.TranslateNode,
|
|
14728
14812
|
{ workIds: [V], position: N, workState: P.Done, viewId: e == null ? void 0 : e.viewId }
|
|
14729
14813
|
);
|
|
14730
|
-
}, 100, { leading: !1 }), M = Et((m,
|
|
14814
|
+
}, 100, { leading: !1 }), M = Et((m, I) => {
|
|
14731
14815
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), e != null && e.control.worker.isBusy) {
|
|
14732
14816
|
d(!0), n(P.Pending);
|
|
14733
14817
|
return;
|
|
14734
14818
|
}
|
|
14735
|
-
const N = { x:
|
|
14736
|
-
(
|
|
14819
|
+
const N = { x: I.x, y: I.y };
|
|
14820
|
+
(I.x !== (o == null ? void 0 : o.x) || I.y !== (o == null ? void 0 : o.y)) && (n(P.Doing), _.emitMethod(
|
|
14737
14821
|
X.MainEngine,
|
|
14738
14822
|
R.TranslateNode,
|
|
14739
14823
|
{ workIds: [V], position: N, workState: P.Doing, viewId: e == null ? void 0 : e.viewId }
|
|
14740
14824
|
));
|
|
14741
|
-
}, 100, { leading: !1 }),
|
|
14825
|
+
}, 100, { leading: !1 }), T = q(() => !!((o == null ? void 0 : o.scaleType) === pt.none && (o != null && o.canLock)), [o]), w = Et((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 });
|
|
14742
14826
|
return /* @__PURE__ */ k.createElement(
|
|
14743
14827
|
Ae,
|
|
14744
14828
|
{
|
|
@@ -14758,7 +14842,7 @@ const hm = () => {
|
|
|
14758
14842
|
width: o.w,
|
|
14759
14843
|
height: o.h,
|
|
14760
14844
|
zIndex: 2,
|
|
14761
|
-
pointerEvents:
|
|
14845
|
+
pointerEvents: T ? "none" : "auto",
|
|
14762
14846
|
touchAction: "none"
|
|
14763
14847
|
} : void 0,
|
|
14764
14848
|
onClick: (m) => {
|
|
@@ -14788,7 +14872,7 @@ const hm = () => {
|
|
|
14788
14872
|
return;
|
|
14789
14873
|
}
|
|
14790
14874
|
y(!1), (L = u == null ? void 0 : u.control.room) != null && L.disableDeviceInputs && (u.control.room.disableDeviceInputs = !1);
|
|
14791
|
-
},
|
|
14875
|
+
}, T = (x) => [
|
|
14792
14876
|
[x.x, x.y],
|
|
14793
14877
|
[x.x + x.w, x.y],
|
|
14794
14878
|
[x.x + x.w, x.y + x.h],
|
|
@@ -14867,15 +14951,15 @@ const hm = () => {
|
|
|
14867
14951
|
}
|
|
14868
14952
|
}
|
|
14869
14953
|
E[0] = z.w / t.w, E[1] = z.h / t.h;
|
|
14870
|
-
const H =
|
|
14954
|
+
const H = T(z).map((Q) => A.control.viewContainerManager.transformToScenePoint(Q, A.viewId)), Z = w(H, x);
|
|
14871
14955
|
return O && (rt[1] = Z[1] - j[1]), D && (rt[0] = Z[0] - j[0]), { scale: E, translate: rt };
|
|
14872
|
-
},
|
|
14956
|
+
}, I = (x, L) => {
|
|
14873
14957
|
if (x.cancelable && x.preventDefault(), x.stopPropagation(), u != null && u.control.worker.isBusy) {
|
|
14874
14958
|
y(!0);
|
|
14875
14959
|
return;
|
|
14876
14960
|
}
|
|
14877
14961
|
if (h != null && h.w && (h != null && h.h) && u) {
|
|
14878
|
-
const A = { x: h.x, y: h.y, w: h.w, h: h.h }, j =
|
|
14962
|
+
const A = { x: h.x, y: h.y, w: h.w, h: h.h }, j = T(A), D = j.map((E) => u.control.viewContainerManager.transformToScenePoint(E, u.viewId)), O = w(j, L), z = w(D, L);
|
|
14879
14963
|
e(A), s(O), r(z), l(L), u != null && u.control.room && (u.control.room.disableDeviceInputs = !0), _.emitMethod(
|
|
14880
14964
|
X.MainEngine,
|
|
14881
14965
|
R.ScaleNode,
|
|
@@ -14942,7 +15026,7 @@ const hm = () => {
|
|
|
14942
15026
|
topLeft: !0
|
|
14943
15027
|
},
|
|
14944
15028
|
lockAspectRatio: (h == null ? void 0 : h.scaleType) === pt.proportional,
|
|
14945
|
-
onResizeStart:
|
|
15029
|
+
onResizeStart: I,
|
|
14946
15030
|
onResize: N,
|
|
14947
15031
|
onResizeStop: v
|
|
14948
15032
|
}
|
|
@@ -14978,24 +15062,24 @@ const hm = () => {
|
|
|
14978
15062
|
p(!0), u(P.Pending);
|
|
14979
15063
|
return;
|
|
14980
15064
|
}
|
|
14981
|
-
const
|
|
14982
|
-
if ((
|
|
14983
|
-
const N = n.control.viewContainerManager.transformToScenePoint([
|
|
15065
|
+
const I = { x: m.x, y: m.y };
|
|
15066
|
+
if ((I.x !== (t == null ? void 0 : t.x) || I.y !== (t == null ? void 0 : t.y)) && (n != null && n.control.viewContainerManager)) {
|
|
15067
|
+
const N = n.control.viewContainerManager.transformToScenePoint([I.x, I.y], n.viewId), v = e.get(o);
|
|
14984
15068
|
v && i === "start" ? v[0] = N : v && i === "end" && (v[1] = N), u(P.Doing), _.emitMethod(
|
|
14985
15069
|
X.MainEngine,
|
|
14986
15070
|
R.SetPoint,
|
|
14987
15071
|
{ workId: V, pointMap: e, workState: P.Doing, viewId: n == null ? void 0 : n.viewId }
|
|
14988
15072
|
);
|
|
14989
15073
|
}
|
|
14990
|
-
}, 100, { leading: !1 }),
|
|
15074
|
+
}, 100, { leading: !1 }), T = Et((w, m) => {
|
|
14991
15075
|
if (w.cancelable && w.preventDefault(), n != null && n.control.worker.isBusy) {
|
|
14992
15076
|
p(!0), u(P.Pending);
|
|
14993
15077
|
return;
|
|
14994
15078
|
}
|
|
14995
15079
|
w.stopPropagation(), s(R.None), u(P.Done);
|
|
14996
|
-
const
|
|
15080
|
+
const I = { x: m.x, y: m.y };
|
|
14997
15081
|
if (n != null && n.control.viewContainerManager) {
|
|
14998
|
-
const N = n.control.viewContainerManager.transformToScenePoint([
|
|
15082
|
+
const N = n.control.viewContainerManager.transformToScenePoint([I.x, I.y], n.viewId), v = e.get(o);
|
|
14999
15083
|
v && i === "start" ? v[0] = N : v && i === "end" && (v[1] = N), n != null && n.control.room && (n.control.room.disableDeviceInputs = !1), _.emitMethod(
|
|
15000
15084
|
X.MainEngine,
|
|
15001
15085
|
R.SetPoint,
|
|
@@ -15010,7 +15094,7 @@ const hm = () => {
|
|
|
15010
15094
|
position: c,
|
|
15011
15095
|
onStart: y,
|
|
15012
15096
|
onDrag: M,
|
|
15013
|
-
onStop:
|
|
15097
|
+
onStop: T
|
|
15014
15098
|
},
|
|
15015
15099
|
/* @__PURE__ */ k.createElement(
|
|
15016
15100
|
"div",
|
|
@@ -15238,16 +15322,16 @@ const Cm = (a) => {
|
|
|
15238
15322
|
const u = i.maps.get(o);
|
|
15239
15323
|
u && l(u.miniMapCamera, u.viewCamera);
|
|
15240
15324
|
}, l = (u, d) => {
|
|
15241
|
-
const { width: p, height: f } = s.getBoundingClientRect(), y = Math.min(p / u.width, f / u.height), M = d.width / d.scale,
|
|
15325
|
+
const { width: p, height: f } = s.getBoundingClientRect(), y = Math.min(p / u.width, f / u.height), M = d.width / d.scale, T = d.height / d.scale, w = [d.centerX, d.centerY], m = [u.centerX, u.centerY], I = [w[0] - m[0], w[1] - m[1]], N = Math.min(u.scale * y, u.scale * y), v = [I[0] * N, I[1] * N, M, T, N];
|
|
15242
15326
|
r(v);
|
|
15243
15327
|
}, h = (u) => {
|
|
15244
15328
|
var d;
|
|
15245
15329
|
if (i.control.renderControl.isWriteable()) {
|
|
15246
15330
|
const p = u.nativeEvent.target || u.nativeEvent.srcElement;
|
|
15247
15331
|
if (p && u.nativeEvent && n) {
|
|
15248
|
-
const { width: f, height: y } = p.getBoundingClientRect(), [M,
|
|
15249
|
-
if (
|
|
15250
|
-
const [N, v] = [
|
|
15332
|
+
const { width: f, height: y } = p.getBoundingClientRect(), [M, T] = [f / 2, y / 2], [w, m] = [(u.nativeEvent.offsetX - M) / n[4], (u.nativeEvent.offsetY - T) / n[4]], I = i.maps.get(o);
|
|
15333
|
+
if (I != null && I.viewCamera) {
|
|
15334
|
+
const [N, v] = [I.miniMapCamera.centerX + w, I.miniMapCamera.centerY + m];
|
|
15251
15335
|
(d = i.control.room) == null || d.moveCamera({
|
|
15252
15336
|
centerX: N,
|
|
15253
15337
|
centerY: v,
|
|
@@ -15422,7 +15506,7 @@ class zm extends fn {
|
|
|
15422
15506
|
super(t, e);
|
|
15423
15507
|
g(this, "width", 1e3);
|
|
15424
15508
|
g(this, "height", 1e3);
|
|
15425
|
-
g(this, "dpr",
|
|
15509
|
+
g(this, "dpr", re());
|
|
15426
15510
|
g(this, "vDom");
|
|
15427
15511
|
g(this, "eventTragetElement");
|
|
15428
15512
|
g(this, "snapshotContainerRef");
|
|
@@ -15439,7 +15523,8 @@ class zm extends fn {
|
|
|
15439
15523
|
setCanvassStyle() {
|
|
15440
15524
|
if (this.eventTragetElement) {
|
|
15441
15525
|
const t = this.eventTragetElement.offsetWidth || this.width, e = this.eventTragetElement.offsetHeight || this.height;
|
|
15442
|
-
|
|
15526
|
+
let i = re();
|
|
15527
|
+
this.canvasBgRef.current && (i = re(this.canvasBgRef.current.getContext("2d"))), i !== this.dpr && (this.dpr = i, this.control.worker.updateDpr(this.viewId, this.dpr)), t && e && this.canvasContainerRef.current && (t !== this.width || e !== this.height) && (this.width = t, this.height = e, this.canvasContainerRef.current.style.width = `${t}px`, this.canvasContainerRef.current.style.height = `${e}px`), t && e && this.snapshotContainerRef && this.snapshotContainerRef.current && (t !== this.width || e !== this.height) && (this.width = t, this.height = e), t && e && this.canvasBgRef.current && (t !== this.width || e !== this.height) && (this.width = t, this.height = e, this.canvasBgRef.current.width = t * this.dpr, this.canvasBgRef.current.height = e * this.dpr, this.canvasFloatRef.current && (this.canvasFloatRef.current.width = t * this.dpr, this.canvasFloatRef.current.height = e * this.dpr), this.canvasServiceFloatRef.current && (this.canvasServiceFloatRef.current.width = t * this.dpr, this.canvasServiceFloatRef.current.height = e * this.dpr), this.canvasTopRef.current && (this.canvasTopRef.current.width = t * this.dpr, this.canvasTopRef.current.height = e * this.dpr));
|
|
15443
15528
|
}
|
|
15444
15529
|
}
|
|
15445
15530
|
destroy() {
|
|
@@ -15469,7 +15554,7 @@ class zm extends fn {
|
|
|
15469
15554
|
class Pm extends ww {
|
|
15470
15555
|
constructor(t, e, i) {
|
|
15471
15556
|
super(t, e, i);
|
|
15472
|
-
g(this, "dpr",
|
|
15557
|
+
g(this, "dpr", re());
|
|
15473
15558
|
g(this, "width", 1e3);
|
|
15474
15559
|
g(this, "height", 1e3);
|
|
15475
15560
|
g(this, "vDom");
|
|
@@ -15485,14 +15570,14 @@ class Pm extends ww {
|
|
|
15485
15570
|
}
|
|
15486
15571
|
setCanvassStyle() {
|
|
15487
15572
|
if (this.eventTragetElement) {
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15573
|
+
let t = re();
|
|
15574
|
+
if (this.canvasBgRef.current && (t = re(this.canvasBgRef.current.getContext("2d"))), t !== this.dpr && (this.dpr = t, this.control.worker.updateDpr(this.viewId, this.dpr)), this.canvasContainerRef.current) {
|
|
15575
|
+
const e = this.eventTragetElement.offsetWidth || this.width, i = this.eventTragetElement.offsetHeight || this.height;
|
|
15576
|
+
e && i && (e !== this.width || i !== this.height) && (this.width = e, this.height = i, this.canvasContainerRef.current.style.width = `${e}px`, this.canvasContainerRef.current.style.height = `${i}px`);
|
|
15491
15577
|
}
|
|
15492
15578
|
if (this.canvasBgRef.current) {
|
|
15493
|
-
this.
|
|
15494
|
-
|
|
15495
|
-
t && e && (t !== this.width || e !== this.height) && (this.width = t, this.height = e, this.canvasBgRef.current.width = t * this.dpr, this.canvasBgRef.current.height = e * this.dpr, this.canvasFloatRef.current && (this.canvasFloatRef.current.width = t * this.dpr, this.canvasFloatRef.current.height = e * this.dpr), this.canvasServiceFloatRef.current && (this.canvasServiceFloatRef.current.width = t * this.dpr, this.canvasServiceFloatRef.current.height = e * this.dpr), this.canvasTopRef.current && (this.canvasTopRef.current.width = t * this.dpr, this.canvasTopRef.current.height = e * this.dpr));
|
|
15579
|
+
const e = this.eventTragetElement.offsetWidth || this.width, i = this.eventTragetElement.offsetHeight || this.height;
|
|
15580
|
+
e && i && (e !== this.width || i !== this.height) && (this.width = e, this.height = i, this.canvasBgRef.current.width = e * this.dpr, this.canvasBgRef.current.height = i * this.dpr, this.canvasFloatRef.current && (this.canvasFloatRef.current.width = e * this.dpr, this.canvasFloatRef.current.height = i * this.dpr), this.canvasServiceFloatRef.current && (this.canvasServiceFloatRef.current.width = e * this.dpr, this.canvasServiceFloatRef.current.height = i * this.dpr), this.canvasTopRef.current && (this.canvasTopRef.current.width = e * this.dpr, this.canvasTopRef.current.height = i * this.dpr));
|
|
15496
15581
|
}
|
|
15497
15582
|
}
|
|
15498
15583
|
}
|
|
@@ -15785,7 +15870,7 @@ class Qt extends Ve {
|
|
|
15785
15870
|
this.control.hotkeyManager.onActiveHotkey(t);
|
|
15786
15871
|
}
|
|
15787
15872
|
}
|
|
15788
|
-
class
|
|
15873
|
+
class ae extends xt {
|
|
15789
15874
|
constructor(t) {
|
|
15790
15875
|
super(t);
|
|
15791
15876
|
g(this, "windowManager");
|
|
@@ -15923,37 +16008,37 @@ const B = class B extends gs {
|
|
|
15923
16008
|
maxScreenshotWidth: 10 * 1024,
|
|
15924
16009
|
maxScreenshotHeight: 10 * 1024,
|
|
15925
16010
|
getBoundingRectAsync: async function(f) {
|
|
15926
|
-
var
|
|
16011
|
+
var T;
|
|
15927
16012
|
B.logger.info("[ApplianceMultiPlugin] getBoundingRectAsync");
|
|
15928
|
-
const y = (t.mainView || i).getBoundingRect(f), M = await ((
|
|
16013
|
+
const y = (t.mainView || i).getBoundingRect(f), M = await ((T = B.currentManager) == null ? void 0 : T.getBoundingRect(f));
|
|
15929
16014
|
return !y.width || !y.height ? M : pi(y, M);
|
|
15930
16015
|
},
|
|
15931
|
-
screenshotToCanvasAsync: async function(f, y, M,
|
|
16016
|
+
screenshotToCanvasAsync: async function(f, y, M, T, w, m) {
|
|
15932
16017
|
var A;
|
|
15933
16018
|
B.logger.info("[ApplianceMultiPlugin] screenshotToCanvasAsync");
|
|
15934
|
-
let
|
|
15935
|
-
|
|
16019
|
+
let I = M, N = T, v = w.scale;
|
|
16020
|
+
I > this.maxScreenshotWidth && (v = this.maxScreenshotWidth / I * v, I = this.maxScreenshotWidth), N > this.maxScreenshotHeight && (v = Math.min(this.maxScreenshotHeight / N * v, v), N = this.maxScreenshotHeight), w.scale = v;
|
|
15936
16021
|
const x = document.createElement("canvas"), L = x.getContext("2d");
|
|
15937
|
-
x.width =
|
|
16022
|
+
x.width = I * (m || 1), x.height = N * (m || 1), L && ((t.mainView || i).screenshotToCanvas(L, y, I, N, w, m), f.drawImage(x, Math.floor((M - I) / 2), Math.floor((T - N) / 2), I * (m || 1), N * (m || 1), 0, 0, I, N), x.remove()), B.currentManager && await ((A = B.currentManager) == null ? void 0 : A.screenshotToCanvas(f, y, I, N, w, Math.floor((M - I) / 2), Math.floor((T - N) / 2)));
|
|
15938
16023
|
},
|
|
15939
|
-
scenePreviewAsync: async function(f, y, M,
|
|
15940
|
-
B.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || i).scenePreview(f, y, M,
|
|
16024
|
+
scenePreviewAsync: async function(f, y, M, T, w) {
|
|
16025
|
+
B.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || i).scenePreview(f, y, M, T, w);
|
|
15941
16026
|
const m = document.createElement("img");
|
|
15942
16027
|
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);
|
|
15943
16028
|
},
|
|
15944
|
-
fillSceneSnapshotAsync: async function(f, y, M,
|
|
15945
|
-
B.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), y.innerHTML = "", (t.mainView || i).fillSceneSnapshot(f, y, M,
|
|
15946
|
-
const m = M || t.mainView.size.width,
|
|
16029
|
+
fillSceneSnapshotAsync: async function(f, y, M, T, w) {
|
|
16030
|
+
B.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), y.innerHTML = "", (t.mainView || i).fillSceneSnapshot(f, y, M, T, w);
|
|
16031
|
+
const m = M || t.mainView.size.width, I = T || t.mainView.size.height;
|
|
15947
16032
|
let N = await this.getBoundingRectAsync(f);
|
|
15948
16033
|
N || (N = {
|
|
15949
16034
|
originX: 0,
|
|
15950
16035
|
originY: 0,
|
|
15951
16036
|
width: m,
|
|
15952
|
-
height:
|
|
16037
|
+
height: I
|
|
15953
16038
|
});
|
|
15954
|
-
let v = Math.max(N == null ? void 0 : N.width, m), x = Math.max(N == null ? void 0 : N.height,
|
|
15955
|
-
const A = v > m && Math.min(m / v, L) || L, j = x >
|
|
15956
|
-
A <= j ? (v = A < 1 && m || v, x = Math.floor(x * A) + 1, L = A) : A > j && (x = j < 1 &&
|
|
16039
|
+
let v = Math.max(N == null ? void 0 : N.width, m), x = Math.max(N == null ? void 0 : N.height, I), L = 1;
|
|
16040
|
+
const A = v > m && Math.min(m / v, L) || L, j = x > I && Math.min(I / x, L) || L;
|
|
16041
|
+
A <= j ? (v = A < 1 && m || v, x = Math.floor(x * A) + 1, L = A) : A > j && (x = j < 1 && I || x, v = Math.floor(v * j) + 1, L = j);
|
|
15957
16042
|
const D = {
|
|
15958
16043
|
scale: L,
|
|
15959
16044
|
centerX: N.originX + N.width / 2,
|
|
@@ -15968,13 +16053,13 @@ const B = class B extends gs {
|
|
|
15968
16053
|
}, y.append(E), getComputedStyle(y).position || (y.style.position = "relative");
|
|
15969
16054
|
},
|
|
15970
16055
|
_callbacksOn: function(f, y) {
|
|
15971
|
-
B.logger.info(`[ApplianceMultiPlugin] callbacks ${f}`), (f === "onCanUndoStepsUpdate" || f === "onCanRedoStepsUpdate") && ct(i) && i.isWritable ?
|
|
16056
|
+
B.logger.info(`[ApplianceMultiPlugin] callbacks ${f}`), (f === "onCanUndoStepsUpdate" || f === "onCanRedoStepsUpdate") && ct(i) && i.isWritable ? ae.InternalMsgEmitter.on(f, y) : s.call(i.callbacks, f, y);
|
|
15972
16057
|
},
|
|
15973
16058
|
_callbacksOnce: function(f, y) {
|
|
15974
|
-
B.logger.info(`[ApplianceMultiPlugin] callbacks ${f}`), (f === "onCanUndoStepsUpdate" || f === "onCanRedoStepsUpdate") && ct(i) && i.isWritable ?
|
|
16059
|
+
B.logger.info(`[ApplianceMultiPlugin] callbacks ${f}`), (f === "onCanUndoStepsUpdate" || f === "onCanRedoStepsUpdate") && ct(i) && i.isWritable ? ae.InternalMsgEmitter.on(f, y) : r.call(i.callbacks, f, y);
|
|
15975
16060
|
},
|
|
15976
16061
|
_callbacksOff: function(f, y) {
|
|
15977
|
-
B.logger.info(`[ApplianceMultiPlugin] callbacks ${f}`), (f === "onCanUndoStepsUpdate" || f === "onCanRedoStepsUpdate") && ct(i) && i.isWritable ?
|
|
16062
|
+
B.logger.info(`[ApplianceMultiPlugin] callbacks ${f}`), (f === "onCanUndoStepsUpdate" || f === "onCanRedoStepsUpdate") && ct(i) && i.isWritable ? ae.InternalMsgEmitter.off(f, y) : n.call(i.callbacks, f, y);
|
|
15978
16063
|
},
|
|
15979
16064
|
canRedoSteps() {
|
|
15980
16065
|
if (B.logger.info("[ApplianceMultiPlugin] canRedoSteps"), B.currentManager && ct(i) && !i.disableSerialization) {
|
|
@@ -16051,10 +16136,10 @@ const B = class B extends gs {
|
|
|
16051
16136
|
return B.currentManager.cancelFilterRender(f, y);
|
|
16052
16137
|
},
|
|
16053
16138
|
addListener: (f, y) => {
|
|
16054
|
-
B.logger.info(`[ApplianceMultiPlugin] addListener ${f}`),
|
|
16139
|
+
B.logger.info(`[ApplianceMultiPlugin] addListener ${f}`), ae.PublicMsgEmitter.on(f, y);
|
|
16055
16140
|
},
|
|
16056
16141
|
removeListener: (f, y) => {
|
|
16057
|
-
B.logger.info(`[ApplianceMultiPlugin] removeListener ${f}`),
|
|
16142
|
+
B.logger.info(`[ApplianceMultiPlugin] removeListener ${f}`), ae.PublicMsgEmitter.off(f, y);
|
|
16058
16143
|
},
|
|
16059
16144
|
usePlugin: (f) => {
|
|
16060
16145
|
var y;
|
|
@@ -16075,9 +16160,9 @@ const B = class B extends gs {
|
|
|
16075
16160
|
get() {
|
|
16076
16161
|
return u.canRedoSteps();
|
|
16077
16162
|
}
|
|
16078
|
-
}),
|
|
16163
|
+
}), ae.InternalMsgEmitter.on("onCanUndoStepsUpdate", (f) => {
|
|
16079
16164
|
t.emitter.emit("canUndoStepsChange", f);
|
|
16080
|
-
}),
|
|
16165
|
+
}), ae.InternalMsgEmitter.on("onCanRedoStepsUpdate", (f) => {
|
|
16081
16166
|
t.emitter.emit("canRedoStepsChange", f);
|
|
16082
16167
|
});
|
|
16083
16168
|
const p = {
|
|
@@ -16133,7 +16218,7 @@ g(B, "kind", "appliance-multi-plugin"), g(B, "currentManager"), g(B, "logger", {
|
|
|
16133
16218
|
plugin: i,
|
|
16134
16219
|
displayer: t.displayer,
|
|
16135
16220
|
options: e
|
|
16136
|
-
}, n = new
|
|
16221
|
+
}, n = new ae(s);
|
|
16137
16222
|
B.logger.info("[ApplianceMultiPlugin] refresh ApplianceMultiManager object"), n.setWindowManager(t), B.currentManager = n, t.room && t.room.logger.info(`[ApplianceMultiPlugin] use ${ai}`);
|
|
16138
16223
|
});
|
|
16139
16224
|
let ds = B;
|
|
@@ -16142,7 +16227,7 @@ class Dm extends fn {
|
|
|
16142
16227
|
super(t, e);
|
|
16143
16228
|
g(this, "width", 1e3);
|
|
16144
16229
|
g(this, "height", 1e3);
|
|
16145
|
-
g(this, "dpr",
|
|
16230
|
+
g(this, "dpr", re());
|
|
16146
16231
|
g(this, "vDom");
|
|
16147
16232
|
g(this, "viewId", yt);
|
|
16148
16233
|
g(this, "eventTragetElement");
|
|
@@ -16160,7 +16245,8 @@ class Dm extends fn {
|
|
|
16160
16245
|
setCanvassStyle() {
|
|
16161
16246
|
if (this.eventTragetElement) {
|
|
16162
16247
|
const t = this.eventTragetElement.offsetWidth, e = this.eventTragetElement.offsetHeight;
|
|
16163
|
-
|
|
16248
|
+
let i = re();
|
|
16249
|
+
this.canvasBgRef.current && (i = re(this.canvasBgRef.current.getContext("2d"))), i !== this.dpr && (this.dpr = i, this.control.worker.updateDpr(this.viewId, this.dpr)), t && e && this.canvasContainerRef.current && (t !== this.width || e !== this.height) && (this.width = t, this.height = e), t && e && this.canvasBgRef.current && (t !== this.width || e !== this.height) && (this.width = t, this.height = e, this.canvasBgRef.current.width = t * this.dpr, this.canvasBgRef.current.height = e * this.dpr, this.canvasFloatRef.current && (this.canvasFloatRef.current.width = t * this.dpr, this.canvasFloatRef.current.height = e * this.dpr), this.canvasServiceFloatRef.current && (this.canvasServiceFloatRef.current.width = t * this.dpr, this.canvasServiceFloatRef.current.height = e * this.dpr), this.canvasTopRef.current && (this.canvasTopRef.current.width = t * this.dpr, this.canvasTopRef.current.height = e * this.dpr));
|
|
16164
16250
|
}
|
|
16165
16251
|
}
|
|
16166
16252
|
createMainViewDisplayer(t) {
|
|
@@ -16410,37 +16496,37 @@ const W = class W extends gs {
|
|
|
16410
16496
|
const f = t.getBoundingRect(p), y = await ((M = W.currentManager) == null ? void 0 : M.getBoundingRect(p));
|
|
16411
16497
|
return !f.width || !f.height ? y : pi(f, y);
|
|
16412
16498
|
},
|
|
16413
|
-
screenshotToCanvasAsync: async function(p, f, y, M,
|
|
16499
|
+
screenshotToCanvasAsync: async function(p, f, y, M, T, w) {
|
|
16414
16500
|
var L;
|
|
16415
16501
|
W.logger.info("[ApplianceSinglePlugin] screenshotToCanvasAsync");
|
|
16416
|
-
let m = y,
|
|
16417
|
-
m > this.maxScreenshotWidth && (N = this.maxScreenshotWidth / m * N, m = this.maxScreenshotWidth),
|
|
16502
|
+
let m = y, I = M, N = T.scale;
|
|
16503
|
+
m > this.maxScreenshotWidth && (N = this.maxScreenshotWidth / m * N, m = this.maxScreenshotWidth), I > this.maxScreenshotHeight && (N = Math.min(this.maxScreenshotHeight / I * N, N), I = this.maxScreenshotHeight), T.scale = N;
|
|
16418
16504
|
const v = document.createElement("canvas"), x = v.getContext("2d");
|
|
16419
|
-
v.width = m * (w || 1), v.height =
|
|
16505
|
+
v.width = m * (w || 1), v.height = I * (w || 1), x && (t.screenshotToCanvas(x, f, m, I, T, w), p.drawImage(v, Math.floor((y - m) / 2), Math.floor((M - I) / 2), m * (w || 1), I * (w || 1), 0, 0, m, I), v.remove()), W.currentManager && await ((L = W.currentManager) == null ? void 0 : L.screenshotToCanvas(p, f, m, I, T, Math.floor((y - m) / 2), Math.floor((M - I) / 2)));
|
|
16420
16506
|
},
|
|
16421
|
-
scenePreviewAsync: async function(p, f, y, M,
|
|
16422
|
-
W.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"), t.scenePreview(p, f, y, M,
|
|
16507
|
+
scenePreviewAsync: async function(p, f, y, M, T) {
|
|
16508
|
+
W.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"), t.scenePreview(p, f, y, M, T);
|
|
16423
16509
|
const w = document.createElement("img");
|
|
16424
16510
|
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);
|
|
16425
16511
|
},
|
|
16426
|
-
fillSceneSnapshotAsync: async function(p, f, y, M,
|
|
16512
|
+
fillSceneSnapshotAsync: async function(p, f, y, M, T) {
|
|
16427
16513
|
var E, rt;
|
|
16428
|
-
W.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"), f.innerHTML = "", t.fillSceneSnapshot(p, f, y, M,
|
|
16514
|
+
W.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"), f.innerHTML = "", t.fillSceneSnapshot(p, f, y, M, T);
|
|
16429
16515
|
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;
|
|
16430
|
-
let
|
|
16431
|
-
|
|
16516
|
+
let I = await this.getBoundingRectAsync(p);
|
|
16517
|
+
I || (I = {
|
|
16432
16518
|
originX: 0,
|
|
16433
16519
|
originY: 0,
|
|
16434
16520
|
width: w,
|
|
16435
16521
|
height: m
|
|
16436
16522
|
});
|
|
16437
|
-
let N = Math.max(
|
|
16523
|
+
let N = Math.max(I == null ? void 0 : I.width, w), v = Math.max(I == null ? void 0 : I.height, m), x = 1;
|
|
16438
16524
|
const L = N > w && Math.min(w / N, x) || x, A = v > m && Math.min(m / v, x) || x;
|
|
16439
16525
|
L <= A ? (N = L < 1 && w || N, v = Math.floor(v * L) + 1, x = L) : L > A && (v = A < 1 && m || v, N = Math.floor(N * A) + 1, x = A);
|
|
16440
16526
|
const j = {
|
|
16441
16527
|
scale: x,
|
|
16442
|
-
centerX:
|
|
16443
|
-
centerY:
|
|
16528
|
+
centerX: I.originX + I.width / 2,
|
|
16529
|
+
centerY: I.originY + I.height / 2
|
|
16444
16530
|
}, D = document.createElement("canvas"), O = D.getContext("2d");
|
|
16445
16531
|
D.width = N, D.height = v, O && await this.screenshotToCanvasAsync(O, p, N, v, j, devicePixelRatio);
|
|
16446
16532
|
const z = document.createElement("img");
|
|
@@ -16812,7 +16898,7 @@ class Zm extends gw {
|
|
|
16812
16898
|
}
|
|
16813
16899
|
export {
|
|
16814
16900
|
ds as A,
|
|
16815
|
-
|
|
16901
|
+
It as B,
|
|
16816
16902
|
Qm as C,
|
|
16817
16903
|
Ot as D,
|
|
16818
16904
|
P as E,
|
|
@@ -16822,7 +16908,7 @@ export {
|
|
|
16822
16908
|
X as I,
|
|
16823
16909
|
zn as J,
|
|
16824
16910
|
Rt as K,
|
|
16825
|
-
|
|
16911
|
+
oe as L,
|
|
16826
16912
|
yt as M,
|
|
16827
16913
|
Zm as N,
|
|
16828
16914
|
gw as P,
|
|
@@ -16843,7 +16929,7 @@ export {
|
|
|
16843
16929
|
oo as l,
|
|
16844
16930
|
lt as m,
|
|
16845
16931
|
we as n,
|
|
16846
|
-
|
|
16932
|
+
_t as o,
|
|
16847
16933
|
Ve as p,
|
|
16848
16934
|
Lo as q,
|
|
16849
16935
|
Vm as r,
|
|
@@ -16853,6 +16939,6 @@ export {
|
|
|
16853
16939
|
fs as v,
|
|
16854
16940
|
nt as w,
|
|
16855
16941
|
et as x,
|
|
16856
|
-
|
|
16942
|
+
ee as y,
|
|
16857
16943
|
Ln as z
|
|
16858
16944
|
};
|