|
@@ -6,20 +6,20 @@ import {
|
|
} from 'jupyter-js-services';
|
|
} from 'jupyter-js-services';
|
|
|
|
|
|
import {
|
|
import {
|
|
- Message
|
|
|
|
-} from 'phosphor-messaging';
|
|
|
|
|
|
+ clearSignalData
|
|
|
|
+} from 'phosphor/lib/core/signaling';
|
|
|
|
|
|
import {
|
|
import {
|
|
- PanelLayout
|
|
|
|
-} from 'phosphor-panel';
|
|
|
|
|
|
+ Message
|
|
|
|
+} from 'phosphor/lib/core/messaging';
|
|
|
|
|
|
import {
|
|
import {
|
|
- clearSignalData
|
|
|
|
-} from 'phosphor-signaling';
|
|
|
|
|
|
+ PanelLayout
|
|
|
|
+} from 'phosphor/lib/ui/panel';
|
|
|
|
|
|
import {
|
|
import {
|
|
Widget
|
|
Widget
|
|
-} from 'phosphor-widget';
|
|
|
|
|
|
+} from 'phosphor/lib/ui/widget';
|
|
|
|
|
|
import {
|
|
import {
|
|
InspectionHandler
|
|
InspectionHandler
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
|
|
|
import {
|
|
import {
|
|
nbformat
|
|
nbformat
|
|
-} from '../notebook';
|
|
|
|
|
|
+} from '../notebook/notebook/nbformat';
|
|
|
|
|
|
import {
|
|
import {
|
|
CodeCellWidget, CodeCellModel, RawCellModel, RawCellWidget
|
|
CodeCellWidget, CodeCellModel, RawCellModel, RawCellWidget
|
|
@@ -54,8 +54,6 @@ import {
|
|
} from './history';
|
|
} from './history';
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* The class name added to console widgets.
|
|
* The class name added to console widgets.
|
|
*/
|
|
*/
|
|
@@ -104,7 +102,7 @@ class ConsoleWidget extends Widget {
|
|
|
|
|
|
// Because a completion widget may be passed in, check if it is attached.
|
|
// Because a completion widget may be passed in, check if it is attached.
|
|
if (!completion.isAttached) {
|
|
if (!completion.isAttached) {
|
|
- completion.attach(document.body);
|
|
|
|
|
|
+ Widget.attach(completion, document.body);
|
|
}
|
|
}
|
|
|
|
|
|
// Set up the completion handler.
|
|
// Set up the completion handler.
|
|
@@ -120,7 +118,7 @@ class ConsoleWidget extends Widget {
|
|
banner.addClass(BANNER_CLASS);
|
|
banner.addClass(BANNER_CLASS);
|
|
banner.readOnly = true;
|
|
banner.readOnly = true;
|
|
banner.model.source = '...';
|
|
banner.model.source = '...';
|
|
- layout.addChild(banner);
|
|
|
|
|
|
+ layout.addWidget(banner);
|
|
|
|
|
|
// Set the banner text and the mimetype.
|
|
// Set the banner text and the mimetype.
|
|
this.initialize();
|
|
this.initialize();
|
|
@@ -155,8 +153,8 @@ class ConsoleWidget extends Widget {
|
|
*/
|
|
*/
|
|
get prompt(): CodeCellWidget {
|
|
get prompt(): CodeCellWidget {
|
|
let layout = this.layout as PanelLayout;
|
|
let layout = this.layout as PanelLayout;
|
|
- let last = layout.childCount() - 1;
|
|
|
|
- return last > 0 ? layout.childAt(last) as CodeCellWidget : null;
|
|
|
|
|
|
+ let last = layout.widgets.length - 1;
|
|
|
|
+ return last > 0 ? layout.widgets.at(last) as CodeCellWidget : null;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -245,8 +243,8 @@ class ConsoleWidget extends Widget {
|
|
serialize(): nbformat.ICodeCell[] {
|
|
serialize(): nbformat.ICodeCell[] {
|
|
let output: nbformat.ICodeCell[] = [];
|
|
let output: nbformat.ICodeCell[] = [];
|
|
let layout = this.layout as PanelLayout;
|
|
let layout = this.layout as PanelLayout;
|
|
- for (let i = 1; i < layout.childCount(); i++) {
|
|
|
|
- let widget = layout.childAt(i) as CodeCellWidget;
|
|
|
|
|
|
+ for (let i = 1; i < layout.widgets.length; i++) {
|
|
|
|
+ let widget = layout.widgets.at(i) as CodeCellWidget;
|
|
output.push(widget.model.toJSON());
|
|
output.push(widget.model.toJSON());
|
|
}
|
|
}
|
|
return output;
|
|
return output;
|
|
@@ -354,7 +352,7 @@ class ConsoleWidget extends Widget {
|
|
prompt = this._renderer.createPrompt(this._rendermime);
|
|
prompt = this._renderer.createPrompt(this._rendermime);
|
|
prompt.mimetype = this._mimetype;
|
|
prompt.mimetype = this._mimetype;
|
|
prompt.addClass(PROMPT_CLASS);
|
|
prompt.addClass(PROMPT_CLASS);
|
|
- layout.addChild(prompt);
|
|
|
|
|
|
+ layout.addWidget(prompt);
|
|
|
|
|
|
// Hook up completion and history handling.
|
|
// Hook up completion and history handling.
|
|
let editor = prompt.editor;
|
|
let editor = prompt.editor;
|
|
@@ -375,7 +373,7 @@ class ConsoleWidget extends Widget {
|
|
*/
|
|
*/
|
|
private _handleInfo(info: KernelMessage.IInfoReply): void {
|
|
private _handleInfo(info: KernelMessage.IInfoReply): void {
|
|
let layout = this.layout as PanelLayout;
|
|
let layout = this.layout as PanelLayout;
|
|
- let banner = layout.childAt(0) as RawCellWidget;
|
|
|
|
|
|
+ let banner = layout.widgets.at(0) as RawCellWidget;
|
|
banner.model.source = info.banner;
|
|
banner.model.source = info.banner;
|
|
this._mimetype = mimetypeForLanguage(info.language_info);
|
|
this._mimetype = mimetypeForLanguage(info.language_info);
|
|
this.prompt.mimetype = this._mimetype;
|
|
this.prompt.mimetype = this._mimetype;
|