@inweb/viewer-visualize 27.5.0 → 27.6.1

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.
@@ -159,8 +159,7 @@
159
159
  this.abortController = new AbortController();
160
160
  }
161
161
  dispose() {
162
- this.abortController.abort();
163
- this.abortController = undefined;
162
+ this.cancel();
164
163
  }
165
164
  isSupport(file, format) {
166
165
  return false;
@@ -179,10 +178,10 @@
179
178
  extractFileName(file) {
180
179
  const regex = /[^/\\?#:]+(?=\?|#|$)/;
181
180
  if (typeof file === "string")
182
- return (file.match(regex) || [])[0];
181
+ return (file.match(regex) || [])[0] || "";
183
182
  else if (file instanceof globalThis.File)
184
- return (file.name.match(regex) || [])[0];
185
- return undefined;
183
+ return (file.name.match(regex) || [])[0] || "";
184
+ return "";
186
185
  }
187
186
  }
188
187
  class Loaders {
@@ -264,21 +263,44 @@
264
263
  snapshotQuality: 0.25,
265
264
  };
266
265
  }
266
+ function isColorRGB(value) {
267
+ return (typeof value === "object" &&
268
+ value !== null &&
269
+ typeof value.r === "number" &&
270
+ typeof value.g === "number" &&
271
+ typeof value.b === "number");
272
+ }
273
+ function isLegacyRGB(value) {
274
+ return (typeof value === "object" &&
275
+ value !== null &&
276
+ typeof value.red === "number" &&
277
+ typeof value.green === "number" &&
278
+ typeof value.blue === "number");
279
+ }
267
280
  class Options {
268
281
  constructor(emitter) {
282
+ this._updateCount = 0;
269
283
  this._emitter = emitter;
270
- this._data = defaultOptions();
284
+ this._data = Options.defaults();
285
+ this._defaults = Options.defaults();
271
286
  this.loadFromStorage();
272
287
  }
273
288
  static defaults() {
274
289
  return defaultOptions();
275
290
  }
276
291
  change() {
277
- if (this._emitter !== undefined) {
292
+ if (this._emitter !== undefined && this._updateCount === 0) {
278
293
  this.saveToStorage();
279
294
  this._emitter.emit({ type: "optionschange", data: this });
280
295
  }
281
296
  }
297
+ beginUpdate() {
298
+ this._updateCount++;
299
+ }
300
+ endUpdate() {
301
+ this._updateCount--;
302
+ this.change();
303
+ }
282
304
  saveToStorage() {
283
305
  if (typeof window !== "undefined")
284
306
  try {
@@ -292,321 +314,312 @@
292
314
  if (typeof window !== "undefined")
293
315
  try {
294
316
  const item = localStorage.getItem("od-client-settings");
295
- if (item) {
296
- const data = JSON.parse(item);
297
- this.data = { ...data };
298
- }
317
+ if (item)
318
+ this.data = JSON.parse(item);
299
319
  }
300
320
  catch (error) {
301
321
  console.error("Cannot load client settings.", error);
302
322
  }
303
323
  }
304
- resetToDefaults(fields) {
305
- if (fields !== undefined) {
306
- const defaults = Options.defaults();
307
- const resetData = fields.reduce((acc, field) => {
308
- acc[field] = defaults[field];
309
- return acc;
310
- }, {});
311
- this.data = { ...this.data, ...resetData };
324
+ resetToDefaults(fields, defaults = this._defaults) {
325
+ if (Array.isArray(fields)) {
326
+ const resetData = {};
327
+ for (const field of fields) {
328
+ if (field in defaults)
329
+ resetData[field] = defaults[field];
330
+ }
331
+ this.data = resetData;
312
332
  }
313
333
  else {
314
- this.data = { ...this.data, ...Options.defaults() };
334
+ this.data = defaults;
315
335
  }
316
336
  }
337
+ setProperty(key, value = this._defaults[key], accept = this.isValidValue(key, value)) {
338
+ if (!accept) {
339
+ console.warn(`Options.${key}: Invalid value`, value);
340
+ return;
341
+ }
342
+ if (this._data[key] !== value) {
343
+ this._data[key] = value;
344
+ this.change();
345
+ }
346
+ }
347
+ isValidValue(key, value) {
348
+ return typeof value === typeof this._defaults[key];
349
+ }
317
350
  get data() {
318
351
  return this._data;
319
352
  }
320
353
  set data(value) {
321
- this._data = { ...Options.defaults(), ...this._data, ...value };
322
- if (this._data.enablePartialMode) {
323
- this._data.enableStreamingMode = true;
324
- this._data.sceneGraph = false;
325
- }
326
- if (!value.sectionFillColor && value.cuttingPlaneFillColor)
327
- this._data.sectionFillColor = {
328
- r: value.cuttingPlaneFillColor.red,
329
- g: value.cuttingPlaneFillColor.green,
330
- b: value.cuttingPlaneFillColor.blue,
331
- };
332
- this.change();
354
+ this.beginUpdate();
355
+ try {
356
+ for (const key of Object.keys(value)) {
357
+ if (key in this._defaults)
358
+ this[key] = value[key];
359
+ else
360
+ this._data[key] = value[key];
361
+ }
362
+ if ("enablePartialMode" in value) {
363
+ this.enablePartialMode = value.enablePartialMode;
364
+ }
365
+ if ("sectionFillColor" in value) {
366
+ this.sectionFillColor = value.sectionFillColor;
367
+ }
368
+ }
369
+ finally {
370
+ this.endUpdate();
371
+ }
333
372
  }
334
373
  get showWCS() {
335
374
  return this._data.showWCS;
336
375
  }
337
376
  set showWCS(value) {
338
- this._data.showWCS = value;
339
- this.change();
377
+ this.setProperty("showWCS", value);
340
378
  }
341
379
  get cameraAnimation() {
342
380
  return this._data.cameraAnimation;
343
381
  }
344
382
  set cameraAnimation(value) {
345
- this._data.cameraAnimation = value;
346
- this.change();
383
+ this.setProperty("cameraAnimation", value);
347
384
  }
348
385
  get antialiasing() {
349
386
  return this._data.antialiasing;
350
387
  }
351
388
  set antialiasing(value) {
352
- this._data.antialiasing = value;
353
- this.change();
389
+ this.setProperty("antialiasing", value, typeof value === "boolean" || typeof value === "string");
354
390
  }
355
391
  get groundShadow() {
356
392
  return this._data.groundShadow;
357
393
  }
358
394
  set groundShadow(value) {
359
- this._data.groundShadow = value;
360
- this.change();
395
+ this.setProperty("groundShadow", value);
361
396
  }
362
397
  get shadows() {
363
398
  return this._data.shadows;
364
399
  }
365
400
  set shadows(value) {
366
- this._data.shadows = value;
367
- this.change();
401
+ this.setProperty("shadows", value);
368
402
  }
369
403
  get cameraAxisXSpeed() {
370
404
  return this._data.cameraAxisXSpeed;
371
405
  }
372
406
  set cameraAxisXSpeed(value) {
373
- this._data.cameraAxisXSpeed = value;
374
- this.change();
407
+ this.setProperty("cameraAxisXSpeed", value);
375
408
  }
376
409
  get cameraAxisYSpeed() {
377
410
  return this._data.cameraAxisYSpeed;
378
411
  }
379
412
  set cameraAxisYSpeed(value) {
380
- this.cameraAxisYSpeed = value;
381
- this.change();
413
+ this.setProperty("cameraAxisYSpeed", value);
382
414
  }
383
415
  get ambientOcclusion() {
384
416
  return this._data.ambientOcclusion;
385
417
  }
386
418
  set ambientOcclusion(value) {
387
- this._data.ambientOcclusion = value;
388
- this.change();
419
+ this.setProperty("ambientOcclusion", value);
389
420
  }
390
421
  get enableStreamingMode() {
391
422
  return this._data.enableStreamingMode;
392
423
  }
393
424
  set enableStreamingMode(value) {
394
- this._data.enableStreamingMode = value;
395
- if (!value)
396
- this._data.enablePartialMode = false;
397
- this.change();
425
+ this.setProperty("enableStreamingMode", value);
426
+ this.setProperty("enablePartialMode", this.enablePartialMode && this.enableStreamingMode);
398
427
  }
399
428
  get enablePartialMode() {
400
429
  return this._data.enablePartialMode;
401
430
  }
402
431
  set enablePartialMode(value) {
403
- this._data.enablePartialMode = value;
404
- if (value) {
405
- this._data.enableStreamingMode = true;
406
- this._data.sceneGraph = false;
407
- }
408
- this.change();
432
+ this.setProperty("enablePartialMode", value);
433
+ this.setProperty("enableStreamingMode", this.enableStreamingMode || this.enablePartialMode);
434
+ this.setProperty("sceneGraph", this.sceneGraph && !this.enablePartialMode);
409
435
  }
410
436
  get memoryLimit() {
411
437
  return this._data.memoryLimit;
412
438
  }
413
439
  set memoryLimit(value) {
414
- this._data.memoryLimit = value;
415
- this.change();
440
+ this.setProperty("memoryLimit", value);
416
441
  }
417
442
  get cuttingPlaneFillColor() {
418
- console.warn("Options.cuttingPlaneFillColor has been deprecated since 27.5 and will be removed in a future release, use sectionFillColor instead");
419
- return {
420
- red: this._data.sectionFillColor.r,
421
- green: this._data.sectionFillColor.g,
422
- blue: this._data.sectionFillColor.b,
423
- };
443
+ return this._data.cuttingPlaneFillColor;
424
444
  }
425
445
  set cuttingPlaneFillColor(value) {
426
- console.warn("Options.cuttingPlaneFillColor has been deprecated since 27.5 and will be removed in a future release, use sectionFillColor instead");
427
- this._data.sectionFillColor = {
428
- r: value.red,
429
- g: value.green,
430
- b: value.blue,
431
- };
432
- this.change();
446
+ if (this._updateCount === 0) {
447
+ console.warn("Options.cuttingPlaneFillColor has been deprecated since 27.5 and will be removed in a future release, use sectionFillColor instead");
448
+ }
449
+ this.setProperty("cuttingPlaneFillColor", value, isLegacyRGB(value));
450
+ this.setProperty("sectionFillColor", {
451
+ r: this._data.cuttingPlaneFillColor.red,
452
+ g: this._data.cuttingPlaneFillColor.green,
453
+ b: this._data.cuttingPlaneFillColor.blue,
454
+ }, true);
433
455
  }
434
456
  get enableSectionFill() {
435
457
  return this._data.enableSectionFill;
436
458
  }
437
459
  set enableSectionFill(value) {
438
- this._data.enableSectionFill = value;
439
- this.change();
460
+ this.setProperty("enableSectionFill", value);
440
461
  }
441
462
  get sectionFillColor() {
442
463
  return this._data.sectionFillColor;
443
464
  }
444
465
  set sectionFillColor(value) {
445
- this._data.sectionFillColor = value;
446
- this.change();
466
+ this.setProperty("sectionFillColor", value, isColorRGB(value));
467
+ this.setProperty("cuttingPlaneFillColor", {
468
+ red: this._data.sectionFillColor.r,
469
+ green: this._data.sectionFillColor.g,
470
+ blue: this._data.sectionFillColor.b,
471
+ }, true);
447
472
  }
448
473
  get sectionUseObjectColor() {
449
474
  return this._data.sectionUseObjectColor;
450
475
  }
451
476
  set sectionUseObjectColor(value) {
452
- this._data.sectionUseObjectColor = value;
453
- this.change();
477
+ this.setProperty("sectionUseObjectColor", value);
454
478
  }
455
479
  get enableSectionHatch() {
456
480
  return this._data.enableSectionHatch;
457
481
  }
458
482
  set enableSectionHatch(value) {
459
- this._data.enableSectionHatch = value;
460
- this.change();
483
+ this.setProperty("enableSectionHatch", value);
461
484
  }
462
485
  get sectionHatchColor() {
463
486
  return this._data.sectionHatchColor;
464
487
  }
465
488
  set sectionHatchColor(value) {
466
- this._data.sectionHatchColor = value;
467
- this.change();
489
+ this.setProperty("sectionHatchColor", value, isColorRGB(value));
468
490
  }
469
491
  get sectionHatchScale() {
470
492
  return this._data.sectionHatchScale;
471
493
  }
472
494
  set sectionHatchScale(value) {
473
- this._data.sectionHatchScale = value;
474
- this.change();
495
+ this.setProperty("sectionHatchScale", value);
475
496
  }
476
497
  get enableSectionOutline() {
477
498
  return this._data.enableSectionOutline;
478
499
  }
479
500
  set enableSectionOutline(value) {
480
- this._data.enableSectionOutline = value;
481
- this.change();
501
+ this.setProperty("enableSectionOutline", value);
482
502
  }
483
503
  get sectionOutlineColor() {
484
504
  return this._data.sectionOutlineColor;
485
505
  }
486
506
  set sectionOutlineColor(value) {
487
- this._data.sectionOutlineColor = value;
488
- this.change();
507
+ this.setProperty("sectionOutlineColor", value, isColorRGB(value));
489
508
  }
490
509
  get sectionOutlineWidth() {
491
510
  return this._data.sectionOutlineWidth;
492
511
  }
493
512
  set sectionOutlineWidth(value) {
494
- this._data.sectionOutlineWidth = value;
495
- this.change();
513
+ this.setProperty("sectionOutlineWidth", value);
496
514
  }
497
515
  get edgesColor() {
498
516
  return this._data.edgesColor;
499
517
  }
500
518
  set edgesColor(value) {
501
- this._data.edgesColor = value;
502
- this.change();
519
+ this.setProperty("edgesColor", value, isColorRGB(value));
503
520
  }
504
521
  get facesColor() {
505
522
  return this._data.facesColor;
506
523
  }
507
524
  set facesColor(value) {
508
- this._data.facesColor = value;
509
- this.change();
525
+ this.setProperty("facesColor", value, isColorRGB(value));
510
526
  }
511
527
  get edgesVisibility() {
512
528
  return this._data.edgesVisibility;
513
529
  }
514
530
  set edgesVisibility(value) {
515
- this._data.edgesVisibility = value;
516
- this.change();
531
+ this.setProperty("edgesVisibility", value);
517
532
  }
518
533
  get edgesOverlap() {
519
534
  return this._data.edgesOverlap;
520
535
  }
521
536
  set edgesOverlap(value) {
522
- this._data.edgesOverlap = value;
523
- this.change();
537
+ this.setProperty("edgesOverlap", value);
524
538
  }
525
539
  get facesOverlap() {
526
540
  return this._data.facesOverlap;
527
541
  }
528
542
  set facesOverlap(value) {
529
- this._data.facesOverlap = value;
530
- this.change();
543
+ this.setProperty("facesOverlap", value);
531
544
  }
532
545
  get facesTransparancy() {
533
546
  return this._data.facesTransparancy;
534
547
  }
535
548
  set facesTransparancy(value) {
536
- this._data.facesTransparancy = value;
537
- this.change();
549
+ this.setProperty("facesTransparancy", value);
538
550
  }
539
551
  get enableCustomHighlight() {
540
552
  return this._data.enableCustomHighlight;
541
553
  }
542
554
  set enableCustomHighlight(value) {
543
- this._data.enableCustomHighlight = value;
544
- this.change();
555
+ this.setProperty("enableCustomHighlight", value);
545
556
  }
546
557
  get sceneGraph() {
547
558
  return this._data.sceneGraph;
548
559
  }
549
560
  set sceneGraph(value) {
550
- this._data.sceneGraph = value;
551
- if (value)
552
- this._data.enablePartialMode = false;
553
- this.change();
561
+ this.setProperty("sceneGraph", value);
562
+ this.setProperty("enablePartialMode", this.enablePartialMode && !this.sceneGraph);
554
563
  }
555
564
  get edgeModel() {
556
565
  return Boolean(this._data.edgeModel);
557
566
  }
558
567
  set edgeModel(value) {
559
- this._data.edgeModel = Boolean(value);
560
- this.change();
568
+ this.setProperty("edgeModel", value);
561
569
  }
562
570
  get reverseZoomWheel() {
563
571
  return this._data.reverseZoomWheel;
564
572
  }
565
573
  set reverseZoomWheel(value) {
566
- this._data.reverseZoomWheel = !!value;
567
- this.change();
574
+ this.setProperty("reverseZoomWheel", value);
568
575
  }
569
576
  get enableZoomWheel() {
570
577
  return this._data.enableZoomWheel;
571
578
  }
572
579
  set enableZoomWheel(value) {
573
- this._data.enableZoomWheel = !!value;
574
- this.change();
580
+ this.setProperty("enableZoomWheel", value);
575
581
  }
576
582
  get enableGestures() {
577
583
  return this._data.enableGestures;
578
584
  }
579
585
  set enableGestures(value) {
580
- this._data.enableGestures = !!value;
581
- this.change();
586
+ this.setProperty("enableGestures", value);
582
587
  }
583
588
  get geometryType() {
584
589
  return this._data.geometryType;
585
590
  }
586
591
  set geometryType(value) {
587
- this._data.geometryType = value;
588
- this.change();
592
+ this.setProperty("geometryType", value);
589
593
  }
590
594
  get rulerUnit() {
591
595
  return this._data.rulerUnit;
592
596
  }
593
597
  set rulerUnit(value) {
594
- this._data.rulerUnit = value;
595
- this.change();
598
+ this.setProperty("rulerUnit", value);
596
599
  }
597
600
  get rulerPrecision() {
598
601
  return this._data.rulerPrecision;
599
602
  }
600
603
  set rulerPrecision(value) {
601
- this._data.rulerPrecision = value;
602
- this.change();
604
+ this.setProperty("rulerPrecision", value, typeof value === "number" || value === "Default" || value === "Auto");
603
605
  }
604
606
  get cameraMode() {
605
- return this._data.cameraMode || "perspective";
607
+ return this._data.cameraMode;
606
608
  }
607
609
  set cameraMode(value) {
608
- this._data.cameraMode = value;
609
- this.change();
610
+ this.setProperty("cameraMode", value, value === "perspective" || value === "orthographic");
611
+ }
612
+ get snapshotMimeType() {
613
+ return this._data.snapshotMimeType;
614
+ }
615
+ set snapshotMimeType(value) {
616
+ this.setProperty("snapshotMimeType", value);
617
+ }
618
+ get snapshotQuality() {
619
+ return this._data.snapshotQuality;
620
+ }
621
+ set snapshotQuality(value) {
622
+ this.setProperty("snapshotQuality", value);
610
623
  }
611
624
  }
612
625
  const CanvasEvents = [
@@ -770,6 +783,7 @@
770
783
  class OdBaseDragger extends OdaGeAction {
771
784
  constructor(subject) {
772
785
  super(subject.visualizeJs);
786
+ this.name = "";
773
787
  this.beginInteractivity = () => {
774
788
  const viewer = this.getViewer();
775
789
  const view = viewer.activeView;
@@ -796,6 +810,8 @@
796
810
  this.needInputText = false;
797
811
  this.mouseDownPosition = { x: 0, y: 0 };
798
812
  this.autoSelect = false;
813
+ this.isDragging = false;
814
+ this.press = false;
799
815
  this.pointerdown = this.pointerdown.bind(this);
800
816
  this.pointerup = this.pointerup.bind(this);
801
817
  this.pointercancel = this.pointercancel.bind(this);
@@ -2981,16 +2997,16 @@
2981
2997
  constructor(subject) {
2982
2998
  super(subject);
2983
2999
  this.press = false;
3000
+ this.drawPoints = [];
2984
3001
  }
2985
3002
  dispose() {
2986
3003
  super.dispose();
2987
3004
  this.end();
2988
- this.points = null;
2989
- this.drawPoints = null;
3005
+ this.drawPoints.length = 0;
2990
3006
  }
2991
3007
  start(x, y) {
2992
3008
  const point = this.getViewer().screenToWorld(x, y);
2993
- this.drawPoints = [point[0], point[1], point[2]];
3009
+ this.drawPoints.push(point[0], point[1], point[2]);
2994
3010
  }
2995
3011
  drag(x, y) {
2996
3012
  if (this.isDragging) {
@@ -3002,7 +3018,7 @@
3002
3018
  end() {
3003
3019
  if (this.entity) {
3004
3020
  this.entity.delete();
3005
- this.drawPoints = null;
3021
+ this.drawPoints.length = 0;
3006
3022
  this.entity = null;
3007
3023
  }
3008
3024
  }
@@ -3698,7 +3714,6 @@
3698
3714
  }
3699
3715
  dispose() {
3700
3716
  this.mutationObserver.disconnect();
3701
- this.mutationObserver = undefined;
3702
3717
  }
3703
3718
  }
3704
3719
 
@@ -3724,7 +3739,6 @@
3724
3739
  }
3725
3740
  dispose() {
3726
3741
  this.zoomWheelDragger.dispose();
3727
- this.zoomWheelDragger = undefined;
3728
3742
  }
3729
3743
  }
3730
3744
 
@@ -3918,7 +3932,6 @@
3918
3932
  }
3919
3933
  dispose() {
3920
3934
  this.gestureManager.dispose();
3921
- this.gestureManager = undefined;
3922
3935
  }
3923
3936
  }
3924
3937
 
@@ -3981,6 +3994,9 @@
3981
3994
  components.registerComponent("ResetComponent", (viewer) => new ResetComponent(viewer));
3982
3995
 
3983
3996
  class ModelImpl {
3997
+ constructor() {
3998
+ this.id = "";
3999
+ }
3984
4000
  dispose() { }
3985
4001
  }
3986
4002
 
@@ -3988,7 +4004,6 @@
3988
4004
  constructor() {
3989
4005
  this.requestHeader = {};
3990
4006
  this.withCredentials = false;
3991
- this.abortSignal = undefined;
3992
4007
  }
3993
4008
  setRequestHeader(requestHeader) {
3994
4009
  this.requestHeader = requestHeader;
@@ -4010,12 +4025,15 @@
4010
4025
  .then((response) => {
4011
4026
  if (!response.ok)
4012
4027
  throw new Error(`Failed to fetch "${response.url}", status ${response.status}`);
4028
+ const body = response.body;
4029
+ if (!body)
4030
+ return response;
4013
4031
  const contentLength = response.headers.get("X-File-Size") || response.headers.get("Content-Length");
4014
4032
  const total = parseInt(contentLength || "", 10) || 0;
4015
4033
  const lengthComputable = total > 0;
4016
4034
  const stream = new ReadableStream({
4017
4035
  async start(controller) {
4018
- const reader = response.body.getReader();
4036
+ const reader = body.getReader();
4019
4037
  let loaded = 0;
4020
4038
  try {
4021
4039
  while (true) {
@@ -4044,7 +4062,7 @@
4044
4062
  const reader = new FileReader();
4045
4063
  reader.onload = () => resolve(reader.result);
4046
4064
  reader.onerror = () => reject(reader.error);
4047
- reader.onprogress = onProgress;
4065
+ reader.onprogress = onProgress || null;
4048
4066
  reader.readAsArrayBuffer(new Blob([file]));
4049
4067
  });
4050
4068
  }
@@ -4063,7 +4081,7 @@
4063
4081
  super();
4064
4082
  this.viewer = viewer;
4065
4083
  }
4066
- isSupport(file, format) {
4084
+ isSupport(file, format = "") {
4067
4085
  return ((typeof file === "string" || file instanceof globalThis.File || file instanceof ArrayBuffer) &&
4068
4086
  /vsf$/i.test(format));
4069
4087
  }
@@ -4158,7 +4176,7 @@
4158
4176
  super();
4159
4177
  this.viewer = viewer;
4160
4178
  }
4161
- isSupport(file, format) {
4179
+ isSupport(file, format = "") {
4162
4180
  return ((typeof file === "string" || file instanceof globalThis.File || file instanceof ArrayBuffer) &&
4163
4181
  /vsfx$/i.test(format));
4164
4182
  }
@@ -4518,7 +4536,7 @@
4518
4536
  const script = document.createElement("script");
4519
4537
  script.src = url;
4520
4538
  script.async = true;
4521
- script.crossOrigin = params.crossOrigin;
4539
+ script.crossOrigin = params.crossOrigin || null;
4522
4540
  script.onload = () => resolve(script);
4523
4541
  script.onerror = () => {
4524
4542
  script.remove();
@@ -17316,8 +17334,8 @@ js: import "konva/skia-backend";
17316
17334
  this.lineWidth = 4;
17317
17335
  this.lineType = "solid";
17318
17336
  this.fontSize = 34;
17319
- this.changeActiveDragger = (event) => {
17320
- const draggerName = event.data;
17337
+ this.changeActiveDragger = ({ data }) => {
17338
+ const draggerName = data || "";
17321
17339
  this._markupContainer.className = this._container.className
17322
17340
  .split(" ")
17323
17341
  .filter((x) => !x.startsWith("oda-cursor-"))
@@ -17378,19 +17396,19 @@ js: import "konva/skia-backend";
17378
17396
  this._resizeObserver = new ResizeObserver(this.resizeContainer);
17379
17397
  this._resizeObserver.observe(container);
17380
17398
  if (this._viewer) {
17381
- this._viewer.addEventListener("changeactivedragger", this.changeActiveDragger);
17382
- this._viewer.addEventListener("pan", this.pan);
17383
- this._viewer.addEventListener("zoomat", this.zoomAt);
17384
- this._viewer.addEventListener("changecameramode", this.changeCameraMode);
17399
+ this._viewer.on("changeactivedragger", this.changeActiveDragger);
17400
+ this._viewer.on("pan", this.pan);
17401
+ this._viewer.on("zoomat", this.zoomAt);
17402
+ this._viewer.on("changecameramode", this.changeCameraMode);
17385
17403
  }
17386
17404
  }
17387
17405
  dispose() {
17388
17406
  var _a, _b;
17389
17407
  if (this._viewer) {
17390
- this._viewer.removeEventListener("changecameramode", this.changeCameraMode);
17391
- this._viewer.removeEventListener("zoomat", this.zoomAt);
17392
- this._viewer.removeEventListener("pan", this.pan);
17393
- this._viewer.removeEventListener("changeactivedragger", this.changeActiveDragger);
17408
+ this._viewer.off("changecameramode", this.changeCameraMode);
17409
+ this._viewer.off("zoomat", this.zoomAt);
17410
+ this._viewer.off("pan", this.pan);
17411
+ this._viewer.off("changeactivedragger", this.changeActiveDragger);
17394
17412
  }
17395
17413
  (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
17396
17414
  this._resizeObserver = undefined;
@@ -18153,6 +18171,7 @@ js: import "konva/skia-backend";
18153
18171
  constructor() {
18154
18172
  this._markupColor = { r: 255, g: 0, b: 0 };
18155
18173
  this.lineWidth = 4;
18174
+ this.lineType = "solid";
18156
18175
  this.fontSize = 34;
18157
18176
  }
18158
18177
  initialize(container, containerEvents, viewer, worldTransformer) {
@@ -18361,6 +18380,7 @@ js: import "konva/skia-backend";
18361
18380
  this.info = new Info();
18362
18381
  this.canvasEvents = CANVAS_EVENTS.slice();
18363
18382
  this.canvaseventlistener = (event) => this.emit(event);
18383
+ this._visualizeTimestamp = 0;
18364
18384
  this._activeDragger = null;
18365
18385
  this._components = [];
18366
18386
  this._renderNeeded = false;
@@ -18427,7 +18447,9 @@ js: import "konva/skia-backend";
18427
18447
  this.canvasEvents.forEach((x) => canvas.addEventListener(x, this.canvaseventlistener));
18428
18448
  this._markup.initialize(this.canvas, this.canvasEvents, this, this);
18429
18449
  for (const name of components.getComponents().keys()) {
18430
- this._components.push(components.createComponent(name, this));
18450
+ const component = components.createComponent(name, this);
18451
+ if (component)
18452
+ this._components.push(component);
18431
18453
  }
18432
18454
  this.syncOptions();
18433
18455
  this.syncOverlay();
@@ -18444,10 +18466,7 @@ js: import "konva/skia-backend";
18444
18466
  this.setActiveDragger();
18445
18467
  this._components.forEach((component) => component.dispose());
18446
18468
  this._components.length = 0;
18447
- if (this._markup) {
18448
- this._markup.dispose();
18449
- this._markup = undefined;
18450
- }
18469
+ this._markup.dispose();
18451
18470
  if (this.canvas) {
18452
18471
  this.canvasEvents.forEach((x) => this.canvas.removeEventListener(x, this.canvaseventlistener));
18453
18472
  this.canvas = undefined;
@@ -18455,7 +18474,7 @@ js: import "konva/skia-backend";
18455
18474
  if (this._viewer)
18456
18475
  this._viewer.clear();
18457
18476
  this._visualizeJs = undefined;
18458
- this._visualizeTimestamp = undefined;
18477
+ this._visualizeTimestamp = 0;
18459
18478
  this._viewer = undefined;
18460
18479
  return this;
18461
18480
  }
@@ -18832,7 +18851,7 @@ js: import "konva/skia-backend";
18832
18851
  }
18833
18852
  }
18834
18853
  getComponent(name) {
18835
- return this._components.find((component) => component.name === name);
18854
+ return this._components.find((component) => component.name === name) || null;
18836
18855
  }
18837
18856
  drawViewpoint(viewpoint) {
18838
18857
  var _a, _b;