|
@@ -11,6 +11,7 @@ import { useLayoutContext } from '@/shared/context/layout-context'
|
|
|
import { useState } from 'react'
|
|
import { useState } from 'react'
|
|
|
import EditorPanel from './editor-panel'
|
|
import EditorPanel from './editor-panel'
|
|
|
import { useRailContext } from '../contexts/rail-context'
|
|
import { useRailContext } from '../contexts/rail-context'
|
|
|
|
|
+import HistoryContainer from '@/features/ide-react/components/history-container'
|
|
|
|
|
|
|
|
export default function MainLayout() {
|
|
export default function MainLayout() {
|
|
|
const [resizing, setResizing] = useState(false)
|
|
const [resizing, setResizing] = useState(false)
|
|
@@ -30,6 +31,7 @@ export default function MainLayout() {
|
|
|
view === 'editor' || view === 'file' || pdfLayout === 'sideBySide'
|
|
view === 'editor' || view === 'file' || pdfLayout === 'sideBySide'
|
|
|
|
|
|
|
|
const { t } = useTranslation()
|
|
const { t } = useTranslation()
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className="ide-redesign-main">
|
|
<div className="ide-redesign-main">
|
|
|
<Toolbar />
|
|
<Toolbar />
|
|
@@ -42,49 +44,59 @@ export default function MainLayout() {
|
|
|
})}
|
|
})}
|
|
|
>
|
|
>
|
|
|
<RailLayout />
|
|
<RailLayout />
|
|
|
- <Panel
|
|
|
|
|
- id="ide-redesign-editor-panel"
|
|
|
|
|
- order={1}
|
|
|
|
|
- className={classNames({
|
|
|
|
|
- hidden: !editorIsOpen,
|
|
|
|
|
- })}
|
|
|
|
|
- minSize={5}
|
|
|
|
|
- defaultSize={50}
|
|
|
|
|
- >
|
|
|
|
|
- <div className="ide-redesign-editor-container">
|
|
|
|
|
- <EditorPanel />
|
|
|
|
|
- </div>
|
|
|
|
|
- </Panel>
|
|
|
|
|
- <HorizontalResizeHandle
|
|
|
|
|
- resizable={pdfLayout === 'sideBySide'}
|
|
|
|
|
- onDragging={setResizing}
|
|
|
|
|
- onDoubleClick={togglePdfPane}
|
|
|
|
|
- hitAreaMargins={{ coarse: 0, fine: 0 }}
|
|
|
|
|
- className={classNames({
|
|
|
|
|
- hidden: !editorIsOpen,
|
|
|
|
|
- })}
|
|
|
|
|
- >
|
|
|
|
|
- <HorizontalToggler
|
|
|
|
|
- id="ide-redesign-pdf-panel"
|
|
|
|
|
- togglerType="east"
|
|
|
|
|
- isOpen={isPdfOpen}
|
|
|
|
|
- setIsOpen={setIsPdfOpen}
|
|
|
|
|
- tooltipWhenOpen={t('tooltip_hide_pdf')}
|
|
|
|
|
- tooltipWhenClosed={t('tooltip_show_pdf')}
|
|
|
|
|
- />
|
|
|
|
|
- </HorizontalResizeHandle>
|
|
|
|
|
- <Panel
|
|
|
|
|
- collapsible
|
|
|
|
|
- className="ide-redesign-pdf-container"
|
|
|
|
|
- id="ide-redesign-pdf-panel"
|
|
|
|
|
- order={2}
|
|
|
|
|
- defaultSize={50}
|
|
|
|
|
- minSize={5}
|
|
|
|
|
- ref={pdfPanelRef}
|
|
|
|
|
- onExpand={handlePdfPaneExpand}
|
|
|
|
|
- onCollapse={handlePdfPaneCollapse}
|
|
|
|
|
- >
|
|
|
|
|
- <PdfPreview />
|
|
|
|
|
|
|
+ <Panel id="ide-redesign-editor-and-pdf-panel" order={2}>
|
|
|
|
|
+ <HistoryContainer />
|
|
|
|
|
+ <PanelGroup
|
|
|
|
|
+ autoSaveId="ide-redesign-editor-and-pdf-panel-group"
|
|
|
|
|
+ direction="horizontal"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Panel
|
|
|
|
|
+ id="ide-redesign-editor-panel"
|
|
|
|
|
+ order={1}
|
|
|
|
|
+ className={classNames({
|
|
|
|
|
+ hidden: !editorIsOpen || view === 'history',
|
|
|
|
|
+ })}
|
|
|
|
|
+ minSize={5}
|
|
|
|
|
+ defaultSize={50}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className="ide-redesign-editor-container">
|
|
|
|
|
+ <EditorPanel />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Panel>
|
|
|
|
|
+ <HorizontalResizeHandle
|
|
|
|
|
+ resizable={pdfLayout === 'sideBySide'}
|
|
|
|
|
+ onDragging={setResizing}
|
|
|
|
|
+ onDoubleClick={togglePdfPane}
|
|
|
|
|
+ hitAreaMargins={{ coarse: 0, fine: 0 }}
|
|
|
|
|
+ className={classNames({
|
|
|
|
|
+ hidden: !editorIsOpen,
|
|
|
|
|
+ })}
|
|
|
|
|
+ >
|
|
|
|
|
+ <HorizontalToggler
|
|
|
|
|
+ id="ide-redesign-pdf-panel"
|
|
|
|
|
+ togglerType="east"
|
|
|
|
|
+ isOpen={isPdfOpen}
|
|
|
|
|
+ setIsOpen={setIsPdfOpen}
|
|
|
|
|
+ tooltipWhenOpen={t('tooltip_hide_pdf')}
|
|
|
|
|
+ tooltipWhenClosed={t('tooltip_show_pdf')}
|
|
|
|
|
+ />
|
|
|
|
|
+ </HorizontalResizeHandle>
|
|
|
|
|
+ <Panel
|
|
|
|
|
+ collapsible
|
|
|
|
|
+ className={classNames('ide-redesign-pdf-container', {
|
|
|
|
|
+ hidden: view === 'history',
|
|
|
|
|
+ })}
|
|
|
|
|
+ id="ide-redesign-pdf-panel"
|
|
|
|
|
+ order={2}
|
|
|
|
|
+ defaultSize={50}
|
|
|
|
|
+ minSize={5}
|
|
|
|
|
+ ref={pdfPanelRef}
|
|
|
|
|
+ onExpand={handlePdfPaneExpand}
|
|
|
|
|
+ onCollapse={handlePdfPaneCollapse}
|
|
|
|
|
+ >
|
|
|
|
|
+ <PdfPreview />
|
|
|
|
|
+ </Panel>
|
|
|
|
|
+ </PanelGroup>
|
|
|
</Panel>
|
|
</Panel>
|
|
|
</PanelGroup>
|
|
</PanelGroup>
|
|
|
</div>
|
|
</div>
|