Skip to content

Commit 484b11f

Browse files
Add base notebook component (#348)
* Clean up the websocket connection * Listen to sync and connection-close events React to notebook model change * Start base notebook component * Automatic application of license header * Add simpler notebook component * Automatic application of license header * Fix interface * Strip SimpleNotebook from stores * Restore commands and completer * Fix BaseNotebook styling * Simplify simple notebook thanks to hooks * Allow to pass by the command registry * Improve DatalayerExtension API --------- Co-authored-by: Frédéric Collonval <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 9fcc413 commit 484b11f

File tree

17 files changed

+2100
-445
lines changed

17 files changed

+2100
-445
lines changed

packages/react/src/components/notebook/BaseNotebook.tsx

Lines changed: 1076 additions & 0 deletions
Large diffs are not rendered by default.

packages/react/src/components/notebook/Notebook.tsx

Lines changed: 265 additions & 112 deletions
Large diffs are not rendered by default.

packages/react/src/components/notebook/NotebookAdapter.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { JupyterReactContentFactory } from './content/JupyterReactContentFactory
3030
import { JupyterReactNotebookModelFactory } from './model/JupyterReactNotebookModelFactory';
3131
import { getMarked } from './marked/marked';
3232
import { INotebookProps } from './Notebook';
33-
import { NotebookCommands } from './NotebookCommands';
33+
import { addNotebookCommands } from './NotebookCommands';
3434

3535
const FALLBACK_NOTEBOOK_PATH = '.datalayer/ping.ipynb';
3636

@@ -75,10 +75,10 @@ export class NotebookAdapter {
7575
this._kernelClients = props.kernelClients;
7676
this._lite = props.lite;
7777
this._nbformat = props.nbformat;
78-
this._nbgrader = props.nbgrader;
78+
this._nbgrader = props.nbgrader!;
7979
this._path = props.path;
80-
this._readonly = props.readonly;
81-
this._renderers = props.renderers;
80+
this._readonly = props.readonly!;
81+
this._renderers = props.renderers!;
8282
this._serverless = props.serverless;
8383
this._serviceManager = props.serviceManager!;
8484
this._url = props.url;
@@ -348,9 +348,8 @@ export class NotebookAdapter {
348348

349349
if (!this._readonly) {
350350
try {
351-
NotebookCommands(
351+
addNotebookCommands(
352352
this._commandRegistry,
353-
this._notebookPanel,
354353
completerHandler,
355354
this._tracker!,
356355
this._path

0 commit comments

Comments
 (0)