Explorar o código

chore: remove useless config of variable engine in demo

sanmaopep hai 10 meses
pai
achega
14f99b0e68

+ 5 - 6
apps/demo-fixed-layout/src/hooks/use-editor-props.ts

@@ -24,7 +24,7 @@ import { DragNode } from '../components';
 
 export function useEditorProps(
   initialData: FlowDocumentJSON,
-  nodeRegistries: FlowNodeRegistry[],
+  nodeRegistries: FlowNodeRegistry[]
 ): FixedLayoutProps {
   return useMemo<FixedLayoutProps>(
     () => ({
@@ -94,7 +94,7 @@ export function useEditorProps(
       },
       // Config shortcuts
       shortcuts: (registry: ShortcutsRegistry, ctx) => {
-        registry.addHandlers(...shortcutGetter.map(getter => getter(ctx)));
+        registry.addHandlers(...shortcutGetter.map((getter) => getter(ctx)));
       },
       /**
        * Drag/Drop config
@@ -141,7 +141,6 @@ export function useEditorProps(
        */
       variableEngine: {
         enable: true,
-        layout: 'fixed',
       },
       /**
        * Materials, components can be customized based on the key
@@ -165,7 +164,7 @@ export function useEditorProps(
       /**
        * Playground init
        */
-      onInit: ctx => {
+      onInit: (ctx) => {
         /**
          * Data can also be dynamically loaded via fromJSON
          * 也可以通过 fromJSON 动态加载数据
@@ -176,7 +175,7 @@ export function useEditorProps(
       /**
        * Playground render
        */
-      onAllLayersRendered: ctx => {
+      onAllLayersRendered: (ctx) => {
         setTimeout(() => {
           ctx.playground.config.fitView(ctx.document.root.bounds.pad(30));
         }, 10);
@@ -236,6 +235,6 @@ export function useEditorProps(
         createClipboardPlugin(),
       ],
     }),
-    [],
+    []
   );
 }

+ 2 - 3
apps/demo-free-layout/src/hooks/use-editor-props.tsx

@@ -14,7 +14,7 @@ import { BaseNode } from '../components';
 
 export function useEditorProps(
   initialData: FlowDocumentJSON,
-  nodeRegistries: FlowNodeRegistry[],
+  nodeRegistries: FlowNodeRegistry[]
 ): FreeLayoutProps {
   return useMemo<FreeLayoutProps>(
     () => ({
@@ -90,7 +90,6 @@ export function useEditorProps(
        */
       variableEngine: {
         enable: true,
-        layout: 'free',
       },
       /**
        * Redo/Undo enable
@@ -167,6 +166,6 @@ export function useEditorProps(
         }),
       ],
     }),
-    [],
+    []
   );
 }