@tutti-os/workbench-surface 0.0.130 → 0.0.131
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.js +15 -19
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -906,28 +906,24 @@ function reduceWorkbenchState(state, action) {
|
|
|
906
906
|
if (state.surfaceSize.width === action.size.width && state.surfaceSize.height === action.size.height) {
|
|
907
907
|
return state;
|
|
908
908
|
}
|
|
909
|
+
const resizedNodes = state.nodes.map((node) => {
|
|
910
|
+
const frame = node.displayMode === "fullscreen" ? getWorkbenchFullscreenRect(
|
|
911
|
+
action.size,
|
|
912
|
+
state.layoutConstraints,
|
|
913
|
+
node.sizeConstraints
|
|
914
|
+
) : clampWorkbenchRectToVisibleArea(
|
|
915
|
+
node.frame,
|
|
916
|
+
action.size,
|
|
917
|
+
state.layoutConstraints,
|
|
918
|
+
void 0,
|
|
919
|
+
node.sizeConstraints
|
|
920
|
+
);
|
|
921
|
+
return rectsEqual(node.frame, frame) ? node : { ...node, frame };
|
|
922
|
+
});
|
|
909
923
|
const resizedState = {
|
|
910
924
|
...state,
|
|
911
925
|
surfaceSize: action.size,
|
|
912
|
-
nodes: state.nodes.
|
|
913
|
-
(node) => node.displayMode === "fullscreen" ? {
|
|
914
|
-
...node,
|
|
915
|
-
frame: getWorkbenchFullscreenRect(
|
|
916
|
-
action.size,
|
|
917
|
-
state.layoutConstraints,
|
|
918
|
-
node.sizeConstraints
|
|
919
|
-
)
|
|
920
|
-
} : {
|
|
921
|
-
...node,
|
|
922
|
-
frame: clampWorkbenchRectToVisibleArea(
|
|
923
|
-
node.frame,
|
|
924
|
-
action.size,
|
|
925
|
-
state.layoutConstraints,
|
|
926
|
-
void 0,
|
|
927
|
-
node.sizeConstraints
|
|
928
|
-
)
|
|
929
|
-
}
|
|
930
|
-
)
|
|
926
|
+
nodes: resizedNodes.every((node, index) => node === state.nodes[index]) ? state.nodes : resizedNodes
|
|
931
927
|
};
|
|
932
928
|
if (state.lockedLayout && state.lockedLayout.nodeIDs.length >= 2) {
|
|
933
929
|
if (state.lockedLayout.normalizedFrames) {
|