@datalayer/core 0.0.16 → 0.0.18

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.
Files changed (133) hide show
  1. package/README.md +9 -13
  2. package/lib/client/auth/AuthenticationManager.d.ts +95 -0
  3. package/lib/client/auth/AuthenticationManager.js +214 -0
  4. package/lib/client/auth/index.d.ts +8 -0
  5. package/lib/client/auth/index.js +17 -0
  6. package/lib/client/auth/storage.d.ts +154 -0
  7. package/lib/client/auth/storage.js +447 -0
  8. package/lib/client/auth/strategies.d.ts +54 -0
  9. package/lib/client/auth/strategies.js +238 -0
  10. package/lib/client/auth/types.d.ts +151 -0
  11. package/lib/{examples/index.js → client/auth/types.js} +4 -2
  12. package/lib/client/base.d.ts +3 -0
  13. package/lib/client/base.js +9 -0
  14. package/lib/client/index.d.ts +1 -0
  15. package/lib/client/index.js +2 -0
  16. package/lib/components/auth/Login.d.ts +40 -0
  17. package/lib/components/auth/Login.js +173 -0
  18. package/lib/components/auth/Login.stories.d.ts +54 -0
  19. package/lib/components/auth/Login.stories.js +104 -0
  20. package/lib/components/auth/LoginToken.d.ts +16 -0
  21. package/lib/components/auth/LoginToken.js +63 -0
  22. package/lib/components/auth/index.d.ts +5 -0
  23. package/lib/components/auth/index.js +16 -0
  24. package/lib/components/avatars/BoringAvatar.d.ts +6 -15
  25. package/lib/components/avatars/BoringAvatar.js +30 -34
  26. package/lib/components/avatars/BoringAvatar.stories.d.ts +7 -16
  27. package/lib/components/avatars/UserProfileAvatar.d.ts +1 -6
  28. package/lib/components/avatars/UserProfileAvatar.js +3 -8
  29. package/lib/components/buttons/DownloadCSVButton.d.ts +2 -7
  30. package/lib/components/buttons/DownloadCSVButton.js +1 -5
  31. package/lib/components/buttons/DownloadJsonButton.d.ts +3 -10
  32. package/lib/components/buttons/DownloadJsonButton.js +1 -7
  33. package/lib/components/buttons/UploadButton.d.ts +1 -4
  34. package/lib/components/buttons/UploadButton.js +3 -7
  35. package/lib/components/chat/ChatComponent.d.ts +4 -0
  36. package/lib/components/chat/ChatComponent.js +143 -0
  37. package/lib/components/chat/MessagePart.d.ts +11 -0
  38. package/lib/components/chat/MessagePart.js +23 -0
  39. package/lib/components/chat/display/DynamicToolPart.d.ts +6 -0
  40. package/lib/components/chat/display/DynamicToolPart.js +5 -0
  41. package/lib/components/chat/display/ReasoningPart.d.ts +6 -0
  42. package/lib/components/chat/display/ReasoningPart.js +58 -0
  43. package/lib/components/chat/display/TextPart.d.ts +9 -0
  44. package/lib/components/chat/display/TextPart.js +93 -0
  45. package/lib/components/chat/display/ToolPart.d.ts +6 -0
  46. package/lib/components/chat/display/ToolPart.js +148 -0
  47. package/lib/components/chat/display/index.d.ts +4 -0
  48. package/lib/components/chat/display/index.js +13 -0
  49. package/lib/components/chat/handler.d.ts +8 -0
  50. package/lib/components/chat/handler.js +43 -0
  51. package/lib/components/chat/index.d.ts +4 -0
  52. package/lib/components/chat/index.js +13 -0
  53. package/lib/components/display/CenteredSpinner.d.ts +1 -4
  54. package/lib/components/display/CenteredSpinner.js +1 -5
  55. package/lib/components/display/HorizontalCenter.d.ts +1 -4
  56. package/lib/components/display/HorizontalCenter.js +1 -5
  57. package/lib/components/flashes/FlashClosable.d.ts +1 -4
  58. package/lib/components/flashes/FlashClosable.js +1 -5
  59. package/lib/components/flashes/FlashDisclaimer.js +1 -1
  60. package/lib/components/index.d.ts +2 -1
  61. package/lib/components/index.js +2 -1
  62. package/lib/components/notebooks/JupyterNotebook.d.ts +1 -6
  63. package/lib/components/notebooks/JupyterNotebook.js +1 -5
  64. package/lib/components/runtimes/RuntimeSimplePicker.d.ts +4 -0
  65. package/lib/components/runtimes/RuntimeSimplePicker.js +3 -3
  66. package/lib/components/snapshots/RuntimeSnapshotMenu.d.ts +1 -4
  67. package/lib/components/snapshots/RuntimeSnapshotMenu.js +1 -5
  68. package/lib/config/Configuration.js +1 -1
  69. package/lib/examples/CellExample.js +11 -47
  70. package/lib/examples/lexical-theme.css +436 -0
  71. package/lib/examples/notebooks/Matplotlib.ipynb.json +1 -1
  72. package/lib/examples/notebooks/NotebookExample1.ipynb.json +1 -1
  73. package/lib/hooks/useAIJupyterChat.d.ts +36 -0
  74. package/lib/hooks/useAIJupyterChat.js +53 -0
  75. package/lib/hooks/useBackdrop.d.ts +4 -4
  76. package/lib/hooks/useBackdrop.js +5 -9
  77. package/lib/hooks/useCache.d.ts +5 -1
  78. package/lib/hooks/useCache.js +126 -58
  79. package/lib/hooks/useMobile.d.ts +1 -0
  80. package/lib/hooks/useMobile.js +26 -0
  81. package/lib/hooks/useScreenshot.d.ts +3 -5
  82. package/lib/hooks/useScreenshot.js +1 -8
  83. package/lib/hooks/useUpload.js +29 -21
  84. package/lib/index.d.ts +1 -0
  85. package/lib/index.js +8 -4
  86. package/lib/models/Outbound.d.ts +2 -0
  87. package/lib/models/Outbound.js +3 -1
  88. package/lib/state/substates/CoreState.js +1 -1
  89. package/lib/state/substates/IAMState.js +15 -6
  90. package/lib/stateful/index.d.ts +0 -1
  91. package/lib/stateful/index.js +0 -1
  92. package/lib/stateful/runtimes/actions.d.ts +1 -1
  93. package/lib/stateful/runtimes/actions.js +1 -1
  94. package/lib/theme/DatalayerTheme.d.ts +2 -2
  95. package/lib/theme/DatalayerTheme.js +4 -4
  96. package/lib/theme/DatalayerThemeProvider.js +2 -2
  97. package/lib/tools/adapters/agui/AgUIToolAdapter.d.ts +75 -0
  98. package/lib/tools/adapters/agui/AgUIToolAdapter.js +244 -0
  99. package/lib/tools/adapters/agui/index.d.ts +10 -0
  100. package/lib/tools/adapters/agui/index.js +19 -0
  101. package/lib/tools/adapters/agui/lexicalHooks.d.ts +27 -0
  102. package/lib/tools/adapters/agui/lexicalHooks.js +64 -0
  103. package/lib/tools/adapters/agui/notebookHooks.d.ts +27 -0
  104. package/lib/tools/adapters/agui/notebookHooks.js +61 -0
  105. package/lib/tools/index.d.ts +6 -0
  106. package/lib/tools/index.js +18 -0
  107. package/lib/types.d.ts +5 -0
  108. package/lib/types.js +5 -0
  109. package/lib/utils/cli/index.d.ts +4 -0
  110. package/lib/utils/cli/index.js +13 -0
  111. package/lib/utils/cli/query.d.ts +6 -0
  112. package/lib/utils/cli/query.js +26 -0
  113. package/lib/utils/index.d.ts +1 -0
  114. package/lib/utils/index.js +1 -0
  115. package/package.json +62 -5
  116. package/style/base.css +4 -0
  117. package/lib/examples/DatalayerNotebookExample.d.ts +0 -16
  118. package/lib/examples/DatalayerNotebookExample.js +0 -75
  119. package/lib/examples/NativeNavigationExample.d.ts +0 -8
  120. package/lib/examples/NativeNavigationExample.js +0 -97
  121. package/lib/examples/NotebookMutationsKernel.d.ts +0 -2
  122. package/lib/examples/NotebookMutationsKernel.js +0 -115
  123. package/lib/examples/NotebookMutationsServiceManager.d.ts +0 -2
  124. package/lib/examples/NotebookMutationsServiceManager.js +0 -107
  125. package/lib/examples/ReactRouterExample.d.ts +0 -6
  126. package/lib/examples/ReactRouterExample.js +0 -175
  127. package/lib/examples/example-selector.d.ts +0 -22
  128. package/lib/examples/example-selector.js +0 -45
  129. package/lib/examples/index.d.ts +0 -2
  130. package/lib/examples/main.d.ts +0 -1
  131. package/lib/examples/main.js +0 -153
  132. package/lib/examples/notebooks/OutputIPyWidgetsExample.d.ts +0 -145
  133. package/lib/examples/notebooks/OutputIPyWidgetsExample.js +0 -153
@@ -2,8 +2,5 @@ import { PropsWithChildren } from 'react';
2
2
  type IHorizontalCenterProps = {
3
3
  margin?: string;
4
4
  };
5
- export declare const HorizontalCenter: {
6
- (props: PropsWithChildren<IHorizontalCenterProps>): import("react/jsx-runtime").JSX.Element;
7
- defaultProps: IHorizontalCenterProps;
8
- };
5
+ export declare const HorizontalCenter: ({ children, margin, }: PropsWithChildren<IHorizontalCenterProps>) => import("react/jsx-runtime").JSX.Element;
9
6
  export default HorizontalCenter;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const HorizontalCenter = (props) => {
3
- const { children, margin } = props;
2
+ export const HorizontalCenter = ({ children, margin = '0px', }) => {
4
3
  return (_jsx("div", { style: {
5
4
  display: 'flex',
6
5
  alignItems: 'center',
@@ -8,7 +7,4 @@ export const HorizontalCenter = (props) => {
8
7
  margin,
9
8
  }, children: children }));
10
9
  };
11
- HorizontalCenter.defaultProps = {
12
- margin: '0px',
13
- };
14
10
  export default HorizontalCenter;
@@ -15,8 +15,5 @@ export interface IFlashDatalayerProps extends FlashProps {
15
15
  /**
16
16
  * Closable flash component with actions.
17
17
  */
18
- export declare const FlashClosable: {
19
- (props: IFlashDatalayerProps): JSX.Element;
20
- defaultProps: Partial<IFlashDatalayerProps>;
21
- };
18
+ export declare const FlashClosable: ({ actions, children, closable, variant, sx, ...others }: IFlashDatalayerProps) => JSX.Element;
22
19
  export default FlashClosable;
@@ -10,8 +10,7 @@ import { useCallback, useState } from 'react';
10
10
  /**
11
11
  * Closable flash component with actions.
12
12
  */
13
- export const FlashClosable = (props) => {
14
- const { actions, children, closable, variant, sx, ...others } = props;
13
+ export const FlashClosable = ({ actions, children, closable = true, variant, sx, ...others }) => {
15
14
  const [open, setOpen] = useState(true);
16
15
  const visual = variant === 'warning' ? (_jsx(AlertIcon, {})) : variant === 'success' ? (_jsx(CheckIcon, {})) : variant === 'danger' ? (_jsx(StopIcon, {})) : (_jsx(InfoIcon, {}));
17
16
  const onClose = useCallback(() => {
@@ -58,7 +57,4 @@ export const FlashClosable = (props) => {
58
57
  '& > svg': { marginRight: 0, color: 'var(--fgColor-default)' },
59
58
  } }) }))] })) : (_jsx(_Fragment, {}));
60
59
  };
61
- FlashClosable.defaultProps = {
62
- closable: true,
63
- };
64
60
  export default FlashClosable;
@@ -12,6 +12,6 @@ export const FlashDisclaimer = () => {
12
12
  const { configuration } = useCoreStore();
13
13
  const { showDisclaimer, setShowDisclaimer } = useRuntimesStore();
14
14
  const navigate = useNavigate();
15
- return (_jsx(_Fragment, { children: configuration?.whiteLabel === false && showDisclaimer && (_jsx(Banner, { variant: "info", title: "AI Platform for Data Analysis", description: _jsxs(Box, { children: [_jsx(Label, { style: { marginRight: 10 }, children: "PRIVATE BETA" }), "Create Kernels and use them from your JupyterLab, VS Code or CLI. Read the", ' ', _jsx(Link, { href: "javascript: return false;", onClick: e => navigate('/docs', e), children: "documentation" }), ' ', "for any question or", ' ', _jsx(Link, { href: "javascript: return false;", onClick: e => navigate('/support/request', e), children: "contact us for support" }), "."] }), onDismiss: () => setShowDisclaimer(false) })) }));
15
+ return (_jsx(_Fragment, { children: configuration?.whiteLabel === false && showDisclaimer && (_jsx(Banner, { variant: "info", title: "AI Agents for Data Analysis", description: _jsxs(Box, { children: [_jsx(Label, { style: { marginRight: 10 }, children: "PRIVATE BETA" }), "Create Kernels and use them from your JupyterLab, VS Code or CLI. Read the", ' ', _jsx(Link, { href: "javascript: return false;", onClick: e => navigate('/docs', e), children: "documentation" }), ' ', "for any question or", ' ', _jsx(Link, { href: "javascript: return false;", onClick: e => navigate('/support/request', e), children: "contact us for support" }), "."] }), onDismiss: () => setShowDisclaimer(false) })) }));
16
16
  };
17
17
  export default FlashDisclaimer;
@@ -1 +1,2 @@
1
- export {};
1
+ export * from './auth';
2
+ export * from './chat';
@@ -1,5 +1,6 @@
1
- export {};
2
1
  /*
3
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
3
  * Distributed under the terms of the Modified BSD License.
5
4
  */
5
+ export * from './auth';
6
+ export * from './chat';
@@ -3,10 +3,5 @@ type IJupyterNotebooProps = {
3
3
  boxPanel: BoxPanel;
4
4
  height?: string;
5
5
  };
6
- export declare const JupyterNotebook: {
7
- (props: IJupyterNotebooProps): import("react/jsx-runtime").JSX.Element;
8
- defaultProps: {
9
- height: string;
10
- };
11
- };
6
+ export declare const JupyterNotebook: ({ boxPanel, height, }: IJupyterNotebooProps) => import("react/jsx-runtime").JSX.Element;
12
7
  export default JupyterNotebook;
@@ -5,8 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  */
6
6
  import { Box } from '@datalayer/primer-addons';
7
7
  import { Lumino } from '@datalayer/jupyter-react';
8
- export const JupyterNotebook = (props) => {
9
- const { boxPanel, height } = props;
8
+ export const JupyterNotebook = ({ boxPanel, height = '100%', }) => {
10
9
  return (_jsx("div", { style: { position: 'relative' }, children: _jsx(Box, { className: "jp-LabShell", sx: {
11
10
  position: 'relative',
12
11
  '& .dla-Jupyter-Notebook': {
@@ -30,7 +29,4 @@ export const JupyterNotebook = (props) => {
30
29
  },
31
30
  }, children: _jsx(Lumino, { children: boxPanel }) }) }));
32
31
  };
33
- JupyterNotebook.defaultProps = {
34
- height: '100%',
35
- };
36
32
  export default JupyterNotebook;
@@ -26,6 +26,10 @@ interface IRuntimeSimplePickerProps {
26
26
  * Connection to the active runtime.
27
27
  */
28
28
  sessionConnection?: Session.ISessionConnection;
29
+ /**
30
+ * Whether browser runtime is available.
31
+ */
32
+ browserRuntimeAvailable?: boolean;
29
33
  }
30
34
  /**
31
35
  * Runtime simple picker component.
@@ -35,7 +35,7 @@ var RuntimeDialogCause;
35
35
  * Runtime simple picker component.
36
36
  */
37
37
  export function RuntimeSimplePicker(props) {
38
- const { assignRuntime, sessionConnection } = props;
38
+ const { assignRuntime, sessionConnection, browserRuntimeAvailable = true, } = props;
39
39
  const { runtimeModels, multiServiceManager } = useRuntimesStore();
40
40
  const jupyterReactStore = useJupyterReactStore();
41
41
  const jupyterLabAdapter = jupyterReactStore.jupyterLabAdapter;
@@ -120,7 +120,7 @@ export function RuntimeSimplePicker(props) {
120
120
  sessionConnection === undefined, onSelect: () => {
121
121
  setRuntimeLocation(undefined);
122
122
  assignRuntime({ runtimeDesc: undefined });
123
- }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(EyeIcon, {}) }), "Viewer", _jsx(ActionList.Description, { variant: "block", children: "A simple Notebook Viewer without Runtime." })] }), _jsxs(ActionList.Item, { selected: runtimeLocation === 'browser', onSelect: () => {
123
+ }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(EyeIcon, {}) }), "Viewer", _jsx(ActionList.Description, { variant: "block", children: "A simple Notebook Viewer without Runtime." })] }), browserRuntimeAvailable && (_jsxs(ActionList.Item, { selected: runtimeLocation === 'browser', onSelect: () => {
124
124
  setRuntimeLocation('browser');
125
125
  assignRuntime({
126
126
  runtimeDesc: {
@@ -129,7 +129,7 @@ export function RuntimeSimplePicker(props) {
129
129
  language: 'python',
130
130
  },
131
131
  });
132
- }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(BrowserIcon, {}) }), "Browser Runtime", _jsx(ActionList.Description, { variant: "block", children: "A Browser Runtime based on Pyodide." })] })] }), runtimeModels.length > 0 && (_jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Cloud Runtimes" }), runtimeModels.map(kernelModel => {
132
+ }, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(BrowserIcon, {}) }), "Browser Runtime", _jsx(ActionList.Description, { variant: "block", children: "A Browser Runtime based on Pyodide." })] }))] }), runtimeModels.length > 0 && (_jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Cloud Runtimes" }), runtimeModels.map(kernelModel => {
133
133
  return (_jsxs(ActionList.Item, { selected: sessionConnection?.kernel?.id === kernelModel.id, onSelect: () => {
134
134
  setRuntimeLocation('remote');
135
135
  assignRuntime({
@@ -29,8 +29,5 @@ type IRuntimeSnapshotMenu = {
29
29
  /**
30
30
  * Runtime Snapshot menu component.
31
31
  */
32
- export declare function RuntimeSnapshotMenu(props: PropsWithChildren<IRuntimeSnapshotMenu>): JSX.Element;
33
- export declare namespace RuntimeSnapshotMenu {
34
- var defaultProps: Partial<IRuntimeSnapshotMenu>;
35
- }
32
+ export declare function RuntimeSnapshotMenu({ children, connection, podName, multiServiceManager, disabled, }: PropsWithChildren<IRuntimeSnapshotMenu>): JSX.Element;
36
33
  export {};
@@ -15,8 +15,7 @@ import { createRuntimeSnapshotName } from '../../utils';
15
15
  /**
16
16
  * Runtime Snapshot menu component.
17
17
  */
18
- export function RuntimeSnapshotMenu(props) {
19
- const { children, connection, podName, multiServiceManager, disabled } = props;
18
+ export function RuntimeSnapshotMenu({ children, connection, podName, multiServiceManager, disabled = false, }) {
20
19
  const { addRuntimeSnapshot, runtimesRunUrl, runtimeSnapshots, setRuntimeSnapshots, } = useRuntimesStore();
21
20
  const { enqueueToast, trackAsyncTask } = useToast();
22
21
  const [openLoadDialog, setOpenLoadDialog] = useState(false);
@@ -168,6 +167,3 @@ export function RuntimeSnapshotMenu(props) {
168
167
  },
169
168
  ], children: _jsxs(Box, { as: "form", children: [_jsxs(FormControl, { children: [_jsx(FormControl.Label, { children: "Snapshot" }), _jsx(Select, { name: "snapshot", value: selection, onChange: onRuntimeSnapshotChanged, block: true, children: runtimeSnapshots.map(s => (_jsx(Select.Option, { value: s.id, children: s.name ? `${s.name} (${s.id})` : s.id }, s.id))) })] }), error && _jsx(Flash, { variant: "danger", children: error })] }) }))] }));
170
169
  }
171
- RuntimeSnapshotMenu.defaultProps = {
172
- disabled: false,
173
- };
@@ -26,7 +26,7 @@ export class DatalayerConfiguration {
26
26
  * Default configuration values for Datalayer
27
27
  */
28
28
  export const DEFAULT_DATALAYER_CONFIG = {
29
- runUrl: 'https://prod1.datalayer.run',
29
+ runUrl: 'https://oss.datalayer.run',
30
30
  credits: 100,
31
31
  cpuEnvironment: 'python-cpu-env',
32
32
  gpuEnvironment: 'ai-env',
@@ -1,55 +1,19 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright (c) 2023-2025 Datalayer, Inc.
4
- * Distributed under the terms of the Modified BSD License.
5
- */
6
- /*
7
- * Copyright (c) 2021-2023 Datalayer, Inc.
8
- *
9
- * MIT License
10
- */
11
- import { useEffect, useState } from 'react';
12
- import { Box, Button, Label } from '@primer/react';
13
- import { ServiceManager } from '@jupyterlab/services';
14
- import { createServerSettings, getJupyterServerUrl, getJupyterServerToken, } from '@datalayer/jupyter-react';
15
- import { Cell, KernelIndicator, useKernelsStore, useCellsStore, Kernel, } from '@datalayer/jupyter-react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Jupyter, Cell, KernelIndicator, useJupyter, useKernelsStore, useCellsStore, } from '@datalayer/jupyter-react';
3
+ import { Button, Label } from '@primer/react';
4
+ import { Box } from '@datalayer/primer-addons';
16
5
  const CELL_ID = 'cell-example-1';
17
6
  const DEFAULT_SOURCE = `from IPython.display import display
18
7
 
19
8
  for i in range(10):
20
9
  display('I am a long string which is repeatedly added to the dom in separated divs: %d' % i)`;
21
- export const CellExample = (props) => {
22
- const [kernel, setKernel] = useState();
23
- const [serviceManager, setServiceManager] = useState(props.serviceManager);
24
- const kernelsStore = useKernelsStore();
25
- useEffect(() => {
26
- // Create service manager if not provided
27
- if (!props.serviceManager) {
28
- const serverSettings = createServerSettings(getJupyterServerUrl(), getJupyterServerToken());
29
- const manager = new ServiceManager({ serverSettings });
30
- setServiceManager(manager);
31
- }
32
- }, [props.serviceManager]);
33
- useEffect(() => {
34
- if (!kernel && serviceManager) {
35
- // Create a kernel using the service manager
36
- const createKernel = async () => {
37
- // Create a Kernel wrapper
38
- const k = new Kernel({
39
- kernelName: 'python3',
40
- });
41
- // @ts-expect-error - Set service manager after construction
42
- k._serviceManager = serviceManager;
43
- await k.ready;
44
- setKernel(k);
45
- };
46
- createKernel();
47
- }
48
- }, [serviceManager]);
10
+ const CellExampleContent = () => {
11
+ const { defaultKernel } = useJupyter({ startDefaultKernel: true });
49
12
  const cellsStore = useCellsStore();
50
- if (!kernel) {
51
- return (_jsxs(Box, { p: 4, children: [_jsx(Box, { as: "h1", children: "A Jupyter Cell" }), _jsx(Box, { children: "Loading kernel..." })] }));
52
- }
53
- return (_jsxs(_Fragment, { children: [_jsx(Box, { as: "h1", children: "A Jupyter Cell" }), _jsxs(Box, { children: ["Source: ", cellsStore.getSource(CELL_ID)] }), _jsxs(Box, { children: ["Outputs Count: ", cellsStore.getOutputsCount(CELL_ID)] }), _jsxs(Box, { children: ["Kernel State: ", _jsx(Label, { children: kernelsStore.getExecutionState(kernel.id) })] }), _jsxs(Box, { children: ["Kernel Phase: ", _jsx(Label, { children: kernelsStore.getExecutionPhase(kernel.id) })] }), _jsxs(Box, { display: "flex", children: [_jsx(Box, { children: "Kernel Indicator:" }), _jsx(Box, { ml: 3, children: _jsx(KernelIndicator, { kernel: kernel.connection }) })] }), _jsx(Box, { children: _jsx(Button, { onClick: () => cellsStore.execute(CELL_ID), children: "Run cell" }) }), _jsx(Cell, { source: DEFAULT_SOURCE, id: CELL_ID })] }));
13
+ const kernelsStore = useKernelsStore();
14
+ return (_jsxs(Box, { p: 4, children: [_jsx(Box, { as: "h1", children: "A Jupyter Cell" }), _jsxs(Box, { children: ["Source: ", cellsStore.getSource(CELL_ID)] }), _jsxs(Box, { children: ["Outputs Count: ", cellsStore.getOutputsCount(CELL_ID)] }), _jsxs(Box, { children: ["Kernel State:", ' ', _jsx(Label, { children: defaultKernel && kernelsStore.getExecutionState(defaultKernel.id) })] }), _jsxs(Box, { children: ["Kernel Phase:", ' ', _jsx(Label, { children: defaultKernel && kernelsStore.getExecutionPhase(defaultKernel.id) })] }), _jsxs(Box, { display: "flex", children: [_jsx(Box, { children: "Kernel Indicator:" }), _jsx(Box, { ml: 3, children: _jsx(KernelIndicator, { kernel: defaultKernel && defaultKernel.connection }) })] }), _jsx(Box, { children: _jsx(Button, { onClick: () => cellsStore.execute(CELL_ID), children: "Run cell" }) }), _jsx(Cell, { source: DEFAULT_SOURCE, id: CELL_ID, kernel: defaultKernel })] }));
15
+ };
16
+ export const CellExample = (props) => {
17
+ return (_jsx(Jupyter, { serviceManager: props.serviceManager, children: _jsx(CellExampleContent, {}) }));
54
18
  };
55
19
  export default CellExample;