@datalayer/jupyter-react 0.5.2 → 0.6.1
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/app/JupyterReact.js +17 -4
- package/lib/app/JupyterReact.js.map +1 -1
- package/lib/app/tabs/AboutTab.d.ts +5 -0
- package/lib/app/tabs/AboutTab.js +8 -0
- package/lib/app/tabs/AboutTab.js.map +1 -0
- package/lib/app/tabs/PluginsTab.d.ts +2 -0
- package/lib/app/tabs/PluginsTab.js +6 -0
- package/lib/app/tabs/PluginsTab.js.map +1 -0
- package/lib/components/cell/CellAdapter.js +1 -1
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/components/ipywidgets/IPyWidgetsOutput.d.ts +7 -0
- package/lib/components/ipywidgets/IPyWidgetsOutput.js +9 -0
- package/lib/components/ipywidgets/IPyWidgetsOutput.js.map +1 -0
- package/lib/components/notebook/Notebook.css +1 -1
- package/lib/components/notebook/Notebook.js +2 -2
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.js +3 -4
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/cell/prompt/Countdown.d.ts +3 -0
- package/lib/components/notebook/cell/prompt/Countdown.js +16 -0
- package/lib/components/notebook/cell/prompt/Countdown.js.map +1 -0
- package/lib/components/notebook/cell/prompt/{InputPrompt.d.ts → CountdownInputPrompt.d.ts} +2 -8
- package/lib/components/notebook/cell/prompt/{InputPrompt.js → CountdownInputPrompt.js} +5 -30
- package/lib/components/notebook/cell/prompt/CountdownInputPrompt.js.map +1 -0
- package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.d.ts +13 -0
- package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.js +37 -0
- package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.js.map +1 -0
- package/lib/components/notebook/cell/sidebar/CellSidebarNew.js +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarNew.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/lumino/CellSidebarWidget.d.ts +2 -2
- package/lib/components/notebook/cell/sidebar/lumino/CellSidebarWidget.js +9 -5
- package/lib/components/notebook/cell/sidebar/lumino/CellSidebarWidget.js.map +1 -1
- package/lib/components/notebook/content/JupyterReactContentFactory.js +1 -1
- package/lib/components/notebook/content/JupyterReactContentFactory.js.map +1 -1
- package/lib/components/notebook/marked/marked.js.map +1 -1
- package/lib/components/viewer/Viewer.d.ts +7 -0
- package/lib/components/viewer/Viewer.js +17 -0
- package/lib/components/viewer/Viewer.js.map +1 -0
- package/lib/components/viewer/input/CodemirrorView.d.ts +2 -0
- package/lib/components/viewer/input/CodemirrorView.js +35 -0
- package/lib/components/viewer/input/CodemirrorView.js.map +1 -0
- package/lib/components/viewer/input/CodemirrorViewer.d.ts +6 -0
- package/lib/components/viewer/input/CodemirrorViewer.js +22 -0
- package/lib/components/viewer/input/CodemirrorViewer.js.map +1 -0
- package/lib/components/viewer/input/InputViewer.d.ts +7 -0
- package/lib/components/viewer/input/InputViewer.js +102 -0
- package/lib/components/viewer/input/InputViewer.js.map +1 -0
- package/lib/components/viewer/output/OutputAdapter.d.ts +11 -0
- package/lib/components/viewer/output/OutputAdapter.js +33 -0
- package/lib/components/viewer/output/OutputAdapter.js.map +1 -0
- package/lib/components/viewer/output/OutputViewer.d.ts +6 -0
- package/lib/components/viewer/output/OutputViewer.js +17 -0
- package/lib/components/viewer/output/OutputViewer.js.map +1 -0
- package/lib/examples/All.js +2 -2
- package/lib/examples/All.js.map +1 -1
- package/lib/examples/Dashboard.js +3 -3
- package/lib/examples/Dashboard.js.map +1 -1
- package/lib/examples/{Panel.js → IPyReact.js} +3 -3
- package/lib/examples/{IpyReact.js.map → IPyReact.js.map} +1 -1
- package/lib/examples/IPyWidgets.js +2 -2
- package/lib/examples/IPyWidgets.js.map +1 -1
- package/lib/examples/IPyWidgetsOutput.d.ts +1 -0
- package/lib/examples/IPyWidgetsOutput.js +9 -0
- package/lib/examples/IPyWidgetsOutput.js.map +1 -0
- package/lib/examples/{NotebookRenderer.js → NotebookGeoJson.js} +2 -2
- package/lib/examples/NotebookGeoJson.js.map +1 -0
- package/lib/examples/{IpyReact.js → NotebookMatplotlib.js} +4 -3
- package/lib/examples/NotebookMatplotlib.js.map +1 -0
- package/lib/examples/NotebookModel.js +2 -2
- package/lib/examples/NotebookModel.js.map +1 -1
- package/lib/examples/NotebookModelChange.js +4 -4
- package/lib/examples/NotebookModelChange.js.map +1 -1
- package/lib/examples/{Plotly.js → NotebookPlotly.js} +1 -1
- package/lib/examples/NotebookPlotly.js.map +1 -0
- package/lib/examples/NotebookRedux.js +2 -2
- package/lib/examples/NotebookRedux.js.map +1 -1
- package/lib/examples/NotebookUnmount.js +2 -2
- package/lib/examples/NotebookUnmount.js.map +1 -1
- package/lib/examples/Viewer.d.ts +1 -0
- package/lib/examples/Viewer.js +76 -0
- package/lib/examples/Viewer.js.map +1 -0
- package/lib/examples/samples/IPyWidgetsOutput.d.ts +145 -0
- package/lib/examples/samples/IPyWidgetsOutput.js +150 -0
- package/lib/examples/samples/IPyWidgetsOutput.js.map +1 -0
- package/lib/examples/samples/IPyWidgetsOutputMatplotlib.exclude.d.ts +51 -0
- package/lib/examples/samples/IPyWidgetsOutputMatplotlib.exclude.js +92 -0
- package/lib/examples/samples/IPyWidgetsOutputMatplotlib.exclude.js.map +1 -0
- package/lib/examples/samples/NotebookMatplotlib.ipynb.json +171 -0
- package/lib/index.d.ts +7 -5
- package/lib/index.js +11 -8
- package/lib/index.js.map +1 -1
- package/lib/jupyter/ipywidgets/IPyWidgetsClassicManager.js.map +1 -1
- package/lib/jupyter/lab/index.d.ts +1 -1
- package/lib/jupyter/lab/index.js +13 -13
- package/lib/jupyter/lab/index.js.map +1 -1
- package/lib/jupyter/lab/notebook/classic/{classic.d.ts → classicRender.d.ts} +5 -5
- package/lib/jupyter/lab/notebook/classic/{classic.js → classicRender.js} +11 -31
- package/lib/jupyter/lab/notebook/classic/classicRender.js.map +1 -0
- package/lib/jupyter/lab/notebook/classic/{index.d.ts → plugin.d.ts} +3 -2
- package/lib/jupyter/lab/notebook/classic/{index.js → plugin.js} +32 -32
- package/lib/jupyter/lab/notebook/classic/plugin.js.map +1 -0
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.d.ts +11 -0
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js +18 -0
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js.map +1 -0
- package/lib/jupyter/lab/notebook/content/plugin.d.ts +7 -0
- package/lib/jupyter/lab/notebook/content/plugin.js +19 -0
- package/lib/jupyter/lab/notebook/content/plugin.js.map +1 -0
- package/lib/jupyter/lab/notebook/dashboard/components/Dashboard.d.ts +7 -0
- package/lib/jupyter/lab/notebook/dashboard/components/Dashboard.js +13 -0
- package/lib/jupyter/lab/notebook/dashboard/components/Dashboard.js.map +1 -0
- package/lib/jupyter/lab/notebook/dashboard/dashboard.d.ts +26 -0
- package/lib/jupyter/lab/notebook/dashboard/dashboard.js +77 -0
- package/lib/jupyter/lab/notebook/dashboard/dashboard.js.map +1 -0
- package/lib/jupyter/lab/notebook/dashboard/dashboardWidget.d.ts +9 -0
- package/lib/jupyter/lab/notebook/dashboard/dashboardWidget.js +16 -0
- package/lib/jupyter/lab/notebook/dashboard/dashboardWidget.js.map +1 -0
- package/lib/jupyter/lab/notebook/dashboard/plugin.d.ts +12 -0
- package/lib/jupyter/lab/notebook/dashboard/plugin.js +147 -0
- package/lib/jupyter/lab/notebook/dashboard/plugin.js.map +1 -0
- package/lib/jupyter/lab/notebook/header/{index.d.ts → NotebookHeader.d.ts} +3 -0
- package/lib/jupyter/lab/notebook/header/NotebookHeader.js +52 -0
- package/lib/jupyter/lab/notebook/header/NotebookHeader.js.map +1 -0
- package/lib/jupyter/lab/widget.js.map +1 -1
- package/lib/jupyter/lumino/IPyWidgetsAttached.d.ts +10 -0
- package/lib/jupyter/lumino/IPyWidgetsAttached.js +20 -0
- package/lib/jupyter/lumino/IPyWidgetsAttached.js.map +1 -0
- package/lib/jupyter/lumino/Lumino.js +4 -4
- package/lib/jupyter/lumino/Lumino.js.map +1 -1
- package/lib/jupyter/lumino/LuminoNotebook.js +5 -5
- package/lib/jupyter/lumino/LuminoNotebook.js.map +1 -1
- package/lib/jupyter/lumino/LuminoObservable.d.ts +1 -1
- package/lib/jupyter/lumino/LuminoObservable.js +1 -1
- package/lib/jupyter/lumino/LuminoObservable.js.map +1 -1
- package/lib/jupyter/lumino/{LuminoReactPortal.d.ts → ReactPortalWidget.d.ts} +6 -6
- package/lib/jupyter/lumino/{LuminoReactPortal.js → ReactPortalWidget.js} +8 -10
- package/lib/jupyter/lumino/ReactPortalWidget.js.map +1 -0
- package/lib/jupyter/utils/Utils.d.ts +2 -0
- package/lib/jupyter/utils/Utils.js +8 -0
- package/lib/jupyter/utils/Utils.js.map +1 -0
- package/package.json +24 -3
- package/style/base.css +8 -2
- package/lib/app/tabs/CellTab.d.ts +0 -2
- package/lib/app/tabs/CellTab.js +0 -9
- package/lib/app/tabs/CellTab.js.map +0 -1
- package/lib/components/ipywidgets/IPyWidgetsComponent.d.ts +0 -5
- package/lib/components/ipywidgets/IPyWidgetsComponent.js +0 -9
- package/lib/components/ipywidgets/IPyWidgetsComponent.js.map +0 -1
- package/lib/components/notebook/cell/prompt/InputPrompt.js.map +0 -1
- package/lib/examples/NotebookRenderer.js.map +0 -1
- package/lib/examples/Panel.js.map +0 -1
- package/lib/examples/Plotly.js.map +0 -1
- package/lib/jupyter/ipywidgets/IPyWidgetsAttached.d.ts +0 -8
- package/lib/jupyter/ipywidgets/IPyWidgetsAttached.js +0 -15
- package/lib/jupyter/ipywidgets/IPyWidgetsAttached.js.map +0 -1
- package/lib/jupyter/lab/notebook/classic/classic.js.map +0 -1
- package/lib/jupyter/lab/notebook/classic/icons.d.ts +0 -2
- package/lib/jupyter/lab/notebook/classic/icons.js +0 -7
- package/lib/jupyter/lab/notebook/classic/icons.js.map +0 -1
- package/lib/jupyter/lab/notebook/classic/index.js.map +0 -1
- package/lib/jupyter/lab/notebook/header/index.js +0 -21
- package/lib/jupyter/lab/notebook/header/index.js.map +0 -1
- package/lib/jupyter/lumino/LuminoReactPortal.js.map +0 -1
- package/style/svg/notebookClassic.svg +0 -3
- /package/lib/components/ipywidgets/{IPyWidgetsComponent.css → IPyWidgetsOutput.css} +0 -0
- /package/lib/examples/{IpyReact.d.ts → IPyReact.d.ts} +0 -0
- /package/lib/examples/{NotebookRenderer.d.ts → NotebookGeoJson.d.ts} +0 -0
- /package/lib/examples/{Panel.d.ts → NotebookMatplotlib.d.ts} +0 -0
- /package/lib/examples/{Plotly.d.ts → NotebookPlotly.d.ts} +0 -0
- /package/lib/examples/{notebooks → samples}/IPyWidgetsExample1.ipynb.json +0 -0
- /package/lib/examples/{notebooks → samples}/NotebookExample1.ipynb.json +0 -0
- /package/lib/examples/{notebooks → samples}/NotebookExample2.ipynb.json +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
2
|
import '../../../style/index.css';
|
|
3
|
-
declare const plugins: (JupyterFrontEndPlugin<void> | JupyterFrontEndPlugin<import("./notebook/classic/
|
|
3
|
+
declare const plugins: (JupyterFrontEndPlugin<void> | JupyterFrontEndPlugin<import("./notebook/classic/classicRender").IClassicRenderTracker> | JupyterFrontEndPlugin<import("./notebook/dashboard/dashboard").IDashboardTracker> | JupyterFrontEndPlugin<import("@jupyterlab/notebook").NotebookPanel.IContentFactory>)[];
|
|
4
4
|
export default plugins;
|
package/lib/jupyter/lab/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { MainAreaWidget, ICommandPalette
|
|
1
|
+
import { MainAreaWidget, ICommandPalette } from '@jupyterlab/apputils';
|
|
2
2
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
3
3
|
import { ILauncher } from '@jupyterlab/launcher';
|
|
4
|
-
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
5
|
-
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
6
|
-
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
7
|
-
import { ITranslator } from '@jupyterlab/translation';
|
|
8
4
|
import { reactIcon } from '@jupyterlab/ui-components';
|
|
9
5
|
import { requestAPI } from './handler';
|
|
10
6
|
import { JupyterReactWidget } from './widget';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
7
|
+
import { NotebookHeaderExtension } from './notebook/header/NotebookHeader';
|
|
8
|
+
import notebookClassicPlugin from './notebook/classic/plugin';
|
|
9
|
+
import dashboardPlugin from './notebook/dashboard/plugin';
|
|
10
|
+
import notebookContentFactoryPlugin from './notebook/content/plugin';
|
|
13
11
|
import '../../../style/index.css';
|
|
14
12
|
/**
|
|
15
13
|
* The command IDs used by the plugin.
|
|
@@ -24,9 +22,9 @@ var CommandIDs;
|
|
|
24
22
|
const jupyterReactPlugin = {
|
|
25
23
|
id: '@datalayer/jupyter-react:plugin',
|
|
26
24
|
autoStart: true,
|
|
27
|
-
requires: [ICommandPalette
|
|
28
|
-
optional: [ISettingRegistry,
|
|
29
|
-
activate: (app, palette,
|
|
25
|
+
requires: [ICommandPalette],
|
|
26
|
+
optional: [ISettingRegistry, ILauncher],
|
|
27
|
+
activate: (app, palette, settingRegistry, launcher) => {
|
|
30
28
|
const { commands } = app;
|
|
31
29
|
const command = CommandIDs.create;
|
|
32
30
|
commands.addCommand(command, {
|
|
@@ -47,7 +45,7 @@ const jupyterReactPlugin = {
|
|
|
47
45
|
launcher.add({
|
|
48
46
|
command,
|
|
49
47
|
category: 'Datalayer',
|
|
50
|
-
rank:
|
|
48
|
+
rank: 10,
|
|
51
49
|
});
|
|
52
50
|
}
|
|
53
51
|
if (settingRegistry) {
|
|
@@ -67,13 +65,15 @@ const jupyterReactPlugin = {
|
|
|
67
65
|
.catch(reason => {
|
|
68
66
|
console.error(`The Jupyter Server jupyter_react extension appears to be missing.\n${reason}`);
|
|
69
67
|
});
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
app.docRegistry.addWidgetExtension('Notebook', new NotebookHeaderExtension(commands));
|
|
69
|
+
console.log('JupyterLab extension @datalayer/jupyter-react is activated.');
|
|
72
70
|
}
|
|
73
71
|
};
|
|
74
72
|
const plugins = [
|
|
75
73
|
jupyterReactPlugin,
|
|
76
74
|
notebookClassicPlugin,
|
|
75
|
+
dashboardPlugin,
|
|
76
|
+
notebookContentFactoryPlugin,
|
|
77
77
|
];
|
|
78
78
|
export default plugins;
|
|
79
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jupyter/lab/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jupyter/lab/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAC9D,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,4BAA4B,MAAM,2BAA2B,CAAC;AAErE,OAAO,0BAA0B,CAAC;AAElC;;GAEG;AACH,IAAU,UAAU,CAEnB;AAFD,WAAU,UAAU;IACL,iBAAM,GAAG,6BAA6B,CAAC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I,eAAe,EAAE;YACnB,eAAe;iBACZ,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;iBAC3B,IAAI,CAAC,QAAQ,CAAC,EAAE;gBACf,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC/E,CAAC,CAAC;iBACD,KAAK,CAAC,MAAM,CAAC,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,uDAAuD,EAAE,MAAM,CAAC,CAAC;YACjF,CAAC,CAAC,CAAC;SACN;QACD,UAAU,CAAM,YAAY,CAAC;aAC1B,IAAI,CAAC,IAAI,CAAC,EAAE;YACX,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC;aACD,KAAK,CAAC,MAAM,CAAC,EAAE;YACd,OAAO,CAAC,KAAK,CACX,sEAAsE,MAAM,EAAE,CAC/E,CAAC;QACJ,CAAC,CACF,CAAC;QACF,GAAG,CAAC,WAAW,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtF,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;IAC7E,CAAC;CACF,CAAA;AAED,MAAM,OAAO,GAAG;IACd,kBAAkB;IAClB,qBAAqB;IACrB,eAAe;IACf,4BAA4B;CAC7B,CAAA;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { IFrame, IWidgetTracker } from '@jupyterlab/apputils';
|
|
|
2
2
|
import { ABCWidgetFactory, DocumentRegistry, DocumentWidget } from '@jupyterlab/docregistry';
|
|
3
3
|
import { INotebookModel } from '@jupyterlab/notebook';
|
|
4
4
|
import { Token } from '@lumino/coreutils';
|
|
5
|
-
export type
|
|
6
|
-
export declare const
|
|
5
|
+
export type IClassicRenderTracker = IWidgetTracker<ClassicRender>;
|
|
6
|
+
export declare const IClassicRenderTracker: Token<IClassicRenderTracker>;
|
|
7
7
|
export declare const CLASSIC_RENDER_ICON_CLASS = "jp-MaterialIcon jp-NotebookIcon";
|
|
8
8
|
export declare class ClassicRender extends DocumentWidget<IFrame, INotebookModel> {
|
|
9
9
|
private _renderOnSave;
|
|
@@ -15,13 +15,13 @@ export declare class ClassicRender extends DocumentWidget<IFrame, INotebookModel
|
|
|
15
15
|
}
|
|
16
16
|
export declare namespace ClassicRender {
|
|
17
17
|
interface IOptions extends DocumentWidget.IOptionsOptionalContent<IFrame, INotebookModel> {
|
|
18
|
-
|
|
18
|
+
getClassicUrl: (path: string) => string;
|
|
19
19
|
renderOnSave?: boolean;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export declare class ClassicRenderFactory extends ABCWidgetFactory<ClassicRender, INotebookModel> {
|
|
23
|
-
private
|
|
23
|
+
private getClassicUrl;
|
|
24
24
|
defaultRenderOnSave: boolean;
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(getClassicUrl: (path: string) => string, options: DocumentRegistry.IWidgetFactoryOptions<ClassicRender>);
|
|
26
26
|
protected createNewWidget(context: DocumentRegistry.IContext<INotebookModel>): ClassicRender;
|
|
27
27
|
}
|
|
@@ -3,45 +3,25 @@ import { IFrame, ToolbarButton, ReactWidget } from '@jupyterlab/apputils';
|
|
|
3
3
|
import { ABCWidgetFactory, DocumentWidget } from '@jupyterlab/docregistry';
|
|
4
4
|
import { Token } from '@lumino/coreutils';
|
|
5
5
|
import { Signal } from '@lumino/signaling';
|
|
6
|
-
export const
|
|
6
|
+
export const IClassicRenderTracker = new Token('@datalayer/jupyter-react:IClassicRenderTracker');
|
|
7
7
|
export const CLASSIC_RENDER_ICON_CLASS = 'jp-MaterialIcon jp-NotebookIcon';
|
|
8
8
|
export class ClassicRender extends DocumentWidget {
|
|
9
9
|
_renderOnSave;
|
|
10
10
|
constructor(options) {
|
|
11
11
|
super({
|
|
12
12
|
...options,
|
|
13
|
-
content: new IFrame({ sandbox: ['allow-same-origin', 'allow-scripts'] })
|
|
13
|
+
content: new IFrame({ sandbox: ['allow-same-origin', 'allow-scripts'] }),
|
|
14
14
|
});
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
//console.log("EVENT: ", event);
|
|
18
|
-
switch (event.data?.level) {
|
|
19
|
-
case 'debug':
|
|
20
|
-
console.debug(...event.data?.msg);
|
|
21
|
-
break;
|
|
22
|
-
case 'info':
|
|
23
|
-
console.info(...event.data?.msg);
|
|
24
|
-
break;
|
|
25
|
-
case 'warn':
|
|
26
|
-
console.warn(...event.data?.msg);
|
|
27
|
-
break;
|
|
28
|
-
case 'error':
|
|
29
|
-
console.error(...event.data?.msg);
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
console.log(event);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
this.content.url = getPreviewUrl(context.path);
|
|
15
|
+
const { getClassicUrl, context, renderOnSave } = options;
|
|
16
|
+
this.content.url = getClassicUrl(context.path);
|
|
37
17
|
this.content.title.iconClass = CLASSIC_RENDER_ICON_CLASS;
|
|
38
18
|
this.renderOnSave = renderOnSave ? true : false;
|
|
39
19
|
context.pathChanged.connect(() => {
|
|
40
|
-
this.content.url =
|
|
20
|
+
this.content.url = getClassicUrl(context.path);
|
|
41
21
|
});
|
|
42
22
|
const reloadButton = new ToolbarButton({
|
|
43
23
|
iconClass: 'jp-RefreshIcon',
|
|
44
|
-
tooltip: 'Reload
|
|
24
|
+
tooltip: 'Reload Classic Render',
|
|
45
25
|
onClick: () => {
|
|
46
26
|
this.reload();
|
|
47
27
|
}
|
|
@@ -83,18 +63,18 @@ export class ClassicRender extends DocumentWidget {
|
|
|
83
63
|
}
|
|
84
64
|
}
|
|
85
65
|
export class ClassicRenderFactory extends ABCWidgetFactory {
|
|
86
|
-
|
|
66
|
+
getClassicUrl;
|
|
87
67
|
defaultRenderOnSave = false;
|
|
88
|
-
constructor(
|
|
68
|
+
constructor(getClassicUrl, options) {
|
|
89
69
|
super(options);
|
|
90
|
-
this.
|
|
70
|
+
this.getClassicUrl = getClassicUrl;
|
|
91
71
|
}
|
|
92
72
|
createNewWidget(context) {
|
|
93
73
|
return new ClassicRender({
|
|
94
74
|
context,
|
|
95
|
-
|
|
75
|
+
getClassicUrl: this.getClassicUrl,
|
|
96
76
|
renderOnSave: this.defaultRenderOnSave
|
|
97
77
|
});
|
|
98
78
|
}
|
|
99
79
|
}
|
|
100
|
-
//# sourceMappingURL=
|
|
80
|
+
//# sourceMappingURL=classicRender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classicRender.js","sourceRoot":"","sources":["../../../../../src/jupyter/lab/notebook/classic/classicRender.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAoB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,KAAK,CAC5C,gDAAgD,CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iCAAiC,CAAC;AAE3E,MAAM,OAAO,aAAc,SAAQ,cAAsC;IAC/D,aAAa,CAAU;IAE/B,YAAY,OAA+B;QACzC,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAI,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAE,CAAC;SACzE,CAAC,CAAC;QACH,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS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,CAAC;SACJ;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO;SACR;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,oEAAoE;QACpE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;QAC1D,IAAI,MAAM,CAAC,aAAa,EAAE;YACxB,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;SACxC;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY,CAAC,YAAqB;QACpC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;CAEF;AASD,MAAM,OAAO,oBAAqB,SAAQ,gBAA+C;IAC/E,aAAa,CAA0B;IACxC,mBAAmB,GAAG,KAAK,CAAC;IAEnC,YAAY,aAAuC,EAAE,OAA8D;QACjH,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAES,eAAe,CAAC,OAAkD;QAC1E,OAAO,IAAI,aAAa,CAAC;YACvB,OAAO;YACP,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,YAAY,EAAE,IAAI,CAAC,mBAAmB;SACvC,CAAC,CAAC;IACL,CAAC;CAEF"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
|
-
import {
|
|
2
|
+
import { IClassicRenderTracker } from './classicRender';
|
|
3
3
|
export declare namespace CommandIDs {
|
|
4
4
|
const classicRender = "notebook:render-with-classic";
|
|
5
5
|
const classicOpen = "notebook:open-with-classic";
|
|
6
6
|
}
|
|
7
|
+
export declare const CLASSIC_RENDER_WIDGET_FACTORY = "Classic Render";
|
|
7
8
|
/**
|
|
8
9
|
* Initialization data for the jupyterlab-preview extension.
|
|
9
10
|
*/
|
|
10
|
-
declare const notebookClassicPlugin: JupyterFrontEndPlugin<
|
|
11
|
+
declare const notebookClassicPlugin: JupyterFrontEndPlugin<IClassicRenderTracker>;
|
|
11
12
|
export default notebookClassicPlugin;
|
|
@@ -4,15 +4,15 @@ import { PageConfig } from '@jupyterlab/coreutils';
|
|
|
4
4
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
5
5
|
import { IMainMenu } from '@jupyterlab/mainmenu';
|
|
6
6
|
import { INotebookTracker } from '@jupyterlab/notebook';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
7
|
+
import classicRender from '@datalayer/icons-react/data1/DashboardColorIconLabIcon';
|
|
8
|
+
import { IClassicRenderTracker, ClassicRenderFactory } from './classicRender';
|
|
9
9
|
export var CommandIDs;
|
|
10
10
|
(function (CommandIDs) {
|
|
11
11
|
CommandIDs.classicRender = 'notebook:render-with-classic';
|
|
12
12
|
CommandIDs.classicOpen = 'notebook:open-with-classic';
|
|
13
13
|
})(CommandIDs || (CommandIDs = {}));
|
|
14
|
-
const
|
|
15
|
-
class
|
|
14
|
+
export const CLASSIC_RENDER_WIDGET_FACTORY = 'Classic Render';
|
|
15
|
+
class ClassicRenderButton {
|
|
16
16
|
_commands;
|
|
17
17
|
constructor(commands) {
|
|
18
18
|
this._commands = commands;
|
|
@@ -21,7 +21,7 @@ class NotebookPreviewButton {
|
|
|
21
21
|
const button = new ToolbarButton({
|
|
22
22
|
className: 'classicRender',
|
|
23
23
|
tooltip: 'Render with Classic',
|
|
24
|
-
icon:
|
|
24
|
+
icon: classicRender,
|
|
25
25
|
onClick: () => { this._commands.execute(CommandIDs.classicRender); }
|
|
26
26
|
});
|
|
27
27
|
panel.toolbar.insertAfter('cellType', 'classicRender', button);
|
|
@@ -36,7 +36,7 @@ const notebookClassicPlugin = {
|
|
|
36
36
|
autoStart: true,
|
|
37
37
|
requires: [INotebookTracker],
|
|
38
38
|
optional: [ICommandPalette, ILayoutRestorer, IMainMenu, ISettingRegistry],
|
|
39
|
-
provides:
|
|
39
|
+
provides: IClassicRenderTracker,
|
|
40
40
|
activate: (app, notebookTracker, palette, restorer, menu, settingRegistry) => {
|
|
41
41
|
const { commands, docRegistry } = app;
|
|
42
42
|
const tracker = new WidgetTracker({
|
|
@@ -47,41 +47,41 @@ const notebookClassicPlugin = {
|
|
|
47
47
|
command: 'docmanager:open',
|
|
48
48
|
args: panel => ({
|
|
49
49
|
path: panel.context.path,
|
|
50
|
-
factory:
|
|
50
|
+
factory: classicRenderFactory.name
|
|
51
51
|
}),
|
|
52
52
|
name: panel => panel.context.path,
|
|
53
53
|
when: app.serviceManager.ready
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
56
|
+
function getCurrentNotebookPanel(args) {
|
|
57
|
+
const notebookPanel = notebookTracker.currentWidget;
|
|
58
58
|
const activate = args['activate'] !== false;
|
|
59
|
-
if (activate &&
|
|
60
|
-
app.shell.activateById(
|
|
59
|
+
if (activate && notebookPanel) {
|
|
60
|
+
app.shell.activateById(notebookPanel.id);
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return notebookPanel;
|
|
63
63
|
}
|
|
64
64
|
function isEnabled() {
|
|
65
65
|
return (notebookTracker.currentWidget !== null &&
|
|
66
66
|
notebookTracker.currentWidget === app.shell.currentWidget);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function getClassicUrl(path) {
|
|
69
69
|
const baseUrl = PageConfig.getBaseUrl();
|
|
70
70
|
return `${baseUrl}tree/${path}`;
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
name:
|
|
72
|
+
const classicRenderFactory = new ClassicRenderFactory(getClassicUrl, {
|
|
73
|
+
name: CLASSIC_RENDER_WIDGET_FACTORY,
|
|
74
74
|
fileTypes: ['notebook'],
|
|
75
75
|
modelName: 'notebook'
|
|
76
76
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
void tracker.save(
|
|
77
|
+
classicRenderFactory.widgetCreated.connect((sender, classicRender) => {
|
|
78
|
+
classicRender.context.pathChanged.connect(() => {
|
|
79
|
+
void tracker.save(classicRender);
|
|
80
80
|
});
|
|
81
|
-
void tracker.add(
|
|
81
|
+
void tracker.add(classicRender);
|
|
82
82
|
});
|
|
83
83
|
const updateSettings = (settings) => {
|
|
84
|
-
|
|
84
|
+
classicRenderFactory.defaultRenderOnSave = settings.get('renderOnSave')
|
|
85
85
|
.composite;
|
|
86
86
|
};
|
|
87
87
|
if (settingRegistry) {
|
|
@@ -97,14 +97,14 @@ const notebookClassicPlugin = {
|
|
|
97
97
|
commands.addCommand(CommandIDs.classicRender, {
|
|
98
98
|
label: 'Render Notebook with Classic',
|
|
99
99
|
execute: async (args) => {
|
|
100
|
-
const
|
|
100
|
+
const notebookPanel = getCurrentNotebookPanel(args);
|
|
101
101
|
let context;
|
|
102
|
-
if (
|
|
103
|
-
context =
|
|
102
|
+
if (notebookPanel) {
|
|
103
|
+
context = notebookPanel.context;
|
|
104
104
|
await context.save();
|
|
105
105
|
commands.execute('docmanager:open', {
|
|
106
106
|
path: context.path,
|
|
107
|
-
factory:
|
|
107
|
+
factory: CLASSIC_RENDER_WIDGET_FACTORY,
|
|
108
108
|
options: {
|
|
109
109
|
mode: 'split-right'
|
|
110
110
|
}
|
|
@@ -114,14 +114,14 @@ const notebookClassicPlugin = {
|
|
|
114
114
|
isEnabled
|
|
115
115
|
});
|
|
116
116
|
commands.addCommand(CommandIDs.classicOpen, {
|
|
117
|
-
label: '
|
|
117
|
+
label: 'Render with Classic',
|
|
118
118
|
execute: async (args) => {
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
119
|
+
const notebookPanel = getCurrentNotebookPanel(args);
|
|
120
|
+
if (!notebookPanel) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
await
|
|
124
|
-
const previewUrl =
|
|
123
|
+
await notebookPanel.context.save();
|
|
124
|
+
const previewUrl = getClassicUrl(notebookPanel.context.path);
|
|
125
125
|
window.open(previewUrl);
|
|
126
126
|
},
|
|
127
127
|
isEnabled
|
|
@@ -142,13 +142,13 @@ const notebookClassicPlugin = {
|
|
|
142
142
|
}
|
|
143
143
|
], 1000);
|
|
144
144
|
}
|
|
145
|
-
const classicRenderButton = new
|
|
145
|
+
const classicRenderButton = new ClassicRenderButton(commands);
|
|
146
146
|
//
|
|
147
|
+
docRegistry.addWidgetFactory(classicRenderFactory);
|
|
147
148
|
docRegistry.addWidgetExtension('Notebook', classicRenderButton);
|
|
148
|
-
docRegistry.addWidgetFactory(classicFactory);
|
|
149
149
|
//
|
|
150
150
|
return tracker;
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
export default notebookClassicPlugin;
|
|
154
|
-
//# sourceMappingURL=
|
|
154
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../src/jupyter/lab/notebook/classic/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAiC,MAAM,sBAAsB,CAAC;AAIvF,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,EAAiB,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE7F,MAAM,KAAW,UAAU,CAG1B;AAHD,WAAiB,UAAU;IACZ,wBAAa,GAAG,8BA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OAAO,CAAC;IACjB,CAAC;CAEF,CAAA;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
2
|
+
import { Cell, IInputPrompt } from '@jupyterlab/cells';
|
|
3
|
+
import { IOutputPrompt } from '@jupyterlab/outputarea';
|
|
4
|
+
export declare class CountdownContentFactory extends NotebookPanel.ContentFactory {
|
|
5
|
+
constructor(options: Cell.ContentFactory.IOptions);
|
|
6
|
+
/** @override */
|
|
7
|
+
createInputPrompt(): IInputPrompt;
|
|
8
|
+
/** @override */
|
|
9
|
+
createOutputPrompt(): IOutputPrompt;
|
|
10
|
+
}
|
|
11
|
+
export default CountdownContentFactory;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
2
|
+
import CountdownInputPrompt from '../../../../components/notebook/cell/prompt/CountdownInputPrompt';
|
|
3
|
+
import CountdownOutputPrompt from '../../../../components/notebook/cell/prompt/CountdownOutputPrompt';
|
|
4
|
+
export class CountdownContentFactory extends NotebookPanel.ContentFactory {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
|
+
}
|
|
8
|
+
/** @override */
|
|
9
|
+
createInputPrompt() {
|
|
10
|
+
return new CountdownInputPrompt();
|
|
11
|
+
}
|
|
12
|
+
/** @override */
|
|
13
|
+
createOutputPrompt() {
|
|
14
|
+
return new CountdownOutputPrompt();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export default CountdownContentFactory;
|
|
18
|
+
//# sourceMappingURL=CountdownContentFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountdownContentFactory.js","sourceRoot":"","sources":["../../../../../src/jupyter/lab/notebook/content/CountdownContentFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,oBAAoB,MAAM,kEAAkE,CAAC;AACpG,OAAO,qBAAqB,MAAM,mEAAmE,CAAC;AAEtG,MAAM,OAAO,uBAAwB,SAAQ,aAAa,CAAC,cAAc;IACvE,YAAY,OAAqC;QAC/C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAChB,iBAAiB;QACf,OAAO,IAAI,oBAAoB,EAAE,CAAC;IACpC,CAAC;IAED,gBAAgB;IAChB,kBAAkB;QAChB,OAAO,IAAI,qBAAqB,EAAE,CAAC;IACrC,CAAC;CAEF;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
|
+
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
3
|
+
/**
|
|
4
|
+
* The notebook cell factory provider.
|
|
5
|
+
*/
|
|
6
|
+
declare const contentFactoryPlugin: JupyterFrontEndPlugin<NotebookPanel.IContentFactory>;
|
|
7
|
+
export default contentFactoryPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
2
|
+
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
3
|
+
import CountdownContentFactory from './CountdownContentFactory';
|
|
4
|
+
/**
|
|
5
|
+
* The notebook cell factory provider.
|
|
6
|
+
*/
|
|
7
|
+
const contentFactoryPlugin = {
|
|
8
|
+
id: '@datalayer/jupyter-react:notebook-extension-factory',
|
|
9
|
+
description: 'Provides the notebook cell factory.',
|
|
10
|
+
provides: NotebookPanel.IContentFactory,
|
|
11
|
+
requires: [IEditorServices],
|
|
12
|
+
autoStart: true,
|
|
13
|
+
activate: (app, editorServices) => {
|
|
14
|
+
const editorFactory = editorServices.factoryService.newInlineEditor;
|
|
15
|
+
return new CountdownContentFactory({ editorFactory });
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export default contentFactoryPlugin;
|
|
19
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../src/jupyter/lab/notebook/content/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,oBAAoB,GAAyD;IACjF,EAAE,EAAE,qDAAqD;IACzD,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,aAAa,CAAC,eAAe;IACvC,QAAQ,EAAE,CAAC,eAAe,CAAC;IAC3B,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,CAAC,GAAoB,EAAE,cAA+B,EAAE,EAAE;QAClE,MAAM,aAAa,GAAG,cAAc,CAAC,cAAc,CAAC,eAAe,CAAC;QACpE,OAAO,IAAI,uBAAuB,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC;IACxD,CAAC;CACF,CAAA;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DocumentRegistry } from '@jupyterlab/docregistry';
|
|
2
|
+
import { INotebookModel } from '@jupyterlab/notebook';
|
|
3
|
+
type Props = {
|
|
4
|
+
context: DocumentRegistry.IContext<INotebookModel>;
|
|
5
|
+
};
|
|
6
|
+
declare const Dashboard: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Dashboard;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Viewer from './../../../../../components/viewer/Viewer';
|
|
4
|
+
const Dashboard = (props) => {
|
|
5
|
+
const { context } = props;
|
|
6
|
+
const [model, setModel] = useState(context.model.sharedModel.toJSON());
|
|
7
|
+
context.model.contentChanged.connect((model, _) => {
|
|
8
|
+
setModel(model.sharedModel.toJSON());
|
|
9
|
+
});
|
|
10
|
+
return (_jsx(_Fragment, { children: _jsx(Viewer, { nbformat: model, outputs: false }) }));
|
|
11
|
+
};
|
|
12
|
+
export default Dashboard;
|
|
13
|
+
//# sourceMappingURL=Dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../../../../../../src/jupyter/lab/notebook/dashboard/components/Dashboard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,MAAM,MAAM,2CAA2C,CAAC;AAM/D,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,EAAE;IACjC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAChD,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IACH,OAAO,CACL,4BACE,KAAC,MAAM,IAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAI,GAC1C,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IWidgetTracker } from '@jupyterlab/apputils';
|
|
2
|
+
import { ABCWidgetFactory, DocumentRegistry, DocumentWidget } from '@jupyterlab/docregistry';
|
|
3
|
+
import { INotebookModel } from '@jupyterlab/notebook';
|
|
4
|
+
import { Token } from '@lumino/coreutils';
|
|
5
|
+
import DashboardWidget from './dashboardWidget';
|
|
6
|
+
export type IDashboardTracker = IWidgetTracker<Dashboard>;
|
|
7
|
+
export declare const IDashboardTracker: Token<IDashboardTracker>;
|
|
8
|
+
export declare const DASHBOARD_ICON_CLASS = "jp-MaterialIcon jp-NotebookIcon";
|
|
9
|
+
export declare class Dashboard extends DocumentWidget<DashboardWidget, INotebookModel> {
|
|
10
|
+
private _renderOnSave;
|
|
11
|
+
constructor(options: Dashboard.IOptions);
|
|
12
|
+
dispose(): void;
|
|
13
|
+
reload(): void;
|
|
14
|
+
get renderOnSave(): boolean;
|
|
15
|
+
set renderOnSave(renderOnSave: boolean);
|
|
16
|
+
}
|
|
17
|
+
export declare namespace Dashboard {
|
|
18
|
+
interface IOptions extends DocumentWidget.IOptionsOptionalContent<DashboardWidget, INotebookModel> {
|
|
19
|
+
renderOnSave?: boolean;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare class DashboardFactory extends ABCWidgetFactory<Dashboard, INotebookModel> {
|
|
23
|
+
defaultRenderOnSave: boolean;
|
|
24
|
+
constructor(options: DocumentRegistry.IWidgetFactoryOptions<Dashboard>);
|
|
25
|
+
protected createNewWidget(context: DocumentRegistry.IContext<INotebookModel>): Dashboard;
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ToolbarButton, ReactWidget } from '@jupyterlab/apputils';
|
|
3
|
+
import { ABCWidgetFactory, DocumentWidget } from '@jupyterlab/docregistry';
|
|
4
|
+
import { Token } from '@lumino/coreutils';
|
|
5
|
+
import { Signal } from '@lumino/signaling';
|
|
6
|
+
import DashboardWidget from './dashboardWidget';
|
|
7
|
+
export const IDashboardTracker = new Token('@datalayer/jupyter-react:IDashboardTracker');
|
|
8
|
+
export const DASHBOARD_ICON_CLASS = 'jp-MaterialIcon jp-NotebookIcon';
|
|
9
|
+
export class Dashboard extends DocumentWidget {
|
|
10
|
+
_renderOnSave;
|
|
11
|
+
constructor(options) {
|
|
12
|
+
super({
|
|
13
|
+
...options,
|
|
14
|
+
content: new DashboardWidget(options.context),
|
|
15
|
+
});
|
|
16
|
+
const { context, renderOnSave } = options;
|
|
17
|
+
this.content.title.iconClass = DASHBOARD_ICON_CLASS;
|
|
18
|
+
this.renderOnSave = renderOnSave ? true : false;
|
|
19
|
+
context.pathChanged.connect(() => {
|
|
20
|
+
// this.content.url = getClassicUrl(context.path);
|
|
21
|
+
});
|
|
22
|
+
const reloadButton = new ToolbarButton({
|
|
23
|
+
iconClass: 'jp-RefreshIcon',
|
|
24
|
+
tooltip: 'Reload Dashboard',
|
|
25
|
+
onClick: () => {
|
|
26
|
+
this.reload();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const renderOnSaveCheckbox = ReactWidget.create(_jsxs("label", { className: "jp-Preview-renderOnSave", children: [_jsx("input", { style: { verticalAlign: 'middle' }, name: "renderOnSave", type: "checkbox", defaultChecked: renderOnSave, onChange: (event) => {
|
|
30
|
+
this._renderOnSave = event.target.checked;
|
|
31
|
+
} }), "Render on Save"] }));
|
|
32
|
+
this.toolbar.addItem('reload', reloadButton);
|
|
33
|
+
if (context) {
|
|
34
|
+
this.toolbar.addItem('renderOnSave', renderOnSaveCheckbox);
|
|
35
|
+
void context.ready.then(() => {
|
|
36
|
+
context.fileChanged.connect(() => {
|
|
37
|
+
if (this.renderOnSave) {
|
|
38
|
+
this.reload();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
dispose() {
|
|
45
|
+
if (this.isDisposed) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
super.dispose();
|
|
49
|
+
Signal.clearData(this);
|
|
50
|
+
}
|
|
51
|
+
reload() {
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
53
|
+
const iframe = this.content.node.querySelector('iframe');
|
|
54
|
+
if (iframe.contentWindow) {
|
|
55
|
+
iframe.contentWindow.location.reload();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
get renderOnSave() {
|
|
59
|
+
return this._renderOnSave;
|
|
60
|
+
}
|
|
61
|
+
set renderOnSave(renderOnSave) {
|
|
62
|
+
this._renderOnSave = renderOnSave;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export class DashboardFactory extends ABCWidgetFactory {
|
|
66
|
+
defaultRenderOnSave = false;
|
|
67
|
+
constructor(options) {
|
|
68
|
+
super(options);
|
|
69
|
+
}
|
|
70
|
+
createNewWidget(context) {
|
|
71
|
+
return new Dashboard({
|
|
72
|
+
context,
|
|
73
|
+
renderOnSave: this.defaultRenderOnSave
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../../../../src/jupyter/lab/notebook/dashboard/dashboard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAoB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,KAAK,CACxC,4CAA4C,CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,iCAAiC,CAAC;AAEtE,MAAM,OAAO,SAAU,SAAQ,cAA+C;IACpE,aAAa,CAAU;IAE/B,YAAY,OAA2B;QACrC,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC;SAC9C,CAAC,CAAC;QACH,MAAM,EAAE,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AAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO;SACR;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,oEAAoE;QACpE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;QAC1D,IAAI,MAAM,CAAC,aAAa,EAAE;YACxB,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;SACxC;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY,CAAC,YAAqB;QACpC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;CAEF;AAQD,MAAM,OAAO,gBAAiB,SAAQ,gBAA2C;IACxE,mBAAmB,GAAG,KAAK,CAAC;IAEnC,YAAY,OAA0D;QACpE,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAES,eAAe,CAAC,OAAkD;QAC1E,OAAO,IAAI,SAAS,CAAC;YACnB,OAAO;YACP,YAAY,EAAE,IAAI,CAAC,mBAAmB;SACvC,CAAC,CAAC;IACL,CAAC;CAEF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactWidget } from '@jupyterlab/apputils';
|
|
2
|
+
import { DocumentRegistry } from '@jupyterlab/docregistry';
|
|
3
|
+
import { INotebookModel } from '@jupyterlab/notebook';
|
|
4
|
+
declare class DashboardWidget extends ReactWidget {
|
|
5
|
+
private _context;
|
|
6
|
+
constructor(context: DocumentRegistry.IContext<INotebookModel>);
|
|
7
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
export default DashboardWidget;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ReactWidget } from '@jupyterlab/apputils';
|
|
3
|
+
import { ThemeProvider, BaseStyles, Box } from '@primer/react';
|
|
4
|
+
import Dashboard from './components/Dashboard';
|
|
5
|
+
class DashboardWidget extends ReactWidget {
|
|
6
|
+
_context;
|
|
7
|
+
constructor(context) {
|
|
8
|
+
super();
|
|
9
|
+
this._context = context;
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (_jsx(ThemeProvider, { children: _jsx(BaseStyles, { children: _jsx(Box, { m: 3, children: _jsx(Dashboard, { context: this._context }) }) }) }));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export default DashboardWidget;
|
|
16
|
+
//# sourceMappingURL=dashboardWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardWidget.js","sourceRoot":"","sources":["../../../../../src/jupyter/lab/notebook/dashboard/dashboardWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,MAAM,eAAgB,SAAQ,WAAW;IAC/B,QAAQ,CAA2C;IAE3D,YAAY,OAAkD;QAC5D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,MAAM;QACJ,OAAO,CACL,KAAC,aAAa,cACZ,KAAC,UAAU,cACT,KAAC,GAAG,IAAC,CAAC,EAAE,CAAC,YACP,KAAC,SAAS,IAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,GAChC,GACK,GACC,CACjB,CAAC;IACJ,CAAC;CACF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
|
+
import { IDashboardTracker } from './dashboard';
|
|
3
|
+
export declare namespace CommandIDs {
|
|
4
|
+
const dashboardRender = "notebook:render-with-dashboard";
|
|
5
|
+
const dashboardOpen = "notebook:open-with-dashboard";
|
|
6
|
+
}
|
|
7
|
+
export declare const DASHBOARD_WIDGET_FACTORY = "Dashboard Preview";
|
|
8
|
+
/**
|
|
9
|
+
* Initialization data for the jupyterlab-preview extension.
|
|
10
|
+
*/
|
|
11
|
+
declare const dashboardPlugin: JupyterFrontEndPlugin<IDashboardTracker>;
|
|
12
|
+
export default dashboardPlugin;
|