Explorar o código

Update terminal example

Steven Silvester %!s(int64=8) %!d(string=hai) anos
pai
achega
5f3f56df81
Modificáronse 2 ficheiros con 13 adicións e 11 borrados
  1. 2 3
      examples/terminal/package.json
  2. 11 8
      examples/terminal/src/index.ts

+ 2 - 3
examples/terminal/package.json

@@ -4,15 +4,13 @@
   "scripts": {
     "build": "tsc --project src && webpack --config webpack.conf.js",
     "clean": "rimraf build && rimraf node_modules",
-    "postinstall": "npm dedupe",
     "update": "rimraf node_modules/jupyterlab && npm install",
     "watch": "watch 'npm run update && npm run build' ../../src src --wait 10"
   },
   "dependencies": {
     "jupyter-js-services": "^0.17.0",
     "jupyterlab": "file:../..",
-    "phosphor-dockpanel": "^0.9.7",
-    "url-loader": "^0.5.7",
+    "phosphor": "^0.6.0",
     "xterm": "^1.0.0"
   },
   "devDependencies": {
@@ -21,6 +19,7 @@
     "rimraf": "^2.5.2",
     "style-loader": "^0.13.1",
     "typescript": "^1.8.10",
+    "url-loader": "^0.5.7",
     "watch": "^0.18.0",
     "webpack": "^1.13.0"
   }

+ 11 - 8
examples/terminal/src/index.ts

@@ -5,16 +5,19 @@ import {
   createTerminalSession
 } from 'jupyter-js-services';
 
+import {
+  TerminalWidget
+} from 'jupyterlab/lib/terminal';
+
 import {
   DockPanel
-} from 'phosphor-dockpanel';
+} from 'phosphor/lib/ui/dockpanel';
 
 import {
-  TerminalWidget
-} from 'jupyterlab/lib/terminal';
+  Widget
+} from 'phosphor/lib/ui/widget';
 
-import 'jupyterlab/lib/index.css';
-import 'jupyterlab/lib/theme.css';
+import 'jupyterlab/lib/default-theme/index.css';
 
 
 function main(): void {
@@ -33,10 +36,10 @@ function main(): void {
   term1.title.closable = true;
   term2.title.closable = true;
   let dock = new DockPanel();
-  dock.insertTabBefore(term1);
-  dock.insertTabBefore(term2);
+  dock.addWidget(term1);
+  dock.addWidget(term2, { mode: 'tab-before' });
 
-  dock.attach(document.body);
+  Widget.attach(dock, document.body);
   dock.id = 'main';
 
   window.onresize = () => dock.fit();