vim-web 0.3.44-dev.7 → 0.3.44-dev.9

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
@@ -67862,9 +67862,9 @@ function controlBarSectionBox(section, hasSelection) {
67862
67862
  id: elementIds.buttonSectionBoxSettings,
67863
67863
  tip: "Section Settings",
67864
67864
  enabled: () => section.getEnable(),
67865
- isOn: () => section.getOffsetVisible(),
67865
+ isOn: () => section.getShowOffsetPanel(),
67866
67866
  style: (on) => buttonDefaultStyle(on),
67867
- action: () => section.setOffsetsVisible(!section.getOffsetVisible()),
67867
+ action: () => section.setShowOffsetPanel(!section.getShowOffsetPanel()),
67868
67868
  icon: slidersHoriz
67869
67869
  }
67870
67870
  ]
@@ -75717,8 +75717,8 @@ function SectionBoxPanel(props) {
75717
75717
  resizeObserver.disconnect();
75718
75718
  }
75719
75719
  };
75720
- }, [props.state.getOffsetVisible()]);
75721
- if (!props.state.getOffsetVisible()) return null;
75720
+ }, [props.state.getShowOffsetPanel()]);
75721
+ if (!props.state.getShowOffsetPanel()) return null;
75722
75722
  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: [
75723
75723
  /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: label }),
75724
75724
  /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -75726,8 +75726,8 @@ function SectionBoxPanel(props) {
75726
75726
  {
75727
75727
  id: id2,
75728
75728
  type: "text",
75729
- value: props.state.getText(field),
75730
- onChange: (e) => props.state.setText(field, e.target.value),
75729
+ value: props.state.getOffsetText(field),
75730
+ onChange: (e) => props.state.setOffsetText(field, e.target.value),
75731
75731
  className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
75732
75732
  onBlur: () => props.state.validate(field)
75733
75733
  }
@@ -75751,7 +75751,7 @@ function SectionBoxPanel(props) {
75751
75751
  "button",
75752
75752
  {
75753
75753
  className: "vc-flex vc-border-none vc-bg-transparent vc-text-sm vc-cursor-pointer",
75754
- onClick: () => props.state.setOffsetsVisible(false),
75754
+ onClick: () => props.state.setShowOffsetPanel(false),
75755
75755
  children: close({ height: 12, width: 12, fill: "currentColor" })
75756
75756
  }
75757
75757
  )
@@ -75809,17 +75809,6 @@ function useSectionBox(adapter) {
75809
75809
  });
75810
75810
  const boxRef = useRef(adapter.getBox());
75811
75811
  const offsetBox = useMemo(() => offsetsToBox3(offsets), [offsets]);
75812
- useEffect(() => {
75813
- setVisible(enable);
75814
- setAuto(false);
75815
- setOffsetsVisible(false);
75816
- setOffsets({
75817
- topOffset: "1",
75818
- sideOffset: "1",
75819
- bottomOffset: "1"
75820
- });
75821
- void resetBox();
75822
- }, [enable]);
75823
75812
  useEffect(() => {
75824
75813
  if (auto) sectionSelection();
75825
75814
  return auto ? adapter.onSelectionChanged.sub(sectionSelection) : () => {
@@ -75861,18 +75850,33 @@ function useSectionBox(adapter) {
75861
75850
  setBox(box);
75862
75851
  };
75863
75852
  return {
75864
- setEnable,
75853
+ setEnable: (v) => {
75854
+ setEnable(v);
75855
+ setVisible(v);
75856
+ setAuto(false);
75857
+ setOffsetsVisible(false);
75858
+ setOffsets({
75859
+ topOffset: "1",
75860
+ sideOffset: "1",
75861
+ bottomOffset: "1"
75862
+ });
75863
+ void resetBox();
75864
+ },
75865
75865
  getEnable: () => enable,
75866
75866
  getVisible: () => visible2,
75867
75867
  setVisible,
75868
75868
  sectionSelection,
75869
75869
  sectionReset: resetBox,
75870
- getOffsetVisible: () => offsetsVisible,
75871
- setOffsetsVisible,
75872
- getText: (field) => offsets[field],
75873
- setText,
75870
+ section: setBox,
75871
+ getShowOffsetPanel: () => offsetsVisible,
75872
+ setShowOffsetPanel: setOffsetsVisible,
75873
+ getOffsetText: (field) => offsets[field],
75874
+ setOffsetText: setText,
75874
75875
  getAuto: () => auto,
75875
- setAuto,
75876
+ setAuto: (v) => {
75877
+ console.log("auto", v);
75878
+ setAuto(v);
75879
+ },
75876
75880
  validate
75877
75881
  };
75878
75882
  }