소스 검색

fix: fixed-layout catchBlock error, sidebar form render with node expanded (#323)

* fix: sidebar form render

* fix(fixed-layout): catch block error
xiamidaxia 7 달 전
부모
커밋
d96f97dbc5

+ 4 - 6
apps/demo-fixed-layout/src/form-components/form-content/index.tsx

@@ -15,12 +15,10 @@ export function FormContent(props: { children?: React.ReactNode }) {
   const registry = node.getNodeRegistry<FlowNodeRegistry>();
   const registry = node.getNodeRegistry<FlowNodeRegistry>();
   return (
   return (
     <FormWrapper>
     <FormWrapper>
-      {expanded ? (
-        <>
-          {isSidebar && <FormTitleDescription>{registry.info?.description}</FormTitleDescription>}
-          {props.children}
-        </>
-      ) : undefined}
+      <>
+        {isSidebar && <FormTitleDescription>{registry.info?.description}</FormTitleDescription>}
+        {(expanded || isSidebar) && props.children}
+      </>
     </FormWrapper>
     </FormWrapper>
   );
   );
 }
 }

+ 4 - 6
apps/demo-free-layout/src/form-components/form-content/index.tsx

@@ -15,12 +15,10 @@ export function FormContent(props: { children?: React.ReactNode }) {
   const registry = node.getNodeRegistry<FlowNodeRegistry>();
   const registry = node.getNodeRegistry<FlowNodeRegistry>();
   return (
   return (
     <FormWrapper>
     <FormWrapper>
-      {expanded ? (
-        <>
-          {isSidebar && <FormTitleDescription>{registry.info?.description}</FormTitleDescription>}
-          {props.children}
-        </>
-      ) : undefined}
+      <>
+        {isSidebar && <FormTitleDescription>{registry.info?.description}</FormTitleDescription>}
+        {(expanded || isSidebar) && props.children}
+      </>
     </FormWrapper>
     </FormWrapper>
   );
   );
 }
 }

+ 1 - 1
packages/canvas-engine/fixed-layout-core/src/activities/try-catch.ts

@@ -109,7 +109,7 @@ export const TryCatchRegistry: FlowNodeRegistry = {
     const parent = node.document.getNode(`$catchInlineBlocks$${node.id}`);
     const parent = node.document.getNode(`$catchInlineBlocks$${node.id}`);
     const block = node.document.addNode({
     const block = node.document.addNode({
       id: blockData.id,
       id: blockData.id,
-      type: node.type || TryCatchTypeEnum.CATCH_BLOCK,
+      type: blockData.type || TryCatchTypeEnum.CATCH_BLOCK,
       originParent: node,
       originParent: node,
       parent,
       parent,
       data: blockData.data,
       data: blockData.data,