From b29a925ec2bf3d323e63ce99b56b7526610071ab Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Thu, 21 Jul 2022 18:31:13 +0200 Subject: [PATCH] Add the table of content dependency --- app/index.js | 6 ++++++ app/package.json | 1 + packages/application/src/shell.ts | 7 ++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/index.js b/app/index.js index aa67a3e63..e89e29491 100644 --- a/app/index.js +++ b/app/index.js @@ -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'), diff --git a/app/package.json b/app/package.json index 821a59d41..787d365d0 100644 --- a/app/package.json +++ b/app/package.json @@ -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" diff --git a/packages/application/src/shell.ts b/packages/application/src/shell.ts index a3d99fa48..2616d67b6 100644 --- a/packages/application/src/shell.ts +++ b/packages/application/src/shell.ts @@ -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}`); } }