@inweb/viewer-visualize 25.3.20 → 25.3.22

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.
@@ -361,7 +361,9 @@ class Options {
361
361
  }
362
362
  }
363
363
 
364
- const CANVAS_EVENTS = [ "click", "dblclick", "mousedown", "mousemove", "mouseup", "mouseleave", "pointerdown", "pointermove", "pointerup", "pointerleave", "pointercancel", "wheel", "touchstart", "touchmove", "touchend", "touchcancel" ];
364
+ const CanvasEvents = [ "click", "contextmenu", "dblclick", "mousedown", "mouseleave", "mousemove", "mouseup", "pointercancel", "pointerdown", "pointerleave", "pointermove", "pointerup", "touchcancel", "touchend", "touchmove", "touchstart", "wheel" ];
365
+
366
+ const CANVAS_EVENTS = CanvasEvents;
365
367
 
366
368
  const composeMatrixFromTransform = (translate, rotate, scale, modelCenter, matrix) => {
367
369
  const translateMatrix = matrix.setTranslation([ translate.x, translate.y, translate.z ]);
@@ -4943,7 +4945,7 @@ class Viewer extends EventEmitter2 {
4943
4945
  markupDraggers === null || markupDraggers === void 0 ? void 0 : markupDraggers.forEach(((value, key) => {
4944
4946
  this.registerDragger(key, value);
4945
4947
  }));
4946
- this.canvasEvents = CANVAS_EVENTS;
4948
+ this.canvasEvents = CANVAS_EVENTS.slice();
4947
4949
  this.canvaseventlistener = event => this.emit(event);
4948
4950
  this._enableAutoUpdate = (_b = params.enableAutoUpdate) !== null && _b !== void 0 ? _b : true;
4949
4951
  this._isNeedRender = false;
@@ -4982,7 +4984,7 @@ class Viewer extends EventEmitter2 {
4982
4984
  };
4983
4985
  onProgress === null || onProgress === void 0 ? void 0 : onProgress(event);
4984
4986
  }));
4985
- this.visualizeJs = visualizeJs;
4987
+ this._visualizeJs = visualizeJs;
4986
4988
  this.visualizeJs.canvas = canvas;
4987
4989
  this.visualizeJs.Viewer.create();
4988
4990
  this.canvas = canvas;
@@ -5003,7 +5005,6 @@ class Viewer extends EventEmitter2 {
5003
5005
  return this;
5004
5006
  }
5005
5007
  dispose() {
5006
- var _a, _b, _c, _d;
5007
5008
  this.cancel();
5008
5009
  this.emitEvent({
5009
5010
  type: "dispose"
@@ -5011,19 +5012,20 @@ class Viewer extends EventEmitter2 {
5011
5012
  if (this.frameId) cancelAnimationFrame(this.frameId);
5012
5013
  this.frameId = 0;
5013
5014
  this.setActiveDragger("");
5014
- (_a = this._zoomWheelDragger) === null || _a === void 0 ? void 0 : _a.dispose();
5015
- (_b = this._gestureManager) === null || _b === void 0 ? void 0 : _b.dispose();
5016
5015
  this.removeAllListeners();
5017
- (_c = this._resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
5016
+ if (this._gestureManager) this._gestureManager.dispose();
5017
+ this._gestureManager = undefined;
5018
+ if (this._zoomWheelDragger) this._zoomWheelDragger.dispose();
5019
+ this._zoomWheelDragger = undefined;
5020
+ if (this._resizeObserver) this._resizeObserver.disconnect();
5018
5021
  this._resizeObserver = undefined;
5019
5022
  this.markup.dispose();
5020
- this.canvasEvents.forEach((x => {
5021
- var _a;
5022
- return (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.removeEventListener(x, this.canvaseventlistener);
5023
- }));
5024
- this.canvas = undefined;
5025
- (_d = this.visualizeJs) === null || _d === void 0 ? void 0 : _d.getViewer().clear();
5026
- this.visualizeJs = undefined;
5023
+ if (this.canvas) {
5024
+ this.canvasEvents.forEach((x => this.canvas.removeEventListener(x, this.canvaseventlistener)));
5025
+ this.canvas = undefined;
5026
+ }
5027
+ if (this._visualizeJs) this._visualizeJs.getViewer().clear();
5028
+ this._visualizeJs = undefined;
5027
5029
  return this;
5028
5030
  }
5029
5031
  isInitialized() {
@@ -5107,6 +5109,9 @@ class Viewer extends EventEmitter2 {
5107
5109
  this._isRunAsyncUpdate = false;
5108
5110
  }
5109
5111
  }
5112
+ get visualizeJs() {
5113
+ return this._visualizeJs;
5114
+ }
5110
5115
  visLib() {
5111
5116
  return this.visualizeJs;
5112
5117
  }
@@ -5608,5 +5613,5 @@ class Viewer extends EventEmitter2 {
5608
5613
  }
5609
5614
  }
5610
5615
 
5611
- export { CANVAS_EVENTS, OdBaseDragger, Options, Viewer, commands, defaultOptions };
5616
+ export { CANVAS_EVENTS, CanvasEvents, OdBaseDragger, Options, Viewer, commands, defaultOptions };
5612
5617
  //# sourceMappingURL=viewer-visualize.module.js.map