@jupyter-notebook/docmanager-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 +14 -7
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
import { PageConfig, PathExt } from '@jupyterlab/coreutils';
|
|
3
|
+
import { PageConfig, PathExt, URLExt } from '@jupyterlab/coreutils';
|
|
4
4
|
import { IDocumentWidgetOpener } from '@jupyterlab/docmanager';
|
|
5
|
-
import { INotebookShell } from '@jupyter-notebook/application';
|
|
5
|
+
import { INotebookPathOpener, INotebookShell, defaultNotebookPathOpener, } from '@jupyter-notebook/application';
|
|
6
6
|
import { Signal } from '@lumino/signaling';
|
|
7
7
|
/**
|
|
8
8
|
* A plugin to open documents in a new browser tab.
|
|
@@ -11,11 +11,12 @@ import { Signal } from '@lumino/signaling';
|
|
|
11
11
|
const opener = {
|
|
12
12
|
id: '@jupyter-notebook/docmanager-extension:opener',
|
|
13
13
|
autoStart: true,
|
|
14
|
-
optional: [INotebookShell],
|
|
14
|
+
optional: [INotebookPathOpener, INotebookShell],
|
|
15
15
|
provides: IDocumentWidgetOpener,
|
|
16
|
-
activate: (app, notebookShell) => {
|
|
16
|
+
activate: (app, notebookPathOpener, notebookShell) => {
|
|
17
17
|
const baseUrl = PageConfig.getBaseUrl();
|
|
18
18
|
const docRegistry = app.docRegistry;
|
|
19
|
+
const pathOpener = notebookPathOpener !== null && notebookPathOpener !== void 0 ? notebookPathOpener : defaultNotebookPathOpener;
|
|
19
20
|
let id = 0;
|
|
20
21
|
return new (class {
|
|
21
22
|
constructor() {
|
|
@@ -35,13 +36,19 @@ const opener = {
|
|
|
35
36
|
widgetName.includes('Notebook')) {
|
|
36
37
|
route = 'notebooks';
|
|
37
38
|
}
|
|
38
|
-
let url = `${baseUrl}${route}/${path}`;
|
|
39
39
|
// append ?factory only if it's not the default
|
|
40
40
|
const defaultFactory = docRegistry.defaultWidgetFactory(path);
|
|
41
|
+
let searchParams = undefined;
|
|
41
42
|
if (widgetName !== defaultFactory.name) {
|
|
42
|
-
|
|
43
|
+
searchParams = new URLSearchParams({
|
|
44
|
+
factory: widgetName,
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
pathOpener.open({
|
|
48
|
+
prefix: URLExt.join(baseUrl, route),
|
|
49
|
+
path,
|
|
50
|
+
searchParams,
|
|
51
|
+
});
|
|
45
52
|
// dispose the widget since it is not used on this page
|
|
46
53
|
widget.dispose();
|
|
47
54
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/docmanager-extension",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
4
4
|
"description": "Jupyter Notebook - Document Manager Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"watch": "tsc -b --watch"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@jupyter-notebook/application": "^7.0.
|
|
42
|
-
"@jupyterlab/application": "^4.0.
|
|
43
|
-
"@jupyterlab/coreutils": "^6.0.
|
|
44
|
-
"@jupyterlab/docmanager": "^4.0.
|
|
45
|
-
"@jupyterlab/docregistry": "^4.0.
|
|
46
|
-
"@jupyterlab/services": "^7.0.
|
|
41
|
+
"@jupyter-notebook/application": "^7.0.5",
|
|
42
|
+
"@jupyterlab/application": "^4.0.7",
|
|
43
|
+
"@jupyterlab/coreutils": "^6.0.7",
|
|
44
|
+
"@jupyterlab/docmanager": "^4.0.7",
|
|
45
|
+
"@jupyterlab/docregistry": "^4.0.7",
|
|
46
|
+
"@jupyterlab/services": "^7.0.7",
|
|
47
47
|
"@lumino/algorithm": "^2.0.1",
|
|
48
48
|
"@lumino/signaling": "^2.1.2"
|
|
49
49
|
},
|