| 377 | } |
| 378 | |
| 379 | export function resizeNode(layoutState: LayoutTreeState, action: LayoutTreeResizeNodeAction) { |
| 380 | if (!action.resizeOperations) { |
| 381 | console.error("invalid resizeNode operation. nodeSizes array must be defined."); |
| 382 | } |
| 383 | for (const resize of action.resizeOperations) { |
| 384 | if (!resize.nodeId || resize.size < 0 || resize.size > 100) { |
| 385 | console.error("invalid resizeNode operation. nodeId must be defined and size must be between 0 and 100"); |
| 386 | return; |
| 387 | } |
| 388 | const node = findNode(layoutState.rootNode, resize.nodeId); |
| 389 | node.size = resize.size; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | export function focusNode(layoutState: LayoutTreeState, action: LayoutTreeFocusNodeAction) { |
| 394 | if (!action.nodeId) { |