@anu3ev/fabric-image-editor 0.5.17 → 0.5.18
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 +226 -224
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var cs = Object.defineProperty, ds = Object.defineProperties;
|
|
2
2
|
var ls = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var Xt = Object.getOwnPropertySymbols;
|
|
4
4
|
var Re = Object.prototype.hasOwnProperty, _e = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var De = (h, t, e) => t in h ? cs(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, B = (h, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
7
|
Re.call(t, e) && De(h, e, t[e]);
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
8
|
+
if (Xt)
|
|
9
|
+
for (var e of Xt(t))
|
|
10
10
|
_e.call(t, e) && De(h, e, t[e]);
|
|
11
11
|
return h;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, vt = (h, t) => ds(h, ls(t));
|
|
13
|
+
var bt = (h, t) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var s in h)
|
|
16
16
|
Re.call(h, s) && t.indexOf(s) < 0 && (e[s] = h[s]);
|
|
17
|
-
if (h != null &&
|
|
18
|
-
for (var s of
|
|
17
|
+
if (h != null && Xt)
|
|
18
|
+
for (var s of Xt(h))
|
|
19
19
|
t.indexOf(s) < 0 && _e.call(h, s) && (e[s] = h[s]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
@@ -35,7 +35,7 @@ var k = (h, t, e) => new Promise((s, n) => {
|
|
|
35
35
|
}, a = (r) => r.done ? s(r.value) : Promise.resolve(r.value).then(o, i);
|
|
36
36
|
a((e = e.apply(h, t)).next());
|
|
37
37
|
});
|
|
38
|
-
import { ActiveSelection as U, Textbox as ot, util as dt, controlsUtils as xe, InteractiveFabricObject as Ne, Point as et, FitContentLayout as Be, loadSVGFromURL as hs, FabricImage as
|
|
38
|
+
import { ActiveSelection as U, Textbox as ot, util as dt, controlsUtils as xe, InteractiveFabricObject as Ne, Point as et, FitContentLayout as Be, loadSVGFromURL as hs, FabricImage as Ut, Gradient as ke, Rect as us, Circle as gs, Triangle as fs, Group as Et, Color as ps, classRegistry as ze, loadSVGFromString as ms, Canvas as ys, Pattern as vs } from "fabric";
|
|
39
39
|
import { create as bs } from "jsondiffpatch";
|
|
40
40
|
import Ms from "diff-match-patch";
|
|
41
41
|
var ws = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", V = function() {
|
|
@@ -463,50 +463,50 @@ class js {
|
|
|
463
463
|
this.worker.terminate();
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
const rt = 12, Is = 2,
|
|
467
|
-
function
|
|
466
|
+
const rt = 12, Is = 2, he = 8, ue = 20, Cs = 100, ge = 20, fe = 8, Ts = 100, te = 32, ve = 1, Es = "#2B2D33", be = "#3D8BF4", Me = "#FFFFFF";
|
|
467
|
+
function Kt(h, t, e, s, n) {
|
|
468
468
|
const o = rt, i = Is;
|
|
469
|
-
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle =
|
|
469
|
+
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle = Me, h.strokeStyle = be, h.lineWidth = ve, h.beginPath(), h.roundRect(-o / 2, -o / 2, o, o, i), h.fill(), h.stroke(), h.restore();
|
|
470
470
|
}
|
|
471
471
|
function Ue(h, t, e, s, n) {
|
|
472
|
-
const o =
|
|
473
|
-
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle =
|
|
472
|
+
const o = he, i = ue, a = Cs;
|
|
473
|
+
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle = Me, h.strokeStyle = be, h.lineWidth = ve, h.beginPath(), h.roundRect(-o / 2, -i / 2, o, i, a), h.fill(), h.stroke(), h.restore();
|
|
474
474
|
}
|
|
475
475
|
function Pe(h, t, e, s, n) {
|
|
476
|
-
const o =
|
|
477
|
-
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle =
|
|
476
|
+
const o = ge, i = fe, a = Ts;
|
|
477
|
+
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle = Me, h.strokeStyle = be, h.lineWidth = ve, h.beginPath(), h.roundRect(-o / 2, -i / 2, o, i, a), h.fill(), h.stroke(), h.restore();
|
|
478
478
|
}
|
|
479
479
|
const Os = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", ts = new Image();
|
|
480
480
|
ts.src = Os;
|
|
481
481
|
function Ls(h, t, e, s, n) {
|
|
482
|
-
const i =
|
|
482
|
+
const i = te / 2;
|
|
483
483
|
h.save(), h.translate(t, e), h.rotate(dt.degreesToRadians(n.angle)), h.fillStyle = Es, h.beginPath(), h.arc(0, 0, i, 0, 2 * Math.PI), h.fill(), h.drawImage(ts, -i / 2, -i / 2, i, i), h.restore();
|
|
484
484
|
}
|
|
485
485
|
const Ds = {
|
|
486
486
|
// Угловые точки
|
|
487
487
|
tl: {
|
|
488
|
-
render:
|
|
488
|
+
render: Kt,
|
|
489
489
|
sizeX: rt,
|
|
490
490
|
sizeY: rt,
|
|
491
491
|
offsetX: 0,
|
|
492
492
|
offsetY: 0
|
|
493
493
|
},
|
|
494
494
|
tr: {
|
|
495
|
-
render:
|
|
495
|
+
render: Kt,
|
|
496
496
|
sizeX: rt,
|
|
497
497
|
sizeY: rt,
|
|
498
498
|
offsetX: 0,
|
|
499
499
|
offsetY: 0
|
|
500
500
|
},
|
|
501
501
|
bl: {
|
|
502
|
-
render:
|
|
502
|
+
render: Kt,
|
|
503
503
|
sizeX: rt,
|
|
504
504
|
sizeY: rt,
|
|
505
505
|
offsetX: 0,
|
|
506
506
|
offsetY: 0
|
|
507
507
|
},
|
|
508
508
|
br: {
|
|
509
|
-
render:
|
|
509
|
+
render: Kt,
|
|
510
510
|
sizeX: rt,
|
|
511
511
|
sizeY: rt,
|
|
512
512
|
offsetX: 0,
|
|
@@ -515,40 +515,40 @@ const Ds = {
|
|
|
515
515
|
// Середина вертикалей
|
|
516
516
|
ml: {
|
|
517
517
|
render: Ue,
|
|
518
|
-
sizeX:
|
|
519
|
-
sizeY:
|
|
518
|
+
sizeX: he,
|
|
519
|
+
sizeY: ue,
|
|
520
520
|
offsetX: 0,
|
|
521
521
|
offsetY: 0
|
|
522
522
|
},
|
|
523
523
|
mr: {
|
|
524
524
|
render: Ue,
|
|
525
|
-
sizeX:
|
|
526
|
-
sizeY:
|
|
525
|
+
sizeX: he,
|
|
526
|
+
sizeY: ue,
|
|
527
527
|
offsetX: 0,
|
|
528
528
|
offsetY: 0
|
|
529
529
|
},
|
|
530
530
|
// Середина горизонталей
|
|
531
531
|
mt: {
|
|
532
532
|
render: Pe,
|
|
533
|
-
sizeX:
|
|
534
|
-
sizeY:
|
|
533
|
+
sizeX: ge,
|
|
534
|
+
sizeY: fe,
|
|
535
535
|
offsetX: 0,
|
|
536
536
|
offsetY: 0
|
|
537
537
|
},
|
|
538
538
|
mb: {
|
|
539
539
|
render: Pe,
|
|
540
|
-
sizeX:
|
|
541
|
-
sizeY:
|
|
540
|
+
sizeX: ge,
|
|
541
|
+
sizeY: fe,
|
|
542
542
|
offsetX: 0,
|
|
543
543
|
offsetY: 0
|
|
544
544
|
},
|
|
545
545
|
// Специальный «rotate» контрол
|
|
546
546
|
mtr: {
|
|
547
547
|
render: Ls,
|
|
548
|
-
sizeX:
|
|
549
|
-
sizeY:
|
|
548
|
+
sizeX: te,
|
|
549
|
+
sizeY: te,
|
|
550
550
|
offsetX: 0,
|
|
551
|
-
offsetY:
|
|
551
|
+
offsetY: -te
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
class $ {
|
|
@@ -854,8 +854,8 @@ z.registeredFontKeys = /* @__PURE__ */ new Set(), z.descriptorDefaults = {
|
|
|
854
854
|
featureSettings: "normal",
|
|
855
855
|
display: "auto"
|
|
856
856
|
};
|
|
857
|
-
let
|
|
858
|
-
const Rs = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi44NzUgMi41YS42MjUuNjI1IDAgMCAwLS42MjUuNjI0VjYuMjVIMy4xMjVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2MTBjMCAuMzQ1LjI4LjYyNS42MjUuNjI1aDEwYy4zNDUgMCAuNjI1LS4yOC42MjUtLjYyNXYtMy4xMjZoMy4xMjVjLjM0NSAwIC42MjUtLjI4LjYyNS0uNjI1di0xMGEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTEwWm02Ljg3NSAxMGgyLjVWMy43NU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jYyNWEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2LjYyNWg1Wk01IDE2LjI1VjVoMTB2MTEuMjVINVpNOC4xMjUgNy41Yy4zNDUgMCAuNjI1LjI4LjYyNS42MjV2NWEuNjI1LjYyNSAwIDEgMS0xLjI1IDB2LTVjMC0uMzQ1LjI4LS42MjUuNjI1LS42MjVabTQuMzc1IDUuNjI1di01YS42MjUuNjI1IDAgMCAwLTEuMjUgMHY1YS42MjUuNjI1IDAgMSAwIDEuMjUgMFoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==", Pt = {
|
|
859
859
|
style: {
|
|
860
860
|
position: "absolute",
|
|
861
861
|
display: "none",
|
|
@@ -965,11 +965,11 @@ class Ps {
|
|
|
965
965
|
_initToolbar() {
|
|
966
966
|
if (!this.options.showToolbar) return;
|
|
967
967
|
const t = this.options.toolbar || {};
|
|
968
|
-
this.config =
|
|
969
|
-
style: B(B({},
|
|
970
|
-
btnStyle: B(B({},
|
|
971
|
-
icons: B(B({},
|
|
972
|
-
handlers: B(B({},
|
|
968
|
+
this.config = vt(B(B({}, Pt), t), {
|
|
969
|
+
style: B(B({}, Pt.style), t.style || {}),
|
|
970
|
+
btnStyle: B(B({}, Pt.btnStyle), t.btnStyle || {}),
|
|
971
|
+
icons: B(B({}, Pt.icons), t.icons || {}),
|
|
972
|
+
handlers: B(B({}, Pt.handlers), t.handlers || {})
|
|
973
973
|
}), this.currentTarget = null, this.currentLocked = !1, this.isTransforming = !1, this.isTemporarilyHidden = !1, this._onMouseDown = this._handleMouseDown.bind(this), this._onObjectMoving = this._startTransform.bind(this), this._onObjectScaling = this._startTransform.bind(this), this._onObjectRotating = this._startTransform.bind(this), this._onMouseUp = this._endTransform.bind(this), this._onObjectModified = this._endTransform.bind(this), this._onSelectionChange = this._updateToolbar.bind(this), this._onSelectionClear = () => {
|
|
974
974
|
this.el.style.display = "none";
|
|
975
975
|
}, this._createDOM(), this._bindEvents();
|
|
@@ -1086,7 +1086,7 @@ class Ps {
|
|
|
1086
1086
|
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("after:render", this._onSelectionChange), this.canvas.off("selection:cleared", this._onSelectionClear), this.el.remove();
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
|
-
const
|
|
1089
|
+
const Ws = {
|
|
1090
1090
|
position: "absolute",
|
|
1091
1091
|
display: "none",
|
|
1092
1092
|
background: "#2B2D33",
|
|
@@ -1100,8 +1100,8 @@ const Fs = {
|
|
|
1100
1100
|
"pointer-events": "none",
|
|
1101
1101
|
"white-space": "nowrap",
|
|
1102
1102
|
"box-shadow": "0 2px 8px rgba(0, 0, 0, 0.2)"
|
|
1103
|
-
},
|
|
1104
|
-
class
|
|
1103
|
+
}, We = 16, Fe = 16, Fs = "fabric-editor-angle-indicator";
|
|
1104
|
+
class we {
|
|
1105
1105
|
constructor({ editor: t }) {
|
|
1106
1106
|
this.isActive = !1, this.currentAngle = 0, this.editor = t, this.canvas = t.canvas, this.options = t.options, this._createDOM(), this._bindEvents();
|
|
1107
1107
|
}
|
|
@@ -1109,7 +1109,7 @@ class be {
|
|
|
1109
1109
|
* Создание DOM-элемента индикатора
|
|
1110
1110
|
*/
|
|
1111
1111
|
_createDOM() {
|
|
1112
|
-
this.el = document.createElement("div"), this.el.className =
|
|
1112
|
+
this.el = document.createElement("div"), this.el.className = Fs, Object.entries(Ws).forEach(([t, e]) => {
|
|
1113
1113
|
this.el.style.setProperty(t, e);
|
|
1114
1114
|
}), this.canvas.wrapperEl.appendChild(this.el);
|
|
1115
1115
|
}
|
|
@@ -1129,7 +1129,7 @@ class be {
|
|
|
1129
1129
|
return;
|
|
1130
1130
|
}
|
|
1131
1131
|
const s = e.angle || 0;
|
|
1132
|
-
this.currentAngle =
|
|
1132
|
+
this.currentAngle = we._normalizeAngle(s), this.el.textContent = `${this.currentAngle}°`, this._positionIndicator(t.e), this.isActive || this._showIndicator();
|
|
1133
1133
|
}
|
|
1134
1134
|
/**
|
|
1135
1135
|
* Обработчик отпускания кнопки мыши
|
|
@@ -1160,9 +1160,9 @@ class be {
|
|
|
1160
1160
|
*/
|
|
1161
1161
|
_positionIndicator(t) {
|
|
1162
1162
|
const e = this.canvas.wrapperEl.getBoundingClientRect();
|
|
1163
|
-
let s = t.clientX - e.left +
|
|
1163
|
+
let s = t.clientX - e.left + We, n = t.clientY - e.top + Fe;
|
|
1164
1164
|
const o = this.el.getBoundingClientRect(), i = o.width, a = o.height;
|
|
1165
|
-
s + i > e.width && (s = t.clientX - e.left - i -
|
|
1165
|
+
s + i > e.width && (s = t.clientX - e.left - i - We), n + a > e.height && (n = t.clientY - e.top - a - Fe), this.el.style.left = `${s}px`, this.el.style.top = `${n}px`;
|
|
1166
1166
|
}
|
|
1167
1167
|
/**
|
|
1168
1168
|
* Показать индикатор
|
|
@@ -1473,7 +1473,7 @@ class Ys {
|
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
|
-
const Hs = 0.1, Zs = 2, Ye = 0.1, Gs = 90, Rt = 16, _t = 16,
|
|
1476
|
+
const Hs = 0.1, Zs = 2, Ye = 0.1, Gs = 90, Rt = 16, _t = 16, wt = 4096, St = 4096, He = "application/image-editor:", Qt = [
|
|
1477
1477
|
"format",
|
|
1478
1478
|
"uppercase",
|
|
1479
1479
|
"textCaseRaw",
|
|
@@ -1567,17 +1567,17 @@ class ct {
|
|
|
1567
1567
|
const j = yield hs(M);
|
|
1568
1568
|
S = dt.groupSVGElements(j.objects, j.options);
|
|
1569
1569
|
} else
|
|
1570
|
-
S = yield
|
|
1570
|
+
S = yield Ut.fromURL(M, { crossOrigin: "anonymous" });
|
|
1571
1571
|
const { width: y, height: b } = S;
|
|
1572
|
-
if (S instanceof
|
|
1572
|
+
if (S instanceof Ut) {
|
|
1573
1573
|
const j = S.getElement();
|
|
1574
1574
|
let A = "";
|
|
1575
|
-
if (j instanceof HTMLImageElement ? A = j.src : j instanceof HTMLCanvasElement && (A = j.toDataURL()), b >
|
|
1575
|
+
if (j instanceof HTMLImageElement ? A = j.src : j instanceof HTMLCanvasElement && (A = j.toDataURL()), b > St || y > wt) {
|
|
1576
1576
|
const C = yield this.resizeImageToBoundaries(A, "max"), w = URL.createObjectURL(C);
|
|
1577
|
-
this._createdBlobUrls.push(w), S = yield
|
|
1577
|
+
this._createdBlobUrls.push(w), S = yield Ut.fromURL(w, { crossOrigin: "anonymous" });
|
|
1578
1578
|
} else if (b < _t || y < Rt) {
|
|
1579
1579
|
const C = yield this.resizeImageToBoundaries(A, "min"), w = URL.createObjectURL(C);
|
|
1580
|
-
this._createdBlobUrls.push(w), S = yield
|
|
1580
|
+
this._createdBlobUrls.push(w), S = yield Ut.fromURL(w, { crossOrigin: "anonymous" });
|
|
1581
1581
|
}
|
|
1582
1582
|
}
|
|
1583
1583
|
if (S.set("id", `${S.type}-${V()}`), S.set("format", p), s === "scale-montage")
|
|
@@ -1630,13 +1630,13 @@ class ct {
|
|
|
1630
1630
|
*/
|
|
1631
1631
|
resizeImageToBoundaries(t, e = "max") {
|
|
1632
1632
|
return k(this, null, function* () {
|
|
1633
|
-
let s = `Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ${
|
|
1633
|
+
let s = `Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ${wt}x${St}`;
|
|
1634
1634
|
e === "min" && (s = `Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ${Rt}x${_t}`);
|
|
1635
1635
|
const n = {
|
|
1636
1636
|
dataURL: t,
|
|
1637
1637
|
sizeType: e,
|
|
1638
|
-
maxWidth:
|
|
1639
|
-
maxHeight:
|
|
1638
|
+
maxWidth: wt,
|
|
1639
|
+
maxHeight: St,
|
|
1640
1640
|
minWidth: Rt,
|
|
1641
1641
|
minHeight: _t
|
|
1642
1642
|
};
|
|
@@ -1721,13 +1721,13 @@ class ct {
|
|
|
1721
1721
|
format: [T, E]
|
|
1722
1722
|
});
|
|
1723
1723
|
if (x.addImage(String(I), "JPG", 0, 0, T, E), n) {
|
|
1724
|
-
const
|
|
1724
|
+
const F = {
|
|
1725
1725
|
image: x.output("datauristring"),
|
|
1726
1726
|
format: "pdf",
|
|
1727
1727
|
contentType: "application/pdf",
|
|
1728
1728
|
fileName: e
|
|
1729
1729
|
};
|
|
1730
|
-
return i.fire("editor:canvas-exported",
|
|
1730
|
+
return i.fire("editor:canvas-exported", F), F;
|
|
1731
1731
|
}
|
|
1732
1732
|
const N = x.output("blob"), D = {
|
|
1733
1733
|
image: new File([N], e, { type: "application/pdf" }),
|
|
@@ -1808,7 +1808,7 @@ class ct {
|
|
|
1808
1808
|
};
|
|
1809
1809
|
return a.fire("editor:object-exported", v), v;
|
|
1810
1810
|
}
|
|
1811
|
-
if (o && c instanceof
|
|
1811
|
+
if (o && c instanceof Ut) {
|
|
1812
1812
|
const p = yield createImageBitmap(c.getElement()), m = yield r.post(
|
|
1813
1813
|
"toDataURL",
|
|
1814
1814
|
{
|
|
@@ -2014,7 +2014,7 @@ class Qs {
|
|
|
2014
2014
|
canvas: o,
|
|
2015
2015
|
montageArea: i,
|
|
2016
2016
|
options: { canvasBackstoreWidth: a }
|
|
2017
|
-
} = this.editor, { width: r, height: c } = i, d = Tt(Number(t), Rt,
|
|
2017
|
+
} = this.editor, { width: r, height: c } = i, d = Tt(Number(t), Rt, wt);
|
|
2018
2018
|
if (!a || a === "auto" || n ? this.adaptCanvasToContainer() : a ? this.setCanvasBackstoreWidth(Number(a)) : this.setCanvasBackstoreWidth(d), i.set({ width: d }), (f = o.clipPath) == null || f.set({ width: d }), e) {
|
|
2019
2019
|
const p = d / r, m = Ze(c, p);
|
|
2020
2020
|
this.setResolutionHeight(m);
|
|
@@ -2044,7 +2044,7 @@ class Qs {
|
|
|
2044
2044
|
canvas: o,
|
|
2045
2045
|
montageArea: i,
|
|
2046
2046
|
options: { canvasBackstoreHeight: a }
|
|
2047
|
-
} = this.editor, { width: r, height: c } = i, d = Tt(Number(t), _t,
|
|
2047
|
+
} = this.editor, { width: r, height: c } = i, d = Tt(Number(t), _t, St);
|
|
2048
2048
|
if (!a || a === "auto" || n ? this.adaptCanvasToContainer() : a ? this.setCanvasBackstoreHeight(Number(a)) : this.setCanvasBackstoreHeight(d), i.set({ height: d }), (f = o.clipPath) == null || f.set({ height: d }), e) {
|
|
2049
2049
|
const p = d / c, m = Ze(r, p);
|
|
2050
2050
|
this.setResolutionWidth(m);
|
|
@@ -2097,7 +2097,7 @@ class Qs {
|
|
|
2097
2097
|
*/
|
|
2098
2098
|
setCanvasBackstoreWidth(t) {
|
|
2099
2099
|
if (!t || typeof t != "number") return;
|
|
2100
|
-
const e = Tt(t, Rt,
|
|
2100
|
+
const e = Tt(t, Rt, wt);
|
|
2101
2101
|
this.editor.canvas.setDimensions({ width: e }, { backstoreOnly: !0 });
|
|
2102
2102
|
}
|
|
2103
2103
|
/**
|
|
@@ -2106,7 +2106,7 @@ class Qs {
|
|
|
2106
2106
|
*/
|
|
2107
2107
|
setCanvasBackstoreHeight(t) {
|
|
2108
2108
|
if (!t || typeof t != "number") return;
|
|
2109
|
-
const e = Tt(t, _t,
|
|
2109
|
+
const e = Tt(t, _t, St);
|
|
2110
2110
|
this.editor.canvas.setDimensions({ height: e }, { backstoreOnly: !0 });
|
|
2111
2111
|
}
|
|
2112
2112
|
/**
|
|
@@ -2115,7 +2115,7 @@ class Qs {
|
|
|
2115
2115
|
* с учётом минимальных и максимальных значений.
|
|
2116
2116
|
*/
|
|
2117
2117
|
adaptCanvasToContainer() {
|
|
2118
|
-
const { canvas: t } = this.editor, e = this.getEditorContainer(), s = e.clientWidth, n = e.clientHeight, o = Tt(s, Rt,
|
|
2118
|
+
const { canvas: t } = this.editor, e = this.getEditorContainer(), s = e.clientWidth, n = e.clientHeight, o = Tt(s, Rt, wt), i = Tt(n, _t, St);
|
|
2119
2119
|
t.setDimensions({ width: o, height: i }, { backstoreOnly: !0 });
|
|
2120
2120
|
}
|
|
2121
2121
|
/**
|
|
@@ -2317,7 +2317,7 @@ class Qs {
|
|
|
2317
2317
|
} = this.editor, c = t || n.getActiveObject();
|
|
2318
2318
|
if (!Ks(c)) return;
|
|
2319
2319
|
const { width: d, height: l } = c;
|
|
2320
|
-
let u = Math.min(d,
|
|
2320
|
+
let u = Math.min(d, wt), g = Math.min(l, St);
|
|
2321
2321
|
if (e) {
|
|
2322
2322
|
const {
|
|
2323
2323
|
width: f,
|
|
@@ -3164,7 +3164,7 @@ class Ot {
|
|
|
3164
3164
|
}) ? !1 : t.type === "linear" && e.type === "linear" ? Math.abs(t.coords.x1 - e.coords.x1) < 1e-4 && Math.abs(t.coords.y1 - e.coords.y1) < 1e-4 && Math.abs(t.coords.x2 - e.coords.x2) < 1e-4 && Math.abs(t.coords.y2 - e.coords.y2) < 1e-4 : t.type === "radial" && e.type === "radial" ? Math.abs(t.coords.x1 - e.coords.x1) < 1e-4 && Math.abs(t.coords.y1 - e.coords.y1) < 1e-4 && Math.abs(t.coords.x2 - e.coords.x2) < 1e-4 && Math.abs(t.coords.y2 - e.coords.y2) < 1e-4 && Math.abs(t.coords.r1 - e.coords.r1) < 1e-4 && Math.abs(t.coords.r2 - e.coords.r2) < 1e-4 : !1;
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
-
class
|
|
3167
|
+
class ee {
|
|
3168
3168
|
constructor({ editor: t }) {
|
|
3169
3169
|
this.editor = t;
|
|
3170
3170
|
}
|
|
@@ -3197,7 +3197,7 @@ class te {
|
|
|
3197
3197
|
const { canvas: s, historyManager: n } = this.editor;
|
|
3198
3198
|
n.suspendHistory();
|
|
3199
3199
|
const o = t || s.getActiveObject();
|
|
3200
|
-
o && (o instanceof U ?
|
|
3200
|
+
o && (o instanceof U ? ee._moveSelectionForward(s, o) : s.bringObjectForward(o), s.renderAll(), n.resumeHistory(), e || n.saveState(), s.fire("editor:object-bring-forward", {
|
|
3201
3201
|
object: o,
|
|
3202
3202
|
withoutSave: e
|
|
3203
3203
|
}));
|
|
@@ -3248,7 +3248,7 @@ class te {
|
|
|
3248
3248
|
} = this.editor;
|
|
3249
3249
|
o.suspendHistory();
|
|
3250
3250
|
const r = t || s.getActiveObject();
|
|
3251
|
-
r && (r instanceof U ?
|
|
3251
|
+
r && (r instanceof U ? ee._moveSelectionBackwards(s, r) : s.sendObjectBackwards(r), a && s.sendObjectToBack(a), s.sendObjectToBack(n), i && s.sendObjectToBack(i), s.renderAll(), o.resumeHistory(), e || o.saveState(), s.fire("editor:object-send-backwards", {
|
|
3252
3252
|
object: r,
|
|
3253
3253
|
withoutSave: e
|
|
3254
3254
|
}));
|
|
@@ -3324,7 +3324,7 @@ class tn {
|
|
|
3324
3324
|
width: n = 100,
|
|
3325
3325
|
height: o = 100,
|
|
3326
3326
|
fill: i = "blue"
|
|
3327
|
-
} = l, a =
|
|
3327
|
+
} = l, a = bt(l, [
|
|
3328
3328
|
"id",
|
|
3329
3329
|
"left",
|
|
3330
3330
|
"top",
|
|
@@ -3365,7 +3365,7 @@ class tn {
|
|
|
3365
3365
|
top: s,
|
|
3366
3366
|
radius: n = 50,
|
|
3367
3367
|
fill: o = "green"
|
|
3368
|
-
} = d, i =
|
|
3368
|
+
} = d, i = bt(d, [
|
|
3369
3369
|
"id",
|
|
3370
3370
|
"left",
|
|
3371
3371
|
"top",
|
|
@@ -3406,7 +3406,7 @@ class tn {
|
|
|
3406
3406
|
width: n = 100,
|
|
3407
3407
|
height: o = 100,
|
|
3408
3408
|
fill: i = "yellow"
|
|
3409
|
-
} = l, a =
|
|
3409
|
+
} = l, a = bt(l, [
|
|
3410
3410
|
"id",
|
|
3411
3411
|
"left",
|
|
3412
3412
|
"top",
|
|
@@ -3456,7 +3456,7 @@ class en {
|
|
|
3456
3456
|
return k(this, null, function* () {
|
|
3457
3457
|
const { canvas: e, errorManager: s } = this.editor;
|
|
3458
3458
|
try {
|
|
3459
|
-
const n = yield t.clone(
|
|
3459
|
+
const n = yield t.clone(Qt);
|
|
3460
3460
|
this.clipboard = n, e.fire("editor:object-copied", { object: n });
|
|
3461
3461
|
} catch (n) {
|
|
3462
3462
|
s.emitError({
|
|
@@ -3483,7 +3483,7 @@ class en {
|
|
|
3483
3483
|
message: "navigator.clipboard не поддерживается в этом браузере или отсутствует HTTPS-соединение."
|
|
3484
3484
|
}), !1;
|
|
3485
3485
|
try {
|
|
3486
|
-
const s = t.toObject(
|
|
3486
|
+
const s = t.toObject(Qt), n = JSON.stringify(s);
|
|
3487
3487
|
return t.type === "image" ? this._copyImageToClipboard(t, n) : this._copyTextToClipboard(n);
|
|
3488
3488
|
} catch (s) {
|
|
3489
3489
|
return e.emitError({
|
|
@@ -3577,7 +3577,7 @@ class en {
|
|
|
3577
3577
|
const { canvas: e } = this.editor, s = t || e.getActiveObject();
|
|
3578
3578
|
if (!s || s.locked) return !1;
|
|
3579
3579
|
try {
|
|
3580
|
-
const n = yield s.clone(
|
|
3580
|
+
const n = yield s.clone(Qt);
|
|
3581
3581
|
return n instanceof U && n.forEachObject((o) => {
|
|
3582
3582
|
o.set({
|
|
3583
3583
|
id: `${o.type}-${V()}`,
|
|
@@ -3663,7 +3663,7 @@ class en {
|
|
|
3663
3663
|
const { canvas: t } = this.editor;
|
|
3664
3664
|
if (!this.clipboard) return !1;
|
|
3665
3665
|
try {
|
|
3666
|
-
const e = yield this.clipboard.clone(
|
|
3666
|
+
const e = yield this.clipboard.clone(Qt);
|
|
3667
3667
|
return t.discardActiveObject(), e instanceof U && e.forEachObject((s) => {
|
|
3668
3668
|
s.set({
|
|
3669
3669
|
id: `${s.type}-${V()}`,
|
|
@@ -3688,7 +3688,7 @@ class en {
|
|
|
3688
3688
|
});
|
|
3689
3689
|
}
|
|
3690
3690
|
}
|
|
3691
|
-
class
|
|
3691
|
+
class se {
|
|
3692
3692
|
constructor({ editor: t }) {
|
|
3693
3693
|
this.editor = t;
|
|
3694
3694
|
}
|
|
@@ -3714,7 +3714,7 @@ class ee {
|
|
|
3714
3714
|
editable: !1,
|
|
3715
3715
|
locked: !0
|
|
3716
3716
|
};
|
|
3717
|
-
i.set(a), !e &&
|
|
3717
|
+
i.set(a), !e && se._isGroupOrSelection(i) && i.getObjects().forEach((c) => {
|
|
3718
3718
|
c.set(a);
|
|
3719
3719
|
}), n.renderAll(), s || o.saveState(), n.fire("editor:object-locked", {
|
|
3720
3720
|
object: i,
|
|
@@ -3743,7 +3743,7 @@ class ee {
|
|
|
3743
3743
|
editable: !0,
|
|
3744
3744
|
locked: !1
|
|
3745
3745
|
};
|
|
3746
|
-
o.set(i),
|
|
3746
|
+
o.set(i), se._isGroupOrSelection(o) && o.getObjects().forEach((a) => {
|
|
3747
3747
|
a.set(i);
|
|
3748
3748
|
}), s.renderAll(), e || n.saveState(), s.fire("editor:object-unlocked", {
|
|
3749
3749
|
object: o,
|
|
@@ -3870,7 +3870,7 @@ class nn {
|
|
|
3870
3870
|
o && s.lockObject({ object: i, skipInnerObjects: !0, withoutSave: !0 }), t.setActiveObject(i), t.requestRenderAll(), t.fire("editor:all-objects-selected", { selected: i });
|
|
3871
3871
|
}
|
|
3872
3872
|
}
|
|
3873
|
-
class
|
|
3873
|
+
class Se {
|
|
3874
3874
|
constructor({ editor: t }) {
|
|
3875
3875
|
this.editor = t;
|
|
3876
3876
|
}
|
|
@@ -3917,7 +3917,7 @@ class Me {
|
|
|
3917
3917
|
s || o.suspendHistory();
|
|
3918
3918
|
const r = [];
|
|
3919
3919
|
if (a.forEach((d) => {
|
|
3920
|
-
if (
|
|
3920
|
+
if (Se._isUngroupableGroup(d)) {
|
|
3921
3921
|
const l = this._handleGroupDeletion(d);
|
|
3922
3922
|
r.push(...l);
|
|
3923
3923
|
return;
|
|
@@ -3932,7 +3932,7 @@ class Me {
|
|
|
3932
3932
|
return n.fire("editor:objects-deleted", c), c;
|
|
3933
3933
|
}
|
|
3934
3934
|
}
|
|
3935
|
-
const
|
|
3935
|
+
const Mt = {
|
|
3936
3936
|
IMAGE_MANAGER: {
|
|
3937
3937
|
/**
|
|
3938
3938
|
* Некорректный Content-Type изображения
|
|
@@ -4037,7 +4037,7 @@ const bt = {
|
|
|
4037
4037
|
APPLY_FAILED: "TEMPLATE_APPLY_FAILED"
|
|
4038
4038
|
}
|
|
4039
4039
|
};
|
|
4040
|
-
class
|
|
4040
|
+
class Yt {
|
|
4041
4041
|
constructor({ editor: t }) {
|
|
4042
4042
|
this._buffer = [], this.editor = t;
|
|
4043
4043
|
}
|
|
@@ -4064,7 +4064,7 @@ class Wt {
|
|
|
4064
4064
|
* @fires editor:error
|
|
4065
4065
|
*/
|
|
4066
4066
|
emitError({ origin: t = "ImageEditor", method: e = "Unknown Method", code: s, data: n, message: o }) {
|
|
4067
|
-
if (!
|
|
4067
|
+
if (!Yt.isValidErrorCode(s)) {
|
|
4068
4068
|
console.warn("Неизвестный код ошибки: ", { code: s, origin: t, method: e });
|
|
4069
4069
|
return;
|
|
4070
4070
|
}
|
|
@@ -4093,7 +4093,7 @@ class Wt {
|
|
|
4093
4093
|
* @fires editor:warning
|
|
4094
4094
|
*/
|
|
4095
4095
|
emitWarning({ origin: t = "ImageEditor", method: e = "Unknown Method", code: s, message: n, data: o }) {
|
|
4096
|
-
if (!
|
|
4096
|
+
if (!Yt.isValidErrorCode(s)) {
|
|
4097
4097
|
console.warn("Неизвестный код предупреждения: ", { code: s, origin: t, method: e });
|
|
4098
4098
|
return;
|
|
4099
4099
|
}
|
|
@@ -4116,7 +4116,7 @@ class Wt {
|
|
|
4116
4116
|
* @returns true, если код допустим, иначе false
|
|
4117
4117
|
*/
|
|
4118
4118
|
static isValidErrorCode(t) {
|
|
4119
|
-
return t ? Object.values(
|
|
4119
|
+
return t ? Object.values(Mt).some((e) => Object.values(e).includes(t)) : !1;
|
|
4120
4120
|
}
|
|
4121
4121
|
}
|
|
4122
4122
|
class on {
|
|
@@ -4233,7 +4233,7 @@ const at = ({
|
|
|
4233
4233
|
}
|
|
4234
4234
|
_getTransformedDimensions(t = {}) {
|
|
4235
4235
|
const { width: e, height: s } = this._getBackgroundDimensions();
|
|
4236
|
-
return super._getTransformedDimensions(
|
|
4236
|
+
return super._getTransformedDimensions(vt(B({}, t), {
|
|
4237
4237
|
width: e,
|
|
4238
4238
|
height: s
|
|
4239
4239
|
}));
|
|
@@ -4243,7 +4243,7 @@ const at = ({
|
|
|
4243
4243
|
*/
|
|
4244
4244
|
toObject(t = []) {
|
|
4245
4245
|
const e = super.toObject(t);
|
|
4246
|
-
return
|
|
4246
|
+
return vt(B({}, e), {
|
|
4247
4247
|
backgroundOpacity: this.backgroundOpacity,
|
|
4248
4248
|
paddingTop: this.paddingTop,
|
|
4249
4249
|
paddingRight: this.paddingRight,
|
|
@@ -4306,7 +4306,7 @@ const at = ({
|
|
|
4306
4306
|
try {
|
|
4307
4307
|
s = new ps(t);
|
|
4308
4308
|
} catch (o) {
|
|
4309
|
-
return
|
|
4309
|
+
return Yt.emitError({
|
|
4310
4310
|
origin: "BackgroundTextbox",
|
|
4311
4311
|
method: "_getEffectiveBackgroundFill",
|
|
4312
4312
|
code: "INVALID_COLOR_VALUE",
|
|
@@ -4368,10 +4368,10 @@ Dt.type = "background-textbox", Dt.cacheProperties = [
|
|
|
4368
4368
|
"radiusBottomRight",
|
|
4369
4369
|
"radiusBottomLeft"
|
|
4370
4370
|
];
|
|
4371
|
-
let
|
|
4371
|
+
let ne = Dt;
|
|
4372
4372
|
const an = () => {
|
|
4373
4373
|
var h;
|
|
4374
|
-
(h = ze) != null && h.setClass && ze.setClass(
|
|
4374
|
+
(h = ze) != null && h.setClass && ze.setClass(ne, "background-textbox");
|
|
4375
4375
|
}, rn = ({ textbox: h }) => {
|
|
4376
4376
|
var s, n;
|
|
4377
4377
|
if (!h.isEditing) return null;
|
|
@@ -4389,7 +4389,7 @@ const an = () => {
|
|
|
4389
4389
|
if (!t) return !1;
|
|
4390
4390
|
const e = (n = (s = h.text) == null ? void 0 : s.length) != null ? n : 0;
|
|
4391
4391
|
return e <= 0 ? !1 : t.start <= 0 && t.end >= e;
|
|
4392
|
-
},
|
|
4392
|
+
}, re = ({
|
|
4393
4393
|
textbox: h,
|
|
4394
4394
|
styles: t,
|
|
4395
4395
|
range: e
|
|
@@ -4411,8 +4411,8 @@ const an = () => {
|
|
|
4411
4411
|
);
|
|
4412
4412
|
if (s.length)
|
|
4413
4413
|
return (n = s[0]) == null ? void 0 : n[e];
|
|
4414
|
-
}, Ve = ({ strokeColor: h, width: t }) => t <= 0 ? null : h != null ? h : "#000000", Xe = ({ width: h = 0 }) => h ? Math.max(0, h) : 0,
|
|
4415
|
-
class
|
|
4414
|
+
}, Ve = ({ strokeColor: h, width: t }) => t <= 0 ? null : h != null ? h : "#000000", Xe = ({ width: h = 0 }) => h ? Math.max(0, h) : 0, ce = ({ value: h }) => typeof h == "string" ? h.toLocaleUpperCase() : "", nt = 0.01;
|
|
4415
|
+
class W {
|
|
4416
4416
|
constructor({ editor: t }) {
|
|
4417
4417
|
var e;
|
|
4418
4418
|
this._handleTextEditingEntered = () => {
|
|
@@ -4420,23 +4420,23 @@ class F {
|
|
|
4420
4420
|
}, this._handleTextEditingExited = (s) => {
|
|
4421
4421
|
var r, c;
|
|
4422
4422
|
const { target: n } = s;
|
|
4423
|
-
if (!
|
|
4423
|
+
if (!W._isTextbox(n)) return;
|
|
4424
4424
|
const o = (r = n.text) != null ? r : "";
|
|
4425
4425
|
if (!!n.uppercase) {
|
|
4426
4426
|
const d = (c = n.textCaseRaw) != null ? c : o.toLocaleLowerCase();
|
|
4427
4427
|
n.textCaseRaw = d;
|
|
4428
4428
|
} else
|
|
4429
4429
|
n.textCaseRaw = o;
|
|
4430
|
-
|
|
4430
|
+
W._roundTextboxDimensions({ textbox: n }) && (n.setCoords(), n.dirty = !0, this.canvas.requestRenderAll()), n.locked || n.set({
|
|
4431
4431
|
lockMovementX: !1,
|
|
4432
4432
|
lockMovementY: !1
|
|
4433
4433
|
}), setTimeout(() => {
|
|
4434
4434
|
this.isTextEditingActive = !1, this.editor.historyManager.saveState();
|
|
4435
4435
|
}, Vs);
|
|
4436
4436
|
}, this._handleObjectScaling = (s) => {
|
|
4437
|
-
var
|
|
4437
|
+
var kt, zt, X, It, Zt, yt, Gt, Ct, je, Ie, Ce, Te, Ee;
|
|
4438
4438
|
const { target: n, transform: o } = s;
|
|
4439
|
-
if (n instanceof U || !
|
|
4439
|
+
if (n instanceof U || !W._isTextbox(n) || !o) return;
|
|
4440
4440
|
n.isScaling = !0;
|
|
4441
4441
|
const i = this._ensureScalingState(n), {
|
|
4442
4442
|
baseWidth: a,
|
|
@@ -4445,9 +4445,9 @@ class F {
|
|
|
4445
4445
|
basePadding: d,
|
|
4446
4446
|
baseRadii: l,
|
|
4447
4447
|
baseStyles: u
|
|
4448
|
-
} = i, g = typeof ((
|
|
4448
|
+
} = i, g = typeof ((kt = o.original) == null ? void 0 : kt.width) == "number" ? o.original.width : void 0, f = typeof ((zt = o.original) == null ? void 0 : zt.left) == "number" ? o.original.left : void 0, p = g != null ? g : a, m = f != null ? f : r, v = (X = o.corner) != null ? X : "", M = (It = o.action) != null ? It : "", S = ["ml", "mr"].includes(v) || M === "scaleX", y = ["mt", "mb"].includes(v) || M === "scaleY", b = ["tl", "tr", "bl", "br"].includes(v) || M === "scale", I = b || y;
|
|
4449
4449
|
if (!S && !y && !b) return;
|
|
4450
|
-
const j = Math.abs((
|
|
4450
|
+
const j = Math.abs((yt = (Zt = n.scaleX) != null ? Zt : o.scaleX) != null ? yt : 1) || 1, A = Math.abs((Ct = (Gt = n.scaleY) != null ? Gt : o.scaleY) != null ? Ct : 1) || 1, C = Math.max(1, p * j), w = Math.max(1, Math.round(C)), T = Math.max(1, c * A), {
|
|
4451
4451
|
paddingTop: E = 0,
|
|
4452
4452
|
paddingRight: P = 0,
|
|
4453
4453
|
paddingBottom: x = 0,
|
|
@@ -4455,7 +4455,7 @@ class F {
|
|
|
4455
4455
|
radiusTopLeft: Z = 0,
|
|
4456
4456
|
radiusTopRight: D = 0,
|
|
4457
4457
|
radiusBottomRight: _ = 0,
|
|
4458
|
-
radiusBottomLeft:
|
|
4458
|
+
radiusBottomLeft: F = 0,
|
|
4459
4459
|
fontSize: G,
|
|
4460
4460
|
width: Y,
|
|
4461
4461
|
originX: K = "left"
|
|
@@ -4469,22 +4469,22 @@ class F {
|
|
|
4469
4469
|
topRight: Math.max(0, l.topRight * A),
|
|
4470
4470
|
bottomRight: Math.max(0, l.bottomRight * A),
|
|
4471
4471
|
bottomLeft: Math.max(0, l.bottomLeft * A)
|
|
4472
|
-
} : l,
|
|
4472
|
+
} : l, At = Object.keys(u).length > 0;
|
|
4473
4473
|
let st;
|
|
4474
|
-
if (I &&
|
|
4475
|
-
const
|
|
4474
|
+
if (I && At) {
|
|
4475
|
+
const ie = {};
|
|
4476
4476
|
Object.entries(u).forEach(([as, Oe]) => {
|
|
4477
4477
|
if (!Oe) return;
|
|
4478
|
-
const
|
|
4479
|
-
Object.entries(Oe).forEach(([rs,
|
|
4480
|
-
if (!
|
|
4481
|
-
const Le = B({},
|
|
4482
|
-
typeof
|
|
4483
|
-
}), Object.keys(
|
|
4484
|
-
}), Object.keys(
|
|
4478
|
+
const ae = {};
|
|
4479
|
+
Object.entries(Oe).forEach(([rs, Vt]) => {
|
|
4480
|
+
if (!Vt) return;
|
|
4481
|
+
const Le = B({}, Vt);
|
|
4482
|
+
typeof Vt.fontSize == "number" && (Le.fontSize = Math.max(1, Vt.fontSize * A)), ae[rs] = Le;
|
|
4483
|
+
}), Object.keys(ae).length && (ie[as] = ae);
|
|
4484
|
+
}), Object.keys(ie).length && (st = ie);
|
|
4485
4485
|
}
|
|
4486
|
-
const lt = (Ie = (je = o.originX) != null ? je : K) != null ? Ie : "left",
|
|
4487
|
-
if (!
|
|
4486
|
+
const lt = (Ie = (je = o.originX) != null ? je : K) != null ? Ie : "left", mt = m + p, jt = m + p / 2, ht = Y != null ? Y : p, ut = w !== ht, oe = Math.abs(T - (G != null ? G : c)) > nt, Ht = Math.abs(H.top - E) > nt || Math.abs(H.right - P) > nt || Math.abs(H.bottom - x) > nt || Math.abs(H.left - N) > nt, xt = Math.abs(q.topLeft - Z) > nt || Math.abs(q.topRight - D) > nt || Math.abs(q.bottomRight - _) > nt || Math.abs(q.bottomLeft - F) > nt;
|
|
4487
|
+
if (!ut && !oe && !Ht && !xt) {
|
|
4488
4488
|
n.set({ scaleX: 1, scaleY: 1 }), o.scaleX = 1, o.scaleY = 1;
|
|
4489
4489
|
return;
|
|
4490
4490
|
}
|
|
@@ -4502,13 +4502,13 @@ class F {
|
|
|
4502
4502
|
scaleX: 1,
|
|
4503
4503
|
scaleY: 1
|
|
4504
4504
|
});
|
|
4505
|
-
const
|
|
4506
|
-
|
|
4507
|
-
const
|
|
4508
|
-
let
|
|
4509
|
-
|
|
4505
|
+
const Nt = W._roundTextboxDimensions({ textbox: n });
|
|
4506
|
+
Nt && (n.dirty = !0);
|
|
4507
|
+
const gt = (Ce = n.width) != null ? Ce : w, Bt = gt !== ht;
|
|
4508
|
+
let ft = m;
|
|
4509
|
+
Bt && (S || b) && (lt === "right" ? ft = mt - gt : lt === "center" && (ft = jt - gt / 2)), n.set({ left: ft }), i.baseLeft = ft, o.scaleX = 1, o.scaleY = 1;
|
|
4510
4510
|
const { original: it } = o;
|
|
4511
|
-
it && (it.scaleX = 1, it.scaleY = 1, it.width =
|
|
4511
|
+
it && (it.scaleX = 1, it.scaleY = 1, it.width = gt, it.height = n.height, it.left = ft), n.setCoords(), this.canvas.requestRenderAll(), i.baseWidth = gt, i.baseFontSize = (Te = n.fontSize) != null ? Te : T, i.baseStyles = JSON.parse(JSON.stringify((Ee = n.styles) != null ? Ee : {})), i.basePadding = {
|
|
4512
4512
|
top: H.top,
|
|
4513
4513
|
right: H.right,
|
|
4514
4514
|
bottom: H.bottom,
|
|
@@ -4518,19 +4518,19 @@ class F {
|
|
|
4518
4518
|
topRight: q.topRight,
|
|
4519
4519
|
bottomRight: q.bottomRight,
|
|
4520
4520
|
bottomLeft: q.bottomLeft
|
|
4521
|
-
}, i.hasWidthChange =
|
|
4521
|
+
}, i.hasWidthChange = Bt || oe || Ht || xt || Nt;
|
|
4522
4522
|
}, this._handleObjectModified = (s) => {
|
|
4523
4523
|
var M, S, y;
|
|
4524
4524
|
const { target: n } = s;
|
|
4525
4525
|
if (n instanceof U) {
|
|
4526
4526
|
const b = n.getObjects();
|
|
4527
|
-
if (!b.some((w) =>
|
|
4527
|
+
if (!b.some((w) => W._isTextbox(w))) return;
|
|
4528
4528
|
const { scaleX: j = 1, scaleY: A = 1 } = n;
|
|
4529
4529
|
if (Math.abs(j - 1) < nt && Math.abs(A - 1) < nt) return;
|
|
4530
4530
|
this.canvas.discardActiveObject(), b.forEach((w) => {
|
|
4531
4531
|
var T, E, P, x;
|
|
4532
|
-
if (
|
|
4533
|
-
const N = (T = w.scaleX) != null ? T : 1, Z = (E = w.scaleY) != null ? E : 1, D = ((P = w.fontSize) != null ? P : 16) * Z, _ = ((x = w.width) != null ? x : 0) * N,
|
|
4532
|
+
if (W._isTextbox(w)) {
|
|
4533
|
+
const N = (T = w.scaleX) != null ? T : 1, Z = (E = w.scaleY) != null ? E : 1, D = ((P = w.fontSize) != null ? P : 16) * Z, _ = ((x = w.width) != null ? x : 0) * N, F = Z, {
|
|
4534
4534
|
paddingTop: G = 0,
|
|
4535
4535
|
paddingRight: Y = 0,
|
|
4536
4536
|
paddingBottom: K = 0,
|
|
@@ -4538,32 +4538,32 @@ class F {
|
|
|
4538
4538
|
radiusTopLeft: J = 0,
|
|
4539
4539
|
radiusTopRight: H = 0,
|
|
4540
4540
|
radiusBottomRight: q = 0,
|
|
4541
|
-
radiusBottomLeft:
|
|
4541
|
+
radiusBottomLeft: At = 0,
|
|
4542
4542
|
styles: st
|
|
4543
4543
|
} = w, lt = {
|
|
4544
|
-
paddingTop: Math.max(0, G *
|
|
4545
|
-
paddingRight: Math.max(0, Y *
|
|
4546
|
-
paddingBottom: Math.max(0, K *
|
|
4547
|
-
paddingLeft: Math.max(0, tt *
|
|
4548
|
-
},
|
|
4549
|
-
radiusTopLeft: Math.max(0, J *
|
|
4550
|
-
radiusTopRight: Math.max(0, H *
|
|
4551
|
-
radiusBottomRight: Math.max(0, q *
|
|
4552
|
-
radiusBottomLeft: Math.max(0,
|
|
4544
|
+
paddingTop: Math.max(0, G * F),
|
|
4545
|
+
paddingRight: Math.max(0, Y * F),
|
|
4546
|
+
paddingBottom: Math.max(0, K * F),
|
|
4547
|
+
paddingLeft: Math.max(0, tt * F)
|
|
4548
|
+
}, mt = {
|
|
4549
|
+
radiusTopLeft: Math.max(0, J * F),
|
|
4550
|
+
radiusTopRight: Math.max(0, H * F),
|
|
4551
|
+
radiusBottomRight: Math.max(0, q * F),
|
|
4552
|
+
radiusBottomLeft: Math.max(0, At * F)
|
|
4553
4553
|
};
|
|
4554
|
-
let
|
|
4555
|
-
st && Object.keys(st).length > 0 && (
|
|
4556
|
-
Object.values(ht).forEach((
|
|
4557
|
-
typeof
|
|
4554
|
+
let jt = st;
|
|
4555
|
+
st && Object.keys(st).length > 0 && (jt = JSON.parse(JSON.stringify(st)), Object.values(jt).forEach((ht) => {
|
|
4556
|
+
Object.values(ht).forEach((ut) => {
|
|
4557
|
+
typeof ut.fontSize == "number" && (ut.fontSize = Math.max(1, ut.fontSize * F));
|
|
4558
4558
|
});
|
|
4559
|
-
})), w.set(
|
|
4559
|
+
})), w.set(vt(B(B({
|
|
4560
4560
|
fontSize: D,
|
|
4561
4561
|
width: _,
|
|
4562
4562
|
scaleX: 1,
|
|
4563
4563
|
scaleY: 1
|
|
4564
|
-
}, lt),
|
|
4565
|
-
styles:
|
|
4566
|
-
})),
|
|
4564
|
+
}, lt), mt), {
|
|
4565
|
+
styles: jt
|
|
4566
|
+
})), W._roundTextboxDimensions({ textbox: w });
|
|
4567
4567
|
}
|
|
4568
4568
|
w.setCoords();
|
|
4569
4569
|
});
|
|
@@ -4573,7 +4573,7 @@ class F {
|
|
|
4573
4573
|
this.canvas.setActiveObject(C), this.canvas.requestRenderAll();
|
|
4574
4574
|
return;
|
|
4575
4575
|
}
|
|
4576
|
-
if (!
|
|
4576
|
+
if (!W._isTextbox(n)) return;
|
|
4577
4577
|
n.isScaling = !1;
|
|
4578
4578
|
const o = this.scalingState.get(n);
|
|
4579
4579
|
if (this.scalingState.delete(n), !(o != null && o.hasWidthChange)) return;
|
|
@@ -4634,7 +4634,7 @@ class F {
|
|
|
4634
4634
|
radiusTopRight: I = 0,
|
|
4635
4635
|
radiusBottomRight: j = 0,
|
|
4636
4636
|
radiusBottomLeft: A = 0
|
|
4637
|
-
} = x, C =
|
|
4637
|
+
} = x, C = bt(x, [
|
|
4638
4638
|
"id",
|
|
4639
4639
|
"text",
|
|
4640
4640
|
"fontFamily",
|
|
@@ -4663,7 +4663,7 @@ class F {
|
|
|
4663
4663
|
var tt;
|
|
4664
4664
|
const { historyManager: N } = this.editor, { canvas: Z } = this;
|
|
4665
4665
|
N.suspendHistory();
|
|
4666
|
-
const D = s != null ? s : this._getDefaultFontFamily(), _ = Xe({ width: g }),
|
|
4666
|
+
const D = s != null ? s : this._getDefaultFontFamily(), _ = Xe({ width: g }), F = Ve({
|
|
4667
4667
|
strokeColor: u,
|
|
4668
4668
|
width: _
|
|
4669
4669
|
}), G = B({
|
|
@@ -4677,7 +4677,7 @@ class F {
|
|
|
4677
4677
|
linethrough: c,
|
|
4678
4678
|
textAlign: d,
|
|
4679
4679
|
fill: l,
|
|
4680
|
-
stroke:
|
|
4680
|
+
stroke: F,
|
|
4681
4681
|
strokeWidth: _,
|
|
4682
4682
|
strokeUniform: !0,
|
|
4683
4683
|
opacity: f,
|
|
@@ -4691,21 +4691,21 @@ class F {
|
|
|
4691
4691
|
radiusTopRight: I,
|
|
4692
4692
|
radiusBottomRight: j,
|
|
4693
4693
|
radiusBottomLeft: A
|
|
4694
|
-
}, C), Y = new
|
|
4694
|
+
}, C), Y = new ne(e, G);
|
|
4695
4695
|
if (Y.textCaseRaw = (tt = Y.text) != null ? tt : "", r) {
|
|
4696
|
-
const J =
|
|
4696
|
+
const J = ce({ value: Y.textCaseRaw });
|
|
4697
4697
|
J !== Y.text && Y.set({ text: J });
|
|
4698
4698
|
}
|
|
4699
|
-
return
|
|
4699
|
+
return W._roundTextboxDimensions({ textbox: Y }) && (Y.dirty = !0), C.left === void 0 && C.top === void 0 && Z.centerObject(Y), E || Z.add(Y), w || Z.setActiveObject(Y), Z.requestRenderAll(), N.resumeHistory(), T || N.saveState(), Z.fire("editor:text-added", {
|
|
4700
4700
|
textbox: Y,
|
|
4701
|
-
options:
|
|
4701
|
+
options: vt(B({}, G), {
|
|
4702
4702
|
text: e,
|
|
4703
4703
|
bold: o,
|
|
4704
4704
|
italic: i,
|
|
4705
4705
|
strikethrough: c,
|
|
4706
4706
|
align: d,
|
|
4707
4707
|
color: l,
|
|
4708
|
-
strokeColor:
|
|
4708
|
+
strokeColor: F,
|
|
4709
4709
|
strokeWidth: _
|
|
4710
4710
|
}),
|
|
4711
4711
|
flags: {
|
|
@@ -4724,12 +4724,12 @@ class F {
|
|
|
4724
4724
|
* @param options.skipRender — не вызывать перерисовку канваса
|
|
4725
4725
|
*/
|
|
4726
4726
|
updateText({ target: t, style: e = {}, withoutSave: s, skipRender: n } = {}) {
|
|
4727
|
-
var Nt, Bt,
|
|
4727
|
+
var Nt, gt, Bt, ft, it, kt, zt;
|
|
4728
4728
|
const o = this._resolveTextObject(t);
|
|
4729
4729
|
if (!o) return null;
|
|
4730
4730
|
const { historyManager: i } = this.editor, { canvas: a } = this;
|
|
4731
4731
|
i.suspendHistory();
|
|
4732
|
-
const r =
|
|
4732
|
+
const r = W._getSnapshot(o), xt = e, {
|
|
4733
4733
|
text: c,
|
|
4734
4734
|
fontFamily: d,
|
|
4735
4735
|
fontSize: l,
|
|
@@ -4753,7 +4753,7 @@ class F {
|
|
|
4753
4753
|
radiusTopRight: P,
|
|
4754
4754
|
radiusBottomRight: x,
|
|
4755
4755
|
radiusBottomLeft: N
|
|
4756
|
-
} = xt, Z =
|
|
4756
|
+
} = xt, Z = bt(xt, [
|
|
4757
4757
|
"text",
|
|
4758
4758
|
"fontFamily",
|
|
4759
4759
|
"fontSize",
|
|
@@ -4777,8 +4777,8 @@ class F {
|
|
|
4777
4777
|
"radiusTopRight",
|
|
4778
4778
|
"radiusBottomRight",
|
|
4779
4779
|
"radiusBottomLeft"
|
|
4780
|
-
]), D = B({}, Z), _ = rn({ textbox: o }),
|
|
4781
|
-
if (d !== void 0 && (
|
|
4780
|
+
]), D = B({}, Z), _ = rn({ textbox: o }), F = _ ? W._expandRangeToFullLines({ textbox: o, range: _ }) : null, G = {}, Y = {}, K = {}, tt = dn({ textbox: o, range: _ }), J = !_ || tt, H = !_;
|
|
4781
|
+
if (d !== void 0 && (F && (Y.fontFamily = d), J && (D.fontFamily = d, H && (K.fontFamily = d))), l !== void 0 && (F && (Y.fontSize = l), J && (D.fontSize = l, H && (K.fontSize = l))), u !== void 0) {
|
|
4782
4782
|
const X = u ? "bold" : "normal";
|
|
4783
4783
|
_ && (G.fontWeight = X), J && (D.fontWeight = X, H && (K.fontWeight = X));
|
|
4784
4784
|
}
|
|
@@ -4787,29 +4787,31 @@ class F {
|
|
|
4787
4787
|
_ && (G.fontStyle = X), J && (D.fontStyle = X, H && (K.fontStyle = X));
|
|
4788
4788
|
}
|
|
4789
4789
|
if (f !== void 0 && (_ && (G.underline = f), J && (D.underline = f, H && (K.underline = f))), m !== void 0 && (_ && (G.linethrough = m), J && (D.linethrough = m, H && (K.linethrough = m))), v !== void 0 && (D.textAlign = v), M !== void 0 && (_ && (G.fill = M), J && (D.fill = M, H && (K.fill = M))), S !== void 0 || y !== void 0) {
|
|
4790
|
-
const X = _ ? Ge({ textbox: o, range: _, property: "strokeWidth" }) : void 0, It = _ ? Ge({ textbox: o, range: _, property: "stroke" }) : void 0,
|
|
4791
|
-
strokeColor:
|
|
4792
|
-
width:
|
|
4790
|
+
const X = _ ? Ge({ textbox: o, range: _, property: "strokeWidth" }) : void 0, It = _ ? Ge({ textbox: o, range: _, property: "stroke" }) : void 0, Zt = (gt = (Nt = y != null ? y : X) != null ? Nt : o.strokeWidth) != null ? gt : 0, yt = Xe({ width: Zt }), Gt = (ft = (Bt = S != null ? S : It) != null ? Bt : o.stroke) != null ? ft : void 0, Ct = Ve({
|
|
4791
|
+
strokeColor: Gt,
|
|
4792
|
+
width: yt
|
|
4793
4793
|
});
|
|
4794
|
-
_ && (G.stroke = Ct, G.strokeWidth =
|
|
4794
|
+
_ && (G.stroke = Ct, G.strokeWidth = yt), J && (D.stroke = Ct, D.strokeWidth = yt, H && (K.stroke = Ct, K.strokeWidth = yt));
|
|
4795
4795
|
}
|
|
4796
4796
|
b !== void 0 && (D.opacity = b), I !== void 0 && (D.backgroundColor = I), j !== void 0 && (D.backgroundOpacity = j), A !== void 0 && (D.paddingTop = A), C !== void 0 && (D.paddingRight = C), w !== void 0 && (D.paddingBottom = w), T !== void 0 && (D.paddingLeft = T), E !== void 0 && (D.radiusTopLeft = E), P !== void 0 && (D.radiusTopRight = P), x !== void 0 && (D.radiusBottomRight = x), N !== void 0 && (D.radiusBottomLeft = N);
|
|
4797
|
-
const q = (
|
|
4798
|
-
if (st ||
|
|
4799
|
-
const X =
|
|
4797
|
+
const q = (kt = o.textCaseRaw) != null ? kt : (it = o.text) != null ? it : "", At = !!o.uppercase, st = c !== void 0, lt = st ? c != null ? c : "" : q, mt = p != null ? p : At;
|
|
4798
|
+
if (st || mt !== At) {
|
|
4799
|
+
const X = mt ? ce({ value: lt }) : lt;
|
|
4800
4800
|
D.text = X, o.textCaseRaw = lt;
|
|
4801
4801
|
} else o.textCaseRaw === void 0 && (o.textCaseRaw = q);
|
|
4802
|
-
o.uppercase =
|
|
4802
|
+
o.uppercase = mt, o.set(D);
|
|
4803
4803
|
let ht = !1;
|
|
4804
4804
|
if (_) {
|
|
4805
|
-
const X =
|
|
4805
|
+
const X = re({ textbox: o, styles: G, range: _ }), It = F ? re({ textbox: o, styles: Y, range: F }) : !1;
|
|
4806
4806
|
ht = X || It;
|
|
4807
4807
|
} else if (Object.keys(K).length) {
|
|
4808
4808
|
const X = cn({ textbox: o });
|
|
4809
|
-
X && (ht =
|
|
4809
|
+
X && (ht = re({ textbox: o, styles: K, range: X }));
|
|
4810
4810
|
}
|
|
4811
|
-
ht && (o.dirty = !0), (I !== void 0 || j !== void 0 || A !== void 0 || C !== void 0 || w !== void 0 || T !== void 0 || E !== void 0 || P !== void 0 || x !== void 0 || N !== void 0) && (o.dirty = !0)
|
|
4812
|
-
const
|
|
4811
|
+
ht && (o.dirty = !0), (I !== void 0 || j !== void 0 || A !== void 0 || C !== void 0 || w !== void 0 || T !== void 0 || E !== void 0 || P !== void 0 || x !== void 0 || N !== void 0) && (o.dirty = !0);
|
|
4812
|
+
const ut = o.calcTextWidth();
|
|
4813
|
+
ut > ((zt = o.width) != null ? zt : 0) && (o.set({ width: ut }), o.dirty = !0), W._roundTextboxDimensions({ textbox: o }) && (o.dirty = !0), o.setCoords(), n || a.requestRenderAll(), i.resumeHistory(), s || i.saveState();
|
|
4814
|
+
const Ht = W._getSnapshot(o);
|
|
4813
4815
|
return a.fire("editor:text-updated", {
|
|
4814
4816
|
textbox: o,
|
|
4815
4817
|
target: t,
|
|
@@ -4820,7 +4822,7 @@ class F {
|
|
|
4820
4822
|
},
|
|
4821
4823
|
updates: D,
|
|
4822
4824
|
before: r,
|
|
4823
|
-
after:
|
|
4825
|
+
after: Ht,
|
|
4824
4826
|
selectionRange: _ != null ? _ : void 0,
|
|
4825
4827
|
selectionStyles: _ && Object.keys(G).length ? G : void 0
|
|
4826
4828
|
}), o;
|
|
@@ -4830,7 +4832,7 @@ class F {
|
|
|
4830
4832
|
*/
|
|
4831
4833
|
destroy() {
|
|
4832
4834
|
const { canvas: t } = this;
|
|
4833
|
-
t.off("object:scaling", this._handleObjectScaling), t.off("object:resizing",
|
|
4835
|
+
t.off("object:scaling", this._handleObjectScaling), t.off("object:resizing", W._handleObjectResizing), t.off("object:modified", this._handleObjectModified), t.off("text:editing:exited", this._handleTextEditingExited), t.off("text:editing:entered", this._handleTextEditingEntered), t.off("text:changed", W._handleTextChanged);
|
|
4834
4836
|
}
|
|
4835
4837
|
/**
|
|
4836
4838
|
* Возвращает активный текст или ищет по id.
|
|
@@ -4840,10 +4842,10 @@ class F {
|
|
|
4840
4842
|
const { canvas: e } = this;
|
|
4841
4843
|
if (!t) {
|
|
4842
4844
|
const s = e.getActiveObject();
|
|
4843
|
-
return
|
|
4845
|
+
return W._isTextbox(s) ? s : null;
|
|
4844
4846
|
}
|
|
4845
4847
|
if (typeof t == "string") {
|
|
4846
|
-
const s = e.getObjects().find((n) =>
|
|
4848
|
+
const s = e.getObjects().find((n) => W._isTextbox(n) && n.id === t);
|
|
4847
4849
|
return s != null ? s : null;
|
|
4848
4850
|
}
|
|
4849
4851
|
return null;
|
|
@@ -4859,21 +4861,21 @@ class F {
|
|
|
4859
4861
|
*/
|
|
4860
4862
|
_bindEvents() {
|
|
4861
4863
|
const { canvas: t } = this;
|
|
4862
|
-
t.on("object:scaling", this._handleObjectScaling), t.on("object:resizing",
|
|
4864
|
+
t.on("object:scaling", this._handleObjectScaling), t.on("object:resizing", W._handleObjectResizing), t.on("object:modified", this._handleObjectModified), t.on("text:editing:entered", this._handleTextEditingEntered), t.on("text:editing:exited", this._handleTextEditingExited), t.on("text:changed", W._handleTextChanged);
|
|
4863
4865
|
}
|
|
4864
4866
|
/**
|
|
4865
4867
|
* Реагирует на изменение текста в режиме редактирования: синхронизирует textCaseRaw и uppercase.
|
|
4866
4868
|
*/
|
|
4867
4869
|
static _handleTextChanged(t) {
|
|
4868
4870
|
const { target: e } = t;
|
|
4869
|
-
if (!
|
|
4871
|
+
if (!W._isTextbox(e)) return;
|
|
4870
4872
|
const { text: s = "", uppercase: n } = e, o = !!n, i = s.toLocaleLowerCase();
|
|
4871
4873
|
if (o) {
|
|
4872
|
-
const r =
|
|
4874
|
+
const r = ce({ value: i });
|
|
4873
4875
|
r !== s && e.set({ text: r }), e.textCaseRaw = i;
|
|
4874
4876
|
} else
|
|
4875
4877
|
e.textCaseRaw = s;
|
|
4876
|
-
|
|
4878
|
+
W._roundTextboxDimensions({ textbox: e }) && (e.setCoords(), e.dirty = !0);
|
|
4877
4879
|
}
|
|
4878
4880
|
/**
|
|
4879
4881
|
* Обрабатывает изменение ширины текстового объекта (resizing).
|
|
@@ -4884,7 +4886,7 @@ class F {
|
|
|
4884
4886
|
static _handleObjectResizing(t) {
|
|
4885
4887
|
var l, u, g, f, p, m;
|
|
4886
4888
|
const { target: e, transform: s } = t;
|
|
4887
|
-
if (!
|
|
4889
|
+
if (!W._isTextbox(e)) return;
|
|
4888
4890
|
const {
|
|
4889
4891
|
paddingLeft: n = 0,
|
|
4890
4892
|
paddingRight: o = 0
|
|
@@ -4924,7 +4926,7 @@ class F {
|
|
|
4924
4926
|
textbox: t,
|
|
4925
4927
|
range: e
|
|
4926
4928
|
}) {
|
|
4927
|
-
const s =
|
|
4929
|
+
const s = W._getLineRanges({ textbox: t });
|
|
4928
4930
|
if (!s.length) return e;
|
|
4929
4931
|
let { start: n } = e, { end: o } = e;
|
|
4930
4932
|
return s.forEach(({ start: i, end: a }) => {
|
|
@@ -4986,10 +4988,10 @@ class F {
|
|
|
4986
4988
|
static _roundTextboxDimensions({
|
|
4987
4989
|
textbox: t
|
|
4988
4990
|
}) {
|
|
4989
|
-
const { width: e, height: s, calcTextWidth: n, calcTextHeight: o } = t, i = typeof n == "function" ? n.call(t) : void 0, a = typeof o == "function" ? o.call(t) : void 0, r =
|
|
4991
|
+
const { width: e, height: s, calcTextWidth: n, calcTextHeight: o } = t, i = typeof n == "function" ? n.call(t) : void 0, a = typeof o == "function" ? o.call(t) : void 0, r = W._resolveDimension({
|
|
4990
4992
|
rawValue: e,
|
|
4991
4993
|
calculatedValue: i
|
|
4992
|
-
}), c =
|
|
4994
|
+
}), c = W._resolveDimension({
|
|
4993
4995
|
rawValue: s,
|
|
4994
4996
|
calculatedValue: a
|
|
4995
4997
|
}), d = Number.isFinite(r) ? Math.round(r) : null, l = Number.isFinite(c) ? Math.round(c) : null, u = {};
|
|
@@ -5039,13 +5041,13 @@ class F {
|
|
|
5039
5041
|
angle: Z,
|
|
5040
5042
|
scaleX: D,
|
|
5041
5043
|
scaleY: _
|
|
5042
|
-
} = t,
|
|
5044
|
+
} = t, F = {
|
|
5043
5045
|
id: s,
|
|
5044
5046
|
uppercase: !!i,
|
|
5045
5047
|
textAlign: g
|
|
5046
5048
|
};
|
|
5047
5049
|
return e({
|
|
5048
|
-
snapshot:
|
|
5050
|
+
snapshot: F,
|
|
5049
5051
|
entries: {
|
|
5050
5052
|
text: n,
|
|
5051
5053
|
textCaseRaw: o,
|
|
@@ -5077,7 +5079,7 @@ class F {
|
|
|
5077
5079
|
scaleX: D,
|
|
5078
5080
|
scaleY: _
|
|
5079
5081
|
}
|
|
5080
|
-
}),
|
|
5082
|
+
}), F;
|
|
5081
5083
|
}
|
|
5082
5084
|
/**
|
|
5083
5085
|
* Возвращает первый доступный шрифт или дефолтный Arial.
|
|
@@ -5090,7 +5092,7 @@ class F {
|
|
|
5090
5092
|
const Q = ({
|
|
5091
5093
|
value: h,
|
|
5092
5094
|
fallback: t = 0
|
|
5093
|
-
}) => typeof h == "number" && Number.isFinite(h) ? h : typeof t == "number" && Number.isFinite(t) ? t : 0,
|
|
5095
|
+
}) => typeof h == "number" && Number.isFinite(h) ? h : typeof t == "number" && Number.isFinite(t) ? t : 0, qt = ({
|
|
5094
5096
|
value: h,
|
|
5095
5097
|
dimension: t,
|
|
5096
5098
|
useRelativePositions: e
|
|
@@ -5107,22 +5109,22 @@ const Q = ({
|
|
|
5107
5109
|
const o = h;
|
|
5108
5110
|
if (typeof o[n.x] == "number" && typeof o[n.y] == "number")
|
|
5109
5111
|
return {
|
|
5110
|
-
x:
|
|
5112
|
+
x: qt({
|
|
5111
5113
|
value: o[n.x],
|
|
5112
5114
|
dimension: t,
|
|
5113
5115
|
useRelativePositions: s
|
|
5114
5116
|
}),
|
|
5115
|
-
y:
|
|
5117
|
+
y: qt({
|
|
5116
5118
|
value: o[n.y],
|
|
5117
5119
|
dimension: e,
|
|
5118
5120
|
useRelativePositions: s
|
|
5119
5121
|
})
|
|
5120
5122
|
};
|
|
5121
|
-
const { left: a, top: r, width: c, height: d } = h, l =
|
|
5123
|
+
const { left: a, top: r, width: c, height: d } = h, l = qt({
|
|
5122
5124
|
value: a,
|
|
5123
5125
|
dimension: t,
|
|
5124
5126
|
useRelativePositions: s
|
|
5125
|
-
}), u =
|
|
5127
|
+
}), u = qt({
|
|
5126
5128
|
value: r,
|
|
5127
5129
|
dimension: e,
|
|
5128
5130
|
useRelativePositions: s
|
|
@@ -5160,7 +5162,7 @@ const Q = ({
|
|
|
5160
5162
|
} catch (s) {
|
|
5161
5163
|
return null;
|
|
5162
5164
|
}
|
|
5163
|
-
},
|
|
5165
|
+
}, pt = ({
|
|
5164
5166
|
object: h
|
|
5165
5167
|
}) => {
|
|
5166
5168
|
if (!h) return null;
|
|
@@ -5224,7 +5226,7 @@ const Q = ({
|
|
|
5224
5226
|
};
|
|
5225
5227
|
}
|
|
5226
5228
|
return null;
|
|
5227
|
-
},
|
|
5229
|
+
}, Wt = "_templateCenterX", de = "_templateCenterY", Jt = "_templateAnchorX", le = "_templateAnchorY";
|
|
5228
5230
|
class R {
|
|
5229
5231
|
constructor({ editor: t }) {
|
|
5230
5232
|
this.editor = t;
|
|
@@ -5249,7 +5251,7 @@ class R {
|
|
|
5249
5251
|
return a.emitWarning({
|
|
5250
5252
|
origin: "TemplateManager",
|
|
5251
5253
|
method: "serializeSelection",
|
|
5252
|
-
code:
|
|
5254
|
+
code: Mt.TEMPLATE_MANAGER.NO_OBJECTS_SELECTED,
|
|
5253
5255
|
message: "Нет объектов для сериализации шаблона"
|
|
5254
5256
|
}), null;
|
|
5255
5257
|
const f = R._getBounds(i), p = R._getMontageSize({ montageArea: i, bounds: f }), m = p.width, v = p.height, M = g.map((b) => R._serializeObject({
|
|
@@ -5258,7 +5260,7 @@ class R {
|
|
|
5258
5260
|
baseWidth: m,
|
|
5259
5261
|
baseHeight: v,
|
|
5260
5262
|
montageArea: i != null ? i : null
|
|
5261
|
-
})), S =
|
|
5263
|
+
})), S = vt(B({}, s), {
|
|
5262
5264
|
baseWidth: m,
|
|
5263
5265
|
baseHeight: v,
|
|
5264
5266
|
positionsNormalized: !0,
|
|
@@ -5292,7 +5294,7 @@ class R {
|
|
|
5292
5294
|
return a.emitWarning({
|
|
5293
5295
|
origin: "TemplateManager",
|
|
5294
5296
|
method: "applyTemplate",
|
|
5295
|
-
code:
|
|
5297
|
+
code: Mt.TEMPLATE_MANAGER.INVALID_TEMPLATE,
|
|
5296
5298
|
message: "Шаблон не содержит объектов"
|
|
5297
5299
|
}), null;
|
|
5298
5300
|
const u = R._getBounds(o);
|
|
@@ -5300,7 +5302,7 @@ class R {
|
|
|
5300
5302
|
return a.emitWarning({
|
|
5301
5303
|
origin: "TemplateManager",
|
|
5302
5304
|
method: "applyTemplate",
|
|
5303
|
-
code:
|
|
5305
|
+
code: Mt.TEMPLATE_MANAGER.INVALID_TARGET,
|
|
5304
5306
|
message: "Не удалось определить границы монтажной области"
|
|
5305
5307
|
}), null;
|
|
5306
5308
|
const g = R._getMontageSize({ montageArea: o, bounds: u }), f = R._normalizeMeta({ meta: d, fallback: g }), p = R._calculateScale({ meta: f, target: g }), m = !!f.positionsNormalized;
|
|
@@ -5312,7 +5314,7 @@ class R {
|
|
|
5312
5314
|
return a.emitWarning({
|
|
5313
5315
|
origin: "TemplateManager",
|
|
5314
5316
|
method: "applyTemplate",
|
|
5315
|
-
code:
|
|
5317
|
+
code: Mt.TEMPLATE_MANAGER.INVALID_TEMPLATE,
|
|
5316
5318
|
message: "Не удалось создать объекты шаблона"
|
|
5317
5319
|
}), null;
|
|
5318
5320
|
const { backgroundObject: y, contentObjects: b } = R._extractBackgroundObject(S);
|
|
@@ -5346,7 +5348,7 @@ class R {
|
|
|
5346
5348
|
return a.emitError({
|
|
5347
5349
|
origin: "TemplateManager",
|
|
5348
5350
|
method: "applyTemplate",
|
|
5349
|
-
code:
|
|
5351
|
+
code: Mt.TEMPLATE_MANAGER.APPLY_FAILED,
|
|
5350
5352
|
message: "Ошибка применения шаблона",
|
|
5351
5353
|
data: {
|
|
5352
5354
|
templateId: l,
|
|
@@ -5528,8 +5530,8 @@ class R {
|
|
|
5528
5530
|
baseHeight: i,
|
|
5529
5531
|
useRelativePositions: r,
|
|
5530
5532
|
centerKeys: {
|
|
5531
|
-
x:
|
|
5532
|
-
y:
|
|
5533
|
+
x: Wt,
|
|
5534
|
+
y: de
|
|
5533
5535
|
}
|
|
5534
5536
|
}), { scaleX: u, scaleY: g } = t, f = Q({ value: u, fallback: 1 }), p = Q({ value: g, fallback: 1 }), m = R._getPositioningBounds({
|
|
5535
5537
|
bounds: s,
|
|
@@ -5537,8 +5539,8 @@ class R {
|
|
|
5537
5539
|
baseHeight: i,
|
|
5538
5540
|
scale: e,
|
|
5539
5541
|
useRelativePositions: r,
|
|
5540
|
-
anchorX: R._resolveAnchor(c,
|
|
5541
|
-
anchorY: R._resolveAnchor(c,
|
|
5542
|
+
anchorX: R._resolveAnchor(c, Jt),
|
|
5543
|
+
anchorY: R._resolveAnchor(c, le)
|
|
5542
5544
|
}), v = hn({
|
|
5543
5545
|
normalizedX: d,
|
|
5544
5546
|
normalizedY: l,
|
|
@@ -5549,7 +5551,7 @@ class R {
|
|
|
5549
5551
|
t.set({
|
|
5550
5552
|
scaleX: M,
|
|
5551
5553
|
scaleY: S
|
|
5552
|
-
}), t.setPositionByOrigin(v, "center", "center"), t.setCoords(), delete c[
|
|
5554
|
+
}), t.setPositionByOrigin(v, "center", "center"), t.setCoords(), delete c[Wt], delete c[de], delete c[Jt], delete c[le];
|
|
5553
5555
|
}
|
|
5554
5556
|
/**
|
|
5555
5557
|
* Возвращает bounds, в которых должны позиционироваться нормализованные объекты.
|
|
@@ -5596,7 +5598,7 @@ class R {
|
|
|
5596
5598
|
meta: t,
|
|
5597
5599
|
fallback: e
|
|
5598
5600
|
}) {
|
|
5599
|
-
const { width: s, height: n } = e, r = t || {}, { baseWidth: o = s, baseHeight: i = n } = r, a =
|
|
5601
|
+
const { width: s, height: n } = e, r = t || {}, { baseWidth: o = s, baseHeight: i = n } = r, a = bt(r, ["baseWidth", "baseHeight"]);
|
|
5600
5602
|
return B({
|
|
5601
5603
|
baseWidth: o,
|
|
5602
5604
|
baseHeight: i
|
|
@@ -5648,7 +5650,7 @@ class R {
|
|
|
5648
5650
|
} = t, r = Q({ value: e, fallback: 0 }), c = t, d = Q({ value: c.paddingLeft, fallback: 0 }), l = Q({ value: c.paddingRight, fallback: 0 }), u = Q({ value: i, fallback: 1 }), g = Q({ value: a, fallback: 0 }) * u, f = Q({ value: o, fallback: 0 }), p = f * u, m = d * u, v = l * u, M = p + m + v + g;
|
|
5649
5651
|
if (!n || !f || !r) return;
|
|
5650
5652
|
t.setCoords();
|
|
5651
|
-
const S = t, y = S[
|
|
5653
|
+
const S = t, y = S[Wt], b = typeof y == "number" ? y : null, I = R._resolveAnchor(S, Jt), j = M / r, A = b !== null ? b - j / 2 : null, C = b !== null ? b + j / 2 : null, w = t.getCenterPoint();
|
|
5652
5654
|
t.set("width", n), t.initDimensions();
|
|
5653
5655
|
const T = R._getLongestLineWidth({
|
|
5654
5656
|
textbox: t,
|
|
@@ -5657,7 +5659,7 @@ class R {
|
|
|
5657
5659
|
t.set("width", E), t.initDimensions(), t.setPositionByOrigin(w, "center", "center"), t.setCoords();
|
|
5658
5660
|
const x = (E * u + m + v + g) / r;
|
|
5659
5661
|
let N = b;
|
|
5660
|
-
I === "start" && A !== null ? N = Math.max(0, A) + x / 2 : I === "end" && C !== null && (N = Math.min(1, C) - x / 2), typeof N == "number" && (S[
|
|
5662
|
+
I === "start" && A !== null ? N = Math.max(0, A) + x / 2 : I === "end" && C !== null && (N = Math.min(1, C) - x / 2), typeof N == "number" && (S[Wt] = N);
|
|
5661
5663
|
}
|
|
5662
5664
|
/**
|
|
5663
5665
|
* Возвращает ширину самой длинной строки текстового объекта.
|
|
@@ -5709,11 +5711,11 @@ class R {
|
|
|
5709
5711
|
y: (y.y - r) / g
|
|
5710
5712
|
};
|
|
5711
5713
|
})(), m = (l.left - a) / u, v = (l.top - r) / g, M = m + l.width / u, S = v + l.height / g;
|
|
5712
|
-
return i[
|
|
5714
|
+
return i[Wt] = p.x, i[de] = p.y, i[Jt] = R._detectAnchor({
|
|
5713
5715
|
center: p.x,
|
|
5714
5716
|
start: m,
|
|
5715
5717
|
end: M
|
|
5716
|
-
}), i[
|
|
5718
|
+
}), i[le] = R._detectAnchor({
|
|
5717
5719
|
center: p.y,
|
|
5718
5720
|
start: v,
|
|
5719
5721
|
end: S
|
|
@@ -5771,7 +5773,7 @@ class R {
|
|
|
5771
5773
|
s.emitWarning({
|
|
5772
5774
|
origin: "TemplateManager",
|
|
5773
5775
|
method: "applyTemplate",
|
|
5774
|
-
code:
|
|
5776
|
+
code: Mt.TEMPLATE_MANAGER.APPLY_FAILED,
|
|
5775
5777
|
message: "Не удалось применить фон из шаблона",
|
|
5776
5778
|
data: o
|
|
5777
5779
|
});
|
|
@@ -5830,7 +5832,7 @@ class R {
|
|
|
5830
5832
|
return dt.enlivenObjectEnlivables(t);
|
|
5831
5833
|
}
|
|
5832
5834
|
}
|
|
5833
|
-
const pn = 5, ss = "#3D8BF4",
|
|
5835
|
+
const pn = 5, ss = "#3D8BF4", me = 1, $t = 1, Ke = ({
|
|
5834
5836
|
anchors: h,
|
|
5835
5837
|
positions: t,
|
|
5836
5838
|
threshold: e
|
|
@@ -6146,7 +6148,7 @@ const pn = 5, ss = "#3D8BF4", fe = 1, Jt = 1, Ke = ({
|
|
|
6146
6148
|
}) => {
|
|
6147
6149
|
const i = Math.min(o, s / 2, n / 2);
|
|
6148
6150
|
h.moveTo(t + i, e), h.lineTo(t + s - i, e), h.quadraticCurveTo(t + s, e, t + s, e + i), h.lineTo(t + s, e + n - i), h.quadraticCurveTo(t + s, e + n, t + s - i, e + n), h.lineTo(t + i, e + n), h.quadraticCurveTo(t, e + n, t, e + n - i), h.lineTo(t, e + i), h.quadraticCurveTo(t, e, t + i, e), h.closePath();
|
|
6149
|
-
},
|
|
6151
|
+
}, ye = ({
|
|
6150
6152
|
context: h,
|
|
6151
6153
|
type: t,
|
|
6152
6154
|
axis: e,
|
|
@@ -6190,7 +6192,7 @@ const pn = 5, ss = "#3D8BF4", fe = 1, Jt = 1, Ke = ({
|
|
|
6190
6192
|
} = t, d = Math.round(c).toString();
|
|
6191
6193
|
h.beginPath(), s === "vertical" ? (h.moveTo(n, o), h.lineTo(n, i), h.moveTo(n, a), h.lineTo(n, r)) : (h.moveTo(o, n), h.lineTo(i, n), h.moveTo(a, n), h.lineTo(r, n)), h.stroke();
|
|
6192
6194
|
const l = ss;
|
|
6193
|
-
|
|
6195
|
+
ye({
|
|
6194
6196
|
context: h,
|
|
6195
6197
|
type: s,
|
|
6196
6198
|
axis: n,
|
|
@@ -6199,8 +6201,8 @@ const pn = 5, ss = "#3D8BF4", fe = 1, Jt = 1, Ke = ({
|
|
|
6199
6201
|
text: d,
|
|
6200
6202
|
zoom: e,
|
|
6201
6203
|
color: l,
|
|
6202
|
-
lineWidth:
|
|
6203
|
-
}),
|
|
6204
|
+
lineWidth: me
|
|
6205
|
+
}), ye({
|
|
6204
6206
|
context: h,
|
|
6205
6207
|
type: s,
|
|
6206
6208
|
axis: n,
|
|
@@ -6209,7 +6211,7 @@ const pn = 5, ss = "#3D8BF4", fe = 1, Jt = 1, Ke = ({
|
|
|
6209
6211
|
text: d,
|
|
6210
6212
|
zoom: e,
|
|
6211
6213
|
color: l,
|
|
6212
|
-
lineWidth:
|
|
6214
|
+
lineWidth: me
|
|
6213
6215
|
});
|
|
6214
6216
|
}, Qe = ({
|
|
6215
6217
|
anchors: h,
|
|
@@ -6340,7 +6342,7 @@ class jn {
|
|
|
6340
6342
|
return;
|
|
6341
6343
|
}
|
|
6342
6344
|
!this.anchors.vertical.length && !this.anchors.horizontal.length && this._cacheAnchors({ activeObject: e });
|
|
6343
|
-
let o =
|
|
6345
|
+
let o = pt({ object: e });
|
|
6344
6346
|
if (!o) {
|
|
6345
6347
|
this._clearGuides();
|
|
6346
6348
|
return;
|
|
@@ -6355,9 +6357,9 @@ class jn {
|
|
|
6355
6357
|
e.set({
|
|
6356
6358
|
left: v + d,
|
|
6357
6359
|
top: M + l
|
|
6358
|
-
}), e.setCoords(), o = (p =
|
|
6360
|
+
}), e.setCoords(), o = (p = pt({ object: e })) != null ? p : o;
|
|
6359
6361
|
}
|
|
6360
|
-
const g = this.cachedTargetBounds.length ? this.cachedTargetBounds : this._collectTargets({ activeObject: e }).map((v) =>
|
|
6362
|
+
const g = this.cachedTargetBounds.length ? this.cachedTargetBounds : this._collectTargets({ activeObject: e }).map((v) => pt({ object: v })).filter((v) => !!v), f = bn({
|
|
6361
6363
|
activeBounds: o,
|
|
6362
6364
|
candidates: g,
|
|
6363
6365
|
threshold: r,
|
|
@@ -6368,7 +6370,7 @@ class jn {
|
|
|
6368
6370
|
e.set({
|
|
6369
6371
|
left: v + f.deltaX,
|
|
6370
6372
|
top: M + f.deltaY
|
|
6371
|
-
}), e.setCoords(), o = (m =
|
|
6373
|
+
}), e.setCoords(), o = (m = pt({ object: e })) != null ? m : o;
|
|
6372
6374
|
}
|
|
6373
6375
|
this._applyGuides({
|
|
6374
6376
|
guides: u,
|
|
@@ -6396,7 +6398,7 @@ class jn {
|
|
|
6396
6398
|
const { canvas: t, guideBounds: e } = this, s = t.getSelectionContext();
|
|
6397
6399
|
if (!s) return;
|
|
6398
6400
|
const n = e != null ? e : this._calculateViewportBounds(), { left: o, right: i, top: a, bottom: r } = n, { viewportTransform: c } = t, d = t.getZoom() || 1;
|
|
6399
|
-
s.save(), Array.isArray(c) && s.transform(...c), s.lineWidth =
|
|
6401
|
+
s.save(), Array.isArray(c) && s.transform(...c), s.lineWidth = me / d, s.strokeStyle = ss, s.setLineDash([4, 4]);
|
|
6400
6402
|
for (const l of this.activeGuides)
|
|
6401
6403
|
s.beginPath(), l.type === "vertical" ? (s.moveTo(l.position, a), s.lineTo(l.position, r)) : (s.moveTo(o, l.position), s.lineTo(i, l.position)), s.stroke();
|
|
6402
6404
|
for (const l of this.activeSpacingGuides)
|
|
@@ -6436,7 +6438,7 @@ class jn {
|
|
|
6436
6438
|
* Применяет шаг перемещения, округляя координаты объекта к сетке MOVE_SNAP_STEP.
|
|
6437
6439
|
*/
|
|
6438
6440
|
_applyMovementStep({ target: t }) {
|
|
6439
|
-
const { left: e = 0, top: s = 0 } = t, n = Math.round(e /
|
|
6441
|
+
const { left: e = 0, top: s = 0 } = t, n = Math.round(e / $t) * $t, o = Math.round(s / $t) * $t;
|
|
6440
6442
|
n === e && o === s || (t.set({
|
|
6441
6443
|
left: n,
|
|
6442
6444
|
top: o
|
|
@@ -6448,10 +6450,10 @@ class jn {
|
|
|
6448
6450
|
_cacheAnchors({ activeObject: t }) {
|
|
6449
6451
|
const e = this._collectTargets({ activeObject: t }), s = { vertical: [], horizontal: [] }, n = [];
|
|
6450
6452
|
for (const a of e) {
|
|
6451
|
-
const r =
|
|
6453
|
+
const r = pt({ object: a });
|
|
6452
6454
|
r && (Qe({ anchors: s, bounds: r }), n.push(r));
|
|
6453
6455
|
}
|
|
6454
|
-
const { montageArea: o } = this.editor, i =
|
|
6456
|
+
const { montageArea: o } = this.editor, i = pt({ object: o });
|
|
6455
6457
|
if (i) {
|
|
6456
6458
|
Qe({ anchors: s, bounds: i });
|
|
6457
6459
|
const { left: a, right: r, top: c, bottom: d } = i;
|
|
@@ -6600,7 +6602,7 @@ class Lt {
|
|
|
6600
6602
|
this._clearGuides();
|
|
6601
6603
|
return;
|
|
6602
6604
|
}
|
|
6603
|
-
const o =
|
|
6605
|
+
const o = pt({ object: n });
|
|
6604
6606
|
if (!o) {
|
|
6605
6607
|
this._clearGuides();
|
|
6606
6608
|
return;
|
|
@@ -6608,7 +6610,7 @@ class Lt {
|
|
|
6608
6610
|
const i = Lt._resolveTarget({
|
|
6609
6611
|
event: t,
|
|
6610
6612
|
activeObject: n
|
|
6611
|
-
}), { montageArea: a } = s, r = i != null ? i : a, c = r === a, d =
|
|
6613
|
+
}), { montageArea: a } = s, r = i != null ? i : a, c = r === a, d = pt({ object: r });
|
|
6612
6614
|
if (!d) {
|
|
6613
6615
|
this._clearGuides();
|
|
6614
6616
|
return;
|
|
@@ -6807,7 +6809,7 @@ class Lt {
|
|
|
6807
6809
|
e.save(), Array.isArray(s) && e.transform(...s), e.lineWidth = $e / n, e.strokeStyle = Je, e.setLineDash([]);
|
|
6808
6810
|
for (const c of this.activeGuides) {
|
|
6809
6811
|
const { type: d, axis: l, start: u, end: g, distance: f } = c, p = Math.abs(g - u), m = u <= g ? -1 : 1, v = a ? m * (p / 2 + r) : 0, M = 0;
|
|
6810
|
-
e.beginPath(), d === "vertical" ? (e.moveTo(l, u), e.lineTo(l, g)) : (e.moveTo(u, l), e.lineTo(g, l)), e.stroke(),
|
|
6812
|
+
e.beginPath(), d === "vertical" ? (e.moveTo(l, u), e.lineTo(l, g)) : (e.moveTo(u, l), e.lineTo(g, l)), e.stroke(), ye({
|
|
6811
6813
|
context: e,
|
|
6812
6814
|
type: d,
|
|
6813
6815
|
axis: l,
|
|
@@ -6842,7 +6844,7 @@ class Lt {
|
|
|
6842
6844
|
(e = t == null ? void 0 : t.showAfterTemporary) == null || e.call(t), this.isToolbarHidden = !1;
|
|
6843
6845
|
}
|
|
6844
6846
|
}
|
|
6845
|
-
class
|
|
6847
|
+
class Ae {
|
|
6846
6848
|
/**
|
|
6847
6849
|
* Конструктор класса ImageEditor.
|
|
6848
6850
|
* @param canvasId - идентификатор канваса, в котором будет создан редактор
|
|
@@ -6872,7 +6874,7 @@ class we {
|
|
|
6872
6874
|
showRotationAngle: d,
|
|
6873
6875
|
_onReadyCallback: l
|
|
6874
6876
|
} = this.options;
|
|
6875
|
-
if ($.apply(), this.canvas = new ys(this.containerId, this.options), this.moduleLoader = new Ss(), this.workerManager = new js(), this.errorManager = new
|
|
6877
|
+
if ($.apply(), this.canvas = new ys(this.containerId, this.options), this.moduleLoader = new Ss(), this.workerManager = new js(), this.errorManager = new Yt({ editor: this }), this.historyManager = new Ys({ editor: this }), this.toolbar = new Ps({ editor: this }), this.transformManager = new qs({ editor: this }), this.zoomManager = new Js({ editor: this }), this.canvasManager = new Qs({ editor: this }), this.imageManager = new ct({ editor: this }), this.layerManager = new ee({ editor: this }), this.shapeManager = new tn({ editor: this }), this.interactionBlocker = new $s({ editor: this }), this.backgroundManager = new Ot({ editor: this }), this.clipboardManager = new en({ editor: this }), this.objectLockManager = new se({ editor: this }), this.groupingManager = new sn({ editor: this }), this.selectionManager = new nn({ editor: this }), this.deletionManager = new Se({ editor: this }), this.panConstraintManager = new on({ editor: this }), this.snappingManager = new jn({ editor: this }), this.measurementManager = new Lt({ editor: this }), this.fontManager = new pe((u = this.options.fonts) != null ? u : []), this.textManager = new W({ editor: this }), this.templateManager = new R({ editor: this }), d && (this.angleIndicator = new we({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new Ft({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(t), this.canvasManager.setEditorContainerHeight(e), this.canvasManager.setCanvasWrapperWidth(s), this.canvasManager.setCanvasWrapperHeight(n), this.canvasManager.setCanvasCSSWidth(o), this.canvasManager.setCanvasCSSHeight(i), this.canvasManager.updateCanvas(), this.zoomManager.calculateAndApplyDefaultZoom(), yield this.fontManager.loadFonts(), a != null && a.source) {
|
|
6876
6878
|
const {
|
|
6877
6879
|
source: g,
|
|
6878
6880
|
scale: f = `image-${c}`,
|
|
@@ -6894,7 +6896,7 @@ class we {
|
|
|
6894
6896
|
this.montageArea = this.shapeManager.addRectangle({
|
|
6895
6897
|
width: t,
|
|
6896
6898
|
height: e,
|
|
6897
|
-
fill:
|
|
6899
|
+
fill: Ae._createMosaicPattern(),
|
|
6898
6900
|
stroke: null,
|
|
6899
6901
|
strokeWidth: 0,
|
|
6900
6902
|
selectable: !1,
|
|
@@ -7881,7 +7883,7 @@ function Dn(h, t = {}) {
|
|
|
7881
7883
|
const n = document.createElement("canvas");
|
|
7882
7884
|
return n.id = `${h}-canvas`, s.appendChild(n), e.editorContainer = s, new Promise((o) => {
|
|
7883
7885
|
e._onReadyCallback = o;
|
|
7884
|
-
const i = new
|
|
7886
|
+
const i = new Ae(n.id, e);
|
|
7885
7887
|
window[h] = i;
|
|
7886
7888
|
});
|
|
7887
7889
|
}
|