@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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { lazy, Suspense } from 'react';
|
|
8
|
+
import { JupyterSkeleton } from './JupyterSkeleton.js';
|
|
9
|
+
/**
|
|
10
|
+
* Lazy-loaded Viewer component
|
|
11
|
+
*/
|
|
12
|
+
const ViewerImpl = lazy(() => import('../components/viewer/Viewer').then(module => ({
|
|
13
|
+
default: module.Viewer,
|
|
14
|
+
})));
|
|
15
|
+
/**
|
|
16
|
+
* Lazy-loaded Viewer component with built-in Suspense boundary
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <LazyViewer
|
|
21
|
+
* nbformat={notebookContent}
|
|
22
|
+
* outputs={true}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const LazyViewer = ({ fallback, skeletonHeight = '300px', ...viewerProps }) => {
|
|
27
|
+
const defaultFallback = (_jsx(JupyterSkeleton, { height: skeletonHeight, componentType: "viewer" }));
|
|
28
|
+
return (_jsx(Suspense, { fallback: fallback ?? defaultFallback, children: _jsx(ViewerImpl, { ...viewerProps }) }));
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Raw lazy Viewer component without Suspense boundary
|
|
32
|
+
*/
|
|
33
|
+
export const LazyViewerRaw = ViewerImpl;
|
|
34
|
+
export default LazyViewer;
|
|
35
|
+
//# sourceMappingURL=LazyViewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyViewer.js","sourceRoot":"","sources":["../../src/lazy/LazyViewer.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAC3B,MAAM,CAAC,6BAA6B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAC,CACJ,CAAC;AAaF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAA+B,CAAC,EACrD,QAAQ,EACR,cAAc,GAAG,OAAO,EACxB,GAAG,WAAW,EACf,EAAE,EAAE;IACH,MAAM,eAAe,GAAG,CACtB,KAAC,eAAe,IAAC,MAAM,EAAE,cAAc,EAAE,aAAa,EAAC,QAAQ,GAAG,CACnE,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,IAAI,eAAe,YAC7C,KAAC,UAAU,OAAK,WAAW,GAAI,GACtB,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AAExC,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy-loaded components for code splitting
|
|
3
|
+
*
|
|
4
|
+
* This module provides React.lazy wrappers around heavy Jupyter components.
|
|
5
|
+
* Use these when you want to enable proper code splitting and reduce initial
|
|
6
|
+
* bundle size.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { LazyCell, LazyNotebook } from '@datalayer/jupyter-react/lazy';
|
|
10
|
+
*
|
|
11
|
+
* <Suspense fallback={<JupyterSkeleton />}>
|
|
12
|
+
* <LazyCell source="print('hello')" />
|
|
13
|
+
* </Suspense>
|
|
14
|
+
*/
|
|
15
|
+
export * from './LazyCell';
|
|
16
|
+
export * from './LazyNotebook';
|
|
17
|
+
export * from './LazyOutput';
|
|
18
|
+
export * from './LazyTerminal';
|
|
19
|
+
export * from './LazyConsole';
|
|
20
|
+
export * from './LazyViewer';
|
|
21
|
+
export * from './JupyterSkeleton';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Lazy-loaded components for code splitting
|
|
8
|
+
*
|
|
9
|
+
* This module provides React.lazy wrappers around heavy Jupyter components.
|
|
10
|
+
* Use these when you want to enable proper code splitting and reduce initial
|
|
11
|
+
* bundle size.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* import { LazyCell, LazyNotebook } from '@datalayer/jupyter-react/lazy';
|
|
15
|
+
*
|
|
16
|
+
* <Suspense fallback={<JupyterSkeleton />}>
|
|
17
|
+
* <LazyCell source="print('hello')" />
|
|
18
|
+
* </Suspense>
|
|
19
|
+
*/
|
|
20
|
+
export * from './LazyCell.js';
|
|
21
|
+
export * from './LazyNotebook.js';
|
|
22
|
+
export * from './LazyOutput.js';
|
|
23
|
+
export * from './LazyTerminal.js';
|
|
24
|
+
export * from './LazyConsole.js';
|
|
25
|
+
export * from './LazyViewer.js';
|
|
26
|
+
export * from './JupyterSkeleton.js';
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lazy/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy entry point - code-split components
|
|
3
|
+
*
|
|
4
|
+
* This entry point provides React.lazy wrapped components that enable
|
|
5
|
+
* proper code splitting. Each component is loaded on-demand when first
|
|
6
|
+
* rendered.
|
|
7
|
+
*
|
|
8
|
+
* Use with the core entry point for optimal bundle size:
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { JupyterReactTheme } from '@datalayer/jupyter-react/core';
|
|
13
|
+
* import { LazyCell, LazyNotebook, JupyterSkeleton } from '@datalayer/jupyter-react/lazy';
|
|
14
|
+
*
|
|
15
|
+
* function App() {
|
|
16
|
+
* return (
|
|
17
|
+
* <JupyterReactTheme>
|
|
18
|
+
* <LazyCell source="print('Hello!')" />
|
|
19
|
+
* <LazyNotebook id="nb" serviceManager={sm} />
|
|
20
|
+
* </JupyterReactTheme>
|
|
21
|
+
* );
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export { LazyCell, LazyCellRaw } from './lazy/LazyCell';
|
|
26
|
+
export { LazyNotebook, LazyNotebookRaw } from './lazy/LazyNotebook';
|
|
27
|
+
export { LazyOutput, LazyOutputRaw } from './lazy/LazyOutput';
|
|
28
|
+
export { LazyTerminal, LazyTerminalRaw } from './lazy/LazyTerminal';
|
|
29
|
+
export { LazyConsole, LazyConsoleRaw } from './lazy/LazyConsole';
|
|
30
|
+
export { LazyViewer, LazyViewerRaw } from './lazy/LazyViewer';
|
|
31
|
+
export { JupyterSkeleton, type IJupyterSkeletonProps, } from './lazy/JupyterSkeleton';
|
|
32
|
+
export type { ILazyCellProps } from './lazy/LazyCell';
|
|
33
|
+
export type { ILazyNotebookProps } from './lazy/LazyNotebook';
|
|
34
|
+
export type { ILazyOutputProps } from './lazy/LazyOutput';
|
|
35
|
+
export type { ILazyTerminalProps } from './lazy/LazyTerminal';
|
|
36
|
+
export type { ILazyConsoleProps } from './lazy/LazyConsole';
|
|
37
|
+
export type { ILazyViewerProps } from './lazy/LazyViewer';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Lazy entry point - code-split components
|
|
8
|
+
*
|
|
9
|
+
* This entry point provides React.lazy wrapped components that enable
|
|
10
|
+
* proper code splitting. Each component is loaded on-demand when first
|
|
11
|
+
* rendered.
|
|
12
|
+
*
|
|
13
|
+
* Use with the core entry point for optimal bundle size:
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { JupyterReactTheme } from '@datalayer/jupyter-react/core';
|
|
18
|
+
* import { LazyCell, LazyNotebook, JupyterSkeleton } from '@datalayer/jupyter-react/lazy';
|
|
19
|
+
*
|
|
20
|
+
* function App() {
|
|
21
|
+
* return (
|
|
22
|
+
* <JupyterReactTheme>
|
|
23
|
+
* <LazyCell source="print('Hello!')" />
|
|
24
|
+
* <LazyNotebook id="nb" serviceManager={sm} />
|
|
25
|
+
* </JupyterReactTheme>
|
|
26
|
+
* );
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
// Lazy-loaded components with built-in Suspense
|
|
31
|
+
export { LazyCell, LazyCellRaw } from './lazy/LazyCell.js';
|
|
32
|
+
export { LazyNotebook, LazyNotebookRaw } from './lazy/LazyNotebook.js';
|
|
33
|
+
export { LazyOutput, LazyOutputRaw } from './lazy/LazyOutput.js';
|
|
34
|
+
export { LazyTerminal, LazyTerminalRaw } from './lazy/LazyTerminal.js';
|
|
35
|
+
export { LazyConsole, LazyConsoleRaw } from './lazy/LazyConsole.js';
|
|
36
|
+
export { LazyViewer, LazyViewerRaw } from './lazy/LazyViewer.js';
|
|
37
|
+
// Skeleton loader for custom Suspense boundaries
|
|
38
|
+
export { JupyterSkeleton, } from './lazy/JupyterSkeleton.js';
|
|
39
|
+
//# sourceMappingURL=lazy-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-entry.js","sourceRoot":"","sources":["../src/lazy-entry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE9D,iDAAiD;AACjD,OAAO,EACL,eAAe,GAEhB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lite entry point - exports JupyterLite-related modules including kernel extensions.
|
|
3
|
+
*/
|
|
4
|
+
export * from './jupyter/lite';
|
|
5
|
+
export { default as pyodideKernelExtension } from './jupyter/lite/pyodide-kernel-extension';
|
|
6
|
+
export { default as javascriptKernelExtension } from './jupyter/lite/javascript-kernel-extension';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Lite entry point - exports JupyterLite-related modules including kernel extensions.
|
|
8
|
+
*/
|
|
9
|
+
// Re-export lite modules
|
|
10
|
+
export * from './jupyter/lite/index.js';
|
|
11
|
+
// Re-export kernel extensions
|
|
12
|
+
export { default as pyodideKernelExtension } from './jupyter/lite/pyodide-kernel-extension/index.js';
|
|
13
|
+
export { default as javascriptKernelExtension } from './jupyter/lite/javascript-kernel-extension/index.js';
|
|
14
|
+
//# sourceMappingURL=lite-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lite-entry.js","sourceRoot":"","sources":["../src/lite-entry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH,yBAAyB;AACzB,cAAc,gBAAgB,CAAC;AAE/B,8BAA8B;AAC9B,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,4CAA4C,CAAC"}
|
package/lib/notebook.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Notebook component entry point
|
|
8
|
+
*
|
|
9
|
+
* This is a separate entry point for tree-shaking.
|
|
10
|
+
* Import from '@datalayer/jupyter-react/notebook' for smaller bundles.
|
|
11
|
+
*/
|
|
12
|
+
export * from './components/notebook/index.js';
|
|
13
|
+
//# sourceMappingURL=notebook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook.js","sourceRoot":"","sources":["../src/notebook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH,cAAc,uBAAuB,CAAC"}
|
package/lib/output.d.ts
ADDED
package/lib/output.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Output component entry point
|
|
8
|
+
*
|
|
9
|
+
* This is a separate entry point for tree-shaking.
|
|
10
|
+
* Import from '@datalayer/jupyter-react/output' for smaller bundles.
|
|
11
|
+
*/
|
|
12
|
+
export * from './components/output/index.js';
|
|
13
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH,cAAc,qBAAqB,CAAC"}
|
|
@@ -8,25 +8,23 @@ import { createStore } from 'zustand/vanilla';
|
|
|
8
8
|
import { useStore } from 'zustand';
|
|
9
9
|
import { ServiceManager, } from '@jupyterlab/services';
|
|
10
10
|
import { setupPrimerPortals } from '@datalayer/primer-addons';
|
|
11
|
-
import { getJupyterServerUrl, createLiteServiceManager, DEFAULT_KERNEL_NAME, } from '../jupyter';
|
|
12
|
-
import { ServiceManagerLess } from '../jupyter/services';
|
|
13
|
-
import { Kernel } from '../jupyter/kernel/Kernel';
|
|
14
|
-
import { loadJupyterConfig } from '../jupyter/JupyterConfig';
|
|
15
|
-
import { cellsStore } from '../components/cell/CellState';
|
|
16
|
-
import { consoleStore } from '../components/console/ConsoleState';
|
|
17
|
-
import { notebookStore, } from '../components/notebook/NotebookState';
|
|
18
|
-
import { outputsStore } from '../components/output/OutputState';
|
|
19
|
-
import { terminalStore, } from '../components/terminal/TerminalState';
|
|
20
|
-
import { createServerSettings, ensureJupyterAuth } from '../utils';
|
|
11
|
+
import { getJupyterServerUrl, createLiteServiceManager, DEFAULT_KERNEL_NAME, } from '../jupyter/index.js';
|
|
12
|
+
import { ServiceManagerLess } from '../jupyter/services/index.js';
|
|
13
|
+
import { Kernel } from '../jupyter/kernel/Kernel.js';
|
|
14
|
+
import { loadJupyterConfig } from '../jupyter/JupyterConfig.js';
|
|
15
|
+
import { cellsStore } from '../components/cell/CellState.js';
|
|
16
|
+
import { consoleStore } from '../components/console/ConsoleState.js';
|
|
17
|
+
import { notebookStore, } from '../components/notebook/NotebookState.js';
|
|
18
|
+
import { outputsStore } from '../components/output/OutputState.js';
|
|
19
|
+
import { terminalStore, } from '../components/terminal/TerminalState.js';
|
|
20
|
+
import { createServerSettings, ensureJupyterAuth } from '../utils/index.js';
|
|
21
21
|
export const jupyterReactStore = createStore((set, get) => ({
|
|
22
|
-
collaborative: false,
|
|
23
22
|
version: '',
|
|
24
23
|
jupyterLabAdapter: undefined,
|
|
25
24
|
jupyterConfig: undefined,
|
|
26
25
|
kernelIsLoading: true,
|
|
27
26
|
kernel: undefined,
|
|
28
27
|
serviceManager: undefined,
|
|
29
|
-
serverSettings: undefined,
|
|
30
28
|
cellsStore: cellsStore.getState(),
|
|
31
29
|
consoleStore: consoleStore.getState(),
|
|
32
30
|
notebookStore: notebookStore.getState(),
|
|
@@ -34,22 +32,22 @@ export const jupyterReactStore = createStore((set, get) => ({
|
|
|
34
32
|
terminalStore: terminalStore.getState(),
|
|
35
33
|
colormode: 'light',
|
|
36
34
|
setJupyterLabAdapter: (jupyterLabAdapter) => {
|
|
37
|
-
set(
|
|
35
|
+
set(_state => ({ jupyterLabAdapter }));
|
|
38
36
|
},
|
|
39
37
|
setJupyterConfig: (jupyterConfig) => {
|
|
40
|
-
set(
|
|
38
|
+
set(_state => ({ jupyterConfig }));
|
|
41
39
|
},
|
|
42
40
|
setServiceManager: (serviceManager) => {
|
|
43
|
-
set(
|
|
41
|
+
set(_state => ({ serviceManager }));
|
|
44
42
|
},
|
|
45
43
|
setVersion: version => {
|
|
46
44
|
if (version && !get().version) {
|
|
47
|
-
set(
|
|
45
|
+
set(_state => ({ version }));
|
|
48
46
|
}
|
|
49
47
|
},
|
|
50
48
|
setColormode: colormode => {
|
|
51
49
|
setupPrimerPortals(colormode);
|
|
52
|
-
set(
|
|
50
|
+
set(_state => ({ colormode }));
|
|
53
51
|
},
|
|
54
52
|
}));
|
|
55
53
|
export function useJupyterReactStore(selector) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JupyterReactState.js","sourceRoot":"","sources":["../../src/state/JupyterReactState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,cAAc,GAGf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,M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AAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;oBAClC,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,iBAAiB,CAAC,CAAC;oBACtE,IAAI,QAAQ,EAAE,CAAC;wBACb,IAAI,CAAC;4BACH,MAAM,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;wBAC9C,CAAC;wBAAC,OAAO,KAAK,EAAE,CAAC;4BACf,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;wBAC7D,CAAC;oBACH,CAAC;oBACD,SAAS,CAAC,aAAa,CAAC,CAAC;oBACzB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,aAAa,CAAC;oBACpD,YAAY,CAAC,KAAK,CAAC,CAAC;oBACpB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,eAAe,GAAG,KAAK,CAAC;gBACvD,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
package/lib/state/index.js
CHANGED
package/lib/terminal.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Terminal component entry point
|
|
8
|
+
*
|
|
9
|
+
* This is a separate entry point for tree-shaking.
|
|
10
|
+
* Import from '@datalayer/jupyter-react/terminal' for smaller bundles.
|
|
11
|
+
*/
|
|
12
|
+
export * from './components/terminal/index.js';
|
|
13
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH,cAAc,uBAAuB,CAAC"}
|
|
@@ -7,9 +7,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
7
7
|
import { createContext, useContext, useEffect, useState, } from 'react';
|
|
8
8
|
import { BaseStyles, ThemeProvider } from '@primer/react';
|
|
9
9
|
import { setupPrimerPortals } from '@datalayer/primer-addons';
|
|
10
|
-
import { JupyterLabCss, jupyterLabTheme } from '../theme';
|
|
11
|
-
import { loadJupyterConfig } from '../jupyter';
|
|
12
|
-
import { useJupyterReactStore } from '../state';
|
|
10
|
+
import { JupyterLabCss, jupyterLabTheme } from '../theme/index.js';
|
|
11
|
+
import { loadJupyterConfig } from '../jupyter/index.js';
|
|
12
|
+
import { useJupyterReactStore } from '../state/index.js';
|
|
13
13
|
import '@primer/primitives/dist/css/functional/themes/light.css';
|
|
14
14
|
import '@primer/primitives/dist/css/functional/themes/dark.css';
|
|
15
15
|
import '@primer/primitives/dist/css/base/typography/typography.css';
|
package/lib/theme/index.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*/
|
|
6
|
-
export * from './themes';
|
|
7
|
-
export * from './JupyterLabColormode';
|
|
8
|
-
export * from './JupyterLabCss';
|
|
9
|
-
export * from './JupyterPalette';
|
|
10
|
-
export * from './JupyterReactTheme';
|
|
6
|
+
export * from './themes/index.js';
|
|
7
|
+
export * from './JupyterLabColormode.js';
|
|
8
|
+
export * from './JupyterLabCss.js';
|
|
9
|
+
export * from './JupyterPalette.js';
|
|
10
|
+
export * from './JupyterReactTheme.js';
|
|
11
11
|
// Do NOT export JupyterLabCssImports here...
|
|
12
12
|
// !!! Leave this export commented otherwise webpack may break in consumers
|
|
13
|
-
// export * from './JupyterLabCssImports';
|
|
13
|
+
// export * from './JupyterLabCssImports.js';
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Theme entry point
|
|
8
|
+
*
|
|
9
|
+
* This is a separate entry point for tree-shaking.
|
|
10
|
+
* Import from '@datalayer/jupyter-react/theme' for smaller bundles.
|
|
11
|
+
*/
|
|
12
|
+
export * from './theme/index.js';
|
|
13
|
+
//# sourceMappingURL=theme-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-entry.js","sourceRoot":"","sources":["../src/theme-entry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* 4. TOON format returns encoded strings
|
|
14
14
|
*/
|
|
15
15
|
import { describe, it, expect, beforeEach } from '@jest/globals';
|
|
16
|
-
import { OperationRunner } from '../core/operationRunner';
|
|
17
|
-
import { insertCellOperation } from '../operations/insertCell';
|
|
18
|
-
import { deleteCellOperation } from '../operations/deleteCell';
|
|
19
|
-
import { updateCellOperation } from '../operations/updateCell';
|
|
20
|
-
import { readCellOperation } from '../operations/readCell';
|
|
21
|
-
import { readAllCellsOperation } from '../operations/readAllCells';
|
|
22
|
-
import { runCellOperation } from '../operations/runCell';
|
|
23
|
-
import { executeCodeOperation } from '../operations/executeCode';
|
|
16
|
+
import { OperationRunner } from '../core/operationRunner.js';
|
|
17
|
+
import { insertCellOperation } from '../operations/insertCell.js';
|
|
18
|
+
import { deleteCellOperation } from '../operations/deleteCell.js';
|
|
19
|
+
import { updateCellOperation } from '../operations/updateCell.js';
|
|
20
|
+
import { readCellOperation } from '../operations/readCell.js';
|
|
21
|
+
import { readAllCellsOperation } from '../operations/readAllCells.js';
|
|
22
|
+
import { runCellOperation } from '../operations/runCell.js';
|
|
23
|
+
import { executeCodeOperation } from '../operations/executeCode.js';
|
|
24
24
|
/**
|
|
25
25
|
* Mock executor for testing
|
|
26
26
|
*/
|
|
@@ -30,25 +30,19 @@ export class DefaultExecutor {
|
|
|
30
30
|
* @returns Result from store method
|
|
31
31
|
*/
|
|
32
32
|
async execute(operationName, args) {
|
|
33
|
-
console.log(`[DefaultExecutor] Executing: ${operationName} for document: ${this.documentId}`);
|
|
34
|
-
console.log(`[DefaultExecutor] Args:`, args);
|
|
35
33
|
// Get the store method directly (1:1 mapping, no transformation)
|
|
36
34
|
const method = this.store[operationName];
|
|
37
35
|
if (typeof method !== 'function') {
|
|
38
|
-
console.error(`[DefaultExecutor] Method '${operationName}' not found in store!`);
|
|
39
|
-
console.error(`[DefaultExecutor] Available methods:`, Object.keys(this.store).filter(k => typeof this.store[k] === 'function'));
|
|
40
36
|
throw new Error(`Store method '${operationName}' not found or not a function`);
|
|
41
37
|
}
|
|
42
38
|
// Build payload: { id, ...args } - pass as single object parameter
|
|
43
39
|
const payload = typeof args === 'object' && args !== null
|
|
44
40
|
? { id: this.documentId, ...args }
|
|
45
41
|
: { id: this.documentId };
|
|
46
|
-
console.log(`[DefaultExecutor] Calling method with payload:`, payload);
|
|
47
42
|
// Call method with payload object as first parameter
|
|
48
43
|
// Methods will check if first param is object and destructure accordingly
|
|
49
44
|
const methodFn = method;
|
|
50
45
|
const result = await methodFn.call(this.store, payload);
|
|
51
|
-
console.log(`[DefaultExecutor] Result:`, result);
|
|
52
46
|
return result;
|
|
53
47
|
}
|
|
54
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/tools/core/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0BH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAe;IAEhB;IACA;IAFV,YACU,UAAkB,EAClB,KAAoB;QADpB,eAAU,GAAV,UAAU,CAAQ;QAClB,UAAK,GAAL,KAAK,CAAe;IAC3B,CAAC;IAEJ;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,CAAC,aAAqB,EAAE,IAAa;QAChD,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/tools/core/executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0BH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAe;IAEhB;IACA;IAFV,YACU,UAAkB,EAClB,KAAoB;QADpB,eAAU,GAAV,UAAU,CAAQ;QAClB,UAAK,GAAL,KAAK,CAAe;IAC3B,CAAC;IAEJ;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,CAAC,aAAqB,EAAE,IAAa;QAChD,iEAAiE;QACjE,MAAM,MAAM,GAAI,IAAI,CAAC,KAA4C,CAC/D,aAAa,CACd,CAAC;QAEF,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,iBAAiB,aAAa,+BAA+B,CAC9D,CAAC;QACJ,CAAC;QAED,mEAAmE;QACnE,MAAM,OAAO,GACX,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;YACvC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,EAAE;YAClC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;QAE9B,qDAAqD;QACrD,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,MAAuC,CAAC;QACzD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAExD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/lib/tools/core/index.js
CHANGED
|
@@ -8,17 +8,18 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module tools/core
|
|
10
10
|
*/
|
|
11
|
-
export * from '../operations/insertCell';
|
|
12
|
-
export * from '../operations/deleteCell';
|
|
13
|
-
export * from '../operations/updateCell';
|
|
14
|
-
export * from '../operations/readCell';
|
|
15
|
-
export * from '../operations/readAllCells';
|
|
16
|
-
export * from '../operations/runCell';
|
|
17
|
-
export * from '../operations/executeCode';
|
|
18
|
-
export * from './interfaces';
|
|
19
|
-
export * from './formatter';
|
|
20
|
-
export * from './executor';
|
|
21
|
-
export * from './operationRunner';
|
|
22
|
-
export * from './schema';
|
|
23
|
-
export * from './types';
|
|
11
|
+
export * from '../operations/insertCell.js';
|
|
12
|
+
export * from '../operations/deleteCell.js';
|
|
13
|
+
export * from '../operations/updateCell.js';
|
|
14
|
+
export * from '../operations/readCell.js';
|
|
15
|
+
export * from '../operations/readAllCells.js';
|
|
16
|
+
export * from '../operations/runCell.js';
|
|
17
|
+
export * from '../operations/executeCode.js';
|
|
18
|
+
export * from './interfaces.js';
|
|
19
|
+
export * from './formatter.js';
|
|
20
|
+
export * from './executor.js';
|
|
21
|
+
export * from './operationRunner.js';
|
|
22
|
+
export * from './schema.js';
|
|
23
|
+
export * from './types.js';
|
|
24
|
+
export * from './zodUtils.js';
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
|
|
@@ -86,6 +86,30 @@ schema) {
|
|
|
86
86
|
else if (typeName === 'ZodBoolean' || typeName === 'boolean') {
|
|
87
87
|
prop.type = 'boolean';
|
|
88
88
|
}
|
|
89
|
+
else if (typeName === 'ZodArray' || typeName === 'array') {
|
|
90
|
+
prop.type = 'array';
|
|
91
|
+
// Get the inner type of the array
|
|
92
|
+
const innerType = zodField._def?.type || zodField.def?.type;
|
|
93
|
+
const innerTypeName = innerType?._def?.typeName ||
|
|
94
|
+
innerType?._def?.type ||
|
|
95
|
+
innerType?.def?.type;
|
|
96
|
+
// Map inner type to JSON Schema item type
|
|
97
|
+
if (innerTypeName === 'ZodString' || innerTypeName === 'string') {
|
|
98
|
+
prop.items = { type: 'string' };
|
|
99
|
+
}
|
|
100
|
+
else if (innerTypeName === 'ZodNumber' ||
|
|
101
|
+
innerTypeName === 'number') {
|
|
102
|
+
prop.items = { type: 'number' };
|
|
103
|
+
}
|
|
104
|
+
else if (innerTypeName === 'ZodBoolean' ||
|
|
105
|
+
innerTypeName === 'boolean') {
|
|
106
|
+
prop.items = { type: 'boolean' };
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// Default to string items for unknown inner types
|
|
110
|
+
prop.items = { type: 'string' };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
89
113
|
else if (typeName === 'ZodEnum' || typeName === 'enum') {
|
|
90
114
|
prop.type = 'string';
|
|
91
115
|
// Enum values can be in different places depending on Zod version:
|
|
@@ -101,6 +125,10 @@ schema) {
|
|
|
101
125
|
? enumValues
|
|
102
126
|
: Object.keys(enumValues || {});
|
|
103
127
|
}
|
|
128
|
+
else {
|
|
129
|
+
// Fallback: Default to string type for unknown types to ensure valid JSON Schema
|
|
130
|
+
prop.type = 'string';
|
|
131
|
+
}
|
|
104
132
|
properties[key] = prop;
|
|
105
133
|
// Mark as required if not optional
|
|
106
134
|
if (!isOptional) {
|