@datalayer/jupyter-react 1.1.8 → 1.2.0
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/README.md +74 -1
- package/lib/app/tabs/components/CellComponent.js +4 -2
- package/lib/app/tabs/components/CellComponent.js.map +1 -1
- package/lib/app/tabs/components/NotebookComponent.js +2 -2
- package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
- package/lib/app/tabs/components/ViewerComponent.js +1 -1
- package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
- package/lib/components/cell/Cell.d.ts +5 -8
- package/lib/components/cell/Cell.js +6 -22
- package/lib/components/cell/Cell.js.map +1 -1
- package/lib/components/cell/CellAdapter.d.ts +1 -3
- package/lib/components/cell/CellAdapter.js +5 -17
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorOutputToolbar.d.ts +2 -2
- package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -1
- package/lib/components/console/ConsoleAdapter.d.ts +1 -1
- package/lib/components/console/ConsoleAdapter.js +1 -1
- package/lib/components/console/ConsoleAdapter.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabApp.d.ts +16 -19
- package/lib/components/jupyterlab/JupyterLabApp.js +27 -21
- package/lib/components/jupyterlab/JupyterLabApp.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabAppAdapter.d.ts +4 -4
- package/lib/components/jupyterlab/JupyterLabAppAdapter.js +1 -1
- package/lib/components/jupyterlab/JupyterLabAppAdapter.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabAppCss.d.ts +1 -4
- package/lib/components/jupyterlab/JupyterLabAppCss.js +1 -5
- package/lib/components/jupyterlab/JupyterLabAppCss.js.map +1 -1
- package/lib/components/kernel/KernelActionMenu.d.ts +2 -2
- package/lib/components/kernel/KernelActionMenu.js.map +1 -1
- package/lib/components/kernel/KernelDetective.d.ts +1 -1
- package/lib/components/kernel/{Kernelndicator.d.ts → KernelIndicator.d.ts} +2 -1
- package/lib/components/kernel/{Kernelndicator.js → KernelIndicator.js} +13 -5
- package/lib/components/kernel/KernelIndicator.js.map +1 -0
- package/lib/components/kernel/KernelInspector.d.ts +2 -2
- package/lib/components/kernel/KernelInspector.js.map +1 -1
- package/lib/components/kernel/KernelSelector.d.ts +2 -2
- package/lib/components/kernel/KernelSelector.js.map +1 -1
- package/lib/components/kernel/KernelUsage.d.ts +2 -2
- package/lib/components/kernel/KernelUsage.js.map +1 -1
- package/lib/components/kernel/KernelVariables.d.ts +2 -2
- package/lib/components/kernel/KernelVariables.js.map +1 -1
- package/lib/components/kernel/index.d.ts +1 -1
- package/lib/components/kernel/index.js +1 -1
- package/lib/components/kernel/index.js.map +1 -1
- package/lib/components/kernel/variables/kernelconnector.d.ts +2 -2
- package/lib/components/kernel/variables/kernelconnector.js +2 -2
- package/lib/components/kernel/variables/widget.d.ts +4 -2
- package/lib/components/kernel/variables/widget.js.map +1 -1
- package/lib/components/lumino/Lumino.d.ts +1 -1
- package/lib/components/lumino/LuminoBox.d.ts +3 -9
- package/lib/components/lumino/LuminoBox.js +1 -6
- package/lib/components/lumino/LuminoBox.js.map +1 -1
- package/lib/components/lumino/ReactPortalWidget.d.ts +1 -2
- package/lib/components/notebook/Notebook.d.ts +4 -6
- package/lib/components/notebook/Notebook.js +11 -26
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/Notebook2.d.ts +6 -2
- package/lib/components/notebook/Notebook2.js +3 -2
- package/lib/components/notebook/Notebook2.js.map +1 -1
- package/lib/components/notebook/Notebook2Adapter.d.ts +189 -0
- package/lib/components/notebook/Notebook2Adapter.js +554 -10
- package/lib/components/notebook/Notebook2Adapter.js.map +1 -1
- package/lib/components/notebook/Notebook2Base.d.ts +15 -9
- package/lib/components/notebook/Notebook2Base.js +89 -50
- package/lib/components/notebook/Notebook2Base.js.map +1 -1
- package/lib/components/notebook/Notebook2State.d.ts +35 -8
- package/lib/components/notebook/Notebook2State.js +74 -45
- package/lib/components/notebook/Notebook2State.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +1 -0
- package/lib/components/notebook/NotebookAdapter.js +13 -8
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookCommands.d.ts +25 -2
- package/lib/components/notebook/NotebookCommands.js +89 -10
- package/lib/components/notebook/NotebookCommands.js.map +1 -1
- package/lib/components/notebook/NotebookState.d.ts +11 -11
- package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarExtension.d.ts +2 -4
- package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js +1 -3
- package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js.map +1 -1
- package/lib/components/notebook/index.d.ts +1 -0
- package/lib/components/notebook/index.js +1 -0
- package/lib/components/notebook/index.js.map +1 -1
- package/lib/components/notebook/model/JupyterReactNotebookModelFactory.d.ts +28 -1
- package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js +15 -1
- package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js.map +1 -1
- package/lib/components/output/Output.d.ts +11 -13
- package/lib/components/output/Output.js +19 -30
- package/lib/components/output/Output.js.map +1 -1
- package/lib/components/output/OutputIPyWidgets.d.ts +2 -2
- package/lib/components/output/OutputIPyWidgets.js.map +1 -1
- package/lib/components/output/OutputRenderer.d.ts +2 -2
- package/lib/components/output/OutputRenderer.js.map +1 -1
- package/lib/components/terminal/Terminal.d.ts +1 -4
- package/lib/components/terminal/Terminal.js +5 -8
- package/lib/components/terminal/Terminal.js.map +1 -1
- package/lib/components/viewer/Viewer.d.ts +1 -1
- package/lib/components/viewer/output/OutputViewer.d.ts +3 -6
- package/lib/components/viewer/output/OutputViewer.js +1 -5
- package/lib/components/viewer/output/OutputViewer.js.map +1 -1
- package/lib/examples/Bokeh.js +2 -2
- package/lib/examples/Bokeh.js.map +1 -1
- package/lib/examples/Bqplot.js +2 -2
- package/lib/examples/Bqplot.js.map +1 -1
- package/lib/examples/Cell.js +4 -4
- package/lib/examples/Cell.js.map +1 -1
- package/lib/examples/CellLite.js +16 -4
- package/lib/examples/CellLite.js.map +1 -1
- package/lib/examples/Cells.js +9 -6
- package/lib/examples/Cells.js.map +1 -1
- package/lib/examples/CellsExecute.js +13 -9
- package/lib/examples/CellsExecute.js.map +1 -1
- package/lib/examples/Console.js +2 -2
- package/lib/examples/Console.js.map +1 -1
- package/lib/examples/ConsoleLite.js +3 -3
- package/lib/examples/ConsoleLite.js.map +1 -1
- package/lib/examples/Dashboard.js +2 -2
- package/lib/examples/Dashboard.js.map +1 -1
- package/lib/examples/Deno.js +2 -2
- package/lib/examples/Deno.js.map +1 -1
- package/lib/examples/Examples.d.ts +23 -0
- package/lib/examples/Examples.js +342 -0
- package/lib/examples/Examples.js.map +1 -0
- package/lib/examples/FileBrowser.js +2 -2
- package/lib/examples/FileBrowser.js.map +1 -1
- package/lib/examples/GeoJson.js +2 -2
- package/lib/examples/GeoJson.js.map +1 -1
- package/lib/examples/IPyLeaflet.js +3 -3
- package/lib/examples/IPyLeaflet.js.map +1 -1
- package/lib/examples/IPyReact.js +3 -3
- package/lib/examples/IPyReact.js.map +1 -1
- package/lib/examples/IPyWidgets.js +3 -3
- package/lib/examples/IPyWidgets.js.map +1 -1
- package/lib/examples/IPyWidgetsState.js +3 -3
- package/lib/examples/IPyWidgetsState.js.map +1 -1
- package/lib/examples/JupyterContext.js +2 -2
- package/lib/examples/JupyterContext.js.map +1 -1
- package/lib/examples/JupyterLabAppHeadless.js +2 -2
- package/lib/examples/JupyterLabAppHeadless.js.map +1 -1
- package/lib/examples/JupyterLabAppHeadlessServerless.js +2 -2
- package/lib/examples/JupyterLabAppHeadlessServerless.js.map +1 -1
- package/lib/examples/JupyterLabAppServerless.js +2 -2
- package/lib/examples/JupyterLabAppServerless.js.map +1 -1
- package/lib/examples/JupyterLabAppServiceManager.js +2 -2
- package/lib/examples/JupyterLabAppServiceManager.js.map +1 -1
- package/lib/examples/JupyterLabTheme.js +2 -2
- package/lib/examples/JupyterLabTheme.js.map +1 -1
- package/lib/examples/KernelExecute.d.ts +1 -1
- package/lib/examples/KernelExecute.js +9 -11
- package/lib/examples/KernelExecute.js.map +1 -1
- package/lib/examples/KernelExecuteLite.d.ts +1 -0
- package/lib/examples/KernelExecuteLite.js +51 -0
- package/lib/examples/KernelExecuteLite.js.map +1 -0
- package/lib/examples/KernelExecutor.js +10 -9
- package/lib/examples/KernelExecutor.js.map +1 -1
- package/lib/examples/KernelExecutorLite.js +63 -0
- package/lib/examples/KernelExecutorLite.js.map +1 -0
- package/lib/examples/Kernels.js +6 -5
- package/lib/examples/Kernels.js.map +1 -1
- package/lib/examples/Lumino.js +2 -2
- package/lib/examples/Lumino.js.map +1 -1
- package/lib/examples/Matplotlib.js +10 -6
- package/lib/examples/Matplotlib.js.map +1 -1
- package/lib/examples/Notebook.js +3 -2
- package/lib/examples/Notebook.js.map +1 -1
- package/lib/examples/Notebook2.js +9 -6
- package/lib/examples/Notebook2.js.map +1 -1
- package/lib/examples/Notebook2Actions.js +8 -6
- package/lib/examples/Notebook2Actions.js.map +1 -1
- package/lib/examples/Notebook2Collaborative.js +2 -2
- package/lib/examples/Notebook2Collaborative.js.map +1 -1
- package/lib/examples/Notebook2Lite.js +19 -14
- package/lib/examples/Notebook2Lite.js.map +1 -1
- package/lib/examples/NotebookCellSidebar.js +3 -3
- package/lib/examples/NotebookCellSidebar.js.map +1 -1
- package/lib/examples/NotebookCellToolbar.js +4 -4
- package/lib/examples/NotebookCellToolbar.js.map +1 -1
- package/lib/examples/NotebookCollaborative.js +2 -2
- package/lib/examples/NotebookCollaborative.js.map +1 -1
- package/lib/examples/NotebookColormode.js +15 -10
- package/lib/examples/NotebookColormode.js.map +1 -1
- package/lib/examples/NotebookExtension.js +4 -4
- package/lib/examples/NotebookExtension.js.map +1 -1
- package/lib/examples/NotebookExternalContent.js +18 -13
- package/lib/examples/NotebookExternalContent.js.map +1 -1
- package/lib/examples/NotebookInit.js +10 -9
- package/lib/examples/NotebookInit.js.map +1 -1
- package/lib/examples/NotebookKernel.js +4 -4
- package/lib/examples/NotebookKernel.js.map +1 -1
- package/lib/examples/NotebookKernelChange.js +2 -2
- package/lib/examples/NotebookKernelChange.js.map +1 -1
- package/lib/examples/NotebookLess.js +4 -4
- package/lib/examples/NotebookLess.js.map +1 -1
- package/lib/examples/NotebookLite.js +10 -6
- package/lib/examples/NotebookLite.js.map +1 -1
- package/lib/examples/NotebookLiteContext.js +10 -5
- package/lib/examples/NotebookLiteContext.js.map +1 -1
- package/lib/examples/NotebookLocalServer.js +3 -3
- package/lib/examples/NotebookLocalServer.js.map +1 -1
- package/lib/examples/NotebookNbformat.js +7 -5
- package/lib/examples/NotebookNbformat.js.map +1 -1
- package/lib/examples/NotebookNbformatChange.js +12 -6
- package/lib/examples/NotebookNbformatChange.js.map +1 -1
- package/lib/examples/NotebookNoContext.js +4 -3
- package/lib/examples/NotebookNoContext.js.map +1 -1
- package/lib/examples/NotebookNoPrimer.js +3 -2
- package/lib/examples/NotebookNoPrimer.js.map +1 -1
- package/lib/examples/NotebookOnSessionConnection.js +5 -5
- package/lib/examples/NotebookOnSessionConnection.js.map +1 -1
- package/lib/examples/NotebookPath.js +2 -2
- package/lib/examples/NotebookPath.js.map +1 -1
- package/lib/examples/NotebookPathChange.js +5 -4
- package/lib/examples/NotebookPathChange.js.map +1 -1
- package/lib/examples/NotebookReadonly.js +4 -4
- package/lib/examples/NotebookReadonly.js.map +1 -1
- package/lib/examples/NotebookServiceManager.js +4 -4
- package/lib/examples/NotebookServiceManager.js.map +1 -1
- package/lib/examples/NotebookSkeleton.js +3 -2
- package/lib/examples/NotebookSkeleton.js.map +1 -1
- package/lib/examples/NotebookTOC.d.ts +1 -0
- package/lib/examples/{NotebookToc.js → NotebookTOC.js} +12 -6
- package/lib/examples/NotebookTOC.js.map +1 -0
- package/lib/examples/NotebookTheme.js +10 -5
- package/lib/examples/NotebookTheme.js.map +1 -1
- package/lib/examples/NotebookThemeColormode.js +4 -4
- package/lib/examples/NotebookThemeColormode.js.map +1 -1
- package/lib/examples/NotebookURL.js +3 -2
- package/lib/examples/NotebookURL.js.map +1 -1
- package/lib/examples/NotebookUnmount.js +13 -7
- package/lib/examples/NotebookUnmount.js.map +1 -1
- package/lib/examples/ObservableHQ.js +2 -2
- package/lib/examples/ObservableHQ.js.map +1 -1
- package/lib/examples/OutputIPyWidgets.js +3 -3
- package/lib/examples/OutputIPyWidgets.js.map +1 -1
- package/lib/examples/OutputWithMonitoring.js +3 -2
- package/lib/examples/OutputWithMonitoring.js.map +1 -1
- package/lib/examples/Outputs.js +8 -8
- package/lib/examples/Outputs.js.map +1 -1
- package/lib/examples/OutputsIpynb.js +4 -4
- package/lib/examples/OutputsIpynb.js.map +1 -1
- package/lib/examples/Panel.js +2 -2
- package/lib/examples/Panel.js.map +1 -1
- package/lib/examples/Plotly.js +2 -2
- package/lib/examples/Plotly.js.map +1 -1
- package/lib/examples/PyGWalker.js +4 -4
- package/lib/examples/PyGWalker.js.map +1 -1
- package/lib/examples/Terminal.js +4 -3
- package/lib/examples/Terminal.js.map +1 -1
- package/lib/examples/Vega.js +2 -2
- package/lib/examples/Vega.js.map +1 -1
- package/lib/examples/Viewer.js +5 -4
- package/lib/examples/Viewer.js.map +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbarComponent.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/jupyter/Jupyter.d.ts +1 -74
- package/lib/jupyter/Jupyter.js +2 -9
- package/lib/jupyter/Jupyter.js.map +1 -1
- package/lib/jupyter/JupyterConfig.js +7 -5
- package/lib/jupyter/JupyterConfig.js.map +1 -1
- package/lib/jupyter/JupyterContext.d.ts +2 -2
- package/lib/jupyter/collaboration/ICollaborationProvider.js.map +1 -1
- package/lib/jupyter/ipywidgets/classic/htmlmanager.d.ts +6 -0
- package/lib/jupyter/ipywidgets/classic/htmlmanager.js +8 -0
- package/lib/jupyter/ipywidgets/classic/htmlmanager.js.map +1 -1
- package/lib/jupyter/ipywidgets/lab/manager.d.ts +6 -0
- package/lib/jupyter/ipywidgets/lab/manager.js +8 -0
- package/lib/jupyter/ipywidgets/lab/manager.js.map +1 -1
- package/lib/jupyter/ipywidgets/libembed-amd.d.ts +1 -1
- package/lib/jupyter/ipywidgets/libembed-amd.js +1 -1
- package/lib/jupyter/kernel/Kernel.js +21 -15
- package/lib/jupyter/kernel/Kernel.js.map +1 -1
- package/lib/jupyter/kernel/KernelState.d.ts +1 -1
- package/lib/jupyter/lite/Lite.d.ts +1 -1
- package/lib/jupyter/lite/LiteServer.d.ts +2 -2
- package/lib/jupyter/lite/LiteServer.js +21 -6
- package/lib/jupyter/lite/LiteServer.js.map +1 -1
- package/lib/jupyter/lite/contents/broadcast.d.ts +27 -0
- package/lib/jupyter/lite/contents/broadcast.js +60 -0
- package/lib/jupyter/lite/contents/broadcast.js.map +1 -0
- package/lib/jupyter/lite/contents/contents.d.ts +228 -0
- package/lib/jupyter/lite/contents/contents.js +774 -0
- package/lib/jupyter/lite/contents/contents.js.map +1 -0
- package/lib/jupyter/lite/contents/drivecontents.d.ts +92 -0
- package/lib/jupyter/lite/contents/drivecontents.js +133 -0
- package/lib/jupyter/lite/contents/drivecontents.js.map +1 -0
- package/lib/jupyter/lite/contents/drivefs.d.ts +193 -0
- package/lib/jupyter/lite/contents/drivefs.js +432 -0
- package/lib/jupyter/lite/contents/drivefs.js.map +1 -0
- package/lib/jupyter/lite/contents/emscripten.d.ts +89 -0
- package/lib/jupyter/lite/contents/emscripten.js +11 -0
- package/lib/jupyter/lite/contents/emscripten.js.map +1 -0
- package/lib/jupyter/lite/contents/index.d.ts +6 -0
- package/lib/jupyter/lite/contents/index.js +9 -0
- package/lib/jupyter/lite/contents/index.js.map +1 -0
- package/lib/jupyter/lite/contents/tokens.d.ts +136 -0
- package/lib/jupyter/lite/contents/tokens.js +66 -0
- package/lib/jupyter/lite/contents/tokens.js.map +1 -0
- package/lib/jupyter/lite/kernel/index.d.ts +4 -0
- package/lib/jupyter/lite/kernel/index.js +7 -0
- package/lib/jupyter/lite/kernel/index.js.map +1 -0
- package/lib/jupyter/lite/kernel/kernel.d.ts +245 -0
- package/lib/jupyter/lite/kernel/kernel.js +453 -0
- package/lib/jupyter/lite/kernel/kernel.js.map +1 -0
- package/lib/jupyter/lite/kernel/kernels.d.ts +85 -0
- package/lib/jupyter/lite/kernel/kernels.js +218 -0
- package/lib/jupyter/lite/kernel/kernels.js.map +1 -0
- package/lib/jupyter/lite/kernel/kernelspecs.d.ts +53 -0
- package/lib/jupyter/lite/kernel/kernelspecs.js +50 -0
- package/lib/jupyter/lite/kernel/kernelspecs.js.map +1 -0
- package/lib/jupyter/lite/kernel/tokens.d.ts +171 -0
- package/lib/jupyter/lite/kernel/tokens.js +16 -0
- package/lib/jupyter/lite/kernel/tokens.js.map +1 -0
- package/lib/jupyter/lite/licenses/index.d.ts +2 -0
- package/lib/jupyter/lite/licenses/index.js +5 -0
- package/lib/jupyter/lite/licenses/index.js.map +1 -0
- package/lib/jupyter/lite/licenses/licenses.d.ts +35 -0
- package/lib/jupyter/lite/licenses/licenses.js +95 -0
- package/lib/jupyter/lite/licenses/licenses.js.map +1 -0
- package/lib/jupyter/lite/licenses/tokens.d.ts +74 -0
- package/lib/jupyter/lite/licenses/tokens.js +13 -0
- package/lib/jupyter/lite/licenses/tokens.js.map +1 -0
- package/lib/jupyter/lite/localforage/index.d.ts +2 -0
- package/lib/jupyter/lite/localforage/index.js +5 -0
- package/lib/jupyter/lite/localforage/index.js.map +1 -0
- package/lib/jupyter/lite/localforage/memory.d.ts +5 -0
- package/lib/jupyter/lite/localforage/memory.js +10 -0
- package/lib/jupyter/lite/localforage/memory.js.map +1 -0
- package/lib/jupyter/lite/localforage/tokens.d.ts +12 -0
- package/lib/jupyter/lite/localforage/tokens.js +8 -0
- package/lib/jupyter/lite/localforage/tokens.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/_pypi.d.ts +18 -0
- package/lib/jupyter/lite/pyodide-kernel/_pypi.js +45 -0
- package/lib/jupyter/lite/pyodide-kernel/_pypi.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.d.ts +15 -0
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js +63 -0
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.d.ts +9 -0
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js +50 -0
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/index.d.ts +6 -0
- package/lib/jupyter/lite/pyodide-kernel/index.js +9 -0
- package/lib/jupyter/lite/pyodide-kernel/index.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/kernel.d.ts +157 -0
- package/lib/jupyter/lite/pyodide-kernel/kernel.js +294 -0
- package/lib/jupyter/lite/pyodide-kernel/kernel.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/pypi/all-local.json +128 -0
- package/lib/jupyter/lite/pyodide-kernel/pypi/all.json +128 -0
- package/lib/jupyter/lite/pyodide-kernel/schema/piplite.v0.schema.json +113 -0
- package/lib/jupyter/lite/pyodide-kernel/tokens.d.ts +82 -0
- package/lib/jupyter/lite/pyodide-kernel/tokens.js +8 -0
- package/lib/jupyter/lite/pyodide-kernel/tokens.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/worker.d.ts +138 -0
- package/lib/jupyter/lite/pyodide-kernel/worker.js +426 -0
- package/lib/jupyter/lite/pyodide-kernel/worker.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel-extension/index.d.ts +4 -0
- package/lib/jupyter/lite/pyodide-kernel-extension/index.js +88 -0
- package/lib/jupyter/lite/pyodide-kernel-extension/index.js.map +1 -0
- package/lib/jupyter/lite/server/app.d.ts +87 -0
- package/lib/jupyter/lite/server/app.js +157 -0
- package/lib/jupyter/lite/server/app.js.map +1 -0
- package/lib/jupyter/lite/server/index.d.ts +4 -0
- package/lib/jupyter/lite/server/index.js +7 -0
- package/lib/jupyter/lite/server/index.js.map +1 -0
- package/lib/jupyter/lite/server/router.d.ts +99 -0
- package/lib/jupyter/lite/server/router.js +109 -0
- package/lib/jupyter/lite/server/router.js.map +1 -0
- package/lib/jupyter/lite/server/service-manager.d.ts +21 -0
- package/lib/jupyter/lite/server/service-manager.js +102 -0
- package/lib/jupyter/lite/server/service-manager.js.map +1 -0
- package/lib/jupyter/lite/server/service-worker.d.ts +58 -0
- package/lib/jupyter/lite/server/service-worker.js +145 -0
- package/lib/jupyter/lite/server/service-worker.js.map +1 -0
- package/lib/jupyter/lite/server/status.d.ts +18 -0
- package/lib/jupyter/lite/server/status.js +21 -0
- package/lib/jupyter/lite/server/status.js.map +1 -0
- package/lib/jupyter/lite/server/tokens.d.ts +38 -0
- package/lib/jupyter/lite/server/tokens.js +8 -0
- package/lib/jupyter/lite/server/tokens.js.map +1 -0
- package/lib/jupyter/lite/server-extension/index.d.ts +3 -0
- package/lib/jupyter/lite/server-extension/index.js +500 -0
- package/lib/jupyter/lite/server-extension/index.js.map +1 -0
- package/lib/jupyter/lite/session/index.d.ts +2 -0
- package/lib/jupyter/lite/session/index.js +5 -0
- package/lib/jupyter/lite/session/index.js.map +1 -0
- package/lib/jupyter/lite/session/sessions.d.ts +68 -0
- package/lib/jupyter/lite/session/sessions.js +185 -0
- package/lib/jupyter/lite/session/sessions.js.map +1 -0
- package/lib/jupyter/lite/session/tokens.d.ts +40 -0
- package/lib/jupyter/lite/session/tokens.js +6 -0
- package/lib/jupyter/lite/session/tokens.js.map +1 -0
- package/lib/jupyter/lite/settings/index.d.ts +2 -0
- package/lib/jupyter/lite/settings/index.js +5 -0
- package/lib/jupyter/lite/settings/index.js.map +1 -0
- package/lib/jupyter/lite/settings/settings.d.ts +75 -0
- package/lib/jupyter/lite/settings/settings.js +155 -0
- package/lib/jupyter/lite/settings/settings.js.map +1 -0
- package/lib/jupyter/lite/settings/tokens.d.ts +65 -0
- package/lib/jupyter/lite/settings/tokens.js +6 -0
- package/lib/jupyter/lite/settings/tokens.js.map +1 -0
- package/lib/jupyter/lite/translation/index.d.ts +2 -0
- package/lib/jupyter/lite/translation/index.js +5 -0
- package/lib/jupyter/lite/translation/index.js.map +1 -0
- package/lib/jupyter/lite/translation/tokens.d.ts +17 -0
- package/lib/jupyter/lite/translation/tokens.js +6 -0
- package/lib/jupyter/lite/translation/tokens.js.map +1 -0
- package/lib/jupyter/lite/translation/translation.d.ts +13 -0
- package/lib/jupyter/lite/translation/translation.js +52 -0
- package/lib/jupyter/lite/translation/translation.js.map +1 -0
- package/lib/jupyter/lite/types/index.d.ts +1 -0
- package/lib/jupyter/lite/types/index.js +4 -0
- package/lib/jupyter/lite/types/index.js.map +1 -0
- package/lib/jupyter/lite/types/tokens.d.ts +27 -0
- package/lib/jupyter/lite/types/tokens.js +4 -0
- package/lib/jupyter/lite/types/tokens.js.map +1 -0
- package/lib/jupyter/services/ServiceManagerLite.js +15 -6
- package/lib/jupyter/services/ServiceManagerLite.js.map +1 -1
- package/lib/state/JupyterReactState.js +7 -8
- package/lib/state/JupyterReactState.js.map +1 -1
- package/lib/theme/JupyterLabCss.d.ts +1 -1
- package/lib/theme/JupyterLabCss.js +4 -2
- package/lib/theme/JupyterLabCss.js.map +1 -1
- package/lib/theme/JupyterReactTheme.d.ts +1 -1
- package/lib/tools/__tests__/operationRunner.test.d.ts +1 -0
- package/lib/tools/__tests__/operationRunner.test.js +193 -0
- package/lib/tools/__tests__/operationRunner.test.js.map +1 -0
- package/lib/tools/core/executor.d.ts +46 -0
- package/lib/tools/core/executor.js +55 -0
- package/lib/tools/core/executor.js.map +1 -0
- package/lib/tools/core/formatter.d.ts +20 -0
- package/lib/tools/core/formatter.js +41 -0
- package/lib/tools/core/formatter.js.map +1 -0
- package/lib/tools/core/index.d.ts +18 -0
- package/lib/tools/core/index.js +24 -0
- package/lib/tools/core/index.js.map +1 -0
- package/lib/tools/core/interfaces.d.ts +38 -0
- package/lib/tools/core/interfaces.js +7 -0
- package/lib/tools/core/interfaces.js.map +1 -0
- package/lib/tools/core/operationRunner.d.ts +27 -0
- package/lib/tools/core/operationRunner.js +33 -0
- package/lib/tools/core/operationRunner.js.map +1 -0
- package/lib/tools/core/schema.d.ts +47 -0
- package/lib/tools/core/schema.js +7 -0
- package/lib/tools/core/schema.js.map +1 -0
- package/lib/tools/core/types.d.ts +36 -0
- package/lib/tools/core/types.js +7 -0
- package/lib/tools/core/types.js.map +1 -0
- package/lib/tools/core/zodUtils.d.ts +56 -0
- package/lib/tools/core/zodUtils.js +179 -0
- package/lib/tools/core/zodUtils.js.map +1 -0
- package/lib/tools/definitions/deleteCell.d.ts +7 -0
- package/lib/tools/definitions/deleteCell.js +25 -0
- package/lib/tools/definitions/deleteCell.js.map +1 -0
- package/lib/tools/definitions/executeCode.d.ts +7 -0
- package/lib/tools/definitions/executeCode.js +33 -0
- package/lib/tools/definitions/executeCode.js.map +1 -0
- package/lib/tools/definitions/index.d.ts +12 -0
- package/lib/tools/definitions/index.js +18 -0
- package/lib/tools/definitions/index.js.map +1 -0
- package/lib/tools/definitions/insertCell.d.ts +7 -0
- package/lib/tools/definitions/insertCell.js +24 -0
- package/lib/tools/definitions/insertCell.js.map +1 -0
- package/lib/tools/definitions/readAllCells.d.ts +7 -0
- package/lib/tools/definitions/readAllCells.js +24 -0
- package/lib/tools/definitions/readAllCells.js.map +1 -0
- package/lib/tools/definitions/readCell.d.ts +7 -0
- package/lib/tools/definitions/readCell.js +24 -0
- package/lib/tools/definitions/readCell.js.map +1 -0
- package/lib/tools/definitions/runCell.d.ts +7 -0
- package/lib/tools/definitions/runCell.js +31 -0
- package/lib/tools/definitions/runCell.js.map +1 -0
- package/lib/tools/definitions/updateCell.d.ts +7 -0
- package/lib/tools/definitions/updateCell.js +24 -0
- package/lib/tools/definitions/updateCell.js.map +1 -0
- package/lib/tools/index.d.ts +20 -0
- package/lib/tools/index.js +62 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/tools/operations/deleteCell.d.ts +49 -0
- package/lib/tools/operations/deleteCell.js +103 -0
- package/lib/tools/operations/deleteCell.js.map +1 -0
- package/lib/tools/operations/executeCode.d.ts +33 -0
- package/lib/tools/operations/executeCode.js +45 -0
- package/lib/tools/operations/executeCode.js.map +1 -0
- package/lib/tools/operations/insertCell.d.ts +27 -0
- package/lib/tools/operations/insertCell.js +56 -0
- package/lib/tools/operations/insertCell.js.map +1 -0
- package/lib/tools/operations/readAllCells.d.ts +21 -0
- package/lib/tools/operations/readAllCells.js +45 -0
- package/lib/tools/operations/readAllCells.js.map +1 -0
- package/lib/tools/operations/readCell.d.ts +39 -0
- package/lib/tools/operations/readCell.js +90 -0
- package/lib/tools/operations/readCell.js.map +1 -0
- package/lib/tools/operations/runCell.d.ts +24 -0
- package/lib/tools/operations/runCell.js +124 -0
- package/lib/tools/operations/runCell.js.map +1 -0
- package/lib/tools/operations/updateCell.d.ts +27 -0
- package/lib/tools/operations/updateCell.js +53 -0
- package/lib/tools/operations/updateCell.js.map +1 -0
- package/lib/tools/schemas/deleteCell.d.ts +20 -0
- package/lib/tools/schemas/deleteCell.js +24 -0
- package/lib/tools/schemas/deleteCell.js.map +1 -0
- package/lib/tools/schemas/executeCode.d.ts +19 -0
- package/lib/tools/schemas/executeCode.js +28 -0
- package/lib/tools/schemas/executeCode.js.map +1 -0
- package/lib/tools/schemas/index.d.ts +12 -0
- package/lib/tools/schemas/index.js +18 -0
- package/lib/tools/schemas/index.js.map +1 -0
- package/lib/tools/schemas/insertCell.d.ts +24 -0
- package/lib/tools/schemas/insertCell.js +29 -0
- package/lib/tools/schemas/insertCell.js.map +1 -0
- package/lib/tools/schemas/readAllCells.d.ts +19 -0
- package/lib/tools/schemas/readAllCells.js +18 -0
- package/lib/tools/schemas/readAllCells.js.map +1 -0
- package/lib/tools/schemas/readCell.d.ts +19 -0
- package/lib/tools/schemas/readCell.js +24 -0
- package/lib/tools/schemas/readCell.js.map +1 -0
- package/lib/tools/schemas/runCell.d.ts +21 -0
- package/lib/tools/schemas/runCell.js +39 -0
- package/lib/tools/schemas/runCell.js.map +1 -0
- package/lib/tools/schemas/updateCell.d.ts +19 -0
- package/lib/tools/schemas/updateCell.js +21 -0
- package/lib/tools/schemas/updateCell.js.map +1 -0
- package/package.json +40 -28
- package/schema/kernel.v0.schema.json +42 -0
- package/style/icons/pyodide.svg +17 -0
- package/lib/components/kernel/Kernelndicator.js.map +0 -1
- package/lib/examples/NotebookToc.js.map +0 -1
- /package/lib/examples/{NotebookToc.d.ts → KernelExecutorLite.d.ts} +0 -0
package/lib/examples/Cell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cell.js","sourceRoot":"","sources":["../../src/examples/Cell.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Cell.js","sourceRoot":"","sources":["../../src/examples/Cell.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC,MAAM,cAAc,GAAG;;;iGAG0E,CAAC;AAElG,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,CACL,MAAC,iBAAiB,eAChB,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,qBAAW,EACvB,MAAC,GAAG,IAAC,EAAE,EAAC,KAAK,yBAAU,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,IAAO,EAC3D,MAAC,GAAG,kCAAiB,UAAU,CAAC,eAAe,CAAC,OAAO,CAAC,IAAO,EAC/D,MAAC,GAAG,gCACY,GAAG,EACjB,KAAC,KAAK,cACH,aAAa,IAAI,YAAY,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE,CAAC,GAC5D,IACJ,EACN,MAAC,GAAG,gCACY,GAAG,EACjB,KAAC,KAAK,cACH,aAAa,IAAI,YAAY,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE,CAAC,GAC5D,IACJ,EACN,KAAC,GAAG,cACF,KAAC,eAAe,IACd,MAAM,EAAE,aAAa,EAAE,UAAU,EACjC,KAAK,EAAC,kBAAkB,GACxB,GACE,EACN,KAAC,GAAG,cACF,KAAC,MAAM,IACL,aAAa,EAAE,GAAG,EAAE,CAAC,KAAC,QAAQ,KAAG,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,yBAGnC,GACL,EACL,aAAa,IAAI,CAChB,KAAC,IAAI,IAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,GAAI,CACrE,IACiB,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC"}
|
package/lib/examples/CellLite.js
CHANGED
|
@@ -5,12 +5,24 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* MIT License
|
|
6
6
|
*/
|
|
7
7
|
import { createRoot } from 'react-dom/client';
|
|
8
|
-
import { Box } from '@primer
|
|
9
|
-
import {
|
|
8
|
+
import { Box } from '@datalayer/primer-addons';
|
|
9
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
10
|
+
import { useJupyter } from '../jupyter/JupyterContext';
|
|
10
11
|
import { Cell } from '../components/cell/Cell';
|
|
12
|
+
const CODE = `import sys
|
|
13
|
+
|
|
14
|
+
print("👋 Hello Jupyter React Lite")
|
|
15
|
+
print(f"Platform: {sys.platform}")
|
|
16
|
+
print(f"IPython: {get_ipython()}")`;
|
|
17
|
+
const CellLiteExample = () => {
|
|
18
|
+
const { defaultKernel } = useJupyter({
|
|
19
|
+
startDefaultKernel: true,
|
|
20
|
+
lite: true,
|
|
21
|
+
});
|
|
22
|
+
return (_jsxs(JupyterReactTheme, { children: [_jsx(Box, { as: "h1", children: "Cell with a Lite Kernel" }), defaultKernel && (_jsx(Cell, { id: "jupyter-cell-lite-1", source: CODE, kernel: defaultKernel }))] }));
|
|
23
|
+
};
|
|
11
24
|
const div = document.createElement('div');
|
|
12
25
|
document.body.appendChild(div);
|
|
13
26
|
const root = createRoot(div);
|
|
14
|
-
root.render(
|
|
15
|
-
print(f"👋 Hello Jupyter UI Lite - Platform: {sys.platform} - IPython: {get_ipython()}")` })] }));
|
|
27
|
+
root.render(_jsx(CellLiteExample, {}));
|
|
16
28
|
//# sourceMappingURL=CellLite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellLite.js","sourceRoot":"","sources":["../../src/examples/CellLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CellLite.js","sourceRoot":"","sources":["../../src/examples/CellLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,MAAM,IAAI,GAAG;;;;mCAIsB,CAAC;AAEpC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;QACnC,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IACH,OAAO,CACL,MAAC,iBAAiB,eAChB,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,wCAA8B,EACzC,aAAa,IAAI,CAChB,KAAC,IAAI,IAAC,EAAE,EAAC,qBAAqB,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,GAAI,CACvE,IACiB,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,eAAe,KAAG,CAAC,CAAC"}
|
package/lib/examples/Cells.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
3
|
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
4
|
*
|
|
5
5
|
* MIT License
|
|
6
6
|
*/
|
|
7
7
|
import { createRoot } from 'react-dom/client';
|
|
8
|
-
import { Box } from '@primer
|
|
8
|
+
import { Box } from '@datalayer/primer-addons';
|
|
9
9
|
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
10
|
-
import
|
|
10
|
+
import { useJupyter } from '../jupyter/JupyterContext';
|
|
11
|
+
import { Cell } from '../components/cell/Cell';
|
|
12
|
+
const CellsExample = () => {
|
|
13
|
+
const { defaultKernel } = useJupyter({ startDefaultKernel: true });
|
|
14
|
+
return (_jsxs(JupyterReactTheme, { children: [_jsx(Box, { as: "h1", children: "Cells Example" }), defaultKernel && (_jsxs(_Fragment, { children: [_jsx(Cell, { source: 'print("Hello from Cell 1")', kernel: defaultKernel }), _jsx(Cell, { source: 'print("Hello from Cell 2")', kernel: defaultKernel }), _jsx(Cell, { source: 'print("Hello from Cell 3")', kernel: defaultKernel })] }))] }));
|
|
15
|
+
};
|
|
11
16
|
const div = document.createElement('div');
|
|
12
17
|
document.body.appendChild(div);
|
|
13
18
|
const root = createRoot(div);
|
|
14
|
-
root.render(
|
|
15
|
-
|
|
16
|
-
r = random.randint(0,9)` }), _jsx(Cell, { source: "print(f'Random integer: {r}')" })] }));
|
|
19
|
+
root.render(_jsx(CellsExample, {}));
|
|
17
20
|
//# sourceMappingURL=Cells.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cells.js","sourceRoot":"","sources":["../../src/examples/Cells.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Cells.js","sourceRoot":"","sources":["../../src/examples/Cells.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,OAAO,CACL,MAAC,iBAAiB,eAChB,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,8BAAoB,EAC/B,aAAa,IAAI,CAChB,8BACE,KAAC,IAAI,IAAC,MAAM,EAAE,4BAA4B,EAAE,MAAM,EAAE,aAAa,GAAI,EACrE,KAAC,IAAI,IAAC,MAAM,EAAE,4BAA4B,EAAE,MAAM,EAAE,aAAa,GAAI,EACrE,KAAC,IAAI,IAAC,MAAM,EAAE,4BAA4B,EAAE,MAAM,EAAE,aAAa,GAAI,IACpE,CACJ,IACiB,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,YAAY,KAAG,CAAC,CAAC"}
|
|
@@ -6,10 +6,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useState, useEffect } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { Button
|
|
10
|
-
import {
|
|
9
|
+
import { Button } from '@primer/react';
|
|
10
|
+
import { PlayIcon } from '@primer/octicons-react';
|
|
11
|
+
import { Box } from '@datalayer/primer-addons';
|
|
11
12
|
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import
|
|
13
|
+
import { useJupyter } from '../jupyter/JupyterContext';
|
|
14
|
+
import { cellsStore } from '../components/cell/CellState';
|
|
15
|
+
import { Cell } from '../components/cell/Cell';
|
|
13
16
|
const CODE_CELL_1 = `import time
|
|
14
17
|
print("Cell 1 start...")
|
|
15
18
|
time.sleep(3)
|
|
@@ -18,7 +21,8 @@ const CODE_CELL_2 = `import time
|
|
|
18
21
|
print("Cell 2 start...")
|
|
19
22
|
time.sleep(3)
|
|
20
23
|
print("Cell 2 end.")`;
|
|
21
|
-
const
|
|
24
|
+
const CellsExecuteExample = () => {
|
|
25
|
+
const { defaultKernel } = useJupyter({ startDefaultKernel: true });
|
|
22
26
|
const [executionDisable, setExecutionDisable] = useState(false);
|
|
23
27
|
useEffect(() => {
|
|
24
28
|
const handleChange = (newState) => {
|
|
@@ -32,13 +36,13 @@ const CellsExecute = () => {
|
|
|
32
36
|
const onExecuteClick = () => {
|
|
33
37
|
cellsStore.getState().execute();
|
|
34
38
|
};
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
return (_jsxs(JupyterReactTheme, { children: [_jsx(Box, { as: "h1", children: "Cells Execute Example" }), defaultKernel && (_jsxs(Box, { style: { marginTop: '20px' }, children: [_jsx(Cell, { id: "1", type: "code", source: CODE_CELL_1, autoStart: false, showToolbar: false, kernel: defaultKernel }), _jsx(Cell, { id: "2", type: "code", source: CODE_CELL_2, autoStart: false, showToolbar: false, kernel: defaultKernel }), _jsx(Button, { onClick: onExecuteClick, disabled: executionDisable, leadingVisual: () => _jsx(PlayIcon, {}), style: {
|
|
40
|
+
marginLeft: '50px',
|
|
41
|
+
marginTop: '20px',
|
|
42
|
+
}, children: "Execute all" })] }))] }));
|
|
39
43
|
};
|
|
40
44
|
const div = document.createElement('div');
|
|
41
45
|
document.body.appendChild(div);
|
|
42
46
|
const root = createRoot(div);
|
|
43
|
-
root.render(_jsx(
|
|
47
|
+
root.render(_jsx(CellsExecuteExample, {}));
|
|
44
48
|
//# sourceMappingURL=CellsExecute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellsExecute.js","sourceRoot":"","sources":["../../src/examples/CellsExecute.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"CellsExecute.js","sourceRoot":"","sources":["../../src/examples/CellsExecute.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,MAAM,WAAW,GAAG;;;qBAGC,CAAC;AAEtB,MAAM,WAAW,GAAG;;;qBAGC,CAAC;AAEtB,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,CAAC,QAAqB,EAAE,EAAE;YAC7C,mBAAmB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACnD,CAAC,CAAC;QACF,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE;YACV,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,UAAU,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC,CAAC;IACF,OAAO,CACL,MAAC,iBAAiB,eAChB,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,sCAA4B,EACvC,aAAa,IAAI,CAChB,MAAC,GAAG,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,aAC/B,KAAC,IAAI,IACH,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,KAAK,EAClB,MAAM,EAAE,aAAa,GACrB,EACF,KAAC,IAAI,IACH,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,KAAK,EAClB,MAAM,EAAE,aAAa,GACrB,EACF,KAAC,MAAM,IACL,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,GAAG,EAAE,CAAC,KAAC,QAAQ,KAAG,EACjC,KAAK,EAAE;4BACL,UAAU,EAAE,MAAM;4BAClB,SAAS,EAAE,MAAM;yBAClB,4BAGM,IACL,CACP,IACiB,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,mBAAmB,KAAG,CAAC,CAAC"}
|
package/lib/examples/Console.js
CHANGED
|
@@ -5,11 +5,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* MIT License
|
|
6
6
|
*/
|
|
7
7
|
import { createRoot } from 'react-dom/client';
|
|
8
|
-
import { Box } from '@primer
|
|
8
|
+
import { Box } from '@datalayer/primer-addons';
|
|
9
9
|
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
10
10
|
import Console from '../components/console/Console';
|
|
11
11
|
const div = document.createElement('div');
|
|
12
12
|
document.body.appendChild(div);
|
|
13
13
|
const root = createRoot(div);
|
|
14
|
-
root.render(_jsxs(JupyterReactTheme, { children: [_jsx(Box, { as: "h1", children: "
|
|
14
|
+
root.render(_jsxs(JupyterReactTheme, { children: [_jsx(Box, { as: "h1", children: "Console" }), _jsx(Console, { code: "print('👋 Hello Jupyter Console')" })] }));
|
|
15
15
|
//# sourceMappingURL=Console.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Console.js","sourceRoot":"","sources":["../../src/examples/Console.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Console.js","sourceRoot":"","sources":["../../src/examples/Console.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,OAAO,MAAM,+BAA+B,CAAC;AAEpD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,iBAAiB,eAChB,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,wBAAc,EAC1B,KAAC,OAAO,IAAC,IAAI,EAAE,mCAAmC,GAAI,IACpC,CACrB,CAAC"}
|
|
@@ -5,14 +5,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* MIT License
|
|
6
6
|
*/
|
|
7
7
|
import { createRoot } from 'react-dom/client';
|
|
8
|
-
import { Box } from '@primer
|
|
8
|
+
import { Box } from '@datalayer/primer-addons';
|
|
9
9
|
import { Jupyter } from '../jupyter/Jupyter';
|
|
10
10
|
import Console from '../components/console/Console';
|
|
11
11
|
const div = document.createElement('div');
|
|
12
12
|
document.body.appendChild(div);
|
|
13
13
|
const root = createRoot(div);
|
|
14
|
-
root.render(_jsxs(Jupyter, { startDefaultKernel: true, lite: true, children: [_jsx(Box, { as: "h1", children: "
|
|
14
|
+
root.render(_jsxs(Jupyter, { startDefaultKernel: true, lite: true, children: [_jsx(Box, { as: "h1", children: "Console with a Lite Kernel" }), _jsx(Console, { code: `import micropip
|
|
15
15
|
await micropip.install('numpy')
|
|
16
|
-
import numpy
|
|
16
|
+
import numpy, sys
|
|
17
17
|
print(f'👋 Hello Jupyter Console with a Lite Kernel - Platform: {sys.platform} - IPython: {get_ipython()}") - numpy {numpy.__version__}')` })] }));
|
|
18
18
|
//# sourceMappingURL=ConsoleLite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleLite.js","sourceRoot":"","sources":["../../src/examples/ConsoleLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ConsoleLite.js","sourceRoot":"","sources":["../../src/examples/ConsoleLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,OAAO,MAAM,+BAA+B,CAAC;AAEpD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,OAAO,IAAC,kBAAkB,QAAC,IAAI,mBAC9B,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,2CAAiC,EAC7C,KAAC,OAAO,IACN,IAAI,EAAE;;;0IAG8H,GACpI,IACM,CACX,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Notebook } from '../components/notebook/Notebook';
|
|
|
6
6
|
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
7
7
|
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
8
8
|
import notebook from './notebooks/IPyWidgetsExample.ipynb.json';
|
|
9
|
-
const
|
|
9
|
+
const DashboardExample = () => {
|
|
10
10
|
const extensions = useMemo(() => [new CellSidebarExtension()], []);
|
|
11
11
|
return (_jsx(JupyterReactTheme, { children: _jsx(Notebook, { nbformat: notebook, id: "notebook-id", height: "calc(100vh - 2.6rem)" // (Height - Toolbar Height).
|
|
12
12
|
, extensions: extensions, Toolbar: NotebookToolbar }) }));
|
|
@@ -14,5 +14,5 @@ const Dashboard = () => {
|
|
|
14
14
|
const div = document.createElement('div');
|
|
15
15
|
document.body.appendChild(div);
|
|
16
16
|
const root = createRoot(div);
|
|
17
|
-
root.render(_jsx(
|
|
17
|
+
root.render(_jsx(DashboardExample, {}));
|
|
18
18
|
//# sourceMappingURL=Dashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../../src/examples/Dashboard.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,QAAQ,MAAM,0CAA0C,CAAC;AAEhE,MAAM,
|
|
1
|
+
{"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../../src/examples/Dashboard.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,QAAQ,MAAM,0CAA0C,CAAC;AAEhE,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,oBAAoB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnE,OAAO,CACL,KAAC,iBAAiB,cAChB,KAAC,QAAQ,IACP,QAAQ,EAAE,QAA4B,EACtC,EAAE,EAAC,aAAa,EAChB,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,eAAe,GACxB,GACgB,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC"}
|
package/lib/examples/Deno.js
CHANGED
|
@@ -10,7 +10,7 @@ import { CellSidebarExtension } from '../components';
|
|
|
10
10
|
import { Notebook } from '../components/notebook/Notebook';
|
|
11
11
|
import { Jupyter } from '../jupyter/Jupyter';
|
|
12
12
|
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
13
|
-
const
|
|
13
|
+
const DenoExample = () => {
|
|
14
14
|
const extensions = useMemo(() => [new CellSidebarExtension()], []);
|
|
15
15
|
return (_jsx(Jupyter, { defaultKernelName: "deno", children: _jsx(Notebook, { url: "https://raw.githubusercontent.com/rgbkrk/denotebooks/f173b472ad5b0169d77818027bf662682c5024ec/10.2_Polar%20DataFrames.ipynb", height: "calc(100vh - 2.6rem)" // (Height - Toolbar Height).
|
|
16
16
|
, extensions: extensions, Toolbar: NotebookToolbar }) }));
|
|
@@ -18,5 +18,5 @@ const Deno = () => {
|
|
|
18
18
|
const div = document.createElement('div');
|
|
19
19
|
document.body.appendChild(div);
|
|
20
20
|
const root = createRoot(div);
|
|
21
|
-
root.render(_jsx(
|
|
21
|
+
root.render(_jsx(DenoExample, {}));
|
|
22
22
|
//# sourceMappingURL=Deno.js.map
|
package/lib/examples/Deno.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deno.js","sourceRoot":"","sources":["../../src/examples/Deno.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,MAAM,
|
|
1
|
+
{"version":3,"file":"Deno.js","sourceRoot":"","sources":["../../src/examples/Deno.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,oBAAoB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,OAAO,CACL,KAAC,OAAO,IAAC,iBAAiB,EAAC,MAAM,YAC/B,KAAC,QAAQ,IACP,GAAG,EAAC,6HAA6H,EACjI,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,eAAe,GACxB,GACM,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available examples with their display names and module paths.
|
|
3
|
+
* Only includes examples that actually exist in the examples directory.
|
|
4
|
+
*/
|
|
5
|
+
declare const EXAMPLES: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Get the selected example from URL or localStorage.
|
|
11
|
+
*/
|
|
12
|
+
declare const getSelectedExample: () => string;
|
|
13
|
+
/**
|
|
14
|
+
* Save the selected example to localStorage.
|
|
15
|
+
*/
|
|
16
|
+
declare const saveExample: (path: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Main Examples component.
|
|
19
|
+
* Renders the sidebar and loads the selected example in an iframe.
|
|
20
|
+
*/
|
|
21
|
+
declare const Examples: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { EXAMPLES, getSelectedExample, saveExample };
|
|
23
|
+
export default Examples;
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Examples - A runtime example picker for Jupyter React.
|
|
9
|
+
*
|
|
10
|
+
* This module provides a dynamic example selector that:
|
|
11
|
+
* 1. Reads the example from URL query parameter (?example=CellLite)
|
|
12
|
+
* 2. Falls back to localStorage if no query param
|
|
13
|
+
* 3. Falls back to default (CellLite) if nothing stored
|
|
14
|
+
* 4. Dynamically imports and executes the selected example
|
|
15
|
+
*
|
|
16
|
+
* The selector UI uses Primer React components and persists selection.
|
|
17
|
+
*/
|
|
18
|
+
import { useState, useEffect, useRef } from 'react';
|
|
19
|
+
import { createRoot } from 'react-dom/client';
|
|
20
|
+
import { ThemeProvider, BaseStyles, Text, Spinner, Flash, ActionList, TextInput, } from '@primer/react';
|
|
21
|
+
import { Box } from '@datalayer/primer-addons';
|
|
22
|
+
import { SearchIcon, CheckIcon } from '@primer/octicons-react';
|
|
23
|
+
const LOCAL_STORAGE_KEY = 'jupyter-react-selected-example';
|
|
24
|
+
/**
|
|
25
|
+
* Available examples with their display names and module paths.
|
|
26
|
+
* Only includes examples that actually exist in the examples directory.
|
|
27
|
+
*/
|
|
28
|
+
const EXAMPLES = [
|
|
29
|
+
{ name: 'Cell', path: 'Cell' },
|
|
30
|
+
{ name: 'Cell Lite', path: 'CellLite' },
|
|
31
|
+
{ name: 'Cells', path: 'Cells' },
|
|
32
|
+
{ name: 'Cells Execute', path: 'CellsExecute' },
|
|
33
|
+
{ name: 'Console', path: 'Console' },
|
|
34
|
+
{ name: 'Console Lite', path: 'ConsoleLite' },
|
|
35
|
+
{ name: 'File Browser', path: 'FileBrowser' },
|
|
36
|
+
{ name: 'IPyLeaflet', path: 'IPyLeaflet' },
|
|
37
|
+
{ name: 'IPyReact', path: 'IPyReact' },
|
|
38
|
+
{ name: 'IPyWidgets', path: 'IPyWidgets' },
|
|
39
|
+
{ name: 'IPyWidgets State', path: 'IPyWidgetsState' },
|
|
40
|
+
{ name: 'Jupyter Context', path: 'JupyterContext' },
|
|
41
|
+
{ name: 'JupyterLab App', path: 'JupyterLabApp' },
|
|
42
|
+
{ name: 'JupyterLab App Headless', path: 'JupyterLabAppHeadless' },
|
|
43
|
+
{
|
|
44
|
+
name: 'JupyterLab App Headless Serverless',
|
|
45
|
+
path: 'JupyterLabAppHeadlessServerless',
|
|
46
|
+
},
|
|
47
|
+
{ name: 'JupyterLab App Serverless', path: 'JupyterLabAppServerless' },
|
|
48
|
+
{
|
|
49
|
+
name: 'JupyterLab App Service Manager',
|
|
50
|
+
path: 'JupyterLabAppServiceManager',
|
|
51
|
+
},
|
|
52
|
+
{ name: 'JupyterLab Theme', path: 'JupyterLabTheme' },
|
|
53
|
+
{ name: 'Kernel Execute', path: 'KernelExecute' },
|
|
54
|
+
{ name: 'Kernel Execute Lite', path: 'KernelExecuteLite' },
|
|
55
|
+
{ name: 'Kernel Executor', path: 'KernelExecutor' },
|
|
56
|
+
{ name: 'Kernel Executor Lite', path: 'KernelExecutorLite' },
|
|
57
|
+
{ name: 'Kernels', path: 'Kernels' },
|
|
58
|
+
{ name: 'Lumino', path: 'Lumino' },
|
|
59
|
+
{ name: 'Matplotlib', path: 'Matplotlib' },
|
|
60
|
+
{ name: 'Notebook', path: 'Notebook' },
|
|
61
|
+
{ name: 'Notebook2', path: 'Notebook2' },
|
|
62
|
+
{ name: 'Notebook2 Actions', path: 'Notebook2Actions' },
|
|
63
|
+
{ name: 'Notebook2 Collaborative', path: 'Notebook2Collaborative' },
|
|
64
|
+
{ name: 'Notebook2 Lite', path: 'Notebook2Lite' },
|
|
65
|
+
{ name: 'Notebook Cell Sidebar', path: 'NotebookCellSidebar' },
|
|
66
|
+
{ name: 'Notebook Cell Toolbar', path: 'NotebookCellToolbar' },
|
|
67
|
+
{ name: 'Notebook Colormode', path: 'NotebookColormode' },
|
|
68
|
+
{ name: 'Notebook Collaborative', path: 'NotebookCollaborative' },
|
|
69
|
+
{ name: 'Notebook Extension', path: 'NotebookExtension' },
|
|
70
|
+
{ name: 'Notebook External Content', path: 'NotebookExternalContent' },
|
|
71
|
+
{ name: 'Notebook Init', path: 'NotebookInit' },
|
|
72
|
+
{ name: 'Notebook Kernel', path: 'NotebookKernel' },
|
|
73
|
+
{ name: 'Notebook Kernel Change', path: 'NotebookKernelChange' },
|
|
74
|
+
{ name: 'Notebook Less', path: 'NotebookLess' },
|
|
75
|
+
{ name: 'Notebook Lite', path: 'NotebookLite' },
|
|
76
|
+
{ name: 'Notebook Lite Context', path: 'NotebookLiteContext' },
|
|
77
|
+
{ name: 'Notebook Local Server', path: 'NotebookLocalServer' },
|
|
78
|
+
{ name: 'Notebook Nbformat', path: 'NotebookNbformat' },
|
|
79
|
+
{ name: 'Notebook Nbformat Change', path: 'NotebookNbformatChange' },
|
|
80
|
+
{ name: 'Notebook No Context', path: 'NotebookNoContext' },
|
|
81
|
+
{ name: 'Notebook No Primer', path: 'NotebookNoPrimer' },
|
|
82
|
+
{
|
|
83
|
+
name: 'Notebook On Session Connection',
|
|
84
|
+
path: 'NotebookOnSessionConnection',
|
|
85
|
+
},
|
|
86
|
+
{ name: 'Notebook Path', path: 'NotebookPath' },
|
|
87
|
+
{ name: 'Notebook Path Change', path: 'NotebookPathChange' },
|
|
88
|
+
{ name: 'Notebook Readonly', path: 'NotebookReadonly' },
|
|
89
|
+
{ name: 'Notebook Service Manager', path: 'NotebookServiceManager' },
|
|
90
|
+
{ name: 'Notebook Skeleton', path: 'NotebookSkeleton' },
|
|
91
|
+
{ name: 'Notebook Theme', path: 'NotebookTheme' },
|
|
92
|
+
{ name: 'Notebook Theme Colormode', path: 'NotebookThemeColormode' },
|
|
93
|
+
{ name: 'Notebook TOC', path: 'NotebookTOC' },
|
|
94
|
+
{ name: 'Notebook URL', path: 'NotebookURL' },
|
|
95
|
+
{ name: 'Notebook Unmount', path: 'NotebookUnmount' },
|
|
96
|
+
{ name: 'Outputs', path: 'Outputs' },
|
|
97
|
+
{ name: 'Outputs Ipynb', path: 'OutputsIpynb' },
|
|
98
|
+
{ name: 'Output IPyWidgets', path: 'OutputIPyWidgets' },
|
|
99
|
+
{ name: 'Output With Monitoring', path: 'OutputWithMonitoring' },
|
|
100
|
+
{ name: 'Plotly', path: 'Plotly' },
|
|
101
|
+
{ name: 'PyGWalker', path: 'PyGWalker' },
|
|
102
|
+
{ name: 'Running Sessions', path: 'RunningSessions' },
|
|
103
|
+
{ name: 'Terminal', path: 'Terminal' },
|
|
104
|
+
{ name: 'Viewer', path: 'Viewer' },
|
|
105
|
+
];
|
|
106
|
+
/**
|
|
107
|
+
* Dynamic import function for examples.
|
|
108
|
+
* Uses explicit imports to work with both Vite and webpack bundlers.
|
|
109
|
+
* The examples render to their own DOM elements when imported.
|
|
110
|
+
*/
|
|
111
|
+
const importExample = (path) => {
|
|
112
|
+
const modules = {
|
|
113
|
+
Cell: () => import('./Cell'),
|
|
114
|
+
CellLite: () => import('./CellLite'),
|
|
115
|
+
Cells: () => import('./Cells'),
|
|
116
|
+
CellsExecute: () => import('./CellsExecute'),
|
|
117
|
+
Console: () => import('./Console'),
|
|
118
|
+
ConsoleLite: () => import('./ConsoleLite'),
|
|
119
|
+
FileBrowser: () => import('./FileBrowser'),
|
|
120
|
+
IPyLeaflet: () => import('./IPyLeaflet'),
|
|
121
|
+
IPyReact: () => import('./IPyReact'),
|
|
122
|
+
IPyWidgets: () => import('./IPyWidgets'),
|
|
123
|
+
IPyWidgetsState: () => import('./IPyWidgetsState'),
|
|
124
|
+
JupyterContext: () => import('./JupyterContext'),
|
|
125
|
+
JupyterLabApp: () => import('./JupyterLabApp'),
|
|
126
|
+
JupyterLabAppHeadless: () => import('./JupyterLabAppHeadless'),
|
|
127
|
+
JupyterLabAppHeadlessServerless: () => import('./JupyterLabAppHeadlessServerless'),
|
|
128
|
+
JupyterLabAppServerless: () => import('./JupyterLabAppServerless'),
|
|
129
|
+
JupyterLabAppServiceManager: () => import('./JupyterLabAppServiceManager'),
|
|
130
|
+
JupyterLabTheme: () => import('./JupyterLabTheme'),
|
|
131
|
+
KernelExecute: () => import('./KernelExecute'),
|
|
132
|
+
KernelExecuteLite: () => import('./KernelExecuteLite'),
|
|
133
|
+
KernelExecutor: () => import('./KernelExecutor'),
|
|
134
|
+
KernelExecutorLite: () => import('./KernelExecutorLite'),
|
|
135
|
+
Kernels: () => import('./Kernels'),
|
|
136
|
+
Lumino: () => import('./Lumino'),
|
|
137
|
+
Matplotlib: () => import('./Matplotlib'),
|
|
138
|
+
Notebook: () => import('./Notebook'),
|
|
139
|
+
Notebook2: () => import('./Notebook2'),
|
|
140
|
+
Notebook2Actions: () => import('./Notebook2Actions'),
|
|
141
|
+
Notebook2Collaborative: () => import('./Notebook2Collaborative'),
|
|
142
|
+
Notebook2Lite: () => import('./Notebook2Lite'),
|
|
143
|
+
NotebookCellSidebar: () => import('./NotebookCellSidebar'),
|
|
144
|
+
NotebookCellToolbar: () => import('./NotebookCellToolbar'),
|
|
145
|
+
NotebookColormode: () => import('./NotebookColormode'),
|
|
146
|
+
NotebookCollaborative: () => import('./NotebookCollaborative'),
|
|
147
|
+
NotebookExtension: () => import('./NotebookExtension'),
|
|
148
|
+
NotebookExternalContent: () => import('./NotebookExternalContent'),
|
|
149
|
+
NotebookInit: () => import('./NotebookInit'),
|
|
150
|
+
NotebookKernel: () => import('./NotebookKernel'),
|
|
151
|
+
NotebookKernelChange: () => import('./NotebookKernelChange'),
|
|
152
|
+
NotebookLess: () => import('./NotebookLess'),
|
|
153
|
+
NotebookLite: () => import('./NotebookLite'),
|
|
154
|
+
NotebookLiteContext: () => import('./NotebookLiteContext'),
|
|
155
|
+
NotebookLocalServer: () => import('./NotebookLocalServer'),
|
|
156
|
+
NotebookNbformat: () => import('./NotebookNbformat'),
|
|
157
|
+
NotebookNbformatChange: () => import('./NotebookNbformatChange'),
|
|
158
|
+
NotebookNoContext: () => import('./NotebookNoContext'),
|
|
159
|
+
NotebookNoPrimer: () => import('./NotebookNoPrimer'),
|
|
160
|
+
NotebookOnSessionConnection: () => import('./NotebookOnSessionConnection'),
|
|
161
|
+
NotebookPath: () => import('./NotebookPath'),
|
|
162
|
+
NotebookPathChange: () => import('./NotebookPathChange'),
|
|
163
|
+
NotebookReadonly: () => import('./NotebookReadonly'),
|
|
164
|
+
NotebookServiceManager: () => import('./NotebookServiceManager'),
|
|
165
|
+
NotebookSkeleton: () => import('./NotebookSkeleton'),
|
|
166
|
+
NotebookTheme: () => import('./NotebookTheme'),
|
|
167
|
+
NotebookThemeColormode: () => import('./NotebookThemeColormode'),
|
|
168
|
+
NotebookTOC: () => import('./NotebookTOC'),
|
|
169
|
+
NotebookURL: () => import('./NotebookURL'),
|
|
170
|
+
NotebookUnmount: () => import('./NotebookUnmount'),
|
|
171
|
+
Outputs: () => import('./Outputs'),
|
|
172
|
+
OutputsIpynb: () => import('./OutputsIpynb'),
|
|
173
|
+
OutputIPyWidgets: () => import('./OutputIPyWidgets'),
|
|
174
|
+
OutputWithMonitoring: () => import('./OutputWithMonitoring'),
|
|
175
|
+
Plotly: () => import('./Plotly'),
|
|
176
|
+
PyGWalker: () => import('./PyGWalker'),
|
|
177
|
+
RunningSessions: () => import('./RunningSessions'),
|
|
178
|
+
Terminal: () => import('./Terminal'),
|
|
179
|
+
Viewer: () => import('./Viewer'),
|
|
180
|
+
};
|
|
181
|
+
const loader = modules[path];
|
|
182
|
+
if (loader) {
|
|
183
|
+
return loader();
|
|
184
|
+
}
|
|
185
|
+
return Promise.reject(new Error(`Example "${path}" not found`));
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Get the selected example from URL or localStorage.
|
|
189
|
+
*/
|
|
190
|
+
const getSelectedExample = () => {
|
|
191
|
+
// First check URL query parameter
|
|
192
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
193
|
+
const exampleFromUrl = urlParams.get('example');
|
|
194
|
+
if (exampleFromUrl && EXAMPLES.some(e => e.path === exampleFromUrl)) {
|
|
195
|
+
return exampleFromUrl;
|
|
196
|
+
}
|
|
197
|
+
// Then check localStorage
|
|
198
|
+
try {
|
|
199
|
+
const saved = localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
200
|
+
if (saved && EXAMPLES.some(e => e.path === saved)) {
|
|
201
|
+
return saved;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// localStorage not available
|
|
206
|
+
}
|
|
207
|
+
return 'CellLite'; // Default example
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Save the selected example to localStorage.
|
|
211
|
+
*/
|
|
212
|
+
const saveExample = (path) => {
|
|
213
|
+
try {
|
|
214
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, path);
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
// localStorage not available
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Example Selector Sidebar component.
|
|
222
|
+
* Renders a right sidebar with a filtered list for selecting examples.
|
|
223
|
+
*/
|
|
224
|
+
const ExamplesSidebar = ({ selectedPath, onSelect, isLoading, error, }) => {
|
|
225
|
+
const [filter, setFilter] = useState('');
|
|
226
|
+
// Filter examples based on search text
|
|
227
|
+
const filteredExamples = EXAMPLES.filter(example => example.name.toLowerCase().includes(filter.toLowerCase()) ||
|
|
228
|
+
example.path.toLowerCase().includes(filter.toLowerCase()));
|
|
229
|
+
return (_jsxs(Box, { sx: {
|
|
230
|
+
position: 'fixed',
|
|
231
|
+
top: 0,
|
|
232
|
+
right: 0,
|
|
233
|
+
height: '100vh',
|
|
234
|
+
width: '320px',
|
|
235
|
+
backgroundColor: 'canvas.default',
|
|
236
|
+
borderLeft: '1px solid',
|
|
237
|
+
borderColor: 'border.default',
|
|
238
|
+
display: 'flex',
|
|
239
|
+
flexDirection: 'column',
|
|
240
|
+
zIndex: 1000,
|
|
241
|
+
}, children: [_jsxs(Box, { sx: {
|
|
242
|
+
px: 3,
|
|
243
|
+
py: 2,
|
|
244
|
+
borderBottom: '1px solid',
|
|
245
|
+
borderColor: 'border.default',
|
|
246
|
+
}, children: [_jsx(Text, { as: "div", fontWeight: "bold", fontSize: 2, children: "\uD83D\uDCD3 Examples" }), isLoading && (_jsxs(Box, { mt: 2, display: "flex", alignItems: "center", children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { ml: 2, fontSize: 1, color: "fg.muted", children: "Loading..." })] }))] }), error && (_jsx(Box, { px: 3, py: 2, children: _jsx(Flash, { variant: "danger", children: error }) })), _jsx(Box, { sx: {
|
|
247
|
+
px: 2,
|
|
248
|
+
py: 2,
|
|
249
|
+
borderBottom: '1px solid',
|
|
250
|
+
borderColor: 'border.default',
|
|
251
|
+
}, children: _jsx(TextInput, { leadingVisual: SearchIcon, placeholder: "Filter examples...", value: filter, onChange: e => setFilter(e.target.value), sx: { width: '100%' }, "aria-label": "Filter examples" }) }), _jsx(Box, { sx: { flex: 1, overflow: 'auto' }, children: _jsx(ActionList, { selectionVariant: "single", children: filteredExamples.length === 0 ? (_jsxs(ActionList.Item, { disabled: true, children: ["No examples match \u201C", filter, "\u201D"] })) : (filteredExamples.map(example => {
|
|
252
|
+
const isSelected = example.path === selectedPath;
|
|
253
|
+
return (_jsxs(ActionList.Item, { selected: isSelected, onSelect: () => onSelect(example.path), children: [isSelected && (_jsx(ActionList.LeadingVisual, { children: _jsx(CheckIcon, {}) })), example.name, _jsx(ActionList.Description, { variant: "block", children: example.path })] }, example.path));
|
|
254
|
+
})) }) })] }));
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Main Examples component.
|
|
258
|
+
* Renders the sidebar and loads the selected example in an iframe.
|
|
259
|
+
*/
|
|
260
|
+
const Examples = () => {
|
|
261
|
+
const [selectedPath, setSelectedPath] = useState(getSelectedExample);
|
|
262
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
263
|
+
const [error, setError] = useState(null);
|
|
264
|
+
const iframeRef = useRef(null);
|
|
265
|
+
useEffect(() => {
|
|
266
|
+
// Add margin to body to account for sidebar width (medium = 320px)
|
|
267
|
+
document.body.style.marginRight = '320px';
|
|
268
|
+
document.body.style.margin = '0';
|
|
269
|
+
document.body.style.padding = '0';
|
|
270
|
+
document.body.style.overflow = 'hidden';
|
|
271
|
+
document.documentElement.style.margin = '0';
|
|
272
|
+
document.documentElement.style.padding = '0';
|
|
273
|
+
document.documentElement.style.overflow = 'hidden';
|
|
274
|
+
return () => {
|
|
275
|
+
// Cleanup: remove styles when component unmounts
|
|
276
|
+
document.body.style.marginRight = '';
|
|
277
|
+
document.body.style.margin = '';
|
|
278
|
+
document.body.style.padding = '';
|
|
279
|
+
document.body.style.overflow = '';
|
|
280
|
+
document.documentElement.style.margin = '';
|
|
281
|
+
document.documentElement.style.padding = '';
|
|
282
|
+
document.documentElement.style.overflow = '';
|
|
283
|
+
};
|
|
284
|
+
}, []);
|
|
285
|
+
// Build the iframe URL for the selected example
|
|
286
|
+
const getExampleUrl = (path) => {
|
|
287
|
+
const url = new URL(window.location.href);
|
|
288
|
+
url.searchParams.set('example', path);
|
|
289
|
+
url.searchParams.set('standalone', 'true');
|
|
290
|
+
return url.toString();
|
|
291
|
+
};
|
|
292
|
+
const handleSelect = (path) => {
|
|
293
|
+
if (path === selectedPath)
|
|
294
|
+
return;
|
|
295
|
+
// Save selection
|
|
296
|
+
saveExample(path);
|
|
297
|
+
// Update URL without reloading
|
|
298
|
+
const url = new URL(window.location.href);
|
|
299
|
+
url.searchParams.set('example', path);
|
|
300
|
+
window.history.pushState({}, '', url.toString());
|
|
301
|
+
// Update state to reload iframe
|
|
302
|
+
setIsLoading(true);
|
|
303
|
+
setError(null);
|
|
304
|
+
setSelectedPath(path);
|
|
305
|
+
};
|
|
306
|
+
const handleIframeLoad = () => {
|
|
307
|
+
setIsLoading(false);
|
|
308
|
+
};
|
|
309
|
+
const handleIframeError = () => {
|
|
310
|
+
setError(`Failed to load example "${selectedPath}"`);
|
|
311
|
+
setIsLoading(false);
|
|
312
|
+
};
|
|
313
|
+
return (_jsx(ThemeProvider, { colorMode: "auto", children: _jsxs(BaseStyles, { children: [_jsx("iframe", { ref: iframeRef, src: getExampleUrl(selectedPath), onLoad: handleIframeLoad, onError: handleIframeError, style: {
|
|
314
|
+
position: 'fixed',
|
|
315
|
+
top: 0,
|
|
316
|
+
left: 0,
|
|
317
|
+
width: 'calc(100vw - 320px)',
|
|
318
|
+
height: '100vh',
|
|
319
|
+
border: 'none',
|
|
320
|
+
}, title: `Example: ${selectedPath}` }), _jsx(ExamplesSidebar, { selectedPath: selectedPath, onSelect: handleSelect, isLoading: isLoading, error: error })] }) }));
|
|
321
|
+
};
|
|
322
|
+
// Check if we're in standalone mode (loaded in iframe)
|
|
323
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
324
|
+
const isStandalone = urlParams.get('standalone') === 'true';
|
|
325
|
+
if (isStandalone) {
|
|
326
|
+
// In standalone mode, just load the example directly
|
|
327
|
+
const examplePath = urlParams.get('example') || 'CellLite';
|
|
328
|
+
importExample(examplePath).catch(err => {
|
|
329
|
+
console.error('Failed to load example:', err);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
// Normal mode: render the selector with sidebar
|
|
334
|
+
const selectorDiv = document.createElement('div');
|
|
335
|
+
selectorDiv.id = 'example-selector-root';
|
|
336
|
+
document.body.appendChild(selectorDiv);
|
|
337
|
+
const root = createRoot(selectorDiv);
|
|
338
|
+
root.render(_jsx(Examples, {}));
|
|
339
|
+
}
|
|
340
|
+
export { EXAMPLES, getSelectedExample, saveExample };
|
|
341
|
+
export default Examples;
|
|
342
|
+
//# sourceMappingURL=Examples.js.map
|