@jupytergis/jupytergis-lab 0.1.6 → 0.2.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
@@ -1,5 +1,5 @@
1
- import { CommandIDs, ControlPanelModel, LeftPanelWidget, RightPanelWidget, addCommands, createDefaultLayerRegistry, logoMiniIcon } from '@jupytergis/base';
2
- import { IJGISFormSchemaRegistryToken, IJGISLayerBrowserRegistryToken, IJupyterGISDocTracker } from '@jupytergis/schema';
1
+ import { CommandIDs, ControlPanelModel, GlobalStateDbManager, LeftPanelWidget, RightPanelWidget, addCommands, createDefaultLayerRegistry, logoMiniIcon } from '@jupytergis/base';
2
+ import { IAnnotationToken, IJGISFormSchemaRegistryToken, IJGISLayerBrowserRegistryToken, IJupyterGISDocTracker } from '@jupytergis/schema';
3
3
  import { ILayoutRestorer } from '@jupyterlab/application';
4
4
  import { ICompletionProviderManager } from '@jupyterlab/completer';
5
5
  import { IMainMenu } from '@jupyterlab/mainmenu';
@@ -26,6 +26,8 @@ const plugin = {
26
26
  tracker.currentWidget === app.shell.currentWidget);
27
27
  };
28
28
  createDefaultLayerRegistry(layerBrowserRegistry);
29
+ const stateDbManager = GlobalStateDbManager.getInstance();
30
+ stateDbManager.initialize(state);
29
31
  addCommands(app, tracker, translator, formSchemaRegistry, layerBrowserRegistry, state, completionProviderManager);
30
32
  // SOURCES context menu
31
33
  const newSourceSubMenu = new Menu({ commands: app.commands });
@@ -207,9 +209,10 @@ const controlPanel = {
207
209
  ILayoutRestorer,
208
210
  IJupyterGISDocTracker,
209
211
  IJGISFormSchemaRegistryToken,
210
- IStateDB
212
+ IStateDB,
213
+ IAnnotationToken
211
214
  ],
212
- activate: (app, restorer, tracker, formSchemaRegistry, state) => {
215
+ activate: (app, restorer, tracker, formSchemaRegistry, state, annotationModel) => {
213
216
  const controlModel = new ControlPanelModel({ tracker });
214
217
  const leftControlPanel = new LeftPanelWidget({
215
218
  model: controlModel,
@@ -222,7 +225,8 @@ const controlPanel = {
222
225
  const rightControlPanel = new RightPanelWidget({
223
226
  model: controlModel,
224
227
  tracker,
225
- formSchemaRegistry
228
+ formSchemaRegistry,
229
+ annotationModel
226
230
  });
227
231
  rightControlPanel.id = 'jupytergis::rightControlPanel';
228
232
  rightControlPanel.title.caption = 'JupyterGIS Control Panel';
@@ -1,4 +1,4 @@
1
- import { ICollaborativeDrive } from '@jupyter/docprovider';
1
+ import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
2
2
  import { JupyterGISPanel } from '@jupytergis/base';
3
3
  import { JupyterGISModel } from '@jupytergis/schema';
4
4
  import { MessageLoop } from '@lumino/messaging';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/jupytergis-lab",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "JupyterGIS Lab extension.",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -52,27 +52,27 @@
52
52
  "watch:labextension": "jupyter labextension watch ."
53
53
  },
54
54
  "dependencies": {
55
- "@jupyter/docprovider": "^2.0.0",
56
- "@jupytergis/base": "^0.1.6",
57
- "@jupytergis/jupytergis-core": "^0.1.6",
58
- "@jupytergis/schema": "^0.1.6",
59
- "@jupyterlab/application": "^4.0.0",
60
- "@jupyterlab/apputils": "^4.0.0",
61
- "@jupyterlab/coreutils": "^6.0.0",
62
- "@jupyterlab/docregistry": "^4.0.0",
63
- "@jupyterlab/filebrowser": "^4.0.0",
64
- "@jupyterlab/launcher": "^4.0.0",
65
- "@jupyterlab/mainmenu": "^4.0.0",
66
- "@jupyterlab/services": "^7.0.0",
67
- "@jupyterlab/translation": "^4.0.0",
68
- "@jupyterlab/ui-components": "^4.0.0",
55
+ "@jupyter/collaborative-drive": "^3.0.0",
56
+ "@jupytergis/base": "^0.2.0",
57
+ "@jupytergis/jupytergis-core": "^0.2.0",
58
+ "@jupytergis/schema": "^0.2.0",
59
+ "@jupyterlab/application": "^4.3.0",
60
+ "@jupyterlab/apputils": "^4.3.0",
61
+ "@jupyterlab/coreutils": "^6.3.0",
62
+ "@jupyterlab/docregistry": "^4.3.0",
63
+ "@jupyterlab/filebrowser": "^4.3.0",
64
+ "@jupyterlab/launcher": "^4.3.0",
65
+ "@jupyterlab/mainmenu": "^4.3.0",
66
+ "@jupyterlab/services": "^7.3.0",
67
+ "@jupyterlab/translation": "^4.3.0",
68
+ "@jupyterlab/ui-components": "^4.3.0",
69
69
  "@lumino/messaging": "^2.0.0",
70
70
  "@lumino/widgets": "^2.0.0",
71
71
  "react": "^18.0.1",
72
72
  "yjs-widgets": "^0.3.5"
73
73
  },
74
74
  "devDependencies": {
75
- "@jupyterlab/builder": "^4.0.0",
75
+ "@jupyterlab/builder": "^4.3.0",
76
76
  "css-loader": "^6.7.1",
77
77
  "mkdirp": "^1.0.3",
78
78
  "npm-run-all": "^4.1.5",
package/style/base.css CHANGED
@@ -1,4 +1,3 @@
1
- @import url('~@deathbeds/jupyterlab-rjsf/style/index.css');
2
1
  @import url('~@jupytergis/base/style/index.css');
3
2
 
4
3
  .jGIS-Spinner {
@@ -170,8 +169,8 @@ div.field.field-array > label + span {
170
169
  }
171
170
 
172
171
  /* TODO Upstream this to jupyterlab jrfs */
173
- .jp-SchemaForm .control-label,
174
- .jp-SchemaForm legend {
172
+ .jGIS-property-panel .rjsf .control-label,
173
+ .jGIS-property-panel .rjsf legend {
175
174
  position: inherit;
176
175
  text-transform: capitalize;
177
176
  }
@@ -193,6 +192,7 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
193
192
  }
194
193
 
195
194
  .jGIS-Toolbar-Separator {
195
+ min-height: 25px;
196
196
  width: var(--jp-border-width);
197
197
  background-color: var(--jp-border-color1);
198
198
  padding-left: 0px !important;
@@ -218,7 +218,7 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
218
218
  box-sizing: border-box;
219
219
  }
220
220
 
221
- .jGIS-Annotation-Wrapper {
221
+ .jGIS-Popup-Wrapper {
222
222
  position: absolute;
223
223
  opacity: 1;
224
224
  transition: opacity 0.1s linear 0.15s;
@@ -241,12 +241,20 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
241
241
  position: absolute;
242
242
  width: 250px;
243
243
  box-shadow: var(--jp-elevation-z6);
244
+ z-index: 40;
245
+ max-height: 400px;
246
+ overflow: auto;
244
247
  }
245
248
 
246
249
  .jGIS-Annotations {
247
250
  overflow: auto;
248
251
  }
249
252
 
253
+ .jGIS-Annotation-Card {
254
+ max-height: 400px;
255
+ overflow: auto;
256
+ }
257
+
250
258
  .jGIS-Annotations-Separator {
251
259
  border-color: var(--jp-layout-color4);
252
260
  border-style: solid;
@@ -265,7 +273,7 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
265
273
  cursor: pointer;
266
274
  transition-property: width, height, left, top;
267
275
  transition-duration: 0.2s;
268
- z-index: 1000;
276
+ z-index: 20;
269
277
  }
270
278
 
271
279
  .jGIS-Annotation-Handler:hover {
@@ -299,6 +307,9 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
299
307
  color: var(--jp-ui-font-color2);
300
308
  flex-grow: 1;
301
309
  resize: none;
310
+ border: none;
311
+ padding: 0.5em;
312
+ outline: thin solid var(--jp-border-color0);
302
313
  }
303
314
 
304
315
  .jGIS-Annotation-Message-Content {
@@ -308,21 +319,14 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
308
319
  flex-grow: 1;
309
320
  }
310
321
 
311
- .jGIS-Annotation-Topbar {
322
+ .jGIS-Popup-Topbar {
312
323
  display: flex;
313
324
  flex-direction: row-reverse;
314
325
  }
315
326
 
316
- .jGIS-Annotation-TopBarIcon {
317
- margin: 3px;
318
- width: 20px;
319
- height: 20px;
327
+ .jGIS-Popup-TopBarIcon {
320
328
  cursor: pointer;
321
- }
322
-
323
- .jGIS-Annotation-TopBarIcon > svg {
324
- width: 20px;
325
- height: 20px;
329
+ transform: rotate(180deg);
326
330
  }
327
331
 
328
332
  .jGIS-Annotation-Submit > svg {
@@ -346,6 +350,58 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
346
350
  height: 30px;
347
351
  }
348
352
 
353
+ .jGIS-Annotation-Buttons {
354
+ display: flex;
355
+ justify-content: space-around;
356
+ padding-top: 1em;
357
+ }
358
+
359
+ .jGIS-Annotation-Buttons > button {
360
+ border-radius: var(--jp-border-radius);
361
+ flex-grow: 1;
362
+ max-width: 68px;
363
+ }
364
+
365
+ .jGIS-Remote-Pointer {
366
+ position: absolute;
367
+ transition-property: left, top, width, height;
368
+ transition-duration: 150ms;
369
+ transition-timing-function: ease;
370
+ z-index: 20;
371
+ }
372
+
373
+ .jGIS-Remote-Pointer-Icon:hover {
374
+ scale: 1.3;
375
+ }
376
+
377
+ .jGIS-Floating-Pointer-Popup {
378
+ position: absolute;
379
+ width: 160px;
380
+ box-shadow: var(--jp-elevation-z6);
381
+ z-index: 40;
382
+ max-height: 400px;
383
+ overflow: auto;
384
+ }
385
+
386
+ .jGIS-Remote-Pointer-Popup {
387
+ margin-left: 7px;
388
+ margin-top: 14px;
389
+ color: #fff;
390
+ padding: 1em;
391
+ border-radius: 0.5em;
392
+ font-size: 12px;
393
+ line-height: 1.2;
394
+ }
395
+
396
+ .jGIS-Remote-Pointer-Popup-Name {
397
+ font-size: 16px;
398
+ color: #333;
399
+ }
400
+
401
+ .jGIS-Remote-Pointer-Popup-Coordinates {
402
+ font-size: 14px;
403
+ }
404
+
349
405
  /* Hack to remove the malformed form button */
350
406
  .object-property-expand {
351
407
  display: none;
@@ -363,8 +419,8 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
363
419
  width: 100%;
364
420
  }
365
421
 
366
- .jp-SchemaForm .control-label,
367
- .jp-SchemaForm legend {
422
+ .jGIS-property-panel .rjsf .control-label,
423
+ .jGIS-property-panel .rjsf legend {
368
424
  width: 100%;
369
425
  }
370
426
 
@@ -375,3 +431,303 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
375
431
  .jpgis-console .jp-CodeConsole-banner {
376
432
  display: none;
377
433
  }
434
+
435
+ /* FormComponent CSS */
436
+ .jGIS-property-panel .rjsf {
437
+ color: var(--jp-ui-font-color1);
438
+ }
439
+
440
+ .jGIS-property-panel .rjsf > form {
441
+ padding: var(--jp-ui-font-size1);
442
+ }
443
+
444
+ .jGIS-property-panel .rjsf fieldset {
445
+ border: 0;
446
+ margin: 0;
447
+ padding: 0;
448
+ }
449
+
450
+ .jGIS-property-panel .rjsf button[type='submit'] {
451
+ display: none;
452
+ }
453
+
454
+ .jGIS-property-panel .rjsf .control-label,
455
+ .jGIS-property-panel .rjsf legend {
456
+ margin: 0;
457
+ padding: 0;
458
+ font-weight: bold;
459
+ position: relative;
460
+ width: 100%;
461
+ }
462
+
463
+ .jGIS-property-panel .rjsf legend > :first-child,
464
+ .jGIS-property-panel .rjsf .control-label > :first-child {
465
+ margin-top: 0;
466
+ padding-top: 0;
467
+ }
468
+
469
+ .jGIS-property-panel .rjsf .form-group .form-group {
470
+ margin-bottom: var(--jp-ui-font-size1);
471
+ }
472
+
473
+ .jGIS-property-panel .rjsf .form-group:last-child {
474
+ margin-bottom: 0;
475
+ }
476
+
477
+ .jGIS-property-panel .rjsf .jp-FormGroup-description,
478
+ .jGIS-property-panel .rjsf .field-description,
479
+ .jGIS-property-panel .rjsf .help-block {
480
+ color: var(--jp-ui-font-color2);
481
+ margin-top: 2px;
482
+ margin-bottom: 2px;
483
+ }
484
+
485
+ .jGIS-property-panel
486
+ .jp-FormGroup-content
487
+ fieldset
488
+ .jp-inputFieldWrapper
489
+ > input {
490
+ box-sizing: border-box;
491
+ border: var(--jp-border-width) solid var(--jp-border-color1);
492
+ background-color: var(--jp-layout-color0);
493
+ color: var(--jp-ui-font-color0);
494
+ font-size: var(--jp-ui-font-size2);
495
+ min-width: 0;
496
+ outline: none !important;
497
+ padding: 2px 7px;
498
+ width: 100%;
499
+ max-width: 100%;
500
+ }
501
+
502
+ .jGIS-property-panel
503
+ .jp-FormGroup-content
504
+ fieldset
505
+ .jp-inputFieldWrapper
506
+ > input#root_Color,
507
+ .jGIS-property-panel
508
+ .jp-FormGroup-content
509
+ fieldset
510
+ .jp-inputFieldWrapper
511
+ > input#root_shadowColor {
512
+ height: revert;
513
+ }
514
+
515
+ .jGIS-property-panel .jp-FormGroup-contentNormal {
516
+ display: flex;
517
+ flex-direction: column;
518
+ align-items: inherit;
519
+ }
520
+
521
+ .jGIS-property-panel .jp-FormGroup-contentNormal .jp-FormGroup-fieldLabel {
522
+ font-weight: bold;
523
+ order: 1;
524
+ margin-top: 2px;
525
+ margin-bottom: 2px;
526
+ }
527
+
528
+ .jGIS-property-panel
529
+ .jp-FormGroup-content
530
+ .jp-FormGroup-contentNormal
531
+ .jp-FormGroup-description,
532
+ .jGIS-property-panel .field-description {
533
+ order: 2;
534
+ color: var(--jp-ui-font-color2);
535
+ }
536
+
537
+ .jGIS-property-panel .jp-FormGroup-content .jp-inputFieldWrapper {
538
+ order: 3;
539
+ }
540
+
541
+ .jGIS-property-panel .jp-FormGroup-contentNormal .validationErrors,
542
+ .jGIS-property-panel .jp-FormGroup-contentNormal .validationErrors ul {
543
+ order: 4;
544
+ list-style: none;
545
+ color: var(--jp-warn-color0);
546
+ margin: 0;
547
+ padding: 0;
548
+ }
549
+
550
+ .jGIS-property-panel .jp-objectFieldWrapper,
551
+ .jGIS-property-panel .jp-arrayFieldWrapper {
552
+ padding-left: var(--jp-notebook-padding);
553
+ border-left: solid 4px var(--jp-border-color3);
554
+ }
555
+
556
+ .jGIS-property-panel .array-item {
557
+ border: none;
558
+ }
559
+
560
+ .jGIS-property-panel
561
+ .jp-FormGroup-content
562
+ .jp-FormGroup-contentNormal
563
+ .jp-arrayFieldWrapper
564
+ + .jp-FormGroup-description {
565
+ display: none;
566
+ }
567
+
568
+ .jGIS-property-panel .rjsf .errors {
569
+ color: var(--jp-warn-color0);
570
+ }
571
+
572
+ .jGIS-property-panel .rjsf .errors ul,
573
+ .jGIS-property-panel .rjsf .validationErrors ul,
574
+ .jGIS-property-panel .rjsf .validationErrors li,
575
+ .jGIS-property-panel .rjsf .errors li {
576
+ list-style: none;
577
+ margin: 0;
578
+ padding: 0;
579
+ }
580
+
581
+ .jGIS-property-panel .rjsf .jp-ArrayOperationsButton {
582
+ display: none;
583
+ }
584
+
585
+ /* Hide additional property fields with remove buttons that should not be displayed in the form */
586
+ .jGIS-property-panel
587
+ .form-group:has(.jp-FormGroup-removeButton):not(:has(.jp-root)) {
588
+ display: none;
589
+ }
590
+
591
+ .jGIS-property-panel .jp-arrayFieldWrapper .array-item legend,
592
+ .jGIS-property-panel
593
+ .jp-arrayFieldWrapper
594
+ .field-array-of-array
595
+ .field-array-of-number
596
+ legend,
597
+ .jGIS-property-panel
598
+ .jp-arrayFieldWrapper
599
+ .field-array-of-array
600
+ .field-array-of-number
601
+ .jp-FormGroup-fieldLabel {
602
+ display: none;
603
+ }
604
+ .jGIS-property-panel
605
+ .jp-arrayFieldWrapper
606
+ .field-array-of-array
607
+ .array-item
608
+ .form-group
609
+ .field-array-of-number {
610
+ display: flex;
611
+ }
612
+
613
+ .jGIS-property-panel
614
+ .jp-arrayFieldWrapper
615
+ .field-array-of-array
616
+ .array-item
617
+ .form-group
618
+ .field-array-of-number
619
+ > div:nth-child(1) {
620
+ order: 2;
621
+ }
622
+
623
+ .jGIS-property-panel
624
+ .jp-arrayFieldWrapper
625
+ .field-array-of-array
626
+ .array-item
627
+ .form-group
628
+ .field-array-of-number
629
+ > div:nth-child(2) {
630
+ order: 1;
631
+ }
632
+
633
+ .jGIS-property-panel .required {
634
+ font-size: var(--jp-ui-font-size3);
635
+ color: var(--jp-warn-color1);
636
+ font-weight: 800;
637
+ position: absolute;
638
+ top: 0;
639
+ right: 0;
640
+ display: block;
641
+ }
642
+
643
+ .jGIS-property-panel
644
+ .jp-FormGroup-content
645
+ fieldset
646
+ .jp-inputFieldWrapper
647
+ select {
648
+ width: 100%;
649
+ font-size: var(--jp-ui-font-size1);
650
+ background: var(--jp-input-background);
651
+ color: var(--jp-ui-font-color0);
652
+ padding: calc(var(--jp-ui-font-size1) / 2);
653
+ padding-right: var(--jp-ui-font-size3);
654
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 20 20'%3e %3cg class='jp-icon3' fill='%23616161' shape-rendering='geometricPrecision'%3e %3cpolygon class='st1' points='9.9%2c13.6 3.6%2c7.4 4.4%2c6.6 9.9%2c12.2 15.4%2c6.7 16.1%2c7.4 '/%3e %3c/g%3e %3c/svg%3e");
655
+ background-repeat: no-repeat;
656
+ background-position: 99% center;
657
+ background-size: 18px;
658
+ border: var(--jp-border-width) solid var(--jp-input-border-color);
659
+ border-radius: 0;
660
+ outline: none;
661
+ appearance: none;
662
+ }
663
+
664
+ .jGIS-property-panel .jp-select-wrapper select {
665
+ background-image: unset !important;
666
+ }
667
+
668
+ .lm-TabBar-tabIcon .jgis-main-logo[fill] {
669
+ fill: var(--jp-inverse-layout-color3);
670
+ }
671
+
672
+ .jGIS-identify-tool {
673
+ cursor: crosshair;
674
+ }
675
+
676
+ .jgis-identify-grid-item {
677
+ display: grid;
678
+ grid-template-columns: 1fr 1fr;
679
+ grid-template-rows: auto auto;
680
+ position: relative;
681
+ gap: 1px;
682
+ }
683
+
684
+ .jgis-identify-grid-item-header {
685
+ display: flex;
686
+ grid-column: span 2;
687
+ font-weight: bold;
688
+ font-size: var(--jp-ui-font-size1);
689
+ padding: 2px 0;
690
+ cursor: pointer;
691
+ margin: 0 5px;
692
+ line-height: 25px;
693
+ }
694
+
695
+ .jgis-identify-grid-item:not(:last-of-type)::after {
696
+ content: '';
697
+ position: absolute;
698
+ bottom: 0;
699
+ left: 50%;
700
+ transform: translateX(-50%);
701
+ width: 90%;
702
+ border-bottom: 1px solid var(--jp-border-color0);
703
+ }
704
+
705
+ .jgis-identify-grid-body {
706
+ display: contents;
707
+ }
708
+
709
+ .jgis-identify-grid-body span a:link {
710
+ color: var(--jp-content-link-color);
711
+ cursor: pointer;
712
+ text-decoration: underline;
713
+ }
714
+
715
+ .jgis-identify-grid-body span a:visited {
716
+ color: var(--jp-content-link-visited-color);
717
+ cursor: pointer;
718
+ text-decoration: underline;
719
+ }
720
+
721
+ .jgis-identify-grid-body strong {
722
+ grid-column: 1;
723
+ text-transform: capitalize;
724
+ margin-left: 21px;
725
+ }
726
+
727
+ .jgis-identify-grid-body span {
728
+ grid-column: 2;
729
+ }
730
+
731
+ .jgis-identify-grid-body:last-of-type strong:last-of-type {
732
+ padding-bottom: 8px;
733
+ }