@anu3ev/fabric-image-editor 0.6.0 → 0.6.1
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 +219 -196
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -35,9 +35,9 @@ var Z = (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 K, Textbox as ct, util as bt, controlsUtils as Je, InteractiveFabricObject as Qe, Point as lt, FitContentLayout as $e, loadSVGFromURL as xn, FabricImage as qt, Gradient as tn, Rect as
|
|
39
|
-
import { create as
|
|
40
|
-
import
|
|
38
|
+
import { ActiveSelection as K, Textbox as ct, util as bt, controlsUtils as Je, InteractiveFabricObject as Qe, Point as lt, FitContentLayout as $e, loadSVGFromURL as xn, FabricImage as qt, Gradient as tn, Rect as kn, Circle as Rn, Triangle as Bn, Group as Pt, Color as Nn, classRegistry as en, loadSVGFromString as Pn, Canvas as zn, Pattern as Fn } from "fabric";
|
|
39
|
+
import { create as Un } from "jsondiffpatch";
|
|
40
|
+
import Wn from "diff-match-patch";
|
|
41
41
|
var Yn = "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
43
|
e += Yn[n[t] & 63];
|
|
@@ -457,18 +457,18 @@ class Gn {
|
|
|
457
457
|
this.worker.terminate();
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
const At = 12, Vn = 2, Oe = 8, _e = 20, Xn = 100, Le = 20, De = 8, Kn = 100, me = 32, Fe = 1, qn = "#2B2D33",
|
|
460
|
+
const At = 12, Vn = 2, Oe = 8, _e = 20, Xn = 100, Le = 20, De = 8, Kn = 100, me = 32, Fe = 1, qn = "#2B2D33", Ue = "#3D8BF4", We = "#FFFFFF";
|
|
461
461
|
function he(h, t, e, n, s) {
|
|
462
462
|
const o = At, i = Vn;
|
|
463
|
-
h.save(), h.translate(t, e), h.rotate(bt.degreesToRadians(s.angle)), h.fillStyle =
|
|
463
|
+
h.save(), h.translate(t, e), h.rotate(bt.degreesToRadians(s.angle)), h.fillStyle = We, h.strokeStyle = Ue, h.lineWidth = Fe, h.beginPath(), h.roundRect(-o / 2, -o / 2, o, o, i), h.fill(), h.stroke(), h.restore();
|
|
464
464
|
}
|
|
465
465
|
function sn(h, t, e, n, s) {
|
|
466
466
|
const o = Oe, i = _e, a = Xn;
|
|
467
|
-
h.save(), h.translate(t, e), h.rotate(bt.degreesToRadians(s.angle)), h.fillStyle =
|
|
467
|
+
h.save(), h.translate(t, e), h.rotate(bt.degreesToRadians(s.angle)), h.fillStyle = We, h.strokeStyle = Ue, h.lineWidth = Fe, h.beginPath(), h.roundRect(-o / 2, -i / 2, o, i, a), h.fill(), h.stroke(), h.restore();
|
|
468
468
|
}
|
|
469
469
|
function on(h, t, e, n, s) {
|
|
470
470
|
const o = Le, i = De, a = Kn;
|
|
471
|
-
h.save(), h.translate(t, e), h.rotate(bt.degreesToRadians(s.angle)), h.fillStyle =
|
|
471
|
+
h.save(), h.translate(t, e), h.rotate(bt.degreesToRadians(s.angle)), h.fillStyle = We, h.strokeStyle = Ue, h.lineWidth = Fe, h.beginPath(), h.roundRect(-o / 2, -i / 2, o, i, a), h.fill(), h.stroke(), h.restore();
|
|
472
472
|
}
|
|
473
473
|
const Jn = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", wn = new Image();
|
|
474
474
|
wn.src = Jn;
|
|
@@ -1187,7 +1187,7 @@ class Ye {
|
|
|
1187
1187
|
this.canvas && (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:cleared", this._onSelectionCleared)), (t = this.el) != null && t.parentNode && this.el.parentNode.removeChild(this.el), this.el = null, this.editor = null, this.canvas = null, this.options = null;
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
const
|
|
1190
|
+
const ke = [
|
|
1191
1191
|
"id",
|
|
1192
1192
|
"backgroundId",
|
|
1193
1193
|
"customData",
|
|
@@ -1228,7 +1228,7 @@ const Re = [
|
|
|
1228
1228
|
];
|
|
1229
1229
|
class J {
|
|
1230
1230
|
constructor({ editor: t }) {
|
|
1231
|
-
this.editor = t, this.canvas = t.canvas, this._isSavingState = !1, this._historySuspendCount = 0, this._isActionInProgress = !1, this._actionSnapshot = null, this._actionReason = null, this._pendingSaveTimeoutId = null, this._pendingSaveReason = null, this.baseState = null, this.patches = [], this.currentIndex = 0, this.maxHistoryLength = t.options.maxHistoryLength, this.totalChangesCount = 0, this.baseStateChangesCount = 0, this._createDiffPatcher();
|
|
1231
|
+
this.editor = t, this.canvas = t.canvas, this._isSavingState = !1, this._historySuspendCount = 0, this._isActionInProgress = !1, this._actionSnapshot = null, this._actionReason = null, this._pendingSaveTimeoutId = null, this._pendingSaveReason = null, this._hasDeferredSaveAfterUnblock = !1, this.baseState = null, this.patches = [], this.currentIndex = 0, this.maxHistoryLength = t.options.maxHistoryLength, this.totalChangesCount = 0, this.baseStateChangesCount = 0, this._createDiffPatcher();
|
|
1232
1232
|
}
|
|
1233
1233
|
/** Проверка, нужно ли пропускать сохранение истории */
|
|
1234
1234
|
get skipHistory() {
|
|
@@ -1238,7 +1238,7 @@ class J {
|
|
|
1238
1238
|
return this.patches[this.currentIndex - 1] || null;
|
|
1239
1239
|
}
|
|
1240
1240
|
_createDiffPatcher() {
|
|
1241
|
-
this.diffPatcher =
|
|
1241
|
+
this.diffPatcher = Un({
|
|
1242
1242
|
objectHash(t) {
|
|
1243
1243
|
return [JSON.stringify(t)].join("-");
|
|
1244
1244
|
},
|
|
@@ -1247,7 +1247,7 @@ class J {
|
|
|
1247
1247
|
includeValueOnMove: !1
|
|
1248
1248
|
},
|
|
1249
1249
|
textDiff: {
|
|
1250
|
-
diffMatchPatch:
|
|
1250
|
+
diffMatchPatch: Wn,
|
|
1251
1251
|
minLength: 60
|
|
1252
1252
|
}
|
|
1253
1253
|
});
|
|
@@ -1302,6 +1302,25 @@ class J {
|
|
|
1302
1302
|
getCurrentChangePosition() {
|
|
1303
1303
|
return this.baseStateChangesCount + this.currentIndex;
|
|
1304
1304
|
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Проверяет, заблокирован ли UI редактора.
|
|
1307
|
+
*/
|
|
1308
|
+
_isUiBlocked() {
|
|
1309
|
+
const { interactionBlocker: t } = this.editor;
|
|
1310
|
+
return t ? t.isBlocked : !1;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Помечает, что состояние нужно сохранить после снятия блокировки UI.
|
|
1314
|
+
*/
|
|
1315
|
+
_deferSaveAfterUiUnblock() {
|
|
1316
|
+
this._hasDeferredSaveAfterUnblock = !0;
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Выполняет отложенное сохранение после снятия блокировки UI.
|
|
1320
|
+
*/
|
|
1321
|
+
flushDeferredSaveAfterUnblock() {
|
|
1322
|
+
return !this._hasDeferredSaveAfterUnblock || this._isUiBlocked() || this.skipHistory ? !1 : (this._hasDeferredSaveAfterUnblock = !1, this.saveState(), !0);
|
|
1323
|
+
}
|
|
1305
1324
|
/**
|
|
1306
1325
|
* Получаем полное состояние, применяя все диффы к базовому состоянию.
|
|
1307
1326
|
*/
|
|
@@ -1323,7 +1342,7 @@ class J {
|
|
|
1323
1342
|
*/
|
|
1324
1343
|
_serializeCanvasState() {
|
|
1325
1344
|
const { canvas: t } = this;
|
|
1326
|
-
return t.toDatalessObject([...
|
|
1345
|
+
return t.toDatalessObject([...ke]);
|
|
1327
1346
|
}
|
|
1328
1347
|
/**
|
|
1329
1348
|
* Обрабатывает срабатывание отложенного сохранения.
|
|
@@ -1381,10 +1400,14 @@ class J {
|
|
|
1381
1400
|
*/
|
|
1382
1401
|
saveState() {
|
|
1383
1402
|
if (console.log("saveState"), !this.skipHistory) {
|
|
1403
|
+
if (this._isUiBlocked()) {
|
|
1404
|
+
this._deferSaveAfterUiUnblock();
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1384
1407
|
this._isSavingState = !0, console.time("saveState");
|
|
1385
1408
|
try {
|
|
1386
1409
|
const t = this._withTemporaryUnlock(
|
|
1387
|
-
() => this.canvas.toDatalessObject([...
|
|
1410
|
+
() => this.canvas.toDatalessObject([...ke])
|
|
1388
1411
|
);
|
|
1389
1412
|
if (console.timeEnd("saveState"), !this.baseState) {
|
|
1390
1413
|
this.baseState = t, this.patches = [], this.currentIndex = 0, console.log("Базовое состояние сохранено.");
|
|
@@ -2150,27 +2173,27 @@ class pt {
|
|
|
2150
2173
|
[T]
|
|
2151
2174
|
);
|
|
2152
2175
|
if (l) {
|
|
2153
|
-
const I = m * 0.264583, O = g * 0.264583, L = (yield this.editor.moduleLoader.loadModule("jspdf")).jsPDF,
|
|
2176
|
+
const I = m * 0.264583, O = g * 0.264583, L = (yield this.editor.moduleLoader.loadModule("jspdf")).jsPDF, U = new L({
|
|
2154
2177
|
orientation: I > O ? "landscape" : "portrait",
|
|
2155
2178
|
unit: "mm",
|
|
2156
2179
|
format: [I, O]
|
|
2157
2180
|
});
|
|
2158
|
-
if (
|
|
2181
|
+
if (U.addImage(String(E), "JPG", 0, 0, I, O), s) {
|
|
2159
2182
|
const x = {
|
|
2160
|
-
image:
|
|
2183
|
+
image: U.output("datauristring"),
|
|
2161
2184
|
format: "pdf",
|
|
2162
2185
|
contentType: "application/pdf",
|
|
2163
2186
|
fileName: e
|
|
2164
2187
|
};
|
|
2165
2188
|
return i.fire("editor:canvas-exported", x), x;
|
|
2166
2189
|
}
|
|
2167
|
-
const z =
|
|
2190
|
+
const z = U.output("blob"), R = {
|
|
2168
2191
|
image: new File([z], e, { type: "application/pdf" }),
|
|
2169
2192
|
format: "pdf",
|
|
2170
2193
|
contentType: "application/pdf",
|
|
2171
2194
|
fileName: e
|
|
2172
2195
|
};
|
|
2173
|
-
return i.fire("editor:canvas-exported",
|
|
2196
|
+
return i.fire("editor:canvas-exported", R), R;
|
|
2174
2197
|
}
|
|
2175
2198
|
if (s) {
|
|
2176
2199
|
const M = {
|
|
@@ -3265,10 +3288,10 @@ class Ms {
|
|
|
3265
3288
|
const { canvas: t, canvasManager: e, historyManager: n } = this.editor;
|
|
3266
3289
|
n.suspendHistory(), this.isBlocked = !1, t.selection = !0, t.skipTargetFind = !1, e.getObjects().forEach((s) => {
|
|
3267
3290
|
s.evented = !0, s.selectable = !0;
|
|
3268
|
-
}), t.upperCanvasEl.style.pointerEvents = "", t.lowerCanvasEl.style.pointerEvents = "", this.overlayMask.visible = !1, t.requestRenderAll(), t.fire("editor:enabled"), n.resumeHistory();
|
|
3291
|
+
}), t.upperCanvasEl.style.pointerEvents = "", t.lowerCanvasEl.style.pointerEvents = "", this.overlayMask.visible = !1, t.requestRenderAll(), t.fire("editor:enabled"), n.resumeHistory(), n.flushDeferredSaveAfterUnblock();
|
|
3269
3292
|
}
|
|
3270
3293
|
}
|
|
3271
|
-
class
|
|
3294
|
+
class Ut {
|
|
3272
3295
|
constructor({ editor: t }) {
|
|
3273
3296
|
this.editor = t, this.backgroundObject = null;
|
|
3274
3297
|
}
|
|
@@ -3331,8 +3354,8 @@ class Wt {
|
|
|
3331
3354
|
try {
|
|
3332
3355
|
const { historyManager: i } = this.editor, { backgroundObject: a } = this;
|
|
3333
3356
|
if (i.suspendHistory(), a && a.backgroundType === "gradient") {
|
|
3334
|
-
const r =
|
|
3335
|
-
if (
|
|
3357
|
+
const r = Ut._createFabricGradient(t);
|
|
3358
|
+
if (Ut._isGradientEqual(a.fill, r)) {
|
|
3336
3359
|
i.resumeHistory();
|
|
3337
3360
|
return;
|
|
3338
3361
|
}
|
|
@@ -3515,7 +3538,7 @@ class Wt {
|
|
|
3515
3538
|
backgroundType: "gradient",
|
|
3516
3539
|
backgroundId: `background-${et()}`
|
|
3517
3540
|
}, { withoutSelection: !0 }), this.refresh();
|
|
3518
|
-
const e =
|
|
3541
|
+
const e = Ut._createFabricGradient(t);
|
|
3519
3542
|
this.backgroundObject.set("fill", e), this.editor.canvas.requestRenderAll();
|
|
3520
3543
|
}
|
|
3521
3544
|
/**
|
|
@@ -3575,7 +3598,7 @@ class Wt {
|
|
|
3575
3598
|
{ offset: 0, color: "#000000" },
|
|
3576
3599
|
{ offset: 1, color: "#ffffff" }
|
|
3577
3600
|
], t.type === "linear") {
|
|
3578
|
-
const u = t.angle * Math.PI / 180, f =
|
|
3601
|
+
const u = t.angle * Math.PI / 180, f = Ut._angleToCoords(u);
|
|
3579
3602
|
return new tn({
|
|
3580
3603
|
type: "linear",
|
|
3581
3604
|
gradientUnits: "percentage",
|
|
@@ -3798,7 +3821,7 @@ class Ss {
|
|
|
3798
3821
|
"height",
|
|
3799
3822
|
"fill"
|
|
3800
3823
|
]);
|
|
3801
|
-
const { canvas: u } = this.editor, f = new
|
|
3824
|
+
const { canvas: u } = this.editor, f = new kn(F({
|
|
3802
3825
|
id: t,
|
|
3803
3826
|
left: e,
|
|
3804
3827
|
top: n,
|
|
@@ -3838,7 +3861,7 @@ class Ss {
|
|
|
3838
3861
|
"radius",
|
|
3839
3862
|
"fill"
|
|
3840
3863
|
]);
|
|
3841
|
-
const { canvas: d } = this.editor, u = new
|
|
3864
|
+
const { canvas: d } = this.editor, u = new Rn(F({
|
|
3842
3865
|
id: t,
|
|
3843
3866
|
left: e,
|
|
3844
3867
|
top: n,
|
|
@@ -5047,7 +5070,7 @@ const Cs = ({ textbox: h }) => {
|
|
|
5047
5070
|
);
|
|
5048
5071
|
if (n.length)
|
|
5049
5072
|
return (s = n[0]) == null ? void 0 : s[e];
|
|
5050
|
-
},
|
|
5073
|
+
}, Re = ({ strokeColor: h, width: t }) => t <= 0 ? null : h != null ? h : "#000000", Be = ({ width: h = 0 }) => h ? Math.max(0, h) : 0, Ce = ({ value: h }) => typeof h == "string" ? h.toLocaleUpperCase() : "", wt = ({
|
|
5051
5074
|
value: h,
|
|
5052
5075
|
min: t,
|
|
5053
5076
|
max: e
|
|
@@ -5141,38 +5164,38 @@ const Cs = ({ textbox: h }) => {
|
|
|
5141
5164
|
}
|
|
5142
5165
|
const A = c[g], w = b / o, T = this._getLineLeftOffset(g);
|
|
5143
5166
|
let E = 0, C = 0, v = this.getValueOfPropertyAt(g, 0, e), S = this._getDecorationColorAt(g, 0), M = this.getValueOfPropertyAt(g, 0, "textDecorationThickness"), I = v, O = S, L = M;
|
|
5144
|
-
const
|
|
5167
|
+
const U = l + w * (1 - r);
|
|
5145
5168
|
let z = this.getHeightOfChar(g, 0), j = this.getValueOfPropertyAt(g, 0, "deltaY");
|
|
5146
5169
|
for (let x = 0, B = A.length; x < B; x += 1) {
|
|
5147
5170
|
const _ = this.__charBounds[g][x];
|
|
5148
5171
|
I = this.getValueOfPropertyAt(g, x, e), O = this._getDecorationColorAt(g, x), L = this.getValueOfPropertyAt(g, x, "textDecorationThickness");
|
|
5149
5172
|
const D = this.getHeightOfChar(g, x), P = this.getValueOfPropertyAt(g, x, "deltaY");
|
|
5150
5173
|
if (u && I && O) {
|
|
5151
|
-
const
|
|
5174
|
+
const k = s * L / 1e3;
|
|
5152
5175
|
t.save(), t.fillStyle = S, t.translate(_.renderLeft, _.renderTop), t.rotate(_.angle), t.fillRect(
|
|
5153
5176
|
-_.kernedWidth / 2,
|
|
5154
|
-
p * D + P - m *
|
|
5177
|
+
p * D + P - m * k,
|
|
5155
5178
|
_.kernedWidth,
|
|
5156
|
-
|
|
5179
|
+
k
|
|
5157
5180
|
), t.restore();
|
|
5158
5181
|
} else if ((I !== v || O !== S || D !== z || L !== M || P !== j) && C > 0) {
|
|
5159
|
-
const
|
|
5182
|
+
const k = s * M / 1e3;
|
|
5160
5183
|
let V = d + T + E;
|
|
5161
5184
|
n === "rtl" && (V = a - V - C), v && S && M && (t.fillStyle = S, t.fillRect(
|
|
5162
5185
|
V,
|
|
5163
|
-
|
|
5186
|
+
U + p * z + j - m * k,
|
|
5164
5187
|
C,
|
|
5165
|
-
|
|
5188
|
+
k
|
|
5166
5189
|
)), E = _.left, C = _.width, v = I, M = L, S = O, z = D, j = P;
|
|
5167
5190
|
} else
|
|
5168
5191
|
C += _.kernedWidth;
|
|
5169
5192
|
}
|
|
5170
|
-
let
|
|
5171
|
-
n === "rtl" && (
|
|
5193
|
+
let R = d + T + E;
|
|
5194
|
+
n === "rtl" && (R = a - R - C), t.fillStyle = O;
|
|
5172
5195
|
const N = s * L / 1e3;
|
|
5173
5196
|
I && O && L && t.fillRect(
|
|
5174
|
-
|
|
5175
|
-
|
|
5197
|
+
R,
|
|
5198
|
+
U + p * z + j - m * N,
|
|
5176
5199
|
C - f,
|
|
5177
5200
|
N
|
|
5178
5201
|
), l += b;
|
|
@@ -5185,7 +5208,7 @@ const Cs = ({ textbox: h }) => {
|
|
|
5185
5208
|
_getDecorationColorAt(t, e) {
|
|
5186
5209
|
const n = this.getValueOfPropertyAt(t, e, "strokeWidth"), s = Be({
|
|
5187
5210
|
width: typeof n == "number" && Number.isFinite(n) ? n : 0
|
|
5188
|
-
}), o = this.getValueOfPropertyAt(t, e, "stroke"), i = o == null ? null :
|
|
5211
|
+
}), o = this.getValueOfPropertyAt(t, e, "stroke"), i = o == null ? null : Re({ strokeColor: o, width: s });
|
|
5189
5212
|
if (s > 0 && i != null)
|
|
5190
5213
|
return i;
|
|
5191
5214
|
const a = this.getValueOfPropertyAt(t, e, "fill");
|
|
@@ -5439,7 +5462,7 @@ const Es = () => {
|
|
|
5439
5462
|
s > u && n < f && i.push(l), a = f + 1;
|
|
5440
5463
|
}
|
|
5441
5464
|
return i;
|
|
5442
|
-
},
|
|
5465
|
+
}, ks = ({
|
|
5443
5466
|
textbox: h,
|
|
5444
5467
|
range: t
|
|
5445
5468
|
}) => {
|
|
@@ -5454,7 +5477,7 @@ const Es = () => {
|
|
|
5454
5477
|
n <= u && s >= f && i.push(l), a = f + 1;
|
|
5455
5478
|
}
|
|
5456
5479
|
return i;
|
|
5457
|
-
},
|
|
5480
|
+
}, Rs = ({
|
|
5458
5481
|
previous: h,
|
|
5459
5482
|
next: t
|
|
5460
5483
|
}) => {
|
|
@@ -5619,7 +5642,7 @@ class rt {
|
|
|
5619
5642
|
event: i != null ? i : null
|
|
5620
5643
|
});
|
|
5621
5644
|
}, this._handleObjectScaling = (n) => {
|
|
5622
|
-
var ie, Se, oe, ae, re,
|
|
5645
|
+
var ie, Se, oe, ae, re, Rt, we, ce, Zt, Gt, Vt, Xt, Kt;
|
|
5623
5646
|
const { target: s, transform: o } = n;
|
|
5624
5647
|
if (s instanceof K || !rt._isTextbox(s) || !o) return;
|
|
5625
5648
|
s.isScaling = !0;
|
|
@@ -5633,19 +5656,19 @@ class rt {
|
|
|
5633
5656
|
baseLineFontDefaults: f
|
|
5634
5657
|
} = i, p = typeof ((ie = o.original) == null ? void 0 : ie.width) == "number" ? o.original.width : void 0, m = typeof ((Se = o.original) == null ? void 0 : Se.left) == "number" ? o.original.left : void 0, g = p != null ? p : a, y = m != null ? m : r, b = (oe = o.corner) != null ? oe : "", A = (ae = o.action) != null ? ae : "", w = ["ml", "mr"].includes(b) || A === "scaleX", T = ["mt", "mb"].includes(b) || A === "scaleY", E = ["tl", "tr", "bl", "br"].includes(b) || A === "scale", C = E || T;
|
|
5635
5658
|
if (!w && !T && !E) return;
|
|
5636
|
-
const v = Math.abs((
|
|
5659
|
+
const v = Math.abs((Rt = (re = s.scaleX) != null ? re : o.scaleX) != null ? Rt : 1) || 1, S = Math.abs((ce = (we = s.scaleY) != null ? we : o.scaleY) != null ? ce : 1) || 1, M = Math.max(1, g * v), I = Math.max(1, Math.round(M)), O = Math.max(1, c * S), {
|
|
5637
5660
|
paddingTop: L = 0,
|
|
5638
|
-
paddingRight:
|
|
5661
|
+
paddingRight: U = 0,
|
|
5639
5662
|
paddingBottom: z = 0,
|
|
5640
5663
|
paddingLeft: j = 0,
|
|
5641
|
-
radiusTopLeft:
|
|
5664
|
+
radiusTopLeft: R = 0,
|
|
5642
5665
|
radiusTopRight: N = 0,
|
|
5643
5666
|
radiusBottomRight: x = 0,
|
|
5644
5667
|
radiusBottomLeft: B = 0,
|
|
5645
5668
|
fontSize: _,
|
|
5646
5669
|
width: D,
|
|
5647
5670
|
originX: P = "left"
|
|
5648
|
-
} = s,
|
|
5671
|
+
} = s, k = E || T, V = E || T, H = k ? {
|
|
5649
5672
|
top: Math.max(0, l.top * S),
|
|
5650
5673
|
right: Math.max(0, l.right * S),
|
|
5651
5674
|
bottom: Math.max(0, l.bottom * S),
|
|
@@ -5674,8 +5697,8 @@ class rt {
|
|
|
5674
5697
|
lineFontDefaults: f,
|
|
5675
5698
|
scale: S
|
|
5676
5699
|
}));
|
|
5677
|
-
const jt = (Gt = (Zt = o.originX) != null ? Zt : P) != null ? Gt : "left", dt = y + g, ht = y + g / 2, Et = D != null ? D : g, Ct = I !== Et, Dt = Math.abs(O - (_ != null ? _ : c)) > it, xt = Math.abs(H.top - L) > it || Math.abs(H.right -
|
|
5678
|
-
if (!Ct && !Dt && !xt && !
|
|
5700
|
+
const jt = (Gt = (Zt = o.originX) != null ? Zt : P) != null ? Gt : "left", dt = y + g, ht = y + g / 2, Et = D != null ? D : g, Ct = I !== Et, Dt = Math.abs(O - (_ != null ? _ : c)) > it, xt = Math.abs(H.top - L) > it || Math.abs(H.right - U) > it || Math.abs(H.bottom - z) > it || Math.abs(H.left - j) > it, kt = Math.abs(q.topLeft - R) > it || Math.abs(q.topRight - N) > it || Math.abs(q.bottomRight - x) > it || Math.abs(q.bottomLeft - B) > it;
|
|
5701
|
+
if (!Ct && !Dt && !xt && !kt) {
|
|
5679
5702
|
s.set({ scaleX: 1, scaleY: 1 }), o.scaleX = 1, o.scaleY = 1;
|
|
5680
5703
|
return;
|
|
5681
5704
|
}
|
|
@@ -5711,7 +5734,7 @@ class rt {
|
|
|
5711
5734
|
topRight: q.topRight,
|
|
5712
5735
|
bottomRight: q.bottomRight,
|
|
5713
5736
|
bottomLeft: q.bottomLeft
|
|
5714
|
-
}, i.hasWidthChange = se || Dt || xt ||
|
|
5737
|
+
}, i.hasWidthChange = se || Dt || xt || kt || Ht;
|
|
5715
5738
|
}, this._handleObjectModified = (n) => {
|
|
5716
5739
|
var b, A, w;
|
|
5717
5740
|
const { target: s } = n;
|
|
@@ -5721,14 +5744,14 @@ class rt {
|
|
|
5721
5744
|
const { scaleX: C = 1, scaleY: v = 1 } = s;
|
|
5722
5745
|
if (Math.abs(C - 1) < it && Math.abs(v - 1) < it) return;
|
|
5723
5746
|
this.canvas.discardActiveObject(), T.forEach((M) => {
|
|
5724
|
-
var I, O, L,
|
|
5747
|
+
var I, O, L, U;
|
|
5725
5748
|
if (rt._isTextbox(M)) {
|
|
5726
|
-
const z = (I = M.scaleX) != null ? I : 1, j = (O = M.scaleY) != null ? O : 1,
|
|
5749
|
+
const z = (I = M.scaleX) != null ? I : 1, j = (O = M.scaleY) != null ? O : 1, R = ((L = M.fontSize) != null ? L : 16) * j, N = ((U = M.width) != null ? U : 0) * z, x = j, {
|
|
5727
5750
|
paddingTop: B = 0,
|
|
5728
5751
|
paddingRight: _ = 0,
|
|
5729
5752
|
paddingBottom: D = 0,
|
|
5730
5753
|
paddingLeft: P = 0,
|
|
5731
|
-
radiusTopLeft:
|
|
5754
|
+
radiusTopLeft: k = 0,
|
|
5732
5755
|
radiusTopRight: V = 0,
|
|
5733
5756
|
radiusBottomRight: H = 0,
|
|
5734
5757
|
radiusBottomLeft: q = 0,
|
|
@@ -5739,7 +5762,7 @@ class rt {
|
|
|
5739
5762
|
paddingBottom: Math.max(0, D * x),
|
|
5740
5763
|
paddingLeft: Math.max(0, P * x)
|
|
5741
5764
|
}, gt = {
|
|
5742
|
-
radiusTopLeft: Math.max(0,
|
|
5765
|
+
radiusTopLeft: Math.max(0, k * x),
|
|
5743
5766
|
radiusTopRight: Math.max(0, V * x),
|
|
5744
5767
|
radiusBottomRight: Math.max(0, H * x),
|
|
5745
5768
|
radiusBottomLeft: Math.max(0, q * x)
|
|
@@ -5754,7 +5777,7 @@ class rt {
|
|
|
5754
5777
|
lineFontDefaults: M.lineFontDefaults,
|
|
5755
5778
|
scale: x
|
|
5756
5779
|
}), ht = It(F(F({
|
|
5757
|
-
fontSize:
|
|
5780
|
+
fontSize: R,
|
|
5758
5781
|
width: N,
|
|
5759
5782
|
scaleX: 1,
|
|
5760
5783
|
scaleY: 1
|
|
@@ -5806,8 +5829,8 @@ class rt {
|
|
|
5806
5829
|
* @param options — настройки текста
|
|
5807
5830
|
* @param flags — флаги поведения
|
|
5808
5831
|
*/
|
|
5809
|
-
addText(
|
|
5810
|
-
var z =
|
|
5832
|
+
addText(U = {}, { withoutSelection: I = !1, withoutSave: O = !1, withoutAdding: L = !1 } = {}) {
|
|
5833
|
+
var z = U, {
|
|
5811
5834
|
id: t = `text-${et()}`,
|
|
5812
5835
|
text: e = "Новый текст",
|
|
5813
5836
|
autoExpand: n = !0,
|
|
@@ -5861,9 +5884,9 @@ class rt {
|
|
|
5861
5884
|
"radiusBottomLeft"
|
|
5862
5885
|
]);
|
|
5863
5886
|
var V;
|
|
5864
|
-
const { historyManager: j } = this.editor, { canvas:
|
|
5887
|
+
const { historyManager: j } = this.editor, { canvas: R } = this;
|
|
5865
5888
|
j.suspendHistory();
|
|
5866
|
-
const N = s != null ? s : this._getDefaultFontFamily(), x = Be({ width: p }), B =
|
|
5889
|
+
const N = s != null ? s : this._getDefaultFontFamily(), x = Be({ width: p }), B = Re({
|
|
5867
5890
|
strokeColor: f,
|
|
5868
5891
|
width: x
|
|
5869
5892
|
}), _ = F({
|
|
@@ -5896,7 +5919,7 @@ class rt {
|
|
|
5896
5919
|
const H = Ce({ value: D.textCaseRaw });
|
|
5897
5920
|
H !== D.text && D.set({ text: H });
|
|
5898
5921
|
}
|
|
5899
|
-
return _t({ textbox: D }) && (D.dirty = !0), M.left === void 0 && M.top === void 0 &&
|
|
5922
|
+
return _t({ textbox: D }) && (D.dirty = !0), M.left === void 0 && M.top === void 0 && R.centerObject(D), L || R.add(D), I || R.setActiveObject(D), R.requestRenderAll(), j.resumeHistory(), O || j.saveState(), R.fire("editor:text-added", {
|
|
5900
5923
|
textbox: D,
|
|
5901
5924
|
options: It(F({}, _), {
|
|
5902
5925
|
text: e,
|
|
@@ -5957,10 +5980,10 @@ class rt {
|
|
|
5957
5980
|
opacity: I,
|
|
5958
5981
|
backgroundColor: O,
|
|
5959
5982
|
backgroundOpacity: L,
|
|
5960
|
-
paddingTop:
|
|
5983
|
+
paddingTop: U,
|
|
5961
5984
|
paddingRight: z,
|
|
5962
5985
|
paddingBottom: j,
|
|
5963
|
-
paddingLeft:
|
|
5986
|
+
paddingLeft: R,
|
|
5964
5987
|
radiusTopLeft: N,
|
|
5965
5988
|
radiusTopRight: x,
|
|
5966
5989
|
radiusBottomRight: B,
|
|
@@ -5990,39 +6013,39 @@ class rt {
|
|
|
5990
6013
|
"radiusTopRight",
|
|
5991
6014
|
"radiusBottomRight",
|
|
5992
6015
|
"radiusBottomLeft"
|
|
5993
|
-
]), P = F({}, D),
|
|
6016
|
+
]), P = F({}, D), k = o !== void 0 ? Ls({
|
|
5994
6017
|
text: a,
|
|
5995
6018
|
range: o
|
|
5996
|
-
}) : Cs({ textbox: i }), V =
|
|
6019
|
+
}) : Cs({ textbox: i }), V = k ? Ds({ textbox: i, range: k }) : null, H = {}, q = {}, tt = {};
|
|
5997
6020
|
let at, gt;
|
|
5998
|
-
const jt = Ts({ textbox: i, range:
|
|
6021
|
+
const jt = Ts({ textbox: i, range: k }), dt = !k || jt, ht = !k;
|
|
5999
6022
|
if (g !== void 0 && (V && (q.fontFamily = g), dt && (P.fontFamily = g, ht && (tt.fontFamily = g))), y !== void 0 && (V && (q.fontSize = y), dt && (P.fontSize = y, ht && (tt.fontSize = y))), b !== void 0) {
|
|
6000
6023
|
const Q = b ? "bold" : "normal";
|
|
6001
|
-
|
|
6024
|
+
k && (H.fontWeight = Q), dt && (P.fontWeight = Q, ht && (tt.fontWeight = Q));
|
|
6002
6025
|
}
|
|
6003
6026
|
if (A !== void 0) {
|
|
6004
6027
|
const Q = A ? "italic" : "normal";
|
|
6005
|
-
|
|
6028
|
+
k && (H.fontStyle = Q), dt && (P.fontStyle = Q, ht && (tt.fontStyle = Q));
|
|
6006
6029
|
}
|
|
6007
|
-
if (w !== void 0 && (
|
|
6008
|
-
const Q =
|
|
6030
|
+
if (w !== void 0 && (k && (H.underline = w), dt && (P.underline = w, ht && (tt.underline = w))), E !== void 0 && (k && (H.linethrough = E), dt && (P.linethrough = E, ht && (tt.linethrough = E))), C !== void 0 && (P.textAlign = C), v !== void 0 && (k && (H.fill = v), dt && (P.fill = v, ht && (tt.fill = v))), S !== void 0 || M !== void 0) {
|
|
6031
|
+
const Q = k ? hn({ textbox: i, range: k, property: "strokeWidth" }) : void 0, st = k ? hn({ textbox: i, range: k, property: "stroke" }) : void 0, Ae = (Xt = (Vt = M != null ? M : Q) != null ? Vt : i.strokeWidth) != null ? Xt : 0;
|
|
6009
6032
|
gt = Be({ width: Ae });
|
|
6010
6033
|
const Nt = (Bt = (Kt = S != null ? S : st) != null ? Kt : i.stroke) != null ? Bt : void 0;
|
|
6011
|
-
at =
|
|
6034
|
+
at = Re({
|
|
6012
6035
|
strokeColor: Nt,
|
|
6013
6036
|
width: gt
|
|
6014
|
-
}),
|
|
6037
|
+
}), k && (H.stroke = at, H.strokeWidth = gt), dt && (P.stroke = at, P.strokeWidth = gt, ht && (tt.stroke = at, tt.strokeWidth = gt));
|
|
6015
6038
|
}
|
|
6016
|
-
I !== void 0 && (P.opacity = I), O !== void 0 && (P.backgroundColor = O), L !== void 0 && (P.backgroundOpacity = L),
|
|
6017
|
-
const Et = (le = i.textCaseRaw) != null ? le : a, Ct = !!i.uppercase, Dt = p !== void 0, xt = Dt ? p != null ? p : "" : Et,
|
|
6039
|
+
I !== void 0 && (P.opacity = I), O !== void 0 && (P.backgroundColor = O), L !== void 0 && (P.backgroundOpacity = L), U !== void 0 && (P.paddingTop = U), z !== void 0 && (P.paddingRight = z), j !== void 0 && (P.paddingBottom = j), R !== void 0 && (P.paddingLeft = R), N !== void 0 && (P.radiusTopLeft = N), x !== void 0 && (P.radiusTopRight = x), B !== void 0 && (P.radiusBottomRight = B), _ !== void 0 && (P.radiusBottomLeft = _);
|
|
6040
|
+
const Et = (le = i.textCaseRaw) != null ? le : a, Ct = !!i.uppercase, Dt = p !== void 0, xt = Dt ? p != null ? p : "" : Et, kt = T != null ? T : Ct, Ht = kt !== Ct;
|
|
6018
6041
|
if (Dt || Ht) {
|
|
6019
|
-
const Q =
|
|
6042
|
+
const Q = kt ? Ce({ value: xt }) : xt;
|
|
6020
6043
|
P.text = Q, i.textCaseRaw = xt;
|
|
6021
6044
|
} else i.textCaseRaw === void 0 && (i.textCaseRaw = Et);
|
|
6022
|
-
i.uppercase =
|
|
6045
|
+
i.uppercase = kt, i.set(P);
|
|
6023
6046
|
let mt = !1;
|
|
6024
|
-
if (
|
|
6025
|
-
const Q = je({ textbox: i, styles: H, range:
|
|
6047
|
+
if (k) {
|
|
6048
|
+
const Q = je({ textbox: i, styles: H, range: k }), st = V ? je({ textbox: i, styles: q, range: V }) : !1;
|
|
6026
6049
|
mt = Q || st;
|
|
6027
6050
|
} else if (Object.keys(tt).length) {
|
|
6028
6051
|
const Q = Is({ textbox: i });
|
|
@@ -6046,10 +6069,10 @@ class rt {
|
|
|
6046
6069
|
updates: st
|
|
6047
6070
|
});
|
|
6048
6071
|
}
|
|
6049
|
-
if (
|
|
6050
|
-
const Q =
|
|
6072
|
+
if (k && (v !== void 0 || S !== void 0 || M !== void 0)) {
|
|
6073
|
+
const Q = ks({
|
|
6051
6074
|
textbox: i,
|
|
6052
|
-
range:
|
|
6075
|
+
range: k
|
|
6053
6076
|
}), st = {};
|
|
6054
6077
|
v !== void 0 && (st.fill = v), (S !== void 0 || M !== void 0) && (at === null && (st.stroke = null), at != null && (st.stroke = at)), un({
|
|
6055
6078
|
textbox: i,
|
|
@@ -6057,7 +6080,7 @@ class rt {
|
|
|
6057
6080
|
updates: st
|
|
6058
6081
|
});
|
|
6059
6082
|
}
|
|
6060
|
-
se && (i.initDimensions(), i.dirty = !0), (O !== void 0 || L !== void 0 ||
|
|
6083
|
+
se && (i.initDimensions(), i.dirty = !0), (O !== void 0 || L !== void 0 || U !== void 0 || z !== void 0 || j !== void 0 || R !== void 0 || N !== void 0 || x !== void 0 || B !== void 0 || _ !== void 0) && (i.dirty = !0);
|
|
6061
6084
|
const Ot = mn({
|
|
6062
6085
|
stylesList: [
|
|
6063
6086
|
P,
|
|
@@ -6068,10 +6091,10 @@ class rt {
|
|
|
6068
6091
|
}), { autoExpand: Mt } = i, ie = m !== void 0, oe = (m != null ? m : Mt) !== !1;
|
|
6069
6092
|
ie ? i.autoExpand = m !== !1 : Mt === void 0 && (i.autoExpand = !0);
|
|
6070
6093
|
const ae = Object.prototype.hasOwnProperty.call(P, "width"), re = oe && !ae && (Dt || Ht || Ot);
|
|
6071
|
-
let
|
|
6072
|
-
re && (
|
|
6094
|
+
let Rt = !1;
|
|
6095
|
+
re && (Rt = this._autoExpandTextboxWidth(i, {
|
|
6073
6096
|
anchor: f
|
|
6074
|
-
}),
|
|
6097
|
+
}), Rt && (i.dirty = !0)), (Rt ? !1 : _t({ textbox: i })) && (i.dirty = !0), i.setCoords(), s || c.requestRenderAll(), r.resumeHistory(), n || r.saveState();
|
|
6075
6098
|
const ce = rt._getSnapshot(i);
|
|
6076
6099
|
return c.fire("editor:text-updated", {
|
|
6077
6100
|
textbox: i,
|
|
@@ -6084,8 +6107,8 @@ class rt {
|
|
|
6084
6107
|
updates: P,
|
|
6085
6108
|
before: l,
|
|
6086
6109
|
after: ce,
|
|
6087
|
-
selectionRange:
|
|
6088
|
-
selectionStyles:
|
|
6110
|
+
selectionRange: k != null ? k : void 0,
|
|
6111
|
+
selectionStyles: k && Object.keys(H).length ? H : void 0
|
|
6089
6112
|
}), i;
|
|
6090
6113
|
}
|
|
6091
6114
|
/**
|
|
@@ -6135,7 +6158,7 @@ class rt {
|
|
|
6135
6158
|
* Синхронизирует lineFontDefaults при изменении текста и сохраняет typing style для пустых строк.
|
|
6136
6159
|
*/
|
|
6137
6160
|
_syncLineFontDefaultsOnTextChanged({ textbox: t }) {
|
|
6138
|
-
var L,
|
|
6161
|
+
var L, U, z;
|
|
6139
6162
|
const {
|
|
6140
6163
|
text: e = "",
|
|
6141
6164
|
lineFontDefaults: n,
|
|
@@ -6152,20 +6175,20 @@ class rt {
|
|
|
6152
6175
|
let b = n, A = !1, w = !1;
|
|
6153
6176
|
const T = typeof a == "string" ? a : void 0, E = typeof r == "string" ? r : void 0;
|
|
6154
6177
|
if (y !== 0 && n && Object.keys(n).length) {
|
|
6155
|
-
const j =
|
|
6178
|
+
const j = Rs({
|
|
6156
6179
|
previous: u,
|
|
6157
6180
|
next: d
|
|
6158
|
-
}),
|
|
6181
|
+
}), R = Bs({
|
|
6159
6182
|
text: u,
|
|
6160
6183
|
charIndex: j
|
|
6161
6184
|
});
|
|
6162
6185
|
if (y > 0) {
|
|
6163
6186
|
const N = Ns({
|
|
6164
6187
|
text: u,
|
|
6165
|
-
lineIndex:
|
|
6188
|
+
lineIndex: R
|
|
6166
6189
|
});
|
|
6167
|
-
let x =
|
|
6168
|
-
j === N && (x =
|
|
6190
|
+
let x = R + 1;
|
|
6191
|
+
j === N && (x = R);
|
|
6169
6192
|
const B = {};
|
|
6170
6193
|
for (const _ in n) {
|
|
6171
6194
|
if (!Object.prototype.hasOwnProperty.call(n, _)) continue;
|
|
@@ -6173,43 +6196,43 @@ class rt {
|
|
|
6173
6196
|
if (!Number.isFinite(D)) continue;
|
|
6174
6197
|
const P = n[D];
|
|
6175
6198
|
if (!P) continue;
|
|
6176
|
-
const
|
|
6177
|
-
B[
|
|
6199
|
+
const k = D >= x ? D + y : D;
|
|
6200
|
+
B[k] = F({}, P);
|
|
6178
6201
|
}
|
|
6179
6202
|
b = B, A = !0, w = !0;
|
|
6180
6203
|
}
|
|
6181
6204
|
if (y < 0) {
|
|
6182
6205
|
const N = Math.abs(y);
|
|
6183
|
-
let x =
|
|
6206
|
+
let x = R;
|
|
6184
6207
|
u[j] === `
|
|
6185
|
-
` && ((
|
|
6208
|
+
` && ((U = f[R]) != null ? U : "").length > 0 && (x = R + 1);
|
|
6186
6209
|
const _ = x + N - 1, D = {};
|
|
6187
6210
|
for (const P in n) {
|
|
6188
6211
|
if (!Object.prototype.hasOwnProperty.call(n, P)) continue;
|
|
6189
|
-
const
|
|
6190
|
-
if (!Number.isFinite(
|
|
6191
|
-
const V = n[
|
|
6192
|
-
V && (
|
|
6212
|
+
const k = Number(P);
|
|
6213
|
+
if (!Number.isFinite(k)) continue;
|
|
6214
|
+
const V = n[k];
|
|
6215
|
+
V && (k < x && (D[k] = F({}, V)), k > _ && (D[k + y] = F({}, V)));
|
|
6193
6216
|
}
|
|
6194
6217
|
b = D, A = !0, w = !0;
|
|
6195
6218
|
}
|
|
6196
6219
|
}
|
|
6197
6220
|
let C = null;
|
|
6198
6221
|
if (l && typeof c == "number") {
|
|
6199
|
-
const j = t.get2DCursorLocation(c), { lineIndex:
|
|
6200
|
-
Number.isFinite(
|
|
6222
|
+
const j = t.get2DCursorLocation(c), { lineIndex: R } = j;
|
|
6223
|
+
Number.isFinite(R) && (C = R);
|
|
6201
6224
|
}
|
|
6202
6225
|
let v = s, S = !1, M = !1, I, O = null;
|
|
6203
6226
|
for (let j = 0; j < p.length; j += 1) {
|
|
6204
|
-
const
|
|
6205
|
-
if (N && (I = N),
|
|
6227
|
+
const R = (z = p[j]) != null ? z : "", N = b ? b[j] : void 0;
|
|
6228
|
+
if (N && (I = N), R.length !== 0) {
|
|
6206
6229
|
if (N) {
|
|
6207
|
-
const
|
|
6208
|
-
lineText:
|
|
6230
|
+
const k = Os({
|
|
6231
|
+
lineText: R,
|
|
6209
6232
|
lineStyles: v ? v[j] : void 0,
|
|
6210
6233
|
lineDefaults: N
|
|
6211
6234
|
});
|
|
6212
|
-
|
|
6235
|
+
k.changed && (v || (v = {}, M = !0), M || (v = F({}, v), M = !0), k.lineStyles && (v[j] = k.lineStyles), !k.lineStyles && v[j] && delete v[j], S = !0);
|
|
6213
6236
|
}
|
|
6214
6237
|
continue;
|
|
6215
6238
|
}
|
|
@@ -6238,7 +6261,7 @@ class rt {
|
|
|
6238
6261
|
* но не шире монтажной области, и удерживает объект в её пределах.
|
|
6239
6262
|
*/
|
|
6240
6263
|
_autoExpandTextboxWidth(t, { anchor: e } = {}) {
|
|
6241
|
-
var C, v, S, M, I, O, L,
|
|
6264
|
+
var C, v, S, M, I, O, L, U, z, j, R, N, x;
|
|
6242
6265
|
const { montageArea: n } = this.editor;
|
|
6243
6266
|
if (!n) return !1;
|
|
6244
6267
|
const s = typeof t.text == "string" ? t.text : "";
|
|
@@ -6246,7 +6269,7 @@ class rt {
|
|
|
6246
6269
|
n.setCoords();
|
|
6247
6270
|
const o = n.getBoundingRect(!1, !0), i = (C = o.width) != null ? C : 0;
|
|
6248
6271
|
if (!Number.isFinite(i) || i <= 0) return !1;
|
|
6249
|
-
const a = e != null ? e : (v = this.editingAnchorState) == null ? void 0 : v.get(t), r = (M = (S = a == null ? void 0 : a.originY) != null ? S : t.originY) != null ? M : "top", c = Math.abs((I = t.scaleX) != null ? I : 1) || 1, l = (O = t.paddingLeft) != null ? O : 0, d = (L = t.paddingRight) != null ? L : 0, u = (
|
|
6272
|
+
const a = e != null ? e : (v = this.editingAnchorState) == null ? void 0 : v.get(t), r = (M = (S = a == null ? void 0 : a.originY) != null ? S : t.originY) != null ? M : "top", c = Math.abs((I = t.scaleX) != null ? I : 1) || 1, l = (O = t.paddingLeft) != null ? O : 0, d = (L = t.paddingRight) != null ? L : 0, u = (U = t.strokeWidth) != null ? U : 0, f = Math.max(
|
|
6250
6273
|
1,
|
|
6251
6274
|
i / c - l - d - u
|
|
6252
6275
|
);
|
|
@@ -6262,7 +6285,7 @@ class rt {
|
|
|
6262
6285
|
f,
|
|
6263
6286
|
Math.max(b, A)
|
|
6264
6287
|
);
|
|
6265
|
-
y && (w = f), Math.abs(((
|
|
6288
|
+
y && (w = f), Math.abs(((R = t.width) != null ? R : 0) - w) > it && (t.set({ width: w }), t.initDimensions(), m = !0), _t({ textbox: t }) && (m = !0), a && (t.setPositionByOrigin(new lt(a.x, a.y), "center", r), m = !0);
|
|
6266
6289
|
const E = zs({
|
|
6267
6290
|
textbox: t,
|
|
6268
6291
|
montageLeft: (N = o.left) != null ? N : 0,
|
|
@@ -6325,8 +6348,8 @@ class rt {
|
|
|
6325
6348
|
snapshot: _,
|
|
6326
6349
|
entries: D
|
|
6327
6350
|
}) => {
|
|
6328
|
-
Object.entries(D).forEach(([P,
|
|
6329
|
-
|
|
6351
|
+
Object.entries(D).forEach(([P, k]) => {
|
|
6352
|
+
k != null && (_[P] = k);
|
|
6330
6353
|
});
|
|
6331
6354
|
}, {
|
|
6332
6355
|
id: n,
|
|
@@ -6356,10 +6379,10 @@ class rt {
|
|
|
6356
6379
|
radiusBottomRight: I,
|
|
6357
6380
|
radiusBottomLeft: O,
|
|
6358
6381
|
left: L,
|
|
6359
|
-
top:
|
|
6382
|
+
top: U,
|
|
6360
6383
|
width: z,
|
|
6361
6384
|
height: j,
|
|
6362
|
-
angle:
|
|
6385
|
+
angle: R,
|
|
6363
6386
|
scaleX: N,
|
|
6364
6387
|
scaleY: x
|
|
6365
6388
|
} = t, B = {
|
|
@@ -6394,10 +6417,10 @@ class rt {
|
|
|
6394
6417
|
radiusBottomRight: I,
|
|
6395
6418
|
radiusBottomLeft: O,
|
|
6396
6419
|
left: L,
|
|
6397
|
-
top:
|
|
6420
|
+
top: U,
|
|
6398
6421
|
width: z,
|
|
6399
6422
|
height: j,
|
|
6400
|
-
angle:
|
|
6423
|
+
angle: R,
|
|
6401
6424
|
scaleX: N,
|
|
6402
6425
|
scaleY: x
|
|
6403
6426
|
}
|
|
@@ -6457,7 +6480,7 @@ const fe = ({
|
|
|
6457
6480
|
x: d + f / 2,
|
|
6458
6481
|
y: u + p / 2
|
|
6459
6482
|
};
|
|
6460
|
-
},
|
|
6483
|
+
}, Us = ({
|
|
6461
6484
|
normalizedX: h,
|
|
6462
6485
|
normalizedY: t,
|
|
6463
6486
|
bounds: e,
|
|
@@ -6471,7 +6494,7 @@ const fe = ({
|
|
|
6471
6494
|
}
|
|
6472
6495
|
const c = o + h * a, l = i + t * r;
|
|
6473
6496
|
return new lt(c, l);
|
|
6474
|
-
},
|
|
6497
|
+
}, Ws = ({
|
|
6475
6498
|
object: h,
|
|
6476
6499
|
montageArea: t,
|
|
6477
6500
|
bounds: e
|
|
@@ -6752,8 +6775,8 @@ class G {
|
|
|
6752
6775
|
return;
|
|
6753
6776
|
}
|
|
6754
6777
|
if (I === "stretch") {
|
|
6755
|
-
const
|
|
6756
|
-
|
|
6778
|
+
const U = S ? T / m : null, z = M ? E / g : null;
|
|
6779
|
+
U && U > 0 && (O.scaleX = U), z && z > 0 && (O.scaleY = z), c.set(O);
|
|
6757
6780
|
return;
|
|
6758
6781
|
}
|
|
6759
6782
|
if (!S || !M) {
|
|
@@ -6863,7 +6886,7 @@ class G {
|
|
|
6863
6886
|
useRelativePositions: r,
|
|
6864
6887
|
anchorX: G._resolveAnchor(c, pe),
|
|
6865
6888
|
anchorY: G._resolveAnchor(c, Te)
|
|
6866
|
-
}), y =
|
|
6889
|
+
}), y = Us({
|
|
6867
6890
|
normalizedX: l,
|
|
6868
6891
|
normalizedY: d,
|
|
6869
6892
|
bounds: g,
|
|
@@ -6958,12 +6981,12 @@ class G {
|
|
|
6958
6981
|
object: t,
|
|
6959
6982
|
baseWidth: e
|
|
6960
6983
|
}) {
|
|
6961
|
-
var j,
|
|
6984
|
+
var j, R;
|
|
6962
6985
|
if (!(t instanceof ct)) return;
|
|
6963
6986
|
const n = typeof t.text == "string" ? t.text : "";
|
|
6964
6987
|
if (!n) return;
|
|
6965
6988
|
const s = nt({
|
|
6966
|
-
value: (
|
|
6989
|
+
value: (R = (j = this.editor) == null ? void 0 : j.montageArea) == null ? void 0 : R.width,
|
|
6967
6990
|
fallback: 0
|
|
6968
6991
|
}), {
|
|
6969
6992
|
width: o = 0,
|
|
@@ -6979,9 +7002,9 @@ class G {
|
|
|
6979
7002
|
text: n
|
|
6980
7003
|
}), O = I > p ? I + 1 : p;
|
|
6981
7004
|
t.set("width", O), t.initDimensions(), t.setPositionByOrigin(M, "center", "center"), t.setCoords();
|
|
6982
|
-
const
|
|
7005
|
+
const U = (O * u + g + y + f) / r;
|
|
6983
7006
|
let z = T;
|
|
6984
|
-
E === "start" && v !== null ? z = Math.max(0, v) +
|
|
7007
|
+
E === "start" && v !== null ? z = Math.max(0, v) + U / 2 : E === "end" && S !== null && (z = Math.min(1, S) - U / 2), typeof z == "number" && (A[Qt] = z);
|
|
6985
7008
|
}
|
|
6986
7009
|
/**
|
|
6987
7010
|
* Возвращает ширину самой длинной строки текстового объекта.
|
|
@@ -7011,7 +7034,7 @@ class G {
|
|
|
7011
7034
|
baseHeight: s,
|
|
7012
7035
|
montageArea: o
|
|
7013
7036
|
}) {
|
|
7014
|
-
const i = t.toDatalessObject([...
|
|
7037
|
+
const i = t.toDatalessObject([...ke]);
|
|
7015
7038
|
if (G._isSvgObject(t)) {
|
|
7016
7039
|
const w = G._extractSvgMarkup(t);
|
|
7017
7040
|
w && (i.svgMarkup = w, delete i.objects, delete i.path);
|
|
@@ -7022,7 +7045,7 @@ class G {
|
|
|
7022
7045
|
top: r,
|
|
7023
7046
|
width: c,
|
|
7024
7047
|
height: l
|
|
7025
|
-
} = e, d = t.getBoundingRect(!1, !0), u = n || c || 1, f = s || l || 1, p =
|
|
7048
|
+
} = e, d = t.getBoundingRect(!1, !0), u = n || c || 1, f = s || l || 1, p = Ws({
|
|
7026
7049
|
object: t,
|
|
7027
7050
|
montageArea: o,
|
|
7028
7051
|
bounds: e
|
|
@@ -7358,19 +7381,19 @@ const Ee = 5, An = "#3D8BF4", Ne = 1, ot = 2, jn = ({
|
|
|
7358
7381
|
if (g && y) {
|
|
7359
7382
|
const { bounds: v } = g, { bounds: S } = y, { bottom: M } = v, { top: I } = S, L = I - M - f;
|
|
7360
7383
|
if (L >= 0) {
|
|
7361
|
-
const
|
|
7362
|
-
if (vt({ value:
|
|
7363
|
-
const j = Ze({ value:
|
|
7384
|
+
const U = L / 2;
|
|
7385
|
+
if (vt({ value: U, step: ot })) {
|
|
7386
|
+
const j = Ze({ value: U, step: ot }), R = o - M, N = I - i, x = Math.abs(R - j), B = Math.abs(N - j), _ = Math.max(x, B);
|
|
7364
7387
|
if (_ <= e) {
|
|
7365
|
-
const D = j -
|
|
7388
|
+
const D = j - R;
|
|
7366
7389
|
if (vt({ value: D, step: ot })) {
|
|
7367
|
-
const
|
|
7390
|
+
const k = i + D, V = {
|
|
7368
7391
|
type: "vertical",
|
|
7369
7392
|
axis: s,
|
|
7370
7393
|
refStart: M,
|
|
7371
7394
|
refEnd: M + j,
|
|
7372
|
-
activeStart:
|
|
7373
|
-
activeEnd:
|
|
7395
|
+
activeStart: k,
|
|
7396
|
+
activeEnd: k + j,
|
|
7374
7397
|
distance: j
|
|
7375
7398
|
};
|
|
7376
7399
|
u.push({ delta: D, guide: V, diff: _ });
|
|
@@ -7495,19 +7518,19 @@ const Ee = 5, An = "#3D8BF4", Ne = 1, ot = 2, jn = ({
|
|
|
7495
7518
|
if (g && y) {
|
|
7496
7519
|
const { bounds: v } = g, { bounds: S } = y, { right: M } = v, { left: I } = S, L = I - M - f;
|
|
7497
7520
|
if (L >= 0) {
|
|
7498
|
-
const
|
|
7499
|
-
if (vt({ value:
|
|
7500
|
-
const j = Ze({ value:
|
|
7521
|
+
const U = L / 2;
|
|
7522
|
+
if (vt({ value: U, step: ot })) {
|
|
7523
|
+
const j = Ze({ value: U, step: ot }), R = o - M, N = I - i, x = Math.abs(R - j), B = Math.abs(N - j), _ = Math.max(x, B);
|
|
7501
7524
|
if (_ <= e) {
|
|
7502
|
-
const D = j -
|
|
7525
|
+
const D = j - R;
|
|
7503
7526
|
if (vt({ value: D, step: ot })) {
|
|
7504
|
-
const
|
|
7527
|
+
const k = i + D, V = {
|
|
7505
7528
|
type: "horizontal",
|
|
7506
7529
|
axis: s,
|
|
7507
7530
|
refStart: M,
|
|
7508
7531
|
refEnd: M + j,
|
|
7509
|
-
activeStart:
|
|
7510
|
-
activeEnd:
|
|
7532
|
+
activeStart: k,
|
|
7533
|
+
activeEnd: k + j,
|
|
7511
7534
|
distance: j
|
|
7512
7535
|
};
|
|
7513
7536
|
u.push({ delta: D, guide: V, diff: _ });
|
|
@@ -7901,13 +7924,13 @@ class $ {
|
|
|
7901
7924
|
anchors: d,
|
|
7902
7925
|
candidates: S,
|
|
7903
7926
|
threshold: m
|
|
7904
|
-
}), { guidePosition: O } = M, { guidePosition: L } = I,
|
|
7905
|
-
if (!
|
|
7927
|
+
}), { guidePosition: O } = M, { guidePosition: L } = I, U = O !== null, z = L !== null;
|
|
7928
|
+
if (!U && !z) {
|
|
7906
7929
|
this._clearGuides();
|
|
7907
7930
|
return;
|
|
7908
7931
|
}
|
|
7909
7932
|
const j = [];
|
|
7910
|
-
let
|
|
7933
|
+
let R = null, N = null;
|
|
7911
7934
|
if (r) {
|
|
7912
7935
|
const B = $._resolveUniformScale({
|
|
7913
7936
|
bounds: u,
|
|
@@ -7918,12 +7941,12 @@ class $ {
|
|
|
7918
7941
|
});
|
|
7919
7942
|
if (B) {
|
|
7920
7943
|
const { scaleFactor: _, guide: D } = B;
|
|
7921
|
-
|
|
7944
|
+
R = w * _, N = T * _, j.push(D);
|
|
7922
7945
|
}
|
|
7923
7946
|
}
|
|
7924
7947
|
if (!r) {
|
|
7925
|
-
const { angle: B = 0 } = e, { width: _, height: D } = $._resolveBaseDimensions({ target: e }), P = Math.abs(w) || 1,
|
|
7926
|
-
if (
|
|
7948
|
+
const { angle: B = 0 } = e, { width: _, height: D } = $._resolveBaseDimensions({ target: e }), P = Math.abs(w) || 1, k = Math.abs(T) || 1;
|
|
7949
|
+
if (U) {
|
|
7927
7950
|
const V = $._resolveDesiredWidth({
|
|
7928
7951
|
bounds: u,
|
|
7929
7952
|
originX: E,
|
|
@@ -7934,12 +7957,12 @@ class $ {
|
|
|
7934
7957
|
desiredWidth: V,
|
|
7935
7958
|
baseWidth: _,
|
|
7936
7959
|
baseHeight: D,
|
|
7937
|
-
scaleY:
|
|
7960
|
+
scaleY: k,
|
|
7938
7961
|
angle: B
|
|
7939
7962
|
});
|
|
7940
7963
|
if (H !== null) {
|
|
7941
7964
|
const q = w < 0 ? -1 : 1;
|
|
7942
|
-
|
|
7965
|
+
R = H * q, O !== null && j.push({
|
|
7943
7966
|
type: "vertical",
|
|
7944
7967
|
position: O
|
|
7945
7968
|
});
|
|
@@ -7970,14 +7993,14 @@ class $ {
|
|
|
7970
7993
|
}
|
|
7971
7994
|
}
|
|
7972
7995
|
}
|
|
7973
|
-
const x =
|
|
7996
|
+
const x = R !== null || N !== null;
|
|
7974
7997
|
if (!x && !j.length) {
|
|
7975
7998
|
this._clearGuides();
|
|
7976
7999
|
return;
|
|
7977
8000
|
}
|
|
7978
8001
|
if (x) {
|
|
7979
8002
|
const B = e.getRelativeCenterPoint(), _ = e.translateToOriginPoint(B, E, C), D = {};
|
|
7980
|
-
|
|
8003
|
+
R !== null && (D.scaleX = R, s.scaleX = R), N !== null && (D.scaleY = N, s.scaleY = N), Object.keys(D).length && (e.set(D), e.setPositionByOrigin(_, E, C), e.setCoords());
|
|
7981
8004
|
}
|
|
7982
8005
|
this._applyGuides({
|
|
7983
8006
|
guides: j,
|
|
@@ -8433,7 +8456,7 @@ class $ {
|
|
|
8433
8456
|
}
|
|
8434
8457
|
}
|
|
8435
8458
|
const Mn = "#3D8BF4", Sn = 1;
|
|
8436
|
-
class
|
|
8459
|
+
class Wt {
|
|
8437
8460
|
/**
|
|
8438
8461
|
* Создаёт менеджер измерений и инициализирует события.
|
|
8439
8462
|
*/
|
|
@@ -8543,7 +8566,7 @@ class Ut {
|
|
|
8543
8566
|
this._clearGuides();
|
|
8544
8567
|
return;
|
|
8545
8568
|
}
|
|
8546
|
-
const i =
|
|
8569
|
+
const i = Wt._resolveTarget({
|
|
8547
8570
|
event: t,
|
|
8548
8571
|
activeObject: s
|
|
8549
8572
|
}), { montageArea: a } = n, r = i != null ? i : a, c = r === a, l = yt({ object: r });
|
|
@@ -8555,7 +8578,7 @@ class Ut {
|
|
|
8555
8578
|
this._clearGuides();
|
|
8556
8579
|
return;
|
|
8557
8580
|
}
|
|
8558
|
-
const u =
|
|
8581
|
+
const u = Wt._buildGuides({
|
|
8559
8582
|
activeBounds: o,
|
|
8560
8583
|
targetBounds: l,
|
|
8561
8584
|
targetIsMontageArea: c
|
|
@@ -8584,11 +8607,11 @@ class Ut {
|
|
|
8584
8607
|
targetBounds: e,
|
|
8585
8608
|
targetIsMontageArea: n
|
|
8586
8609
|
}) {
|
|
8587
|
-
const s =
|
|
8610
|
+
const s = Wt._buildHorizontalGuides({
|
|
8588
8611
|
activeBounds: t,
|
|
8589
8612
|
targetBounds: e,
|
|
8590
8613
|
targetIsMontageArea: n
|
|
8591
|
-
}), o =
|
|
8614
|
+
}), o = Wt._buildVerticalGuides({
|
|
8592
8615
|
activeBounds: t,
|
|
8593
8616
|
targetBounds: e,
|
|
8594
8617
|
targetIsMontageArea: n
|
|
@@ -8810,7 +8833,7 @@ class Ge {
|
|
|
8810
8833
|
showRotationAngle: l,
|
|
8811
8834
|
_onReadyCallback: d
|
|
8812
8835
|
} = this.options;
|
|
8813
|
-
if (ut.apply(), this.canvas = new zn(this.containerId, this.options), this.moduleLoader = new Hn(), this.workerManager = new Gn(), this.errorManager = new ne({ editor: this }), this.historyManager = new J({ editor: this }), this.toolbar = new cs({ editor: this }), this.transformManager = new vs({ editor: this }), this.zoomManager = new bs({ editor: this }), this.canvasManager = new ys({ editor: this }), this.imageManager = new pt({ editor: this }), this.layerManager = new ye({ editor: this }), this.shapeManager = new Ss({ editor: this }), this.interactionBlocker = new Ms({ editor: this }), this.backgroundManager = new
|
|
8836
|
+
if (ut.apply(), this.canvas = new zn(this.containerId, this.options), this.moduleLoader = new Hn(), this.workerManager = new Gn(), this.errorManager = new ne({ editor: this }), this.historyManager = new J({ editor: this }), this.toolbar = new cs({ editor: this }), this.transformManager = new vs({ editor: this }), this.zoomManager = new bs({ editor: this }), this.canvasManager = new ys({ editor: this }), this.imageManager = new pt({ editor: this }), this.layerManager = new ye({ editor: this }), this.shapeManager = new Ss({ editor: this }), this.interactionBlocker = new Ms({ editor: this }), this.backgroundManager = new Ut({ editor: this }), this.clipboardManager = new ws({ editor: this }), this.objectLockManager = new ve({ editor: this }), this.groupingManager = new As({ editor: this }), this.selectionManager = new ft({ editor: this }), this.deletionManager = new He({ editor: this }), this.panConstraintManager = new js({ editor: this }), this.snappingManager = new $({ editor: this }), this.measurementManager = new Wt({ editor: this }), this.fontManager = new xe((u = this.options.fonts) != null ? u : []), this.textManager = new rt({ editor: this }), this.templateManager = new G({ editor: this }), l && (this.angleIndicator = new Ye({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new ze({ 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(), r) {
|
|
8814
8837
|
this.historyManager.suspendHistory();
|
|
8815
8838
|
try {
|
|
8816
8839
|
const m = yield this.imageManager.prepareInitialState({
|
|
@@ -8923,7 +8946,7 @@ class Ge {
|
|
|
8923
8946
|
});
|
|
8924
8947
|
}
|
|
8925
8948
|
}
|
|
8926
|
-
const
|
|
8949
|
+
const W = [
|
|
8927
8950
|
"U+0000-00FF",
|
|
8928
8951
|
"U+0100-02BA",
|
|
8929
8952
|
"U+02BB-02BC",
|
|
@@ -8989,7 +9012,7 @@ const U = [
|
|
|
8989
9012
|
style: "normal",
|
|
8990
9013
|
weight: "400",
|
|
8991
9014
|
display: "swap",
|
|
8992
|
-
unicodeRange:
|
|
9015
|
+
unicodeRange: W
|
|
8993
9016
|
}
|
|
8994
9017
|
},
|
|
8995
9018
|
{
|
|
@@ -9009,7 +9032,7 @@ const U = [
|
|
|
9009
9032
|
style: "normal",
|
|
9010
9033
|
weight: "700",
|
|
9011
9034
|
display: "swap",
|
|
9012
|
-
unicodeRange:
|
|
9035
|
+
unicodeRange: W
|
|
9013
9036
|
}
|
|
9014
9037
|
},
|
|
9015
9038
|
{
|
|
@@ -9029,7 +9052,7 @@ const U = [
|
|
|
9029
9052
|
style: "normal",
|
|
9030
9053
|
weight: "200 700",
|
|
9031
9054
|
display: "swap",
|
|
9032
|
-
unicodeRange:
|
|
9055
|
+
unicodeRange: W
|
|
9033
9056
|
}
|
|
9034
9057
|
},
|
|
9035
9058
|
{
|
|
@@ -9049,7 +9072,7 @@ const U = [
|
|
|
9049
9072
|
style: "normal",
|
|
9050
9073
|
weight: "300 900",
|
|
9051
9074
|
display: "swap",
|
|
9052
|
-
unicodeRange:
|
|
9075
|
+
unicodeRange: W
|
|
9053
9076
|
}
|
|
9054
9077
|
},
|
|
9055
9078
|
{
|
|
@@ -9069,7 +9092,7 @@ const U = [
|
|
|
9069
9092
|
style: "normal",
|
|
9070
9093
|
weight: "400 700",
|
|
9071
9094
|
display: "swap",
|
|
9072
|
-
unicodeRange:
|
|
9095
|
+
unicodeRange: W
|
|
9073
9096
|
}
|
|
9074
9097
|
},
|
|
9075
9098
|
{
|
|
@@ -9089,7 +9112,7 @@ const U = [
|
|
|
9089
9112
|
style: "normal",
|
|
9090
9113
|
weight: "300 700",
|
|
9091
9114
|
display: "swap",
|
|
9092
|
-
unicodeRange:
|
|
9115
|
+
unicodeRange: W
|
|
9093
9116
|
}
|
|
9094
9117
|
},
|
|
9095
9118
|
{
|
|
@@ -9109,7 +9132,7 @@ const U = [
|
|
|
9109
9132
|
style: "normal",
|
|
9110
9133
|
weight: "300 700",
|
|
9111
9134
|
display: "swap",
|
|
9112
|
-
unicodeRange:
|
|
9135
|
+
unicodeRange: W
|
|
9113
9136
|
}
|
|
9114
9137
|
},
|
|
9115
9138
|
{
|
|
@@ -9129,7 +9152,7 @@ const U = [
|
|
|
9129
9152
|
style: "normal",
|
|
9130
9153
|
weight: "400",
|
|
9131
9154
|
display: "swap",
|
|
9132
|
-
unicodeRange:
|
|
9155
|
+
unicodeRange: W
|
|
9133
9156
|
}
|
|
9134
9157
|
},
|
|
9135
9158
|
{
|
|
@@ -9149,7 +9172,7 @@ const U = [
|
|
|
9149
9172
|
style: "normal",
|
|
9150
9173
|
weight: "400 700",
|
|
9151
9174
|
display: "swap",
|
|
9152
|
-
unicodeRange:
|
|
9175
|
+
unicodeRange: W
|
|
9153
9176
|
}
|
|
9154
9177
|
},
|
|
9155
9178
|
{
|
|
@@ -9169,7 +9192,7 @@ const U = [
|
|
|
9169
9192
|
style: "normal",
|
|
9170
9193
|
weight: "100 900",
|
|
9171
9194
|
display: "swap",
|
|
9172
|
-
unicodeRange:
|
|
9195
|
+
unicodeRange: W
|
|
9173
9196
|
}
|
|
9174
9197
|
},
|
|
9175
9198
|
{
|
|
@@ -9189,7 +9212,7 @@ const U = [
|
|
|
9189
9212
|
style: "normal",
|
|
9190
9213
|
weight: "400",
|
|
9191
9214
|
display: "swap",
|
|
9192
|
-
unicodeRange:
|
|
9215
|
+
unicodeRange: W
|
|
9193
9216
|
}
|
|
9194
9217
|
},
|
|
9195
9218
|
{
|
|
@@ -9209,7 +9232,7 @@ const U = [
|
|
|
9209
9232
|
style: "normal",
|
|
9210
9233
|
weight: "700",
|
|
9211
9234
|
display: "swap",
|
|
9212
|
-
unicodeRange:
|
|
9235
|
+
unicodeRange: W
|
|
9213
9236
|
}
|
|
9214
9237
|
},
|
|
9215
9238
|
{
|
|
@@ -9229,7 +9252,7 @@ const U = [
|
|
|
9229
9252
|
style: "normal",
|
|
9230
9253
|
weight: "400 700",
|
|
9231
9254
|
display: "swap",
|
|
9232
|
-
unicodeRange:
|
|
9255
|
+
unicodeRange: W
|
|
9233
9256
|
}
|
|
9234
9257
|
},
|
|
9235
9258
|
{
|
|
@@ -9249,7 +9272,7 @@ const U = [
|
|
|
9249
9272
|
style: "normal",
|
|
9250
9273
|
weight: "100 900",
|
|
9251
9274
|
display: "swap",
|
|
9252
|
-
unicodeRange:
|
|
9275
|
+
unicodeRange: W
|
|
9253
9276
|
}
|
|
9254
9277
|
},
|
|
9255
9278
|
{
|
|
@@ -9269,7 +9292,7 @@ const U = [
|
|
|
9269
9292
|
style: "normal",
|
|
9270
9293
|
weight: "100",
|
|
9271
9294
|
display: "swap",
|
|
9272
|
-
unicodeRange:
|
|
9295
|
+
unicodeRange: W
|
|
9273
9296
|
}
|
|
9274
9297
|
},
|
|
9275
9298
|
{
|
|
@@ -9289,7 +9312,7 @@ const U = [
|
|
|
9289
9312
|
style: "normal",
|
|
9290
9313
|
weight: "200",
|
|
9291
9314
|
display: "swap",
|
|
9292
|
-
unicodeRange:
|
|
9315
|
+
unicodeRange: W
|
|
9293
9316
|
}
|
|
9294
9317
|
},
|
|
9295
9318
|
{
|
|
@@ -9309,7 +9332,7 @@ const U = [
|
|
|
9309
9332
|
style: "normal",
|
|
9310
9333
|
weight: "300",
|
|
9311
9334
|
display: "swap",
|
|
9312
|
-
unicodeRange:
|
|
9335
|
+
unicodeRange: W
|
|
9313
9336
|
}
|
|
9314
9337
|
},
|
|
9315
9338
|
{
|
|
@@ -9329,7 +9352,7 @@ const U = [
|
|
|
9329
9352
|
style: "normal",
|
|
9330
9353
|
weight: "400",
|
|
9331
9354
|
display: "swap",
|
|
9332
|
-
unicodeRange:
|
|
9355
|
+
unicodeRange: W
|
|
9333
9356
|
}
|
|
9334
9357
|
},
|
|
9335
9358
|
{
|
|
@@ -9349,7 +9372,7 @@ const U = [
|
|
|
9349
9372
|
style: "normal",
|
|
9350
9373
|
weight: "500",
|
|
9351
9374
|
display: "swap",
|
|
9352
|
-
unicodeRange:
|
|
9375
|
+
unicodeRange: W
|
|
9353
9376
|
}
|
|
9354
9377
|
},
|
|
9355
9378
|
{
|
|
@@ -9369,7 +9392,7 @@ const U = [
|
|
|
9369
9392
|
style: "normal",
|
|
9370
9393
|
weight: "600",
|
|
9371
9394
|
display: "swap",
|
|
9372
|
-
unicodeRange:
|
|
9395
|
+
unicodeRange: W
|
|
9373
9396
|
}
|
|
9374
9397
|
},
|
|
9375
9398
|
{
|
|
@@ -9389,7 +9412,7 @@ const U = [
|
|
|
9389
9412
|
style: "normal",
|
|
9390
9413
|
weight: "700",
|
|
9391
9414
|
display: "swap",
|
|
9392
|
-
unicodeRange:
|
|
9415
|
+
unicodeRange: W
|
|
9393
9416
|
}
|
|
9394
9417
|
},
|
|
9395
9418
|
{
|
|
@@ -9409,7 +9432,7 @@ const U = [
|
|
|
9409
9432
|
style: "normal",
|
|
9410
9433
|
weight: "800",
|
|
9411
9434
|
display: "swap",
|
|
9412
|
-
unicodeRange:
|
|
9435
|
+
unicodeRange: W
|
|
9413
9436
|
}
|
|
9414
9437
|
},
|
|
9415
9438
|
{
|
|
@@ -9429,7 +9452,7 @@ const U = [
|
|
|
9429
9452
|
style: "normal",
|
|
9430
9453
|
weight: "900",
|
|
9431
9454
|
display: "swap",
|
|
9432
|
-
unicodeRange:
|
|
9455
|
+
unicodeRange: W
|
|
9433
9456
|
}
|
|
9434
9457
|
},
|
|
9435
9458
|
{
|
|
@@ -9449,7 +9472,7 @@ const U = [
|
|
|
9449
9472
|
style: "normal",
|
|
9450
9473
|
weight: "400",
|
|
9451
9474
|
display: "swap",
|
|
9452
|
-
unicodeRange:
|
|
9475
|
+
unicodeRange: W
|
|
9453
9476
|
}
|
|
9454
9477
|
},
|
|
9455
9478
|
{
|
|
@@ -9469,7 +9492,7 @@ const U = [
|
|
|
9469
9492
|
style: "normal",
|
|
9470
9493
|
weight: "700",
|
|
9471
9494
|
display: "swap",
|
|
9472
|
-
unicodeRange:
|
|
9495
|
+
unicodeRange: W
|
|
9473
9496
|
}
|
|
9474
9497
|
},
|
|
9475
9498
|
{
|
|
@@ -9489,7 +9512,7 @@ const U = [
|
|
|
9489
9512
|
style: "normal",
|
|
9490
9513
|
weight: "100 900",
|
|
9491
9514
|
display: "swap",
|
|
9492
|
-
unicodeRange:
|
|
9515
|
+
unicodeRange: W
|
|
9493
9516
|
}
|
|
9494
9517
|
},
|
|
9495
9518
|
{
|
|
@@ -9509,7 +9532,7 @@ const U = [
|
|
|
9509
9532
|
style: "normal",
|
|
9510
9533
|
weight: "300 700",
|
|
9511
9534
|
display: "swap",
|
|
9512
|
-
unicodeRange:
|
|
9535
|
+
unicodeRange: W
|
|
9513
9536
|
}
|
|
9514
9537
|
},
|
|
9515
9538
|
{
|
|
@@ -9529,7 +9552,7 @@ const U = [
|
|
|
9529
9552
|
style: "normal",
|
|
9530
9553
|
weight: "400",
|
|
9531
9554
|
display: "swap",
|
|
9532
|
-
unicodeRange:
|
|
9555
|
+
unicodeRange: W
|
|
9533
9556
|
}
|
|
9534
9557
|
},
|
|
9535
9558
|
{
|
|
@@ -9549,7 +9572,7 @@ const U = [
|
|
|
9549
9572
|
style: "normal",
|
|
9550
9573
|
weight: "200 800",
|
|
9551
9574
|
display: "swap",
|
|
9552
|
-
unicodeRange:
|
|
9575
|
+
unicodeRange: W
|
|
9553
9576
|
}
|
|
9554
9577
|
},
|
|
9555
9578
|
{
|
|
@@ -9569,7 +9592,7 @@ const U = [
|
|
|
9569
9592
|
style: "normal",
|
|
9570
9593
|
weight: "100 900",
|
|
9571
9594
|
display: "swap",
|
|
9572
|
-
unicodeRange:
|
|
9595
|
+
unicodeRange: W
|
|
9573
9596
|
}
|
|
9574
9597
|
},
|
|
9575
9598
|
{
|
|
@@ -9589,7 +9612,7 @@ const U = [
|
|
|
9589
9612
|
style: "normal",
|
|
9590
9613
|
weight: "400",
|
|
9591
9614
|
display: "swap",
|
|
9592
|
-
unicodeRange:
|
|
9615
|
+
unicodeRange: W
|
|
9593
9616
|
}
|
|
9594
9617
|
},
|
|
9595
9618
|
{
|
|
@@ -9609,7 +9632,7 @@ const U = [
|
|
|
9609
9632
|
style: "normal",
|
|
9610
9633
|
weight: "100 900",
|
|
9611
9634
|
display: "swap",
|
|
9612
|
-
unicodeRange:
|
|
9635
|
+
unicodeRange: W
|
|
9613
9636
|
}
|
|
9614
9637
|
},
|
|
9615
9638
|
{
|
|
@@ -9629,7 +9652,7 @@ const U = [
|
|
|
9629
9652
|
style: "normal",
|
|
9630
9653
|
weight: "300 800",
|
|
9631
9654
|
display: "swap",
|
|
9632
|
-
unicodeRange:
|
|
9655
|
+
unicodeRange: W
|
|
9633
9656
|
}
|
|
9634
9657
|
},
|
|
9635
9658
|
{
|
|
@@ -9649,7 +9672,7 @@ const U = [
|
|
|
9649
9672
|
style: "normal",
|
|
9650
9673
|
weight: "400",
|
|
9651
9674
|
display: "swap",
|
|
9652
|
-
unicodeRange:
|
|
9675
|
+
unicodeRange: W
|
|
9653
9676
|
}
|
|
9654
9677
|
},
|
|
9655
9678
|
{
|
|
@@ -9669,7 +9692,7 @@ const U = [
|
|
|
9669
9692
|
style: "normal",
|
|
9670
9693
|
weight: "700",
|
|
9671
9694
|
display: "swap",
|
|
9672
|
-
unicodeRange:
|
|
9695
|
+
unicodeRange: W
|
|
9673
9696
|
}
|
|
9674
9697
|
},
|
|
9675
9698
|
{
|
|
@@ -9689,7 +9712,7 @@ const U = [
|
|
|
9689
9712
|
style: "normal",
|
|
9690
9713
|
weight: "300 900",
|
|
9691
9714
|
display: "swap",
|
|
9692
|
-
unicodeRange:
|
|
9715
|
+
unicodeRange: W
|
|
9693
9716
|
}
|
|
9694
9717
|
},
|
|
9695
9718
|
{
|
|
@@ -9709,7 +9732,7 @@ const U = [
|
|
|
9709
9732
|
style: "normal",
|
|
9710
9733
|
weight: "400",
|
|
9711
9734
|
display: "swap",
|
|
9712
|
-
unicodeRange:
|
|
9735
|
+
unicodeRange: W
|
|
9713
9736
|
}
|
|
9714
9737
|
},
|
|
9715
9738
|
{
|
|
@@ -9729,7 +9752,7 @@ const U = [
|
|
|
9729
9752
|
style: "normal",
|
|
9730
9753
|
weight: "100 900",
|
|
9731
9754
|
display: "swap",
|
|
9732
|
-
unicodeRange:
|
|
9755
|
+
unicodeRange: W
|
|
9733
9756
|
}
|
|
9734
9757
|
},
|
|
9735
9758
|
{
|
|
@@ -9749,7 +9772,7 @@ const U = [
|
|
|
9749
9772
|
style: "normal",
|
|
9750
9773
|
weight: "100 900",
|
|
9751
9774
|
display: "swap",
|
|
9752
|
-
unicodeRange:
|
|
9775
|
+
unicodeRange: W
|
|
9753
9776
|
}
|
|
9754
9777
|
}
|
|
9755
9778
|
], ti = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anu3ev/fabric-image-editor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
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": [
|