@local-logic/maps 0.0.10 → 0.0.12

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 (49) hide show
  1. package/dist/{index-BYlamtEc.js → index-B3NH4rqN.js} +30 -17
  2. package/dist/index-B9YXnLOH.js +42 -0
  3. package/dist/index-BcpSqK0X.js +74 -0
  4. package/dist/{index-DgHrPgsK.js → index-Bd7meO8V.js} +245 -234
  5. package/dist/index-BhldVNew.js +35 -0
  6. package/dist/index-Bu4XEiYU.js +74 -0
  7. package/dist/{index-CR8t37Oz.js → index-CzBPD5Sw.js} +10 -10
  8. package/dist/index-DFdfOz0d.js +34 -0
  9. package/dist/index-DsrEcQq0.js +71 -0
  10. package/dist/{index-BtwgeEEU.js → index-LKvWHhi6.js} +14 -14
  11. package/dist/{index-BsnsAUt5.js → index-UEadmVww.js} +2 -1
  12. package/dist/{index-JQfyhSrg.js → index-aDlW4ps0.js} +5 -5
  13. package/dist/index.es.js +1 -1
  14. package/dist/index.umd.js +30 -26
  15. package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -1
  16. package/dist/src/components/Map/Root/Layers/Google/index.d.ts.map +1 -1
  17. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts +2 -1
  18. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts.map +1 -1
  19. package/dist/src/components/Map/Root/Markers/Google/index.d.ts +1 -1
  20. package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
  21. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +1 -1
  22. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
  23. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +1 -1
  24. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
  25. package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
  26. package/dist/src/components/Map/Root/Markers/styles.d.ts +2 -2
  27. package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -1
  28. package/dist/src/components/Map/Root/Markers/types.d.ts +1 -0
  29. package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
  30. package/dist/src/components/Map/Root/Popup/Google/index.d.ts.map +1 -1
  31. package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -1
  32. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
  33. package/dist/src/components/Map/Root/Popup/styles.d.ts +1 -1
  34. package/dist/src/components/Map/Root/Popup/styles.d.ts.map +1 -1
  35. package/dist/src/components/Map/Root/constants.d.ts +1 -0
  36. package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
  37. package/dist/src/components/Map/Root/context.d.ts +1 -0
  38. package/dist/src/components/Map/Root/context.d.ts.map +1 -1
  39. package/dist/src/components/Map/Root/types.d.ts +1 -0
  40. package/dist/src/components/Map/Root/types.d.ts.map +1 -1
  41. package/dist/style.css +2 -2
  42. package/dist/{styles-uPzJnzVS.js → styles-ChFj97uV.js} +1 -1
  43. package/package.json +1 -1
  44. package/dist/index-9RZYMoMG.js +0 -39
  45. package/dist/index-BOuko7CL.js +0 -32
  46. package/dist/index-CRQ5kxRL.js +0 -65
  47. package/dist/index-D5uhfwEH.js +0 -31
  48. package/dist/index-DNKXUpkv.js +0 -65
  49. package/dist/index-DnsF5I7I.js +0 -62
@@ -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-DgHrPgsK.js";
3
+ import { useMemo as Z } from "react";
4
+ import { u as p, M as o } from "./index-Bd7meO8V.js";
5
5
  import { p as A } from "./IconBase.es-rM5tt24D.js";
6
- const p = /* @__PURE__ */ new Map([
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(A, { 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,21 +59,24 @@ 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
68
  const E = `
65
69
  relative flex
66
70
  `, s = `
67
71
  -ml-6 -z-10 last:-z-20
68
72
  `;
69
- function k({
73
+ function z({
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 } = p(), i = Z(() => l.name === "google" ? n - 1 < o + 1 : n < o, [n, l]);
79
+ return /* @__PURE__ */ c(
75
80
  "div",
76
81
  {
77
82
  className: E,
@@ -80,17 +85,25 @@ function k({
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
+ z as C,
107
+ v as M,
95
108
  m as c
96
109
  };
@@ -0,0 +1,42 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useEffect as n, 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-Bd7meO8V.js";
5
+ import { c as x } from "./styles-ChFj97uV.js";
6
+ function M({
7
+ latitude: u,
8
+ longitude: e,
9
+ offset: t = [0, -25],
10
+ onClose: r,
11
+ children: a
12
+ }) {
13
+ const i = o(), { zoom: p } = y();
14
+ n(() => {
15
+ r == null || r();
16
+ }, [p]), n(() => {
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__ */ m(
27
+ s,
28
+ {
29
+ shouldFocus: !0,
30
+ position: {
31
+ lat: u,
32
+ lng: e
33
+ },
34
+ pixelOffset: c,
35
+ onClose: r,
36
+ children: /* @__PURE__ */ m("div", { className: x, children: a })
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ M as default
42
+ };
@@ -0,0 +1,74 @@
1
+ import { jsxs as b, jsx as M } from "react/jsx-runtime";
2
+ import { useEffect as c } from "react";
3
+ import { u as h, a as L } from "./scale-control-CyJd4u6j.js";
4
+ import { u as E, M as v } from "./index-Bd7meO8V.js";
5
+ import { C as y, c as O, M as _ } from "./index-B3NH4rqN.js";
6
+ function R({
7
+ clusters: n,
8
+ colors: i,
9
+ clusterIcon: x,
10
+ markerBoundsPadding: e,
11
+ markerBounds: r,
12
+ onClick: m,
13
+ doesSuperclusterContainActiveMarker: d
14
+ }) {
15
+ const { current: f } = h(), { activeMarker: s, zoom: g } = E();
16
+ c(() => {
17
+ if (f && r) {
18
+ const [t, a, o, p] = r;
19
+ f.fitBounds(
20
+ [
21
+ [a - e.left, t - e.bottom],
22
+ [p + e.right, o + e.top]
23
+ ],
24
+ {
25
+ maxZoom: 17,
26
+ duration: 1e3
27
+ }
28
+ );
29
+ }
30
+ }, [f, r, e]);
31
+ const u = (t) => (a) => {
32
+ a.originalEvent.stopPropagation(), m == null || m(t);
33
+ };
34
+ return n == null ? void 0 : n.map((t, a) => {
35
+ const o = t.geometry.coordinates[0], p = t.geometry.coordinates[1];
36
+ return /* @__PURE__ */ b(
37
+ L,
38
+ {
39
+ anchor: "bottom",
40
+ longitude: o,
41
+ latitude: p,
42
+ onClick: u(t),
43
+ children: [
44
+ t.properties.cluster && /* @__PURE__ */ M(
45
+ y,
46
+ {
47
+ colors: i,
48
+ icon: x,
49
+ isActive: d(t.properties.cluster_id)
50
+ }
51
+ ),
52
+ !t.properties.cluster && /* @__PURE__ */ M(
53
+ "div",
54
+ {
55
+ className: O,
56
+ style: {
57
+ "--background": i == null ? void 0 : i.background,
58
+ "--fill": i == null ? void 0 : i.fill
59
+ },
60
+ "data-is-cluster": !!t.properties.cluster,
61
+ "data-is-zoomed-out": g < v,
62
+ "data-is-active": (s == null ? void 0 : s.id) === t.properties.id,
63
+ children: /* @__PURE__ */ M(_, { icon: t.properties.icon })
64
+ }
65
+ )
66
+ ]
67
+ },
68
+ `map-marker-${o}-${p}-${a}`
69
+ );
70
+ });
71
+ }
72
+ export {
73
+ R as default
74
+ };