xiamidaxia 3 месяцев назад
Родитель
Сommit
dd6ae25479

+ 19 - 11
apps/demo-free-layout/src/components/node-menu/index.tsx

@@ -85,18 +85,26 @@ export const NodeMenu: FC<NodeMenuProps> = ({ node, deleteNode, updateTitleEdit
     },
     [clientContext, node]
   );
-  const handleEditTitle = useCallback(() => {
-    updateTitleEdit(true);
-  }, [updateTitleEdit]);
+  const handleEditTitle = useCallback(
+    (e: React.MouseEvent) => {
+      updateTitleEdit(true);
+      e.stopPropagation(); // Disable clicking prevents the sidebar from opening
+    },
+    [updateTitleEdit]
+  );
 
-  const handleAutoLayout = useCallback(async () => {
-    await tools.autoLayout({
-      containerNode: node,
-      enableAnimation: true,
-      animationDuration: 1000,
-      disableFitView: true,
-    });
-  }, [tools]);
+  const handleAutoLayout = useCallback(
+    (e: React.MouseEvent) => {
+      e.stopPropagation(); // Disable clicking prevents the sidebar from opening
+      tools.autoLayout({
+        containerNode: node,
+        enableAnimation: true,
+        animationDuration: 1000,
+        disableFitView: true,
+      });
+    },
+    [tools]
+  );
 
   if (!visible) {
     return <></>;

+ 1 - 1
apps/docs/src/en/api/core/flow-node-entity.mdx

@@ -28,7 +28,7 @@ Node entity, `WorkflowNodeEntity` is the alias for the node used for free layout
 - form: [NodeFormProps](https://flowgram.ai/auto-docs/editor/interfaces/NodeFormProps.html) Get the node's form data, like [getNodeForm](/api/utils/get-node-form.html)
 - scope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) Get the node's variable public scope
 - privateScope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) Get the node's variable private scope
-- line: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) Get the node's lines data (Only FreeLayout)
+- lines: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) Get the node's lines data (Only FreeLayout)
 - ports: [WorkflowNodePortsData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodePortsData.html) Get the node's ports data (Only FreeLayout)
 
 

+ 2 - 2
apps/docs/src/en/guide/advanced/fixed-layout/node.mdx

@@ -17,12 +17,12 @@ Nodes are defined through [FlowNodeEntity](/api/core/flow-node-entity.html)
 - originParent: `FlowNodeEntity | undefined` Get the original parent node, this is used to find the entire virtual branch for the first node of the fixed layout branch (orderIcon)
 - allChildren: `FlowNodeEntity[]` Get all child nodes, not including collapsed child nodes
 - document: [FlowDocument](/api/core/flow-document.html) Document link
-- transform: [FlowNodeTransformData](https://flowgram.ai/auto-docs/document/classes/FlowNodeTransformData.html) Get the ndoe's transform data
+- transform: [FlowNodeTransformData](https://flowgram.ai/auto-docs/document/classes/FlowNodeTransformData.html) Get the node's transform data
 - renderData: [FlowNodeRenderData](https://flowgram.ai/auto-docs/document/classes/FlowNodeRenderData.html) Get the node's render data, including render status
 - form: [NodeFormProps](https://flowgram.ai/auto-docs/editor/interfaces/NodeFormProps.html) Get the node's form data, like [getNodeForm](/api/utils/get-node-form.html)
 - scope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) Get the node's variable public scope
 - privateScope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) Get the node's variable private scope
-- getNodeRegistry(): [WorkflowNodeRegistry](https://flowgram.ai/auto-docs/free-layout-core/interfaces/WorkflowNodeRegistry) Get the node's registry
+- getNodeRegistry(): [FlowNodeRegistry](https://flowgram.ai/auto-docs/document/interfaces/FlowNodeRegistry-1) Get the node's registry
 - getService(): Get the [IOC](/guide/concepts/ioc.html) Service, such as`node.getService(HistoryService)`
 - getExtInfo(): Get the node's ext info, such as `node.getExtInfo<{ test: string }>()`
 - updateExtInfo(): Update the node's ext info, such as `node.updateExtInfo<{ test: string }>({ test: 'test' })`

+ 2 - 2
apps/docs/src/en/guide/advanced/free-layout/node.mdx

@@ -10,12 +10,12 @@ Nodes are defined through [FlowNodeEntity](/api/core/flow-node-entity.html)
 - blocks: `FlowNodeEntity[]` Get child nodes, including collapsed child nodes
 - parent: `FlowNodeEntity | undefined` Get the parent node (Such as loop)
 - document: [WorkflowDocument](/api/core/workflow-document.html) Document link
-- transform: [FlowNodeTransformData](https://flowgram.ai/auto-docs/document/classes/FlowNodeTransformData.html) Get the ndoe's transform data
+- transform: [FlowNodeTransformData](https://flowgram.ai/auto-docs/document/classes/FlowNodeTransformData.html) Get the node's transform data
 - renderData: [FlowNodeRenderData](https://flowgram.ai/auto-docs/document/classes/FlowNodeRenderData.html) Get the node's render data, including render status
 - form: [NodeFormProps](https://flowgram.ai/auto-docs/editor/interfaces/NodeFormProps.html) Get the node's form data, like [getNodeForm](/api/utils/get-node-form.html)
 - scope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) Get the node's variable public scope
 - privateScope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) Get the node's variable private scope
-- line: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) Get the node's lines data
+- lines: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) Get the node's lines data
 - ports: [WorkflowNodePortsData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodePortsData.html) Get the node's ports data
 - getNodeRegistry(): [WorkflowNodeRegistry](https://flowgram.ai/auto-docs/free-layout-core/interfaces/WorkflowNodeRegistry) Get the node's registry
 - getService(): Get the [IOC](/guide/concepts/ioc.html) Service, such as`node.getService(HistoryService)`

+ 1 - 1
apps/docs/src/zh/api/core/flow-node-entity.mdx

@@ -28,7 +28,7 @@
 - form: [NodeFormProps](https://flowgram.ai/auto-docs/editor/interfaces/NodeFormProps.html) 获取节点的表单数据, 等价于 [getNodeForm](/api/utils/get-node-form.html)
 - scope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) 变量作用域
 - privateScope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) 变量私有作用域
-- line: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) 自由布局线条数据
+- lines: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) 自由布局线条数据
 - ports: [WorkflowNodePortsData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodePortsData.html) 自由布局端口数据
 
 

+ 1 - 1
apps/docs/src/zh/guide/advanced/fixed-layout/node.mdx

@@ -23,7 +23,7 @@
 - form: [NodeFormProps](https://flowgram.ai/auto-docs/editor/interfaces/NodeFormProps.html) 获取节点的表单数据, 等价于 [getNodeForm](/api/utils/get-node-form.html)
 - scope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) 变量作用域
 - privateScope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) 变量私有作用域
-- getNodeRegistry(): [WorkflowNodeRegistry](https://flowgram.ai/auto-docs/free-layout-core/interfaces/WorkflowNodeRegistry) 获取节点注册器
+- getNodeRegistry(): [FlowNodeRegistry](https://flowgram.ai/auto-docs/document/interfaces/FlowNodeRegistry-1) 获取节点注册器
 - getService(): 获取 [IOC](/guide/concepts/ioc.html) 服务,如 `node.getService(HistoryService)`
 - getExtInfo(): 获取节点扩展数据, 如 `node.getExtInfo<{ test: string }>()`
 - updateExtInfo(): 更新节点扩展数据, 如 `node.updateExtInfo<{ test: string }>({ test: 'test' })`

+ 1 - 1
apps/docs/src/zh/guide/advanced/free-layout/node.mdx

@@ -15,7 +15,7 @@
 - form: [NodeFormProps](https://flowgram.ai/auto-docs/editor/interfaces/NodeFormProps.html) 获取节点的表单数据, 等价于 [getNodeForm](/api/utils/get-node-form.html)
 - scope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) 变量作用域
 - privateScope: [FlowNodeScope](https://flowgram.ai/auto-docs/editor/interfaces/FlowNodeScope) 变量私有作用域
-- line: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) 自由布局线条数据
+- lines: [WorkflowNodeLinesData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodeLinesData.html) 自由布局线条数据
 - ports: [WorkflowNodePortsData](https://flowgram.ai/auto-docs/free-layout-core/classes/WorkflowNodePortsData.html) 自由布局端口数据
 - getNodeRegistry(): [WorkflowNodeRegistry](https://flowgram.ai/auto-docs/free-layout-core/interfaces/WorkflowNodeRegistry) 获取节点注册器
 - getService(): 获取 [IOC](/guide/concepts/ioc.html) 服务,如 `node.getService(HistoryService)`