@jupytergis/jupytergis-lab 0.1.7 → 0.2.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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CommandIDs, ControlPanelModel, GlobalStateDbManager, LeftPanelWidget, RightPanelWidget, addCommands, createDefaultLayerRegistry, logoMiniIcon } from '@jupytergis/base';
2
- import { IJGISFormSchemaRegistryToken, IJGISLayerBrowserRegistryToken, IJupyterGISDocTracker } from '@jupytergis/schema';
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';
@@ -209,9 +209,10 @@ const controlPanel = {
209
209
  ILayoutRestorer,
210
210
  IJupyterGISDocTracker,
211
211
  IJGISFormSchemaRegistryToken,
212
- IStateDB
212
+ IStateDB,
213
+ IAnnotationToken
213
214
  ],
214
- activate: (app, restorer, tracker, formSchemaRegistry, state) => {
215
+ activate: (app, restorer, tracker, formSchemaRegistry, state, annotationModel) => {
215
216
  const controlModel = new ControlPanelModel({ tracker });
216
217
  const leftControlPanel = new LeftPanelWidget({
217
218
  model: controlModel,
@@ -224,7 +225,8 @@ const controlPanel = {
224
225
  const rightControlPanel = new RightPanelWidget({
225
226
  model: controlModel,
226
227
  tracker,
227
- formSchemaRegistry
228
+ formSchemaRegistry,
229
+ annotationModel
228
230
  });
229
231
  rightControlPanel.id = 'jupytergis::rightControlPanel';
230
232
  rightControlPanel.title.caption = 'JupyterGIS Control Panel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/jupytergis-lab",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "description": "JupyterGIS Lab extension.",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,9 +53,9 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@jupyter/collaborative-drive": "^3.0.0",
56
- "@jupytergis/base": "^0.1.7",
57
- "@jupytergis/jupytergis-core": "^0.1.7",
58
- "@jupytergis/schema": "^0.1.7",
56
+ "@jupytergis/base": "^0.2.1",
57
+ "@jupytergis/jupytergis-core": "^0.2.1",
58
+ "@jupytergis/schema": "^0.2.1",
59
59
  "@jupyterlab/application": "^4.3.0",
60
60
  "@jupyterlab/apputils": "^4.3.0",
61
61
  "@jupyterlab/coreutils": "^6.3.0",
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
  }
@@ -219,7 +218,7 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
219
218
  box-sizing: border-box;
220
219
  }
221
220
 
222
- .jGIS-Annotation-Wrapper {
221
+ .jGIS-Popup-Wrapper {
223
222
  position: absolute;
224
223
  opacity: 1;
225
224
  transition: opacity 0.1s linear 0.15s;
@@ -242,12 +241,20 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
242
241
  position: absolute;
243
242
  width: 250px;
244
243
  box-shadow: var(--jp-elevation-z6);
244
+ z-index: 40;
245
+ max-height: 400px;
246
+ overflow: auto;
245
247
  }
246
248
 
247
249
  .jGIS-Annotations {
248
250
  overflow: auto;
249
251
  }
250
252
 
253
+ .jGIS-Annotation-Card {
254
+ max-height: 400px;
255
+ overflow: auto;
256
+ }
257
+
251
258
  .jGIS-Annotations-Separator {
252
259
  border-color: var(--jp-layout-color4);
253
260
  border-style: solid;
@@ -266,7 +273,7 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
266
273
  cursor: pointer;
267
274
  transition-property: width, height, left, top;
268
275
  transition-duration: 0.2s;
269
- z-index: 1000;
276
+ z-index: 20;
270
277
  }
271
278
 
272
279
  .jGIS-Annotation-Handler:hover {
@@ -300,6 +307,9 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
300
307
  color: var(--jp-ui-font-color2);
301
308
  flex-grow: 1;
302
309
  resize: none;
310
+ border: none;
311
+ padding: 0.5em;
312
+ outline: thin solid var(--jp-border-color0);
303
313
  }
304
314
 
305
315
  .jGIS-Annotation-Message-Content {
@@ -309,21 +319,14 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
309
319
  flex-grow: 1;
310
320
  }
311
321
 
312
- .jGIS-Annotation-Topbar {
322
+ .jGIS-Popup-Topbar {
313
323
  display: flex;
314
324
  flex-direction: row-reverse;
315
325
  }
316
326
 
317
- .jGIS-Annotation-TopBarIcon {
318
- margin: 3px;
319
- width: 20px;
320
- height: 20px;
327
+ .jGIS-Popup-TopBarIcon {
321
328
  cursor: pointer;
322
- }
323
-
324
- .jGIS-Annotation-TopBarIcon > svg {
325
- width: 20px;
326
- height: 20px;
329
+ transform: rotate(180deg);
327
330
  }
328
331
 
329
332
  .jGIS-Annotation-Submit > svg {
@@ -347,6 +350,58 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
347
350
  height: 30px;
348
351
  }
349
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
+
350
405
  /* Hack to remove the malformed form button */
351
406
  .object-property-expand {
352
407
  display: none;
@@ -364,8 +419,8 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
364
419
  width: 100%;
365
420
  }
366
421
 
367
- .jp-SchemaForm .control-label,
368
- .jp-SchemaForm legend {
422
+ .jGIS-property-panel .rjsf .control-label,
423
+ .jGIS-property-panel .rjsf legend {
369
424
  width: 100%;
370
425
  }
371
426
 
@@ -376,3 +431,303 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
376
431
  .jpgis-console .jp-CodeConsole-banner {
377
432
  display: none;
378
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
+ }