@datalayer/jupyter-react 0.19.3 → 0.19.5
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/app/tabs/components/NotebookComponent.js +3 -2
- package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
- package/lib/components/cell/CellCommands.d.ts +1 -1
- package/lib/components/cell/CellCommands.js +7 -7
- package/lib/components/cell/CellCommands.js.map +1 -1
- package/lib/components/notebook/BaseNotebook.d.ts +148 -0
- package/lib/components/notebook/BaseNotebook.js +732 -0
- package/lib/components/notebook/BaseNotebook.js.map +1 -0
- package/lib/components/notebook/Notebook.css +13 -0
- package/lib/components/notebook/Notebook.d.ts +14 -16
- package/lib/components/notebook/Notebook.js +143 -65
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +7 -9
- package/lib/components/notebook/NotebookAdapter.js +18 -22
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookCommands.d.ts +14 -4
- package/lib/components/notebook/NotebookCommands.js +230 -156
- package/lib/components/notebook/NotebookCommands.js.map +1 -1
- package/lib/components/notebook/NotebookState.js +6 -6
- package/lib/components/notebook/NotebookState.js.map +1 -1
- package/lib/components/notebook/SimpleNotebook.d.ts +40 -0
- package/lib/components/notebook/SimpleNotebook.js +73 -0
- package/lib/components/notebook/SimpleNotebook.js.map +1 -0
- package/lib/components/notebook/cell/metadata/CellMetadataEditor.d.ts +14 -6
- package/lib/components/notebook/cell/metadata/CellMetadataEditor.js +35 -37
- package/lib/components/notebook/cell/metadata/CellMetadataEditor.js.map +1 -1
- package/lib/components/notebook/cell/metadata/NbGraderCells.d.ts +2 -2
- package/lib/components/notebook/cell/metadata/NbGraderCells.js +2 -2
- package/lib/components/notebook/cell/metadata/NbGraderCells.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebar.d.ts +28 -2
- package/lib/components/notebook/cell/sidebar/CellSidebar.js +64 -78
- package/lib/components/notebook/cell/sidebar/CellSidebar.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarButton.d.ts +3 -2
- package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +57 -72
- package/lib/components/notebook/cell/sidebar/CellSidebarButton.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarRun.d.ts +3 -2
- package/lib/components/notebook/cell/sidebar/CellSidebarRun.js +14 -29
- package/lib/components/notebook/cell/sidebar/CellSidebarRun.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/extension.d.ts +31 -0
- package/lib/components/notebook/cell/sidebar/extension.js +121 -0
- package/lib/components/notebook/cell/sidebar/extension.js.map +1 -0
- package/lib/components/notebook/cell/sidebar/index.d.ts +1 -1
- package/lib/components/notebook/cell/sidebar/index.js +1 -1
- package/lib/components/notebook/cell/sidebar/index.js.map +1 -1
- package/lib/components/notebook/content/JupyterReactContentFactory.d.ts +1 -12
- package/lib/components/notebook/content/JupyterReactContentFactory.js +4 -22
- package/lib/components/notebook/content/JupyterReactContentFactory.js.map +1 -1
- package/lib/components/notebook/index.d.ts +2 -0
- package/lib/components/notebook/index.js +2 -0
- package/lib/components/notebook/index.js.map +1 -1
- package/lib/components/utils/Loader.d.ts +4 -0
- package/lib/components/utils/Loader.js +23 -0
- package/lib/components/utils/Loader.js.map +1 -0
- package/lib/components/utils/SpinnerCentered.d.ts +2 -1
- package/lib/components/utils/SpinnerCentered.js +2 -2
- package/lib/components/utils/SpinnerCentered.js.map +1 -1
- package/lib/components/utils/index.d.ts +1 -0
- package/lib/components/utils/index.js +1 -0
- package/lib/components/utils/index.js.map +1 -1
- package/lib/examples/Bokeh.js +8 -4
- package/lib/examples/Bokeh.js.map +1 -1
- package/lib/examples/Bqplot.js +8 -4
- package/lib/examples/Bqplot.js.map +1 -1
- package/lib/examples/Dashboard.js +8 -9
- package/lib/examples/Dashboard.js.map +1 -1
- package/lib/examples/Deno.js +8 -4
- package/lib/examples/Deno.js.map +1 -1
- package/lib/examples/GeoJson.js +10 -5
- package/lib/examples/GeoJson.js.map +1 -1
- package/lib/examples/IPyLeaflet.js +8 -4
- package/lib/examples/IPyLeaflet.js.map +1 -1
- package/lib/examples/IPyReact.js +8 -4
- package/lib/examples/IPyReact.js.map +1 -1
- package/lib/examples/IPyWidgets.js +8 -9
- package/lib/examples/IPyWidgets.js.map +1 -1
- package/lib/examples/IPyWidgetsState.js +8 -9
- package/lib/examples/IPyWidgetsState.js.map +1 -1
- package/lib/examples/JupyterContext.js +20 -22
- package/lib/examples/JupyterContext.js.map +1 -1
- package/lib/examples/Matplotlib.js +8 -9
- package/lib/examples/Matplotlib.js.map +1 -1
- package/lib/examples/Notebook.js +4 -3
- package/lib/examples/Notebook.js.map +1 -1
- package/lib/examples/NotebookCellSidebar.js +4 -8
- package/lib/examples/NotebookCellSidebar.js.map +1 -1
- package/lib/examples/NotebookCellToolbar.js +11 -12
- package/lib/examples/NotebookCellToolbar.js.map +1 -1
- package/lib/examples/NotebookCollaborative.js +6 -3
- package/lib/examples/NotebookCollaborative.js.map +1 -1
- package/lib/examples/NotebookColormode.js +6 -10
- package/lib/examples/NotebookColormode.js.map +1 -1
- package/lib/examples/NotebookExtension.js +11 -12
- package/lib/examples/NotebookExtension.js.map +1 -1
- package/lib/examples/NotebookExternalContent.js +10 -12
- package/lib/examples/NotebookExternalContent.js.map +1 -1
- package/lib/examples/NotebookInit.js +5 -4
- package/lib/examples/NotebookInit.js.map +1 -1
- package/lib/examples/NotebookKernelChange.js +7 -6
- package/lib/examples/NotebookKernelChange.js.map +1 -1
- package/lib/examples/NotebookLess.js +8 -12
- package/lib/examples/NotebookLess.js.map +1 -1
- package/lib/examples/NotebookLite.js +5 -10
- package/lib/examples/NotebookLite.js.map +1 -1
- package/lib/examples/NotebookLiteContext.js +9 -10
- package/lib/examples/NotebookLiteContext.js.map +1 -1
- package/lib/examples/NotebookLocalServer.js +10 -7
- package/lib/examples/NotebookLocalServer.js.map +1 -1
- package/lib/examples/NotebookNbformat.js +8 -9
- package/lib/examples/NotebookNbformat.js.map +1 -1
- package/lib/examples/NotebookNbformatChange.js +9 -11
- package/lib/examples/NotebookNbformatChange.js.map +1 -1
- package/lib/examples/NotebookNoContext.js +4 -3
- package/lib/examples/NotebookNoContext.js.map +1 -1
- package/lib/examples/NotebookNoPrimer.js +5 -4
- package/lib/examples/NotebookNoPrimer.js.map +1 -1
- package/lib/examples/NotebookOnSessionConnection.js +7 -11
- package/lib/examples/NotebookOnSessionConnection.js.map +1 -1
- package/lib/examples/NotebookPath.js +4 -3
- package/lib/examples/NotebookPath.js.map +1 -1
- package/lib/examples/NotebookPathChange.js +9 -6
- package/lib/examples/NotebookPathChange.js.map +1 -1
- package/lib/examples/NotebookReadonly.js +6 -4
- package/lib/examples/NotebookReadonly.js.map +1 -1
- package/lib/examples/NotebookServiceManager.js +10 -14
- package/lib/examples/NotebookServiceManager.js.map +1 -1
- package/lib/examples/NotebookSkeleton.js +5 -4
- package/lib/examples/NotebookSkeleton.js.map +1 -1
- package/lib/examples/NotebookTheme.js +6 -10
- package/lib/examples/NotebookTheme.js.map +1 -1
- package/lib/examples/NotebookThemeColormode.js +6 -10
- package/lib/examples/NotebookThemeColormode.js.map +1 -1
- package/lib/examples/NotebookURL.js +4 -3
- package/lib/examples/NotebookURL.js.map +1 -1
- package/lib/examples/NotebookUnmount.js +7 -11
- package/lib/examples/NotebookUnmount.js.map +1 -1
- package/lib/examples/ObservableHQ.js +8 -4
- package/lib/examples/ObservableHQ.js.map +1 -1
- package/lib/examples/Panel.js +6 -3
- package/lib/examples/Panel.js.map +1 -1
- package/lib/examples/Plotly.js +8 -4
- package/lib/examples/Plotly.js.map +1 -1
- package/lib/examples/PyGWalker.js +8 -9
- package/lib/examples/PyGWalker.js.map +1 -1
- package/lib/examples/Vega.js +5 -4
- package/lib/examples/Vega.js.map +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbarExtension.d.ts +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbarExtension.js +6 -2
- package/lib/examples/extensions/celltoolbar/CellToolbarExtension.js.map +1 -1
- package/lib/examples/extensions/exectime/ExecTimeExtension.d.ts +1 -1
- package/lib/examples/extensions/exectime/ExecTimeExtension.js +1 -1
- package/lib/examples/extensions/exectime/ExecTimeExtension.js.map +1 -1
- package/lib/examples/sidebars/CellSidebarSource.js +56 -73
- package/lib/examples/sidebars/CellSidebarSource.js.map +1 -1
- package/lib/examples/toolbars/NotebookToolbarAutoSave.js +3 -3
- package/lib/examples/toolbars/NotebookToolbarAutoSave.js.map +1 -1
- package/lib/jupyter/collaboration/DatalayerCollaboration.d.ts +7 -2
- package/lib/jupyter/collaboration/DatalayerCollaboration.js +24 -1
- package/lib/jupyter/collaboration/DatalayerCollaboration.js.map +1 -1
- package/lib/jupyter/collaboration/JupyterCollaboration.d.ts +2 -2
- package/lib/jupyter/collaboration/JupyterCollaboration.js +3 -3
- package/lib/jupyter/collaboration/JupyterCollaboration.js.map +1 -1
- package/lib/utils/Utils.d.ts +6 -0
- package/lib/utils/Utils.js +9 -1
- package/lib/utils/Utils.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarWidget.d.ts +0 -16
- package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js +0 -37
- package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js.map +0 -1
|
@@ -4,12 +4,13 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
4
4
|
*
|
|
5
5
|
* MIT License
|
|
6
6
|
*/
|
|
7
|
+
import { CellSidebarExtension } from '../../../components';
|
|
7
8
|
import Notebook from '../../../components/notebook/Notebook';
|
|
8
|
-
import CellSidebarNew from './../../../components/notebook/cell/sidebar/CellSidebarButton';
|
|
9
9
|
import nbformat from './../../..//examples/notebooks/NotebookExample1.ipynb.json';
|
|
10
|
+
import CellSidebarNew from './../../../components/notebook/cell/sidebar/CellSidebarButton';
|
|
10
11
|
export const NotebookComponent = () => {
|
|
11
12
|
return (_jsx(_Fragment, { children: _jsx(Notebook, { startDefaultKernel: true, nbformat: nbformat, id: "notebook-id", cellSidebarMargin: 60, height: "calc(100vh - 2.6rem)" // (Height - Toolbar Height).
|
|
12
|
-
,
|
|
13
|
+
, extensions: [new CellSidebarExtension({ factory: CellSidebarNew })] }) }));
|
|
13
14
|
};
|
|
14
15
|
export default NotebookComponent;
|
|
15
16
|
//# sourceMappingURL=NotebookComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookComponent.js","sourceRoot":"","sources":["../../../../src/app/tabs/components/NotebookComponent.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"NotebookComponent.js","sourceRoot":"","sources":["../../../../src/app/tabs/components/NotebookComponent.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,QAAQ,MAAM,uCAAuC,CAAC;AAC7D,OAAO,QAAQ,MAAM,4DAA4D,CAAC;AAClF,OAAO,cAAc,MAAM,+DAA+D,CAAC;AAE3F,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,CACL,4BACE,KAAC,QAAQ,IACP,kBAAkB,EAAE,IAAI,EACxB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAC,aAAa,EAChB,iBAAiB,EAAE,EAAE,EACrB,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,UAAU,EAAE,CAAC,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,GACnE,GACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,5 +2,5 @@ import { CommandRegistry } from '@lumino/commands';
|
|
|
2
2
|
import { CompletionHandler } from '@jupyterlab/completer';
|
|
3
3
|
import { CodeCell, MarkdownCell, RawCell } from '@jupyterlab/cells';
|
|
4
4
|
import CellAdapter from './CellAdapter';
|
|
5
|
-
export declare const CellCommands: (
|
|
5
|
+
export declare const CellCommands: (commands: CommandRegistry, cell: CodeCell | MarkdownCell | RawCell, completerHandler: CompletionHandler, cellAdapter: CellAdapter) => void;
|
|
6
6
|
export default CellCommands;
|
|
@@ -8,16 +8,16 @@ const cmdIds = {
|
|
|
8
8
|
invoke: 'completer:invoke',
|
|
9
9
|
select: 'completer:select',
|
|
10
10
|
};
|
|
11
|
-
export const CellCommands = (
|
|
12
|
-
|
|
11
|
+
export const CellCommands = (commands, cell, completerHandler, cellAdapter) => {
|
|
12
|
+
commands.addCommand(cmdIds.invoke, {
|
|
13
13
|
label: 'Completer: Invoke',
|
|
14
14
|
execute: () => completerHandler.invoke(),
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
commands.addCommand(cmdIds.select, {
|
|
17
17
|
label: 'Completer: Select',
|
|
18
18
|
execute: () => completerHandler.completer.selectActive(),
|
|
19
19
|
});
|
|
20
|
-
|
|
20
|
+
commands.addCommand('run:cell', {
|
|
21
21
|
execute: () => {
|
|
22
22
|
if (cell instanceof CodeCell) {
|
|
23
23
|
cellAdapter.execute();
|
|
@@ -27,12 +27,12 @@ export const CellCommands = (commandRegistry, cell, completerHandler, cellAdapte
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
commands.addKeyBinding({
|
|
31
31
|
selector: '.jp-InputArea-editor.jp-mod-completer-enabled',
|
|
32
32
|
keys: ['Tab'],
|
|
33
33
|
command: cmdIds.invoke,
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
commands.addKeyBinding({
|
|
36
36
|
selector: '.jp-InputArea-editor',
|
|
37
37
|
keys: ['Shift Enter'],
|
|
38
38
|
command: 'run:cell',
|
|
@@ -44,7 +44,7 @@ export const CellCommands = (commandRegistry, cell, completerHandler, cellAdapte
|
|
|
44
44
|
command: cmdIds.select,
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
|
-
bindings.map(binding =>
|
|
47
|
+
bindings.map(binding => commands.addKeyBinding(binding));
|
|
48
48
|
};
|
|
49
49
|
export default CellCommands;
|
|
50
50
|
//# sourceMappingURL=CellCommands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellCommands.js","sourceRoot":"","sources":["../../../src/components/cell/CellCommands.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAW,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,
|
|
1
|
+
{"version":3,"file":"CellCommands.js","sourceRoot":"","sources":["../../../src/components/cell/CellCommands.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAW,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,QAAyB,EACzB,IAAuC,EACvC,gBAAmC,EACnC,WAAwB,EAClB,EAAE;IACR,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE;QACjC,KAAK,EAAE,mBAAmB;QAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE;KACzC,CAAC,CAAC;IACH,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE;QACjC,KAAK,EAAE,mBAAmB;QAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,YAAY,EAAE;KACzD,CAAC,CAAC;IACH,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE;QAC9B,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,IAAI,YAAY,QAAQ,EAAE;gBAC5B,WAAW,CAAC,OAAO,EAAE,CAAC;aACvB;iBAAM,IAAI,IAAI,YAAY,YAAY,EAAE;gBACtC,IAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC;aACxC;QACH,CAAC;KACF,CAAC,CAAC;IACH,QAAQ,CAAC,aAAa,CAAC;QACrB,QAAQ,EAAE,+CAA+C;QACzD,IAAI,EAAE,CAAC,KAAK,CAAC;QACb,OAAO,EAAE,MAAM,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,QAAQ,CAAC,aAAa,CAAC;QACrB,QAAQ,EAAE,sBAAsB;QAChC,IAAI,EAAE,CAAC,aAAa,CAAC;QACrB,OAAO,EAAE,UAAU;KACpB,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG;QACf;YACE,QAAQ,EAAE,8CAA8C;YACxD,IAAI,EAAE,CAAC,OAAO,CAAC;YACf,OAAO,EAAE,MAAM,CAAC,MAAM;SACvB;KACF,CAAC;IACF,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { INotebookContent } from '@jupyterlab/nbformat';
|
|
3
|
+
import { NotebookModel } from '@jupyterlab/notebook';
|
|
4
|
+
import type { Kernel, ServerConnection, ServiceManager } from '@jupyterlab/services';
|
|
5
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
6
|
+
import type { OnSessionConnection } from '../../state';
|
|
7
|
+
import type { DatalayerNotebookExtension } from './Notebook';
|
|
8
|
+
/**
|
|
9
|
+
* Base notebook component properties
|
|
10
|
+
*/
|
|
11
|
+
export interface IBaseNotebookProps {
|
|
12
|
+
/**
|
|
13
|
+
* Custom command registry.
|
|
14
|
+
*
|
|
15
|
+
* Note:
|
|
16
|
+
* Providing it allows to command the component from an higher level.
|
|
17
|
+
*/
|
|
18
|
+
commands?: CommandRegistry;
|
|
19
|
+
/**
|
|
20
|
+
* Notebook ID
|
|
21
|
+
*/
|
|
22
|
+
id?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Notebook extensions
|
|
25
|
+
*/
|
|
26
|
+
extensions?: DatalayerNotebookExtension[];
|
|
27
|
+
/**
|
|
28
|
+
* Kernel ID to connect to
|
|
29
|
+
*/
|
|
30
|
+
kernelId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Service manager
|
|
33
|
+
*/
|
|
34
|
+
serviceManager: ServiceManager.IManager;
|
|
35
|
+
/**
|
|
36
|
+
* Notebook content model
|
|
37
|
+
*/
|
|
38
|
+
model: NotebookModel;
|
|
39
|
+
/**
|
|
40
|
+
* Callback on session connection changed
|
|
41
|
+
*/
|
|
42
|
+
onSessionConnectionChanged?: OnSessionConnection;
|
|
43
|
+
/**
|
|
44
|
+
* Notebook path
|
|
45
|
+
*
|
|
46
|
+
* Set this only if you use Jupyter Server to fetch
|
|
47
|
+
* and save the content.
|
|
48
|
+
*/
|
|
49
|
+
path?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Base notebook component
|
|
53
|
+
*
|
|
54
|
+
* The notebook model and kernel lifecycle is not handled by
|
|
55
|
+
* this component.
|
|
56
|
+
*
|
|
57
|
+
* Important
|
|
58
|
+
* This component is not connected to any React stores.
|
|
59
|
+
*/
|
|
60
|
+
export declare function BaseNotebook(props: IBaseNotebookProps): JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Get the kernel ID to connect to.
|
|
63
|
+
*
|
|
64
|
+
* Steps:
|
|
65
|
+
* - Check the requested kernel ID exists
|
|
66
|
+
* - If no kernel found, start a new one if required
|
|
67
|
+
*
|
|
68
|
+
* Note
|
|
69
|
+
* If the hook starts the kernel, it will shut it down when unmounting.
|
|
70
|
+
*/
|
|
71
|
+
export declare function useKernelId(options: {
|
|
72
|
+
/**
|
|
73
|
+
* Kernels manager
|
|
74
|
+
*/
|
|
75
|
+
kernels: Kernel.IManager;
|
|
76
|
+
/**
|
|
77
|
+
* Kernel ID to connect to
|
|
78
|
+
*
|
|
79
|
+
* If the kernel does not exist and {@link startDefaultKernel} is `true`,
|
|
80
|
+
* another kernel will be started.
|
|
81
|
+
*/
|
|
82
|
+
requestedKernelId?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Whether or not to start a default kernel.
|
|
85
|
+
*
|
|
86
|
+
* Default: false
|
|
87
|
+
*/
|
|
88
|
+
startDefaultKernel?: boolean;
|
|
89
|
+
}): string | undefined;
|
|
90
|
+
export type CollaborationServer = {
|
|
91
|
+
/**
|
|
92
|
+
* Base server URL
|
|
93
|
+
*/
|
|
94
|
+
baseURL: string;
|
|
95
|
+
/**
|
|
96
|
+
* Notebook room name to connect to.
|
|
97
|
+
*/
|
|
98
|
+
roomName: string;
|
|
99
|
+
/**
|
|
100
|
+
* JWT token
|
|
101
|
+
*/
|
|
102
|
+
token: string;
|
|
103
|
+
/**
|
|
104
|
+
* Server type
|
|
105
|
+
*/
|
|
106
|
+
type: 'datalayer';
|
|
107
|
+
} | {
|
|
108
|
+
/**
|
|
109
|
+
* Notebook path
|
|
110
|
+
*/
|
|
111
|
+
path: string;
|
|
112
|
+
/**
|
|
113
|
+
* Jupyter server settings
|
|
114
|
+
*/
|
|
115
|
+
serverSettings: ServerConnection.ISettings;
|
|
116
|
+
/**
|
|
117
|
+
* Server type
|
|
118
|
+
*/
|
|
119
|
+
type: 'jupyter';
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Hook to handle a notebook model.
|
|
123
|
+
*
|
|
124
|
+
* The notebook content may come from 3 sources:
|
|
125
|
+
* - {@link nbformat}: The notebook content
|
|
126
|
+
* - {@link url}: A URL to fetch the notebook content from
|
|
127
|
+
* - {@link collaborationServer}: Parameters to connect to a collaboration server
|
|
128
|
+
*/
|
|
129
|
+
export declare function useNotebookModel(options: {
|
|
130
|
+
/**
|
|
131
|
+
* Collaboration server providing the document rooms
|
|
132
|
+
*/
|
|
133
|
+
collaborationServer?: CollaborationServer;
|
|
134
|
+
/**
|
|
135
|
+
* Notebook content.
|
|
136
|
+
*/
|
|
137
|
+
nbformat?: INotebookContent;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the model is read-only or not.
|
|
140
|
+
*
|
|
141
|
+
* Default: false
|
|
142
|
+
*/
|
|
143
|
+
readonly?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* URL to fetch the notebook content from.
|
|
146
|
+
*/
|
|
147
|
+
url?: string;
|
|
148
|
+
}): NotebookModel | null;
|