Updates after rebasing v7.0.0a6

This commit is contained in:
foo 2022-10-04 14:07:12 +02:00
parent 7f33dbed84
commit 239e5b931c
9 changed files with 58 additions and 45 deletions

View File

@ -77,6 +77,7 @@
"@jupyterlab/terminal-extension": "~4.0.0-alpha.14",
"@jupyterlab/theme-dark-extension": "~4.0.0-alpha.14",
"@jupyterlab/theme-light-extension": "~4.0.0-alpha.14",
"@jupyterlab/toc-extension": "~6.0.0-alpha.14",
"@jupyterlab/tooltip": "~4.0.0-alpha.14",
"@jupyterlab/tooltip-extension": "~4.0.0-alpha.14",
"@jupyterlab/translation": "~4.0.0-alpha.14",

View File

@ -206,7 +206,7 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
activateById(id: string): void {
// Search all areas that can have widgets for this widget, starting with main.
for (const area of ['main', 'top', 'left', 'right', 'menu']) {
const widget = find(this.widgets(area), w => w.id === id);
const widget = find(this.widgets(area as Shell.Area), w => w.id === id);
if (widget) {
if (area === 'left') {
this.expandLeft(id);
@ -293,6 +293,15 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
case 'main':
yield* this._main.widgets;
return;
case 'left':
yield* this._leftHandler.widgets;
return;
case 'right':
yield* this._rightHandler.widgets;
return;
default:
console.error(`This shell has no area called "${area}"`);
return;
}
}
@ -332,24 +341,6 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
this._onLayoutModified();
}
widgetsList(area?: string): readonly Widget[] {
switch (area ?? 'main') {
case 'top':
return this._topHandler.panel.widgets;
case 'menu':
return this._menuHandler.panel.widgets;
case 'main':
return this._main.widgets;
case 'left':
return this._leftHandler.widgets;
case 'right':
return this._rightHandler.widgets;
default:
console.error(`This shell has no area called "${area}"`);
return;
}
}
/**
* Is a particular area empty (no widgets)?
*
@ -357,7 +348,7 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
* @returns true if area has no widgets, false if at least one widget is present
*/
isEmpty(area: Shell.Area): boolean {
return this.widgetsList(area).length === 0;
return Array.from(this.widgets(area)).length === 0;
}
/**

View File

@ -145,10 +145,10 @@ describe('Shell for tree view', () => {
});
it('should throw an exception if a fake area does not exist', () => {
const spy = jest.spyOn(console, 'error');
const jupyterFrontEndShell = shell as JupyterFrontEnd.IShell;
expect(() => {
jupyterFrontEndShell.widgets('fake');
}).toThrow('Invalid area: fake');
expect(Array.from(jupyterFrontEndShell.widgets('fake'))).toHaveLength(0);
expect(spy).toHaveBeenCalled();
});
});

View File

@ -7,7 +7,7 @@ import { expect } from '@playwright/test';
import { test } from './fixtures';
import { runAndAdvance } from './utils';
import { runAndAdvance, waitForKernelReady } from './utils';
const NOTEBOOK = 'example.ipynb';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1429,10 +1429,10 @@
"@jridgewell/sourcemap-codec" "^1.4.10"
"@jupyter-notebook/application-extension@file:packages/application-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/application" "^7.0.0-alpha.5"
"@jupyter-notebook/ui-components" "^7.0.0-alpha.5"
"@jupyter-notebook/application" "^7.0.0-alpha.6"
"@jupyter-notebook/ui-components" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/celltags" "^4.0.0-alpha.14"
@ -1450,7 +1450,7 @@
"@lumino/widgets" "^2.0.0-alpha.6"
"@jupyter-notebook/application@file:packages/application":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/coreutils" "^6.0.0-alpha.14"
@ -1465,7 +1465,7 @@
"@lumino/widgets" "^2.0.0-alpha.6"
"@jupyter-notebook/console-extension@file:packages/console-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/console" "^4.0.0-alpha.14"
@ -1473,7 +1473,7 @@
"@lumino/algorithm" "^2.0.0-alpha.6"
"@jupyter-notebook/docmanager-extension@file:packages/docmanager-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/coreutils" "^6.0.0-alpha.14"
@ -1483,26 +1483,26 @@
"@lumino/algorithm" "^2.0.0-alpha.6"
"@jupyter-notebook/documentsearch-extension@file:packages/documentsearch-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/application" "^7.0.0-alpha.5"
"@jupyter-notebook/application" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/documentsearch" "^4.0.0-alpha.14"
"@lumino/widgets" "^2.0.0-alpha.6"
"@jupyter-notebook/help-extension@file:packages/help-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/ui-components" "^7.0.0-alpha.5"
"@jupyter-notebook/ui-components" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/mainmenu" "^4.0.0-alpha.14"
"@jupyterlab/translation" "^4.0.0-alpha.14"
"@jupyter-notebook/lab-extension@file:packages/lab-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/application" "^7.0.0-alpha.5"
"@jupyter-notebook/application" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/coreutils" "^6.0.0-alpha.14"
@ -1513,9 +1513,9 @@
"@lumino/disposable" "^2.0.0-alpha.6"
"@jupyter-notebook/notebook-extension@file:packages/notebook-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/application" "^7.0.0-alpha.5"
"@jupyter-notebook/application" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/cells" "^4.0.0-alpha.14"
@ -1527,7 +1527,7 @@
"@lumino/widgets" "^2.0.0-alpha.6"
"@jupyter-notebook/terminal-extension@file:packages/terminal-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/coreutils" "^6.0.0-alpha.14"
@ -1535,10 +1535,10 @@
"@lumino/algorithm" "^2.0.0-alpha.6"
"@jupyter-notebook/tree-extension@file:packages/tree-extension":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/application" "^7.0.0-alpha.5"
"@jupyter-notebook/tree" "^7.0.0-alpha.5"
"@jupyter-notebook/application" "^7.0.0-alpha.6"
"@jupyter-notebook/tree" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/coreutils" "^6.0.0-alpha.14"
@ -1555,9 +1555,9 @@
"@lumino/widgets" "^2.0.0-alpha.6"
"@jupyter-notebook/tree@file:packages/tree":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyter-notebook/application" "^7.0.0-alpha.5"
"@jupyter-notebook/application" "^7.0.0-alpha.6"
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/coreutils" "^6.0.0-alpha.14"
@ -1575,7 +1575,7 @@
"@lumino/widgets" "^2.0.0-alpha.6"
"@jupyter-notebook/ui-components@file:packages/ui-components":
version "7.0.0-alpha.5"
version "7.0.0-alpha.6"
dependencies:
"@jupyterlab/ui-components" "^4.0.0-alpha.29"
react "^17.0.1"
@ -1813,6 +1813,16 @@
"@lumino/widgets" "^2.0.0-alpha.6"
react "^17.0.1"
"@jupyterlab/celltags-extension@^4.0.0-alpha.14":
version "4.0.0-alpha.14"
resolved "https://registry.yarnpkg.com/@jupyterlab/celltags-extension/-/celltags-extension-4.0.0-alpha.14.tgz#cad83537b31e31910f10099ae260a26aa66a65e8"
integrity sha512-S7o/l8n2K5eCnbXCFKsGaOlbl4PnQb10oeRo1PQDQSPAvpN2WgUzp83YYMXlLjngsDs41DGaSBj+7h6qfGCVmw==
dependencies:
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/celltags" "^4.0.0-alpha.14"
"@jupyterlab/notebook" "^4.0.0-alpha.14"
"@jupyterlab/translation" "^4.0.0-alpha.14"
"@jupyterlab/celltags@^4.0.0-alpha.14":
version "4.0.0-alpha.14"
resolved "https://registry.yarnpkg.com/@jupyterlab/celltags/-/celltags-4.0.0-alpha.14.tgz#d1ad45da532c62b0ba1f3778e2feff04d0800698"
@ -2795,6 +2805,17 @@
"@jupyterlab/apputils" "^4.0.0-alpha.14"
"@jupyterlab/translation" "^4.0.0-alpha.14"
"@jupyterlab/toc-extension@^6.0.0-alpha.14":
version "6.0.0-alpha.14"
resolved "https://registry.yarnpkg.com/@jupyterlab/toc-extension/-/toc-extension-6.0.0-alpha.14.tgz#706e5c2f7abf72546592dea5f675c55dc257bcea"
integrity sha512-ilksYGjsXszgdhl9beZtFRmRJLm+ZN2lQ0WJDxsnRaNG+d6tRfiw8toAS111bbSmxyfRNBysdqNIbtNfbioFEg==
dependencies:
"@jupyterlab/application" "^4.0.0-alpha.14"
"@jupyterlab/settingregistry" "^4.0.0-alpha.14"
"@jupyterlab/toc" "^6.0.0-alpha.14"
"@jupyterlab/translation" "^4.0.0-alpha.14"
"@jupyterlab/ui-components" "^4.0.0-alpha.29"
"@jupyterlab/toc@^6.0.0-alpha.14":
version "6.0.0-alpha.14"
resolved "https://registry.yarnpkg.com/@jupyterlab/toc/-/toc-6.0.0-alpha.14.tgz#6fad008f8252cbdcd87921ade3c4f42fbfd46012"