@anu3ev/fabric-image-editor 0.1.40 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +358 -306
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -19,19 +19,19 @@ var X = (o, e) => {
|
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
21
|
var Q = (o, e, t) => new Promise((a, r) => {
|
|
22
|
-
var
|
|
22
|
+
var n = (c) => {
|
|
23
23
|
try {
|
|
24
24
|
s(t.next(c));
|
|
25
25
|
} catch (u) {
|
|
26
26
|
r(u);
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, i = (c) => {
|
|
29
29
|
try {
|
|
30
30
|
s(t.throw(c));
|
|
31
31
|
} catch (u) {
|
|
32
32
|
r(u);
|
|
33
33
|
}
|
|
34
|
-
}, s = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(
|
|
34
|
+
}, s = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(n, i);
|
|
35
35
|
s((t = t.apply(o, e)).next());
|
|
36
36
|
});
|
|
37
37
|
import { ActiveSelection as H, util as P, controlsUtils as Ee, InteractiveFabricObject as Oe, loadSVGFromURL as Te, FabricImage as q, Point as ke, Rect as xe, Circle as Be, Triangle as Ze, Group as ze, Canvas as Ue, Pattern as Ye } from "fabric";
|
|
@@ -69,14 +69,14 @@ class R {
|
|
|
69
69
|
canvasDragging: t,
|
|
70
70
|
mouseWheelZooming: a,
|
|
71
71
|
bringToFrontOnSelection: r,
|
|
72
|
-
copyObjectsByHotkey:
|
|
73
|
-
pasteImageFromClipboard:
|
|
72
|
+
copyObjectsByHotkey: n,
|
|
73
|
+
pasteImageFromClipboard: i,
|
|
74
74
|
undoRedoByHotKeys: s,
|
|
75
75
|
selectAllByHotkey: c,
|
|
76
76
|
deleteObjectsByHotkey: u,
|
|
77
77
|
resetObjectFitByDoubleClick: d
|
|
78
78
|
} = this.options;
|
|
79
|
-
t && (this.canvas.on("mouse:down", this.handleCanvasDragStartBound), this.canvas.on("mouse:move", this.handleCanvasDraggingBound), this.canvas.on("mouse:up", this.handleCanvasDragEndBound), document.addEventListener("keydown", this.handleSpaceKeyDownBound, { capture: !0 }), document.addEventListener("keyup", this.handleSpaceKeyUpBound, { capture: !0 })), a && this.canvas.on("mouse:wheel", this.handleMouseWheelZoomBound), r && (this.canvas.on("selection:created", this.handleBringToFrontBound), this.canvas.on("selection:updated", this.handleBringToFrontBound)), d && this.canvas.on("mouse:dblclick", this.handleResetObjectFitBound), e && window.addEventListener("resize", this.handleContainerResizeBound, { capture: !0 }),
|
|
79
|
+
t && (this.canvas.on("mouse:down", this.handleCanvasDragStartBound), this.canvas.on("mouse:move", this.handleCanvasDraggingBound), this.canvas.on("mouse:up", this.handleCanvasDragEndBound), document.addEventListener("keydown", this.handleSpaceKeyDownBound, { capture: !0 }), document.addEventListener("keyup", this.handleSpaceKeyUpBound, { capture: !0 })), a && this.canvas.on("mouse:wheel", this.handleMouseWheelZoomBound), r && (this.canvas.on("selection:created", this.handleBringToFrontBound), this.canvas.on("selection:updated", this.handleBringToFrontBound)), d && this.canvas.on("mouse:dblclick", this.handleResetObjectFitBound), e && window.addEventListener("resize", this.handleContainerResizeBound, { capture: !0 }), n && document.addEventListener("keydown", this.handleCopyEventBound, { capture: !0 }), i && document.addEventListener("paste", this.handlePasteEventBound, { capture: !0 }), s && (document.addEventListener("keydown", this.handleUndoRedoEventBound, { capture: !0 }), document.addEventListener("keyup", this.handleUndoRedoKeyUpBound, { capture: !0 })), c && document.addEventListener("keydown", this.handleSelectAllEventBound, { capture: !0 }), u && document.addEventListener("keydown", this.handleDeleteObjectsEventBound, { capture: !0 }), this.canvas.on("object:modified", this.handleObjectModifiedHistoryBound), this.canvas.on("object:rotating", this.handleObjectRotatingHistoryBound), this.canvas.on("object:added", this.handleObjectAddedHistoryBound), this.canvas.on("object:removed", this.handleObjectRemovedHistoryBound), this.canvas.on("object:added", this.handleOverlayUpdateBound), this.canvas.on("selection:created", this.handleOverlayUpdateBound), this.canvas.on("selection:created", this.handleLockedSelectionBound), this.canvas.on("selection:updated", this.handleLockedSelectionBound);
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* При массовом выделении объектов удаляем из него залоченные.
|
|
@@ -85,8 +85,8 @@ class R {
|
|
|
85
85
|
* @param {TPointerEvent} [params.e] - событие указателя (опционально)
|
|
86
86
|
*/
|
|
87
87
|
_filterLockedSelection({ selected: e, e: t }) {
|
|
88
|
-
if (!(e != null && e.length) || !(t instanceof MouseEvent) || e.length === 1 || !e.some((
|
|
89
|
-
const r = e.filter((
|
|
88
|
+
if (!(e != null && e.length) || !(t instanceof MouseEvent) || e.length === 1 || !e.some((i) => i.locked)) return;
|
|
89
|
+
const r = e.filter((i) => !i.locked);
|
|
90
90
|
if (r.length === 0) {
|
|
91
91
|
this.canvas.discardActiveObject();
|
|
92
92
|
return;
|
|
@@ -95,10 +95,10 @@ class R {
|
|
|
95
95
|
this.canvas.setActiveObject(r[0]);
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const n = new H(r, {
|
|
99
99
|
canvas: this.canvas
|
|
100
100
|
});
|
|
101
|
-
this.canvas.setActiveObject(
|
|
101
|
+
this.canvas.setActiveObject(n), this.canvas.requestRenderAll();
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Обработчики для сохранения состояния редактора в истории.
|
|
@@ -158,8 +158,8 @@ class R {
|
|
|
158
158
|
*/
|
|
159
159
|
handleUndoRedoEvent(e) {
|
|
160
160
|
return Q(this, null, function* () {
|
|
161
|
-
const { ctrlKey: t, metaKey: a, code: r, repeat:
|
|
162
|
-
!t && !a ||
|
|
161
|
+
const { ctrlKey: t, metaKey: a, code: r, repeat: n } = e;
|
|
162
|
+
!t && !a || n || !/Mac/i.test(navigator.userAgent) && this.isUndoRedoKeyPressed || (r === "KeyZ" ? (e.preventDefault(), this.isUndoRedoKeyPressed = !0, yield this.editor.historyManager.undo()) : r === "KeyY" && (e.preventDefault(), this.isUndoRedoKeyPressed = !0, yield this.editor.historyManager.redo()));
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
@@ -197,12 +197,12 @@ class R {
|
|
|
197
197
|
*/
|
|
198
198
|
handleSpaceKeyDown(e) {
|
|
199
199
|
if (e.code !== "Space") return;
|
|
200
|
-
const { canvas: t, editor: a, isSpacePressed: r, isDragging:
|
|
201
|
-
r ||
|
|
200
|
+
const { canvas: t, editor: a, isSpacePressed: r, isDragging: n } = this;
|
|
201
|
+
r || n || (this.isSpacePressed = !0, e.preventDefault(), t.set({
|
|
202
202
|
selection: !1,
|
|
203
203
|
defaultCursor: "grab"
|
|
204
|
-
}), t.setCursor("grab"), a.canvasManager.getObjects().forEach((
|
|
205
|
-
|
|
204
|
+
}), t.setCursor("grab"), a.canvasManager.getObjects().forEach((i) => {
|
|
205
|
+
i.set({
|
|
206
206
|
selectable: !1,
|
|
207
207
|
evented: !1
|
|
208
208
|
});
|
|
@@ -297,9 +297,9 @@ class R {
|
|
|
297
297
|
static debounce(e, t) {
|
|
298
298
|
let a = null;
|
|
299
299
|
return function(...r) {
|
|
300
|
-
const
|
|
300
|
+
const n = this;
|
|
301
301
|
a && clearTimeout(a), a = setTimeout(() => {
|
|
302
|
-
e.apply(
|
|
302
|
+
e.apply(n, r);
|
|
303
303
|
}, t);
|
|
304
304
|
};
|
|
305
305
|
}
|
|
@@ -349,10 +349,10 @@ class Pe {
|
|
|
349
349
|
} = e, {
|
|
350
350
|
requestId: a,
|
|
351
351
|
success: r,
|
|
352
|
-
data:
|
|
353
|
-
error:
|
|
352
|
+
data: n,
|
|
353
|
+
error: i
|
|
354
354
|
} = t, s = this._callbacks.get(a);
|
|
355
|
-
s && (r ? s.resolve(
|
|
355
|
+
s && (r ? s.resolve(n) : s.reject(new Error(i)), this._callbacks.delete(a));
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
358
|
* Универсальный метод отправки команды в воркер
|
|
@@ -363,10 +363,10 @@ class Pe {
|
|
|
363
363
|
*/
|
|
364
364
|
post(e, t) {
|
|
365
365
|
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], r = "".concat(e, ":").concat(A(8));
|
|
366
|
-
return new Promise((
|
|
366
|
+
return new Promise((n, i) => {
|
|
367
367
|
this._callbacks.set(r, {
|
|
368
|
-
resolve:
|
|
369
|
-
reject:
|
|
368
|
+
resolve: n,
|
|
369
|
+
reject: i
|
|
370
370
|
}), this.worker.postMessage({
|
|
371
371
|
action: e,
|
|
372
372
|
payload: t,
|
|
@@ -381,24 +381,24 @@ class Pe {
|
|
|
381
381
|
this.worker.terminate();
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
var I = 12, We = 2, te = 8, ae = 20, Fe = 100, re = 20,
|
|
384
|
+
var I = 12, We = 2, te = 8, ae = 20, Fe = 100, re = 20, ne = 8, Ve = 100, ie = 32, se = 1, Ge = "#2B2D33", oe = "#3D8BF4", ce = "#FFFFFF";
|
|
385
385
|
function J(o, e, t, a, r) {
|
|
386
|
-
var
|
|
387
|
-
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-12 / 2, -12 / 2,
|
|
386
|
+
var n = I, i = We;
|
|
387
|
+
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-12 / 2, -12 / 2, n, n, i), o.fill(), o.stroke(), o.restore();
|
|
388
388
|
}
|
|
389
389
|
function je(o, e, t, a, r) {
|
|
390
|
-
var
|
|
391
|
-
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-8 / 2, -20 / 2,
|
|
390
|
+
var n = te, i = ae, s = Fe;
|
|
391
|
+
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-8 / 2, -20 / 2, n, i, s), o.fill(), o.stroke(), o.restore();
|
|
392
392
|
}
|
|
393
393
|
function ye(o, e, t, a, r) {
|
|
394
|
-
var
|
|
395
|
-
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-20 / 2, -8 / 2,
|
|
394
|
+
var n = re, i = ne, s = Ve;
|
|
395
|
+
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-20 / 2, -8 / 2, n, i, s), o.fill(), o.stroke(), o.restore();
|
|
396
396
|
}
|
|
397
397
|
var Xe = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", Se = new Image();
|
|
398
398
|
Se.src = Xe;
|
|
399
399
|
function Qe(o, e, t, a, r) {
|
|
400
|
-
var
|
|
401
|
-
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = Ge, o.beginPath(), o.arc(0, 0,
|
|
400
|
+
var n = ie, i = n / 2;
|
|
401
|
+
o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = Ge, o.beginPath(), o.arc(0, 0, i, 0, 2 * Math.PI), o.fill(), o.drawImage(Se, -16 / 2, -16 / 2, i, i), o.restore();
|
|
402
402
|
}
|
|
403
403
|
var Je = {
|
|
404
404
|
// Угловые точки
|
|
@@ -449,22 +449,22 @@ var Je = {
|
|
|
449
449
|
mt: {
|
|
450
450
|
render: ye,
|
|
451
451
|
sizeX: re,
|
|
452
|
-
sizeY:
|
|
452
|
+
sizeY: ne,
|
|
453
453
|
offsetX: 0,
|
|
454
454
|
offsetY: 0
|
|
455
455
|
},
|
|
456
456
|
mb: {
|
|
457
457
|
render: ye,
|
|
458
458
|
sizeX: re,
|
|
459
|
-
sizeY:
|
|
459
|
+
sizeY: ne,
|
|
460
460
|
offsetX: 0,
|
|
461
461
|
offsetY: 0
|
|
462
462
|
},
|
|
463
463
|
// Специальный «rotate» контрол
|
|
464
464
|
mtr: {
|
|
465
465
|
render: Qe,
|
|
466
|
-
sizeX:
|
|
467
|
-
sizeY:
|
|
466
|
+
sizeX: ie,
|
|
467
|
+
sizeY: ie,
|
|
468
468
|
offsetX: 0,
|
|
469
469
|
offsetY: -32
|
|
470
470
|
}
|
|
@@ -480,17 +480,17 @@ class Ke {
|
|
|
480
480
|
sizeY: r.sizeY,
|
|
481
481
|
offsetX: r.offsetX,
|
|
482
482
|
offsetY: r.offsetY
|
|
483
|
-
}), a === "mtr" && (e[a].cursorStyle = "grab", e[a].mouseDownHandler = (
|
|
484
|
-
var u =
|
|
483
|
+
}), a === "mtr" && (e[a].cursorStyle = "grab", e[a].mouseDownHandler = (n, i, s, c) => {
|
|
484
|
+
var u = i.target;
|
|
485
485
|
u.canvas.setCursor("grabbing");
|
|
486
486
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zVabTQuMzc1IDIuNXYtLjYyNWEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2LjYyNWg1Wk01IDE2LjI1VjVoMTB2MTEuMjVINVpNOC4xMjUgNy41Yy4zNDUgMCAuNjI1LjI4LjYyNS42MjV2NWEuNjI1LjYyNSAwIDEgMS0xLjI1IDB2LTVjMC0uMzQ1LjI4LS42MjUuNjI1LS42MjVabTQuMzc1IDUuNjI1di01YS42MjUuNjI1IDAgMCAwLTEuMjUgMHY1YS42MjUuNjI1IDAgMSAwIDEuMjUgMFoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==";
|
|
491
|
+
function pe(o, e, t, a, r, n, i) {
|
|
492
492
|
try {
|
|
493
|
-
var s = o[
|
|
493
|
+
var s = o[n](i), c = s.value;
|
|
494
494
|
} catch (u) {
|
|
495
495
|
return void t(u);
|
|
496
496
|
}
|
|
@@ -500,14 +500,14 @@ function st(o) {
|
|
|
500
500
|
return function() {
|
|
501
501
|
var e = this, t = arguments;
|
|
502
502
|
return new Promise(function(a, r) {
|
|
503
|
-
var
|
|
504
|
-
function
|
|
505
|
-
pe(
|
|
503
|
+
var n = o.apply(e, t);
|
|
504
|
+
function i(c) {
|
|
505
|
+
pe(n, a, r, i, s, "next", c);
|
|
506
506
|
}
|
|
507
507
|
function s(c) {
|
|
508
|
-
pe(
|
|
508
|
+
pe(n, a, r, i, s, "throw", c);
|
|
509
509
|
}
|
|
510
|
-
|
|
510
|
+
i(void 0);
|
|
511
511
|
});
|
|
512
512
|
};
|
|
513
513
|
}
|
|
@@ -571,11 +571,11 @@ const _ = {
|
|
|
571
571
|
offsetTop: 50,
|
|
572
572
|
icons: {
|
|
573
573
|
copyPaste: $e,
|
|
574
|
-
delete:
|
|
574
|
+
delete: it,
|
|
575
575
|
lock: qe,
|
|
576
576
|
unlock: et,
|
|
577
577
|
bringToFront: rt,
|
|
578
|
-
sendToBack:
|
|
578
|
+
sendToBack: nt,
|
|
579
579
|
bringForward: tt,
|
|
580
580
|
sendBackwards: at
|
|
581
581
|
},
|
|
@@ -700,14 +700,14 @@ class dt {
|
|
|
700
700
|
this.el.innerHTML = "";
|
|
701
701
|
var a = function() {
|
|
702
702
|
var {
|
|
703
|
-
name:
|
|
703
|
+
name: i,
|
|
704
704
|
handle: s
|
|
705
705
|
} = r, {
|
|
706
706
|
icons: c,
|
|
707
707
|
btnStyle: u,
|
|
708
708
|
handlers: d
|
|
709
709
|
} = t.config, l = document.createElement("button");
|
|
710
|
-
l.innerHTML = c[s] ? '<img src="'.concat(c[s], '" title="').concat(
|
|
710
|
+
l.innerHTML = c[s] ? '<img src="'.concat(c[s], '" title="').concat(i, '" />') : i, Object.assign(l.style, u), l.onclick = () => {
|
|
711
711
|
var h;
|
|
712
712
|
return (h = d[s]) === null || h === void 0 ? void 0 : h.call(d, t.editor);
|
|
713
713
|
}, t.el.appendChild(l);
|
|
@@ -782,12 +782,12 @@ class dt {
|
|
|
782
782
|
canvas: r
|
|
783
783
|
} = this;
|
|
784
784
|
e.setCoords();
|
|
785
|
-
var
|
|
785
|
+
var n = r.getZoom(), [, , , , i, s] = r.viewportTransform, {
|
|
786
786
|
x: c
|
|
787
787
|
} = e.getCenterPoint(), {
|
|
788
788
|
top: u,
|
|
789
789
|
height: d
|
|
790
|
-
} = e.getBoundingRect(!1, !0), l = c *
|
|
790
|
+
} = e.getBoundingRect(!1, !0), l = c * n + i, h = l - t.offsetWidth / 2, g = (u + d) * n + s + a.offsetTop;
|
|
791
791
|
Object.assign(t.style, {
|
|
792
792
|
left: "".concat(h, "px"),
|
|
793
793
|
top: "".concat(g, "px"),
|
|
@@ -802,9 +802,9 @@ class dt {
|
|
|
802
802
|
this.el.removeEventListener("mouseover", this._onBtnOver), this.el.removeEventListener("mouseout", this._onBtnOut), this.canvas.off("mouse:down", this._onMouseDown), this.canvas.off("object:moving", this._onObjectMoving), this.canvas.off("object:scaling", this._onObjectScaling), this.canvas.off("object:rotating", this._onObjectRotating), this.canvas.off("mouse:up", this._onMouseUp), this.canvas.off("object:modified", this._onObjectModified), this.canvas.off("selection:created", this._onSelectionChange), this.canvas.off("selection:updated", this._onSelectionChange), this.canvas.off("selection:changed", this._onSelectionChange), this.canvas.off("after:render", this._onSelectionChange), this.canvas.off("selection:cleared", this._onSelectionClear), this.el.remove();
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
function Ie(o, e, t, a, r,
|
|
805
|
+
function Ie(o, e, t, a, r, n, i) {
|
|
806
806
|
try {
|
|
807
|
-
var s = o[
|
|
807
|
+
var s = o[n](i), c = s.value;
|
|
808
808
|
} catch (u) {
|
|
809
809
|
return void t(u);
|
|
810
810
|
}
|
|
@@ -814,14 +814,14 @@ function ee(o) {
|
|
|
814
814
|
return function() {
|
|
815
815
|
var e = this, t = arguments;
|
|
816
816
|
return new Promise(function(a, r) {
|
|
817
|
-
var
|
|
818
|
-
function
|
|
819
|
-
Ie(
|
|
817
|
+
var n = o.apply(e, t);
|
|
818
|
+
function i(c) {
|
|
819
|
+
Ie(n, a, r, i, s, "next", c);
|
|
820
820
|
}
|
|
821
821
|
function s(c) {
|
|
822
|
-
Ie(
|
|
822
|
+
Ie(n, a, r, i, s, "throw", c);
|
|
823
823
|
}
|
|
824
|
-
|
|
824
|
+
i(void 0);
|
|
825
825
|
});
|
|
826
826
|
};
|
|
827
827
|
}
|
|
@@ -887,8 +887,8 @@ class lt {
|
|
|
887
887
|
baseState: e,
|
|
888
888
|
currentIndex: t,
|
|
889
889
|
patches: a
|
|
890
|
-
} = this, r = JSON.parse(JSON.stringify(e)),
|
|
891
|
-
r = this.diffPatcher.patch(r, a[
|
|
890
|
+
} = this, r = JSON.parse(JSON.stringify(e)), n = 0; n < t; n += 1)
|
|
891
|
+
r = this.diffPatcher.patch(r, a[n].diff);
|
|
892
892
|
return console.log("getFullState state", r), r;
|
|
893
893
|
}
|
|
894
894
|
/**
|
|
@@ -926,16 +926,16 @@ class lt {
|
|
|
926
926
|
var {
|
|
927
927
|
canvas: a,
|
|
928
928
|
canvasManager: r,
|
|
929
|
-
interactionBlocker:
|
|
929
|
+
interactionBlocker: n
|
|
930
930
|
} = t.editor, {
|
|
931
|
-
width:
|
|
931
|
+
width: i,
|
|
932
932
|
height: s
|
|
933
933
|
} = a;
|
|
934
934
|
yield a.loadFromJSON(e);
|
|
935
935
|
var c = a.getObjects().find((d) => d.id === "montage-area");
|
|
936
|
-
c && (t.editor.montageArea = c, (
|
|
936
|
+
c && (t.editor.montageArea = c, (i !== e.width || s !== e.height) && r.updateCanvasAndFitObjects());
|
|
937
937
|
var u = a.getObjects().find((d) => d.id === "overlay-mask");
|
|
938
|
-
u && (
|
|
938
|
+
u && (n.overlayMask = u, n.overlayMask.visible = !1), a.renderAll(), a.fire("editor:history-state-loaded", {
|
|
939
939
|
fullState: e,
|
|
940
940
|
currentIndex: t.currentIndex,
|
|
941
941
|
totalChangesCount: t.totalChangesCount,
|
|
@@ -962,7 +962,14 @@ class lt {
|
|
|
962
962
|
try {
|
|
963
963
|
e.currentIndex -= 1, e.totalChangesCount -= 1;
|
|
964
964
|
var t = e.getFullState();
|
|
965
|
-
yield e.loadStateFromFullState(t), console.log("Undo выполнен. Текущий индекс истории:", e.currentIndex), e.canvas.fire("editor:undo"
|
|
965
|
+
yield e.loadStateFromFullState(t), console.log("Undo выполнен. Текущий индекс истории:", e.currentIndex), e.canvas.fire("editor:undo", {
|
|
966
|
+
fullState: t,
|
|
967
|
+
currentIndex: e.currentIndex,
|
|
968
|
+
totalChangesCount: e.totalChangesCount,
|
|
969
|
+
baseStateChangesCount: e.baseStateChangesCount,
|
|
970
|
+
patchesCount: e.patches.length,
|
|
971
|
+
patches: e.patches
|
|
972
|
+
});
|
|
966
973
|
} catch (a) {
|
|
967
974
|
console.error("undo. Ошибка отмены действия: ", a), e.canvas.fire("editor:error", {
|
|
968
975
|
message: "Ошибка отмены действия: ".concat(a.message)
|
|
@@ -989,7 +996,14 @@ class lt {
|
|
|
989
996
|
try {
|
|
990
997
|
e.currentIndex += 1, e.totalChangesCount += 1;
|
|
991
998
|
var t = e.getFullState();
|
|
992
|
-
console.log("fullState", t), yield e.loadStateFromFullState(t), console.log("Redo выполнен. Текущий индекс истории:", e.currentIndex), e.canvas.fire("editor:redo"
|
|
999
|
+
console.log("fullState", t), yield e.loadStateFromFullState(t), console.log("Redo выполнен. Текущий индекс истории:", e.currentIndex), e.canvas.fire("editor:redo", {
|
|
1000
|
+
fullState: t,
|
|
1001
|
+
currentIndex: e.currentIndex,
|
|
1002
|
+
totalChangesCount: e.totalChangesCount,
|
|
1003
|
+
baseStateChangesCount: e.baseStateChangesCount,
|
|
1004
|
+
patchesCount: e.patches.length,
|
|
1005
|
+
patches: e.patches
|
|
1006
|
+
});
|
|
993
1007
|
} catch (a) {
|
|
994
1008
|
console.error("redo. Ошибка повтора действия: ", a), e.canvas.fire("editor:error", {
|
|
995
1009
|
message: "Ошибка повтора действия: ".concat(a.message)
|
|
@@ -1002,9 +1016,9 @@ class lt {
|
|
|
1002
1016
|
}
|
|
1003
1017
|
}
|
|
1004
1018
|
const ht = 0.1, gt = 2, vt = 0.1, mt = 90, k = 16, x = 16, E = 4096, O = 4096;
|
|
1005
|
-
function Ae(o, e, t, a, r,
|
|
1019
|
+
function Ae(o, e, t, a, r, n, i) {
|
|
1006
1020
|
try {
|
|
1007
|
-
var s = o[
|
|
1021
|
+
var s = o[n](i), c = s.value;
|
|
1008
1022
|
} catch (u) {
|
|
1009
1023
|
return void t(u);
|
|
1010
1024
|
}
|
|
@@ -1014,14 +1028,14 @@ function T(o) {
|
|
|
1014
1028
|
return function() {
|
|
1015
1029
|
var e = this, t = arguments;
|
|
1016
1030
|
return new Promise(function(a, r) {
|
|
1017
|
-
var
|
|
1018
|
-
function
|
|
1019
|
-
Ae(
|
|
1031
|
+
var n = o.apply(e, t);
|
|
1032
|
+
function i(c) {
|
|
1033
|
+
Ae(n, a, r, i, s, "next", c);
|
|
1020
1034
|
}
|
|
1021
1035
|
function s(c) {
|
|
1022
|
-
Ae(
|
|
1036
|
+
Ae(n, a, r, i, s, "throw", c);
|
|
1023
1037
|
}
|
|
1024
|
-
|
|
1038
|
+
i(void 0);
|
|
1025
1039
|
});
|
|
1026
1040
|
};
|
|
1027
1041
|
}
|
|
@@ -1054,11 +1068,11 @@ class D {
|
|
|
1054
1068
|
var {
|
|
1055
1069
|
source: a,
|
|
1056
1070
|
scale: r = "image-".concat(t.options.scaleType),
|
|
1057
|
-
withoutSave:
|
|
1071
|
+
withoutSave: n = !1
|
|
1058
1072
|
} = e;
|
|
1059
1073
|
if (!a) return null;
|
|
1060
1074
|
var {
|
|
1061
|
-
canvas:
|
|
1075
|
+
canvas: i,
|
|
1062
1076
|
montageArea: s,
|
|
1063
1077
|
transformManager: c,
|
|
1064
1078
|
historyManager: u,
|
|
@@ -1155,16 +1169,16 @@ class D {
|
|
|
1155
1169
|
withoutSave: !0
|
|
1156
1170
|
});
|
|
1157
1171
|
}
|
|
1158
|
-
|
|
1172
|
+
i.add(v), i.centerObject(v), i.setActiveObject(v), i.renderAll(), u.resumeHistory(), n || u.saveState();
|
|
1159
1173
|
var V = {
|
|
1160
1174
|
image: v,
|
|
1161
1175
|
format: h,
|
|
1162
1176
|
contentType: l,
|
|
1163
1177
|
scale: r,
|
|
1164
|
-
withoutSave:
|
|
1178
|
+
withoutSave: n,
|
|
1165
1179
|
source: a
|
|
1166
1180
|
};
|
|
1167
|
-
return
|
|
1181
|
+
return i.fire("editor:image-imported", V), V;
|
|
1168
1182
|
} catch (Y) {
|
|
1169
1183
|
return d.emitError({
|
|
1170
1184
|
origin: "ImageManager",
|
|
@@ -1176,7 +1190,7 @@ class D {
|
|
|
1176
1190
|
format: h,
|
|
1177
1191
|
contentType: l,
|
|
1178
1192
|
scale: r,
|
|
1179
|
-
withoutSave:
|
|
1193
|
+
withoutSave: n
|
|
1180
1194
|
}
|
|
1181
1195
|
}), u.resumeHistory(), null;
|
|
1182
1196
|
}
|
|
@@ -1193,9 +1207,9 @@ class D {
|
|
|
1193
1207
|
resizeImageToBoundaries(e) {
|
|
1194
1208
|
var t = arguments, a = this;
|
|
1195
1209
|
return T(function* () {
|
|
1196
|
-
var r = t.length > 1 && t[1] !== void 0 ? t[1] : "max",
|
|
1197
|
-
r === "min" && (
|
|
1198
|
-
var
|
|
1210
|
+
var r = t.length > 1 && t[1] !== void 0 ? t[1] : "max", n = "Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ".concat(E, "x").concat(O);
|
|
1211
|
+
r === "min" && (n = "Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ".concat(k, "x").concat(x));
|
|
1212
|
+
var i = {
|
|
1199
1213
|
dataURL: e,
|
|
1200
1214
|
sizeType: r,
|
|
1201
1215
|
maxWidth: E,
|
|
@@ -1207,9 +1221,9 @@ class D {
|
|
|
1207
1221
|
origin: "ImageManager",
|
|
1208
1222
|
method: "resizeImageToBoundaries",
|
|
1209
1223
|
code: "IMAGE_RESIZE_WARNING",
|
|
1210
|
-
message:
|
|
1211
|
-
data:
|
|
1212
|
-
}), a.editor.workerManager.post("resizeImage",
|
|
1224
|
+
message: n,
|
|
1225
|
+
data: i
|
|
1226
|
+
}), a.editor.workerManager.post("resizeImage", i);
|
|
1213
1227
|
})();
|
|
1214
1228
|
}
|
|
1215
1229
|
/**
|
|
@@ -1229,8 +1243,8 @@ class D {
|
|
|
1229
1243
|
var {
|
|
1230
1244
|
fileName: a = "image.png",
|
|
1231
1245
|
contentType: r = "image/png",
|
|
1232
|
-
exportAsBase64:
|
|
1233
|
-
exportAsBlob:
|
|
1246
|
+
exportAsBase64: n = !1,
|
|
1247
|
+
exportAsBlob: i = !1
|
|
1234
1248
|
} = e.length > 0 && e[0] !== void 0 ? e[0] : {}, {
|
|
1235
1249
|
canvas: s,
|
|
1236
1250
|
montageArea: c,
|
|
@@ -1258,8 +1272,8 @@ class D {
|
|
|
1258
1272
|
var w = v.toSVG();
|
|
1259
1273
|
v.dispose();
|
|
1260
1274
|
var L = D._exportSVGStringAsFile(w, {
|
|
1261
|
-
exportAsBase64:
|
|
1262
|
-
exportAsBlob:
|
|
1275
|
+
exportAsBase64: n,
|
|
1276
|
+
exportAsBlob: i,
|
|
1263
1277
|
fileName: a
|
|
1264
1278
|
}), y = {
|
|
1265
1279
|
image: L,
|
|
@@ -1272,7 +1286,7 @@ class D {
|
|
|
1272
1286
|
var p = yield new Promise((b) => {
|
|
1273
1287
|
v.getElement().toBlob(b);
|
|
1274
1288
|
});
|
|
1275
|
-
if (v.dispose(),
|
|
1289
|
+
if (v.dispose(), i) {
|
|
1276
1290
|
var B = {
|
|
1277
1291
|
image: p,
|
|
1278
1292
|
format: h,
|
|
@@ -1292,7 +1306,7 @@ class D {
|
|
|
1292
1306
|
unit: "mm",
|
|
1293
1307
|
format: [z, U]
|
|
1294
1308
|
});
|
|
1295
|
-
if (Y.addImage(Z, "JPG", 0, 0, z, U),
|
|
1309
|
+
if (Y.addImage(Z, "JPG", 0, 0, z, U), n) {
|
|
1296
1310
|
var Ce = Y.output("datauristring"), de = {
|
|
1297
1311
|
image: Ce,
|
|
1298
1312
|
format: "pdf",
|
|
@@ -1311,7 +1325,7 @@ class D {
|
|
|
1311
1325
|
};
|
|
1312
1326
|
return s.fire("editor:canvas-exported", le), le;
|
|
1313
1327
|
}
|
|
1314
|
-
if (
|
|
1328
|
+
if (n) {
|
|
1315
1329
|
var he = {
|
|
1316
1330
|
image: Z,
|
|
1317
1331
|
format: h,
|
|
@@ -1338,8 +1352,8 @@ class D {
|
|
|
1338
1352
|
data: {
|
|
1339
1353
|
contentType: r,
|
|
1340
1354
|
fileName: a,
|
|
1341
|
-
exportAsBase64:
|
|
1342
|
-
exportAsBlob:
|
|
1355
|
+
exportAsBase64: n,
|
|
1356
|
+
exportAsBlob: i
|
|
1343
1357
|
}
|
|
1344
1358
|
}), "";
|
|
1345
1359
|
}
|
|
@@ -1362,8 +1376,8 @@ class D {
|
|
|
1362
1376
|
var {
|
|
1363
1377
|
object: a,
|
|
1364
1378
|
fileName: r = "image.png",
|
|
1365
|
-
contentType:
|
|
1366
|
-
exportAsBase64:
|
|
1379
|
+
contentType: n = "image/png",
|
|
1380
|
+
exportAsBase64: i = !1,
|
|
1367
1381
|
exportAsBlob: s = !1
|
|
1368
1382
|
} = e.length > 0 && e[0] !== void 0 ? e[0] : {}, {
|
|
1369
1383
|
canvas: c,
|
|
@@ -1376,17 +1390,17 @@ class D {
|
|
|
1376
1390
|
code: "NO_OBJECT_SELECTED",
|
|
1377
1391
|
message: "Не выбран объект для экспорта",
|
|
1378
1392
|
data: {
|
|
1379
|
-
contentType:
|
|
1393
|
+
contentType: n,
|
|
1380
1394
|
fileName: r,
|
|
1381
|
-
exportAsBase64:
|
|
1395
|
+
exportAsBase64: i,
|
|
1382
1396
|
exportAsBlob: s
|
|
1383
1397
|
}
|
|
1384
1398
|
}), "";
|
|
1385
1399
|
try {
|
|
1386
|
-
var l = D.getFormatFromContentType(
|
|
1400
|
+
var l = D.getFormatFromContentType(n);
|
|
1387
1401
|
if (l === "svg") {
|
|
1388
1402
|
var h = d.toSVG(), g = t._exportSVGStringAsFile(h, {
|
|
1389
|
-
exportAsBase64:
|
|
1403
|
+
exportAsBase64: i,
|
|
1390
1404
|
exportAsBlob: s,
|
|
1391
1405
|
fileName: r
|
|
1392
1406
|
}), M = {
|
|
@@ -1397,7 +1411,7 @@ class D {
|
|
|
1397
1411
|
};
|
|
1398
1412
|
return c.fire("editor:object-exported", M), M;
|
|
1399
1413
|
}
|
|
1400
|
-
if (
|
|
1414
|
+
if (i) {
|
|
1401
1415
|
var m = yield createImageBitmap(d._element), f = yield u.post("toDataURL", {
|
|
1402
1416
|
format: l,
|
|
1403
1417
|
quality: 1,
|
|
@@ -1405,7 +1419,7 @@ class D {
|
|
|
1405
1419
|
}, [m]), v = {
|
|
1406
1420
|
image: f,
|
|
1407
1421
|
format: l,
|
|
1408
|
-
contentType:
|
|
1422
|
+
contentType: n,
|
|
1409
1423
|
fileName: r
|
|
1410
1424
|
};
|
|
1411
1425
|
return c.fire("editor:object-exported", v), v;
|
|
@@ -1417,17 +1431,17 @@ class D {
|
|
|
1417
1431
|
var w = {
|
|
1418
1432
|
image: N,
|
|
1419
1433
|
format: l,
|
|
1420
|
-
contentType:
|
|
1434
|
+
contentType: n,
|
|
1421
1435
|
fileName: r
|
|
1422
1436
|
};
|
|
1423
1437
|
return c.fire("editor:object-exported", w), w;
|
|
1424
1438
|
}
|
|
1425
1439
|
var L = new File([N], r, {
|
|
1426
|
-
type:
|
|
1440
|
+
type: n
|
|
1427
1441
|
}), y = {
|
|
1428
1442
|
image: L,
|
|
1429
1443
|
format: l,
|
|
1430
|
-
contentType:
|
|
1444
|
+
contentType: n,
|
|
1431
1445
|
fileName: r
|
|
1432
1446
|
};
|
|
1433
1447
|
return c.fire("editor:object-exported", y), y;
|
|
@@ -1438,9 +1452,9 @@ class D {
|
|
|
1438
1452
|
code: "IMAGE_EXPORT_FAILED",
|
|
1439
1453
|
message: "Ошибка экспорта объекта: ".concat(p.message),
|
|
1440
1454
|
data: {
|
|
1441
|
-
contentType:
|
|
1455
|
+
contentType: n,
|
|
1442
1456
|
fileName: r,
|
|
1443
|
-
exportAsBase64:
|
|
1457
|
+
exportAsBase64: i,
|
|
1444
1458
|
exportAsBlob: s
|
|
1445
1459
|
}
|
|
1446
1460
|
}), "";
|
|
@@ -1532,11 +1546,11 @@ class D {
|
|
|
1532
1546
|
try {
|
|
1533
1547
|
var r = yield fetch(e, {
|
|
1534
1548
|
method: "HEAD"
|
|
1535
|
-
}),
|
|
1536
|
-
if (
|
|
1537
|
-
return
|
|
1538
|
-
} catch (
|
|
1539
|
-
console.warn("HEAD запрос неудачен, определяем тип по расширению:",
|
|
1549
|
+
}), n = r.headers.get("content-type");
|
|
1550
|
+
if (n && n.startsWith("image/"))
|
|
1551
|
+
return n.split(";")[0];
|
|
1552
|
+
} catch (i) {
|
|
1553
|
+
console.warn("HEAD запрос неудачен, определяем тип по расширению:", i);
|
|
1540
1554
|
}
|
|
1541
1555
|
return t.getContentTypeFromExtension(e);
|
|
1542
1556
|
})();
|
|
@@ -1549,13 +1563,13 @@ class D {
|
|
|
1549
1563
|
*/
|
|
1550
1564
|
getContentTypeFromExtension(e) {
|
|
1551
1565
|
try {
|
|
1552
|
-
var t, a = new URL(e), r = (t = a.pathname.split(".").pop()) === null || t === void 0 ? void 0 : t.toLowerCase(),
|
|
1553
|
-
return this.acceptContentTypes.forEach((
|
|
1554
|
-
var s = D.getFormatFromContentType(
|
|
1555
|
-
s && (
|
|
1556
|
-
}),
|
|
1557
|
-
} catch (
|
|
1558
|
-
return console.warn("Не удалось определить расширение из URL:", e,
|
|
1566
|
+
var t, a = new URL(e), r = (t = a.pathname.split(".").pop()) === null || t === void 0 ? void 0 : t.toLowerCase(), n = {};
|
|
1567
|
+
return this.acceptContentTypes.forEach((i) => {
|
|
1568
|
+
var s = D.getFormatFromContentType(i);
|
|
1569
|
+
s && (n[s] = i);
|
|
1570
|
+
}), n[r] || "application/octet-stream";
|
|
1571
|
+
} catch (i) {
|
|
1572
|
+
return console.warn("Не удалось определить расширение из URL:", e, i), "application/octet-stream";
|
|
1559
1573
|
}
|
|
1560
1574
|
}
|
|
1561
1575
|
/**
|
|
@@ -1572,11 +1586,11 @@ class D {
|
|
|
1572
1586
|
montageArea: r
|
|
1573
1587
|
} = this.editor;
|
|
1574
1588
|
if (!r || !t) return 1;
|
|
1575
|
-
var
|
|
1589
|
+
var n = r.width, i = r.height, {
|
|
1576
1590
|
width: s,
|
|
1577
1591
|
height: c
|
|
1578
1592
|
} = t;
|
|
1579
|
-
return a === "contain" || a === "image-contain" ? Math.min(
|
|
1593
|
+
return a === "contain" || a === "image-contain" ? Math.min(n / s, i / c) : a === "cover" || a === "image-cover" ? Math.max(n / s, i / c) : 1;
|
|
1580
1594
|
}
|
|
1581
1595
|
}
|
|
1582
1596
|
class Mt {
|
|
@@ -1607,18 +1621,18 @@ class Mt {
|
|
|
1607
1621
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1608
1622
|
if (e) {
|
|
1609
1623
|
var {
|
|
1610
|
-
canvas:
|
|
1611
|
-
montageArea:
|
|
1624
|
+
canvas: n,
|
|
1625
|
+
montageArea: i,
|
|
1612
1626
|
options: {
|
|
1613
1627
|
canvasBackstoreWidth: s
|
|
1614
1628
|
}
|
|
1615
1629
|
} = this.editor, {
|
|
1616
1630
|
width: c,
|
|
1617
1631
|
height: u
|
|
1618
|
-
} =
|
|
1619
|
-
if (!s || s === "auto" || r ? this.adaptCanvasToContainer() : s ? this.setCanvasBackstoreWidth(s) : this.setCanvasBackstoreWidth(d),
|
|
1632
|
+
} = i, d = Number(Math.max(Math.min(e, E), k));
|
|
1633
|
+
if (!s || s === "auto" || r ? this.adaptCanvasToContainer() : s ? this.setCanvasBackstoreWidth(s) : this.setCanvasBackstoreWidth(d), i.set({
|
|
1620
1634
|
width: d
|
|
1621
|
-
}),
|
|
1635
|
+
}), n.clipPath.set({
|
|
1622
1636
|
width: d
|
|
1623
1637
|
}), t) {
|
|
1624
1638
|
var l = d / c, h = u * l;
|
|
@@ -1628,8 +1642,8 @@ class Mt {
|
|
|
1628
1642
|
var {
|
|
1629
1643
|
left: g,
|
|
1630
1644
|
top: M
|
|
1631
|
-
} = this.getObjectDefaultCoords(
|
|
1632
|
-
|
|
1645
|
+
} = this.getObjectDefaultCoords(i), m = n.getZoom();
|
|
1646
|
+
n.setViewportTransform([m, 0, 0, m, g, M]), this.centerMontageArea(), a || this.editor.historyManager.saveState(), n == null || n.fire("editor:resolution-width-changed", {
|
|
1633
1647
|
width: e
|
|
1634
1648
|
});
|
|
1635
1649
|
}
|
|
@@ -1651,18 +1665,18 @@ class Mt {
|
|
|
1651
1665
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1652
1666
|
if (e) {
|
|
1653
1667
|
var {
|
|
1654
|
-
canvas:
|
|
1655
|
-
montageArea:
|
|
1668
|
+
canvas: n,
|
|
1669
|
+
montageArea: i,
|
|
1656
1670
|
options: {
|
|
1657
1671
|
canvasBackstoreHeight: s
|
|
1658
1672
|
}
|
|
1659
1673
|
} = this.editor, {
|
|
1660
1674
|
width: c,
|
|
1661
1675
|
height: u
|
|
1662
|
-
} =
|
|
1663
|
-
if (!s || s === "auto" || r ? this.adaptCanvasToContainer() : s ? this.setCanvasBackstoreHeight(s) : this.setCanvasBackstoreHeight(d),
|
|
1676
|
+
} = i, d = Number(Math.max(Math.min(e, O), x));
|
|
1677
|
+
if (!s || s === "auto" || r ? this.adaptCanvasToContainer() : s ? this.setCanvasBackstoreHeight(s) : this.setCanvasBackstoreHeight(d), i.set({
|
|
1664
1678
|
height: d
|
|
1665
|
-
}),
|
|
1679
|
+
}), n.clipPath.set({
|
|
1666
1680
|
height: d
|
|
1667
1681
|
}), t) {
|
|
1668
1682
|
var l = d / u, h = c * l;
|
|
@@ -1672,8 +1686,8 @@ class Mt {
|
|
|
1672
1686
|
var {
|
|
1673
1687
|
left: g,
|
|
1674
1688
|
top: M
|
|
1675
|
-
} = this.getObjectDefaultCoords(
|
|
1676
|
-
|
|
1689
|
+
} = this.getObjectDefaultCoords(i), m = n.getZoom();
|
|
1690
|
+
n.setViewportTransform([m, 0, 0, m, g, M]), this.centerMontageArea(), a || this.editor.historyManager.saveState(), n == null || n.fire("editor:resolution-height-changed", {
|
|
1677
1691
|
height: e
|
|
1678
1692
|
});
|
|
1679
1693
|
}
|
|
@@ -1686,7 +1700,7 @@ class Mt {
|
|
|
1686
1700
|
var {
|
|
1687
1701
|
canvas: e,
|
|
1688
1702
|
montageArea: t
|
|
1689
|
-
} = this.editor, a = e.getWidth(), r = e.getHeight(),
|
|
1703
|
+
} = this.editor, a = e.getWidth(), r = e.getHeight(), n = e.getZoom(), i = new ke(a / 2, r / 2);
|
|
1690
1704
|
t.set({
|
|
1691
1705
|
left: a / 2,
|
|
1692
1706
|
top: r / 2
|
|
@@ -1695,7 +1709,7 @@ class Mt {
|
|
|
1695
1709
|
top: r / 2
|
|
1696
1710
|
}), e.renderAll();
|
|
1697
1711
|
var s = e.viewportTransform;
|
|
1698
|
-
s[4] = a / 2 -
|
|
1712
|
+
s[4] = a / 2 - i.x * n, s[5] = r / 2 - i.y * n, e.setViewportTransform(s), e.renderAll();
|
|
1699
1713
|
}
|
|
1700
1714
|
/**
|
|
1701
1715
|
* Метод для получения координат объекта с учетом текущего зума
|
|
@@ -1712,8 +1726,8 @@ class Mt {
|
|
|
1712
1726
|
}), {};
|
|
1713
1727
|
var {
|
|
1714
1728
|
width: r,
|
|
1715
|
-
height:
|
|
1716
|
-
} = a,
|
|
1729
|
+
height: n
|
|
1730
|
+
} = a, i = t.getZoom(), s = (r - r * i) / 2, c = (n - n * i) / 2;
|
|
1717
1731
|
return {
|
|
1718
1732
|
left: s,
|
|
1719
1733
|
top: c
|
|
@@ -1742,10 +1756,10 @@ class Mt {
|
|
|
1742
1756
|
adaptCanvasToContainer() {
|
|
1743
1757
|
var {
|
|
1744
1758
|
canvas: e
|
|
1745
|
-
} = this.editor, t = e.editorContainer, a = t.clientWidth, r = t.clientHeight,
|
|
1746
|
-
console.log("adaptCanvasToContainer newWidth",
|
|
1747
|
-
width:
|
|
1748
|
-
height:
|
|
1759
|
+
} = this.editor, t = e.editorContainer, a = t.clientWidth, r = t.clientHeight, n = Math.max(Math.min(a, E), k), i = Math.max(Math.min(r, O), x);
|
|
1760
|
+
console.log("adaptCanvasToContainer newWidth", n), console.log("adaptCanvasToContainer newHeight", i), e.setDimensions({
|
|
1761
|
+
width: n,
|
|
1762
|
+
height: i
|
|
1749
1763
|
}, {
|
|
1750
1764
|
backstoreOnly: !0
|
|
1751
1765
|
});
|
|
@@ -1762,13 +1776,13 @@ class Mt {
|
|
|
1762
1776
|
transformManager: a,
|
|
1763
1777
|
montageArea: {
|
|
1764
1778
|
width: r,
|
|
1765
|
-
height:
|
|
1779
|
+
height: n
|
|
1766
1780
|
}
|
|
1767
1781
|
} = this.editor;
|
|
1768
1782
|
this.setResolutionWidth(r, {
|
|
1769
1783
|
adaptCanvasToContainer: !0,
|
|
1770
1784
|
withoutSave: !0
|
|
1771
|
-
}), this.setResolutionHeight(
|
|
1785
|
+
}), this.setResolutionHeight(n, {
|
|
1772
1786
|
adaptCanvasToContainer: !0,
|
|
1773
1787
|
withoutSave: !0
|
|
1774
1788
|
}), this.centerMontageArea(), t.selectAll(), a.fitObject({
|
|
@@ -1776,7 +1790,7 @@ class Mt {
|
|
|
1776
1790
|
withoutSave: !0
|
|
1777
1791
|
}), e.fire("editor:canvas-updated", {
|
|
1778
1792
|
width: r,
|
|
1779
|
-
height:
|
|
1793
|
+
height: n
|
|
1780
1794
|
});
|
|
1781
1795
|
}
|
|
1782
1796
|
/**
|
|
@@ -1794,7 +1808,7 @@ class Mt {
|
|
|
1794
1808
|
var {
|
|
1795
1809
|
canvas: t,
|
|
1796
1810
|
montageArea: a
|
|
1797
|
-
} = this.editor, r = a.width * e,
|
|
1811
|
+
} = this.editor, r = a.width * e, n = a.height * e, i = t.wrapperEl.parentNode, s = r <= i.clientWidth ? "100%" : r, c = n <= i.clientHeight ? "100%" : n;
|
|
1798
1812
|
t.setDimensions({
|
|
1799
1813
|
width: s,
|
|
1800
1814
|
height: c
|
|
@@ -1893,25 +1907,25 @@ class Mt {
|
|
|
1893
1907
|
var {
|
|
1894
1908
|
canvas: r,
|
|
1895
1909
|
options: {
|
|
1896
|
-
editorContainer:
|
|
1910
|
+
editorContainer: n
|
|
1897
1911
|
}
|
|
1898
|
-
} = this.editor,
|
|
1912
|
+
} = this.editor, i = [];
|
|
1899
1913
|
switch (e) {
|
|
1900
1914
|
case "canvas":
|
|
1901
|
-
|
|
1915
|
+
i.push(r.lowerCanvasEl, r.upperCanvasEl);
|
|
1902
1916
|
break;
|
|
1903
1917
|
case "wrapper":
|
|
1904
|
-
|
|
1918
|
+
i.push(r.wrapperEl);
|
|
1905
1919
|
break;
|
|
1906
1920
|
case "container":
|
|
1907
|
-
|
|
1921
|
+
i.push(n);
|
|
1908
1922
|
break;
|
|
1909
1923
|
default:
|
|
1910
|
-
|
|
1924
|
+
i.push(r.lowerCanvasEl, r.upperCanvasEl);
|
|
1911
1925
|
}
|
|
1912
1926
|
var s = t === "width" ? "width" : "height";
|
|
1913
1927
|
if (typeof a == "string") {
|
|
1914
|
-
|
|
1928
|
+
i.forEach((d) => {
|
|
1915
1929
|
d.style[s] = a;
|
|
1916
1930
|
});
|
|
1917
1931
|
return;
|
|
@@ -1919,7 +1933,7 @@ class Mt {
|
|
|
1919
1933
|
var c = parseFloat(a);
|
|
1920
1934
|
if (!isNaN(c)) {
|
|
1921
1935
|
var u = "".concat(c, "px");
|
|
1922
|
-
|
|
1936
|
+
i.forEach((d) => {
|
|
1923
1937
|
d.style[s] = u;
|
|
1924
1938
|
}), r.fire("editor:display-".concat(e, "-").concat(s, "-changed"), {
|
|
1925
1939
|
element: e,
|
|
@@ -1943,8 +1957,8 @@ class Mt {
|
|
|
1943
1957
|
withoutSave: a
|
|
1944
1958
|
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
|
|
1945
1959
|
canvas: r,
|
|
1946
|
-
montageArea:
|
|
1947
|
-
transformManager:
|
|
1960
|
+
montageArea: n,
|
|
1961
|
+
transformManager: i,
|
|
1948
1962
|
options: {
|
|
1949
1963
|
montageAreaWidth: s,
|
|
1950
1964
|
montageAreaHeight: c
|
|
@@ -1959,14 +1973,14 @@ class Mt {
|
|
|
1959
1973
|
var {
|
|
1960
1974
|
width: M,
|
|
1961
1975
|
height: m
|
|
1962
|
-
} =
|
|
1976
|
+
} = n, f = d / M, v = l / m, S = Math.max(f, v);
|
|
1963
1977
|
h = M * S, g = m * S;
|
|
1964
1978
|
}
|
|
1965
1979
|
this.setResolutionWidth(h, {
|
|
1966
1980
|
withoutSave: !0
|
|
1967
1981
|
}), this.setResolutionHeight(g, {
|
|
1968
1982
|
withoutSave: !0
|
|
1969
|
-
}), (d > s || l > c) &&
|
|
1983
|
+
}), (d > s || l > c) && i.calculateAndApplyDefaultZoom(), i.resetObject(u, {
|
|
1970
1984
|
withoutSave: !0
|
|
1971
1985
|
}), r.centerObject(u), r.renderAll(), a || this.editor.historyManager.saveState(), r.fire("editor:montage-area-scaled-to-image", {
|
|
1972
1986
|
object: u,
|
|
@@ -2003,13 +2017,13 @@ class Mt {
|
|
|
2003
2017
|
transformManager: a,
|
|
2004
2018
|
historyManager: r,
|
|
2005
2019
|
options: {
|
|
2006
|
-
montageAreaWidth:
|
|
2007
|
-
montageAreaHeight:
|
|
2020
|
+
montageAreaWidth: n,
|
|
2021
|
+
montageAreaHeight: i
|
|
2008
2022
|
}
|
|
2009
2023
|
} = this.editor;
|
|
2010
|
-
a.resetZoom(), this.setResolutionWidth(
|
|
2024
|
+
a.resetZoom(), this.setResolutionWidth(n, {
|
|
2011
2025
|
withoutSave: !0
|
|
2012
|
-
}), this.setResolutionHeight(
|
|
2026
|
+
}), this.setResolutionHeight(i, {
|
|
2013
2027
|
withoutSave: !0
|
|
2014
2028
|
}), t.renderAll(), a.resetObjects(), e || r.saveState(), t.fire("editor:default-scale-set");
|
|
2015
2029
|
}
|
|
@@ -2025,7 +2039,7 @@ class Mt {
|
|
|
2025
2039
|
overlayMask: a
|
|
2026
2040
|
}
|
|
2027
2041
|
} = this.editor, r = e.getObjects();
|
|
2028
|
-
return r.filter((
|
|
2042
|
+
return r.filter((n) => n.id !== t.id && n.id !== a.id);
|
|
2029
2043
|
}
|
|
2030
2044
|
}
|
|
2031
2045
|
class ft {
|
|
@@ -2049,10 +2063,10 @@ class ft {
|
|
|
2049
2063
|
calculateAndApplyDefaultZoom() {
|
|
2050
2064
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.defaultScale, {
|
|
2051
2065
|
canvas: t
|
|
2052
|
-
} = this.editor, a = t.editorContainer, r = a.clientWidth,
|
|
2053
|
-
width:
|
|
2066
|
+
} = this.editor, a = t.editorContainer, r = a.clientWidth, n = a.clientHeight, {
|
|
2067
|
+
width: i,
|
|
2054
2068
|
height: s
|
|
2055
|
-
} = this.editor.montageArea, c = r /
|
|
2069
|
+
} = this.editor.montageArea, c = r / i * e, u = n / s * e, d = Math.min(c, u), {
|
|
2056
2070
|
minZoom: l,
|
|
2057
2071
|
maxZoom: h,
|
|
2058
2072
|
maxZoomFactor: g
|
|
@@ -2074,15 +2088,20 @@ class ft {
|
|
|
2074
2088
|
var {
|
|
2075
2089
|
canvas: a,
|
|
2076
2090
|
minZoom: r,
|
|
2077
|
-
maxZoom:
|
|
2078
|
-
} = this.editor,
|
|
2091
|
+
maxZoom: n
|
|
2092
|
+
} = this.editor, i = a.getZoom(), {
|
|
2079
2093
|
x: s = t.pointX,
|
|
2080
2094
|
y: c = t.pointY
|
|
2081
|
-
} = a.getCenterPoint(), u = Number((
|
|
2082
|
-
u >
|
|
2095
|
+
} = a.getCenterPoint(), u = Number((i + Number(e)).toFixed(2));
|
|
2096
|
+
u > n && (u = n), u < r && (u = r), a.zoomToPoint({
|
|
2083
2097
|
x: Number(s),
|
|
2084
2098
|
y: Number(c)
|
|
2085
|
-
}, u),
|
|
2099
|
+
}, u), console.log({
|
|
2100
|
+
currentZoom: i,
|
|
2101
|
+
zoom: u,
|
|
2102
|
+
pointX: s,
|
|
2103
|
+
pointY: c
|
|
2104
|
+
}), a.fire("editor:zoom-changed", {
|
|
2086
2105
|
currentZoom: a.getZoom(),
|
|
2087
2106
|
zoom: u,
|
|
2088
2107
|
pointX: s,
|
|
@@ -2101,17 +2120,17 @@ class ft {
|
|
|
2101
2120
|
minZoom: a,
|
|
2102
2121
|
maxZoom: r
|
|
2103
2122
|
} = this.editor, {
|
|
2104
|
-
x:
|
|
2105
|
-
y:
|
|
2123
|
+
x: n,
|
|
2124
|
+
y: i
|
|
2106
2125
|
} = t.getCenterPoint(), s = e;
|
|
2107
2126
|
e > r && (s = r), e < a && (s = a), t.zoomToPoint({
|
|
2108
|
-
x: Number(
|
|
2109
|
-
y: Number(
|
|
2127
|
+
x: Number(n),
|
|
2128
|
+
y: Number(i)
|
|
2110
2129
|
}, s), t.fire("editor:zoom-changed", {
|
|
2111
2130
|
currentZoom: t.getZoom(),
|
|
2112
2131
|
zoom: s,
|
|
2113
|
-
pointX:
|
|
2114
|
-
pointY:
|
|
2132
|
+
pointX: n,
|
|
2133
|
+
pointY: i
|
|
2115
2134
|
});
|
|
2116
2135
|
}
|
|
2117
2136
|
/**
|
|
@@ -2130,7 +2149,9 @@ class ft {
|
|
|
2130
2149
|
x: Number(a),
|
|
2131
2150
|
y: Number(r)
|
|
2132
2151
|
}, t), this.editor.canvas.fire("editor:zoom-changed", {
|
|
2133
|
-
currentZoom: e.getZoom()
|
|
2152
|
+
currentZoom: e.getZoom(),
|
|
2153
|
+
pointX: a,
|
|
2154
|
+
pointY: r
|
|
2134
2155
|
});
|
|
2135
2156
|
}
|
|
2136
2157
|
/**
|
|
@@ -2146,11 +2167,13 @@ class ft {
|
|
|
2146
2167
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
|
2147
2168
|
canvas: a,
|
|
2148
2169
|
historyManager: r
|
|
2149
|
-
} = this.editor,
|
|
2150
|
-
if (
|
|
2151
|
-
var
|
|
2152
|
-
|
|
2153
|
-
|
|
2170
|
+
} = this.editor, n = a.getActiveObject();
|
|
2171
|
+
if (n) {
|
|
2172
|
+
var i = n.angle + e;
|
|
2173
|
+
n.rotate(i), n.setCoords(), a.renderAll(), t || r.saveState(), a.fire("editor:object-rotated", {
|
|
2174
|
+
object: n,
|
|
2175
|
+
withoutSave: t,
|
|
2176
|
+
angle: i
|
|
2154
2177
|
});
|
|
2155
2178
|
}
|
|
2156
2179
|
}
|
|
@@ -2167,7 +2190,10 @@ class ft {
|
|
|
2167
2190
|
canvas: t,
|
|
2168
2191
|
historyManager: a
|
|
2169
2192
|
} = this.editor, r = t.getActiveObject();
|
|
2170
|
-
r && (r.flipX = !r.flipX, t.renderAll(), e || a.saveState(), t.fire("editor:object-flipped-x"
|
|
2193
|
+
r && (r.flipX = !r.flipX, t.renderAll(), e || a.saveState(), t.fire("editor:object-flipped-x", {
|
|
2194
|
+
object: r,
|
|
2195
|
+
withoutSave: e
|
|
2196
|
+
}));
|
|
2171
2197
|
}
|
|
2172
2198
|
/**
|
|
2173
2199
|
* Отразить по вертикали
|
|
@@ -2182,7 +2208,10 @@ class ft {
|
|
|
2182
2208
|
canvas: t,
|
|
2183
2209
|
historyManager: a
|
|
2184
2210
|
} = this.editor, r = t.getActiveObject();
|
|
2185
|
-
r && (r.flipY = !r.flipY, t.renderAll(), e || a.saveState(), t.fire("editor:object-flipped-y"
|
|
2211
|
+
r && (r.flipY = !r.flipY, t.renderAll(), e || a.saveState(), t.fire("editor:object-flipped-y", {
|
|
2212
|
+
object: r,
|
|
2213
|
+
withoutSave: e
|
|
2214
|
+
}));
|
|
2186
2215
|
}
|
|
2187
2216
|
/**
|
|
2188
2217
|
* Установка прозрачности объекта
|
|
@@ -2196,11 +2225,15 @@ class ft {
|
|
|
2196
2225
|
withoutSave: a
|
|
2197
2226
|
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
|
|
2198
2227
|
canvas: r,
|
|
2199
|
-
historyManager:
|
|
2200
|
-
} = this.editor,
|
|
2201
|
-
|
|
2228
|
+
historyManager: n
|
|
2229
|
+
} = this.editor, i = e || r.getActiveObject();
|
|
2230
|
+
i && (i.type === "activeselection" ? i.getObjects().forEach((s) => {
|
|
2202
2231
|
s.set("opacity", t);
|
|
2203
|
-
}) :
|
|
2232
|
+
}) : i.set("opacity", t), r.renderAll(), a || n.saveState(), r.fire("editor:object-opacity-changed", {
|
|
2233
|
+
object: i,
|
|
2234
|
+
opacity: t,
|
|
2235
|
+
withoutSave: a
|
|
2236
|
+
}));
|
|
2204
2237
|
}
|
|
2205
2238
|
/**
|
|
2206
2239
|
* Масштабирование объекта
|
|
@@ -2220,32 +2253,32 @@ class ft {
|
|
|
2220
2253
|
withoutSave: a,
|
|
2221
2254
|
fitAsOneObject: r
|
|
2222
2255
|
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
|
|
2223
|
-
canvas:
|
|
2224
|
-
imageManager:
|
|
2256
|
+
canvas: n,
|
|
2257
|
+
imageManager: i,
|
|
2225
2258
|
historyManager: s
|
|
2226
|
-
} = this.editor, c = e ||
|
|
2259
|
+
} = this.editor, c = e || n.getActiveObject();
|
|
2227
2260
|
if (c) {
|
|
2228
2261
|
if (c.set("angle", 0), ["activeselection"].includes(c.type) && !r) {
|
|
2229
2262
|
var u = c.getObjects();
|
|
2230
|
-
|
|
2231
|
-
var g =
|
|
2263
|
+
n.discardActiveObject(), u.forEach((h) => {
|
|
2264
|
+
var g = i.calculateScaleFactor({
|
|
2232
2265
|
imageObject: h,
|
|
2233
2266
|
scaleType: t
|
|
2234
2267
|
});
|
|
2235
|
-
h.scale(g),
|
|
2268
|
+
h.scale(g), n.centerObject(h);
|
|
2236
2269
|
});
|
|
2237
2270
|
var d = new H(u, {
|
|
2238
|
-
canvas:
|
|
2271
|
+
canvas: n
|
|
2239
2272
|
});
|
|
2240
|
-
|
|
2273
|
+
n.setActiveObject(d);
|
|
2241
2274
|
} else {
|
|
2242
|
-
var l =
|
|
2275
|
+
var l = i.calculateScaleFactor({
|
|
2243
2276
|
imageObject: c,
|
|
2244
2277
|
scaleType: t
|
|
2245
2278
|
});
|
|
2246
|
-
c.scale(l),
|
|
2279
|
+
c.scale(l), n.centerObject(c);
|
|
2247
2280
|
}
|
|
2248
|
-
|
|
2281
|
+
n.renderAll(), a || s.saveState(), n.fire("editor:object-fitted", {
|
|
2249
2282
|
object: c,
|
|
2250
2283
|
type: t,
|
|
2251
2284
|
withoutSave: a,
|
|
@@ -2276,8 +2309,8 @@ class ft {
|
|
|
2276
2309
|
withoutSave: a = !1
|
|
2277
2310
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
|
2278
2311
|
canvas: r,
|
|
2279
|
-
montageArea:
|
|
2280
|
-
imageManager:
|
|
2312
|
+
montageArea: n,
|
|
2313
|
+
imageManager: i,
|
|
2281
2314
|
historyManager: s,
|
|
2282
2315
|
options: {
|
|
2283
2316
|
scaleType: c
|
|
@@ -2302,10 +2335,10 @@ class ft {
|
|
|
2302
2335
|
var {
|
|
2303
2336
|
width: l,
|
|
2304
2337
|
height: h
|
|
2305
|
-
} =
|
|
2338
|
+
} = n, {
|
|
2306
2339
|
width: g,
|
|
2307
2340
|
height: M
|
|
2308
|
-
} = u, m =
|
|
2341
|
+
} = u, m = i.calculateScaleFactor({
|
|
2309
2342
|
imageObject: u,
|
|
2310
2343
|
scaleType: c
|
|
2311
2344
|
}), f = c === "contain" && m < 1 || c === "cover" && (g > l || M > h);
|
|
@@ -2322,7 +2355,11 @@ class ft {
|
|
|
2322
2355
|
flipX: !1,
|
|
2323
2356
|
flipY: !1,
|
|
2324
2357
|
angle: 0
|
|
2325
|
-
}), r.centerObject(u), r.renderAll(), s.resumeHistory(), a || s.saveState(), r.fire("editor:object-reset"
|
|
2358
|
+
}), r.centerObject(u), r.renderAll(), s.resumeHistory(), a || s.saveState(), r.fire("editor:object-reset", {
|
|
2359
|
+
object: u,
|
|
2360
|
+
withoutSave: a,
|
|
2361
|
+
alwaysFitObject: t
|
|
2362
|
+
});
|
|
2326
2363
|
}
|
|
2327
2364
|
}
|
|
2328
2365
|
}
|
|
@@ -2376,14 +2413,14 @@ class jt {
|
|
|
2376
2413
|
a.suspendHistory(), t.setCoords();
|
|
2377
2414
|
var {
|
|
2378
2415
|
left: r,
|
|
2379
|
-
top:
|
|
2380
|
-
width:
|
|
2416
|
+
top: n,
|
|
2417
|
+
width: i,
|
|
2381
2418
|
height: s
|
|
2382
2419
|
} = t.getBoundingRect();
|
|
2383
2420
|
this.overlayMask.set({
|
|
2384
2421
|
left: r,
|
|
2385
|
-
top:
|
|
2386
|
-
width:
|
|
2422
|
+
top: n,
|
|
2423
|
+
width: i,
|
|
2387
2424
|
height: s
|
|
2388
2425
|
}), e.discardActiveObject(), this.editor.layerManager.bringToFront(this.overlayMask, {
|
|
2389
2426
|
withoutSave: !0
|
|
@@ -2452,10 +2489,13 @@ class K {
|
|
|
2452
2489
|
historyManager: r
|
|
2453
2490
|
} = this.editor;
|
|
2454
2491
|
r.suspendHistory();
|
|
2455
|
-
var
|
|
2456
|
-
|
|
2457
|
-
a.bringObjectToFront(
|
|
2458
|
-
}) : a.bringObjectToFront(
|
|
2492
|
+
var n = e || a.getActiveObject();
|
|
2493
|
+
n && (n.type === "activeselection" ? n.getObjects().forEach((i) => {
|
|
2494
|
+
a.bringObjectToFront(i);
|
|
2495
|
+
}) : a.bringObjectToFront(n), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:object-bring-to-front", {
|
|
2496
|
+
object: n,
|
|
2497
|
+
withoutSave: t
|
|
2498
|
+
}));
|
|
2459
2499
|
}
|
|
2460
2500
|
/**
|
|
2461
2501
|
* Поднять объект на один уровень вверх по оси Z
|
|
@@ -2472,8 +2512,11 @@ class K {
|
|
|
2472
2512
|
historyManager: r
|
|
2473
2513
|
} = this.editor;
|
|
2474
2514
|
r.suspendHistory();
|
|
2475
|
-
var
|
|
2476
|
-
|
|
2515
|
+
var n = e || a.getActiveObject();
|
|
2516
|
+
n && (n.type === "activeselection" ? K._moveSelectionForward(a, n) : a.bringObjectForward(n), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:object-bring-forward", {
|
|
2517
|
+
object: n,
|
|
2518
|
+
withoutSave: t
|
|
2519
|
+
}));
|
|
2477
2520
|
}
|
|
2478
2521
|
/**
|
|
2479
2522
|
* Отправить объект на задний план по оси Z
|
|
@@ -2488,12 +2531,12 @@ class K {
|
|
|
2488
2531
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
|
2489
2532
|
canvas: a,
|
|
2490
2533
|
montageArea: r,
|
|
2491
|
-
historyManager:
|
|
2534
|
+
historyManager: n,
|
|
2492
2535
|
interactionBlocker: {
|
|
2493
|
-
overlayMask:
|
|
2536
|
+
overlayMask: i
|
|
2494
2537
|
}
|
|
2495
2538
|
} = this.editor;
|
|
2496
|
-
|
|
2539
|
+
n.suspendHistory();
|
|
2497
2540
|
var s = e || a.getActiveObject();
|
|
2498
2541
|
if (s) {
|
|
2499
2542
|
if (s.type === "activeselection")
|
|
@@ -2501,7 +2544,10 @@ class K {
|
|
|
2501
2544
|
a.sendObjectToBack(c[u]);
|
|
2502
2545
|
else
|
|
2503
2546
|
a.sendObjectToBack(s);
|
|
2504
|
-
a.sendObjectToBack(r), a.sendObjectToBack(
|
|
2547
|
+
a.sendObjectToBack(r), a.sendObjectToBack(i), a.renderAll(), n.resumeHistory(), t || n.saveState(), a.fire("editor:object-send-to-back", {
|
|
2548
|
+
object: s,
|
|
2549
|
+
withoutSave: t
|
|
2550
|
+
});
|
|
2505
2551
|
}
|
|
2506
2552
|
}
|
|
2507
2553
|
/**
|
|
@@ -2516,14 +2562,17 @@ class K {
|
|
|
2516
2562
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
|
2517
2563
|
canvas: a,
|
|
2518
2564
|
montageArea: r,
|
|
2519
|
-
historyManager:
|
|
2565
|
+
historyManager: n,
|
|
2520
2566
|
interactionBlocker: {
|
|
2521
|
-
overlayMask:
|
|
2567
|
+
overlayMask: i
|
|
2522
2568
|
}
|
|
2523
2569
|
} = this.editor;
|
|
2524
|
-
|
|
2570
|
+
n.suspendHistory();
|
|
2525
2571
|
var s = e || a.getActiveObject();
|
|
2526
|
-
s && (s.type === "activeselection" ? K._moveSelectionBackwards(a, s) : a.sendObjectBackwards(s), a.sendObjectToBack(r), a.sendObjectToBack(
|
|
2572
|
+
s && (s.type === "activeselection" ? K._moveSelectionBackwards(a, s) : a.sendObjectBackwards(s), a.sendObjectToBack(r), a.sendObjectToBack(i), a.renderAll(), n.resumeHistory(), t || n.saveState(), a.fire("editor:object-send-backwards", {
|
|
2573
|
+
object: s,
|
|
2574
|
+
withoutSave: t
|
|
2575
|
+
}));
|
|
2527
2576
|
}
|
|
2528
2577
|
/**
|
|
2529
2578
|
* Сдвигает выделенные объекты на один уровень вверх относительно ближайшего верхнего объекта
|
|
@@ -2533,20 +2582,20 @@ class K {
|
|
|
2533
2582
|
* @private
|
|
2534
2583
|
*/
|
|
2535
2584
|
static _moveSelectionForward(e, t) {
|
|
2536
|
-
for (var a = e.getObjects(), r = t.getObjects(),
|
|
2585
|
+
for (var a = e.getObjects(), r = t.getObjects(), n = r.map((d) => a.indexOf(d)), i = -1, s = function(l) {
|
|
2537
2586
|
var h = a[l];
|
|
2538
|
-
if (!r.includes(h) &&
|
|
2539
|
-
return
|
|
2587
|
+
if (!r.includes(h) && n.some((g) => l > g))
|
|
2588
|
+
return i = l, 1;
|
|
2540
2589
|
}, c = 0; c < a.length && !s(c); c += 1)
|
|
2541
2590
|
;
|
|
2542
|
-
if (
|
|
2591
|
+
if (i !== -1) {
|
|
2543
2592
|
var u = r.map((d) => ({
|
|
2544
2593
|
obj: d,
|
|
2545
2594
|
index: a.indexOf(d)
|
|
2546
2595
|
})).sort((d, l) => l.index - d.index);
|
|
2547
2596
|
u.forEach((d) => {
|
|
2548
2597
|
var l = a.indexOf(d.obj);
|
|
2549
|
-
l <
|
|
2598
|
+
l < i && (e.moveObjectTo(d.obj, i), i = l);
|
|
2550
2599
|
});
|
|
2551
2600
|
}
|
|
2552
2601
|
}
|
|
@@ -2558,8 +2607,8 @@ class K {
|
|
|
2558
2607
|
* @private
|
|
2559
2608
|
*/
|
|
2560
2609
|
static _moveSelectionBackwards(e, t) {
|
|
2561
|
-
for (var a = e.getObjects(), r = t.getObjects(),
|
|
2562
|
-
e.moveObjectTo(r[
|
|
2610
|
+
for (var a = e.getObjects(), r = t.getObjects(), n = Math.min(...r.map((s) => a.indexOf(s))), i = r.length - 1; i >= 0; i -= 1)
|
|
2611
|
+
e.moveObjectTo(r[i], n - 1);
|
|
2563
2612
|
}
|
|
2564
2613
|
}
|
|
2565
2614
|
class yt {
|
|
@@ -2592,8 +2641,8 @@ class yt {
|
|
|
2592
2641
|
left: t,
|
|
2593
2642
|
top: a,
|
|
2594
2643
|
width: r = 100,
|
|
2595
|
-
height:
|
|
2596
|
-
fill:
|
|
2644
|
+
height: n = 100,
|
|
2645
|
+
fill: i = "blue"
|
|
2597
2646
|
} = l, s = X(l, [
|
|
2598
2647
|
"id",
|
|
2599
2648
|
"left",
|
|
@@ -2607,8 +2656,8 @@ class yt {
|
|
|
2607
2656
|
left: t,
|
|
2608
2657
|
top: a,
|
|
2609
2658
|
width: r,
|
|
2610
|
-
height:
|
|
2611
|
-
fill:
|
|
2659
|
+
height: n,
|
|
2660
|
+
fill: i
|
|
2612
2661
|
}, s));
|
|
2613
2662
|
return !t && !a && h.centerObject(g), u || (h.add(g), c || h.setActiveObject(g), h.renderAll()), g;
|
|
2614
2663
|
}
|
|
@@ -2634,8 +2683,8 @@ class yt {
|
|
|
2634
2683
|
left: t,
|
|
2635
2684
|
top: a,
|
|
2636
2685
|
radius: r = 50,
|
|
2637
|
-
fill:
|
|
2638
|
-
} = d,
|
|
2686
|
+
fill: n = "green"
|
|
2687
|
+
} = d, i = X(d, [
|
|
2639
2688
|
"id",
|
|
2640
2689
|
"left",
|
|
2641
2690
|
"top",
|
|
@@ -2646,9 +2695,9 @@ class yt {
|
|
|
2646
2695
|
id: e,
|
|
2647
2696
|
left: t,
|
|
2648
2697
|
top: a,
|
|
2649
|
-
fill:
|
|
2698
|
+
fill: n,
|
|
2650
2699
|
radius: r
|
|
2651
|
-
},
|
|
2700
|
+
}, i));
|
|
2652
2701
|
return !t && !a && l.centerObject(h), c || (l.add(h), s || l.setActiveObject(h), l.renderAll()), h;
|
|
2653
2702
|
}
|
|
2654
2703
|
/**
|
|
@@ -2674,8 +2723,8 @@ class yt {
|
|
|
2674
2723
|
left: t,
|
|
2675
2724
|
top: a,
|
|
2676
2725
|
width: r = 100,
|
|
2677
|
-
height:
|
|
2678
|
-
fill:
|
|
2726
|
+
height: n = 100,
|
|
2727
|
+
fill: i = "yellow"
|
|
2679
2728
|
} = l, s = X(l, [
|
|
2680
2729
|
"id",
|
|
2681
2730
|
"left",
|
|
@@ -2688,9 +2737,9 @@ class yt {
|
|
|
2688
2737
|
id: e,
|
|
2689
2738
|
left: t,
|
|
2690
2739
|
top: a,
|
|
2691
|
-
fill:
|
|
2740
|
+
fill: i,
|
|
2692
2741
|
width: r,
|
|
2693
|
-
height:
|
|
2742
|
+
height: n
|
|
2694
2743
|
}, s));
|
|
2695
2744
|
return !t && !a && h.centerObject(g), u || (h.add(g), c || h.setActiveObject(g), h.renderAll()), g;
|
|
2696
2745
|
}
|
|
@@ -2729,10 +2778,10 @@ class pt {
|
|
|
2729
2778
|
});
|
|
2730
2779
|
}), this._cloneAndFire(e, a);
|
|
2731
2780
|
}
|
|
2732
|
-
const
|
|
2781
|
+
const n = a.toCanvasElement().toDataURL(), i = n.slice(5).split(";")[0], s = n.split(",")[1], c = atob(s), u = new Uint8Array(c.length);
|
|
2733
2782
|
for (let h = 0; h < c.length; h++)
|
|
2734
2783
|
u[h] = c.charCodeAt(h);
|
|
2735
|
-
const d = new Blob([u.buffer], { type:
|
|
2784
|
+
const d = new Blob([u.buffer], { type: i }), l = new ClipboardItem({ [i]: d });
|
|
2736
2785
|
navigator.clipboard.write([l]).catch((h) => {
|
|
2737
2786
|
t.emitWarning({
|
|
2738
2787
|
origin: "ClipboardManager",
|
|
@@ -2767,8 +2816,8 @@ class pt {
|
|
|
2767
2816
|
* @param {Array} event.clipboardData.items — элементы буфера обмена
|
|
2768
2817
|
*/
|
|
2769
2818
|
handlePasteEvent({ clipboardData: e }) {
|
|
2770
|
-
var
|
|
2771
|
-
if (!((
|
|
2819
|
+
var i;
|
|
2820
|
+
if (!((i = e == null ? void 0 : e.items) != null && i.length)) return;
|
|
2772
2821
|
const { imageManager: t } = this.editor, { items: a } = e, r = a[a.length - 1];
|
|
2773
2822
|
if (r.type !== "text/html") {
|
|
2774
2823
|
const s = r.getAsFile();
|
|
@@ -2779,9 +2828,9 @@ class pt {
|
|
|
2779
2828
|
}, c.readAsDataURL(s);
|
|
2780
2829
|
return;
|
|
2781
2830
|
}
|
|
2782
|
-
const
|
|
2783
|
-
if (
|
|
2784
|
-
const u = new DOMParser().parseFromString(
|
|
2831
|
+
const n = e.getData("text/html");
|
|
2832
|
+
if (n) {
|
|
2833
|
+
const u = new DOMParser().parseFromString(n, "text/html").querySelector("img");
|
|
2785
2834
|
if (u != null && u.src) {
|
|
2786
2835
|
t.importImage({ source: u.src });
|
|
2787
2836
|
return;
|
|
@@ -2835,9 +2884,9 @@ class bt {
|
|
|
2835
2884
|
withoutSave: a
|
|
2836
2885
|
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
|
|
2837
2886
|
canvas: r,
|
|
2838
|
-
historyManager:
|
|
2839
|
-
} = this.editor,
|
|
2840
|
-
if (!(!
|
|
2887
|
+
historyManager: n
|
|
2888
|
+
} = this.editor, i = e || r.getActiveObject();
|
|
2889
|
+
if (!(!i || i.locked)) {
|
|
2841
2890
|
var s = {
|
|
2842
2891
|
lockMovementX: !0,
|
|
2843
2892
|
lockMovementY: !0,
|
|
@@ -2848,12 +2897,14 @@ class bt {
|
|
|
2848
2897
|
lockSkewingY: !0,
|
|
2849
2898
|
locked: !0
|
|
2850
2899
|
};
|
|
2851
|
-
|
|
2852
|
-
var c = !t && ["activeselection", "group"].includes(
|
|
2853
|
-
c &&
|
|
2900
|
+
i.set(s);
|
|
2901
|
+
var c = !t && ["activeselection", "group"].includes(i.type);
|
|
2902
|
+
c && i.getObjects().forEach((u) => {
|
|
2854
2903
|
u.set(s);
|
|
2855
|
-
}), r.renderAll(), a ||
|
|
2856
|
-
object:
|
|
2904
|
+
}), r.renderAll(), a || n.saveState(), r.fire("editor:object-locked", {
|
|
2905
|
+
object: i,
|
|
2906
|
+
skipInnerObjects: t,
|
|
2907
|
+
withoutSave: a
|
|
2857
2908
|
});
|
|
2858
2909
|
}
|
|
2859
2910
|
}
|
|
@@ -2872,9 +2923,9 @@ class bt {
|
|
|
2872
2923
|
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
|
|
2873
2924
|
canvas: a,
|
|
2874
2925
|
historyManager: r
|
|
2875
|
-
} = this.editor,
|
|
2876
|
-
if (
|
|
2877
|
-
var
|
|
2926
|
+
} = this.editor, n = e || a.getActiveObject();
|
|
2927
|
+
if (n) {
|
|
2928
|
+
var i = {
|
|
2878
2929
|
lockMovementX: !1,
|
|
2879
2930
|
lockMovementY: !1,
|
|
2880
2931
|
lockRotation: !1,
|
|
@@ -2884,10 +2935,11 @@ class bt {
|
|
|
2884
2935
|
lockSkewingY: !1,
|
|
2885
2936
|
locked: !1
|
|
2886
2937
|
};
|
|
2887
|
-
|
|
2888
|
-
s.set(
|
|
2938
|
+
n.set(i), ["activeselection", "group"].includes(n.type) && n.getObjects().forEach((s) => {
|
|
2939
|
+
s.set(i);
|
|
2889
2940
|
}), a.renderAll(), t || r.saveState(), a.fire("editor:object-unlocked", {
|
|
2890
|
-
object:
|
|
2941
|
+
object: n,
|
|
2942
|
+
withoutSave: t
|
|
2891
2943
|
});
|
|
2892
2944
|
}
|
|
2893
2945
|
}
|
|
@@ -2919,11 +2971,11 @@ class It {
|
|
|
2919
2971
|
historyManager: r
|
|
2920
2972
|
} = this.editor;
|
|
2921
2973
|
r.suspendHistory();
|
|
2922
|
-
var
|
|
2923
|
-
if (
|
|
2924
|
-
var
|
|
2925
|
-
|
|
2926
|
-
object:
|
|
2974
|
+
var n = e || a.getActiveObject();
|
|
2975
|
+
if (n && n.type === "activeselection") {
|
|
2976
|
+
var i = n.getObjects(), s = new ze(i);
|
|
2977
|
+
i.forEach((c) => a.remove(c)), s.set("id", "".concat(s.type, "-").concat(A())), a.add(s), a.setActiveObject(s), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-grouped", {
|
|
2978
|
+
object: n,
|
|
2927
2979
|
group: s,
|
|
2928
2980
|
withoutSave: t
|
|
2929
2981
|
});
|
|
@@ -2945,15 +2997,15 @@ class It {
|
|
|
2945
2997
|
historyManager: r
|
|
2946
2998
|
} = this.editor;
|
|
2947
2999
|
r.suspendHistory();
|
|
2948
|
-
var
|
|
2949
|
-
if (!(!
|
|
2950
|
-
var
|
|
2951
|
-
a.remove(
|
|
2952
|
-
var s = new H(
|
|
3000
|
+
var n = e || a.getActiveObject();
|
|
3001
|
+
if (!(!n || n.type !== "group")) {
|
|
3002
|
+
var i = n.removeAll();
|
|
3003
|
+
a.remove(n), i.forEach((c) => a.add(c));
|
|
3004
|
+
var s = new H(i, {
|
|
2953
3005
|
canvas: a
|
|
2954
3006
|
});
|
|
2955
3007
|
a.setActiveObject(s), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-ungrouped", {
|
|
2956
|
-
object:
|
|
3008
|
+
object: n,
|
|
2957
3009
|
selection: s,
|
|
2958
3010
|
withoutSave: t
|
|
2959
3011
|
});
|
|
@@ -2982,15 +3034,15 @@ class At {
|
|
|
2982
3034
|
objectLockManager: a
|
|
2983
3035
|
} = this.editor;
|
|
2984
3036
|
e.discardActiveObject();
|
|
2985
|
-
var r = t.getObjects(),
|
|
3037
|
+
var r = t.getObjects(), n = r.some((s) => s.locked), i = r.length > 1 ? new H(t.getObjects(), {
|
|
2986
3038
|
canvas: e
|
|
2987
3039
|
}) : r[0];
|
|
2988
|
-
|
|
2989
|
-
object:
|
|
3040
|
+
n && a.lockObject({
|
|
3041
|
+
object: i,
|
|
2990
3042
|
skipInnerObjects: !0,
|
|
2991
3043
|
withoutSave: !0
|
|
2992
|
-
}), e.setActiveObject(
|
|
2993
|
-
selected:
|
|
3044
|
+
}), e.setActiveObject(i), e.requestRenderAll(), e.fire("editor:all-objects-selected", {
|
|
3045
|
+
selected: i
|
|
2994
3046
|
});
|
|
2995
3047
|
}
|
|
2996
3048
|
}
|
|
@@ -3019,16 +3071,16 @@ class St {
|
|
|
3019
3071
|
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
|
|
3020
3072
|
canvas: a,
|
|
3021
3073
|
historyManager: r,
|
|
3022
|
-
groupingManager:
|
|
3023
|
-
} = this.editor,
|
|
3024
|
-
|
|
3074
|
+
groupingManager: n
|
|
3075
|
+
} = this.editor, i = (e || a.getActiveObjects()).filter((s) => !s.locked);
|
|
3076
|
+
i != null && i.length && (r.suspendHistory(), i.forEach((s) => {
|
|
3025
3077
|
if (s.type === "group" && s.format !== "svg") {
|
|
3026
|
-
|
|
3078
|
+
n.ungroup(s), this.deleteSelectedObjects();
|
|
3027
3079
|
return;
|
|
3028
3080
|
}
|
|
3029
3081
|
a.remove(s);
|
|
3030
3082
|
}), a.discardActiveObject(), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-deleted", {
|
|
3031
|
-
objects:
|
|
3083
|
+
objects: i,
|
|
3032
3084
|
withoutSave: t
|
|
3033
3085
|
}));
|
|
3034
3086
|
}
|
|
@@ -3102,19 +3154,19 @@ class $ {
|
|
|
3102
3154
|
* @param {string} [options.message] — текст ошибки (опционально, если не передан, то используется код ошибки)
|
|
3103
3155
|
* @fires editor:error
|
|
3104
3156
|
*/
|
|
3105
|
-
emitError({ origin: e = "ImageEditor", method: t = "Unknown Method", code: a, data: r, message:
|
|
3157
|
+
emitError({ origin: e = "ImageEditor", method: t = "Unknown Method", code: a, data: r, message: n }) {
|
|
3106
3158
|
if (!$.isValidErrorCode(a)) {
|
|
3107
3159
|
console.warn("Неизвестный код ошибки: ", { code: a, origin: e, method: t });
|
|
3108
3160
|
return;
|
|
3109
3161
|
}
|
|
3110
3162
|
if (!a) return;
|
|
3111
|
-
const
|
|
3112
|
-
console.error(`${e}. ${t}. ${a}. ${
|
|
3163
|
+
const i = n || a;
|
|
3164
|
+
console.error(`${e}. ${t}. ${a}. ${i}`, r);
|
|
3113
3165
|
const s = {
|
|
3114
3166
|
code: a,
|
|
3115
3167
|
origin: e,
|
|
3116
3168
|
method: t,
|
|
3117
|
-
message:
|
|
3169
|
+
message: i,
|
|
3118
3170
|
data: r
|
|
3119
3171
|
};
|
|
3120
3172
|
this._buffer.push(C({
|
|
@@ -3131,19 +3183,19 @@ class $ {
|
|
|
3131
3183
|
* @param {string} [options.message] — текст предупреждения (опционально, если не передан, то используется код предупреждения)
|
|
3132
3184
|
* @fires editor:warning
|
|
3133
3185
|
*/
|
|
3134
|
-
emitWarning({ origin: e = "ImageEditor", method: t = "Unknown Method", code: a, message: r, data:
|
|
3186
|
+
emitWarning({ origin: e = "ImageEditor", method: t = "Unknown Method", code: a, message: r, data: n }) {
|
|
3135
3187
|
if (!$.isValidErrorCode(a)) {
|
|
3136
3188
|
console.warn("Неизвестный код предупреждения: ", { code: a, origin: e, method: t });
|
|
3137
3189
|
return;
|
|
3138
3190
|
}
|
|
3139
|
-
const
|
|
3140
|
-
console.warn(`${e}. ${t}. ${a}. ${
|
|
3191
|
+
const i = r || a;
|
|
3192
|
+
console.warn(`${e}. ${t}. ${a}. ${i}`, n);
|
|
3141
3193
|
const s = {
|
|
3142
3194
|
code: a,
|
|
3143
3195
|
origin: e,
|
|
3144
3196
|
method: t,
|
|
3145
|
-
message:
|
|
3146
|
-
data:
|
|
3197
|
+
message: i,
|
|
3198
|
+
data: n
|
|
3147
3199
|
};
|
|
3148
3200
|
this._buffer.push(C({
|
|
3149
3201
|
type: "editor:warning"
|
|
@@ -3157,12 +3209,12 @@ class ue {
|
|
|
3157
3209
|
/**
|
|
3158
3210
|
* Конструктор класса ImageEditor.
|
|
3159
3211
|
* @param {string} canvasId - идентификатор канваса, в котором будет создан редактор
|
|
3160
|
-
* @param {
|
|
3212
|
+
* @param {CanvasOptions} options - опции и настройки редактора
|
|
3161
3213
|
*/
|
|
3162
3214
|
constructor(e, t) {
|
|
3163
3215
|
this.options = t;
|
|
3164
|
-
const { defaultScale: a, minZoom: r, maxZoom:
|
|
3165
|
-
this.containerId = e, this.editorId = `${e}-${A()}`, this.clipboard = null, this.defaultZoom = a, this.minZoom = r || ht, this.maxZoom =
|
|
3216
|
+
const { defaultScale: a, minZoom: r, maxZoom: n } = t;
|
|
3217
|
+
this.containerId = e, this.editorId = `${e}-${A()}`, this.clipboard = null, this.defaultZoom = a, this.minZoom = r || ht, this.maxZoom = n || gt, this.init();
|
|
3166
3218
|
}
|
|
3167
3219
|
init() {
|
|
3168
3220
|
return Q(this, null, function* () {
|
|
@@ -3171,14 +3223,14 @@ class ue {
|
|
|
3171
3223
|
editorContainerHeight: t,
|
|
3172
3224
|
canvasWrapperWidth: a,
|
|
3173
3225
|
canvasWrapperHeight: r,
|
|
3174
|
-
canvasCSSWidth:
|
|
3175
|
-
canvasCSSHeight:
|
|
3226
|
+
canvasCSSWidth: n,
|
|
3227
|
+
canvasCSSHeight: i,
|
|
3176
3228
|
initialImage: s,
|
|
3177
3229
|
initialStateJSON: c,
|
|
3178
3230
|
scaleType: u,
|
|
3179
3231
|
_onReadyCallback: d
|
|
3180
3232
|
} = this.options;
|
|
3181
|
-
if (Ke.apply(), this.canvas = new Ue(this.containerId, this.options), this.moduleLoader = new He(), this.workerManager = new Pe(), this.errorManager = new $({ editor: this }), this.historyManager = new lt({ editor: this }), this.toolbar = new dt({ editor: this }), this.transformManager = new ft({ editor: this }), this.canvasManager = new Mt({ editor: this }), this.imageManager = new D({ editor: this }), this.layerManager = new K({ editor: this }), this.shapeManager = new yt({ editor: this }), this.interactionBlocker = new jt({ editor: this }), this.clipboardManager = new pt({ editor: this }), this.objectLockManager = new bt({ editor: this }), this.groupingManager = new It({ editor: this }), this.selectionManager = new At({ editor: this }), this.deletionManager = new St({ editor: this }), this._createMontageArea(), this._createClippingArea(), this.listeners = new R({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(e), this.canvasManager.setEditorContainerHeight(t), this.canvasManager.setCanvasWrapperWidth(a), this.canvasManager.setCanvasWrapperHeight(r), this.canvasManager.setCanvasCSSWidth(
|
|
3233
|
+
if (Ke.apply(), this.canvas = new Ue(this.containerId, this.options), this.moduleLoader = new He(), this.workerManager = new Pe(), this.errorManager = new $({ editor: this }), this.historyManager = new lt({ editor: this }), this.toolbar = new dt({ editor: this }), this.transformManager = new ft({ editor: this }), this.canvasManager = new Mt({ editor: this }), this.imageManager = new D({ editor: this }), this.layerManager = new K({ editor: this }), this.shapeManager = new yt({ editor: this }), this.interactionBlocker = new jt({ editor: this }), this.clipboardManager = new pt({ editor: this }), this.objectLockManager = new bt({ editor: this }), this.groupingManager = new It({ editor: this }), this.selectionManager = new At({ editor: this }), this.deletionManager = new St({ editor: this }), this._createMontageArea(), this._createClippingArea(), this.listeners = new R({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(e), this.canvasManager.setEditorContainerHeight(t), this.canvasManager.setCanvasWrapperWidth(a), this.canvasManager.setCanvasWrapperHeight(r), this.canvasManager.setCanvasCSSWidth(n), this.canvasManager.setCanvasCSSHeight(i), s != null && s.source) {
|
|
3182
3234
|
const {
|
|
3183
3235
|
source: l,
|
|
3184
3236
|
scale: h = `image-${u}`,
|
|
@@ -3341,10 +3393,10 @@ function Et(o, e = {}) {
|
|
|
3341
3393
|
if (!a)
|
|
3342
3394
|
return Promise.reject(new Error(`Контейнер с ID "${o}" не найден.`));
|
|
3343
3395
|
const r = document.createElement("canvas");
|
|
3344
|
-
return r.id = `${o}-canvas`, a.appendChild(r), t.editorContainer = a, new Promise((
|
|
3345
|
-
t._onReadyCallback =
|
|
3346
|
-
const
|
|
3347
|
-
window[o] =
|
|
3396
|
+
return r.id = `${o}-canvas`, a.appendChild(r), t.editorContainer = a, new Promise((n) => {
|
|
3397
|
+
t._onReadyCallback = n;
|
|
3398
|
+
const i = new ue(r.id, t);
|
|
3399
|
+
window[o] = i;
|
|
3348
3400
|
});
|
|
3349
3401
|
}
|
|
3350
3402
|
export {
|