@@ -19,12 +19,13 @@ import { getSettings, updateSettings } from '../react-common/settingsReactSide';
19
19
import { StyleInjector } from '../react-common/styleInjector' ;
20
20
import { Cell , ICellViewModel } from './cell' ;
21
21
import { ContentPanel , IContentPanelProps } from './contentPanel' ;
22
- import { HeaderPanel , IHeaderPanelProps } from './headerPanel' ;
23
22
import { InputHistory } from './inputHistory' ;
24
23
import { IntellisenseProvider } from './intellisenseProvider' ;
25
24
import { createCellVM , createEditableCellVM , extractInputText , generateTestState , IMainPanelState } from './mainPanelState' ;
26
25
import { initializeTokenizer , registerMonacoLanguage } from './tokenizer' ;
26
+ import { IToolbarPanelProps , ToolbarPanel } from './toolbarPanel' ;
27
27
import { VariableExplorer } from './variableExplorer' ;
28
+ import { IVariablePanelProps , VariablePanel } from './variablePanel' ;
28
29
29
30
import './mainPanel.css' ;
30
31
@@ -62,7 +63,6 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
62
63
redoStack : [ ] ,
63
64
submittedText : false ,
64
65
history : new InputHistory ( ) ,
65
- contentTop : 24 ,
66
66
editCellVM : getSettings && getSettings ( ) . allowInput ? createEditableCellVM ( 1 ) : undefined ,
67
67
editorOptions : this . computeEditorOptions ( )
68
68
} ;
@@ -138,22 +138,17 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
138
138
darkChanged = { this . darkChanged }
139
139
monacoThemeChanged = { this . monacoThemeChanged }
140
140
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 ) }
145
143
</ 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 ) }
152
146
</ 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 ) }
157
152
</ div >
158
153
</ div >
159
154
) ;
@@ -262,9 +257,14 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
262
257
// this.addCell(cell);
263
258
// }
264
259
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 } /> ;
268
268
}
269
269
270
270
private renderContentPanel ( baseTheme : string ) {
@@ -347,11 +347,6 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
347
347
return { } ;
348
348
}
349
349
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
-
355
350
private darkChanged = ( newDark : boolean ) => {
356
351
// update our base theme if allowed. Don't do this
357
352
// during testing as it will mess up the expected render count.
@@ -395,7 +390,6 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
395
390
return {
396
391
editorOptions : this . state . editorOptions ,
397
392
baseTheme : baseTheme ,
398
- contentTop : this . state . contentTop ,
399
393
cellVMs : this . state . cellVMs ,
400
394
history : this . state . history ,
401
395
testMode : this . props . testMode ,
@@ -409,10 +403,9 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
409
403
onCodeChange : this . codeChange
410
404
} ;
411
405
}
412
- private getHeaderProps = ( baseTheme : string ) : IHeaderPanelProps => {
406
+ private getToolbarProps = ( baseTheme : string ) : IToolbarPanelProps => {
413
407
return {
414
408
addMarkdown : this . addMarkdown ,
415
- busy : this . state . busy ,
416
409
collapseAll : this . collapseAll ,
417
410
expandAll : this . expandAll ,
418
411
export : this . export ,
@@ -422,17 +415,23 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
422
415
redo : this . redo ,
423
416
clearAll : this . clearAll ,
424
417
skipDefault : this . props . skipDefault ,
425
- showDataExplorer : this . showDataViewer ,
426
- testMode : this . props . testMode ,
427
- variableExplorerRef : this . variableExplorerRef ,
428
418
canCollapseAll : this . canCollapseAll ( ) ,
429
419
canExpandAll : this . canExpandAll ( ) ,
430
420
canExport : this . canExport ( ) ,
431
421
canUndo : this . canUndo ( ) ,
432
422
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 ,
433
433
refreshVariables : this . refreshVariables ,
434
434
variableExplorerToggled : this . variableExplorerToggled ,
435
- onHeightChange : this . onHeaderHeightChange ,
436
435
baseTheme : baseTheme
437
436
} ;
438
437
}
0 commit comments