@jupyter-notebook/lab-extension 7.0.0-alpha.14 → 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.
Files changed (2) hide show
  1. package/lib/index.js +10 -10
  2. package/package.json +13 -12
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,28 +29,27 @@ var CommandIDs;
28
29
  /**
29
30
  * A plugin to add custom toolbar items to the notebook page
30
31
  */
31
- const launchButtons = {
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');
50
- const menubar = new MenuBar();
46
+ const overflowOptions = {
47
+ overflowMenuOptions: { isVisible: false }
48
+ };
49
+ const menubar = new MenuBar(overflowOptions);
51
50
  const switcher = new Menu({ commands });
52
51
  switcher.title.label = trans.__('Interface');
52
+ switcher.title.icon = caretDownIcon;
53
53
  menubar.addMenu(switcher);
54
54
  const isEnabled = () => {
55
55
  return (notebookTracker.currentWidget !== null &&
@@ -92,7 +92,7 @@ const launchButtons = {
92
92
  }
93
93
  if (toolbarRegistry) {
94
94
  toolbarRegistry.addFactory('Notebook', 'interfaceSwitcher', panel => {
95
- const menubar = new MenuBar();
95
+ const menubar = new MenuBar(overflowOptions);
96
96
  menubar.addMenu(switcher);
97
97
  menubar.addClass('jp-InterfaceSwitcher');
98
98
  return menubar;
@@ -128,6 +128,6 @@ const launchNotebookTree = {
128
128
  */
129
129
  const plugins = [
130
130
  launchNotebookTree,
131
- launchButtons
131
+ interfaceSwitcher
132
132
  ];
133
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.14",
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,20 +43,21 @@
43
43
  "watch:src": "tsc -w"
44
44
  },
45
45
  "dependencies": {
46
- "@jupyter-notebook/application": "^7.0.0-alpha.14",
47
- "@jupyterlab/application": "^4.0.0-alpha.19",
48
- "@jupyterlab/apputils": "^4.0.0-alpha.19",
49
- "@jupyterlab/coreutils": "^6.0.0-alpha.19",
50
- "@jupyterlab/docregistry": "^4.0.0-alpha.19",
51
- "@jupyterlab/notebook": "^4.0.0-alpha.19",
52
- "@jupyterlab/translation": "^4.0.0-alpha.19",
53
- "@lumino/commands": "^2.0.0-beta.1",
54
- "@lumino/disposable": "^2.0.0-beta.1"
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",
54
+ "@lumino/commands": "^2.0.0-rc.1",
55
+ "@lumino/disposable": "^2.0.0-rc.1"
55
56
  },
56
57
  "devDependencies": {
57
- "@jupyterlab/builder": "^4.0.0-alpha.19",
58
+ "@jupyterlab/builder": "^4.0.0-alpha.21",
58
59
  "rimraf": "^3.0.2",
59
- "typescript": "5.0.0-beta"
60
+ "typescript": "5.0.1-rc"
60
61
  },
61
62
  "publishConfig": {
62
63
  "access": "public"