@jupyter-notebook/console-extension 7.0.3 → 7.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +10 -3
- package/package.json +5 -4
package/lib/index.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { IRouter, } from '@jupyterlab/application';
|
|
4
4
|
import { IConsoleTracker } from '@jupyterlab/console';
|
|
5
|
-
import { PageConfig } from '@jupyterlab/coreutils';
|
|
5
|
+
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
|
|
6
|
+
import { INotebookPathOpener, defaultNotebookPathOpener, } from '@jupyter-notebook/application';
|
|
6
7
|
import { find } from '@lumino/algorithm';
|
|
7
8
|
/**
|
|
8
9
|
* A plugin to open consoles in a new tab
|
|
@@ -39,9 +40,11 @@ const opener = {
|
|
|
39
40
|
const redirect = {
|
|
40
41
|
id: '@jupyter-notebook/console-extension:redirect',
|
|
41
42
|
requires: [IConsoleTracker],
|
|
43
|
+
optional: [INotebookPathOpener],
|
|
42
44
|
autoStart: true,
|
|
43
|
-
activate: (app, tracker) => {
|
|
45
|
+
activate: (app, tracker, notebookPathOpener) => {
|
|
44
46
|
const baseUrl = PageConfig.getBaseUrl();
|
|
47
|
+
const opener = notebookPathOpener !== null && notebookPathOpener !== void 0 ? notebookPathOpener : defaultNotebookPathOpener;
|
|
45
48
|
tracker.widgetAdded.connect(async (send, console) => {
|
|
46
49
|
const { sessionContext } = console;
|
|
47
50
|
await sessionContext.ready;
|
|
@@ -50,7 +53,11 @@ const redirect = {
|
|
|
50
53
|
// bail if the console is already added to the main area
|
|
51
54
|
return;
|
|
52
55
|
}
|
|
53
|
-
|
|
56
|
+
opener.open({
|
|
57
|
+
prefix: URLExt.join(baseUrl, 'consoles'),
|
|
58
|
+
path: sessionContext.path,
|
|
59
|
+
target: '_blank',
|
|
60
|
+
});
|
|
54
61
|
// the widget is not needed anymore
|
|
55
62
|
console.dispose();
|
|
56
63
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/console-extension",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
4
4
|
"description": "Jupyter Notebook - Console Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
"watch": "tsc -b --watch"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@jupyterlab/
|
|
43
|
-
"@jupyterlab/
|
|
41
|
+
"@jupyter-notebook/application": "^7.0.5",
|
|
42
|
+
"@jupyterlab/application": "^4.0.7",
|
|
43
|
+
"@jupyterlab/console": "^4.0.7",
|
|
44
|
+
"@jupyterlab/coreutils": "^6.0.7",
|
|
44
45
|
"@lumino/algorithm": "^2.0.1"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|