@@ -9,6 +9,7 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
99import MonacoEditor from '@monaco-editor/react' ;
1010import { ErrorSchema , RJSFSchema , UiSchema } from '@rjsf/utils' ;
1111import isEqualWith from 'lodash/isEqualWith' ;
12+ import { Panel , Group , Separator } from 'react-resizable-panels' ;
1213
1314import ThemeSelector , { ThemesType } from './ThemeSelector' ;
1415import SubthemeSelector , { SubthemeType } from './SubthemeSelector' ;
@@ -60,7 +61,7 @@ function Editor({ title, code, onChange }: EditorProps) {
6061 const cls = valid ? 'valid' : 'invalid' ;
6162
6263 return (
63- < div className = 'panel panel-default' >
64+ < div className = 'panel panel-default' style = { { marginBottom : 0 } } >
6465 < div className = 'panel-heading' >
6566 < span className = { `${ cls } glyphicon glyphicon-${ icon } ` } />
6667 { ' ' + title }
@@ -187,22 +188,27 @@ export default function Editors({
187188 </ Grid >
188189 </ AccordionSummary >
189190 < AccordionDetails sx = { { p : 0 } } >
190- < Grid container spacing = { 0.5 } >
191- < Grid size = { extraErrors ? 3 : 4 } >
191+ < Group orientation = 'horizontal' >
192+ < Panel defaultSize = { extraErrors ? '34%' : '25%' } minSize = '10%' >
192193 < Editor title = 'JSONSchema' code = { toJson ( schema ) } onChange = { onSchemaEdited } />
193- </ Grid >
194- < Grid size = { extraErrors ? 3 : 4 } >
194+ </ Panel >
195+ < Separator style = { { width : '4px' , cursor : 'col-resize' } } />
196+ < Panel defaultSize = { extraErrors ? '33%' : '25%' } minSize = '10%' >
195197 < Editor title = { uiSchemaTitle } code = { toJson ( uiSchema ) } onChange = { onUISchemaEdited } />
196- </ Grid >
197- < Grid size = { extraErrors ? 3 : 4 } >
198+ </ Panel >
199+ < Separator style = { { width : '4px' , cursor : 'col-resize' } } />
200+ < Panel defaultSize = { extraErrors ? '33%' : '25%' } minSize = '10%' >
198201 < Editor title = 'formData' code = { toJson ( formData ) } onChange = { onFormDataEdited } />
199- </ Grid >
202+ </ Panel >
200203 { extraErrors && (
201- < Grid size = { 3 } >
202- < Editor title = 'extraErrors' code = { toJson ( extraErrors || { } ) } onChange = { onExtraErrorsEdited } />
203- </ Grid >
204+ < >
205+ < Separator style = { { width : '4px' , cursor : 'col-resize' } } />
206+ < Panel defaultSize = '25%' minSize = '10%' >
207+ < Editor title = 'extraErrors' code = { toJson ( extraErrors ) } onChange = { onExtraErrorsEdited } />
208+ </ Panel >
209+ </ >
204210 ) }
205- </ Grid >
211+ </ Group >
206212 </ AccordionDetails >
207213 </ Accordion >
208214 ) ;
0 commit comments