diff --git a/package-lock.json b/package-lock.json index 79305f7d..c41e6378 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "react-dropdown": "^1.11.0", "react-icons": "^5.5.0", "react-markdown": "^9.0.1", + "react-resizable-panels": "^3.0.3", "react-router-dom": "^6.24.1", "react-shepherd": "^6.1.1", "react-spring": "^9.7.4", @@ -19974,6 +19975,16 @@ "node": ">=0.10.0" } }, + "node_modules/react-resizable-panels": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/react-resizable-panels/-/react-resizable-panels-3.0.3.tgz", + "integrity": "sha512-7HA8THVBHTzhDK4ON0tvlGXyMAJN1zBeRpuyyremSikgYh2ku6ltD7tsGQOcXx4NKPrZtYCm/5CBr+dkruTGQw==", + "license": "MIT", + "peerDependencies": { + "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc", + "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + } + }, "node_modules/react-router": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.24.1.tgz", diff --git a/package.json b/package.json index 246ba7c2..79f588b8 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "react-dropdown": "^1.11.0", "react-icons": "^5.5.0", "react-markdown": "^9.0.1", + "react-resizable-panels": "^3.0.3", "react-router-dom": "^6.24.1", "react-shepherd": "^6.1.1", "react-spring": "^9.7.4", diff --git a/src/App.tsx b/src/App.tsx index af40254f..d2cc0868 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,22 +1,15 @@ import { useEffect, useState } from "react"; -import { App as AntdApp, Layout, Row, Col, Collapse, Spin } from "antd"; +import { App as AntdApp, Layout, Spin } from "antd"; import { LoadingOutlined } from "@ant-design/icons"; import { Routes, Route, useSearchParams, useNavigate } from "react-router-dom"; import Navbar from "./components/Navbar"; -import Footer from "./components/Footer"; import tour from "./components/Tour"; -import AgreementData from "./editors/editorsContainer/AgreementData"; import LearnNow from "./pages/LearnNow"; -import AgreementHtml from "./AgreementHtml"; -import Errors from "./utils/helpers/Errors"; -import TemplateMarkdown from "./editors/editorsContainer/TemplateMarkdown"; -import TemplateModel from "./editors/editorsContainer/TemplateModel"; import useAppStore from "./store/store"; -import SampleDropdown from "./components/SampleDropdown"; -import UseShare from "./components/UseShare"; import LearnContent from "./components/Content"; -import ResizableContainer from "./components/ResizableContainer"; -import { AIChatPanel } from "./components/AIChatPanel"; +import MainContainer from "./pages/MainContainer"; +import PlaygroundSidebar from "./components/PlaygroundSidebar"; +import "./styles/App.css"; import AIConfigPopup from "./components/AIConfigPopup"; import { loadConfigFromLocalStorage } from "./ai-assistant/chatRelay"; @@ -26,35 +19,22 @@ const App = () => { const navigate = useNavigate(); const init = useAppStore((state) => state.init); const loadFromLink = useAppStore((state) => state.loadFromLink); - const { isAIChatOpen, setAIChatOpen, isAIConfigOpen, setAIConfigOpen } = useAppStore((state) => ({ - isAIChatOpen: state.isAIChatOpen, - setAIChatOpen: state.setAIChatOpen, + const { isAIConfigOpen, setAIConfigOpen } = + useAppStore((state) => ({ isAIConfigOpen: state.isAIConfigOpen, - setAIConfigOpen: state.setAIConfigOpen - } - )); + setAIConfigOpen: state.setAIConfigOpen, + })); const backgroundColor = useAppStore((state) => state.backgroundColor); const textColor = useAppStore((state) => state.textColor); - const [activePanel, setActivePanel] = useState(); const [loading, setLoading] = useState(true); const [searchParams] = useSearchParams(); - const scrollToFooter = () => { - const exploreContent = document.getElementById("footer"); - if (exploreContent) { - exploreContent.scrollIntoView({ behavior: "smooth" }); - } - }; const handleConfigSave = () => { loadConfigFromLocalStorage(); setAIConfigOpen(false); }; - const onChange = (key: string | string[]) => { - setActivePanel(key); - }; - useEffect(() => { const initializeApp = async () => { try { @@ -74,7 +54,7 @@ const App = () => { setLoading(false); } }; - initializeApp(); + void initializeApp(); }, [init, loadFromLink, searchParams, navigate]); useEffect(() => { @@ -109,167 +89,67 @@ const App = () => { const showTour = searchParams.get("showTour") === "true"; if (showTour || !localStorage.getItem("hasVisited")) { - startTour(); + void startTour(); } }, [searchParams]); - const panels = [ - { - key: "templateMark", - label: "TemplateMark", - children: , - }, - { - key: "model", - label: "Concerto Model", - children: , - }, - { - key: "data", - label: "Preview Data", - children: , - }, - ]; + return ( - - - - {loading ? ( -
- -
- ) : ( - - - - - - - - - - - - - - -
- - } - rightPane={} - aiChatPane={isAIChatOpen ? : null} - initialLeftWidth={66} - minLeftWidth={30} - minRightWidth={30} - /> -
- - } - /> - }> - } /> - } /> - } /> - } /> - -
- )} -
- setAIConfigOpen(false)} - onSave={handleConfigSave} - /> -