vim-web 0.3.44-dev.34 → 0.3.44-dev.36
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/types/react-viewers/state/cameraState.d.ts +1 -0
- package/dist/types/react-viewers/state/sectionBoxState.d.ts +2 -1
- package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +2 -1
- package/dist/types/react-viewers/webgl/webglCameraState.d.ts +2 -2
- package/dist/vim-web.iife.js +25 -20
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +25 -20
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
package/dist/vim-web.js
CHANGED
|
@@ -75906,14 +75906,14 @@ function useSectionBox(adapter) {
|
|
|
75906
75906
|
topOffset.useConfirm((v) => sanitize(v, true));
|
|
75907
75907
|
sideOffset.useConfirm((v) => sanitize(v, true));
|
|
75908
75908
|
bottomOffset.useConfirm((v) => sanitize(v, true));
|
|
75909
|
-
topOffset.useOnChange((v) =>
|
|
75910
|
-
sideOffset.useOnChange((v) =>
|
|
75911
|
-
bottomOffset.useOnChange((v) =>
|
|
75909
|
+
topOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75910
|
+
sideOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75911
|
+
bottomOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75912
75912
|
auto.useOnChange((v) => {
|
|
75913
75913
|
if (v) sectionSelection.call();
|
|
75914
75914
|
});
|
|
75915
75915
|
visible2.useOnChange((v) => adapter.setVisible(v));
|
|
75916
|
-
const
|
|
75916
|
+
const sectionBox2 = useArgActionRef((baseBox) => {
|
|
75917
75917
|
if (baseBox === void 0) return;
|
|
75918
75918
|
boxRef.current = baseBox;
|
|
75919
75919
|
const newBox = addBox(baseBox, offsetsToBox3(topOffset.get(), sideOffset.get(), bottomOffset.get()));
|
|
@@ -75922,14 +75922,14 @@ function useSectionBox(adapter) {
|
|
|
75922
75922
|
const sectionSelection = useFuncRef(async () => {
|
|
75923
75923
|
try {
|
|
75924
75924
|
const box = await adapter.getSelectionBox() ?? await adapter.getRendererBox();
|
|
75925
|
-
|
|
75925
|
+
sectionBox2.call(box);
|
|
75926
75926
|
} catch (e) {
|
|
75927
75927
|
console.error(e);
|
|
75928
75928
|
}
|
|
75929
75929
|
});
|
|
75930
75930
|
const sectionReset = useFuncRef(async () => {
|
|
75931
75931
|
const box = await adapter.getRendererBox();
|
|
75932
|
-
|
|
75932
|
+
sectionBox2.call(box);
|
|
75933
75933
|
});
|
|
75934
75934
|
return {
|
|
75935
75935
|
enable,
|
|
@@ -75941,7 +75941,8 @@ function useSectionBox(adapter) {
|
|
|
75941
75941
|
bottomOffset,
|
|
75942
75942
|
sectionSelection,
|
|
75943
75943
|
sectionReset,
|
|
75944
|
-
|
|
75944
|
+
sectionBox: sectionBox2,
|
|
75945
|
+
getBox: () => adapter.getBox()
|
|
75945
75946
|
};
|
|
75946
75947
|
}
|
|
75947
75948
|
const sanitize = (value, strict) => {
|
|
@@ -76016,16 +76017,18 @@ function useCamera(adapter) {
|
|
|
76016
76017
|
async function frameBox(adapter, getBox) {
|
|
76017
76018
|
const box = await getBox();
|
|
76018
76019
|
if (!box) return;
|
|
76019
|
-
|
|
76020
|
-
|
|
76021
|
-
|
|
76022
|
-
|
|
76023
|
-
|
|
76024
|
-
box.
|
|
76020
|
+
if (adapter.isSectionBoxEnabled()) {
|
|
76021
|
+
const section = adapter.getSectionBox();
|
|
76022
|
+
if (section) {
|
|
76023
|
+
box.intersect(section);
|
|
76024
|
+
}
|
|
76025
|
+
if (box.isEmpty()) {
|
|
76026
|
+
box.copy(section);
|
|
76027
|
+
}
|
|
76025
76028
|
}
|
|
76026
76029
|
adapter.frameCamera(box, 1);
|
|
76027
76030
|
}
|
|
76028
|
-
function useWebglCamera(viewer) {
|
|
76031
|
+
function useWebglCamera(viewer, section) {
|
|
76029
76032
|
return useCamera({
|
|
76030
76033
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76031
76034
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
@@ -76033,7 +76036,8 @@ function useWebglCamera(viewer) {
|
|
|
76033
76036
|
hasSelection: () => viewer.selection.count > 0,
|
|
76034
76037
|
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
76035
76038
|
getSectionBox: () => viewer.renderer.section.box,
|
|
76036
|
-
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox())
|
|
76039
|
+
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
|
|
76040
|
+
isSectionBoxEnabled: () => section.enable.get()
|
|
76037
76041
|
});
|
|
76038
76042
|
}
|
|
76039
76043
|
function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
|
|
@@ -76067,7 +76071,8 @@ function VimComponent(props) {
|
|
|
76067
76071
|
var _a2;
|
|
76068
76072
|
const settings2 = useSettings(props.viewer, props.settings ?? {});
|
|
76069
76073
|
const modal = useModal(settings2.value.capacity.canFollowUrl);
|
|
76070
|
-
const
|
|
76074
|
+
const sectionBox2 = useWebglSectionBox(props.viewer);
|
|
76075
|
+
const camera2 = useWebglCamera(props.viewer, sectionBox2);
|
|
76071
76076
|
const cursor = useMemo(() => new CursorManager(props.viewer), []);
|
|
76072
76077
|
const loader = useRef(new ComponentLoader(props.viewer, modal));
|
|
76073
76078
|
const [isolation] = useState(() => new Isolation(props.viewer, camera2, settings2.value));
|
|
@@ -76082,7 +76087,6 @@ function VimComponent(props) {
|
|
|
76082
76087
|
const viewerState = useViewerState(props.viewer);
|
|
76083
76088
|
const treeRef = useRef();
|
|
76084
76089
|
const performanceRef = useRef(null);
|
|
76085
|
-
const sectionBox2 = useWebglSectionBox(props.viewer);
|
|
76086
76090
|
const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
|
|
76087
76091
|
useEffect(() => {
|
|
76088
76092
|
var _a3;
|
|
@@ -76546,7 +76550,7 @@ function useUltraControlBar(viewer, section, camera2, customization) {
|
|
|
76546
76550
|
bar = (customization == null ? void 0 : customization(bar)) ?? bar;
|
|
76547
76551
|
return bar;
|
|
76548
76552
|
}
|
|
76549
|
-
function useUltraCamera(viewer) {
|
|
76553
|
+
function useUltraCamera(viewer, section) {
|
|
76550
76554
|
return useCamera({
|
|
76551
76555
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76552
76556
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
@@ -76554,7 +76558,8 @@ function useUltraCamera(viewer) {
|
|
|
76554
76558
|
hasSelection: () => viewer.selection.count > 0,
|
|
76555
76559
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76556
76560
|
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76557
|
-
getSectionBox: () => viewer.sectionBox.getBox()
|
|
76561
|
+
getSectionBox: () => viewer.sectionBox.getBox(),
|
|
76562
|
+
isSectionBoxEnabled: () => section.enable.get()
|
|
76558
76563
|
});
|
|
76559
76564
|
}
|
|
76560
76565
|
function createUltraComponent(container) {
|
|
@@ -76585,7 +76590,7 @@ function createUltraComponent(container) {
|
|
|
76585
76590
|
function UltraComponent(props) {
|
|
76586
76591
|
const modal = useModal(true);
|
|
76587
76592
|
const sectionBox2 = useUltraSectionBox(props.viewer);
|
|
76588
|
-
const camera2 = useUltraCamera(props.viewer);
|
|
76593
|
+
const camera2 = useUltraCamera(props.viewer, sectionBox2);
|
|
76589
76594
|
const side = useSideState(true, 400);
|
|
76590
76595
|
const [_, setSelectState] = useState(0);
|
|
76591
76596
|
const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
|