vim-web 0.3.44-dev.2 → 0.3.44-dev.20

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.
Files changed (55) hide show
  1. package/dist/style.css +38 -1
  2. package/dist/types/core-viewers/ultra/index.d.ts +1 -1
  3. package/dist/types/core-viewers/ultra/viewer/camera.d.ts +2 -1
  4. package/dist/types/core-viewers/ultra/viewer/inputs/inputMouse.d.ts +6 -5
  5. package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +0 -1
  6. package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +1 -0
  7. package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +1 -0
  8. package/dist/types/core-viewers/ultra/viewer/sectionBox.d.ts +2 -5
  9. package/dist/types/core-viewers/ultra/viewer/selection.d.ts +2 -0
  10. package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +2 -0
  11. package/dist/types/core-viewers/ultra/viewer/vimCollection.d.ts +4 -0
  12. package/dist/types/core-viewers/webgl/utils/threeUtils.d.ts +3 -0
  13. package/dist/types/core-viewers/webgl/viewer/gizmos/gizmos.d.ts +1 -1
  14. package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +1 -1
  15. package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +2 -0
  16. package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
  17. package/dist/types/react-viewers/bim/bimTree.d.ts +2 -2
  18. package/dist/types/react-viewers/controlbar/controlBar.d.ts +6 -44
  19. package/dist/types/react-viewers/controlbar/controlBarButton.d.ts +3 -1
  20. package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +29 -0
  21. package/dist/types/react-viewers/controlbar/controlBarSection.d.ts +2 -1
  22. package/dist/types/react-viewers/helpers/inputs.d.ts +2 -2
  23. package/dist/types/react-viewers/helpers/isolation.d.ts +2 -2
  24. package/dist/types/react-viewers/helpers/reactUtils.d.ts +39 -0
  25. package/dist/types/react-viewers/index.d.ts +1 -0
  26. package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -2
  27. package/dist/types/react-viewers/panels/contextMenu.d.ts +2 -2
  28. package/dist/types/react-viewers/panels/icons.d.ts +7 -0
  29. package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +4 -0
  30. package/dist/types/react-viewers/state/cameraState.d.ts +22 -0
  31. package/dist/types/react-viewers/state/controlBarState.d.ts +64 -0
  32. package/dist/types/react-viewers/state/sectionBoxState.d.ts +30 -0
  33. package/dist/types/react-viewers/ultra/index.d.ts +2 -0
  34. package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +2 -0
  35. package/dist/types/react-viewers/ultra/ultraComponent.d.ts +1 -7
  36. package/dist/types/react-viewers/ultra/ultraComponentRef.d.ts +36 -0
  37. package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +19 -0
  38. package/dist/types/react-viewers/ultra/ultraModal.d.ts +4 -0
  39. package/dist/types/react-viewers/ultra/ultraSectionBoxState.d.ts +3 -0
  40. package/dist/types/react-viewers/webgl/index.d.ts +0 -1
  41. package/dist/types/react-viewers/webgl/webglCameraState.d.ts +2 -0
  42. package/dist/types/react-viewers/webgl/webglComponentRef.d.ts +7 -2
  43. package/dist/types/react-viewers/webgl/webglSectionBoxState.d.ts +3 -0
  44. package/dist/vim-web.iife.js +999 -424
  45. package/dist/vim-web.iife.js.map +1 -1
  46. package/dist/vim-web.js +1000 -425
  47. package/dist/vim-web.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/types/react-viewers/controlbar/controlBarCommands.d.ts +0 -4
  50. package/dist/types/react-viewers/controlbar/sectionBoxState.d.ts +0 -15
  51. package/dist/types/react-viewers/helpers/camera.d.ts +0 -37
  52. /package/dist/types/react-viewers/{controlbar → panels}/restOfScreen.d.ts +0 -0
  53. /package/dist/types/react-viewers/{controlbar → state}/fullScreenState.d.ts +0 -0
  54. /package/dist/types/react-viewers/{controlbar → state}/measureState.d.ts +0 -0
  55. /package/dist/types/react-viewers/{controlbar → state}/pointerState.d.ts +0 -0
package/dist/vim-web.js CHANGED
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import * as React from "react";
5
- import React__default, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle, useContext, Component } from "react";
5
+ import React__default, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle, useContext, Component, useLayoutEffect } from "react";
6
6
  import ReactDOM, { flushSync as flushSync$1 } from "react-dom";
7
7
  function getDefaultExportFromCjs(x) {
8
8
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -45819,7 +45819,7 @@ class ElementNoMapping {
45819
45819
  }
45820
45820
  }
45821
45821
  class ElementMapping {
45822
- constructor(instances, instanceToElement, elementIds2, instanceMeshes) {
45822
+ constructor(instances, instanceToElement, elementIds, instanceMeshes) {
45823
45823
  __publicField(this, "_instanceToElement");
45824
45824
  __publicField(this, "_instanceMeshes");
45825
45825
  __publicField(this, "_elementToInstances");
@@ -45832,17 +45832,17 @@ class ElementMapping {
45832
45832
  this._elementToInstances = ElementMapping.invertMap(
45833
45833
  this._instanceToElement
45834
45834
  );
45835
- this._elementIds = elementIds2;
45836
- this._elementIdToElements = ElementMapping.invertArray(elementIds2);
45835
+ this._elementIds = elementIds;
45836
+ this._elementIdToElements = ElementMapping.invertArray(elementIds);
45837
45837
  this._instanceMeshes = instanceMeshes;
45838
45838
  }
45839
45839
  static async fromG3d(g3d2, bim) {
45840
45840
  const instanceToElement = await bim.node.getAllElementIndex();
45841
- const elementIds2 = await bim.element.getAllId();
45841
+ const elementIds = await bim.element.getAllId();
45842
45842
  return new ElementMapping(
45843
45843
  Array.from(g3d2.instanceNodes),
45844
45844
  instanceToElement,
45845
- elementIds2,
45845
+ elementIds,
45846
45846
  g3d2.instanceMeshes
45847
45847
  );
45848
45848
  }
@@ -50648,7 +50648,7 @@ class CameraLerp extends CameraMovement {
50648
50648
  }
50649
50649
  init(duration) {
50650
50650
  this.cancel();
50651
- this._duration = duration;
50651
+ this._duration = Math.max(duration, 0.01);
50652
50652
  this._clock.start();
50653
50653
  }
50654
50654
  cancel() {
@@ -50969,6 +50969,7 @@ let Camera$1 = class Camera2 {
50969
50969
  * @returns {CameraMovement} The camera movement api.
50970
50970
  */
50971
50971
  lerp(duration = 1, force = false) {
50972
+ if (duration <= 0) return this.snap(force);
50972
50973
  this.stop();
50973
50974
  this._force = force;
50974
50975
  this._lerp.init(duration);
@@ -51870,10 +51871,10 @@ class MouseHandler extends InputHandler$1 {
51870
51871
  });
51871
51872
  __publicField(this, "onMouseUp", (event) => {
51872
51873
  event.stopImmediatePropagation();
51874
+ event.preventDefault();
51873
51875
  const btn = this.getButton(event);
51874
51876
  if (btn === this._buttonDown) return;
51875
51877
  this._viewer.gizmos.rectangle.visible = false;
51876
- event.preventDefault();
51877
51878
  if (!this._buttonDown) return;
51878
51879
  if (this.inputs.pointerActive === "rect" && this._hasMouseMoved && !this._hasCameraMoved) {
51879
51880
  this.onRectEnd();
@@ -51890,6 +51891,7 @@ class MouseHandler extends InputHandler$1 {
51890
51891
  this.inputs.pointerOverride = void 0;
51891
51892
  });
51892
51893
  __publicField(this, "onDoubleClick", (event) => {
51894
+ console.log("Double click");
51893
51895
  event.stopImmediatePropagation();
51894
51896
  this.onMouseClick(
51895
51897
  new Vector2(event.offsetX, event.offsetY),
@@ -52237,7 +52239,7 @@ class DefaultInputScheme {
52237
52239
  }
52238
52240
  }
52239
52241
  onIdleAction(hit) {
52240
- if (!this._viewer.gizmos.section.interactive) {
52242
+ if (!this._viewer.gizmos.sectionBox.interactive) {
52241
52243
  this._viewer.selection.focus(hit == null ? void 0 : hit.object);
52242
52244
  }
52243
52245
  }
@@ -54795,12 +54797,12 @@ class MeasureGizmo {
54795
54797
  const xz = this.screenDist(this._lineX.position, this._lineZ.position);
54796
54798
  const yz = this.screenDist(this._lineY.position, this._lineZ.position);
54797
54799
  let conflicts = 0;
54798
- if (lx !== void 0 && lx < 0.1) conflicts++;
54799
- if (ly !== void 0 && ly < 0.1) conflicts++;
54800
- if (lz !== void 0 && lz < 0.1) conflicts++;
54801
- if (xy !== void 0 && xy < 0.1) conflicts++;
54802
- if (xz !== void 0 && xz < 0.1) conflicts++;
54803
- if (yz !== void 0 && yz < 0.1) conflicts++;
54800
+ if (lx !== void 0 && lx < 0.3) conflicts++;
54801
+ if (ly !== void 0 && ly < 0.3) conflicts++;
54802
+ if (lz !== void 0 && lz < 0.3) conflicts++;
54803
+ if (xy !== void 0 && xy < 0.3) conflicts++;
54804
+ if (xz !== void 0 && xz < 0.3) conflicts++;
54805
+ if (yz !== void 0 && yz < 0.3) conflicts++;
54804
54806
  const collapse2 = conflicts > 1;
54805
54807
  this._label.visible = collapse2;
54806
54808
  this._line.label.visible = !collapse2;
@@ -54830,6 +54832,7 @@ class MeasureGizmo {
54830
54832
  this._line.mesh.visible = false;
54831
54833
  this._line.label.visible = false;
54832
54834
  }
54835
+ this._label.visible = false;
54833
54836
  this._viewer.renderer.needsUpdate = true;
54834
54837
  }
54835
54838
  /**
@@ -54879,7 +54882,9 @@ class MeasureGizmo {
54879
54882
  * Disposes all resources.
54880
54883
  */
54881
54884
  dispose() {
54885
+ console.log("dispose");
54882
54886
  if (this._animId !== void 0) cancelAnimationFrame(this._animId);
54887
+ this._html.div.remove();
54883
54888
  this._viewer.renderer.remove(this._group);
54884
54889
  this._startMarker.dispose();
54885
54890
  this._endMarker.dispose();
@@ -55450,6 +55455,7 @@ class SectionBoxHandle extends Mesh {
55450
55455
  __publicField(this, "_color");
55451
55456
  __publicField(this, "_highlightColor");
55452
55457
  __publicField(this, "_materials");
55458
+ __publicField(this, "_camera");
55453
55459
  __publicField(this, "_camSub");
55454
55460
  this._materials = [matAlways, matBehind];
55455
55461
  this._forward = new Vector3();
@@ -55462,15 +55468,18 @@ class SectionBoxHandle extends Mesh {
55462
55468
  this.quaternion.setFromUnitVectors(new Vector3(0, -1, 0), this._forward);
55463
55469
  }
55464
55470
  trackCamera(camera2) {
55465
- const rescale = () => {
55466
- const size = camera2.frustrumSizeAt(this.position);
55467
- this.scale.set(size.x * 5e-3, size.x * 5e-3, size.x * 5e-3);
55468
- };
55469
- this._camSub = camera2.onMoved.subscribe(() => rescale());
55470
- rescale();
55471
+ this._camera = camera2;
55472
+ this.update();
55473
+ this._camSub = camera2.onMoved.subscribe(() => this.update());
55474
+ }
55475
+ update() {
55476
+ if (!this._camera) return;
55477
+ const size = this._camera.frustrumSizeAt(this.position);
55478
+ this.scale.set(size.x * 3e-3, size.x * 3e-3, size.x * 3e-3);
55471
55479
  }
55472
55480
  setPosition(position) {
55473
55481
  this.position.copy(position);
55482
+ this.update();
55474
55483
  }
55475
55484
  get forward() {
55476
55485
  return this._forward;
@@ -55628,6 +55637,9 @@ let SectionBox$1 = class SectionBox {
55628
55637
  this.update();
55629
55638
  };
55630
55639
  this._inputs.onBoxConfirm = (box) => this._onBoxConfirm.dispatch(box);
55640
+ viewer.renderer.onBoxUpdated.subscribe(() => {
55641
+ this.fitBox(viewer.renderer.getBoundingBox());
55642
+ });
55631
55643
  this.clip = false;
55632
55644
  this.visible = false;
55633
55645
  this.interactive = false;
@@ -55728,6 +55740,7 @@ let SectionBox$1 = class SectionBox {
55728
55740
  set visible(value) {
55729
55741
  if (value === this._visible) return;
55730
55742
  this._gizmos.visible = value;
55743
+ this._visible = value;
55731
55744
  if (value) {
55732
55745
  this.update();
55733
55746
  }
@@ -55744,11 +55757,10 @@ let SectionBox$1 = class SectionBox {
55744
55757
  * @param box - The bounding box to match (required).
55745
55758
  * @param padding - The scalar amount by which to expand the bounding box. Default is `1`.
55746
55759
  */
55747
- fitBox(box, padding = 1) {
55760
+ fitBox(box) {
55748
55761
  if (!box) return;
55749
- const b = box.expandByScalar(padding);
55750
- this._gizmos.fitBox(b);
55751
- this.renderer.section.fitBox(b);
55762
+ this._gizmos.fitBox(box);
55763
+ this.renderer.section.fitBox(box);
55752
55764
  this._onBoxConfirm.dispatch(this.box);
55753
55765
  this.renderer.needsUpdate = true;
55754
55766
  }
@@ -55758,7 +55770,7 @@ let SectionBox$1 = class SectionBox {
55758
55770
  * Call this if the renderer's section box is changed by code outside this class.
55759
55771
  */
55760
55772
  update() {
55761
- this.fitBox(this.section.box, 0);
55773
+ this.fitBox(this.section.box);
55762
55774
  this.renderer.needsUpdate = true;
55763
55775
  }
55764
55776
  /**
@@ -55780,7 +55792,7 @@ class Gizmos {
55780
55792
  /**
55781
55793
  * The section box gizmo.
55782
55794
  */
55783
- __publicField(this, "section");
55795
+ __publicField(this, "sectionBox");
55784
55796
  /**
55785
55797
  * The loading indicator gizmo.
55786
55798
  */
@@ -55804,7 +55816,7 @@ class Gizmos {
55804
55816
  var _a2;
55805
55817
  this.viewer = viewer;
55806
55818
  this._measure = new Measure(viewer);
55807
- this.section = new SectionBox$1(viewer);
55819
+ this.sectionBox = new SectionBox$1(viewer);
55808
55820
  this.loading = new GizmoLoading(viewer);
55809
55821
  this.orbit = new GizmoOrbit(
55810
55822
  viewer.renderer,
@@ -55833,7 +55845,7 @@ class Gizmos {
55833
55845
  var _a2;
55834
55846
  (_a2 = this.viewer.viewport.canvas.parentElement) == null ? void 0 : _a2.removeChild(this.axes.canvas);
55835
55847
  this._measure.clear();
55836
- this.section.dispose();
55848
+ this.sectionBox.dispose();
55837
55849
  this.loading.dispose();
55838
55850
  this.orbit.dispose();
55839
55851
  this.rectangle.dispose();
@@ -57605,6 +57617,36 @@ function clamp$1(value, min2, max2) {
57605
57617
  }
57606
57618
  return Math.min(Math.max(value, min2), max2);
57607
57619
  }
57620
+ class CaptureStateMachine {
57621
+ constructor(canvas) {
57622
+ __publicField(this, "_canvas");
57623
+ __publicField(this, "state");
57624
+ __publicField(this, "id");
57625
+ this._canvas = canvas;
57626
+ this.state = "none";
57627
+ this.id = -1;
57628
+ }
57629
+ onPointerDown(event) {
57630
+ if (this.state === "captured") {
57631
+ this._canvas.releasePointerCapture(this.id);
57632
+ }
57633
+ this.id = event.pointerId;
57634
+ this.state = "captured";
57635
+ }
57636
+ onPointerMove(event) {
57637
+ if (this.state === "capture") {
57638
+ this._canvas.setPointerCapture(this.id);
57639
+ this.state = "captured";
57640
+ }
57641
+ }
57642
+ onPointerUp(event) {
57643
+ if (this.state === "captured") {
57644
+ this._canvas.releasePointerCapture(this.id);
57645
+ this.state = "none";
57646
+ this.id = -1;
57647
+ }
57648
+ }
57649
+ }
57608
57650
  class InputMouse extends InputHandler2 {
57609
57651
  constructor(canvas, rpc, selection, camera2) {
57610
57652
  super();
@@ -57613,45 +57655,47 @@ class InputMouse extends InputHandler2 {
57613
57655
  __publicField(this, "_lastMouseDownPosition", new Vector2(0, 0));
57614
57656
  __publicField(this, "_selection");
57615
57657
  __publicField(this, "_camera");
57658
+ __publicField(this, "_capture");
57616
57659
  this._canvas = canvas;
57617
57660
  this._rpc = rpc;
57618
57661
  this._selection = selection;
57619
57662
  this._camera = camera2;
57663
+ this._capture = new CaptureStateMachine(canvas);
57620
57664
  }
57621
57665
  register() {
57622
57666
  this.reg(this._canvas, "pointerdown", (e) => {
57623
- this.handlePointerDown(e);
57667
+ this.onPointerDown(e);
57624
57668
  });
57625
57669
  this.reg(this._canvas, "pointerup", (e) => {
57626
- this.handlePointerUp(e);
57670
+ this.onPointerUp(e);
57627
57671
  });
57628
57672
  this.reg(this._canvas, "pointermove", (e) => {
57629
- this.handlePointerMove(e);
57673
+ this.onPointerMove(e);
57630
57674
  });
57631
57675
  this.reg(this._canvas, "wheel", (e) => {
57632
- this.handleMouseScroll(e);
57676
+ this.onMouseScroll(e);
57633
57677
  });
57634
57678
  this.reg(this._canvas, "dblclick", (e) => {
57635
- this.handleDoubleClick(e);
57679
+ this.onDoubleClick(e);
57636
57680
  });
57637
57681
  }
57638
57682
  dispose() {
57639
57683
  this.unregister();
57640
57684
  }
57641
- handlePointerDown(event) {
57685
+ onPointerDown(event) {
57642
57686
  if (event.pointerType !== "mouse") return;
57643
57687
  const pos = this.relativePosition(event);
57644
57688
  this._rpc.RPCMouseButtonEvent(pos, event.button, true);
57645
57689
  this._lastMouseDownPosition = pos;
57646
- this._canvas.setPointerCapture(event.pointerId);
57690
+ this._capture.onPointerDown(event);
57647
57691
  event.preventDefault();
57648
57692
  }
57649
- handlePointerUp(event) {
57693
+ onPointerUp(event) {
57650
57694
  if (event.pointerType !== "mouse") return;
57651
57695
  const pos = this.relativePosition(event);
57652
57696
  this._rpc.RPCMouseButtonEvent(pos, event.button, false);
57653
57697
  this.handleMouseClick(event);
57654
- this._canvas.releasePointerCapture(event.pointerId);
57698
+ this._capture.onPointerUp(event);
57655
57699
  event.preventDefault();
57656
57700
  }
57657
57701
  async handleMouseClick(event) {
@@ -57671,21 +57715,24 @@ class InputMouse extends InputHandler2 {
57671
57715
  this._selection.select(hit.vim, hit.nodeIndex);
57672
57716
  }
57673
57717
  }
57674
- handlePointerMove(event) {
57718
+ onPointerMove(event) {
57675
57719
  if (event.pointerType !== "mouse") return;
57676
57720
  this._canvas.focus();
57721
+ this._capture.onPointerMove(event);
57677
57722
  const pos = this.relativePosition(event);
57678
57723
  this._rpc.RPCMouseMoveEvent(pos);
57679
57724
  }
57680
- async handleDoubleClick(event) {
57725
+ async onDoubleClick(event) {
57681
57726
  const pos = this.relativePosition(event);
57682
57727
  const hit = await this._selection.hitTest(pos);
57683
57728
  if (hit) {
57684
57729
  this._camera.frameVim(hit.vim, [hit.nodeIndex], 1);
57730
+ } else {
57731
+ this._camera.frameAll(1);
57685
57732
  }
57686
57733
  event.preventDefault();
57687
57734
  }
57688
- handleMouseScroll(event) {
57735
+ onMouseScroll(event) {
57689
57736
  this._rpc.RPCMouseScrollEvent(Math.sign(event.deltaY));
57690
57737
  event.preventDefault();
57691
57738
  }
@@ -57993,7 +58040,6 @@ class Marshal {
57993
58040
  }
57994
58041
  // -------------------- SectionBox -------------------
57995
58042
  writeSectionBoxState(data2) {
57996
- this.writeBoolean(data2.enabled);
57997
58043
  this.writeBoolean(data2.visible);
57998
58044
  this.writeBoolean(data2.interactible);
57999
58045
  this.writeBoolean(data2.clip);
@@ -58149,13 +58195,11 @@ class ReadMarshal {
58149
58195
  return new Segment(position, target);
58150
58196
  }
58151
58197
  readSectionBoxState() {
58152
- const enabled = this.readBoolean();
58153
58198
  const visible2 = this.readBoolean();
58154
58199
  const interactible = this.readBoolean();
58155
58200
  const clip = this.readBoolean();
58156
58201
  const box = this.readBox3();
58157
58202
  return {
58158
- enabled,
58159
58203
  visible: visible2,
58160
58204
  interactible,
58161
58205
  clip,
@@ -58274,6 +58318,12 @@ class RpcClient {
58274
58318
  marshal.writeUInt(componentHandle);
58275
58319
  this._socket.sendRPC(marshal);
58276
58320
  }
58321
+ RPCEnableSectionBox(value) {
58322
+ const marshal = new Marshal();
58323
+ marshal.writeString("RPCEnableSectionBox");
58324
+ marshal.writeBoolean(value);
58325
+ this._socket.sendRPC(marshal);
58326
+ }
58277
58327
  async RPCFrameAll(blendTime) {
58278
58328
  const marshal = new Marshal();
58279
58329
  marshal.writeString("RPCFrameAll");
@@ -59117,6 +59167,9 @@ class RpcSafeClient {
59117
59167
  * SECTION BOX METHODS
59118
59168
  * Methods for controlling section box visibility and position.
59119
59169
  ******************************************************************************/
59170
+ RPCEnableSectionBox(enable) {
59171
+ this.rpc.RPCEnableSectionBox(enable);
59172
+ }
59120
59173
  RPCSetSectionBox(state) {
59121
59174
  this.rpc.RPCSetSectionBox(state);
59122
59175
  }
@@ -59659,15 +59712,19 @@ class InputKeyboard extends InputHandler2 {
59659
59712
  switch (event.key) {
59660
59713
  case "Escape":
59661
59714
  this._selection.clear();
59715
+ event.preventDefault();
59662
59716
  break;
59663
59717
  case "f":
59664
59718
  this.frameContext();
59719
+ event.preventDefault();
59665
59720
  break;
59666
59721
  case "Home":
59667
59722
  this._camera.restoreSavedPosition();
59723
+ event.preventDefault();
59668
59724
  break;
59669
59725
  case " ":
59670
59726
  this._inputs.mode = this._inputs.mode === InputMode.Orbit ? InputMode.Free : InputMode.Orbit;
59727
+ event.preventDefault();
59671
59728
  break;
59672
59729
  }
59673
59730
  }
@@ -60784,8 +60841,8 @@ class Vim2 {
60784
60841
  if (nodes === "all") {
60785
60842
  this._rpc.RPCClearMaterialOverrides(this._handle);
60786
60843
  } else {
60787
- const ids = new Array(nodes.length).fill(MaterialHandles.Invalid);
60788
- this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids);
60844
+ const ids2 = new Array(nodes.length).fill(MaterialHandles.Invalid);
60845
+ this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids2);
60789
60846
  }
60790
60847
  }
60791
60848
  updateMap(nodes, state) {
@@ -61207,11 +61264,15 @@ class Camera3 {
61207
61264
  * Handles camera initialization when connection is established
61208
61265
  */
61209
61266
  onConnect() {
61267
+ this.set(new Vector3(-1e3, 1e3, 1e3), new Vector3(0, 0, 0), 0);
61210
61268
  this.restoreLastPosition();
61211
61269
  }
61212
61270
  onCameraPose(pose) {
61213
61271
  this._lastPosition = pose;
61214
61272
  }
61273
+ set(position, target, blendTime = this._defaultBlendTime) {
61274
+ this._rpc.RPCSetCameraPosition(new Segment(position, target), blendTime);
61275
+ }
61215
61276
  /**
61216
61277
  * Pauses or resumes rendering
61217
61278
  * @param value - True to pause rendering, false to resume
@@ -61225,6 +61286,7 @@ class Camera3 {
61225
61286
  * @returns Promise that resolves when the framing animation is complete
61226
61287
  */
61227
61288
  async frameAll(blendTime = this._defaultBlendTime) {
61289
+ console.log("Camera.frameAll");
61228
61290
  const segment = await this._rpc.RPCFrameAll(blendTime);
61229
61291
  this._savedPosition = this._savedPosition ?? segment;
61230
61292
  return segment;
@@ -61235,6 +61297,7 @@ class Camera3 {
61235
61297
  * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
61236
61298
  */
61237
61299
  async frameBox(box, blendTime = this._defaultBlendTime) {
61300
+ console.log("Camera.frameAll");
61238
61301
  const segment = await this._rpc.RPCFrameBox(box, blendTime);
61239
61302
  this._savedPosition = this._savedPosition ?? segment;
61240
61303
  return segment;
@@ -61267,10 +61330,14 @@ class ViewerSelection {
61267
61330
  __publicField(this, "_rpc");
61268
61331
  __publicField(this, "_vims");
61269
61332
  __publicField(this, "_selectedNodes");
61333
+ __publicField(this, "_onValueChanged", new distExports$1.SignalDispatcher());
61270
61334
  this._rpc = rpc;
61271
61335
  this._vims = vims;
61272
61336
  this._selectedNodes = /* @__PURE__ */ new Map();
61273
61337
  }
61338
+ get onValueChanged() {
61339
+ return this._onValueChanged.asEvent();
61340
+ }
61274
61341
  /**
61275
61342
  * Gets the total number of selected nodes across all VIMs.
61276
61343
  * @returns The total count of selected nodes.
@@ -61339,12 +61406,17 @@ class ViewerSelection {
61339
61406
  nodeSet = /* @__PURE__ */ new Set();
61340
61407
  this._selectedNodes.set(vim, nodeSet);
61341
61408
  }
61409
+ let changed = false;
61342
61410
  nodes.forEach((n) => {
61343
61411
  if (!nodeSet.has(n)) {
61344
61412
  nodeSet.add(n);
61345
61413
  vim.highlight([n]);
61414
+ changed = true;
61346
61415
  }
61347
61416
  });
61417
+ if (changed) {
61418
+ this._onValueChanged.dispatch();
61419
+ }
61348
61420
  }
61349
61421
  /**
61350
61422
  * Removes the specified node(s) from the current selection.
@@ -61356,27 +61428,37 @@ class ViewerSelection {
61356
61428
  const nodeSet = this._selectedNodes.get(vim);
61357
61429
  if (!nodeSet) return;
61358
61430
  const nodes = Array.isArray(node) ? node : [node];
61431
+ let changed = false;
61359
61432
  nodes.forEach((n) => {
61360
61433
  if (nodeSet.has(n)) {
61361
61434
  nodeSet.delete(n);
61362
61435
  vim.removeHighlight([n], "visible");
61436
+ changed = true;
61363
61437
  }
61364
61438
  });
61365
61439
  if (nodeSet.size === 0) {
61366
61440
  this._selectedNodes.delete(vim);
61367
61441
  }
61442
+ if (changed) {
61443
+ this._onValueChanged.dispatch();
61444
+ }
61368
61445
  }
61369
61446
  /**
61370
61447
  * Clears all selections across all VIMs or for a specific VIM.
61371
61448
  * @param vim - Optional. If provided, only clears selections for the specified VIM.
61372
61449
  */
61373
61450
  clear(vim) {
61451
+ let changed = false;
61374
61452
  this._selectedNodes.forEach((nodes, v) => {
61375
61453
  if (vim === void 0 || v === vim) {
61376
61454
  v.removeHighlight(Array.from(nodes), "visible");
61455
+ changed = true;
61377
61456
  }
61378
61457
  });
61379
61458
  this._selectedNodes.clear();
61459
+ if (changed) {
61460
+ this._onValueChanged.dispatch();
61461
+ }
61380
61462
  }
61381
61463
  /**
61382
61464
  * Calculates the bounding box encompassing all selected nodes.
@@ -61405,8 +61487,12 @@ class ViewerSelection {
61405
61487
  class VimCollection {
61406
61488
  constructor() {
61407
61489
  __publicField(this, "_vims");
61490
+ __publicField(this, "_onChanged", new distExports$1.SignalDispatcher());
61408
61491
  this._vims = [];
61409
61492
  }
61493
+ get onChanged() {
61494
+ return this._onChanged.asEvent();
61495
+ }
61410
61496
  get count() {
61411
61497
  return this._vims.length;
61412
61498
  }
@@ -61417,6 +61503,7 @@ class VimCollection {
61417
61503
  add(vim) {
61418
61504
  if (!this._vims.some((v) => v.handle === vim.handle)) {
61419
61505
  this._vims.push(vim);
61506
+ this._onChanged.dispatch();
61420
61507
  }
61421
61508
  }
61422
61509
  /**
@@ -61424,7 +61511,11 @@ class VimCollection {
61424
61511
  * @param vim - The Vim instance to remove.
61425
61512
  */
61426
61513
  remove(vim) {
61514
+ const count = this._vims.length;
61427
61515
  this._vims = this._vims.filter((v) => v.handle !== vim.handle);
61516
+ if (this._vims.length !== count) {
61517
+ this._onChanged.dispatch();
61518
+ }
61428
61519
  }
61429
61520
  /**
61430
61521
  * Gets a Vim instance by its handle.
@@ -61687,7 +61778,6 @@ class Renderer2 {
61687
61778
  }
61688
61779
  class SectionBox2 {
61689
61780
  constructor(rpc) {
61690
- __publicField(this, "_enabled", false);
61691
61781
  __publicField(this, "_visible", true);
61692
61782
  __publicField(this, "_interactible", true);
61693
61783
  __publicField(this, "_clip", true);
@@ -61706,6 +61796,7 @@ class SectionBox2 {
61706
61796
  return this._animationFrame > 0;
61707
61797
  }
61708
61798
  async onConnect() {
61799
+ this._rpc.RPCEnableSectionBox(true);
61709
61800
  this.push();
61710
61801
  this._interval = setInterval(() => this.pull(), 1e3);
61711
61802
  }
@@ -61720,10 +61811,9 @@ class SectionBox2 {
61720
61811
  if (this.needUpdate) return;
61721
61812
  const state = await this._rpc.RPCGetSectionBox();
61722
61813
  let changed = false;
61723
- if (state.enabled !== this._enabled || state.visible !== this._visible || state.interactible !== this._interactible || state.clip !== this._clip || state.box !== this._box) {
61814
+ if (state.visible !== this._visible || state.interactible !== this._interactible || state.clip !== this._clip || state.box !== this._box) {
61724
61815
  changed = true;
61725
61816
  }
61726
- this._enabled = state.enabled;
61727
61817
  this._visible = state.visible;
61728
61818
  this._interactible = state.interactible;
61729
61819
  this._clip = state.clip;
@@ -61734,20 +61824,12 @@ class SectionBox2 {
61734
61824
  }
61735
61825
  async push() {
61736
61826
  await this._rpc.RPCSetSectionBox({
61737
- enabled: this._enabled,
61738
61827
  visible: this._visible,
61739
61828
  interactible: this._interactible,
61740
61829
  clip: this._clip,
61741
61830
  box: this._box
61742
61831
  });
61743
61832
  }
61744
- get enabled() {
61745
- return this._enabled;
61746
- }
61747
- set enabled(value) {
61748
- this._enabled = value;
61749
- this.scheduleUpdate();
61750
- }
61751
61833
  get visible() {
61752
61834
  return this._visible;
61753
61835
  }
@@ -61755,10 +61837,10 @@ class SectionBox2 {
61755
61837
  this._visible = value;
61756
61838
  this.scheduleUpdate();
61757
61839
  }
61758
- get interactible() {
61840
+ get interactive() {
61759
61841
  return this._interactible;
61760
61842
  }
61761
- set interactible(value) {
61843
+ set interactive(value) {
61762
61844
  this._interactible = value;
61763
61845
  this.scheduleUpdate();
61764
61846
  }
@@ -61868,6 +61950,9 @@ class Viewer2 {
61868
61950
  get decoder() {
61869
61951
  return this._decoder;
61870
61952
  }
61953
+ get selection() {
61954
+ return this._selection;
61955
+ }
61871
61956
  /**
61872
61957
  * Gets the current URL to which the viewer is connected.
61873
61958
  * @returns The URL as a string, or undefined if not connected.
@@ -66498,6 +66583,31 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
66498
66583
  wrapper: "div",
66499
66584
  clickable: false
66500
66585
  }), _defineProperty(_class2, "supportedWrappers", ["div", "span"]), _defineProperty(_class2, "displayName", "ReactTooltip"), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
66586
+ function slidersHoriz({ height, width, fill: fill2, className }) {
66587
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
66588
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66589
+ "path",
66590
+ {
66591
+ fill: fill2,
66592
+ d: "M24,74h111.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h19.163c8.836,0,16-7.164,16-16s-7.164-16-16-16h-19.163c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16Zm132.083-17.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637Z"
66593
+ }
66594
+ ),
66595
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66596
+ "path",
66597
+ {
66598
+ fill: fill2,
66599
+ d: "M232,112H120.837c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16h19.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h111.163c8.836,0,16-7.164,16-16s-7.164-16-16-16Zm-132.083,17.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637Z"
66600
+ }
66601
+ ),
66602
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66603
+ "path",
66604
+ {
66605
+ fill: fill2,
66606
+ d: "M232,182h-19.163c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16h111.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h19.163c8.836,0,16-7.164,16-16s-7.164-16-16-16Zm-40.083,17.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637Z"
66607
+ }
66608
+ )
66609
+ ] });
66610
+ }
66501
66611
  function settings({ height, width, fill: fill2, className }) {
66502
66612
  return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height, width, viewBox: "0 0 256 256", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
66503
66613
  "path",
@@ -66742,6 +66852,25 @@ function hidden({ height, width, fill: fill2, className = "" }) {
66742
66852
  }
66743
66853
  );
66744
66854
  }
66855
+ function autoCamera({ height, width, fill: fill2 = "", className }) {
66856
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
66857
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
66858
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66859
+ "path",
66860
+ {
66861
+ fill: fill2,
66862
+ d: "M 242.35934,69.720521 V 192.19034 c 0,9.46501 -7.97359,15.37204 -14.35248,10.67406 l -39.68884,-29.41993 v 8.38267 c 0,25.1595 -15.90243,45.64407 -35.51391,45.64407 H 48.520099 C 28.90861,227.51727 13.006195,206.98664 13.006195,181.80411 V 80.187338 c 0,-25.159506 15.902415,-45.644066 35.513904,-45.644066 H 152.55325 c 19.57566,0 35.51392,20.4385 35.51392,45.644066 v 8.382665 L 227.756,59.150074 c 6.33409,-4.801607 14.60334,1.162981 14.60334,10.570447 z"
66863
+ }
66864
+ ),
66865
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66866
+ "path",
66867
+ {
66868
+ fill: "white",
66869
+ d: "m 134.24221,179.28573 -6.38,-16.771 H 73.539201 l -6.38,17.135 c -2.492,6.684 -4.618,11.211 -6.38,13.581 -1.763,2.309 -4.649,3.464 -8.659,3.464 -3.403,0 -6.411,-1.246 -9.024,-3.737 -2.613,-2.492 -3.919,-5.317 -3.919,-8.477 0,-1.823 0.304,-3.706 0.911,-5.651 0.608,-1.944 1.611,-4.648 3.008,-8.112 l 34.18,-86.771005 c 0.972,-2.491 2.127,-5.469 3.463,-8.932 1.398,-3.525 2.856,-6.441 4.375,-8.75 1.58,-2.309 3.616,-4.163 6.107,-5.56 2.552005,-1.458 5.682005,-2.188 9.388009,-2.188 3.768,0 6.897,0.73 9.388,2.188 2.552,1.397 4.588,3.22 6.107,5.469 1.58,2.248 2.886,4.678 3.919,7.291 1.094,2.552 2.461,5.986 4.102,10.3 l 34.909,86.224005 c 2.734,6.562 4.101,11.332 4.101,14.31 0,3.099 -1.306,5.955 -3.919,8.568 -2.552,2.552 -5.651,3.828 -9.297,3.828 -2.126,0 -3.949,-0.395 -5.468,-1.185 -1.52,-0.729 -2.796,-1.732 -3.829,-3.008 -1.033,-1.337 -2.157,-3.342 -3.372,-6.016 -1.155,-2.734 -2.157,-5.134 -3.008,-7.2 z m -53.594009,-37.097 h 39.922009 l -20.143,-55.143005 z"
66870
+ }
66871
+ )
66872
+ ] });
66873
+ }
66745
66874
  function orbit({ height, width, fill: fill2 = "", className }) {
66746
66875
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
66747
66876
  /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
@@ -67032,6 +67161,60 @@ function measure({ height, width, fill: fill2, className }) {
67032
67161
  )
67033
67162
  ] });
67034
67163
  }
67164
+ function sectionBoxSettings({ height, width, fill: fill2, className }) {
67165
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67166
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67167
+ "path",
67168
+ {
67169
+ fill: fill2,
67170
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67171
+ }
67172
+ ),
67173
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67174
+ "path",
67175
+ {
67176
+ fill: fill2,
67177
+ d: "m 175.57713,226.38215 c -1.28316,3.98514 -5.40414,6.14971 -9.13315,4.86244 l -3.60809,-1.24739 c -3.76004,-1.29737 -5.86799,-5.60846 -4.70379,-9.64145 l 0.42438,-1.46966 c 0.96925,-3.3572 -0.3989,-7.74539 -3.07521,-9.81798 l -0.73032,-0.56682 c -2.66882,-2.0641 -7.02118,-2.10184 -9.7235,-0.0863 l -1.1842,0.8837 c -3.23919,2.42089 -7.76901,1.59565 -10.07644,-1.77642 l -2.23242,-3.26259 c -2.3254,-3.40131 -1.6226,-8.22657 1.51812,-10.73784 l 1.15669,-0.92571 c 2.63933,-2.1082 3.9555,-6.51288 2.93126,-9.86426 l -0.27844,-0.91558 c -1.01877,-3.33861 -4.52035,-6.09072 -7.821,-6.14815 l -1.44661,-0.0253 c -3.95551,-0.0693 -7.1652,-3.56724 -7.1652,-7.7374 v -4.03725 c 0,-4.20531 3.2372,-7.66991 7.1652,-7.73745 l 1.44661,-0.0251 c 3.30016,-0.0568 6.79826,-2.79894 7.821,-6.14974 l 0.27844,-0.91348 c 1.02023,-3.33859 -0.29193,-7.75605 -2.93126,-9.86586 l -1.15669,-0.9241 c -3.16419,-2.52987 -3.82354,-7.3652 -1.51812,-10.73784 l 2.23242,-3.2647 c 2.32739,-3.39921 6.86326,-4.17603 10.07644,-1.77645 l 1.1842,0.88372 c 2.70232,2.01782 7.04471,1.98645 9.7235,-0.086 l 0.73032,-0.56467 c 2.66683,-2.06414 4.04446,-6.46083 3.07521,-9.81803 l -0.42438,-1.47176 c -1.1627,-4.02504 0.97525,-8.35208 4.70379,-9.63935 l 3.60809,-1.24738 c 3.76004,-1.299493 7.84798,0.87146 9.13315,4.86086 l 0.46987,1.4569 c 1.07175,3.32157 4.60331,6.0152 7.91546,6.0152 h 0.90232 c 3.30011,0 6.84321,-2.69363 7.91345,-6.0152 l 0.46988,-1.4569 c 1.28517,-3.98301 5.40663,-6.148123 9.13516,-4.86033 l 3.60808,1.24739 c 3.76006,1.29738 5.86803,5.60632 4.70383,9.63932 l -0.42441,1.47179 c -0.96925,3.35722 0.39893,7.7454 3.07522,9.81798 l 0.73029,0.56467 c 2.66883,2.06622 7.02122,2.10401 9.72154,0.0862 l 1.1842,-0.88369 c 3.23916,-2.41874 7.77099,-1.59353 10.0764,1.77644 l 2.23444,3.26469 c 2.32542,3.40132 1.62261,8.22656 -1.51812,10.73784 l -1.15667,0.92409 c -2.63936,2.11036 -3.95552,6.51504 -2.93328,9.86586 l 0.28043,0.91346 c 1.01873,3.34022 4.52035,6.09284 7.82101,6.14975 l 1.44514,0.0251 c 3.95749,0.0671 7.16516,3.56725 7.16516,7.73741 v 4.03729 c 0,4.20314 -3.23717,7.66987 -7.16516,7.73739 l -1.44514,0.0254 c -3.30016,0.0568 -6.79828,2.79678 -7.82101,6.14812 l -0.28043,0.91562 c -1.01872,3.33856 0.29392,7.75601 2.93328,9.86424 l 1.15667,0.92571 c 3.16422,2.52985 3.82355,7.36522 1.51812,10.73786 l -2.23444,3.26254 c -2.32537,3.40135 -6.86123,4.17815 -10.0764,1.77645 l -1.1842,-0.88373 c -2.70032,-2.01569 -7.04322,-1.98646 -9.72154,0.086 l -0.73029,0.56681 c -2.66683,2.06412 -4.04447,6.46079 -3.07522,9.81801 l 0.42441,1.46964 c 1.1627,4.02717 -0.97526,8.3542 -4.70383,9.64146 l -3.60808,1.24739 c -3.76002,1.29736 -7.84798,-0.87146 -9.13516,-4.86248 l -0.46988,-1.45474 c -1.06973,-3.32157 -4.60133,-6.01523 -7.91345,-6.01523 h -0.90232 c -3.30013,0 -6.84323,2.69366 -7.91546,6.01523 l -0.46987,1.45474 z m 8.83473,-24.33631 c 18.77473,0 33.99232,-16.18681 33.99232,-36.15723 0,-19.97043 -15.21759,-36.1551 -33.99232,-36.1551 -18.77467,0 -33.9903,16.18681 -33.9903,36.1551 0,19.96828 15.21761,36.15723 33.9903,36.15723 z"
67178
+ }
67179
+ )
67180
+ ] });
67181
+ }
67182
+ function sectionBoxAuto({ height, width, fill: fill2, className }) {
67183
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67184
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67185
+ "path",
67186
+ {
67187
+ fill: fill2,
67188
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67189
+ }
67190
+ ),
67191
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67192
+ "path",
67193
+ {
67194
+ fill: fill2,
67195
+ d: "M 221.207314 217.240532 L 214.827314 200.469532 L 160.504314 200.469532 L 154.124314 217.604532 C 151.632314 224.288532 149.506314 228.815532 147.744314 231.186532 C 145.981314 233.494532 143.095314 234.649532 139.085314 234.649532 C 135.682314 234.649532 132.674314 233.403532 130.061314 230.912532 C 127.448314 228.420532 126.142314 225.595532 126.142314 222.435532 C 126.142314 220.612532 126.446314 218.729532 127.053314 216.784532 C 127.661314 214.840532 128.664314 212.137532 130.061314 208.672532 L 164.241314 121.901532 C 165.213314 119.410532 166.368314 116.432532 167.704314 112.969532 C 169.102314 109.444532 170.560314 106.528532 172.079314 104.219532 C 173.659314 101.911532 175.695314 100.057532 178.186314 98.660532 C 180.738314 97.201532 183.868314 96.471532 187.574314 96.471532 C 191.342314 96.471532 194.471314 97.201532 196.962314 98.660532 C 199.514314 100.057532 201.550314 101.879532 203.069314 104.128532 C 204.649314 106.376532 205.955314 108.807532 206.988314 111.419532 C 208.082314 113.971532 209.449314 117.405532 211.090314 121.719532 L 245.999314 207.943532 C 248.733314 214.505532 250.100314 219.275532 250.100314 222.253532 C 250.100314 225.352532 248.794314 228.209532 246.181314 230.822532 C 243.629314 233.373532 240.530314 234.649532 236.884314 234.649532 C 234.758314 234.649532 232.935314 234.254532 231.416314 233.464532 C 229.896314 232.735532 228.620314 231.732532 227.587314 230.456532 C 226.554314 229.119532 225.430314 227.115532 224.215314 224.440532 C 223.060314 221.706532 222.058314 219.306532 221.207314 217.240532 Z M 167.613314 180.143532 L 207.535314 180.143532 L 187.392314 125.000532 Z"
67196
+ }
67197
+ )
67198
+ ] });
67199
+ }
67200
+ function sectionBoxVisible({ height, width, fill: fill2, className }) {
67201
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67202
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67203
+ "path",
67204
+ {
67205
+ fill: fill2,
67206
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67207
+ }
67208
+ ),
67209
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67210
+ "path",
67211
+ {
67212
+ fill: fill2,
67213
+ d: "m 186.05204,115.30607 c -37.93016,0 -68.67906,39.581 -68.67906,59.64313 0,21.35677 30.7489,59.64312 68.67906,59.64312 37.93016,0 68.67906,-38.28635 68.67906,-59.64312 0,-20.06213 -30.7489,-59.64313 -68.67906,-59.64313 z m 40.42729,85.41349 c -6.9441,6.83951 -21.43002,18.31368 -40.42729,18.31368 -18.99727,0 -33.48265,-11.47417 -40.42728,-18.31368 -11.61642,-11.4411 -15.37445,-22.30263 -15.37445,-25.77036 0,-0.0305 0.0381,-3.14164 3.35186,-9.36916 2.8652,-5.38603 7.15818,-11.06056 12.08697,-15.97917 3.66628,-3.65833 9.40099,-8.61065 16.72067,-12.50626 -6.58514,7.55977 -10.6973,18.2333 -10.6973,30.07505 0,22.91463 15.37445,41.49087 34.33953,41.49087 18.96508,0 34.33953,-18.57624 34.33953,-41.49087 0,-5.71277 -0.95614,-11.15521 -2.68492,-16.10818 -0.0445,9.9792 -6.75148,18.05306 -15.0214,18.05306 -8.26992,0 -15.02354,-8.12702 -15.02354,-18.15225 0,-8.97953 5.39774,-16.43168 12.48617,-17.88905 11.9346,3.73548 21.13062,11.40091 26.2676,16.52763 4.92879,4.91861 9.22177,10.59379 12.08697,15.97917 3.31377,6.22752 3.35186,9.33869 3.35186,9.36916 0,3.46773 -3.75803,14.32926 -15.37445,25.77036 z"
67214
+ }
67215
+ )
67216
+ ] });
67217
+ }
67035
67218
  function sectionBox({ height, width, fill: fill2, className }) {
67036
67219
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67037
67220
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -67050,6 +67233,31 @@ function sectionBox({ height, width, fill: fill2, className }) {
67050
67233
  )
67051
67234
  ] });
67052
67235
  }
67236
+ function sectionBoxDisable({ height, width, fill: fill2, className }) {
67237
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67238
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67239
+ "path",
67240
+ {
67241
+ fill: fill2,
67242
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67243
+ }
67244
+ ),
67245
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67246
+ "path",
67247
+ {
67248
+ fill: fill2,
67249
+ d: "m 185.61601,192.28388 v -44.0883 c 0,-2.52838 -1.97182,-4.91709 -4.84542,-5.26996 -3.49833,-0.42965 -6.4956,1.9253 -6.4956,4.89027 v 44.08783 c 0,2.52885 1.97182,4.91756 4.84542,5.27043 3.49833,0.42965 6.4956,-1.92531 6.4956,-4.89027 z m 22.68149,0 v -44.0883 c 0,-2.52838 -1.97182,-4.91709 -4.84542,-5.26996 -3.49832,-0.42965 -6.49559,1.9253 -6.49559,4.89027 v 44.08783 c 0,2.52885 1.97182,4.91756 4.84542,5.27043 3.49832,0.42965 6.49559,-1.92531 6.49559,-4.89027 z m 38.18908,-71.6429 H 225.42553 V 105.9623 c 0,-2.80818 -2.61299,-5.08498 -5.83584,-5.08498 h -56.43703 c -3.22285,0 -5.83585,2.2768 -5.83585,5.08498 v 14.67868 h -21.23089 c -4.69044,0 -8.49236,3.31275 -8.49236,7.39969 v 0.0231 c 0,4.08694 3.80192,7.39969 8.49236,7.39969 h 110.40066 c 4.69044,0 8.49236,-3.31275 8.49236,-7.39969 v -0.0231 c 0,-4.08694 -3.80192,-7.39969 -8.49236,-7.39969 z m -35.23745,-6.4863 v 6.4863 h -39.75592 v -6.4863 a 1.0615448,0.92496161 0 0 1 1.06155,-0.92496 h 37.63282 a 1.0615448,0.92496161 0 0 1 1.06155,0.92496 z"
67250
+ }
67251
+ ),
67252
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67253
+ "path",
67254
+ {
67255
+ fill: fill2,
67256
+ d: "m 227.42894,215.76405 c 0,5.6549 -4.47215,10.23953 -9.98832,10.23953 h -49.76957 c -5.51617,0 -9.98832,-4.58463 -9.98832,-10.23953 v -69.72083 a 4.9863693,5.1117785 0 0 0 -4.98637,-5.11178 h -10.00391 a 4.9863693,5.1117785 0 0 0 -4.98637,5.11178 v 73.13422 c 0,15.08038 11.92553,27.30584 26.63594,27.30584 h 56.42825 c 14.71041,0 26.63594,-12.22546 26.63594,-27.30584 v -73.13422 a 4.9863693,5.1117785 0 0 0 -4.98637,-5.11178 h -10.0039 a 4.9863693,5.1117785 0 0 0 -4.98637,5.11178 v 69.72147 z"
67257
+ }
67258
+ )
67259
+ ] });
67260
+ }
67053
67261
  function sectionBoxClip({ height, width, fill: fill2, className }) {
67054
67262
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67055
67263
  /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
@@ -67131,6 +67339,24 @@ function sectionBoxShrink({ height, width, fill: fill2, className }) {
67131
67339
  ) })
67132
67340
  ] });
67133
67341
  }
67342
+ function sectionBoxShrink2({ height, width, fill: fill2, className }) {
67343
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67344
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67345
+ "path",
67346
+ {
67347
+ fill: fill2,
67348
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67349
+ }
67350
+ ),
67351
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67352
+ "path",
67353
+ {
67354
+ fill: fill2,
67355
+ d: "m 223.41166,231.92815 -50.05,-51.82677 -21.39562,22.15515 -21.52251,-81.36695 78.57748,22.28655 -21.39561,22.15516 50.05002,51.82676 z"
67356
+ }
67357
+ )
67358
+ ] });
67359
+ }
67134
67360
  function ghost({ height, width, fill: fill2, className }) {
67135
67361
  return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, width: height, height: width, viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { "data-name": "ICONS", children: [
67136
67362
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -67168,6 +67394,7 @@ function ghostDead({ height, width, fill: fill2, className }) {
67168
67394
  const icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67169
67395
  __proto__: null,
67170
67396
  arrowLeft,
67397
+ autoCamera,
67171
67398
  camera,
67172
67399
  checkmark,
67173
67400
  close,
@@ -67190,11 +67417,17 @@ const icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
67190
67417
  pan,
67191
67418
  perspective,
67192
67419
  sectionBox,
67420
+ sectionBoxAuto,
67193
67421
  sectionBoxClip,
67422
+ sectionBoxDisable,
67194
67423
  sectionBoxIgnore,
67195
67424
  sectionBoxReset,
67425
+ sectionBoxSettings,
67196
67426
  sectionBoxShrink,
67427
+ sectionBoxShrink2,
67428
+ sectionBoxVisible,
67197
67429
  settings,
67430
+ slidersHoriz,
67198
67431
  toggleIsolation,
67199
67432
  trash,
67200
67433
  treeView,
@@ -67214,9 +67447,6 @@ function anyUiAxesButton(settings2) {
67214
67447
  function anyUiCursorButton(settings2) {
67215
67448
  return isTrue(settings2.ui.orbit) || isTrue(settings2.ui.lookAround) || isTrue(settings2.ui.pan) || isTrue(settings2.ui.zoom) || isTrue(settings2.ui.zoomWindow) || isTrue(settings2.ui.zoomToFit);
67216
67449
  }
67217
- function anyUiToolButton(settings2) {
67218
- return isTrue(settings2.ui.sectioningMode) || isTrue(settings2.ui.measuringMode) || isTrue(settings2.ui.toggleIsolation);
67219
- }
67220
67450
  function anyUiSettingButton(settings2) {
67221
67451
  return isTrue(settings2.ui.projectInspector) || isTrue(settings2.ui.settings) || isTrue(settings2.ui.help) || isTrue(settings2.ui.maximise);
67222
67452
  }
@@ -67311,7 +67541,7 @@ function AxesPanel(props) {
67311
67541
  );
67312
67542
  };
67313
67543
  const onHomeBtn = () => {
67314
- props.camera.reset();
67544
+ props.camera.reset.call();
67315
67545
  };
67316
67546
  const btnStyle2 = "vim-axes-button vc-flex vc-items-center vc-justify-center vc-text-gray-medium vc-transition-all hover:vc-text-primary-royal";
67317
67547
  const btnIsolation = /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -67348,7 +67578,7 @@ function AxesPanel(props) {
67348
67578
  }
67349
67579
  );
67350
67580
  const hidden2 = isTrue(props.settings.value.ui.axesPanel) ? "" : " vc-hidden";
67351
- const createBar2 = () => {
67581
+ const createBar = () => {
67352
67582
  if (!anyUiAxesButton(props.settings.value)) {
67353
67583
  return (
67354
67584
  // Keeps layout when all buttons are disabled.
@@ -67370,7 +67600,7 @@ function AxesPanel(props) {
67370
67600
  className: "vim-axes-panel vc-pointer-events-none vc-absolute vc-overflow-hidden vc-z-20 vc-flex vc-flex-col vc-border vc-border-white vc-opacity-50 vc-shadow-lg vc-saturate-0 vc-transition-all hover:vc-opacity-100 hover:vc-saturate-100" + hidden2,
67371
67601
  children: [
67372
67602
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gizmoDiv, className: "vim-axes-panel-gizmo vc-absolute vc-pointer-events-auto" }),
67373
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children: createBar2() })
67603
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children: createBar() })
67374
67604
  ]
67375
67605
  }
67376
67606
  );
@@ -67379,22 +67609,98 @@ const btnStyle = "vim-control-bar-button vc-rounded-full vc-items-center vc-just
67379
67609
  function buttonDefaultStyle(on) {
67380
67610
  return on ? btnStyle + " vc-text-primary" : btnStyle + " vc-text-gray-medium";
67381
67611
  }
67612
+ function buttonExpandStyle(on) {
67613
+ return on ? btnStyle + " vc-text-white vc-bg-primary" : btnStyle + " vc-text-gray-medium";
67614
+ }
67615
+ function buttonDisableStyle(on) {
67616
+ return on ? btnStyle + " vc-text-gray-medium" : btnStyle + " vc-text-gray vc-pointer-events-none";
67617
+ }
67382
67618
  function buttonBlueStyle(on) {
67383
67619
  return btnStyle + " vc-text-white";
67384
67620
  }
67385
67621
  function createButton(button) {
67386
67622
  var _a2;
67387
67623
  if (button.enabled !== void 0 && !button.enabled()) return null;
67388
- const style = button.style((_a2 = button.isOn) == null ? void 0 : _a2.call(button));
67389
- return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { "data-tip": button.tip, onClick: button.action, className: style, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
67624
+ const style = (button.style ?? buttonDefaultStyle)((_a2 = button.isOn) == null ? void 0 : _a2.call(button));
67625
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { id: button.id, "data-tip": button.tip, onClick: button.action, className: style, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
67390
67626
  }
67391
- const sectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-px-2 vc-shadow-md";
67627
+ const sectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-shadow-md";
67392
67628
  const sectionDefaultStyle = sectionStyle + " vc-bg-white";
67393
67629
  const sectionBlueStyle = sectionStyle + " vc-bg-primary";
67630
+ const sectionNoPadStyle = sectionStyle.replace("vc-px-2", "") + " vc-bg-white";
67394
67631
  function createSection$1(section) {
67395
67632
  if (section.enable !== void 0 && !section.enable()) return null;
67396
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
67633
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style ?? sectionDefaultStyle}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
67397
67634
  }
67635
+ const ids = {
67636
+ // Sections
67637
+ sectionCamera: "controlBar.sectionCamera",
67638
+ sectionInputs: "controlBar.sectionInputs",
67639
+ sectionActions: "controlBar.sectionActions",
67640
+ sectionTools: "controlBar.sectionTools",
67641
+ sectionSettings: "controlBar.sectionSettings",
67642
+ sectionMeasure: "controlBar.sectionMeasure",
67643
+ sectionSectionBox: "controlBar.sectionSectionBox",
67644
+ // Camera buttons
67645
+ buttonCameraAuto: "controlBar.camera.auto",
67646
+ buttonCameraOrbit: "controlBar.camera.orbit",
67647
+ buttonCameraLook: "controlBarcamera.look",
67648
+ buttonCameraPan: "controlBar.camera.pan",
67649
+ buttonCameraZoom: "controlBar.camera.zoom",
67650
+ buttonCameraZoomWindow: "controlBar.camera.zoomWindow",
67651
+ // Settings buttons
67652
+ buttonProjectInspector: "controlBar.projectInspector",
67653
+ buttonSettings: "controlBar.settings",
67654
+ buttonHelp: "controlBar.help",
67655
+ buttonMaximize: "controlBar.maximize",
67656
+ // Action Buttons
67657
+ buttonToggleIsolation: "controlBar.action.toggleIsolation",
67658
+ buttonZoomToFit: "controlBar.action.zoomToFit",
67659
+ // Tools buttons
67660
+ buttonSectionBox: "controlBar.sectionBox",
67661
+ buttonMeasure: "controlBar.measure",
67662
+ // Section box buttons
67663
+ buttonSectionBoxEnable: "controlBar.sectionBox.enable",
67664
+ buttonSectionBoxVisible: "controlBar.sectionBox.visible",
67665
+ buttonSectionBoxShrinkToSelection: "controlBar.sectionBox.shrinkToSelection",
67666
+ buttonSectionBoxAuto: "controlBar.sectionBox.auto",
67667
+ buttonSectionBoxReset: "controlBar.sectionBox.reset",
67668
+ buttonSectionBoxSettings: "controlBar.sectionBox.settings"
67669
+ };
67670
+ function ControlBar(props) {
67671
+ useEffect(() => {
67672
+ ReactTooltip.rebuild();
67673
+ });
67674
+ if (!props.show) {
67675
+ return null;
67676
+ }
67677
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
67678
+ "div",
67679
+ {
67680
+ style: {
67681
+ gap: "min(10px, 2%)",
67682
+ bottom: "min(36px, 10%)"
67683
+ },
67684
+ id: "vim-control-bar",
67685
+ className: "vim-control-bar vc-pointer-events-auto vc-flex-wrap vc-mx-2 vc-min-w-0 vc-absolute vc-left-0 vc-right-0 vc-z-20 vc-flex vc-items-center vc-justify-center transition-all",
67686
+ children: props.content.map(createSection$1)
67687
+ }
67688
+ );
67689
+ }
67690
+ const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67691
+ __proto__: null,
67692
+ ControlBar,
67693
+ buttonBlueStyle,
67694
+ buttonDefaultStyle,
67695
+ buttonDisableStyle,
67696
+ buttonExpandStyle,
67697
+ createButton,
67698
+ createSection: createSection$1,
67699
+ ids,
67700
+ sectionBlueStyle,
67701
+ sectionDefaultStyle,
67702
+ sectionNoPadStyle
67703
+ }, Symbol.toStringTag, { value: "Module" }));
67398
67704
  function getPointerState(viewer) {
67399
67705
  const [mode, setMode] = useState(viewer.inputs.pointerActive);
67400
67706
  useEffect(() => {
@@ -67456,52 +67762,6 @@ function getFullScreenState() {
67456
67762
  }
67457
67763
  };
67458
67764
  }
67459
- function getSectionBoxState(viewer) {
67460
- const sectionGizmo = viewer.gizmos.section;
67461
- const first = useRef(true);
67462
- const [section, setSection] = useState({
67463
- clip: sectionGizmo.clip,
67464
- active: sectionGizmo.visible && sectionGizmo.interactive
67465
- });
67466
- useEffect(() => {
67467
- const subSection = sectionGizmo.onStateChanged.subscribe(
67468
- () => setSection({
67469
- clip: sectionGizmo.clip,
67470
- active: sectionGizmo.visible && sectionGizmo.interactive
67471
- })
67472
- );
67473
- return () => subSection();
67474
- }, []);
67475
- const toggle = () => {
67476
- ReactTooltip.hide();
67477
- if (viewer.inputs.pointerActive === "rect") {
67478
- viewer.inputs.pointerActive = viewer.inputs.pointerFallback;
67479
- }
67480
- const next = !(sectionGizmo.visible && sectionGizmo.interactive);
67481
- sectionGizmo.interactive = next;
67482
- sectionGizmo.visible = next;
67483
- if (next && first.current) {
67484
- sectionGizmo.clip = true;
67485
- sectionGizmo.fitBox(viewer.renderer.getBoundingBox());
67486
- first.current = false;
67487
- }
67488
- };
67489
- return {
67490
- clip: section.clip,
67491
- active: section.active,
67492
- set: setSection,
67493
- toggle,
67494
- hide: () => {
67495
- sectionGizmo.visible = false;
67496
- sectionGizmo.interactive = false;
67497
- },
67498
- reset: () => sectionGizmo.fitBox(viewer.renderer.getBoundingBox()),
67499
- shrinkToSelection: () => sectionGizmo.fitBox(viewer.selection.getBoundingBox()),
67500
- toggleClip: () => {
67501
- sectionGizmo.clip = !section.clip;
67502
- }
67503
- };
67504
- }
67505
67765
  function pointerToCursor(pointer) {
67506
67766
  switch (pointer) {
67507
67767
  case "orbit":
@@ -67553,13 +67813,13 @@ class CursorManager {
67553
67813
  const sub2 = this._viewer.inputs.onPointerOverrideChanged.subscribe(
67554
67814
  () => this._updateCursor()
67555
67815
  );
67556
- const sub3 = this._viewer.gizmos.section.onStateChanged.subscribe(() => {
67557
- if (!this._viewer.gizmos.section.visible) {
67816
+ const sub3 = this._viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
67817
+ if (!this._viewer.gizmos.sectionBox.visible) {
67558
67818
  this._boxHover = false;
67559
67819
  this._updateCursor();
67560
67820
  }
67561
67821
  });
67562
- const sub4 = this._viewer.gizmos.section.onHover.subscribe((hover) => {
67822
+ const sub4 = this._viewer.gizmos.sectionBox.onHover.subscribe((hover) => {
67563
67823
  this._boxHover = hover;
67564
67824
  this._updateCursor();
67565
67825
  });
@@ -67622,59 +67882,77 @@ function getMeasureState(viewer, cursor) {
67622
67882
  clear
67623
67883
  };
67624
67884
  }
67625
- const elementIds = {
67626
- // Sections
67627
- sectionCamera: "controlBar.sectionCamera",
67628
- sectionTools: "controlBar.sectionTools",
67629
- sectionSettings: "controlBar.sectionSettings",
67630
- sectionMeasure: "controlBar.sectionMeasure",
67631
- sectionSectionBox: "controlBar.sectionSectionBox",
67632
- // Camera buttons
67633
- buttonCameraOrbit: "controlBar.camera.orbit",
67634
- buttonCameraLook: "controlBarcamera.look",
67635
- buttonCameraPan: "controlBar.camera.pan",
67636
- buttonCameraZoom: "controlBar.camera.zoom",
67637
- buttonCameraZoomWindow: "controlBar.camera.zoomWindow",
67638
- buttonCameraZoomToFit: "controlBar.camera.zoomToFit",
67639
- // Settings buttons
67640
- buttonProjectInspector: "controlBar.projectInspector",
67641
- buttonSettings: "controlBar.settings",
67642
- buttonHelp: "controlBar.help",
67643
- buttonMaximize: "controlBar.maximize",
67644
- // Tools buttons
67645
- buttonSectionBox: "controlBar.sectionBox",
67646
- buttonMeasure: "controlBar.measure",
67647
- buttonToggleIsolation: "controlBar.toggleIsolation",
67648
- // Measure buttons
67649
- buttonMeasureDelete: "controlBar.measure.delete",
67650
- buttonMeasureDone: "controlBar.measure.done",
67651
- // Section box buttons
67652
- buttonSectionBoxReset: "controlBar.sectionBox.reset",
67653
- buttonSectionBoxShrinkToSelection: "controlBar.sectionBox.shrinkToSelection",
67654
- buttonSectionBoxClip: "controlBar.sectionBox.clip",
67655
- buttonSectionBoxIgnore: "controlBar.sectionBox.ignore",
67656
- buttonSectionBoxDone: "controlBar.sectionBox.done"
67657
- };
67658
- function ControlBar(props) {
67659
- var _a2;
67660
- const pointer = getPointerState(props.viewer);
67661
- const fullScreen = getFullScreenState();
67662
- const section = getSectionBoxState(props.viewer);
67663
- const measure$1 = getMeasureState(props.viewer, props.cursor);
67664
- useEffect(() => {
67665
- ReactTooltip.rebuild();
67666
- });
67667
- if (isFalse(props.settings.ui.controlBar)) {
67668
- return null;
67669
- }
67670
- const cameraSection = {
67671
- id: elementIds.sectionCamera,
67672
- enable: () => anyUiCursorButton(props.settings),
67885
+ function controlBarSectionBox(section, hasSelection) {
67886
+ return {
67887
+ id: ids.sectionSectionBox,
67888
+ style: section.enable.get() ? sectionNoPadStyle : sectionDefaultStyle,
67889
+ //enable: () => section.getEnable(),
67890
+ buttons: [
67891
+ {
67892
+ id: ids.buttonSectionBoxEnable,
67893
+ tip: "Enable Section Box",
67894
+ isOn: () => section.enable.get(),
67895
+ style: (on) => buttonExpandStyle(on),
67896
+ action: () => section.enable.set(!section.enable.get()),
67897
+ icon: sectionBox
67898
+ },
67899
+ {
67900
+ id: ids.buttonSectionBoxShrinkToSelection,
67901
+ tip: "Fit Section",
67902
+ enabled: () => section.enable.get(),
67903
+ isOn: () => hasSelection,
67904
+ style: (on) => buttonDisableStyle(on),
67905
+ action: () => section.sectionSelection.call(),
67906
+ icon: sectionBoxShrink
67907
+ },
67908
+ {
67909
+ id: ids.buttonSectionBoxReset,
67910
+ tip: "Reset Section",
67911
+ enabled: () => section.enable.get(),
67912
+ style: (on) => buttonDefaultStyle(on),
67913
+ action: () => section.sectionReset.call(),
67914
+ icon: sectionBoxReset
67915
+ },
67916
+ {
67917
+ id: ids.buttonSectionBoxVisible,
67918
+ tip: "Show Section Box",
67919
+ enabled: () => section.enable.get(),
67920
+ isOn: () => section.visible.get(),
67921
+ style: (on) => buttonDefaultStyle(on),
67922
+ action: () => section.visible.set(!section.visible.get()),
67923
+ icon: visible
67924
+ },
67925
+ {
67926
+ id: ids.buttonSectionBoxAuto,
67927
+ tip: "Auto Section",
67928
+ enabled: () => section.enable.get(),
67929
+ isOn: () => section.auto.get(),
67930
+ style: (on) => buttonDefaultStyle(on),
67931
+ action: () => section.auto.set(!section.auto.get()),
67932
+ icon: sectionBoxAuto
67933
+ },
67934
+ {
67935
+ id: ids.buttonSectionBoxSettings,
67936
+ tip: "Section Settings",
67937
+ enabled: () => section.enable.get(),
67938
+ isOn: () => section.showOffsetPanel.get(),
67939
+ style: (on) => buttonDefaultStyle(on),
67940
+ action: () => section.showOffsetPanel.set(!section.showOffsetPanel.get()),
67941
+ icon: slidersHoriz
67942
+ }
67943
+ ]
67944
+ };
67945
+ }
67946
+ function controlBarPointer(viewer, camera2, settings2, section) {
67947
+ const pointer = getPointerState(viewer);
67948
+ return {
67949
+ id: ids.sectionInputs,
67950
+ enable: () => anyUiCursorButton(settings2),
67673
67951
  style: sectionDefaultStyle,
67674
67952
  buttons: [
67675
67953
  {
67676
- id: elementIds.buttonCameraOrbit,
67677
- enabled: () => isTrue(props.settings.ui.orbit),
67954
+ id: ids.buttonCameraOrbit,
67955
+ enabled: () => isTrue(settings2.ui.orbit),
67678
67956
  tip: "Orbit",
67679
67957
  action: () => pointer.onButton("orbit"),
67680
67958
  icon: orbit,
@@ -67682,8 +67960,8 @@ function ControlBar(props) {
67682
67960
  style: buttonDefaultStyle
67683
67961
  },
67684
67962
  {
67685
- id: elementIds.buttonCameraLook,
67686
- enabled: () => isTrue(props.settings.ui.lookAround),
67963
+ id: ids.buttonCameraLook,
67964
+ enabled: () => isTrue(settings2.ui.lookAround),
67687
67965
  tip: "Look Around",
67688
67966
  action: () => pointer.onButton("look"),
67689
67967
  icon: look,
@@ -67691,8 +67969,8 @@ function ControlBar(props) {
67691
67969
  style: buttonDefaultStyle
67692
67970
  },
67693
67971
  {
67694
- id: elementIds.buttonCameraPan,
67695
- enabled: () => isTrue(props.settings.ui.pan),
67972
+ id: ids.buttonCameraPan,
67973
+ enabled: () => isTrue(settings2.ui.pan),
67696
67974
  tip: "Pan",
67697
67975
  action: () => pointer.onButton("pan"),
67698
67976
  icon: pan,
@@ -67700,8 +67978,8 @@ function ControlBar(props) {
67700
67978
  style: buttonDefaultStyle
67701
67979
  },
67702
67980
  {
67703
- id: elementIds.buttonCameraZoom,
67704
- enabled: () => isTrue(props.settings.ui.zoom),
67981
+ id: ids.buttonCameraZoom,
67982
+ enabled: () => isTrue(settings2.ui.zoom),
67705
67983
  tip: "Zoom",
67706
67984
  action: () => pointer.onButton("zoom"),
67707
67985
  icon: zoom,
@@ -67709,60 +67987,88 @@ function ControlBar(props) {
67709
67987
  style: buttonDefaultStyle
67710
67988
  },
67711
67989
  {
67712
- id: elementIds.buttonCameraZoomWindow,
67713
- enabled: () => isTrue(props.settings.ui.zoomWindow),
67990
+ id: ids.buttonCameraZoomWindow,
67991
+ enabled: () => isTrue(settings2.ui.zoomWindow),
67714
67992
  tip: "Zoom Window",
67715
67993
  action: () => {
67716
67994
  pointer.onButton("rect");
67717
- section.hide();
67718
67995
  },
67719
67996
  icon: frameRect,
67720
67997
  isOn: () => pointer.mode === "rect",
67721
67998
  style: buttonDefaultStyle
67722
- },
67999
+ }
68000
+ ]
68001
+ };
68002
+ }
68003
+ function controlBarActions(camera2, settings2, isolation, measure$1) {
68004
+ return {
68005
+ id: ids.sectionActions,
68006
+ enable: () => true,
68007
+ style: sectionDefaultStyle,
68008
+ buttons: [
67723
68009
  {
67724
- id: elementIds.buttonCameraZoomToFit,
67725
- enabled: () => isTrue(props.settings.ui.zoomToFit),
68010
+ id: ids.buttonZoomToFit,
68011
+ enabled: () => isTrue(settings2.ui.zoomToFit),
67726
68012
  tip: "Zoom to Fit",
67727
- action: () => props.camera.frameContext(),
68013
+ action: () => camera2.frameSelection.call(),
67728
68014
  icon: frameSelection,
67729
68015
  isOn: () => false,
67730
68016
  style: buttonDefaultStyle
68017
+ },
68018
+ {
68019
+ id: ids.buttonToggleIsolation,
68020
+ enabled: () => isTrue(settings2.ui.toggleIsolation),
68021
+ tip: "Toggle Isolation",
68022
+ action: () => isolation.toggle("controlBar"),
68023
+ icon: toggleIsolation,
68024
+ style: buttonDefaultStyle
68025
+ },
68026
+ {
68027
+ id: ids.buttonMeasure,
68028
+ enabled: () => isTrue(settings2.ui.measuringMode),
68029
+ isOn: () => measure$1.active,
68030
+ tip: "Measuring Mode",
68031
+ action: () => measure$1.toggle(),
68032
+ icon: measure,
68033
+ style: buttonDefaultStyle
67731
68034
  }
67732
68035
  ]
67733
68036
  };
67734
- const settingsSection = {
67735
- id: elementIds.sectionSettings,
67736
- enable: () => anyUiSettingButton(props.settings),
68037
+ }
68038
+ function controlBarSettings(modal, side, settings$1) {
68039
+ const fullScreen = getFullScreenState();
68040
+ return {
68041
+ id: ids.sectionSettings,
68042
+ enable: () => anyUiSettingButton(settings$1),
67737
68043
  style: sectionDefaultStyle,
67738
68044
  buttons: [
67739
68045
  {
67740
- id: elementIds.buttonProjectInspector,
67741
- enabled: () => isTrue(props.settings.ui.projectInspector) && (isTrue(props.settings.ui.bimTreePanel) || isTrue(props.settings.ui.bimInfoPanel)),
68046
+ id: ids.buttonProjectInspector,
68047
+ enabled: () => isTrue(settings$1.ui.projectInspector) && (isTrue(settings$1.ui.bimTreePanel) || isTrue(settings$1.ui.bimInfoPanel)),
67742
68048
  tip: "Project Inspector",
67743
- action: () => props.side.toggleContent("bim"),
68049
+ action: () => side.toggleContent("bim"),
67744
68050
  icon: treeView,
67745
68051
  style: buttonDefaultStyle
67746
68052
  },
67747
68053
  {
67748
- id: elementIds.buttonSettings,
67749
- enabled: () => isTrue(props.settings.ui.settings),
68054
+ id: ids.buttonSettings,
68055
+ enabled: () => isTrue(settings$1.ui.settings),
67750
68056
  tip: "Settings",
67751
- action: () => props.side.toggleContent("settings"),
68057
+ action: () => side.toggleContent("settings"),
67752
68058
  icon: settings,
67753
68059
  style: buttonDefaultStyle
67754
68060
  },
67755
68061
  {
67756
- id: elementIds.buttonHelp,
67757
- enabled: () => isTrue(props.settings.ui.help),
68062
+ id: ids.buttonHelp,
68063
+ enabled: () => isTrue(settings$1.ui.help),
67758
68064
  tip: "Help",
67759
- action: () => props.modal.help(true),
68065
+ action: () => modal.help(true),
67760
68066
  icon: help,
67761
68067
  style: buttonDefaultStyle
67762
68068
  },
67763
68069
  {
67764
- id: elementIds.buttonMaximize,
67765
- enabled: () => isTrue(props.settings.ui.maximise) && props.settings.capacity.canGoFullScreen,
68070
+ id: ids.buttonMaximize,
68071
+ enabled: () => isTrue(settings$1.ui.maximise) && settings$1.capacity.canGoFullScreen,
67766
68072
  tip: fullScreen.get() ? "Minimize" : "Fullscreen",
67767
68073
  action: () => fullScreen.toggle(),
67768
68074
  icon: fullScreen.get() ? minimize : fullsScreen,
@@ -67770,112 +68076,42 @@ function ControlBar(props) {
67770
68076
  }
67771
68077
  ]
67772
68078
  };
67773
- const sectionBoxSection = {
67774
- id: elementIds.sectionSectionBox,
67775
- enable: () => !measure$1.active && section.active,
67776
- style: sectionBlueStyle,
67777
- buttons: [
67778
- {
67779
- id: elementIds.buttonSectionBoxReset,
67780
- tip: "Reset Section Box",
67781
- action: () => section.reset(),
67782
- icon: sectionBoxReset,
67783
- style: buttonBlueStyle
67784
- },
67785
- {
67786
- id: elementIds.buttonSectionBoxShrinkToSelection,
67787
- tip: "Shrink to Selection",
67788
- action: () => section.shrinkToSelection(),
67789
- icon: sectionBoxShrink,
67790
- style: buttonBlueStyle
67791
- },
67792
- {
67793
- id: elementIds.buttonSectionBoxClip,
67794
- tip: section.clip ? "Ignore Section Box" : "Clip Section Box",
67795
- action: () => section.toggleClip(),
67796
- icon: section.clip ? sectionBoxIgnore : sectionBoxClip,
67797
- style: buttonBlueStyle
67798
- },
67799
- {
67800
- id: elementIds.buttonSectionBoxDone,
67801
- tip: "Done",
67802
- action: () => section.toggle(),
67803
- icon: checkmark,
67804
- style: buttonBlueStyle
67805
- }
67806
- ]
67807
- };
67808
- const measureSection = {
67809
- id: elementIds.sectionMeasure,
67810
- enable: () => measure$1.active && !section.active,
67811
- style: sectionBlueStyle,
67812
- buttons: [
67813
- {
67814
- id: elementIds.buttonMeasureDelete,
67815
- tip: "Delete",
67816
- action: () => measure$1.clear(),
67817
- icon: trash,
67818
- style: buttonBlueStyle
67819
- },
67820
- {
67821
- id: elementIds.buttonMeasureDone,
67822
- tip: "Done",
67823
- action: () => measure$1.toggle(),
67824
- icon: checkmark,
67825
- style: buttonBlueStyle
67826
- }
67827
- ]
67828
- };
67829
- const toolSections = {
67830
- id: elementIds.sectionTools,
67831
- enable: () => anyUiToolButton(props.settings) && !measure$1.active && !section.active,
67832
- style: measure$1.active || section.active ? sectionBlueStyle : sectionDefaultStyle,
68079
+ }
68080
+ function controlBarCamera(camera2) {
68081
+ return {
68082
+ id: ids.sectionCamera,
68083
+ enable: () => true,
68084
+ style: sectionDefaultStyle,
67833
68085
  buttons: [
67834
68086
  {
67835
- id: elementIds.buttonSectionBox,
67836
- enabled: () => isTrue(props.settings.ui.sectioningMode),
67837
- tip: "Sectioning Mode",
67838
- action: () => section.toggle(),
67839
- icon: sectionBox,
67840
- style: buttonDefaultStyle
67841
- },
67842
- {
67843
- id: elementIds.buttonMeasure,
67844
- enabled: () => isTrue(props.settings.ui.measuringMode),
67845
- tip: "Measuring Mode",
67846
- action: () => measure$1.toggle(),
67847
- icon: measure,
67848
- style: buttonDefaultStyle
67849
- },
67850
- {
67851
- id: elementIds.buttonToggleIsolation,
67852
- enabled: () => isTrue(props.settings.ui.toggleIsolation),
67853
- tip: "Toggle Isolation",
67854
- action: () => props.isolation.toggle("controlBar"),
67855
- icon: toggleIsolation,
68087
+ id: ids.buttonCameraAuto,
68088
+ tip: "Auto Camera",
68089
+ isOn: () => camera2.autoCamera.get(),
68090
+ action: () => camera2.autoCamera.set(!camera2.autoCamera.get()),
68091
+ icon: autoCamera,
67856
68092
  style: buttonDefaultStyle
67857
68093
  }
67858
68094
  ]
67859
68095
  };
67860
- let controlBar2 = [cameraSection, toolSections, measureSection, sectionBoxSection, settingsSection];
67861
- controlBar2 = ((_a2 = props.customization) == null ? void 0 : _a2.call(props, controlBar2)) ?? controlBar2;
67862
- return createBar(controlBar2);
67863
68096
  }
67864
- function createBar(sections) {
67865
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
67866
- gap: "min(10px, 2%)",
67867
- bottom: "min(36px, 10%)"
67868
- }, className: "vim-control-bar vc-pointer-events-auto vc-flex-wrap vc-mx-2 vc-min-w-0 vc-absolute vc-left-0 vc-right-0 vc-z-20 vc-flex vc-items-center vc-justify-center transition-all", children: sections.map(createSection$1) });
68097
+ function useControlBar(viewer, camera2, modal, side, isolation, cursor, settings2, section, customization) {
68098
+ const measure2 = getMeasureState(viewer, cursor);
68099
+ const pointerSection = controlBarPointer(viewer, camera2, settings2);
68100
+ const actionSection = controlBarActions(camera2, settings2, isolation, measure2);
68101
+ const sectionBoxSection = controlBarSectionBox(section, viewer.selection.count > 0);
68102
+ const settingsSection = controlBarSettings(modal, side, settings2);
68103
+ const cameraSection = controlBarCamera(camera2);
68104
+ let controlBarSections = [
68105
+ pointerSection,
68106
+ actionSection,
68107
+ cameraSection,
68108
+ sectionBoxSection,
68109
+ // Optional section
68110
+ settingsSection
68111
+ ];
68112
+ controlBarSections = (customization == null ? void 0 : customization(controlBarSections)) ?? controlBarSections;
68113
+ return controlBarSections;
67869
68114
  }
67870
- const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67871
- __proto__: null,
67872
- ControlBar,
67873
- buttonBlueStyle,
67874
- buttonDefaultStyle,
67875
- elementIds,
67876
- sectionBlueStyle,
67877
- sectionDefaultStyle
67878
- }, Symbol.toStringTag, { value: "Module" }));
67879
68115
  function RestOfScreen(props) {
67880
68116
  const [, setVersion] = useState(0);
67881
68117
  const resizeObserver = useRef();
@@ -71864,23 +72100,23 @@ function VimContextMenu(props) {
71864
72100
  const viewer = props.viewer;
71865
72101
  const camera2 = props.camera;
71866
72102
  const [section, setSection] = useState({
71867
- visible: viewer.gizmos.section.visible,
71868
- clip: viewer.gizmos.section.clip
72103
+ visible: viewer.gizmos.sectionBox.visible,
72104
+ clip: viewer.gizmos.sectionBox.clip
71869
72105
  });
71870
72106
  const isClipping = () => {
71871
- return !viewer.gizmos.section.box.containsBox(viewer.renderer.getBoundingBox());
72107
+ return !viewer.gizmos.sectionBox.box.containsBox(viewer.renderer.getBoundingBox());
71872
72108
  };
71873
72109
  const [clipping, setClipping] = useState(isClipping());
71874
72110
  const [, setVersion] = useState(0);
71875
72111
  const hidden2 = props.isolation.isActive();
71876
72112
  useEffect(() => {
71877
- const subState = viewer.gizmos.section.onStateChanged.subscribe(() => {
72113
+ const subState = viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
71878
72114
  setSection({
71879
- visible: viewer.gizmos.section.visible,
71880
- clip: viewer.gizmos.section.clip
72115
+ visible: viewer.gizmos.sectionBox.visible,
72116
+ clip: viewer.gizmos.sectionBox.clip
71881
72117
  });
71882
72118
  });
71883
- const subConfirm = viewer.gizmos.section.onBoxConfirm.subscribe(
72119
+ const subConfirm = viewer.gizmos.sectionBox.onBoxConfirm.subscribe(
71884
72120
  () => setClipping(isClipping())
71885
72121
  );
71886
72122
  props.isolation.onChanged.subscribe(() => setVersion((v) => v + 1));
@@ -71894,11 +72130,11 @@ function VimContextMenu(props) {
71894
72130
  e.stopPropagation();
71895
72131
  };
71896
72132
  const onCameraResetBtn = (e) => {
71897
- camera2.reset();
72133
+ camera2.reset.call();
71898
72134
  e.stopPropagation();
71899
72135
  };
71900
72136
  const onCameraFrameBtn = (e) => {
71901
- camera2.frameContext();
72137
+ camera2.frameSelection.call();
71902
72138
  e.stopPropagation();
71903
72139
  };
71904
72140
  const onSelectionIsolateBtn = (e) => {
@@ -71932,10 +72168,10 @@ function VimContextMenu(props) {
71932
72168
  e.stopPropagation();
71933
72169
  };
71934
72170
  const onSectionToggleBtn = (e) => {
71935
- viewer.gizmos.section.clip = !viewer.gizmos.section.clip;
72171
+ viewer.gizmos.sectionBox.clip = !viewer.gizmos.sectionBox.clip;
71936
72172
  };
71937
72173
  const onSectionResetBtn = (e) => {
71938
- viewer.gizmos.section.fitBox(viewer.renderer.getBoundingBox());
72174
+ viewer.gizmos.sectionBox.fitBox(viewer.renderer.getBoundingBox());
71939
72175
  e.stopPropagation();
71940
72176
  };
71941
72177
  const onMeasureDeleteBtn = (e) => {
@@ -71944,7 +72180,7 @@ function VimContextMenu(props) {
71944
72180
  const onFitSectionToSelectionBtn = (e) => {
71945
72181
  const box = viewer.selection.getBoundingBox();
71946
72182
  if (box) {
71947
- viewer.gizmos.section.fitBox(box);
72183
+ viewer.gizmos.sectionBox.fitBox(box);
71948
72184
  }
71949
72185
  };
71950
72186
  const createButton2 = (button) => {
@@ -72230,7 +72466,7 @@ function BimTree(props) {
72230
72466
  createInteractiveElementProps: (item, treeId, actions, renderFlags) => ({
72231
72467
  onKeyUp: (e) => {
72232
72468
  if (e.key === "f") {
72233
- props.camera.frameContext();
72469
+ props.camera.frameSelection.call();
72234
72470
  }
72235
72471
  if (e.key === "Escape") {
72236
72472
  props.viewer.selection.clear();
@@ -72273,7 +72509,7 @@ function BimTree(props) {
72273
72509
  },
72274
72510
  onPrimaryAction: (item, _) => {
72275
72511
  if (doubleClick.isDoubleClick(item.index)) {
72276
- props.camera.frameSelection();
72512
+ props.camera.frameSelection.call();
72277
72513
  }
72278
72514
  },
72279
72515
  onFocusItem: (item) => {
@@ -74564,7 +74800,7 @@ class ComponentInputs {
74564
74800
  return true;
74565
74801
  }
74566
74802
  case KEYS.KEY_F: {
74567
- this._camera.frameContext();
74803
+ this._camera.frameSelection.call();
74568
74804
  return true;
74569
74805
  }
74570
74806
  case KEYS.KEY_I: {
@@ -74758,7 +74994,7 @@ class Isolation {
74758
74994
  if (!this._settings.isolation.enable) return;
74759
74995
  this._isolation = objects ?? [];
74760
74996
  this._apply(source);
74761
- this._camera.frameVisibleObjects();
74997
+ this._camera.frameScene.call();
74762
74998
  }
74763
74999
  /**
74764
75000
  * Toggles isolation by using the current selection.
@@ -74773,7 +75009,7 @@ class Isolation {
74773
75009
  if (!this._settings.isolation.enable) return;
74774
75010
  this._isolation = [...this._viewer.selection.objects].filter((o) => o.type === "Object3D");
74775
75011
  this._apply(source);
74776
- this._camera.frameVisibleObjects();
75012
+ this._camera.frameScene.call();
74777
75013
  this._viewer.selection.clear();
74778
75014
  }
74779
75015
  /**
@@ -74873,75 +75109,6 @@ class Isolation {
74873
75109
  return objects;
74874
75110
  }
74875
75111
  }
74876
- class ComponentCamera {
74877
- constructor(viewer) {
74878
- __publicField(this, "_viewer");
74879
- this._viewer = viewer;
74880
- }
74881
- /**
74882
- * Resets the camera to its initial position.
74883
- */
74884
- reset() {
74885
- this._viewer.camera.lerp(1).reset();
74886
- }
74887
- /**
74888
- * Frames selected elements if there is an active selection; otherwise, frames all visible objects.
74889
- * @param duration Optional duration of the camera movement animation (default: 1).
74890
- */
74891
- frameContext(duration = 1) {
74892
- if (this._viewer.selection.count > 0) {
74893
- this.frameSelection(duration);
74894
- } else {
74895
- this.frameVisibleObjects(void 0, duration);
74896
- }
74897
- }
74898
- /**
74899
- * Frames selected elements if there is an active selection; otherwise, does nothing.
74900
- * @param duration Optional duration of the camera movement animation (default: 1).
74901
- */
74902
- frameSelection(duration = 1) {
74903
- if (this._viewer.selection.count === 0) return;
74904
- const box = this._viewer.selection.getBoundingBox();
74905
- if (box && this._viewer.gizmos.section.box.intersectsBox(box)) {
74906
- const movement = duration === 0 ? this._viewer.camera.snap() : this._viewer.camera.lerp(duration);
74907
- movement.frame(box);
74908
- }
74909
- }
74910
- /**
74911
- * Frames all visible objects in the scene.
74912
- * @param source Optional VIM to specify the source of objects to frame.
74913
- * @param duration Duration of the camera movement animation (default: 1).
74914
- */
74915
- frameVisibleObjects(source, duration = 1) {
74916
- const movement = duration === 0 ? this._viewer.camera.snap() : this._viewer.camera.lerp(duration);
74917
- const box = this.getVisibleBoundingBox(source);
74918
- movement.frame(box);
74919
- }
74920
- /**
74921
- * Returns the bounding box of all visible objects.
74922
- * @param source Optional VIM to specify the source of visible objects.
74923
- * @returns The bounding box of all visible objects.
74924
- */
74925
- getVisibleBoundingBox(source) {
74926
- let box;
74927
- const vimBoxUnion = (vim) => {
74928
- for (const obj of vim.getObjects()) {
74929
- if (!obj.visible) continue;
74930
- const b = obj.getBoundingBox();
74931
- if (!b) continue;
74932
- box = box ? box.union(b) : b == null ? void 0 : b.clone();
74933
- }
74934
- };
74935
- if (source) {
74936
- vimBoxUnion(source);
74937
- } else {
74938
- for (const vim of this._viewer.vims) {
74939
- vimBoxUnion(vim);
74940
- }
74941
- }
74942
- return box;
74943
- }
74944
- }
74945
75112
  function createContainer(element) {
74946
75113
  let root = element;
74947
75114
  if (root === void 0) {
@@ -75551,6 +75718,345 @@ function setComponentBehind(value) {
75551
75718
  component.classList.remove("behind");
75552
75719
  }
75553
75720
  }
75721
+ function SectionBoxPanel(props) {
75722
+ const [panelPosition, setPanelPosition] = useState({
75723
+ top: 0,
75724
+ left: 0
75725
+ });
75726
+ const panelRef = useRef(null);
75727
+ useLayoutEffect(() => {
75728
+ const updatePosition = () => {
75729
+ const { top, left } = computePosition(panelRef);
75730
+ setPanelPosition({ top, left });
75731
+ };
75732
+ updatePosition();
75733
+ let resizeObserver = null;
75734
+ if (panelRef.current) {
75735
+ resizeObserver = new ResizeObserver(updatePosition);
75736
+ resizeObserver.observe(panelRef.current.parentElement);
75737
+ }
75738
+ return () => {
75739
+ if (resizeObserver) {
75740
+ resizeObserver.disconnect();
75741
+ }
75742
+ };
75743
+ }, [props.state.showOffsetPanel.get()]);
75744
+ if (!props.state.showOffsetPanel.get()) return null;
75745
+ const renderField = (id2, label, field) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-sectionbox-offsets-entry vc-text-xs vc-flex vc-items-center vc-justify-center vc-justify-between vc-my-2", children: [
75746
+ /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: label }),
75747
+ /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
75748
+ "input",
75749
+ {
75750
+ id: id2,
75751
+ type: "text",
75752
+ value: field.get(),
75753
+ onChange: (e) => field.set(e.target.value),
75754
+ className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
75755
+ onBlur: () => field.confirm()
75756
+ }
75757
+ ) })
75758
+ ] });
75759
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
75760
+ "div",
75761
+ {
75762
+ className: "vc-fixed vc-inset-0 vc-flex vc-pointer-events-none",
75763
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
75764
+ "div",
75765
+ {
75766
+ ref: panelRef,
75767
+ style: { position: "absolute", top: panelPosition.top, left: panelPosition.left, width: "min(200px, 60%)" },
75768
+ className: "vim-sectionbox-offsets vc-pointer-events-auto vc-bg-white vc-relative",
75769
+ onClick: (e) => e.stopPropagation(),
75770
+ children: [
75771
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-sectionbox-header vc-px-2 vc-bg-gray-light vc-flex vc-items-center vc-justify-between ", children: [
75772
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vc-flex vim-sectionbox-offsets-title vc-title vc-block", children: "Section Box Offsets" }),
75773
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75774
+ "button",
75775
+ {
75776
+ className: "vc-flex vc-border-none vc-bg-transparent vc-text-sm vc-cursor-pointer",
75777
+ onClick: () => props.state.showOffsetPanel.set(false),
75778
+ children: close({ height: 12, width: 12, fill: "currentColor" })
75779
+ }
75780
+ )
75781
+ ] }),
75782
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("dl", { className: "vc-text-xl vc-text-gray-darker vc-mb-2 vc-mx-2 ", children: [
75783
+ renderField("topOffset", "Top Offset", props.state.topOffset),
75784
+ renderField("sideOffseet", "Side Offset", props.state.sideOffset),
75785
+ renderField("bottomOffset", "Bottom Offset", props.state.bottomOffset)
75786
+ ] })
75787
+ ]
75788
+ }
75789
+ )
75790
+ }
75791
+ );
75792
+ }
75793
+ function computePosition(panelRef) {
75794
+ const origin = document.getElementById("vim-control-bar");
75795
+ if (origin && panelRef.current) {
75796
+ const originRect = origin.getBoundingClientRect();
75797
+ const panelRect = panelRef.current.getBoundingClientRect();
75798
+ let left = originRect.left + originRect.width / 2 - panelRect.width / 2;
75799
+ let top = originRect.top - 10 - panelRect.height;
75800
+ if (top < 10) {
75801
+ top = originRect.bottom + 10;
75802
+ }
75803
+ if (left < 10) {
75804
+ left = 10;
75805
+ }
75806
+ if (left + panelRect.width > window.innerWidth - 10) {
75807
+ left = window.innerWidth - panelRect.width - 10;
75808
+ }
75809
+ return { top, left };
75810
+ }
75811
+ return { top: 0, left: 0 };
75812
+ }
75813
+ function addBox(b1, b2) {
75814
+ const r = b1.clone();
75815
+ r.min.x += b2.min.x;
75816
+ r.min.y += b2.min.y;
75817
+ r.min.z += b2.min.z;
75818
+ r.max.x += b2.max.x;
75819
+ r.max.y += b2.max.y;
75820
+ r.max.z += b2.max.z;
75821
+ return r;
75822
+ }
75823
+ function useStateRef(initialValue) {
75824
+ const [value, setValue] = useState(initialValue);
75825
+ const ref = useRef(initialValue);
75826
+ const event = useRef(new distExports.SimpleEventDispatcher());
75827
+ const validate = useRef((value2) => value2);
75828
+ const confirm = useRef((value2) => value2);
75829
+ const set3 = (value2) => {
75830
+ const finalValue = validate.current(value2) ?? value2;
75831
+ if (finalValue === void 0) return;
75832
+ if (finalValue === ref.current) return;
75833
+ ref.current = finalValue;
75834
+ setValue(finalValue);
75835
+ event.current.dispatch(finalValue);
75836
+ };
75837
+ return {
75838
+ get() {
75839
+ return ref.current;
75840
+ },
75841
+ set: set3,
75842
+ confirm() {
75843
+ set3(confirm.current(ref.current));
75844
+ },
75845
+ useOnChange(on) {
75846
+ useEffect(() => {
75847
+ return event.current.subscribe(on);
75848
+ }, []);
75849
+ },
75850
+ useMemo(on, deps) {
75851
+ return useMemo(() => on(value), [...deps || [], value]);
75852
+ },
75853
+ useValidate(on) {
75854
+ useEffect(() => {
75855
+ validate.current = on;
75856
+ }, []);
75857
+ },
75858
+ useConfirm(on) {
75859
+ useEffect(() => {
75860
+ confirm.current = on;
75861
+ }, []);
75862
+ }
75863
+ };
75864
+ }
75865
+ function useActionRef(action) {
75866
+ const ref = useRef(action);
75867
+ return {
75868
+ call() {
75869
+ ref == null ? void 0 : ref.current();
75870
+ },
75871
+ set(func) {
75872
+ ref.current = func;
75873
+ }
75874
+ };
75875
+ }
75876
+ function useArgActionRef(action) {
75877
+ const ref = useRef(action);
75878
+ return {
75879
+ call(arg) {
75880
+ ref == null ? void 0 : ref.current(arg);
75881
+ },
75882
+ set(func) {
75883
+ ref.current = func;
75884
+ }
75885
+ };
75886
+ }
75887
+ function useFuncRef(func) {
75888
+ const ref = useRef(func);
75889
+ return {
75890
+ call() {
75891
+ return ref == null ? void 0 : ref.current();
75892
+ },
75893
+ set(func2) {
75894
+ ref.current = func2;
75895
+ }
75896
+ };
75897
+ }
75898
+ function useAsyncFuncRef(func) {
75899
+ const ref = useRef(func);
75900
+ return {
75901
+ async call() {
75902
+ return ref == null ? void 0 : ref.current();
75903
+ },
75904
+ set(func2) {
75905
+ ref.current = func2;
75906
+ }
75907
+ };
75908
+ }
75909
+ function useSectionBox(adapter) {
75910
+ const enable = useStateRef(false);
75911
+ const visible2 = useStateRef(false);
75912
+ const showOffsetPanel = useStateRef(false);
75913
+ const auto = useStateRef(false);
75914
+ const topOffset = useStateRef("1");
75915
+ const sideOffset = useStateRef("1");
75916
+ const bottomOffset = useStateRef("1");
75917
+ const boxRef = useRef(adapter.getBox());
75918
+ enable.useOnChange((v) => {
75919
+ visible2.set(v);
75920
+ showOffsetPanel.set(false);
75921
+ if (v && auto.get()) {
75922
+ sectionSelection.call();
75923
+ } else {
75924
+ sectionReset.call();
75925
+ }
75926
+ });
75927
+ visible2.useValidate((v) => enable.get() && v);
75928
+ showOffsetPanel.useValidate((v) => enable.get() && v);
75929
+ topOffset.useConfirm((v) => sanitize(v, true));
75930
+ sideOffset.useConfirm((v) => sanitize(v, true));
75931
+ bottomOffset.useConfirm((v) => sanitize(v, true));
75932
+ topOffset.useOnChange((v) => section.call(boxRef.current));
75933
+ sideOffset.useOnChange((v) => section.call(boxRef.current));
75934
+ bottomOffset.useOnChange((v) => section.call(boxRef.current));
75935
+ auto.useOnChange((v) => {
75936
+ if (v) sectionSelection.call();
75937
+ });
75938
+ visible2.useOnChange((v) => adapter.setVisible(v));
75939
+ useEffect(() => {
75940
+ adapter.setVisible(false);
75941
+ return adapter.onSelectionChanged.sub(() => {
75942
+ if (auto.get() && enable.get()) sectionSelection.call();
75943
+ });
75944
+ }, []);
75945
+ const section = useArgActionRef((baseBox) => {
75946
+ boxRef.current = baseBox;
75947
+ const newBox = addBox(baseBox, offsetsToBox3(topOffset.get(), sideOffset.get(), bottomOffset.get()));
75948
+ adapter.fitBox(newBox);
75949
+ });
75950
+ const sectionSelection = useFuncRef(async () => {
75951
+ try {
75952
+ const box = await adapter.getSelectionBox() ?? await adapter.getRendererBox();
75953
+ section.call(box);
75954
+ } catch (e) {
75955
+ console.error(e);
75956
+ }
75957
+ });
75958
+ const sectionReset = useFuncRef(async () => {
75959
+ const box = await adapter.getRendererBox();
75960
+ section.call(box);
75961
+ });
75962
+ return {
75963
+ enable,
75964
+ visible: visible2,
75965
+ auto,
75966
+ showOffsetPanel,
75967
+ topOffset,
75968
+ sideOffset,
75969
+ bottomOffset,
75970
+ sectionSelection,
75971
+ sectionReset,
75972
+ section
75973
+ };
75974
+ }
75975
+ const sanitize = (value, strict) => {
75976
+ if (!strict) {
75977
+ if (value === "" || value === "-") return value;
75978
+ }
75979
+ const num = parseFloat(value);
75980
+ if (isNaN(num)) {
75981
+ return strict ? "1" : void 0;
75982
+ }
75983
+ return String(num);
75984
+ };
75985
+ function offsetsToBox3(top, side, bottom) {
75986
+ const getNumber = (s) => {
75987
+ const num = parseFloat(s);
75988
+ return isNaN(num) ? 0 : num;
75989
+ };
75990
+ return new Box3(
75991
+ new Vector3(-getNumber(side), -getNumber(side), -getNumber(bottom)),
75992
+ new Vector3(getNumber(side), getNumber(side), getNumber(top))
75993
+ );
75994
+ }
75995
+ function useWebglSectionBox(viewer) {
75996
+ const vimAdapter = {
75997
+ setVisible: (b) => {
75998
+ viewer.gizmos.sectionBox.visible = b;
75999
+ viewer.gizmos.sectionBox.interactive = b;
76000
+ },
76001
+ getBox: () => viewer.gizmos.sectionBox.box.clone(),
76002
+ fitBox: (box) => viewer.gizmos.sectionBox.fitBox(box),
76003
+ getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
76004
+ getRendererBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
76005
+ onSelectionChanged: viewer.selection.onValueChanged
76006
+ };
76007
+ viewer.gizmos.sectionBox.clip = true;
76008
+ return useSectionBox(vimAdapter);
76009
+ }
76010
+ function useCamera(adapter) {
76011
+ const autoCamera2 = useStateRef(false);
76012
+ autoCamera2.useOnChange((v) => {
76013
+ if (v) {
76014
+ frameSelection2.call();
76015
+ }
76016
+ });
76017
+ useEffect(() => {
76018
+ adapter.onSelectionChanged.sub(() => {
76019
+ if (autoCamera2.get()) {
76020
+ frameSelection2.call();
76021
+ }
76022
+ });
76023
+ }, []);
76024
+ const reset = useActionRef(() => adapter.resetCamera(1));
76025
+ const frameSelection2 = useAsyncFuncRef(async () => {
76026
+ console.log("frameSelection");
76027
+ if (!adapter.hasSelection()) {
76028
+ frameScene.call();
76029
+ return;
76030
+ }
76031
+ const box = await adapter.getSelectionBox();
76032
+ if (!box) {
76033
+ return;
76034
+ }
76035
+ adapter.frameCamera(box, 1);
76036
+ });
76037
+ const frameScene = useAsyncFuncRef(async () => {
76038
+ adapter.frameAll(1);
76039
+ });
76040
+ return {
76041
+ autoCamera: autoCamera2,
76042
+ reset,
76043
+ frameSelection: frameSelection2,
76044
+ frameScene
76045
+ };
76046
+ }
76047
+ function useWebglCamera(viewer) {
76048
+ return useCamera({
76049
+ onSelectionChanged: viewer.selection.onValueChanged,
76050
+ frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
76051
+ resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
76052
+ frameAll: (duration) => {
76053
+ const box = viewer.renderer.getBoundingBox();
76054
+ viewer.camera.lerp(duration).frame(box);
76055
+ },
76056
+ hasSelection: () => viewer.selection.count > 0,
76057
+ getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox())
76058
+ });
76059
+ }
75554
76060
  function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
75555
76061
  const promise2 = new DeferredPromise2();
75556
76062
  const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
@@ -75582,7 +76088,7 @@ function VimComponent(props) {
75582
76088
  var _a2;
75583
76089
  const settings2 = useSettings(props.viewer, props.settings ?? {});
75584
76090
  const modal = useModal(settings2.value.capacity.canFollowUrl);
75585
- const camera2 = useMemo(() => new ComponentCamera(props.viewer), []);
76091
+ const camera2 = useWebglCamera(props.viewer);
75586
76092
  const cursor = useMemo(() => new CursorManager(props.viewer), []);
75587
76093
  const loader = useRef(new ComponentLoader(props.viewer, modal));
75588
76094
  const [isolation] = useState(() => new Isolation(props.viewer, camera2, settings2.value));
@@ -75592,11 +76098,13 @@ function VimComponent(props) {
75592
76098
  Math.min(props.container.root.clientWidth * 0.25, 340)
75593
76099
  );
75594
76100
  const [contextMenu2, setcontextMenu] = useState();
75595
- const [controlBar2, setControlBar] = useState();
76101
+ const [controlBarCustom, setControlBarCustom] = useState();
75596
76102
  const bimInfoRef = useBimInfo();
75597
76103
  const viewerState = useViewerState(props.viewer);
75598
76104
  const treeRef = useRef();
75599
76105
  const performanceRef = useRef(null);
76106
+ const sectionBox2 = useWebglSectionBox(props.viewer);
76107
+ const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
75600
76108
  useEffect(() => {
75601
76109
  var _a3;
75602
76110
  side.setHasBim(((_a3 = viewerState.vim) == null ? void 0 : _a3.bim) !== void 0);
@@ -75621,11 +76129,14 @@ function VimComponent(props) {
75621
76129
  isolation,
75622
76130
  camera: camera2,
75623
76131
  settings: settings2,
76132
+ get sectionBox() {
76133
+ return sectionBox2;
76134
+ },
75624
76135
  contextMenu: {
75625
76136
  customize: (v) => setcontextMenu(() => v)
75626
76137
  },
75627
76138
  controlBar: {
75628
- customize: (v) => setControlBar(() => v)
76139
+ customize: (v) => setControlBarCustom(() => v)
75629
76140
  },
75630
76141
  modal,
75631
76142
  bimInfo: bimInfoRef,
@@ -75679,16 +76190,11 @@ function VimComponent(props) {
75679
76190
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75680
76191
  ControlBar,
75681
76192
  {
75682
- viewer: props.viewer,
75683
- camera: camera2,
75684
- modal,
75685
- side,
75686
- isolation,
75687
- cursor,
75688
- settings: settings2.value,
75689
- customization: controlBar2
76193
+ content: controlBar2,
76194
+ show: isTrue(settings2.value.ui.controlBar)
75690
76195
  }
75691
76196
  ),
76197
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 }),
75692
76198
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75693
76199
  AxesPanelMemo,
75694
76200
  {
@@ -76014,12 +76520,65 @@ function getRequestErrorMessage(source, error) {
76014
76520
  return serverConnectionError(source.url);
76015
76521
  }
76016
76522
  }
76523
+ function updateModal(modal, state) {
76524
+ if (state.status === "connected") {
76525
+ modal.loading(void 0);
76526
+ modal.message(void 0);
76527
+ }
76528
+ if (state.status === "connecting") {
76529
+ if (modal.current === void 0 || modal.current.type === "loading") {
76530
+ modal.loading({ message: "Connecting to VIM Ultra server..." });
76531
+ }
76532
+ }
76533
+ if (state.status === "error") {
76534
+ console.log("Error loading vim", state);
76535
+ modal.message(getErrorMessage(state));
76536
+ }
76537
+ }
76538
+ async function updateProgress(request2, modal) {
76539
+ for await (const progress of request2.getProgress()) {
76540
+ if (request2.isCompleted) break;
76541
+ modal.loading({ message: "Loading File in VIM Ultra mode", progress });
76542
+ }
76543
+ }
76544
+ function useUltraSectionBox(viewer) {
76545
+ const ultraAdapter = {
76546
+ setVisible: (b) => {
76547
+ console.log("SetVisible!", b);
76548
+ viewer.sectionBox.visible = b;
76549
+ viewer.sectionBox.interactive = b;
76550
+ },
76551
+ getBox: () => viewer.sectionBox.getBox().clone(),
76552
+ fitBox: (box) => viewer.sectionBox.fitBox(box),
76553
+ getSelectionBox: () => viewer.selection.getBoundingBox(),
76554
+ getRendererBox: () => viewer.renderer.getBoundingBox(),
76555
+ onSelectionChanged: viewer.selection.onValueChanged
76556
+ };
76557
+ return useSectionBox(ultraAdapter);
76558
+ }
76559
+ function useUltraControlBar(viewer, section, camera2, customization) {
76560
+ const sectionSectionBox = controlBarSectionBox(section, viewer.selection.count > 0);
76561
+ const sectionCamera = controlBarCamera(camera2);
76562
+ let bar = [sectionCamera, sectionSectionBox];
76563
+ bar = (customization == null ? void 0 : customization(bar)) ?? bar;
76564
+ return bar;
76565
+ }
76566
+ function useUltraCamera(viewer) {
76567
+ return useCamera({
76568
+ onSelectionChanged: viewer.selection.onValueChanged,
76569
+ frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
76570
+ frameAll: (duration) => viewer.camera.frameAll(duration),
76571
+ resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
76572
+ hasSelection: () => viewer.selection.count > 0,
76573
+ getSelectionBox: () => viewer.selection.getBoundingBox()
76574
+ });
76575
+ }
76017
76576
  function createUltraComponent(container) {
76018
76577
  const promise2 = new DeferredPromise2();
76019
76578
  const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
76020
76579
  const viewer = Viewer2.createWithCanvas(cmpContainer.gfx);
76021
76580
  const reactRoot = clientExports.createRoot(cmpContainer.ui);
76022
- const patchRef = (cmp) => {
76581
+ const attachDispose = (cmp) => {
76023
76582
  cmp.dispose = () => {
76024
76583
  viewer.dispose();
76025
76584
  cmpContainer.dispose();
@@ -76033,7 +76592,7 @@ function createUltraComponent(container) {
76033
76592
  {
76034
76593
  container: cmpContainer,
76035
76594
  viewer,
76036
- onMount: (cmp) => promise2.resolve(patchRef(cmp))
76595
+ onMount: (cmp) => promise2.resolve(attachDispose(cmp))
76037
76596
  }
76038
76597
  )
76039
76598
  );
@@ -76041,32 +76600,60 @@ function createUltraComponent(container) {
76041
76600
  }
76042
76601
  function UltraComponent(props) {
76043
76602
  const modal = useModal(true);
76603
+ const sectionBox2 = useUltraSectionBox(props.viewer);
76604
+ const camera2 = useUltraCamera(props.viewer);
76605
+ const side = useSideState(true, 400);
76606
+ const [_, setSelectState] = useState(0);
76607
+ const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
76608
+ const controlBar2 = useUltraControlBar(props.viewer, sectionBox2, camera2, (_2) => _2);
76044
76609
  useEffect(() => {
76045
76610
  props.viewer.onStateChanged.subscribe((state) => updateModal(modal, state));
76046
- props.onMount(ToRef(props.viewer, modal));
76611
+ props.viewer.selection.onValueChanged.subscribe(() => {
76612
+ setSelectState((i) => (i + 1) % 2);
76613
+ });
76614
+ props.onMount({
76615
+ viewer: props.viewer,
76616
+ modal,
76617
+ sectionBox: sectionBox2,
76618
+ camera: camera2,
76619
+ dispose: () => {
76620
+ },
76621
+ controlBar: {
76622
+ customize: (v) => setControlBarCustom(() => v)
76623
+ },
76624
+ load: patchLoad(props.viewer, modal)
76625
+ });
76047
76626
  }, []);
76048
76627
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76049
- /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.viewer.viewport.canvas }),
76050
- /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal })
76628
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
76629
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76630
+ whenTrue(true, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
76631
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.viewer.viewport.canvas }),
76632
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
76633
+ ControlBar,
76634
+ {
76635
+ content: controlBarCustom(controlBar2),
76636
+ show: true
76637
+ }
76638
+ ),
76639
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 })
76640
+ ] });
76641
+ } }),
76642
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal }),
76643
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
76644
+ ReactTooltip,
76645
+ {
76646
+ multiline: true,
76647
+ arrowColor: "transparent",
76648
+ type: "light",
76649
+ className: "!vc-max-w-xs !vc-border !vc-border-solid !vc-border-gray-medium !vc-bg-white !vc-text-xs !vc-text-gray-darkest !vc-opacity-100 !vc-shadow-[2px_6px_15px_rgba(0,0,0,0.3)] !vc-transition-opacity",
76650
+ delayShow: 200
76651
+ }
76652
+ )
76051
76653
  ] });
76052
76654
  }
76053
- function updateModal(modal, state) {
76054
- if (state.status === "connected") {
76055
- modal.loading(void 0);
76056
- modal.message(void 0);
76057
- }
76058
- if (state.status === "connecting") {
76059
- if (modal.current === void 0 || modal.current.type === "loading") {
76060
- modal.loading({ message: "Connecting to VIM Ultra server..." });
76061
- }
76062
- }
76063
- if (state.status === "error") {
76064
- console.log("Error loading vim", state);
76065
- modal.message(getErrorMessage(state));
76066
- }
76067
- }
76068
- function ToRef(viewer, modal) {
76069
- function load(source) {
76655
+ function patchLoad(viewer, modal) {
76656
+ return function load(source) {
76070
76657
  const request2 = viewer.loadVim(source);
76071
76658
  void updateProgress(request2, modal);
76072
76659
  void request2.getResult().then(
@@ -76081,23 +76668,11 @@ function ToRef(viewer, modal) {
76081
76668
  }
76082
76669
  );
76083
76670
  return request2;
76084
- }
76085
- return {
76086
- viewer,
76087
- modal,
76088
- dispose: () => {
76089
- },
76090
- load
76091
76671
  };
76092
76672
  }
76093
- async function updateProgress(request2, modal) {
76094
- for await (const progress of request2.getProgress()) {
76095
- if (request2.isCompleted) break;
76096
- modal.loading({ message: "Loading File in VIM Ultra mode", progress });
76097
- }
76098
- }
76099
76673
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
76100
76674
  __proto__: null,
76675
+ ControlBar: controlBar,
76101
76676
  UltraComponent,
76102
76677
  createUltraComponent
76103
76678
  }, Symbol.toStringTag, { value: "Module" }));