11import React , { useEffect , useState , useRef } from 'react' ;
2+ import { useLocation } from 'react-router-dom' ;
23import { Header } from './Header' ;
34import { FlowCanvas } from '../flow/FlowCanvas' ;
45import { ToolsPanel } from '../ui/ToolsPanel' ;
@@ -21,6 +22,7 @@ interface MainLayoutProps {
2122 topRightSlot ?: React . ReactNode ;
2223 showWorkspaceInfo ?: boolean ;
2324 workspaceTopRightSlot ?: React . ReactNode ;
25+ workspaceOverlay ?: React . ReactNode ;
2426}
2527
2628interface EcoreFileBox {
@@ -34,7 +36,9 @@ interface EcoreFileBox {
3436 createdAt ?: string ;
3537}
3638
37- export function MainLayout ( { onDeploy, onSave, onLoad, onNew, user, onLogout, leftSidebar, leftSidebarWidth = 350 , rightSidebar, rightSidebarWidth = 0 , topRightSlot, showWorkspaceInfo = true , workspaceTopRightSlot } : MainLayoutProps ) {
39+ export function MainLayout ( { onDeploy, onSave, onLoad, onNew, user, onLogout, leftSidebar, leftSidebarWidth = 350 , rightSidebar, rightSidebarWidth = 0 , topRightSlot, showWorkspaceInfo = true , workspaceTopRightSlot, workspaceOverlay } : MainLayoutProps ) {
40+ const location = useLocation ( ) ;
41+ const isMMLRoute = location . pathname . startsWith ( '/mml' ) ;
3842 const [ selectedDiagramType , setSelectedDiagramType ] = useState < string | undefined > ( ) ;
3943 const flowCanvasRef = useRef < any > ( null ) ;
4044 const leftAsideRef = useRef < HTMLDivElement | null > ( null ) ;
@@ -453,7 +457,7 @@ export function MainLayout({ onDeploy, onSave, onLoad, onNew, user, onLogout, le
453457 ) }
454458
455459 { /* Top-right workspace document panel (separate from ToolsPanel) */ }
456- { activeDocId && (
460+ { activeDocId && ! isMMLRoute && (
457461 < div style = { { position : 'absolute' , right : 16 + ( rightSidebarWidth || 0 ) , top : 56 , zIndex : 25 } } >
458462 < div style = { {
459463 background : '#ffffff' ,
@@ -546,7 +550,7 @@ export function MainLayout({ onDeploy, onSave, onLoad, onNew, user, onLogout, le
546550 ) }
547551
548552 { /* Workspace info panel */ }
549- { showWorkspaceInfo && (
553+ { showWorkspaceInfo && ! isMMLRoute && (
550554 < div style = { { position : 'absolute' , left : 16 , top : 56 , zIndex : 25 } } >
551555 < div style = { {
552556 background : '#ffffff' ,
@@ -577,19 +581,60 @@ export function MainLayout({ onDeploy, onSave, onLoad, onNew, user, onLogout, le
577581
578582 < div style = { { flexGrow : 1 , position : 'relative' , display : 'flex' } } >
579583 < div style = { { flexGrow : 1 , position : 'relative' , display : 'flex' } } >
580- < FlowCanvas
581- onDeploy = { onDeploy }
582- onDiagramChange = { handleDiagramChange }
583- ref = { flowCanvasRef }
584- ecoreFiles = { ecoreFileBoxes }
585- onEcoreFileSelect = { handleEcoreFileSelect }
586- onEcoreFileExpand = { handleEcoreFileExpand }
587- onEcoreFilePositionChange = { handleEcoreFilePositionChange }
588- onEcoreFileDelete = { handleEcoreFileDelete }
589- onEcoreFileRename = { handleEcoreFileRename }
590- />
591- { workspaceTopRightSlot && (
592- < div style = { { position : 'absolute' , right : 16 , top : 60 , zIndex : 15 } } >
584+ { workspaceOverlay && (
585+ < div style = { { position : 'absolute' , left : 0 , right : 0 , top : 48 , zIndex : 20 , pointerEvents : 'none' } } >
586+ < div style = { { pointerEvents : 'auto' } } >
587+ { workspaceOverlay }
588+ </ div >
589+ </ div >
590+ ) }
591+ { isMMLRoute ? (
592+ < div style = { {
593+ width : '100%' ,
594+ height : '100%' ,
595+ background : '#ffffff' ,
596+ display : 'flex' ,
597+ flexDirection : 'column' ,
598+ alignItems : 'center' ,
599+ justifyContent : 'center' ,
600+ padding : '40px'
601+ } } >
602+ < div style = { {
603+ textAlign : 'center' ,
604+ fontFamily : 'Georgia, serif' ,
605+ color : '#2c3e50' ,
606+ maxWidth : '600px'
607+ } } >
608+ < img
609+ src = "/assets/22098030.png"
610+ alt = "Vitruvius"
611+ style = { {
612+ width : '200px' ,
613+ height : '200px' ,
614+ objectFit : 'contain' ,
615+ marginBottom : '30px'
616+ } }
617+ />
618+ < p style = { { margin : '0 0 20px 0' , fontSize : '16px' , color : '#6b7280' , lineHeight : '1.6' } } >
619+ Meta Model Management Platform
620+ </ p >
621+ </ div >
622+ </ div >
623+ ) : (
624+ < FlowCanvas
625+ onDeploy = { onDeploy }
626+ onDiagramChange = { handleDiagramChange }
627+ ref = { flowCanvasRef }
628+ ecoreFiles = { ecoreFileBoxes }
629+ onEcoreFileSelect = { handleEcoreFileSelect }
630+ onEcoreFileExpand = { handleEcoreFileExpand }
631+ onEcoreFilePositionChange = { handleEcoreFilePositionChange }
632+ onEcoreFileDelete = { handleEcoreFileDelete }
633+ onEcoreFileRename = { handleEcoreFileRename }
634+ />
635+ ) }
636+ { workspaceTopRightSlot && ! isMMLRoute && (
637+ < div style = { { position : 'absolute' , right : 16 , top : 60 , zIndex : 30 } } >
593638 { workspaceTopRightSlot }
594639 </ div >
595640 ) }
0 commit comments