feat(backend): 添加流程模型与服务支持 feat(frontend): 实现流程编辑器UI与交互 feat(assets): 添加流程节点图标资源 feat(plugins): 实现上下文菜单和运行时插件 feat(components): 新增基础节点和侧边栏组件 feat(routes): 添加流程相关路由配置 feat(models): 创建流程和运行日志数据模型 feat(services): 实现流程服务层逻辑 feat(migration): 添加流程相关数据库迁移 feat(config): 更新前端配置支持流程编辑器 feat(utils): 增强axios错误处理和工具函数
28 lines
673 B
TypeScript
28 lines
673 B
TypeScript
/**
|
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
import { domUtils, injectable, Layer } from '@flowgram.ai/free-layout-editor';
|
|
|
|
import { VariablePanel } from './components/variable-panel';
|
|
|
|
@injectable()
|
|
export class VariablePanelLayer extends Layer {
|
|
onReady(): void {
|
|
// Fix variable panel in the right of canvas
|
|
this.config.onDataChange(() => {
|
|
const { scrollX, scrollY } = this.config.config;
|
|
domUtils.setStyle(this.node, {
|
|
position: 'absolute',
|
|
right: 25 - scrollX,
|
|
top: scrollY + 25,
|
|
});
|
|
});
|
|
}
|
|
|
|
render(): JSX.Element {
|
|
return <VariablePanel />;
|
|
}
|
|
}
|