@@ -19,12 +19,13 @@ import { getSettings, updateSettings } from '../react-common/settingsReactSide';
1919import { StyleInjector } from '../react-common/styleInjector' ;
2020import { Cell , ICellViewModel } from './cell' ;
2121import { ContentPanel , IContentPanelProps } from './contentPanel' ;
22- import { HeaderPanel , IHeaderPanelProps } from './headerPanel' ;
2322import { InputHistory } from './inputHistory' ;
2423import { IntellisenseProvider } from './intellisenseProvider' ;
2524import { createCellVM , createEditableCellVM , extractInputText , generateTestState , IMainPanelState } from './mainPanelState' ;
2625import { initializeTokenizer , registerMonacoLanguage } from './tokenizer' ;
26+ import { IToolbarPanelProps , ToolbarPanel } from './toolbarPanel' ;
2727import { VariableExplorer } from './variableExplorer' ;
28+ import { IVariablePanelProps , VariablePanel } from './variablePanel' ;
2829
2930import './mainPanel.css' ;
3031
@@ -62,7 +63,6 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
6263 redoStack : [ ] ,
6364 submittedText : false ,
6465 history : new InputHistory ( ) ,
65- contentTop : 24 ,
6666 editCellVM : getSettings && getSettings ( ) . allowInput ? createEditableCellVM ( 1 ) : undefined ,
6767 editorOptions : this . computeEditorOptions ( )
6868 } ;
@@ -138,22 +138,17 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
138138 darkChanged = { this . darkChanged }
139139 monacoThemeChanged = { this . monacoThemeChanged }
140140 ref = { this . styleInjectorRef } />
141- < div className = 'main-panel-header' >
142- < div className = 'main-panel-inner' >
143- { this . renderHeaderPanel ( baseTheme ) }
144- </ div >
141+ < div id = 'main-panel-toolbar' >
142+ { this . renderToolbarPanel ( baseTheme ) }
145143 </ div >
146- < div className = 'main-panel-content' >
147- < div className = 'main-panel-inner' >
148- < div className = 'main-panel-scrollable' >
149- { this . renderContentPanel ( baseTheme ) }
150- </ div >
151- </ div >
144+ < div id = 'main-panel-variable' >
145+ { this . renderVariablePanel ( baseTheme ) }
152146 </ div >
153- < div className = 'main-panel-footer' >
154- < div className = 'main-panel-inner' >
155- { this . renderFooterPanel ( baseTheme ) }
156- </ div >
147+ < div id = 'main-panel-content' >
148+ { this . renderContentPanel ( baseTheme ) }
149+ </ div >
150+ < div id = 'main-panel-footer' >
151+ { this . renderFooterPanel ( baseTheme ) }
157152 </ div >
158153 </ div >
159154 ) ;
@@ -262,9 +257,14 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
262257 // this.addCell(cell);
263258 // }
264259
265- private renderHeaderPanel ( baseTheme : string ) {
266- const headerProps = this . getHeaderProps ( baseTheme ) ;
267- return < HeaderPanel { ...headerProps } /> ;
260+ private renderToolbarPanel ( baseTheme : string ) {
261+ const toolbarProps = this . getToolbarProps ( baseTheme ) ;
262+ return < ToolbarPanel { ...toolbarProps } /> ;
263+ }
264+
265+ private renderVariablePanel ( baseTheme : string ) {
266+ const variableProps = this . getVariableProps ( baseTheme ) ;
267+ return < VariablePanel { ...variableProps } /> ;
268268 }
269269
270270 private renderContentPanel ( baseTheme : string ) {
@@ -347,11 +347,6 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
347347 return { } ;
348348 }
349349
350- // Called by the header control when size changes (such as expanding variables)
351- private onHeaderHeightChange = ( newHeight : number ) => {
352- this . setState ( { contentTop : newHeight } ) ;
353- }
354-
355350 private darkChanged = ( newDark : boolean ) => {
356351 // update our base theme if allowed. Don't do this
357352 // during testing as it will mess up the expected render count.
@@ -395,7 +390,6 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
395390 return {
396391 editorOptions : this . state . editorOptions ,
397392 baseTheme : baseTheme ,
398- contentTop : this . state . contentTop ,
399393 cellVMs : this . state . cellVMs ,
400394 history : this . state . history ,
401395 testMode : this . props . testMode ,
@@ -409,10 +403,9 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
409403 onCodeChange : this . codeChange
410404 } ;
411405 }
412- private getHeaderProps = ( baseTheme : string ) : IHeaderPanelProps => {
406+ private getToolbarProps = ( baseTheme : string ) : IToolbarPanelProps => {
413407 return {
414408 addMarkdown : this . addMarkdown ,
415- busy : this . state . busy ,
416409 collapseAll : this . collapseAll ,
417410 expandAll : this . expandAll ,
418411 export : this . export ,
@@ -422,17 +415,23 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
422415 redo : this . redo ,
423416 clearAll : this . clearAll ,
424417 skipDefault : this . props . skipDefault ,
425- showDataExplorer : this . showDataViewer ,
426- testMode : this . props . testMode ,
427- variableExplorerRef : this . variableExplorerRef ,
428418 canCollapseAll : this . canCollapseAll ( ) ,
429419 canExpandAll : this . canExpandAll ( ) ,
430420 canExport : this . canExport ( ) ,
431421 canUndo : this . canUndo ( ) ,
432422 canRedo : this . canRedo ( ) ,
423+ baseTheme : baseTheme
424+ } ;
425+ }
426+
427+ private getVariableProps = ( baseTheme : string ) : IVariablePanelProps => {
428+ return {
429+ busy : this . state . busy ,
430+ showDataExplorer : this . showDataViewer ,
431+ testMode : this . props . testMode ,
432+ variableExplorerRef : this . variableExplorerRef ,
433433 refreshVariables : this . refreshVariables ,
434434 variableExplorerToggled : this . variableExplorerToggled ,
435- onHeightChange : this . onHeaderHeightChange ,
436435 baseTheme : baseTheme
437436 } ;
438437 }
0 commit comments