chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -30,56 +30,56 @@ import { getStoreNode } from '../utils';
|
||||
|
||||
export interface NodeRenderReturnType {
|
||||
/**
|
||||
* 当前节点 (如果是 icon 则会返回它的父节点)
|
||||
* The current node (if it is an icon, it will return its parent node)
|
||||
*/
|
||||
node: FlowNodeEntity;
|
||||
/**
|
||||
* 节点是否激活
|
||||
* Is the node active?
|
||||
*/
|
||||
activated: boolean;
|
||||
/**
|
||||
* 节点是否展开
|
||||
* Is the node expanded?
|
||||
*/
|
||||
expanded: boolean;
|
||||
/**
|
||||
* 鼠标进入, 主要用于控制 activated 状态
|
||||
* Mouse entry, mainly used to control the activated state
|
||||
*/
|
||||
onMouseEnter: (e: React.MouseEvent) => void;
|
||||
/**
|
||||
* 鼠标离开, 主要用于控制 activated 状态
|
||||
* The mouse leaves, mainly used to control the activated state
|
||||
*/
|
||||
onMouseLeave: (e: React.MouseEvent) => void;
|
||||
|
||||
/**
|
||||
* 渲染表单,只有节点引擎开启才能使用
|
||||
* Render the form, which can only be used if the node engine is turned on
|
||||
*/
|
||||
form: NodeFormProps<any> | undefined;
|
||||
|
||||
/**
|
||||
* 获取节点的扩展数据
|
||||
* Get the extended data of the node
|
||||
*/
|
||||
getExtInfo<T = any>(): T;
|
||||
|
||||
/**
|
||||
* 更新节点的扩展数据
|
||||
* Update the extended data of the node
|
||||
* @param extInfo
|
||||
*/
|
||||
updateExtInfo<T = any>(extInfo: T): void;
|
||||
|
||||
/**
|
||||
* 展开/收起节点
|
||||
* Expand/Collapse Nodes
|
||||
* @param expanded
|
||||
*/
|
||||
toggleExpand(): void;
|
||||
/**
|
||||
* 全局 readonly 状态
|
||||
* Global readonly state
|
||||
*/
|
||||
readonly: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义 useNodeRender
|
||||
* 不区分 blockIcon 和 inlineBlocks
|
||||
* Custom useNodeRender
|
||||
* Do not distinguish between blockIcon and inlineBlocks
|
||||
*/
|
||||
export function useCustomNodeRender(
|
||||
nodeFromProps?: FlowNodeEntity,
|
||||
|
||||
@@ -50,13 +50,13 @@ export const useEditorProps = (data?: any, json?: any) =>
|
||||
[FlowRendererKey.BRANCH_ADDER]: () => null,
|
||||
[FlowRendererKey.DRAG_NODE]: () => null,
|
||||
},
|
||||
renderDefaultNode: BaseNode, // 节点渲染
|
||||
renderDefaultNode: BaseNode, // Node rendering
|
||||
},
|
||||
onReady(ctx) {
|
||||
const treeService = ctx.get<TreeService>(TreeService);
|
||||
treeService.transformSchema(json);
|
||||
treeService.treeToFlowNodeJson();
|
||||
// 强制 resize 生效
|
||||
// Forced resizing takes effect
|
||||
setTimeout(() => {
|
||||
ctx.playground.resize();
|
||||
}, 100);
|
||||
@@ -67,12 +67,12 @@ export const useEditorProps = (data?: any, json?: any) =>
|
||||
},
|
||||
plugins: () => [
|
||||
/**
|
||||
* 自定义线条插件
|
||||
* Custom Line Plugin
|
||||
*/
|
||||
createCustomLinesPlugin({}),
|
||||
/**
|
||||
* Minimap plugin
|
||||
* 缩略图插件
|
||||
* Thumbnail plugin
|
||||
*/
|
||||
createMinimapPlugin({
|
||||
disableLayer: true,
|
||||
|
||||
Reference in New Issue
Block a user