fix(web): 构建与测试 - 修复会话类型和图标依赖兼容
This commit is contained in:
1 parent
48276e5560
commit
72d851c52b
10 files changed
+40
-1826
No files matched your search
@@ -0,0 +1,24 @@
|
||||
export const STORYBOARD_ROW_HEIGHT = 48;
|
||||
export const STORYBOARD_HEADER_HEIGHT = 124;
|
||||
|
||||
const STORYBOARD_ADD_ROW_HEIGHT = 36;
|
||||
export const STORYBOARD_COMPOSER_MIN_HEIGHT = 104;
|
||||
const STORYBOARD_COMPOSER_MAX_HEIGHT = 180;
|
||||
|
||||
// 布局计算属于画布领域逻辑,独立于 React 节点组件,避免纯函数测试加载完整 UI 依赖。
|
||||
function normalizedComposerHeight(composerHeight: number) {
|
||||
return Math.min(STORYBOARD_COMPOSER_MAX_HEIGHT, Math.max(STORYBOARD_COMPOSER_MIN_HEIGHT, composerHeight));
|
||||
}
|
||||
|
||||
export function storyboardNodeHeight(rowCount: number, composerHeight = STORYBOARD_COMPOSER_MIN_HEIGHT) {
|
||||
const visibleRows = Math.min(Math.max(rowCount, 1), 4);
|
||||
return STORYBOARD_HEADER_HEIGHT + visibleRows * STORYBOARD_ROW_HEIGHT + STORYBOARD_ADD_ROW_HEIGHT + normalizedComposerHeight(composerHeight);
|
||||
}
|
||||
|
||||
export function storyboardMinNodeHeight(composerHeight = STORYBOARD_COMPOSER_MIN_HEIGHT) {
|
||||
return STORYBOARD_HEADER_HEIGHT + STORYBOARD_ROW_HEIGHT + STORYBOARD_ADD_ROW_HEIGHT + normalizedComposerHeight(composerHeight);
|
||||
}
|
||||
|
||||
export function storyboardTableHeight(nodeHeight: number, composerHeight = STORYBOARD_COMPOSER_MIN_HEIGHT) {
|
||||
return Math.max(STORYBOARD_ROW_HEIGHT, nodeHeight - STORYBOARD_HEADER_HEIGHT - STORYBOARD_ADD_ROW_HEIGHT - normalizedComposerHeight(composerHeight));
|
||||
}
|
||||
Reference in new issue
Block a user