@jupyter-notebook/lab-extension 7.0.0-alpha.15 → 7.0.0-alpha.16
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 +5 -8
- package/package.json +10 -9
package/lib/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { INotebookTracker } from '@jupyterlab/notebook';
|
|
|
7
7
|
import { ITranslator } from '@jupyterlab/translation';
|
|
8
8
|
import { Menu, MenuBar } from '@lumino/widgets';
|
|
9
9
|
import { INotebookShell } from '@jupyter-notebook/application';
|
|
10
|
+
import { caretDownIcon } from '@jupyterlab/ui-components';
|
|
10
11
|
/**
|
|
11
12
|
* The command IDs used by the application plugin.
|
|
12
13
|
*/
|
|
@@ -28,22 +29,17 @@ var CommandIDs;
|
|
|
28
29
|
/**
|
|
29
30
|
* A plugin to add custom toolbar items to the notebook page
|
|
30
31
|
*/
|
|
31
|
-
const
|
|
32
|
+
const interfaceSwitcher = {
|
|
32
33
|
id: '@jupyter-notebook/lab-extension:interface-switcher',
|
|
33
34
|
autoStart: true,
|
|
34
|
-
requires: [ITranslator],
|
|
35
|
+
requires: [ITranslator, INotebookTracker],
|
|
35
36
|
optional: [
|
|
36
|
-
INotebookTracker,
|
|
37
37
|
ICommandPalette,
|
|
38
38
|
INotebookShell,
|
|
39
39
|
ILabShell,
|
|
40
40
|
IToolbarWidgetRegistry
|
|
41
41
|
],
|
|
42
42
|
activate: (app, translator, notebookTracker, palette, notebookShell, labShell, toolbarRegistry) => {
|
|
43
|
-
if (!notebookTracker) {
|
|
44
|
-
// to prevent showing the toolbar button in non-notebook pages
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
43
|
const { commands, shell } = app;
|
|
48
44
|
const baseUrl = PageConfig.getBaseUrl();
|
|
49
45
|
const trans = translator.load('notebook');
|
|
@@ -53,6 +49,7 @@ const launchButtons = {
|
|
|
53
49
|
const menubar = new MenuBar(overflowOptions);
|
|
54
50
|
const switcher = new Menu({ commands });
|
|
55
51
|
switcher.title.label = trans.__('Interface');
|
|
52
|
+
switcher.title.icon = caretDownIcon;
|
|
56
53
|
menubar.addMenu(switcher);
|
|
57
54
|
const isEnabled = () => {
|
|
58
55
|
return (notebookTracker.currentWidget !== null &&
|
|
@@ -131,6 +128,6 @@ const launchNotebookTree = {
|
|
|
131
128
|
*/
|
|
132
129
|
const plugins = [
|
|
133
130
|
launchNotebookTree,
|
|
134
|
-
|
|
131
|
+
interfaceSwitcher
|
|
135
132
|
];
|
|
136
133
|
export default plugins;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/lab-extension",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.16",
|
|
4
4
|
"description": "Jupyter Notebook - Lab Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -43,18 +43,19 @@
|
|
|
43
43
|
"watch:src": "tsc -w"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@jupyter-notebook/application": "^7.0.0-alpha.
|
|
47
|
-
"@jupyterlab/application": "^4.0.0-alpha.
|
|
48
|
-
"@jupyterlab/apputils": "^4.0.0-alpha.
|
|
49
|
-
"@jupyterlab/coreutils": "^6.0.0-alpha.
|
|
50
|
-
"@jupyterlab/docregistry": "^4.0.0-alpha.
|
|
51
|
-
"@jupyterlab/notebook": "^4.0.0-alpha.
|
|
52
|
-
"@jupyterlab/translation": "^4.0.0-alpha.
|
|
46
|
+
"@jupyter-notebook/application": "^7.0.0-alpha.16",
|
|
47
|
+
"@jupyterlab/application": "^4.0.0-alpha.21",
|
|
48
|
+
"@jupyterlab/apputils": "^4.0.0-alpha.21",
|
|
49
|
+
"@jupyterlab/coreutils": "^6.0.0-alpha.21",
|
|
50
|
+
"@jupyterlab/docregistry": "^4.0.0-alpha.21",
|
|
51
|
+
"@jupyterlab/notebook": "^4.0.0-alpha.21",
|
|
52
|
+
"@jupyterlab/translation": "^4.0.0-alpha.21",
|
|
53
|
+
"@jupyterlab/ui-components": "^4.0.0-alpha.36",
|
|
53
54
|
"@lumino/commands": "^2.0.0-rc.1",
|
|
54
55
|
"@lumino/disposable": "^2.0.0-rc.1"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@jupyterlab/builder": "^4.0.0-alpha.
|
|
58
|
+
"@jupyterlab/builder": "^4.0.0-alpha.21",
|
|
58
59
|
"rimraf": "^3.0.2",
|
|
59
60
|
"typescript": "5.0.1-rc"
|
|
60
61
|
},
|