@aptre/flex-layout 0.4.1 → 0.4.3

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/index.mjs CHANGED
@@ -4515,9 +4515,12 @@ var TabSet = (props) => {
4515
4515
  node.setTabStripRect(layout.getBoundingClientRect(tabStripRef.current));
4516
4516
  }
4517
4517
  const newContentRect = Rect.getContentRect(contentRef.current).relativeTo(layout.getDomRect());
4518
- if (!node.getContentRect().equals(newContentRect)) {
4518
+ const oldContentRect = node.getContentRect();
4519
+ if (!oldContentRect.equals(newContentRect)) {
4519
4520
  node.setContentRect(newContentRect);
4520
- if (!isFirstRender.current) {
4521
+ const oldWasEmpty = oldContentRect.width === 0 && oldContentRect.height === 0;
4522
+ const shouldRedraw = !isFirstRender.current || oldWasEmpty;
4523
+ if (shouldRedraw) {
4521
4524
  layout.redrawInternal("tabset content rect " + newContentRect);
4522
4525
  }
4523
4526
  }
@@ -6044,7 +6047,7 @@ function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange,
6044
6047
  [handleRectChange, handleVisibilityChange]
6045
6048
  );
6046
6049
  const tabsForContainer = useMemo(() => tabs, [tabs]);
6047
- return /* @__PURE__ */ React20.createElement("div", { style: { position: "relative", width: "100%", height: "100%" } }, /* @__PURE__ */ React20.createElement(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, ...layoutProps }), /* @__PURE__ */ React20.createElement(TabContainer, { tabs: tabsForContainer, renderTab, isDragging, classNameMapper }));
6050
+ return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, ...layoutProps }), /* @__PURE__ */ React20.createElement(TabContainer, { tabs: tabsForContainer, renderTab, isDragging, classNameMapper }));
6048
6051
  }
6049
6052
 
6050
6053
  // src/model/walk.ts
@@ -1,8 +1 @@
1
- declare const localStorageMock: {
2
- getItem: (key: string) => string;
3
- setItem: (key: string, value: string) => void;
4
- removeItem: (key: string) => void;
5
- clear: () => void;
6
- readonly length: number;
7
- key: (index: number) => string;
8
- };
1
+ import "../../style/light.css";
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.1",
5
+ "version": "0.4.3",
6
6
  "license": "ISC",
7
7
  "repository": {
8
8
  "type": "git",