@inweb/markup 26.3.2 → 26.3.3

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