@datalayer/jupyter-react 0.0.13 → 0.0.16
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/lib/components/cell/Cell.js +15 -8
- package/lib/components/cell/Cell.js.map +1 -1
- package/lib/components/cell/CellAdapter.d.ts +2 -2
- package/lib/components/cell/CellAdapter.js +12 -15
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorEditor.d.ts +2 -2
- package/lib/components/codemirror/CodeMirrorEditor.js +8 -8
- package/lib/components/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorOutputToolbar.d.ts +12 -0
- package/lib/components/{outputs/OutputToolbar.js → codemirror/CodeMirrorOutputToolbar.js} +16 -14
- package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -0
- package/lib/components/commands/Commands.js +2 -2
- package/lib/components/commands/Commands.js.map +1 -1
- package/lib/components/console/Console.js +2 -2
- package/lib/components/console/Console.js.map +1 -1
- package/lib/components/filebrowser/FileBrowser.js +2 -2
- package/lib/components/filebrowser/FileBrowser.js.map +1 -1
- package/lib/components/filebrowser/FileBrowserAdapter.js +9 -9
- package/lib/components/filebrowser/FileBrowserAdapter.js.map +1 -1
- package/lib/components/notebook/Notebook.d.ts +0 -2
- package/lib/components/notebook/Notebook.js +41 -52
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +3 -4
- package/lib/components/notebook/NotebookAdapter.js +13 -17
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookCommands.js +2 -2
- package/lib/components/notebook/NotebookCommands.js.map +1 -1
- package/lib/components/notebook/NotebookState.js +1 -3
- package/lib/components/notebook/NotebookState.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarDefault.js +8 -7
- package/lib/components/notebook/cell/sidebar/CellSidebarDefault.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/base/CellSidebarWidget.js +2 -2
- package/lib/components/notebook/cell/sidebar/base/CellSidebarWidget.js.map +1 -1
- package/lib/components/{outputs → output}/Output.css +0 -0
- package/lib/components/{outputs → output}/Output.d.ts +7 -5
- package/lib/components/output/Output.js +186 -0
- package/lib/components/output/Output.js.map +1 -0
- package/lib/components/output/OutputAdapter.d.ts +19 -0
- package/lib/components/{outputs → output}/OutputAdapter.js +35 -42
- package/lib/components/output/OutputAdapter.js.map +1 -0
- package/lib/components/output/OutputRenderer.d.ts +6 -0
- package/lib/components/output/OutputRenderer.js +101 -0
- package/lib/components/output/OutputRenderer.js.map +1 -0
- package/lib/components/{outputs → output}/OutputState.d.ts +0 -0
- package/lib/components/{outputs → output}/OutputState.js +10 -10
- package/lib/components/output/OutputState.js.map +1 -0
- package/lib/components/settings/Settings.js +2 -2
- package/lib/components/settings/Settings.js.map +1 -1
- package/lib/components/terminal/Terminal.js +8 -3
- package/lib/components/terminal/Terminal.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +5 -6
- package/lib/index.js.map +1 -1
- package/lib/jupyter/Jupyter.d.ts +2 -0
- package/lib/jupyter/Jupyter.js +3 -2
- package/lib/jupyter/Jupyter.js.map +1 -1
- package/lib/jupyter/JupyterContext.d.ts +8 -3
- package/lib/jupyter/JupyterContext.js +45 -28
- package/lib/jupyter/JupyterContext.js.map +1 -1
- package/lib/jupyter/JupyterHandlers.d.ts +2 -1
- package/lib/jupyter/JupyterHandlers.js +3 -4
- package/lib/jupyter/JupyterHandlers.js.map +1 -1
- package/lib/jupyter/lite/LiteServer.js.map +1 -1
- package/lib/jupyter/lumino/Lumino.d.ts +3 -0
- package/lib/jupyter/lumino/{LuminoAttached.js → Lumino.js} +14 -6
- package/lib/jupyter/lumino/Lumino.js.map +1 -0
- package/lib/jupyter/services/kernel/Kernel.d.ts +5 -6
- package/lib/jupyter/services/kernel/Kernel.js +12 -35
- package/lib/jupyter/services/kernel/Kernel.js.map +1 -1
- package/lib/{utils → jupyter/utils}/Ids.d.ts +0 -0
- package/lib/{utils → jupyter/utils}/Ids.js +0 -0
- package/lib/jupyter/utils/Ids.js.map +1 -0
- package/lib/state/State.d.ts +5 -5
- package/lib/state/State.js +3 -3
- package/lib/state/State.js.map +1 -1
- package/lib/state/Store.js +1 -4
- package/lib/state/Store.js.map +1 -1
- package/package.json +35 -38
- package/style/index.css +27 -1
- package/lib/JupyterExample.d.ts +0 -1
- package/lib/JupyterExample.js +0 -56
- package/lib/JupyterExample.js.map +0 -1
- package/lib/JupyterLiteExample.d.ts +0 -1
- package/lib/JupyterLiteExample.js +0 -10
- package/lib/JupyterLiteExample.js.map +0 -1
- package/lib/components/outputs/Output.js +0 -126
- package/lib/components/outputs/Output.js.map +0 -1
- package/lib/components/outputs/OutputAdapter.d.ts +0 -19
- package/lib/components/outputs/OutputAdapter.js.map +0 -1
- package/lib/components/outputs/OutputState.js.map +0 -1
- package/lib/components/outputs/OutputToolbar.d.ts +0 -12
- package/lib/components/outputs/OutputToolbar.js.map +0 -1
- package/lib/jupyter/lumino/LuminoAttached.d.ts +0 -3
- package/lib/jupyter/lumino/LuminoAttached.js.map +0 -1
- package/lib/utils/Ids.js.map +0 -1
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAA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
|
9
9
|
lite: boolean;
|
|
10
|
+
startDefaultKernel: boolean;
|
|
10
11
|
injectableStore?: Store | any;
|
|
11
12
|
collaborative?: boolean;
|
|
12
13
|
jupyterServerHttpUrl?: string;
|
|
@@ -24,6 +25,7 @@ export declare const Jupyter: {
|
|
|
24
25
|
(props: JupyterProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
25
26
|
defaultProps: {
|
|
26
27
|
lite: boolean;
|
|
28
|
+
startDefaultKernel: boolean;
|
|
27
29
|
collaborative: boolean;
|
|
28
30
|
terminals: boolean;
|
|
29
31
|
};
|
package/lib/jupyter/Jupyter.js
CHANGED
|
@@ -17,12 +17,13 @@ const ErrorFallback = ({ error, resetErrorBoundary }) => {
|
|
|
17
17
|
* are available.
|
|
18
18
|
*/
|
|
19
19
|
export const Jupyter = (props) => {
|
|
20
|
-
const { lite } = props;
|
|
20
|
+
const { lite, startDefaultKernel } = props;
|
|
21
21
|
loadJupyterConfig(props);
|
|
22
|
-
return (_jsx(ErrorBoundary, Object.assign({ FallbackComponent: ErrorFallback }, { children: _jsx(ThemeProvider, { children: _jsx(BaseStyles, { children: _jsx(JupyterContextProvider, Object.assign({ lite: lite, baseUrl: getJupyterServerHttpUrl(), wsUrl: getJupyterServerWsUrl(), injectableStore: props.injectableStore || injectableStore, variant: "default" }, { children: props.children }), void 0) }, void 0) }, void 0) }), void 0));
|
|
22
|
+
return (_jsx(ErrorBoundary, Object.assign({ FallbackComponent: ErrorFallback }, { children: _jsx(ThemeProvider, Object.assign({ colorMode: "day" }, { children: _jsx(BaseStyles, { children: _jsx(JupyterContextProvider, Object.assign({ lite: lite, startDefaultKernel: startDefaultKernel, baseUrl: getJupyterServerHttpUrl(), wsUrl: getJupyterServerWsUrl(), injectableStore: props.injectableStore || injectableStore, variant: "default" }, { children: props.children }), void 0) }, void 0) }), void 0) }), void 0));
|
|
23
23
|
};
|
|
24
24
|
Jupyter.defaultProps = {
|
|
25
25
|
lite: false,
|
|
26
|
+
startDefaultKernel: true,
|
|
26
27
|
collaborative: false,
|
|
27
28
|
terminals: false,
|
|
28
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jupyter.js","sourceRoot":"","sources":["../../src/jupyter/Jupyter.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Jupyter.js","sourceRoot":"","sources":["../../src/jupyter/Jupyter.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,eAAe,MAAM,gBAAgB,CAAC;AAmB7C;;GAEG;AACH,MAAM,aAAa,GAAG,CAAC,EAAC,KAAK,EAAE,kBAAkB,EAAM,EAAE,EAAE;IACzD,OAAO,CACL,6BAAK,IAAI,EAAC,OAAO,iBACf,8DAAkC;YAClC,wBAAM,KAAK,CAAC,OAAO,WAAO,aAItB,CACP,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC7C,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAC3C,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,CACL,KAAC,aAAa,kBACZ,iBAAiB,EAAE,aAAa,gBAGhC,KAAC,aAAa,kBAAC,SAAS,EAAC,KAAK,gBAC5B,KAAC,UAAU,cACT,KAAC,sBAAsB,kBACrB,IAAI,EAAE,IAAI,EACV,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,uBAAuB,EAAE,EAClC,KAAK,EAAE,qBAAqB,EAAE,EAC9B,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,eAAe,EACzD,OAAO,EAAC,SAAS,gBAEf,KAAK,CAAC,QAAQ,YACO,WACd,YACC,YACF,CACjB,CAAA;AACH,CAAC,CAAA;AAED,OAAO,CAAC,YAAY,GAAG;IACrB,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,KAAK;CACjB,CAAA;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ServiceManager, ServerConnection } from '@jupyterlab/services';
|
|
2
|
+
import { ServiceManager, ServerConnection, KernelManager } from '@jupyterlab/services';
|
|
3
|
+
import Kernel from './services/kernel/Kernel';
|
|
3
4
|
/**
|
|
4
5
|
* The type for the Jupyter context.
|
|
5
6
|
*/
|
|
6
7
|
export declare type JupyterContextType = {
|
|
7
8
|
lite: boolean;
|
|
8
|
-
serverSettings
|
|
9
|
+
serverSettings: ServerConnection.ISettings;
|
|
9
10
|
serviceManager?: ServiceManager;
|
|
11
|
+
kernelManager?: KernelManager;
|
|
12
|
+
kernel?: Kernel;
|
|
13
|
+
startDefaultKernel: boolean;
|
|
10
14
|
variant: string;
|
|
11
15
|
setVariant: (value: string) => void;
|
|
12
16
|
baseUrl: string;
|
|
@@ -26,13 +30,14 @@ export declare const JupyterContextConsumer: React.Consumer<JupyterContextType |
|
|
|
26
30
|
* Utiliy method to ensure the Jupyter context is authenticated
|
|
27
31
|
* with the Jupyter server.
|
|
28
32
|
*/
|
|
29
|
-
export declare const ensureJupyterAuth: () => Promise<boolean>;
|
|
33
|
+
export declare const ensureJupyterAuth: (serverSettings: ServerConnection.ISettings) => Promise<boolean>;
|
|
30
34
|
/**
|
|
31
35
|
* The Jupyter context provider.
|
|
32
36
|
*/
|
|
33
37
|
export declare const JupyterContextProvider: React.FC<{
|
|
34
38
|
children: React.ReactNode;
|
|
35
39
|
lite: boolean;
|
|
40
|
+
startDefaultKernel: boolean;
|
|
36
41
|
variant: string;
|
|
37
42
|
baseUrl: string;
|
|
38
43
|
wsUrl: string;
|
|
@@ -5,6 +5,7 @@ import { ServiceManager, ServerConnection } from '@jupyterlab/services';
|
|
|
5
5
|
import { getJupyterServerHttpUrl } from './JupyterConfig';
|
|
6
6
|
import { requestAPI } from './JupyterHandlers';
|
|
7
7
|
import { startLiteServer } from './../jupyter/lite/LiteServer';
|
|
8
|
+
import Kernel from './services/kernel/Kernel';
|
|
8
9
|
/**
|
|
9
10
|
* The instance for the Jupyter context.
|
|
10
11
|
*/
|
|
@@ -27,12 +28,8 @@ const JupyterProvider = JupyterContext.Provider;
|
|
|
27
28
|
* Utiliy method to ensure the Jupyter context is authenticated
|
|
28
29
|
* with the Jupyter server.
|
|
29
30
|
*/
|
|
30
|
-
export const ensureJupyterAuth = () => {
|
|
31
|
-
return requestAPI('api', ''
|
|
32
|
-
credentials: 'include',
|
|
33
|
-
mode: 'cors',
|
|
34
|
-
})
|
|
35
|
-
.then(data => {
|
|
31
|
+
export const ensureJupyterAuth = (serverSettings) => {
|
|
32
|
+
return requestAPI(serverSettings, 'api', '').then(data => {
|
|
36
33
|
return true;
|
|
37
34
|
})
|
|
38
35
|
.catch(reason => {
|
|
@@ -40,47 +37,64 @@ export const ensureJupyterAuth = () => {
|
|
|
40
37
|
return false;
|
|
41
38
|
});
|
|
42
39
|
};
|
|
40
|
+
/*
|
|
43
41
|
const headers = new Headers({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
"Cache-Control": "no-cache, no-store, must-revalidate",
|
|
43
|
+
"Pragma": "no-cache",
|
|
44
|
+
"Expires": "0",
|
|
47
45
|
});
|
|
46
|
+
*/
|
|
48
47
|
/**
|
|
49
48
|
* The Jupyter context provider.
|
|
50
49
|
*/
|
|
51
|
-
export const JupyterContextProvider = ({ children, lite, variant, baseUrl, wsUrl, injectableStore }) => {
|
|
50
|
+
export const JupyterContextProvider = ({ children, lite, startDefaultKernel, variant, baseUrl, wsUrl, injectableStore }) => {
|
|
52
51
|
const [_, setVariant] = useState('default');
|
|
53
|
-
const [serverSettings
|
|
52
|
+
const [serverSettings] = useState(ServerConnection.makeSettings({
|
|
53
|
+
baseUrl,
|
|
54
|
+
wsUrl,
|
|
55
|
+
appendToken: true,
|
|
56
|
+
init: {
|
|
57
|
+
credentials: "include",
|
|
58
|
+
mode: 'cors',
|
|
59
|
+
cache: 'no-cache',
|
|
60
|
+
// headers,
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
54
63
|
const [serviceManager, setServiceManager] = useState();
|
|
64
|
+
const [kernelManager, setKernelManager] = useState();
|
|
65
|
+
const [kernel, setKernel] = useState();
|
|
55
66
|
useEffect(() => {
|
|
56
67
|
if (lite) {
|
|
57
68
|
startLiteServer().then((serviceManager) => {
|
|
58
69
|
setServiceManager(serviceManager);
|
|
70
|
+
setKernelManager(serviceManager.sessions._kernelManager);
|
|
59
71
|
});
|
|
60
72
|
}
|
|
61
73
|
else {
|
|
62
|
-
ensureJupyterAuth().then(isAuth => {
|
|
63
|
-
if (isAuth) {
|
|
64
|
-
const serverSettings = ServerConnection.makeSettings({
|
|
65
|
-
baseUrl,
|
|
66
|
-
wsUrl,
|
|
67
|
-
appendToken: true,
|
|
68
|
-
init: {
|
|
69
|
-
credentials: "include",
|
|
70
|
-
mode: 'cors',
|
|
71
|
-
headers,
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
setServerSettings(serverSettings);
|
|
75
|
-
const serviceManager = new ServiceManager({ serverSettings });
|
|
76
|
-
setServiceManager(serviceManager);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
74
|
+
ensureJupyterAuth(serverSettings).then(isAuth => {
|
|
75
|
+
if (!isAuth) {
|
|
79
76
|
const loginUrl = getJupyterServerHttpUrl() + '/login?next=' + window.location;
|
|
80
77
|
console.warn('Redirecting to jupyter login url', loginUrl);
|
|
81
78
|
window.location.replace(loginUrl);
|
|
82
79
|
}
|
|
83
80
|
});
|
|
81
|
+
const serviceManager = new ServiceManager({ serverSettings });
|
|
82
|
+
setServiceManager(serviceManager);
|
|
83
|
+
const kernelManager = serviceManager.sessions._kernelManager;
|
|
84
|
+
setKernelManager(kernelManager);
|
|
85
|
+
kernelManager.ready.then(() => {
|
|
86
|
+
if (startDefaultKernel) {
|
|
87
|
+
// console.log('Kernel Manager is ready.');
|
|
88
|
+
const kernel = new Kernel({ kernelManager });
|
|
89
|
+
kernel.getJupyterKernel().then(k => {
|
|
90
|
+
console.log(`Kernel started with session id:client_id ${k.id}:${k.clientId}`);
|
|
91
|
+
k.info.then(info => {
|
|
92
|
+
// console.log('Kernel information', info);
|
|
93
|
+
});
|
|
94
|
+
setKernel(kernel);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
84
98
|
}
|
|
85
99
|
setVariant(variant);
|
|
86
100
|
}, [lite, variant]);
|
|
@@ -88,6 +102,9 @@ export const JupyterContextProvider = ({ children, lite, variant, baseUrl, wsUrl
|
|
|
88
102
|
lite,
|
|
89
103
|
serverSettings,
|
|
90
104
|
serviceManager,
|
|
105
|
+
kernelManager,
|
|
106
|
+
kernel,
|
|
107
|
+
startDefaultKernel,
|
|
91
108
|
variant,
|
|
92
109
|
setVariant,
|
|
93
110
|
baseUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JupyterContext.js","sourceRoot":"","sources":["../../src/jupyter/JupyterContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"JupyterContext.js","sour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aAChB,gBACG,QAAQ,YACM,YACJ,CACjB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ServerConnection } from '@jupyterlab/services';
|
|
1
2
|
/**
|
|
2
3
|
* Call the Jupyter server API.
|
|
3
4
|
*
|
|
@@ -5,4 +6,4 @@
|
|
|
5
6
|
* @param init Initial values for the request
|
|
6
7
|
* @returns The response body interpreted as JSON
|
|
7
8
|
*/
|
|
8
|
-
export declare function requestAPI<T>(namespace?: string, endPoint?: string, init?: RequestInit): Promise<T>;
|
|
9
|
+
export declare function requestAPI<T>(serverSettings: ServerConnection.ISettings, namespace?: string, endPoint?: string, init?: RequestInit): Promise<T>;
|
|
@@ -17,14 +17,13 @@ import JupyterAuthError from './JupyterAuthError';
|
|
|
17
17
|
* @param init Initial values for the request
|
|
18
18
|
* @returns The response body interpreted as JSON
|
|
19
19
|
*/
|
|
20
|
-
export function requestAPI(namespace = '', endPoint = '', init = {}) {
|
|
20
|
+
export function requestAPI(serverSettings, namespace = '', endPoint = '', init = {}) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
// Make request to the Jupyter API.
|
|
23
|
-
const
|
|
24
|
-
const requestUrl = URLExt.join(settings.baseUrl, namespace, endPoint);
|
|
23
|
+
const requestUrl = URLExt.join(serverSettings.baseUrl, namespace, endPoint);
|
|
25
24
|
let response;
|
|
26
25
|
try {
|
|
27
|
-
response = yield ServerConnection.makeRequest(requestUrl, init,
|
|
26
|
+
response = yield ServerConnection.makeRequest(requestUrl, init, serverSettings);
|
|
28
27
|
if (response.status === 403) {
|
|
29
28
|
throw new JupyterAuthError();
|
|
30
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JupyterHandlers.js","sourceRoot":"","sources":["../../src/jupyter/JupyterHandlers.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,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O,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;aACtD;SACF;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,MAAM,IAAI,gBAAgB,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;SAC1E;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiteServer.js","sourceRoot":"","sources":["../../../src/jupyter/lite/LiteServer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,gBAAgB,GAAG;IACzB,uDAAuD;IACrD,MAAM,CAAC,4CAA4C,CAAC;IACpD,MAAM,CAAC,yCAAyC,CAAC;CAClD,CAAC;AAEF,mCAAmC;AACnC,MAAM,QAAQ,GAAG;IACf,2CAA2C;IAC3C,wCAAwC;IACxC,wCAAwC;IACxC,iDAAiD;IACjD,yCAAyC;IACzC,2CAA2C;IAC3C,4CAA4C;IAC5C,8CAA8C;IAC9C,kCAAkC;IACpC;;;;;;;;;;;;;;MAcE;CACD,CAAC;AAEF,MAAM,UAAgB,eAAe;;
|
|
1
|
+
{"version":3,"file":"LiteServer.js","sourceRoot":"","sources":["../../../src/jupyter/lite/LiteServer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,gBAAgB,GAAG;IACzB,uDAAuD;IACrD,MAAM,CAAC,4CAA4C,CAAC;IACpD,MAAM,CAAC,yCAAyC,CAAC;CAClD,CAAC;AAEF,mCAAmC;AACnC,MAAM,QAAQ,GAAG;IACf,2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,CAAC,CAAC;QACH,4CAA4C;QAC5C,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,EAAS,CAAC,CAAC;QAC3D,iBAAiB,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;QAC/D,oBAAoB;QACpB,MAAM,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAChC,2DAA2D;QAC3D,MAAM,EAAE,cAAc,EAAE,GAAG,iBAAiB,CAAC;QAC7C,OAAO,cAAc,CAAC;IACxB,CAAC;CAAA"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
3
|
import { Widget } from '@lumino/widgets';
|
|
4
|
-
export const
|
|
4
|
+
export const Lumino = (props) => {
|
|
5
5
|
const ref = useRef(null);
|
|
6
6
|
const { children } = props;
|
|
7
7
|
useEffect(() => {
|
|
8
|
-
|
|
8
|
+
const widget = children;
|
|
9
|
+
try {
|
|
10
|
+
Widget.attach(widget, ref.current);
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
console.warn('Exception while attaching Lumino widget.', e);
|
|
14
|
+
}
|
|
9
15
|
return () => {
|
|
10
16
|
try {
|
|
11
|
-
|
|
17
|
+
if (widget.isAttached || widget.node.isConnected) {
|
|
18
|
+
Widget.detach(widget);
|
|
19
|
+
}
|
|
12
20
|
}
|
|
13
21
|
catch (e) {
|
|
14
22
|
console.warn('Exception while detaching Lumino widget.', e);
|
|
15
23
|
}
|
|
16
24
|
};
|
|
17
|
-
}, []);
|
|
25
|
+
}, [children]);
|
|
18
26
|
return _jsx("div", { ref: ref }, void 0);
|
|
19
27
|
};
|
|
20
|
-
export default
|
|
21
|
-
//# sourceMappingURL=
|
|
28
|
+
export default Lumino;
|
|
29
|
+
//# sourceMappingURL=Lumino.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lumino.js","sourceRoot":"","sources":["../../../src/jupyter/lumino/Lumino.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAA6B,EAAE,EAAE;IACtD,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,QAAkB,CAAC;QAClC,IAAI;YACF,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAAQ,CAAC,CAAC;SACrC;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,CAAC,CAAC,CAAC;SAC7D;QACD,OAAO,GAAG,EAAE;YACV,IAAI;gBACF,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;oBAChD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;iBACvB;aACF;YAAC,OAAM,CAAC,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,CAAC,CAAC,CAAC;aAC7D;QACH,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,cAAK,GAAG,EAAE,GAAG,WAAG,CAAA;AACzB,CAAC,CAAA;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { Kernel as JupyterKernel } from '@jupyterlab/services';
|
|
1
|
+
import { Kernel as JupyterKernel, KernelManager } from '@jupyterlab/services';
|
|
2
2
|
export declare type IKernelProps = {
|
|
3
|
-
|
|
4
|
-
wsUrl?: string;
|
|
3
|
+
kernelManager: KernelManager;
|
|
5
4
|
kernelType?: string;
|
|
6
5
|
};
|
|
7
6
|
export declare class Kernel {
|
|
8
|
-
private
|
|
7
|
+
private _kernelManager;
|
|
9
8
|
private _kernelType;
|
|
10
9
|
private _kernel;
|
|
11
|
-
constructor(options
|
|
12
|
-
getJupyterKernel(): Promise<JupyterKernel.IKernelConnection>;
|
|
10
|
+
constructor(options: IKernelProps);
|
|
13
11
|
private requestKernel;
|
|
12
|
+
getJupyterKernel(): Promise<JupyterKernel.IKernelConnection>;
|
|
14
13
|
}
|
|
15
14
|
export default Kernel;
|
|
@@ -7,59 +7,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { SessionManager } from '@jupyterlab/services';
|
|
11
11
|
import { UUID } from '@lumino/coreutils';
|
|
12
|
-
const headers = new Headers({
|
|
13
|
-
"Cache-Control": "no-cache, no-store, must-revalidate",
|
|
14
|
-
"Pragma": "no-cache",
|
|
15
|
-
"Expires": "0",
|
|
16
|
-
});
|
|
17
12
|
export class Kernel {
|
|
18
|
-
constructor(options
|
|
19
|
-
this.
|
|
20
|
-
baseUrl: options.baseUrl || (location.protocol + '//' + location.host + "/api/jupyter"),
|
|
21
|
-
wsUrl: options.wsUrl || (location.protocol.replace('http', 'ws') + '//' + location.host + "/api/jupyter"),
|
|
22
|
-
appendToken: true,
|
|
23
|
-
init: {
|
|
24
|
-
credentials: 'include',
|
|
25
|
-
mode: 'cors',
|
|
26
|
-
headers,
|
|
27
|
-
}
|
|
28
|
-
});
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this._kernelManager = options.kernelManager;
|
|
29
15
|
this._kernelType = options.kernelType || 'python3';
|
|
30
16
|
this._kernel = this.requestKernel();
|
|
31
17
|
}
|
|
32
|
-
getJupyterKernel() {
|
|
33
|
-
/*
|
|
34
|
-
if (this._kernel) {
|
|
35
|
-
return this._kernel;
|
|
36
|
-
}
|
|
37
|
-
this._kernel = this.requestKernel();
|
|
38
|
-
*/
|
|
39
|
-
return this._kernel;
|
|
40
|
-
}
|
|
41
18
|
requestKernel() {
|
|
42
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
|
|
44
|
-
serverSettings: this._serverSettings,
|
|
45
|
-
standby: 'never',
|
|
46
|
-
});
|
|
20
|
+
yield this._kernelManager.ready;
|
|
47
21
|
const sessionManager = new SessionManager({
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
kernelManager: this._kernelManager,
|
|
23
|
+
serverSettings: this._kernelManager.serverSettings,
|
|
50
24
|
standby: 'never',
|
|
51
25
|
});
|
|
52
26
|
yield sessionManager.ready;
|
|
53
|
-
const
|
|
27
|
+
const randomName = UUID.uuid4();
|
|
54
28
|
const session = yield sessionManager.startNew({
|
|
55
|
-
path:
|
|
56
|
-
name:
|
|
29
|
+
path: randomName,
|
|
30
|
+
name: randomName,
|
|
57
31
|
type: this._kernelType,
|
|
58
32
|
});
|
|
59
33
|
yield session.kernel.info;
|
|
60
34
|
return session.kernel;
|
|
61
35
|
});
|
|
62
36
|
}
|
|
37
|
+
getJupyterKernel() {
|
|
38
|
+
return this._kernel;
|
|
39
|
+
}
|
|
63
40
|
}
|
|
64
41
|
export default Kernel;
|
|
65
42
|
//# sourceMappingURL=Kernel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kernel.js","sourceRoot":"","sources":["../../../../src/jupyter/services/kernel/Kernel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Kernel.js","sourceRoot":"","sources":["../../../../src/jupyter/services/kernel/Kernel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAA0C,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAOzC,MAAM,OAAO,MAAM;IAKjB,YAAmB,OAAqB;QACtC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,IAAI,SAAS,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACtC,CAAC;IAEa,aAAa;;YACzB,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;YAChC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC;gBACxC,aAAa,EAAE,IAAI,CAAC,cAAc;gBAClC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,cAAc;gBAClD,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;YACH,MAAM,cAAc,CAAC,KAAK,CAAC;YAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAChC,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC;gBAC5C,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,IAAI,CAAC,WAAW;aACvB,CAAC,CAAC;YACH,MAAM,OAAO,CAAC,MAAO,CAAC,IAAI,CAAC;YAC3B,OAAO,OAAO,CAAC,MAAO,CAAC;QACzB,CAAC;KAAA;IAEM,gBAAgB;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CAEF;AAED,eAAe,MAAM,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ids.js","sourceRoot":"","sources":["../../../src/jupyter/utils/Ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,uCAAuC;AACvC,sBAAsB;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,6DAA6D;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC,CAAA"}
|
package/lib/state/State.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { AnyAction } from "typescript-fsa";
|
|
|
2
2
|
import { ICellState } from "../components/cell/CellState";
|
|
3
3
|
import { INotebookState } from "../components/notebook/NotebookState";
|
|
4
4
|
import { ITerminalState } from "../components/terminal/TerminalState";
|
|
5
|
-
import { IOutputsState } from "../components/
|
|
6
|
-
export interface
|
|
5
|
+
import { IOutputsState } from "../components/output/OutputState";
|
|
6
|
+
export interface IJupyterReactState {
|
|
7
7
|
cell: ICellState;
|
|
8
|
-
|
|
8
|
+
output: IOutputsState;
|
|
9
9
|
notebook: INotebookState;
|
|
10
10
|
terminal: ITerminalState;
|
|
11
11
|
}
|
|
12
|
-
export declare const initialState:
|
|
12
|
+
export declare const initialState: IJupyterReactState;
|
|
13
13
|
export declare const epics: import("redux-observable").Epic<AnyAction, AnyAction, any, any>;
|
|
14
|
-
export declare const reducers: import("redux").Reducer<import("redux").CombinedState<
|
|
14
|
+
export declare const reducers: import("redux").Reducer<import("redux").CombinedState<IJupyterReactState>, import("redux").AnyAction>;
|
package/lib/state/State.js
CHANGED
|
@@ -3,10 +3,10 @@ import { combineEpics } from "redux-observable";
|
|
|
3
3
|
import { cellInitialState, cellReducer } from "../components/cell/CellState";
|
|
4
4
|
import { notebookInitialState, notebookEpics, notebookReducer } from "../components/notebook/NotebookState";
|
|
5
5
|
import { terminalInitialState, terminalReducer } from "../components/terminal/TerminalState";
|
|
6
|
-
import { outputInitialState, outputReducer } from "../components/
|
|
6
|
+
import { outputInitialState, outputReducer } from "../components/output/OutputState";
|
|
7
7
|
export const initialState = {
|
|
8
8
|
cell: cellInitialState,
|
|
9
|
-
|
|
9
|
+
output: outputInitialState,
|
|
10
10
|
notebook: notebookInitialState,
|
|
11
11
|
terminal: terminalInitialState,
|
|
12
12
|
};
|
|
@@ -25,7 +25,7 @@ export const epics = combineEpics(notebookEpics);
|
|
|
25
25
|
/* Reducers */
|
|
26
26
|
export const reducers = combineReducers({
|
|
27
27
|
cell: cellReducer,
|
|
28
|
-
|
|
28
|
+
output: outputReducer,
|
|
29
29
|
notebook: notebookReducer,
|
|
30
30
|
terminal: terminalReducer,
|
|
31
31
|
});
|
package/lib/state/State.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"State.js","sourceRoot":"","sources":["../../src/state/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAc,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAkB,MAAM,sCAAsC,CAAC;AAC5H,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAkB,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"State.js","sourceRoot":"","sources":["../../src/state/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAc,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAkB,MAAM,sCAAsC,CAAC;AAC5H,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAkB,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAiB,MAAM,kCAAkC,CAAC;AAWpG,MAAM,CAAC,MAAM,YAAY,GAAuB;IAC9C,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,QAAQ,EAAE,oBAAoB;CAC/B,CAAA;AAED;;;;;;;;;EASE;AAEF,WAAW;AACX,MAAM,CAAC,MAAM,KAAK,GAAG,YAAY,CAC/B,aAAa,CACd,CAAC;AAEF,cAAc;AACd,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAqB;IAC1D,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;CAC1B,CAAC,CAAC"}
|
package/lib/state/Store.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { applyMiddleware, combineReducers, createStore } from "redux";
|
|
2
2
|
import { createEpicMiddleware } from "redux-observable";
|
|
3
|
-
import { cellReducer } from "../components/cell/CellState";
|
|
4
|
-
import { notebookReducer } from "../components/notebook/NotebookState";
|
|
5
|
-
import { terminalReducer } from "../components/terminal/TerminalState";
|
|
6
3
|
const epicMiddleware = createEpicMiddleware();
|
|
7
4
|
function createReducer(asyncReducers) {
|
|
8
|
-
return combineReducers(Object.assign({
|
|
5
|
+
return combineReducers(Object.assign({}, asyncReducers));
|
|
9
6
|
}
|
|
10
7
|
function createInjectableStore() {
|
|
11
8
|
const injectableStore = createStore(createReducer({}), applyMiddleware(epicMiddleware));
|
package/lib/state/Store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../src/state/Store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../src/state/Store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,MAAM,cAAc,GAAG,oBAAoB,EAAgD,CAAC;AAE5F,SAAS,aAAa,CAAC,aAAkB;IACvC,OAAO,eAAe,mBACjB,aAAa,EAChB,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB;IAC5B,MAAM,eAAe,GAAG,WAAW,CACjC,aAAa,CAAC,EAAE,CAAC,EACjB,eAAe,CAAC,cAAc,CAAC,CAChC,CAAC;IACD,eAAuB,CAAC,aAAa,GAAG,EAAE,CAAC;IAC3C,eAAuB,CAAC,MAAM,GAAG,CAAC,GAAW,EAAE,YAAiB,EAAE,IAAU,EAAE,EAAE;QAC/E,MAAM,OAAO,GAAI,eAAuB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI,IAAI,EAAE;gBACR,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;aAC1B;YACA,eAAuB,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;YAC3D,MAAM,UAAU,GAAG,aAAa,CAAE,eAAuB,CAAC,aAAa,CAAC,CAAC;YACzE,eAAe,CAAC,cAAc,CAAC,UAAiB,CAAC,CAAC;SACnD;IACH,CAAC,CAAA;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AACD;;;;;;EAME;AACF,MAAM,eAAe,GAAG,qBAAqB,EAAE,CAAC;AAEhD,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/jupyter-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Jupyter React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "gulp resources-to-lib && tsc && webpack",
|
|
24
|
-
"build:prod": "gulp resources-to-lib && tsc
|
|
24
|
+
"build:prod": "gulp resources-to-lib && tsc",
|
|
25
25
|
"clean": "rimraf lib build dist tsconfig.tsbuildinfo",
|
|
26
26
|
"start": "run-p -c start:*",
|
|
27
27
|
"start:jupyter": "cd ./../.. && make start-jupyter-server",
|
|
@@ -41,42 +41,39 @@
|
|
|
41
41
|
"@jupyter-widgets/html-manager": "1.0.0-rc.1",
|
|
42
42
|
"@jupyter-widgets/jupyterlab-manager": "5.0.0-rc.1",
|
|
43
43
|
"@jupyter-widgets/output": "6.0.0-rc.1",
|
|
44
|
-
"@jupyterlab/apputils": "4.0.0-alpha.
|
|
45
|
-
"@jupyterlab/cells": "4.0.0-alpha.
|
|
46
|
-
"@jupyterlab/codemirror": "4.0.0-alpha.
|
|
47
|
-
"@jupyterlab/completer": "4.0.0-alpha.
|
|
48
|
-
"@jupyterlab/console": "4.0.0-alpha.
|
|
49
|
-
"@jupyterlab/coreutils": "6.0.0-alpha.
|
|
50
|
-
"@jupyterlab/docmanager": "4.0.0-alpha.
|
|
51
|
-
"@jupyterlab/docprovider": "4.0.0-alpha.
|
|
52
|
-
"@jupyterlab/docregistry": "4.0.0-alpha.
|
|
53
|
-
"@jupyterlab/documentsearch": "4.0.0-alpha.
|
|
54
|
-
"@jupyterlab/filebrowser": "4.0.0-alpha.
|
|
55
|
-
"@jupyterlab/fileeditor": "4.0.0-alpha.
|
|
56
|
-
"@jupyterlab/json-extension": "4.0.0-alpha.
|
|
57
|
-
"@jupyterlab/javascript-extension": "4.0.0-alpha.
|
|
58
|
-
"@jupyterlab/mathjax2": "4.0.0-alpha.
|
|
59
|
-
"@jupyterlab/markedparser-extension": "4.0.0-alpha.
|
|
60
|
-
"@jupyterlab/nbconvert-css": "4.0.0-alpha.
|
|
61
|
-
"@jupyterlab/notebook": "4.0.0-alpha.
|
|
62
|
-
"@jupyterlab/outputarea": "4.0.0-alpha.
|
|
63
|
-
"@jupyterlab/rendermime": "4.0.0-alpha.
|
|
64
|
-
"@jupyterlab/rendermime-extension": "4.0.0-alpha.
|
|
65
|
-
"@jupyterlab/rendermime-interfaces": "3.8.0-alpha.
|
|
66
|
-
"@jupyterlab/services": "7.0.0-alpha.
|
|
67
|
-
"@jupyterlab/terminal": "4.0.0-alpha.
|
|
68
|
-
"@jupyterlab/theme-dark-extension": "4.0.0-alpha.
|
|
69
|
-
"@jupyterlab/theme-light-extension": "4.0.0-alpha.
|
|
70
|
-
"@
|
|
71
|
-
"@datalayer/jupyterlite-
|
|
72
|
-
"@datalayer/jupyterlite-ipykernel
|
|
73
|
-
"@datalayer/jupyterlite-
|
|
74
|
-
"@datalayer/jupyterlite-server
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
77
|
-
"@lumino/default-theme": "0.21.1",
|
|
78
|
-
"@lumino/widgets": "1.31.1",
|
|
79
|
-
"@primer/react": "35.7.1-rc.ebe39a33",
|
|
44
|
+
"@jupyterlab/apputils": "4.0.0-alpha.13",
|
|
45
|
+
"@jupyterlab/cells": "4.0.0-alpha.13",
|
|
46
|
+
"@jupyterlab/codemirror": "4.0.0-alpha.13",
|
|
47
|
+
"@jupyterlab/completer": "4.0.0-alpha.13",
|
|
48
|
+
"@jupyterlab/console": "4.0.0-alpha.13",
|
|
49
|
+
"@jupyterlab/coreutils": "6.0.0-alpha.13",
|
|
50
|
+
"@jupyterlab/docmanager": "4.0.0-alpha.13",
|
|
51
|
+
"@jupyterlab/docprovider": "4.0.0-alpha.13",
|
|
52
|
+
"@jupyterlab/docregistry": "4.0.0-alpha.13",
|
|
53
|
+
"@jupyterlab/documentsearch": "4.0.0-alpha.13",
|
|
54
|
+
"@jupyterlab/filebrowser": "4.0.0-alpha.13",
|
|
55
|
+
"@jupyterlab/fileeditor": "4.0.0-alpha.13",
|
|
56
|
+
"@jupyterlab/json-extension": "4.0.0-alpha.13",
|
|
57
|
+
"@jupyterlab/javascript-extension": "4.0.0-alpha.13",
|
|
58
|
+
"@jupyterlab/mathjax2": "4.0.0-alpha.13",
|
|
59
|
+
"@jupyterlab/markedparser-extension": "4.0.0-alpha.13",
|
|
60
|
+
"@jupyterlab/nbconvert-css": "4.0.0-alpha.13",
|
|
61
|
+
"@jupyterlab/notebook": "4.0.0-alpha.13",
|
|
62
|
+
"@jupyterlab/outputarea": "4.0.0-alpha.13",
|
|
63
|
+
"@jupyterlab/rendermime": "4.0.0-alpha.13",
|
|
64
|
+
"@jupyterlab/rendermime-extension": "4.0.0-alpha.13",
|
|
65
|
+
"@jupyterlab/rendermime-interfaces": "3.8.0-alpha.13",
|
|
66
|
+
"@jupyterlab/services": "7.0.0-alpha.13",
|
|
67
|
+
"@jupyterlab/terminal": "4.0.0-alpha.13",
|
|
68
|
+
"@jupyterlab/theme-dark-extension": "4.0.0-alpha.13",
|
|
69
|
+
"@jupyterlab/theme-light-extension": "4.0.0-alpha.13",
|
|
70
|
+
"@lumino/default-theme": "1.0.0-alpha.4",
|
|
71
|
+
"@datalayer/jupyterlite-kernel": "0.1.0-beta.13",
|
|
72
|
+
"@datalayer/jupyterlite-ipykernel": "0.1.0-beta.13",
|
|
73
|
+
"@datalayer/jupyterlite-ipykernel-extension": "0.1.0-beta.13",
|
|
74
|
+
"@datalayer/jupyterlite-server": "0.1.0-beta.13",
|
|
75
|
+
"@datalayer/jupyterlite-server-extension": "0.1.0-beta.13",
|
|
76
|
+
"@primer/react": "35.8.0",
|
|
80
77
|
"@primer/octicons-react": "17.0.0",
|
|
81
78
|
"assert": "2.0.0",
|
|
82
79
|
"marked": "4.0.10",
|