@anu3ev/fabric-image-editor 0.5.31 → 0.5.32
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 +258 -225
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -35,12 +35,12 @@ var G = (h, t, e) => new Promise((n, s) => {
|
|
|
35
35
|
}, a = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(o, i);
|
|
36
36
|
a((e = e.apply(h, t)).next());
|
|
37
37
|
});
|
|
38
|
-
import { ActiveSelection as X, Textbox as ct, util as
|
|
38
|
+
import { ActiveSelection as X, Textbox as ct, util as vt, controlsUtils as Xe, InteractiveFabricObject as Ke, Point as lt, FitContentLayout as qe, loadSVGFromURL as En, FabricImage as Kt, Gradient as Je, Rect as Dn, Circle as Ln, Triangle as _n, Group as Nt, Color as xn, classRegistry as Qe, loadSVGFromString as Rn, Canvas as kn, Pattern as Bn } from "fabric";
|
|
39
39
|
import { create as Nn } from "jsondiffpatch";
|
|
40
|
-
import
|
|
41
|
-
var
|
|
40
|
+
import zn from "diff-match-patch";
|
|
41
|
+
var Pn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", et = function() {
|
|
42
42
|
for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21, e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0)); t--; )
|
|
43
|
-
e +=
|
|
43
|
+
e += Pn[n[t] & 63];
|
|
44
44
|
return e;
|
|
45
45
|
};
|
|
46
46
|
const $e = 300;
|
|
@@ -503,52 +503,52 @@ class Un {
|
|
|
503
503
|
this.worker.terminate();
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const St = 12, Yn = 2, Ie = 8, Te = 20, Hn = 100, Oe = 20, Ee = 8, Zn = 100, ge = 32, Ne = 1, Gn = "#2B2D33", ze = "#3D8BF4", Pe = "#FFFFFF";
|
|
507
507
|
function le(h, t, e, n, s) {
|
|
508
|
-
const o =
|
|
509
|
-
h.save(), h.translate(t, e), h.rotate(
|
|
508
|
+
const o = St, i = Yn;
|
|
509
|
+
h.save(), h.translate(t, e), h.rotate(vt.degreesToRadians(s.angle)), h.fillStyle = Pe, h.strokeStyle = ze, h.lineWidth = Ne, h.beginPath(), h.roundRect(-o / 2, -o / 2, o, o, i), h.fill(), h.stroke(), h.restore();
|
|
510
510
|
}
|
|
511
511
|
function tn(h, t, e, n, s) {
|
|
512
512
|
const o = Ie, i = Te, a = Hn;
|
|
513
|
-
h.save(), h.translate(t, e), h.rotate(
|
|
513
|
+
h.save(), h.translate(t, e), h.rotate(vt.degreesToRadians(s.angle)), h.fillStyle = Pe, h.strokeStyle = ze, h.lineWidth = Ne, h.beginPath(), h.roundRect(-o / 2, -i / 2, o, i, a), h.fill(), h.stroke(), h.restore();
|
|
514
514
|
}
|
|
515
515
|
function en(h, t, e, n, s) {
|
|
516
516
|
const o = Oe, i = Ee, a = Zn;
|
|
517
|
-
h.save(), h.translate(t, e), h.rotate(
|
|
517
|
+
h.save(), h.translate(t, e), h.rotate(vt.degreesToRadians(s.angle)), h.fillStyle = Pe, h.strokeStyle = ze, h.lineWidth = Ne, h.beginPath(), h.roundRect(-o / 2, -i / 2, o, i, a), h.fill(), h.stroke(), h.restore();
|
|
518
518
|
}
|
|
519
519
|
const Vn = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", bn = new Image();
|
|
520
520
|
bn.src = Vn;
|
|
521
521
|
function Xn(h, t, e, n, s) {
|
|
522
522
|
const i = ge / 2;
|
|
523
|
-
h.save(), h.translate(t, e), h.rotate(
|
|
523
|
+
h.save(), h.translate(t, e), h.rotate(vt.degreesToRadians(s.angle)), h.fillStyle = Gn, h.beginPath(), h.arc(0, 0, i, 0, 2 * Math.PI), h.fill(), h.drawImage(bn, -i / 2, -i / 2, i, i), h.restore();
|
|
524
524
|
}
|
|
525
525
|
const Kn = {
|
|
526
526
|
// Угловые точки
|
|
527
527
|
tl: {
|
|
528
528
|
render: le,
|
|
529
|
-
sizeX:
|
|
530
|
-
sizeY:
|
|
529
|
+
sizeX: St,
|
|
530
|
+
sizeY: St,
|
|
531
531
|
offsetX: 0,
|
|
532
532
|
offsetY: 0
|
|
533
533
|
},
|
|
534
534
|
tr: {
|
|
535
535
|
render: le,
|
|
536
|
-
sizeX:
|
|
537
|
-
sizeY:
|
|
536
|
+
sizeX: St,
|
|
537
|
+
sizeY: St,
|
|
538
538
|
offsetX: 0,
|
|
539
539
|
offsetY: 0
|
|
540
540
|
},
|
|
541
541
|
bl: {
|
|
542
542
|
render: le,
|
|
543
|
-
sizeX:
|
|
544
|
-
sizeY:
|
|
543
|
+
sizeX: St,
|
|
544
|
+
sizeY: St,
|
|
545
545
|
offsetX: 0,
|
|
546
546
|
offsetY: 0
|
|
547
547
|
},
|
|
548
548
|
br: {
|
|
549
549
|
render: le,
|
|
550
|
-
sizeX:
|
|
551
|
-
sizeY:
|
|
550
|
+
sizeX: St,
|
|
551
|
+
sizeY: St,
|
|
552
552
|
offsetX: 0,
|
|
553
553
|
offsetY: 0
|
|
554
554
|
},
|
|
@@ -895,7 +895,7 @@ V.registeredFontKeys = /* @__PURE__ */ new Set(), V.descriptorDefaults = {
|
|
|
895
895
|
display: "auto"
|
|
896
896
|
};
|
|
897
897
|
let De = V;
|
|
898
|
-
const qn = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi44NzUgMi41YS42MjUuNjI1IDAgMCAwLS42MjUuNjI0VjYuMjVIMy4xMjVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2MTBjMCAuMzQ1LjI4LjYyNS42MjUuNjI1aDEwYy4zNDUgMCAuNjI1LS4yOC42MjUtLjYyNXYtMy4xMjZoMy4xMjVjLjM0NSAwIC42MjUtLjI4LjYyNS0uNjI1di0xMGEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTEwWm02Ljg3NSAxMGgyLjVWMy43NUg3LjV2Mi41aDUuNjI1Yy4zNDUgMCAuNjI1LjI4LjYyNS42MjV2NS42MjRabS0xMCAzLjc1VjcuNWg4Ljc1djguNzVIMy43NVoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==", Jn = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMi41IDcuNWMwLS42OS41Ni0xLjI1IDEuMjUtMS4yNWgxMi41Yy42OSAwIDEuMjUuNTYgMS4yNSAxLjI1djguNzVjMCAuNjktLjU2IDEuMjUtMS4yNSAxLjI1SDMuNzVjLS42OSAwLTEuMjUtLjU2LTEuMjUtMS4yNVY3LjVabTE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S42MyAwbC0zLjk3LTIuMzE2TDMuNzQgMTBaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=", ss = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI0VDNEU0MCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC4xMjUgMS4yNUExLjg3NSAxLjg3NSAwIDAgMCA2LjI1IDMuMTI1di42MjVIMy4xMjVhLjYyNS42MjUgMCAwIDAgMCAxLjI1aC42MjV2MTEuMjVBMS4yNSAxLjI1IDAgMCAwIDUgMTcuNWgxMGExLjI1IDEuMjUgMCAwIDAgMS4yNS0xLjI1VjVoLjYyNWEuNjI1LjYyNSAwIDAgMCAwLTEuMjVIMTMuNzV2LS42MjVhMS44NzUgMS44NzUgMCAwIDAtMS44NzUtMS44NzVoLTMuNzVabTQuMzc1IDIuNXYtLjYyNWEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2LjYyNWg1Wk01IDE2LjI1VjVoMTB2MTEuMjVINVpNOC4xMjUgNy41Yy4zNDUgMCAuNjI1LjI4LjYyNS42MjV2NWEuNjI1LjYyNSAwIDEgMS0xLjI1IDB2LTVjMC0uMzQ1LjI4LS42MjUuNjI1LS42MjVabTQuMzc1IDUuNjI1di01YS42MjUuNjI1IDAgMCAwLTEuMjUgMHY1YS42MjUuNjI1IDAgMSAwIDEuMjUgMFoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==", qt = {
|
|
899
899
|
style: {
|
|
900
900
|
position: "absolute",
|
|
901
901
|
display: "none",
|
|
@@ -1005,11 +1005,11 @@ class is {
|
|
|
1005
1005
|
_initToolbar() {
|
|
1006
1006
|
if (!this.options.showToolbar) return;
|
|
1007
1007
|
const t = this.options.toolbar || {};
|
|
1008
|
-
this.config = Ot(F(F({},
|
|
1009
|
-
style: F(F({},
|
|
1010
|
-
btnStyle: F(F({},
|
|
1011
|
-
icons: F(F({},
|
|
1012
|
-
handlers: F(F({},
|
|
1008
|
+
this.config = Ot(F(F({}, qt), t), {
|
|
1009
|
+
style: F(F({}, qt.style), t.style || {}),
|
|
1010
|
+
btnStyle: F(F({}, qt.btnStyle), t.btnStyle || {}),
|
|
1011
|
+
icons: F(F({}, qt.icons), t.icons || {}),
|
|
1012
|
+
handlers: F(F({}, qt.handlers), t.handlers || {})
|
|
1013
1013
|
}), 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 = () => {
|
|
1014
1014
|
this.el.style.display = "none";
|
|
1015
1015
|
}, this._createDOM(), this._bindEvents();
|
|
@@ -1292,7 +1292,7 @@ class J {
|
|
|
1292
1292
|
includeValueOnMove: !1
|
|
1293
1293
|
},
|
|
1294
1294
|
textDiff: {
|
|
1295
|
-
diffMatchPatch:
|
|
1295
|
+
diffMatchPatch: zn,
|
|
1296
1296
|
minLength: 60
|
|
1297
1297
|
}
|
|
1298
1298
|
});
|
|
@@ -1822,7 +1822,7 @@ class J {
|
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
1824
|
}
|
|
1825
|
-
const rs = 0.1, cs = 2, on = 0.1, ls = 90,
|
|
1825
|
+
const rs = 0.1, cs = 2, on = 0.1, ls = 90, Qt = 16, $t = 16, zt = 4096, Pt = 4096, an = "application/image-editor:", de = [
|
|
1826
1826
|
"format",
|
|
1827
1827
|
"uppercase",
|
|
1828
1828
|
"textCaseRaw",
|
|
@@ -1838,7 +1838,7 @@ const rs = 0.1, cs = 2, on = 0.1, ls = 90, Yt = 16, Ht = 16, Lt = 4096, _t = 409
|
|
|
1838
1838
|
"radiusBottomLeft",
|
|
1839
1839
|
"lineFontDefaults"
|
|
1840
1840
|
], ds = 50;
|
|
1841
|
-
class
|
|
1841
|
+
class pt {
|
|
1842
1842
|
constructor({ editor: t }) {
|
|
1843
1843
|
this.editor = t, this.options = t.options, this._createdBlobUrls = [], this.acceptContentTypes = this.editor.options.acceptContentTypes, this.acceptFormats = this.getAllowedFormatsFromContentTypes();
|
|
1844
1844
|
}
|
|
@@ -1867,7 +1867,7 @@ class St {
|
|
|
1867
1867
|
customData: c = null
|
|
1868
1868
|
} = t;
|
|
1869
1869
|
if (!e) return null;
|
|
1870
|
-
const { canvas: l, montageArea: d, transformManager: u, historyManager: f, errorManager: g } = this.editor, m = yield this.getContentType(e), p =
|
|
1870
|
+
const { canvas: l, montageArea: d, transformManager: u, historyManager: f, errorManager: g } = this.editor, m = yield this.getContentType(e), p = pt.getFormatFromContentType(m), { acceptContentTypes: y, acceptFormats: v } = this;
|
|
1871
1871
|
if (!this.isAllowedContentType(m)) {
|
|
1872
1872
|
const C = `Неверный contentType для изображения: ${m}. Ожидается один из: ${this.acceptContentTypes.join(", ")}.`;
|
|
1873
1873
|
return g.emitError({
|
|
@@ -1915,22 +1915,28 @@ class St {
|
|
|
1915
1915
|
withoutAdding: r,
|
|
1916
1916
|
customData: c
|
|
1917
1917
|
}
|
|
1918
|
-
}), null;
|
|
1918
|
+
}), f.resumeHistory(), null;
|
|
1919
1919
|
if (this._createdBlobUrls.push(C), p === "svg") {
|
|
1920
1920
|
const w = yield En(C);
|
|
1921
|
-
b =
|
|
1921
|
+
b = vt.groupSVGElements(w.objects, w.options);
|
|
1922
1922
|
} else
|
|
1923
|
-
b = yield
|
|
1923
|
+
b = yield Kt.fromURL(C, { crossOrigin: "anonymous" });
|
|
1924
1924
|
const { width: T, height: M } = b;
|
|
1925
|
-
if (b instanceof
|
|
1925
|
+
if (b instanceof Kt) {
|
|
1926
1926
|
const w = b.getElement();
|
|
1927
1927
|
let I = "";
|
|
1928
|
-
if (w instanceof HTMLImageElement ? I = w.src : w instanceof HTMLCanvasElement && (I = w.toDataURL()), M >
|
|
1929
|
-
const S = yield this.resizeImageToBoundaries(
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
this._createdBlobUrls.push(j), b = yield
|
|
1928
|
+
if (w instanceof HTMLImageElement ? I = w.src : w instanceof HTMLCanvasElement && (I = w.toDataURL()), M > Pt || T > zt) {
|
|
1929
|
+
const S = yield this.resizeImageToBoundaries({
|
|
1930
|
+
dataURL: I,
|
|
1931
|
+
sizeType: "max"
|
|
1932
|
+
}), j = URL.createObjectURL(S);
|
|
1933
|
+
this._createdBlobUrls.push(j), b = yield Kt.fromURL(j, { crossOrigin: "anonymous" });
|
|
1934
|
+
} else if (M < $t || T < Qt) {
|
|
1935
|
+
const S = yield this.resizeImageToBoundaries({
|
|
1936
|
+
dataURL: I,
|
|
1937
|
+
sizeType: "min"
|
|
1938
|
+
}), j = URL.createObjectURL(S);
|
|
1939
|
+
this._createdBlobUrls.push(j), b = yield Kt.fromURL(j, { crossOrigin: "anonymous" });
|
|
1934
1940
|
}
|
|
1935
1941
|
}
|
|
1936
1942
|
if (b.set("id", `${b.type}-${et()}`), b.set("format", p), b.set("customData", c || null), n === "scale-montage")
|
|
@@ -1976,32 +1982,59 @@ class St {
|
|
|
1976
1982
|
});
|
|
1977
1983
|
}
|
|
1978
1984
|
/**
|
|
1979
|
-
*
|
|
1980
|
-
*
|
|
1985
|
+
* Ресайзит изображение до заданных максимальных или минимальных размеров,
|
|
1986
|
+
* сохраняя пропорции. По умолчанию использует границы канваса.
|
|
1981
1987
|
*
|
|
1982
|
-
* @param
|
|
1983
|
-
* @param
|
|
1984
|
-
* @
|
|
1985
|
-
|
|
1986
|
-
|
|
1988
|
+
* @param options - опции
|
|
1989
|
+
* @param options.dataURL - dataURL изображения
|
|
1990
|
+
* @param options.sizeType - максимальный или минимальный размер ('max' | 'min')
|
|
1991
|
+
* @param options.maxWidth - максимальная ширина (по умолчанию CANVAS_MAX_WIDTH)
|
|
1992
|
+
* @param options.maxHeight - максимальная высота (по умолчанию CANVAS_MAX_HEIGHT)
|
|
1993
|
+
* @param options.minWidth - минимальная ширина (по умолчанию CANVAS_MIN_WIDTH)
|
|
1994
|
+
* @param options.minHeight - минимальная высота (по умолчанию CANVAS_MIN_HEIGHT)
|
|
1995
|
+
* @param options.asBase64 - вернуть base64 вместо Blob
|
|
1996
|
+
* @param options.emitMessage - выводить предупреждение в случае ресайза
|
|
1997
|
+
* @returns возвращает Promise с Blob или base64 в зависимости от опций
|
|
1998
|
+
*/
|
|
1999
|
+
resizeImageToBoundaries(t) {
|
|
1987
2000
|
return G(this, null, function* () {
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2001
|
+
const {
|
|
2002
|
+
dataURL: e,
|
|
2003
|
+
sizeType: n = "max",
|
|
2004
|
+
maxWidth: s = zt,
|
|
2005
|
+
maxHeight: o = Pt,
|
|
2006
|
+
minWidth: i = Qt,
|
|
2007
|
+
minHeight: a = $t,
|
|
2008
|
+
asBase64: r = !1,
|
|
2009
|
+
emitMessage: c = !0
|
|
2010
|
+
} = t, { errorManager: l, workerManager: d } = this.editor, u = {
|
|
2011
|
+
dataURL: e,
|
|
2012
|
+
sizeType: n,
|
|
2013
|
+
maxWidth: s,
|
|
2014
|
+
maxHeight: o,
|
|
2015
|
+
minWidth: i,
|
|
2016
|
+
minHeight: a
|
|
1997
2017
|
};
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2018
|
+
if (c) {
|
|
2019
|
+
let g = `Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ${s}x${o}`;
|
|
2020
|
+
n === "min" && (g = `Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ${i}x${a}`), l.emitWarning({
|
|
2021
|
+
origin: "ImageManager",
|
|
2022
|
+
method: "resizeImageToBoundaries",
|
|
2023
|
+
code: "IMAGE_RESIZE_WARNING",
|
|
2024
|
+
message: g,
|
|
2025
|
+
data: u
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
const f = yield d.post("resizeImage", u);
|
|
2029
|
+
if (r) {
|
|
2030
|
+
const g = yield this.getContentTypeFromUrl(e), p = pt.getFormatFromContentType(g) || "png", y = yield createImageBitmap(f);
|
|
2031
|
+
return yield d.post(
|
|
2032
|
+
"toDataURL",
|
|
2033
|
+
{ format: p, quality: 1, bitmap: y },
|
|
2034
|
+
[y]
|
|
2035
|
+
);
|
|
2036
|
+
}
|
|
2037
|
+
return f;
|
|
2005
2038
|
});
|
|
2006
2039
|
}
|
|
2007
2040
|
/**
|
|
@@ -2024,7 +2057,7 @@ class St {
|
|
|
2024
2057
|
exportAsBlob: o = !1
|
|
2025
2058
|
} = t, { canvas: i, montageArea: a, workerManager: r, interactionBlocker: c } = this.editor;
|
|
2026
2059
|
try {
|
|
2027
|
-
const l = n === "application/pdf", d = l ? "image/jpg" : n, u =
|
|
2060
|
+
const l = n === "application/pdf", d = l ? "image/jpg" : n, u = pt.getFormatFromContentType(d);
|
|
2028
2061
|
a.setCoords();
|
|
2029
2062
|
const { left: f, top: g, width: m, height: p } = a.getBoundingRect(), y = yield i.clone(["id", "format", "locked"]);
|
|
2030
2063
|
y.enableRetinaScaling = !1, ["image/jpg", "image/jpeg"].includes(d) && (y.backgroundColor = "#ffffff");
|
|
@@ -2039,7 +2072,7 @@ class St {
|
|
|
2039
2072
|
const S = y.toSVG();
|
|
2040
2073
|
y.dispose();
|
|
2041
2074
|
const O = {
|
|
2042
|
-
image:
|
|
2075
|
+
image: pt._exportSVGStringAsFile(S, {
|
|
2043
2076
|
exportAsBase64: s,
|
|
2044
2077
|
exportAsBlob: o,
|
|
2045
2078
|
fileName: e
|
|
@@ -2148,9 +2181,9 @@ class St {
|
|
|
2148
2181
|
data: { contentType: s, fileName: n, exportAsBase64: o, exportAsBlob: i }
|
|
2149
2182
|
}), null;
|
|
2150
2183
|
try {
|
|
2151
|
-
const l =
|
|
2184
|
+
const l = pt.getFormatFromContentType(s);
|
|
2152
2185
|
if (l === "svg") {
|
|
2153
|
-
const m = c.toSVG(), p =
|
|
2186
|
+
const m = c.toSVG(), p = pt._exportSVGStringAsFile(m, {
|
|
2154
2187
|
exportAsBase64: o,
|
|
2155
2188
|
exportAsBlob: i,
|
|
2156
2189
|
fileName: n
|
|
@@ -2163,7 +2196,7 @@ class St {
|
|
|
2163
2196
|
};
|
|
2164
2197
|
return a.fire("editor:object-exported", y), y;
|
|
2165
2198
|
}
|
|
2166
|
-
if (o && c instanceof
|
|
2199
|
+
if (o && c instanceof Kt) {
|
|
2167
2200
|
const m = yield createImageBitmap(c.getElement()), p = yield r.post(
|
|
2168
2201
|
"toDataURL",
|
|
2169
2202
|
{
|
|
@@ -2228,7 +2261,7 @@ class St {
|
|
|
2228
2261
|
* @returns массив допустимых форматов изображений
|
|
2229
2262
|
*/
|
|
2230
2263
|
getAllowedFormatsFromContentTypes() {
|
|
2231
|
-
return this.acceptContentTypes.map((t) =>
|
|
2264
|
+
return this.acceptContentTypes.map((t) => pt.getFormatFromContentType(t)).filter((t) => t);
|
|
2232
2265
|
}
|
|
2233
2266
|
/**
|
|
2234
2267
|
* Проверяет, является ли contentType допустимым типом изображения.
|
|
@@ -2281,7 +2314,7 @@ class St {
|
|
|
2281
2314
|
try {
|
|
2282
2315
|
const s = (e = new URL(t).pathname.split(".").pop()) == null ? void 0 : e.toLowerCase(), o = {};
|
|
2283
2316
|
return this.acceptContentTypes.forEach((i) => {
|
|
2284
|
-
const a =
|
|
2317
|
+
const a = pt.getFormatFromContentType(i);
|
|
2285
2318
|
a && (o[a] = i);
|
|
2286
2319
|
}), s && o[s] || "application/octet-stream";
|
|
2287
2320
|
} catch (n) {
|
|
@@ -2385,7 +2418,7 @@ class fs {
|
|
|
2385
2418
|
canvas: o,
|
|
2386
2419
|
montageArea: i,
|
|
2387
2420
|
options: { canvasBackstoreWidth: a }
|
|
2388
|
-
} = this.editor, { width: r, height: c } = i, l = Ct(Number(t),
|
|
2421
|
+
} = this.editor, { width: r, height: c } = i, l = Ct(Number(t), Qt, zt);
|
|
2389
2422
|
if (!a || a === "auto" || s ? this.adaptCanvasToContainer() : a ? this.setCanvasBackstoreWidth(Number(a)) : this.setCanvasBackstoreWidth(l), i.set({ width: l }), (g = o.clipPath) == null || g.set({ width: l }), e) {
|
|
2390
2423
|
const m = l / r, p = rn(c, m);
|
|
2391
2424
|
this.setResolutionHeight(p);
|
|
@@ -2415,7 +2448,7 @@ class fs {
|
|
|
2415
2448
|
canvas: o,
|
|
2416
2449
|
montageArea: i,
|
|
2417
2450
|
options: { canvasBackstoreHeight: a }
|
|
2418
|
-
} = this.editor, { width: r, height: c } = i, l = Ct(Number(t),
|
|
2451
|
+
} = this.editor, { width: r, height: c } = i, l = Ct(Number(t), $t, Pt);
|
|
2419
2452
|
if (!a || a === "auto" || s ? this.adaptCanvasToContainer() : a ? this.setCanvasBackstoreHeight(Number(a)) : this.setCanvasBackstoreHeight(l), i.set({ height: l }), (g = o.clipPath) == null || g.set({ height: l }), e) {
|
|
2420
2453
|
const m = l / c, p = rn(r, m);
|
|
2421
2454
|
this.setResolutionWidth(p);
|
|
@@ -2468,7 +2501,7 @@ class fs {
|
|
|
2468
2501
|
*/
|
|
2469
2502
|
setCanvasBackstoreWidth(t) {
|
|
2470
2503
|
if (!t || typeof t != "number") return;
|
|
2471
|
-
const e = Ct(t,
|
|
2504
|
+
const e = Ct(t, Qt, zt);
|
|
2472
2505
|
this.editor.canvas.setDimensions({ width: e }, { backstoreOnly: !0 });
|
|
2473
2506
|
}
|
|
2474
2507
|
/**
|
|
@@ -2477,7 +2510,7 @@ class fs {
|
|
|
2477
2510
|
*/
|
|
2478
2511
|
setCanvasBackstoreHeight(t) {
|
|
2479
2512
|
if (!t || typeof t != "number") return;
|
|
2480
|
-
const e = Ct(t,
|
|
2513
|
+
const e = Ct(t, $t, Pt);
|
|
2481
2514
|
this.editor.canvas.setDimensions({ height: e }, { backstoreOnly: !0 });
|
|
2482
2515
|
}
|
|
2483
2516
|
/**
|
|
@@ -2486,7 +2519,7 @@ class fs {
|
|
|
2486
2519
|
* с учётом минимальных и максимальных значений.
|
|
2487
2520
|
*/
|
|
2488
2521
|
adaptCanvasToContainer() {
|
|
2489
|
-
const { canvas: t } = this.editor, e = this.getEditorContainer(), n = e.clientWidth, s = e.clientHeight, o = Ct(n,
|
|
2522
|
+
const { canvas: t } = this.editor, e = this.getEditorContainer(), n = e.clientWidth, s = e.clientHeight, o = Ct(n, Qt, zt), i = Ct(s, $t, Pt);
|
|
2490
2523
|
t.setDimensions({ width: o, height: i }, { backstoreOnly: !0 });
|
|
2491
2524
|
}
|
|
2492
2525
|
/**
|
|
@@ -2688,7 +2721,7 @@ class fs {
|
|
|
2688
2721
|
} = this.editor, c = t || s.getActiveObject();
|
|
2689
2722
|
if (!us(c)) return;
|
|
2690
2723
|
const { width: l, height: d } = c;
|
|
2691
|
-
let u = Math.min(l,
|
|
2724
|
+
let u = Math.min(l, zt), f = Math.min(d, Pt);
|
|
2692
2725
|
if (e) {
|
|
2693
2726
|
const {
|
|
2694
2727
|
width: g,
|
|
@@ -4131,7 +4164,7 @@ class me {
|
|
|
4131
4164
|
});
|
|
4132
4165
|
}
|
|
4133
4166
|
static _isGroupOrSelection(t) {
|
|
4134
|
-
return t instanceof X || t instanceof
|
|
4167
|
+
return t instanceof X || t instanceof Nt;
|
|
4135
4168
|
}
|
|
4136
4169
|
}
|
|
4137
4170
|
class bs {
|
|
@@ -4154,20 +4187,20 @@ class bs {
|
|
|
4154
4187
|
*/
|
|
4155
4188
|
_getGroupsToUngroup(t) {
|
|
4156
4189
|
if (Array.isArray(t)) {
|
|
4157
|
-
const n = t.filter((s) => s instanceof
|
|
4190
|
+
const n = t.filter((s) => s instanceof Nt);
|
|
4158
4191
|
return n.length > 0 ? n : null;
|
|
4159
4192
|
}
|
|
4160
4193
|
if (t instanceof X) {
|
|
4161
|
-
const n = t.getObjects().filter((s) => s instanceof
|
|
4194
|
+
const n = t.getObjects().filter((s) => s instanceof Nt);
|
|
4162
4195
|
return n.length > 0 ? n : null;
|
|
4163
4196
|
}
|
|
4164
4197
|
const e = t || this.editor.canvas.getActiveObject();
|
|
4165
4198
|
if (!e) return null;
|
|
4166
4199
|
if (e instanceof X) {
|
|
4167
|
-
const n = e.getObjects().filter((s) => s instanceof
|
|
4200
|
+
const n = e.getObjects().filter((s) => s instanceof Nt);
|
|
4168
4201
|
return n.length > 0 ? n : null;
|
|
4169
4202
|
}
|
|
4170
|
-
return e instanceof
|
|
4203
|
+
return e instanceof Nt ? [e] : null;
|
|
4171
4204
|
}
|
|
4172
4205
|
/**
|
|
4173
4206
|
* Группировка объектов
|
|
@@ -4184,7 +4217,7 @@ class bs {
|
|
|
4184
4217
|
if (!o) return null;
|
|
4185
4218
|
try {
|
|
4186
4219
|
s.suspendHistory();
|
|
4187
|
-
const i = new
|
|
4220
|
+
const i = new Nt(o, {
|
|
4188
4221
|
id: `group-${et()}`
|
|
4189
4222
|
});
|
|
4190
4223
|
o.forEach((r) => n.remove(r)), n.add(i), n.setActiveObject(i), n.requestRenderAll();
|
|
@@ -4623,7 +4656,7 @@ const ws = ({ textbox: h }) => {
|
|
|
4623
4656
|
);
|
|
4624
4657
|
if (n.length)
|
|
4625
4658
|
return (s = n[0]) == null ? void 0 : s[e];
|
|
4626
|
-
}, _e = ({ strokeColor: h, width: t }) => t <= 0 ? null : h != null ? h : "#000000", xe = ({ width: h = 0 }) => h ? Math.max(0, h) : 0, we = ({ value: h }) => typeof h == "string" ? h.toLocaleUpperCase() : "",
|
|
4659
|
+
}, _e = ({ strokeColor: h, width: t }) => t <= 0 ? null : h != null ? h : "#000000", xe = ({ width: h = 0 }) => h ? Math.max(0, h) : 0, we = ({ value: h }) => typeof h == "string" ? h.toLocaleUpperCase() : "", Mt = ({
|
|
4627
4660
|
value: h,
|
|
4628
4661
|
min: t,
|
|
4629
4662
|
max: e
|
|
@@ -4719,7 +4752,7 @@ const ws = ({ textbox: h }) => {
|
|
|
4719
4752
|
let M = 0, A = 0, w = this.getValueOfPropertyAt(p, 0, e), I = this._getDecorationColorAt(p, 0), S = this.getValueOfPropertyAt(p, 0, "textDecorationThickness"), j = w, O = I, k = S;
|
|
4720
4753
|
const D = l + b * (1 - r);
|
|
4721
4754
|
let W = this.getHeightOfChar(p, 0), E = this.getValueOfPropertyAt(p, 0, "deltaY");
|
|
4722
|
-
for (let B = 0,
|
|
4755
|
+
for (let B = 0, P = C.length; B < P; B += 1) {
|
|
4723
4756
|
const x = this.__charBounds[p][B];
|
|
4724
4757
|
j = this.getValueOfPropertyAt(p, B, e), O = this._getDecorationColorAt(p, B), k = this.getValueOfPropertyAt(p, B, "textDecorationThickness");
|
|
4725
4758
|
const _ = this.getHeightOfChar(p, B), R = this.getValueOfPropertyAt(p, B, "deltaY");
|
|
@@ -4745,12 +4778,12 @@ const ws = ({ textbox: h }) => {
|
|
|
4745
4778
|
}
|
|
4746
4779
|
let L = d + T + M;
|
|
4747
4780
|
n === "rtl" && (L = a - L - A), t.fillStyle = O;
|
|
4748
|
-
const
|
|
4781
|
+
const z = s * k / 1e3;
|
|
4749
4782
|
j && O && k && t.fillRect(
|
|
4750
4783
|
L,
|
|
4751
|
-
D + g * W + E - m *
|
|
4784
|
+
D + g * W + E - m * z,
|
|
4752
4785
|
A - f,
|
|
4753
|
-
|
|
4786
|
+
z
|
|
4754
4787
|
), l += v;
|
|
4755
4788
|
}
|
|
4756
4789
|
this._removeShadow(t);
|
|
@@ -4779,10 +4812,10 @@ const ws = ({ textbox: h }) => {
|
|
|
4779
4812
|
var i, a, r, c;
|
|
4780
4813
|
const n = t / 2, s = e / 2, o = Math.min(n, s);
|
|
4781
4814
|
return {
|
|
4782
|
-
bottomLeft:
|
|
4783
|
-
bottomRight:
|
|
4784
|
-
topLeft:
|
|
4785
|
-
topRight:
|
|
4815
|
+
bottomLeft: Mt({ value: (i = this.radiusBottomLeft) != null ? i : 0, min: 0, max: o }),
|
|
4816
|
+
bottomRight: Mt({ value: (a = this.radiusBottomRight) != null ? a : 0, min: 0, max: o }),
|
|
4817
|
+
topLeft: Mt({ value: (r = this.radiusTopLeft) != null ? r : 0, min: 0, max: o }),
|
|
4818
|
+
topRight: Mt({ value: (c = this.radiusTopRight) != null ? c : 0, min: 0, max: o })
|
|
4786
4819
|
};
|
|
4787
4820
|
}
|
|
4788
4821
|
_getPadding() {
|
|
@@ -4798,7 +4831,7 @@ const ws = ({ textbox: h }) => {
|
|
|
4798
4831
|
var s;
|
|
4799
4832
|
const t = this.backgroundColor;
|
|
4800
4833
|
if (!t) return null;
|
|
4801
|
-
const e =
|
|
4834
|
+
const e = Mt({ value: (s = this.backgroundOpacity) != null ? s : 1, min: 0, max: 1 });
|
|
4802
4835
|
let n;
|
|
4803
4836
|
try {
|
|
4804
4837
|
n = new xn(t);
|
|
@@ -4826,7 +4859,7 @@ const ws = ({ textbox: h }) => {
|
|
|
4826
4859
|
topRight: l,
|
|
4827
4860
|
bottomRight: d,
|
|
4828
4861
|
bottomLeft: u
|
|
4829
|
-
} = s, f =
|
|
4862
|
+
} = s, f = Mt({ value: c, min: 0, max: i }), g = Mt({ value: l, min: 0, max: i }), m = Mt({ value: d, min: 0, max: i }), p = Mt({ value: u, min: 0, max: i });
|
|
4830
4863
|
t.beginPath(), t.moveTo(n + f, o), t.lineTo(a - g, o), t.quadraticCurveTo(a, o, a, o + g), t.lineTo(a, r - m), t.quadraticCurveTo(a, r, a - m, r), t.lineTo(n + p, r), t.quadraticCurveTo(n, r, n, r - p), t.lineTo(n, o + f), t.quadraticCurveTo(n, o, n + f, o), t.closePath();
|
|
4831
4864
|
}
|
|
4832
4865
|
/**
|
|
@@ -5195,7 +5228,7 @@ class rt {
|
|
|
5195
5228
|
event: i != null ? i : null
|
|
5196
5229
|
});
|
|
5197
5230
|
}, this._handleObjectScaling = (n) => {
|
|
5198
|
-
var ne, ve, se, ie, oe,
|
|
5231
|
+
var ne, ve, se, ie, oe, Rt, be, ae, Ht, Zt, Gt, Vt, Xt;
|
|
5199
5232
|
const { target: s, transform: o } = n;
|
|
5200
5233
|
if (s instanceof X || !rt._isTextbox(s) || !o) return;
|
|
5201
5234
|
s.isScaling = !0;
|
|
@@ -5209,15 +5242,15 @@ class rt {
|
|
|
5209
5242
|
baseLineFontDefaults: f
|
|
5210
5243
|
} = i, g = typeof ((ne = o.original) == null ? void 0 : ne.width) == "number" ? o.original.width : void 0, m = typeof ((ve = o.original) == null ? void 0 : ve.left) == "number" ? o.original.left : void 0, p = g != null ? g : a, y = m != null ? m : r, v = (se = o.corner) != null ? se : "", C = (ie = o.action) != null ? ie : "", b = ["ml", "mr"].includes(v) || C === "scaleX", T = ["mt", "mb"].includes(v) || C === "scaleY", M = ["tl", "tr", "bl", "br"].includes(v) || C === "scale", A = M || T;
|
|
5211
5244
|
if (!b && !T && !M) return;
|
|
5212
|
-
const w = Math.abs((
|
|
5245
|
+
const w = Math.abs((Rt = (oe = s.scaleX) != null ? oe : o.scaleX) != null ? Rt : 1) || 1, I = Math.abs((ae = (be = s.scaleY) != null ? be : o.scaleY) != null ? ae : 1) || 1, S = Math.max(1, p * w), j = Math.max(1, Math.round(S)), O = Math.max(1, c * I), {
|
|
5213
5246
|
paddingTop: k = 0,
|
|
5214
5247
|
paddingRight: D = 0,
|
|
5215
5248
|
paddingBottom: W = 0,
|
|
5216
5249
|
paddingLeft: E = 0,
|
|
5217
5250
|
radiusTopLeft: L = 0,
|
|
5218
|
-
radiusTopRight:
|
|
5251
|
+
radiusTopRight: z = 0,
|
|
5219
5252
|
radiusBottomRight: B = 0,
|
|
5220
|
-
radiusBottomLeft:
|
|
5253
|
+
radiusBottomLeft: P = 0,
|
|
5221
5254
|
fontSize: x,
|
|
5222
5255
|
width: _,
|
|
5223
5256
|
originX: R = "left"
|
|
@@ -5234,24 +5267,24 @@ class rt {
|
|
|
5234
5267
|
} : d, tt = Object.keys(u).length > 0;
|
|
5235
5268
|
let at;
|
|
5236
5269
|
if (A && tt) {
|
|
5237
|
-
const
|
|
5270
|
+
const kt = {};
|
|
5238
5271
|
Object.entries(u).forEach(([re, Q]) => {
|
|
5239
5272
|
if (!Q) return;
|
|
5240
5273
|
const st = {};
|
|
5241
|
-
Object.entries(Q).forEach(([Me,
|
|
5242
|
-
if (!
|
|
5243
|
-
const He = F({},
|
|
5244
|
-
typeof
|
|
5245
|
-
}), Object.keys(st).length && (
|
|
5246
|
-
}), Object.keys(
|
|
5274
|
+
Object.entries(Q).forEach(([Me, Bt]) => {
|
|
5275
|
+
if (!Bt) return;
|
|
5276
|
+
const He = F({}, Bt);
|
|
5277
|
+
typeof Bt.fontSize == "number" && (He.fontSize = Math.max(1, Bt.fontSize * I)), st[Me] = He;
|
|
5278
|
+
}), Object.keys(st).length && (kt[re] = st);
|
|
5279
|
+
}), Object.keys(kt).length && (at = kt);
|
|
5247
5280
|
}
|
|
5248
5281
|
let ft;
|
|
5249
5282
|
A && (ft = hn({
|
|
5250
5283
|
lineFontDefaults: f,
|
|
5251
5284
|
scale: I
|
|
5252
5285
|
}));
|
|
5253
|
-
const wt = (
|
|
5254
|
-
if (!At && !
|
|
5286
|
+
const wt = (Zt = (Ht = o.originX) != null ? Ht : R) != null ? Zt : "left", dt = y + p, ht = y + p / 2, It = _ != null ? _ : p, At = j !== It, Lt = Math.abs(O - (x != null ? x : c)) > it, _t = Math.abs(H.top - k) > it || Math.abs(H.right - D) > it || Math.abs(H.bottom - W) > it || Math.abs(H.left - E) > it, xt = Math.abs(q.topLeft - L) > it || Math.abs(q.topRight - z) > it || Math.abs(q.bottomRight - B) > it || Math.abs(q.bottomLeft - P) > it;
|
|
5287
|
+
if (!At && !Lt && !_t && !xt) {
|
|
5255
5288
|
s.set({ scaleX: 1, scaleY: 1 }), o.scaleX = 1, o.scaleY = 1;
|
|
5256
5289
|
return;
|
|
5257
5290
|
}
|
|
@@ -5269,13 +5302,13 @@ class rt {
|
|
|
5269
5302
|
scaleX: 1,
|
|
5270
5303
|
scaleY: 1
|
|
5271
5304
|
});
|
|
5272
|
-
const
|
|
5273
|
-
|
|
5274
|
-
const gt = (
|
|
5305
|
+
const Yt = Et({ textbox: s });
|
|
5306
|
+
Yt && (s.dirty = !0);
|
|
5307
|
+
const gt = (Gt = s.width) != null ? Gt : j, ee = gt !== It;
|
|
5275
5308
|
let Tt = y;
|
|
5276
5309
|
ee && (b || M) && (wt === "right" ? Tt = dt - gt : wt === "center" && (Tt = ht - gt / 2)), s.set({ left: Tt }), i.baseLeft = Tt, o.scaleX = 1, o.scaleY = 1;
|
|
5277
|
-
const { original:
|
|
5278
|
-
|
|
5310
|
+
const { original: bt } = o;
|
|
5311
|
+
bt && (bt.scaleX = 1, bt.scaleY = 1, bt.width = gt, bt.height = s.height, bt.left = Tt), s.setCoords(), this.canvas.requestRenderAll(), i.baseWidth = gt, i.baseFontSize = (Vt = s.fontSize) != null ? Vt : O, i.baseStyles = JSON.parse(JSON.stringify((Xt = s.styles) != null ? Xt : {})), i.baseLineFontDefaults = dn({
|
|
5279
5312
|
lineFontDefaults: s.lineFontDefaults
|
|
5280
5313
|
}), i.basePadding = {
|
|
5281
5314
|
top: H.top,
|
|
@@ -5287,7 +5320,7 @@ class rt {
|
|
|
5287
5320
|
topRight: q.topRight,
|
|
5288
5321
|
bottomRight: q.bottomRight,
|
|
5289
5322
|
bottomLeft: q.bottomLeft
|
|
5290
|
-
}, i.hasWidthChange = ee ||
|
|
5323
|
+
}, i.hasWidthChange = ee || Lt || _t || xt || Yt;
|
|
5291
5324
|
}, this._handleObjectModified = (n) => {
|
|
5292
5325
|
var v, C, b;
|
|
5293
5326
|
const { target: s } = n;
|
|
@@ -5299,8 +5332,8 @@ class rt {
|
|
|
5299
5332
|
this.canvas.discardActiveObject(), T.forEach((S) => {
|
|
5300
5333
|
var j, O, k, D;
|
|
5301
5334
|
if (rt._isTextbox(S)) {
|
|
5302
|
-
const W = (j = S.scaleX) != null ? j : 1, E = (O = S.scaleY) != null ? O : 1, L = ((k = S.fontSize) != null ? k : 16) * E,
|
|
5303
|
-
paddingTop:
|
|
5335
|
+
const W = (j = S.scaleX) != null ? j : 1, E = (O = S.scaleY) != null ? O : 1, L = ((k = S.fontSize) != null ? k : 16) * E, z = ((D = S.width) != null ? D : 0) * W, B = E, {
|
|
5336
|
+
paddingTop: P = 0,
|
|
5304
5337
|
paddingRight: x = 0,
|
|
5305
5338
|
paddingBottom: _ = 0,
|
|
5306
5339
|
paddingLeft: R = 0,
|
|
@@ -5310,7 +5343,7 @@ class rt {
|
|
|
5310
5343
|
radiusBottomLeft: q = 0,
|
|
5311
5344
|
styles: tt
|
|
5312
5345
|
} = S, at = {
|
|
5313
|
-
paddingTop: Math.max(0,
|
|
5346
|
+
paddingTop: Math.max(0, P * B),
|
|
5314
5347
|
paddingRight: Math.max(0, x * B),
|
|
5315
5348
|
paddingBottom: Math.max(0, _ * B),
|
|
5316
5349
|
paddingLeft: Math.max(0, R * B)
|
|
@@ -5331,7 +5364,7 @@ class rt {
|
|
|
5331
5364
|
scale: B
|
|
5332
5365
|
}), ht = Ot(F(F({
|
|
5333
5366
|
fontSize: L,
|
|
5334
|
-
width:
|
|
5367
|
+
width: z,
|
|
5335
5368
|
scaleX: 1,
|
|
5336
5369
|
scaleY: 1
|
|
5337
5370
|
}, at), ft), {
|
|
@@ -5439,12 +5472,12 @@ class rt {
|
|
|
5439
5472
|
var K;
|
|
5440
5473
|
const { historyManager: E } = this.editor, { canvas: L } = this;
|
|
5441
5474
|
E.suspendHistory();
|
|
5442
|
-
const
|
|
5475
|
+
const z = s != null ? s : this._getDefaultFontFamily(), B = xe({ width: g }), P = _e({
|
|
5443
5476
|
strokeColor: f,
|
|
5444
5477
|
width: B
|
|
5445
5478
|
}), x = F({
|
|
5446
5479
|
id: t,
|
|
5447
|
-
fontFamily:
|
|
5480
|
+
fontFamily: z,
|
|
5448
5481
|
fontSize: o,
|
|
5449
5482
|
fontWeight: i ? "bold" : "normal",
|
|
5450
5483
|
fontStyle: a ? "italic" : "normal",
|
|
@@ -5453,7 +5486,7 @@ class rt {
|
|
|
5453
5486
|
linethrough: l,
|
|
5454
5487
|
textAlign: d,
|
|
5455
5488
|
fill: u,
|
|
5456
|
-
stroke:
|
|
5489
|
+
stroke: P,
|
|
5457
5490
|
strokeWidth: B,
|
|
5458
5491
|
strokeUniform: !0,
|
|
5459
5492
|
opacity: m,
|
|
@@ -5481,7 +5514,7 @@ class rt {
|
|
|
5481
5514
|
strikethrough: l,
|
|
5482
5515
|
align: d,
|
|
5483
5516
|
color: u,
|
|
5484
|
-
strokeColor:
|
|
5517
|
+
strokeColor: P,
|
|
5485
5518
|
strokeWidth: B
|
|
5486
5519
|
}),
|
|
5487
5520
|
flags: {
|
|
@@ -5507,16 +5540,16 @@ class rt {
|
|
|
5507
5540
|
skipRender: s,
|
|
5508
5541
|
selectionRange: o
|
|
5509
5542
|
} = {}) {
|
|
5510
|
-
var
|
|
5543
|
+
var Ht, Gt, Vt, Xt, kt, re;
|
|
5511
5544
|
const i = this._resolveTextObject(t);
|
|
5512
5545
|
if (!i) return null;
|
|
5513
5546
|
const { text: a = "" } = i, { historyManager: r } = this.editor, { canvas: c } = this;
|
|
5514
5547
|
r.suspendHistory();
|
|
5515
|
-
const l = rt._getSnapshot(i), d = (
|
|
5548
|
+
const l = rt._getSnapshot(i), d = (Ht = i.originY) != null ? Ht : "top", u = i.getPointByOrigin("center", d), f = {
|
|
5516
5549
|
originY: d,
|
|
5517
5550
|
x: u.x,
|
|
5518
5551
|
y: u.y
|
|
5519
|
-
},
|
|
5552
|
+
}, Zt = e, {
|
|
5520
5553
|
text: g,
|
|
5521
5554
|
autoExpand: m,
|
|
5522
5555
|
fontFamily: p,
|
|
@@ -5537,11 +5570,11 @@ class rt {
|
|
|
5537
5570
|
paddingRight: W,
|
|
5538
5571
|
paddingBottom: E,
|
|
5539
5572
|
paddingLeft: L,
|
|
5540
|
-
radiusTopLeft:
|
|
5573
|
+
radiusTopLeft: z,
|
|
5541
5574
|
radiusTopRight: B,
|
|
5542
|
-
radiusBottomRight:
|
|
5575
|
+
radiusBottomRight: P,
|
|
5543
5576
|
radiusBottomLeft: x
|
|
5544
|
-
} =
|
|
5577
|
+
} = Zt, _ = jt(Zt, [
|
|
5545
5578
|
"text",
|
|
5546
5579
|
"autoExpand",
|
|
5547
5580
|
"fontFamily",
|
|
@@ -5581,21 +5614,21 @@ class rt {
|
|
|
5581
5614
|
N && (H.fontStyle = Q), dt && (R.fontStyle = Q, ht && (tt.fontStyle = Q));
|
|
5582
5615
|
}
|
|
5583
5616
|
if (b !== void 0 && (N && (H.underline = b), dt && (R.underline = b, ht && (tt.underline = b))), M !== void 0 && (N && (H.linethrough = M), dt && (R.linethrough = M, ht && (tt.linethrough = M))), A !== void 0 && (R.textAlign = A), w !== void 0 && (N && (H.fill = w), dt && (R.fill = w, ht && (tt.fill = w))), I !== void 0 || S !== void 0) {
|
|
5584
|
-
const Q = N ? cn({ textbox: i, range: N, property: "strokeWidth" }) : void 0, st = N ? cn({ textbox: i, range: N, property: "stroke" }) : void 0, Me = (
|
|
5617
|
+
const Q = N ? cn({ textbox: i, range: N, property: "strokeWidth" }) : void 0, st = N ? cn({ textbox: i, range: N, property: "stroke" }) : void 0, Me = (Vt = (Gt = S != null ? S : Q) != null ? Gt : i.strokeWidth) != null ? Vt : 0;
|
|
5585
5618
|
ft = xe({ width: Me });
|
|
5586
|
-
const
|
|
5619
|
+
const Bt = (kt = (Xt = I != null ? I : st) != null ? Xt : i.stroke) != null ? kt : void 0;
|
|
5587
5620
|
at = _e({
|
|
5588
|
-
strokeColor:
|
|
5621
|
+
strokeColor: Bt,
|
|
5589
5622
|
width: ft
|
|
5590
5623
|
}), N && (H.stroke = at, H.strokeWidth = ft), dt && (R.stroke = at, R.strokeWidth = ft, ht && (tt.stroke = at, tt.strokeWidth = ft));
|
|
5591
5624
|
}
|
|
5592
|
-
j !== void 0 && (R.opacity = j), O !== void 0 && (R.backgroundColor = O), k !== void 0 && (R.backgroundOpacity = k), D !== void 0 && (R.paddingTop = D), W !== void 0 && (R.paddingRight = W), E !== void 0 && (R.paddingBottom = E), L !== void 0 && (R.paddingLeft = L),
|
|
5593
|
-
const It = (re = i.textCaseRaw) != null ? re : a, At = !!i.uppercase,
|
|
5594
|
-
if (
|
|
5595
|
-
const Q =
|
|
5596
|
-
R.text = Q, i.textCaseRaw =
|
|
5625
|
+
j !== void 0 && (R.opacity = j), O !== void 0 && (R.backgroundColor = O), k !== void 0 && (R.backgroundOpacity = k), D !== void 0 && (R.paddingTop = D), W !== void 0 && (R.paddingRight = W), E !== void 0 && (R.paddingBottom = E), L !== void 0 && (R.paddingLeft = L), z !== void 0 && (R.radiusTopLeft = z), B !== void 0 && (R.radiusTopRight = B), P !== void 0 && (R.radiusBottomRight = P), x !== void 0 && (R.radiusBottomLeft = x);
|
|
5626
|
+
const It = (re = i.textCaseRaw) != null ? re : a, At = !!i.uppercase, Lt = g !== void 0, _t = Lt ? g != null ? g : "" : It, xt = T != null ? T : At, Yt = xt !== At;
|
|
5627
|
+
if (Lt || Yt) {
|
|
5628
|
+
const Q = xt ? we({ value: _t }) : _t;
|
|
5629
|
+
R.text = Q, i.textCaseRaw = _t;
|
|
5597
5630
|
} else i.textCaseRaw === void 0 && (i.textCaseRaw = It);
|
|
5598
|
-
i.uppercase =
|
|
5631
|
+
i.uppercase = xt, i.set(R);
|
|
5599
5632
|
let gt = !1;
|
|
5600
5633
|
if (N) {
|
|
5601
5634
|
const Q = Se({ textbox: i, styles: H, range: N }), st = K ? Se({ textbox: i, styles: q, range: K }) : !1;
|
|
@@ -5633,7 +5666,7 @@ class rt {
|
|
|
5633
5666
|
updates: st
|
|
5634
5667
|
});
|
|
5635
5668
|
}
|
|
5636
|
-
ee && (i.initDimensions(), i.dirty = !0), (O !== void 0 || k !== void 0 || D !== void 0 || W !== void 0 || E !== void 0 || L !== void 0 ||
|
|
5669
|
+
ee && (i.initDimensions(), i.dirty = !0), (O !== void 0 || k !== void 0 || D !== void 0 || W !== void 0 || E !== void 0 || L !== void 0 || z !== void 0 || B !== void 0 || P !== void 0 || x !== void 0) && (i.dirty = !0);
|
|
5637
5670
|
const Tt = fn({
|
|
5638
5671
|
stylesList: [
|
|
5639
5672
|
R,
|
|
@@ -5641,13 +5674,13 @@ class rt {
|
|
|
5641
5674
|
q,
|
|
5642
5675
|
tt
|
|
5643
5676
|
]
|
|
5644
|
-
}), { autoExpand:
|
|
5645
|
-
ne ? i.autoExpand = m !== !1 :
|
|
5646
|
-
const ie = Object.prototype.hasOwnProperty.call(R, "width"), oe = se && !ie && (
|
|
5647
|
-
let
|
|
5648
|
-
oe && (
|
|
5677
|
+
}), { autoExpand: bt } = i, ne = m !== void 0, se = (m != null ? m : bt) !== !1;
|
|
5678
|
+
ne ? i.autoExpand = m !== !1 : bt === void 0 && (i.autoExpand = !0);
|
|
5679
|
+
const ie = Object.prototype.hasOwnProperty.call(R, "width"), oe = se && !ie && (Lt || Yt || Tt);
|
|
5680
|
+
let Rt = !1;
|
|
5681
|
+
oe && (Rt = this._autoExpandTextboxWidth(i, {
|
|
5649
5682
|
anchor: f
|
|
5650
|
-
}),
|
|
5683
|
+
}), Rt && (i.dirty = !0)), (Rt ? !1 : Et({ textbox: i })) && (i.dirty = !0), i.setCoords(), s || c.requestRenderAll(), r.resumeHistory(), n || r.saveState();
|
|
5651
5684
|
const ae = rt._getSnapshot(i);
|
|
5652
5685
|
return c.fire("editor:text-updated", {
|
|
5653
5686
|
textbox: i,
|
|
@@ -5669,7 +5702,7 @@ class rt {
|
|
|
5669
5702
|
*/
|
|
5670
5703
|
// eslint-disable-next-line class-methods-use-this
|
|
5671
5704
|
stylesFromArray(t, e) {
|
|
5672
|
-
return
|
|
5705
|
+
return vt.stylesFromArray(t, e);
|
|
5673
5706
|
}
|
|
5674
5707
|
/**
|
|
5675
5708
|
* Уничтожает менеджер и снимает слушатели.
|
|
@@ -5736,13 +5769,13 @@ class rt {
|
|
|
5736
5769
|
charIndex: E
|
|
5737
5770
|
});
|
|
5738
5771
|
if (y > 0) {
|
|
5739
|
-
const
|
|
5772
|
+
const z = Rs({
|
|
5740
5773
|
text: u,
|
|
5741
5774
|
lineIndex: L
|
|
5742
5775
|
});
|
|
5743
5776
|
let B = L + 1;
|
|
5744
|
-
E ===
|
|
5745
|
-
const
|
|
5777
|
+
E === z && (B = L);
|
|
5778
|
+
const P = {};
|
|
5746
5779
|
for (const x in n) {
|
|
5747
5780
|
if (!Object.prototype.hasOwnProperty.call(n, x)) continue;
|
|
5748
5781
|
const _ = Number(x);
|
|
@@ -5750,16 +5783,16 @@ class rt {
|
|
|
5750
5783
|
const R = n[_];
|
|
5751
5784
|
if (!R) continue;
|
|
5752
5785
|
const N = _ >= B ? _ + y : _;
|
|
5753
|
-
|
|
5786
|
+
P[N] = F({}, R);
|
|
5754
5787
|
}
|
|
5755
|
-
v =
|
|
5788
|
+
v = P, C = !0, b = !0;
|
|
5756
5789
|
}
|
|
5757
5790
|
if (y < 0) {
|
|
5758
|
-
const
|
|
5791
|
+
const z = Math.abs(y);
|
|
5759
5792
|
let B = L;
|
|
5760
5793
|
u[E] === `
|
|
5761
5794
|
` && ((D = f[L]) != null ? D : "").length > 0 && (B = L + 1);
|
|
5762
|
-
const x = B +
|
|
5795
|
+
const x = B + z - 1, _ = {};
|
|
5763
5796
|
for (const R in n) {
|
|
5764
5797
|
if (!Object.prototype.hasOwnProperty.call(n, R)) continue;
|
|
5765
5798
|
const N = Number(R);
|
|
@@ -5777,20 +5810,20 @@ class rt {
|
|
|
5777
5810
|
}
|
|
5778
5811
|
let w = s, I = !1, S = !1, j, O = null;
|
|
5779
5812
|
for (let E = 0; E < g.length; E += 1) {
|
|
5780
|
-
const L = (W = g[E]) != null ? W : "",
|
|
5781
|
-
if (
|
|
5782
|
-
if (
|
|
5813
|
+
const L = (W = g[E]) != null ? W : "", z = v ? v[E] : void 0;
|
|
5814
|
+
if (z && (j = z), L.length !== 0) {
|
|
5815
|
+
if (z) {
|
|
5783
5816
|
const N = Is({
|
|
5784
5817
|
lineText: L,
|
|
5785
5818
|
lineStyles: w ? w[E] : void 0,
|
|
5786
|
-
lineDefaults:
|
|
5819
|
+
lineDefaults: z
|
|
5787
5820
|
});
|
|
5788
5821
|
N.changed && (w || (w = {}, S = !0), S || (w = F({}, w), S = !0), N.lineStyles && (w[E] = N.lineStyles), !N.lineStyles && w[E] && delete w[E], I = !0);
|
|
5789
5822
|
}
|
|
5790
5823
|
continue;
|
|
5791
5824
|
}
|
|
5792
|
-
const
|
|
5793
|
-
(
|
|
5825
|
+
const P = z != null ? z : j, x = {};
|
|
5826
|
+
(P == null ? void 0 : P.fontFamily) !== void 0 ? x.fontFamily = P.fontFamily : o !== void 0 && (x.fontFamily = o), (P == null ? void 0 : P.fontSize) !== void 0 ? x.fontSize = P.fontSize : i !== void 0 && (x.fontSize = i), (P == null ? void 0 : P.fill) !== void 0 ? x.fill = P.fill : T !== void 0 && (x.fill = T), (P == null ? void 0 : P.stroke) !== void 0 ? x.stroke = P.stroke : M !== void 0 && (x.stroke = M), !z && Object.keys(x).length && (v || (v = {}, b = !0), b || (v = F({}, v), b = !0), v[E] = x, C = !0, j = x), z && (j = z), A !== null && A === E && (O = x);
|
|
5794
5827
|
const _ = {};
|
|
5795
5828
|
x.fontFamily !== void 0 && (_.fontFamily = x.fontFamily), x.fontSize !== void 0 && (_.fontSize = x.fontSize), x.fill !== void 0 && (_.fill = x.fill), x.stroke !== void 0 && (_.stroke = x.stroke);
|
|
5796
5829
|
const R = Object.keys(_).length > 0;
|
|
@@ -5814,7 +5847,7 @@ class rt {
|
|
|
5814
5847
|
* но не шире монтажной области, и удерживает объект в её пределах.
|
|
5815
5848
|
*/
|
|
5816
5849
|
_autoExpandTextboxWidth(t, { anchor: e } = {}) {
|
|
5817
|
-
var A, w, I, S, j, O, k, D, W, E, L,
|
|
5850
|
+
var A, w, I, S, j, O, k, D, W, E, L, z, B;
|
|
5818
5851
|
const { montageArea: n } = this.editor;
|
|
5819
5852
|
if (!n) return !1;
|
|
5820
5853
|
const s = typeof t.text == "string" ? t.text : "";
|
|
@@ -5841,7 +5874,7 @@ class rt {
|
|
|
5841
5874
|
y && (b = f), Math.abs(((L = t.width) != null ? L : 0) - b) > it && (t.set({ width: b }), t.initDimensions(), m = !0), Et({ textbox: t }) && (m = !0), a && (t.setPositionByOrigin(new lt(a.x, a.y), "center", r), m = !0);
|
|
5842
5875
|
const M = Bs({
|
|
5843
5876
|
textbox: t,
|
|
5844
|
-
montageLeft: (
|
|
5877
|
+
montageLeft: (z = o.left) != null ? z : 0,
|
|
5845
5878
|
montageRight: ((B = o.left) != null ? B : 0) + i
|
|
5846
5879
|
});
|
|
5847
5880
|
return m || M;
|
|
@@ -5936,15 +5969,15 @@ class rt {
|
|
|
5936
5969
|
width: W,
|
|
5937
5970
|
height: E,
|
|
5938
5971
|
angle: L,
|
|
5939
|
-
scaleX:
|
|
5972
|
+
scaleX: z,
|
|
5940
5973
|
scaleY: B
|
|
5941
|
-
} = t,
|
|
5974
|
+
} = t, P = {
|
|
5942
5975
|
id: n,
|
|
5943
5976
|
uppercase: !!i,
|
|
5944
5977
|
textAlign: g
|
|
5945
5978
|
};
|
|
5946
5979
|
return e({
|
|
5947
|
-
snapshot:
|
|
5980
|
+
snapshot: P,
|
|
5948
5981
|
entries: {
|
|
5949
5982
|
text: s,
|
|
5950
5983
|
textCaseRaw: o,
|
|
@@ -5974,10 +6007,10 @@ class rt {
|
|
|
5974
6007
|
width: W,
|
|
5975
6008
|
height: E,
|
|
5976
6009
|
angle: L,
|
|
5977
|
-
scaleX:
|
|
6010
|
+
scaleX: z,
|
|
5978
6011
|
scaleY: B
|
|
5979
6012
|
}
|
|
5980
|
-
}),
|
|
6013
|
+
}), P;
|
|
5981
6014
|
}
|
|
5982
6015
|
/**
|
|
5983
6016
|
* Возвращает первый доступный шрифт или дефолтный Arial.
|
|
@@ -6033,7 +6066,7 @@ const he = ({
|
|
|
6033
6066
|
x: d + f / 2,
|
|
6034
6067
|
y: u + g / 2
|
|
6035
6068
|
};
|
|
6036
|
-
},
|
|
6069
|
+
}, zs = ({
|
|
6037
6070
|
normalizedX: h,
|
|
6038
6071
|
normalizedY: t,
|
|
6039
6072
|
bounds: e,
|
|
@@ -6047,7 +6080,7 @@ const he = ({
|
|
|
6047
6080
|
}
|
|
6048
6081
|
const c = o + h * a, l = i + t * r;
|
|
6049
6082
|
return new lt(c, l);
|
|
6050
|
-
},
|
|
6083
|
+
}, Ps = ({
|
|
6051
6084
|
object: h,
|
|
6052
6085
|
montageArea: t,
|
|
6053
6086
|
bounds: e
|
|
@@ -6062,7 +6095,7 @@ const he = ({
|
|
|
6062
6095
|
} catch (n) {
|
|
6063
6096
|
return null;
|
|
6064
6097
|
}
|
|
6065
|
-
},
|
|
6098
|
+
}, mt = ({
|
|
6066
6099
|
object: h
|
|
6067
6100
|
}) => {
|
|
6068
6101
|
if (!h) return null;
|
|
@@ -6126,7 +6159,7 @@ const he = ({
|
|
|
6126
6159
|
};
|
|
6127
6160
|
}
|
|
6128
6161
|
return null;
|
|
6129
|
-
},
|
|
6162
|
+
}, Jt = "_templateCenterX", Ae = "_templateCenterY", fe = "_templateAnchorX", je = "_templateAnchorY";
|
|
6130
6163
|
class Z {
|
|
6131
6164
|
constructor({ editor: t }) {
|
|
6132
6165
|
this.editor = t;
|
|
@@ -6293,7 +6326,7 @@ class Z {
|
|
|
6293
6326
|
if (i)
|
|
6294
6327
|
return Z._restoreImageScale({ revived: i, serialized: n }), i;
|
|
6295
6328
|
}
|
|
6296
|
-
const s = yield
|
|
6329
|
+
const s = yield vt.enlivenObjects([n]), o = s == null ? void 0 : s[0];
|
|
6297
6330
|
return o ? (Z._restoreImageScale({ revived: o, serialized: n }), o) : null;
|
|
6298
6331
|
})))).filter((n) => !!n);
|
|
6299
6332
|
});
|
|
@@ -6363,7 +6396,7 @@ class Z {
|
|
|
6363
6396
|
const e = typeof t.svgMarkup == "string" ? t.svgMarkup : null;
|
|
6364
6397
|
if (!e) return null;
|
|
6365
6398
|
try {
|
|
6366
|
-
const n = yield Rn(e), s =
|
|
6399
|
+
const n = yield Rn(e), s = vt.groupSVGElements(n.objects, n.options), o = yield vt.enlivenObjectEnlivables(
|
|
6367
6400
|
Z._prepareSerializableProps(t)
|
|
6368
6401
|
);
|
|
6369
6402
|
return s.set(o), s.setCoords(), s;
|
|
@@ -6428,7 +6461,7 @@ class Z {
|
|
|
6428
6461
|
baseHeight: i,
|
|
6429
6462
|
useRelativePositions: r,
|
|
6430
6463
|
centerKeys: {
|
|
6431
|
-
x:
|
|
6464
|
+
x: Jt,
|
|
6432
6465
|
y: Ae
|
|
6433
6466
|
}
|
|
6434
6467
|
}), { scaleX: u, scaleY: f } = t, g = nt({ value: u, fallback: 1 }), m = nt({ value: f, fallback: 1 }), p = Z._getPositioningBounds({
|
|
@@ -6439,7 +6472,7 @@ class Z {
|
|
|
6439
6472
|
useRelativePositions: r,
|
|
6440
6473
|
anchorX: Z._resolveAnchor(c, fe),
|
|
6441
6474
|
anchorY: Z._resolveAnchor(c, je)
|
|
6442
|
-
}), y =
|
|
6475
|
+
}), y = zs({
|
|
6443
6476
|
normalizedX: l,
|
|
6444
6477
|
normalizedY: d,
|
|
6445
6478
|
bounds: p,
|
|
@@ -6449,7 +6482,7 @@ class Z {
|
|
|
6449
6482
|
t.set({
|
|
6450
6483
|
scaleX: v,
|
|
6451
6484
|
scaleY: C
|
|
6452
|
-
}), t.setPositionByOrigin(y, "center", "center"), t.setCoords(), delete c[
|
|
6485
|
+
}), t.setPositionByOrigin(y, "center", "center"), t.setCoords(), delete c[Jt], delete c[Ae], delete c[fe], delete c[je];
|
|
6453
6486
|
}
|
|
6454
6487
|
/**
|
|
6455
6488
|
* Возвращает bounds, в которых должны позиционироваться нормализованные объекты.
|
|
@@ -6548,7 +6581,7 @@ class Z {
|
|
|
6548
6581
|
} = t, r = nt({ value: e, fallback: 0 }), c = t, l = nt({ value: c.paddingLeft, fallback: 0 }), d = nt({ value: c.paddingRight, fallback: 0 }), u = nt({ value: i, fallback: 1 }), f = nt({ value: a, fallback: 0 }) * u, g = nt({ value: o, fallback: 0 }), m = g * u, p = l * u, y = d * u, v = m + p + y + f;
|
|
6549
6582
|
if (!s || !g || !r) return;
|
|
6550
6583
|
t.setCoords();
|
|
6551
|
-
const C = t, b = C[
|
|
6584
|
+
const C = t, b = C[Jt], T = typeof b == "number" ? b : null, M = Z._resolveAnchor(C, fe), A = v / r, w = T !== null ? T - A / 2 : null, I = T !== null ? T + A / 2 : null, S = t.getCenterPoint();
|
|
6552
6585
|
t.set("width", s), t.initDimensions();
|
|
6553
6586
|
const j = Z._getLongestLineWidth({
|
|
6554
6587
|
textbox: t,
|
|
@@ -6557,7 +6590,7 @@ class Z {
|
|
|
6557
6590
|
t.set("width", O), t.initDimensions(), t.setPositionByOrigin(S, "center", "center"), t.setCoords();
|
|
6558
6591
|
const D = (O * u + p + y + f) / r;
|
|
6559
6592
|
let W = T;
|
|
6560
|
-
M === "start" && w !== null ? W = Math.max(0, w) + D / 2 : M === "end" && I !== null && (W = Math.min(1, I) - D / 2), typeof W == "number" && (C[
|
|
6593
|
+
M === "start" && w !== null ? W = Math.max(0, w) + D / 2 : M === "end" && I !== null && (W = Math.min(1, I) - D / 2), typeof W == "number" && (C[Jt] = W);
|
|
6561
6594
|
}
|
|
6562
6595
|
/**
|
|
6563
6596
|
* Возвращает ширину самой длинной строки текстового объекта.
|
|
@@ -6598,7 +6631,7 @@ class Z {
|
|
|
6598
6631
|
top: r,
|
|
6599
6632
|
width: c,
|
|
6600
6633
|
height: l
|
|
6601
|
-
} = e, d = t.getBoundingRect(!1, !0), u = n || c || 1, f = s || l || 1, g =
|
|
6634
|
+
} = e, d = t.getBoundingRect(!1, !0), u = n || c || 1, f = s || l || 1, g = Ps({
|
|
6602
6635
|
object: t,
|
|
6603
6636
|
montageArea: o,
|
|
6604
6637
|
bounds: e
|
|
@@ -6609,7 +6642,7 @@ class Z {
|
|
|
6609
6642
|
y: (b.y - r) / f
|
|
6610
6643
|
};
|
|
6611
6644
|
})(), p = (d.left - a) / u, y = (d.top - r) / f, v = p + d.width / u, C = y + d.height / f;
|
|
6612
|
-
return i[
|
|
6645
|
+
return i[Jt] = m.x, i[Ae] = m.y, i[fe] = Z._detectAnchor({
|
|
6613
6646
|
center: m.x,
|
|
6614
6647
|
start: p,
|
|
6615
6648
|
end: v
|
|
@@ -6727,13 +6760,13 @@ class Z {
|
|
|
6727
6760
|
*/
|
|
6728
6761
|
// eslint-disable-next-line class-methods-use-this
|
|
6729
6762
|
enlivenObjectEnlivables(t) {
|
|
6730
|
-
return
|
|
6763
|
+
return vt.enlivenObjectEnlivables(t);
|
|
6731
6764
|
}
|
|
6732
6765
|
}
|
|
6733
6766
|
const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
6734
6767
|
value: h,
|
|
6735
6768
|
step: t
|
|
6736
|
-
}) => Math.round(h / t) * t,
|
|
6769
|
+
}) => Math.round(h / t) * t, yt = ({
|
|
6737
6770
|
value: h,
|
|
6738
6771
|
step: t
|
|
6739
6772
|
}) => Ue({ value: h, step: t }) === h, Sn = ({
|
|
@@ -6845,12 +6878,12 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6845
6878
|
const { bounds: M } = g, { bounds: A } = m, { bottom: w } = M, { top: I } = A, j = I - w - f;
|
|
6846
6879
|
if (j >= 0) {
|
|
6847
6880
|
const O = j / 2;
|
|
6848
|
-
if (
|
|
6849
|
-
const D = Ue({ value: O, step: ot }), W = o - w, E = I - i, L = Math.abs(W - D),
|
|
6881
|
+
if (yt({ value: O, step: ot })) {
|
|
6882
|
+
const D = Ue({ value: O, step: ot }), W = o - w, E = I - i, L = Math.abs(W - D), z = Math.abs(E - D), B = Math.max(L, z);
|
|
6850
6883
|
if (B <= e) {
|
|
6851
|
-
const
|
|
6852
|
-
if (
|
|
6853
|
-
const _ = i +
|
|
6884
|
+
const P = D - W;
|
|
6885
|
+
if (yt({ value: P, step: ot })) {
|
|
6886
|
+
const _ = i + P, R = {
|
|
6854
6887
|
type: "vertical",
|
|
6855
6888
|
axis: s,
|
|
6856
6889
|
refStart: w,
|
|
@@ -6859,7 +6892,7 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6859
6892
|
activeEnd: _ + D,
|
|
6860
6893
|
distance: D
|
|
6861
6894
|
};
|
|
6862
|
-
u.push({ delta:
|
|
6895
|
+
u.push({ delta: P, guide: R, diff: B });
|
|
6863
6896
|
}
|
|
6864
6897
|
}
|
|
6865
6898
|
}
|
|
@@ -6885,13 +6918,13 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6885
6918
|
end: S,
|
|
6886
6919
|
distance: j
|
|
6887
6920
|
} = M;
|
|
6888
|
-
if (!(A === d || w === d || !
|
|
6921
|
+
if (!(A === d || w === d || !yt({ value: j, step: ot }))) {
|
|
6889
6922
|
if (y !== null && C) {
|
|
6890
6923
|
const k = Math.abs(y - j);
|
|
6891
6924
|
if (k <= e) {
|
|
6892
6925
|
const D = j - y;
|
|
6893
|
-
if (!
|
|
6894
|
-
const E = o + D, { bottom: L } = C,
|
|
6926
|
+
if (!yt({ value: D, step: ot })) continue;
|
|
6927
|
+
const E = o + D, { bottom: L } = C, z = {
|
|
6895
6928
|
type: "vertical",
|
|
6896
6929
|
axis: s,
|
|
6897
6930
|
refStart: I,
|
|
@@ -6900,15 +6933,15 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6900
6933
|
activeEnd: E,
|
|
6901
6934
|
distance: j
|
|
6902
6935
|
};
|
|
6903
|
-
u.push({ delta: D, guide:
|
|
6936
|
+
u.push({ delta: D, guide: z, diff: k });
|
|
6904
6937
|
}
|
|
6905
6938
|
}
|
|
6906
6939
|
if (v !== null && b) {
|
|
6907
6940
|
const k = Math.abs(v - j);
|
|
6908
6941
|
if (k <= e) {
|
|
6909
6942
|
const D = v - j;
|
|
6910
|
-
if (!
|
|
6911
|
-
const E = i + D, { top: L } = b,
|
|
6943
|
+
if (!yt({ value: D, step: ot })) continue;
|
|
6944
|
+
const E = i + D, { top: L } = b, z = {
|
|
6912
6945
|
type: "vertical",
|
|
6913
6946
|
axis: s,
|
|
6914
6947
|
refStart: I,
|
|
@@ -6917,7 +6950,7 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6917
6950
|
activeEnd: L,
|
|
6918
6951
|
distance: j
|
|
6919
6952
|
};
|
|
6920
|
-
u.push({ delta: D, guide:
|
|
6953
|
+
u.push({ delta: D, guide: z, diff: k });
|
|
6921
6954
|
}
|
|
6922
6955
|
}
|
|
6923
6956
|
}
|
|
@@ -6964,12 +6997,12 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6964
6997
|
const { bounds: M } = g, { bounds: A } = m, { right: w } = M, { left: I } = A, j = I - w - f;
|
|
6965
6998
|
if (j >= 0) {
|
|
6966
6999
|
const O = j / 2;
|
|
6967
|
-
if (
|
|
6968
|
-
const D = Ue({ value: O, step: ot }), W = o - w, E = I - i, L = Math.abs(W - D),
|
|
7000
|
+
if (yt({ value: O, step: ot })) {
|
|
7001
|
+
const D = Ue({ value: O, step: ot }), W = o - w, E = I - i, L = Math.abs(W - D), z = Math.abs(E - D), B = Math.max(L, z);
|
|
6969
7002
|
if (B <= e) {
|
|
6970
|
-
const
|
|
6971
|
-
if (
|
|
6972
|
-
const _ = i +
|
|
7003
|
+
const P = D - W;
|
|
7004
|
+
if (yt({ value: P, step: ot })) {
|
|
7005
|
+
const _ = i + P, R = {
|
|
6973
7006
|
type: "horizontal",
|
|
6974
7007
|
axis: s,
|
|
6975
7008
|
refStart: w,
|
|
@@ -6978,7 +7011,7 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
6978
7011
|
activeEnd: _ + D,
|
|
6979
7012
|
distance: D
|
|
6980
7013
|
};
|
|
6981
|
-
u.push({ delta:
|
|
7014
|
+
u.push({ delta: P, guide: R, diff: B });
|
|
6982
7015
|
}
|
|
6983
7016
|
}
|
|
6984
7017
|
}
|
|
@@ -7004,13 +7037,13 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
7004
7037
|
end: S,
|
|
7005
7038
|
distance: j
|
|
7006
7039
|
} = M;
|
|
7007
|
-
if (!(A === d || w === d || !
|
|
7040
|
+
if (!(A === d || w === d || !yt({ value: j, step: ot }))) {
|
|
7008
7041
|
if (y !== null && C) {
|
|
7009
7042
|
const k = Math.abs(y - j);
|
|
7010
7043
|
if (k <= e) {
|
|
7011
7044
|
const D = j - y;
|
|
7012
|
-
if (!
|
|
7013
|
-
const E = o + D, { right: L } = C,
|
|
7045
|
+
if (!yt({ value: D, step: ot })) continue;
|
|
7046
|
+
const E = o + D, { right: L } = C, z = {
|
|
7014
7047
|
type: "horizontal",
|
|
7015
7048
|
axis: s,
|
|
7016
7049
|
refStart: I,
|
|
@@ -7019,15 +7052,15 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
7019
7052
|
activeEnd: E,
|
|
7020
7053
|
distance: j
|
|
7021
7054
|
};
|
|
7022
|
-
u.push({ delta: D, guide:
|
|
7055
|
+
u.push({ delta: D, guide: z, diff: k });
|
|
7023
7056
|
}
|
|
7024
7057
|
}
|
|
7025
7058
|
if (v !== null && b) {
|
|
7026
7059
|
const k = Math.abs(v - j);
|
|
7027
7060
|
if (k <= e) {
|
|
7028
7061
|
const D = v - j;
|
|
7029
|
-
if (!
|
|
7030
|
-
const E = i + D, { left: L } = b,
|
|
7062
|
+
if (!yt({ value: D, step: ot })) continue;
|
|
7063
|
+
const E = i + D, { left: L } = b, z = {
|
|
7031
7064
|
type: "horizontal",
|
|
7032
7065
|
axis: s,
|
|
7033
7066
|
refStart: I,
|
|
@@ -7036,7 +7069,7 @@ const Ce = 5, Mn = "#3D8BF4", Re = 1, ot = 2, Ue = ({
|
|
|
7036
7069
|
activeEnd: L,
|
|
7037
7070
|
distance: j
|
|
7038
7071
|
};
|
|
7039
|
-
u.push({ delta: D, guide:
|
|
7072
|
+
u.push({ delta: D, guide: z, diff: k });
|
|
7040
7073
|
}
|
|
7041
7074
|
}
|
|
7042
7075
|
}
|
|
@@ -7278,7 +7311,7 @@ class $ {
|
|
|
7278
7311
|
return;
|
|
7279
7312
|
}
|
|
7280
7313
|
$._applyMovementStep({ target: e }), !this.anchors.vertical.length && !this.anchors.horizontal.length && this._cacheAnchors({ activeObject: e });
|
|
7281
|
-
let o =
|
|
7314
|
+
let o = mt({ object: e });
|
|
7282
7315
|
if (!o) {
|
|
7283
7316
|
this._clearGuides();
|
|
7284
7317
|
return;
|
|
@@ -7293,9 +7326,9 @@ class $ {
|
|
|
7293
7326
|
e.set({
|
|
7294
7327
|
left: y + l,
|
|
7295
7328
|
top: v + d
|
|
7296
|
-
}), e.setCoords(), o = (m =
|
|
7329
|
+
}), e.setCoords(), o = (m = mt({ object: e })) != null ? m : o;
|
|
7297
7330
|
}
|
|
7298
|
-
const f = this.cachedTargetBounds.length ? this.cachedTargetBounds : this._collectTargets({ activeObject: e }).map((y) =>
|
|
7331
|
+
const f = this.cachedTargetBounds.length ? this.cachedTargetBounds : this._collectTargets({ activeObject: e }).map((y) => mt({ object: y })).filter((y) => !!y), g = Zs({
|
|
7299
7332
|
activeBounds: o,
|
|
7300
7333
|
candidates: f,
|
|
7301
7334
|
threshold: r,
|
|
@@ -7306,7 +7339,7 @@ class $ {
|
|
|
7306
7339
|
e.set({
|
|
7307
7340
|
left: y + g.deltaX,
|
|
7308
7341
|
top: v + g.deltaY
|
|
7309
|
-
}), e.setCoords(), o = (p =
|
|
7342
|
+
}), e.setCoords(), o = (p = mt({ object: e })) != null ? p : o;
|
|
7310
7343
|
}
|
|
7311
7344
|
this._applyGuides({
|
|
7312
7345
|
guides: u,
|
|
@@ -7340,7 +7373,7 @@ class $ {
|
|
|
7340
7373
|
horizontal: d
|
|
7341
7374
|
} = c;
|
|
7342
7375
|
!l.length && !d.length && this._cacheAnchors({ activeObject: e });
|
|
7343
|
-
const u =
|
|
7376
|
+
const u = mt({ object: e });
|
|
7344
7377
|
if (!u) {
|
|
7345
7378
|
this._clearGuides();
|
|
7346
7379
|
return;
|
|
@@ -7375,22 +7408,22 @@ class $ {
|
|
|
7375
7408
|
return;
|
|
7376
7409
|
}
|
|
7377
7410
|
const E = [];
|
|
7378
|
-
let L = null,
|
|
7411
|
+
let L = null, z = null;
|
|
7379
7412
|
if (r) {
|
|
7380
|
-
const
|
|
7413
|
+
const P = $._resolveUniformScale({
|
|
7381
7414
|
bounds: u,
|
|
7382
7415
|
originX: M,
|
|
7383
7416
|
originY: A,
|
|
7384
7417
|
verticalSnap: S,
|
|
7385
7418
|
horizontalSnap: j
|
|
7386
7419
|
});
|
|
7387
|
-
if (
|
|
7388
|
-
const { scaleFactor: x, guide: _ } =
|
|
7389
|
-
L = b * x,
|
|
7420
|
+
if (P) {
|
|
7421
|
+
const { scaleFactor: x, guide: _ } = P;
|
|
7422
|
+
L = b * x, z = T * x, E.push(_);
|
|
7390
7423
|
}
|
|
7391
7424
|
}
|
|
7392
7425
|
if (!r) {
|
|
7393
|
-
const { angle:
|
|
7426
|
+
const { angle: P = 0 } = e, { width: x, height: _ } = $._resolveBaseDimensions({ target: e }), R = Math.abs(b) || 1, N = Math.abs(T) || 1;
|
|
7394
7427
|
if (D) {
|
|
7395
7428
|
const K = $._resolveDesiredWidth({
|
|
7396
7429
|
bounds: u,
|
|
@@ -7403,7 +7436,7 @@ class $ {
|
|
|
7403
7436
|
baseWidth: x,
|
|
7404
7437
|
baseHeight: _,
|
|
7405
7438
|
scaleY: N,
|
|
7406
|
-
angle:
|
|
7439
|
+
angle: P
|
|
7407
7440
|
});
|
|
7408
7441
|
if (H !== null) {
|
|
7409
7442
|
const q = b < 0 ? -1 : 1;
|
|
@@ -7426,11 +7459,11 @@ class $ {
|
|
|
7426
7459
|
baseWidth: x,
|
|
7427
7460
|
baseHeight: _,
|
|
7428
7461
|
scaleX: R,
|
|
7429
|
-
angle:
|
|
7462
|
+
angle: P
|
|
7430
7463
|
});
|
|
7431
7464
|
if (H !== null) {
|
|
7432
7465
|
const q = T < 0 ? -1 : 1;
|
|
7433
|
-
|
|
7466
|
+
z = H * q, k !== null && E.push({
|
|
7434
7467
|
type: "horizontal",
|
|
7435
7468
|
position: k
|
|
7436
7469
|
});
|
|
@@ -7438,14 +7471,14 @@ class $ {
|
|
|
7438
7471
|
}
|
|
7439
7472
|
}
|
|
7440
7473
|
}
|
|
7441
|
-
const B = L !== null ||
|
|
7474
|
+
const B = L !== null || z !== null;
|
|
7442
7475
|
if (!B && !E.length) {
|
|
7443
7476
|
this._clearGuides();
|
|
7444
7477
|
return;
|
|
7445
7478
|
}
|
|
7446
7479
|
if (B) {
|
|
7447
|
-
const
|
|
7448
|
-
L !== null && (_.scaleX = L, s.scaleX = L),
|
|
7480
|
+
const P = e.getRelativeCenterPoint(), x = e.translateToOriginPoint(P, M, A), _ = {};
|
|
7481
|
+
L !== null && (_.scaleX = L, s.scaleX = L), z !== null && (_.scaleY = z, s.scaleY = z), Object.keys(_).length && (e.set(_), e.setPositionByOrigin(x, M, A), e.setCoords());
|
|
7449
7482
|
}
|
|
7450
7483
|
this._applyGuides({
|
|
7451
7484
|
guides: E,
|
|
@@ -7479,7 +7512,7 @@ class $ {
|
|
|
7479
7512
|
horizontal: c
|
|
7480
7513
|
} = a;
|
|
7481
7514
|
!r.length && !c.length && this._cacheAnchors({ activeObject: t });
|
|
7482
|
-
const l =
|
|
7515
|
+
const l = mt({ object: t });
|
|
7483
7516
|
if (!l) {
|
|
7484
7517
|
this._clearGuides();
|
|
7485
7518
|
return;
|
|
@@ -7854,10 +7887,10 @@ class $ {
|
|
|
7854
7887
|
_cacheAnchors({ activeObject: t }) {
|
|
7855
7888
|
const e = this._collectTargets({ activeObject: t }), n = { vertical: [], horizontal: [] }, s = [];
|
|
7856
7889
|
for (const a of e) {
|
|
7857
|
-
const r =
|
|
7890
|
+
const r = mt({ object: a });
|
|
7858
7891
|
r && (pn({ anchors: n, bounds: r }), s.push(r));
|
|
7859
7892
|
}
|
|
7860
|
-
const { montageArea: o } = this.editor, i =
|
|
7893
|
+
const { montageArea: o } = this.editor, i = mt({ object: o });
|
|
7861
7894
|
if (i) {
|
|
7862
7895
|
pn({ anchors: n, bounds: i });
|
|
7863
7896
|
const { left: a, right: r, top: c, bottom: l } = i;
|
|
@@ -8006,7 +8039,7 @@ class Wt {
|
|
|
8006
8039
|
this._clearGuides();
|
|
8007
8040
|
return;
|
|
8008
8041
|
}
|
|
8009
|
-
const o =
|
|
8042
|
+
const o = mt({ object: s });
|
|
8010
8043
|
if (!o) {
|
|
8011
8044
|
this._clearGuides();
|
|
8012
8045
|
return;
|
|
@@ -8014,7 +8047,7 @@ class Wt {
|
|
|
8014
8047
|
const i = Wt._resolveTarget({
|
|
8015
8048
|
event: t,
|
|
8016
8049
|
activeObject: s
|
|
8017
|
-
}), { montageArea: a } = n, r = i != null ? i : a, c = r === a, l =
|
|
8050
|
+
}), { montageArea: a } = n, r = i != null ? i : a, c = r === a, l = mt({ object: r });
|
|
8018
8051
|
if (!l) {
|
|
8019
8052
|
this._clearGuides();
|
|
8020
8053
|
return;
|
|
@@ -8278,7 +8311,7 @@ class Ye {
|
|
|
8278
8311
|
showRotationAngle: l,
|
|
8279
8312
|
_onReadyCallback: d
|
|
8280
8313
|
} = this.options;
|
|
8281
|
-
if (ut.apply(), this.canvas = new kn(this.containerId, this.options), this.moduleLoader = new Fn(), this.workerManager = new Un(), this.errorManager = new te({ editor: this }), this.historyManager = new J({ editor: this }), this.toolbar = new is({ editor: this }), this.transformManager = new gs({ editor: this }), this.zoomManager = new ps({ editor: this }), this.canvasManager = new fs({ editor: this }), this.imageManager = new
|
|
8314
|
+
if (ut.apply(), this.canvas = new kn(this.containerId, this.options), this.moduleLoader = new Fn(), this.workerManager = new Un(), this.errorManager = new te({ editor: this }), this.historyManager = new J({ editor: this }), this.toolbar = new is({ editor: this }), this.transformManager = new gs({ editor: this }), this.zoomManager = new ps({ editor: this }), this.canvasManager = new fs({ editor: this }), this.imageManager = new pt({ editor: this }), this.layerManager = new pe({ editor: this }), this.shapeManager = new ys({ editor: this }), this.interactionBlocker = new ms({ editor: this }), this.backgroundManager = new Ft({ editor: this }), this.clipboardManager = new vs({ editor: this }), this.objectLockManager = new me({ editor: this }), this.groupingManager = new bs({ editor: this }), this.selectionManager = new Ms({ editor: this }), this.deletionManager = new We({ editor: this }), this.panConstraintManager = new Ss({ editor: this }), this.snappingManager = new $({ editor: this }), this.measurementManager = new Wt({ editor: this }), this.fontManager = new De((u = this.options.fonts) != null ? u : []), this.textManager = new rt({ editor: this }), this.templateManager = new Z({ editor: this }), l && (this.angleIndicator = new Fe({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new Be({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(t), this.canvasManager.setEditorContainerHeight(e), this.canvasManager.setCanvasWrapperWidth(n), this.canvasManager.setCanvasWrapperHeight(s), this.canvasManager.setCanvasCSSWidth(o), this.canvasManager.setCanvasCSSHeight(i), this.canvasManager.updateCanvas(), this.zoomManager.calculateAndApplyDefaultZoom(), yield this.fontManager.loadFonts(), a != null && a.source) {
|
|
8282
8315
|
const f = a, {
|
|
8283
8316
|
source: g,
|
|
8284
8317
|
scale: m = `image-${c}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anu3ev/fabric-image-editor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.32",
|
|
4
4
|
"description": "JavaScript image editor built on FabricJS, allowing you to create instances with an integrated montage area and providing an API to modify and manage state.",
|
|
5
5
|
"module": "dist/main.js",
|
|
6
6
|
"files": [
|