@jupyter-notebook/docmanager-extension 7.0.0-beta.4 → 7.0.0-rc.1
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 +8 -3
- package/package.json +6 -6
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { PageConfig, PathExt } from '@jupyterlab/coreutils';
|
|
4
4
|
import { IDocumentWidgetOpener } from '@jupyterlab/docmanager';
|
|
5
|
+
import { INotebookShell } from '@jupyter-notebook/application';
|
|
5
6
|
import { Signal } from '@lumino/signaling';
|
|
6
7
|
/**
|
|
7
8
|
* A plugin to open documents in a new browser tab.
|
|
@@ -10,8 +11,9 @@ import { Signal } from '@lumino/signaling';
|
|
|
10
11
|
const opener = {
|
|
11
12
|
id: '@jupyter-notebook/docmanager-extension:opener',
|
|
12
13
|
autoStart: true,
|
|
14
|
+
optional: [INotebookShell],
|
|
13
15
|
provides: IDocumentWidgetOpener,
|
|
14
|
-
activate: (app) => {
|
|
16
|
+
activate: (app, notebookShell) => {
|
|
15
17
|
const baseUrl = PageConfig.getBaseUrl();
|
|
16
18
|
const docRegistry = app.docRegistry;
|
|
17
19
|
let id = 0;
|
|
@@ -20,9 +22,12 @@ const opener = {
|
|
|
20
22
|
this._opened = new Signal(this);
|
|
21
23
|
}
|
|
22
24
|
open(widget, options) {
|
|
23
|
-
|
|
25
|
+
var _a, _b, _c;
|
|
26
|
+
const widgetName = (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : '';
|
|
24
27
|
const ref = options === null || options === void 0 ? void 0 : options.ref;
|
|
25
|
-
if
|
|
28
|
+
// check if there is an setting override and if it would add the widget in the main area
|
|
29
|
+
const userLayoutArea = (_c = (_b = notebookShell === null || notebookShell === void 0 ? void 0 : notebookShell.userLayout) === null || _b === void 0 ? void 0 : _b[widgetName]) === null || _c === void 0 ? void 0 : _c.area;
|
|
30
|
+
if (ref !== '_noref' && userLayoutArea === undefined) {
|
|
26
31
|
const path = widget.context.path;
|
|
27
32
|
const ext = PathExt.extname(path);
|
|
28
33
|
let route = 'edit';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/docmanager-extension",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-rc.1",
|
|
4
4
|
"description": "Jupyter Notebook - Document Manager Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"watch": "tsc -b --watch"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@jupyterlab/application": "^4.0.
|
|
42
|
-
"@jupyterlab/coreutils": "^6.0.
|
|
43
|
-
"@jupyterlab/docmanager": "^4.0.
|
|
44
|
-
"@jupyterlab/docregistry": "^4.0.
|
|
45
|
-
"@jupyterlab/services": "^7.0.
|
|
41
|
+
"@jupyterlab/application": "^4.0.2",
|
|
42
|
+
"@jupyterlab/coreutils": "^6.0.2",
|
|
43
|
+
"@jupyterlab/docmanager": "^4.0.2",
|
|
44
|
+
"@jupyterlab/docregistry": "^4.0.2",
|
|
45
|
+
"@jupyterlab/services": "^7.0.2",
|
|
46
46
|
"@lumino/algorithm": "^2.0.0",
|
|
47
47
|
"@lumino/signaling": "^2.1.1"
|
|
48
48
|
},
|