@datalayer/jupyter-react 0.20.1 → 0.21.0
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.d.ts +1 -1
- package/lib/app/JupyterReact.js +1 -1
- package/lib/app/JupyterReact.js.map +1 -1
- package/lib/app/index.d.ts +1 -0
- package/lib/{jupyter/lab → app}/index.js +1 -1
- package/lib/app/index.js.map +1 -0
- package/lib/components/jupyterlab/JupyterLabAppAdapter.js +1 -1
- package/lib/components/jupyterlab/JupyterLabAppAdapter.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabAppPlugins.js +2 -2
- package/lib/components/jupyterlab/JupyterLabAppPlugins.js.map +1 -1
- package/lib/components/kernel/inspector/widget.js +2 -1
- package/lib/components/kernel/inspector/widget.js.map +1 -1
- package/lib/components/notebook/BaseNotebook.d.ts +4 -8
- package/lib/components/notebook/BaseNotebook.js +111 -53
- package/lib/components/notebook/BaseNotebook.js.map +1 -1
- package/lib/components/notebook/SimpleNotebook.d.ts +1 -5
- package/lib/components/notebook/SimpleNotebook.js +2 -2
- package/lib/components/notebook/SimpleNotebook.js.map +1 -1
- package/lib/examples/JupyterLabApp.js +0 -2
- package/lib/examples/JupyterLabApp.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/jupyter/index.d.ts +0 -1
- package/lib/jupyter/index.js +0 -1
- package/lib/jupyter/index.js.map +1 -1
- package/lib/jupyter/services/ServiceManagerLess.d.ts +1 -0
- package/lib/jupyter/services/ServiceManagerLess.js +1 -0
- package/lib/jupyter/services/ServiceManagerLess.js.map +1 -1
- package/lib/theme/JupyterLabCss.d.ts +4 -8
- package/lib/theme/JupyterLabCss.js +8 -8
- package/lib/theme/JupyterLabCss.js.map +1 -1
- package/lib/theme/JupyterReactTheme.d.ts +6 -9
- package/lib/theme/JupyterReactTheme.js +4 -9
- package/lib/theme/JupyterReactTheme.js.map +1 -1
- package/lib/utils/cursorExtension.d.ts +23 -0
- package/lib/utils/cursorExtension.js +292 -0
- package/lib/utils/cursorExtension.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/package.json +29 -75
- package/lib/jupyter/lab/__tests__/datalayer.spec.d.ts +0 -0
- package/lib/jupyter/lab/__tests__/datalayer.spec.js +0 -11
- package/lib/jupyter/lab/__tests__/datalayer.spec.js.map +0 -1
- package/lib/jupyter/lab/index.d.ts +0 -1
- package/lib/jupyter/lab/index.js.map +0 -1
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.d.ts +0 -6
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js +0 -17
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js.map +0 -1
- package/lib/jupyter/lab/notebook/content/index.d.ts +0 -0
- package/lib/jupyter/lab/notebook/content/index.js +0 -6
- package/lib/jupyter/lab/notebook/content/index.js.map +0 -1
- package/lib/jupyter/lab/notebook/content/plugin.d.ts +0 -7
- package/lib/jupyter/lab/notebook/content/plugin.js +0 -24
- package/lib/jupyter/lab/notebook/content/plugin.js.map +0 -1
- package/lib/jupyter/lab/notebook/editor/history.d.ts +0 -193
- package/lib/jupyter/lab/notebook/editor/history.js +0 -304
- package/lib/jupyter/lab/notebook/editor/history.js.map +0 -1
- package/lib/jupyter/lab/notebook/editor/index.d.ts +0 -0
- package/lib/jupyter/lab/notebook/editor/index.js +0 -6
- package/lib/jupyter/lab/notebook/editor/index.js.map +0 -1
- package/lib/jupyter/lab/notebook/editor/plugin.d.ts +0 -7
- package/lib/jupyter/lab/notebook/editor/plugin.js +0 -62
- package/lib/jupyter/lab/notebook/editor/plugin.js.map +0 -1
- package/lib/jupyter/lab/notebook/editor/widgetfactory.d.ts +0 -96
- package/lib/jupyter/lab/notebook/editor/widgetfactory.js +0 -89
- package/lib/jupyter/lab/notebook/editor/widgetfactory.js.map +0 -1
- package/lib/jupyter/lab/notebook/index.d.ts +0 -0
- package/lib/jupyter/lab/notebook/index.js +0 -6
- package/lib/jupyter/lab/notebook/index.js.map +0 -1
- package/lib/jupyter/lab/plugin.d.ts +0 -4
- package/lib/jupyter/lab/plugin.js +0 -104
- package/lib/jupyter/lab/plugin.js.map +0 -1
- package/lib/jupyter/lab/widget.d.ts +0 -8
- package/lib/jupyter/lab/widget.js +0 -15
- package/lib/jupyter/lab/widget.js.map +0 -1
- package/schema/plugin.json +0 -52
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*/
|
|
6
|
-
import { ILayoutRestorer } from '@jupyterlab/application';
|
|
7
|
-
import { MainAreaWidget, ICommandPalette, WidgetTracker } from '@jupyterlab/apputils';
|
|
8
|
-
import { ILauncher } from '@jupyterlab/launcher';
|
|
9
|
-
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
10
|
-
import { ServerConnection } from '@jupyterlab/services';
|
|
11
|
-
import icon from '@datalayer/icons-react/data2/AtomSymbolIconJupyterLab';
|
|
12
|
-
import { requestAPI } from './../JupyterHandlers';
|
|
13
|
-
import { JupyterReactWidget } from './widget';
|
|
14
|
-
import { contentFactoryPlugin as notebookContentFactoryPlugin } from './notebook/content/plugin';
|
|
15
|
-
import { widgetFactoryPlugin as notebookWidgetFactoryPlugin } from './notebook/editor/plugin';
|
|
16
|
-
import '../../../style/index.css';
|
|
17
|
-
/**
|
|
18
|
-
* The command IDs used by the plugin.
|
|
19
|
-
*/
|
|
20
|
-
var CommandIDs;
|
|
21
|
-
(function (CommandIDs) {
|
|
22
|
-
CommandIDs.create = 'create-jupyter-react-widget';
|
|
23
|
-
})(CommandIDs || (CommandIDs = {}));
|
|
24
|
-
/**
|
|
25
|
-
* Initialization data for the @datalayer/jupyter-react extension.
|
|
26
|
-
*/
|
|
27
|
-
const jupyterReactPlugin = {
|
|
28
|
-
id: '@datalayer/jupyter-react:plugin',
|
|
29
|
-
autoStart: true,
|
|
30
|
-
requires: [ICommandPalette],
|
|
31
|
-
optional: [ISettingRegistry, ILauncher, ILayoutRestorer],
|
|
32
|
-
activate: (app, palette, settingRegistry, launcher, restorer) => {
|
|
33
|
-
const { commands } = app;
|
|
34
|
-
const command = CommandIDs.create;
|
|
35
|
-
const tracker = new WidgetTracker({
|
|
36
|
-
namespace: 'jupyter-react',
|
|
37
|
-
});
|
|
38
|
-
if (restorer) {
|
|
39
|
-
void restorer.restore(tracker, {
|
|
40
|
-
command,
|
|
41
|
-
name: () => 'jupyter-react',
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
commands.addCommand(command, {
|
|
45
|
-
caption: 'Show Jupyter React',
|
|
46
|
-
label: 'Jupyter React',
|
|
47
|
-
icon,
|
|
48
|
-
execute: () => {
|
|
49
|
-
const content = new JupyterReactWidget(app);
|
|
50
|
-
const widget = new MainAreaWidget({ content });
|
|
51
|
-
widget.title.label = 'Jupyter React';
|
|
52
|
-
widget.title.icon = icon;
|
|
53
|
-
app.shell.add(widget, 'main');
|
|
54
|
-
tracker.add(widget);
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
const category = 'Datalayer';
|
|
58
|
-
palette.addItem({ command, category, args: { origin: 'from palette' } });
|
|
59
|
-
if (launcher) {
|
|
60
|
-
launcher.add({
|
|
61
|
-
command,
|
|
62
|
-
category,
|
|
63
|
-
rank: 2.4,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
const settingsUpdated = (settings) => {
|
|
67
|
-
const showInLauncher = settings.get('showInLauncher')
|
|
68
|
-
.composite;
|
|
69
|
-
if (launcher && showInLauncher) {
|
|
70
|
-
launcher.add({
|
|
71
|
-
command,
|
|
72
|
-
category,
|
|
73
|
-
rank: 2.4,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
if (settingRegistry) {
|
|
78
|
-
settingRegistry
|
|
79
|
-
.load(jupyterReactPlugin.id)
|
|
80
|
-
.then(settings => {
|
|
81
|
-
console.log('@datalayer/jupyter-react settings loaded:', settings.composite);
|
|
82
|
-
settingsUpdated(settings);
|
|
83
|
-
settings.changed.connect(settingsUpdated);
|
|
84
|
-
})
|
|
85
|
-
.catch(reason => {
|
|
86
|
-
console.error('Failed to load settings for @datalayer/jupyter-react.', reason);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
requestAPI(ServerConnection.makeSettings(), 'jupyter_react', 'config')
|
|
90
|
-
.then(data => {
|
|
91
|
-
console.log(data);
|
|
92
|
-
})
|
|
93
|
-
.catch(reason => {
|
|
94
|
-
console.error(`The Jupyter Server jupyter_react extension extension.\n${reason}`);
|
|
95
|
-
});
|
|
96
|
-
console.log('JupyterLab plugin @datalayer/jupyter-react is activated.');
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
export default [
|
|
100
|
-
jupyterReactPlugin,
|
|
101
|
-
notebookContentFactoryPlugin,
|
|
102
|
-
notebookWidgetFactoryPlugin,
|
|
103
|
-
];
|
|
104
|
-
//# sourceMappingURL=plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/jupyter/lab/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA0C,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,IAAI,MAAM,uDAAuD,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,kBAAkB,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AAM,CACP,CAAC;YACJ,CAAC,CAAC,CAAC;SACN;QACD,UAAU,CAAM,gBAAgB,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,QAAQ,CAAC;aACxE,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,0DAA0D,MAAM,EAAE,CACnE,CAAC;QACJ,CAAC,CAAC,CAAC;QACL,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IAC1E,CAAC;CACF,CAAC;AAEF,eAAe;IACb,kBAAkB;IAClB,4BAA4B;IAC5B,2BAA2B;CAC5B,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
3
|
-
import { ReactWidget } from '@jupyterlab/apputils';
|
|
4
|
-
export declare class JupyterReactWidget extends ReactWidget {
|
|
5
|
-
private _app;
|
|
6
|
-
constructor(app: JupyterFrontEnd);
|
|
7
|
-
render(): JSX.Element;
|
|
8
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ReactWidget } from '@jupyterlab/apputils';
|
|
3
|
-
import JupyterReact from '../../app/JupyterReact';
|
|
4
|
-
export class JupyterReactWidget extends ReactWidget {
|
|
5
|
-
_app;
|
|
6
|
-
constructor(app) {
|
|
7
|
-
super();
|
|
8
|
-
this._app = app;
|
|
9
|
-
this.addClass('dla-Container');
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return _jsx(JupyterReact, { app: this._app });
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=widget.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/jupyter/lab/widget.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACzC,IAAI,CAAkB;IAE9B,YAAY,GAAoB;QAC9B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,OAAO,KAAC,YAAY,IAAC,GAAG,EAAE,IAAI,CAAC,IAAI,GAAI,CAAC;IAC1C,CAAC;CACF"}
|
package/schema/plugin.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Jupyter React",
|
|
3
|
-
"description": "Jupyter React settings.",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"showInLauncher": {
|
|
7
|
-
"title": "Show Jupyter React in the launcher",
|
|
8
|
-
"description": "Show Jupyter React in the launcher",
|
|
9
|
-
"default": false,
|
|
10
|
-
"type": "boolean"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"additionalProperties": false,
|
|
14
|
-
"_jupyter.lab.toolbars": {
|
|
15
|
-
"Cell": [
|
|
16
|
-
{
|
|
17
|
-
"name": "run",
|
|
18
|
-
"icon": "ui-components:react",
|
|
19
|
-
"command": "runmenu:run"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"Notebook": [
|
|
23
|
-
{
|
|
24
|
-
"name": "run",
|
|
25
|
-
"icon": "ui-components:react",
|
|
26
|
-
"command": "runmenu:run"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"_jupyter.lab.shortcuts": [
|
|
31
|
-
{
|
|
32
|
-
"command": "my-command",
|
|
33
|
-
"keys": ["Accel T"],
|
|
34
|
-
"selector": ".jp-mod-searchable"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"_jupyter.lab.menus": {
|
|
38
|
-
"main": [
|
|
39
|
-
{
|
|
40
|
-
"id": "jp-mainmenu-myextension",
|
|
41
|
-
"label": "My Menu",
|
|
42
|
-
"items": [
|
|
43
|
-
{
|
|
44
|
-
"command": "my-command",
|
|
45
|
-
"rank": 500
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"rank": 100
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
}
|