@inweb/viewer-three 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/viewer-three.js +302 -278
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +2 -2
- package/dist/viewer-three.module.js +107 -107
- package/dist/viewer-three.module.js.map +1 -1
- package/package.json +5 -5
- package/src/Viewer/commands/ClearSelected.ts +3 -3
- package/src/Viewer/commands/SetSelected.ts +3 -3
package/dist/viewer-three.js
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
const {handler: handler, thisArg: thisArg} = command;
|
|
41
41
|
const result = handler.apply(thisArg, [ viewer, ...args ]);
|
|
42
|
-
viewer === null || viewer ===
|
|
42
|
+
viewer === null || viewer === void 0 ? void 0 : viewer.emit({
|
|
43
43
|
type: "command",
|
|
44
44
|
data: id,
|
|
45
45
|
args: args
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
hasRequiredGlobal = 1;
|
|
485
485
|
(function (exports) {
|
|
486
486
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
487
|
-
exports._registerNode = exports.Konva = exports.glob =
|
|
487
|
+
exports._registerNode = exports.Konva = exports.glob = void 0;
|
|
488
488
|
const PI_OVER_180 = Math.PI / 180;
|
|
489
489
|
function detectBrowser() {
|
|
490
490
|
return (typeof window !== 'undefined' &&
|
|
@@ -500,7 +500,7 @@
|
|
|
500
500
|
: {};
|
|
501
501
|
exports.Konva = {
|
|
502
502
|
_global: exports.glob,
|
|
503
|
-
version: '9.3.
|
|
503
|
+
version: '9.3.20',
|
|
504
504
|
isBrowser: detectBrowser(),
|
|
505
505
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
506
506
|
dblClickWindow: 400,
|
|
@@ -532,7 +532,7 @@
|
|
|
532
532
|
},
|
|
533
533
|
isTransforming() {
|
|
534
534
|
var _a;
|
|
535
|
-
return (_a = exports.Konva['Transformer']) === null || _a ===
|
|
535
|
+
return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
|
|
536
536
|
},
|
|
537
537
|
isDragReady() {
|
|
538
538
|
return !!exports.Konva['DD'].node;
|
|
@@ -561,7 +561,7 @@
|
|
|
561
561
|
hasRequiredUtil = 1;
|
|
562
562
|
(function (exports) {
|
|
563
563
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
564
|
-
exports.Util = exports.Transform =
|
|
564
|
+
exports.Util = exports.Transform = void 0;
|
|
565
565
|
const Global_1 = requireGlobal();
|
|
566
566
|
class Transform {
|
|
567
567
|
constructor(m = [1, 0, 0, 1, 0, 0]) {
|
|
@@ -1579,7 +1579,7 @@
|
|
|
1579
1579
|
hasRequiredFactory = 1;
|
|
1580
1580
|
(function (exports) {
|
|
1581
1581
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1582
|
-
exports.Factory =
|
|
1582
|
+
exports.Factory = void 0;
|
|
1583
1583
|
const Util_1 = requireUtil();
|
|
1584
1584
|
const Validators_1 = requireValidators();
|
|
1585
1585
|
const GET = 'get';
|
|
@@ -1717,7 +1717,7 @@
|
|
|
1717
1717
|
if (hasRequiredContext) return Context;
|
|
1718
1718
|
hasRequiredContext = 1;
|
|
1719
1719
|
Object.defineProperty(Context, "__esModule", { value: true });
|
|
1720
|
-
Context.HitContext = Context.SceneContext = Context.Context =
|
|
1720
|
+
Context.HitContext = Context.SceneContext = Context.Context = void 0;
|
|
1721
1721
|
const Util_1 = requireUtil();
|
|
1722
1722
|
const Global_1 = requireGlobal();
|
|
1723
1723
|
function simplifyArray(arr) {
|
|
@@ -2206,7 +2206,7 @@
|
|
|
2206
2206
|
}
|
|
2207
2207
|
_applyShadow(shape) {
|
|
2208
2208
|
var _a, _b, _c;
|
|
2209
|
-
const color = (_a = shape.getShadowRGBA()) !== null && _a !==
|
|
2209
|
+
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 : {
|
|
2210
2210
|
x: 0,
|
|
2211
2211
|
y: 0,
|
|
2212
2212
|
}, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
|
|
@@ -2265,12 +2265,10 @@
|
|
|
2265
2265
|
if (hasRequiredCanvas) return Canvas;
|
|
2266
2266
|
hasRequiredCanvas = 1;
|
|
2267
2267
|
Object.defineProperty(Canvas, "__esModule", { value: true });
|
|
2268
|
-
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas =
|
|
2268
|
+
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
|
|
2269
2269
|
const Util_1 = requireUtil();
|
|
2270
2270
|
const Context_1 = requireContext();
|
|
2271
2271
|
const Global_1 = requireGlobal();
|
|
2272
|
-
const Factory_1 = requireFactory();
|
|
2273
|
-
const Validators_1 = requireValidators();
|
|
2274
2272
|
let _pixelRatio;
|
|
2275
2273
|
function getDevicePixelRatio() {
|
|
2276
2274
|
if (_pixelRatio) {
|
|
@@ -2359,7 +2357,6 @@
|
|
|
2359
2357
|
}
|
|
2360
2358
|
};
|
|
2361
2359
|
Canvas.Canvas = Canvas$1;
|
|
2362
|
-
Factory_1.Factory.addGetterSetter(Canvas$1, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());
|
|
2363
2360
|
class SceneCanvas extends Canvas$1 {
|
|
2364
2361
|
constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
|
|
2365
2362
|
super(config);
|
|
@@ -2391,7 +2388,7 @@
|
|
|
2391
2388
|
hasRequiredDragAndDrop = 1;
|
|
2392
2389
|
(function (exports) {
|
|
2393
2390
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2394
|
-
exports.DD =
|
|
2391
|
+
exports.DD = void 0;
|
|
2395
2392
|
const Global_1 = requireGlobal();
|
|
2396
2393
|
const Util_1 = requireUtil();
|
|
2397
2394
|
exports.DD = {
|
|
@@ -2512,7 +2509,7 @@
|
|
|
2512
2509
|
if (hasRequiredNode) return Node;
|
|
2513
2510
|
hasRequiredNode = 1;
|
|
2514
2511
|
Object.defineProperty(Node, "__esModule", { value: true });
|
|
2515
|
-
Node.Node =
|
|
2512
|
+
Node.Node = void 0;
|
|
2516
2513
|
const Util_1 = requireUtil();
|
|
2517
2514
|
const Factory_1 = requireFactory();
|
|
2518
2515
|
const Canvas_1 = requireCanvas();
|
|
@@ -3417,7 +3414,7 @@
|
|
|
3417
3414
|
var _a, _b;
|
|
3418
3415
|
const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
|
|
3419
3416
|
m.reset();
|
|
3420
|
-
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !==
|
|
3417
|
+
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;
|
|
3421
3418
|
if (x !== 0 || y !== 0) {
|
|
3422
3419
|
m.translate(x, y);
|
|
3423
3420
|
}
|
|
@@ -3619,7 +3616,7 @@
|
|
|
3619
3616
|
_requestDraw() {
|
|
3620
3617
|
if (Global_1.Konva.autoDrawEnabled) {
|
|
3621
3618
|
const drawNode = this.getLayer() || this.getStage();
|
|
3622
|
-
drawNode === null || drawNode ===
|
|
3619
|
+
drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
|
|
3623
3620
|
}
|
|
3624
3621
|
}
|
|
3625
3622
|
_setAttr(key, val) {
|
|
@@ -3680,13 +3677,13 @@
|
|
|
3680
3677
|
}
|
|
3681
3678
|
_getProtoListeners(eventType) {
|
|
3682
3679
|
var _a, _b, _c;
|
|
3683
|
-
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !==
|
|
3684
|
-
let events = allListeners === null || allListeners ===
|
|
3680
|
+
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};
|
|
3681
|
+
let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
|
|
3685
3682
|
if (events === undefined) {
|
|
3686
3683
|
events = [];
|
|
3687
3684
|
let obj = Object.getPrototypeOf(this);
|
|
3688
3685
|
while (obj) {
|
|
3689
|
-
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b ===
|
|
3686
|
+
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];
|
|
3690
3687
|
events.push(...hierarchyEvents);
|
|
3691
3688
|
obj = Object.getPrototypeOf(obj);
|
|
3692
3689
|
}
|
|
@@ -3952,7 +3949,7 @@
|
|
|
3952
3949
|
if (hasRequiredContainer) return Container;
|
|
3953
3950
|
hasRequiredContainer = 1;
|
|
3954
3951
|
Object.defineProperty(Container, "__esModule", { value: true });
|
|
3955
|
-
Container.Container =
|
|
3952
|
+
Container.Container = void 0;
|
|
3956
3953
|
const Factory_1 = requireFactory();
|
|
3957
3954
|
const Node_1 = requireNode();
|
|
3958
3955
|
const Validators_1 = requireValidators();
|
|
@@ -4109,13 +4106,13 @@
|
|
|
4109
4106
|
if (this.isCached()) {
|
|
4110
4107
|
return;
|
|
4111
4108
|
}
|
|
4112
|
-
(_a = this.children) === null || _a ===
|
|
4109
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
|
|
4113
4110
|
node._clearSelfAndDescendantCache(attr);
|
|
4114
4111
|
});
|
|
4115
4112
|
}
|
|
4116
4113
|
_setChildrenIndices() {
|
|
4117
4114
|
var _a;
|
|
4118
|
-
(_a = this.children) === null || _a ===
|
|
4115
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
|
|
4119
4116
|
child.index = n;
|
|
4120
4117
|
});
|
|
4121
4118
|
this._requestDraw();
|
|
@@ -4186,7 +4183,7 @@
|
|
|
4186
4183
|
context.save();
|
|
4187
4184
|
context._applyGlobalCompositeOperation(this);
|
|
4188
4185
|
}
|
|
4189
|
-
(_a = this.children) === null || _a ===
|
|
4186
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
4190
4187
|
child[drawMethod](canvas, top, bufferCanvas);
|
|
4191
4188
|
});
|
|
4192
4189
|
if (hasComposition) {
|
|
@@ -4208,7 +4205,7 @@
|
|
|
4208
4205
|
height: 0,
|
|
4209
4206
|
};
|
|
4210
4207
|
const that = this;
|
|
4211
|
-
(_a = this.children) === null || _a ===
|
|
4208
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
4212
4209
|
if (!child.visible()) {
|
|
4213
4210
|
return;
|
|
4214
4211
|
}
|
|
@@ -4340,7 +4337,7 @@
|
|
|
4340
4337
|
hasRequiredStage = 1;
|
|
4341
4338
|
(function (exports) {
|
|
4342
4339
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4343
|
-
exports.Stage = exports.stages =
|
|
4340
|
+
exports.Stage = exports.stages = void 0;
|
|
4344
4341
|
const Util_1 = requireUtil();
|
|
4345
4342
|
const Factory_1 = requireFactory();
|
|
4346
4343
|
const Container_1 = requireContainer();
|
|
@@ -5057,7 +5054,7 @@
|
|
|
5057
5054
|
hasRequiredShape = 1;
|
|
5058
5055
|
(function (exports) {
|
|
5059
5056
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5060
|
-
exports.Shape = exports.shapes =
|
|
5057
|
+
exports.Shape = exports.shapes = void 0;
|
|
5061
5058
|
const Global_1 = requireGlobal();
|
|
5062
5059
|
const Util_1 = requireUtil();
|
|
5063
5060
|
const Factory_1 = requireFactory();
|
|
@@ -5290,7 +5287,7 @@
|
|
|
5290
5287
|
}
|
|
5291
5288
|
_useBufferCanvas(forceFill) {
|
|
5292
5289
|
var _a;
|
|
5293
|
-
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !==
|
|
5290
|
+
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
|
|
5294
5291
|
if (!perfectDrawEnabled) {
|
|
5295
5292
|
return false;
|
|
5296
5293
|
}
|
|
@@ -5610,7 +5607,7 @@
|
|
|
5610
5607
|
if (hasRequiredLayer) return Layer;
|
|
5611
5608
|
hasRequiredLayer = 1;
|
|
5612
5609
|
Object.defineProperty(Layer, "__esModule", { value: true });
|
|
5613
|
-
Layer.Layer =
|
|
5610
|
+
Layer.Layer = void 0;
|
|
5614
5611
|
const Util_1 = requireUtil();
|
|
5615
5612
|
const Container_1 = requireContainer();
|
|
5616
5613
|
const Node_1 = requireNode();
|
|
@@ -5928,7 +5925,7 @@
|
|
|
5928
5925
|
if (hasRequiredFastLayer) return FastLayer;
|
|
5929
5926
|
hasRequiredFastLayer = 1;
|
|
5930
5927
|
Object.defineProperty(FastLayer, "__esModule", { value: true });
|
|
5931
|
-
FastLayer.FastLayer =
|
|
5928
|
+
FastLayer.FastLayer = void 0;
|
|
5932
5929
|
const Util_1 = requireUtil();
|
|
5933
5930
|
const Layer_1 = requireLayer();
|
|
5934
5931
|
const Global_1 = requireGlobal();
|
|
@@ -5953,7 +5950,7 @@
|
|
|
5953
5950
|
if (hasRequiredGroup) return Group$1;
|
|
5954
5951
|
hasRequiredGroup = 1;
|
|
5955
5952
|
Object.defineProperty(Group$1, "__esModule", { value: true });
|
|
5956
|
-
Group$1.Group =
|
|
5953
|
+
Group$1.Group = void 0;
|
|
5957
5954
|
const Util_1 = requireUtil();
|
|
5958
5955
|
const Container_1 = requireContainer();
|
|
5959
5956
|
const Global_1 = requireGlobal();
|
|
@@ -5979,7 +5976,7 @@
|
|
|
5979
5976
|
if (hasRequiredAnimation) return Animation;
|
|
5980
5977
|
hasRequiredAnimation = 1;
|
|
5981
5978
|
Object.defineProperty(Animation, "__esModule", { value: true });
|
|
5982
|
-
Animation.Animation =
|
|
5979
|
+
Animation.Animation = void 0;
|
|
5983
5980
|
const Global_1 = requireGlobal();
|
|
5984
5981
|
const Util_1 = requireUtil();
|
|
5985
5982
|
const now = (function () {
|
|
@@ -6135,7 +6132,7 @@
|
|
|
6135
6132
|
hasRequiredTween = 1;
|
|
6136
6133
|
(function (exports) {
|
|
6137
6134
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6138
|
-
exports.Easings = exports.Tween =
|
|
6135
|
+
exports.Easings = exports.Tween = void 0;
|
|
6139
6136
|
const Util_1 = requireUtil();
|
|
6140
6137
|
const Animation_1 = requireAnimation();
|
|
6141
6138
|
const Node_1 = requireNode();
|
|
@@ -6668,7 +6665,7 @@
|
|
|
6668
6665
|
hasRequired_CoreInternals = 1;
|
|
6669
6666
|
(function (exports) {
|
|
6670
6667
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6671
|
-
exports.Konva =
|
|
6668
|
+
exports.Konva = void 0;
|
|
6672
6669
|
const Global_1 = requireGlobal();
|
|
6673
6670
|
const Util_1 = requireUtil();
|
|
6674
6671
|
const Node_1 = requireNode();
|
|
@@ -6715,7 +6712,7 @@
|
|
|
6715
6712
|
if (hasRequiredArc) return Arc;
|
|
6716
6713
|
hasRequiredArc = 1;
|
|
6717
6714
|
Object.defineProperty(Arc, "__esModule", { value: true });
|
|
6718
|
-
Arc.Arc =
|
|
6715
|
+
Arc.Arc = void 0;
|
|
6719
6716
|
const Factory_1 = requireFactory();
|
|
6720
6717
|
const Shape_1 = requireShape();
|
|
6721
6718
|
const Global_1 = requireGlobal();
|
|
@@ -6766,7 +6763,12 @@
|
|
|
6766
6763
|
Arc.Arc = Arc$1;
|
|
6767
6764
|
Arc$1.prototype._centroid = true;
|
|
6768
6765
|
Arc$1.prototype.className = 'Arc';
|
|
6769
|
-
Arc$1.prototype._attrsAffectingSize = [
|
|
6766
|
+
Arc$1.prototype._attrsAffectingSize = [
|
|
6767
|
+
'innerRadius',
|
|
6768
|
+
'outerRadius',
|
|
6769
|
+
'angle',
|
|
6770
|
+
'clockwise',
|
|
6771
|
+
];
|
|
6770
6772
|
(0, Global_2._registerNode)(Arc$1);
|
|
6771
6773
|
Factory_1.Factory.addGetterSetter(Arc$1, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
|
|
6772
6774
|
Factory_1.Factory.addGetterSetter(Arc$1, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
|
|
@@ -6785,7 +6787,7 @@
|
|
|
6785
6787
|
if (hasRequiredLine) return Line$1;
|
|
6786
6788
|
hasRequiredLine = 1;
|
|
6787
6789
|
Object.defineProperty(Line$1, "__esModule", { value: true });
|
|
6788
|
-
Line$1.Line =
|
|
6790
|
+
Line$1.Line = void 0;
|
|
6789
6791
|
const Factory_1 = requireFactory();
|
|
6790
6792
|
const Global_1 = requireGlobal();
|
|
6791
6793
|
const Shape_1 = requireShape();
|
|
@@ -6956,7 +6958,7 @@
|
|
|
6956
6958
|
hasRequiredBezierFunctions = 1;
|
|
6957
6959
|
(function (exports) {
|
|
6958
6960
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6959
|
-
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues =
|
|
6961
|
+
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
|
|
6960
6962
|
exports.tValues = [
|
|
6961
6963
|
[],
|
|
6962
6964
|
[],
|
|
@@ -7754,7 +7756,7 @@
|
|
|
7754
7756
|
if (hasRequiredPath) return Path;
|
|
7755
7757
|
hasRequiredPath = 1;
|
|
7756
7758
|
Object.defineProperty(Path, "__esModule", { value: true });
|
|
7757
|
-
Path.Path =
|
|
7759
|
+
Path.Path = void 0;
|
|
7758
7760
|
const Factory_1 = requireFactory();
|
|
7759
7761
|
const Shape_1 = requireShape();
|
|
7760
7762
|
const Global_1 = requireGlobal();
|
|
@@ -7937,8 +7939,8 @@
|
|
|
7937
7939
|
return null;
|
|
7938
7940
|
}
|
|
7939
7941
|
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
|
7940
|
-
fromX = fromX !== null && fromX !==
|
|
7941
|
-
fromY = fromY !== null && fromY !==
|
|
7942
|
+
fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
|
|
7943
|
+
fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
|
|
7942
7944
|
const len = this.getLineLength(P1x, P1y, P2x, P2y);
|
|
7943
7945
|
if (len < 1e-10) {
|
|
7944
7946
|
return { x: P1x, y: P1y };
|
|
@@ -8367,7 +8369,7 @@
|
|
|
8367
8369
|
if (hasRequiredArrow) return Arrow;
|
|
8368
8370
|
hasRequiredArrow = 1;
|
|
8369
8371
|
Object.defineProperty(Arrow, "__esModule", { value: true });
|
|
8370
|
-
Arrow.Arrow =
|
|
8372
|
+
Arrow.Arrow = void 0;
|
|
8371
8373
|
const Factory_1 = requireFactory();
|
|
8372
8374
|
const Line_1 = requireLine();
|
|
8373
8375
|
const Validators_1 = requireValidators();
|
|
@@ -8479,7 +8481,7 @@
|
|
|
8479
8481
|
if (hasRequiredCircle) return Circle;
|
|
8480
8482
|
hasRequiredCircle = 1;
|
|
8481
8483
|
Object.defineProperty(Circle, "__esModule", { value: true });
|
|
8482
|
-
Circle.Circle =
|
|
8484
|
+
Circle.Circle = void 0;
|
|
8483
8485
|
const Factory_1 = requireFactory();
|
|
8484
8486
|
const Shape_1 = requireShape();
|
|
8485
8487
|
const Validators_1 = requireValidators();
|
|
@@ -8525,7 +8527,7 @@
|
|
|
8525
8527
|
if (hasRequiredEllipse) return Ellipse;
|
|
8526
8528
|
hasRequiredEllipse = 1;
|
|
8527
8529
|
Object.defineProperty(Ellipse, "__esModule", { value: true });
|
|
8528
|
-
Ellipse.Ellipse =
|
|
8530
|
+
Ellipse.Ellipse = void 0;
|
|
8529
8531
|
const Factory_1 = requireFactory();
|
|
8530
8532
|
const Shape_1 = requireShape();
|
|
8531
8533
|
const Validators_1 = requireValidators();
|
|
@@ -8575,7 +8577,7 @@
|
|
|
8575
8577
|
if (hasRequiredImage) return Image$1;
|
|
8576
8578
|
hasRequiredImage = 1;
|
|
8577
8579
|
Object.defineProperty(Image$1, "__esModule", { value: true });
|
|
8578
|
-
Image$1.Image =
|
|
8580
|
+
Image$1.Image = void 0;
|
|
8579
8581
|
const Util_1 = requireUtil();
|
|
8580
8582
|
const Factory_1 = requireFactory();
|
|
8581
8583
|
const Shape_1 = requireShape();
|
|
@@ -8584,7 +8586,11 @@
|
|
|
8584
8586
|
class Image extends Shape_1.Shape {
|
|
8585
8587
|
constructor(attrs) {
|
|
8586
8588
|
super(attrs);
|
|
8587
|
-
this.
|
|
8589
|
+
this._loadListener = () => {
|
|
8590
|
+
this._requestDraw();
|
|
8591
|
+
};
|
|
8592
|
+
this.on('imageChange.konva', (props) => {
|
|
8593
|
+
this._removeImageLoad(props.oldVal);
|
|
8588
8594
|
this._setImageLoad();
|
|
8589
8595
|
});
|
|
8590
8596
|
this._setImageLoad();
|
|
@@ -8598,11 +8604,19 @@
|
|
|
8598
8604
|
return;
|
|
8599
8605
|
}
|
|
8600
8606
|
if (image && image['addEventListener']) {
|
|
8601
|
-
image['addEventListener']('load',
|
|
8602
|
-
|
|
8603
|
-
|
|
8607
|
+
image['addEventListener']('load', this._loadListener);
|
|
8608
|
+
}
|
|
8609
|
+
}
|
|
8610
|
+
_removeImageLoad(image) {
|
|
8611
|
+
if (image && image['removeEventListener']) {
|
|
8612
|
+
image['removeEventListener']('load', this._loadListener);
|
|
8604
8613
|
}
|
|
8605
8614
|
}
|
|
8615
|
+
destroy() {
|
|
8616
|
+
this._removeImageLoad(this.image());
|
|
8617
|
+
super.destroy();
|
|
8618
|
+
return this;
|
|
8619
|
+
}
|
|
8606
8620
|
_useBufferCanvas() {
|
|
8607
8621
|
const hasCornerRadius = !!this.cornerRadius();
|
|
8608
8622
|
const hasShadow = this.hasShadow();
|
|
@@ -8666,11 +8680,11 @@
|
|
|
8666
8680
|
}
|
|
8667
8681
|
getWidth() {
|
|
8668
8682
|
var _a, _b;
|
|
8669
|
-
return (_a = this.attrs.width) !== null && _a !==
|
|
8683
|
+
return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;
|
|
8670
8684
|
}
|
|
8671
8685
|
getHeight() {
|
|
8672
8686
|
var _a, _b;
|
|
8673
|
-
return (_a = this.attrs.height) !== null && _a !==
|
|
8687
|
+
return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
|
|
8674
8688
|
}
|
|
8675
8689
|
static fromURL(url, callback, onError = null) {
|
|
8676
8690
|
const img = Util_1.Util.createImageElement();
|
|
@@ -8706,7 +8720,7 @@
|
|
|
8706
8720
|
if (hasRequiredLabel) return Label;
|
|
8707
8721
|
hasRequiredLabel = 1;
|
|
8708
8722
|
Object.defineProperty(Label, "__esModule", { value: true });
|
|
8709
|
-
Label.Tag = Label.Label =
|
|
8723
|
+
Label.Tag = Label.Label = void 0;
|
|
8710
8724
|
const Factory_1 = requireFactory();
|
|
8711
8725
|
const Shape_1 = requireShape();
|
|
8712
8726
|
const Group_1 = requireGroup();
|
|
@@ -8893,7 +8907,7 @@
|
|
|
8893
8907
|
if (hasRequiredRect) return Rect;
|
|
8894
8908
|
hasRequiredRect = 1;
|
|
8895
8909
|
Object.defineProperty(Rect, "__esModule", { value: true });
|
|
8896
|
-
Rect.Rect =
|
|
8910
|
+
Rect.Rect = void 0;
|
|
8897
8911
|
const Factory_1 = requireFactory();
|
|
8898
8912
|
const Shape_1 = requireShape();
|
|
8899
8913
|
const Global_1 = requireGlobal();
|
|
@@ -8928,7 +8942,7 @@
|
|
|
8928
8942
|
if (hasRequiredRegularPolygon) return RegularPolygon;
|
|
8929
8943
|
hasRequiredRegularPolygon = 1;
|
|
8930
8944
|
Object.defineProperty(RegularPolygon, "__esModule", { value: true });
|
|
8931
|
-
RegularPolygon.RegularPolygon =
|
|
8945
|
+
RegularPolygon.RegularPolygon = void 0;
|
|
8932
8946
|
const Factory_1 = requireFactory();
|
|
8933
8947
|
const Shape_1 = requireShape();
|
|
8934
8948
|
const Validators_1 = requireValidators();
|
|
@@ -9006,7 +9020,7 @@
|
|
|
9006
9020
|
if (hasRequiredRing) return Ring;
|
|
9007
9021
|
hasRequiredRing = 1;
|
|
9008
9022
|
Object.defineProperty(Ring, "__esModule", { value: true });
|
|
9009
|
-
Ring.Ring =
|
|
9023
|
+
Ring.Ring = void 0;
|
|
9010
9024
|
const Factory_1 = requireFactory();
|
|
9011
9025
|
const Shape_1 = requireShape();
|
|
9012
9026
|
const Validators_1 = requireValidators();
|
|
@@ -9052,7 +9066,7 @@
|
|
|
9052
9066
|
if (hasRequiredSprite) return Sprite$1;
|
|
9053
9067
|
hasRequiredSprite = 1;
|
|
9054
9068
|
Object.defineProperty(Sprite$1, "__esModule", { value: true });
|
|
9055
|
-
Sprite$1.Sprite =
|
|
9069
|
+
Sprite$1.Sprite = void 0;
|
|
9056
9070
|
const Factory_1 = requireFactory();
|
|
9057
9071
|
const Shape_1 = requireShape();
|
|
9058
9072
|
const Animation_1 = requireAnimation();
|
|
@@ -9173,7 +9187,7 @@
|
|
|
9173
9187
|
if (hasRequiredStar) return Star;
|
|
9174
9188
|
hasRequiredStar = 1;
|
|
9175
9189
|
Object.defineProperty(Star, "__esModule", { value: true });
|
|
9176
|
-
Star.Star =
|
|
9190
|
+
Star.Star = void 0;
|
|
9177
9191
|
const Factory_1 = requireFactory();
|
|
9178
9192
|
const Shape_1 = requireShape();
|
|
9179
9193
|
const Validators_1 = requireValidators();
|
|
@@ -9224,7 +9238,7 @@
|
|
|
9224
9238
|
if (hasRequiredText) return Text;
|
|
9225
9239
|
hasRequiredText = 1;
|
|
9226
9240
|
Object.defineProperty(Text, "__esModule", { value: true });
|
|
9227
|
-
Text.Text =
|
|
9241
|
+
Text.Text = void 0;
|
|
9228
9242
|
Text.stringToArray = stringToArray;
|
|
9229
9243
|
const Util_1 = requireUtil();
|
|
9230
9244
|
const Factory_1 = requireFactory();
|
|
@@ -9470,17 +9484,17 @@
|
|
|
9470
9484
|
_context.restore();
|
|
9471
9485
|
const scaleFactor = fontSize / 100;
|
|
9472
9486
|
return {
|
|
9473
|
-
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !==
|
|
9474
|
-
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !==
|
|
9475
|
-
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !==
|
|
9476
|
-
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !==
|
|
9477
|
-
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !==
|
|
9478
|
-
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !==
|
|
9479
|
-
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !==
|
|
9480
|
-
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !==
|
|
9481
|
-
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !==
|
|
9482
|
-
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !==
|
|
9483
|
-
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !==
|
|
9487
|
+
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,
|
|
9488
|
+
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,
|
|
9489
|
+
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
|
|
9490
|
+
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
|
|
9491
|
+
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,
|
|
9492
|
+
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
|
|
9493
|
+
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
|
|
9494
|
+
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
|
|
9495
|
+
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
|
|
9496
|
+
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
|
|
9497
|
+
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
|
|
9484
9498
|
width: metrics.width,
|
|
9485
9499
|
height: fontSize,
|
|
9486
9500
|
};
|
|
@@ -9524,8 +9538,14 @@
|
|
|
9524
9538
|
while (line.length > 0) {
|
|
9525
9539
|
let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
|
|
9526
9540
|
while (low < high) {
|
|
9527
|
-
const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr)
|
|
9528
|
-
|
|
9541
|
+
const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr);
|
|
9542
|
+
const shouldConsiderEllipsis = shouldAddEllipsis &&
|
|
9543
|
+
fixedHeight &&
|
|
9544
|
+
currentHeightPx + lineHeightPx > maxHeightPx;
|
|
9545
|
+
const effectiveWidth = shouldConsiderEllipsis
|
|
9546
|
+
? substrWidth + additionalWidth
|
|
9547
|
+
: substrWidth;
|
|
9548
|
+
if (effectiveWidth <= maxWidth) {
|
|
9529
9549
|
low = mid + 1;
|
|
9530
9550
|
match = substr;
|
|
9531
9551
|
matchWidth = substrWidth;
|
|
@@ -9672,7 +9692,7 @@
|
|
|
9672
9692
|
if (hasRequiredTextPath) return TextPath;
|
|
9673
9693
|
hasRequiredTextPath = 1;
|
|
9674
9694
|
Object.defineProperty(TextPath, "__esModule", { value: true });
|
|
9675
|
-
TextPath.TextPath =
|
|
9695
|
+
TextPath.TextPath = void 0;
|
|
9676
9696
|
const Util_1 = requireUtil();
|
|
9677
9697
|
const Factory_1 = requireFactory();
|
|
9678
9698
|
const Shape_1 = requireShape();
|
|
@@ -9922,7 +9942,7 @@
|
|
|
9922
9942
|
if (hasRequiredTransformer) return Transformer;
|
|
9923
9943
|
hasRequiredTransformer = 1;
|
|
9924
9944
|
Object.defineProperty(Transformer, "__esModule", { value: true });
|
|
9925
|
-
Transformer.Transformer =
|
|
9945
|
+
Transformer.Transformer = void 0;
|
|
9926
9946
|
const Util_1 = requireUtil();
|
|
9927
9947
|
const Factory_1 = requireFactory();
|
|
9928
9948
|
const Node_1 = requireNode();
|
|
@@ -10119,10 +10139,12 @@
|
|
|
10119
10139
|
this.update();
|
|
10120
10140
|
}
|
|
10121
10141
|
};
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10142
|
+
if (node._attrsAffectingSize.length) {
|
|
10143
|
+
const additionalEvents = node._attrsAffectingSize
|
|
10144
|
+
.map((prop) => prop + 'Change.' + this._getEventNamespace())
|
|
10145
|
+
.join(' ');
|
|
10146
|
+
node.on(additionalEvents, onChange);
|
|
10147
|
+
}
|
|
10126
10148
|
node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);
|
|
10127
10149
|
node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);
|
|
10128
10150
|
this._proxyDrag(node);
|
|
@@ -10597,12 +10619,12 @@
|
|
|
10597
10619
|
const node = this.getNode();
|
|
10598
10620
|
activeTransformersCount--;
|
|
10599
10621
|
this._fire('transformend', { evt: e, target: node });
|
|
10600
|
-
(_a = this.getLayer()) === null || _a ===
|
|
10622
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10601
10623
|
if (node) {
|
|
10602
10624
|
this._nodes.forEach((target) => {
|
|
10603
10625
|
var _a;
|
|
10604
10626
|
target._fire('transformend', { evt: e, target });
|
|
10605
|
-
(_a = target.getLayer()) === null || _a ===
|
|
10627
|
+
(_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10606
10628
|
});
|
|
10607
10629
|
}
|
|
10608
10630
|
this._movingAnchorName = null;
|
|
@@ -10715,7 +10737,7 @@
|
|
|
10715
10737
|
.multiply(localTransform);
|
|
10716
10738
|
const attrs = newLocalTransform.decompose();
|
|
10717
10739
|
node.setAttrs(attrs);
|
|
10718
|
-
(_a = node.getLayer()) === null || _a ===
|
|
10740
|
+
(_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10719
10741
|
});
|
|
10720
10742
|
this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
|
|
10721
10743
|
this._nodes.forEach((node) => {
|
|
@@ -10830,7 +10852,7 @@
|
|
|
10830
10852
|
styleFunc(node);
|
|
10831
10853
|
});
|
|
10832
10854
|
}
|
|
10833
|
-
(_a = this.getLayer()) === null || _a ===
|
|
10855
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
10834
10856
|
}
|
|
10835
10857
|
isTransforming() {
|
|
10836
10858
|
return this._transforming;
|
|
@@ -10937,7 +10959,7 @@
|
|
|
10937
10959
|
if (hasRequiredWedge) return Wedge;
|
|
10938
10960
|
hasRequiredWedge = 1;
|
|
10939
10961
|
Object.defineProperty(Wedge, "__esModule", { value: true });
|
|
10940
|
-
Wedge.Wedge =
|
|
10962
|
+
Wedge.Wedge = void 0;
|
|
10941
10963
|
const Factory_1 = requireFactory();
|
|
10942
10964
|
const Shape_1 = requireShape();
|
|
10943
10965
|
const Global_1 = requireGlobal();
|
|
@@ -10988,7 +11010,7 @@
|
|
|
10988
11010
|
if (hasRequiredBlur) return Blur;
|
|
10989
11011
|
hasRequiredBlur = 1;
|
|
10990
11012
|
Object.defineProperty(Blur, "__esModule", { value: true });
|
|
10991
|
-
Blur.Blur =
|
|
11013
|
+
Blur.Blur = void 0;
|
|
10992
11014
|
const Factory_1 = requireFactory();
|
|
10993
11015
|
const Node_1 = requireNode();
|
|
10994
11016
|
const Validators_1 = requireValidators();
|
|
@@ -11236,7 +11258,7 @@
|
|
|
11236
11258
|
if (hasRequiredBrighten) return Brighten;
|
|
11237
11259
|
hasRequiredBrighten = 1;
|
|
11238
11260
|
Object.defineProperty(Brighten, "__esModule", { value: true });
|
|
11239
|
-
Brighten.Brighten =
|
|
11261
|
+
Brighten.Brighten = void 0;
|
|
11240
11262
|
const Factory_1 = requireFactory();
|
|
11241
11263
|
const Node_1 = requireNode();
|
|
11242
11264
|
const Validators_1 = requireValidators();
|
|
@@ -11261,7 +11283,7 @@
|
|
|
11261
11283
|
if (hasRequiredContrast) return Contrast;
|
|
11262
11284
|
hasRequiredContrast = 1;
|
|
11263
11285
|
Object.defineProperty(Contrast, "__esModule", { value: true });
|
|
11264
|
-
Contrast.Contrast =
|
|
11286
|
+
Contrast.Contrast = void 0;
|
|
11265
11287
|
const Factory_1 = requireFactory();
|
|
11266
11288
|
const Node_1 = requireNode();
|
|
11267
11289
|
const Validators_1 = requireValidators();
|
|
@@ -11309,7 +11331,7 @@
|
|
|
11309
11331
|
if (hasRequiredEmboss) return Emboss;
|
|
11310
11332
|
hasRequiredEmboss = 1;
|
|
11311
11333
|
Object.defineProperty(Emboss, "__esModule", { value: true });
|
|
11312
|
-
Emboss.Emboss =
|
|
11334
|
+
Emboss.Emboss = void 0;
|
|
11313
11335
|
const Factory_1 = requireFactory();
|
|
11314
11336
|
const Node_1 = requireNode();
|
|
11315
11337
|
const Util_1 = requireUtil();
|
|
@@ -11425,7 +11447,7 @@
|
|
|
11425
11447
|
if (hasRequiredEnhance) return Enhance;
|
|
11426
11448
|
hasRequiredEnhance = 1;
|
|
11427
11449
|
Object.defineProperty(Enhance, "__esModule", { value: true });
|
|
11428
|
-
Enhance.Enhance =
|
|
11450
|
+
Enhance.Enhance = void 0;
|
|
11429
11451
|
const Factory_1 = requireFactory();
|
|
11430
11452
|
const Node_1 = requireNode();
|
|
11431
11453
|
const Validators_1 = requireValidators();
|
|
@@ -11522,7 +11544,7 @@
|
|
|
11522
11544
|
if (hasRequiredGrayscale) return Grayscale;
|
|
11523
11545
|
hasRequiredGrayscale = 1;
|
|
11524
11546
|
Object.defineProperty(Grayscale, "__esModule", { value: true });
|
|
11525
|
-
Grayscale.Grayscale =
|
|
11547
|
+
Grayscale.Grayscale = void 0;
|
|
11526
11548
|
const Grayscale$1 = function (imageData) {
|
|
11527
11549
|
const data = imageData.data, len = data.length;
|
|
11528
11550
|
for (let i = 0; i < len; i += 4) {
|
|
@@ -11544,7 +11566,7 @@
|
|
|
11544
11566
|
if (hasRequiredHSL) return HSL;
|
|
11545
11567
|
hasRequiredHSL = 1;
|
|
11546
11568
|
Object.defineProperty(HSL, "__esModule", { value: true });
|
|
11547
|
-
HSL.HSL =
|
|
11569
|
+
HSL.HSL = void 0;
|
|
11548
11570
|
const Factory_1 = requireFactory();
|
|
11549
11571
|
const Node_1 = requireNode();
|
|
11550
11572
|
const Validators_1 = requireValidators();
|
|
@@ -11581,7 +11603,7 @@
|
|
|
11581
11603
|
if (hasRequiredHSV) return HSV;
|
|
11582
11604
|
hasRequiredHSV = 1;
|
|
11583
11605
|
Object.defineProperty(HSV, "__esModule", { value: true });
|
|
11584
|
-
HSV.HSV =
|
|
11606
|
+
HSV.HSV = void 0;
|
|
11585
11607
|
const Factory_1 = requireFactory();
|
|
11586
11608
|
const Node_1 = requireNode();
|
|
11587
11609
|
const Validators_1 = requireValidators();
|
|
@@ -11618,7 +11640,7 @@
|
|
|
11618
11640
|
if (hasRequiredInvert) return Invert;
|
|
11619
11641
|
hasRequiredInvert = 1;
|
|
11620
11642
|
Object.defineProperty(Invert, "__esModule", { value: true });
|
|
11621
|
-
Invert.Invert =
|
|
11643
|
+
Invert.Invert = void 0;
|
|
11622
11644
|
const Invert$1 = function (imageData) {
|
|
11623
11645
|
const data = imageData.data, len = data.length;
|
|
11624
11646
|
for (let i = 0; i < len; i += 4) {
|
|
@@ -11639,7 +11661,7 @@
|
|
|
11639
11661
|
if (hasRequiredKaleidoscope) return Kaleidoscope;
|
|
11640
11662
|
hasRequiredKaleidoscope = 1;
|
|
11641
11663
|
Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
|
|
11642
|
-
Kaleidoscope.Kaleidoscope =
|
|
11664
|
+
Kaleidoscope.Kaleidoscope = void 0;
|
|
11643
11665
|
const Factory_1 = requireFactory();
|
|
11644
11666
|
const Node_1 = requireNode();
|
|
11645
11667
|
const Util_1 = requireUtil();
|
|
@@ -11785,7 +11807,7 @@
|
|
|
11785
11807
|
if (hasRequiredMask) return Mask;
|
|
11786
11808
|
hasRequiredMask = 1;
|
|
11787
11809
|
Object.defineProperty(Mask, "__esModule", { value: true });
|
|
11788
|
-
Mask.Mask =
|
|
11810
|
+
Mask.Mask = void 0;
|
|
11789
11811
|
const Factory_1 = requireFactory();
|
|
11790
11812
|
const Node_1 = requireNode();
|
|
11791
11813
|
const Validators_1 = requireValidators();
|
|
@@ -11939,7 +11961,7 @@
|
|
|
11939
11961
|
if (hasRequiredNoise) return Noise;
|
|
11940
11962
|
hasRequiredNoise = 1;
|
|
11941
11963
|
Object.defineProperty(Noise, "__esModule", { value: true });
|
|
11942
|
-
Noise.Noise =
|
|
11964
|
+
Noise.Noise = void 0;
|
|
11943
11965
|
const Factory_1 = requireFactory();
|
|
11944
11966
|
const Node_1 = requireNode();
|
|
11945
11967
|
const Validators_1 = requireValidators();
|
|
@@ -11964,7 +11986,7 @@
|
|
|
11964
11986
|
if (hasRequiredPixelate) return Pixelate;
|
|
11965
11987
|
hasRequiredPixelate = 1;
|
|
11966
11988
|
Object.defineProperty(Pixelate, "__esModule", { value: true });
|
|
11967
|
-
Pixelate.Pixelate =
|
|
11989
|
+
Pixelate.Pixelate = void 0;
|
|
11968
11990
|
const Factory_1 = requireFactory();
|
|
11969
11991
|
const Util_1 = requireUtil();
|
|
11970
11992
|
const Node_1 = requireNode();
|
|
@@ -12037,7 +12059,7 @@
|
|
|
12037
12059
|
if (hasRequiredPosterize) return Posterize;
|
|
12038
12060
|
hasRequiredPosterize = 1;
|
|
12039
12061
|
Object.defineProperty(Posterize, "__esModule", { value: true });
|
|
12040
|
-
Posterize.Posterize =
|
|
12062
|
+
Posterize.Posterize = void 0;
|
|
12041
12063
|
const Factory_1 = requireFactory();
|
|
12042
12064
|
const Node_1 = requireNode();
|
|
12043
12065
|
const Validators_1 = requireValidators();
|
|
@@ -12060,7 +12082,7 @@
|
|
|
12060
12082
|
if (hasRequiredRGB) return RGB;
|
|
12061
12083
|
hasRequiredRGB = 1;
|
|
12062
12084
|
Object.defineProperty(RGB, "__esModule", { value: true });
|
|
12063
|
-
RGB.RGB =
|
|
12085
|
+
RGB.RGB = void 0;
|
|
12064
12086
|
const Factory_1 = requireFactory();
|
|
12065
12087
|
const Node_1 = requireNode();
|
|
12066
12088
|
const Validators_1 = requireValidators();
|
|
@@ -12111,7 +12133,7 @@
|
|
|
12111
12133
|
if (hasRequiredRGBA) return RGBA;
|
|
12112
12134
|
hasRequiredRGBA = 1;
|
|
12113
12135
|
Object.defineProperty(RGBA, "__esModule", { value: true });
|
|
12114
|
-
RGBA.RGBA =
|
|
12136
|
+
RGBA.RGBA = void 0;
|
|
12115
12137
|
const Factory_1 = requireFactory();
|
|
12116
12138
|
const Node_1 = requireNode();
|
|
12117
12139
|
const Validators_1 = requireValidators();
|
|
@@ -12173,7 +12195,7 @@
|
|
|
12173
12195
|
if (hasRequiredSepia) return Sepia;
|
|
12174
12196
|
hasRequiredSepia = 1;
|
|
12175
12197
|
Object.defineProperty(Sepia, "__esModule", { value: true });
|
|
12176
|
-
Sepia.Sepia =
|
|
12198
|
+
Sepia.Sepia = void 0;
|
|
12177
12199
|
const Sepia$1 = function (imageData) {
|
|
12178
12200
|
const data = imageData.data, nPixels = data.length;
|
|
12179
12201
|
for (let i = 0; i < nPixels; i += 4) {
|
|
@@ -12197,7 +12219,7 @@
|
|
|
12197
12219
|
if (hasRequiredSolarize) return Solarize;
|
|
12198
12220
|
hasRequiredSolarize = 1;
|
|
12199
12221
|
Object.defineProperty(Solarize, "__esModule", { value: true });
|
|
12200
|
-
Solarize.Solarize =
|
|
12222
|
+
Solarize.Solarize = void 0;
|
|
12201
12223
|
const Solarize$1 = function (imageData) {
|
|
12202
12224
|
const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
|
|
12203
12225
|
let y = h;
|
|
@@ -12236,7 +12258,7 @@
|
|
|
12236
12258
|
if (hasRequiredThreshold) return Threshold;
|
|
12237
12259
|
hasRequiredThreshold = 1;
|
|
12238
12260
|
Object.defineProperty(Threshold, "__esModule", { value: true });
|
|
12239
|
-
Threshold.Threshold =
|
|
12261
|
+
Threshold.Threshold = void 0;
|
|
12240
12262
|
const Factory_1 = requireFactory();
|
|
12241
12263
|
const Node_1 = requireNode();
|
|
12242
12264
|
const Validators_1 = requireValidators();
|
|
@@ -12257,7 +12279,7 @@
|
|
|
12257
12279
|
if (hasRequired_FullInternals) return _FullInternals;
|
|
12258
12280
|
hasRequired_FullInternals = 1;
|
|
12259
12281
|
Object.defineProperty(_FullInternals, "__esModule", { value: true });
|
|
12260
|
-
_FullInternals.Konva =
|
|
12282
|
+
_FullInternals.Konva = void 0;
|
|
12261
12283
|
const _CoreInternals_1 = require_CoreInternals();
|
|
12262
12284
|
const Arc_1 = requireArc();
|
|
12263
12285
|
const Arrow_1 = requireArrow();
|
|
@@ -12418,8 +12440,8 @@
|
|
|
12418
12440
|
}
|
|
12419
12441
|
if (!params) params = {};
|
|
12420
12442
|
if (!params.points) params.points = [ {
|
|
12421
|
-
x:
|
|
12422
|
-
y:
|
|
12443
|
+
x: 0,
|
|
12444
|
+
y: 0
|
|
12423
12445
|
}, {
|
|
12424
12446
|
x: 100,
|
|
12425
12447
|
y: 100
|
|
@@ -12427,8 +12449,8 @@
|
|
|
12427
12449
|
const konvaPoints = [];
|
|
12428
12450
|
params.points.forEach((point => konvaPoints.push(point.x, point.y)));
|
|
12429
12451
|
this._ref = new Konva.Line({
|
|
12430
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12431
|
-
strokeWidth: (_b = params.width) !== null && _b !==
|
|
12452
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12453
|
+
strokeWidth: (_b = params.width) !== null && _b !== void 0 ? _b : 4,
|
|
12432
12454
|
globalCompositeOperation: "source-over",
|
|
12433
12455
|
lineCap: "round",
|
|
12434
12456
|
lineJoin: "round",
|
|
@@ -12527,20 +12549,20 @@
|
|
|
12527
12549
|
}
|
|
12528
12550
|
if (!params) params = {};
|
|
12529
12551
|
if (!params.position) params.position = {
|
|
12530
|
-
x:
|
|
12531
|
-
y:
|
|
12552
|
+
x: 0,
|
|
12553
|
+
y: 0
|
|
12532
12554
|
};
|
|
12533
12555
|
if (!params.text) params.text = "default";
|
|
12534
12556
|
this._ref = new Konva.Text({
|
|
12535
12557
|
x: params.position.x,
|
|
12536
12558
|
y: params.position.y,
|
|
12537
12559
|
text: params.text,
|
|
12538
|
-
fontSize: (_a = params.fontSize) !== null && _a !==
|
|
12560
|
+
fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
|
|
12539
12561
|
fontFamily: this.TEXT_FONT_FAMILY,
|
|
12540
|
-
fill: (_b = params.color) !== null && _b !==
|
|
12562
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
12541
12563
|
align: "left",
|
|
12542
12564
|
draggable: true,
|
|
12543
|
-
rotation: (_c = params.rotation) !== null && _c !==
|
|
12565
|
+
rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0
|
|
12544
12566
|
});
|
|
12545
12567
|
this._ref.width(this._ref.getTextWidth());
|
|
12546
12568
|
this._ref.on("transform", (e => {
|
|
@@ -12634,19 +12656,19 @@
|
|
|
12634
12656
|
}
|
|
12635
12657
|
if (!params) params = {};
|
|
12636
12658
|
if (!params.position) params.position = {
|
|
12637
|
-
x:
|
|
12638
|
-
y:
|
|
12659
|
+
x: 0,
|
|
12660
|
+
y: 0
|
|
12639
12661
|
};
|
|
12640
12662
|
this._ref = new Konva.Rect({
|
|
12641
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12642
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
12663
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12664
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
|
|
12643
12665
|
globalCompositeOperation: "source-over",
|
|
12644
12666
|
lineCap: "round",
|
|
12645
12667
|
lineJoin: "round",
|
|
12646
12668
|
x: params.position.x,
|
|
12647
12669
|
y: params.position.y,
|
|
12648
|
-
width: (_c = params.width) !== null && _c !==
|
|
12649
|
-
height: (_d = params.height) !== null && _d !==
|
|
12670
|
+
width: (_c = params.width) !== null && _c !== void 0 ? _c : 200,
|
|
12671
|
+
height: (_d = params.height) !== null && _d !== void 0 ? _d : 200,
|
|
12650
12672
|
draggable: true,
|
|
12651
12673
|
strokeScaleEnabled: false
|
|
12652
12674
|
});
|
|
@@ -12748,16 +12770,16 @@
|
|
|
12748
12770
|
}
|
|
12749
12771
|
if (!params) params = {};
|
|
12750
12772
|
if (!params.position) params.position = {
|
|
12751
|
-
x:
|
|
12752
|
-
y:
|
|
12773
|
+
x: 0,
|
|
12774
|
+
y: 0
|
|
12753
12775
|
};
|
|
12754
12776
|
if (!params.radius) params.radius = {
|
|
12755
12777
|
x: 25,
|
|
12756
12778
|
y: 25
|
|
12757
12779
|
};
|
|
12758
12780
|
this._ref = new Konva.Ellipse({
|
|
12759
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12760
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
12781
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12782
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
|
|
12761
12783
|
globalCompositeOperation: "source-over",
|
|
12762
12784
|
lineCap: "round",
|
|
12763
12785
|
lineJoin: "round",
|
|
@@ -12878,16 +12900,16 @@
|
|
|
12878
12900
|
}
|
|
12879
12901
|
if (!params) params = {};
|
|
12880
12902
|
if (!params.start) params.start = {
|
|
12881
|
-
x:
|
|
12882
|
-
y:
|
|
12903
|
+
x: 0,
|
|
12904
|
+
y: 0
|
|
12883
12905
|
};
|
|
12884
12906
|
if (!params.end) params.end = {
|
|
12885
12907
|
x: 100,
|
|
12886
12908
|
y: 100
|
|
12887
12909
|
};
|
|
12888
12910
|
this._ref = new Konva.Arrow({
|
|
12889
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12890
|
-
fill: (_b = params.color) !== null && _b !==
|
|
12911
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
12912
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
12891
12913
|
strokeWidth: 4,
|
|
12892
12914
|
globalCompositeOperation: "source-over",
|
|
12893
12915
|
lineCap: "round",
|
|
@@ -12994,8 +13016,8 @@
|
|
|
12994
13016
|
}
|
|
12995
13017
|
if (!params) params = {};
|
|
12996
13018
|
if (!params.position) params.position = {
|
|
12997
|
-
x:
|
|
12998
|
-
y:
|
|
13019
|
+
x: 0,
|
|
13020
|
+
y: 0
|
|
12999
13021
|
};
|
|
13000
13022
|
if (!params.src || !params.src.startsWith(this.BASE64_HEADER_START)) params.src = this.BASE64_NOT_FOUND;
|
|
13001
13023
|
this._canvasImage = new Image;
|
|
@@ -13027,8 +13049,8 @@
|
|
|
13027
13049
|
x: params.position.x,
|
|
13028
13050
|
y: params.position.y,
|
|
13029
13051
|
image: this._canvasImage,
|
|
13030
|
-
width: (_a = params.width) !== null && _a !==
|
|
13031
|
-
height: (_b = params.height) !== null && _b !==
|
|
13052
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
|
|
13053
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
|
|
13032
13054
|
draggable: true
|
|
13033
13055
|
});
|
|
13034
13056
|
this._ref.on("transform", (e => {
|
|
@@ -13131,17 +13153,17 @@
|
|
|
13131
13153
|
}
|
|
13132
13154
|
if (!params) params = {};
|
|
13133
13155
|
if (!params.position) params.position = {
|
|
13134
|
-
x:
|
|
13135
|
-
y:
|
|
13156
|
+
x: 0,
|
|
13157
|
+
y: 0
|
|
13136
13158
|
};
|
|
13137
13159
|
const arcRadius = 16;
|
|
13138
13160
|
this._ref = new Konva.Shape({
|
|
13139
13161
|
x: params.position.x,
|
|
13140
13162
|
y: params.position.y,
|
|
13141
|
-
width: (_a = params.width) !== null && _a !==
|
|
13142
|
-
height: (_b = params.height) !== null && _b !==
|
|
13143
|
-
stroke: (_c = params.color) !== null && _c !==
|
|
13144
|
-
strokeWidth: (_d = params.lineWidth) !== null && _d !==
|
|
13163
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
|
|
13164
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
|
|
13165
|
+
stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
|
|
13166
|
+
strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
|
|
13145
13167
|
draggable: true,
|
|
13146
13168
|
strokeScaleEnabled: false,
|
|
13147
13169
|
globalCompositeOperation: "source-over",
|
|
@@ -13390,9 +13412,9 @@
|
|
|
13390
13412
|
initialize(container, containerEvents, viewer, worldTransformer) {
|
|
13391
13413
|
if (!Konva) 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?');
|
|
13392
13414
|
this._viewer = viewer;
|
|
13393
|
-
this._worldTransformer = worldTransformer !== null && worldTransformer !==
|
|
13415
|
+
this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform;
|
|
13394
13416
|
this._container = container;
|
|
13395
|
-
this._containerEvents = containerEvents !== null && containerEvents !==
|
|
13417
|
+
this._containerEvents = containerEvents !== null && containerEvents !== void 0 ? containerEvents : [];
|
|
13396
13418
|
this._markupContainer = document.createElement("div");
|
|
13397
13419
|
this._markupContainer.id = "markup-container";
|
|
13398
13420
|
this._markupContainer.style.position = "absolute";
|
|
@@ -13420,9 +13442,9 @@
|
|
|
13420
13442
|
this._viewer.removeEventListener("changeactivedragger", this.changeActiveDragger);
|
|
13421
13443
|
}
|
|
13422
13444
|
this.destroyKonva();
|
|
13423
|
-
(_a = this._resizeObserver) === null || _a ===
|
|
13445
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
13424
13446
|
this._resizeObserver = undefined;
|
|
13425
|
-
(_b = this._markupContainer) === null || _b ===
|
|
13447
|
+
(_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
|
|
13426
13448
|
this._markupContainer = undefined;
|
|
13427
13449
|
this._container = undefined;
|
|
13428
13450
|
this._viewer = undefined;
|
|
@@ -13454,14 +13476,14 @@
|
|
|
13454
13476
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
13455
13477
|
this.getObjects().filter((obj => {
|
|
13456
13478
|
var _a;
|
|
13457
|
-
return (_a = obj.setColor) === null || _a ===
|
|
13479
|
+
return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
|
|
13458
13480
|
}));
|
|
13459
13481
|
}
|
|
13460
13482
|
colorizeSelectedMarkups(r, g, b) {
|
|
13461
13483
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
13462
13484
|
this.getSelectedObjects().filter((obj => {
|
|
13463
13485
|
var _a;
|
|
13464
|
-
return (_a = obj.setColor) === null || _a ===
|
|
13486
|
+
return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
|
|
13465
13487
|
}));
|
|
13466
13488
|
}
|
|
13467
13489
|
setViewpoint(viewpoint) {
|
|
@@ -13477,13 +13499,13 @@
|
|
|
13477
13499
|
x: 0,
|
|
13478
13500
|
y: 0
|
|
13479
13501
|
});
|
|
13480
|
-
const markupColor = ((_a = viewpoint.custom_fields) === null || _a ===
|
|
13502
|
+
const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || {
|
|
13481
13503
|
r: 255,
|
|
13482
13504
|
g: 0,
|
|
13483
13505
|
b: 0
|
|
13484
13506
|
};
|
|
13485
13507
|
this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
|
|
13486
|
-
(_b = viewpoint.lines) === null || _b ===
|
|
13508
|
+
(_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach((line => {
|
|
13487
13509
|
const linePoints = [];
|
|
13488
13510
|
line.points.forEach((point => {
|
|
13489
13511
|
const screenPoint = this._worldTransformer.worldToScreen(point);
|
|
@@ -13492,28 +13514,28 @@
|
|
|
13492
13514
|
}));
|
|
13493
13515
|
this.addLine(linePoints, line.color, line.type, line.width, line.id);
|
|
13494
13516
|
}));
|
|
13495
|
-
(_c = viewpoint.texts) === null || _c ===
|
|
13517
|
+
(_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach((text => {
|
|
13496
13518
|
const screenPoint = this._worldTransformer.worldToScreen(text.position);
|
|
13497
13519
|
this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
|
|
13498
13520
|
}));
|
|
13499
|
-
(_d = viewpoint.rectangles) === null || _d ===
|
|
13521
|
+
(_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach((rect => {
|
|
13500
13522
|
const screenPoint = this._worldTransformer.worldToScreen(rect.position);
|
|
13501
13523
|
this.addRectangle(screenPoint, rect.width, rect.height, rect.line_width, rect.color, rect.id);
|
|
13502
13524
|
}));
|
|
13503
|
-
(_e = viewpoint.ellipses) === null || _e ===
|
|
13525
|
+
(_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach((ellipse => {
|
|
13504
13526
|
const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
|
|
13505
13527
|
this.addEllipse(screenPoint, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
|
|
13506
13528
|
}));
|
|
13507
|
-
(_f = viewpoint.arrows) === null || _f ===
|
|
13529
|
+
(_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach((arrow => {
|
|
13508
13530
|
const startPoint = this._worldTransformer.worldToScreen(arrow.start);
|
|
13509
13531
|
const endPoint = this._worldTransformer.worldToScreen(arrow.end);
|
|
13510
13532
|
this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
|
|
13511
13533
|
}));
|
|
13512
|
-
(_g = viewpoint.clouds) === null || _g ===
|
|
13534
|
+
(_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach((cloud => {
|
|
13513
13535
|
const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
|
|
13514
13536
|
this.addCloud(screenPoint, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
|
|
13515
13537
|
}));
|
|
13516
|
-
(_h = viewpoint.images) === null || _h ===
|
|
13538
|
+
(_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach((image => {
|
|
13517
13539
|
const screenPoint = this._worldTransformer.worldToScreen(image.position);
|
|
13518
13540
|
this.addImage(screenPoint, image.src, image.width, image.height, image.id);
|
|
13519
13541
|
}));
|
|
@@ -13807,7 +13829,7 @@
|
|
|
13807
13829
|
this.removeTextInput();
|
|
13808
13830
|
this.removeImageInput();
|
|
13809
13831
|
this.clearOverlay();
|
|
13810
|
-
(_a = this._konvaStage) === null || _a ===
|
|
13832
|
+
(_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
13811
13833
|
this._groupImages = undefined;
|
|
13812
13834
|
this._groupGeometry = undefined;
|
|
13813
13835
|
this._groupTexts = undefined;
|
|
@@ -14057,7 +14079,7 @@
|
|
|
14057
14079
|
}
|
|
14058
14080
|
removeTextInput() {
|
|
14059
14081
|
var _a;
|
|
14060
|
-
(_a = this._textInputRef) === null || _a ===
|
|
14082
|
+
(_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
14061
14083
|
this._textInputRef = null;
|
|
14062
14084
|
this._textInputPos = null;
|
|
14063
14085
|
this._textInputAngle = 0;
|
|
@@ -14100,14 +14122,14 @@
|
|
|
14100
14122
|
}
|
|
14101
14123
|
removeImageInput() {
|
|
14102
14124
|
var _a;
|
|
14103
|
-
(_a = this._imageInputRef) === null || _a ===
|
|
14125
|
+
(_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
14104
14126
|
this._imageInputRef = null;
|
|
14105
14127
|
this._imageInputPos = null;
|
|
14106
14128
|
}
|
|
14107
14129
|
addText(text, position, angle, color, textSize, fontSize, id) {
|
|
14108
14130
|
var _a;
|
|
14109
14131
|
if (!text) return;
|
|
14110
|
-
(_a = this.getSelectedObjects().at(0)) === null || _a ===
|
|
14132
|
+
(_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
|
|
14111
14133
|
this.clearSelected();
|
|
14112
14134
|
this.removeTextInput();
|
|
14113
14135
|
const tolerance = 1e-6;
|
|
@@ -14182,7 +14204,7 @@
|
|
|
14182
14204
|
addImage(position, src, width, height, id) {
|
|
14183
14205
|
var _a;
|
|
14184
14206
|
if (!position || !src) return;
|
|
14185
|
-
(_a = this.getSelectedObjects().at(0)) === null || _a ===
|
|
14207
|
+
(_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
|
|
14186
14208
|
this.clearSelected();
|
|
14187
14209
|
this.removeImageInput();
|
|
14188
14210
|
const konvaImage = new KonvaImage({
|
|
@@ -56684,117 +56706,6 @@ void main() {
|
|
|
56684
56706
|
viewer.clearOverlay();
|
|
56685
56707
|
}
|
|
56686
56708
|
|
|
56687
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
56688
|
-
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
56689
|
-
// All rights reserved.
|
|
56690
|
-
//
|
|
56691
|
-
// This software and its documentation and related materials are owned by
|
|
56692
|
-
// the Alliance. The software may only be incorporated into application
|
|
56693
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
56694
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
56695
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
56696
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
56697
|
-
// protected by copyright law and international treaty provisions. Application
|
|
56698
|
-
// programs incorporating this software must include the following statement
|
|
56699
|
-
// with their copyright notices:
|
|
56700
|
-
//
|
|
56701
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
56702
|
-
// license agreement with Open Design Alliance.
|
|
56703
|
-
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
56704
|
-
// All rights reserved.
|
|
56705
|
-
//
|
|
56706
|
-
// By use of this software, its documentation or related materials, you
|
|
56707
|
-
// acknowledge and accept the above terms.
|
|
56708
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
56709
|
-
class SelectionComponent {
|
|
56710
|
-
constructor(viewer) {
|
|
56711
|
-
this.onPointerDown = (event) => {
|
|
56712
|
-
if (!event.isPrimary || event.button !== 0)
|
|
56713
|
-
return;
|
|
56714
|
-
this.getMousePosition(event, this.downPosition);
|
|
56715
|
-
};
|
|
56716
|
-
this.onPointerUp = (event) => {
|
|
56717
|
-
if (!event.isPrimary)
|
|
56718
|
-
return;
|
|
56719
|
-
const upPosition = this.getMousePosition(event, new Vector2());
|
|
56720
|
-
if (this.downPosition.distanceTo(upPosition) !== 0)
|
|
56721
|
-
return;
|
|
56722
|
-
const intersects = this.getPointerIntersects(upPosition);
|
|
56723
|
-
this.clearSelection();
|
|
56724
|
-
if (intersects.length > 0)
|
|
56725
|
-
this.select(intersects[0].object);
|
|
56726
|
-
this.viewer.update();
|
|
56727
|
-
this.viewer.emitEvent({ type: "select", data: undefined, handles: this.viewer.getSelected() });
|
|
56728
|
-
};
|
|
56729
|
-
this.onDoubleClick = (event) => {
|
|
56730
|
-
if (event.button !== 0)
|
|
56731
|
-
return;
|
|
56732
|
-
this.viewer.executeCommand("zoomToSelected");
|
|
56733
|
-
};
|
|
56734
|
-
this.optionsChange = () => {
|
|
56735
|
-
const { facesColor, facesTransparancy } = this.viewer.options;
|
|
56736
|
-
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
56737
|
-
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
56738
|
-
this.viewer.update();
|
|
56739
|
-
};
|
|
56740
|
-
this.viewer = viewer;
|
|
56741
|
-
this.raycaster = new Raycaster();
|
|
56742
|
-
this.downPosition = new Vector2();
|
|
56743
|
-
const { facesColor, facesTransparancy } = this.viewer.options;
|
|
56744
|
-
this.facesMaterial = new MeshBasicMaterial();
|
|
56745
|
-
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
56746
|
-
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
56747
|
-
this.facesMaterial.transparent = true;
|
|
56748
|
-
this.viewer.addEventListener("pointerdown", this.onPointerDown);
|
|
56749
|
-
this.viewer.addEventListener("pointerup", this.onPointerUp);
|
|
56750
|
-
this.viewer.addEventListener("dblclick", this.onDoubleClick);
|
|
56751
|
-
this.viewer.addEventListener("optionschange", this.optionsChange);
|
|
56752
|
-
}
|
|
56753
|
-
dispose() {
|
|
56754
|
-
this.facesMaterial.dispose();
|
|
56755
|
-
this.viewer.removeEventListener("pointerdown", this.onPointerDown);
|
|
56756
|
-
this.viewer.removeEventListener("pointerup", this.onPointerUp);
|
|
56757
|
-
this.viewer.removeEventListener("dblclick", this.onDoubleClick);
|
|
56758
|
-
this.viewer.removeEventListener("optionschange", this.optionsChange);
|
|
56759
|
-
}
|
|
56760
|
-
getMousePosition(event, target) {
|
|
56761
|
-
return target.set(event.clientX, event.clientY);
|
|
56762
|
-
}
|
|
56763
|
-
getPointerIntersects(mouse) {
|
|
56764
|
-
const rect = this.viewer.canvas.getBoundingClientRect();
|
|
56765
|
-
const x = ((mouse.x - rect.left) / rect.width) * 2 - 1;
|
|
56766
|
-
const y = (-(mouse.y - rect.top) / rect.height) * 2 + 1;
|
|
56767
|
-
const coords = new Vector2(x, y);
|
|
56768
|
-
this.raycaster.setFromCamera(coords, this.viewer.camera);
|
|
56769
|
-
const objects = [];
|
|
56770
|
-
this.viewer.scene.traverseVisible((child) => objects.push(child));
|
|
56771
|
-
this.raycaster.params = this.raycaster.params = {
|
|
56772
|
-
Mesh: {},
|
|
56773
|
-
Line: { threshold: 0.25 },
|
|
56774
|
-
Line2: { threshold: 0.25 },
|
|
56775
|
-
LOD: {},
|
|
56776
|
-
Points: { threshold: 0.1 },
|
|
56777
|
-
Sprite: {},
|
|
56778
|
-
};
|
|
56779
|
-
return this.raycaster.intersectObjects(objects, false);
|
|
56780
|
-
}
|
|
56781
|
-
select(object) {
|
|
56782
|
-
if (object.isSelected)
|
|
56783
|
-
return;
|
|
56784
|
-
object.isSelected = true;
|
|
56785
|
-
object.originalMaterial = object.material;
|
|
56786
|
-
object.material = this.facesMaterial;
|
|
56787
|
-
this.viewer.selected.push(object);
|
|
56788
|
-
}
|
|
56789
|
-
clearSelection() {
|
|
56790
|
-
this.viewer.selected.forEach((object) => {
|
|
56791
|
-
object.isSelected = false;
|
|
56792
|
-
object.material = object.originalMaterial;
|
|
56793
|
-
});
|
|
56794
|
-
this.viewer.selected.length = 0;
|
|
56795
|
-
}
|
|
56796
|
-
}
|
|
56797
|
-
|
|
56798
56709
|
///////////////////////////////////////////////////////////////////////////////
|
|
56799
56710
|
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
56800
56711
|
// All rights reserved.
|
|
@@ -56818,9 +56729,10 @@ void main() {
|
|
|
56818
56729
|
// acknowledge and accept the above terms.
|
|
56819
56730
|
///////////////////////////////////////////////////////////////////////////////
|
|
56820
56731
|
function clearSelected(viewer) {
|
|
56821
|
-
const selection =
|
|
56732
|
+
const selection = viewer.getComponent("SelectionComponent");
|
|
56733
|
+
if (!selection)
|
|
56734
|
+
return;
|
|
56822
56735
|
selection.clearSelection();
|
|
56823
|
-
selection.dispose();
|
|
56824
56736
|
viewer.update();
|
|
56825
56737
|
viewer.emitEvent({ type: "select", data: undefined, handles: [] });
|
|
56826
56738
|
}
|
|
@@ -57098,7 +57010,7 @@ void main() {
|
|
|
57098
57010
|
// acknowledge and accept the above terms.
|
|
57099
57011
|
///////////////////////////////////////////////////////////////////////////////
|
|
57100
57012
|
function getModels(viewer) {
|
|
57101
|
-
return viewer.models.map((model) => { var _a; return ((_a = model.userData) === null || _a ===
|
|
57013
|
+
return viewer.models.map((model) => { var _a; return ((_a = model.userData) === null || _a === void 0 ? void 0 : _a.handle) || ""; }).filter((handle) => handle);
|
|
57102
57014
|
}
|
|
57103
57015
|
|
|
57104
57016
|
///////////////////////////////////////////////////////////////////////////////
|
|
@@ -57124,7 +57036,118 @@ void main() {
|
|
|
57124
57036
|
// acknowledge and accept the above terms.
|
|
57125
57037
|
///////////////////////////////////////////////////////////////////////////////
|
|
57126
57038
|
function getSelected(viewer) {
|
|
57127
|
-
return viewer.selected.map((object) => { var _a; return (_a = object.userData) === null || _a ===
|
|
57039
|
+
return viewer.selected.map((object) => { var _a; return (_a = object.userData) === null || _a === void 0 ? void 0 : _a.handle; }).filter((handle) => handle);
|
|
57040
|
+
}
|
|
57041
|
+
|
|
57042
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
57043
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
57044
|
+
// All rights reserved.
|
|
57045
|
+
//
|
|
57046
|
+
// This software and its documentation and related materials are owned by
|
|
57047
|
+
// the Alliance. The software may only be incorporated into application
|
|
57048
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
57049
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
57050
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
57051
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
57052
|
+
// protected by copyright law and international treaty provisions. Application
|
|
57053
|
+
// programs incorporating this software must include the following statement
|
|
57054
|
+
// with their copyright notices:
|
|
57055
|
+
//
|
|
57056
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
57057
|
+
// license agreement with Open Design Alliance.
|
|
57058
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
57059
|
+
// All rights reserved.
|
|
57060
|
+
//
|
|
57061
|
+
// By use of this software, its documentation or related materials, you
|
|
57062
|
+
// acknowledge and accept the above terms.
|
|
57063
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
57064
|
+
class SelectionComponent {
|
|
57065
|
+
constructor(viewer) {
|
|
57066
|
+
this.onPointerDown = (event) => {
|
|
57067
|
+
if (!event.isPrimary || event.button !== 0)
|
|
57068
|
+
return;
|
|
57069
|
+
this.getMousePosition(event, this.downPosition);
|
|
57070
|
+
};
|
|
57071
|
+
this.onPointerUp = (event) => {
|
|
57072
|
+
if (!event.isPrimary)
|
|
57073
|
+
return;
|
|
57074
|
+
const upPosition = this.getMousePosition(event, new Vector2());
|
|
57075
|
+
if (this.downPosition.distanceTo(upPosition) !== 0)
|
|
57076
|
+
return;
|
|
57077
|
+
const intersects = this.getPointerIntersects(upPosition);
|
|
57078
|
+
this.clearSelection();
|
|
57079
|
+
if (intersects.length > 0)
|
|
57080
|
+
this.select(intersects[0].object);
|
|
57081
|
+
this.viewer.update();
|
|
57082
|
+
this.viewer.emitEvent({ type: "select", data: undefined, handles: this.viewer.getSelected() });
|
|
57083
|
+
};
|
|
57084
|
+
this.onDoubleClick = (event) => {
|
|
57085
|
+
if (event.button !== 0)
|
|
57086
|
+
return;
|
|
57087
|
+
this.viewer.executeCommand("zoomToSelected");
|
|
57088
|
+
};
|
|
57089
|
+
this.optionsChange = () => {
|
|
57090
|
+
const { facesColor, facesTransparancy } = this.viewer.options;
|
|
57091
|
+
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
57092
|
+
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
57093
|
+
this.viewer.update();
|
|
57094
|
+
};
|
|
57095
|
+
this.viewer = viewer;
|
|
57096
|
+
this.raycaster = new Raycaster();
|
|
57097
|
+
this.downPosition = new Vector2();
|
|
57098
|
+
const { facesColor, facesTransparancy } = this.viewer.options;
|
|
57099
|
+
this.facesMaterial = new MeshBasicMaterial();
|
|
57100
|
+
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
57101
|
+
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
57102
|
+
this.facesMaterial.transparent = true;
|
|
57103
|
+
this.viewer.addEventListener("pointerdown", this.onPointerDown);
|
|
57104
|
+
this.viewer.addEventListener("pointerup", this.onPointerUp);
|
|
57105
|
+
this.viewer.addEventListener("dblclick", this.onDoubleClick);
|
|
57106
|
+
this.viewer.addEventListener("optionschange", this.optionsChange);
|
|
57107
|
+
}
|
|
57108
|
+
dispose() {
|
|
57109
|
+
this.facesMaterial.dispose();
|
|
57110
|
+
this.viewer.removeEventListener("pointerdown", this.onPointerDown);
|
|
57111
|
+
this.viewer.removeEventListener("pointerup", this.onPointerUp);
|
|
57112
|
+
this.viewer.removeEventListener("dblclick", this.onDoubleClick);
|
|
57113
|
+
this.viewer.removeEventListener("optionschange", this.optionsChange);
|
|
57114
|
+
}
|
|
57115
|
+
getMousePosition(event, target) {
|
|
57116
|
+
return target.set(event.clientX, event.clientY);
|
|
57117
|
+
}
|
|
57118
|
+
getPointerIntersects(mouse) {
|
|
57119
|
+
const rect = this.viewer.canvas.getBoundingClientRect();
|
|
57120
|
+
const x = ((mouse.x - rect.left) / rect.width) * 2 - 1;
|
|
57121
|
+
const y = (-(mouse.y - rect.top) / rect.height) * 2 + 1;
|
|
57122
|
+
const coords = new Vector2(x, y);
|
|
57123
|
+
this.raycaster.setFromCamera(coords, this.viewer.camera);
|
|
57124
|
+
const objects = [];
|
|
57125
|
+
this.viewer.scene.traverseVisible((child) => objects.push(child));
|
|
57126
|
+
this.raycaster.params = this.raycaster.params = {
|
|
57127
|
+
Mesh: {},
|
|
57128
|
+
Line: { threshold: 0.25 },
|
|
57129
|
+
Line2: { threshold: 0.25 },
|
|
57130
|
+
LOD: {},
|
|
57131
|
+
Points: { threshold: 0.1 },
|
|
57132
|
+
Sprite: {},
|
|
57133
|
+
};
|
|
57134
|
+
return this.raycaster.intersectObjects(objects, false);
|
|
57135
|
+
}
|
|
57136
|
+
select(object) {
|
|
57137
|
+
if (object.isSelected)
|
|
57138
|
+
return;
|
|
57139
|
+
object.isSelected = true;
|
|
57140
|
+
object.originalMaterial = object.material;
|
|
57141
|
+
object.material = this.facesMaterial;
|
|
57142
|
+
this.viewer.selected.push(object);
|
|
57143
|
+
}
|
|
57144
|
+
clearSelection() {
|
|
57145
|
+
this.viewer.selected.forEach((object) => {
|
|
57146
|
+
object.isSelected = false;
|
|
57147
|
+
object.material = object.originalMaterial;
|
|
57148
|
+
});
|
|
57149
|
+
this.viewer.selected.length = 0;
|
|
57150
|
+
}
|
|
57128
57151
|
}
|
|
57129
57152
|
|
|
57130
57153
|
///////////////////////////////////////////////////////////////////////////////
|
|
@@ -57359,13 +57382,14 @@ void main() {
|
|
|
57359
57382
|
const objects = [];
|
|
57360
57383
|
viewer.scene.traverseVisible((child) => {
|
|
57361
57384
|
var _a;
|
|
57362
|
-
if (handleSet.has((_a = child.userData) === null || _a ===
|
|
57385
|
+
if (handleSet.has((_a = child.userData) === null || _a === void 0 ? void 0 : _a.handle))
|
|
57363
57386
|
objects.push(child);
|
|
57364
57387
|
});
|
|
57365
|
-
const selection =
|
|
57388
|
+
const selection = viewer.getComponent("SelectionComponent");
|
|
57389
|
+
if (!selection)
|
|
57390
|
+
return;
|
|
57366
57391
|
selection.clearSelection();
|
|
57367
57392
|
objects.forEach((object) => selection.select(object));
|
|
57368
|
-
selection.dispose();
|
|
57369
57393
|
viewer.update();
|
|
57370
57394
|
viewer.emitEvent({ type: "select", data: undefined, handles });
|
|
57371
57395
|
}
|
|
@@ -57451,7 +57475,7 @@ void main() {
|
|
|
57451
57475
|
const objects = [];
|
|
57452
57476
|
viewer.scene.traverseVisible((child) => {
|
|
57453
57477
|
var _a;
|
|
57454
|
-
if (handleSet.has((_a = child.userData) === null || _a ===
|
|
57478
|
+
if (handleSet.has((_a = child.userData) === null || _a === void 0 ? void 0 : _a.handle))
|
|
57455
57479
|
objects.push(child);
|
|
57456
57480
|
});
|
|
57457
57481
|
const extents = objects.reduce((result, object) => result.expandByObject(object), new Box3());
|
|
@@ -62997,7 +63021,7 @@ void main() {
|
|
|
62997
63021
|
.replace(this.resourcePath, "")
|
|
62998
63022
|
.replace(/^(\.?\/)/, "");
|
|
62999
63023
|
const dataURL = this.dataURLs.get(key);
|
|
63000
|
-
return dataURL !== null && dataURL !==
|
|
63024
|
+
return dataURL !== null && dataURL !== void 0 ? dataURL : url;
|
|
63001
63025
|
});
|
|
63002
63026
|
}
|
|
63003
63027
|
dispose() {
|
|
@@ -63178,7 +63202,7 @@ void main() {
|
|
|
63178
63202
|
this.renderer.autoClear = false;
|
|
63179
63203
|
this.renderer.render(this.helpers, this.camera);
|
|
63180
63204
|
this.renderer.clippingPlanes = clippingPlanes;
|
|
63181
|
-
(_b = (_a = this._activeDragger) === null || _a ===
|
|
63205
|
+
(_b = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
63182
63206
|
const deltaTime = (time - this.renderTime) / 1000;
|
|
63183
63207
|
this.renderTime = time;
|
|
63184
63208
|
this.emitEvent({ type: "render", time, deltaTime });
|
|
@@ -63446,7 +63470,7 @@ void main() {
|
|
|
63446
63470
|
newDragger = draggers.createDragger(name, this);
|
|
63447
63471
|
if (newDragger) {
|
|
63448
63472
|
this._activeDragger = newDragger;
|
|
63449
|
-
(_b = (_a = this._activeDragger).initialize) === null || _b ===
|
|
63473
|
+
(_b = (_a = this._activeDragger).initialize) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
63450
63474
|
}
|
|
63451
63475
|
}
|
|
63452
63476
|
const canvas = this.canvas;
|
|
@@ -63543,7 +63567,7 @@ void main() {
|
|
|
63543
63567
|
}
|
|
63544
63568
|
};
|
|
63545
63569
|
const setClippingPlanes = (clipping_planes) => {
|
|
63546
|
-
clipping_planes === null || clipping_planes ===
|
|
63570
|
+
clipping_planes === null || clipping_planes === void 0 ? void 0 : clipping_planes.forEach((clipping_plane) => {
|
|
63547
63571
|
const plane = new Plane();
|
|
63548
63572
|
plane.setFromNormalAndCoplanarPoint(getVector3FromPoint3d(clipping_plane.direction), getVector3FromPoint3d(clipping_plane.location));
|
|
63549
63573
|
this.renderer.clippingPlanes.push(plane);
|
|
@@ -63553,7 +63577,7 @@ void main() {
|
|
|
63553
63577
|
if (selection)
|
|
63554
63578
|
this.setSelected(selection.map((component) => component.handle));
|
|
63555
63579
|
};
|
|
63556
|
-
const draggerName = (_a = this._activeDragger) === null || _a ===
|
|
63580
|
+
const draggerName = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.name;
|
|
63557
63581
|
this.setActiveDragger();
|
|
63558
63582
|
this.clearSlices();
|
|
63559
63583
|
this.clearOverlay();
|
|
@@ -63565,7 +63589,7 @@ void main() {
|
|
|
63565
63589
|
setClippingPlanes(viewpoint.clipping_planes);
|
|
63566
63590
|
setSelection(viewpoint.selection);
|
|
63567
63591
|
this._markup.setViewpoint(viewpoint);
|
|
63568
|
-
this.target = getVector3FromPoint3d((_c = (_b = viewpoint.custom_fields) === null || _b ===
|
|
63592
|
+
this.target = getVector3FromPoint3d((_c = (_b = viewpoint.custom_fields) === null || _b === void 0 ? void 0 : _b.camera_target) !== null && _c !== void 0 ? _c : this.target);
|
|
63569
63593
|
this.setActiveDragger(draggerName);
|
|
63570
63594
|
this.emitEvent({ type: "drawviewpoint", data: viewpoint });
|
|
63571
63595
|
this.update();
|