@jupyter-notebook/application 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/app.d.ts +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/panelhandler.js +1 -1
- package/lib/pathopener.d.ts +12 -0
- package/lib/pathopener.js +20 -0
- package/lib/tokens.d.ts +48 -0
- package/lib/tokens.js +8 -0
- package/package.json +7 -7
package/lib/app.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/panelhandler.js
CHANGED
|
@@ -291,7 +291,7 @@ export class SidePanelPalette {
|
|
|
291
291
|
id: widget.id,
|
|
292
292
|
},
|
|
293
293
|
});
|
|
294
|
-
// Keep the disposableDelegate
|
|
294
|
+
// Keep the disposableDelegate object to be able to dispose of the item if the widget
|
|
295
295
|
// is remove from the side panel.
|
|
296
296
|
this._items.push({
|
|
297
297
|
widgetId: widget.id,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { INotebookPathOpener } from './tokens';
|
|
2
|
+
/**
|
|
3
|
+
* A class to open paths in new browser tabs in the Notebook application.
|
|
4
|
+
*/
|
|
5
|
+
declare class DefaultNotebookPathOpener implements INotebookPathOpener {
|
|
6
|
+
/**
|
|
7
|
+
* Open a path in a new browser tab.
|
|
8
|
+
*/
|
|
9
|
+
open(options: INotebookPathOpener.IOpenOptions): WindowProxy | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const defaultNotebookPathOpener: DefaultNotebookPathOpener;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { URLExt } from '@jupyterlab/coreutils';
|
|
4
|
+
/**
|
|
5
|
+
* A class to open paths in new browser tabs in the Notebook application.
|
|
6
|
+
*/
|
|
7
|
+
class DefaultNotebookPathOpener {
|
|
8
|
+
/**
|
|
9
|
+
* Open a path in a new browser tab.
|
|
10
|
+
*/
|
|
11
|
+
open(options) {
|
|
12
|
+
const { prefix, path, searchParams, target, features } = options;
|
|
13
|
+
const url = new URL(URLExt.join(prefix, path !== null && path !== void 0 ? path : ''), window.location.origin);
|
|
14
|
+
if (searchParams) {
|
|
15
|
+
url.search = searchParams.toString();
|
|
16
|
+
}
|
|
17
|
+
return window.open(url, target, features);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const defaultNotebookPathOpener = new DefaultNotebookPathOpener();
|
package/lib/tokens.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Token } from '@lumino/coreutils';
|
|
2
|
+
/**
|
|
3
|
+
* The INotebookPathOpener interface.
|
|
4
|
+
*/
|
|
5
|
+
export interface INotebookPathOpener {
|
|
6
|
+
/**
|
|
7
|
+
* Open a path in the application.
|
|
8
|
+
*
|
|
9
|
+
* @param options - The options used to open the path.
|
|
10
|
+
*/
|
|
11
|
+
open: (options: INotebookPathOpener.IOpenOptions) => WindowProxy | null;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace INotebookPathOpener {
|
|
14
|
+
/**
|
|
15
|
+
* The options used to open a path in the application.
|
|
16
|
+
*/
|
|
17
|
+
interface IOpenOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The URL prefix, which should include the base URL
|
|
20
|
+
*/
|
|
21
|
+
prefix: string;
|
|
22
|
+
/**
|
|
23
|
+
* The path to open in the application, e.g `setup.py`, or `notebooks/example.ipynb`
|
|
24
|
+
*/
|
|
25
|
+
path?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The extra search params to use in the URL.
|
|
28
|
+
*/
|
|
29
|
+
searchParams?: URLSearchParams;
|
|
30
|
+
/**
|
|
31
|
+
* Name of the browsing context the resource is being loaded into.
|
|
32
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/Window/open for more details.
|
|
33
|
+
*/
|
|
34
|
+
target?: string;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/Window/open for more details.
|
|
38
|
+
*/
|
|
39
|
+
features?: string;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The INotebookPathOpener token.
|
|
44
|
+
* The main purpose of this token is to allow other extensions or downstream applications
|
|
45
|
+
* to override the default behavior of opening a notebook in a new tab.
|
|
46
|
+
* It also allows passing the path as a URL search parameter, or other options to the window.open call.
|
|
47
|
+
*/
|
|
48
|
+
export declare const INotebookPathOpener: Token<INotebookPathOpener>;
|
package/lib/tokens.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Token } from '@lumino/coreutils';
|
|
2
|
+
/**
|
|
3
|
+
* The INotebookPathOpener token.
|
|
4
|
+
* The main purpose of this token is to allow other extensions or downstream applications
|
|
5
|
+
* to override the default behavior of opening a notebook in a new tab.
|
|
6
|
+
* It also allows passing the path as a URL search parameter, or other options to the window.open call.
|
|
7
|
+
*/
|
|
8
|
+
export const INotebookPathOpener = new Token('@jupyter-notebook/application:INotebookPathOpener');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/application",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
4
4
|
"description": "Jupyter Notebook - Application",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"watch": "tsc -b --watch"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jupyterlab/application": "^4.0.
|
|
46
|
-
"@jupyterlab/coreutils": "^6.0.
|
|
47
|
-
"@jupyterlab/docregistry": "^4.0.
|
|
48
|
-
"@jupyterlab/rendermime-interfaces": "^3.8.
|
|
49
|
-
"@jupyterlab/ui-components": "^4.0.
|
|
45
|
+
"@jupyterlab/application": "^4.0.7",
|
|
46
|
+
"@jupyterlab/coreutils": "^6.0.7",
|
|
47
|
+
"@jupyterlab/docregistry": "^4.0.7",
|
|
48
|
+
"@jupyterlab/rendermime-interfaces": "^3.8.7",
|
|
49
|
+
"@jupyterlab/ui-components": "^4.0.7",
|
|
50
50
|
"@lumino/algorithm": "^2.0.1",
|
|
51
51
|
"@lumino/coreutils": "^2.1.2",
|
|
52
52
|
"@lumino/messaging": "^2.0.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@babel/core": "^7.11.6",
|
|
59
59
|
"@babel/preset-env": "^7.12.1",
|
|
60
|
-
"@jupyterlab/testutils": "^4.0.
|
|
60
|
+
"@jupyterlab/testutils": "^4.0.7",
|
|
61
61
|
"@types/jest": "^29.2.5",
|
|
62
62
|
"jest": "^29.3.1",
|
|
63
63
|
"rimraf": "^3.0.2",
|