vim-web 0.4.1-dev.1 → 0.4.1-dev.3

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
@@ -45581,7 +45581,7 @@ let Element3D$1 = class Element3D {
45581
45581
  }
45582
45582
  /**
45583
45583
  * Retrieves the bounding box of the object from cache or computes it if needed.
45584
- * Returns undefined if the object has no geometry.
45584
+ * Returns undefined if the element is abstract.
45585
45585
  * @returns {THREE.Box3 | undefined} The bounding box of the object, or undefined if the object has no geometry.
45586
45586
  */
45587
45587
  async getBoundingBox() {
@@ -50290,7 +50290,7 @@ class CameraMovement {
50290
50290
  * Resets the camera to its last saved position and orientation.
50291
50291
  */
50292
50292
  reset() {
50293
- this.set(this._camera.position, this._camera.target);
50293
+ this.set(this._savedState.position, this._savedState.target);
50294
50294
  }
50295
50295
  /**
50296
50296
  * Sets the camera's orientation and position to focus on the specified target.
@@ -60992,6 +60992,7 @@ class Element3D2 {
60992
60992
  }
60993
60993
  /**
60994
60994
  * Computes and returns the bounding box of the element.
60995
+ * Returns undefined if the element is abstract.
60995
60996
  * @returns A promise resolving to the element's bounding box.
60996
60997
  */
60997
60998
  async getBoundingBox() {
@@ -75773,6 +75774,7 @@ function useSectionBox(adapter) {
75773
75774
  const topOffset = useStateRef(1);
75774
75775
  const sideOffset = useStateRef(1);
75775
75776
  const bottomOffset = useStateRef(1);
75777
+ const requestId = useRef(0);
75776
75778
  const boxRef = useRef(adapter.getBox());
75777
75779
  const getSelectionBox = useAsyncFuncRef(adapter.getSelectionBox);
75778
75780
  const getSceneBox = useAsyncFuncRef(adapter.getSceneBox);
@@ -75802,18 +75804,23 @@ function useSectionBox(adapter) {
75802
75804
  if (v) sectionSelection2.call();
75803
75805
  });
75804
75806
  visible2.useOnChange((v) => adapter.setVisible(v));
75805
- const sectionBox2 = useArgActionRef((baseBox) => {
75806
- if (baseBox === void 0) return;
75807
- boxRef.current = baseBox;
75808
- const newBox = addBox(baseBox, offsetsToBox3_(topOffset.get(), sideOffset.get(), bottomOffset.get()));
75807
+ const sectionBox2 = useArgActionRef((box) => {
75808
+ if (box === void 0) return;
75809
+ requestId.current++;
75810
+ boxRef.current = box;
75811
+ const newBox = addBox(box, offsetsToBox3_(topOffset.get(), sideOffset.get(), bottomOffset.get()));
75809
75812
  adapter.setBox(newBox);
75810
75813
  });
75811
75814
  const sectionSelection2 = useFuncRef(async () => {
75815
+ const id2 = requestId.current;
75812
75816
  const box = await getSelectionBox.call() ?? await getSceneBox.call();
75817
+ if (requestId.current !== id2) return;
75813
75818
  sectionBox2.call(box);
75814
75819
  });
75815
75820
  const sectionScene = useFuncRef(async () => {
75821
+ const id2 = requestId.current;
75816
75822
  const box = await getSceneBox.call();
75823
+ if (requestId.current !== id2) return;
75817
75824
  sectionBox2.call(box);
75818
75825
  });
75819
75826
  return {