vim-web 0.3.44-dev.6 → 0.3.44-dev.8

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.
@@ -15,10 +15,11 @@ export interface SectionBoxRef {
15
15
  setAuto: (auto: boolean) => void;
16
16
  sectionSelection: () => void;
17
17
  sectionReset: () => void;
18
- getOffsetVisible: () => boolean;
19
- setOffsetsVisible: React.Dispatch<React.SetStateAction<boolean>>;
20
- getText: (field: OffsetField) => string;
21
- setText: (field: OffsetField, value: string) => void;
18
+ section: (box: THREE.Box3) => void;
19
+ getShowOffsetPanel: () => boolean;
20
+ setShowOffsetPanel: React.Dispatch<React.SetStateAction<boolean>>;
21
+ getOffsetText: (field: OffsetField) => string;
22
+ setOffsetText: (field: OffsetField, value: string) => void;
22
23
  validate: (field: OffsetField) => void;
23
24
  }
24
25
  export interface SectionBoxAdapter {
@@ -1,10 +1,28 @@
1
1
  import * as Ultra from '../../core-viewers/ultra/index';
2
2
  import { Container } from '../container';
3
3
  import { ModalRef } from '../panels/modal';
4
+ import { SectionBoxRef } from '../state/sectionBoxState';
4
5
  export type UltraComponentRef = {
6
+ /**
7
+ * The Vim viewer instance associated with the component.
8
+ */
5
9
  viewer: Ultra.Viewer;
10
+ /**
11
+ * API to manage the modal dialog.
12
+ */
6
13
  modal: ModalRef;
14
+ /**
15
+ * API to manage the section box.
16
+ */
17
+ sectionBox: SectionBoxRef;
18
+ /**
19
+ * Disposes of the component and its resources.
20
+ */
7
21
  dispose: () => void;
22
+ /**
23
+ * Loads a file into the viewer.
24
+ * @param url The URL of the file to load.
25
+ */
8
26
  load(url: Ultra.VimSource): Ultra.ILoadRequest;
9
27
  };
10
28
  /**
@@ -11,6 +11,7 @@ import { BimInfoPanelRef } from '../bim/bimInfoData';
11
11
  import { ControlBarCustomization } from '../controlbar/controlBar';
12
12
  import { ComponentLoader } from './webglLoading';
13
13
  import { ModalRef } from '../panels/modal';
14
+ import { SectionBoxRef } from '../state/sectionBoxState';
14
15
  /**
15
16
  * Settings API managing settings applied to the component.
16
17
  */
@@ -82,6 +83,10 @@ export type VimComponentRef = {
82
83
  * Isolation API managing isolation state in the component.
83
84
  */
84
85
  isolation: Isolation;
86
+ /**
87
+ * Section box API managing the section box in the component.
88
+ */
89
+ sectionBox: SectionBoxRef;
85
90
  /**
86
91
  * Context menu API managing the content and behavior of the context menu.
87
92
  */
@@ -67878,9 +67878,9 @@ Averrage Date/Second ${avgDataRatePS} kb
67878
67878
  id: elementIds.buttonSectionBoxSettings,
67879
67879
  tip: "Section Settings",
67880
67880
  enabled: () => section.getEnable(),
67881
- isOn: () => section.getOffsetVisible(),
67881
+ isOn: () => section.getShowOffsetPanel(),
67882
67882
  style: (on) => buttonDefaultStyle(on),
67883
- action: () => section.setOffsetsVisible(!section.getOffsetVisible()),
67883
+ action: () => section.setShowOffsetPanel(!section.getShowOffsetPanel()),
67884
67884
  icon: slidersHoriz
67885
67885
  }
67886
67886
  ]
@@ -75733,8 +75733,8 @@ Averrage Date/Second ${avgDataRatePS} kb
75733
75733
  resizeObserver.disconnect();
75734
75734
  }
75735
75735
  };
75736
- }, [props.state.getOffsetVisible()]);
75737
- if (!props.state.getOffsetVisible()) return null;
75736
+ }, [props.state.getShowOffsetPanel()]);
75737
+ if (!props.state.getShowOffsetPanel()) return null;
75738
75738
  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: [
75739
75739
  /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: label }),
75740
75740
  /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -75742,8 +75742,8 @@ Averrage Date/Second ${avgDataRatePS} kb
75742
75742
  {
75743
75743
  id: id2,
75744
75744
  type: "text",
75745
- value: props.state.getText(field),
75746
- onChange: (e) => props.state.setText(field, e.target.value),
75745
+ value: props.state.getOffsetText(field),
75746
+ onChange: (e) => props.state.setOffsetText(field, e.target.value),
75747
75747
  className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
75748
75748
  onBlur: () => props.state.validate(field)
75749
75749
  }
@@ -75767,7 +75767,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75767
75767
  "button",
75768
75768
  {
75769
75769
  className: "vc-flex vc-border-none vc-bg-transparent vc-text-sm vc-cursor-pointer",
75770
- onClick: () => props.state.setOffsetsVisible(false),
75770
+ onClick: () => props.state.setShowOffsetPanel(false),
75771
75771
  children: close({ height: 12, width: 12, fill: "currentColor" })
75772
75772
  }
75773
75773
  )
@@ -75883,10 +75883,11 @@ Averrage Date/Second ${avgDataRatePS} kb
75883
75883
  setVisible,
75884
75884
  sectionSelection,
75885
75885
  sectionReset: resetBox,
75886
- getOffsetVisible: () => offsetsVisible,
75887
- setOffsetsVisible,
75888
- getText: (field) => offsets[field],
75889
- setText,
75886
+ section: setBox,
75887
+ getShowOffsetPanel: () => offsetsVisible,
75888
+ setShowOffsetPanel: setOffsetsVisible,
75889
+ getOffsetText: (field) => offsets[field],
75890
+ setOffsetText: setText,
75890
75891
  getAuto: () => auto,
75891
75892
  setAuto,
75892
75893
  validate
@@ -76000,6 +76001,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76000
76001
  isolation,
76001
76002
  camera: camera2,
76002
76003
  settings: settings2,
76004
+ sectionBox: sectionBox2,
76003
76005
  contextMenu: {
76004
76006
  customize: (v) => setcontextMenu(() => v)
76005
76007
  },
@@ -76465,7 +76467,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76465
76467
  props.viewer.selection.onValueChanged.subscribe(() => {
76466
76468
  setSelectState((i2) => (i2 + 1) % 2);
76467
76469
  });
76468
- props.onMount(createComponentRef(props.viewer, modal));
76470
+ props.onMount(createComponentRef(props.viewer, modal, sectionBox2));
76469
76471
  }, []);
76470
76472
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76471
76473
  /* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
@@ -76485,7 +76487,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76485
76487
  /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal })
76486
76488
  ] });
76487
76489
  }
76488
- function createComponentRef(viewer, modal) {
76490
+ function createComponentRef(viewer, modal, sectionBox2) {
76489
76491
  function load(source) {
76490
76492
  const request2 = viewer.loadVim(source);
76491
76493
  void updateProgress(request2, modal);
@@ -76505,6 +76507,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76505
76507
  return {
76506
76508
  viewer,
76507
76509
  modal,
76510
+ sectionBox: sectionBox2,
76508
76511
  dispose: () => {
76509
76512
  },
76510
76513
  load