ol-contextmenu 4.1.0 → 5.0.1-alpha
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/dist/ol-contextmenu.css +1 -109
- package/dist/ol-contextmenu.js +313 -6
- package/dist/ol-contextmenu.umd.cjs +1 -0
- package/package.json +64 -53
- package/dist/ol-contextmenu-debug.js +0 -821
- package/dist/ol-contextmenu.min.css +0 -7
package/dist/ol-contextmenu.css
CHANGED
|
@@ -1,109 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/*!
|
|
3
|
-
* ol-contextmenu - v4.1.0
|
|
4
|
-
* https://github.com/jonataswalker/ol-contextmenu
|
|
5
|
-
* Built: Sat Aug 15 2020 10:43:26 GMT-0300 (Brasilia Standard Time)
|
|
6
|
-
*/
|
|
7
|
-
.ol-ctx-menu-container {
|
|
8
|
-
position: absolute;
|
|
9
|
-
padding: 8px;
|
|
10
|
-
background: #fff;
|
|
11
|
-
color: #222;
|
|
12
|
-
font-size: 13px;
|
|
13
|
-
border-radius: 5px;
|
|
14
|
-
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
}
|
|
17
|
-
.ol-ctx-menu-container div, .ol-ctx-menu-container span, .ol-ctx-menu-container a, .ol-ctx-menu-container img, .ol-ctx-menu-container ul, .ol-ctx-menu-container li {
|
|
18
|
-
margin: 0;
|
|
19
|
-
padding: 0;
|
|
20
|
-
border: 0;
|
|
21
|
-
font: inherit;
|
|
22
|
-
font-size: 100%;
|
|
23
|
-
vertical-align: baseline;
|
|
24
|
-
}
|
|
25
|
-
.ol-ctx-menu-container a img {
|
|
26
|
-
border: none;
|
|
27
|
-
}
|
|
28
|
-
.ol-ctx-menu-container *,
|
|
29
|
-
.ol-ctx-menu-container *::before,
|
|
30
|
-
.ol-ctx-menu-container *::after {
|
|
31
|
-
box-sizing: inherit;
|
|
32
|
-
}
|
|
33
|
-
.ol-ctx-menu-container.ol-ctx-menu-hidden {
|
|
34
|
-
opacity: 0;
|
|
35
|
-
visibility: hidden;
|
|
36
|
-
transition: visibility 0s linear 300ms, opacity 300ms;
|
|
37
|
-
}
|
|
38
|
-
.ol-ctx-menu-container ul {
|
|
39
|
-
list-style: none;
|
|
40
|
-
}
|
|
41
|
-
.ol-ctx-menu-container li {
|
|
42
|
-
position: relative;
|
|
43
|
-
line-height: 20px;
|
|
44
|
-
padding: 2px 5px;
|
|
45
|
-
}
|
|
46
|
-
.ol-ctx-menu-container li:not(.ol-ctx-menu-separator):hover {
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
background-color: #333;
|
|
49
|
-
color: #eee;
|
|
50
|
-
}
|
|
51
|
-
.ol-ctx-menu-container li.ol-ctx-menu-submenu .ol-ctx-menu-container {
|
|
52
|
-
border: 1px solid #eee;
|
|
53
|
-
padding: 8px;
|
|
54
|
-
top: 0;
|
|
55
|
-
opacity: 0;
|
|
56
|
-
visibility: hidden;
|
|
57
|
-
transition: visibility 0s linear 300ms, opacity 300ms;
|
|
58
|
-
}
|
|
59
|
-
.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover .ol-ctx-menu-container {
|
|
60
|
-
opacity: 1;
|
|
61
|
-
visibility: visible;
|
|
62
|
-
transition-delay: 0s;
|
|
63
|
-
}
|
|
64
|
-
.ol-ctx-menu-container li.ol-ctx-menu-submenu::after {
|
|
65
|
-
position: absolute;
|
|
66
|
-
top: 7px;
|
|
67
|
-
right: 10px;
|
|
68
|
-
content: "";
|
|
69
|
-
display: inline-block;
|
|
70
|
-
width: 0.6em;
|
|
71
|
-
height: 0.6em;
|
|
72
|
-
border-right: 0.3em solid #222;
|
|
73
|
-
border-top: 0.3em solid #222;
|
|
74
|
-
transform: rotate(45deg);
|
|
75
|
-
}
|
|
76
|
-
.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover::after {
|
|
77
|
-
border-color: #eee;
|
|
78
|
-
}
|
|
79
|
-
.ol-ctx-menu-container li.ol-ctx-menu-separator {
|
|
80
|
-
padding: 0;
|
|
81
|
-
}
|
|
82
|
-
.ol-ctx-menu-container li.ol-ctx-menu-separator hr {
|
|
83
|
-
border: 0;
|
|
84
|
-
height: 1px;
|
|
85
|
-
background-image: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ol-ctx-menu-icon {
|
|
89
|
-
text-indent: 20px;
|
|
90
|
-
background-size: 20px auto;
|
|
91
|
-
background-repeat: no-repeat;
|
|
92
|
-
background-position: left center;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.ol-ctx-menu-zoom-in {
|
|
96
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABaUlEQVQ4T72U7VHCQBCGn90GtAMuNGCswFiBWIFQgWMFxg6wArECsQKhArEBiB1Qwa1zgQn5IAYcxv13k71n3919L8KJQ07M47+BzgG9TRfZ/JBuWhS6BJFHRJICYrZGZIz3z5Ct2+B7gG6I6kt+wewdkQVwjtkAkR5mC8yu26A1oItR/cTsOweQBdgutD8G7jGm2PJ2n8oqUKIpIjd4HxTM8gvaT/F+AlmWnyWaIXKF95eNguFzTYFhNsdWu9kFgFlaFMANUH3D8wDLoLgSTSD2il8NCe2ZXQBxWDGwxmyUzzOMBZ7wy7Qb2K0wQfXjMOBuhlFpZtNty5sFaTQBuTusZdymeqs1SpYKcO9HkE3KbTd9WFijMHJQ5hBNEAYNq5Qd0dhyke0GiE4QzjqfW23mHT8Hl4DG4Lce3FPE7AtbBSdsbNqpoJLgYkRnNeUV+xwJDHTnUEkxHGbhBXUs5TjJjew/KPy94g+NRaIVRYmMXwAAAABJRU5ErkJggg==");
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-in {
|
|
100
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABc0lEQVQ4T71U21ECQRDsJgGdvQDECMQIxAjECMQILCPwzAAjECIQI0AiEDPQAPaWCBhrcKHuCUcV5f7dY3v6tUscefHIePhfwBBCF8CZqRCReRs1tQxDCH1VfQLQz4EsSY4AvIjIsgm8AhhCGKrqa9zwrqoLAKckB5HtguR1E2gBMITQU9VPAD8GICIGtl3e+xHJBwBT59xtHcsCYJZlUwA3kcGHbfDep51OZywi3/acZZm9vyJ5WR5o38uACmDunNt6ZwAkUxFZDwghDFT1jeSjiJinhVUBVNVJkiTDKO8CQA+AsbNQ7s1Ps0VVn5MkSfcCtmBoDZi1Bdx4eJ7zbBolrwPy3o9J3rWSHPs3A1BbjVKlYBaIyDgvu9LDXDU2RTZmXVW1oKyLxRD+OrkOrJLy5mVM0iaftDhuhVbsvBzMglzKUNW6IV/OOWtCM8MmVvEkmbwt83LaB19fdgOtVquUZJeknaDdobTwbOcvBzPcN/AXH1DFFWP7u9oAAAAASUVORK5CYII=");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.ol-ctx-menu-zoom-out {
|
|
104
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABU0lEQVQ4T72U7VECMRRFz3sNaAdkacC1AtcKxApcKnCsQOwAK3CtQKxAqEBsANYOqCDPyTIC+8WCw5jfybn33dxEOPGSE/P4b6BzQG89RT47ZJoWhy5B5BGRZAMxWyEyxvtnyFdt8AagS1F9KQ6YvSMyB84xGyDSw2yO2XUbtAJ0MaqfmH0XAPIA2y7tj4F7jAm2uG1yWQZKNEHkBu+Dg2njWBJNEbnC+8uaIFRuWfuG2QxbbrOrUd0A1Tc8D7AIjkur7DAAsVf8MiWMZ3ZR2m02LPIMscATfjHqBnY7TFD9OAy4zTCCPG/MUKMM5O6wkXFr9dZq7FQqqHk/hDzbFa73cFONTZFDdRyiCcKg5rrSiLaXkiI6RjjrfG6VzDs+B5eAxuDXeYpmNRGzL2wZ/wof+du4GNFpBVqqz5HA4MM5VEYYDrOs+1I6Q9u/4Q8O9wN/AGgWjBVqQjjgAAAAAElFTkSuQmCC");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-out {
|
|
108
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABYklEQVQ4T72U4VHCQBCF36tA91KAWIFYgViBWIFYgWMFYgdYgVCBWAFSgdiBFpAsFWSdxcDkQoBkhnF/ZjbfvX377ogjF4/Mw/8CVbUD4MynEJF5k2lqFapqz8yeAPRKkCXJEYAXEVnugm8BVXVgZq/FD+9mtgBwSrJfqF2QvN4FjYCq2jWzTwA/DhARh20qTdMRyQcA0xDCbZ3KCJhl2RTATaHgo+6HLMv8+xXJy+qB3l8FGoB5CKHsXcRV1b6ZvZF8FBH3NKotoJlNkiQZFONdlLtJ3rufbouZPSdJMjwIbKDQEzBrClx7eC4i33Uepmk6JnnXaOQifzMAtdGoRApugYiMI1uqKkrRWAfZo9MxM1+UZzFewl8mN4nYdVM83L7BkwbXLUrF3sfBLQDQBbDy08x8vOohXyEE71lVq9emuEk+3gZa3XYroCvwFyjP8yHJDsnxwaU08GxvS2uFhw78BbzWrxXgMbsHAAAAAElFTkSuQmCC");
|
|
109
|
-
}
|
|
1
|
+
.ol-ctx-menu-container{position:absolute;padding:8px;background:#fff;color:#222;font-size:13px;border-radius:5px;box-shadow:#0003 3px 3px 5px;box-sizing:border-box}.ol-ctx-menu-container div,.ol-ctx-menu-container span,.ol-ctx-menu-container a,.ol-ctx-menu-container img,.ol-ctx-menu-container ul,.ol-ctx-menu-container li{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}.ol-ctx-menu-container a img{border:none}.ol-ctx-menu-container *,.ol-ctx-menu-container *:before,.ol-ctx-menu-container *:after{box-sizing:inherit}.ol-ctx-menu-container.ol-ctx-menu-hidden{opacity:0;visibility:hidden;transition:visibility 0s linear .3s,opacity .3s}.ol-ctx-menu-container ul{list-style:none}.ol-ctx-menu-container li{position:relative;line-height:20px;padding:2px 5px;white-space:nowrap}.ol-ctx-menu-container li:not(.ol-ctx-menu-separator):hover{cursor:pointer;background-color:#333;color:#eee}.ol-ctx-menu-container li.ol-ctx-menu-submenu .ol-ctx-menu-container{border:1px solid #eee;padding:8px;top:0;opacity:0;visibility:hidden;transition:visibility 0s linear .3s,opacity .3s}.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover>.ol-ctx-menu-container{opacity:1;visibility:visible;transition-delay:0s}.ol-ctx-menu-container li.ol-ctx-menu-submenu:after{position:absolute;top:7px;right:10px;content:"";display:inline-block;width:.6em;height:.6em;border-right:.3em solid #222;border-top:.3em solid #222;transform:rotate(45deg)}.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover:after{border-color:#eee}.ol-ctx-menu-container li.ol-ctx-menu-separator{padding:0}.ol-ctx-menu-container li.ol-ctx-menu-separator hr{border:0;height:1px;background-image:linear-gradient(to left,rgba(0,0,0,0),rgba(0,0,0,.75),rgba(0,0,0,0))}.ol-ctx-menu-icon{text-indent:20px;background-size:20px auto;background-repeat:no-repeat;background-position:left center}.ol-ctx-menu-zoom-in{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABaUlEQVQ4T72U7VHCQBCGn90GtAMuNGCswFiBWIFQgWMFxg6wArECsQKhArEBiB1Qwa1zgQn5IAYcxv13k71n3919L8KJQ07M47+BzgG9TRfZ/JBuWhS6BJFHRJICYrZGZIz3z5Ct2+B7gG6I6kt+wewdkQVwjtkAkR5mC8yu26A1oItR/cTsOweQBdgutD8G7jGm2PJ2n8oqUKIpIjd4HxTM8gvaT/F+AlmWnyWaIXKF95eNguFzTYFhNsdWu9kFgFlaFMANUH3D8wDLoLgSTSD2il8NCe2ZXQBxWDGwxmyUzzOMBZ7wy7Qb2K0wQfXjMOBuhlFpZtNty5sFaTQBuTusZdymeqs1SpYKcO9HkE3KbTd9WFijMHJQ5hBNEAYNq5Qd0dhyke0GiE4QzjqfW23mHT8Hl4DG4Lce3FPE7AtbBSdsbNqpoJLgYkRnNeUV+xwJDHTnUEkxHGbhBXUs5TjJjew/KPy94g+NRaIVRYmMXwAAAABJRU5ErkJggg==)}.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-in{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABc0lEQVQ4T71U21ECQRDsJgGdvQDECMQIxAjECMQILCPwzAAjECIQI0AiEDPQAPaWCBhrcKHuCUcV5f7dY3v6tUscefHIePhfwBBCF8CZqRCReRs1tQxDCH1VfQLQz4EsSY4AvIjIsgm8AhhCGKrqa9zwrqoLAKckB5HtguR1E2gBMITQU9VPAD8GICIGtl3e+xHJBwBT59xtHcsCYJZlUwA3kcGHbfDep51OZywi3/acZZm9vyJ5WR5o38uACmDunNt6ZwAkUxFZDwghDFT1jeSjiJinhVUBVNVJkiTDKO8CQA+AsbNQ7s1Ps0VVn5MkSfcCtmBoDZi1Bdx4eJ7zbBolrwPy3o9J3rWSHPs3A1BbjVKlYBaIyDgvu9LDXDU2RTZmXVW1oKyLxRD+OrkOrJLy5mVM0iaftDhuhVbsvBzMglzKUNW6IV/OOWtCM8MmVvEkmbwt83LaB19fdgOtVquUZJeknaDdobTwbOcvBzPcN/AXH1DFFWP7u9oAAAAASUVORK5CYII=)}.ol-ctx-menu-zoom-out{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABU0lEQVQ4T72U7VECMRRFz3sNaAdkacC1AtcKxApcKnCsQOwAK3CtQKxAqEBsANYOqCDPyTIC+8WCw5jfybn33dxEOPGSE/P4b6BzQG89RT47ZJoWhy5B5BGRZAMxWyEyxvtnyFdt8AagS1F9KQ6YvSMyB84xGyDSw2yO2XUbtAJ0MaqfmH0XAPIA2y7tj4F7jAm2uG1yWQZKNEHkBu+Dg2njWBJNEbnC+8uaIFRuWfuG2QxbbrOrUd0A1Tc8D7AIjkur7DAAsVf8MiWMZ3ZR2m02LPIMscATfjHqBnY7TFD9OAy4zTCCPG/MUKMM5O6wkXFr9dZq7FQqqHk/hDzbFa73cFONTZFDdRyiCcKg5rrSiLaXkiI6RjjrfG6VzDs+B5eAxuDXeYpmNRGzL2wZ/wof+du4GNFpBVqqz5HA4MM5VEYYDrOs+1I6Q9u/4Q8O9wN/AGgWjBVqQjjgAAAAAElFTkSuQmCC)}.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-out{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABYklEQVQ4T72U4VHCQBCF36tA91KAWIFYgViBWIFYgWMFYgdYgVCBWAFSgdiBFpAsFWSdxcDkQoBkhnF/ZjbfvX377ogjF4/Mw/8CVbUD4MynEJF5k2lqFapqz8yeAPRKkCXJEYAXEVnugm8BVXVgZq/FD+9mtgBwSrJfqF2QvN4FjYCq2jWzTwA/DhARh20qTdMRyQcA0xDCbZ3KCJhl2RTATaHgo+6HLMv8+xXJy+qB3l8FGoB5CKHsXcRV1b6ZvZF8FBH3NKotoJlNkiQZFONdlLtJ3rufbouZPSdJMjwIbKDQEzBrClx7eC4i33Uepmk6JnnXaOQifzMAtdGoRApugYiMI1uqKkrRWAfZo9MxM1+UZzFewl8mN4nYdVM83L7BkwbXLUrF3sfBLQDQBbDy08x8vOohXyEE71lVq9emuEk+3gZa3XYroCvwFyjP8yHJDsnxwaU08GxvS2uFhw78BbzWrxXgMbsHAAAAAElFTkSuQmCC)}
|
package/dist/ol-contextmenu.js
CHANGED
|
@@ -1,6 +1,313 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var k = (s, t, e) => t in s ? S(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var a = (s, t, e) => (k(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import T from "ol/control/Control";
|
|
5
|
+
var M = /* @__PURE__ */ ((s) => (s.CONTEXTMENU = "contextmenu", s.CLICK = "click", s.DBLCLICK = "dblclick", s))(M || {}), p = /* @__PURE__ */ ((s) => (s.BEFOREOPEN = "beforeopen", s.OPEN = "open", s.CLOSE = "close", s.ADD_MENU_ENTRY = "add-menu-entry", s))(p || {});
|
|
6
|
+
const O = {
|
|
7
|
+
width: 150,
|
|
8
|
+
scrollAt: 4,
|
|
9
|
+
eventType: M.CONTEXTMENU,
|
|
10
|
+
defaultItems: !0,
|
|
11
|
+
items: []
|
|
12
|
+
}, d = "ol-ctx-menu", r = {
|
|
13
|
+
namespace: d,
|
|
14
|
+
container: `${d}-container`,
|
|
15
|
+
separator: `${d}-separator`,
|
|
16
|
+
submenu: `${d}-submenu`,
|
|
17
|
+
hidden: `${d}-hidden`,
|
|
18
|
+
icon: `${d}-icon`,
|
|
19
|
+
zoomIn: `${d}-zoom-in`,
|
|
20
|
+
zoomOut: `${d}-zoom-out`,
|
|
21
|
+
unselectable: "ol-unselectable"
|
|
22
|
+
}, x = [
|
|
23
|
+
{
|
|
24
|
+
text: "Zoom In",
|
|
25
|
+
classname: `${r.zoomIn} ${r.icon}`,
|
|
26
|
+
callback: (s, t) => {
|
|
27
|
+
const e = t.getView();
|
|
28
|
+
e.animate({
|
|
29
|
+
zoom: Number(e.getZoom()) + 1,
|
|
30
|
+
duration: 700,
|
|
31
|
+
center: s.coordinate
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: "Zoom Out",
|
|
37
|
+
classname: `${r.zoomOut} ${r.icon}`,
|
|
38
|
+
callback: (s, t) => {
|
|
39
|
+
const e = t.getView();
|
|
40
|
+
e.animate({
|
|
41
|
+
zoom: Number(e.getZoom()) - 1,
|
|
42
|
+
duration: 700,
|
|
43
|
+
center: s.coordinate
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
var w = { exports: {} };
|
|
49
|
+
function b() {
|
|
50
|
+
}
|
|
51
|
+
b.prototype = {
|
|
52
|
+
on: function(s, t, e) {
|
|
53
|
+
var n = this.e || (this.e = {});
|
|
54
|
+
return (n[s] || (n[s] = [])).push({
|
|
55
|
+
fn: t,
|
|
56
|
+
ctx: e
|
|
57
|
+
}), this;
|
|
58
|
+
},
|
|
59
|
+
once: function(s, t, e) {
|
|
60
|
+
var n = this;
|
|
61
|
+
function i() {
|
|
62
|
+
n.off(s, i), t.apply(e, arguments);
|
|
63
|
+
}
|
|
64
|
+
return i._ = t, this.on(s, i, e);
|
|
65
|
+
},
|
|
66
|
+
emit: function(s) {
|
|
67
|
+
var t = [].slice.call(arguments, 1), e = ((this.e || (this.e = {}))[s] || []).slice(), n = 0, i = e.length;
|
|
68
|
+
for (n; n < i; n++)
|
|
69
|
+
e[n].fn.apply(e[n].ctx, t);
|
|
70
|
+
return this;
|
|
71
|
+
},
|
|
72
|
+
off: function(s, t) {
|
|
73
|
+
var e = this.e || (this.e = {}), n = e[s], i = [];
|
|
74
|
+
if (n && t)
|
|
75
|
+
for (var o = 0, l = n.length; o < l; o++)
|
|
76
|
+
n[o].fn !== t && n[o].fn._ !== t && i.push(n[o]);
|
|
77
|
+
return i.length ? e[s] = i : delete e[s], this;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
w.exports = b;
|
|
81
|
+
var D = w.exports.TinyEmitter = b;
|
|
82
|
+
const y = new D();
|
|
83
|
+
function E(s) {
|
|
84
|
+
const t = document.createDocumentFragment(), e = document.createElement("div");
|
|
85
|
+
for (e.innerHTML = s; e.firstChild; )
|
|
86
|
+
t.append(e.firstChild);
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
89
|
+
function I(s) {
|
|
90
|
+
const t = document.importNode(s), e = s.offsetWidth;
|
|
91
|
+
t.style.cssText = `position: fixed; top: 0; left: 0; overflow: auto; visibility: hidden; pointer-events: none; height: unset; max-height: unset; width: ${e}px`;
|
|
92
|
+
const n = E("<span>Foo</span>"), i = E("<span>Foo</span>"), o = document.createElement("li"), l = document.createElement("li");
|
|
93
|
+
o.append(n), l.append(i), t.append(o), t.append(l), s.parentNode?.append(t);
|
|
94
|
+
const u = t.offsetHeight / 2;
|
|
95
|
+
return s.parentNode?.removeChild(t), u;
|
|
96
|
+
}
|
|
97
|
+
function L(s, t, e = !1) {
|
|
98
|
+
const n = `_${Math.random().toString(36).slice(2, 11)}`;
|
|
99
|
+
if (typeof t != "string" && "text" in t) {
|
|
100
|
+
const u = `<span>${t.text}</span>`, f = E(u), c = document.createElement("li");
|
|
101
|
+
return t.classname = t.classname || "", t.icon && (t.classname === "" ? t.classname = r.icon : t.classname.includes(r.icon) === !1 && (t.classname += ` ${r.icon}`), c.setAttribute("style", `background-image:url(${t.icon})`)), c.id = n, c.className = t.classname, c.append(f), s.append(c), y.emit(
|
|
102
|
+
p.ADD_MENU_ENTRY,
|
|
103
|
+
{
|
|
104
|
+
id: n,
|
|
105
|
+
isSubmenu: e,
|
|
106
|
+
isSeparator: !1,
|
|
107
|
+
callback: "callback" in t ? t.callback : null,
|
|
108
|
+
data: "data" in t ? t.data : null
|
|
109
|
+
},
|
|
110
|
+
c
|
|
111
|
+
), c;
|
|
112
|
+
}
|
|
113
|
+
const i = `<li id="${n}" class="${r.separator}"><hr></li>`, o = E(i);
|
|
114
|
+
s.append(o);
|
|
115
|
+
const l = s.lastChild;
|
|
116
|
+
return y.emit(
|
|
117
|
+
p.ADD_MENU_ENTRY,
|
|
118
|
+
{
|
|
119
|
+
id: n,
|
|
120
|
+
isSubmenu: e,
|
|
121
|
+
isSeparator: !0,
|
|
122
|
+
callback: null,
|
|
123
|
+
data: null
|
|
124
|
+
},
|
|
125
|
+
l
|
|
126
|
+
), l;
|
|
127
|
+
}
|
|
128
|
+
function v(s, t, e) {
|
|
129
|
+
t.forEach((n) => {
|
|
130
|
+
if (typeof n != "string" && "items" in n && Array.isArray(n.items)) {
|
|
131
|
+
const i = L(s, n, !0);
|
|
132
|
+
i.classList.add(r.submenu);
|
|
133
|
+
const o = document.createElement("ul");
|
|
134
|
+
o.classList.add(r.container), o.style.width = `${e}px`, i.append(o), v(o, n.items, e);
|
|
135
|
+
} else
|
|
136
|
+
L(s, n);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function g(s, t) {
|
|
140
|
+
if (!s)
|
|
141
|
+
throw new Error(t);
|
|
142
|
+
}
|
|
143
|
+
class z extends T {
|
|
144
|
+
constructor(e = {}) {
|
|
145
|
+
g(typeof e == "object", "@param `opts` should be object type!");
|
|
146
|
+
const n = document.createElement("div");
|
|
147
|
+
super({ element: n });
|
|
148
|
+
a(this, "map");
|
|
149
|
+
a(this, "container");
|
|
150
|
+
a(this, "coordinate", []);
|
|
151
|
+
a(this, "pixel", []);
|
|
152
|
+
a(this, "contextMenuEventListener");
|
|
153
|
+
a(this, "entryCallbackEventListener");
|
|
154
|
+
a(this, "mapMoveListener");
|
|
155
|
+
a(this, "lineHeight", 0);
|
|
156
|
+
a(this, "disabled");
|
|
157
|
+
a(this, "opened");
|
|
158
|
+
a(this, "items", []);
|
|
159
|
+
a(this, "menuEntries", /* @__PURE__ */ new Map());
|
|
160
|
+
a(this, "options");
|
|
161
|
+
this.options = { ...O, ...e };
|
|
162
|
+
const i = document.createElement("ul");
|
|
163
|
+
n.append(i), n.style.width = `${this.options.width}px`, n.classList.add(
|
|
164
|
+
r.container,
|
|
165
|
+
r.unselectable,
|
|
166
|
+
r.hidden
|
|
167
|
+
), this.container = n, this.contextMenuEventListener = (o) => {
|
|
168
|
+
this.handleContextMenu(o);
|
|
169
|
+
}, this.entryCallbackEventListener = (o) => {
|
|
170
|
+
this.handleEntryCallback(o);
|
|
171
|
+
}, this.mapMoveListener = () => {
|
|
172
|
+
this.handleMapMove();
|
|
173
|
+
}, this.disabled = !1, this.opened = !1, y.on(
|
|
174
|
+
p.ADD_MENU_ENTRY,
|
|
175
|
+
(o, l) => {
|
|
176
|
+
this.handleAddMenuEntry(o, l);
|
|
177
|
+
},
|
|
178
|
+
this
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
clear() {
|
|
182
|
+
for (const e of this.menuEntries.keys())
|
|
183
|
+
this.removeMenuEntry(e);
|
|
184
|
+
this.container.replaceChildren();
|
|
185
|
+
}
|
|
186
|
+
enable() {
|
|
187
|
+
this.disabled = !1;
|
|
188
|
+
}
|
|
189
|
+
disable() {
|
|
190
|
+
this.disabled = !0;
|
|
191
|
+
}
|
|
192
|
+
getDefaultItems() {
|
|
193
|
+
return x;
|
|
194
|
+
}
|
|
195
|
+
countItems() {
|
|
196
|
+
return this.menuEntries.size;
|
|
197
|
+
}
|
|
198
|
+
extend(e) {
|
|
199
|
+
g(Array.isArray(e), "@param `items` should be an Array."), v(
|
|
200
|
+
this.container.firstElementChild,
|
|
201
|
+
e,
|
|
202
|
+
this.options.width
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
closeMenu() {
|
|
206
|
+
this.opened = !1, this.container.classList.add(r.hidden), this.dispatchEvent(p.CLOSE);
|
|
207
|
+
}
|
|
208
|
+
isOpen() {
|
|
209
|
+
return this.opened;
|
|
210
|
+
}
|
|
211
|
+
updatePosition(e) {
|
|
212
|
+
g(Array.isArray(e), "@param `pixel` should be an Array."), this.isOpen() && (this.pixel = e, this.positionContainer());
|
|
213
|
+
}
|
|
214
|
+
pop() {
|
|
215
|
+
const e = Array.from(this.menuEntries.keys()).pop();
|
|
216
|
+
e && this.removeMenuEntry(e);
|
|
217
|
+
}
|
|
218
|
+
shift() {
|
|
219
|
+
const e = Array.from(this.menuEntries.keys()).shift();
|
|
220
|
+
e && this.removeMenuEntry(e);
|
|
221
|
+
}
|
|
222
|
+
push(e) {
|
|
223
|
+
e && this.extend([e]);
|
|
224
|
+
}
|
|
225
|
+
setMap(e) {
|
|
226
|
+
if (super.setMap(e), e) {
|
|
227
|
+
this.map = e, this.map.getViewport().addEventListener(this.options.eventType, this.contextMenuEventListener, !1), this.map.on("movestart", () => {
|
|
228
|
+
this.handleMapMove();
|
|
229
|
+
}), this.items = this.options.defaultItems ? this.options.items.concat(x) : this.options.items, v(
|
|
230
|
+
this.container.firstElementChild,
|
|
231
|
+
this.items,
|
|
232
|
+
this.options.width
|
|
233
|
+
);
|
|
234
|
+
const n = this.getMenuEntriesLength();
|
|
235
|
+
this.lineHeight = n > 0 ? this.container.offsetHeight / n : I(this.container);
|
|
236
|
+
} else
|
|
237
|
+
this.removeListeners(), this.clear();
|
|
238
|
+
}
|
|
239
|
+
removeListeners() {
|
|
240
|
+
this.map.getViewport().removeEventListener(this.options.eventType, this.contextMenuEventListener, !1);
|
|
241
|
+
}
|
|
242
|
+
removeMenuEntry(e) {
|
|
243
|
+
const n = document.getElementById(e);
|
|
244
|
+
n?.remove(), n?.removeEventListener("click", this.entryCallbackEventListener), this.menuEntries.delete(e);
|
|
245
|
+
}
|
|
246
|
+
handleContextMenu(e) {
|
|
247
|
+
this.coordinate = this.map.getEventCoordinate(e), this.pixel = this.map.getEventPixel(e), this.dispatchEvent({
|
|
248
|
+
type: p.BEFOREOPEN,
|
|
249
|
+
pixel: this.pixel,
|
|
250
|
+
coordinate: this.coordinate
|
|
251
|
+
}), !this.disabled && (this.options.eventType === M.CONTEXTMENU && (e.stopPropagation(), e.preventDefault()), this.openMenu(), e.target?.addEventListener(
|
|
252
|
+
"pointerdown",
|
|
253
|
+
(n) => {
|
|
254
|
+
this.opened && (n.stopPropagation(), this.closeMenu());
|
|
255
|
+
},
|
|
256
|
+
{ once: !0 }
|
|
257
|
+
));
|
|
258
|
+
}
|
|
259
|
+
openMenu() {
|
|
260
|
+
this.menuEntries.size !== 0 && (this.opened = !0, this.positionContainer(), this.container.classList.remove(r.hidden));
|
|
261
|
+
}
|
|
262
|
+
getMenuEntriesLength() {
|
|
263
|
+
return Array.from(this.menuEntries).filter(
|
|
264
|
+
([, e]) => e.isSeparator === !1 || e.isSubmenu === !1
|
|
265
|
+
).length;
|
|
266
|
+
}
|
|
267
|
+
positionContainer() {
|
|
268
|
+
const e = this.map.getSize() || [0, 0], n = {
|
|
269
|
+
w: e[0] - this.pixel[0],
|
|
270
|
+
h: e[1] - this.pixel[1]
|
|
271
|
+
}, i = {
|
|
272
|
+
w: this.container.offsetWidth,
|
|
273
|
+
h: Math.round(this.lineHeight * this.getMenuEntriesLength())
|
|
274
|
+
}, o = n.w >= i.w ? this.pixel[0] + 5 : this.pixel[0] - i.w;
|
|
275
|
+
this.container.style.left = `${o}px`, this.container.style.top = n.h >= i.h ? `${this.pixel[1] - 10}px` : `${this.pixel[1] - i.h}px`, this.container.style.right = "auto", this.container.style.bottom = "auto", n.w -= i.w;
|
|
276
|
+
const l = (c) => Array.from(c.children).filter(
|
|
277
|
+
(m) => m.tagName === "LI" && m.classList.contains(r.submenu)
|
|
278
|
+
);
|
|
279
|
+
let u = 0;
|
|
280
|
+
const f = (c, m) => {
|
|
281
|
+
u += 1, l(c).forEach((C) => {
|
|
282
|
+
const A = m >= i.w ? i.w - 8 : (i.w + 8) * -1, h = C.querySelector(
|
|
283
|
+
`ul.${r.container}`
|
|
284
|
+
), $ = Math.round(
|
|
285
|
+
this.lineHeight * Array.from(h.children).filter((N) => N.tagName === "LI").length
|
|
286
|
+
);
|
|
287
|
+
h.style.left = `${A}px`, h.style.right = "auto", h.style.top = n.h >= $ + i.h ? "0" : `-${h.offsetHeight - 25}px`, h.style.bottom = "auto", h.style.zIndex = String(u), l(h).length > 0 && f(h, m - i.w);
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
f(this.container.firstElementChild, n.w);
|
|
291
|
+
}
|
|
292
|
+
handleMapMove() {
|
|
293
|
+
this.closeMenu();
|
|
294
|
+
}
|
|
295
|
+
handleEntryCallback(e) {
|
|
296
|
+
e.preventDefault(), e.stopPropagation();
|
|
297
|
+
const n = e.currentTarget, i = this.menuEntries.get(n.id);
|
|
298
|
+
if (!i)
|
|
299
|
+
return;
|
|
300
|
+
const o = {
|
|
301
|
+
coordinate: this.coordinate,
|
|
302
|
+
data: i.data
|
|
303
|
+
};
|
|
304
|
+
this.closeMenu(), i.callback?.(o, this.map);
|
|
305
|
+
}
|
|
306
|
+
handleAddMenuEntry(e, n) {
|
|
307
|
+
this.menuEntries.set(e.id, e), "callback" in e && typeof e.callback == "function" && n.addEventListener("click", this.entryCallbackEventListener, !1);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
window.ol?.control && (window.ol.control.ContextMenu = z);
|
|
311
|
+
export {
|
|
312
|
+
z as default
|
|
313
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(l,c){typeof exports=="object"&&typeof module<"u"?module.exports=c(require("ol/control/Control")):typeof define=="function"&&define.amd?define(["ol/control/Control"],c):(l=typeof globalThis<"u"?globalThis:l||self,l.ContextMenu=c(l.ol.control.Control))})(this,function(l){"use strict";var z=Object.defineProperty;var H=(l,c,f)=>c in l?z(l,c,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[c]=f;var a=(l,c,f)=>(H(l,typeof c!="symbol"?c+"":c,f),f);const f=(n=>n&&typeof n=="object"&&"default"in n?n:{default:n})(l);var M=(n=>(n.CONTEXTMENU="contextmenu",n.CLICK="click",n.DBLCLICK="dblclick",n))(M||{}),m=(n=>(n.BEFOREOPEN="beforeopen",n.OPEN="open",n.CLOSE="close",n.ADD_MENU_ENTRY="add-menu-entry",n))(m||{});const S={width:150,scrollAt:4,eventType:M.CONTEXTMENU,defaultItems:!0,items:[]},p="ol-ctx-menu",r={namespace:p,container:`${p}-container`,separator:`${p}-separator`,submenu:`${p}-submenu`,hidden:`${p}-hidden`,icon:`${p}-icon`,zoomIn:`${p}-zoom-in`,zoomOut:`${p}-zoom-out`,unselectable:"ol-unselectable"},C=[{text:"Zoom In",classname:`${r.zoomIn} ${r.icon}`,callback:(n,i)=>{const e=i.getView();e.animate({zoom:Number(e.getZoom())+1,duration:700,center:n.coordinate})}},{text:"Zoom Out",classname:`${r.zoomOut} ${r.icon}`,callback:(n,i)=>{const e=i.getView();e.animate({zoom:Number(e.getZoom())-1,duration:700,center:n.coordinate})}}];var A={exports:{}};function x(){}x.prototype={on:function(n,i,e){var t=this.e||(this.e={});return(t[n]||(t[n]=[])).push({fn:i,ctx:e}),this},once:function(n,i,e){var t=this;function s(){t.off(n,s),i.apply(e,arguments)}return s._=i,this.on(n,s,e)},emit:function(n){var i=[].slice.call(arguments,1),e=((this.e||(this.e={}))[n]||[]).slice(),t=0,s=e.length;for(t;t<s;t++)e[t].fn.apply(e[t].ctx,i);return this},off:function(n,i){var e=this.e||(this.e={}),t=e[n],s=[];if(t&&i)for(var o=0,h=t.length;o<h;o++)t[o].fn!==i&&t[o].fn._!==i&&s.push(t[o]);return s.length?e[n]=s:delete e[n],this}},A.exports=x;var k=A.exports.TinyEmitter=x;const b=new k;function y(n){const i=document.createDocumentFragment(),e=document.createElement("div");for(e.innerHTML=n;e.firstChild;)i.append(e.firstChild);return i}function T(n){const i=document.importNode(n),e=n.offsetWidth;i.style.cssText=`position: fixed; top: 0; left: 0; overflow: auto; visibility: hidden; pointer-events: none; height: unset; max-height: unset; width: ${e}px`;const t=y("<span>Foo</span>"),s=y("<span>Foo</span>"),o=document.createElement("li"),h=document.createElement("li");o.append(t),h.append(s),i.append(o),i.append(h),n.parentNode?.append(i);const E=i.offsetHeight/2;return n.parentNode?.removeChild(i),E}function $(n,i,e=!1){const t=`_${Math.random().toString(36).slice(2,11)}`;if(typeof i!="string"&&"text"in i){const E=`<span>${i.text}</span>`,v=y(E),u=document.createElement("li");return i.classname=i.classname||"",i.icon&&(i.classname===""?i.classname=r.icon:i.classname.includes(r.icon)===!1&&(i.classname+=` ${r.icon}`),u.setAttribute("style",`background-image:url(${i.icon})`)),u.id=t,u.className=i.classname,u.append(v),n.append(u),b.emit(m.ADD_MENU_ENTRY,{id:t,isSubmenu:e,isSeparator:!1,callback:"callback"in i?i.callback:null,data:"data"in i?i.data:null},u),u}const s=`<li id="${t}" class="${r.separator}"><hr></li>`,o=y(s);n.append(o);const h=n.lastChild;return b.emit(m.ADD_MENU_ENTRY,{id:t,isSubmenu:e,isSeparator:!0,callback:null,data:null},h),h}function L(n,i,e){i.forEach(t=>{if(typeof t!="string"&&"items"in t&&Array.isArray(t.items)){const s=$(n,t,!0);s.classList.add(r.submenu);const o=document.createElement("ul");o.classList.add(r.container),o.style.width=`${e}px`,s.append(o),L(o,t.items,e)}else $(n,t)})}const P="";function w(n,i){if(!n)throw new Error(i)}class N extends f.default{constructor(e={}){w(typeof e=="object","@param `opts` should be object type!");const t=document.createElement("div");super({element:t});a(this,"map");a(this,"container");a(this,"coordinate",[]);a(this,"pixel",[]);a(this,"contextMenuEventListener");a(this,"entryCallbackEventListener");a(this,"mapMoveListener");a(this,"lineHeight",0);a(this,"disabled");a(this,"opened");a(this,"items",[]);a(this,"menuEntries",new Map);a(this,"options");this.options={...S,...e};const s=document.createElement("ul");t.append(s),t.style.width=`${this.options.width}px`,t.classList.add(r.container,r.unselectable,r.hidden),this.container=t,this.contextMenuEventListener=o=>{this.handleContextMenu(o)},this.entryCallbackEventListener=o=>{this.handleEntryCallback(o)},this.mapMoveListener=()=>{this.handleMapMove()},this.disabled=!1,this.opened=!1,b.on(m.ADD_MENU_ENTRY,(o,h)=>{this.handleAddMenuEntry(o,h)},this)}clear(){for(const e of this.menuEntries.keys())this.removeMenuEntry(e);this.container.replaceChildren()}enable(){this.disabled=!1}disable(){this.disabled=!0}getDefaultItems(){return C}countItems(){return this.menuEntries.size}extend(e){w(Array.isArray(e),"@param `items` should be an Array."),L(this.container.firstElementChild,e,this.options.width)}closeMenu(){this.opened=!1,this.container.classList.add(r.hidden),this.dispatchEvent(m.CLOSE)}isOpen(){return this.opened}updatePosition(e){w(Array.isArray(e),"@param `pixel` should be an Array."),this.isOpen()&&(this.pixel=e,this.positionContainer())}pop(){const e=Array.from(this.menuEntries.keys()).pop();e&&this.removeMenuEntry(e)}shift(){const e=Array.from(this.menuEntries.keys()).shift();e&&this.removeMenuEntry(e)}push(e){e&&this.extend([e])}setMap(e){if(super.setMap(e),e){this.map=e,this.map.getViewport().addEventListener(this.options.eventType,this.contextMenuEventListener,!1),this.map.on("movestart",()=>{this.handleMapMove()}),this.items=this.options.defaultItems?this.options.items.concat(C):this.options.items,L(this.container.firstElementChild,this.items,this.options.width);const t=this.getMenuEntriesLength();this.lineHeight=t>0?this.container.offsetHeight/t:T(this.container)}else this.removeListeners(),this.clear()}removeListeners(){this.map.getViewport().removeEventListener(this.options.eventType,this.contextMenuEventListener,!1)}removeMenuEntry(e){const t=document.getElementById(e);t?.remove(),t?.removeEventListener("click",this.entryCallbackEventListener),this.menuEntries.delete(e)}handleContextMenu(e){this.coordinate=this.map.getEventCoordinate(e),this.pixel=this.map.getEventPixel(e),this.dispatchEvent({type:m.BEFOREOPEN,pixel:this.pixel,coordinate:this.coordinate}),!this.disabled&&(this.options.eventType===M.CONTEXTMENU&&(e.stopPropagation(),e.preventDefault()),this.openMenu(),e.target?.addEventListener("pointerdown",t=>{this.opened&&(t.stopPropagation(),this.closeMenu())},{once:!0}))}openMenu(){this.menuEntries.size!==0&&(this.opened=!0,this.positionContainer(),this.container.classList.remove(r.hidden))}getMenuEntriesLength(){return Array.from(this.menuEntries).filter(([,e])=>e.isSeparator===!1||e.isSubmenu===!1).length}positionContainer(){const e=this.map.getSize()||[0,0],t={w:e[0]-this.pixel[0],h:e[1]-this.pixel[1]},s={w:this.container.offsetWidth,h:Math.round(this.lineHeight*this.getMenuEntriesLength())},o=t.w>=s.w?this.pixel[0]+5:this.pixel[0]-s.w;this.container.style.left=`${o}px`,this.container.style.top=t.h>=s.h?`${this.pixel[1]-10}px`:`${this.pixel[1]-s.h}px`,this.container.style.right="auto",this.container.style.bottom="auto",t.w-=s.w;const h=u=>Array.from(u.children).filter(g=>g.tagName==="LI"&&g.classList.contains(r.submenu));let E=0;const v=(u,g)=>{E+=1,h(u).forEach(_=>{const D=g>=s.w?s.w-8:(s.w+8)*-1,d=_.querySelector(`ul.${r.container}`),O=Math.round(this.lineHeight*Array.from(d.children).filter(I=>I.tagName==="LI").length);d.style.left=`${D}px`,d.style.right="auto",d.style.top=t.h>=O+s.h?"0":`-${d.offsetHeight-25}px`,d.style.bottom="auto",d.style.zIndex=String(E),h(d).length>0&&v(d,g-s.w)})};v(this.container.firstElementChild,t.w)}handleMapMove(){this.closeMenu()}handleEntryCallback(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget,s=this.menuEntries.get(t.id);if(!s)return;const o={coordinate:this.coordinate,data:s.data};this.closeMenu(),s.callback?.(o,this.map)}handleAddMenuEntry(e,t){this.menuEntries.set(e.id,e),"callback"in e&&typeof e.callback=="function"&&t.addEventListener("click",this.entryCallbackEventListener,!1)}}return window.ol?.control&&(window.ol.control.ContextMenu=N),N});
|
package/package.json
CHANGED
|
@@ -1,55 +1,66 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
2
|
+
"name": "ol-contextmenu",
|
|
3
|
+
"version": "5.0.1-alpha",
|
|
4
|
+
"description": "Custom Context Menu for Openlayers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/ol-contextmenu.umd.cjs",
|
|
7
|
+
"module": "./dist/ol-contextmenu.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/ol-contextmenu.js",
|
|
11
|
+
"require": "./dist/ol-contextmenu.umd.cjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/ol-contextmenu.d.ts",
|
|
15
|
+
"author": "Jonatas Walker",
|
|
16
|
+
"homepage": "https://github.com/jonataswalker/ol-contextmenu",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git://github.com/jonataswalker/ol-contextmenu.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/jonataswalker/ol-contextmenu/issues"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": "^16 || ^18",
|
|
27
|
+
"npm": ">=8"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "vite",
|
|
34
|
+
"build": "npm run generate-types && tsc && vite build",
|
|
35
|
+
"preview": "vite preview",
|
|
36
|
+
"lint": "eslint --cache --ext .js .",
|
|
37
|
+
"lint:fix": "npm run lint -- --fix",
|
|
38
|
+
"generate-types": "tsc src/**/*.ts --declaration --declarationMap --emitDeclarationOnly --outdir dist",
|
|
39
|
+
"test": "jest"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@swc/core": "^1.3.0",
|
|
43
|
+
"@swc/jest": "^0.2.22",
|
|
44
|
+
"@types/jest": "^29.0.2",
|
|
45
|
+
"@vitejs/plugin-legacy": "^2.1.0",
|
|
46
|
+
"canvas": "^2.10.1",
|
|
47
|
+
"eslint": "^8.23.1",
|
|
48
|
+
"eslint-config-jwalker": "^7.9.2",
|
|
49
|
+
"eslint-config-prettier": "^8.5.0",
|
|
50
|
+
"eslint-plugin-jest": "^27.0.4",
|
|
51
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
52
|
+
"identity-obj-proxy": "^3.0.0",
|
|
53
|
+
"jest": "^29.0.3",
|
|
54
|
+
"jest-environment-jsdom": "^29.0.3",
|
|
55
|
+
"ol": "^7.1.0",
|
|
56
|
+
"prettier": "^2.7.1",
|
|
57
|
+
"typescript": "^4.8.3",
|
|
58
|
+
"vite": "^3.1.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"ol": "^7.1.0"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"tiny-emitter": "^2.1.0"
|
|
65
|
+
}
|
|
55
66
|
}
|