Ver código fonte

Merge pull request #52 from FungYuu/docs-free

docs: Modify the FixedLayoutProps in a free layout
xiamidaxia 10 meses atrás
pai
commit
6c13bffbf3

+ 4 - 4
apps/docs/src/en/guide/getting-started/create-free-layout-simple.mdx

@@ -40,7 +40,7 @@ Canvas configuration is declarative, providing data, rendering, event, and plugi
 
 
 ```tsx pure title="use-editor-props.tsx"
 ```tsx pure title="use-editor-props.tsx"
 import { useMemo } from 'react';
 import { useMemo } from 'react';
-import { type FixedLayoutProps } from '@flowgram.ai/free-layout-editor';
+import { type FreeLayoutProps } from '@flowgram.ai/free-layout-editor';
 import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
 import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
 
 
 import { intialData } from './initial-data' // 初始化数据
 import { intialData } from './initial-data' // 初始化数据
@@ -48,8 +48,8 @@ import { nodeRegistries } from './node-registries' // 节点声明配置
 import { BaseNode } from './base-node' // 节点渲染
 import { BaseNode } from './base-node' // 节点渲染
 
 
 export function useEditorProps(
 export function useEditorProps(
-): FixedLayoutProps {
-  return useMemo<FixedLayoutProps>(
+): FreeLayoutProps {
+  return useMemo<FreeLayoutProps>(
     () => ({
     () => ({
       /**
       /**
        * Initialize data
        * Initialize data
@@ -271,7 +271,7 @@ export const BaseNode = () => {
    */
    */
   const { form } = useNodeRender()
   const { form } = useNodeRender()
   /**
   /**
-   * WorkflowNodeRenderer will add node drag events and port rendering, for deep customization, 
+   * WorkflowNodeRenderer will add node drag events and port rendering, for deep customization,
    * you can check the component source code at:
    * you can check the component source code at:
    * https://github.com/bytedance/flowgram.ai/blob/main/packages/client/free-layout-editor/src/components/workflow-node-renderer.tsx
    * https://github.com/bytedance/flowgram.ai/blob/main/packages/client/free-layout-editor/src/components/workflow-node-renderer.tsx
    */
    */

+ 3 - 3
apps/docs/src/zh/guide/getting-started/create-free-layout-simple.mdx

@@ -42,7 +42,7 @@ function App() {
 
 
 ```tsx pure title="use-editor-props.tsx"
 ```tsx pure title="use-editor-props.tsx"
 import { useMemo } from 'react';
 import { useMemo } from 'react';
-import { type FixedLayoutProps } from '@flowgram.ai/free-layout-editor';
+import { type FreeLayoutProps } from '@flowgram.ai/free-layout-editor';
 import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
 import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
 
 
 import { intialData } from './initial-data' // 初始化数据
 import { intialData } from './initial-data' // 初始化数据
@@ -50,8 +50,8 @@ import { nodeRegistries } from './node-registries' // 节点声明配置
 import { BaseNode } from './base-node' // 节点渲染
 import { BaseNode } from './base-node' // 节点渲染
 
 
 export function useEditorProps(
 export function useEditorProps(
-): FixedLayoutProps {
-  return useMemo<FixedLayoutProps>(
+): FreeLayoutProps {
+  return useMemo<FreeLayoutProps>(
     () => ({
     () => ({
       /**
       /**
        * 初始化数据
        * 初始化数据