@datalayer/jupyter-react 2.0.0 → 2.0.2
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 +38 -5
- package/lib/app/App.js +1 -1
- package/lib/app/JupyterReact.js +4 -4
- package/lib/app/index.js +1 -1
- package/lib/app/tabs/ComponentsTab.js +5 -5
- package/lib/app/tabs/components/CellComponent.js +2 -2
- package/lib/app/tabs/components/FileBrowserComponent.js +2 -2
- package/lib/app/tabs/components/IPyWidgetsComponent.js +2 -2
- package/lib/app/tabs/components/NotebookComponent.js +4 -4
- package/lib/app/tabs/components/ViewerComponent.js +1 -1
- package/lib/cell.d.ts +7 -0
- package/lib/cell.js +13 -0
- package/lib/cell.js.map +1 -0
- package/lib/components/button/index.js +1 -1
- package/lib/components/cell/Cell.js +13 -8
- package/lib/components/cell/Cell.js.map +1 -1
- package/lib/components/cell/CellAdapter.js +6 -6
- package/lib/components/cell/index.js +4 -4
- package/lib/components/codemirror/CodeMirrorEditor.js +3 -3
- package/lib/components/codemirror/index.js +4 -4
- package/lib/components/commands/Commands.js +2 -2
- package/lib/components/commands/index.js +2 -2
- package/lib/components/console/Console.js +4 -4
- package/lib/components/console/index.js +3 -3
- package/lib/components/dialog/Dialog.js +2 -2
- package/lib/components/dialog/index.js +2 -2
- package/lib/components/environment/index.js +1 -1
- package/lib/components/filebrowser/FileBrowser.js +1 -1
- package/lib/components/filebrowser/index.js +1 -1
- package/lib/components/filemanager/FileManagerJupyterLab.js +3 -3
- package/lib/components/filemanager/index.js +2 -2
- package/lib/components/filemanager/lab/index.js +1 -1
- package/lib/components/index.js +19 -19
- package/lib/components/jupyterlab/JupyterLabApp.js +4 -4
- package/lib/components/jupyterlab/index.js +3 -3
- package/lib/components/kernel/KernelInspector.js +2 -2
- package/lib/components/kernel/KernelSelector.js +1 -1
- package/lib/components/kernel/KernelVariables.js +2 -2
- package/lib/components/kernel/Kernels.js +1 -1
- package/lib/components/kernel/index.js +13 -13
- package/lib/components/kernel/inspector/index.js +2 -2
- package/lib/components/kernel/inspector/widget.js +2 -2
- package/lib/components/kernel/variables/index.js +7 -7
- package/lib/components/kernel/variables/variablesinspector.js +5 -5
- package/lib/components/lumino/Lumino.js +0 -14
- package/lib/components/lumino/Lumino.js.map +1 -1
- package/lib/components/lumino/index.js +5 -5
- package/lib/components/notebook/Notebook.js +2 -13
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +32 -0
- package/lib/components/notebook/NotebookAdapter.js +59 -32
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookBase.d.ts +14 -12
- package/lib/components/notebook/NotebookBase.js +50 -100
- package/lib/components/notebook/NotebookBase.js.map +1 -1
- package/lib/components/notebook/NotebookState.d.ts +87 -0
- package/lib/components/notebook/NotebookState.js +147 -4
- package/lib/components/notebook/NotebookState.js.map +1 -1
- package/lib/components/notebook/cell/index.js +3 -3
- package/lib/components/notebook/cell/metadata/CellMetadataEditor.js +1 -1
- package/lib/components/notebook/cell/metadata/index.js +2 -2
- package/lib/components/notebook/cell/prompt/CountdownInputPrompt.js +1 -1
- package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.js +1 -1
- package/lib/components/notebook/cell/prompt/index.js +3 -3
- package/lib/components/notebook/cell/sidebar/CellSidebar.js +2 -2
- package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +2 -2
- package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js +2 -2
- package/lib/components/notebook/cell/sidebar/CellSidebarRun.js +2 -2
- package/lib/components/notebook/cell/sidebar/index.js +4 -4
- package/lib/components/notebook/content/JupyterReactContentFactory.js +1 -1
- package/lib/components/notebook/content/index.js +1 -1
- package/lib/components/notebook/index.js +11 -11
- package/lib/components/notebook/marked/index.js +1 -1
- package/lib/components/notebook/model/index.js +1 -1
- package/lib/components/notebook/toolbar/NotebookToolbar.js +4 -8
- package/lib/components/notebook/toolbar/NotebookToolbar.js.map +1 -1
- package/lib/components/notebook/toolbar/index.js +1 -1
- package/lib/components/output/Output.js +8 -8
- package/lib/components/output/OutputAdapter.js +3 -3
- package/lib/components/output/OutputIPyWidgets.js +1 -1
- package/lib/components/output/index.js +6 -6
- package/lib/components/output/ipywidgets/IPyWidgetsAttached.js +1 -1
- package/lib/components/settings/Settings.js +2 -2
- package/lib/components/settings/index.js +2 -2
- package/lib/components/terminal/Terminal.js +4 -4
- package/lib/components/terminal/index.js +3 -3
- package/lib/components/textinput/index.js +1 -1
- package/lib/components/utils/index.js +2 -2
- package/lib/components/viewer/Viewer.js +3 -3
- package/lib/components/viewer/index.js +3 -3
- package/lib/components/viewer/input/CodemirrorViewer.js +2 -2
- package/lib/components/viewer/input/InputViewer.js +4 -4
- package/lib/components/viewer/input/index.js +2 -2
- package/lib/components/viewer/output/OutputViewer.js +2 -2
- package/lib/components/viewer/output/index.js +2 -2
- package/lib/console.d.ts +7 -0
- package/lib/console.js +13 -0
- package/lib/console.js.map +1 -0
- package/lib/core.d.ts +38 -0
- package/lib/core.js +48 -0
- package/lib/core.js.map +1 -0
- package/lib/examples/Bokeh.js +5 -5
- package/lib/examples/Bqplot.js +5 -5
- package/lib/examples/Cell.js +6 -6
- package/lib/examples/CellLite.js +3 -3
- package/lib/examples/Cells.js +3 -3
- package/lib/examples/CellsExecute.js +4 -4
- package/lib/examples/Console.js +2 -2
- package/lib/examples/ConsoleLite.js +2 -2
- package/lib/examples/Dashboard.js +5 -5
- package/lib/examples/Deno.js +5 -5
- package/lib/examples/Examples.js +1 -1
- package/lib/examples/Examples.js.map +1 -1
- package/lib/examples/FileBrowser.js +3 -3
- package/lib/examples/GeoJson.js +6 -6
- package/lib/examples/IPyLeaflet.js +5 -5
- package/lib/examples/IPyReact.js +5 -5
- package/lib/examples/IPyWidgets.js +5 -5
- package/lib/examples/IPyWidgetsState.js +5 -5
- package/lib/examples/JupyterContext.js +17 -17
- package/lib/examples/JupyterContext.js.map +1 -1
- package/lib/examples/JupyterLabApp.js +2 -2
- package/lib/examples/JupyterLabAppHeadless.js +3 -3
- package/lib/examples/JupyterLabAppHeadlessServerless.js +3 -3
- package/lib/examples/JupyterLabAppServerless.js +3 -3
- package/lib/examples/JupyterLabAppServiceManager.js +4 -4
- package/lib/examples/JupyterLabTheme.js +2 -2
- package/lib/examples/KernelExecute.js +3 -3
- package/lib/examples/KernelExecuteLite.js +4 -4
- package/lib/examples/KernelExecutor.js +3 -3
- package/lib/examples/KernelExecutorLite.js +4 -4
- package/lib/examples/Kernels.js +3 -3
- package/lib/examples/Lumino.js +2 -2
- package/lib/examples/Matplotlib.js +5 -5
- package/lib/examples/Notebook.js +4 -4
- package/lib/examples/Notebook.js.map +1 -1
- package/lib/examples/NotebookActions.js +6 -6
- package/lib/examples/NotebookActions.js.map +1 -1
- package/lib/examples/NotebookCellSidebar.js +6 -6
- package/lib/examples/NotebookCellToolbar.js +7 -7
- package/lib/examples/NotebookCollaborative.js +3 -3
- package/lib/examples/NotebookCollaborative.js.map +1 -1
- package/lib/examples/NotebookColormode.js +6 -6
- package/lib/examples/NotebookExtension.js +4 -4
- package/lib/examples/NotebookExternalContent.js +5 -5
- package/lib/examples/NotebookInit.js +13 -19
- package/lib/examples/NotebookInit.js.map +1 -1
- package/lib/examples/NotebookKernel.js +9 -9
- package/lib/examples/NotebookKernel.js.map +1 -1
- package/lib/examples/NotebookKernelChange.js +23 -17
- package/lib/examples/NotebookKernelChange.js.map +1 -1
- package/lib/examples/NotebookLess.js +5 -5
- package/lib/examples/NotebookLite.js +5 -5
- package/lib/examples/NotebookLite.js.map +1 -1
- package/lib/examples/NotebookLocalServer.js +6 -6
- package/lib/examples/NotebookNbformat.js +3 -3
- package/lib/examples/NotebookNbformatChange.js +8 -14
- package/lib/examples/NotebookNbformatChange.js.map +1 -1
- package/lib/examples/NotebookNoContext.js +6 -6
- package/lib/examples/NotebookNoPrimer.js +6 -6
- package/lib/examples/NotebookOnSessionConnection.js +3 -3
- package/lib/examples/NotebookPath.js +6 -6
- package/lib/examples/NotebookPathChange.js +4 -4
- package/lib/examples/NotebookReadonly.js +5 -5
- package/lib/examples/NotebookServiceManager.js +6 -6
- package/lib/examples/NotebookSkeleton.js +6 -6
- package/lib/examples/NotebookTOC.js +7 -7
- package/lib/examples/NotebookTheme.js +5 -5
- package/lib/examples/NotebookThemeColormode.js +4 -4
- package/lib/examples/NotebookURL.js +6 -6
- package/lib/examples/NotebookUnmount.js +5 -5
- package/lib/examples/ObservableHQ.js +5 -5
- package/lib/examples/OutputIPyWidgets.js +3 -3
- package/lib/examples/OutputWithMonitoring.js +5 -5
- package/lib/examples/Outputs.js +8 -8
- package/lib/examples/OutputsIpynb.js +3 -3
- package/lib/examples/Panel.js +6 -6
- package/lib/examples/Plotly.js +5 -5
- package/lib/examples/PyGWalker.js +5 -5
- package/lib/examples/RunningSessions.js +2 -2
- package/lib/examples/Terminal.js +2 -2
- package/lib/examples/Vega.js +6 -6
- package/lib/examples/Viewer.js +2 -2
- package/lib/examples/extensions/cellsidebars/CellSidebarSource.js +3 -3
- package/lib/examples/extensions/cellsidebars/index.js +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbar.js +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbarComponent.js +2 -3
- package/lib/examples/extensions/celltoolbar/CellToolbarComponent.js.map +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbarExtension.js +1 -1
- package/lib/examples/extensions/celltoolbar/CellToolbarWidget.js +1 -1
- package/lib/examples/extensions/celltoolbar/index.js +4 -4
- package/lib/examples/extensions/exectime/ExecTimeExtension.js +1 -1
- package/lib/examples/extensions/exectime/ExecTimeWidget.js +1 -1
- package/lib/examples/extensions/exectime/index.js +3 -3
- package/lib/examples/extensions/index.js +3 -3
- package/lib/examples/extensions/toc/ReactLayoutFactory.js +3 -3
- package/lib/examples/extensions/toc/ReactLayoutFactory.js.map +1 -1
- package/lib/examples/extensions/toc/TocComponent.d.ts +1 -2
- package/lib/examples/extensions/toc/TocComponent.js +29 -40
- package/lib/examples/extensions/toc/TocComponent.js.map +1 -1
- package/lib/examples/extensions/toc/TocExtension.js +1 -1
- package/lib/index.js +7 -7
- package/lib/jupyter/JupyterConfig.js +1 -1
- package/lib/jupyter/JupyterHandlers.js +1 -1
- package/lib/jupyter/JupyterUse.js +1 -1
- package/lib/jupyter/collaboration/CollaborationContext.js +1 -1
- package/lib/jupyter/collaboration/index.js +4 -4
- package/lib/jupyter/collaboration/providers/JupyterCollaborationProvider.js +2 -2
- package/lib/jupyter/collaboration/providers/NoOpCollaborationProvider.js +1 -1
- package/lib/jupyter/collaboration/providers/index.js +2 -2
- package/lib/jupyter/index.js +11 -11
- package/lib/jupyter/ipywidgets/classic/htmlmanager.js +1 -1
- package/lib/jupyter/ipywidgets/classic/index.js +3 -3
- package/lib/jupyter/ipywidgets/classic/manager.js +5 -5
- package/lib/jupyter/ipywidgets/index.js +5 -5
- package/lib/jupyter/ipywidgets/lab/index.js +2 -2
- package/lib/jupyter/ipywidgets/lab/manager.js +3 -3
- package/lib/jupyter/ipywidgets/libembed-amd.js +1 -1
- package/lib/jupyter/ipywidgets/libembed.js +1 -1
- package/lib/jupyter/kernel/Kernel.js +2 -7
- package/lib/jupyter/kernel/Kernel.js.map +1 -1
- package/lib/jupyter/kernel/KernelExecutor.js +3 -5
- package/lib/jupyter/kernel/KernelExecutor.js.map +1 -1
- package/lib/jupyter/kernel/index.js +3 -3
- package/lib/jupyter/lite/LiteServer.js +2 -2
- package/lib/jupyter/lite/contents/broadcast.js +2 -2
- package/lib/jupyter/lite/contents/contents.js +1 -1
- package/lib/jupyter/lite/contents/drivecontents.js +2 -2
- package/lib/jupyter/lite/contents/drivefs.js +1 -1
- package/lib/jupyter/lite/contents/index.js +6 -6
- package/lib/jupyter/lite/index.js +7 -7
- package/lib/jupyter/lite/javascript-kernel/comlink.worker.js +1 -1
- package/lib/jupyter/lite/javascript-kernel/index.js +2 -2
- package/lib/jupyter/lite/javascript-kernel/kernel.js +1 -1
- package/lib/jupyter/lite/javascript-kernel-extension/index.js +2 -2
- package/lib/jupyter/lite/kernel/index.js +4 -4
- package/lib/jupyter/lite/kernel/kernelspecs.js +1 -1
- package/lib/jupyter/lite/licenses/index.js +2 -2
- package/lib/jupyter/lite/licenses/licenses.js +1 -1
- package/lib/jupyter/lite/localforage/index.js +2 -2
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js +2 -2
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js +2 -2
- package/lib/jupyter/lite/pyodide-kernel/index.js +6 -6
- package/lib/jupyter/lite/pyodide-kernel/kernel.js +3 -3
- package/lib/jupyter/lite/pyodide-kernel-extension/index.js +3 -3
- package/lib/jupyter/lite/server/app.js +1 -1
- package/lib/jupyter/lite/server/index.js +4 -4
- package/lib/jupyter/lite/server-extension/index.js +8 -8
- package/lib/jupyter/lite/session/index.js +2 -2
- package/lib/jupyter/lite/settings/index.js +2 -2
- package/lib/jupyter/lite/translation/index.js +2 -2
- package/lib/jupyter/lite/types/index.js +1 -1
- package/lib/jupyter/renderers/index.js +1 -1
- package/lib/jupyter/renderers/plotly/index.js +1 -1
- package/lib/jupyter/services/ServiceManagerLite.js +1 -1
- package/lib/jupyter/services/index.d.ts +1 -0
- package/lib/jupyter/services/index.js +4 -3
- package/lib/jupyter/services/index.js.map +1 -1
- package/lib/jupyter/services/serviceManagerUtils.d.ts +73 -0
- package/lib/jupyter/services/serviceManagerUtils.js +132 -0
- package/lib/jupyter/services/serviceManagerUtils.js.map +1 -0
- package/lib/jupyter-context.d.ts +13 -0
- package/lib/jupyter-context.js +19 -0
- package/lib/jupyter-context.js.map +1 -0
- package/lib/lazy/JupyterSkeleton.d.ts +27 -0
- package/lib/lazy/JupyterSkeleton.js +32 -0
- package/lib/lazy/JupyterSkeleton.js.map +1 -0
- package/lib/lazy/LazyCell.d.ts +36 -0
- package/lib/lazy/LazyCell.js +46 -0
- package/lib/lazy/LazyCell.js.map +1 -0
- package/lib/lazy/LazyConsole.d.ts +26 -0
- package/lib/lazy/LazyConsole.js +32 -0
- package/lib/lazy/LazyConsole.js.map +1 -0
- package/lib/lazy/LazyNotebook.d.ts +30 -0
- package/lib/lazy/LazyNotebook.js +36 -0
- package/lib/lazy/LazyNotebook.js.map +1 -0
- package/lib/lazy/LazyOutput.d.ts +30 -0
- package/lib/lazy/LazyOutput.js +36 -0
- package/lib/lazy/LazyOutput.js.map +1 -0
- package/lib/lazy/LazyTerminal.d.ts +29 -0
- package/lib/lazy/LazyTerminal.js +35 -0
- package/lib/lazy/LazyTerminal.js.map +1 -0
- package/lib/lazy/LazyViewer.d.ts +29 -0
- package/lib/lazy/LazyViewer.js +35 -0
- package/lib/lazy/LazyViewer.js.map +1 -0
- package/lib/lazy/index.d.ts +21 -0
- package/lib/lazy/index.js +27 -0
- package/lib/lazy/index.js.map +1 -0
- package/lib/lazy-entry.d.ts +37 -0
- package/lib/lazy-entry.js +39 -0
- package/lib/lazy-entry.js.map +1 -0
- package/lib/lite-entry.d.ts +6 -0
- package/lib/lite-entry.js +14 -0
- package/lib/lite-entry.js.map +1 -0
- package/lib/notebook.d.ts +7 -0
- package/lib/notebook.js +13 -0
- package/lib/notebook.js.map +1 -0
- package/lib/output.d.ts +7 -0
- package/lib/output.js +13 -0
- package/lib/output.js.map +1 -0
- package/lib/state/JupyterReactState.js +15 -17
- package/lib/state/JupyterReactState.js.map +1 -1
- package/lib/state/index.js +1 -1
- package/lib/terminal.d.ts +7 -0
- package/lib/terminal.js +13 -0
- package/lib/terminal.js.map +1 -0
- package/lib/theme/JupyterReactTheme.js +3 -3
- package/lib/theme/index.js +6 -6
- package/lib/theme/themes/index.js +1 -1
- package/lib/theme-entry.d.ts +7 -0
- package/lib/theme-entry.js +13 -0
- package/lib/theme-entry.js.map +1 -0
- package/lib/tools/__tests__/operationRunner.test.js +8 -8
- package/lib/tools/core/executor.js +0 -6
- package/lib/tools/core/executor.js.map +1 -1
- package/lib/tools/core/index.d.ts +1 -0
- package/lib/tools/core/index.js +14 -13
- package/lib/tools/core/index.js.map +1 -1
- package/lib/tools/core/operationRunner.js +1 -1
- package/lib/tools/core/zodUtils.js +28 -0
- package/lib/tools/core/zodUtils.js.map +1 -1
- package/lib/tools/definitions/deleteCell.js +2 -2
- package/lib/tools/definitions/executeCode.js +2 -2
- package/lib/tools/definitions/index.js +7 -7
- package/lib/tools/definitions/insertCell.js +2 -2
- package/lib/tools/definitions/readAllCells.js +2 -2
- package/lib/tools/definitions/readCell.js +2 -2
- package/lib/tools/definitions/runCell.js +2 -2
- package/lib/tools/definitions/updateCell.js +2 -2
- package/lib/tools/index.js +16 -16
- package/lib/tools/operations/deleteCell.js +3 -3
- package/lib/tools/operations/executeCode.js +2 -2
- package/lib/tools/operations/insertCell.js +14 -5
- package/lib/tools/operations/insertCell.js.map +1 -1
- package/lib/tools/operations/readAllCells.js +2 -2
- package/lib/tools/operations/readCell.js +1 -1
- package/lib/tools/operations/runCell.js +3 -3
- package/lib/tools/operations/updateCell.js +2 -2
- package/lib/tools/schemas/index.js +7 -7
- package/lib/utils/Utils.js +1 -1
- package/lib/utils/index.js +2 -2
- package/lib/viewer.d.ts +7 -0
- package/lib/viewer.js +13 -0
- package/lib/viewer.js.map +1 -0
- package/package.json +129 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JupyterContext.js","sourceRoot":"","sources":["../../src/examples/JupyterContext.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD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,EACN,KAAC,OAAO,KAAG,EACX,cAAM,EACN,KAAC,OAAO,KAAG,EACX,cAAM,EACN,KAAC,eAAe,KAAG,EAClB,cAAc,IAAI,aAAa,IAAI,CAClC,KAAC,QAAQ,IACP,IAAI,EAAC,kBAAkB,EACvB,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,aAAa,GACjB,CACH,EACD,cAAM,EACN,KAAC,oBAAoB,KAAG,EACxB,cAAM,EACN,KAAC,qBAAqB,KAAG,EACzB,cAAM,EACL,cAAc,IAAI,KAAC,WAAW,IAAC,cAAc,EAAE,cAAc,GAAI,EAClE,cAAM,EACN,KAAC,QAAQ,KAAG,IACM,GACnB,CACJ,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;AAC7B,MAAM,MAAM,GAAG,WAAW,CAAC;AAE3B,IAAI,CAAC,MAAM,CAAC,KAAC,qBAAqB,KAAG,CAAC,CAAC"}
|
|
@@ -5,8 +5,8 @@ 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 { JupyterReactTheme } from '../theme';
|
|
9
|
-
import { JupyterLabApp } from '../components/jupyterlab';
|
|
8
|
+
import { JupyterReactTheme } from '../theme/index.js';
|
|
9
|
+
import { JupyterLabApp } from '../components/jupyterlab/index.js';
|
|
10
10
|
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
11
11
|
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
12
12
|
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
@@ -9,9 +9,9 @@ import { createRoot } from 'react-dom/client';
|
|
|
9
9
|
import { Box, Text, ToggleSwitch, ThemeProvider, useTheme, } from '@primer/react';
|
|
10
10
|
import { ThemeManager } from '@jupyterlab/apputils';
|
|
11
11
|
// import { NotebookTracker } from '@jupyterlab/notebook';
|
|
12
|
-
import { JupyterReactTheme } from '../theme';
|
|
13
|
-
import Lumino from '../components/lumino/Lumino';
|
|
14
|
-
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp';
|
|
12
|
+
import { JupyterReactTheme } from '../theme/index.js';
|
|
13
|
+
import Lumino from '../components/lumino/Lumino.js';
|
|
14
|
+
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp.js';
|
|
15
15
|
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
16
16
|
import * as darkThemePlugins from '@jupyterlab/theme-dark-extension';
|
|
17
17
|
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
@@ -9,9 +9,9 @@ import { createRoot } from 'react-dom/client';
|
|
|
9
9
|
import { Box, Text, ToggleSwitch, ThemeProvider, useTheme, } from '@primer/react';
|
|
10
10
|
import { ThemeManager } from '@jupyterlab/apputils';
|
|
11
11
|
// import { NotebookTracker } from '@jupyterlab/notebook';
|
|
12
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
13
|
-
import Lumino from '../components/lumino/Lumino';
|
|
14
|
-
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp';
|
|
12
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
13
|
+
import Lumino from '../components/lumino/Lumino.js';
|
|
14
|
+
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp.js';
|
|
15
15
|
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
16
16
|
import * as darkThemePlugins from '@jupyterlab/theme-dark-extension';
|
|
17
17
|
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
@@ -5,12 +5,12 @@ 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 { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
9
|
-
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp';
|
|
8
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
9
|
+
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp.js';
|
|
10
10
|
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
11
11
|
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
12
12
|
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
13
|
-
// import * as reactPlugins from './../jupyter/lab/index';
|
|
13
|
+
// import * as reactPlugins from './../jupyter/lab/index.js';
|
|
14
14
|
import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
15
15
|
const JupyterLabAppServerlessExample = () => {
|
|
16
16
|
const onJupyterLab = async (jupyterLabAdapter) => {
|
|
@@ -6,13 +6,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
10
|
-
import { ServiceManagerLess } from '../jupyter';
|
|
11
|
-
import { JupyterLabApp } from '../components/jupyterlab';
|
|
9
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
10
|
+
import { ServiceManagerLess } from '../jupyter/index.js';
|
|
11
|
+
import { JupyterLabApp } from '../components/jupyterlab/index.js';
|
|
12
12
|
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
13
13
|
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
14
14
|
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
15
|
-
// import * as reactPlugins from './../jupyter/lab/plugin';
|
|
15
|
+
// import * as reactPlugins from './../jupyter/lab/plugin.js';
|
|
16
16
|
import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
17
17
|
const JupyterLabAppServiceManagerExample = () => {
|
|
18
18
|
const [serviceManager, _] = useState(new ServiceManagerLess());
|
|
@@ -10,8 +10,8 @@ import { Button, Heading, Text, Link, PageLayout, PageHeader, RadioGroup, Radio,
|
|
|
10
10
|
import { DataTable, Table, SkeletonBox, Banner, } from '@primer/react/experimental';
|
|
11
11
|
import { GitCommitIcon, HeartIcon, RocketIcon, CheckIcon, } from '@primer/octicons-react';
|
|
12
12
|
import { Box } from '@datalayer/primer-addons';
|
|
13
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
14
|
-
import { jupyterLabTheme as theme } from '../theme/themes';
|
|
13
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
14
|
+
import { jupyterLabTheme as theme } from '../theme/themes/index.js';
|
|
15
15
|
const mockTokens = [
|
|
16
16
|
{ text: 'zero', id: 0 },
|
|
17
17
|
{ text: 'one', id: 1 },
|
|
@@ -8,9 +8,9 @@ import { useState } from 'react';
|
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Heading, Textarea, Button } from '@primer/react';
|
|
10
10
|
import { Box } from '@datalayer/primer-addons';
|
|
11
|
-
import { useJupyter } from '../jupyter/JupyterUse';
|
|
12
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
13
|
-
import { KernelProgressBar } from './../components/kernel/KernelProgressBar';
|
|
11
|
+
import { useJupyter } from '../jupyter/JupyterUse.js';
|
|
12
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
13
|
+
import { KernelProgressBar } from './../components/kernel/KernelProgressBar.js';
|
|
14
14
|
export const KernelExecuteExample = () => {
|
|
15
15
|
const { defaultKernel } = useJupyter({ startDefaultKernel: true });
|
|
16
16
|
const [running, setRunning] = useState(false);
|
|
@@ -8,10 +8,10 @@ import { useState } from 'react';
|
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Heading, Textarea, Button } from '@primer/react';
|
|
10
10
|
import { Box } from '@datalayer/primer-addons';
|
|
11
|
-
import { useJupyter } from '../jupyter/JupyterUse';
|
|
12
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
13
|
-
import { KernelIndicator } from '../components/kernel/KernelIndicator';
|
|
14
|
-
import { KernelProgressBar } from '../components/kernel/KernelProgressBar';
|
|
11
|
+
import { useJupyter } from '../jupyter/JupyterUse.js';
|
|
12
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
13
|
+
import { KernelIndicator } from '../components/kernel/KernelIndicator.js';
|
|
14
|
+
import { KernelProgressBar } from '../components/kernel/KernelProgressBar.js';
|
|
15
15
|
export const KernelExecuteLiteExample = () => {
|
|
16
16
|
const { defaultKernel } = useJupyter({
|
|
17
17
|
startDefaultKernel: true,
|
|
@@ -8,9 +8,9 @@ import { useEffect, useState } from 'react';
|
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Heading, Text } from '@primer/react';
|
|
10
10
|
import { Box } from '@datalayer/primer-addons';
|
|
11
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import { useJupyter } from '../jupyter/JupyterUse';
|
|
13
|
-
import { Output } from '../components/output/Output';
|
|
11
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
12
|
+
import { useJupyter } from '../jupyter/JupyterUse.js';
|
|
13
|
+
import { Output } from '../components/output/Output.js';
|
|
14
14
|
const CODE = `import sys
|
|
15
15
|
print(sys.platform)
|
|
16
16
|
|
|
@@ -8,10 +8,10 @@ import { useEffect, useState } from 'react';
|
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Heading, Text } from '@primer/react';
|
|
10
10
|
import { Box } from '@datalayer/primer-addons';
|
|
11
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import { useJupyter } from '../jupyter/JupyterUse';
|
|
13
|
-
import { Output } from '../components/output/Output';
|
|
14
|
-
import { KernelIndicator } from '../components/kernel/KernelIndicator';
|
|
11
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
12
|
+
import { useJupyter } from '../jupyter/JupyterUse.js';
|
|
13
|
+
import { Output } from '../components/output/Output.js';
|
|
14
|
+
import { KernelIndicator } from '../components/kernel/KernelIndicator.js';
|
|
15
15
|
const CODE = `import sys
|
|
16
16
|
print(sys.platform)
|
|
17
17
|
|
package/lib/examples/Kernels.js
CHANGED
|
@@ -8,9 +8,9 @@ import { createRoot } from 'react-dom/client';
|
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import { Heading, Textarea, Button, Text } from '@primer/react';
|
|
10
10
|
import { Box } from '@datalayer/primer-addons';
|
|
11
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import { useJupyter } from '../jupyter/JupyterUse';
|
|
13
|
-
import { KERNEL_STATES, KernelProgressBar, KernelIndicator, KernelActionMenu, KernelSelector, KernelUsage, KernelInspector, KernelLauncher, KernelVariables, KernelLogs, Kernels, } from './../components/kernel';
|
|
11
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
12
|
+
import { useJupyter } from '../jupyter/JupyterUse.js';
|
|
13
|
+
import { KERNEL_STATES, KernelProgressBar, KernelIndicator, KernelActionMenu, KernelSelector, KernelUsage, KernelInspector, KernelLauncher, KernelVariables, KernelLogs, Kernels, } from './../components/kernel/index.js';
|
|
14
14
|
export const KernelExecResultView = () => {
|
|
15
15
|
const { defaultKernel: kernel } = useJupyter({ startDefaultKernel: true });
|
|
16
16
|
const [running, setRunning] = useState(false);
|
package/lib/examples/Lumino.js
CHANGED
|
@@ -6,8 +6,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import LuminoBox from '../components/lumino/LuminoBox';
|
|
10
|
-
import LuminoWidget from './lumino/LuminoWidget';
|
|
9
|
+
import LuminoBox from '../components/lumino/LuminoBox.js';
|
|
10
|
+
import LuminoWidget from './lumino/LuminoWidget.js';
|
|
11
11
|
export const LuminoExample = () => {
|
|
12
12
|
const luminoWidget = useMemo(() => new LuminoWidget(), []);
|
|
13
13
|
return _jsx(LuminoBox, { height: "100px", children: luminoWidget.panel });
|
|
@@ -6,11 +6,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { JupyterLabCss, JupyterReactTheme } from '../theme';
|
|
10
|
-
import { useJupyter } from '../jupyter';
|
|
11
|
-
import { CellSidebarExtension } from '../components';
|
|
12
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
13
|
-
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
9
|
+
import { JupyterLabCss, JupyterReactTheme } from '../theme/index.js';
|
|
10
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
11
|
+
import { CellSidebarExtension } from '../components/index.js';
|
|
12
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
13
|
+
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar.js';
|
|
14
14
|
import NBFORMAT from './notebooks/Matplotlib.ipynb.json';
|
|
15
15
|
const MatplotlibExample = () => {
|
|
16
16
|
const { serviceManager, defaultKernel } = useJupyter({
|
package/lib/examples/Notebook.js
CHANGED
|
@@ -7,10 +7,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
11
|
-
import { useJupyter } from '../jupyter';
|
|
12
|
-
import { CellSidebarExtension, CellSidebarButton, KernelIndicator, Notebook, } from '../components';
|
|
13
|
-
import { CellToolbarExtension } from './extensions';
|
|
10
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
11
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
12
|
+
import { CellSidebarExtension, CellSidebarButton, KernelIndicator, Notebook, } from '../components/index.js';
|
|
13
|
+
import { CellToolbarExtension } from './extensions/index.js';
|
|
14
14
|
import NBFORMAT from './notebooks/NotebookExample1.ipynb.json';
|
|
15
15
|
const NotebookExample = () => {
|
|
16
16
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notebook.js","sourceRoot":"","sources":["../../src/examples/Notebook.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAE/D,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;QACnD,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,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC;QACJ,IAAI,oBAAoB,EAAE;QAC1B,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;KACzD,EACD,EAAE,CACH,CAAC;IACF,OAAO,CACL,KAAC,iBAAiB,cACf,cAAc,IAAI,aAAa,IAAI,CAClC,8BACE,KAAC,GAAG,cACF,KAAC,eAAe,IACd,MAAM,EAAE,aAAa,EAAE,UAAU,EACjC,KAAK,EAAC,kBAAkB,GACxB,GACE,EACN,KAAC,QAAQ,IACP,QAAQ,EAAE,QAA4B,EACtC,EAAE,EAAC,uBAAuB,EAC1B,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;sBAC3D,UAAU,EAAE,UAAU,GACtB,IACD,CACJ,GACiB,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"}
|
|
@@ -8,22 +8,22 @@ import { useMemo } from 'react';
|
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { ActionBar } from '@primer/react/experimental';
|
|
10
10
|
import { ChevronDownIcon, ChevronUpIcon, PlayIcon, } from '@primer/octicons-react';
|
|
11
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import { useJupyter } from '../jupyter';
|
|
13
|
-
import { useNotebookStore, Notebook, CellSidebarExtension, CellSidebarButton, } from '../components';
|
|
14
|
-
import { CellToolbarExtension } from './extensions';
|
|
11
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
12
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
13
|
+
import { useNotebookStore, Notebook, CellSidebarExtension, CellSidebarButton, } from '../components/index.js';
|
|
14
|
+
import { CellToolbarExtension } from './extensions/index.js';
|
|
15
15
|
import NBFORMAT from './notebooks/NotebookExample1.ipynb.json';
|
|
16
16
|
const NOTEBOOK_ID = 'notebook-nbformat-id';
|
|
17
17
|
const NotebookActionsExample = () => {
|
|
18
18
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
19
19
|
startDefaultKernel: true,
|
|
20
20
|
});
|
|
21
|
-
const
|
|
21
|
+
const notebookStore = useNotebookStore();
|
|
22
22
|
const extensions = useMemo(() => [
|
|
23
23
|
new CellToolbarExtension(),
|
|
24
24
|
new CellSidebarExtension({ factory: CellSidebarButton }),
|
|
25
25
|
], []);
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ActionBar, { "aria-label": "Toolbar", children: [_jsx(ActionBar.IconButton, { icon: PlayIcon, "aria-label": "Run", onClick: () =>
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ActionBar, { "aria-label": "Toolbar", children: [_jsx(ActionBar.IconButton, { icon: PlayIcon, "aria-label": "Run", onClick: () => notebookStore.run(NOTEBOOK_ID) }), _jsx(ActionBar.Divider, {}), _jsx(ActionBar.IconButton, { icon: ChevronUpIcon, "aria-label": "Insert Code", onClick: () => notebookStore.insertAbove(NOTEBOOK_ID, 'code') }), _jsx(ActionBar.IconButton, { icon: ChevronDownIcon, "aria-label": "Insert Code", onClick: () => notebookStore.insertBelow(NOTEBOOK_ID, 'code') })] }), _jsx(JupyterReactTheme, { children: serviceManager && defaultKernel && (_jsx(Notebook, { id: NOTEBOOK_ID, nbformat: NBFORMAT, serviceManager: serviceManager, kernel: defaultKernel, height: "calc(100vh - 2.6rem)" // (Height - Toolbar Height).
|
|
27
27
|
, extensions: extensions })) })] }));
|
|
28
28
|
};
|
|
29
29
|
const div = document.createElement('div');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookActions.js","sourceRoot":"","sources":["../../src/examples/NotebookActions.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,aAAa,EACb,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAE/D,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,GAAG,EAAE;IAClC,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;QACnD,kBAAkB,EAAE,IAAI;KACzB,CAAC,CAAC;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"NotebookActions.js","sourceRoot":"","sources":["../../src/examples/NotebookActions.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,aAAa,EACb,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,E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AE,EAAE,WAAW,EACf,QAAQ,EAAE,QAA4B,EACtC,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;sBAC3D,UAAU,EAAE,UAAU,GACtB,CACH,GACiB,IACnB,CACJ,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,sBAAsB,KAAG,CAAC,CAAC"}
|
|
@@ -6,12 +6,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { useJupyter } from '../jupyter';
|
|
10
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
11
|
-
import { CellSidebarExtension } from '../components';
|
|
12
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
13
|
-
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
14
|
-
import { CellSidebarSource } from './extensions/cellsidebars/CellSidebarSource';
|
|
9
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
10
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
11
|
+
import { CellSidebarExtension } from '../components/index.js';
|
|
12
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
13
|
+
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar.js';
|
|
14
|
+
import { CellSidebarSource } from './extensions/cellsidebars/CellSidebarSource.js';
|
|
15
15
|
import NBFORMAT from './notebooks/NotebookExample1.ipynb.json';
|
|
16
16
|
const NotebookCellSidebarExample = () => {
|
|
17
17
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { createRoot } from 'react-dom/client';
|
|
4
|
-
import { useJupyter } from '../jupyter';
|
|
5
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
6
|
-
import { CellSidebarExtension } from '../components';
|
|
7
|
-
import { CellSidebarButton } from '../components/notebook/cell/sidebar/CellSidebarButton';
|
|
8
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
9
|
-
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
10
|
-
import { CellToolbarExtension } from './extensions';
|
|
4
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
5
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
6
|
+
import { CellSidebarExtension } from '../components/index.js';
|
|
7
|
+
import { CellSidebarButton } from '../components/notebook/cell/sidebar/CellSidebarButton.js';
|
|
8
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
9
|
+
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar.js';
|
|
10
|
+
import { CellToolbarExtension } from './extensions/index.js';
|
|
11
11
|
import NBFORMAT from './notebooks/NotebookExample1.ipynb.json';
|
|
12
12
|
const NotebookCellToolbarExample = () => {
|
|
13
13
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
@@ -6,9 +6,9 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
10
|
-
import { useJupyter, JupyterCollaborationProvider } from '../jupyter';
|
|
11
|
-
import { Notebook, CellSidebarExtension, CellSidebarButton, } from '../components';
|
|
9
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
10
|
+
import { useJupyter, JupyterCollaborationProvider } from '../jupyter/index.js';
|
|
11
|
+
import { Notebook, CellSidebarExtension, CellSidebarButton, } from '../components/index.js';
|
|
12
12
|
const NotebookCollaborativeExample = () => {
|
|
13
13
|
const { serviceManager } = useJupyter();
|
|
14
14
|
const extensions = useMemo(() => [new CellSidebarExtension({ factory: CellSidebarButton })], []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookCollaborative.js","sourceRoot":"","sources":["../../src/examples/NotebookCollaborative.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,MAAM,4BAA4B,GAAG,GAAG,EAAE;IACxC,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,CAAC,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC,EAChE,EAAE,CACH,CAAC;
|
|
1
|
+
{"version":3,"file":"NotebookCollaborative.js","sourceRoot":"","sources":["../../src/examples/NotebookCollaborative.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,MAAM,4BAA4B,GAAG,GAAG,EAAE;IACxC,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,CAAC,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC,EAChE,EAAE,CACH,CAAC;IACF,MAAM,qBAAqB,GAAG,OAAO,CACnC,GAAG,EAAE,CAAC,IAAI,4BAA4B,EAAE,EACxC,EAAE,CACH,CAAC;IACF,OAAO,cAAc,CAAC,CAAC,CAAC,CACtB,KAAC,iBAAiB,cAChB,KAAC,QAAQ,IACP,IAAI,EAAC,qBAAqB,EAC1B,EAAE,EAAC,4BAA4B,EAC/B,kBAAkB,QAClB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,GAS5C,GACgB,CACrB,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,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,4BAA4B,KAAG,CAAC,CAAC"}
|
|
@@ -7,12 +7,12 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Text, ToggleSwitch } from '@primer/react';
|
|
10
|
-
import { useJupyter } from '../jupyter';
|
|
11
|
-
import { JupyterReactTheme } from '../theme';
|
|
12
|
-
import { CellSidebarExtension } from '../components';
|
|
13
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
14
|
-
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
15
|
-
import { useJupyterReactStore } from '../state';
|
|
10
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
11
|
+
import { JupyterReactTheme } from '../theme/index.js';
|
|
12
|
+
import { CellSidebarExtension } from '../components/index.js';
|
|
13
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
14
|
+
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar.js';
|
|
15
|
+
import { useJupyterReactStore } from '../state/index.js';
|
|
16
16
|
import NBFORMAT from './notebooks/NotebookExample1.ipynb.json';
|
|
17
17
|
const NotebookColormodeExample = () => {
|
|
18
18
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
@@ -6,10 +6,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { Notebook, CellSidebarExtension, CellSidebarButton, NotebookToolbar, } from '../components';
|
|
10
|
-
import { JupyterReactTheme } from '../theme';
|
|
11
|
-
import { useJupyter } from '../jupyter';
|
|
12
|
-
import { ExecTimeExtension } from './extensions';
|
|
9
|
+
import { Notebook, CellSidebarExtension, CellSidebarButton, NotebookToolbar, } from '../components/index.js';
|
|
10
|
+
import { JupyterReactTheme } from '../theme/index.js';
|
|
11
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
12
|
+
import { ExecTimeExtension } from './extensions/index.js';
|
|
13
13
|
import NBFORMAT from './notebooks/NotebookExample1.ipynb.json';
|
|
14
14
|
const NotebookExtensionExample = () => {
|
|
15
15
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
@@ -8,11 +8,11 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { ZapIcon } from '@primer/octicons-react';
|
|
10
10
|
import { IconButton } from '@primer/react';
|
|
11
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import { useJupyter } from '../jupyter';
|
|
13
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
14
|
-
// import { notebookStore } from '../components/notebook/NotebookState';
|
|
15
|
-
import { CellSidebarExtension } from '../components';
|
|
11
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
12
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
13
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
14
|
+
// import { notebookStore } from '../components/notebook/NotebookState.js';
|
|
15
|
+
import { CellSidebarExtension } from '../components/index.js';
|
|
16
16
|
import NBMODEL from './notebooks/NotebookExample1.ipynb.json';
|
|
17
17
|
const NOTEBOOK_ID = 'notebook-model-id';
|
|
18
18
|
const NotebookExternalContentExample = () => {
|
|
@@ -6,15 +6,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useEffect, useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { useJupyter } from '../jupyter';
|
|
10
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
11
|
-
import { CellSidebarExtension, Notebook } from '../components';
|
|
12
|
-
import { useNotebookStore } from '../components/notebook/NotebookState';
|
|
13
|
-
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
9
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
10
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
11
|
+
import { CellSidebarExtension, Notebook } from '../components/index.js';
|
|
12
|
+
import { useNotebookStore } from '../components/notebook/NotebookState.js';
|
|
13
|
+
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar.js';
|
|
14
14
|
const NOTEBOOK_ID = 'notebook';
|
|
15
15
|
const NOTEBOOK_WIDTH = '100%';
|
|
16
16
|
const NOTEBOOK_HEIGHT = 500;
|
|
17
|
-
|
|
17
|
+
let IS_INITIALIZED = false;
|
|
18
18
|
const NotebookInitExample = () => {
|
|
19
19
|
const { serviceManager, defaultKernel } = useJupyter({
|
|
20
20
|
startDefaultKernel: true,
|
|
@@ -24,20 +24,14 @@ const NotebookInitExample = () => {
|
|
|
24
24
|
const extensions = useMemo(() => [new CellSidebarExtension()], []);
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
if (notebook && !IS_INITIALIZED) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
id: NOTEBOOK_ID,
|
|
35
|
-
cellType: 'code',
|
|
36
|
-
source: 'print("Hello 🪐 ⚛️ Jupyter React")',
|
|
37
|
-
});
|
|
38
|
-
}
|
|
27
|
+
notebook.adapter?.panel?.model?.contentChanged.connect(_ => {
|
|
28
|
+
if (!IS_INITIALIZED) {
|
|
29
|
+
IS_INITIALIZED = true;
|
|
30
|
+
// console.log("You can use one of these commands:", notebook.adapter?.commands.listCommands());
|
|
31
|
+
// notebook.adapter?.commands.execute("notebook:run-all");
|
|
32
|
+
notebookStore.insertAbove(NOTEBOOK_ID, 'code', 'print("Hello 🪐 ⚛️ Jupyter React")');
|
|
33
|
+
}
|
|
39
34
|
});
|
|
40
|
-
*/
|
|
41
35
|
}
|
|
42
36
|
}, [defaultKernel, notebook]);
|
|
43
37
|
return (_jsx(JupyterReactTheme, { children: _jsx("div", { style: { width: NOTEBOOK_WIDTH, height: NOTEBOOK_HEIGHT }, children: serviceManager && defaultKernel && (_jsx(Notebook, { path: "ipywidgets.ipynb", id: NOTEBOOK_ID, kernel: defaultKernel, serviceManager: serviceManager, height: `calc(${NOTEBOOK_HEIGHT}px - 2.6rem)`, extensions: extensions, Toolbar: NotebookToolbar })) }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookInit.js","sourceRoot":"","sources":["../../src/examples/NotebookInit.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,
|
|
1
|
+
{"version":3,"file":"NotebookInit.js","sourceRoot":"","sources":["../../src/examples/NotebookInit.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,IAAI,cAAc,GAAG,K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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"}
|
|
@@ -6,18 +6,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { useJupyter } from '../jupyter';
|
|
10
|
-
import { JupyterReactTheme } from '../theme';
|
|
11
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
12
|
-
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar';
|
|
13
|
-
import { CellSidebarButton } from '../components/notebook/cell/sidebar/CellSidebarButton';
|
|
14
|
-
import { CellSidebarExtension } from '../components/notebook/cell/sidebar/CellSidebarExtension';
|
|
9
|
+
import { useJupyter } from '../jupyter/index.js';
|
|
10
|
+
import { JupyterReactTheme } from '../theme/index.js';
|
|
11
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
12
|
+
import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar.js';
|
|
13
|
+
import { CellSidebarButton } from '../components/notebook/cell/sidebar/CellSidebarButton.js';
|
|
14
|
+
import { CellSidebarExtension } from '../components/notebook/cell/sidebar/CellSidebarExtension.js';
|
|
15
15
|
const NotebookKernelExample = () => {
|
|
16
|
-
const { serviceManager
|
|
17
|
-
startDefaultKernel:
|
|
16
|
+
const { serviceManager } = useJupyter({
|
|
17
|
+
startDefaultKernel: false,
|
|
18
18
|
});
|
|
19
19
|
const extensions = useMemo(() => [new CellSidebarExtension({ factory: CellSidebarButton })], []);
|
|
20
|
-
return (_jsx(JupyterReactTheme, { children: serviceManager &&
|
|
20
|
+
return (_jsx(JupyterReactTheme, { children: serviceManager && (_jsx(Notebook, { path: "ipywidgets.ipynb", id: "notebook-kernel-id", startDefaultKernel: true, serviceManager: serviceManager, height: "calc(100vh - 2.6rem)" // (Height - Toolbar Height).
|
|
21
21
|
, extensions: extensions, Toolbar: NotebookToolbar })) }));
|
|
22
22
|
};
|
|
23
23
|
const div = document.createElement('div');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookKernel.js","sourceRoot":"","sources":["../../src/examples/NotebookKernel.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAEhG,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"NotebookKernel.js","sourceRoot":"","sources":["../../src/examples/NotebookKernel.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAEhG,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;QACpC,kBAAkB,EAAE,KAAK;KAC1B,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,CAAC,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC,EAChE,EAAE,CACH,CAAC;IACF,OAAO,CACL,KAAC,iBAAiB,cACf,cAAc,IAAI,CACjB,KAAC,QAAQ,IACP,IAAI,EAAC,kBAAkB,EACvB,EAAE,EAAC,oBAAoB,EACvB,kBAAkB,QAClB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,eAAe,GACxB,CACH,GACiB,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,qBAAqB,KAAG,CAAC,CAAC"}
|
|
@@ -4,27 +4,37 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
*
|
|
5
5
|
* MIT License
|
|
6
6
|
*/
|
|
7
|
-
import { useMemo, useState } from 'react';
|
|
7
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Button, Flash } from '@primer/react';
|
|
10
10
|
import { Box } from '@datalayer/primer-addons';
|
|
11
|
-
import { JupyterReactTheme } from '../theme/JupyterReactTheme';
|
|
12
|
-
import { useJupyter } from '../jupyter/JupyterUse';
|
|
13
|
-
import { Kernel } from '../jupyter/kernel/Kernel';
|
|
14
|
-
import { CellSidebarExtension } from '../components';
|
|
15
|
-
import { Notebook } from '../components/notebook/Notebook';
|
|
16
|
-
|
|
11
|
+
import { JupyterReactTheme } from '../theme/JupyterReactTheme.js';
|
|
12
|
+
import { useJupyter } from '../jupyter/JupyterUse.js';
|
|
13
|
+
import { Kernel } from '../jupyter/kernel/Kernel.js';
|
|
14
|
+
import { CellSidebarExtension } from '../components/index.js';
|
|
15
|
+
import { Notebook } from '../components/notebook/Notebook.js';
|
|
16
|
+
import { useNotebookStore } from '../components/notebook/NotebookState.js';
|
|
17
17
|
const NOTEBOOK_ID = 'notebook-kernel-change-id';
|
|
18
|
-
|
|
18
|
+
const PYTHON_KERNEL_NAME = 'python';
|
|
19
19
|
const DENO_KERNEL_NAME = 'deno';
|
|
20
20
|
const NotebookKernelChangeExample = () => {
|
|
21
21
|
const { kernelManager, serviceManager, defaultKernel } = useJupyter({
|
|
22
22
|
startDefaultKernel: true,
|
|
23
23
|
});
|
|
24
|
-
const [message,
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const [message, setMessage] = useState('');
|
|
25
|
+
const [kernelLanguage, setKernelLanguage] = useState();
|
|
26
|
+
const notebookStore = useNotebookStore();
|
|
27
|
+
const notebook = notebookStore.selectNotebook(NOTEBOOK_ID);
|
|
27
28
|
const extensions = useMemo(() => [new CellSidebarExtension()], []);
|
|
29
|
+
// Fetch kernel info when adapter is available
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const adapter = notebook?.adapter;
|
|
32
|
+
if (adapter) {
|
|
33
|
+
adapter.fetchKernelInfo().then(info => {
|
|
34
|
+
setKernelLanguage(info?.language_info?.name);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}, [notebook?.adapter, notebook?.adapter?.kernel]);
|
|
28
38
|
const changeKernel = () => {
|
|
29
39
|
if (kernelManager && serviceManager) {
|
|
30
40
|
const newKernel = new Kernel({
|
|
@@ -35,16 +45,12 @@ const NotebookKernelChangeExample = () => {
|
|
|
35
45
|
sessionManager: serviceManager.sessions,
|
|
36
46
|
});
|
|
37
47
|
newKernel.ready.then(() => {
|
|
38
|
-
/*
|
|
39
48
|
notebookStore.changeKernel({ id: NOTEBOOK_ID, kernel: newKernel });
|
|
40
|
-
setMessage(
|
|
41
|
-
`🥺 Bummer, all your variables are lost! The kernel was ${PYTHON_KERNEL_NAME} and is now ${DENO_KERNEL_NAME}). Try with: import pl from "npm:nodejs-polars";`
|
|
42
|
-
);
|
|
43
|
-
*/
|
|
49
|
+
setMessage(`🥺 Bummer, all your variables are lost! The kernel was ${PYTHON_KERNEL_NAME} and is now ${DENO_KERNEL_NAME}). Try with: import pl from "npm:nodejs-polars";`);
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
52
|
};
|
|
47
|
-
return (_jsxs(JupyterReactTheme, { children: [_jsxs(Box, { display: "flex", children: [_jsx(Box, { children: _jsx(Button, { variant: "default", size: "small", onClick: changeKernel, children: "Assign another Kernel" }) }), _jsxs(Box, { ml: 3, children: ["Kernel ID: ", defaultKernel?.id] })] }), message && (_jsx(Box, { children: _jsx(Flash, { children: message }) })), serviceManager && defaultKernel && (_jsx(Notebook, { id: NOTEBOOK_ID, kernel: defaultKernel, serviceManager: serviceManager, path: "test.ipynb", height: "500px", extensions: extensions }))] }));
|
|
53
|
+
return (_jsxs(JupyterReactTheme, { children: [_jsxs(Box, { display: "flex", children: [_jsx(Box, { children: _jsx(Button, { variant: "default", size: "small", onClick: changeKernel, children: "Assign another Kernel" }) }), _jsxs(Box, { ml: 3, children: ["Kernel ID: ", defaultKernel?.id] }), _jsxs(Box, { ml: 3, children: ["Kernel Client ID: ", notebook?.adapter?.kernel?.clientId] }), _jsxs(Box, { ml: 3, children: ["Kernel Session ID: ", notebook?.adapter?.sessionContext?.session?.id] }), _jsxs(Box, { ml: 3, children: ["Kernel Language: ", kernelLanguage] })] }), message && (_jsx(Box, { children: _jsx(Flash, { children: message }) })), serviceManager && defaultKernel && (_jsx(Notebook, { id: NOTEBOOK_ID, kernel: defaultKernel, serviceManager: serviceManager, path: "test.ipynb", height: "500px", extensions: extensions }))] }));
|
|
48
54
|
};
|
|
49
55
|
const div = document.createElement('div');
|
|
50
56
|
document.body.appendChild(div);
|