@jupyter-notebook/application-extension 7.0.0-alpha.2 → 7.0.0-alpha.3

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 CHANGED
@@ -158,6 +158,19 @@ const menus = {
158
158
  }
159
159
  }
160
160
  };
161
+ /**
162
+ * A plugin to provide a spacer at rank 900 in the menu area
163
+ */
164
+ const menuSpacer = {
165
+ id: '@jupyter-notebook/application-extension:menu-spacer',
166
+ autoStart: true,
167
+ activate: (app) => {
168
+ const menu = new Widget();
169
+ menu.id = DOMUtils.createDomID();
170
+ menu.addClass('jp-NotebookSpacer');
171
+ app.shell.add(menu, 'menu', { rank: 900 });
172
+ }
173
+ };
161
174
  /**
162
175
  * Add commands to open the tree and running pages.
163
176
  */
@@ -165,8 +178,8 @@ const pages = {
165
178
  id: '@jupyter-notebook/application-extension:pages',
166
179
  autoStart: true,
167
180
  requires: [ITranslator],
168
- optional: [ICommandPalette, IMainMenu],
169
- activate: (app, translator, palette, menu) => {
181
+ optional: [ICommandPalette],
182
+ activate: (app, translator, palette) => {
170
183
  const trans = translator.load('notebook');
171
184
  const baseUrl = PageConfig.getBaseUrl();
172
185
  app.commands.addCommand(CommandIDs.openLab, {
@@ -186,9 +199,6 @@ const pages = {
186
199
  palette.addItem({ command, category: 'View' });
187
200
  });
188
201
  }
189
- if (menu) {
190
- menu.viewMenu.addGroup([{ command: CommandIDs.openLab }, { command: CommandIDs.openTree }], 0);
191
- }
192
202
  }
193
203
  };
194
204
  /**
@@ -251,25 +261,6 @@ const shell = {
251
261
  autoStart: true,
252
262
  provides: INotebookShell
253
263
  };
254
- /**
255
- * A plugin to provide a spacer at rank 900 for flex panels
256
- * TODO: reuse upstream @jupyterlab/application-extension:top-spacer plugin when fixed
257
- * in https://github.com/jupyterlab/jupyterlab/pull/11900
258
- */
259
- const spacer = {
260
- id: '@jupyter-notebook/application-extension:spacer',
261
- autoStart: true,
262
- activate: (app) => {
263
- const top = new Widget();
264
- top.id = DOMUtils.createDomID();
265
- top.addClass('jp-NotebookSpacer');
266
- app.shell.add(top, 'top', { rank: 900 });
267
- const menu = new Widget();
268
- menu.id = DOMUtils.createDomID();
269
- menu.addClass('jp-NotebookSpacer');
270
- app.shell.add(menu, 'menu', { rank: 900 });
271
- }
272
- };
273
264
  /**
274
265
  * The default JupyterLab application status provider.
275
266
  */
@@ -398,8 +389,8 @@ const title = {
398
389
  const topVisibility = {
399
390
  id: '@jupyter-notebook/application-extension:top',
400
391
  requires: [INotebookShell, ITranslator],
401
- optional: [IMainMenu, ISettingRegistry],
402
- activate: (app, notebookShell, translator, menu, settingRegistry) => {
392
+ optional: [ISettingRegistry],
393
+ activate: (app, notebookShell, translator, settingRegistry) => {
403
394
  const trans = translator.load('notebook');
404
395
  const top = notebookShell.top;
405
396
  const pluginId = topVisibility.id;
@@ -413,9 +404,6 @@ const topVisibility = {
413
404
  },
414
405
  isToggled: () => top.isVisible
415
406
  });
416
- if (menu) {
417
- menu.viewMenu.addGroup([{ command: CommandIDs.toggleTop }], 2);
418
- }
419
407
  let settingsOverride = false;
420
408
  if (settingRegistry) {
421
409
  const loadSettings = settingRegistry.load(pluginId);
@@ -522,8 +510,8 @@ const zen = {
522
510
  id: '@jupyter-notebook/application-extension:zen',
523
511
  autoStart: true,
524
512
  requires: [ITranslator],
525
- optional: [ICommandPalette, INotebookShell, IMainMenu],
526
- activate: (app, translator, palette, notebookShell, menu) => {
513
+ optional: [ICommandPalette, INotebookShell],
514
+ activate: (app, translator, palette, notebookShell) => {
527
515
  const { commands } = app;
528
516
  const elem = document.documentElement;
529
517
  const trans = translator.load('notebook');
@@ -559,9 +547,6 @@ const zen = {
559
547
  if (palette) {
560
548
  palette.addItem({ command: CommandIDs.toggleZen, category: 'Mode' });
561
549
  }
562
- if (menu) {
563
- menu.viewMenu.addGroup([{ command: CommandIDs.toggleZen }], 3);
564
- }
565
550
  }
566
551
  };
567
552
  /**
@@ -571,13 +556,13 @@ const plugins = [
571
556
  dirty,
572
557
  logo,
573
558
  menus,
559
+ menuSpacer,
574
560
  opener,
575
561
  pages,
576
562
  paths,
577
563
  router,
578
564
  sessionDialogs,
579
565
  shell,
580
- spacer,
581
566
  status,
582
567
  tabTitle,
583
568
  title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/application-extension",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.0.0-alpha.3",
4
4
  "description": "Jupyter Notebook - Application Extension",
5
5
  "homepage": "https://github.com/jupyter/notebook",
6
6
  "bugs": {
@@ -39,27 +39,27 @@
39
39
  "watch": "tsc -b --watch"
40
40
  },
41
41
  "dependencies": {
42
- "@jupyter-notebook/application": "^7.0.0-alpha.2",
43
- "@jupyter-notebook/ui-components": "^7.0.0-alpha.2",
44
- "@jupyterlab/application": "^4.0.0-alpha.7",
45
- "@jupyterlab/apputils": "^4.0.0-alpha.7",
46
- "@jupyterlab/celltags": "^4.0.0-alpha.7",
47
- "@jupyterlab/codeeditor": "^4.0.0-alpha.7",
48
- "@jupyterlab/codemirror": "^4.0.0-alpha.7",
49
- "@jupyterlab/console": "^4.0.0-alpha.7",
50
- "@jupyterlab/coreutils": "^6.0.0-alpha.7",
51
- "@jupyterlab/docmanager": "^4.0.0-alpha.7",
52
- "@jupyterlab/docregistry": "^4.0.0-alpha.7",
53
- "@jupyterlab/mainmenu": "^4.0.0-alpha.7",
54
- "@jupyterlab/settingregistry": "^4.0.0-alpha.7",
55
- "@jupyterlab/translation": "^4.0.0-alpha.7",
42
+ "@jupyter-notebook/application": "^7.0.0-alpha.3",
43
+ "@jupyter-notebook/ui-components": "^7.0.0-alpha.3",
44
+ "@jupyterlab/application": "^4.0.0-alpha.9",
45
+ "@jupyterlab/apputils": "^4.0.0-alpha.9",
46
+ "@jupyterlab/celltags": "^4.0.0-alpha.9",
47
+ "@jupyterlab/codeeditor": "^4.0.0-alpha.9",
48
+ "@jupyterlab/codemirror": "^4.0.0-alpha.9",
49
+ "@jupyterlab/console": "^4.0.0-alpha.9",
50
+ "@jupyterlab/coreutils": "^6.0.0-alpha.9",
51
+ "@jupyterlab/docmanager": "^4.0.0-alpha.9",
52
+ "@jupyterlab/docregistry": "^4.0.0-alpha.9",
53
+ "@jupyterlab/mainmenu": "^4.0.0-alpha.9",
54
+ "@jupyterlab/settingregistry": "^4.0.0-alpha.9",
55
+ "@jupyterlab/translation": "^4.0.0-alpha.9",
56
56
  "@lumino/coreutils": "^1.12.0",
57
57
  "@lumino/disposable": "^1.10.1",
58
58
  "@lumino/widgets": "^1.31.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "rimraf": "~3.0.0",
62
- "typescript": "~4.1.3"
62
+ "typescript": "~4.6.3"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"
package/schema/menus.json CHANGED
@@ -8,13 +8,44 @@
8
8
  "items": [
9
9
  {
10
10
  "command": "application:rename",
11
- "rank": 4
11
+ "rank": 4.5
12
12
  },
13
13
  {
14
14
  "command": "notebook:trust",
15
15
  "rank": 20
16
16
  }
17
17
  ]
18
+ },
19
+ {
20
+ "id": "jp-mainmenu-run",
21
+ "items": [
22
+ {
23
+ "type": "separator",
24
+ "rank": 1000
25
+ },
26
+ {
27
+ "type": "submenu",
28
+ "rank": 1010,
29
+ "submenu": {
30
+ "id": "jp-runmenu-change-cell-type",
31
+ "label": "Cell Type",
32
+ "items": [
33
+ {
34
+ "command": "notebook:change-cell-to-code",
35
+ "rank": 0
36
+ },
37
+ {
38
+ "command": "notebook:change-cell-to-markdown",
39
+ "rank": 0
40
+ },
41
+ {
42
+ "command": "notebook:change-cell-to-raw",
43
+ "rank": 0
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ ]
18
49
  }
19
50
  ]
20
51
  },
@@ -0,0 +1,24 @@
1
+ {
2
+ "title": "Jupyter Notebook Pages",
3
+ "description": "Jupyter Notebook Pages",
4
+ "jupyter.lab.menus": {
5
+ "main": [
6
+ {
7
+ "id": "jp-mainmenu-view",
8
+ "items": [
9
+ {
10
+ "command": "application:open-lab",
11
+ "rank": 2
12
+ },
13
+ {
14
+ "command": "application:open-tree",
15
+ "rank": 2
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ },
21
+ "properties": {},
22
+ "additionalProperties": false,
23
+ "type": "object"
24
+ }
package/schema/top.json CHANGED
@@ -3,6 +3,19 @@
3
3
  "jupyter.lab.setting-icon-label": "Jupyter Notebook Top Area",
4
4
  "title": "Jupyter Notebook Top Area",
5
5
  "description": "Jupyter Notebook Top Area settings",
6
+ "jupyter.lab.menus": {
7
+ "main": [
8
+ {
9
+ "id": "jp-mainmenu-view",
10
+ "items": [
11
+ {
12
+ "command": "application:toggle-top",
13
+ "rank": 2
14
+ }
15
+ ]
16
+ }
17
+ ]
18
+ },
6
19
  "properties": {
7
20
  "visible": {
8
21
  "type": "boolean",
@@ -0,0 +1,20 @@
1
+ {
2
+ "title": "Jupyter Notebook Zen Mode",
3
+ "description": "Jupyter Notebook Zen Mode",
4
+ "jupyter.lab.menus": {
5
+ "main": [
6
+ {
7
+ "id": "jp-mainmenu-view",
8
+ "items": [
9
+ {
10
+ "command": "application:toggle-zen",
11
+ "rank": 3
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ },
17
+ "properties": {},
18
+ "additionalProperties": false,
19
+ "type": "object"
20
+ }