Skip to content

Commit 71df129

Browse files
authored
Merge pull request #34 from jtpio/jlab-2
Update to JLab 2.0 and latest ipywidgets
2 parents 804d875 + 7c42ce8 commit 71df129

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Control JupyterLab from Python notebooks.
1111
The goal is to provide access to most of the JupyterLab environment from Python notebooks. For example:
1212

1313
- Adding widgets to the main area `DockPanel`, left, right or top area
14-
- Build more advanced interfaces leveraging `SplitPanel`, `Toolbar` and other Phosphor widgets
14+
- Build more advanced interfaces leveraging `SplitPanel`, `Toolbar` and other Lumino widgets
1515
- Launch arbitrary commands (new terminal, change theme, open file and so on)
1616
- Open a workspace with a specific layout
1717
- Listen to JupyterLab signals (notebook opened, console closed) and trigger Python callbacks

css/widget.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Default Split Handle Color*/
2-
.jp-JupyterPhosphorSplitPanelWidget .p-SplitPanel-handle {
2+
.jp-JupyterLuminoSplitPanelWidget .p-SplitPanel-handle {
33
background-color: var(--jp-border-color2);
44
}
55

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@
5959
]
6060
},
6161
"dependencies": {
62-
"@jupyter-widgets/base": "^1 || ^2",
63-
"@jupyter-widgets/controls": "^1.5.3",
64-
"@jupyter-widgets/jupyterlab-manager": "^1.0.0",
65-
"@jupyterlab/application": "^1.2.0",
66-
"@jupyterlab/apputils": "^1.2.1",
67-
"@jupyterlab/observables": "^2.4.0",
68-
"@phosphor/commands": "^1.7.2",
69-
"@phosphor/disposable": "1.3.1",
70-
"@phosphor/widgets": "^1.9.3"
62+
"@jupyter-widgets/base": "^1 || ^3.0.0-rc.0",
63+
"@jupyter-widgets/controls": "^2.0.0-rc.12",
64+
"@jupyter-widgets/jupyterlab-manager": "^2.0.0-rc.3",
65+
"@jupyterlab/application": "^2.0.0",
66+
"@jupyterlab/apputils": "^2.0.0",
67+
"@jupyterlab/observables": "^3.0.0",
68+
"@lumino/commands": "^1.10.1",
69+
"@lumino/disposable": "^1.3.5",
70+
"@lumino/widgets": "^1.11.1"
7171
},
7272
"devDependencies": {
73-
"@phosphor/application": "^1.6.0",
73+
"@lumino/application": "^1.8.4",
7474
"@types/expect.js": "^0.3.29",
7575
"@types/mocha": "^5.2.5",
7676
"@types/node": "^10.11.6",

src/widgets/commands.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
import { ObservableMap } from '@jupyterlab/observables';
55

6-
import { CommandRegistry } from '@phosphor/commands';
6+
import { ISerializers, WidgetModel } from '@jupyter-widgets/base';
77

8-
import { IDisposable } from '@phosphor/disposable';
8+
import { CommandRegistry } from '@lumino/commands';
99

10-
import { ISerializers, WidgetModel } from '@jupyter-widgets/base';
10+
import { IDisposable } from '@lumino/disposable';
1111

1212
import { MODULE_NAME, MODULE_VERSION } from '../version';
1313

src/widgets/split_panel.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ import { JupyterPhosphorWidget, DOMWidgetView } from '@jupyter-widgets/base';
55

66
import { VBoxView } from '@jupyter-widgets/controls';
77

8-
import { Message } from '@phosphor/messaging';
8+
import { Message } from '@lumino/messaging';
99

10-
import { SplitPanel } from '@phosphor/widgets';
10+
import { SplitPanel } from '@lumino/widgets';
1111

1212
import $ from 'jquery';
1313

1414
import { PanelModel } from './panel';
1515

1616
import { MODULE_NAME, MODULE_VERSION } from '../version';
1717

18-
class JupyterPhosphorSplitPanelWidget extends SplitPanel {
18+
class JupyterLuminoSplitPanelWidget extends SplitPanel {
1919
constructor(options: JupyterPhosphorWidget.IOptions & SplitPanel.IOptions) {
2020
let view = options.view;
2121
delete options.view;
2222
super(options);
23-
this.addClass('jp-JupyterPhosphorSplitPanelWidget');
23+
this.addClass('jp-JupyterLuminoSplitPanelWidget');
2424
this._view = view;
2525
}
2626

@@ -66,7 +66,7 @@ export class SplitPanelModel extends PanelModel {
6666

6767
export class SplitPanelView extends VBoxView {
6868
_createElement(tagName: string) {
69-
this.pWidget = new JupyterPhosphorSplitPanelWidget({
69+
this.pWidget = new JupyterLuminoSplitPanelWidget({
7070
view: this,
7171
orientation: this.model.get('orientation')
7272
}) as any;
@@ -84,7 +84,7 @@ export class SplitPanelView extends VBoxView {
8484

8585
initialize(parameters: any) {
8686
super.initialize(parameters);
87-
const pWidget = (this.pWidget as any) as JupyterPhosphorSplitPanelWidget;
87+
const pWidget = (this.pWidget as any) as JupyterLuminoSplitPanelWidget;
8888
this.model.on('change:orientation', () => {
8989
const orientation = this.model.get('orientation');
9090
pWidget.orientation = orientation;

0 commit comments

Comments
 (0)