@local-logic/maps 0.0.11 → 0.0.13

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.
Files changed (67) hide show
  1. package/dist/index-58w3Qwxr.js +56 -0
  2. package/dist/index-BGoTpJjt.js +81 -0
  3. package/dist/index-Bp1bWq9c.js +690 -0
  4. package/dist/index-C36u5N_F.js +34 -0
  5. package/dist/{index-BMvwx9_l.js → index-CBp9gCca.js} +33 -20
  6. package/dist/index-CCtDJ-mV.js +56 -0
  7. package/dist/index-CFomI3Il.js +98 -0
  8. package/dist/index-CUpaKIZP.js +105 -0
  9. package/dist/index-CXTsUiSS.js +57 -0
  10. package/dist/index-CXUQoF5Q.js +34 -0
  11. package/dist/index-DY5pY-zk.js +43 -0
  12. package/dist/index-S5SfktvB.js +79 -0
  13. package/dist/{index-BsnsAUt5.js → index-UEadmVww.js} +2 -1
  14. package/dist/index.es.js +1 -1
  15. package/dist/index.umd.js +82 -78
  16. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts +1 -1
  17. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
  18. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts +1 -1
  19. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
  20. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts +1 -1
  21. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
  22. package/dist/src/components/Map/Root/BaseMap/index.d.ts +1 -1
  23. package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -1
  24. package/dist/src/components/Map/Root/BaseMap/types.d.ts +10 -1
  25. package/dist/src/components/Map/Root/BaseMap/types.d.ts.map +1 -1
  26. package/dist/src/components/Map/Root/Layers/Google/index.d.ts.map +1 -1
  27. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts +2 -1
  28. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts.map +1 -1
  29. package/dist/src/components/Map/Root/Markers/Google/index.d.ts +1 -1
  30. package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
  31. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +1 -1
  32. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
  33. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +1 -1
  34. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
  35. package/dist/src/components/Map/Root/Markers/index.d.ts +1 -1
  36. package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
  37. package/dist/src/components/Map/Root/Markers/styles.d.ts +2 -2
  38. package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -1
  39. package/dist/src/components/Map/Root/Markers/types.d.ts +1 -11
  40. package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
  41. package/dist/src/components/Map/Root/Popup/Google/index.d.ts.map +1 -1
  42. package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -1
  43. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
  44. package/dist/src/components/Map/Root/Popup/index.d.ts +1 -1
  45. package/dist/src/components/Map/Root/Popup/index.d.ts.map +1 -1
  46. package/dist/src/components/Map/Root/Popup/styles.d.ts +1 -1
  47. package/dist/src/components/Map/Root/Popup/styles.d.ts.map +1 -1
  48. package/dist/src/components/Map/Root/constants.d.ts +4 -0
  49. package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
  50. package/dist/src/components/Map/Root/context.d.ts +3 -0
  51. package/dist/src/components/Map/Root/context.d.ts.map +1 -1
  52. package/dist/src/components/Map/Root/index.d.ts.map +1 -1
  53. package/dist/src/components/Map/Root/types.d.ts +1 -0
  54. package/dist/src/components/Map/Root/types.d.ts.map +1 -1
  55. package/dist/style.css +2 -2
  56. package/dist/{styles-uPzJnzVS.js → styles-ChFj97uV.js} +1 -1
  57. package/package.json +1 -1
  58. package/dist/index-9RZYMoMG.js +0 -39
  59. package/dist/index-B9QF7ewJ.js +0 -73
  60. package/dist/index-BOBkPCX5.js +0 -772
  61. package/dist/index-BOuko7CL.js +0 -32
  62. package/dist/index-BdXay-zF.js +0 -62
  63. package/dist/index-Bn_2qA7h.js +0 -65
  64. package/dist/index-D5uhfwEH.js +0 -31
  65. package/dist/index-DJ4SJ9IL.js +0 -53
  66. package/dist/index-DaEKTD5_.js +0 -65
  67. package/dist/index-Dyy8UNMs.js +0 -50
@@ -0,0 +1,34 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useEffect as a } from "react";
3
+ import { P as c } from "./scale-control-CyJd4u6j.js";
4
+ import { u as i } from "./index-Bp1bWq9c.js";
5
+ import { c as n } from "./styles-ChFj97uV.js";
6
+ function l({
7
+ latitude: p,
8
+ longitude: t,
9
+ anchor: f,
10
+ offset: o = [0, -35],
11
+ onClose: r,
12
+ children: m
13
+ }) {
14
+ const { zoom: u } = i();
15
+ return a(() => {
16
+ r == null || r();
17
+ }, [u]), typeof p > "u" || typeof t > "u" ? null : /* @__PURE__ */ e(
18
+ c,
19
+ {
20
+ className: "mapbox-popup",
21
+ focusAfterOpen: !0,
22
+ latitude: p,
23
+ longitude: t,
24
+ anchor: f,
25
+ offset: o,
26
+ onClose: r,
27
+ closeButton: !1,
28
+ children: /* @__PURE__ */ e("div", { className: n, children: m })
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ l as default
34
+ };
@@ -1,9 +1,9 @@
1
- import { jsx as t, jsxs as o, Fragment as f } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as c, Fragment as g } from "react/jsx-runtime";
2
2
  import * as e from "react";
3
- import { useMemo as g } from "react";
4
- import { u as Z, M as c } from "./index-BOBkPCX5.js";
5
- import { p as A } from "./IconBase.es-rM5tt24D.js";
6
- const p = /* @__PURE__ */ new Map([
3
+ import { useMemo as Z } from "react";
4
+ import { u as A, M as o } from "./index-Bp1bWq9c.js";
5
+ import { p } from "./IconBase.es-rM5tt24D.js";
6
+ const h = /* @__PURE__ */ new Map([
7
7
  [
8
8
  "bold",
9
9
  /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,60a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,60Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,124Zm0-112a92.1,92.1,0,0,0-92,92c0,77.36,81.64,135.4,85.12,137.83a12,12,0,0,0,13.76,0,259,259,0,0,0,42.18-39C205.15,170.57,220,136.37,220,104A92.1,92.1,0,0,0,128,12Zm31.3,174.71A249.35,249.35,0,0,1,128,216.89a249.35,249.35,0,0,1-31.3-30.18C80,167.37,60,137.31,60,104a68,68,0,0,1,136,0C196,137.31,176,167.37,159.3,186.71Z" }))
@@ -34,7 +34,7 @@ const p = /* @__PURE__ */ new Map([
34
34
  "thin",
35
35
  /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,68a36,36,0,1,0,36,36A36,36,0,0,0,128,68Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,132Zm0-112a84.09,84.09,0,0,0-84,84c0,30.42,14.17,62.79,41,93.62a250,250,0,0,0,40.73,37.66,4,4,0,0,0,4.58,0A250,250,0,0,0,171,197.62c26.81-30.83,41-63.2,41-93.62A84.09,84.09,0,0,0,128,20Zm37.1,172.23A254.62,254.62,0,0,1,128,227a254.62,254.62,0,0,1-37.1-34.81C73.15,171.8,52,139.9,52,104a76,76,0,0,1,152,0C204,139.9,182.85,171.8,165.1,192.23Z" }))
36
36
  ]
37
- ]), d = e.forwardRef((a, r) => /* @__PURE__ */ e.createElement(A, { ref: r, ...a, weights: p }));
37
+ ]), d = e.forwardRef((t, a) => /* @__PURE__ */ e.createElement(p, { ref: a, ...t, weights: h }));
38
38
  d.displayName = "MapPinIcon";
39
39
  const m = `
40
40
  group/marker cursor-pointer rounded-full
@@ -50,6 +50,8 @@ const m = `
50
50
  data-[is-zoomed-out=true]:bg-[var(--fill)]
51
51
  data-[is-zoomed-out=true]:h-4
52
52
  data-[is-zoomed-out=true]:w-4
53
+
54
+ data-[is-active=true]:bg-[var(--fill)]
53
55
  `, u = `
54
56
  m-auto transition-all w-4 h-4
55
57
 
@@ -57,40 +59,51 @@ const m = `
57
59
  group-hover/marker:fill-[var(--background)]
58
60
 
59
61
  group-data-[is-zoomed-out=true]/marker:hidden
62
+
63
+ group-data-[is-active=true]/marker:fill-[var(--background)]
60
64
  `;
61
- function h({ icon: a }) {
62
- return typeof a < "u" ? /* @__PURE__ */ t(a, { className: u }) : /* @__PURE__ */ t(d, { className: u });
65
+ function v({ icon: t }) {
66
+ return typeof t < "u" ? /* @__PURE__ */ r(t, { className: u }) : /* @__PURE__ */ r(d, { className: u });
63
67
  }
64
- const E = `
68
+ const M = `
65
69
  relative flex
66
70
  `, s = `
67
71
  -ml-6 -z-10 last:-z-20
68
72
  `;
69
- function k({
73
+ function N({
74
+ isActive: t = !1,
70
75
  colors: a,
71
- icon: r
76
+ icon: f
72
77
  }) {
73
- const { zoom: n, mapProvider: l } = Z(), i = g(() => l.name === "google" ? n - 1 < c + 1 : n < c, [n, l]);
74
- return /* @__PURE__ */ o(
78
+ const { zoom: n, mapProvider: l } = A(), i = Z(() => l.name === "google" ? n - 1 < o + 1 : n < o, [n, l]);
79
+ return /* @__PURE__ */ c(
75
80
  "div",
76
81
  {
77
- className: E,
82
+ className: M,
78
83
  style: {
79
84
  "--background": a == null ? void 0 : a.background,
80
85
  "--fill": a == null ? void 0 : a.fill
81
86
  },
82
87
  children: [
83
- /* @__PURE__ */ t("div", { className: m, "data-is-zoomed-out": i, children: /* @__PURE__ */ t(h, { icon: r }) }),
84
- !i && /* @__PURE__ */ o(f, { children: [
85
- /* @__PURE__ */ t("div", { className: `${m} ${s}` }),
86
- /* @__PURE__ */ t("div", { className: `${m} ${s}` })
88
+ /* @__PURE__ */ r(
89
+ "div",
90
+ {
91
+ className: m,
92
+ "data-is-zoomed-out": i,
93
+ "data-is-active": t,
94
+ children: /* @__PURE__ */ r(v, { icon: f })
95
+ }
96
+ ),
97
+ !i && /* @__PURE__ */ c(g, { children: [
98
+ /* @__PURE__ */ r("div", { className: `${m} ${s}` }),
99
+ /* @__PURE__ */ r("div", { className: `${m} ${s}` })
87
100
  ] })
88
101
  ]
89
102
  }
90
103
  );
91
104
  }
92
105
  export {
93
- k as C,
94
- h as M,
106
+ N as C,
107
+ v as M,
95
108
  m as c
96
109
  };
@@ -0,0 +1,56 @@
1
+ import { jsxs as M, jsx as n } from "react/jsx-runtime";
2
+ import { a as u } from "./logo-control-NE-LlsRy.js";
3
+ import "react";
4
+ import { u as _, M as h } from "./index-Bp1bWq9c.js";
5
+ import { C as I, c as O, M as b } from "./index-CBp9gCca.js";
6
+ function $({
7
+ clusters: e,
8
+ colors: t,
9
+ clusterIcon: m,
10
+ onClick: a,
11
+ doesSuperclusterContainActiveMarker: s
12
+ }) {
13
+ const { activeMarker: r, zoom: f } = _(), g = (i) => (o) => {
14
+ o.originalEvent.stopPropagation(), a == null || a(i);
15
+ };
16
+ return e == null ? void 0 : e.map((i, o) => {
17
+ const p = i.geometry.coordinates[0], d = i.geometry.coordinates[1];
18
+ return /* @__PURE__ */ M(
19
+ u,
20
+ {
21
+ anchor: "bottom",
22
+ longitude: p,
23
+ latitude: d,
24
+ onClick: g(i),
25
+ children: [
26
+ i.properties.cluster && i.properties.cluster_id && /* @__PURE__ */ n(
27
+ I,
28
+ {
29
+ colors: t,
30
+ icon: m,
31
+ isActive: s(i.properties.cluster_id)
32
+ }
33
+ ),
34
+ !i.properties.cluster && /* @__PURE__ */ n(
35
+ "div",
36
+ {
37
+ className: O,
38
+ style: {
39
+ "--background": t == null ? void 0 : t.background,
40
+ "--fill": t == null ? void 0 : t.fill
41
+ },
42
+ "data-is-cluster": !!i.properties.cluster,
43
+ "data-is-zoomed-out": f < h,
44
+ "data-is-active": (r == null ? void 0 : r.id) === i.properties.id,
45
+ children: /* @__PURE__ */ n(b, { icon: i.properties.icon })
46
+ }
47
+ )
48
+ ]
49
+ },
50
+ `map-marker-${p}-${d}-${o}`
51
+ );
52
+ });
53
+ }
54
+ export {
55
+ $ as default
56
+ };
@@ -0,0 +1,98 @@
1
+ function g(t, o, f) {
2
+ if (t !== null)
3
+ for (var i, n, b, h, p, r, c, u = 0, s = 0, C, v = t.type, M = v === "FeatureCollection", k = v === "Feature", w = M ? t.features.length : 1, e = 0; e < w; e++) {
4
+ c = M ? t.features[e].geometry : k ? t.geometry : t, C = c ? c.type === "GeometryCollection" : !1, p = C ? c.geometries.length : 1;
5
+ for (var P = 0; P < p; P++) {
6
+ var l = 0, a = 0;
7
+ if (h = C ? c.geometries[P] : c, h !== null) {
8
+ r = h.coordinates;
9
+ var y = h.type;
10
+ switch (u = 0, y) {
11
+ case null:
12
+ break;
13
+ case "Point":
14
+ if (o(
15
+ r,
16
+ s,
17
+ e,
18
+ l,
19
+ a
20
+ ) === !1)
21
+ return !1;
22
+ s++, l++;
23
+ break;
24
+ case "LineString":
25
+ case "MultiPoint":
26
+ for (i = 0; i < r.length; i++) {
27
+ if (o(
28
+ r[i],
29
+ s,
30
+ e,
31
+ l,
32
+ a
33
+ ) === !1)
34
+ return !1;
35
+ s++, y === "MultiPoint" && l++;
36
+ }
37
+ y === "LineString" && l++;
38
+ break;
39
+ case "Polygon":
40
+ case "MultiLineString":
41
+ for (i = 0; i < r.length; i++) {
42
+ for (n = 0; n < r[i].length - u; n++) {
43
+ if (o(
44
+ r[i][n],
45
+ s,
46
+ e,
47
+ l,
48
+ a
49
+ ) === !1)
50
+ return !1;
51
+ s++;
52
+ }
53
+ y === "MultiLineString" && l++, y === "Polygon" && a++;
54
+ }
55
+ y === "Polygon" && l++;
56
+ break;
57
+ case "MultiPolygon":
58
+ for (i = 0; i < r.length; i++) {
59
+ for (a = 0, n = 0; n < r[i].length; n++) {
60
+ for (b = 0; b < r[i][n].length - u; b++) {
61
+ if (o(
62
+ r[i][n][b],
63
+ s,
64
+ e,
65
+ l,
66
+ a
67
+ ) === !1)
68
+ return !1;
69
+ s++;
70
+ }
71
+ a++;
72
+ }
73
+ l++;
74
+ }
75
+ break;
76
+ case "GeometryCollection":
77
+ for (i = 0; i < h.geometries.length; i++)
78
+ if (g(h.geometries[i], o) === !1)
79
+ return !1;
80
+ break;
81
+ default:
82
+ throw new Error("Unknown Geometry Type");
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ function G(t, o = {}) {
89
+ if (t.bbox != null && o.recompute !== !0)
90
+ return t.bbox;
91
+ const f = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
92
+ return g(t, (i) => {
93
+ f[0] > i[0] && (f[0] = i[0]), f[1] > i[1] && (f[1] = i[1]), f[2] < i[0] && (f[2] = i[0]), f[3] < i[1] && (f[3] = i[1]);
94
+ }), f;
95
+ }
96
+ export {
97
+ G as b
98
+ };
@@ -0,0 +1,105 @@
1
+ import { jsxs as v, jsx as T } from "react/jsx-runtime";
2
+ import { useState as h, useEffect as M } from "react";
3
+ import { A as y, M as L, C as f, u as P } from "./index.modern-CLRs8JwI.js";
4
+ import { b as x } from "./index-CFomI3Il.js";
5
+ import { u as b, d as p, a as B, m as O } from "./index-Bp1bWq9c.js";
6
+ const Z = {
7
+ "top-left": f.LEFT_TOP,
8
+ "top-right": f.RIGHT_TOP,
9
+ "bottom-left": f.LEFT_BOTTOM,
10
+ "bottom-right": f.RIGHT_BOTTOM
11
+ }, z = ({
12
+ isMapLoaded: c,
13
+ padding: u
14
+ }) => {
15
+ const e = P(), { markerPoints: s, setBounds: r, setZoom: d } = b(), [n, l] = h(void 0), i = () => {
16
+ var t;
17
+ if (!e)
18
+ return;
19
+ const o = (t = e.getBounds()) == null ? void 0 : t.toJSON();
20
+ o && r([o.west, o.south, o.east, o.north]);
21
+ }, m = () => {
22
+ if (!e)
23
+ return;
24
+ const o = e.getZoom();
25
+ typeof o < "u" && d(o + 1);
26
+ };
27
+ return M(() => {
28
+ i(), m();
29
+ const o = e == null ? void 0 : e.addListener("bounds_changed", () => {
30
+ i();
31
+ }), t = e == null ? void 0 : e.addListener("zoom_changed", () => {
32
+ m();
33
+ });
34
+ return () => {
35
+ o == null || o.remove(), t == null || t.remove();
36
+ };
37
+ }, [e]), M(() => {
38
+ if (!e || typeof s > "u" || s.length === 0)
39
+ return;
40
+ const o = x(O(s));
41
+ o.every((t, a) => t === (n == null ? void 0 : n[a])) || l(o);
42
+ }, [e, s]), M(() => {
43
+ if (!e || typeof n > "u")
44
+ return;
45
+ const [o, t, a, g] = n;
46
+ e.fitBounds(
47
+ {
48
+ south: o,
49
+ west: t,
50
+ north: a,
51
+ east: g
52
+ },
53
+ u
54
+ );
55
+ }, [c, e, n, u]), null;
56
+ };
57
+ function E({ padding: c, children: u }) {
58
+ const [e, s] = h(!1), {
59
+ mapProvider: r,
60
+ center: d,
61
+ zoom: n = p.zoom,
62
+ minZoom: l,
63
+ maxZoom: i,
64
+ pitch: m = p.pitch,
65
+ bearing: o = p.bearing,
66
+ cooperativeGestures: t = p.cooperativeGestures,
67
+ zoomPosition: a
68
+ } = b();
69
+ if (r.name !== "google")
70
+ return null;
71
+ const g = () => {
72
+ s(!0);
73
+ };
74
+ return /* @__PURE__ */ v(y, { apiKey: r.apiKey, children: [
75
+ /* @__PURE__ */ T(z, { isMapLoaded: e, padding: c }),
76
+ /* @__PURE__ */ T(
77
+ L,
78
+ {
79
+ mapId: r.theme || B.google,
80
+ defaultCenter: {
81
+ lat: d.latitude,
82
+ lng: d.longitude
83
+ },
84
+ defaultZoom: n + 1,
85
+ defaultTilt: m,
86
+ defaultHeading: o,
87
+ gestureHandling: t ? "cooperative" : "greedy",
88
+ streetViewControl: !1,
89
+ fullscreenControl: !1,
90
+ clickableIcons: !1,
91
+ mapTypeControl: !1,
92
+ zoomControlOptions: {
93
+ position: a && Z[a]
94
+ },
95
+ minZoom: typeof l == "number" ? l + 1 : void 0,
96
+ maxZoom: typeof i == "number" ? i + 1 : void 0,
97
+ onTilesLoaded: g,
98
+ children: u
99
+ }
100
+ )
101
+ ] });
102
+ }
103
+ export {
104
+ E as default
105
+ };
@@ -0,0 +1,57 @@
1
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
+ import { u as M, a as I } from "./index.modern-CLRs8JwI.js";
3
+ import { u as O, M as _ } from "./index-Bp1bWq9c.js";
4
+ import { C as h, c as k, M as v } from "./index-CBp9gCca.js";
5
+ function $({
6
+ clusters: i,
7
+ colors: a,
8
+ clusterIcon: d,
9
+ onClick: t,
10
+ doesSuperclusterContainActiveMarker: m
11
+ }) {
12
+ M();
13
+ const { activeMarker: n, zoom: s } = O(), f = (e) => () => {
14
+ t == null || t(e);
15
+ };
16
+ return i == null ? void 0 : i.map((e, g) => {
17
+ const o = e.geometry.coordinates[0], p = e.geometry.coordinates[1];
18
+ return /* @__PURE__ */ u(
19
+ I,
20
+ {
21
+ position: {
22
+ lat: p,
23
+ lng: o
24
+ },
25
+ onClick: f(e),
26
+ children: [
27
+ e.properties.cluster && /* @__PURE__ */ r(
28
+ h,
29
+ {
30
+ colors: a,
31
+ icon: d,
32
+ isActive: m(e.properties.cluster_id)
33
+ }
34
+ ),
35
+ !e.properties.cluster && /* @__PURE__ */ r(
36
+ "div",
37
+ {
38
+ className: k,
39
+ style: {
40
+ "--background": a == null ? void 0 : a.background,
41
+ "--fill": a == null ? void 0 : a.fill
42
+ },
43
+ "data-is-cluster": !!e.properties.cluster,
44
+ "data-is-zoomed-out": s - 1 < _ + 1,
45
+ "data-is-active": (n == null ? void 0 : n.id) === e.properties.id,
46
+ children: /* @__PURE__ */ r(v, { icon: e.properties.icon })
47
+ }
48
+ )
49
+ ]
50
+ },
51
+ `map-marker-${o}-${p}-${g}`
52
+ );
53
+ });
54
+ }
55
+ export {
56
+ $ as default
57
+ };
@@ -0,0 +1,34 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useEffect as a } from "react";
3
+ import { P as i } from "./logo-control-NE-LlsRy.js";
4
+ import { u as c } from "./index-Bp1bWq9c.js";
5
+ import { c as n } from "./styles-ChFj97uV.js";
6
+ function y({
7
+ latitude: e,
8
+ longitude: t,
9
+ anchor: f,
10
+ offset: m = [0, -35],
11
+ onClose: r,
12
+ children: o
13
+ }) {
14
+ const { zoom: u } = c();
15
+ return a(() => {
16
+ r == null || r();
17
+ }, [u]), typeof e > "u" || typeof t > "u" ? null : /* @__PURE__ */ p(
18
+ i,
19
+ {
20
+ className: "maplibre-popup",
21
+ focusAfterOpen: !0,
22
+ latitude: e,
23
+ longitude: t,
24
+ anchor: f,
25
+ offset: m,
26
+ onClose: r,
27
+ closeButton: !1,
28
+ children: /* @__PURE__ */ p("div", { className: n, children: o })
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ y as default
34
+ };
@@ -0,0 +1,43 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useEffect as a, useMemo as f } from "react";
3
+ import { u as o, I as s } from "./index.modern-CLRs8JwI.js";
4
+ import { u as y } from "./index-Bp1bWq9c.js";
5
+ import { c as x } from "./styles-ChFj97uV.js";
6
+ function I({
7
+ latitude: u,
8
+ longitude: e,
9
+ offset: t = [0, -25],
10
+ onClose: r,
11
+ children: m
12
+ }) {
13
+ const i = o(), { zoom: p } = y();
14
+ a(() => {
15
+ r == null || r();
16
+ }, [p]), a(() => {
17
+ if (!i) return;
18
+ const d = i.addListener("click", () => {
19
+ r == null || r();
20
+ });
21
+ return () => {
22
+ d.remove();
23
+ };
24
+ }, [i]);
25
+ const c = f(() => Array.isArray(t) ? [t[0], t[1]] : [t, t], [t]);
26
+ return typeof u > "u" || typeof e > "u" ? null : /* @__PURE__ */ n(
27
+ s,
28
+ {
29
+ shouldFocus: !0,
30
+ disableAutoPan: !0,
31
+ position: {
32
+ lat: u,
33
+ lng: e
34
+ },
35
+ pixelOffset: c,
36
+ onClose: r,
37
+ children: /* @__PURE__ */ n("div", { className: x, children: m })
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ I as default
43
+ };
@@ -0,0 +1,79 @@
1
+ import { jsxs as x, jsx as d } from "react/jsx-runtime";
2
+ import { useState as y, useEffect as c } from "react";
3
+ import { M as g, N as h, u as b } from "./logo-control-NE-LlsRy.js";
4
+ import { b as B } from "./index-CFomI3Il.js";
5
+ import { u as M, d as u, a as Z, m as z } from "./index-Bp1bWq9c.js";
6
+ const L = ({ padding: i }) => {
7
+ const { current: o } = b(), { markerPoints: n, setBounds: m, setZoom: f } = M(), [r, p] = y(void 0), s = () => {
8
+ var e;
9
+ if (!o)
10
+ return;
11
+ const t = (e = o.getBounds()) == null ? void 0 : e.toArray().flat();
12
+ t && m(t);
13
+ }, a = () => {
14
+ o && f(o.getZoom());
15
+ };
16
+ return c(() => (s(), a(), o == null || o.on("move", () => {
17
+ s();
18
+ }), o == null || o.on("zoom", () => {
19
+ a();
20
+ }), () => {
21
+ o == null || o.off("move", s), o == null || o.off("zoom", a);
22
+ }), [o]), c(() => {
23
+ if (!o || typeof n > "u" || n.length === 0)
24
+ return;
25
+ const t = B(z(n));
26
+ t.every((e, l) => e === (r == null ? void 0 : r[l])) || p(t);
27
+ }, [o, n]), c(() => {
28
+ if (!o || typeof r > "u")
29
+ return;
30
+ const [t, e, l, v] = r;
31
+ o.fitBounds(
32
+ [
33
+ [e, t],
34
+ [v, l]
35
+ ],
36
+ {
37
+ maxZoom: 17,
38
+ duration: 700,
39
+ padding: i
40
+ }
41
+ );
42
+ }, [o, r, i]), null;
43
+ };
44
+ function C({ padding: i, children: o }) {
45
+ const {
46
+ mapProvider: n,
47
+ center: m,
48
+ zoom: f = u.zoom,
49
+ minZoom: r,
50
+ maxZoom: p,
51
+ pitch: s = u.pitch,
52
+ bearing: a = u.bearing,
53
+ cooperativeGestures: t = u.cooperativeGestures,
54
+ zoomPosition: e
55
+ } = M();
56
+ return n.name !== "maptiler" ? null : /* @__PURE__ */ x(
57
+ g,
58
+ {
59
+ initialViewState: {
60
+ ...m,
61
+ zoom: f,
62
+ pitch: s,
63
+ bearing: a
64
+ },
65
+ cooperativeGestures: t,
66
+ minZoom: r,
67
+ maxZoom: p,
68
+ mapStyle: `https://api.maptiler.com/maps/${n.theme || Z.maptiler}/style.json?key=${n.apiKey}`,
69
+ children: [
70
+ /* @__PURE__ */ d(L, { padding: i }),
71
+ e && /* @__PURE__ */ d(h, { position: e }),
72
+ o
73
+ ]
74
+ }
75
+ );
76
+ }
77
+ export {
78
+ C as default
79
+ };
@@ -29,7 +29,8 @@ function d({ sources: a }) {
29
29
  return;
30
30
  const n = a.map((t) => {
31
31
  const l = {
32
- paths: x(t.geometry)
32
+ paths: x(t.geometry),
33
+ clickable: !1
33
34
  };
34
35
  if (Array.isArray(t.layer))
35
36
  t.layer.forEach((r) => {
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as c } from "./index-BOBkPCX5.js";
1
+ import { i as c } from "./index-Bp1bWq9c.js";
2
2
  export {
3
3
  c as LocalLogicMap
4
4
  };