@jupytergis/jupytergis-lab 0.6.2 → 0.7.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/index.js +3 -43
- package/lib/notebookrenderer.d.ts +5 -1
- package/lib/notebookrenderer.js +17 -4
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { CommandIDs,
|
|
2
|
-
import {
|
|
3
|
-
import { ILayoutRestorer, } from '@jupyterlab/application';
|
|
1
|
+
import { CommandIDs, GlobalStateDbManager, addCommands, createDefaultLayerRegistry, rasterSubMenu, vectorSubMenu, } from '@jupytergis/base';
|
|
2
|
+
import { IJGISFormSchemaRegistryToken, IJGISLayerBrowserRegistryToken, IJupyterGISDocTracker, ProcessingMerge, } from '@jupytergis/schema';
|
|
4
3
|
import { ICompletionProviderManager } from '@jupyterlab/completer';
|
|
5
4
|
import { IMainMenu } from '@jupyterlab/mainmenu';
|
|
6
5
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
7
6
|
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
|
|
8
7
|
import { Menu } from '@lumino/widgets';
|
|
9
8
|
import { notebookRendererPlugin } from './notebookrenderer';
|
|
10
|
-
const NAME_SPACE = 'jupytergis';
|
|
11
9
|
const plugin = {
|
|
12
10
|
id: 'jupytergis:lab:main-menu',
|
|
13
11
|
autoStart: true,
|
|
@@ -147,44 +145,6 @@ const plugin = {
|
|
|
147
145
|
}
|
|
148
146
|
},
|
|
149
147
|
};
|
|
150
|
-
const controlPanel = {
|
|
151
|
-
id: 'jupytergis:lab:controlpanel',
|
|
152
|
-
autoStart: true,
|
|
153
|
-
requires: [
|
|
154
|
-
ILayoutRestorer,
|
|
155
|
-
IJupyterGISDocTracker,
|
|
156
|
-
IJGISFormSchemaRegistryToken,
|
|
157
|
-
IStateDB,
|
|
158
|
-
IAnnotationToken,
|
|
159
|
-
],
|
|
160
|
-
activate: (app, restorer, tracker, formSchemaRegistry, state, annotationModel) => {
|
|
161
|
-
const controlModel = new ControlPanelModel({ tracker });
|
|
162
|
-
const leftControlPanel = new LeftPanelWidget({
|
|
163
|
-
model: controlModel,
|
|
164
|
-
tracker,
|
|
165
|
-
state,
|
|
166
|
-
commands: app.commands,
|
|
167
|
-
});
|
|
168
|
-
leftControlPanel.id = 'jupytergis::leftControlPanel';
|
|
169
|
-
leftControlPanel.title.caption = 'JupyterGIS Control Panel';
|
|
170
|
-
leftControlPanel.title.icon = logoMiniIcon;
|
|
171
|
-
const rightControlPanel = new RightPanelWidget({
|
|
172
|
-
model: controlModel,
|
|
173
|
-
tracker,
|
|
174
|
-
formSchemaRegistry,
|
|
175
|
-
annotationModel,
|
|
176
|
-
});
|
|
177
|
-
rightControlPanel.id = 'jupytergis::rightControlPanel';
|
|
178
|
-
rightControlPanel.title.caption = 'JupyterGIS Control Panel';
|
|
179
|
-
rightControlPanel.title.icon = logoMiniIcon;
|
|
180
|
-
if (restorer) {
|
|
181
|
-
restorer.add(leftControlPanel, `${NAME_SPACE}-left`);
|
|
182
|
-
restorer.add(rightControlPanel, `${NAME_SPACE}-right`);
|
|
183
|
-
}
|
|
184
|
-
app.shell.add(leftControlPanel, 'left', { rank: 2000 });
|
|
185
|
-
app.shell.add(rightControlPanel, 'right', { rank: 2000 });
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
148
|
/**
|
|
189
149
|
* Populates the application menus for the notebook.
|
|
190
150
|
*/
|
|
@@ -253,4 +213,4 @@ function buildGroupsMenu(contextMenu, tracker) {
|
|
|
253
213
|
command: CommandIDs.moveLayerToNewGroup,
|
|
254
214
|
});
|
|
255
215
|
}
|
|
256
|
-
export default [plugin,
|
|
216
|
+
export default [plugin, notebookRendererPlugin];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JupyterGISOutputWidget, JupyterGISTracker } from '@jupytergis/base';
|
|
2
|
-
import { IJGISExternalCommandRegistry, JupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import { IJGISExternalCommandRegistry, JupyterGISModel, IJGISFormSchemaRegistry, IAnnotationModel } from '@jupytergis/schema';
|
|
3
3
|
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
4
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
4
5
|
import { CommandRegistry } from '@lumino/commands';
|
|
5
6
|
import { Panel } from '@lumino/widgets';
|
|
6
7
|
import { JupyterYModel } from 'yjs-widgets';
|
|
@@ -30,6 +31,9 @@ interface IOptions {
|
|
|
30
31
|
model: JupyterGISModel;
|
|
31
32
|
externalCommands?: IJGISExternalCommandRegistry;
|
|
32
33
|
tracker?: JupyterGISTracker;
|
|
34
|
+
formSchemaRegistry?: IJGISFormSchemaRegistry;
|
|
35
|
+
state?: IStateDB;
|
|
36
|
+
annotationModel?: IAnnotationModel;
|
|
33
37
|
}
|
|
34
38
|
export declare const notebookRendererPlugin: JupyterFrontEndPlugin<void>;
|
|
35
39
|
export {};
|
package/lib/notebookrenderer.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
|
|
2
2
|
import { JupyterGISOutputWidget, JupyterGISPanel, ToolbarWidget, } from '@jupytergis/base';
|
|
3
|
-
import { IJGISExternalCommandRegistryToken, IJupyterGISDocTracker, JupyterGISModel, } from '@jupytergis/schema';
|
|
3
|
+
import { IJGISExternalCommandRegistryToken, IJupyterGISDocTracker, JupyterGISModel, IJGISFormSchemaRegistryToken, IAnnotationToken, } from '@jupytergis/schema';
|
|
4
4
|
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
5
5
|
import { ConsolePanel } from '@jupyterlab/console';
|
|
6
6
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
7
7
|
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
8
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
8
9
|
import { MessageLoop } from '@lumino/messaging';
|
|
9
10
|
import { Panel, Widget } from '@lumino/widgets';
|
|
10
11
|
import { IJupyterYWidgetManager, JupyterYDoc, JupyterYModel, } from 'yjs-widgets';
|
|
@@ -19,8 +20,14 @@ export class YJupyterGISLuminoWidget extends Panel {
|
|
|
19
20
|
* @param options
|
|
20
21
|
*/
|
|
21
22
|
this._buildWidget = (options) => {
|
|
22
|
-
const { commands, model, externalCommands, tracker } = options;
|
|
23
|
-
const content = new JupyterGISPanel({
|
|
23
|
+
const { commands, model, externalCommands, tracker, formSchemaRegistry, state, annotationModel, } = options;
|
|
24
|
+
const content = new JupyterGISPanel({
|
|
25
|
+
model,
|
|
26
|
+
commandRegistry: commands,
|
|
27
|
+
formSchemaRegistry,
|
|
28
|
+
state,
|
|
29
|
+
annotationModel,
|
|
30
|
+
});
|
|
24
31
|
let toolbar = undefined;
|
|
25
32
|
if (model.filePath) {
|
|
26
33
|
toolbar = new ToolbarWidget({
|
|
@@ -68,8 +75,11 @@ export const notebookRendererPlugin = {
|
|
|
68
75
|
IJupyterGISDocTracker,
|
|
69
76
|
IJupyterYWidgetManager,
|
|
70
77
|
ICollaborativeDrive,
|
|
78
|
+
IStateDB,
|
|
79
|
+
IJGISFormSchemaRegistryToken,
|
|
80
|
+
IAnnotationToken,
|
|
71
81
|
],
|
|
72
|
-
activate: (app, externalCommandRegistry, jgisTracker, yWidgetManager, drive) => {
|
|
82
|
+
activate: (app, externalCommandRegistry, jgisTracker, yWidgetManager, drive, formSchemaRegistry, state, annotationModel) => {
|
|
73
83
|
if (!yWidgetManager) {
|
|
74
84
|
console.error('Missing IJupyterYWidgetManager token!');
|
|
75
85
|
return;
|
|
@@ -131,6 +141,9 @@ export const notebookRendererPlugin = {
|
|
|
131
141
|
model: yModel.jupyterGISModel,
|
|
132
142
|
externalCommands: externalCommandRegistry,
|
|
133
143
|
tracker: jgisTracker,
|
|
144
|
+
annotationModel,
|
|
145
|
+
state,
|
|
146
|
+
formSchemaRegistry,
|
|
134
147
|
});
|
|
135
148
|
this._jgisWidget = widget.jgisWidget;
|
|
136
149
|
MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupytergis/jupytergis-lab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "JupyterGIS Lab extension.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@jupyter/collaborative-drive": "^3.0.0",
|
|
56
|
-
"@jupytergis/base": "^0.
|
|
57
|
-
"@jupytergis/schema": "^0.
|
|
56
|
+
"@jupytergis/base": "^0.7.0",
|
|
57
|
+
"@jupytergis/schema": "^0.7.0",
|
|
58
58
|
"@jupyterlab/application": "^4.3.0",
|
|
59
59
|
"@jupyterlab/apputils": "^4.3.0",
|
|
60
60
|
"@jupyterlab/completer": "^4.3.0",
|