@datalayer/jupyter-react 0.0.7 → 0.0.8
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/LICENSE +21 -0
- package/README.md +4 -0
- package/package.json +16 -11
- package/lib/components/cell/Cell.d.ts +0 -15
- package/lib/components/cell/Cell.js +0 -48
- package/lib/components/cell/CellAdapter.d.ts +0 -14
- package/lib/components/cell/CellAdapter.js +0 -133
- package/lib/components/cell/CellCommands.d.ts +0 -6
- package/lib/components/cell/CellCommands.js +0 -37
- package/lib/components/cell/CellState.d.ts +0 -22
- package/lib/components/cell/CellState.js +0 -45
- package/lib/components/commands/Commands.d.ts +0 -2
- package/lib/components/commands/Commands.js +0 -8
- package/lib/components/commands/CommandsAdapter.d.ts +0 -9
- package/lib/components/commands/CommandsAdapter.js +0 -35
- package/lib/components/commands/CommandsState.d.ts +0 -15
- package/lib/components/commands/CommandsState.js +0 -29
- package/lib/components/console/Console.d.ts +0 -2
- package/lib/components/console/Console.js +0 -8
- package/lib/components/console/ConsoleAdapter.d.ts +0 -11
- package/lib/components/console/ConsoleAdapter.js +0 -85
- package/lib/components/console/ConsoleState.d.ts +0 -15
- package/lib/components/console/ConsoleState.js +0 -29
- package/lib/components/dialog/Dialog.d.ts +0 -2
- package/lib/components/dialog/Dialog.js +0 -12
- package/lib/components/dialog/DialogAdapter.d.ts +0 -10
- package/lib/components/dialog/DialogAdapter.js +0 -18
- package/lib/components/editor/CodeMirrorEditor.d.ts +0 -7
- package/lib/components/editor/CodeMirrorEditor.js +0 -61
- package/lib/components/filebrowser/FileBrowser.d.ts +0 -2
- package/lib/components/filebrowser/FileBrowser.js +0 -8
- package/lib/components/filebrowser/FileBrowserAdapter.d.ts +0 -13
- package/lib/components/filebrowser/FileBrowserAdapter.js +0 -266
- package/lib/components/filebrowser/FileBrowserState.d.ts +0 -15
- package/lib/components/filebrowser/FileBrowserState.js +0 -29
- package/lib/components/filebrowser/FileBrowserTree.d.ts +0 -2
- package/lib/components/filebrowser/FileBrowserTree.js +0 -59
- package/lib/components/ipywidgets/IpyWidgetsComponent.d.ts +0 -5
- package/lib/components/ipywidgets/IpyWidgetsComponent.js +0 -8
- package/lib/components/notebook/Notebook.d.ts +0 -25
- package/lib/components/notebook/Notebook.js +0 -78
- package/lib/components/notebook/NotebookAdapter.d.ts +0 -25
- package/lib/components/notebook/NotebookAdapter.js +0 -186
- package/lib/components/notebook/NotebookCommands.d.ts +0 -38
- package/lib/components/notebook/NotebookCommands.js +0 -368
- package/lib/components/notebook/NotebookState.d.ts +0 -49
- package/lib/components/notebook/NotebookState.js +0 -116
- package/lib/components/notebook/content/CellSidebar.d.ts +0 -8
- package/lib/components/notebook/content/CellSidebar.js +0 -22
- package/lib/components/notebook/content/ContentFactoryWithSidebar.d.ts +0 -14
- package/lib/components/notebook/content/ContentFactoryWithSidebar.js +0 -19
- package/lib/components/notebook/content/NotebookInputPrompt.d.ts +0 -21
- package/lib/components/notebook/content/NotebookInputPrompt.js +0 -66
- package/lib/components/notebook/render/marked.d.ts +0 -3
- package/lib/components/notebook/render/marked.js +0 -71
- package/lib/components/outputs/Output.d.ts +0 -16
- package/lib/components/outputs/Output.js +0 -55
- package/lib/components/outputs/OutputAdapter.d.ts +0 -20
- package/lib/components/outputs/OutputAdapter.js +0 -69
- package/lib/components/outputs/OutputState.d.ts +0 -15
- package/lib/components/outputs/OutputState.js +0 -29
- package/lib/components/settings/Settings.d.ts +0 -2
- package/lib/components/settings/Settings.js +0 -8
- package/lib/components/settings/SettingsAdapter.d.ts +0 -10
- package/lib/components/settings/SettingsAdapter.js +0 -15
- package/lib/components/settings/SettingsState.d.ts +0 -15
- package/lib/components/settings/SettingsState.js +0 -29
- package/lib/components/terminal/Terminal.d.ts +0 -2
- package/lib/components/terminal/Terminal.js +0 -15
- package/lib/components/terminal/TerminalAdapter.d.ts +0 -13
- package/lib/components/terminal/TerminalAdapter.js +0 -27
- package/lib/components/terminal/TerminalState.d.ts +0 -15
- package/lib/components/terminal/TerminalState.js +0 -37
- package/lib/index.d.ts +0 -23
- package/lib/index.js +0 -35
- package/lib/jupyter/AuthError.d.ts +0 -7
- package/lib/jupyter/AuthError.js +0 -7
- package/lib/jupyter/Handlers.d.ts +0 -8
- package/lib/jupyter/Handlers.js +0 -49
- package/lib/jupyter/Jupyter.d.ts +0 -23
- package/lib/jupyter/Jupyter.js +0 -34
- package/lib/jupyter/JupyterConfig.d.ts +0 -37
- package/lib/jupyter/JupyterConfig.js +0 -58
- package/lib/jupyter/JupyterContext.d.ts +0 -35
- package/lib/jupyter/JupyterContext.js +0 -63
- package/lib/jupyter/ipywidgets/IPyWidgetsAttached.d.ts +0 -8
- package/lib/jupyter/ipywidgets/IPyWidgetsAttached.js +0 -14
- package/lib/jupyter/ipywidgets/IPyWidgetsClassicManager.d.ts +0 -18
- package/lib/jupyter/ipywidgets/IPyWidgetsClassicManager.js +0 -75
- package/lib/jupyter/ipywidgets/IPyWidgetsJupyterLabPlugin.d.ts +0 -15
- package/lib/jupyter/ipywidgets/IPyWidgetsJupyterLabPlugin.js +0 -177
- package/lib/jupyter/ipywidgets/IpyWidgetsManager.d.ts +0 -11
- package/lib/jupyter/ipywidgets/IpyWidgetsManager.js +0 -70
- package/lib/jupyter/ipywidgets/plotly/Figure.d.ts +0 -587
- package/lib/jupyter/ipywidgets/plotly/Figure.js +0 -1696
- package/lib/jupyter/ipywidgets/plotly/JupyterlabPlugin.d.ts +0 -5
- package/lib/jupyter/ipywidgets/plotly/JupyterlabPlugin.js +0 -11
- package/lib/jupyter/ipywidgets/plotly/Version.d.ts +0 -8
- package/lib/jupyter/ipywidgets/plotly/Version.js +0 -15
- package/lib/jupyter/ipywidgets/plotly/index.d.ts +0 -2
- package/lib/jupyter/ipywidgets/plotly/index.js +0 -3
- package/lib/jupyter/lumino/LuminoAttached.d.ts +0 -9
- package/lib/jupyter/lumino/LuminoAttached.js +0 -22
- package/lib/jupyter/lumino/LuminoDetached.d.ts +0 -9
- package/lib/jupyter/lumino/LuminoDetached.js +0 -12
- package/lib/jupyter/lumino/LuminoObservable.d.ts +0 -6
- package/lib/jupyter/lumino/LuminoObservable.js +0 -15
- package/lib/jupyter/lumino/LuminoReactPortal.d.ts +0 -180
- package/lib/jupyter/lumino/LuminoReactPortal.js +0 -194
- package/lib/jupyter/lumino/LuminoRedux.d.ts +0 -8
- package/lib/jupyter/lumino/LuminoRedux.js +0 -1
- package/lib/jupyter/services/Services.d.ts +0 -16
- package/lib/jupyter/services/Services.js +0 -40
- package/lib/jupyter/services/kernel/Kernel.d.ts +0 -15
- package/lib/jupyter/services/kernel/Kernel.js +0 -64
- package/lib/jupyter/services/kernel/KernelModel.d.ts +0 -18
- package/lib/jupyter/services/kernel/KernelModel.js +0 -51
- package/lib/state/State.d.ts +0 -14
- package/lib/state/State.js +0 -31
- package/lib/state/Store.d.ts +0 -4
- package/lib/state/Store.js +0 -38
- package/lib/state/init/Init.d.ts +0 -3
- package/lib/state/init/Init.js +0 -11
- package/lib/state/init/InitState.d.ts +0 -19
- package/lib/state/init/InitState.js +0 -47
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import { ReactWidget } from '@jupyterlab/apputils';
|
|
4
|
-
/**
|
|
5
|
-
* The class name added to OutputPrompt.
|
|
6
|
-
*/
|
|
7
|
-
const INPUT_PROMPT_CLASS = 'jp-InputPrompt';
|
|
8
|
-
export default function Countdown(props) {
|
|
9
|
-
const [count, setCount] = useState(props.count);
|
|
10
|
-
let intervalRef = useRef();
|
|
11
|
-
const decreaseNum = () => setCount((prev) => prev - 1);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setCount(props.count);
|
|
14
|
-
}, [props.count]);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
intervalRef.current = setInterval(decreaseNum, 1000);
|
|
17
|
-
return () => clearInterval(intervalRef.current);
|
|
18
|
-
}, []);
|
|
19
|
-
return (_jsx("div", { children: _jsx("div", { children: count }, void 0) }, void 0));
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The custom input prompt implementation.
|
|
23
|
-
*/
|
|
24
|
-
export class NotebookInputPrompt extends ReactWidget {
|
|
25
|
-
/*
|
|
26
|
-
* Create an output prompt widget.
|
|
27
|
-
*/
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this.state = {
|
|
31
|
-
count: 100
|
|
32
|
-
};
|
|
33
|
-
this._executionCount = null;
|
|
34
|
-
this.addClass(INPUT_PROMPT_CLASS);
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
return _jsx(Countdown, { count: this.state.count }, void 0);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The execution count for the prompt.
|
|
41
|
-
*/
|
|
42
|
-
get executionCount() {
|
|
43
|
-
return this._executionCount;
|
|
44
|
-
}
|
|
45
|
-
set executionCount(value) {
|
|
46
|
-
this._executionCount = value;
|
|
47
|
-
if (value === null) {
|
|
48
|
-
this.state = {
|
|
49
|
-
count: 0
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
if (value === '*') {
|
|
54
|
-
this.state = {
|
|
55
|
-
count: 0
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
this.state = {
|
|
60
|
-
count: Number(value)
|
|
61
|
-
};
|
|
62
|
-
this.update();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { CodeMirrorEditor, Mode } from '@jupyterlab/codemirror';
|
|
2
|
-
import { marked } from 'marked';
|
|
3
|
-
export const getMarked = () => {
|
|
4
|
-
Private.initializeMarked();
|
|
5
|
-
return {
|
|
6
|
-
render: (content) => new Promise((resolve, reject) => {
|
|
7
|
-
marked(content, (err, content) => {
|
|
8
|
-
if (err) {
|
|
9
|
-
reject(err);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
resolve(content);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
})
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
var Private;
|
|
19
|
-
(function (Private) {
|
|
20
|
-
let markedInitialized = false;
|
|
21
|
-
function initializeMarked() {
|
|
22
|
-
if (markedInitialized) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
markedInitialized = true;
|
|
27
|
-
}
|
|
28
|
-
marked.setOptions({
|
|
29
|
-
gfm: true,
|
|
30
|
-
sanitize: false,
|
|
31
|
-
// breaks: true; We can't use GFM breaks as it causes problems with tables
|
|
32
|
-
langPrefix: `cm-s-${CodeMirrorEditor.defaultConfig.theme} language-`,
|
|
33
|
-
highlight: (code, lang, callback) => {
|
|
34
|
-
const cb = (err, code) => {
|
|
35
|
-
if (callback) {
|
|
36
|
-
callback(err, code);
|
|
37
|
-
}
|
|
38
|
-
return code;
|
|
39
|
-
};
|
|
40
|
-
if (!lang) {
|
|
41
|
-
// no language, no highlight
|
|
42
|
-
return cb(null, code);
|
|
43
|
-
}
|
|
44
|
-
Mode.ensure(lang)
|
|
45
|
-
.then(spec => {
|
|
46
|
-
const el = document.createElement('div');
|
|
47
|
-
if (!spec) {
|
|
48
|
-
console.error(`No CodeMirror mode: ${lang}`);
|
|
49
|
-
return cb(null, code);
|
|
50
|
-
}
|
|
51
|
-
try {
|
|
52
|
-
Mode.run(code, spec.mime, el);
|
|
53
|
-
return cb(null, el.innerHTML);
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
console.error(`Failed to highlight ${lang} code`, err);
|
|
57
|
-
return cb(err, code);
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
.catch(err => {
|
|
61
|
-
console.error(`No CodeMirror mode: ${lang}`);
|
|
62
|
-
console.error(`Require CodeMirror mode error: ${err}`);
|
|
63
|
-
return cb(null, code);
|
|
64
|
-
});
|
|
65
|
-
return code;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
Private.initializeMarked = initializeMarked;
|
|
70
|
-
})(Private || (Private = {}));
|
|
71
|
-
export default getMarked;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as nbformat from '@jupyterlab/nbformat';
|
|
2
|
-
import Kernel from '../../jupyter/services/kernel/Kernel';
|
|
3
|
-
export declare type IOutputProps = {
|
|
4
|
-
initialOutput?: [nbformat.IOutput];
|
|
5
|
-
kernel: Kernel;
|
|
6
|
-
autoRun: boolean;
|
|
7
|
-
showEditor: boolean;
|
|
8
|
-
code: string;
|
|
9
|
-
executeTrigger: number;
|
|
10
|
-
clearTrigger: number;
|
|
11
|
-
};
|
|
12
|
-
declare const Output: {
|
|
13
|
-
(props: IOutputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
-
defaultProps: Partial<IOutputProps>;
|
|
15
|
-
};
|
|
16
|
-
export default Output;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo, useEffect } from 'react';
|
|
3
|
-
import { OutputAreaModel } from '@jupyterlab/outputarea';
|
|
4
|
-
import OutputAdapter from './OutputAdapter';
|
|
5
|
-
import CodeMirrorEditor from '../editor/CodeMirrorEditor';
|
|
6
|
-
import LuminoAttached from '../../jupyter/lumino/LuminoAttached';
|
|
7
|
-
const Output = (props) => {
|
|
8
|
-
const { initialOutput, autoRun, code, kernel, showEditor, executeTrigger, clearTrigger } = props;
|
|
9
|
-
const [model] = useState(new OutputAreaModel({
|
|
10
|
-
trusted: true,
|
|
11
|
-
values: initialOutput,
|
|
12
|
-
}));
|
|
13
|
-
const Output = useMemo(() => {
|
|
14
|
-
return new OutputAdapter(kernel.getJupyterKernel(), model, {});
|
|
15
|
-
}, []);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (!showEditor && autoRun) {
|
|
18
|
-
Output.execute(code);
|
|
19
|
-
}
|
|
20
|
-
}, [executeTrigger]);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (showEditor) {
|
|
23
|
-
Output.execute(code);
|
|
24
|
-
}
|
|
25
|
-
}, [executeTrigger]);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (showEditor) {
|
|
28
|
-
Output.clearOutput();
|
|
29
|
-
}
|
|
30
|
-
}, [clearTrigger]);
|
|
31
|
-
return _jsxs("div", { children: [_jsx("div", { children: showEditor &&
|
|
32
|
-
_jsx(CodeMirrorEditor, { autoRun: autoRun, code: code, outputAdapter: Output }, void 0) }, void 0),
|
|
33
|
-
_jsx("div", Object.assign({ css: {
|
|
34
|
-
'& .jp-OutputPrompt': {
|
|
35
|
-
display: 'none',
|
|
36
|
-
},
|
|
37
|
-
} }, { children: _jsx(LuminoAttached, { children: Output.panel }, void 0) }), void 0)] }, void 0);
|
|
38
|
-
};
|
|
39
|
-
Output.defaultProps = {
|
|
40
|
-
initialOutput: [
|
|
41
|
-
{
|
|
42
|
-
"output_type": "execute_result",
|
|
43
|
-
"data": {
|
|
44
|
-
"text/html": [
|
|
45
|
-
"<h3>I am the default output... 👉 Run the cell to update me... 👀</h3>"
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
"execution_count": 0,
|
|
49
|
-
"metadata": {},
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
executeTrigger: 0,
|
|
53
|
-
clearTrigger: 0,
|
|
54
|
-
};
|
|
55
|
-
export default Output;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { OutputArea, OutputAreaModel } from '@jupyterlab/outputarea';
|
|
2
|
-
import { Kernel } from '@jupyterlab/services';
|
|
3
|
-
import '@lumino/default-theme/style/index.css';
|
|
4
|
-
import '@jupyterlab/json-extension/style/index.css';
|
|
5
|
-
import './OutputAdapter.css';
|
|
6
|
-
declare class OutputAdapter {
|
|
7
|
-
private _kernelConnectionPromise;
|
|
8
|
-
private _renderers;
|
|
9
|
-
private _outputArea;
|
|
10
|
-
private _msgLoading;
|
|
11
|
-
private _rendermime;
|
|
12
|
-
private _iPyWidgetsClassicManager;
|
|
13
|
-
constructor(kernel: Promise<Kernel.IKernelConnection>, model: OutputAreaModel, options?: any);
|
|
14
|
-
private renderCell;
|
|
15
|
-
execute(code: string): void;
|
|
16
|
-
clearOutput(): void;
|
|
17
|
-
private render;
|
|
18
|
-
get panel(): OutputArea;
|
|
19
|
-
}
|
|
20
|
-
export default OutputAdapter;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { OutputArea } from '@jupyterlab/outputarea';
|
|
2
|
-
import { RenderMimeRegistry, standardRendererFactories } from '@jupyterlab/rendermime';
|
|
3
|
-
import { rendererFactory as jsonRendererFactory } from '@jupyterlab/json-extension';
|
|
4
|
-
import { IPyWidgetsClassicManager } from "../../jupyter/ipywidgets/IPyWidgetsClassicManager";
|
|
5
|
-
import { requireLoader } from "@jupyter-widgets/html-manager";
|
|
6
|
-
import { WIDGET_MIMETYPE, WidgetRenderer } from "@jupyter-widgets/html-manager/lib/output_renderers";
|
|
7
|
-
// import { activateWidgetExtension } from "../../ipywidgets/IPyWidgetsJupyterLabPlugin";
|
|
8
|
-
// import { activatePlotlyWidgetExtension } from "../../ipywidgets/plotly/jupyterlab-plugin";
|
|
9
|
-
import '@lumino/default-theme/style/index.css';
|
|
10
|
-
import '@jupyterlab/json-extension/style/index.css';
|
|
11
|
-
import './OutputAdapter.css';
|
|
12
|
-
class OutputAdapter {
|
|
13
|
-
constructor(kernel, model, options = {}) {
|
|
14
|
-
this._kernelConnectionPromise = kernel;
|
|
15
|
-
this._msgLoading = options.msgLoading || 'Loading...';
|
|
16
|
-
this._iPyWidgetsClassicManager = new IPyWidgetsClassicManager({ loader: requireLoader });
|
|
17
|
-
this._renderers = standardRendererFactories.filter(_ => true);
|
|
18
|
-
this._renderers.push(jsonRendererFactory);
|
|
19
|
-
this._rendermime = new RenderMimeRegistry({
|
|
20
|
-
initialFactories: this._renderers,
|
|
21
|
-
});
|
|
22
|
-
this._rendermime.addFactory({
|
|
23
|
-
safe: false,
|
|
24
|
-
mimeTypes: [WIDGET_MIMETYPE],
|
|
25
|
-
createRenderer: (options) => new WidgetRenderer(options, this._iPyWidgetsClassicManager),
|
|
26
|
-
}, 0);
|
|
27
|
-
// const widgetRegistry = activateWidgetExtension(this._rendermime, null, null, null);
|
|
28
|
-
// activatePlotlyWidgetExtension(widgetRegistry);
|
|
29
|
-
if (this._kernelConnectionPromise) {
|
|
30
|
-
this._kernelConnectionPromise.then((kernelConnection) => {
|
|
31
|
-
this._iPyWidgetsClassicManager.registerWithKernel(kernelConnection);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (!options.noAutoInit) {
|
|
35
|
-
this.renderCell(model);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
renderCell(model) {
|
|
39
|
-
this._outputArea = new OutputArea({
|
|
40
|
-
model: model,
|
|
41
|
-
rendermime: this._rendermime,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
execute(code) {
|
|
45
|
-
if (this._kernelConnectionPromise) {
|
|
46
|
-
this._outputArea.model.clear();
|
|
47
|
-
this.render(code);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
clearOutput() {
|
|
52
|
-
this._outputArea.model.clear();
|
|
53
|
-
}
|
|
54
|
-
render(code) {
|
|
55
|
-
this._kernelConnectionPromise.then((kernelConnection) => {
|
|
56
|
-
this._outputArea.future = kernelConnection.requestExecute({ code });
|
|
57
|
-
});
|
|
58
|
-
this._outputArea.model.add({
|
|
59
|
-
output_type: 'stream',
|
|
60
|
-
name: 'loading',
|
|
61
|
-
text: this._msgLoading,
|
|
62
|
-
});
|
|
63
|
-
this._outputArea.model.clear(true);
|
|
64
|
-
}
|
|
65
|
-
get panel() {
|
|
66
|
-
return this._outputArea;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export default OutputAdapter;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type IOutput = number;
|
|
2
|
-
export interface IOutputtate {
|
|
3
|
-
outputs: IOutput;
|
|
4
|
-
}
|
|
5
|
-
export declare const outputInitialState: IOutputtate;
|
|
6
|
-
export declare const selectOutput: () => IOutputtate;
|
|
7
|
-
export declare enum ActionType {
|
|
8
|
-
OUTPUTS = "Output/OUTPUTS",
|
|
9
|
-
EXECUTE = "Output/EXECUTE"
|
|
10
|
-
}
|
|
11
|
-
export declare const OutputActions: {
|
|
12
|
-
outputs: import("typescript-fsa").ActionCreator<number>;
|
|
13
|
-
execute: import("typescript-fsa").ActionCreator<void>;
|
|
14
|
-
};
|
|
15
|
-
export declare const OutputReducer: import("typescript-fsa-reducers").ReducerBuilder<IOutputtate, IOutputtate>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useSelector } from "react-redux";
|
|
2
|
-
import actionCreatorFactory from "typescript-fsa";
|
|
3
|
-
import { reducerWithInitialState } from "typescript-fsa-reducers";
|
|
4
|
-
export const outputInitialState = {
|
|
5
|
-
outputs: 0
|
|
6
|
-
};
|
|
7
|
-
/* Selectors */
|
|
8
|
-
export const selectOutput = () => useSelector((state) => {
|
|
9
|
-
if (state.Output) {
|
|
10
|
-
return state.Output;
|
|
11
|
-
}
|
|
12
|
-
return { outputs: 0 };
|
|
13
|
-
});
|
|
14
|
-
/* Actions */
|
|
15
|
-
export var ActionType;
|
|
16
|
-
(function (ActionType) {
|
|
17
|
-
ActionType["OUTPUTS"] = "Output/OUTPUTS";
|
|
18
|
-
ActionType["EXECUTE"] = "Output/EXECUTE";
|
|
19
|
-
})(ActionType || (ActionType = {}));
|
|
20
|
-
const actionCreator = actionCreatorFactory('jupyterReact');
|
|
21
|
-
export const OutputActions = {
|
|
22
|
-
outputs: actionCreator(ActionType.OUTPUTS),
|
|
23
|
-
execute: actionCreator(ActionType.EXECUTE),
|
|
24
|
-
};
|
|
25
|
-
/* Reducers */
|
|
26
|
-
export const OutputReducer = reducerWithInitialState(outputInitialState)
|
|
27
|
-
.case(OutputActions.outputs, (state, success) => {
|
|
28
|
-
return Object.assign(Object.assign({}, state), { outputs: success });
|
|
29
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import SettingsAdapter from './SettingsAdapter';
|
|
3
|
-
import LuminoAttached from '../../jupyter/lumino/LuminoAttached';
|
|
4
|
-
const Settings = () => {
|
|
5
|
-
const settingsAdapter = new SettingsAdapter();
|
|
6
|
-
return _jsx(_Fragment, { children: _jsx(LuminoAttached, { children: settingsAdapter.panel }, void 0) }, void 0);
|
|
7
|
-
};
|
|
8
|
-
export default Settings;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DockPanel } from '@lumino/widgets';
|
|
2
|
-
import '@jupyterlab/theme-light-extension/style/theme.css';
|
|
3
|
-
import '@jupyterlab/theme-light-extension/style/variables.css';
|
|
4
|
-
import './SettingsAdapter.css';
|
|
5
|
-
declare class SettingsAdapter {
|
|
6
|
-
private settingsPanel;
|
|
7
|
-
constructor();
|
|
8
|
-
get panel(): DockPanel;
|
|
9
|
-
}
|
|
10
|
-
export default SettingsAdapter;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DockPanel } from '@lumino/widgets';
|
|
2
|
-
import '@jupyterlab/theme-light-extension/style/theme.css';
|
|
3
|
-
import '@jupyterlab/theme-light-extension/style/variables.css';
|
|
4
|
-
import './SettingsAdapter.css';
|
|
5
|
-
class SettingsAdapter {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.settingsPanel = new DockPanel();
|
|
8
|
-
this.settingsPanel.id = 'dla-jlab-settings';
|
|
9
|
-
this.settingsPanel.spacing = 0;
|
|
10
|
-
}
|
|
11
|
-
get panel() {
|
|
12
|
-
return this.settingsPanel;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export default SettingsAdapter;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type ISettings = number;
|
|
2
|
-
export interface ISettingsState {
|
|
3
|
-
outputs: ISettings;
|
|
4
|
-
}
|
|
5
|
-
export declare const settingsInitialState: ISettingsState;
|
|
6
|
-
export declare const selectSettings: () => ISettingsState;
|
|
7
|
-
export declare enum ActionType {
|
|
8
|
-
OUTPUTS = "settings/OUTPUTS",
|
|
9
|
-
EXECUTE = "settings/EXECUTE"
|
|
10
|
-
}
|
|
11
|
-
export declare const settingsActions: {
|
|
12
|
-
outputs: import("typescript-fsa").ActionCreator<number>;
|
|
13
|
-
execute: import("typescript-fsa").ActionCreator<void>;
|
|
14
|
-
};
|
|
15
|
-
export declare const settingsReducer: import("typescript-fsa-reducers").ReducerBuilder<ISettingsState, ISettingsState>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useSelector } from "react-redux";
|
|
2
|
-
import actionCreatorFactory from "typescript-fsa";
|
|
3
|
-
import { reducerWithInitialState } from "typescript-fsa-reducers";
|
|
4
|
-
export const settingsInitialState = {
|
|
5
|
-
outputs: 0,
|
|
6
|
-
};
|
|
7
|
-
/* Selectors */
|
|
8
|
-
export const selectSettings = () => useSelector((state) => {
|
|
9
|
-
if (state.settings) {
|
|
10
|
-
return state.settings;
|
|
11
|
-
}
|
|
12
|
-
return { outputs: 0 };
|
|
13
|
-
});
|
|
14
|
-
/* Actions */
|
|
15
|
-
export var ActionType;
|
|
16
|
-
(function (ActionType) {
|
|
17
|
-
ActionType["OUTPUTS"] = "settings/OUTPUTS";
|
|
18
|
-
ActionType["EXECUTE"] = "settings/EXECUTE";
|
|
19
|
-
})(ActionType || (ActionType = {}));
|
|
20
|
-
const actionCreator = actionCreatorFactory('jupyterReact');
|
|
21
|
-
export const settingsActions = {
|
|
22
|
-
outputs: actionCreator(ActionType.OUTPUTS),
|
|
23
|
-
execute: actionCreator(ActionType.EXECUTE),
|
|
24
|
-
};
|
|
25
|
-
/* Reducers */
|
|
26
|
-
export const settingsReducer = reducerWithInitialState(settingsInitialState)
|
|
27
|
-
.case(settingsActions.outputs, (state, success) => {
|
|
28
|
-
return Object.assign(Object.assign({}, state), { outputs: success });
|
|
29
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo } from 'react';
|
|
3
|
-
import { useDispatch } from "react-redux";
|
|
4
|
-
import TerminalAdapter from './TerminalAdapter';
|
|
5
|
-
import { terminalActions } from './TerminalState';
|
|
6
|
-
import LuminoAttached from '../../jupyter/lumino/LuminoAttached';
|
|
7
|
-
export const Terminal = () => {
|
|
8
|
-
const dispatch = useDispatch();
|
|
9
|
-
const adapter = useMemo(() => new TerminalAdapter(), []);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
dispatch(terminalActions.update({ adapter }));
|
|
12
|
-
}, []);
|
|
13
|
-
return _jsx(LuminoAttached, { children: adapter.panel }, void 0);
|
|
14
|
-
};
|
|
15
|
-
export default Terminal;
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
import './TerminalAdapter.css';
|
|
6
|
-
export declare class TerminalAdapter {
|
|
7
|
-
private terminalPanel;
|
|
8
|
-
private terminal;
|
|
9
|
-
constructor();
|
|
10
|
-
get panel(): BoxPanel;
|
|
11
|
-
setTheme(theme: string): void;
|
|
12
|
-
}
|
|
13
|
-
export default TerminalAdapter;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { BoxPanel } from '@lumino/widgets';
|
|
2
|
-
import { TerminalManager } from '@jupyterlab/services';
|
|
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
|
-
import './TerminalAdapter.css';
|
|
8
|
-
export class TerminalAdapter {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.terminalPanel = new BoxPanel();
|
|
11
|
-
this.terminalPanel.addClass('jupyterlab-terminal');
|
|
12
|
-
this.terminalPanel.spacing = 0;
|
|
13
|
-
const manager = new TerminalManager();
|
|
14
|
-
manager.startNew().then((s1) => {
|
|
15
|
-
this.terminal = new Terminal(s1, { theme: 'light' });
|
|
16
|
-
this.terminal.title.closable = true;
|
|
17
|
-
this.terminalPanel.addWidget(this.terminal);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
get panel() {
|
|
21
|
-
return this.terminalPanel;
|
|
22
|
-
}
|
|
23
|
-
setTheme(theme) {
|
|
24
|
-
this.terminal.setOption('theme', theme);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export default TerminalAdapter;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import TerminalAdapter from "./TerminalAdapter";
|
|
2
|
-
export declare type ITerminal = boolean;
|
|
3
|
-
export interface ITerminalState {
|
|
4
|
-
dark: ITerminal;
|
|
5
|
-
adapter?: TerminalAdapter;
|
|
6
|
-
}
|
|
7
|
-
export declare const terminalInitialState: ITerminalState;
|
|
8
|
-
export declare const selectTerminal: () => ITerminalState;
|
|
9
|
-
export declare enum ActionType {
|
|
10
|
-
UPDATE = "terminal/UPDATE"
|
|
11
|
-
}
|
|
12
|
-
export declare const terminalActions: {
|
|
13
|
-
update: import("typescript-fsa").ActionCreator<Partial<ITerminalState>>;
|
|
14
|
-
};
|
|
15
|
-
export declare const terminalReducer: import("typescript-fsa-reducers").ReducerBuilder<ITerminalState, ITerminalState>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useSelector } from "react-redux";
|
|
2
|
-
import actionCreatorFactory from "typescript-fsa";
|
|
3
|
-
import { reducerWithInitialState } from "typescript-fsa-reducers";
|
|
4
|
-
export const terminalInitialState = {
|
|
5
|
-
dark: false,
|
|
6
|
-
};
|
|
7
|
-
/* Selectors */
|
|
8
|
-
export const selectTerminal = () => useSelector((state) => {
|
|
9
|
-
if (state.terminal) {
|
|
10
|
-
return state.terminal;
|
|
11
|
-
}
|
|
12
|
-
return terminalInitialState;
|
|
13
|
-
});
|
|
14
|
-
/* Actions */
|
|
15
|
-
export var ActionType;
|
|
16
|
-
(function (ActionType) {
|
|
17
|
-
ActionType["UPDATE"] = "terminal/UPDATE";
|
|
18
|
-
})(ActionType || (ActionType = {}));
|
|
19
|
-
const actionCreator = actionCreatorFactory('jupyterReact');
|
|
20
|
-
export const terminalActions = {
|
|
21
|
-
update: actionCreator(ActionType.UPDATE),
|
|
22
|
-
};
|
|
23
|
-
/* Reducers */
|
|
24
|
-
export const terminalReducer = reducerWithInitialState(terminalInitialState)
|
|
25
|
-
.case(terminalActions.update, (state, update) => {
|
|
26
|
-
if (state.adapter) {
|
|
27
|
-
if (update.dark !== undefined) {
|
|
28
|
-
if (update.dark) {
|
|
29
|
-
state.adapter.setTheme('dark');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
state.adapter.setTheme('light');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return Object.assign(Object.assign({}, state), update);
|
|
37
|
-
});
|
package/lib/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { default as Jupyter } from './jupyter/Jupyter';
|
|
2
|
-
export * from './jupyter/JupyterContext';
|
|
3
|
-
export { default as Services } from './jupyter/services/Services';
|
|
4
|
-
export { default as Kernel } from './jupyter/services/kernel/Kernel';
|
|
5
|
-
export { default as IpyWidgetsComponent } from './components/ipywidgets/IpyWidgetsComponent';
|
|
6
|
-
export { default as Cell } from './components/cell/Cell';
|
|
7
|
-
export { selectCell, cellActions } from './components/cell/CellState';
|
|
8
|
-
export { default as Notebook } from './components/notebook/Notebook';
|
|
9
|
-
export { selectNotebook, notebookActions } from './components/notebook/NotebookState';
|
|
10
|
-
export { default as Commands } from './components/commands/Commands';
|
|
11
|
-
export { selectCommands, commandsActions } from './components/commands/CommandsState';
|
|
12
|
-
export { default as Console } from './components/console/Console';
|
|
13
|
-
export { selectConsole, consoleActions } from './components/console/ConsoleState';
|
|
14
|
-
export { default as Dialog } from './components/dialog/Dialog';
|
|
15
|
-
export { default as FileBrowser } from './components/filebrowser/FileBrowser';
|
|
16
|
-
export { default as FileBrowserTree } from './components/filebrowser/FileBrowserTree';
|
|
17
|
-
export { selectFileBrowser, fileBrowserActions } from './components/filebrowser/FileBrowserState';
|
|
18
|
-
export { default as Output } from './components/outputs/Output';
|
|
19
|
-
export { selectOutput } from './components/outputs/OutputState';
|
|
20
|
-
export { default as Settings } from './components/settings/Settings';
|
|
21
|
-
export { selectSettings, settingsActions } from './components/settings/SettingsState';
|
|
22
|
-
export { default as Terminal } from './components/terminal/Terminal';
|
|
23
|
-
export { selectTerminal, terminalActions } from './components/terminal/TerminalState';
|
package/lib/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Jupyter.
|
|
2
|
-
export { default as Jupyter } from './jupyter/Jupyter';
|
|
3
|
-
export * from './jupyter/JupyterContext';
|
|
4
|
-
// Services.
|
|
5
|
-
export { default as Services } from './jupyter/services/Services';
|
|
6
|
-
export { default as Kernel } from './jupyter/services/kernel/Kernel';
|
|
7
|
-
// IpyWidgets.
|
|
8
|
-
export { default as IpyWidgetsComponent } from './components/ipywidgets/IpyWidgetsComponent';
|
|
9
|
-
// Cell.
|
|
10
|
-
export { default as Cell } from './components/cell/Cell';
|
|
11
|
-
export { selectCell, cellActions } from './components/cell/CellState';
|
|
12
|
-
// Notebook.
|
|
13
|
-
export { default as Notebook } from './components/notebook/Notebook';
|
|
14
|
-
export { selectNotebook, notebookActions } from './components/notebook/NotebookState';
|
|
15
|
-
// Commands.
|
|
16
|
-
export { default as Commands } from './components/commands/Commands';
|
|
17
|
-
export { selectCommands, commandsActions } from './components/commands/CommandsState';
|
|
18
|
-
// Console.
|
|
19
|
-
export { default as Console } from './components/console/Console';
|
|
20
|
-
export { selectConsole, consoleActions } from './components/console/ConsoleState';
|
|
21
|
-
// Dialog.
|
|
22
|
-
export { default as Dialog } from './components/dialog/Dialog';
|
|
23
|
-
// FileBrowser.
|
|
24
|
-
export { default as FileBrowser } from './components/filebrowser/FileBrowser';
|
|
25
|
-
export { default as FileBrowserTree } from './components/filebrowser/FileBrowserTree';
|
|
26
|
-
export { selectFileBrowser, fileBrowserActions } from './components/filebrowser/FileBrowserState';
|
|
27
|
-
// Outputs.
|
|
28
|
-
export { default as Output } from './components/outputs/Output';
|
|
29
|
-
export { selectOutput } from './components/outputs/OutputState';
|
|
30
|
-
// Settings.
|
|
31
|
-
export { default as Settings } from './components/settings/Settings';
|
|
32
|
-
export { selectSettings, settingsActions } from './components/settings/SettingsState';
|
|
33
|
-
// Terminal.
|
|
34
|
-
export { default as Terminal } from './components/terminal/Terminal';
|
|
35
|
-
export { selectTerminal, terminalActions } from './components/terminal/TerminalState';
|
package/lib/jupyter/AuthError.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Call the API extension
|
|
3
|
-
*
|
|
4
|
-
* @param endPoint API REST end point for the extension
|
|
5
|
-
* @param init Initial values for the request
|
|
6
|
-
* @returns The response body interpreted as JSON
|
|
7
|
-
*/
|
|
8
|
-
export declare function requestAPI<T>(namespace?: string, endPoint?: string, init?: RequestInit): Promise<T>;
|