dockview-react 8.8.1 → 8.8.2

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-react
3
- * @version 8.8.1
3
+ * @version 8.8.2
4
4
  * @link https://github.com/dockview/dockview
5
5
  * @license MIT
6
6
  */
@@ -51,7 +51,7 @@ react_dom = __toESM(react_dom);
51
51
  //#region ../dockview-core/dist/package/main.esm.mjs
52
52
  /**
53
53
  * dockview-core
54
- * @version 8.8.1
54
+ * @version 8.8.2
55
55
  * @link https://github.com/dockview/dockview
56
56
  * @license MIT
57
57
  */
@@ -14566,6 +14566,15 @@ react_dom = __toESM(react_dom);
14566
14566
  * if it were, since no frame carries this id.
14567
14567
  */
14568
14568
  const SCHEDULED = -1;
14569
+ /**
14570
+ * A collapsed edge group's content container is `display: none` (0x0) while
14571
+ * collapsed. Edge collapse fires no visibility event, so this is read from the
14572
+ * group rather than `panel.api.isVisible`.
14573
+ */
14574
+ function isInCollapsedEdgeGroup(panel) {
14575
+ const api = panel.group.api;
14576
+ return api.location.type === "edge" && api.isCollapsed();
14577
+ }
14569
14578
  function createFocusableElement() {
14570
14579
  const element = document.createElement("div");
14571
14580
  element.tabIndex = -1;
@@ -14644,6 +14653,7 @@ react_dom = __toESM(react_dom);
14644
14653
  return false;
14645
14654
  }
14646
14655
  attach(options) {
14656
+ var _panel$group$api$onDi, _panel$group$api$onDi2, _panel$group$api;
14647
14657
  const { panel, referenceContainer } = options;
14648
14658
  if (!this.map[panel.api.id]) {
14649
14659
  const element = createFocusableElement();
@@ -14672,10 +14682,10 @@ react_dom = __toESM(react_dom);
14672
14682
  * deliberately leaves scheduled work alone: `repositionPanelOverlay`
14673
14683
  * (the auto-hide peek) schedules a frame carrying the sticky
14674
14684
  * `forceVisible`/`clip` state which `attach` does not re-apply, and a
14675
- * peeked panel's `api.isVisible` is false — so discarding that frame
14676
- * leaves `visibilityChanged` to hide the overlay and the peek renders
14677
- * nothing. A newly created entry already holds a fresh generation, so
14678
- * the stale closures a `detatch` left behind are fenced off either way.
14685
+ * peeked panel's group is collapsed — so discarding that frame leaves
14686
+ * the frame pass to hide the overlay and the peek renders nothing. A
14687
+ * newly created entry already holds a fresh generation, so the stale
14688
+ * closures a `detatch` left behind are fenced off either way.
14679
14689
  */
14680
14690
  if (mapEntry.referenceContainer !== referenceContainer) {
14681
14691
  mapEntry.generation = ++this._generation;
@@ -14692,8 +14702,17 @@ react_dom = __toESM(react_dom);
14692
14702
  * positioned has no left/top/width/height, and `.dv-render-overlay`
14693
14703
  * defaults to 100%/100% — retaining "previous" geometry there would
14694
14704
  * pin the content over the whole container.
14705
+ *
14706
+ * A collapsed edge group's 0x0 is a real collapse, not a pending
14707
+ * layout, so nothing is retained and the overlay hides at once
14708
+ * rather than staying painted at its old box until the next frame.
14695
14709
  */
14696
- mapEntry.retainPreviousGeometry = mapEntry.positioned;
14710
+ const collapsedEdge = isInCollapsedEdgeGroup(panel);
14711
+ mapEntry.retainPreviousGeometry = mapEntry.positioned && !collapsedEdge;
14712
+ if (collapsedEdge && !mapEntry.forceVisible) {
14713
+ mapEntry.element.style.visibility = "hidden";
14714
+ mapEntry.element.style.pointerEvents = "none";
14715
+ }
14697
14716
  }
14698
14717
  const generation = mapEntry.generation;
14699
14718
  const focusContainer = mapEntry.element;
@@ -14748,18 +14767,30 @@ react_dom = __toESM(react_dom);
14748
14767
  if (this.isDisposed || (entry === null || entry === void 0 ? void 0 : entry.generation) !== generation) return;
14749
14768
  const forceVisible = (_entry$forceVisible = entry.forceVisible) !== null && _entry$forceVisible !== void 0 ? _entry$forceVisible : false;
14750
14769
  const clip = entry.clip;
14770
+ const collapsedEdge = isInCollapsedEdgeGroup(panel);
14771
+ const hidden = !forceVisible && (!panel.api.isVisible || collapsedEdge);
14751
14772
  const box = this.positionCache.getPosition(referenceContainer.element);
14752
14773
  const box2 = this.positionCache.getPosition(this.element);
14753
14774
  const left = box.left - box2.left;
14754
14775
  const top = box.top - box2.top;
14755
14776
  const width = box.width;
14756
14777
  const height = box.height;
14757
- if (entry.retainPreviousGeometry && (width === 0 || height === 0)) {
14758
- if (!panel.api.isVisible && !forceVisible) {
14778
+ if (width === 0 || height === 0) {
14779
+ if (collapsedEdge && !forceVisible) {
14780
+ entry.retainPreviousGeometry = false;
14759
14781
  focusContainer.style.visibility = "hidden";
14760
14782
  focusContainer.style.pointerEvents = "none";
14783
+ focusContainer.style.clipPath = "";
14784
+ focusContainer.style.zIndex = "";
14785
+ return;
14786
+ }
14787
+ if (entry.retainPreviousGeometry) {
14788
+ if (hidden) {
14789
+ focusContainer.style.visibility = "hidden";
14790
+ focusContainer.style.pointerEvents = "none";
14791
+ }
14792
+ return;
14761
14793
  }
14762
- return;
14763
14794
  }
14764
14795
  entry.retainPreviousGeometry = false;
14765
14796
  entry.positioned = true;
@@ -14767,7 +14798,7 @@ react_dom = __toESM(react_dom);
14767
14798
  setPixels(focusContainer.style, "top", top);
14768
14799
  setPixels(focusContainer.style, "width", width);
14769
14800
  setPixels(focusContainer.style, "height", height);
14770
- if (panel.api.isVisible || forceVisible) {
14801
+ if (!hidden) {
14771
14802
  focusContainer.style.visibility = "";
14772
14803
  focusContainer.style.pointerEvents = "";
14773
14804
  } else {
@@ -14794,8 +14825,10 @@ react_dom = __toESM(react_dom);
14794
14825
  if (scheduling.pendingUpdate === SCHEDULED) scheduling.pendingUpdate = handle;
14795
14826
  };
14796
14827
  const visibilityChanged = () => {
14797
- if (panel.api.isVisible) {
14798
- var _this$map$panel$api$i;
14828
+ var _this$map$panel$api$i;
14829
+ const collapsedEdge = !((_this$map$panel$api$i = this.map[panel.api.id]) === null || _this$map$panel$api$i === void 0 ? void 0 : _this$map$panel$api$i.forceVisible) && isInCollapsedEdgeGroup(panel);
14830
+ if (panel.api.isVisible && !collapsedEdge) {
14831
+ var _this$map$panel$api$i2;
14799
14832
  this.positionCache.invalidate();
14800
14833
  resize();
14801
14834
  /**
@@ -14814,7 +14847,7 @@ react_dom = __toESM(react_dom);
14814
14847
  * stale-but-real geometry for a frame is the deliberate
14815
14848
  * trade-off against blanking the panel for the whole rebuild.
14816
14849
  */
14817
- if ((_this$map$panel$api$i = this.map[panel.api.id]) === null || _this$map$panel$api$i === void 0 ? void 0 : _this$map$panel$api$i.retainPreviousGeometry) focusContainer.style.visibility = "";
14850
+ if ((_this$map$panel$api$i2 = this.map[panel.api.id]) === null || _this$map$panel$api$i2 === void 0 ? void 0 : _this$map$panel$api$i2.retainPreviousGeometry) focusContainer.style.visibility = "";
14818
14851
  focusContainer.style.pointerEvents = "";
14819
14852
  } else {
14820
14853
  focusContainer.style.visibility = "hidden";
@@ -14882,6 +14915,10 @@ react_dom = __toESM(react_dom);
14882
14915
  if (!panel.api.isVisible) return;
14883
14916
  resize();
14884
14917
  }),
14918
+ (_panel$group$api$onDi = (_panel$group$api$onDi2 = (_panel$group$api = panel.group.api).onDidCollapsedChange) === null || _panel$group$api$onDi2 === void 0 ? void 0 : _panel$group$api$onDi2.call(_panel$group$api, () => {
14919
+ this.positionCache.invalidate();
14920
+ resize();
14921
+ })) !== null && _panel$group$api$onDi !== void 0 ? _panel$group$api$onDi : Disposable.NONE,
14885
14922
  referenceContainer.onDidDimensionsChange((size) => {
14886
14923
  applySize(size);
14887
14924
  }),