diff --git a/editor/layout/panel/workspace-bottom-panel-dock-layout.tsx b/editor/layout/panel/workspace-bottom-panel-dock-layout.tsx index e5a015316..7c1e53d6d 100644 --- a/editor/layout/panel/workspace-bottom-panel-dock-layout.tsx +++ b/editor/layout/panel/workspace-bottom-panel-dock-layout.tsx @@ -1,5 +1,6 @@ import styled from "@emotion/styled"; -import React from "react"; +import React, { useState } from "react"; +import { Resizable } from "re-resizable"; /** * bottom docked layout. its content displays as row @@ -9,12 +10,36 @@ import React from "react"; */ export function WorkspaceBottomPanelDockLayout(props: { children: JSX.Element | JSX.Element[]; + resizable?: boolean; }) { - return {props.children}; + const [height, setHeight] = useState(300); + + const body = props.children; + return props.resizable ? ( + { + setHeight(height + d.height); + }} + > + {body} + + ) : ( + {body} + ); } const DockRootWrap = styled.div` - min-height: 100%; border: solid #d2d2d2; align-self: stretch; border-width: 1px; diff --git a/editor/pages/to-code/index.tsx b/editor/pages/to-code/index.tsx index 259f8bec7..da7a32dbb 100644 --- a/editor/pages/to-code/index.tsx +++ b/editor/pages/to-code/index.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import { designToCode } from "@designto/code"; +import { designToCode, Result } from "@designto/code"; import { useDesign } from "../../query-hooks"; import styled from "@emotion/styled"; import { DefaultEditorWorkspaceLayout } from "../../layout/default-editor-workspace-layout"; @@ -26,12 +26,13 @@ import { import LoadingLayout from "../../layout/loading-overlay"; import { DesignInput } from "@designto/config/input"; import { ClearRemoteDesignSessionCache } from "../../components/clear-remote-design-session-cache"; +import { WidgetTree } from "../../components/visualization/json-visualization/json-tree"; export default function DesignToCodeUniversalPage() { const router = useRouter(); const design = useDesign(); - const [result, setResult] = useState(); - const [preview, setPreview] = useState(); + const [result, setResult] = useState(); + const [preview, setPreview] = useState(); const framework_config = get_framework_config_from_query(router.query); const preview_runner_framework = get_preview_runner_framework(router.query); @@ -146,39 +147,42 @@ export default function DesignToCodeUniversalPage() { /> - +
- -
- {(design.reflect.origin === "INSTANCE" || - design.reflect.origin === "COMPONENT") && ( - - )} - {/*
- -
- -
*/} + +
+ {(design.reflect.origin === "INSTANCE" || + design.reflect.origin === "COMPONENT") && ( + + )} +
+ +
+ +
+
+ +