@local-logic/maps 0.0.23 → 0.0.25

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 (68) hide show
  1. package/dist/index-BSGAziKb.js +92 -0
  2. package/dist/index-BUFjWpWw.js +98 -0
  3. package/dist/index-BVm_ZeWH.js +92 -0
  4. package/dist/index-Bd3yDO3y.js +75 -0
  5. package/dist/index-BxSLdO8P.js +92 -0
  6. package/dist/{index-BrxP9NHZ.js → index-C2d04GGR.js} +3 -3
  7. package/dist/index-C3Tj3r2u.js +24 -0
  8. package/dist/{index-CSVsF1EQ.js → index-CEDpofgZ.js} +1 -1
  9. package/dist/{index-BRD3rjLE.js → index-CIE9YlvM.js} +12 -12
  10. package/dist/index-CUUravWc.js +25 -0
  11. package/dist/index-D8LqYjZz.js +75 -0
  12. package/dist/{index-B85VZGVP.js → index-DnjO_exB.js} +3 -3
  13. package/dist/{index-CFomI3Il.js → index-DscDx7HE.js} +14 -13
  14. package/dist/index-Du1NsFhd.js +69 -0
  15. package/dist/{index-DfhwDiOS.js → index-GGtrKiJn.js} +22 -22
  16. package/dist/{index-ufLC1PLO.js → index-bLVZAISz.js} +16 -16
  17. package/dist/{index-CiWKwaC4.js → index-eWv3le07.js} +7 -6
  18. package/dist/{index-CN_dNOir.js → index-zPNEOm6B.js} +254 -217
  19. package/dist/index.es.js +1 -1
  20. package/dist/index.umd.js +8 -3615
  21. package/dist/{logo-control-VgN6MEKI.js → logo-control-CHapR1Dt.js} +11 -11
  22. package/dist/{scale-control-jBKptTbw.js → scale-control-Dsir9fWY.js} +21 -21
  23. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts +1 -1
  24. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
  25. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts +1 -1
  26. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
  27. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts +1 -1
  28. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
  29. package/dist/src/components/Map/Root/BaseMap/index.d.ts +1 -1
  30. package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -1
  31. package/dist/src/components/Map/Root/BaseMap/types.d.ts +1 -10
  32. package/dist/src/components/Map/Root/BaseMap/types.d.ts.map +1 -1
  33. package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
  34. package/dist/src/components/Map/Root/Popup/Google/index.d.ts.map +1 -1
  35. package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -1
  36. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
  37. package/dist/src/components/Map/Root/Popup/utils/index.d.ts +2 -0
  38. package/dist/src/components/Map/Root/Popup/utils/index.d.ts.map +1 -0
  39. package/dist/src/components/Map/Root/Popup/utils/moveIntoView/index.d.ts +21 -0
  40. package/dist/src/components/Map/Root/Popup/utils/moveIntoView/index.d.ts.map +1 -0
  41. package/dist/src/components/Map/Root/constants.d.ts +11 -2
  42. package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
  43. package/dist/src/components/Map/Root/context.d.ts +6 -6
  44. package/dist/src/components/Map/Root/context.d.ts.map +1 -1
  45. package/dist/src/components/Map/Root/index.d.ts.map +1 -1
  46. package/dist/src/components/Map/Root/types.d.ts +9 -0
  47. package/dist/src/components/Map/Root/types.d.ts.map +1 -1
  48. package/dist/src/components/Map/index.stories.d.ts +9 -3
  49. package/dist/src/components/Map/index.stories.d.ts.map +1 -1
  50. package/dist/style.css +1 -1
  51. package/dist/{styles-BR85tnqI.js → styles-BhmqUA5C.js} +231 -266
  52. package/dist/styles-DGEqzC-2.js +36 -0
  53. package/package.json +30 -10
  54. package/dist/IconBase.es-rM5tt24D.js +0 -48
  55. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  56. package/dist/index-BpFpg_5A.js +0 -78
  57. package/dist/index-CRdDPWou.js +0 -34
  58. package/dist/index-CceEGv05.js +0 -104
  59. package/dist/index-CmajMf1d.js +0 -109
  60. package/dist/index-D5kHxP9H.js +0 -43
  61. package/dist/index-DNNz78Rc.js +0 -24
  62. package/dist/index-Db33Ugg9.js +0 -34
  63. package/dist/index-arkRlpaR.js +0 -80
  64. package/dist/index-vHMPqmOL.js +0 -23
  65. package/dist/index.modern-B-ChKejQ.js +0 -914
  66. package/dist/mapbox-gl-C6frO4Gl.js +0 -34625
  67. package/dist/maplibre-gl-DkDrZ6rP.js +0 -21669
  68. package/dist/styles-ChFj97uV.js +0 -7
@@ -1,8 +1,8 @@
1
1
  import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
- import { a as k } from "./scale-control-jBKptTbw.js";
2
+ import { a as k } from "./scale-control-Dsir9fWY.js";
3
3
  import "react";
4
- import { u, M } from "./index-CN_dNOir.js";
5
- import { C as g, c as C, M as b } from "./index-CmajMf1d.js";
4
+ import { u, M } from "./index-zPNEOm6B.js";
5
+ import { C as g, c as C, M as b } from "./index-D8LqYjZz.js";
6
6
  function _({
7
7
  clusters: n,
8
8
  colors: r,
@@ -1,13 +1,13 @@
1
1
  function g(t, o, f) {
2
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++) {
3
+ for (var i, n, y, h, P, r, b, u = 0, s = 0, v, p = t.type, M = p === "FeatureCollection", k = p === "Feature", w = M ? t.features.length : 1, e = 0; e < w; e++) {
4
+ b = M ? t.features[e].geometry : k ? t.geometry : t, v = b ? b.type === "GeometryCollection" : !1, P = v ? b.geometries.length : 1;
5
+ for (var C = 0; C < P; C++) {
6
6
  var l = 0, a = 0;
7
- if (h = C ? c.geometries[P] : c, h !== null) {
7
+ if (h = v ? b.geometries[C] : b, h !== null) {
8
8
  r = h.coordinates;
9
- var y = h.type;
10
- switch (u = 0, y) {
9
+ var c = h.type;
10
+ switch (u = 0, c) {
11
11
  case null:
12
12
  break;
13
13
  case "Point":
@@ -32,9 +32,9 @@ function g(t, o, f) {
32
32
  a
33
33
  ) === !1)
34
34
  return !1;
35
- s++, y === "MultiPoint" && l++;
35
+ s++, c === "MultiPoint" && l++;
36
36
  }
37
- y === "LineString" && l++;
37
+ c === "LineString" && l++;
38
38
  break;
39
39
  case "Polygon":
40
40
  case "MultiLineString":
@@ -50,16 +50,16 @@ function g(t, o, f) {
50
50
  return !1;
51
51
  s++;
52
52
  }
53
- y === "MultiLineString" && l++, y === "Polygon" && a++;
53
+ c === "MultiLineString" && l++, c === "Polygon" && a++;
54
54
  }
55
- y === "Polygon" && l++;
55
+ c === "Polygon" && l++;
56
56
  break;
57
57
  case "MultiPolygon":
58
58
  for (i = 0; i < r.length; i++) {
59
59
  for (a = 0, n = 0; n < r[i].length; n++) {
60
- for (b = 0; b < r[i][n].length - u; b++) {
60
+ for (y = 0; y < r[i][n].length - u; y++) {
61
61
  if (o(
62
- r[i][n][b],
62
+ r[i][n][y],
63
63
  s,
64
64
  e,
65
65
  l,
@@ -93,6 +93,7 @@ function G(t, o = {}) {
93
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
94
  }), f;
95
95
  }
96
+ var S = G;
96
97
  export {
97
- G as b
98
+ S as t
98
99
  };
@@ -0,0 +1,69 @@
1
+ import { jsxs as x, jsx as g } from "react/jsx-runtime";
2
+ import { useState as B, useRef as k, useCallback as y, useEffect as c } from "react";
3
+ import { M as E, N as L, u as P } from "./logo-control-CHapR1Dt.js";
4
+ import { u as v, D as p, a as h, m as Z } from "./index-zPNEOm6B.js";
5
+ import { t as _ } from "./index-DscDx7HE.js";
6
+ const b = () => {
7
+ const { current: e } = P(), { markerPoints: o, setZoom: s, mapPadding: m } = v(), [a, f] = B(void 0), i = k(void 0), n = y(() => {
8
+ e && s(e.getZoom());
9
+ }, [e, s]);
10
+ return c(() => (n(), e?.on("zoom", n), () => {
11
+ e?.off("zoom", n);
12
+ }), [e, n]), c(() => {
13
+ if (!e || typeof o > "u" || o.length === 0)
14
+ return;
15
+ const t = _(Z(o));
16
+ (!i.current || !t.every((r, u) => r === i.current?.[u])) && (i.current = t, f(t));
17
+ }, [e, o]), c(() => {
18
+ if (!e || typeof a > "u")
19
+ return;
20
+ const [t, r, u, l] = a, d = (u - t) * 0.05 || 1e-3, M = (l - r) * 0.05 || 1e-3;
21
+ e.fitBounds(
22
+ [
23
+ [t - d, r - M],
24
+ [u + d, l + M]
25
+ ],
26
+ {
27
+ padding: m,
28
+ maxZoom: 17,
29
+ duration: 700
30
+ }
31
+ );
32
+ }, [e, a, m]), null;
33
+ };
34
+ function D({ children: e }) {
35
+ const {
36
+ mapProvider: o,
37
+ center: s,
38
+ zoom: m = p.zoom,
39
+ minZoom: a,
40
+ maxZoom: f,
41
+ pitch: i = p.pitch,
42
+ bearing: n = p.bearing,
43
+ cooperativeGestures: t = p.cooperativeGestures,
44
+ zoomPosition: r
45
+ } = v();
46
+ return o.name !== "maptiler" ? null : /* @__PURE__ */ x(
47
+ E,
48
+ {
49
+ initialViewState: {
50
+ ...s,
51
+ zoom: m,
52
+ pitch: i,
53
+ bearing: n
54
+ },
55
+ cooperativeGestures: t,
56
+ minZoom: a,
57
+ maxZoom: f,
58
+ mapStyle: `https://api.maptiler.com/maps/${o.theme || h.maptiler}/style.json?key=${o.apiKey}`,
59
+ children: [
60
+ /* @__PURE__ */ g(b, {}),
61
+ r && /* @__PURE__ */ g(L, { position: r }),
62
+ e
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ export {
68
+ D as default
69
+ };
@@ -1,21 +1,21 @@
1
- import { jsx as c, Fragment as x } from "react/jsx-runtime";
1
+ import { jsx as f, Fragment as x } from "react/jsx-runtime";
2
2
  import * as $ from "react";
3
3
  import { useContext as S, useRef as k, useState as b, useMemo as g, useEffect as w, cloneElement as j } from "react";
4
- import { b as C, d as u } from "./logo-control-VgN6MEKI.js";
4
+ import { b as C, d as u } from "./logo-control-CHapR1Dt.js";
5
5
  import { g as I } from "./utils-DJ13veBM.js";
6
6
  function s(t, e) {
7
7
  if (!t)
8
8
  throw new Error(e);
9
9
  }
10
10
  let M = 0;
11
- function z(t, e, n) {
11
+ function R(t, e, n) {
12
12
  if (t.style && t.style._loaded) {
13
13
  const a = { ...n };
14
14
  return delete a.id, delete a.children, t.addSource(e, a), t.getSource(e);
15
15
  }
16
16
  return null;
17
17
  }
18
- function A(t, e, n) {
18
+ function z(t, e, n) {
19
19
  s(e.id === n.id, "source id changed"), s(e.type === n.type, "source type changed");
20
20
  let a = "", r = 0;
21
21
  for (const o in e)
@@ -45,7 +45,7 @@ function A(t, e, n) {
45
45
  console.warn(`Unable to update <Source> prop: ${a}`);
46
46
  }
47
47
  }
48
- function E(t) {
48
+ function A(t) {
49
49
  const e = S(C).map.getMap(), n = k(t), [, a] = b(0), r = g(() => t.id || `jsx-source-${M++}`, []);
50
50
  w(() => {
51
51
  if (e) {
@@ -54,39 +54,39 @@ function E(t) {
54
54
  if (e.off("styledata", o), e.style && e.style._loaded && e.getSource(r)) {
55
55
  const y = e.getStyle()?.layers;
56
56
  if (y)
57
- for (const d of y)
58
- d.source === r && e.removeLayer(d.id);
57
+ for (const c of y)
58
+ c.source === r && e.removeLayer(c.id);
59
59
  e.removeSource(r);
60
60
  }
61
61
  };
62
62
  }
63
63
  }, [e]);
64
64
  let l = e && e.style && e.getSource(r);
65
- return l ? A(l, t, n.current) : l = z(e, r, t), n.current = t, l && $.Children.map(t.children, (o) => o && j(o, {
65
+ return l ? z(l, t, n.current) : l = R(e, r, t), n.current = t, l && $.Children.map(t.children, (o) => o && j(o, {
66
66
  source: r
67
67
  })) || null;
68
68
  }
69
- function F(t, e, n, a) {
69
+ function E(t, e, n, a) {
70
70
  if (s(n.id === a.id, "layer id changed"), s(n.type === a.type, "layer type changed"), n.type === "custom" || a.type === "custom")
71
71
  return;
72
- const { layout: r = {}, paint: l = {}, filter: o, minzoom: y, maxzoom: d, beforeId: m } = n;
72
+ const { layout: r = {}, paint: l = {}, filter: o, minzoom: y, maxzoom: c, beforeId: m } = n;
73
73
  if (m !== a.beforeId && t.moveLayer(e, m), r !== a.layout) {
74
- const f = a.layout || {};
74
+ const d = a.layout || {};
75
75
  for (const i in r)
76
- u(r[i], f[i]) || t.setLayoutProperty(e, i, r[i]);
77
- for (const i in f)
76
+ u(r[i], d[i]) || t.setLayoutProperty(e, i, r[i]);
77
+ for (const i in d)
78
78
  r.hasOwnProperty(i) || t.setLayoutProperty(e, i, void 0);
79
79
  }
80
80
  if (l !== a.paint) {
81
- const f = a.paint || {};
81
+ const d = a.paint || {};
82
82
  for (const i in l)
83
- u(l[i], f[i]) || t.setPaintProperty(e, i, l[i]);
84
- for (const i in f)
83
+ u(l[i], d[i]) || t.setPaintProperty(e, i, l[i]);
84
+ for (const i in d)
85
85
  l.hasOwnProperty(i) || t.setPaintProperty(e, i, void 0);
86
86
  }
87
- u(o, a.filter) || t.setFilter(e, o), (y !== a.minzoom || d !== a.maxzoom) && t.setLayerZoomRange(e, y, d);
87
+ u(o, a.filter) || t.setFilter(e, o), (y !== a.minzoom || c !== a.maxzoom) && t.setLayerZoomRange(e, y, c);
88
88
  }
89
- function R(t, e, n) {
89
+ function F(t, e, n) {
90
90
  if (t.style && t.style._loaded && (!("source" in n) || t.getSource(n.source))) {
91
91
  const a = { ...n, id: e };
92
92
  delete a.beforeId, t.addLayer(a, n.beforeId);
@@ -104,12 +104,12 @@ function h(t) {
104
104
  }
105
105
  }, [e]), e && e.style && e.getLayer(r))
106
106
  try {
107
- F(e, r, t, n.current);
107
+ E(e, r, t, n.current);
108
108
  } catch (o) {
109
109
  console.warn(o);
110
110
  }
111
111
  else
112
- R(e, r, t);
112
+ F(e, r, t);
113
113
  return n.current = t, null;
114
114
  }
115
115
  function L(t, e, n) {
@@ -133,7 +133,7 @@ function T({ sources: t }) {
133
133
  ...n,
134
134
  geoJson: n.geometry ? I(n.geometry, n.type) : null
135
135
  })), [t]);
136
- return e?.length === 0 ? null : /* @__PURE__ */ c(x, { children: e?.map((n) => /* @__PURE__ */ c("div", { children: n.geoJson && /* @__PURE__ */ c(E, { id: n.key, type: "geojson", data: n.geoJson, children: n.layer && (Array.isArray(n.layer) ? n.layer.map((a, r) => /* @__PURE__ */ c(
136
+ return e?.length === 0 ? null : /* @__PURE__ */ f(x, { children: e?.map((n) => /* @__PURE__ */ f("div", { children: n.geoJson && /* @__PURE__ */ f(A, { id: n.key, type: "geojson", data: n.geoJson, children: n.layer && (Array.isArray(n.layer) ? n.layer.map((a, r) => /* @__PURE__ */ f(
137
137
  h,
138
138
  {
139
139
  id: `${n.key}-${r}`,
@@ -141,7 +141,7 @@ function T({ sources: t }) {
141
141
  paint: L(a.type, a.color, n.type)
142
142
  },
143
143
  `${n.key}-${r}`
144
- )) : /* @__PURE__ */ c(
144
+ )) : /* @__PURE__ */ f(
145
145
  h,
146
146
  {
147
147
  id: n.key,
@@ -1,25 +1,25 @@
1
- import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { u as f, a as k } from "./index.modern-B-ChKejQ.js";
3
- import { u as M, M as g } from "./index-CN_dNOir.js";
4
- import { C, c as v, M as I } from "./index-CmajMf1d.js";
1
+ import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
+ import { useMap as k, AdvancedMarker as u } from "@vis.gl/react-google-maps";
3
+ import { u as M, M as g } from "./index-zPNEOm6B.js";
4
+ import { C, c as v, M as I } from "./index-D8LqYjZz.js";
5
5
  function x({
6
- clusters: t,
6
+ clusters: a,
7
7
  colors: o,
8
- clusterIcon: s,
9
- onClick: n,
8
+ clusterIcon: n,
9
+ onClick: s,
10
10
  doesSuperclusterContainActiveMarker: p
11
11
  }) {
12
- f();
12
+ k();
13
13
  const { activeMarker: d, zoom: c } = M(), m = (e) => () => {
14
- e.properties.disableClick || n?.(e);
14
+ e.properties.disableClick || s?.(e);
15
15
  };
16
- return t?.map((e, l) => {
17
- const i = e.geometry.coordinates[0], a = e.geometry.coordinates[1];
18
- return /* @__PURE__ */ u(
19
- k,
16
+ return a?.map((e, l) => {
17
+ const i = e.geometry.coordinates[0], t = e.geometry.coordinates[1];
18
+ return /* @__PURE__ */ f(
19
+ u,
20
20
  {
21
21
  position: {
22
- lat: a,
22
+ lat: t,
23
23
  lng: i
24
24
  },
25
25
  onClick: m(e),
@@ -28,7 +28,7 @@ function x({
28
28
  C,
29
29
  {
30
30
  colors: o,
31
- icon: s,
31
+ icon: n,
32
32
  isActive: p(e.properties.cluster_id)
33
33
  }
34
34
  ),
@@ -48,7 +48,7 @@ function x({
48
48
  )
49
49
  ]
50
50
  },
51
- `map-marker-${i}-${a}-${l}`
51
+ `map-marker-${i}-${t}-${l}`
52
52
  );
53
53
  });
54
54
  }
@@ -1,18 +1,19 @@
1
1
  import { jsxs as e, jsx as i } from "react/jsx-runtime";
2
- import { t as a, b as o, S as r, o as s, i as c, c as d } from "./styles-BR85tnqI.js";
3
- import { a as l } from "./scale-control-jBKptTbw.js";
2
+ import { t as o, b as a, S as r, i as s, c } from "./styles-BhmqUA5C.js";
3
+ import { a as d } from "./scale-control-Dsir9fWY.js";
4
4
  import "react";
5
+ import { HouseLineIcon as l } from "@phosphor-icons/react";
5
6
  function b({ marker: t, className: n }) {
6
7
  return /* @__PURE__ */ e(
7
- l,
8
+ d,
8
9
  {
9
10
  anchor: "bottom",
10
11
  longitude: t.longitude,
11
12
  latitude: t.latitude,
12
- className: a(d.trim(), n),
13
+ className: o(c.trim(), n),
13
14
  children: [
14
- /* @__PURE__ */ i("span", { id: "center-pin-background", className: o, children: /* @__PURE__ */ i(r, {}) }),
15
- /* @__PURE__ */ i(s, { id: "center-pin-icon", className: c })
15
+ /* @__PURE__ */ i("span", { id: "center-pin-background", className: a, children: /* @__PURE__ */ i(r, {}) }),
16
+ /* @__PURE__ */ i(l, { id: "center-pin-icon", className: s })
16
17
  ]
17
18
  },
18
19
  `center-pin-marker-${t.longitude}-${t.latitude}`