@aptre/flex-layout 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +31 -10
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1671,7 +1671,15 @@ var TabSetNode = class _TabSetNode extends Node {
1671
1671
  }
1672
1672
  /** @internal */
1673
1673
  setContentRect(rect) {
1674
+ const changed = !this.contentRect.equals(rect);
1674
1675
  this.contentRect = rect;
1676
+ if (changed && rect.width > 0 && rect.height > 0) {
1677
+ for (const child of this.children) {
1678
+ if (child instanceof TabNode) {
1679
+ child.setRect(rect);
1680
+ }
1681
+ }
1682
+ }
1675
1683
  }
1676
1684
  /** @internal */
1677
1685
  getContentRect() {
@@ -3177,7 +3185,15 @@ var BorderNode = class _BorderNode extends Node {
3177
3185
  }
3178
3186
  /** @internal */
3179
3187
  setContentRect(r) {
3188
+ const changed = !this.contentRect.equals(r);
3180
3189
  this.contentRect = r;
3190
+ if (changed && r.width > 0 && r.height > 0) {
3191
+ for (const child of this.children) {
3192
+ if (child instanceof TabNode) {
3193
+ child.setRect(r);
3194
+ }
3195
+ }
3196
+ }
3181
3197
  }
3182
3198
  /** @internal */
3183
3199
  isEnableDrop() {
@@ -5922,11 +5938,13 @@ function TabContainer({
5922
5938
  style: {
5923
5939
  position: "absolute",
5924
5940
  inset: 0,
5925
- // CRITICAL: Disable pointer events during drag to prevent drag overlay from disappearing
5926
- // When tabs are rendered outside FlexLayout's DOM, dragging over them triggers dragleave
5927
- // on the Layout element, causing dragEnterCount to drop to 0 and clearing the drag UI.
5928
- pointerEvents: isDragging ? "none" : "auto",
5929
- // Ensure tab container doesn't block FlexLayout's tab bar interactions when not dragging
5941
+ // CRITICAL: The container itself always has pointer-events: none
5942
+ // so it doesn't block clicks on elements beneath it (like FlexLayout's tab bar).
5943
+ // Individual tab panels have pointer-events: auto to receive clicks.
5944
+ // During drag, we also disable pointer events on the children to prevent
5945
+ // dragleave events on the Layout element.
5946
+ pointerEvents: "none",
5947
+ // Ensure tab container doesn't block FlexLayout's tab bar interactions
5930
5948
  zIndex: 0
5931
5949
  },
5932
5950
  "data-layout-path": "/tab-container"
@@ -5934,6 +5952,7 @@ function TabContainer({
5934
5952
  Array.from(tabs.entries()).map(([nodeId, tabInfo]) => {
5935
5953
  const { node, rect, visible } = tabInfo;
5936
5954
  const contentClassName = node.getContentClassName();
5955
+ const hasValidDimensions = rect.width > 0 && rect.height > 0;
5937
5956
  return /* @__PURE__ */ React20.createElement(
5938
5957
  "div",
5939
5958
  {
@@ -5944,11 +5963,13 @@ function TabContainer({
5944
5963
  style: {
5945
5964
  position: "absolute",
5946
5965
  display: visible ? "flex" : "none",
5947
- left: rect.x,
5948
- top: rect.y,
5949
- width: rect.width,
5950
- height: rect.height,
5951
- overflow: "auto"
5966
+ left: hasValidDimensions ? rect.x : 0,
5967
+ top: hasValidDimensions ? rect.y : 0,
5968
+ width: hasValidDimensions ? rect.width : "100%",
5969
+ height: hasValidDimensions ? rect.height : "100%",
5970
+ overflow: "auto",
5971
+ // Tab panels receive pointer events when visible and not dragging
5972
+ pointerEvents: visible && !isDragging ? "auto" : "none"
5952
5973
  }
5953
5974
  },
5954
5975
  renderTab(node)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aptre/flex-layout",
3
3
  "author": "Caplin Systems Ltd",
4
4
  "description": "A multi-tab docking layout manager",
5
- "version": "0.4.0",
5
+ "version": "0.4.1",
6
6
  "license": "ISC",
7
7
  "repository": {
8
8
  "type": "git",