@inweb/markup 26.3.3 → 26.4.0

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/markup.js CHANGED
@@ -25,7 +25,7 @@
25
25
  hasRequiredGlobal = 1;
26
26
  (function (exports) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports._registerNode = exports.Konva = exports.glob = void 0;
28
+ exports._registerNode = exports.Konva = exports.glob = undefined;
29
29
  const PI_OVER_180 = Math.PI / 180;
30
30
  function detectBrowser() {
31
31
  return (typeof window !== 'undefined' &&
@@ -41,7 +41,7 @@
41
41
  : {};
42
42
  exports.Konva = {
43
43
  _global: exports.glob,
44
- version: '9.3.20',
44
+ version: '9.3.18',
45
45
  isBrowser: detectBrowser(),
46
46
  isUnminified: /param/.test(function (param) { }.toString()),
47
47
  dblClickWindow: 400,
@@ -73,7 +73,7 @@
73
73
  },
74
74
  isTransforming() {
75
75
  var _a;
76
- return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
76
+ return (_a = exports.Konva['Transformer']) === null || _a === undefined ? undefined : _a.isTransforming();
77
77
  },
78
78
  isDragReady() {
79
79
  return !!exports.Konva['DD'].node;
@@ -102,7 +102,7 @@
102
102
  hasRequiredUtil = 1;
103
103
  (function (exports) {
104
104
  Object.defineProperty(exports, "__esModule", { value: true });
105
- exports.Util = exports.Transform = void 0;
105
+ exports.Util = exports.Transform = undefined;
106
106
  const Global_1 = requireGlobal();
107
107
  class Transform {
108
108
  constructor(m = [1, 0, 0, 1, 0, 0]) {
@@ -1120,7 +1120,7 @@
1120
1120
  hasRequiredFactory = 1;
1121
1121
  (function (exports) {
1122
1122
  Object.defineProperty(exports, "__esModule", { value: true });
1123
- exports.Factory = void 0;
1123
+ exports.Factory = undefined;
1124
1124
  const Util_1 = requireUtil();
1125
1125
  const Validators_1 = requireValidators();
1126
1126
  const GET = 'get';
@@ -1258,7 +1258,7 @@
1258
1258
  if (hasRequiredContext) return Context;
1259
1259
  hasRequiredContext = 1;
1260
1260
  Object.defineProperty(Context, "__esModule", { value: true });
1261
- Context.HitContext = Context.SceneContext = Context.Context = void 0;
1261
+ Context.HitContext = Context.SceneContext = Context.Context = undefined;
1262
1262
  const Util_1 = requireUtil();
1263
1263
  const Global_1 = requireGlobal();
1264
1264
  function simplifyArray(arr) {
@@ -1747,7 +1747,7 @@
1747
1747
  }
1748
1748
  _applyShadow(shape) {
1749
1749
  var _a, _b, _c;
1750
- const color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
1750
+ const color = (_a = shape.getShadowRGBA()) !== null && _a !== undefined ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== undefined ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== undefined ? _c : {
1751
1751
  x: 0,
1752
1752
  y: 0,
1753
1753
  }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
@@ -1806,10 +1806,12 @@
1806
1806
  if (hasRequiredCanvas) return Canvas;
1807
1807
  hasRequiredCanvas = 1;
1808
1808
  Object.defineProperty(Canvas, "__esModule", { value: true });
1809
- Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
1809
+ Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = undefined;
1810
1810
  const Util_1 = requireUtil();
1811
1811
  const Context_1 = requireContext();
1812
1812
  const Global_1 = requireGlobal();
1813
+ const Factory_1 = requireFactory();
1814
+ const Validators_1 = requireValidators();
1813
1815
  let _pixelRatio;
1814
1816
  function getDevicePixelRatio() {
1815
1817
  if (_pixelRatio) {
@@ -1898,6 +1900,7 @@
1898
1900
  }
1899
1901
  };
1900
1902
  Canvas.Canvas = Canvas$1;
1903
+ Factory_1.Factory.addGetterSetter(Canvas$1, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());
1901
1904
  class SceneCanvas extends Canvas$1 {
1902
1905
  constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
1903
1906
  super(config);
@@ -1929,7 +1932,7 @@
1929
1932
  hasRequiredDragAndDrop = 1;
1930
1933
  (function (exports) {
1931
1934
  Object.defineProperty(exports, "__esModule", { value: true });
1932
- exports.DD = void 0;
1935
+ exports.DD = undefined;
1933
1936
  const Global_1 = requireGlobal();
1934
1937
  const Util_1 = requireUtil();
1935
1938
  exports.DD = {
@@ -2050,7 +2053,7 @@
2050
2053
  if (hasRequiredNode) return Node;
2051
2054
  hasRequiredNode = 1;
2052
2055
  Object.defineProperty(Node, "__esModule", { value: true });
2053
- Node.Node = void 0;
2056
+ Node.Node = undefined;
2054
2057
  const Util_1 = requireUtil();
2055
2058
  const Factory_1 = requireFactory();
2056
2059
  const Canvas_1 = requireCanvas();
@@ -2955,7 +2958,7 @@
2955
2958
  var _a, _b;
2956
2959
  const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
2957
2960
  m.reset();
2958
- const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
2961
+ const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== undefined ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== undefined ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
2959
2962
  if (x !== 0 || y !== 0) {
2960
2963
  m.translate(x, y);
2961
2964
  }
@@ -3157,7 +3160,7 @@
3157
3160
  _requestDraw() {
3158
3161
  if (Global_1.Konva.autoDrawEnabled) {
3159
3162
  const drawNode = this.getLayer() || this.getStage();
3160
- drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
3163
+ drawNode === null || drawNode === undefined ? undefined : drawNode.batchDraw();
3161
3164
  }
3162
3165
  }
3163
3166
  _setAttr(key, val) {
@@ -3218,13 +3221,13 @@
3218
3221
  }
3219
3222
  _getProtoListeners(eventType) {
3220
3223
  var _a, _b, _c;
3221
- const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};
3222
- let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
3224
+ const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== undefined ? _a : {};
3225
+ let events = allListeners === null || allListeners === undefined ? undefined : allListeners[eventType];
3223
3226
  if (events === undefined) {
3224
3227
  events = [];
3225
3228
  let obj = Object.getPrototypeOf(this);
3226
3229
  while (obj) {
3227
- const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];
3230
+ const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === undefined ? undefined : _b[eventType]) !== null && _c !== undefined ? _c : [];
3228
3231
  events.push(...hierarchyEvents);
3229
3232
  obj = Object.getPrototypeOf(obj);
3230
3233
  }
@@ -3490,7 +3493,7 @@
3490
3493
  if (hasRequiredContainer) return Container;
3491
3494
  hasRequiredContainer = 1;
3492
3495
  Object.defineProperty(Container, "__esModule", { value: true });
3493
- Container.Container = void 0;
3496
+ Container.Container = undefined;
3494
3497
  const Factory_1 = requireFactory();
3495
3498
  const Node_1 = requireNode();
3496
3499
  const Validators_1 = requireValidators();
@@ -3647,13 +3650,13 @@
3647
3650
  if (this.isCached()) {
3648
3651
  return;
3649
3652
  }
3650
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
3653
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (node) {
3651
3654
  node._clearSelfAndDescendantCache(attr);
3652
3655
  });
3653
3656
  }
3654
3657
  _setChildrenIndices() {
3655
3658
  var _a;
3656
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
3659
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child, n) {
3657
3660
  child.index = n;
3658
3661
  });
3659
3662
  this._requestDraw();
@@ -3724,7 +3727,7 @@
3724
3727
  context.save();
3725
3728
  context._applyGlobalCompositeOperation(this);
3726
3729
  }
3727
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
3730
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
3728
3731
  child[drawMethod](canvas, top, bufferCanvas);
3729
3732
  });
3730
3733
  if (hasComposition) {
@@ -3746,7 +3749,7 @@
3746
3749
  height: 0,
3747
3750
  };
3748
3751
  const that = this;
3749
- (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
3752
+ (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
3750
3753
  if (!child.visible()) {
3751
3754
  return;
3752
3755
  }
@@ -3878,7 +3881,7 @@
3878
3881
  hasRequiredStage = 1;
3879
3882
  (function (exports) {
3880
3883
  Object.defineProperty(exports, "__esModule", { value: true });
3881
- exports.Stage = exports.stages = void 0;
3884
+ exports.Stage = exports.stages = undefined;
3882
3885
  const Util_1 = requireUtil();
3883
3886
  const Factory_1 = requireFactory();
3884
3887
  const Container_1 = requireContainer();
@@ -4595,7 +4598,7 @@
4595
4598
  hasRequiredShape = 1;
4596
4599
  (function (exports) {
4597
4600
  Object.defineProperty(exports, "__esModule", { value: true });
4598
- exports.Shape = exports.shapes = void 0;
4601
+ exports.Shape = exports.shapes = undefined;
4599
4602
  const Global_1 = requireGlobal();
4600
4603
  const Util_1 = requireUtil();
4601
4604
  const Factory_1 = requireFactory();
@@ -4828,7 +4831,7 @@
4828
4831
  }
4829
4832
  _useBufferCanvas(forceFill) {
4830
4833
  var _a;
4831
- const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
4834
+ const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== undefined ? _a : true;
4832
4835
  if (!perfectDrawEnabled) {
4833
4836
  return false;
4834
4837
  }
@@ -5148,7 +5151,7 @@
5148
5151
  if (hasRequiredLayer) return Layer;
5149
5152
  hasRequiredLayer = 1;
5150
5153
  Object.defineProperty(Layer, "__esModule", { value: true });
5151
- Layer.Layer = void 0;
5154
+ Layer.Layer = undefined;
5152
5155
  const Util_1 = requireUtil();
5153
5156
  const Container_1 = requireContainer();
5154
5157
  const Node_1 = requireNode();
@@ -5466,7 +5469,7 @@
5466
5469
  if (hasRequiredFastLayer) return FastLayer;
5467
5470
  hasRequiredFastLayer = 1;
5468
5471
  Object.defineProperty(FastLayer, "__esModule", { value: true });
5469
- FastLayer.FastLayer = void 0;
5472
+ FastLayer.FastLayer = undefined;
5470
5473
  const Util_1 = requireUtil();
5471
5474
  const Layer_1 = requireLayer();
5472
5475
  const Global_1 = requireGlobal();
@@ -5491,7 +5494,7 @@
5491
5494
  if (hasRequiredGroup) return Group;
5492
5495
  hasRequiredGroup = 1;
5493
5496
  Object.defineProperty(Group, "__esModule", { value: true });
5494
- Group.Group = void 0;
5497
+ Group.Group = undefined;
5495
5498
  const Util_1 = requireUtil();
5496
5499
  const Container_1 = requireContainer();
5497
5500
  const Global_1 = requireGlobal();
@@ -5517,7 +5520,7 @@
5517
5520
  if (hasRequiredAnimation) return Animation;
5518
5521
  hasRequiredAnimation = 1;
5519
5522
  Object.defineProperty(Animation, "__esModule", { value: true });
5520
- Animation.Animation = void 0;
5523
+ Animation.Animation = undefined;
5521
5524
  const Global_1 = requireGlobal();
5522
5525
  const Util_1 = requireUtil();
5523
5526
  const now = (function () {
@@ -5673,7 +5676,7 @@
5673
5676
  hasRequiredTween = 1;
5674
5677
  (function (exports) {
5675
5678
  Object.defineProperty(exports, "__esModule", { value: true });
5676
- exports.Easings = exports.Tween = void 0;
5679
+ exports.Easings = exports.Tween = undefined;
5677
5680
  const Util_1 = requireUtil();
5678
5681
  const Animation_1 = requireAnimation();
5679
5682
  const Node_1 = requireNode();
@@ -6206,7 +6209,7 @@
6206
6209
  hasRequired_CoreInternals = 1;
6207
6210
  (function (exports) {
6208
6211
  Object.defineProperty(exports, "__esModule", { value: true });
6209
- exports.Konva = void 0;
6212
+ exports.Konva = undefined;
6210
6213
  const Global_1 = requireGlobal();
6211
6214
  const Util_1 = requireUtil();
6212
6215
  const Node_1 = requireNode();
@@ -6253,7 +6256,7 @@
6253
6256
  if (hasRequiredArc) return Arc;
6254
6257
  hasRequiredArc = 1;
6255
6258
  Object.defineProperty(Arc, "__esModule", { value: true });
6256
- Arc.Arc = void 0;
6259
+ Arc.Arc = undefined;
6257
6260
  const Factory_1 = requireFactory();
6258
6261
  const Shape_1 = requireShape();
6259
6262
  const Global_1 = requireGlobal();
@@ -6304,12 +6307,7 @@
6304
6307
  Arc.Arc = Arc$1;
6305
6308
  Arc$1.prototype._centroid = true;
6306
6309
  Arc$1.prototype.className = 'Arc';
6307
- Arc$1.prototype._attrsAffectingSize = [
6308
- 'innerRadius',
6309
- 'outerRadius',
6310
- 'angle',
6311
- 'clockwise',
6312
- ];
6310
+ Arc$1.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];
6313
6311
  (0, Global_2._registerNode)(Arc$1);
6314
6312
  Factory_1.Factory.addGetterSetter(Arc$1, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
6315
6313
  Factory_1.Factory.addGetterSetter(Arc$1, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
@@ -6328,7 +6326,7 @@
6328
6326
  if (hasRequiredLine) return Line;
6329
6327
  hasRequiredLine = 1;
6330
6328
  Object.defineProperty(Line, "__esModule", { value: true });
6331
- Line.Line = void 0;
6329
+ Line.Line = undefined;
6332
6330
  const Factory_1 = requireFactory();
6333
6331
  const Global_1 = requireGlobal();
6334
6332
  const Shape_1 = requireShape();
@@ -6499,7 +6497,7 @@
6499
6497
  hasRequiredBezierFunctions = 1;
6500
6498
  (function (exports) {
6501
6499
  Object.defineProperty(exports, "__esModule", { value: true });
6502
- exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
6500
+ exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = undefined;
6503
6501
  exports.tValues = [
6504
6502
  [],
6505
6503
  [],
@@ -7297,7 +7295,7 @@
7297
7295
  if (hasRequiredPath) return Path;
7298
7296
  hasRequiredPath = 1;
7299
7297
  Object.defineProperty(Path, "__esModule", { value: true });
7300
- Path.Path = void 0;
7298
+ Path.Path = undefined;
7301
7299
  const Factory_1 = requireFactory();
7302
7300
  const Shape_1 = requireShape();
7303
7301
  const Global_1 = requireGlobal();
@@ -7480,8 +7478,8 @@
7480
7478
  return null;
7481
7479
  }
7482
7480
  static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
7483
- fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
7484
- fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
7481
+ fromX = fromX !== null && fromX !== undefined ? fromX : P1x;
7482
+ fromY = fromY !== null && fromY !== undefined ? fromY : P1y;
7485
7483
  const len = this.getLineLength(P1x, P1y, P2x, P2y);
7486
7484
  if (len < 1e-10) {
7487
7485
  return { x: P1x, y: P1y };
@@ -7910,7 +7908,7 @@
7910
7908
  if (hasRequiredArrow) return Arrow;
7911
7909
  hasRequiredArrow = 1;
7912
7910
  Object.defineProperty(Arrow, "__esModule", { value: true });
7913
- Arrow.Arrow = void 0;
7911
+ Arrow.Arrow = undefined;
7914
7912
  const Factory_1 = requireFactory();
7915
7913
  const Line_1 = requireLine();
7916
7914
  const Validators_1 = requireValidators();
@@ -8022,7 +8020,7 @@
8022
8020
  if (hasRequiredCircle) return Circle;
8023
8021
  hasRequiredCircle = 1;
8024
8022
  Object.defineProperty(Circle, "__esModule", { value: true });
8025
- Circle.Circle = void 0;
8023
+ Circle.Circle = undefined;
8026
8024
  const Factory_1 = requireFactory();
8027
8025
  const Shape_1 = requireShape();
8028
8026
  const Validators_1 = requireValidators();
@@ -8068,7 +8066,7 @@
8068
8066
  if (hasRequiredEllipse) return Ellipse;
8069
8067
  hasRequiredEllipse = 1;
8070
8068
  Object.defineProperty(Ellipse, "__esModule", { value: true });
8071
- Ellipse.Ellipse = void 0;
8069
+ Ellipse.Ellipse = undefined;
8072
8070
  const Factory_1 = requireFactory();
8073
8071
  const Shape_1 = requireShape();
8074
8072
  const Validators_1 = requireValidators();
@@ -8118,7 +8116,7 @@
8118
8116
  if (hasRequiredImage) return Image$1;
8119
8117
  hasRequiredImage = 1;
8120
8118
  Object.defineProperty(Image$1, "__esModule", { value: true });
8121
- Image$1.Image = void 0;
8119
+ Image$1.Image = undefined;
8122
8120
  const Util_1 = requireUtil();
8123
8121
  const Factory_1 = requireFactory();
8124
8122
  const Shape_1 = requireShape();
@@ -8127,11 +8125,7 @@
8127
8125
  class Image extends Shape_1.Shape {
8128
8126
  constructor(attrs) {
8129
8127
  super(attrs);
8130
- this._loadListener = () => {
8131
- this._requestDraw();
8132
- };
8133
- this.on('imageChange.konva', (props) => {
8134
- this._removeImageLoad(props.oldVal);
8128
+ this.on('imageChange.konva', () => {
8135
8129
  this._setImageLoad();
8136
8130
  });
8137
8131
  this._setImageLoad();
@@ -8145,19 +8139,11 @@
8145
8139
  return;
8146
8140
  }
8147
8141
  if (image && image['addEventListener']) {
8148
- image['addEventListener']('load', this._loadListener);
8149
- }
8150
- }
8151
- _removeImageLoad(image) {
8152
- if (image && image['removeEventListener']) {
8153
- image['removeEventListener']('load', this._loadListener);
8142
+ image['addEventListener']('load', () => {
8143
+ this._requestDraw();
8144
+ });
8154
8145
  }
8155
8146
  }
8156
- destroy() {
8157
- this._removeImageLoad(this.image());
8158
- super.destroy();
8159
- return this;
8160
- }
8161
8147
  _useBufferCanvas() {
8162
8148
  const hasCornerRadius = !!this.cornerRadius();
8163
8149
  const hasShadow = this.hasShadow();
@@ -8221,11 +8207,11 @@
8221
8207
  }
8222
8208
  getWidth() {
8223
8209
  var _a, _b;
8224
- return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;
8210
+ return (_a = this.attrs.width) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.width;
8225
8211
  }
8226
8212
  getHeight() {
8227
8213
  var _a, _b;
8228
- return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
8214
+ return (_a = this.attrs.height) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.height;
8229
8215
  }
8230
8216
  static fromURL(url, callback, onError = null) {
8231
8217
  const img = Util_1.Util.createImageElement();
@@ -8261,7 +8247,7 @@
8261
8247
  if (hasRequiredLabel) return Label;
8262
8248
  hasRequiredLabel = 1;
8263
8249
  Object.defineProperty(Label, "__esModule", { value: true });
8264
- Label.Tag = Label.Label = void 0;
8250
+ Label.Tag = Label.Label = undefined;
8265
8251
  const Factory_1 = requireFactory();
8266
8252
  const Shape_1 = requireShape();
8267
8253
  const Group_1 = requireGroup();
@@ -8448,7 +8434,7 @@
8448
8434
  if (hasRequiredRect) return Rect;
8449
8435
  hasRequiredRect = 1;
8450
8436
  Object.defineProperty(Rect, "__esModule", { value: true });
8451
- Rect.Rect = void 0;
8437
+ Rect.Rect = undefined;
8452
8438
  const Factory_1 = requireFactory();
8453
8439
  const Shape_1 = requireShape();
8454
8440
  const Global_1 = requireGlobal();
@@ -8483,7 +8469,7 @@
8483
8469
  if (hasRequiredRegularPolygon) return RegularPolygon;
8484
8470
  hasRequiredRegularPolygon = 1;
8485
8471
  Object.defineProperty(RegularPolygon, "__esModule", { value: true });
8486
- RegularPolygon.RegularPolygon = void 0;
8472
+ RegularPolygon.RegularPolygon = undefined;
8487
8473
  const Factory_1 = requireFactory();
8488
8474
  const Shape_1 = requireShape();
8489
8475
  const Validators_1 = requireValidators();
@@ -8561,7 +8547,7 @@
8561
8547
  if (hasRequiredRing) return Ring;
8562
8548
  hasRequiredRing = 1;
8563
8549
  Object.defineProperty(Ring, "__esModule", { value: true });
8564
- Ring.Ring = void 0;
8550
+ Ring.Ring = undefined;
8565
8551
  const Factory_1 = requireFactory();
8566
8552
  const Shape_1 = requireShape();
8567
8553
  const Validators_1 = requireValidators();
@@ -8607,7 +8593,7 @@
8607
8593
  if (hasRequiredSprite) return Sprite;
8608
8594
  hasRequiredSprite = 1;
8609
8595
  Object.defineProperty(Sprite, "__esModule", { value: true });
8610
- Sprite.Sprite = void 0;
8596
+ Sprite.Sprite = undefined;
8611
8597
  const Factory_1 = requireFactory();
8612
8598
  const Shape_1 = requireShape();
8613
8599
  const Animation_1 = requireAnimation();
@@ -8728,7 +8714,7 @@
8728
8714
  if (hasRequiredStar) return Star;
8729
8715
  hasRequiredStar = 1;
8730
8716
  Object.defineProperty(Star, "__esModule", { value: true });
8731
- Star.Star = void 0;
8717
+ Star.Star = undefined;
8732
8718
  const Factory_1 = requireFactory();
8733
8719
  const Shape_1 = requireShape();
8734
8720
  const Validators_1 = requireValidators();
@@ -8779,7 +8765,7 @@
8779
8765
  if (hasRequiredText) return Text;
8780
8766
  hasRequiredText = 1;
8781
8767
  Object.defineProperty(Text, "__esModule", { value: true });
8782
- Text.Text = void 0;
8768
+ Text.Text = undefined;
8783
8769
  Text.stringToArray = stringToArray;
8784
8770
  const Util_1 = requireUtil();
8785
8771
  const Factory_1 = requireFactory();
@@ -9025,17 +9011,17 @@
9025
9011
  _context.restore();
9026
9012
  const scaleFactor = fontSize / 100;
9027
9013
  return {
9028
- actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,
9029
- actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,
9030
- actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
9031
- actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
9032
- alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,
9033
- emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
9034
- emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
9035
- fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
9036
- fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
9037
- hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
9038
- ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
9014
+ actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== undefined ? _a : 71.58203125 * scaleFactor,
9015
+ actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== undefined ? _b : 0,
9016
+ actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== undefined ? _c : -7.421875 * scaleFactor,
9017
+ actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== undefined ? _d : 75.732421875 * scaleFactor,
9018
+ alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== undefined ? _e : 0,
9019
+ emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== undefined ? _f : 100 * scaleFactor,
9020
+ emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== undefined ? _g : -20 * scaleFactor,
9021
+ fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== undefined ? _h : 91 * scaleFactor,
9022
+ fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== undefined ? _j : 21 * scaleFactor,
9023
+ hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== undefined ? _k : 72.80000305175781 * scaleFactor,
9024
+ ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== undefined ? _l : -21 * scaleFactor,
9039
9025
  width: metrics.width,
9040
9026
  height: fontSize,
9041
9027
  };
@@ -9079,14 +9065,8 @@
9079
9065
  while (line.length > 0) {
9080
9066
  let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
9081
9067
  while (low < high) {
9082
- const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr);
9083
- const shouldConsiderEllipsis = shouldAddEllipsis &&
9084
- fixedHeight &&
9085
- currentHeightPx + lineHeightPx > maxHeightPx;
9086
- const effectiveWidth = shouldConsiderEllipsis
9087
- ? substrWidth + additionalWidth
9088
- : substrWidth;
9089
- if (effectiveWidth <= maxWidth) {
9068
+ const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr) + additionalWidth;
9069
+ if (substrWidth <= maxWidth) {
9090
9070
  low = mid + 1;
9091
9071
  match = substr;
9092
9072
  matchWidth = substrWidth;
@@ -9233,7 +9213,7 @@
9233
9213
  if (hasRequiredTextPath) return TextPath;
9234
9214
  hasRequiredTextPath = 1;
9235
9215
  Object.defineProperty(TextPath, "__esModule", { value: true });
9236
- TextPath.TextPath = void 0;
9216
+ TextPath.TextPath = undefined;
9237
9217
  const Util_1 = requireUtil();
9238
9218
  const Factory_1 = requireFactory();
9239
9219
  const Shape_1 = requireShape();
@@ -9483,7 +9463,7 @@
9483
9463
  if (hasRequiredTransformer) return Transformer;
9484
9464
  hasRequiredTransformer = 1;
9485
9465
  Object.defineProperty(Transformer, "__esModule", { value: true });
9486
- Transformer.Transformer = void 0;
9466
+ Transformer.Transformer = undefined;
9487
9467
  const Util_1 = requireUtil();
9488
9468
  const Factory_1 = requireFactory();
9489
9469
  const Node_1 = requireNode();
@@ -9680,12 +9660,10 @@
9680
9660
  this.update();
9681
9661
  }
9682
9662
  };
9683
- if (node._attrsAffectingSize.length) {
9684
- const additionalEvents = node._attrsAffectingSize
9685
- .map((prop) => prop + 'Change.' + this._getEventNamespace())
9686
- .join(' ');
9687
- node.on(additionalEvents, onChange);
9688
- }
9663
+ const additionalEvents = node._attrsAffectingSize
9664
+ .map((prop) => prop + 'Change.' + this._getEventNamespace())
9665
+ .join(' ');
9666
+ node.on(additionalEvents, onChange);
9689
9667
  node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);
9690
9668
  node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);
9691
9669
  this._proxyDrag(node);
@@ -10160,12 +10138,12 @@
10160
10138
  const node = this.getNode();
10161
10139
  activeTransformersCount--;
10162
10140
  this._fire('transformend', { evt: e, target: node });
10163
- (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10141
+ (_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10164
10142
  if (node) {
10165
10143
  this._nodes.forEach((target) => {
10166
10144
  var _a;
10167
10145
  target._fire('transformend', { evt: e, target });
10168
- (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10146
+ (_a = target.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10169
10147
  });
10170
10148
  }
10171
10149
  this._movingAnchorName = null;
@@ -10278,7 +10256,7 @@
10278
10256
  .multiply(localTransform);
10279
10257
  const attrs = newLocalTransform.decompose();
10280
10258
  node.setAttrs(attrs);
10281
- (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10259
+ (_a = node.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10282
10260
  });
10283
10261
  this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
10284
10262
  this._nodes.forEach((node) => {
@@ -10393,7 +10371,7 @@
10393
10371
  styleFunc(node);
10394
10372
  });
10395
10373
  }
10396
- (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10374
+ (_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10397
10375
  }
10398
10376
  isTransforming() {
10399
10377
  return this._transforming;
@@ -10500,7 +10478,7 @@
10500
10478
  if (hasRequiredWedge) return Wedge;
10501
10479
  hasRequiredWedge = 1;
10502
10480
  Object.defineProperty(Wedge, "__esModule", { value: true });
10503
- Wedge.Wedge = void 0;
10481
+ Wedge.Wedge = undefined;
10504
10482
  const Factory_1 = requireFactory();
10505
10483
  const Shape_1 = requireShape();
10506
10484
  const Global_1 = requireGlobal();
@@ -10551,7 +10529,7 @@
10551
10529
  if (hasRequiredBlur) return Blur;
10552
10530
  hasRequiredBlur = 1;
10553
10531
  Object.defineProperty(Blur, "__esModule", { value: true });
10554
- Blur.Blur = void 0;
10532
+ Blur.Blur = undefined;
10555
10533
  const Factory_1 = requireFactory();
10556
10534
  const Node_1 = requireNode();
10557
10535
  const Validators_1 = requireValidators();
@@ -10799,7 +10777,7 @@
10799
10777
  if (hasRequiredBrighten) return Brighten;
10800
10778
  hasRequiredBrighten = 1;
10801
10779
  Object.defineProperty(Brighten, "__esModule", { value: true });
10802
- Brighten.Brighten = void 0;
10780
+ Brighten.Brighten = undefined;
10803
10781
  const Factory_1 = requireFactory();
10804
10782
  const Node_1 = requireNode();
10805
10783
  const Validators_1 = requireValidators();
@@ -10824,7 +10802,7 @@
10824
10802
  if (hasRequiredContrast) return Contrast;
10825
10803
  hasRequiredContrast = 1;
10826
10804
  Object.defineProperty(Contrast, "__esModule", { value: true });
10827
- Contrast.Contrast = void 0;
10805
+ Contrast.Contrast = undefined;
10828
10806
  const Factory_1 = requireFactory();
10829
10807
  const Node_1 = requireNode();
10830
10808
  const Validators_1 = requireValidators();
@@ -10872,7 +10850,7 @@
10872
10850
  if (hasRequiredEmboss) return Emboss;
10873
10851
  hasRequiredEmboss = 1;
10874
10852
  Object.defineProperty(Emboss, "__esModule", { value: true });
10875
- Emboss.Emboss = void 0;
10853
+ Emboss.Emboss = undefined;
10876
10854
  const Factory_1 = requireFactory();
10877
10855
  const Node_1 = requireNode();
10878
10856
  const Util_1 = requireUtil();
@@ -10988,7 +10966,7 @@
10988
10966
  if (hasRequiredEnhance) return Enhance;
10989
10967
  hasRequiredEnhance = 1;
10990
10968
  Object.defineProperty(Enhance, "__esModule", { value: true });
10991
- Enhance.Enhance = void 0;
10969
+ Enhance.Enhance = undefined;
10992
10970
  const Factory_1 = requireFactory();
10993
10971
  const Node_1 = requireNode();
10994
10972
  const Validators_1 = requireValidators();
@@ -11085,7 +11063,7 @@
11085
11063
  if (hasRequiredGrayscale) return Grayscale;
11086
11064
  hasRequiredGrayscale = 1;
11087
11065
  Object.defineProperty(Grayscale, "__esModule", { value: true });
11088
- Grayscale.Grayscale = void 0;
11066
+ Grayscale.Grayscale = undefined;
11089
11067
  const Grayscale$1 = function (imageData) {
11090
11068
  const data = imageData.data, len = data.length;
11091
11069
  for (let i = 0; i < len; i += 4) {
@@ -11107,7 +11085,7 @@
11107
11085
  if (hasRequiredHSL) return HSL;
11108
11086
  hasRequiredHSL = 1;
11109
11087
  Object.defineProperty(HSL, "__esModule", { value: true });
11110
- HSL.HSL = void 0;
11088
+ HSL.HSL = undefined;
11111
11089
  const Factory_1 = requireFactory();
11112
11090
  const Node_1 = requireNode();
11113
11091
  const Validators_1 = requireValidators();
@@ -11144,7 +11122,7 @@
11144
11122
  if (hasRequiredHSV) return HSV;
11145
11123
  hasRequiredHSV = 1;
11146
11124
  Object.defineProperty(HSV, "__esModule", { value: true });
11147
- HSV.HSV = void 0;
11125
+ HSV.HSV = undefined;
11148
11126
  const Factory_1 = requireFactory();
11149
11127
  const Node_1 = requireNode();
11150
11128
  const Validators_1 = requireValidators();
@@ -11181,7 +11159,7 @@
11181
11159
  if (hasRequiredInvert) return Invert;
11182
11160
  hasRequiredInvert = 1;
11183
11161
  Object.defineProperty(Invert, "__esModule", { value: true });
11184
- Invert.Invert = void 0;
11162
+ Invert.Invert = undefined;
11185
11163
  const Invert$1 = function (imageData) {
11186
11164
  const data = imageData.data, len = data.length;
11187
11165
  for (let i = 0; i < len; i += 4) {
@@ -11202,7 +11180,7 @@
11202
11180
  if (hasRequiredKaleidoscope) return Kaleidoscope;
11203
11181
  hasRequiredKaleidoscope = 1;
11204
11182
  Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
11205
- Kaleidoscope.Kaleidoscope = void 0;
11183
+ Kaleidoscope.Kaleidoscope = undefined;
11206
11184
  const Factory_1 = requireFactory();
11207
11185
  const Node_1 = requireNode();
11208
11186
  const Util_1 = requireUtil();
@@ -11348,7 +11326,7 @@
11348
11326
  if (hasRequiredMask) return Mask;
11349
11327
  hasRequiredMask = 1;
11350
11328
  Object.defineProperty(Mask, "__esModule", { value: true });
11351
- Mask.Mask = void 0;
11329
+ Mask.Mask = undefined;
11352
11330
  const Factory_1 = requireFactory();
11353
11331
  const Node_1 = requireNode();
11354
11332
  const Validators_1 = requireValidators();
@@ -11502,7 +11480,7 @@
11502
11480
  if (hasRequiredNoise) return Noise;
11503
11481
  hasRequiredNoise = 1;
11504
11482
  Object.defineProperty(Noise, "__esModule", { value: true });
11505
- Noise.Noise = void 0;
11483
+ Noise.Noise = undefined;
11506
11484
  const Factory_1 = requireFactory();
11507
11485
  const Node_1 = requireNode();
11508
11486
  const Validators_1 = requireValidators();
@@ -11527,7 +11505,7 @@
11527
11505
  if (hasRequiredPixelate) return Pixelate;
11528
11506
  hasRequiredPixelate = 1;
11529
11507
  Object.defineProperty(Pixelate, "__esModule", { value: true });
11530
- Pixelate.Pixelate = void 0;
11508
+ Pixelate.Pixelate = undefined;
11531
11509
  const Factory_1 = requireFactory();
11532
11510
  const Util_1 = requireUtil();
11533
11511
  const Node_1 = requireNode();
@@ -11600,7 +11578,7 @@
11600
11578
  if (hasRequiredPosterize) return Posterize;
11601
11579
  hasRequiredPosterize = 1;
11602
11580
  Object.defineProperty(Posterize, "__esModule", { value: true });
11603
- Posterize.Posterize = void 0;
11581
+ Posterize.Posterize = undefined;
11604
11582
  const Factory_1 = requireFactory();
11605
11583
  const Node_1 = requireNode();
11606
11584
  const Validators_1 = requireValidators();
@@ -11623,7 +11601,7 @@
11623
11601
  if (hasRequiredRGB) return RGB;
11624
11602
  hasRequiredRGB = 1;
11625
11603
  Object.defineProperty(RGB, "__esModule", { value: true });
11626
- RGB.RGB = void 0;
11604
+ RGB.RGB = undefined;
11627
11605
  const Factory_1 = requireFactory();
11628
11606
  const Node_1 = requireNode();
11629
11607
  const Validators_1 = requireValidators();
@@ -11674,7 +11652,7 @@
11674
11652
  if (hasRequiredRGBA) return RGBA;
11675
11653
  hasRequiredRGBA = 1;
11676
11654
  Object.defineProperty(RGBA, "__esModule", { value: true });
11677
- RGBA.RGBA = void 0;
11655
+ RGBA.RGBA = undefined;
11678
11656
  const Factory_1 = requireFactory();
11679
11657
  const Node_1 = requireNode();
11680
11658
  const Validators_1 = requireValidators();
@@ -11736,7 +11714,7 @@
11736
11714
  if (hasRequiredSepia) return Sepia;
11737
11715
  hasRequiredSepia = 1;
11738
11716
  Object.defineProperty(Sepia, "__esModule", { value: true });
11739
- Sepia.Sepia = void 0;
11717
+ Sepia.Sepia = undefined;
11740
11718
  const Sepia$1 = function (imageData) {
11741
11719
  const data = imageData.data, nPixels = data.length;
11742
11720
  for (let i = 0; i < nPixels; i += 4) {
@@ -11760,7 +11738,7 @@
11760
11738
  if (hasRequiredSolarize) return Solarize;
11761
11739
  hasRequiredSolarize = 1;
11762
11740
  Object.defineProperty(Solarize, "__esModule", { value: true });
11763
- Solarize.Solarize = void 0;
11741
+ Solarize.Solarize = undefined;
11764
11742
  const Solarize$1 = function (imageData) {
11765
11743
  const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
11766
11744
  let y = h;
@@ -11799,7 +11777,7 @@
11799
11777
  if (hasRequiredThreshold) return Threshold;
11800
11778
  hasRequiredThreshold = 1;
11801
11779
  Object.defineProperty(Threshold, "__esModule", { value: true });
11802
- Threshold.Threshold = void 0;
11780
+ Threshold.Threshold = undefined;
11803
11781
  const Factory_1 = requireFactory();
11804
11782
  const Node_1 = requireNode();
11805
11783
  const Validators_1 = requireValidators();
@@ -11820,7 +11798,7 @@
11820
11798
  if (hasRequired_FullInternals) return _FullInternals;
11821
11799
  hasRequired_FullInternals = 1;
11822
11800
  Object.defineProperty(_FullInternals, "__esModule", { value: true });
11823
- _FullInternals.Konva = void 0;
11801
+ _FullInternals.Konva = undefined;
11824
11802
  const _CoreInternals_1 = require_CoreInternals();
11825
11803
  const Arc_1 = requireArc();
11826
11804
  const Arrow_1 = requireArrow();
@@ -12045,8 +12023,8 @@
12045
12023
  const konvaPoints = [];
12046
12024
  params.points.forEach((point) => konvaPoints.push(point.x, point.y));
12047
12025
  this._ref = new Konva.Line({
12048
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12049
- strokeWidth: (_b = params.width) !== null && _b !== void 0 ? _b : 4,
12026
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12027
+ strokeWidth: (_b = params.width) !== null && _b !== undefined ? _b : 4,
12050
12028
  globalCompositeOperation: "source-over",
12051
12029
  lineCap: "round",
12052
12030
  lineJoin: "round",
@@ -12153,12 +12131,12 @@
12153
12131
  x: params.position.x,
12154
12132
  y: params.position.y,
12155
12133
  text: params.text,
12156
- fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
12134
+ fontSize: (_a = params.fontSize) !== null && _a !== undefined ? _a : 34,
12157
12135
  fontFamily: this.TEXT_FONT_FAMILY,
12158
- fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
12136
+ fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
12159
12137
  align: "left",
12160
12138
  draggable: true,
12161
- rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0,
12139
+ rotation: (_c = params.rotation) !== null && _c !== undefined ? _c : 0,
12162
12140
  });
12163
12141
  this._ref.width(this._ref.getTextWidth());
12164
12142
  this._ref.on("transform", (e) => {
@@ -12254,15 +12232,15 @@
12254
12232
  if (!params.position)
12255
12233
  params.position = { x: 0, y: 0 };
12256
12234
  this._ref = new Konva.Rect({
12257
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12258
- strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
12235
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12236
+ strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
12259
12237
  globalCompositeOperation: "source-over",
12260
12238
  lineCap: "round",
12261
12239
  lineJoin: "round",
12262
12240
  x: params.position.x,
12263
12241
  y: params.position.y,
12264
- width: (_c = params.width) !== null && _c !== void 0 ? _c : 200,
12265
- height: (_d = params.height) !== null && _d !== void 0 ? _d : 200,
12242
+ width: (_c = params.width) !== null && _c !== undefined ? _c : 200,
12243
+ height: (_d = params.height) !== null && _d !== undefined ? _d : 200,
12266
12244
  draggable: true,
12267
12245
  strokeScaleEnabled: false,
12268
12246
  });
@@ -12368,8 +12346,8 @@
12368
12346
  if (!params.radius)
12369
12347
  params.radius = { x: 25, y: 25 };
12370
12348
  this._ref = new Konva.Ellipse({
12371
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12372
- strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
12349
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12350
+ strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
12373
12351
  globalCompositeOperation: "source-over",
12374
12352
  lineCap: "round",
12375
12353
  lineJoin: "round",
@@ -12509,8 +12487,8 @@
12509
12487
  if (!params.end)
12510
12488
  params.end = { x: 100, y: 100 };
12511
12489
  this._ref = new Konva.Arrow({
12512
- stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12513
- fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
12490
+ stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12491
+ fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
12514
12492
  strokeWidth: 4,
12515
12493
  globalCompositeOperation: "source-over",
12516
12494
  lineCap: "round",
@@ -12656,8 +12634,8 @@
12656
12634
  x: params.position.x,
12657
12635
  y: params.position.y,
12658
12636
  image: this._canvasImage,
12659
- width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
12660
- height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
12637
+ width: (_a = params.width) !== null && _a !== undefined ? _a : 0,
12638
+ height: (_b = params.height) !== null && _b !== undefined ? _b : 0,
12661
12639
  draggable: true,
12662
12640
  });
12663
12641
  this._ref.on("transform", (e) => {
@@ -12765,10 +12743,10 @@
12765
12743
  this._ref = new Konva.Shape({
12766
12744
  x: params.position.x,
12767
12745
  y: params.position.y,
12768
- width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
12769
- height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
12770
- stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
12771
- strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
12746
+ width: (_a = params.width) !== null && _a !== undefined ? _a : 200,
12747
+ height: (_b = params.height) !== null && _b !== undefined ? _b : 200,
12748
+ stroke: (_c = params.color) !== null && _c !== undefined ? _c : "#ff0000",
12749
+ strokeWidth: (_d = params.lineWidth) !== null && _d !== undefined ? _d : 4,
12772
12750
  draggable: true,
12773
12751
  strokeScaleEnabled: false,
12774
12752
  globalCompositeOperation: "source-over",
@@ -13042,9 +13020,9 @@
13042
13020
  if (!Konva)
13043
13021
  throw new Error('Markup error: Konva is not initialized. Forgot to add <script src="https://unpkg.com/konva@9/konva.min.js"></script> to your page?');
13044
13022
  this._viewer = viewer;
13045
- this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform();
13023
+ this._worldTransformer = worldTransformer !== null && worldTransformer !== undefined ? worldTransformer : new WorldTransform();
13046
13024
  this._container = container;
13047
- this._containerEvents = containerEvents !== null && containerEvents !== void 0 ? containerEvents : [];
13025
+ this._containerEvents = containerEvents !== null && containerEvents !== undefined ? containerEvents : [];
13048
13026
  this._markupContainer = document.createElement("div");
13049
13027
  this._markupContainer.id = "markup-container";
13050
13028
  this._markupContainer.style.position = "absolute";
@@ -13074,9 +13052,9 @@
13074
13052
  // this._containerEvents.forEach((x) => this._markupContainer.removeEventListener(x, this.redirectToViewer));
13075
13053
  }
13076
13054
  this.destroyKonva();
13077
- (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
13055
+ (_a = this._resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
13078
13056
  this._resizeObserver = undefined;
13079
- (_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
13057
+ (_b = this._markupContainer) === null || _b === undefined ? undefined : _b.remove();
13080
13058
  this._markupContainer = undefined;
13081
13059
  this._container = undefined;
13082
13060
  this._viewer = undefined;
@@ -13099,11 +13077,11 @@
13099
13077
  }
13100
13078
  colorizeAllMarkup(r, g, b) {
13101
13079
  const hexColor = new MarkupColor(r, g, b).asHex();
13102
- this.getObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor); });
13080
+ this.getObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor); });
13103
13081
  }
13104
13082
  colorizeSelectedMarkups(r, g, b) {
13105
13083
  const hexColor = new MarkupColor(r, g, b).asHex();
13106
- this.getSelectedObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor); });
13084
+ this.getSelectedObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor); });
13107
13085
  }
13108
13086
  setViewpoint(viewpoint) {
13109
13087
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -13112,9 +13090,9 @@
13112
13090
  this.removeImageInput();
13113
13091
  this._konvaStage.scale({ x: 1, y: 1 });
13114
13092
  this._konvaStage.position({ x: 0, y: 0 });
13115
- const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || { r: 255, g: 0, b: 0 };
13093
+ const markupColor = ((_a = viewpoint.custom_fields) === null || _a === undefined ? undefined : _a.markup_color) || { r: 255, g: 0, b: 0 };
13116
13094
  this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
13117
- (_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach((line) => {
13095
+ (_b = viewpoint.lines) === null || _b === undefined ? undefined : _b.forEach((line) => {
13118
13096
  const linePoints = [];
13119
13097
  line.points.forEach((point) => {
13120
13098
  const screenPoint = this._worldTransformer.worldToScreen(point);
@@ -13123,28 +13101,28 @@
13123
13101
  });
13124
13102
  this.addLine(linePoints, line.color, line.type, line.width, line.id);
13125
13103
  });
13126
- (_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach((text) => {
13104
+ (_c = viewpoint.texts) === null || _c === undefined ? undefined : _c.forEach((text) => {
13127
13105
  const screenPoint = this._worldTransformer.worldToScreen(text.position);
13128
13106
  this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
13129
13107
  });
13130
- (_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach((rect) => {
13108
+ (_d = viewpoint.rectangles) === null || _d === undefined ? undefined : _d.forEach((rect) => {
13131
13109
  const screenPoint = this._worldTransformer.worldToScreen(rect.position);
13132
13110
  this.addRectangle(screenPoint, rect.width, rect.height, rect.line_width, rect.color, rect.id);
13133
13111
  });
13134
- (_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach((ellipse) => {
13112
+ (_e = viewpoint.ellipses) === null || _e === undefined ? undefined : _e.forEach((ellipse) => {
13135
13113
  const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
13136
13114
  this.addEllipse(screenPoint, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
13137
13115
  });
13138
- (_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach((arrow) => {
13116
+ (_f = viewpoint.arrows) === null || _f === undefined ? undefined : _f.forEach((arrow) => {
13139
13117
  const startPoint = this._worldTransformer.worldToScreen(arrow.start);
13140
13118
  const endPoint = this._worldTransformer.worldToScreen(arrow.end);
13141
13119
  this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
13142
13120
  });
13143
- (_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach((cloud) => {
13121
+ (_g = viewpoint.clouds) === null || _g === undefined ? undefined : _g.forEach((cloud) => {
13144
13122
  const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
13145
13123
  this.addCloud(screenPoint, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
13146
13124
  });
13147
- (_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach((image) => {
13125
+ (_h = viewpoint.images) === null || _h === undefined ? undefined : _h.forEach((image) => {
13148
13126
  const screenPoint = this._worldTransformer.worldToScreen(image.position);
13149
13127
  this.addImage(screenPoint, image.src, image.width, image.height, image.id);
13150
13128
  });
@@ -13461,7 +13439,7 @@
13461
13439
  this.removeTextInput();
13462
13440
  this.removeImageInput();
13463
13441
  this.clearOverlay();
13464
- (_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
13442
+ (_a = this._konvaStage) === null || _a === undefined ? undefined : _a.destroy();
13465
13443
  this._groupImages = undefined;
13466
13444
  this._groupGeometry = undefined;
13467
13445
  this._groupTexts = undefined;
@@ -13699,7 +13677,7 @@
13699
13677
  }
13700
13678
  removeTextInput() {
13701
13679
  var _a;
13702
- (_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
13680
+ (_a = this._textInputRef) === null || _a === undefined ? undefined : _a.remove();
13703
13681
  this._textInputRef = null;
13704
13682
  this._textInputPos = null;
13705
13683
  this._textInputAngle = 0;
@@ -13742,7 +13720,7 @@
13742
13720
  }
13743
13721
  removeImageInput() {
13744
13722
  var _a;
13745
- (_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
13723
+ (_a = this._imageInputRef) === null || _a === undefined ? undefined : _a.remove();
13746
13724
  this._imageInputRef = null;
13747
13725
  this._imageInputPos = null;
13748
13726
  }
@@ -13751,7 +13729,7 @@
13751
13729
  if (!text)
13752
13730
  return;
13753
13731
  // in case of edit - remove old Konva.Text object
13754
- (_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
13732
+ (_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
13755
13733
  this.clearSelected();
13756
13734
  this.removeTextInput();
13757
13735
  // in case we have old viewpoint without font_size
@@ -13830,7 +13808,7 @@
13830
13808
  if (!position || !src)
13831
13809
  return;
13832
13810
  // in case of edit - remove old Image placeholder object
13833
- (_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
13811
+ (_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
13834
13812
  this.clearSelected();
13835
13813
  this.removeImageInput();
13836
13814
  const konvaImage = new KonvaImage({