@datalayer/jupyter-react 0.0.1
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 +56 -0
- package/lib/examples/Example.d.ts +1 -0
- package/lib/examples/Example.js +8 -0
- package/lib/examples/Example.js.map +1 -0
- package/lib/examples/MuiSetup.d.ts +5 -0
- package/lib/examples/MuiSetup.js +13 -0
- package/lib/examples/MuiSetup.js.map +1 -0
- package/lib/examples/bootstrap/All.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/All.bootstrap.js +84 -0
- package/lib/examples/bootstrap/All.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/Cell.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/Cell.bootstrap.js +12 -0
- package/lib/examples/bootstrap/Cell.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/FileBrowser.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/FileBrowser.bootstrap.js +10 -0
- package/lib/examples/bootstrap/FileBrowser.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/Gallery.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/Gallery.bootstrap.js +18 -0
- package/lib/examples/bootstrap/Gallery.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/IPyWidgets.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/IPyWidgets.bootstrap.js +12 -0
- package/lib/examples/bootstrap/IPyWidgets.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/Lumino.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/Lumino.bootstrap.js +11 -0
- package/lib/examples/bootstrap/Lumino.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/Notebook.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/Notebook.bootstrap.js +22 -0
- package/lib/examples/bootstrap/Notebook.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/NotebookCustom.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/NotebookCustom.bootstrap.js +7 -0
- package/lib/examples/bootstrap/NotebookCustom.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/Outputs.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/Outputs.bootstrap.js +154 -0
- package/lib/examples/bootstrap/Outputs.bootstrap.js.map +1 -0
- package/lib/examples/bootstrap/Terminal.bootstrap.d.ts +1 -0
- package/lib/examples/bootstrap/Terminal.bootstrap.js +13 -0
- package/lib/examples/bootstrap/Terminal.bootstrap.js.map +1 -0
- package/lib/examples/controls/CellControl.d.ts +3 -0
- package/lib/examples/controls/CellControl.js +15 -0
- package/lib/examples/controls/CellControl.js.map +1 -0
- package/lib/examples/controls/CommandsControl.d.ts +3 -0
- package/lib/examples/controls/CommandsControl.js +12 -0
- package/lib/examples/controls/CommandsControl.js.map +1 -0
- package/lib/examples/controls/ConsoleControl.d.ts +3 -0
- package/lib/examples/controls/ConsoleControl.js +12 -0
- package/lib/examples/controls/ConsoleControl.js.map +1 -0
- package/lib/examples/controls/DialogControl.d.ts +2 -0
- package/lib/examples/controls/DialogControl.js +7 -0
- package/lib/examples/controls/DialogControl.js.map +1 -0
- package/lib/examples/controls/FileBrowserControl.d.ts +3 -0
- package/lib/examples/controls/FileBrowserControl.js +12 -0
- package/lib/examples/controls/FileBrowserControl.js.map +1 -0
- package/lib/examples/controls/InitControl.d.ts +2 -0
- package/lib/examples/controls/InitControl.js +7 -0
- package/lib/examples/controls/InitControl.js.map +1 -0
- package/lib/examples/controls/NotebookControl.d.ts +3 -0
- package/lib/examples/controls/NotebookControl.js +16 -0
- package/lib/examples/controls/NotebookControl.js.map +1 -0
- package/lib/examples/controls/OutputControl.d.ts +3 -0
- package/lib/examples/controls/OutputControl.js +7 -0
- package/lib/examples/controls/OutputControl.js.map +1 -0
- package/lib/examples/controls/SettingsControl.d.ts +3 -0
- package/lib/examples/controls/SettingsControl.js +12 -0
- package/lib/examples/controls/SettingsControl.js.map +1 -0
- package/lib/examples/controls/SimpleControl.d.ts +2 -0
- package/lib/examples/controls/SimpleControl.js +7 -0
- package/lib/examples/controls/SimpleControl.js.map +1 -0
- package/lib/examples/controls/TerminalControl.d.ts +3 -0
- package/lib/examples/controls/TerminalControl.js +22 -0
- package/lib/examples/controls/TerminalControl.js.map +1 -0
- package/lib/examples/examples/cell/CellExample.d.ts +2 -0
- package/lib/examples/examples/cell/CellExample.js +42 -0
- package/lib/examples/examples/cell/CellExample.js.map +1 -0
- package/lib/examples/examples/gallery/GalleryExample.d.ts +2 -0
- package/lib/examples/examples/gallery/GalleryExample.js +154 -0
- package/lib/examples/examples/gallery/GalleryExample.js.map +1 -0
- package/lib/examples/examples/ipywidgets/IpyWidgetsExample.d.ts +4 -0
- package/lib/examples/examples/ipywidgets/IpyWidgetsExample.js +156 -0
- package/lib/examples/examples/ipywidgets/IpyWidgetsExample.js.map +1 -0
- package/lib/examples/examples/lumino/LuminoAdapter.css +34 -0
- package/lib/examples/examples/lumino/LuminoAdapter.d.ts +9 -0
- package/lib/examples/examples/lumino/LuminoAdapter.js +70 -0
- package/lib/examples/examples/lumino/LuminoAdapter.js.map +1 -0
- package/lib/examples/examples/lumino/LuminoExample.d.ts +2 -0
- package/lib/examples/examples/lumino/LuminoExample.js +10 -0
- package/lib/examples/examples/lumino/LuminoExample.js.map +1 -0
- package/lib/examples/examples/notebook/NotebookCustomHeader.d.ts +2 -0
- package/lib/examples/examples/notebook/NotebookCustomHeader.js +39 -0
- package/lib/examples/examples/notebook/NotebookCustomHeader.js.map +1 -0
- package/lib/examples/examples/notebook/NotebookExample.d.ts +1 -0
- package/lib/examples/examples/notebook/NotebookExample.js +24 -0
- package/lib/examples/examples/notebook/NotebookExample.js.map +1 -0
- package/lib/examples/theme/Layers.d.ts +2 -0
- package/lib/examples/theme/Layers.js +15 -0
- package/lib/examples/theme/Layers.js.map +1 -0
- package/lib/examples/theme/Layers.svg +14 -0
- package/lib/examples/theme/muiLightTheme.d.ts +8 -0
- package/lib/examples/theme/muiLightTheme.js +169 -0
- package/lib/examples/theme/muiLightTheme.js.map +1 -0
- package/lib/examples/theme/vintage.project.json +172 -0
- package/lib/examples/theme/westeros.project.json +168 -0
- package/lib/examples/theme/wonderland.project.json +168 -0
- package/lib/index.d.ts +31 -0
- package/lib/index.js +45 -0
- package/lib/index.js.map +1 -0
- package/lib/ipywidgets/IPyWidgetsAttached.d.ts +8 -0
- package/lib/ipywidgets/IPyWidgetsAttached.js +15 -0
- package/lib/ipywidgets/IPyWidgetsAttached.js.map +1 -0
- package/lib/ipywidgets/IPyWidgetsClassicManager.d.ts +18 -0
- package/lib/ipywidgets/IPyWidgetsClassicManager.js +76 -0
- package/lib/ipywidgets/IPyWidgetsClassicManager.js.map +1 -0
- package/lib/ipywidgets/IPyWidgetsJupyterLabPlugin.d.ts +15 -0
- package/lib/ipywidgets/IPyWidgetsJupyterLabPlugin.js +178 -0
- package/lib/ipywidgets/IPyWidgetsJupyterLabPlugin.js.map +1 -0
- package/lib/ipywidgets/IpyWidgetsComponent.d.ts +4 -0
- package/lib/ipywidgets/IpyWidgetsComponent.js +9 -0
- package/lib/ipywidgets/IpyWidgetsComponent.js.map +1 -0
- package/lib/ipywidgets/IpyWidgetsManager.d.ts +11 -0
- package/lib/ipywidgets/IpyWidgetsManager.js +71 -0
- package/lib/ipywidgets/IpyWidgetsManager.js.map +1 -0
- package/lib/ipywidgets/plotly/Figure.d.ts +587 -0
- package/lib/ipywidgets/plotly/Figure.js +1697 -0
- package/lib/ipywidgets/plotly/Figure.js.map +1 -0
- package/lib/ipywidgets/plotly/index.d.ts +2 -0
- package/lib/ipywidgets/plotly/index.js +4 -0
- package/lib/ipywidgets/plotly/index.js.map +1 -0
- package/lib/ipywidgets/plotly/jupyterlab-plugin.d.ts +5 -0
- package/lib/ipywidgets/plotly/jupyterlab-plugin.js +12 -0
- package/lib/ipywidgets/plotly/jupyterlab-plugin.js.map +1 -0
- package/lib/ipywidgets/plotly/version.d.ts +8 -0
- package/lib/ipywidgets/plotly/version.js +16 -0
- package/lib/ipywidgets/plotly/version.js.map +1 -0
- package/lib/jupyter/AuthError.d.ts +7 -0
- package/lib/jupyter/AuthError.js +8 -0
- package/lib/jupyter/AuthError.js.map +1 -0
- package/lib/jupyter/Handlers.d.ts +8 -0
- package/lib/jupyter/Handlers.js +50 -0
- package/lib/jupyter/Handlers.js.map +1 -0
- package/lib/jupyter/Jupyter.d.ts +23 -0
- package/lib/jupyter/Jupyter.js +35 -0
- package/lib/jupyter/Jupyter.js.map +1 -0
- package/lib/jupyter/JupyterConfig.d.ts +37 -0
- package/lib/jupyter/JupyterConfig.js +59 -0
- package/lib/jupyter/JupyterConfig.js.map +1 -0
- package/lib/jupyter/JupyterContext.d.ts +35 -0
- package/lib/jupyter/JupyterContext.js +64 -0
- package/lib/jupyter/JupyterContext.js.map +1 -0
- package/lib/lumino/LuminoAttached.d.ts +9 -0
- package/lib/lumino/LuminoAttached.js +23 -0
- package/lib/lumino/LuminoAttached.js.map +1 -0
- package/lib/lumino/LuminoDetached.d.ts +9 -0
- package/lib/lumino/LuminoDetached.js +13 -0
- package/lib/lumino/LuminoDetached.js.map +1 -0
- package/lib/lumino/LuminoObservable.d.ts +6 -0
- package/lib/lumino/LuminoObservable.js +16 -0
- package/lib/lumino/LuminoObservable.js.map +1 -0
- package/lib/lumino/LuminoReactPortal.d.ts +180 -0
- package/lib/lumino/LuminoReactPortal.js +195 -0
- package/lib/lumino/LuminoReactPortal.js.map +1 -0
- package/lib/lumino/LuminoRedux.d.ts +8 -0
- package/lib/lumino/LuminoRedux.js +2 -0
- package/lib/lumino/LuminoRedux.js.map +1 -0
- package/lib/services/Services.d.ts +17 -0
- package/lib/services/Services.js +41 -0
- package/lib/services/Services.js.map +1 -0
- package/lib/services/kernel/Kernel.d.ts +18 -0
- package/lib/services/kernel/Kernel.js +95 -0
- package/lib/services/kernel/Kernel.js.map +1 -0
- package/lib/services/kernel/KernelModel.d.ts +18 -0
- package/lib/services/kernel/KernelModel.js +52 -0
- package/lib/services/kernel/KernelModel.js.map +1 -0
- package/lib/state/AllState.d.ts +8 -0
- package/lib/state/AllState.js +24 -0
- package/lib/state/AllState.js.map +1 -0
- package/lib/state/InjectableStore.d.ts +9 -0
- package/lib/state/InjectableStore.js +27 -0
- package/lib/state/InjectableStore.js.map +1 -0
- package/lib/state/init/Init.d.ts +3 -0
- package/lib/state/init/Init.js +12 -0
- package/lib/state/init/Init.js.map +1 -0
- package/lib/state/init/InitRedux.d.ts +21 -0
- package/lib/state/init/InitRedux.js +50 -0
- package/lib/state/init/InitRedux.js.map +1 -0
- package/lib/widgets/cell/CellAdapter.css +16 -0
- package/lib/widgets/cell/CellAdapter.d.ts +18 -0
- package/lib/widgets/cell/CellAdapter.js +160 -0
- package/lib/widgets/cell/CellAdapter.js.map +1 -0
- package/lib/widgets/cell/CellLumino.d.ts +9 -0
- package/lib/widgets/cell/CellLumino.js +48 -0
- package/lib/widgets/cell/CellLumino.js.map +1 -0
- package/lib/widgets/cell/CellState.d.ts +22 -0
- package/lib/widgets/cell/CellState.js +79 -0
- package/lib/widgets/cell/CellState.js.map +1 -0
- package/lib/widgets/commands/CommandsAdapter.css +3 -0
- package/lib/widgets/commands/CommandsAdapter.d.ts +9 -0
- package/lib/widgets/commands/CommandsAdapter.js +36 -0
- package/lib/widgets/commands/CommandsAdapter.js.map +1 -0
- package/lib/widgets/commands/CommandsLumino.d.ts +2 -0
- package/lib/widgets/commands/CommandsLumino.js +9 -0
- package/lib/widgets/commands/CommandsLumino.js.map +1 -0
- package/lib/widgets/commands/CommandsState.d.ts +19 -0
- package/lib/widgets/commands/CommandsState.js +50 -0
- package/lib/widgets/commands/CommandsState.js.map +1 -0
- package/lib/widgets/console/ConsoleAdapter.css +4 -0
- package/lib/widgets/console/ConsoleAdapter.d.ts +11 -0
- package/lib/widgets/console/ConsoleAdapter.js +82 -0
- package/lib/widgets/console/ConsoleAdapter.js.map +1 -0
- package/lib/widgets/console/ConsoleLumino.d.ts +2 -0
- package/lib/widgets/console/ConsoleLumino.js +9 -0
- package/lib/widgets/console/ConsoleLumino.js.map +1 -0
- package/lib/widgets/console/ConsoleState.d.ts +19 -0
- package/lib/widgets/console/ConsoleState.js +50 -0
- package/lib/widgets/console/ConsoleState.js.map +1 -0
- package/lib/widgets/dialog/DialogAdapter.css +0 -0
- package/lib/widgets/dialog/DialogAdapter.d.ts +10 -0
- package/lib/widgets/dialog/DialogAdapter.js +19 -0
- package/lib/widgets/dialog/DialogAdapter.js.map +1 -0
- package/lib/widgets/dialog/DialogLumino.d.ts +2 -0
- package/lib/widgets/dialog/DialogLumino.js +13 -0
- package/lib/widgets/dialog/DialogLumino.js.map +1 -0
- package/lib/widgets/editor/CodeMirrorEditor.d.ts +7 -0
- package/lib/widgets/editor/CodeMirrorEditor.js +62 -0
- package/lib/widgets/editor/CodeMirrorEditor.js.map +1 -0
- package/lib/widgets/filebrowser/FileBrowser.d.ts +2 -0
- package/lib/widgets/filebrowser/FileBrowser.js +60 -0
- package/lib/widgets/filebrowser/FileBrowser.js.map +1 -0
- package/lib/widgets/filebrowser/FileBrowserAdapter.css +8 -0
- package/lib/widgets/filebrowser/FileBrowserAdapter.d.ts +13 -0
- package/lib/widgets/filebrowser/FileBrowserAdapter.js +267 -0
- package/lib/widgets/filebrowser/FileBrowserAdapter.js.map +1 -0
- package/lib/widgets/filebrowser/FileBrowserLumino.d.ts +2 -0
- package/lib/widgets/filebrowser/FileBrowserLumino.js +9 -0
- package/lib/widgets/filebrowser/FileBrowserLumino.js.map +1 -0
- package/lib/widgets/filebrowser/FileBrowserState.d.ts +19 -0
- package/lib/widgets/filebrowser/FileBrowserState.js +50 -0
- package/lib/widgets/filebrowser/FileBrowserState.js.map +1 -0
- package/lib/widgets/notebook/NotebookAdapter.css +27 -0
- package/lib/widgets/notebook/NotebookAdapter.d.ts +26 -0
- package/lib/widgets/notebook/NotebookAdapter.js +187 -0
- package/lib/widgets/notebook/NotebookAdapter.js.map +1 -0
- package/lib/widgets/notebook/NotebookCommands.d.ts +7 -0
- package/lib/widgets/notebook/NotebookCommands.js +349 -0
- package/lib/widgets/notebook/NotebookCommands.js.map +1 -0
- package/lib/widgets/notebook/NotebookLumino.d.ts +19 -0
- package/lib/widgets/notebook/NotebookLumino.js +75 -0
- package/lib/widgets/notebook/NotebookLumino.js.map +1 -0
- package/lib/widgets/notebook/NotebookState.d.ts +43 -0
- package/lib/widgets/notebook/NotebookState.js +114 -0
- package/lib/widgets/notebook/NotebookState.js.map +1 -0
- package/lib/widgets/notebook/NotebookToolbar.d.ts +2 -0
- package/lib/widgets/notebook/NotebookToolbar.js +24 -0
- package/lib/widgets/notebook/NotebookToolbar.js.map +1 -0
- package/lib/widgets/notebook/extension/CellSidebar.d.ts +7 -0
- package/lib/widgets/notebook/extension/CellSidebar.js +23 -0
- package/lib/widgets/notebook/extension/CellSidebar.js.map +1 -0
- package/lib/widgets/notebook/extension/CellSidebarDefault.d.ts +2 -0
- package/lib/widgets/notebook/extension/CellSidebarDefault.js +47 -0
- package/lib/widgets/notebook/extension/CellSidebarDefault.js.map +1 -0
- package/lib/widgets/notebook/extension/ContentFactoryWithSidebar.d.ts +14 -0
- package/lib/widgets/notebook/extension/ContentFactoryWithSidebar.js +20 -0
- package/lib/widgets/notebook/extension/ContentFactoryWithSidebar.js.map +1 -0
- package/lib/widgets/notebook/extension/NotebookInputPrompt.d.ts +21 -0
- package/lib/widgets/notebook/extension/NotebookInputPrompt.js +67 -0
- package/lib/widgets/notebook/extension/NotebookInputPrompt.js.map +1 -0
- package/lib/widgets/outputs/OutputAdapter.css +0 -0
- package/lib/widgets/outputs/OutputAdapter.d.ts +21 -0
- package/lib/widgets/outputs/OutputAdapter.js +75 -0
- package/lib/widgets/outputs/OutputAdapter.js.map +1 -0
- package/lib/widgets/outputs/OutputLumino.d.ts +16 -0
- package/lib/widgets/outputs/OutputLumino.js +56 -0
- package/lib/widgets/outputs/OutputLumino.js.map +1 -0
- package/lib/widgets/outputs/OutputState.d.ts +19 -0
- package/lib/widgets/outputs/OutputState.js +50 -0
- package/lib/widgets/outputs/OutputState.js.map +1 -0
- package/lib/widgets/settings/SettingsAdapter.css +0 -0
- package/lib/widgets/settings/SettingsAdapter.d.ts +10 -0
- package/lib/widgets/settings/SettingsAdapter.js +16 -0
- package/lib/widgets/settings/SettingsAdapter.js.map +1 -0
- package/lib/widgets/settings/SettingsLumino.d.ts +2 -0
- package/lib/widgets/settings/SettingsLumino.js +11 -0
- package/lib/widgets/settings/SettingsLumino.js.map +1 -0
- package/lib/widgets/settings/SettingsState.d.ts +19 -0
- package/lib/widgets/settings/SettingsState.js +50 -0
- package/lib/widgets/settings/SettingsState.js.map +1 -0
- package/lib/widgets/terminal/TerminalAdapter.css +3 -0
- package/lib/widgets/terminal/TerminalAdapter.d.ts +13 -0
- package/lib/widgets/terminal/TerminalAdapter.js +28 -0
- package/lib/widgets/terminal/TerminalAdapter.js.map +1 -0
- package/lib/widgets/terminal/TerminalLumino.d.ts +2 -0
- package/lib/widgets/terminal/TerminalLumino.js +17 -0
- package/lib/widgets/terminal/TerminalLumino.js.map +1 -0
- package/lib/widgets/terminal/TerminalState.d.ts +17 -0
- package/lib/widgets/terminal/TerminalState.js +45 -0
- package/lib/widgets/terminal/TerminalState.js.map +1 -0
- package/package.json +163 -0
- package/style/index.css +3 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useDispatch } from "react-redux";
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import Grid from '@mui/material/Grid';
|
|
5
|
+
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
|
|
6
|
+
import PlayCircleOutlineIcon from '@mui/icons-material/PlayCircleOutline';
|
|
7
|
+
import StopOutlined from '@mui/icons-material/StopOutlined';
|
|
8
|
+
import QuestionAnswerOutlined from '@mui/icons-material/QuestionAnswerOutlined';
|
|
9
|
+
import { notebookActions, selectNotebook } from './NotebookState';
|
|
10
|
+
const NotebookToolbar = () => {
|
|
11
|
+
const dispatch = useDispatch();
|
|
12
|
+
const notebook = selectNotebook();
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsxs(Grid, Object.assign({ container: true, spacing: 3, style: { padding: '30px 110px 0px 30px' } }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 6 }, { children: _jsxs(Grid, Object.assign({ container: true, justifyItems: "flex-start" }, { children: [_jsx(Button, Object.assign({ variant: "text", color: "primary", startIcon: _jsx(AddCircleOutlineIcon, {}, void 0), onClick: () => dispatch(notebookActions.insertBelow.started()) }, { children: "Text" }), void 0),
|
|
14
|
+
_jsx(Button, Object.assign({ variant: "text", color: "primary", startIcon: _jsx(AddCircleOutlineIcon, {}, void 0), onClick: () => dispatch(notebookActions.insertBelow.started()) }, { children: "Markdown" }), void 0),
|
|
15
|
+
_jsx(Button, Object.assign({ variant: "text", color: "primary", startIcon: _jsx(AddCircleOutlineIcon, {}, void 0), onClick: () => dispatch(notebookActions.insertBelow.started()) }, { children: "Code" }), void 0)] }), void 0) }), void 0),
|
|
16
|
+
_jsx(Grid, Object.assign({ item: true, xs: 6 }, { children: _jsxs(Grid, Object.assign({ container: true, justifyContent: "flex-end" }, { children: [(notebook.kernelStatus === 'idle') &&
|
|
17
|
+
_jsx(Button, Object.assign({ variant: "outlined", color: "primary", startIcon: _jsx(PlayCircleOutlineIcon, {}, void 0), onClick: () => dispatch(notebookActions.runAll.started()) }, { children: "Run all" }), void 0),
|
|
18
|
+
(notebook.kernelStatus === 'busy') &&
|
|
19
|
+
_jsx(Button, Object.assign({ variant: "outlined", color: "secondary", startIcon: _jsx(StopOutlined, {}, void 0), onClick: () => dispatch(notebookActions.interrupt.started()) }, { children: "Stop" }), void 0),
|
|
20
|
+
((notebook.kernelStatus !== 'idle') && (notebook.kernelStatus !== 'busy')) &&
|
|
21
|
+
_jsx(Button, { variant: "outlined", color: "primary", startIcon: _jsx(QuestionAnswerOutlined, {}, void 0) }, void 0)] }), void 0) }), void 0)] }), void 0) }, void 0));
|
|
22
|
+
};
|
|
23
|
+
export default NotebookToolbar;
|
|
24
|
+
//# sourceMappingURL=NotebookToolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotebookToolbar.js","sourceRoot":"","sources":["../../../src/widgets/notebook/NotebookToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AACxE,OAAO,qBAAqB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,sBAAsB,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAClC,OAAO,CACL,4BACE,MAAC,IAAI,kBAAC,SAAS,QAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,iBACnE,KAAC,IAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,MAAC,IAAI,kBAAC,SAAS,QAAC,YAAY,EAAC,YAAY,iBACvC,KAAC,MAAM,kBACL,OAAO,EAAC,MAAM,EACd,KAAK,EAAC,SAAS,EACf,SAAS,EAAE,KAAC,oBAAoB,aAAG,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,kCAGvD;4BACT,KAAC,MAAM,kBACL,OAAO,EAAC,MAAM,EACd,KAAK,EAAC,SAAS,E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AC,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICellHeader } from '@jupyterlab/cells';
|
|
2
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
3
|
+
import { LuminoReactPortal } from '../../../lumino/LuminoReactPortal';
|
|
4
|
+
export declare class CellSidebar extends LuminoReactPortal implements ICellHeader {
|
|
5
|
+
private readonly commands;
|
|
6
|
+
constructor(sidebarReact: any, commands: CommandRegistry, injectableStore: any);
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { v4 as uuid_v4 } from 'uuid';
|
|
5
|
+
import { notebookActions } from '../NotebookState';
|
|
6
|
+
import { LuminoReactPortal } from '../../../lumino/LuminoReactPortal';
|
|
7
|
+
const CELL_HEADER_CLASS = 'jp-CellHeader';
|
|
8
|
+
const CELL_HEADER_DIV_CLASS = 'dla-cellHeaderContainer';
|
|
9
|
+
export class CellSidebar extends LuminoReactPortal {
|
|
10
|
+
constructor(sidebarReact, commands, injectableStore) {
|
|
11
|
+
super();
|
|
12
|
+
this.commands = commands;
|
|
13
|
+
this.addClass(CELL_HEADER_CLASS);
|
|
14
|
+
this.id = uuid_v4();
|
|
15
|
+
const sidebar = createElement(sidebarReact, {
|
|
16
|
+
command: this.commands,
|
|
17
|
+
id: this.id
|
|
18
|
+
});
|
|
19
|
+
const portal = createPortal(_jsx("div", Object.assign({ className: CELL_HEADER_DIV_CLASS }, { children: sidebar }), void 0), this.node);
|
|
20
|
+
injectableStore.dispatch(notebookActions.portal.started(portal));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CellSidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellSidebar.js","sourceRoot":"","sources":["../../../../src/widgets/notebook/extension/CellSidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,EAAE,IAAI,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC1C,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAExD,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAEhD,YAAY,YAAiB,EAAE,QAAyB,EAAE,eAAoB;QAC5E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,aAAa,CAC3B,YAAY,EACZ;YACE,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CACF,CAAC;QACF,MAAM,MAAM,GAAG,YAAY,CACzB,4BAAK,SAAS,EAAE,qBAAqB,gBAClC,OAAO,YACJ,EAEN,IAAI,CAAC,IAAI,CACV,CAAC;QACF,eAAe,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAU,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useDispatch } from 'react-redux';
|
|
4
|
+
import PlayArrow from '@mui/icons-material/PlayArrowOutlined';
|
|
5
|
+
import Delete from '@mui/icons-material/DeleteOutline';
|
|
6
|
+
import Typography from '@mui/material/Typography';
|
|
7
|
+
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
|
|
8
|
+
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
|
9
|
+
import { selectNotebook, notebookActions } from '../NotebookState';
|
|
10
|
+
const CELL_HEADER_DIV_CLASS = 'dla-cellHeaderContainer';
|
|
11
|
+
const CellSidebarDefault = (props) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const [visible, setVisible] = useState(false);
|
|
14
|
+
const dispatch = useDispatch();
|
|
15
|
+
const paperBook = selectNotebook();
|
|
16
|
+
const layout = ((_a = paperBook.activeCell) === null || _a === void 0 ? void 0 : _a.layout);
|
|
17
|
+
if (layout) {
|
|
18
|
+
const selectedCellSidebar = ((_b = paperBook.activeCell) === null || _b === void 0 ? void 0 : _b.layout).widgets[0];
|
|
19
|
+
if (!visible && (selectedCellSidebar.id === props.id)) {
|
|
20
|
+
setVisible(true);
|
|
21
|
+
}
|
|
22
|
+
if (visible && (selectedCellSidebar.id !== props.id)) {
|
|
23
|
+
setVisible(false);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (!visible) {
|
|
27
|
+
return _jsx("div", {}, void 0);
|
|
28
|
+
}
|
|
29
|
+
return (_jsxs("div", Object.assign({ className: CELL_HEADER_DIV_CLASS }, { children: [_jsx("div", Object.assign({ onClick: event => {
|
|
30
|
+
dispatch(notebookActions.run.started());
|
|
31
|
+
} }, { children: _jsxs("span", Object.assign({ style: { display: "flex" } }, { children: [_jsx(PlayArrow, { fontSize: "small" }, void 0),
|
|
32
|
+
_jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: "Render" }), void 0)] }), void 0) }), void 0),
|
|
33
|
+
_jsx("div", Object.assign({ onClick: event => {
|
|
34
|
+
dispatch(notebookActions.insertAbove.started());
|
|
35
|
+
} }, { children: _jsxs("span", Object.assign({ style: { display: "flex" } }, { children: [_jsx(ArrowUpwardIcon, { fontSize: "small" }, void 0),
|
|
36
|
+
_jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: "Add above" }), void 0)] }), void 0) }), void 0),
|
|
37
|
+
_jsx("div", Object.assign({ onClick: event => {
|
|
38
|
+
dispatch(notebookActions.insertBelow.started());
|
|
39
|
+
} }, { children: _jsxs("span", Object.assign({ style: { display: "flex" } }, { children: [_jsx(ArrowDownwardIcon, { fontSize: "small" }, void 0),
|
|
40
|
+
_jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: "Add below" }), void 0)] }), void 0) }), void 0),
|
|
41
|
+
_jsx("div", Object.assign({ onClick: event => {
|
|
42
|
+
dispatch(notebookActions.delete.started(undefined));
|
|
43
|
+
} }, { children: _jsxs("span", Object.assign({ style: { display: "flex" } }, { children: [_jsx(Delete, { fontSize: "small" }, void 0),
|
|
44
|
+
_jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: "Delete" }), void 0)] }), void 0) }), void 0)] }), void 0));
|
|
45
|
+
};
|
|
46
|
+
export default CellSidebarDefault;
|
|
47
|
+
//# sourceMappingURL=CellSidebarDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellSidebarDefault.js","sourceRoot":"","sources":["../../../../src/widgets/notebook/extension/CellSidebarDefault.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,MAAM,MAAM,mCAAmC,CAAC;AACvD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAEx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gBAClD,CAAC,gBAED,8BAAM,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,iBAC9B,KAAC,eAAe,IAAC,QAAQ,EAAC,OAAO,WAAG;wBACpC,KAAC,UAAU,kBAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,uCAAuB,aACnE,YACH;YACN,4BACE,OAAO,EAAE,KAAK,CAAC,EAAE;oBACf,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClD,CAAC,gBAED,8BAAM,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,iBAC9B,KAAC,iBAAiB,IAAC,QAAQ,EAAC,OAAO,WAAG;wBACtC,KAAC,UAAU,kBAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,uCAAuB,aACnE,YACH;YACN,4BACE,OAAO,EAAE,KAAK,CAAC,EAAE;oBACf,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;gBACtD,CAAC,gBAED,8BAAM,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,iBAC9B,KAAC,MAAM,IAAC,QAAQ,EAAC,OAAO,WAAG;wBAC3B,KAAC,UAAU,kBAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,oCAAoB,aAChE,YACH,aACF,CACP,CAAC;AACJ,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
2
|
+
import { ICellHeader, Cell } from '@jupyterlab/cells';
|
|
3
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
4
|
+
/**
|
|
5
|
+
* Extend the default implementation NotebookPanel.ContentFactory of `IContentFactory`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ContentFactoryWithSidebar extends NotebookPanel.ContentFactory {
|
|
8
|
+
private readonly sidebarReact;
|
|
9
|
+
private readonly commands;
|
|
10
|
+
private readonly injectableStore;
|
|
11
|
+
constructor(sidebarReact: any, commands: CommandRegistry, injectableStore: any, options?: Cell.ContentFactory.IOptions | undefined);
|
|
12
|
+
createCellHeader(): ICellHeader;
|
|
13
|
+
}
|
|
14
|
+
export default ContentFactoryWithSidebar;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
2
|
+
import { CellSidebar } from './CellSidebar';
|
|
3
|
+
// import { IInputPrompt } from '@jupyterlab/cells';
|
|
4
|
+
// import { NotebookInputPrompt } from './NotebookInputPrompt';
|
|
5
|
+
/**
|
|
6
|
+
* Extend the default implementation NotebookPanel.ContentFactory of `IContentFactory`.
|
|
7
|
+
*/
|
|
8
|
+
export class ContentFactoryWithSidebar extends NotebookPanel.ContentFactory {
|
|
9
|
+
constructor(sidebarReact, commands, injectableStore, options) {
|
|
10
|
+
super(options);
|
|
11
|
+
this.sidebarReact = sidebarReact;
|
|
12
|
+
this.commands = commands;
|
|
13
|
+
this.injectableStore = injectableStore;
|
|
14
|
+
}
|
|
15
|
+
createCellHeader() {
|
|
16
|
+
return new CellSidebar(this.sidebarReact, this.commands, this.injectableStore);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export default ContentFactoryWithSidebar;
|
|
20
|
+
//# sourceMappingURL=ContentFactoryWithSidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentFactoryWithSidebar.js","sourceRoot":"","sources":["../../../../src/widgets/notebook/extension/ContentFactoryWithSidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,oDAAoD;AACpD,+DAA+D;AAE/D;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAAa,CAAC,cAAc;IAIzE,YACE,YAAiB,EACjB,QAAyB,EACzB,eAAoB,EACpB,OAAkD;QAElD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IACD,gBAAgB;QACd,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACjF,CAAC;CAIF;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactWidget } from '@jupyterlab/apputils';
|
|
2
|
+
import { IInputPrompt } from '@jupyterlab/cells';
|
|
3
|
+
export default function Countdown(props: {
|
|
4
|
+
count: number;
|
|
5
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* The custom input prompt implementation.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NotebookInputPrompt extends ReactWidget implements IInputPrompt {
|
|
10
|
+
state: {
|
|
11
|
+
count: number;
|
|
12
|
+
};
|
|
13
|
+
constructor();
|
|
14
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* The execution count for the prompt.
|
|
17
|
+
*/
|
|
18
|
+
get executionCount(): string | null;
|
|
19
|
+
set executionCount(value: string | null);
|
|
20
|
+
private _executionCount;
|
|
21
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
}
|
|
67
|
+
//# sourceMappingURL=NotebookInputPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotebookInputPrompt.js","sourceRoot":"","sources":["../../../../src/widgets/notebook/extension/NotebookInputPrompt.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD;;GAEG;AACH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAsB;IACtD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,WAAW,GAAG,MAAM,EAAU,CAAC;IACnC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACvD,SAAS,CAAE,GAAG,EAAE;QACZ,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjB,SAAS,CAAC,GAAG,EAAE;QACb,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,WAAW,EAAE,IAAI,CAAQ,CAAC;QAC5D,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC,EAAE,EAAE,CAAC,CAAC;IACL,OAAO,CACP,wBACE,wBAAM,KAAK,WAAO,WACd,CACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAIlD;;MAEE;IACF;QACE,KAAK,EAAE,CAAC;QAPV,UAAK,GAAG;YACN,KAAK,EAAE,GAAG;SACX,CAAA;QAuCO,oBAAe,GAAkB,IAAI,CAAC;QAjC5C,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACpC,CAAC;IAED,MAAM;QACJ,OAAO,KAAC,SAAS,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,WAAI,CAAA;IAC/C,CAAC;IACD;;OAEG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IACD,IAAI,cAAc,CAAC,KAAoB;QACrC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC,KAAK,GAAG;gBACX,KAAK,EAAE,CAAC;aACT,CAAC;SACH;aAAM;YACL,IAAI,KAAK,KAAK,GAAG,EAAE;gBACjB,IAAI,CAAC,KAAK,GAAG;oBACX,KAAK,EAAE,CAAC;iBACT,CAAC;aACH;iBACI;gBACH,IAAI,CAAC,KAAK,GAAG;oBACX,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;iBACrB,CAAC;gBACF,IAAI,CAAC,MAAM,EAAE,CAAC;aACf;SACF;IACH,CAAC;CAGF"}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OutputArea, OutputAreaModel } from '@jupyterlab/outputarea';
|
|
2
|
+
import { Kernel } from '@jupyterlab/services';
|
|
3
|
+
import '@lumino/default-theme/style/index.css';
|
|
4
|
+
import './OutputAdapter.css';
|
|
5
|
+
declare class OutputAdapter {
|
|
6
|
+
private _kernelConnectionPromise;
|
|
7
|
+
private _renderers;
|
|
8
|
+
private _outputArea;
|
|
9
|
+
private _eventName;
|
|
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
|
+
private event;
|
|
19
|
+
get panel(): OutputArea;
|
|
20
|
+
}
|
|
21
|
+
export default OutputAdapter;
|
|
@@ -0,0 +1,75 @@
|
|
|
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 "../../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/IPyWidgetsPlugin";
|
|
8
|
+
// import { activatePlotlyWidgetExtension } from "../../ipywidgets/plotly/jupyterlab-plugin";
|
|
9
|
+
import '@lumino/default-theme/style/index.css';
|
|
10
|
+
import './OutputAdapter.css';
|
|
11
|
+
class OutputAdapter {
|
|
12
|
+
constructor(kernel, model, options = {}) {
|
|
13
|
+
this._kernelConnectionPromise = kernel;
|
|
14
|
+
this._eventName = options.eventName || 'dla-jupyter-output';
|
|
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
|
+
this.event('executing', code);
|
|
46
|
+
if (this._kernelConnectionPromise) {
|
|
47
|
+
this._outputArea.model.clear();
|
|
48
|
+
this.render(code);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
clearOutput() {
|
|
53
|
+
this._outputArea.model.clear();
|
|
54
|
+
}
|
|
55
|
+
render(code) {
|
|
56
|
+
this._kernelConnectionPromise.then((kernelConnection) => {
|
|
57
|
+
this._outputArea.future = kernelConnection.requestExecute({ code });
|
|
58
|
+
});
|
|
59
|
+
this._outputArea.model.add({
|
|
60
|
+
output_type: 'stream',
|
|
61
|
+
name: 'loading',
|
|
62
|
+
text: this._msgLoading,
|
|
63
|
+
});
|
|
64
|
+
this._outputArea.model.clear(true);
|
|
65
|
+
}
|
|
66
|
+
event(status, data) {
|
|
67
|
+
const ev = new CustomEvent(this._eventName, { detail: { status, data } });
|
|
68
|
+
document.dispatchEvent(ev);
|
|
69
|
+
}
|
|
70
|
+
get panel() {
|
|
71
|
+
return this._outputArea;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export default OutputAdapter;
|
|
75
|
+
//# sourceMappingURL=OutputAdapter.js.map
|
|
@@ -0,0 +1 @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,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,IAAI,CAAC,WAAW;SACvB,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEO,KAAK,CAAC,MAAc,EAAE,IAAS;QACrC,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,EAAC,MAAM,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,EAAC,CAAC,CAAC;QACtE,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CAEF;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as nbformat from '@jupyterlab/nbformat';
|
|
2
|
+
import Kernel from '../../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 OutputLumino: {
|
|
13
|
+
(props: IOutputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
defaultProps: Partial<IOutputProps>;
|
|
15
|
+
};
|
|
16
|
+
export default OutputLumino;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 '../../lumino/LuminoAttached';
|
|
7
|
+
const OutputLumino = (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 outputAdapter = useMemo(() => {
|
|
14
|
+
return new OutputAdapter(kernel.getJupyterKernel(), model, {});
|
|
15
|
+
}, []);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!showEditor && autoRun) {
|
|
18
|
+
outputAdapter.execute(code);
|
|
19
|
+
}
|
|
20
|
+
}, [executeTrigger]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (showEditor) {
|
|
23
|
+
outputAdapter.execute(code);
|
|
24
|
+
}
|
|
25
|
+
}, [executeTrigger]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (showEditor) {
|
|
28
|
+
outputAdapter.clearOutput();
|
|
29
|
+
}
|
|
30
|
+
}, [clearTrigger]);
|
|
31
|
+
return _jsxs("div", { children: [_jsx("div", { children: showEditor &&
|
|
32
|
+
_jsx(CodeMirrorEditor, { autoRun: autoRun, code: code, outputAdapter: outputAdapter }, void 0) }, void 0),
|
|
33
|
+
_jsx("div", Object.assign({ css: {
|
|
34
|
+
'& .jp-OutputPrompt': {
|
|
35
|
+
display: 'none',
|
|
36
|
+
},
|
|
37
|
+
} }, { children: _jsx(LuminoAttached, { children: outputAdapter.panel }, void 0) }), void 0)] }, void 0);
|
|
38
|
+
};
|
|
39
|
+
OutputLumino.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 OutputLumino;
|
|
56
|
+
//# sourceMappingURL=OutputLumino.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputLumino.js","sourceRoot":"","sources":["../../../src/widgets/outputs/OutputLumino.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAYzD,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC3C,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACjG,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,eAAe,CAAC;QAC3C,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,aAAa;KACtB,CAAC,CAAC,CAAC;IACJ,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QAAG,OAAO,IAAI,aAAa,CAC5D,MAAM,CAAC,gBAAgB,EAAE,EACzB,KAAK,EACL,EAAE,CACH,CAAA;IAAA,CAAC,EAAE,EAAE,CAAC,CAAC;IACR,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,UAAU,IAAI,OAAO,EAAE;YAC1B,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC7B;IACH,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IACrB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,EAAE;YAChB,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC3B;IACH,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IACrB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,EAAE;YACd,aAAa,CAAC,WAAW,EAAE,CAAC;SAC7B;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACnB,OAAO,0BACL,wBACI,UAAU;oBACV,KAAC,gBAAgB,IACf,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,WAC5B,WAEA;YACN,4BACE,GAAG,EAAE;oBACH,oBAAoB,EAAE;wBACpB,OAAO,EAAE,MAAM;qBAChB;iBACF,gBAED,KAAC,cAAc,cAAE,aAAa,CAAC,KAAK,WAAkB,YAClD,YACF,CAAA;AACR,CAAC,CAAA;AAED,YAAY,CAAC,YAAY,GAAG;IAC1B,aAAa,EAAE;QACb;YACE,aAAa,EAAE,gBAAgB;YAC/B,MAAM,EAAE;gBACN,WAAW,EAAE;oBACX,2EAA2E;iBAC5E;aACF;YACD,iBAAiB,EAAE,CAAC;YACpB,UAAU,EAAE,EAAE;SACf;KACF;IACD,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;CACS,CAAC;AAE3B,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Epic } from "redux-observable";
|
|
2
|
+
import { AnyAction } from "typescript-fsa";
|
|
3
|
+
import OutputAdapter from './OutputAdapter';
|
|
4
|
+
export declare type IOutput = number;
|
|
5
|
+
export interface IOutputtate {
|
|
6
|
+
outputs: IOutput;
|
|
7
|
+
}
|
|
8
|
+
export declare const outputInitialState: IOutputtate;
|
|
9
|
+
export declare const selectOutput: () => IOutputtate;
|
|
10
|
+
export declare enum ActionType {
|
|
11
|
+
OUTPUTS = "Output/OUTPUTS",
|
|
12
|
+
EXECUTE = "Output/EXECUTE"
|
|
13
|
+
}
|
|
14
|
+
export declare const OutputActions: {
|
|
15
|
+
outputs: import("typescript-fsa").AsyncActionCreators<number, number, {}>;
|
|
16
|
+
execute: import("typescript-fsa").AsyncActionCreators<void, void, {}>;
|
|
17
|
+
};
|
|
18
|
+
export declare const OutputEpics: (OutputAdapter: OutputAdapter) => Epic<AnyAction, AnyAction, IOutputtate, any>;
|
|
19
|
+
export declare const OutputReducer: import("typescript-fsa-reducers").ReducerBuilder<IOutputtate, IOutputtate>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useSelector } from "react-redux";
|
|
2
|
+
import actionCreatorFactory from "typescript-fsa";
|
|
3
|
+
import { combineEpics } from "redux-observable";
|
|
4
|
+
import { map, ignoreElements } from "rxjs/operators";
|
|
5
|
+
import { ofAction } from "@datalayer/typescript-fsa-redux-observable";
|
|
6
|
+
import { reducerWithInitialState } from "typescript-fsa-reducers";
|
|
7
|
+
export const outputInitialState = {
|
|
8
|
+
outputs: 0
|
|
9
|
+
};
|
|
10
|
+
/* Selectors */
|
|
11
|
+
export const selectOutput = () => useSelector((state) => {
|
|
12
|
+
if (state.Output) {
|
|
13
|
+
return state.Output;
|
|
14
|
+
}
|
|
15
|
+
return { outputs: 0 };
|
|
16
|
+
});
|
|
17
|
+
/* Actions */
|
|
18
|
+
export var ActionType;
|
|
19
|
+
(function (ActionType) {
|
|
20
|
+
ActionType["OUTPUTS"] = "Output/OUTPUTS";
|
|
21
|
+
ActionType["EXECUTE"] = "Output/EXECUTE";
|
|
22
|
+
})(ActionType || (ActionType = {}));
|
|
23
|
+
const actionCreator = actionCreatorFactory('jupyterReact');
|
|
24
|
+
export const OutputActions = {
|
|
25
|
+
outputs: actionCreator.async(ActionType.OUTPUTS),
|
|
26
|
+
execute: actionCreator.async(ActionType.EXECUTE),
|
|
27
|
+
};
|
|
28
|
+
/* Epics */
|
|
29
|
+
export const OutputEpics = (OutputAdapter) => {
|
|
30
|
+
const outputsEpic = action$ => action$.pipe(ofAction(OutputActions.outputs.started), map(action => {
|
|
31
|
+
return OutputActions.outputs.done({
|
|
32
|
+
params: action.payload,
|
|
33
|
+
result: action.payload
|
|
34
|
+
});
|
|
35
|
+
}));
|
|
36
|
+
const executeEpic = action$ => action$.pipe(ofAction(OutputActions.execute.started),
|
|
37
|
+
// tap(action => OutputAdapter.execute()),
|
|
38
|
+
ignoreElements());
|
|
39
|
+
const loggingEpic = action$ => action$
|
|
40
|
+
.pipe(ofAction(OutputActions.outputs.started),
|
|
41
|
+
// tap(action => Output.log(action.type)),
|
|
42
|
+
ignoreElements());
|
|
43
|
+
return combineEpics(loggingEpic, outputsEpic, executeEpic);
|
|
44
|
+
};
|
|
45
|
+
/* Reducers */
|
|
46
|
+
export const OutputReducer = reducerWithInitialState(outputInitialState)
|
|
47
|
+
.case(OutputActions.outputs.done, (state, success) => {
|
|
48
|
+
return Object.assign(Object.assign({}, state), { outputs: success.result });
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=OutputState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputState.js","sourceRoot":"","sources":["../../../src/widgets/outputs/OutputState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,oBAAoB,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAUlE,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,OAAO,EAAE,CAAC;CACX,CAAA;AAED,eAAe;AAEf,MAAM,CAAC,MAAM,YAAY,GAAG,GAAgB,EAAE,CA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AAC,OAAO,CAAC,OAAO,CAAC;IAC7C,+CAA+C;IACzC,cAAc,EAAE,CACjB,CAAC;IAEN,OAAO,YAAY,CACjB,WAAW,EACX,WAAW,EACX,WAAW,CACZ,CAAC;AACJ,CAAC,CAAA;AAED,cAAc;AAEd,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC,kBAAkB,CAAC;KACrE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAkB,EAAE,OAAgC,EAAE,EAAE;IACzF,uCACK,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,MAAM,IACxB;AACH,CAAC,CACF,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
16
|
+
//# sourceMappingURL=SettingsAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsAdapter.js","sourceRoot":"","sources":["../../../src/widgets/settings/SettingsAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,mDAAmD,CAAC;AAC3D,OAAO,uDAAuD,CAAC;AAE/D,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import Typography from '@mui/material/Typography';
|
|
3
|
+
import SettingsAdapter from './SettingsAdapter';
|
|
4
|
+
import LuminoAttached from '../../lumino/LuminoAttached';
|
|
5
|
+
const SettingsLumino = () => {
|
|
6
|
+
const settingsLumino = new SettingsAdapter();
|
|
7
|
+
return _jsxs(_Fragment, { children: [_jsx(Typography, { variant: "h5", gutterBottom: true }, void 0),
|
|
8
|
+
_jsx(LuminoAttached, { children: settingsLumino.panel }, void 0)] }, void 0);
|
|
9
|
+
};
|
|
10
|
+
export default SettingsLumino;
|
|
11
|
+
//# sourceMappingURL=SettingsLumino.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsLumino.js","sourceRoot":"","sources":["../../../src/widgets/settings/SettingsLumino.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAEzD,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,cAAc,GAAG,IAAI,eAAe,EAAE,CAAC;IAC7C,OAAO,8BACL,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,YAAY,iBACxB;YACb,KAAC,cAAc,cAAE,cAAc,CAAC,KAAK,WAAkB,YACtD,CAAA;AACL,CAAC,CAAA;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Epic } from "redux-observable";
|
|
2
|
+
import { AnyAction } from "typescript-fsa";
|
|
3
|
+
import SettingsAdapter from './SettingsAdapter';
|
|
4
|
+
export declare type ISettings = number;
|
|
5
|
+
export interface ISettingsState {
|
|
6
|
+
outputs: ISettings;
|
|
7
|
+
}
|
|
8
|
+
export declare const settingsInitialState: ISettingsState;
|
|
9
|
+
export declare const selectSettings: () => ISettingsState;
|
|
10
|
+
export declare enum ActionType {
|
|
11
|
+
OUTPUTS = "settings/OUTPUTS",
|
|
12
|
+
EXECUTE = "settings/EXECUTE"
|
|
13
|
+
}
|
|
14
|
+
export declare const settingsActions: {
|
|
15
|
+
outputs: import("typescript-fsa").AsyncActionCreators<number, number, {}>;
|
|
16
|
+
execute: import("typescript-fsa").AsyncActionCreators<void, void, {}>;
|
|
17
|
+
};
|
|
18
|
+
export declare const settingsEpics: (settingsLumino: SettingsAdapter) => Epic<AnyAction, AnyAction, ISettingsState, any>;
|
|
19
|
+
export declare const settingsReducer: import("typescript-fsa-reducers").ReducerBuilder<ISettingsState, ISettingsState>;
|