@inweb/viewer-visualize 25.8.4 → 25.8.6

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.
@@ -1664,10 +1664,7 @@ class KonvaMarkup {
1664
1664
  };
1665
1665
  }
1666
1666
  initialize(container, pointerEvents, viewer, worldTransformer) {
1667
- if (!Konva) {
1668
- console.error('Markup error: Konva is not initialized. Update node_modules or add to your page <script src="https://unpkg.com/konva@9/konva.min.js"><\/script>');
1669
- return;
1670
- }
1667
+ 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?');
1671
1668
  this._viewer = viewer;
1672
1669
  this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform;
1673
1670
  this._container = container;
@@ -5148,10 +5145,7 @@ class Viewer extends EventEmitter2 {
5148
5145
  total: total
5149
5146
  });
5150
5147
  }));
5151
- if (visualizeTimestamp !== this._visualizeTimestamp) {
5152
- console.error("Viewer error: dispose() was called before initialize() completed. Are you using React strict mode?");
5153
- return this;
5154
- }
5148
+ if (visualizeTimestamp !== this._visualizeTimestamp) throw new Error("Viewer error: dispose() was called before initialize() completed. Are you using React strict mode?");
5155
5149
  this._visualizeJs = visualizeJs;
5156
5150
  this.visualizeJs.canvas = canvas;
5157
5151
  this.visualizeJs.Viewer.create();
@@ -5427,11 +5421,13 @@ class Viewer extends EventEmitter2 {
5427
5421
  this._activeDragger.dispose();
5428
5422
  this._activeDragger = null;
5429
5423
  }
5430
- const Constructor = this.draggerFactory.get(name);
5431
- if (Constructor) {
5432
- this._activeDragger = new Constructor(this);
5433
- this._activeDragger.name = name;
5434
- this._activeDragger.initialize();
5424
+ if (this.visualizeJs) {
5425
+ const Constructor = this.draggerFactory.get(name);
5426
+ if (Constructor) {
5427
+ this._activeDragger = new Constructor(this);
5428
+ this._activeDragger.name = name;
5429
+ this._activeDragger.initialize();
5430
+ }
5435
5431
  }
5436
5432
  const canvas = this.canvas;
5437
5433
  if (canvas) {