vim-web 0.3.44-dev.34 → 0.3.44-dev.35

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
@@ -76016,16 +76016,18 @@ function useCamera(adapter) {
76016
76016
  async function frameBox(adapter, getBox) {
76017
76017
  const box = await getBox();
76018
76018
  if (!box) return;
76019
- const section = adapter.getSectionBox();
76020
- if (section) {
76021
- box.intersect(section);
76022
- }
76023
- if (box.isEmpty()) {
76024
- box.copy(section);
76019
+ if (adapter.isSectionBoxEnabled()) {
76020
+ const section = adapter.getSectionBox();
76021
+ if (section) {
76022
+ box.intersect(section);
76023
+ }
76024
+ if (box.isEmpty()) {
76025
+ box.copy(section);
76026
+ }
76025
76027
  }
76026
76028
  adapter.frameCamera(box, 1);
76027
76029
  }
76028
- function useWebglCamera(viewer) {
76030
+ function useWebglCamera(viewer, section) {
76029
76031
  return useCamera({
76030
76032
  onSelectionChanged: viewer.selection.onValueChanged,
76031
76033
  frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
@@ -76033,7 +76035,8 @@ function useWebglCamera(viewer) {
76033
76035
  hasSelection: () => viewer.selection.count > 0,
76034
76036
  getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
76035
76037
  getSectionBox: () => viewer.renderer.section.box,
76036
- getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox())
76038
+ getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
76039
+ isSectionBoxEnabled: () => section.enable.get()
76037
76040
  });
76038
76041
  }
76039
76042
  function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
@@ -76067,7 +76070,8 @@ function VimComponent(props) {
76067
76070
  var _a2;
76068
76071
  const settings2 = useSettings(props.viewer, props.settings ?? {});
76069
76072
  const modal = useModal(settings2.value.capacity.canFollowUrl);
76070
- const camera2 = useWebglCamera(props.viewer);
76073
+ const sectionBox2 = useWebglSectionBox(props.viewer);
76074
+ const camera2 = useWebglCamera(props.viewer, sectionBox2);
76071
76075
  const cursor = useMemo(() => new CursorManager(props.viewer), []);
76072
76076
  const loader = useRef(new ComponentLoader(props.viewer, modal));
76073
76077
  const [isolation] = useState(() => new Isolation(props.viewer, camera2, settings2.value));
@@ -76082,7 +76086,6 @@ function VimComponent(props) {
76082
76086
  const viewerState = useViewerState(props.viewer);
76083
76087
  const treeRef = useRef();
76084
76088
  const performanceRef = useRef(null);
76085
- const sectionBox2 = useWebglSectionBox(props.viewer);
76086
76089
  const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
76087
76090
  useEffect(() => {
76088
76091
  var _a3;
@@ -76546,7 +76549,7 @@ function useUltraControlBar(viewer, section, camera2, customization) {
76546
76549
  bar = (customization == null ? void 0 : customization(bar)) ?? bar;
76547
76550
  return bar;
76548
76551
  }
76549
- function useUltraCamera(viewer) {
76552
+ function useUltraCamera(viewer, section) {
76550
76553
  return useCamera({
76551
76554
  onSelectionChanged: viewer.selection.onValueChanged,
76552
76555
  frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
@@ -76554,7 +76557,8 @@ function useUltraCamera(viewer) {
76554
76557
  hasSelection: () => viewer.selection.count > 0,
76555
76558
  getSelectionBox: () => viewer.selection.getBoundingBox(),
76556
76559
  getSceneBox: () => viewer.renderer.getBoundingBox(),
76557
- getSectionBox: () => viewer.sectionBox.getBox()
76560
+ getSectionBox: () => viewer.sectionBox.getBox(),
76561
+ isSectionBoxEnabled: () => section.enable.get()
76558
76562
  });
76559
76563
  }
76560
76564
  function createUltraComponent(container) {
@@ -76585,7 +76589,7 @@ function createUltraComponent(container) {
76585
76589
  function UltraComponent(props) {
76586
76590
  const modal = useModal(true);
76587
76591
  const sectionBox2 = useUltraSectionBox(props.viewer);
76588
- const camera2 = useUltraCamera(props.viewer);
76592
+ const camera2 = useUltraCamera(props.viewer, sectionBox2);
76589
76593
  const side = useSideState(true, 400);
76590
76594
  const [_, setSelectState] = useState(0);
76591
76595
  const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);