@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 +20 -12
- package/package.json +16 -16
- package/schema/menus.json +12 -0
- package/schema/title.json +10 -0
- package/style/base.css +4 -0
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
|
|
324
|
-
|
|
325
|
-
|
|
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 (
|
|
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
|
-
|
|
337
|
-
|
|
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
|
-
|
|
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
|
+
"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.
|
|
43
|
-
"@jupyter-notebook/ui-components": "^7.0.0-alpha.
|
|
44
|
-
"@jupyterlab/application": "^4.0.0-alpha.
|
|
45
|
-
"@jupyterlab/apputils": "^4.0.0-alpha.
|
|
46
|
-
"@jupyterlab/celltags": "^4.0.0-alpha.
|
|
47
|
-
"@jupyterlab/codeeditor": "^4.0.0-alpha.
|
|
48
|
-
"@jupyterlab/codemirror": "^4.0.0-alpha.
|
|
49
|
-
"@jupyterlab/console": "^4.0.0-alpha.
|
|
50
|
-
"@jupyterlab/coreutils": "^6.0.0-alpha.
|
|
51
|
-
"@jupyterlab/docmanager": "^4.0.0-alpha.
|
|
52
|
-
"@jupyterlab/docregistry": "^4.0.0-alpha.
|
|
53
|
-
"@jupyterlab/mainmenu": "^4.0.0-alpha.
|
|
54
|
-
"@jupyterlab/settingregistry": "^4.0.0-alpha.
|
|
55
|
-
"@jupyterlab/translation": "^4.0.0-alpha.
|
|
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.
|
|
58
|
+
"@lumino/widgets": "^1.32.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"rimraf": "~3.0.0",
|
package/schema/menus.json
CHANGED