@anu3ev/fabric-image-editor 0.1.33 → 0.1.35

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 CHANGED
@@ -1,15 +1,24 @@
1
- var Oe = Object.defineProperty;
2
- var ge = Object.getOwnPropertySymbols;
3
- var Te = Object.prototype.hasOwnProperty, ke = Object.prototype.propertyIsEnumerable;
4
- var ve = (o, e, t) => e in o ? Oe(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, X = (o, e) => {
1
+ var Te = Object.defineProperty;
2
+ var G = Object.getOwnPropertySymbols;
3
+ var Me = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
4
+ var me = (o, e, t) => e in o ? Te(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, T = (o, e) => {
5
5
  for (var t in e || (e = {}))
6
- Te.call(e, t) && ve(o, t, e[t]);
7
- if (ge)
8
- for (var t of ge(e))
9
- ke.call(e, t) && ve(o, t, e[t]);
6
+ Me.call(e, t) && me(o, t, e[t]);
7
+ if (G)
8
+ for (var t of G(e))
9
+ fe.call(e, t) && me(o, t, e[t]);
10
10
  return o;
11
11
  };
12
- var Q = (o, e, t) => new Promise((a, r) => {
12
+ var X = (o, e) => {
13
+ var t = {};
14
+ for (var a in o)
15
+ Me.call(o, a) && e.indexOf(a) < 0 && (t[a] = o[a]);
16
+ if (o != null && G)
17
+ for (var a of G(o))
18
+ e.indexOf(a) < 0 && fe.call(o, a) && (t[a] = o[a]);
19
+ return t;
20
+ };
21
+ var $ = (o, e, t) => new Promise((a, r) => {
13
22
  var i = (c) => {
14
23
  try {
15
24
  s(t.next(c));
@@ -25,14 +34,14 @@ var Q = (o, e, t) => new Promise((a, r) => {
25
34
  }, s = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(i, n);
26
35
  s((t = t.apply(o, e)).next());
27
36
  });
28
- import { ActiveSelection as Y, util as P, controlsUtils as xe, InteractiveFabricObject as Be, loadSVGFromURL as Ze, FabricImage as me, Point as ze, Rect as Ue, Circle as Ye, Triangle as Pe, Group as He, Canvas as _e, Pattern as Re } from "fabric";
29
- import { create as We } from "jsondiffpatch";
30
- var Fe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", w = function() {
37
+ import { ActiveSelection as R, util as W, controlsUtils as Oe, InteractiveFabricObject as ke, loadSVGFromURL as xe, FabricImage as q, Point as Be, Rect as Ze, Circle as ze, Triangle as Ue, Group as Ye, Canvas as He, Pattern as Pe } from "fabric";
38
+ import { create as Re } from "jsondiffpatch";
39
+ var We = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", C = function() {
31
40
  for (var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21, t = "", a = crypto.getRandomValues(new Uint8Array(e |= 0)); e--; )
32
- t += Fe[a[e] & 63];
41
+ t += We[a[e] & 63];
33
42
  return t;
34
43
  };
35
- class U {
44
+ class P {
36
45
  /**
37
46
  * Конструктор принимает редактор и опции.
38
47
  * @param {Object} params
@@ -49,7 +58,7 @@ class U {
49
58
  * @param {Boolean} [params.options.resetObjectFitByDoubleClick] — сброс фита объекта по двойному клику
50
59
  */
51
60
  constructor({ editor: e, options: t = {} }) {
52
- this.isDragging = !1, this.lastMouseX = 0, this.lastMouseY = 0, this.isUndoRedoKeyPressed = !1, this.isSpacePressed = !1, this.canvasDragging = !1, this.mouseWheelZooming = !1, this.bringToFrontOnSelection = !1, this.resetObjectFitByDoubleClick = !1, this.copyObjectsByHotkey = !1, this.pasteImageFromClipboard = !1, this.undoRedoByHotKeys = !1, this.selectAllByHotkey = !1, this.deleteObjectsByHotkey = !1, this.adaptCanvasToContainer = !1, this.editor = e, this.canvas = e.canvas, this.options = t, this.handleAdaptCanvasToContainerBound = U.debounce(this.handleAdaptCanvasToContainer.bind(this), 500), this.handleCopyEventBound = this.handleCopyEvent.bind(this), this.handlePasteEventBound = this.handlePasteEvent.bind(this), this.handleUndoRedoEventBound = this.handleUndoRedoEvent.bind(this), this.handleUndoRedoKeyUpBound = this.handleUndoRedoKeyUp.bind(this), this.handleSelectAllEventBound = this.handleSelectAllEvent.bind(this), this.handleDeleteObjectsEventBound = this.handleDeleteObjectsEvent.bind(this), this.handleSpaceKeyDownBound = this.handleSpaceKeyDown.bind(this), this.handleSpaceKeyUpBound = this.handleSpaceKeyUp.bind(this), this.handleObjectModifiedHistoryBound = U.debounce(this.handleObjectModifiedHistory.bind(this), 300), this.handleObjectRotatingHistoryBound = U.debounce(this.handleObjectRotatingHistory.bind(this), 300), this.handleObjectAddedHistoryBound = this.handleObjectAddedHistory.bind(this), this.handleObjectRemovedHistoryBound = this.handleObjectRemovedHistory.bind(this), this.handleOverlayUpdateBound = this.handleOverlayUpdate.bind(this), this.handleCanvasDragStartBound = this.handleCanvasDragStart.bind(this), this.handleCanvasDraggingBound = this.handleCanvasDragging.bind(this), this.handleCanvasDragEndBound = this.handleCanvasDragEnd.bind(this), this.handleMouseWheelZoomBound = this.handleMouseWheelZoom.bind(this), this.handleBringToFrontBound = this.handleBringToFront.bind(this), this.handleResetObjectFitBound = this.handleResetObjectFit.bind(this), this.handleLockedSelectionBound = this._filterLockedSelection.bind(this), this.init();
61
+ this.isDragging = !1, this.lastMouseX = 0, this.lastMouseY = 0, this.isUndoRedoKeyPressed = !1, this.isSpacePressed = !1, this.canvasDragging = !1, this.mouseWheelZooming = !1, this.bringToFrontOnSelection = !1, this.resetObjectFitByDoubleClick = !1, this.copyObjectsByHotkey = !1, this.pasteImageFromClipboard = !1, this.undoRedoByHotKeys = !1, this.selectAllByHotkey = !1, this.deleteObjectsByHotkey = !1, this.adaptCanvasToContainer = !1, this.editor = e, this.canvas = e.canvas, this.options = t, this.handleAdaptCanvasToContainerBound = P.debounce(this.handleAdaptCanvasToContainer.bind(this), 500), this.handleCopyEventBound = this.handleCopyEvent.bind(this), this.handlePasteEventBound = this.handlePasteEvent.bind(this), this.handleUndoRedoEventBound = this.handleUndoRedoEvent.bind(this), this.handleUndoRedoKeyUpBound = this.handleUndoRedoKeyUp.bind(this), this.handleSelectAllEventBound = this.handleSelectAllEvent.bind(this), this.handleDeleteObjectsEventBound = this.handleDeleteObjectsEvent.bind(this), this.handleSpaceKeyDownBound = this.handleSpaceKeyDown.bind(this), this.handleSpaceKeyUpBound = this.handleSpaceKeyUp.bind(this), this.handleObjectModifiedHistoryBound = P.debounce(this.handleObjectModifiedHistory.bind(this), 300), this.handleObjectRotatingHistoryBound = P.debounce(this.handleObjectRotatingHistory.bind(this), 300), this.handleObjectAddedHistoryBound = this.handleObjectAddedHistory.bind(this), this.handleObjectRemovedHistoryBound = this.handleObjectRemovedHistory.bind(this), this.handleOverlayUpdateBound = this.handleOverlayUpdate.bind(this), this.handleCanvasDragStartBound = this.handleCanvasDragStart.bind(this), this.handleCanvasDraggingBound = this.handleCanvasDragging.bind(this), this.handleCanvasDragEndBound = this.handleCanvasDragEnd.bind(this), this.handleMouseWheelZoomBound = this.handleMouseWheelZoom.bind(this), this.handleBringToFrontBound = this.handleBringToFront.bind(this), this.handleResetObjectFitBound = this.handleResetObjectFit.bind(this), this.handleLockedSelectionBound = this._filterLockedSelection.bind(this), this.init();
53
62
  }
54
63
  /**
55
64
  * Инициализация всех обработчиков согласно опциям.
@@ -86,7 +95,7 @@ class U {
86
95
  this.canvas.setActiveObject(r[0]);
87
96
  return;
88
97
  }
89
- const i = new Y(r, {
98
+ const i = new R(r, {
90
99
  canvas: this.canvas
91
100
  });
92
101
  this.canvas.setActiveObject(i), this.canvas.requestRenderAll();
@@ -173,7 +182,7 @@ class U {
173
182
  * @param {String} event.code — код клавиши
174
183
  */
175
184
  handleUndoRedoEvent(e) {
176
- return Q(this, null, function* () {
185
+ return $(this, null, function* () {
177
186
  const { ctrlKey: t, metaKey: a, code: r, repeat: i } = e;
178
187
  !t && !a || i || this.isUndoRedoKeyPressed || (r === "KeyZ" ? (e.preventDefault(), this.isUndoRedoKeyPressed = !0, yield this.editor.historyManager.undo()) : r === "KeyY" && (e.preventDefault(), this.isUndoRedoKeyPressed = !0, yield this.editor.historyManager.redo()));
179
188
  });
@@ -320,7 +329,7 @@ class U {
320
329
  };
321
330
  }
322
331
  }
323
- class Ve {
332
+ class _e {
324
333
  /**
325
334
  * @description Класс для динамической загрузки внешних модулей.
326
335
  */
@@ -338,7 +347,7 @@ class Ve {
338
347
  return this.loaders[e] ? (this.cache.has(e) || this.cache.set(e, this.loaders[e]()), this.cache.get(e)) : Promise.reject(new Error('Unknown module "'.concat(e, '"')));
339
348
  }
340
349
  }
341
- class Ge {
350
+ class Fe {
342
351
  /**
343
352
  * @param {string|URL} [scriptUrl] — URL скрипта воркера.
344
353
  * По-умолчанию использует файл рядом с этим модулем
@@ -378,7 +387,7 @@ class Ge {
378
387
  * @returns {Promise<any>}
379
388
  */
380
389
  post(e, t) {
381
- var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], r = "".concat(e, ":").concat(w(8));
390
+ var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], r = "".concat(e, ":").concat(C(8));
382
391
  return new Promise((i, n) => {
383
392
  this._callbacks.set(r, {
384
393
  resolve: i,
@@ -397,50 +406,50 @@ class Ge {
397
406
  this.worker.terminate();
398
407
  }
399
408
  }
400
- var I = 12, Xe = 2, q = 8, ee = 20, Qe = 100, te = 20, ae = 8, Je = 100, re = 32, ie = 1, Ke = "#2B2D33", ne = "#3D8BF4", se = "#FFFFFF";
401
- function W(o, e, t, a, r) {
402
- var i = I, n = Xe;
403
- o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = se, o.strokeStyle = ne, o.lineWidth = ie, o.beginPath(), o.roundRect(-12 / 2, -12 / 2, i, i, n), o.fill(), o.stroke(), o.restore();
409
+ var I = 12, Ve = 2, te = 8, ae = 20, Ge = 100, re = 20, ie = 8, Xe = 100, ne = 32, se = 1, Qe = "#2B2D33", oe = "#3D8BF4", ce = "#FFFFFF";
410
+ function Q(o, e, t, a, r) {
411
+ var i = I, n = Ve;
412
+ o.save(), o.translate(e, t), o.rotate(W.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-12 / 2, -12 / 2, i, i, n), o.fill(), o.stroke(), o.restore();
404
413
  }
405
- function fe(o, e, t, a, r) {
406
- var i = q, n = ee, s = Qe;
407
- o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = se, o.strokeStyle = ne, o.lineWidth = ie, o.beginPath(), o.roundRect(-8 / 2, -20 / 2, i, n, s), o.fill(), o.stroke(), o.restore();
414
+ function je(o, e, t, a, r) {
415
+ var i = te, n = ae, s = Ge;
416
+ o.save(), o.translate(e, t), o.rotate(W.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-8 / 2, -20 / 2, i, n, s), o.fill(), o.stroke(), o.restore();
408
417
  }
409
- function Me(o, e, t, a, r) {
410
- var i = te, n = ae, s = Je;
411
- o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = se, o.strokeStyle = ne, o.lineWidth = ie, o.beginPath(), o.roundRect(-20 / 2, -8 / 2, i, n, s), o.fill(), o.stroke(), o.restore();
418
+ function ye(o, e, t, a, r) {
419
+ var i = re, n = ie, s = Xe;
420
+ o.save(), o.translate(e, t), o.rotate(W.degreesToRadians(r.angle)), o.fillStyle = ce, o.strokeStyle = oe, o.lineWidth = se, o.beginPath(), o.roundRect(-20 / 2, -8 / 2, i, n, s), o.fill(), o.stroke(), o.restore();
412
421
  }
413
- var $e = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", we = new Image();
414
- we.src = $e;
415
- function qe(o, e, t, a, r) {
416
- var i = re, n = i / 2;
417
- o.save(), o.translate(e, t), o.rotate(P.degreesToRadians(r.angle)), o.fillStyle = Ke, o.beginPath(), o.arc(0, 0, n, 0, 2 * Math.PI), o.fill(), o.drawImage(we, -16 / 2, -16 / 2, n, n), o.restore();
422
+ var Je = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", Ne = new Image();
423
+ Ne.src = Je;
424
+ function Ke(o, e, t, a, r) {
425
+ var i = ne, n = i / 2;
426
+ o.save(), o.translate(e, t), o.rotate(W.degreesToRadians(r.angle)), o.fillStyle = Qe, o.beginPath(), o.arc(0, 0, n, 0, 2 * Math.PI), o.fill(), o.drawImage(Ne, -16 / 2, -16 / 2, n, n), o.restore();
418
427
  }
419
- var et = {
428
+ var $e = {
420
429
  // Угловые точки
421
430
  tl: {
422
- render: W,
431
+ render: Q,
423
432
  sizeX: I,
424
433
  sizeY: I,
425
434
  offsetX: 0,
426
435
  offsetY: 0
427
436
  },
428
437
  tr: {
429
- render: W,
438
+ render: Q,
430
439
  sizeX: I,
431
440
  sizeY: I,
432
441
  offsetX: 0,
433
442
  offsetY: 0
434
443
  },
435
444
  bl: {
436
- render: W,
445
+ render: Q,
437
446
  sizeX: I,
438
447
  sizeY: I,
439
448
  offsetX: 0,
440
449
  offsetY: 0
441
450
  },
442
451
  br: {
443
- render: W,
452
+ render: Q,
444
453
  sizeX: I,
445
454
  sizeY: I,
446
455
  offsetX: 0,
@@ -448,47 +457,47 @@ var et = {
448
457
  },
449
458
  // Середина вертикалей
450
459
  ml: {
451
- render: fe,
452
- sizeX: q,
453
- sizeY: ee,
460
+ render: je,
461
+ sizeX: te,
462
+ sizeY: ae,
454
463
  offsetX: 0,
455
464
  offsetY: 0
456
465
  },
457
466
  mr: {
458
- render: fe,
459
- sizeX: q,
460
- sizeY: ee,
467
+ render: je,
468
+ sizeX: te,
469
+ sizeY: ae,
461
470
  offsetX: 0,
462
471
  offsetY: 0
463
472
  },
464
473
  // Середина горизонталей
465
474
  mt: {
466
- render: Me,
467
- sizeX: te,
468
- sizeY: ae,
475
+ render: ye,
476
+ sizeX: re,
477
+ sizeY: ie,
469
478
  offsetX: 0,
470
479
  offsetY: 0
471
480
  },
472
481
  mb: {
473
- render: Me,
474
- sizeX: te,
475
- sizeY: ae,
482
+ render: ye,
483
+ sizeX: re,
484
+ sizeY: ie,
476
485
  offsetX: 0,
477
486
  offsetY: 0
478
487
  },
479
488
  // Специальный «rotate» контрол
480
489
  mtr: {
481
- render: qe,
482
- sizeX: re,
483
- sizeY: re,
490
+ render: Ke,
491
+ sizeX: ne,
492
+ sizeY: ne,
484
493
  offsetX: 0,
485
494
  offsetY: -32
486
495
  }
487
496
  };
488
- class tt {
497
+ class qe {
489
498
  static apply() {
490
- var e = xe.createObjectDefaultControls();
491
- Object.entries(et).forEach((t) => {
499
+ var e = Oe.createObjectDefaultControls();
500
+ Object.entries($e).forEach((t) => {
492
501
  var [a, r] = t;
493
502
  Object.assign(e[a], {
494
503
  render: r.render,
@@ -497,11 +506,11 @@ class tt {
497
506
  offsetX: r.offsetX,
498
507
  offsetY: r.offsetY
499
508
  });
500
- }), Be.ownDefaults.controls = e;
509
+ }), ke.ownDefaults.controls = e;
501
510
  }
502
511
  }
503
- var at = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi44NzUgMi41YS42MjUuNjI1IDAgMCAwLS42MjUuNjI0VjYuMjVIMy4xMjVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2MTBjMCAuMzQ1LjI4LjYyNS42MjUuNjI1aDEwYy4zNDUgMCAuNjI1LS4yOC42MjUtLjYyNXYtMy4xMjZoMy4xMjVjLjM0NSAwIC42MjUtLjI4LjYyNS0uNjI1di0xMGEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTEwWm02Ljg3NSAxMGgyLjVWMy43NUg3LjV2Mi41aDUuNjI1Yy4zNDUgMCAuNjI1LjI4LjYyNS42MjV2NS42MjRabS0xMCAzLjc1VjcuNWg4Ljc1djguNzVIMy43NVoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==", rt = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy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jMC0uMzQ1LjI4LS42MjUuNjI1LS42MjVabTQuMzc1IDUuNjI1di01YS42MjUuNjI1IDAgMCAwLTEuMjUgMHY1YS42MjUuNjI1IDAgMSAwIDEuMjUgMFoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==";
513
+ function pe(o, e, t, a, r, i, n) {
505
514
  try {
506
515
  var s = o[i](n), c = s.value;
507
516
  } catch (u) {
@@ -509,22 +518,22 @@ function je(o, e, t, a, r, i, n) {
509
518
  }
510
519
  s.done ? e(c) : Promise.resolve(c).then(a, r);
511
520
  }
512
- function dt(o) {
521
+ function ct(o) {
513
522
  return function() {
514
523
  var e = this, t = arguments;
515
524
  return new Promise(function(a, r) {
516
525
  var i = o.apply(e, t);
517
526
  function n(c) {
518
- je(i, a, r, n, s, "next", c);
527
+ pe(i, a, r, n, s, "next", c);
519
528
  }
520
529
  function s(c) {
521
- je(i, a, r, n, s, "throw", c);
530
+ pe(i, a, r, n, s, "throw", c);
522
531
  }
523
532
  n(void 0);
524
533
  });
525
534
  };
526
535
  }
527
- const B = {
536
+ const H = {
528
537
  style: {
529
538
  position: "absolute",
530
539
  display: "none",
@@ -583,18 +592,18 @@ const B = {
583
592
  }],
584
593
  offsetTop: 50,
585
594
  icons: {
586
- copyPaste: at,
587
- delete: ut,
588
- lock: rt,
589
- unlock: it,
590
- bringToFront: ot,
591
- sendToBack: ct,
592
- bringForward: nt,
593
- sendBackwards: st
595
+ copyPaste: et,
596
+ delete: ot,
597
+ lock: tt,
598
+ unlock: at,
599
+ bringToFront: nt,
600
+ sendToBack: st,
601
+ bringForward: rt,
602
+ sendBackwards: it
594
603
  },
595
604
  handlers: {
596
605
  copyPaste: function() {
597
- var o = dt(function* (t) {
606
+ var o = ct(function* (t) {
598
607
  yield t.clipboardManager.copy(), yield t.clipboardManager.paste();
599
608
  });
600
609
  function e(t) {
@@ -625,7 +634,7 @@ const B = {
625
634
  }
626
635
  }
627
636
  };
628
- function ye(o, e) {
637
+ function be(o, e) {
629
638
  var t = Object.keys(o);
630
639
  if (Object.getOwnPropertySymbols) {
631
640
  var a = Object.getOwnPropertySymbols(o);
@@ -638,22 +647,22 @@ function ye(o, e) {
638
647
  function j(o) {
639
648
  for (var e = 1; e < arguments.length; e++) {
640
649
  var t = arguments[e] != null ? arguments[e] : {};
641
- e % 2 ? ye(Object(t), !0).forEach(function(a) {
642
- lt(o, a, t[a]);
643
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : ye(Object(t)).forEach(function(a) {
650
+ e % 2 ? be(Object(t), !0).forEach(function(a) {
651
+ ut(o, a, t[a]);
652
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : be(Object(t)).forEach(function(a) {
644
653
  Object.defineProperty(o, a, Object.getOwnPropertyDescriptor(t, a));
645
654
  });
646
655
  }
647
656
  return o;
648
657
  }
649
- function lt(o, e, t) {
650
- return (e = ht(e)) in o ? Object.defineProperty(o, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : o[e] = t, o;
658
+ function ut(o, e, t) {
659
+ return (e = dt(e)) in o ? Object.defineProperty(o, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : o[e] = t, o;
651
660
  }
652
- function ht(o) {
653
- var e = gt(o, "string");
661
+ function dt(o) {
662
+ var e = lt(o, "string");
654
663
  return typeof e == "symbol" ? e : e + "";
655
664
  }
656
- function gt(o, e) {
665
+ function lt(o, e) {
657
666
  if (typeof o != "object" || !o) return o;
658
667
  var t = o[Symbol.toPrimitive];
659
668
  if (t !== void 0) {
@@ -663,7 +672,7 @@ function gt(o, e) {
663
672
  }
664
673
  return (e === "string" ? String : Number)(o);
665
674
  }
666
- class vt {
675
+ class ht {
667
676
  /**
668
677
  * @param {object} options
669
678
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -675,11 +684,11 @@ class vt {
675
684
  if (this.options = t.options, !!this.options.showToolbar) {
676
685
  this.editor = t, this.canvas = t.canvas;
677
686
  var a = this.options.toolbar || {};
678
- this.config = j(j(j({}, B), a), {}, {
679
- style: j(j({}, B.style), a.style || {}),
680
- btnStyle: j(j({}, B.btnStyle), a.btnStyle || {}),
681
- icons: j(j({}, B.icons), a.icons || {}),
682
- handlers: j(j({}, B.handlers), a.handlers || {})
687
+ this.config = j(j(j({}, H), a), {}, {
688
+ style: j(j({}, H.style), a.style || {}),
689
+ btnStyle: j(j({}, H.btnStyle), a.btnStyle || {}),
690
+ icons: j(j({}, H.icons), a.icons || {}),
691
+ handlers: j(j({}, H.handlers), a.handlers || {})
683
692
  }), this.currentTarget = null, this.currentLocked = null, this.isTransforming = !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 = () => {
684
693
  this.el.style.display = "none";
685
694
  }, this._createDOM(), this._bindEvents();
@@ -800,10 +809,10 @@ class vt {
800
809
  } = e.getCenterPoint(), {
801
810
  top: u,
802
811
  height: l
803
- } = e.getBoundingRect(!1, !0), d = c * i + n, h = d - t.offsetWidth / 2, v = (u + l) * i + s + a.offsetTop;
812
+ } = e.getBoundingRect(!1, !0), d = c * i + n, h = d - t.offsetWidth / 2, g = (u + l) * i + s + a.offsetTop;
804
813
  Object.assign(t.style, {
805
814
  left: "".concat(h, "px"),
806
- top: "".concat(v, "px"),
815
+ top: "".concat(g, "px"),
807
816
  display: "flex"
808
817
  });
809
818
  }
@@ -815,7 +824,7 @@ class vt {
815
824
  this.el.removeEventListener("mouseover", this._onBtnOver), this.el.removeEventListener("mouseout", this._onBtnOut), this.canvas.off("mouse:down", this._onMouseDown), this.canvas.off("object:moving", this._onObjectMoving), this.canvas.off("object:scaling", this._onObjectScaling), this.canvas.off("object:rotating", this._onObjectRotating), this.canvas.off("mouse:up", this._onMouseUp), this.canvas.off("object:modified", this._onObjectModified), this.canvas.off("selection:created", this._onSelectionChange), this.canvas.off("selection:updated", this._onSelectionChange), this.canvas.off("selection:changed", this._onSelectionChange), this.canvas.off("after:render", this._onSelectionChange), this.canvas.off("selection:cleared", this._onSelectionClear), this.el.remove();
816
825
  }
817
826
  }
818
- function pe(o, e, t, a, r, i, n) {
827
+ function Ie(o, e, t, a, r, i, n) {
819
828
  try {
820
829
  var s = o[i](n), c = s.value;
821
830
  } catch (u) {
@@ -823,22 +832,22 @@ function pe(o, e, t, a, r, i, n) {
823
832
  }
824
833
  s.done ? e(c) : Promise.resolve(c).then(a, r);
825
834
  }
826
- function J(o) {
835
+ function ee(o) {
827
836
  return function() {
828
837
  var e = this, t = arguments;
829
838
  return new Promise(function(a, r) {
830
839
  var i = o.apply(e, t);
831
840
  function n(c) {
832
- pe(i, a, r, n, s, "next", c);
841
+ Ie(i, a, r, n, s, "next", c);
833
842
  }
834
843
  function s(c) {
835
- pe(i, a, r, n, s, "throw", c);
844
+ Ie(i, a, r, n, s, "throw", c);
836
845
  }
837
846
  n(void 0);
838
847
  });
839
848
  };
840
849
  }
841
- class mt {
850
+ class gt {
842
851
  /**
843
852
  * @param {object} options
844
853
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -854,7 +863,7 @@ class mt {
854
863
  return this._historySuspendCount > 0;
855
864
  }
856
865
  _createDiffPatcher() {
857
- this.diffPatcher = We({
866
+ this.diffPatcher = Re({
858
867
  objectHash(e) {
859
868
  return [e.id, e.format, e.locked, e.left, e.top, e.width, e.height, e.flipX, e.flipY, e.scaleX, e.scaleY, e.angle, e.opacity].join("-");
860
869
  },
@@ -927,7 +936,7 @@ class mt {
927
936
  */
928
937
  loadStateFromFullState(e) {
929
938
  var t = this;
930
- return J(function* () {
939
+ return ee(function* () {
931
940
  if (e) {
932
941
  console.log("loadStateFromFullState fullState", e), yield t.canvas.loadFromJSON(e);
933
942
  var a = t.canvas.getObjects().find((i) => i.id === "montage-area");
@@ -943,7 +952,7 @@ class mt {
943
952
  */
944
953
  undo() {
945
954
  var e = this;
946
- return J(function* () {
955
+ return ee(function* () {
947
956
  if (!e.skipHistory) {
948
957
  if (e.currentIndex <= 0) {
949
958
  console.log("Нет предыдущих состояний для отмены.");
@@ -970,7 +979,7 @@ class mt {
970
979
  */
971
980
  redo() {
972
981
  var e = this;
973
- return J(function* () {
982
+ return ee(function* () {
974
983
  if (!e.skipHistory) {
975
984
  if (e.currentIndex >= e.patches.length) {
976
985
  console.log("Нет состояний для повтора.");
@@ -992,8 +1001,8 @@ class mt {
992
1001
  })();
993
1002
  }
994
1003
  }
995
- const ft = 0.1, Mt = 2, jt = 0.1, yt = 90, Z = 16, z = 16, D = 4096, L = 4096;
996
- function be(o, e, t, a, r, i, n) {
1004
+ const vt = 0.1, mt = 2, Mt = 0.1, ft = 90, k = 16, x = 16, L = 4096, E = 4096;
1005
+ function Se(o, e, t, a, r, i, n) {
997
1006
  try {
998
1007
  var s = o[i](n), c = s.value;
999
1008
  } catch (u) {
@@ -1001,16 +1010,16 @@ function be(o, e, t, a, r, i, n) {
1001
1010
  }
1002
1011
  s.done ? e(c) : Promise.resolve(c).then(a, r);
1003
1012
  }
1004
- function T(o) {
1013
+ function O(o) {
1005
1014
  return function() {
1006
1015
  var e = this, t = arguments;
1007
1016
  return new Promise(function(a, r) {
1008
1017
  var i = o.apply(e, t);
1009
1018
  function n(c) {
1010
- be(i, a, r, n, s, "next", c);
1019
+ Se(i, a, r, n, s, "next", c);
1011
1020
  }
1012
1021
  function s(c) {
1013
- be(i, a, r, n, s, "throw", c);
1022
+ Se(i, a, r, n, s, "throw", c);
1014
1023
  }
1015
1024
  n(void 0);
1016
1025
  });
@@ -1041,7 +1050,7 @@ class A {
1041
1050
  */
1042
1051
  importImage(e) {
1043
1052
  var t = this;
1044
- return T(function* () {
1053
+ return O(function* () {
1045
1054
  var {
1046
1055
  source: a,
1047
1056
  scale: r = "image-".concat(t.options.scaleType),
@@ -1055,38 +1064,38 @@ class A {
1055
1064
  historyManager: u,
1056
1065
  errorManager: l
1057
1066
  } = t.editor, d = yield t.getContentType(a), h = A.getFormatFromContentType(d), {
1058
- acceptContentTypes: v,
1067
+ acceptContentTypes: g,
1059
1068
  acceptFormats: m
1060
1069
  } = t;
1061
1070
  if (!t.isAllowedContentType(d)) {
1062
- var f = "Неверный contentType для изображения: ".concat(d, ". Ожидается один из: ").concat(t.acceptContentTypes.join(", "), ".");
1071
+ var M = "Неверный contentType для изображения: ".concat(d, ". Ожидается один из: ").concat(t.acceptContentTypes.join(", "), ".");
1063
1072
  return l.emitError({
1064
1073
  origin: "ImageManager",
1065
1074
  method: "importImage",
1066
1075
  code: "INVALID_CONTENT_TYPE",
1067
- message: f,
1076
+ message: M,
1068
1077
  data: {
1069
1078
  source: a,
1070
1079
  format: h,
1071
1080
  contentType: d,
1072
- acceptContentTypes: v,
1081
+ acceptContentTypes: g,
1073
1082
  acceptFormats: m
1074
1083
  }
1075
1084
  }), null;
1076
1085
  }
1077
1086
  u.suspendHistory();
1078
1087
  try {
1079
- var M, g;
1088
+ var f, v;
1080
1089
  if (a instanceof File)
1081
- M = URL.createObjectURL(a);
1090
+ f = URL.createObjectURL(a);
1082
1091
  else if (typeof a == "string") {
1083
- var C = yield fetch(a, {
1092
+ var S = yield fetch(a, {
1084
1093
  mode: "cors"
1085
- }), y = yield C.blob({
1094
+ }), N = yield S.blob({
1086
1095
  type: d,
1087
1096
  quality: 1
1088
1097
  });
1089
- M = URL.createObjectURL(y);
1098
+ f = URL.createObjectURL(N);
1090
1099
  } else
1091
1100
  return l.emitError({
1092
1101
  origin: "ImageManager",
@@ -1097,66 +1106,71 @@ class A {
1097
1106
  source: a,
1098
1107
  format: h,
1099
1108
  contentType: d,
1100
- acceptContentTypes: v,
1109
+ acceptContentTypes: g,
1101
1110
  acceptFormats: m
1102
1111
  }
1103
1112
  }), null;
1104
- if (t._createdBlobUrls.push(M), h === "svg") {
1105
- var N = yield Ze(M);
1106
- g = P.groupSVGElements(N.objects, N.options);
1113
+ if (t._createdBlobUrls.push(f), h === "svg") {
1114
+ var D = yield xe(f);
1115
+ v = W.groupSVGElements(D.objects, D.options);
1107
1116
  } else
1108
- g = yield me.fromURL(M, {
1117
+ v = yield q.fromURL(f, {
1109
1118
  crossOrigin: "anonymous"
1110
1119
  });
1111
1120
  var {
1112
- width: E,
1113
- height: S
1114
- } = g;
1115
- if (S > L || E > D) {
1116
- var p = yield t.resizeImageToBoundaries(g._element.src, "max"), k = URL.createObjectURL(p);
1117
- t._createdBlobUrls.push(k), g = yield me.fromURL(k, {
1121
+ width: w,
1122
+ height: y
1123
+ } = v;
1124
+ if (y > E || w > L) {
1125
+ var p = yield t.resizeImageToBoundaries(v._element.src, "max"), B = URL.createObjectURL(p);
1126
+ t._createdBlobUrls.push(B), v = yield q.fromURL(B, {
1127
+ crossOrigin: "anonymous"
1128
+ });
1129
+ } else if (y < x || w < k) {
1130
+ var _ = yield t.resizeImageToBoundaries(v._element.src, "min"), Z = URL.createObjectURL(_);
1131
+ t._createdBlobUrls.push(Z), v = yield q.fromURL(Z, {
1118
1132
  crossOrigin: "anonymous"
1119
1133
  });
1120
1134
  }
1121
- if (g.set("id", "".concat(g.type, "-").concat(w())), g.set("format", h), r === "scale-montage")
1135
+ if (v.set("id", "".concat(v.type, "-").concat(C())), v.set("format", h), r === "scale-montage")
1122
1136
  t.editor.canvasManager.scaleMontageAreaToImage({
1123
- object: g,
1137
+ object: v,
1124
1138
  withoutSave: !0
1125
1139
  });
1126
1140
  else {
1127
1141
  var {
1128
- width: H,
1129
- height: _
1130
- } = s, R = t.calculateScaleFactor({
1131
- imageObject: g,
1142
+ width: F,
1143
+ height: z
1144
+ } = s, U = t.calculateScaleFactor({
1145
+ imageObject: v,
1132
1146
  scaleType: r
1133
1147
  });
1134
- r === "image-contain" && R < 1 ? c.fitObject({
1135
- object: g,
1148
+ r === "image-contain" && U < 1 ? c.fitObject({
1149
+ object: v,
1136
1150
  type: "contain",
1137
1151
  withoutSave: !0
1138
- }) : r === "image-cover" && (E > H || S > _) && c.fitObject({
1139
- object: g,
1152
+ }) : r === "image-cover" && (w > F || y > z) && c.fitObject({
1153
+ object: v,
1140
1154
  type: "cover",
1141
1155
  withoutSave: !0
1142
1156
  });
1143
1157
  }
1144
- n.add(g), n.centerObject(g), n.setActiveObject(g), n.renderAll(), u.resumeHistory(), i || u.saveState();
1145
- var O = {
1146
- image: g,
1158
+ n.add(v), n.centerObject(v), n.setActiveObject(v), n.renderAll(), u.resumeHistory(), i || u.saveState();
1159
+ var V = {
1160
+ image: v,
1147
1161
  format: h,
1148
1162
  contentType: d,
1149
1163
  scale: r,
1150
1164
  withoutSave: i,
1151
1165
  source: a
1152
1166
  };
1153
- return n.fire("editor:image-imported", O), O;
1154
- } catch (x) {
1167
+ return n.fire("editor:image-imported", V), V;
1168
+ } catch (Y) {
1155
1169
  return l.emitError({
1156
1170
  origin: "ImageManager",
1157
1171
  method: "importImage",
1158
1172
  code: "IMPORT_FAILED",
1159
- message: "Ошибка импорта изображения: ".concat(x.message),
1173
+ message: "Ошибка импорта изображения: ".concat(Y.message),
1160
1174
  data: {
1161
1175
  source: a,
1162
1176
  format: h,
@@ -1178,25 +1192,24 @@ class A {
1178
1192
  */
1179
1193
  resizeImageToBoundaries(e) {
1180
1194
  var t = arguments, a = this;
1181
- return T(function* () {
1182
- var r = t.length > 1 && t[1] !== void 0 ? t[1] : "max", i = "Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров: ".concat(D, "x").concat(L);
1183
- a.editor.errorManager.emitWarning({
1195
+ return O(function* () {
1196
+ var r = t.length > 1 && t[1] !== void 0 ? t[1] : "max", i = "Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ".concat(L, "x").concat(E);
1197
+ r === "min" && (i = "Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ".concat(k, "x").concat(x));
1198
+ var n = {
1199
+ dataURL: e,
1200
+ sizeType: r,
1201
+ maxWidth: L,
1202
+ maxHeight: E,
1203
+ minWidth: k,
1204
+ minHeight: x
1205
+ };
1206
+ return a.editor.errorManager.emitWarning({
1184
1207
  origin: "ImageManager",
1185
1208
  method: "resizeImageToBoundaries",
1186
1209
  code: "IMAGE_RESIZE_WARNING",
1187
1210
  message: i,
1188
- data: {
1189
- dataURL: e,
1190
- size: r
1191
- }
1192
- });
1193
- var n = yield a.editor.workerManager.post("resizeImage", {
1194
- dataURL: e,
1195
- maxWidth: D,
1196
- maxHeight: L,
1197
- sizeType: r
1198
- });
1199
- return n;
1211
+ data: n
1212
+ }), a.editor.workerManager.post("resizeImage", n);
1200
1213
  })();
1201
1214
  }
1202
1215
  /**
@@ -1212,7 +1225,7 @@ class A {
1212
1225
  */
1213
1226
  exportCanvasAsImageFile() {
1214
1227
  var e = arguments, t = this;
1215
- return T(function* () {
1228
+ return O(function* () {
1216
1229
  var {
1217
1230
  fileName: a = "image.png",
1218
1231
  contentType: r = "image/png",
@@ -1227,95 +1240,95 @@ class A {
1227
1240
  var l = r === "application/pdf", d = l ? "image/jpg" : r, h = A.getFormatFromContentType(d);
1228
1241
  c.setCoords();
1229
1242
  var {
1230
- left: v,
1243
+ left: g,
1231
1244
  top: m,
1232
- width: f,
1233
- height: M
1234
- } = c.getBoundingRect(), g = yield s.clone(["id", "format", "locked"]);
1235
- ["image/jpg", "image/jpeg"].includes(d) && (g.backgroundColor = "#ffffff");
1236
- var C = g.getObjects().find((b) => b.id === c.id);
1237
- C.visible = !1, g.viewportTransform = [1, 0, 0, 1, -v, -m], g.setDimensions({
1238
- width: f,
1239
- height: M
1245
+ width: M,
1246
+ height: f
1247
+ } = c.getBoundingRect(), v = yield s.clone(["id", "format", "locked"]);
1248
+ ["image/jpg", "image/jpeg"].includes(d) && (v.backgroundColor = "#ffffff");
1249
+ var S = v.getObjects().find((b) => b.id === c.id);
1250
+ S.visible = !1, v.viewportTransform = [1, 0, 0, 1, -g, -m], v.setDimensions({
1251
+ width: M,
1252
+ height: f
1240
1253
  }, {
1241
1254
  backstoreOnly: !0
1242
- }), g.renderAll();
1243
- var y = g.getObjects().filter((b) => b.format).every((b) => b.format === "svg");
1244
- if (h === "svg" && y) {
1245
- var N = g.toSVG();
1246
- g.dispose();
1247
- var E = A._exportSVGStringAsFile(N, {
1255
+ }), v.renderAll();
1256
+ var N = v.getObjects().filter((b) => b.format).every((b) => b.format === "svg");
1257
+ if (h === "svg" && N) {
1258
+ var D = v.toSVG();
1259
+ v.dispose();
1260
+ var w = A._exportSVGStringAsFile(D, {
1248
1261
  exportAsBase64: i,
1249
1262
  exportAsBlob: n,
1250
1263
  fileName: a
1251
- }), S = {
1252
- image: E,
1264
+ }), y = {
1265
+ image: w,
1253
1266
  format: "svg",
1254
1267
  contentType: "image/svg+xml",
1255
1268
  fileName: a.replace(/\.[^/.]+$/, ".svg")
1256
1269
  };
1257
- return s.fire("editor:canvas-exported", S), S;
1270
+ return s.fire("editor:canvas-exported", y), y;
1258
1271
  }
1259
1272
  var p = yield new Promise((b) => {
1260
- g.getElement().toBlob(b);
1273
+ v.getElement().toBlob(b);
1261
1274
  });
1262
- if (g.dispose(), n) {
1263
- var k = {
1275
+ if (v.dispose(), n) {
1276
+ var B = {
1264
1277
  image: p,
1265
1278
  format: h,
1266
1279
  contentType: d,
1267
1280
  fileName: a
1268
1281
  };
1269
- return s.fire("editor:canvas-exported", k), k;
1282
+ return s.fire("editor:canvas-exported", B), B;
1270
1283
  }
1271
- var H = yield createImageBitmap(p), _ = yield u.post("toDataURL", {
1284
+ var _ = yield createImageBitmap(p), Z = yield u.post("toDataURL", {
1272
1285
  format: h,
1273
1286
  quality: 1,
1274
- bitmap: H
1275
- }, [H]);
1287
+ bitmap: _
1288
+ }, [_]);
1276
1289
  if (l) {
1277
- var R = 0.264583, O = f * R, x = M * R, Ce = (yield t.editor.moduleLoader.loadModule("jspdf")).jsPDF, G = new Ce({
1278
- orientation: O > x ? "landscape" : "portrait",
1290
+ var F = 0.264583, z = M * F, U = f * F, V = (yield t.editor.moduleLoader.loadModule("jspdf")).jsPDF, Y = new V({
1291
+ orientation: z > U ? "landscape" : "portrait",
1279
1292
  unit: "mm",
1280
- format: [O, x]
1293
+ format: [z, U]
1281
1294
  });
1282
- if (G.addImage(_, "JPG", 0, 0, O, x), i) {
1283
- var Ne = G.output("datauristring"), ce = {
1284
- image: Ne,
1295
+ if (Y.addImage(Z, "JPG", 0, 0, z, U), i) {
1296
+ var De = Y.output("datauristring"), de = {
1297
+ image: De,
1285
1298
  format: "pdf",
1286
1299
  contentType: "application/pdf",
1287
1300
  fileName: a
1288
1301
  };
1289
- return s.fire("editor:canvas-exported", ce), ce;
1302
+ return s.fire("editor:canvas-exported", de), de;
1290
1303
  }
1291
- var De = G.output("blob"), Le = new File([De], a, {
1304
+ var we = Y.output("blob"), Le = new File([we], a, {
1292
1305
  type: "application/pdf"
1293
- }), ue = {
1306
+ }), le = {
1294
1307
  image: Le,
1295
1308
  format: "pdf",
1296
1309
  contentType: "application/pdf",
1297
1310
  fileName: a
1298
1311
  };
1299
- return s.fire("editor:canvas-exported", ue), ue;
1312
+ return s.fire("editor:canvas-exported", le), le;
1300
1313
  }
1301
1314
  if (i) {
1302
- var de = {
1303
- image: _,
1315
+ var he = {
1316
+ image: Z,
1304
1317
  format: h,
1305
1318
  contentType: d,
1306
1319
  fileName: a
1307
1320
  };
1308
- return s.fire("editor:canvas-exported", de), de;
1321
+ return s.fire("editor:canvas-exported", he), he;
1309
1322
  }
1310
- var le = h === "svg" && !y ? a.replace(/\.[^/.]+$/, ".png") : a, Ee = new File([p], le, {
1323
+ var ge = h === "svg" && !N ? a.replace(/\.[^/.]+$/, ".png") : a, Ee = new File([p], ge, {
1311
1324
  type: d
1312
- }), he = {
1325
+ }), ve = {
1313
1326
  image: Ee,
1314
1327
  format: h,
1315
1328
  contentType: d,
1316
- fileName: le
1329
+ fileName: ge
1317
1330
  };
1318
- return s.fire("editor:canvas-exported", he), he;
1331
+ return s.fire("editor:canvas-exported", ve), ve;
1319
1332
  } catch (b) {
1320
1333
  return t.editor.errorManager.emitError({
1321
1334
  origin: "ImageManager",
@@ -1345,7 +1358,7 @@ class A {
1345
1358
  */
1346
1359
  exportObjectAsImageFile() {
1347
1360
  var e = arguments, t = this;
1348
- return T(function* () {
1361
+ return O(function* () {
1349
1362
  var {
1350
1363
  object: a,
1351
1364
  fileName: r = "image.png",
@@ -1372,12 +1385,12 @@ class A {
1372
1385
  try {
1373
1386
  var d = A.getFormatFromContentType(i);
1374
1387
  if (d === "svg") {
1375
- var h = l.toSVG(), v = t._exportSVGStringAsFile(h, {
1388
+ var h = l.toSVG(), g = t._exportSVGStringAsFile(h, {
1376
1389
  exportAsBase64: n,
1377
1390
  exportAsBlob: s,
1378
1391
  fileName: r
1379
1392
  }), m = {
1380
- image: v,
1393
+ image: g,
1381
1394
  format: d,
1382
1395
  contentType: "image/svg+xml",
1383
1396
  fileName: r.replace(/\.[^/.]+$/, ".svg")
@@ -1385,39 +1398,39 @@ class A {
1385
1398
  return c.fire("editor:object-exported", m), m;
1386
1399
  }
1387
1400
  if (n) {
1388
- var f = yield createImageBitmap(l._element), M = yield u.post("toDataURL", {
1401
+ var M = yield createImageBitmap(l._element), f = yield u.post("toDataURL", {
1389
1402
  format: d,
1390
1403
  quality: 1,
1391
- bitmap: f
1392
- }, [f]), g = {
1393
- image: M,
1404
+ bitmap: M
1405
+ }, [M]), v = {
1406
+ image: f,
1394
1407
  format: d,
1395
1408
  contentType: i,
1396
1409
  fileName: r
1397
1410
  };
1398
- return c.fire("editor:object-exported", g), g;
1411
+ return c.fire("editor:object-exported", v), v;
1399
1412
  }
1400
- var C = l.toCanvasElement(), y = yield new Promise((p) => {
1401
- C.toBlob(p);
1413
+ var S = l.toCanvasElement(), N = yield new Promise((p) => {
1414
+ S.toBlob(p);
1402
1415
  });
1403
1416
  if (s) {
1404
- var N = {
1405
- image: y,
1417
+ var D = {
1418
+ image: N,
1406
1419
  format: d,
1407
1420
  contentType: i,
1408
1421
  fileName: r
1409
1422
  };
1410
- return c.fire("editor:object-exported", N), N;
1423
+ return c.fire("editor:object-exported", D), D;
1411
1424
  }
1412
- var E = new File([y], r, {
1425
+ var w = new File([N], r, {
1413
1426
  type: i
1414
- }), S = {
1415
- image: E,
1427
+ }), y = {
1428
+ image: w,
1416
1429
  format: d,
1417
1430
  contentType: i,
1418
1431
  fileName: r
1419
1432
  };
1420
- return c.fire("editor:object-exported", S), S;
1433
+ return c.fire("editor:object-exported", y), y;
1421
1434
  } catch (p) {
1422
1435
  return t.editor.errorManager.emitError({
1423
1436
  origin: "ImageManager",
@@ -1499,7 +1512,7 @@ class A {
1499
1512
  */
1500
1513
  getContentType(e) {
1501
1514
  var t = this;
1502
- return T(function* () {
1515
+ return O(function* () {
1503
1516
  return typeof e == "string" ? t.getContentTypeFromUrl(e) : e.type || "application/octet-stream";
1504
1517
  })();
1505
1518
  }
@@ -1511,7 +1524,7 @@ class A {
1511
1524
  */
1512
1525
  getContentTypeFromUrl(e) {
1513
1526
  var t = this;
1514
- return T(function* () {
1527
+ return O(function* () {
1515
1528
  if (e.startsWith("data:")) {
1516
1529
  var a = e.match(/^data:([^;]+)/);
1517
1530
  return a ? a[1] : "application/octet-stream";
@@ -1566,7 +1579,7 @@ class A {
1566
1579
  return a === "contain" || a === "image-contain" ? Math.min(i / s, n / c) : a === "cover" || a === "image-cover" ? Math.max(i / s, n / c) : 1;
1567
1580
  }
1568
1581
  }
1569
- class pt {
1582
+ class jt {
1570
1583
  /**
1571
1584
  * @param {object} options
1572
1585
  * @param {ImageEditor} options.editor – экземпляр редактора
@@ -1602,7 +1615,7 @@ class pt {
1602
1615
  } = this.editor, {
1603
1616
  width: c,
1604
1617
  height: u
1605
- } = n, l = Number(Math.max(Math.min(e, D), Z));
1618
+ } = n, l = Number(Math.max(Math.min(e, L), k));
1606
1619
  if (!s || s === "auto" || r ? this.adaptCanvasToContainer() : s ? this.setCanvasBackstoreWidth(s) : this.setCanvasBackstoreWidth(l), n.set({
1607
1620
  width: l
1608
1621
  }), i.clipPath.set({
@@ -1613,10 +1626,10 @@ class pt {
1613
1626
  return;
1614
1627
  }
1615
1628
  var {
1616
- left: v,
1629
+ left: g,
1617
1630
  top: m
1618
- } = this.getObjectDefaultCoords(n), f = i.getZoom();
1619
- i.setViewportTransform([f, 0, 0, f, v, m]), this.centerMontageArea(), a || this.editor.historyManager.saveState(), i == null || i.fire("editor:resolution-width-changed", {
1631
+ } = this.getObjectDefaultCoords(n), M = i.getZoom();
1632
+ i.setViewportTransform([M, 0, 0, M, g, m]), this.centerMontageArea(), a || this.editor.historyManager.saveState(), i == null || i.fire("editor:resolution-width-changed", {
1620
1633
  width: e
1621
1634
  });
1622
1635
  }
@@ -1646,7 +1659,7 @@ class pt {
1646
1659
  } = this.editor, {
1647
1660
  width: c,
1648
1661
  height: u
1649
- } = n, l = Number(Math.max(Math.min(e, L), z));
1662
+ } = n, l = Number(Math.max(Math.min(e, E), x));
1650
1663
  if (!s || s === "auto" || r ? this.adaptCanvasToContainer() : s ? this.setCanvasBackstoreHeight(s) : this.setCanvasBackstoreHeight(l), n.set({
1651
1664
  height: l
1652
1665
  }), i.clipPath.set({
@@ -1657,10 +1670,10 @@ class pt {
1657
1670
  return;
1658
1671
  }
1659
1672
  var {
1660
- left: v,
1673
+ left: g,
1661
1674
  top: m
1662
- } = this.getObjectDefaultCoords(n), f = i.getZoom();
1663
- i.setViewportTransform([f, 0, 0, f, v, m]), this.centerMontageArea(), a || this.editor.historyManager.saveState(), i == null || i.fire("editor:resolution-height-changed", {
1675
+ } = this.getObjectDefaultCoords(n), M = i.getZoom();
1676
+ i.setViewportTransform([M, 0, 0, M, g, m]), this.centerMontageArea(), a || this.editor.historyManager.saveState(), i == null || i.fire("editor:resolution-height-changed", {
1664
1677
  height: e
1665
1678
  });
1666
1679
  }
@@ -1673,7 +1686,7 @@ class pt {
1673
1686
  var {
1674
1687
  canvas: e,
1675
1688
  montageArea: t
1676
- } = this.editor, a = e.getWidth(), r = e.getHeight(), i = e.getZoom(), n = new ze(a / 2, r / 2);
1689
+ } = this.editor, a = e.getWidth(), r = e.getHeight(), i = e.getZoom(), n = new Be(a / 2, r / 2);
1677
1690
  t.set({
1678
1691
  left: a / 2,
1679
1692
  top: r / 2
@@ -1708,7 +1721,7 @@ class pt {
1708
1721
  }
1709
1722
  setCanvasBackstoreWidth(e) {
1710
1723
  if (!(!e || typeof e != "number")) {
1711
- var t = Math.max(Math.min(e, D), Z);
1724
+ var t = Math.max(Math.min(e, L), k);
1712
1725
  this.editor.canvas.setDimensions({
1713
1726
  width: t
1714
1727
  }, {
@@ -1718,7 +1731,7 @@ class pt {
1718
1731
  }
1719
1732
  setCanvasBackstoreHeight(e) {
1720
1733
  if (!(!e || typeof e != "number")) {
1721
- var t = Math.max(Math.min(e, L), z);
1734
+ var t = Math.max(Math.min(e, E), x);
1722
1735
  this.editor.canvas.setDimensions({
1723
1736
  height: t
1724
1737
  }, {
@@ -1729,7 +1742,7 @@ class pt {
1729
1742
  adaptCanvasToContainer() {
1730
1743
  var {
1731
1744
  canvas: e
1732
- } = this.editor, t = e.editorContainer, a = t.clientWidth, r = t.clientHeight, i = Math.max(Math.min(a, D), Z), n = Math.max(Math.min(r, L), z);
1745
+ } = this.editor, t = e.editorContainer, a = t.clientWidth, r = t.clientHeight, i = Math.max(Math.min(a, L), k), n = Math.max(Math.min(r, E), x);
1733
1746
  console.log("adaptCanvasToContainer newWidth", i), console.log("adaptCanvasToContainer newHeight", n), e.setDimensions({
1734
1747
  width: i,
1735
1748
  height: n
@@ -1912,30 +1925,23 @@ class pt {
1912
1925
  var {
1913
1926
  width: l,
1914
1927
  height: d
1915
- } = u;
1916
- if (l < Z || d < z) {
1917
- var h = "Размер изображения меньше минимального размера канваса, поэтому оно будет растянуто до минимальных размеров: ".concat(Z, "x").concat(z);
1918
- console.warn("scaleMontageAreaToImage. ".concat(h)), r.fire("editor:warning", {
1919
- message: h
1920
- });
1921
- }
1922
- var v = Math.min(l, D), m = Math.min(d, L);
1928
+ } = u, h = Math.min(l, L), g = Math.min(d, E);
1923
1929
  if (t) {
1924
1930
  var {
1925
- width: f,
1931
+ width: m,
1926
1932
  height: M
1927
- } = i, g = l / f, C = d / M, y = Math.max(g, C);
1928
- v = f * y, m = M * y;
1933
+ } = i, f = l / m, v = d / M, S = Math.max(f, v);
1934
+ h = m * S, g = M * S;
1929
1935
  }
1930
- this.setResolutionWidth(v, {
1936
+ this.setResolutionWidth(h, {
1931
1937
  withoutSave: !0
1932
- }), this.setResolutionHeight(m, {
1938
+ }), this.setResolutionHeight(g, {
1933
1939
  withoutSave: !0
1934
1940
  }), (l > s || d > c) && n.calculateAndApplyDefaultZoom(s, c), n.resetObject(u, {
1935
1941
  withoutSave: !0
1936
1942
  }), r.centerObject(u), r.renderAll(), a || this.editor.historyManager.saveState(), r.fire("editor:canvas-scaled", {
1937
- width: v,
1938
- height: m
1943
+ width: h,
1944
+ height: g
1939
1945
  });
1940
1946
  }
1941
1947
  }
@@ -1990,7 +1996,7 @@ class pt {
1990
1996
  return r.filter((i) => i.id !== t.id && i.id !== a.id);
1991
1997
  }
1992
1998
  }
1993
- class bt {
1999
+ class yt {
1994
2000
  /**
1995
2001
  * @param {object} options
1996
2002
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -2029,7 +2035,7 @@ class bt {
2029
2035
  * Если передавать координаты курсора, то нужно быть аккуратнее, так как юзер может выйти за пределы рабочей области
2030
2036
  */
2031
2037
  zoom() {
2032
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : jt, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2038
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Mt, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2033
2039
  if (e) {
2034
2040
  var {
2035
2041
  canvas: a,
@@ -2101,7 +2107,7 @@ class bt {
2101
2107
  * @fires editor:object-rotated
2102
2108
  */
2103
2109
  rotate() {
2104
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yt, {
2110
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ft, {
2105
2111
  withoutSave: t
2106
2112
  } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
2107
2113
  canvas: a,
@@ -2188,13 +2194,13 @@ class bt {
2188
2194
  if (["activeselection"].includes(c.type) && !r) {
2189
2195
  var u = c.getObjects();
2190
2196
  i.discardActiveObject(), u.forEach((h) => {
2191
- var v = n.calculateScaleFactor({
2197
+ var g = n.calculateScaleFactor({
2192
2198
  imageObject: h,
2193
2199
  scaleType: t
2194
2200
  });
2195
- h.scale(v), i.centerObject(h);
2201
+ h.scale(g), i.centerObject(h);
2196
2202
  });
2197
- var l = new Y(u, {
2203
+ var l = new R(u, {
2198
2204
  canvas: i
2199
2205
  });
2200
2206
  i.setActiveObject(l);
@@ -2256,12 +2262,12 @@ class bt {
2256
2262
  height: d
2257
2263
  } = i, {
2258
2264
  width: h,
2259
- height: v
2265
+ height: g
2260
2266
  } = u, m = n.calculateScaleFactor({
2261
2267
  imageObject: u,
2262
2268
  scaleType: c
2263
2269
  });
2264
- c === "contain" && m < 1 || c === "cover" && (h > l || v > d) ? this.fitObject({
2270
+ c === "contain" && m < 1 || c === "cover" && (h > l || g > d) ? this.fitObject({
2265
2271
  object: u,
2266
2272
  withoutSave: !0
2267
2273
  }) : u.set({
@@ -2277,7 +2283,7 @@ class bt {
2277
2283
  }
2278
2284
  }
2279
2285
  }
2280
- class It {
2286
+ class pt {
2281
2287
  /**
2282
2288
  * @param {object} options
2283
2289
  * @param {ImageEditor} options.editor – экземпляр редактора
@@ -2377,7 +2383,7 @@ class It {
2377
2383
  }
2378
2384
  }
2379
2385
  }
2380
- class F {
2386
+ class J {
2381
2387
  /**
2382
2388
  * @param {object} options
2383
2389
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -2424,7 +2430,7 @@ class F {
2424
2430
  } = this.editor;
2425
2431
  r.suspendHistory();
2426
2432
  var i = e || a.getActiveObject();
2427
- i && (i.type === "activeselection" ? F._moveSelectionForward(a, i) : a.bringObjectForward(i), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:object-bring-forward"));
2433
+ i && (i.type === "activeselection" ? J._moveSelectionForward(a, i) : a.bringObjectForward(i), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:object-bring-forward"));
2428
2434
  }
2429
2435
  /**
2430
2436
  * Отправить объект на задний план по оси Z
@@ -2474,7 +2480,7 @@ class F {
2474
2480
  } = this.editor;
2475
2481
  i.suspendHistory();
2476
2482
  var s = e || a.getActiveObject();
2477
- s && (s.type === "activeselection" ? F._moveSelectionBackwards(a, s) : a.sendObjectBackwards(s), a.sendObjectToBack(r), a.sendObjectToBack(n), a.renderAll(), i.resumeHistory(), t || i.saveState(), a.fire("editor:object-send-backwards"));
2483
+ s && (s.type === "activeselection" ? J._moveSelectionBackwards(a, s) : a.sendObjectBackwards(s), a.sendObjectToBack(r), a.sendObjectToBack(n), a.renderAll(), i.resumeHistory(), t || i.saveState(), a.fire("editor:object-send-backwards"));
2478
2484
  }
2479
2485
  /**
2480
2486
  * Сдвигает выделенные объекты на один уровень вверх относительно ближайшего верхнего объекта
@@ -2486,7 +2492,7 @@ class F {
2486
2492
  static _moveSelectionForward(e, t) {
2487
2493
  for (var a = e.getObjects(), r = t.getObjects(), i = r.map((l) => a.indexOf(l)), n = -1, s = function(d) {
2488
2494
  var h = a[d];
2489
- if (!r.includes(h) && i.some((v) => d > v))
2495
+ if (!r.includes(h) && i.some((g) => d > g))
2490
2496
  return n = d, 1;
2491
2497
  }, c = 0; c < a.length && !s(c); c += 1)
2492
2498
  ;
@@ -2513,115 +2519,60 @@ class F {
2513
2519
  e.moveObjectTo(r[n], i - 1);
2514
2520
  }
2515
2521
  }
2516
- var St = ["id", "left", "top", "width", "height", "fill"], At = ["id", "left", "top", "radius", "fill"], wt = ["id", "left", "top", "width", "height", "fill"];
2517
- function Ie(o, e) {
2518
- var t = Object.keys(o);
2519
- if (Object.getOwnPropertySymbols) {
2520
- var a = Object.getOwnPropertySymbols(o);
2521
- e && (a = a.filter(function(r) {
2522
- return Object.getOwnPropertyDescriptor(o, r).enumerable;
2523
- })), t.push.apply(t, a);
2524
- }
2525
- return t;
2526
- }
2527
- function K(o) {
2528
- for (var e = 1; e < arguments.length; e++) {
2529
- var t = arguments[e] != null ? arguments[e] : {};
2530
- e % 2 ? Ie(Object(t), !0).forEach(function(a) {
2531
- Ct(o, a, t[a]);
2532
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : Ie(Object(t)).forEach(function(a) {
2533
- Object.defineProperty(o, a, Object.getOwnPropertyDescriptor(t, a));
2534
- });
2535
- }
2536
- return o;
2537
- }
2538
- function Ct(o, e, t) {
2539
- return (e = Nt(e)) in o ? Object.defineProperty(o, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : o[e] = t, o;
2540
- }
2541
- function Nt(o) {
2542
- var e = Dt(o, "string");
2543
- return typeof e == "symbol" ? e : e + "";
2544
- }
2545
- function Dt(o, e) {
2546
- if (typeof o != "object" || !o) return o;
2547
- var t = o[Symbol.toPrimitive];
2548
- if (t !== void 0) {
2549
- var a = t.call(o, e);
2550
- if (typeof a != "object") return a;
2551
- throw new TypeError("@@toPrimitive must return a primitive value.");
2552
- }
2553
- return (e === "string" ? String : Number)(o);
2554
- }
2555
- function $(o, e) {
2556
- if (o == null) return {};
2557
- var t, a, r = Lt(o, e);
2558
- if (Object.getOwnPropertySymbols) {
2559
- var i = Object.getOwnPropertySymbols(o);
2560
- for (a = 0; a < i.length; a++) t = i[a], e.indexOf(t) === -1 && {}.propertyIsEnumerable.call(o, t) && (r[t] = o[t]);
2561
- }
2562
- return r;
2563
- }
2564
- function Lt(o, e) {
2565
- if (o == null) return {};
2566
- var t = {};
2567
- for (var a in o) if ({}.hasOwnProperty.call(o, a)) {
2568
- if (e.indexOf(a) !== -1) continue;
2569
- t[a] = o[a];
2570
- }
2571
- return t;
2572
- }
2573
- class Et {
2522
+ class bt {
2574
2523
  /**
2575
- * @param {object} options
2576
- * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
2524
+ * Менеджер фигур для редактора.
2525
+ * @param {Object} options - Опции и настройки менеджера фигур.
2526
+ * @param {ImageEditor} options.editor - Ссылка на экземпляр редактора.
2577
2527
  */
2578
- constructor(e) {
2579
- var {
2580
- editor: t
2581
- } = e;
2582
- this.editor = t;
2528
+ constructor({ editor: e }) {
2529
+ this.editor = e;
2583
2530
  }
2584
2531
  /**
2585
2532
  * Добавление прямоугольника
2586
2533
  * @param {Object} shapeOptions
2534
+ * @param {String} shapeOptions.id - Уникальный идентификатор фигуры
2587
2535
  * @param {Number} shapeOptions.left - Координата X
2588
2536
  * @param {Number} shapeOptions.top - Координата Y
2589
2537
  * @param {Number} shapeOptions.width - Ширина
2590
2538
  * @param {Number} shapeOptions.height - Высота
2591
2539
  * @param {String} shapeOptions.fill - Цвет заливки
2592
- * @param {String} shapeOptions.originX - Ориентация по X
2593
- * @param {String} shapeOptions.originY - Ориентация по Y
2594
2540
  * @param {Rect} shapeOptions.rest - Остальные параметры
2595
2541
  *
2542
+ * @param {Object} flags - Флаги для управления поведением
2596
2543
  * @param {Object} flags.withoutSelection - Не выделять объект
2597
2544
  * @param {Object} flags.withoutAdding - Не добавлять объект в canvas
2598
2545
  */
2599
- addRectangle() {
2600
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
2601
- id: t = "rect-".concat(w()),
2602
- left: a,
2603
- top: r,
2604
- width: i = 100,
2605
- height: n = 100,
2606
- fill: s = "blue"
2607
- } = e, c = $(e, St), {
2608
- withoutSelection: u,
2609
- withoutAdding: l
2610
- } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
2611
- canvas: d
2612
- } = this.editor, h = new Ue(K({
2613
- id: t,
2614
- left: a,
2615
- top: r,
2616
- width: i,
2617
- height: n,
2618
- fill: s
2619
- }, c));
2620
- return !a && !r && d.centerObject(h), l || (d.add(h), u || d.setActiveObject(h), d.renderAll()), h;
2546
+ addRectangle(l = {}, { withoutSelection: c, withoutAdding: u } = {}) {
2547
+ var d = l, {
2548
+ id: e = `rect-${C()}`,
2549
+ left: t,
2550
+ top: a,
2551
+ width: r = 100,
2552
+ height: i = 100,
2553
+ fill: n = "blue"
2554
+ } = d, s = X(d, [
2555
+ "id",
2556
+ "left",
2557
+ "top",
2558
+ "width",
2559
+ "height",
2560
+ "fill"
2561
+ ]);
2562
+ const { canvas: h } = this.editor, g = new Ze(T({
2563
+ id: e,
2564
+ left: t,
2565
+ top: a,
2566
+ width: r,
2567
+ height: i,
2568
+ fill: n
2569
+ }, s));
2570
+ return !t && !a && h.centerObject(g), u || (h.add(g), c || h.setActiveObject(g), h.renderAll()), g;
2621
2571
  }
2622
2572
  /**
2623
2573
  * Добавление круга
2624
2574
  * @param {Object} shapeOptions
2575
+ * @param {String} shapeOptions.id - Уникальный идентификатор фигуры
2625
2576
  * @param {Number} shapeOptions.left - Координата X
2626
2577
  * @param {Number} shapeOptions.top - Координата Y
2627
2578
  * @param {Number} shapeOptions.radius - Радиус
@@ -2630,33 +2581,37 @@ class Et {
2630
2581
  * @param {String} shapeOptions.originY - Ориентация по Y
2631
2582
  * @param {Circle} shapeOptions.rest - Остальные параметры
2632
2583
  *
2584
+ * @param {Object} flags - Флаги для управления поведением
2633
2585
  * @param {Object} flags.withoutSelection - Не выделять объект
2634
2586
  * @param {Object} flags.withoutAdding - Не добавлять объект в canvas
2635
2587
  */
2636
- addCircle() {
2637
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
2638
- id: t = "circle-".concat(w()),
2639
- left: a,
2640
- top: r,
2641
- radius: i = 50,
2642
- fill: n = "green"
2643
- } = e, s = $(e, At), {
2644
- withoutSelection: c,
2645
- withoutAdding: u
2646
- } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
2647
- canvas: l
2648
- } = this.editor, d = new Ye(K({
2649
- id: t,
2650
- left: a,
2651
- top: r,
2652
- fill: n,
2653
- radius: i
2654
- }, s));
2655
- return !a && !r && l.centerObject(d), u || (l.add(d), c || l.setActiveObject(d), l.renderAll()), d;
2588
+ addCircle(u = {}, { withoutSelection: s, withoutAdding: c } = {}) {
2589
+ var l = u, {
2590
+ id: e = `circle-${C()}`,
2591
+ left: t,
2592
+ top: a,
2593
+ radius: r = 50,
2594
+ fill: i = "green"
2595
+ } = l, n = X(l, [
2596
+ "id",
2597
+ "left",
2598
+ "top",
2599
+ "radius",
2600
+ "fill"
2601
+ ]);
2602
+ const { canvas: d } = this.editor, h = new ze(T({
2603
+ id: e,
2604
+ left: t,
2605
+ top: a,
2606
+ fill: i,
2607
+ radius: r
2608
+ }, n));
2609
+ return !t && !a && d.centerObject(h), c || (d.add(h), s || d.setActiveObject(h), d.renderAll()), h;
2656
2610
  }
2657
2611
  /**
2658
2612
  * Добавление треугольника
2659
2613
  * @param {Object} shapeOptions
2614
+ * @param {String} shapeOptions.id - Уникальный идентификатор фигуры
2660
2615
  * @param {Number} shapeOptions.left - Координата X
2661
2616
  * @param {Number} shapeOptions.top - Координата Y
2662
2617
  * @param {Number} shapeOptions.width - Ширина
@@ -2666,34 +2621,38 @@ class Et {
2666
2621
  * @param {String} shapeOptions.fill - Цвет заливки
2667
2622
  * @param {Triangle} shapeOptions.rest - Остальные параметры
2668
2623
  *
2624
+ * @param {Object} flags - Флаги для управления поведением
2669
2625
  * @param {Object} flags.withoutSelection - Не выделять объект
2670
2626
  * @param {Object} flags.withoutAdding - Не добавлять объект в canvas
2671
2627
  */
2672
- addTriangle() {
2673
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
2674
- id: t = "triangle-".concat(w()),
2675
- left: a,
2676
- top: r,
2677
- width: i = 100,
2678
- height: n = 100,
2679
- fill: s = "yellow"
2680
- } = e, c = $(e, wt), {
2681
- withoutSelection: u,
2682
- withoutAdding: l
2683
- } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
2684
- canvas: d
2685
- } = this.editor, h = new Pe(K({
2686
- id: t,
2687
- left: a,
2688
- top: r,
2689
- fill: s,
2690
- width: i,
2691
- height: n
2692
- }, c));
2693
- return !a && !r && d.centerObject(h), l || (d.add(h), u || d.setActiveObject(h), d.renderAll()), h;
2628
+ addTriangle(l = {}, { withoutSelection: c, withoutAdding: u } = {}) {
2629
+ var d = l, {
2630
+ id: e = `triangle-${C()}`,
2631
+ left: t,
2632
+ top: a,
2633
+ width: r = 100,
2634
+ height: i = 100,
2635
+ fill: n = "yellow"
2636
+ } = d, s = X(d, [
2637
+ "id",
2638
+ "left",
2639
+ "top",
2640
+ "width",
2641
+ "height",
2642
+ "fill"
2643
+ ]);
2644
+ const { canvas: h } = this.editor, g = new Ue(T({
2645
+ id: e,
2646
+ left: t,
2647
+ top: a,
2648
+ fill: n,
2649
+ width: r,
2650
+ height: i
2651
+ }, s));
2652
+ return !t && !a && h.centerObject(g), u || (h.add(g), c || h.setActiveObject(g), h.renderAll()), g;
2694
2653
  }
2695
2654
  }
2696
- function Se(o, e, t, a, r, i, n) {
2655
+ function Ae(o, e, t, a, r, i, n) {
2697
2656
  try {
2698
2657
  var s = o[i](n), c = s.value;
2699
2658
  } catch (u) {
@@ -2701,22 +2660,22 @@ function Se(o, e, t, a, r, i, n) {
2701
2660
  }
2702
2661
  s.done ? e(c) : Promise.resolve(c).then(a, r);
2703
2662
  }
2704
- function Ae(o) {
2663
+ function Ce(o) {
2705
2664
  return function() {
2706
2665
  var e = this, t = arguments;
2707
2666
  return new Promise(function(a, r) {
2708
2667
  var i = o.apply(e, t);
2709
2668
  function n(c) {
2710
- Se(i, a, r, n, s, "next", c);
2669
+ Ae(i, a, r, n, s, "next", c);
2711
2670
  }
2712
2671
  function s(c) {
2713
- Se(i, a, r, n, s, "throw", c);
2672
+ Ae(i, a, r, n, s, "throw", c);
2714
2673
  }
2715
2674
  n(void 0);
2716
2675
  });
2717
2676
  };
2718
2677
  }
2719
- class Ot {
2678
+ class It {
2720
2679
  /**
2721
2680
  * @param {object} options
2722
2681
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -2733,7 +2692,7 @@ class Ot {
2733
2692
  */
2734
2693
  copy() {
2735
2694
  var e = this;
2736
- return Ae(function* () {
2695
+ return Ce(function* () {
2737
2696
  var {
2738
2697
  canvas: t
2739
2698
  } = e.editor, a = t.getActiveObject();
@@ -2777,18 +2736,18 @@ class Ot {
2777
2736
  */
2778
2737
  paste() {
2779
2738
  var e = this;
2780
- return Ae(function* () {
2739
+ return Ce(function* () {
2781
2740
  var {
2782
2741
  canvas: t
2783
2742
  } = e.editor;
2784
2743
  if (e.clipboard) {
2785
2744
  var a = yield e.clipboard.clone(["format"]);
2786
2745
  t.discardActiveObject(), a.set({
2787
- id: "".concat(a.type, "-").concat(w()),
2746
+ id: "".concat(a.type, "-").concat(C()),
2788
2747
  left: a.left + 10,
2789
2748
  top: a.top + 10,
2790
2749
  evented: !0
2791
- }), a instanceof Y ? (a.canvas = t, a.forEachObject((r) => {
2750
+ }), a instanceof R ? (a.canvas = t, a.forEachObject((r) => {
2792
2751
  t.add(r);
2793
2752
  })) : t.add(a), t.setActiveObject(a), t.requestRenderAll(), t.fire("editor:object-pasted", {
2794
2753
  object: a
@@ -2797,7 +2756,7 @@ class Ot {
2797
2756
  })();
2798
2757
  }
2799
2758
  }
2800
- class Tt {
2759
+ class St {
2801
2760
  /**
2802
2761
  * @param {object} options
2803
2762
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -2880,7 +2839,7 @@ class Tt {
2880
2839
  }
2881
2840
  }
2882
2841
  }
2883
- class kt {
2842
+ class At {
2884
2843
  /**
2885
2844
  * @param {object} options
2886
2845
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -2909,8 +2868,8 @@ class kt {
2909
2868
  r.suspendHistory();
2910
2869
  var i = e || a.getActiveObject();
2911
2870
  if (i && i.type === "activeselection") {
2912
- var n = i.getObjects(), s = new He(n);
2913
- n.forEach((c) => a.remove(c)), s.set("id", "".concat(s.type, "-").concat(w())), a.add(s), a.setActiveObject(s), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-grouped");
2871
+ var n = i.getObjects(), s = new Ye(n);
2872
+ n.forEach((c) => a.remove(c)), s.set("id", "".concat(s.type, "-").concat(C())), a.add(s), a.setActiveObject(s), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-grouped");
2914
2873
  }
2915
2874
  }
2916
2875
  /**
@@ -2933,14 +2892,14 @@ class kt {
2933
2892
  if (!(!i || i.type !== "group")) {
2934
2893
  var n = i.removeAll();
2935
2894
  a.remove(i), n.forEach((c) => a.add(c));
2936
- var s = new Y(n, {
2895
+ var s = new R(n, {
2937
2896
  canvas: a
2938
2897
  });
2939
2898
  a.setActiveObject(s), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-ungrouped");
2940
2899
  }
2941
2900
  }
2942
2901
  }
2943
- class xt {
2902
+ class Ct {
2944
2903
  /**
2945
2904
  * @param {object} options
2946
2905
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -2962,7 +2921,7 @@ class xt {
2962
2921
  objectLockManager: a
2963
2922
  } = this.editor;
2964
2923
  e.discardActiveObject();
2965
- var r = t.getObjects(), i = r.some((s) => s.locked), n = r.length > 1 ? new Y(t.getObjects(), {
2924
+ var r = t.getObjects(), i = r.some((s) => s.locked), n = r.length > 1 ? new R(t.getObjects(), {
2966
2925
  canvas: e
2967
2926
  }) : r[0];
2968
2927
  i && a.lockObject({
@@ -2974,7 +2933,7 @@ class xt {
2974
2933
  });
2975
2934
  }
2976
2935
  }
2977
- class Bt {
2936
+ class Nt {
2978
2937
  /**
2979
2938
  * @param {object} options
2980
2939
  * @param {ImageEditor} options.editor - экземпляр редактора с доступом к canvas
@@ -3010,7 +2969,7 @@ class Bt {
3010
2969
  }), a.discardActiveObject(), a.renderAll(), r.resumeHistory(), t || r.saveState(), a.fire("editor:objects-deleted"));
3011
2970
  }
3012
2971
  }
3013
- var Zt = {
2972
+ var Dt = {
3014
2973
  IMAGE_MANAGER: {
3015
2974
  /**
3016
2975
  * Некорректный Content-Type изображения
@@ -3038,7 +2997,7 @@ var Zt = {
3038
2997
  IMAGE_EXPORT_FAILED: "IMAGE_EXPORT_FAILED"
3039
2998
  }
3040
2999
  };
3041
- class V {
3000
+ class K {
3042
3001
  constructor(e) {
3043
3002
  var {
3044
3003
  editor: t
@@ -3063,7 +3022,7 @@ class V {
3063
3022
  data: i,
3064
3023
  message: n
3065
3024
  } = e;
3066
- if (!V.isValidErrorCode(r)) {
3025
+ if (!K.isValidErrorCode(r)) {
3067
3026
  console.warn("Неизвестный код ошибки: ", {
3068
3027
  code: r,
3069
3028
  origin: t,
@@ -3100,7 +3059,7 @@ class V {
3100
3059
  message: i,
3101
3060
  data: n
3102
3061
  } = e;
3103
- if (!V.isValidErrorCode(r)) {
3062
+ if (!K.isValidErrorCode(r)) {
3104
3063
  console.warn("Неизвестный код ошибки: ", {
3105
3064
  code: r,
3106
3065
  origin: t,
@@ -3118,10 +3077,10 @@ class V {
3118
3077
  });
3119
3078
  }
3120
3079
  static isValidErrorCode(e) {
3121
- return e ? Object.values(Zt).some((t) => Object.values(t).includes(e)) : !1;
3080
+ return e ? Object.values(Dt).some((t) => Object.values(t).includes(e)) : !1;
3122
3081
  }
3123
3082
  }
3124
- class oe {
3083
+ class ue {
3125
3084
  /**
3126
3085
  * Конструктор класса ImageEditor.
3127
3086
  * @param {string} canvasId - идентификатор канваса, в котором будет создан редактор
@@ -3130,10 +3089,10 @@ class oe {
3130
3089
  constructor(e, t) {
3131
3090
  this.options = t;
3132
3091
  const { defaultScale: a, minZoom: r, maxZoom: i } = t;
3133
- this.containerId = e, this.editorId = `${e}-${w()}`, this.clipboard = null, this.defaultZoom = a, this.minZoom = r || ft, this.maxZoom = i || Mt, this.init();
3092
+ this.containerId = e, this.editorId = `${e}-${C()}`, this.clipboard = null, this.defaultZoom = a, this.minZoom = r || vt, this.maxZoom = i || mt, this.init();
3134
3093
  }
3135
3094
  init() {
3136
- return Q(this, null, function* () {
3095
+ return $(this, null, function* () {
3137
3096
  const {
3138
3097
  editorContainerWidth: e,
3139
3098
  editorContainerHeight: t,
@@ -3146,13 +3105,13 @@ class oe {
3146
3105
  scaleType: u,
3147
3106
  _onReadyCallback: l
3148
3107
  } = this.options;
3149
- if (tt.apply(), this.canvas = new _e(this.containerId, this.options), this.moduleLoader = new Ve(), this.workerManager = new Ge(), this.errorManager = new V({ editor: this }), this.historyManager = new mt({ editor: this }), this.toolbar = new vt({ editor: this }), this.transformManager = new bt({ editor: this }), this.canvasManager = new pt({ editor: this }), this.imageManager = new A({ editor: this }), this.layerManager = new F({ editor: this }), this.shapeManager = new Et({ editor: this }), this.interactionBlocker = new It({ editor: this }), this.clipboardManager = new Ot({ editor: this }), this.objectLockManager = new Tt({ editor: this }), this.groupingManager = new kt({ editor: this }), this.selectionManager = new xt({ editor: this }), this.deletionManager = new Bt({ editor: this }), this._createMontageArea(), this._createClippingArea(), this.listeners = new U({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(e), this.canvasManager.setEditorContainerHeight(t), this.canvasManager.setCanvasWrapperWidth(a), this.canvasManager.setCanvasWrapperHeight(r), this.canvasManager.setCanvasCSSWidth(i), this.canvasManager.setCanvasCSSHeight(n), s != null && s.source) {
3108
+ if (qe.apply(), this.canvas = new He(this.containerId, this.options), this.moduleLoader = new _e(), this.workerManager = new Fe(), this.errorManager = new K({ editor: this }), this.historyManager = new gt({ editor: this }), this.toolbar = new ht({ editor: this }), this.transformManager = new yt({ editor: this }), this.canvasManager = new jt({ editor: this }), this.imageManager = new A({ editor: this }), this.layerManager = new J({ editor: this }), this.shapeManager = new bt({ editor: this }), this.interactionBlocker = new pt({ editor: this }), this.clipboardManager = new It({ editor: this }), this.objectLockManager = new St({ editor: this }), this.groupingManager = new At({ editor: this }), this.selectionManager = new Ct({ editor: this }), this.deletionManager = new Nt({ editor: this }), this._createMontageArea(), this._createClippingArea(), this.listeners = new P({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(e), this.canvasManager.setEditorContainerHeight(t), this.canvasManager.setCanvasWrapperWidth(a), this.canvasManager.setCanvasWrapperHeight(r), this.canvasManager.setCanvasCSSWidth(i), this.canvasManager.setCanvasCSSHeight(n), s != null && s.source) {
3150
3109
  const {
3151
3110
  source: d,
3152
3111
  scale: h = `image-${u}`,
3153
- withoutSave: v = !0
3112
+ withoutSave: g = !0
3154
3113
  } = s;
3155
- yield this.imageManager.importImage({ source: d, scale: h, withoutSave: v });
3114
+ yield this.imageManager.importImage({ source: d, scale: h, withoutSave: g });
3156
3115
  } else
3157
3116
  this.canvasManager.setDefaultScale({ withoutSave: !0 });
3158
3117
  c && this.historyManager.loadStateFromFullState(c), this.historyManager.saveState(), console.log("editor:ready"), this.canvas.fire("editor:ready", this), typeof l == "function" && l(this);
@@ -3166,7 +3125,7 @@ class oe {
3166
3125
  this.montageArea = this.shapeManager.addRectangle({
3167
3126
  width: e,
3168
3127
  height: t,
3169
- fill: oe._createMosaicPattern(),
3128
+ fill: ue._createMosaicPattern(),
3170
3129
  stroke: null,
3171
3130
  strokeWidth: 0,
3172
3131
  selectable: !1,
@@ -3210,46 +3169,35 @@ class oe {
3210
3169
  const e = document.createElement("canvas");
3211
3170
  e.width = 20, e.height = 20;
3212
3171
  const t = e.getContext("2d");
3213
- return t.fillStyle = "#ddd", t.fillRect(0, 0, 40, 40), t.fillStyle = "#ccc", t.fillRect(0, 0, 10, 10), t.fillRect(10, 10, 10, 10), new Re({
3172
+ return t.fillStyle = "#ddd", t.fillRect(0, 0, 40, 40), t.fillStyle = "#ccc", t.fillRect(0, 0, 10, 10), t.fillRect(10, 10, 10, 10), new Pe({
3214
3173
  source: e,
3215
3174
  repeat: "repeat"
3216
3175
  });
3217
3176
  }
3218
3177
  }
3219
- const zt = {
3220
- // Cохраняют ли объекты свой текущий порядок (z-index) при выделении
3178
+ const wt = {
3179
+ /**
3180
+ * Опции редактора
3181
+ */
3221
3182
  preserveObjectStacking: !0,
3222
- // Возможность взаимодействия с объектом за пределами монтажной области
3223
3183
  controlsAboveOverlay: !0,
3224
- // Зум по центру
3225
3184
  centeredScaling: !0,
3226
- // Поворот объекта по центру
3227
3185
  centeredRotation: !0,
3228
3186
  /*
3229
- * Кастомные опции
3230
- */
3231
- // Canvas Montage Area width and height
3187
+ * Кастомные опции
3188
+ */
3232
3189
  montageAreaWidth: 512,
3233
3190
  montageAreaHeight: 512,
3234
- // Canvas backstore width and height
3235
3191
  canvasBackstoreWidth: "auto",
3236
3192
  canvasBackstoreHeight: "auto",
3237
- // Canvas (upper & lower) CSS width and height
3238
3193
  canvasCSSWidth: "100%",
3239
3194
  canvasCSSHeight: "100%",
3240
- // Wrapper CSS width and height
3241
3195
  canvasWrapperWidth: "100%",
3242
3196
  canvasWrapperHeight: "100%",
3243
- // Container CSS width and height
3244
3197
  editorContainerWidth: "fit-content",
3245
3198
  editorContainerHeight: "100%",
3246
- // Максимальная длина истории действий
3247
3199
  maxHistoryLength: 50,
3248
- // Дефолтный тип скейлинга для объектов (cotain/cover)
3249
3200
  scaleType: "contain",
3250
- /**
3251
- * Массив допустимых форматов изображений для загрузки в редактор.
3252
- */
3253
3201
  acceptContentTypes: [
3254
3202
  "image/png",
3255
3203
  "image/jpeg",
@@ -3257,11 +3205,7 @@ const zt = {
3257
3205
  "image/svg+xml",
3258
3206
  "image/webp"
3259
3207
  ],
3260
- // Показывать панель инструментов для выделенного объекта
3261
3208
  showToolbar: !0,
3262
- // Настройки панели инструментов выделенного объекта.
3263
- // Можно передать массив с названиями действий или объект с настройками, кастомными иконками и обработчиками
3264
- // ui/toolbar-manager/default-config.js
3265
3209
  toolbar: {
3266
3210
  lockedActions: [{
3267
3211
  name: "Разблокировать",
@@ -3298,61 +3242,40 @@ const zt = {
3298
3242
  }
3299
3243
  ]
3300
3244
  },
3301
- // Можно передать JSON объект в виде строки для инициализации редактора
3302
3245
  initialStateJSON: null,
3303
- /*
3304
- * Объект изображения с которым редактор будет инициализирован. Может содержать:
3305
- * - {String} url - URL изображения (обязательный)
3306
- * - {String} scaleType - Тип скейлинга (image-contain/image-cover/scale-montage)
3307
- * - {Boolean} withoutSave - Не сохранять состояние редактора (по умолчанию false)
3308
- */
3309
3246
  initialImage: null,
3310
- // Дефолтный масштаб
3311
3247
  defaultScale: 1,
3312
- // Минимальный и максимальный зум
3313
3248
  minZoom: 0.1,
3314
3249
  maxZoom: 2,
3315
- // Максимальная кратность зума относительно текущего defaultZoom
3316
3250
  maxZoomFactor: 2,
3317
- // Шаг зума
3318
3251
  zoomRatio: 0.1,
3319
3252
  overlayMaskColor: "rgba(136, 136, 136, 0.6)",
3320
3253
  /*
3321
3254
  * Настройки слушателей событий
3322
3255
  */
3323
- // Адаптировать канвас при изменении размеров контейнера (например, при изменении размеров окна браузера)
3324
3256
  adaptCanvasToContainer: !0,
3325
- // Поднимать объект на передний план по оси Z при выделении
3326
3257
  bringToFrontOnSelection: !1,
3327
- // Зум по колесику мыши
3328
3258
  mouseWheelZooming: !0,
3329
- // Перемещение канваса при зажатой кнопке ALT
3330
3259
  canvasDragging: !0,
3331
- // Копирование объектов (Ctrl + C, Ctrl + V)
3332
3260
  copyObjectsByHotkey: !0,
3333
- // Вставка изображения из буфера обмена
3334
3261
  pasteImageFromClipboard: !0,
3335
- // Отмена/повтор действия по сочетанию клавиш (Ctrl + Z, Ctrl + Y)
3336
3262
  undoRedoByHotKeys: !0,
3337
- // Выделение всех объектов по сочетанию клавиш (Ctrl + A)
3338
3263
  selectAllByHotkey: !0,
3339
- // Удаление объектов по сочетанию клавиш (Delete)
3340
3264
  deleteObjectsByHotkey: !0,
3341
- // Сброс параметров объекта по двойному клику
3342
3265
  resetObjectFitByDoubleClick: !0
3343
3266
  };
3344
- function Ht(o, e = {}) {
3345
- const t = X(X({}, zt), e), a = document.getElementById(o);
3267
+ function Ot(o, e = {}) {
3268
+ const t = T(T({}, wt), e), a = document.getElementById(o);
3346
3269
  if (!a)
3347
3270
  return Promise.reject(new Error(`Контейнер с ID "${o}" не найден.`));
3348
3271
  const r = document.createElement("canvas");
3349
3272
  return r.id = `${o}-canvas`, a.appendChild(r), t.editorContainer = a, new Promise((i) => {
3350
3273
  t._onReadyCallback = i;
3351
- const n = new oe(r.id, t);
3274
+ const n = new ue(r.id, t);
3352
3275
  window[o] = n;
3353
3276
  });
3354
3277
  }
3355
3278
  export {
3356
- Ht as default
3279
+ Ot as default
3357
3280
  };
3358
3281
  //# sourceMappingURL=main.js.map