vim-web 0.3.44-dev.71 → 0.3.44-dev.73

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
@@ -74567,6 +74567,26 @@ async function getFamilyTypeNameMap(document2) {
74567
74567
  })
74568
74568
  );
74569
74569
  }
74570
+ class MutableState {
74571
+ constructor(initial) {
74572
+ __publicField(this, "_value");
74573
+ __publicField(this, "_onChange", new distExports.SimpleEventDispatcher());
74574
+ this._value = initial;
74575
+ }
74576
+ get() {
74577
+ return this._value;
74578
+ }
74579
+ set(value) {
74580
+ if (value === this._value) return;
74581
+ this._value = value;
74582
+ this._onChange.dispatch(value);
74583
+ }
74584
+ confirm() {
74585
+ }
74586
+ get onChange() {
74587
+ return this._onChange.asEvent();
74588
+ }
74589
+ }
74570
74590
  function useRefresher() {
74571
74591
  const [refresh, setRefresh] = useState(false);
74572
74592
  return {
@@ -74801,6 +74821,7 @@ function useArgFuncRef(fn) {
74801
74821
  }
74802
74822
  const reactUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74803
74823
  __proto__: null,
74824
+ MutableState,
74804
74825
  useActionRef,
74805
74826
  useArgActionRef,
74806
74827
  useArgFuncRef,
@@ -75704,6 +75725,24 @@ function GenericBoolField(props) {
75704
75725
  }
75705
75726
  );
75706
75727
  }
75728
+ function useCustomizer(baseEntries, ref) {
75729
+ const customization = useRef();
75730
+ const [entries, setEntries] = useState(baseEntries);
75731
+ const applyCustomization = () => {
75732
+ setEntries(customization.current ? customization.current(baseEntries) : baseEntries);
75733
+ };
75734
+ const setCustomization = (fn) => {
75735
+ customization.current = fn;
75736
+ applyCustomization();
75737
+ };
75738
+ useEffect(() => {
75739
+ applyCustomization();
75740
+ }, [baseEntries]);
75741
+ useImperativeHandle(ref, () => ({
75742
+ customize: setCustomization
75743
+ }));
75744
+ return entries;
75745
+ }
75707
75746
  const GenericPanel = forwardRef((props, ref) => {
75708
75747
  const panelRef = useRef(null);
75709
75748
  const panelPosition = useFloatingPanelPosition(
@@ -75742,24 +75781,6 @@ const GenericPanel = forwardRef((props, ref) => {
75742
75781
  }
75743
75782
  ) });
75744
75783
  });
75745
- function useCustomizer(baseEntries, ref) {
75746
- const customization = useRef();
75747
- const [entries, setEntries] = useState(baseEntries);
75748
- const applyCustomization = () => {
75749
- setEntries(customization.current ? customization.current(baseEntries) : baseEntries);
75750
- };
75751
- const setCustomization = (fn) => {
75752
- customization.current = fn;
75753
- applyCustomization();
75754
- };
75755
- useEffect(() => {
75756
- applyCustomization();
75757
- }, [baseEntries]);
75758
- useImperativeHandle(ref, () => ({
75759
- customize: setCustomization
75760
- }));
75761
- return entries;
75762
- }
75763
75784
  const SectionBoxPanel = forwardRef(
75764
75785
  (props, ref) => {
75765
75786
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -76120,8 +76141,8 @@ function Viewer$1(props) {
76120
76141
  const settings2 = useSettings(props.viewer, props.settings ?? {});
76121
76142
  const modal = useRef(null);
76122
76143
  const sectionBoxRef = useWebglSectionBox(props.viewer);
76123
- const isolationPanelRef = useRef(null);
76124
- const sectionBoxPanelRef = useRef(null);
76144
+ const isolationPanelHandle = useRef(null);
76145
+ const sectionBoxPanelHandle = useRef(null);
76125
76146
  const camera2 = useWebglCamera(props.viewer, sectionBoxRef);
76126
76147
  const cursor = useMemo(() => new CursorManager(props.viewer), []);
76127
76148
  const loader = useRef(new ComponentLoader(props.viewer, modal));
@@ -76158,10 +76179,10 @@ function Viewer$1(props) {
76158
76179
  camera: camera2,
76159
76180
  settings: settings2,
76160
76181
  get isolationPanel() {
76161
- return isolationPanelRef.current;
76182
+ return isolationPanelHandle.current;
76162
76183
  },
76163
76184
  get sectionBoxPanel() {
76164
- return sectionBoxPanelRef.current;
76185
+ return sectionBoxPanelHandle.current;
76165
76186
  },
76166
76187
  get sectionBox() {
76167
76188
  return sectionBoxRef;
@@ -76230,8 +76251,8 @@ function Viewer$1(props) {
76230
76251
  show: isTrue(settings2.value.ui.controlBar)
76231
76252
  }
76232
76253
  ),
76233
- /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { ref: sectionBoxPanelRef, state: sectionBoxRef }),
76234
- /* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel, { ref: isolationPanelRef, state: isolationRef }),
76254
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { ref: sectionBoxPanelHandle, state: sectionBoxRef }),
76255
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel, { ref: isolationPanelHandle, state: isolationRef }),
76235
76256
  /* @__PURE__ */ jsxRuntimeExports.jsx(
76236
76257
  AxesPanelMemo,
76237
76258
  {
@@ -76509,9 +76530,11 @@ function createViewer(container) {
76509
76530
  return promise;
76510
76531
  }
76511
76532
  function Viewer3(props) {
76512
- const modal = useRef(null);
76513
76533
  const sectionBox2 = useUltraSectionBox(props.core);
76514
76534
  const camera2 = useUltraCamera(props.core, sectionBox2);
76535
+ const isolationPanelHandle = useRef(null);
76536
+ const sectionBoxPanelHandle = useRef(null);
76537
+ const modalHandle = useRef(null);
76515
76538
  const side = useSideState(true, 400);
76516
76539
  const [_, setSelectState] = useState(0);
76517
76540
  const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
@@ -76519,24 +76542,30 @@ function Viewer3(props) {
76519
76542
  const controlBar = useUltraControlBar(props.core, sectionBox2, isolation, camera2, (_2) => _2);
76520
76543
  useViewerInput(props.core.inputs, camera2);
76521
76544
  useEffect(() => {
76522
- props.core.onStateChanged.subscribe((state) => updateModal(modal, state));
76545
+ props.core.onStateChanged.subscribe((state) => updateModal(modalHandle, state));
76523
76546
  props.core.selection.onSelectionChanged.subscribe(() => {
76524
76547
  setSelectState((i) => (i + 1) % 2);
76525
76548
  });
76526
76549
  props.onMount({
76527
76550
  core: props.core,
76528
76551
  get modal() {
76529
- return modal.current;
76552
+ return modalHandle.current;
76530
76553
  },
76531
76554
  isolation,
76532
76555
  sectionBox: sectionBox2,
76533
76556
  camera: camera2,
76557
+ get isolationPanel() {
76558
+ return isolationPanelHandle.current;
76559
+ },
76560
+ get sectionBoxPanel() {
76561
+ return sectionBoxPanelHandle.current;
76562
+ },
76534
76563
  dispose: () => {
76535
76564
  },
76536
76565
  controlBar: {
76537
76566
  customize: (v) => setControlBarCustom(() => v)
76538
76567
  },
76539
- load: patchLoad(props.core, modal)
76568
+ load: patchLoad(props.core, modalHandle)
76540
76569
  });
76541
76570
  }, []);
76542
76571
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -76551,11 +76580,11 @@ function Viewer3(props) {
76551
76580
  show: true
76552
76581
  }
76553
76582
  ),
76554
- /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 }),
76555
- /* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel, { state: isolation })
76583
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { ref: sectionBoxPanelHandle, state: sectionBox2 }),
76584
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel, { ref: isolationPanelHandle, state: isolation })
76556
76585
  ] });
76557
76586
  } }),
76558
- /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ref: modal, canFollowLinks: true }),
76587
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ref: modalHandle, canFollowLinks: true }),
76559
76588
  /* @__PURE__ */ jsxRuntimeExports.jsx(
76560
76589
  ReactTooltip,
76561
76590
  {