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

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
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Jupyter Development Team.
2
2
  // Distributed under the terms of the Modified BSD License.
3
3
  import { ILabStatus, IRouter, ITreePathUpdater, JupyterFrontEnd, Router } from '@jupyterlab/application';
4
- import { sessionContextDialogs, ISessionContextDialogs, DOMUtils, ICommandPalette } from '@jupyterlab/apputils';
4
+ import { sessionContextDialogs, ISessionContextDialogs, DOMUtils, ICommandPalette, IToolbarWidgetRegistry } from '@jupyterlab/apputils';
5
5
  import { ConsolePanel } from '@jupyterlab/console';
6
6
  import { PageConfig, PathExt, URLExt } from '@jupyterlab/coreutils';
7
7
  import { IDocumentManager, renameDialog } from '@jupyterlab/docmanager';
@@ -316,25 +316,30 @@ const title = {
316
316
  id: '@jupyter-notebook/application-extension:title',
317
317
  autoStart: true,
318
318
  requires: [INotebookShell, ITranslator],
319
- optional: [IDocumentManager, IRouter],
320
- activate: (app, shell, translator, docManager, router) => {
319
+ optional: [IDocumentManager, IRouter, IToolbarWidgetRegistry],
320
+ activate: (app, shell, translator, docManager, router, toolbarRegistry) => {
321
321
  const { commands } = app;
322
322
  const trans = translator.load('notebook');
323
- const widget = new Widget();
324
- widget.id = 'jp-title';
325
- app.shell.add(widget, 'top', { rank: 10 });
323
+ const node = document.createElement('div');
324
+ if (toolbarRegistry) {
325
+ toolbarRegistry.addFactory('TopBar', 'widgetTitle', toolbar => {
326
+ const widget = new Widget({ node });
327
+ widget.id = 'jp-title';
328
+ return widget;
329
+ });
330
+ }
326
331
  const addTitle = async () => {
327
332
  const current = shell.currentWidget;
328
333
  if (!current || !(current instanceof DocumentWidget)) {
329
334
  return;
330
335
  }
331
- if (widget.node.children.length > 0) {
336
+ if (node.children.length > 0) {
332
337
  return;
333
338
  }
334
339
  const h = document.createElement('h1');
335
340
  h.textContent = current.title.label.replace(STRIP_IPYNB, '');
336
- widget.node.appendChild(h);
337
- widget.node.style.marginLeft = '10px';
341
+ node.appendChild(h);
342
+ node.style.marginLeft = '10px';
338
343
  if (!docManager) {
339
344
  return;
340
345
  }
@@ -375,7 +380,7 @@ const title = {
375
380
  });
376
381
  }
377
382
  });
378
- widget.node.onclick = async () => {
383
+ node.onclick = async () => {
379
384
  void commands.execute(CommandIDs.rename);
380
385
  };
381
386
  };
@@ -389,8 +394,8 @@ const title = {
389
394
  const topVisibility = {
390
395
  id: '@jupyter-notebook/application-extension:top',
391
396
  requires: [INotebookShell, ITranslator],
392
- optional: [ISettingRegistry],
393
- activate: (app, notebookShell, translator, settingRegistry) => {
397
+ optional: [ISettingRegistry, ICommandPalette],
398
+ activate: (app, notebookShell, translator, settingRegistry, palette) => {
394
399
  const trans = translator.load('notebook');
395
400
  const top = notebookShell.top;
396
401
  const pluginId = topVisibility.id;
@@ -425,6 +430,9 @@ const topVisibility = {
425
430
  console.error(reason.message);
426
431
  });
427
432
  }
433
+ if (palette) {
434
+ palette.addItem({ command: CommandIDs.toggleTop, category: 'View' });
435
+ }
428
436
  const onChanged = () => {
429
437
  if (settingsOverride) {
430
438
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/application-extension",
3
- "version": "7.0.0-alpha.3",
3
+ "version": "7.0.0-alpha.4",
4
4
  "description": "Jupyter Notebook - Application Extension",
5
5
  "homepage": "https://github.com/jupyter/notebook",
6
6
  "bugs": {
@@ -39,23 +39,23 @@
39
39
  "watch": "tsc -b --watch"
40
40
  },
41
41
  "dependencies": {
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",
42
+ "@jupyter-notebook/application": "^7.0.0-alpha.4",
43
+ "@jupyter-notebook/ui-components": "^7.0.0-alpha.4",
44
+ "@jupyterlab/application": "^4.0.0-alpha.10",
45
+ "@jupyterlab/apputils": "^4.0.0-alpha.10",
46
+ "@jupyterlab/celltags": "^4.0.0-alpha.10",
47
+ "@jupyterlab/codeeditor": "^4.0.0-alpha.10",
48
+ "@jupyterlab/codemirror": "^4.0.0-alpha.10",
49
+ "@jupyterlab/console": "^4.0.0-alpha.10",
50
+ "@jupyterlab/coreutils": "^6.0.0-alpha.10",
51
+ "@jupyterlab/docmanager": "^4.0.0-alpha.10",
52
+ "@jupyterlab/docregistry": "^4.0.0-alpha.10",
53
+ "@jupyterlab/mainmenu": "^4.0.0-alpha.10",
54
+ "@jupyterlab/settingregistry": "^4.0.0-alpha.10",
55
+ "@jupyterlab/translation": "^4.0.0-alpha.10",
56
56
  "@lumino/coreutils": "^1.12.0",
57
57
  "@lumino/disposable": "^1.10.1",
58
- "@lumino/widgets": "^1.31.1"
58
+ "@lumino/widgets": "^1.32.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "rimraf": "~3.0.0",
package/schema/menus.json CHANGED
@@ -16,6 +16,18 @@
16
16
  }
17
17
  ]
18
18
  },
19
+ {
20
+ "id": "jp-mainmenu-view",
21
+ "items": [
22
+ {
23
+ "type": "submenu",
24
+ "disabled": true,
25
+ "submenu": {
26
+ "id": "jp-mainmenu-view-appearance"
27
+ }
28
+ }
29
+ ]
30
+ },
19
31
  {
20
32
  "id": "jp-mainmenu-run",
21
33
  "items": [
@@ -0,0 +1,10 @@
1
+ {
2
+ "title": "Title widget",
3
+ "description": "Title widget",
4
+ "jupyter.lab.toolbars": {
5
+ "TopBar": [{ "name": "widgetTitle", "rank": 10 }]
6
+ },
7
+ "properties": {},
8
+ "additionalProperties": false,
9
+ "type": "object"
10
+ }
package/style/base.css CHANGED
@@ -12,3 +12,7 @@
12
12
  .jp-MainAreaWidget {
13
13
  height: 100%;
14
14
  }
15
+
16
+ .jp-Toolbar > .jp-Toolbar-item {
17
+ height: unset;
18
+ }