waveterm/frontend/layout/index.ts
Evan Simkowitz c892c39a73
Fix block content sizing (#280)
Make the block content sizing update once when its node moves or becomes
magnified. By manually updating this inner sizing rather than letting
the block flow in the DOM, the animations of the block frames are much
smoother.

This also fixes an issue where two scrollbars were being rendered for
the Directory Preview widget.

This also sets zero padding on nodes when there's only a single node
being rendered.
2024-08-27 13:41:36 -07:00

71 lines
1.9 KiB
TypeScript

// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import { TileLayout } from "./lib/TileLayout";
import { LayoutModel } from "./lib/layoutModel";
import {
deleteLayoutModelForTab,
getLayoutModelForActiveTab,
getLayoutModelForTab,
getLayoutModelForTabById,
useDebouncedNodeInnerRect,
useLayoutModel,
} from "./lib/layoutModelHooks";
import { newLayoutNode } from "./lib/layoutNode";
import type {
ContentRenderer,
LayoutNode,
LayoutTreeAction,
LayoutTreeClearPendingAction,
LayoutTreeCommitPendingAction,
LayoutTreeComputeMoveNodeAction,
LayoutTreeDeleteNodeAction,
LayoutTreeFocusNodeAction,
LayoutTreeInsertNodeAction,
LayoutTreeInsertNodeAtIndexAction,
LayoutTreeMagnifyNodeToggleAction,
LayoutTreeMoveNodeAction,
LayoutTreeResizeNodeAction,
LayoutTreeSetPendingAction,
LayoutTreeStateSetter,
LayoutTreeSwapNodeAction,
NodeModel,
PreviewRenderer,
} from "./lib/types";
import { DropDirection, LayoutTreeActionType, NavigateDirection } from "./lib/types";
export {
deleteLayoutModelForTab,
DropDirection,
getLayoutModelForActiveTab,
getLayoutModelForTab,
getLayoutModelForTabById,
LayoutModel,
LayoutTreeActionType,
NavigateDirection,
newLayoutNode,
TileLayout,
useDebouncedNodeInnerRect,
useLayoutModel,
};
export type {
ContentRenderer,
LayoutNode,
LayoutTreeAction,
LayoutTreeClearPendingAction,
LayoutTreeCommitPendingAction,
LayoutTreeComputeMoveNodeAction,
LayoutTreeDeleteNodeAction,
LayoutTreeFocusNodeAction,
LayoutTreeInsertNodeAction,
LayoutTreeInsertNodeAtIndexAction,
LayoutTreeMagnifyNodeToggleAction,
LayoutTreeMoveNodeAction,
LayoutTreeResizeNodeAction,
LayoutTreeSetPendingAction,
LayoutTreeStateSetter,
LayoutTreeSwapNodeAction,
NodeModel,
PreviewRenderer,
};