leaflet-polydraw 1.3.3 → 2.0.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/README.md +7 -2
- package/dist/icons/icon-donut.svg +5 -0
- package/dist/icons/icon-grip-vertical.svg +8 -0
- package/dist/icons/icon-layer-toggle.svg +6 -0
- package/dist/icons/icon-warning.svg +22 -0
- package/dist/leaflet-polydraw.css +1 -1
- package/dist/polydraw.es.js +9020 -3261
- package/dist/polydraw.es.js.map +1 -1
- package/dist/polydraw.umd.min.js +1 -1
- package/dist/polydraw.umd.min.js.map +1 -1
- package/dist/styles/polydraw.css +414 -0
- package/dist/types/buttons.d.ts.map +1 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/coordinate-utils.d.ts.map +1 -1
- package/dist/types/enums.d.ts +4 -0
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/guards/config-deprecation-guard.d.ts +3 -0
- package/dist/types/guards/config-deprecation-guard.d.ts.map +1 -0
- package/dist/types/guards/config-runtime-fallback-guard.d.ts +3 -0
- package/dist/types/guards/config-runtime-fallback-guard.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/managers/event-manager.d.ts +46 -0
- package/dist/types/managers/event-manager.d.ts.map +1 -1
- package/dist/types/managers/history-manager.d.ts +16 -3
- package/dist/types/managers/history-manager.d.ts.map +1 -1
- package/dist/types/managers/layer-manager.d.ts +92 -0
- package/dist/types/managers/layer-manager.d.ts.map +1 -0
- package/dist/types/managers/polygon-draw-manager.d.ts +2 -0
- package/dist/types/managers/polygon-draw-manager.d.ts.map +1 -1
- package/dist/types/managers/polygon-geometry-manager.d.ts +3 -0
- package/dist/types/managers/polygon-geometry-manager.d.ts.map +1 -1
- package/dist/types/managers/polygon-interaction-manager.d.ts +57 -0
- package/dist/types/managers/polygon-interaction-manager.d.ts.map +1 -1
- package/dist/types/managers/polygon-mutation-manager.d.ts +39 -2
- package/dist/types/managers/polygon-mutation-manager.d.ts.map +1 -1
- package/dist/types/polydraw.d.ts +194 -9
- package/dist/types/polydraw.d.ts.map +1 -1
- package/dist/types/popup-factory.d.ts.map +1 -1
- package/dist/types/styles/dynamic-styles.d.ts.map +1 -1
- package/dist/types/transform/donut-validation.d.ts +16 -0
- package/dist/types/transform/donut-validation.d.ts.map +1 -0
- package/dist/types/transform/polygon-transform-controller.d.ts +11 -1
- package/dist/types/transform/polygon-transform-controller.d.ts.map +1 -1
- package/dist/types/transform/transform-overlay.d.ts +8 -1
- package/dist/types/transform/transform-overlay.d.ts.map +1 -1
- package/dist/types/turf-helper.d.ts +5 -2
- package/dist/types/turf-helper.d.ts.map +1 -1
- package/dist/types/types/polydraw-interfaces.d.ts +257 -114
- package/dist/types/types/polydraw-interfaces.d.ts.map +1 -1
- package/dist/types/ui/layer-panel.d.ts +13 -0
- package/dist/types/ui/layer-panel.d.ts.map +1 -0
- package/dist/types/utils/metadata-clone.util.d.ts +2 -0
- package/dist/types/utils/metadata-clone.util.d.ts.map +1 -0
- package/package.json +10 -4
package/dist/styles/polydraw.css
CHANGED
|
@@ -5,6 +5,16 @@ body {
|
|
|
5
5
|
height: 100%;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/*
|
|
9
|
+
* Leaflet 2 alpha applies width/height: 100% to pane SVG elements.
|
|
10
|
+
* Leaflet's SVG renderer expects its own viewport sizing, so forcing a full-size
|
|
11
|
+
* SVG can shift vector overlays relative to marker panes while drawing/editing.
|
|
12
|
+
*/
|
|
13
|
+
.leaflet-container .leaflet-overlay-pane > svg.leaflet-zoom-animated {
|
|
14
|
+
width: auto;
|
|
15
|
+
height: auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
#blitz-app {
|
|
9
19
|
height: 100%;
|
|
10
20
|
}
|
|
@@ -223,6 +233,28 @@ body {
|
|
|
223
233
|
background-image: url('../icons/icon-rotate.svg');
|
|
224
234
|
}
|
|
225
235
|
|
|
236
|
+
.marker-menu-content .marker-menu-button.transform-donut {
|
|
237
|
+
background-image: url('../icons/icon-donut.svg');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.marker-menu-content .marker-menu-button.menu-action-default {
|
|
241
|
+
background-image: url("data:image/svg+xml,%3Csvg fill='%23ffffff' stroke='%23ffffff' xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 100 100'%3E%3Cpath d='M79.2 32.8c-.2-.7-1.1-.9-1.7-.4L67.4 42.5c-.8.8-2 .8-2.8 0l-7.1-7.1c-.8-.8-.8-2 0-2.8l10.2-10.2c.5-.5.3-1.4-.4-1.7-1.7-.4-3.5-.7-5.3-.7-10.6 0-19.1 9.2-17.9 20 .2 1.7.6 3.2 1.2 4.7L22 68.1c-2.7 2.7-2.7 7.2 0 9.9 1.4 1.4 3.2 2.1 5 2.1s3.6-.7 5-2.1l23.3-23.3c1.5.6 3.1 1 4.7 1.2C70.9 57.1 80 48.6 80 38c0-1.8-.3-3.6-.8-5.2z'/%3E%3C/svg%3E");
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.marker-menu-content .marker-menu-button.menu-action-custom,
|
|
245
|
+
.marker-menu-content .marker-menu-button.menu-action-default {
|
|
246
|
+
position: relative;
|
|
247
|
+
border-color: #ffffff;
|
|
248
|
+
background-color: rgba(6, 78, 59, 0.64);
|
|
249
|
+
box-shadow:
|
|
250
|
+
0 0 0 2px #064e3b,
|
|
251
|
+
0 2px 8px rgba(0, 0, 0, 0.26);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.marker-menu-content .marker-menu-button.menu-action-custom.make-triangle {
|
|
255
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M12 4 21 20H3L12 4Z'/%3E%3C/svg%3E");
|
|
256
|
+
}
|
|
257
|
+
|
|
226
258
|
.marker-menu-content
|
|
227
259
|
.marker-menu-button.toggle-visual-optimization.visual-optimization-state-visible {
|
|
228
260
|
background-image: url('../icons/icon-visual-optimization-show.svg');
|
|
@@ -234,6 +266,8 @@ body {
|
|
|
234
266
|
}
|
|
235
267
|
|
|
236
268
|
.marker-menu-button {
|
|
269
|
+
/* Host apps often apply a global border-box reset; these buttons are sized in content-box terms. */
|
|
270
|
+
box-sizing: content-box;
|
|
237
271
|
padding: 4px;
|
|
238
272
|
border: 1px solid #aaaaaa;
|
|
239
273
|
}
|
|
@@ -337,6 +371,29 @@ body {
|
|
|
337
371
|
justify-content: center;
|
|
338
372
|
}
|
|
339
373
|
|
|
374
|
+
.polydraw-transform-confirm.is-disabled {
|
|
375
|
+
opacity: 0.4;
|
|
376
|
+
cursor: not-allowed;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.polydraw-transform-status {
|
|
380
|
+
display: grid;
|
|
381
|
+
place-items: center;
|
|
382
|
+
width: 16px;
|
|
383
|
+
height: 16px;
|
|
384
|
+
padding: 0;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.polydraw-transform-status.is-invalid {
|
|
388
|
+
filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.28));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.polydraw-transform-status svg {
|
|
392
|
+
width: 16px;
|
|
393
|
+
height: 16px;
|
|
394
|
+
flex: 0 0 auto;
|
|
395
|
+
}
|
|
396
|
+
|
|
340
397
|
.alter-marker-wrapper .row.bottom-separator {
|
|
341
398
|
border-bottom: 1px dashed #fff;
|
|
342
399
|
}
|
|
@@ -506,6 +563,77 @@ body {
|
|
|
506
563
|
user-select: none;
|
|
507
564
|
}
|
|
508
565
|
|
|
566
|
+
/* Custom tooltips for Polydraw toolbar buttons */
|
|
567
|
+
.leaflet-control.leaflet-bar a[data-tooltip] {
|
|
568
|
+
position: relative;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.leaflet-control.leaflet-bar a[data-tooltip]::after,
|
|
572
|
+
.leaflet-control.leaflet-bar a[data-tooltip]::before {
|
|
573
|
+
opacity: 0;
|
|
574
|
+
visibility: hidden;
|
|
575
|
+
pointer-events: none;
|
|
576
|
+
position: absolute;
|
|
577
|
+
top: 50%;
|
|
578
|
+
transform: translateY(-50%);
|
|
579
|
+
transition:
|
|
580
|
+
opacity 0.12s ease,
|
|
581
|
+
transform 0.12s ease;
|
|
582
|
+
transition-delay: 0s;
|
|
583
|
+
z-index: 2000;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.leaflet-control.leaflet-bar a[data-tooltip]::after {
|
|
587
|
+
content: attr(data-tooltip);
|
|
588
|
+
background: var(--polydraw-tooltip-bg, #645d5d);
|
|
589
|
+
color: var(--polydraw-tooltip-color, #ffffff);
|
|
590
|
+
padding: 4px 8px;
|
|
591
|
+
border-radius: 4px;
|
|
592
|
+
font-size: 12px;
|
|
593
|
+
line-height: 1.2;
|
|
594
|
+
white-space: nowrap;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.leaflet-control.leaflet-bar a[data-tooltip]::before {
|
|
598
|
+
content: '';
|
|
599
|
+
border-top: 6px solid transparent;
|
|
600
|
+
border-bottom: 6px solid transparent;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.leaflet-control.leaflet-bar[data-tooltip-direction='left'] a[data-tooltip]::after,
|
|
604
|
+
.leaflet-control.leaflet-bar:not([data-tooltip-direction]) a[data-tooltip]::after {
|
|
605
|
+
right: calc(100% + 10px);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.leaflet-control.leaflet-bar[data-tooltip-direction='left'] a[data-tooltip]::before,
|
|
609
|
+
.leaflet-control.leaflet-bar:not([data-tooltip-direction]) a[data-tooltip]::before {
|
|
610
|
+
right: calc(100% + 4px);
|
|
611
|
+
border-left: 6px solid var(--polydraw-tooltip-bg, #645d5d);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.leaflet-control.leaflet-bar[data-tooltip-direction='right'] a[data-tooltip]::after {
|
|
615
|
+
left: calc(100% + 10px);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.leaflet-control.leaflet-bar[data-tooltip-direction='right'] a[data-tooltip]::before {
|
|
619
|
+
left: calc(100% + 4px);
|
|
620
|
+
border-right: 6px solid var(--polydraw-tooltip-bg, #645d5d);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.leaflet-control.leaflet-bar a[data-tooltip]:hover::after,
|
|
624
|
+
.leaflet-control.leaflet-bar a[data-tooltip]:hover::before,
|
|
625
|
+
.leaflet-control.leaflet-bar a[data-tooltip]:focus-visible::after,
|
|
626
|
+
.leaflet-control.leaflet-bar a[data-tooltip]:focus-visible::before {
|
|
627
|
+
opacity: 1;
|
|
628
|
+
visibility: visible;
|
|
629
|
+
transition-delay: var(--polydraw-tooltip-delay, 500ms);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.leaflet-control.leaflet-bar[data-tooltip-enabled='false'] a[data-tooltip]::after,
|
|
633
|
+
.leaflet-control.leaflet-bar[data-tooltip-enabled='false'] a[data-tooltip]::before {
|
|
634
|
+
display: none;
|
|
635
|
+
}
|
|
636
|
+
|
|
509
637
|
/* Firefox-specific fixes for touch event handling */
|
|
510
638
|
@-moz-document url-prefix() {
|
|
511
639
|
.leaflet-control.leaflet-bar {
|
|
@@ -546,3 +674,289 @@ body {
|
|
|
546
674
|
justify-content: center;
|
|
547
675
|
}
|
|
548
676
|
}
|
|
677
|
+
|
|
678
|
+
/* Layer panel styles */
|
|
679
|
+
.polydraw-layer-panel {
|
|
680
|
+
width: 206px;
|
|
681
|
+
min-width: 206px;
|
|
682
|
+
max-width: 206px;
|
|
683
|
+
z-index: 900 !important;
|
|
684
|
+
background: #fff;
|
|
685
|
+
border: 1px solid #ccc;
|
|
686
|
+
border-radius: 8px;
|
|
687
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
688
|
+
padding: 0;
|
|
689
|
+
font-family:
|
|
690
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
691
|
+
font-size: 12px;
|
|
692
|
+
line-height: 1.2;
|
|
693
|
+
color: #333;
|
|
694
|
+
pointer-events: auto;
|
|
695
|
+
overflow: hidden;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.leaflet-top.leaflet-right .polydraw-layer-panel.leaflet-control {
|
|
699
|
+
clear: none;
|
|
700
|
+
margin-right: 4px;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.polydraw-layer-header {
|
|
704
|
+
height: 30px;
|
|
705
|
+
box-sizing: border-box;
|
|
706
|
+
display: flex;
|
|
707
|
+
align-items: center;
|
|
708
|
+
border-bottom: 1px solid #e0e0e0;
|
|
709
|
+
background: #fff;
|
|
710
|
+
padding-left: 6px;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.polydraw-layer-header-title {
|
|
714
|
+
font-size: 11px;
|
|
715
|
+
font-weight: 600;
|
|
716
|
+
letter-spacing: 0.02em;
|
|
717
|
+
color: #444;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.polydraw-layer-header-count {
|
|
721
|
+
min-width: 16px;
|
|
722
|
+
height: 16px;
|
|
723
|
+
margin-left: 6px;
|
|
724
|
+
padding: 0 4px;
|
|
725
|
+
border-radius: 999px;
|
|
726
|
+
border: 1px solid #d7d7d7;
|
|
727
|
+
color: #666;
|
|
728
|
+
font-size: 10px;
|
|
729
|
+
display: inline-flex;
|
|
730
|
+
align-items: center;
|
|
731
|
+
justify-content: center;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.polydraw-layer-header-toggle {
|
|
735
|
+
margin-left: auto;
|
|
736
|
+
width: 30px;
|
|
737
|
+
height: 30px;
|
|
738
|
+
border: none;
|
|
739
|
+
background: transparent;
|
|
740
|
+
border-radius: 0;
|
|
741
|
+
cursor: pointer;
|
|
742
|
+
color: #333;
|
|
743
|
+
display: inline-flex;
|
|
744
|
+
align-items: center;
|
|
745
|
+
justify-content: center;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.polydraw-layer-header-toggle:hover {
|
|
749
|
+
background: #f0f0f0;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.polydraw-layer-header-toggle:focus-visible {
|
|
753
|
+
outline: none;
|
|
754
|
+
box-shadow: inset 0 0 0 2px rgba(33, 150, 243, 0.35);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.polydraw-layer-header-toggle svg {
|
|
758
|
+
width: 24px;
|
|
759
|
+
height: 24px;
|
|
760
|
+
fill: none;
|
|
761
|
+
stroke: currentColor;
|
|
762
|
+
transition: transform 0.18s ease;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.polydraw-layer-header-toggle.is-collapsed svg {
|
|
766
|
+
transform: rotate(180deg);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.polydraw-layer-panel-collapsed {
|
|
770
|
+
width: 30px;
|
|
771
|
+
min-width: 30px;
|
|
772
|
+
max-width: 30px;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.polydraw-layer-panel-collapsed .polydraw-layer-header {
|
|
776
|
+
border-bottom: none;
|
|
777
|
+
padding-left: 0;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.polydraw-layer-panel-collapsed .polydraw-layer-header-title,
|
|
781
|
+
.polydraw-layer-panel-collapsed .polydraw-layer-header-count {
|
|
782
|
+
display: none;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.polydraw-layer-row {
|
|
786
|
+
display: flex;
|
|
787
|
+
align-items: center;
|
|
788
|
+
gap: 4px;
|
|
789
|
+
height: 30px;
|
|
790
|
+
min-height: 30px;
|
|
791
|
+
padding: 0 4px;
|
|
792
|
+
background: #fff;
|
|
793
|
+
border-bottom: 1px solid #e0e0e0;
|
|
794
|
+
transition: background 0.2s;
|
|
795
|
+
user-select: none;
|
|
796
|
+
outline: none;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.polydraw-layer-row:hover {
|
|
800
|
+
background: #f9f9f9;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.polydraw-layer-row[draggable='true'] {
|
|
804
|
+
cursor: move;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.polydraw-layer-row[draggable='false'] {
|
|
808
|
+
cursor: pointer;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.polydraw-layer-row:focus-visible {
|
|
812
|
+
box-shadow: inset 0 0 0 2px rgba(33, 150, 243, 0.35);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.polydraw-layer-row-active {
|
|
816
|
+
background: #eef5ff;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
.polydraw-layer-row-active:hover {
|
|
820
|
+
background: #e6f0ff;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.polydraw-layer-row-dragging {
|
|
824
|
+
opacity: 0.5;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.polydraw-layer-row-drag-over {
|
|
828
|
+
border-top: 2px solid #2196f3;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.polydraw-layer-grip {
|
|
832
|
+
width: 18px;
|
|
833
|
+
height: 18px;
|
|
834
|
+
padding: 2px;
|
|
835
|
+
display: inline-flex;
|
|
836
|
+
align-items: center;
|
|
837
|
+
justify-content: center;
|
|
838
|
+
border-radius: 4px;
|
|
839
|
+
cursor: grab;
|
|
840
|
+
transition: background 0.2s;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.polydraw-layer-grip:hover {
|
|
844
|
+
background: #e0e0e0;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.polydraw-layer-grip svg {
|
|
848
|
+
width: 12px;
|
|
849
|
+
height: 12px;
|
|
850
|
+
fill: none;
|
|
851
|
+
stroke: #666;
|
|
852
|
+
stroke-width: 2;
|
|
853
|
+
stroke-linecap: round;
|
|
854
|
+
stroke-linejoin: round;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.polydraw-layer-grip-spacer {
|
|
858
|
+
width: 18px;
|
|
859
|
+
height: 18px;
|
|
860
|
+
padding: 2px;
|
|
861
|
+
display: inline-flex;
|
|
862
|
+
align-items: center;
|
|
863
|
+
justify-content: center;
|
|
864
|
+
flex-shrink: 0;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.polydraw-layer-color-indicator {
|
|
868
|
+
width: 12px;
|
|
869
|
+
height: 12px;
|
|
870
|
+
border-radius: 50%;
|
|
871
|
+
border: 1px solid #ccc;
|
|
872
|
+
flex-shrink: 0;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
.polydraw-layer-name {
|
|
876
|
+
flex: 1;
|
|
877
|
+
overflow: hidden;
|
|
878
|
+
text-overflow: ellipsis;
|
|
879
|
+
white-space: nowrap;
|
|
880
|
+
color: #333;
|
|
881
|
+
font-size: 11.5px;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.polydraw-layer-btn {
|
|
885
|
+
width: 30px;
|
|
886
|
+
height: 30px;
|
|
887
|
+
background: transparent;
|
|
888
|
+
border: none;
|
|
889
|
+
padding: 0;
|
|
890
|
+
cursor: pointer;
|
|
891
|
+
display: flex;
|
|
892
|
+
align-items: center;
|
|
893
|
+
justify-content: center;
|
|
894
|
+
border-radius: 4px;
|
|
895
|
+
flex-shrink: 0;
|
|
896
|
+
transition: background 0.2s;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.polydraw-layer-btn svg {
|
|
900
|
+
width: 24px;
|
|
901
|
+
height: 24px;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.polydraw-layer-visibility {
|
|
905
|
+
color: #333;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
.polydraw-layer-visibility svg {
|
|
909
|
+
width: 20px;
|
|
910
|
+
height: 20px;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.polydraw-layer-btn:hover {
|
|
914
|
+
background: #e0e0e0;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.polydraw-layer-delete {
|
|
918
|
+
border: none !important;
|
|
919
|
+
box-shadow: none !important;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.polydraw-layer-btn:focus-visible {
|
|
923
|
+
outline: none;
|
|
924
|
+
box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.35);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.polydraw-layer-btn-spacer {
|
|
928
|
+
width: 30px;
|
|
929
|
+
height: 30px;
|
|
930
|
+
flex-shrink: 0;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.polydraw-layer-visibility-hidden {
|
|
934
|
+
color: #999;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.polydraw-layer-hidden .polydraw-layer-name {
|
|
938
|
+
opacity: 0.65;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
@media (max-width: 768px) {
|
|
942
|
+
.polydraw-layer-panel {
|
|
943
|
+
width: 196px;
|
|
944
|
+
min-width: 196px;
|
|
945
|
+
max-width: 196px;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.polydraw-layer-row {
|
|
949
|
+
height: 30px;
|
|
950
|
+
min-height: 30px;
|
|
951
|
+
padding: 0 4px;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
.polydraw-layer-name {
|
|
955
|
+
font-size: 11.5px;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
.polydraw-layer-btn {
|
|
959
|
+
width: 30px;
|
|
960
|
+
height: 30px;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/buttons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAa7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/buttons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAa7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAwBjE;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,WAAW,EACtB,YAAY,EAAE,WAAW,EACzB,MAAM,EAAE,cAAc,EACtB,gBAAgB,EAAE,MAAM,IAAI,EAC5B,WAAW,EAAE,MAAM,IAAI,EACvB,eAAe,EAAE,MAAM,IAAI,EAC3B,YAAY,EAAE,MAAM,IAAI,EACxB,YAAY,EAAE,MAAM,IAAI,EACxB,mBAAmB,EAAE,MAAM,IAAI,EAC/B,2BAA2B,EAAE,MAAM,IAAI,EACvC,WAAW,EAAE,MAAM,IAAI,EACvB,WAAW,EAAE,MAAM,IAAI,EACvB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,QAwK/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,cA4P3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinate-utils.d.ts","sourceRoot":"","sources":["../../src/coordinate-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;A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;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,OAAO,GAAG,CAAC,CAAC,MAAM;IA6JrD;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE;CAKvE"}
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,cAAc;IACxB,EAAE,QAAQ;IACV,EAAE,QAAQ;CACX;AAED;;GAEG;AAEH,oBAAY,QAAQ;IAClB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,cAAc,KAAK;IACnB,YAAY,KAAK;IACjB,oBAAoB,KAAK;IACzB,KAAK,MAAM;CACZ;AACD;;GAEG;AAGH,oBAAY,cAAc;IACxB,SAAS,IAAI;IACb,KAAK,IAAI;IACT,SAAS,IAAI;IACb,IAAI,IAAI;IACR,SAAS,IAAI;IACb,KAAK,IAAI;IACT,SAAS,IAAI;IACb,IAAI,IAAI;IACR,IAAI,IAAI;CAGT"}
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,cAAc;IACxB,EAAE,QAAQ;IACV,EAAE,QAAQ;CACX;AAED;;GAEG;AAEH,oBAAY,QAAQ;IAClB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,cAAc,KAAK;IACnB,YAAY,KAAK;IACjB,oBAAoB,KAAK;IACzB,KAAK,MAAM;CACZ;AACD;;GAEG;AAGH,oBAAY,cAAc;IACxB,SAAS,IAAI;IACb,KAAK,IAAI;IACT,SAAS,IAAI;IACb,IAAI,IAAI;IACR,SAAS,IAAI;IACb,KAAK,IAAI;IACT,SAAS,IAAI;IACb,IAAI,IAAI;IACR,IAAI,IAAI;CAGT;AAED,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-deprecation-guard.d.ts","sourceRoot":"","sources":["../../../src/guards/config-deprecation-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAsBnE,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAiYxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-runtime-fallback-guard.d.ts","sourceRoot":"","sources":["../../../src/guards/config-runtime-fallback-guard.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AA8BnE,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAgBxE"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, leafletAdapter, defaultConfig, registerWithLeaflet } from "./polydraw";
|
|
1
|
+
export { default, leafletAdapter, defaultConfig, registerWithLeaflet } from "./polydraw"; export type { PolygonMenuAction, PolygonMenuActionContext, PolygonMenuActionResult } from "./polydraw";
|
|
@@ -50,6 +50,19 @@ export type PolydrawEventPayloads = {
|
|
|
50
50
|
operation?: string;
|
|
51
51
|
allowMerge?: boolean;
|
|
52
52
|
optimizationLevel?: number;
|
|
53
|
+
originalOptimizationLevel?: number;
|
|
54
|
+
featureId?: string;
|
|
55
|
+
featureMetadata?: Record<string, unknown>;
|
|
56
|
+
sourceFeatureIds?: string[];
|
|
57
|
+
featureInteractionOverride?: 'editable' | 'readonly' | 'static';
|
|
58
|
+
featureStyleOverrides?: {
|
|
59
|
+
color?: string;
|
|
60
|
+
fillColor?: string;
|
|
61
|
+
fillOpacity?: number;
|
|
62
|
+
weight?: number;
|
|
63
|
+
};
|
|
64
|
+
featureCreatedAt?: string;
|
|
65
|
+
featureLastModified?: string;
|
|
53
66
|
};
|
|
54
67
|
'polydraw:polygon:deleted': undefined;
|
|
55
68
|
'polydraw:mode:change': {
|
|
@@ -60,6 +73,7 @@ export type PolydrawEventPayloads = {
|
|
|
60
73
|
};
|
|
61
74
|
'polydraw:menu:action': {
|
|
62
75
|
action: string;
|
|
76
|
+
menuActionId?: string;
|
|
63
77
|
latLngs?: LatLngExpression[];
|
|
64
78
|
featureGroup?: FeatureGroup;
|
|
65
79
|
};
|
|
@@ -82,6 +96,38 @@ export type PolydrawEventPayloads = {
|
|
|
82
96
|
canUndo: boolean;
|
|
83
97
|
canRedo: boolean;
|
|
84
98
|
};
|
|
99
|
+
'polydraw:layer:created': {
|
|
100
|
+
layerId: string;
|
|
101
|
+
color: string;
|
|
102
|
+
};
|
|
103
|
+
'polydraw:layer:deleted': {
|
|
104
|
+
layerId: string;
|
|
105
|
+
removedFeatureGroups: FeatureGroup[];
|
|
106
|
+
};
|
|
107
|
+
'polydraw:layer:activated': {
|
|
108
|
+
layerId: string;
|
|
109
|
+
previousLayerId: string;
|
|
110
|
+
};
|
|
111
|
+
'polydraw:layer:visibility': {
|
|
112
|
+
layerId: string;
|
|
113
|
+
visible: boolean;
|
|
114
|
+
};
|
|
115
|
+
'polydraw:layer:colorChanged': {
|
|
116
|
+
layerId: string;
|
|
117
|
+
color: string;
|
|
118
|
+
};
|
|
119
|
+
'polydraw:layer:delete-requested': {
|
|
120
|
+
layerId: string;
|
|
121
|
+
};
|
|
122
|
+
'polydraw:layer:reorder-requested': {
|
|
123
|
+
layerId: string;
|
|
124
|
+
targetLayerId: string;
|
|
125
|
+
};
|
|
126
|
+
'polydraw:layer:reordered': {
|
|
127
|
+
layerId: string;
|
|
128
|
+
targetLayerId: string;
|
|
129
|
+
orderedLayerIds: string[];
|
|
130
|
+
};
|
|
85
131
|
};
|
|
86
132
|
export type PolydrawEvent = keyof PolydrawEventPayloads;
|
|
87
133
|
export type PolydrawEventCallback<T extends PolydrawEvent = PolydrawEvent> = (data: PolydrawEventPayloads[T]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-manager.d.ts","sourceRoot":"","sources":["../../../src/managers/event-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAAA;KAAE,CAAC;IAC5D,mBAAmB,EAAE;QAAE,eAAe,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAAA;KAAE,CAAC;IAC1E,aAAa,EAAE;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,CAAC;IACnC,cAAc,EAAE,SAAS,CAAC;IAC1B,iBAAiB,EAAE;QACjB,iBAAiB,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;QACnD,qBAAqB,EAAE,YAAY,EAAE,CAAC;QACtC,mBAAmB,EAAE,YAAY,EAAE,CAAC;KACrC,CAAC;IACF,wBAAwB,EAAE;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;QACzC,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,mBAAmB,CAAC,EAAE,YAAY,EAAE,CAAC;KACtC,CAAC;IACF,YAAY,EAAE;QACZ,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;Q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AA0B,EAAE;QAC1B,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,EAAE,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,CAC3E,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAC3B,IAAI,CAAC;AAEV,qBAAa,YAAY;IACvB,OAAO,CAAC,cAAc,CAA0D;IAEhF;;;;OAIG;IACH,EAAE,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI;IAO/E;;;;OAIG;IACH,GAAG,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI;IAUhF;;;;OAIG;IACH,IAAI,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI;CAO9E"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Feature, Polygon, MultiPolygon } from 'geojson';
|
|
2
2
|
import type { EventManager } from './event-manager';
|
|
3
|
+
import type { FeatureMetadataSnapshotEntry, LayerSnapshot } from '../types/polydraw-interfaces';
|
|
4
|
+
import type { LayerManager } from './layer-manager';
|
|
3
5
|
import * as L from 'leaflet';
|
|
4
6
|
/**
|
|
5
7
|
* Represents a snapshot of the entire drawing state
|
|
@@ -21,6 +23,14 @@ export interface HistorySnapshot {
|
|
|
21
23
|
* Approximate serialized size in bytes at save time.
|
|
22
24
|
*/
|
|
23
25
|
size?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Optional layer snapshot for restoring layer assignments
|
|
28
|
+
*/
|
|
29
|
+
layerSnapshot?: LayerSnapshot;
|
|
30
|
+
/**
|
|
31
|
+
* Optional per-feature metadata snapshot aligned with `features` order.
|
|
32
|
+
*/
|
|
33
|
+
featureMetadataSnapshot?: FeatureMetadataSnapshotEntry[];
|
|
24
34
|
}
|
|
25
35
|
/**
|
|
26
36
|
* HistoryManager handles undo/redo functionality for polygon operations.
|
|
@@ -36,12 +46,14 @@ export declare class HistoryManager {
|
|
|
36
46
|
private eventManager;
|
|
37
47
|
private isRestoring;
|
|
38
48
|
constructor(eventManager: EventManager, maxHistorySize?: number);
|
|
49
|
+
setMaxHistorySize(maxHistorySize: number): void;
|
|
39
50
|
/**
|
|
40
51
|
* Save the current state to the undo stack
|
|
41
52
|
* @param featureGroups - Array of Leaflet feature groups to save
|
|
42
53
|
* @param action - Optional description of the action
|
|
54
|
+
* @param layerManager - Optional layer manager for capturing layer state
|
|
43
55
|
*/
|
|
44
|
-
saveState(featureGroups: L.FeatureGroup[], action?: string): void;
|
|
56
|
+
saveState(featureGroups: L.FeatureGroup[], action?: string, layerManager?: LayerManager): void;
|
|
45
57
|
/**
|
|
46
58
|
* Calculate the approximate size of a snapshot in bytes
|
|
47
59
|
*/
|
|
@@ -59,13 +71,13 @@ export declare class HistoryManager {
|
|
|
59
71
|
* @param featureGroups - Current array of feature groups
|
|
60
72
|
* @returns The snapshot to restore, or null if undo stack is empty
|
|
61
73
|
*/
|
|
62
|
-
undo(featureGroups: L.FeatureGroup[]): HistorySnapshot | null;
|
|
74
|
+
undo(featureGroups: L.FeatureGroup[], layerManager?: LayerManager): HistorySnapshot | null;
|
|
63
75
|
/**
|
|
64
76
|
* Redo the last undone action
|
|
65
77
|
* @param featureGroups - Current array of feature groups
|
|
66
78
|
* @returns The snapshot to restore, or null if redo stack is empty
|
|
67
79
|
*/
|
|
68
|
-
redo(featureGroups: L.FeatureGroup[]): HistorySnapshot | null;
|
|
80
|
+
redo(featureGroups: L.FeatureGroup[], layerManager?: LayerManager): HistorySnapshot | null;
|
|
69
81
|
/**
|
|
70
82
|
* Check if undo is available
|
|
71
83
|
*/
|
|
@@ -86,6 +98,7 @@ export declare class HistoryManager {
|
|
|
86
98
|
* Create a snapshot from feature groups
|
|
87
99
|
*/
|
|
88
100
|
private createSnapshot;
|
|
101
|
+
private captureFeatureMetadataSnapshot;
|
|
89
102
|
private getSnapshotSize;
|
|
90
103
|
}
|
|
91
104
|
//# sourceMappingURL=history-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-manager.d.ts","sourceRoot":"","sources":["../../../src/managers/history-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"history-manager.d.ts","sourceRoot":"","sources":["../../../src/managers/history-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACV,4BAA4B,EAC5B,aAAa,EAGd,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,CAAC;IAE5C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;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