@datalayer/jupyter-react 0.0.14 → 0.0.17
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/components/cell/Cell.css +0 -4
- package/lib/components/cell/Cell.d.ts +0 -6
- package/lib/components/cell/Cell.js +10 -12
- package/lib/components/cell/Cell.js.map +1 -1
- package/lib/components/cell/CellAdapter.d.ts +2 -2
- package/lib/components/cell/CellAdapter.js +12 -12
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorEditor.d.ts +2 -2
- package/lib/components/codemirror/CodeMirrorEditor.js +8 -8
- package/lib/components/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorOutputToolbar.d.ts +12 -0
- package/lib/components/{outputs/OutputToolbar.js → codemirror/CodeMirrorOutputToolbar.js} +16 -14
- package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -0
- package/lib/components/commands/Commands.js +2 -2
- package/lib/components/commands/Commands.js.map +1 -1
- package/lib/components/commands/CommandsAdapter.d.ts +0 -1
- package/lib/components/commands/CommandsAdapter.js +0 -1
- package/lib/components/commands/CommandsAdapter.js.map +1 -1
- package/lib/components/console/Console.js +2 -2
- package/lib/components/console/Console.js.map +1 -1
- package/lib/components/console/ConsoleAdapter.d.ts +0 -4
- package/lib/components/console/ConsoleAdapter.js +0 -4
- package/lib/components/console/ConsoleAdapter.js.map +1 -1
- package/lib/components/dialog/DialogAdapter.d.ts +0 -3
- package/lib/components/dialog/DialogAdapter.js +0 -3
- package/lib/components/dialog/DialogAdapter.js.map +1 -1
- package/lib/components/filebrowser/FileBrowser.js +2 -2
- package/lib/components/filebrowser/FileBrowser.js.map +1 -1
- package/lib/components/filebrowser/FileBrowserAdapter.d.ts +0 -5
- package/lib/components/filebrowser/FileBrowserAdapter.js +9 -14
- package/lib/components/filebrowser/FileBrowserAdapter.js.map +1 -1
- package/lib/components/notebook/Notebook.d.ts +0 -6
- package/lib/components/notebook/Notebook.js +12 -21
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.js +6 -6
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookCommands.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarDefault.js +8 -7
- package/lib/components/notebook/cell/sidebar/CellSidebarDefault.js.map +1 -1
- package/lib/components/{outputs → output}/Output.css +0 -0
- package/lib/components/{outputs → output}/Output.d.ts +6 -4
- package/lib/components/output/Output.js +180 -0
- package/lib/components/output/Output.js.map +1 -0
- package/lib/components/output/OutputAdapter.d.ts +19 -0
- package/lib/components/{outputs → output}/OutputAdapter.js +35 -42
- package/lib/components/output/OutputAdapter.js.map +1 -0
- package/lib/components/output/OutputRenderer.d.ts +6 -0
- package/lib/components/output/OutputRenderer.js +101 -0
- package/lib/components/output/OutputRenderer.js.map +1 -0
- package/lib/components/{outputs → output}/OutputState.d.ts +0 -0
- package/lib/components/{outputs → output}/OutputState.js +10 -10
- package/lib/components/output/OutputState.js.map +1 -0
- package/lib/components/settings/Settings.js +2 -2
- package/lib/components/settings/Settings.js.map +1 -1
- package/lib/components/settings/SettingsAdapter.d.ts +0 -2
- package/lib/components/settings/SettingsAdapter.js +0 -2
- package/lib/components/settings/SettingsAdapter.js.map +1 -1
- package/lib/components/terminal/Terminal.js +2 -2
- package/lib/components/terminal/Terminal.js.map +1 -1
- package/lib/components/terminal/TerminalAdapter.d.ts +0 -3
- package/lib/components/terminal/TerminalAdapter.js +0 -3
- package/lib/components/terminal/TerminalAdapter.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/jupyter/Jupyter.d.ts +21 -2
- package/lib/jupyter/Jupyter.js +22 -3
- package/lib/jupyter/Jupyter.js.map +1 -1
- package/lib/jupyter/JupyterContext.d.ts +2 -1
- package/lib/jupyter/JupyterContext.js +22 -9
- package/lib/jupyter/JupyterContext.js.map +1 -1
- package/lib/jupyter/ipywidgets/IPyWidgetsJupyterLabPlugin.d.ts +0 -2
- package/lib/jupyter/ipywidgets/IPyWidgetsJupyterLabPlugin.js +0 -2
- package/lib/jupyter/ipywidgets/IPyWidgetsJupyterLabPlugin.js.map +1 -1
- package/lib/jupyter/ipywidgets/IpyWidgetsManager.d.ts +0 -1
- package/lib/jupyter/ipywidgets/IpyWidgetsManager.js +0 -1
- package/lib/jupyter/ipywidgets/IpyWidgetsManager.js.map +1 -1
- package/lib/jupyter/lite/LiteServer.js.map +1 -1
- package/lib/jupyter/lumino/Lumino.d.ts +3 -0
- package/lib/jupyter/lumino/{LuminoAttached.js → Lumino.js} +14 -6
- package/lib/jupyter/lumino/Lumino.js.map +1 -0
- package/lib/jupyter/services/kernel/Kernel.js +5 -3
- package/lib/jupyter/services/kernel/Kernel.js.map +1 -1
- package/lib/state/State.d.ts +2 -2
- package/lib/state/State.js +3 -3
- package/lib/state/State.js.map +1 -1
- package/package.json +34 -37
- package/style/index.css +5 -5
- package/lib/JupyterExample.d.ts +0 -1
- package/lib/JupyterExample.js +0 -59
- package/lib/JupyterExample.js.map +0 -1
- package/lib/JupyterLiteExample.d.ts +0 -1
- package/lib/JupyterLiteExample.js +0 -10
- package/lib/JupyterLiteExample.js.map +0 -1
- package/lib/components/outputs/Output.js +0 -131
- package/lib/components/outputs/Output.js.map +0 -1
- package/lib/components/outputs/OutputAdapter.d.ts +0 -19
- package/lib/components/outputs/OutputAdapter.js.map +0 -1
- package/lib/components/outputs/OutputState.js.map +0 -1
- package/lib/components/outputs/OutputToolbar.d.ts +0 -12
- package/lib/components/outputs/OutputToolbar.js.map +0 -1
- package/lib/jupyter/lumino/LuminoAttached.d.ts +0 -3
- package/lib/jupyter/lumino/LuminoAttached.js.map +0 -1
- package/lib/utils/Ids.d.ts +0 -2
- package/lib/utils/Ids.js +0 -11
- package/lib/utils/Ids.js.map +0 -1
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { OutputArea } from '@jupyterlab/outputarea';
|
|
1
|
+
import { OutputArea, OutputAreaModel } from '@jupyterlab/outputarea';
|
|
2
2
|
import { RenderMimeRegistry, standardRendererFactories } from '@jupyterlab/rendermime';
|
|
3
3
|
import { rendererFactory as jsonRendererFactory } from '@jupyterlab/json-extension';
|
|
4
4
|
import { rendererFactory as javascriptRendererFactory } from '@jupyterlab/javascript-extension';
|
|
5
5
|
import { requireLoader } from "@jupyter-widgets/html-manager";
|
|
6
6
|
import { WIDGET_MIMETYPE, WidgetRenderer } from "@jupyter-widgets/html-manager/lib/output_renderers";
|
|
7
|
-
import { IPyWidgetsClassicManager } from "
|
|
7
|
+
import { IPyWidgetsClassicManager } from "../../jupyter/ipywidgets/IPyWidgetsClassicManager";
|
|
8
8
|
// import { activateWidgetExtension } from "./../../jupyter/ipywidgets/IPyWidgetsJupyterLabPlugin";
|
|
9
9
|
// import { activatePlotlyWidgetExtension } from "./../../jupyter/ipywidgets/plotly/JupyterlabPlugin";
|
|
10
10
|
export class OutputAdapter {
|
|
11
|
-
constructor(kernel,
|
|
12
|
-
this.
|
|
13
|
-
this._msgLoading = options.msgLoading || 'Loading...';
|
|
14
|
-
this._iPyWidgetsClassicManager = new IPyWidgetsClassicManager({ loader: requireLoader });
|
|
11
|
+
constructor(kernel, outputs) {
|
|
12
|
+
this._kernel = kernel;
|
|
15
13
|
this._renderers = standardRendererFactories.filter(factory => factory.mimeTypes[0] !== 'text/javascript');
|
|
16
14
|
this._renderers.push(jsonRendererFactory);
|
|
17
15
|
this._renderers.push(javascriptRendererFactory);
|
|
18
16
|
this._rendermime = new RenderMimeRegistry({
|
|
19
17
|
initialFactories: this._renderers,
|
|
20
18
|
});
|
|
21
|
-
this.
|
|
22
|
-
model: model,
|
|
23
|
-
rendermime: this._rendermime,
|
|
24
|
-
});
|
|
19
|
+
this._iPyWidgetsClassicManager = new IPyWidgetsClassicManager({ loader: requireLoader });
|
|
25
20
|
this._rendermime.addFactory({
|
|
26
21
|
safe: false,
|
|
27
22
|
mimeTypes: [WIDGET_MIMETYPE],
|
|
@@ -29,53 +24,51 @@ export class OutputAdapter {
|
|
|
29
24
|
}, 0);
|
|
30
25
|
// const widgetRegistry = activateWidgetExtension(this._rendermime, null, null, null);
|
|
31
26
|
// activatePlotlyWidgetExtension(widgetRegistry);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
if (!options.noAutoInit) {
|
|
38
|
-
this.renderCell(model);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
get outputArea() {
|
|
42
|
-
return this._outputArea;
|
|
43
|
-
}
|
|
44
|
-
renderCell(model) {
|
|
27
|
+
const outputAreaModel = new OutputAreaModel({
|
|
28
|
+
trusted: true,
|
|
29
|
+
values: outputs,
|
|
30
|
+
});
|
|
45
31
|
this._outputArea = new OutputArea({
|
|
46
|
-
model:
|
|
32
|
+
model: outputAreaModel,
|
|
47
33
|
rendermime: this._rendermime,
|
|
48
34
|
});
|
|
35
|
+
this.initKernel();
|
|
49
36
|
}
|
|
50
37
|
execute(code) {
|
|
51
|
-
if (this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
|
|
38
|
+
if (this._kernel) {
|
|
39
|
+
this.clearOutput();
|
|
40
|
+
this._kernel.getJupyterKernel().then((kernelConnection) => {
|
|
41
|
+
this._outputArea.future = kernelConnection.requestExecute({ code });
|
|
42
|
+
});
|
|
55
43
|
}
|
|
56
44
|
}
|
|
57
45
|
interrupt() {
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
if (this._kernel) {
|
|
47
|
+
this._kernel.getJupyterKernel().then((kernelConnection) => {
|
|
48
|
+
kernelConnection.interrupt();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
61
51
|
}
|
|
62
52
|
clearOutput() {
|
|
63
53
|
this._outputArea.model.clear();
|
|
64
54
|
}
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
this._outputArea.future = kernelConnection.requestExecute({ code });
|
|
68
|
-
});
|
|
69
|
-
this._outputArea.model.add({
|
|
70
|
-
output_type: 'stream',
|
|
71
|
-
name: 'loading',
|
|
72
|
-
text: this._msgLoading,
|
|
73
|
-
});
|
|
74
|
-
this._outputArea.model.clear(true);
|
|
55
|
+
get kernel() {
|
|
56
|
+
return this._kernel;
|
|
75
57
|
}
|
|
76
|
-
|
|
58
|
+
set kernel(kernel) {
|
|
59
|
+
this._kernel = kernel;
|
|
60
|
+
this.initKernel();
|
|
61
|
+
}
|
|
62
|
+
get outputArea() {
|
|
77
63
|
return this._outputArea;
|
|
78
64
|
}
|
|
65
|
+
initKernel() {
|
|
66
|
+
if (this._kernel) {
|
|
67
|
+
this._kernel.getJupyterKernel().then((kernelConnection) => {
|
|
68
|
+
this._iPyWidgetsClassicManager.registerWithKernel(kernelConnection);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
79
72
|
}
|
|
80
73
|
export default OutputAdapter;
|
|
81
74
|
//# sourceMappingURL=OutputAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputAdapter.js","sourceRoot":"","sources":["../../../src/components/output/OutputAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAe,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAE7F,mGAAmG;AACnG,sGAAsG;AA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C,OAAO,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,EAAE;gBACxD,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,gBAAgB,CAAC,cAAc,CAAC,EAAC,IAAI,EAAC,CAAC,CAAA;YACnE,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,SAAS;QACd,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,EAAE;gBACxD,gBAAgB,CAAC,SAAS,EAAE,CAAC;YAC/B,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,MAAM,CAAC,MAA0B;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAEO,UAAU;QAChB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,EAAE;gBACxD,IAAI,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;YACrE,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CAEF;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
{
|
|
4
|
+
"execution_count": 2,
|
|
5
|
+
"output_type": "execute_result",
|
|
6
|
+
"data": {
|
|
7
|
+
"text/plain": "IntSlider(value=7, max=10)",
|
|
8
|
+
"application/vnd.jupyter.widget-view+json": {
|
|
9
|
+
"version_major": 2,
|
|
10
|
+
"version_minor": 0,
|
|
11
|
+
"model_id": "cf2eac02dda44b08befe1657e1de73a2"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"metadata": {}
|
|
15
|
+
}
|
|
16
|
+
{
|
|
17
|
+
"name": "stdout",
|
|
18
|
+
"text": "1\n1\n",
|
|
19
|
+
"output_type": "stream"
|
|
20
|
+
}
|
|
21
|
+
{
|
|
22
|
+
"traceback": [
|
|
23
|
+
"\u001b[0;36m Input \u001b[0;32mIn [4]\u001b[0;36m\u001b[0m\n\u001b[0;31m x=1sdfsq\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid decimal literal\n"
|
|
24
|
+
],
|
|
25
|
+
"ename": "SyntaxError",
|
|
26
|
+
"evalue": "invalid decimal literal (2376046737.py, line 1)",
|
|
27
|
+
"output_type": "error"
|
|
28
|
+
}
|
|
29
|
+
*/
|
|
30
|
+
export const OutputRenderer = (props) => {
|
|
31
|
+
const { output } = props;
|
|
32
|
+
let plain;
|
|
33
|
+
let html;
|
|
34
|
+
let img;
|
|
35
|
+
switch (output.output_type) {
|
|
36
|
+
case "error": {
|
|
37
|
+
plain = output.traceback.join('\n');
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case "stream": {
|
|
41
|
+
const t = output.text;
|
|
42
|
+
if (typeof t === "string") {
|
|
43
|
+
plain = t;
|
|
44
|
+
}
|
|
45
|
+
else if (typeof t === "boolean") {
|
|
46
|
+
plain = t ? "true" : "false";
|
|
47
|
+
}
|
|
48
|
+
else if (Array.isArray(t)) {
|
|
49
|
+
plain = t.join('\n');
|
|
50
|
+
}
|
|
51
|
+
else
|
|
52
|
+
plain = t === null || t === void 0 ? void 0 : t.toString();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case "display_data": {
|
|
56
|
+
const data = output.data;
|
|
57
|
+
if (data) {
|
|
58
|
+
const image_png = data["image/png"];
|
|
59
|
+
if (image_png) {
|
|
60
|
+
img = image_png;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "execute_result": {
|
|
66
|
+
const data = output.data;
|
|
67
|
+
if (data) {
|
|
68
|
+
const text_plain = data["text/plain"];
|
|
69
|
+
if (text_plain) {
|
|
70
|
+
if (typeof text_plain === "string") {
|
|
71
|
+
plain = text_plain;
|
|
72
|
+
}
|
|
73
|
+
else if (Array.isArray(text_plain)) {
|
|
74
|
+
plain = text_plain.join('\n');
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
plain = text_plain.toString();
|
|
78
|
+
}
|
|
79
|
+
const text_html = data["text/html"];
|
|
80
|
+
if (text_html) {
|
|
81
|
+
if (typeof text_html === "string") {
|
|
82
|
+
html = text_html;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
html = text_html.join('\n');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// console.log('---', output, plain, html);
|
|
93
|
+
return (_jsxs(_Fragment, { children: [plain &&
|
|
94
|
+
_jsx("pre", Object.assign({ style: { color: "black" } }, { children: plain }), void 0),
|
|
95
|
+
html &&
|
|
96
|
+
_jsx("div", { children: _jsx("div", { dangerouslySetInnerHTML: { __html: html } }, void 0) }, void 0),
|
|
97
|
+
img &&
|
|
98
|
+
_jsx("div", { children: _jsx("img", { src: `data:image/png;base64,${img}` }, void 0) }, void 0)] }, void 0));
|
|
99
|
+
};
|
|
100
|
+
export default OutputRenderer;
|
|
101
|
+
//# sourceMappingURL=OutputRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputRenderer.js","sourceRoot":"","sources":["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CAAC,IAAW,CAAC;YAChC,IAAI,IAAI,EAAE;gBACR,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;gBACtC,IAAI,UAAU,EAAE;oBACd,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;wBAClC,KAAK,GAAG,UAAU,CAAC;qBACpB;yBACI,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;wBAClC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBAC/B;;wBACI,KAAK,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;iBACpC;gBACD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;gBACpC,IAAI,SAAS,EAAE;oBACb,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;wBACjC,IAAI,GAAG,SAAS,CAAC;qBAClB;yBAAM;wBACL,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBAC7B;iBACF;aACF;YACD,MAAM;SACP;KACF;IACH,4CAA4C;IAC1C,OAAO,CACL,8BACI,KAAK;gBACL,4BAAK,KAAK,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,gBACzB,KAAK,YACF;YAEN,IAAI;gBACJ,wBACE,cAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAI,WAC9C;YAEN,GAAG;gBACH,wBACE,cAAK,GAAG,EAAE,yBAAyB,GAAG,EAAE,WAAI,WACxC,YAEP,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,cAAc,CAAC"}
|
|
File without changes
|
|
@@ -7,36 +7,36 @@ export const outputInitialState = {
|
|
|
7
7
|
/* Selectors */
|
|
8
8
|
export const selectJupyterSource = (id) => useSelector((state) => {
|
|
9
9
|
var _a;
|
|
10
|
-
if (state.
|
|
11
|
-
return (_a = state.
|
|
10
|
+
if (state.output) {
|
|
11
|
+
return (_a = state.output.outputs.get(id)) === null || _a === void 0 ? void 0 : _a.source;
|
|
12
12
|
}
|
|
13
13
|
return undefined;
|
|
14
14
|
});
|
|
15
15
|
export const selectJupyterSetSource = (id) => useSelector((state) => {
|
|
16
16
|
var _a;
|
|
17
|
-
if (state.
|
|
18
|
-
return (_a = state.
|
|
17
|
+
if (state.output) {
|
|
18
|
+
return (_a = state.output.outputs.get(id)) === null || _a === void 0 ? void 0 : _a.setSource;
|
|
19
19
|
}
|
|
20
20
|
return undefined;
|
|
21
21
|
});
|
|
22
22
|
export const selectDataset = (id) => useSelector((state) => {
|
|
23
23
|
var _a;
|
|
24
|
-
if (state.
|
|
25
|
-
return (_a = state.
|
|
24
|
+
if (state.output) {
|
|
25
|
+
return (_a = state.output.outputs.get(id)) === null || _a === void 0 ? void 0 : _a.dataset;
|
|
26
26
|
}
|
|
27
27
|
return undefined;
|
|
28
28
|
});
|
|
29
29
|
export const selectExecute = (id) => useSelector((state) => {
|
|
30
30
|
var _a;
|
|
31
|
-
if (state.
|
|
32
|
-
return (_a = state.
|
|
31
|
+
if (state.output) {
|
|
32
|
+
return (_a = state.output.outputs.get(id)) === null || _a === void 0 ? void 0 : _a.execute;
|
|
33
33
|
}
|
|
34
34
|
return undefined;
|
|
35
35
|
});
|
|
36
36
|
export const selectGrade = (id) => useSelector((state) => {
|
|
37
37
|
var _a;
|
|
38
|
-
if (state.
|
|
39
|
-
return (_a = state.
|
|
38
|
+
if (state.output) {
|
|
39
|
+
return (_a = state.output.outputs.get(id)) === null || _a === void 0 ? void 0 : _a.grade;
|
|
40
40
|
}
|
|
41
41
|
return undefined;
|
|
42
42
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputState.js","sourceRoot":"","sources":["../../../src/components/output/OutputState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,oBAAoB,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,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E;IACtF,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;IACpC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE;QACL,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;KACzB;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;KACtC;IACD,uCACK,KAAK,KACR,OAAO,IACR;AACH,CAAC,CAAC;KACD,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,KAAoB,EAAE,KAAyB,EAAE,EAAE;IAC7E,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAChC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE;QACL,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC;KACjB;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;KAClC;IACD,uCACK,KAAK,KACR,OAAO,IACR;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import SettingsAdapter from './SettingsAdapter';
|
|
3
|
-
import
|
|
3
|
+
import Lumino from '../../jupyter/lumino/Lumino';
|
|
4
4
|
export const Settings = () => {
|
|
5
5
|
const settingsAdapter = new SettingsAdapter();
|
|
6
|
-
return _jsx(_Fragment, { children: _jsx(
|
|
6
|
+
return _jsx(_Fragment, { children: _jsx(Lumino, { children: settingsAdapter.panel }, void 0) }, void 0);
|
|
7
7
|
};
|
|
8
8
|
export default Settings;
|
|
9
9
|
//# sourceMappingURL=Settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/components/settings/Settings.tsx"],"names":[],"mappings":";AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/components/settings/Settings.tsx"],"names":[],"mappings":";AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,MAAM,MAAM,6BAA6B,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9C,OAAO,4BACL,KAAC,MAAM,cAAE,eAAe,CAAC,KAAK,WAAU,WACvC,CAAA;AACL,CAAC,CAAA;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsAdapter.js","sourceRoot":"","sources":["../../../src/components/settings/SettingsAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"SettingsAdapter.js","sourceRoot":"","sources":["../../../src/components/settings/SettingsAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,uBAAuB,CAAC;AAE/B,MAAM,eAAe;IAGnB;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,SAAS,EAAE,CAAC;QACrC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,mBAAmB,CAAC;QAC5C,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CAEF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { useDispatch } from "react-redux";
|
|
|
4
4
|
import TerminalAdapter from './TerminalAdapter';
|
|
5
5
|
import { terminalActions, terminalReducer } from './TerminalState';
|
|
6
6
|
import { useJupyter } from './../../jupyter/JupyterContext';
|
|
7
|
-
import
|
|
7
|
+
import Lumino from '../../jupyter/lumino/Lumino';
|
|
8
8
|
export const Terminal = () => {
|
|
9
9
|
const { injectableStore } = useJupyter();
|
|
10
10
|
const dispatch = useDispatch();
|
|
@@ -15,7 +15,7 @@ export const Terminal = () => {
|
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
dispatch(terminalActions.update({ adapter }));
|
|
17
17
|
}, []);
|
|
18
|
-
return _jsx(
|
|
18
|
+
return _jsx(Lumino, { children: adapter.panel }, void 0);
|
|
19
19
|
};
|
|
20
20
|
export default Terminal;
|
|
21
21
|
//# sourceMappingURL=Terminal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/components/terminal/Terminal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/components/terminal/Terminal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,MAAM,MAAM,6BAA6B,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,EAAE;QACV,eAAuB,CAAC,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,KAAC,MAAM,cAAE,OAAO,CAAC,KAAK,WAAU,CAAA;AACzC,CAAC,CAAA;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { BoxPanel } from '@lumino/widgets';
|
|
2
|
-
import '@jupyterlab/terminal/style/index.css';
|
|
3
|
-
import '@jupyterlab/theme-light-extension/style/theme.css';
|
|
4
|
-
import '@jupyterlab/theme-light-extension/style/variables.css';
|
|
5
2
|
import './TerminalAdapter.css';
|
|
6
3
|
export declare class TerminalAdapter {
|
|
7
4
|
private terminalPanel;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { BoxPanel } from '@lumino/widgets';
|
|
2
2
|
import { TerminalManager } from '@jupyterlab/services';
|
|
3
3
|
import { Terminal } from '@jupyterlab/terminal';
|
|
4
|
-
import '@jupyterlab/terminal/style/index.css';
|
|
5
|
-
import '@jupyterlab/theme-light-extension/style/theme.css';
|
|
6
|
-
import '@jupyterlab/theme-light-extension/style/variables.css';
|
|
7
4
|
import './TerminalAdapter.css';
|
|
8
5
|
export class TerminalAdapter {
|
|
9
6
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalAdapter.js","sourceRoot":"","sources":["../../../src/components/terminal/TerminalAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"TerminalAdapter.js","sourceRoot":"","sources":["../../../src/components/terminal/TerminalAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AAE3D,OAAO,uBAAuB,CAAC;AAE/B,MAAM,OAAO,eAAe;IAI1B;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,QAAQ,EAAE,CAAC;QACpC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;QACtC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;YAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YACrD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;YACpC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,KAAwB,CAAC,CAAC;IAC7D,CAAC;CAEF;AAED,eAAe,eAAe,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './jupyter/Jupyter';
|
|
2
2
|
export * from './jupyter/JupyterContext';
|
|
3
3
|
export * from './jupyter/JupyterConfig';
|
|
4
|
-
export * from './jupyter/lumino/
|
|
4
|
+
export * from './jupyter/lumino/Lumino';
|
|
5
5
|
export * from './jupyter/lumino/LuminoDetached';
|
|
6
6
|
export * from './jupyter/lumino/LuminoNotebook';
|
|
7
7
|
export * from './jupyter/lumino/LuminoObservable';
|
|
@@ -34,9 +34,9 @@ export * from './components/console/ConsoleState';
|
|
|
34
34
|
export * from './components/dialog/Dialog';
|
|
35
35
|
export * from './components/filebrowser/FileBrowser';
|
|
36
36
|
export * from './components/filebrowser/FileBrowserState';
|
|
37
|
-
export * from './components/
|
|
38
|
-
export * from './components/
|
|
39
|
-
export * from './components/
|
|
37
|
+
export * from './components/output/Output';
|
|
38
|
+
export * from './components/output/OutputAdapter';
|
|
39
|
+
export * from './components/output/OutputState';
|
|
40
40
|
export * from './components/settings/Settings';
|
|
41
41
|
export * from './components/settings/SettingsState';
|
|
42
42
|
export * from './components/terminal/Terminal';
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export * from './jupyter/Jupyter';
|
|
3
3
|
export * from './jupyter/JupyterContext';
|
|
4
4
|
export * from './jupyter/JupyterConfig';
|
|
5
|
-
export * from './jupyter/lumino/
|
|
5
|
+
export * from './jupyter/lumino/Lumino';
|
|
6
6
|
export * from './jupyter/lumino/LuminoDetached';
|
|
7
7
|
export * from './jupyter/lumino/LuminoNotebook';
|
|
8
8
|
export * from './jupyter/lumino/LuminoObservable';
|
|
@@ -45,9 +45,9 @@ export * from './components/dialog/Dialog';
|
|
|
45
45
|
export * from './components/filebrowser/FileBrowser';
|
|
46
46
|
export * from './components/filebrowser/FileBrowserState';
|
|
47
47
|
// Outputs.
|
|
48
|
-
export * from './components/
|
|
49
|
-
export * from './components/
|
|
50
|
-
export * from './components/
|
|
48
|
+
export * from './components/output/Output';
|
|
49
|
+
export * from './components/output/OutputAdapter';
|
|
50
|
+
export * from './components/output/OutputState';
|
|
51
51
|
// Settings.
|
|
52
52
|
export * from './components/settings/Settings';
|
|
53
53
|
export * from './components/settings/SettingsState';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,YAAY;AACZ,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc;AACd,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,QAAQ;AACR,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,qBAAqB;AACrB,cAAc,0CAA0C,CAAC;AACzD,YAAY;AACZ,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wDAAwD,CAAC;AACvE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mEAAmE,CAAC;AAClF,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,mDAAmD,CAAC;AAClE,YAAY;AACZ,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,UAAU;AACV,cAAc,4BAA4B,CAAC;AAC3C,eAAe;AACf,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,WAAW;AACX,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,YAAY;AACZ,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,YAAY;AACZ,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC"}
|
package/lib/jupyter/Jupyter.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Store } from 'redux';
|
|
3
|
+
import '@lumino/widgets/style/index.css';
|
|
4
|
+
import '@lumino/dragdrop/style/index.css';
|
|
5
|
+
import '@jupyterlab/ui-components/style/base.css';
|
|
6
|
+
import '@jupyterlab/apputils/style/base.css';
|
|
7
|
+
import '@jupyterlab/rendermime/style/base.css';
|
|
8
|
+
import '@jupyterlab/codeeditor/style/base.css';
|
|
9
|
+
import '@jupyterlab/documentsearch/style/base.css';
|
|
10
|
+
import '@jupyterlab/outputarea/style/base.css';
|
|
11
|
+
import '@jupyterlab/console/style/base.css';
|
|
12
|
+
import '@jupyterlab/completer/style/base.css';
|
|
13
|
+
import '@jupyterlab/cells/style/base.css';
|
|
14
|
+
import '@jupyterlab/notebook/style/base.css';
|
|
15
|
+
import '@jupyterlab/codemirror/style/base.css';
|
|
16
|
+
import '@jupyterlab/filebrowser/style/base.css';
|
|
17
|
+
import '@jupyterlab/terminal/style/base.css';
|
|
18
|
+
import '@jupyterlab/theme-light-extension/style/theme.css';
|
|
19
|
+
import '@jupyterlab/theme-light-extension/style/variables.css';
|
|
20
|
+
import '@jupyter-widgets/base/css/index.css';
|
|
21
|
+
import '@jupyter-widgets/controls/css/widgets-base.css';
|
|
3
22
|
/**
|
|
4
23
|
* Definition of the properties that can be passed
|
|
5
24
|
* when creating a Jupyter context.
|
|
@@ -7,7 +26,7 @@ import { Store } from 'redux';
|
|
|
7
26
|
export declare type JupyterProps = {
|
|
8
27
|
children: React.ReactNode;
|
|
9
28
|
lite: boolean;
|
|
10
|
-
|
|
29
|
+
startDefaultKernel: boolean;
|
|
11
30
|
injectableStore?: Store | any;
|
|
12
31
|
collaborative?: boolean;
|
|
13
32
|
jupyterServerHttpUrl?: string;
|
|
@@ -25,7 +44,7 @@ export declare const Jupyter: {
|
|
|
25
44
|
(props: JupyterProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
26
45
|
defaultProps: {
|
|
27
46
|
lite: boolean;
|
|
28
|
-
|
|
47
|
+
startDefaultKernel: boolean;
|
|
29
48
|
collaborative: boolean;
|
|
30
49
|
terminals: boolean;
|
|
31
50
|
};
|
package/lib/jupyter/Jupyter.js
CHANGED
|
@@ -4,6 +4,25 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
4
4
|
import { JupyterContextProvider } from './JupyterContext';
|
|
5
5
|
import { getJupyterServerHttpUrl, getJupyterServerWsUrl, loadJupyterConfig } from './JupyterConfig';
|
|
6
6
|
import injectableStore from '../state/Store';
|
|
7
|
+
import '@lumino/widgets/style/index.css';
|
|
8
|
+
import '@lumino/dragdrop/style/index.css';
|
|
9
|
+
import '@jupyterlab/ui-components/style/base.css';
|
|
10
|
+
import '@jupyterlab/apputils/style/base.css';
|
|
11
|
+
import '@jupyterlab/rendermime/style/base.css';
|
|
12
|
+
import '@jupyterlab/codeeditor/style/base.css';
|
|
13
|
+
import '@jupyterlab/documentsearch/style/base.css';
|
|
14
|
+
import '@jupyterlab/outputarea/style/base.css';
|
|
15
|
+
import '@jupyterlab/console/style/base.css';
|
|
16
|
+
import '@jupyterlab/completer/style/base.css';
|
|
17
|
+
import '@jupyterlab/cells/style/base.css';
|
|
18
|
+
import '@jupyterlab/notebook/style/base.css';
|
|
19
|
+
import '@jupyterlab/codemirror/style/base.css';
|
|
20
|
+
import '@jupyterlab/filebrowser/style/base.css';
|
|
21
|
+
import '@jupyterlab/terminal/style/base.css';
|
|
22
|
+
import '@jupyterlab/theme-light-extension/style/theme.css';
|
|
23
|
+
import '@jupyterlab/theme-light-extension/style/variables.css';
|
|
24
|
+
import '@jupyter-widgets/base/css/index.css';
|
|
25
|
+
import '@jupyter-widgets/controls/css/widgets-base.css';
|
|
7
26
|
/**
|
|
8
27
|
* The component to be used as fallback in case of error.
|
|
9
28
|
*/
|
|
@@ -17,13 +36,13 @@ const ErrorFallback = ({ error, resetErrorBoundary }) => {
|
|
|
17
36
|
* are available.
|
|
18
37
|
*/
|
|
19
38
|
export const Jupyter = (props) => {
|
|
20
|
-
const { lite,
|
|
39
|
+
const { lite, startDefaultKernel } = props;
|
|
21
40
|
loadJupyterConfig(props);
|
|
22
|
-
return (_jsx(ErrorBoundary, Object.assign({ FallbackComponent: ErrorFallback }, { children: _jsx(ThemeProvider, Object.assign({ colorMode: "day" }, { children: _jsx(BaseStyles, { children: _jsx(JupyterContextProvider, Object.assign({ lite: lite,
|
|
41
|
+
return (_jsx(ErrorBoundary, Object.assign({ FallbackComponent: ErrorFallback }, { children: _jsx(ThemeProvider, Object.assign({ colorMode: "day" }, { children: _jsx(BaseStyles, { children: _jsx(JupyterContextProvider, Object.assign({ lite: lite, startDefaultKernel: startDefaultKernel, baseUrl: getJupyterServerHttpUrl(), wsUrl: getJupyterServerWsUrl(), injectableStore: props.injectableStore || injectableStore, variant: "default" }, { children: props.children }), void 0) }, void 0) }), void 0) }), void 0));
|
|
23
42
|
};
|
|
24
43
|
Jupyter.defaultProps = {
|
|
25
44
|
lite: false,
|
|
26
|
-
|
|
45
|
+
startDefaultKernel: true,
|
|
27
46
|
collaborative: false,
|
|
28
47
|
terminals: false,
|
|
29
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jupyter.js","sourceRoot":"","sources":["../../src/jupyter/Jupyter.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Jupyter.js","sourceRoot":"","sources":["../../src/jupyter/Jupyter.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,eAAe,MAAM,gBAAgB,CAAC;AAE7C,OAAO,iCAAiC,CAAC;AACzC,OAAO,kCAAkC,CAAC;AAE1C,OAAO,0CAA0C,CAAC;AAClD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,2CAA2C,CAAC;AACnD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AA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
|
12
12
|
kernel?: Kernel;
|
|
13
|
+
startDefaultKernel: boolean;
|
|
13
14
|
variant: string;
|
|
14
15
|
setVariant: (value: string) => void;
|
|
15
16
|
baseUrl: string;
|
|
@@ -36,7 +37,7 @@ export declare const ensureJupyterAuth: (serverSettings: ServerConnection.ISetti
|
|
|
36
37
|
export declare const JupyterContextProvider: React.FC<{
|
|
37
38
|
children: React.ReactNode;
|
|
38
39
|
lite: boolean;
|
|
39
|
-
|
|
40
|
+
startDefaultKernel: boolean;
|
|
40
41
|
variant: string;
|
|
41
42
|
baseUrl: string;
|
|
42
43
|
wsUrl: string;
|
|
@@ -37,15 +37,17 @@ export const ensureJupyterAuth = (serverSettings) => {
|
|
|
37
37
|
return false;
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
+
/*
|
|
40
41
|
const headers = new Headers({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
"Cache-Control": "no-cache, no-store, must-revalidate",
|
|
43
|
+
"Pragma": "no-cache",
|
|
44
|
+
"Expires": "0",
|
|
44
45
|
});
|
|
46
|
+
*/
|
|
45
47
|
/**
|
|
46
48
|
* The Jupyter context provider.
|
|
47
49
|
*/
|
|
48
|
-
export const JupyterContextProvider = ({ children, lite,
|
|
50
|
+
export const JupyterContextProvider = ({ children, lite, startDefaultKernel, variant, baseUrl, wsUrl, injectableStore }) => {
|
|
49
51
|
const [_, setVariant] = useState('default');
|
|
50
52
|
const [serverSettings] = useState(ServerConnection.makeSettings({
|
|
51
53
|
baseUrl,
|
|
@@ -54,7 +56,8 @@ export const JupyterContextProvider = ({ children, lite, createKernel, variant,
|
|
|
54
56
|
init: {
|
|
55
57
|
credentials: "include",
|
|
56
58
|
mode: 'cors',
|
|
57
|
-
|
|
59
|
+
cache: 'no-cache',
|
|
60
|
+
// headers,
|
|
58
61
|
}
|
|
59
62
|
}));
|
|
60
63
|
const [serviceManager, setServiceManager] = useState();
|
|
@@ -79,10 +82,19 @@ export const JupyterContextProvider = ({ children, lite, createKernel, variant,
|
|
|
79
82
|
setServiceManager(serviceManager);
|
|
80
83
|
const kernelManager = serviceManager.sessions._kernelManager;
|
|
81
84
|
setKernelManager(kernelManager);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
kernelManager.ready.then(() => {
|
|
86
|
+
if (startDefaultKernel) {
|
|
87
|
+
// console.log('Kernel Manager is ready.');
|
|
88
|
+
const kernel = new Kernel({ kernelManager });
|
|
89
|
+
kernel.getJupyterKernel().then(k => {
|
|
90
|
+
console.log(`Kernel started with session id:client_id ${k.id}:${k.clientId}`);
|
|
91
|
+
k.info.then(info => {
|
|
92
|
+
// console.log('Kernel information', info);
|
|
93
|
+
});
|
|
94
|
+
setKernel(kernel);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
86
98
|
}
|
|
87
99
|
setVariant(variant);
|
|
88
100
|
}, [lite, variant]);
|
|
@@ -92,6 +104,7 @@ export const JupyterContextProvider = ({ children, lite, createKernel, variant,
|
|
|
92
104
|
serviceManager,
|
|
93
105
|
kernelManager,
|
|
94
106
|
kernel,
|
|
107
|
+
startDefaultKernel,
|
|
95
108
|
variant,
|
|
96
109
|
setVariant,
|
|
97
110
|
baseUrl,
|