Add the table of content dependency

This commit is contained in:
Nicolas Brichet 2022-07-21 18:31:13 +02:00 committed by foo
parent 73a64bbf12
commit b29a925ec2
3 changed files with 11 additions and 3 deletions

View File

@ -146,6 +146,12 @@ async function main() {
require('@jupyterlab/terminal-extension'),
require('@jupyterlab/theme-light-extension'),
require('@jupyterlab/theme-dark-extension'),
require('@jupyterlab/toc-extension').default.filter(({ id }) =>
[
'@jupyterlab/toc-extension:registry',
'@jupyterlab/toc-extension:tracker'
].includes(id)
),
require('@jupyterlab/translation-extension'),
// Add the "Hub Control Panel" menu option when running in JupyterHub
require('@jupyterlab/collaboration-extension'),

View File

@ -140,6 +140,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-extension": "^4.0.0-alpha.14",
"@jupyterlab/translation-extension": "^4.0.0-alpha.14",
"@jupyterlab/vega5-extension": "^4.0.0-alpha.14"

View File

@ -75,6 +75,7 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
} else {
this.layout = this.initLayoutWithoutSidePanels();
}
}
initLayoutWithoutSidePanels(): Layout {
@ -263,14 +264,14 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
if (this.sidePanelsVisible()) {
return this._leftHandler.addWidget(widget, rank);
}
throw new Error(`${area} area is not available on this page`);
console.warn(`${area} area is not available on this page`);
case 'right':
if (this.sidePanelsVisible()) {
return this._rightHandler.addWidget(widget, rank);
}
throw new Error(`${area} area is not available on this page`);
console.warn(`${area} area is not available on this page`);
default:
throw new Error(`Cannot add widget to area: ${area}`);
console.warn(`Cannot add widget to area: ${area}`);
}
}