@jupytergis/jupytergis-lab 0.13.2 → 0.14.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 CHANGED
@@ -23,46 +23,42 @@ const plugin = {
23
23
  return (tracker.currentWidget !== null &&
24
24
  tracker.currentWidget === app.shell.currentWidget);
25
25
  };
26
- const LAYER = '.jp-gis-layerItem:not(.jp-gis-layerGroup)';
26
+ const GIS_ITEM = '.jp-gis-layerItem:not(.jp-gis-layerGroup)';
27
+ const GIS_LAYER_ITEM = '.jp-gis-layerItem:not(.jp-gis-layerGroup):not(.jp-gis-storySegmentLayer)';
27
28
  createDefaultLayerRegistry(layerBrowserRegistry);
28
29
  const stateDbManager = GlobalStateDbManager.getInstance();
29
30
  stateDbManager.initialize(state);
30
31
  addCommands(app, tracker, translator, formSchemaRegistry, layerBrowserRegistry, state, completionProviderManager);
31
- app.contextMenu.addItem({
32
- selector: '.jp-gis-source.jp-gis-sourceUnused',
33
- rank: 1,
34
- command: CommandIDs.removeSource,
35
- });
36
- app.contextMenu.addItem({
37
- selector: '.jp-gis-source',
38
- rank: 1,
39
- command: CommandIDs.renameSource,
40
- });
41
32
  // LAYERS and LAYER GROUPS context menu
42
33
  app.contextMenu.addItem({
43
34
  command: CommandIDs.symbology,
44
- selector: LAYER,
35
+ selector: GIS_LAYER_ITEM,
45
36
  rank: 1,
46
37
  });
47
38
  // Separator
48
39
  app.contextMenu.addItem({
49
40
  type: 'separator',
50
- selector: LAYER,
41
+ selector: GIS_ITEM,
51
42
  rank: 1,
52
43
  });
53
44
  app.contextMenu.addItem({
54
45
  command: CommandIDs.removeSelected,
55
- selector: LAYER,
46
+ selector: GIS_ITEM,
56
47
  rank: 2,
57
48
  });
58
49
  app.contextMenu.addItem({
59
50
  command: CommandIDs.renameSelected,
60
- selector: LAYER,
51
+ selector: GIS_ITEM,
52
+ rank: 2,
53
+ });
54
+ app.contextMenu.addItem({
55
+ command: CommandIDs.duplicateSelected,
56
+ selector: GIS_ITEM,
61
57
  rank: 2,
62
58
  });
63
59
  app.contextMenu.addItem({
64
60
  command: CommandIDs.zoomToLayer,
65
- selector: LAYER,
61
+ selector: GIS_ITEM,
66
62
  rank: 2,
67
63
  });
68
64
  // Create the Download submenu
@@ -75,7 +71,7 @@ const plugin = {
75
71
  // Add the Download submenu to the context menu
76
72
  app.contextMenu.addItem({
77
73
  type: 'submenu',
78
- selector: LAYER,
74
+ selector: GIS_LAYER_ITEM,
79
75
  rank: 2,
80
76
  submenu: downloadSubmenu,
81
77
  });
@@ -92,20 +88,20 @@ const plugin = {
92
88
  }
93
89
  app.contextMenu.addItem({
94
90
  type: 'submenu',
95
- selector: LAYER,
91
+ selector: GIS_LAYER_ITEM,
96
92
  rank: 2,
97
93
  submenu: processingSubmenu,
98
94
  });
99
- const moveLayerSubmenu = new Menu({ commands: app.commands });
100
- moveLayerSubmenu.title.label = translator
95
+ const moveSelectedSubmenu = new Menu({ commands: app.commands });
96
+ moveSelectedSubmenu.title.label = translator
101
97
  .load('jupyterlab')
102
- .__('Move Selected Layers to Group');
103
- moveLayerSubmenu.id = 'jp-gis-contextmenu-movelayer';
98
+ .__('Move Selection to Group');
99
+ moveSelectedSubmenu.id = 'jp-gis-contextmenu-movelayer';
104
100
  app.contextMenu.addItem({
105
101
  type: 'submenu',
106
- selector: LAYER,
102
+ selector: GIS_ITEM,
107
103
  rank: 2,
108
- submenu: moveLayerSubmenu,
104
+ submenu: moveSelectedSubmenu,
109
105
  });
110
106
  app.contextMenu.opened.connect(() => buildGroupsMenu(app.contextMenu, tracker));
111
107
  app.contextMenu.addItem({
@@ -206,17 +202,17 @@ function buildGroupsMenu(contextMenu, tracker) {
206
202
  return result;
207
203
  }
208
204
  submenu.addItem({
209
- command: CommandIDs.moveLayersToGroup,
205
+ command: CommandIDs.moveSelectedToGroup,
210
206
  args: { label: '' },
211
207
  });
212
208
  groupNames.forEach(name => {
213
209
  submenu.addItem({
214
- command: CommandIDs.moveLayersToGroup,
210
+ command: CommandIDs.moveSelectedToGroup,
215
211
  args: { label: name },
216
212
  });
217
213
  });
218
214
  submenu.addItem({
219
- command: CommandIDs.moveLayerToNewGroup,
215
+ command: CommandIDs.moveSelectedToNewGroup,
220
216
  });
221
217
  }
222
218
  export default [plugin, notebookRendererPlugin];
@@ -1,5 +1,5 @@
1
1
  import { JupyterGISOutputWidget, JupyterGISPanel, ToolbarWidget, } from '@jupytergis/base';
2
- import { IJGISExternalCommandRegistryToken, IJupyterGISDocTracker, JupyterGISModel, IJGISFormSchemaRegistryToken, IAnnotationToken, } from '@jupytergis/schema';
2
+ import { DEFAULT_JGIS_DOCUMENT_CONTENT, IJGISExternalCommandRegistryToken, IJupyterGISDocTracker, JupyterGISModel, IJGISFormSchemaRegistryToken, IAnnotationToken, } from '@jupytergis/schema';
3
3
  import { showErrorMessage } from '@jupyterlab/apputils';
4
4
  import { ConsolePanel } from '@jupyterlab/console';
5
5
  import { PathExt } from '@jupyterlab/coreutils';
@@ -55,8 +55,8 @@ export class YJupyterGISLuminoWidget extends Panel {
55
55
  args.stateChange.forEach((change) => {
56
56
  var _a;
57
57
  if (change.name === 'path') {
58
- (_a = this.layout) === null || _a === void 0 ? void 0 : _a.removeWidget(this._jgisWidget);
59
58
  this._jgisWidget.dispose();
59
+ (_a = this.layout) === null || _a === void 0 ? void 0 : _a.removeWidget(this._jgisWidget);
60
60
  this._buildWidget(options);
61
61
  }
62
62
  });
@@ -110,7 +110,7 @@ export const notebookRendererPlugin = {
110
110
  }
111
111
  catch (e) {
112
112
  await app.serviceManager.contents.save(localPath, {
113
- content: btoa('{}'),
113
+ content: btoa(DEFAULT_JGIS_DOCUMENT_CONTENT),
114
114
  format: 'base64',
115
115
  });
116
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/jupytergis-lab",
3
- "version": "0.13.2",
3
+ "version": "0.14.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": "^4.1.2",
56
- "@jupytergis/base": "^0.13.2",
57
- "@jupytergis/schema": "^0.13.2",
56
+ "@jupytergis/base": "^0.14.0",
57
+ "@jupytergis/schema": "^0.14.0",
58
58
  "@jupyterlab/application": "^4.3.0",
59
59
  "@jupyterlab/apputils": "^4.3.0",
60
60
  "@jupyterlab/completer": "^4.3.0",
package/style/base.css CHANGED
@@ -472,15 +472,6 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
472
472
  display: none;
473
473
  }
474
474
 
475
- .jGIS-property-panel .rjsf .control-label,
476
- .jGIS-property-panel .rjsf legend {
477
- margin: 0;
478
- padding: 0;
479
- font-weight: bold;
480
- position: relative;
481
- width: 100%;
482
- }
483
-
484
475
  .jGIS-property-panel .rjsf legend > :first-child,
485
476
  .jGIS-property-panel .rjsf .control-label > :first-child {
486
477
  margin-top: 0;
@@ -507,7 +498,12 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
507
498
  .jp-FormGroup-content
508
499
  fieldset
509
500
  .jp-inputFieldWrapper
510
- > input {
501
+ > input,
502
+ .jGIS-property-panel
503
+ .jp-FormGroup-content
504
+ fieldset
505
+ .jp-inputFieldWrapper
506
+ > textarea {
511
507
  box-sizing: border-box;
512
508
  border: var(--jp-border-width) solid var(--jp-border-color1);
513
509
  background-color: var(--jp-layout-color0);