vim-web 0.3.44-dev.37 → 0.3.44-dev.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vim-web.js CHANGED
@@ -55717,12 +55717,12 @@ let SectionBox$1 = class SectionBox {
55717
55717
  // Public Properties
55718
55718
  // -------------------------------------------------------------------------
55719
55719
  /**
55720
- * The shared bounding box that defines the section region.
55721
- *
55722
- * To programmatically update the box, see {@link fitBox}.
55720
+ * Returns a copy of the current section box.
55721
+ * To programmatically update the box, see {@link setBox}.
55723
55722
  */
55724
- get box() {
55725
- return this.section.box;
55723
+ getBox() {
55724
+ var _a2;
55725
+ return (_a2 = this.section.box) == null ? void 0 : _a2.clone();
55726
55726
  }
55727
55727
  /**
55728
55728
  * Determines whether the section gizmo applies clipping planes to the model.
@@ -55784,12 +55784,12 @@ let SectionBox$1 = class SectionBox {
55784
55784
  * @param box - The bounding box to match (required).
55785
55785
  * @param padding - The scalar amount by which to expand the bounding box. Default is `1`.
55786
55786
  */
55787
- fitBox(box) {
55787
+ setBox(box) {
55788
55788
  if (!box) return;
55789
55789
  box = safeBox(box);
55790
55790
  this._gizmos.fitBox(box);
55791
55791
  this.renderer.section.fitBox(box);
55792
- this._onBoxConfirm.dispatch(this.box);
55792
+ this._onBoxConfirm.dispatch(box);
55793
55793
  this.renderer.needsUpdate = true;
55794
55794
  }
55795
55795
  /**
@@ -55798,7 +55798,7 @@ let SectionBox$1 = class SectionBox {
55798
55798
  * Call this if the renderer's section box is changed by code outside this class.
55799
55799
  */
55800
55800
  update() {
55801
- this.fitBox(this.section.box);
55801
+ this.setBox(this.section.box);
55802
55802
  this.renderer.needsUpdate = true;
55803
55803
  }
55804
55804
  /**
@@ -59199,7 +59199,12 @@ class RpcSafeClient {
59199
59199
  this.rpc.RPCEnableSectionBox(enable);
59200
59200
  }
59201
59201
  RPCSetSectionBox(state) {
59202
- this.rpc.RPCSetSectionBox(state);
59202
+ this.rpc.RPCSetSectionBox(
59203
+ {
59204
+ ...state,
59205
+ box: state.box ?? new Box3(new Vector3(), new Vector3())
59206
+ }
59207
+ );
59203
59208
  }
59204
59209
  async RPCGetSectionBox() {
59205
59210
  return await this.safeCall(
@@ -61821,7 +61826,7 @@ class SectionBox2 {
61821
61826
  __publicField(this, "_visible", false);
61822
61827
  __publicField(this, "_interactible", false);
61823
61828
  __publicField(this, "_clip", false);
61824
- __publicField(this, "_box", new Box3());
61829
+ __publicField(this, "_box");
61825
61830
  __publicField(this, "_rpc");
61826
61831
  __publicField(this, "_interval");
61827
61832
  __publicField(this, "_animationFrame");
@@ -61905,7 +61910,8 @@ class SectionBox2 {
61905
61910
  this.scheduleUpdate();
61906
61911
  }
61907
61912
  getBox() {
61908
- return this._box;
61913
+ var _a2;
61914
+ return (_a2 = this._box) == null ? void 0 : _a2.clone();
61909
61915
  }
61910
61916
  dispose() {
61911
61917
  clearInterval(this._interval);
@@ -75917,7 +75923,7 @@ function useSectionBox(adapter) {
75917
75923
  if (baseBox === void 0) return;
75918
75924
  boxRef.current = baseBox;
75919
75925
  const newBox = addBox(baseBox, offsetsToBox3(topOffset.get(), sideOffset.get(), bottomOffset.get()));
75920
- adapter.fitBox(newBox);
75926
+ adapter.setBox(newBox);
75921
75927
  });
75922
75928
  const sectionSelection = useFuncRef(async () => {
75923
75929
  try {
@@ -75974,8 +75980,8 @@ function useWebglSectionBox(viewer) {
75974
75980
  viewer.gizmos.sectionBox.visible = b;
75975
75981
  viewer.gizmos.sectionBox.interactive = b;
75976
75982
  },
75977
- getBox: () => viewer.gizmos.sectionBox.box.clone(),
75978
- fitBox: (box) => viewer.gizmos.sectionBox.fitBox(box),
75983
+ getBox: () => viewer.gizmos.sectionBox.getBox(),
75984
+ setBox: (box) => viewer.gizmos.sectionBox.setBox(box),
75979
75985
  getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
75980
75986
  getRendererBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
75981
75987
  onSelectionChanged: viewer.selection.onValueChanged
@@ -76535,8 +76541,8 @@ function useUltraSectionBox(viewer) {
76535
76541
  viewer.sectionBox.visible = b;
76536
76542
  viewer.sectionBox.interactive = b;
76537
76543
  },
76538
- getBox: () => viewer.sectionBox.getBox().clone(),
76539
- fitBox: (box) => viewer.sectionBox.fitBox(box),
76544
+ getBox: () => viewer.sectionBox.getBox(),
76545
+ setBox: (box) => viewer.sectionBox.fitBox(box),
76540
76546
  getSelectionBox: () => viewer.selection.getBoundingBox(),
76541
76547
  getRendererBox: () => viewer.renderer.getBoundingBox(),
76542
76548
  onSelectionChanged: viewer.selection.onValueChanged