@local-logic/maps 0.0.21 → 0.0.23

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 (38) hide show
  1. package/dist/index-B85VZGVP.js +56 -0
  2. package/dist/index-BRD3rjLE.js +138 -0
  3. package/dist/index-BpFpg_5A.js +78 -0
  4. package/dist/index-BrxP9NHZ.js +56 -0
  5. package/dist/{index-AcZakyxd.js → index-CN_dNOir.js} +168 -172
  6. package/dist/index-CRdDPWou.js +34 -0
  7. package/dist/{index-Dz1XJJEv.js → index-CSVsF1EQ.js} +28 -28
  8. package/dist/index-CceEGv05.js +104 -0
  9. package/dist/{index-DdYanSGw.js → index-CiWKwaC4.js} +2 -2
  10. package/dist/{index-6JzOJU8O.js → index-CmajMf1d.js} +21 -21
  11. package/dist/index-D5kHxP9H.js +43 -0
  12. package/dist/{index-29Y5fJR0.js → index-DNNz78Rc.js} +2 -2
  13. package/dist/index-Db33Ugg9.js +34 -0
  14. package/dist/index-DfhwDiOS.js +155 -0
  15. package/dist/index-arkRlpaR.js +80 -0
  16. package/dist/index-ufLC1PLO.js +57 -0
  17. package/dist/{index-Dxh7aMoG.js → index-vHMPqmOL.js} +2 -2
  18. package/dist/index.es.js +1 -1
  19. package/dist/{index.modern-fpUBOYPT.js → index.modern-B-ChKejQ.js} +9 -9
  20. package/dist/index.umd.js +115 -115
  21. package/dist/{logo-control-C5ZdRec5.js → logo-control-VgN6MEKI.js} +186 -206
  22. package/dist/{mapbox-gl-D6JObe4m.js → mapbox-gl-C6frO4Gl.js} +1877 -1877
  23. package/dist/{maplibre-gl-DDfJU6SR.js → maplibre-gl-DkDrZ6rP.js} +1230 -1228
  24. package/dist/{scale-control-Cflgzbvb.js → scale-control-jBKptTbw.js} +234 -252
  25. package/dist/style.css +1 -1
  26. package/dist/{styles-B8oT_wcC.js → styles-BR85tnqI.js} +16 -17
  27. package/package.json +2 -2
  28. package/dist/index-CHSsiFtN.js +0 -139
  29. package/dist/index-CqUTGwL0.js +0 -34
  30. package/dist/index-Cwn0dgP_.js +0 -56
  31. package/dist/index-D--WdzK4.js +0 -79
  32. package/dist/index-D1Phs0fA.js +0 -57
  33. package/dist/index-D1vI6Ww_.js +0 -43
  34. package/dist/index-DHHG0vNa.js +0 -157
  35. package/dist/index-DKFcZs0A.js +0 -81
  36. package/dist/index-DZTFM839.js +0 -105
  37. package/dist/index-_8n5sl1B.js +0 -56
  38. package/dist/index-_n1FGHXc.js +0 -34
@@ -16,7 +16,6 @@ const ae = "-", Le = (e) => {
16
16
  }
17
17
  };
18
18
  }, xe = (e, n) => {
19
- var i;
20
19
  if (e.length === 0)
21
20
  return n.classGroupId;
22
21
  const s = e[0], t = n.nextPart.get(s), c = t ? xe(e.slice(1), t) : void 0;
@@ -25,12 +24,12 @@ const ae = "-", Le = (e) => {
25
24
  if (n.validators.length === 0)
26
25
  return;
27
26
  const m = e.join(ae);
28
- return (i = n.validators.find(({
29
- validator: u
30
- }) => u(m))) == null ? void 0 : i.classGroupId;
27
+ return n.validators.find(({
28
+ validator: i
29
+ }) => i(m))?.classGroupId;
31
30
  }, ge = /^\[(.+)\]$/, Ee = (e) => {
32
31
  if (ge.test(e)) {
33
- const n = ge.exec(e)[1], s = n == null ? void 0 : n.substring(0, n.indexOf(":"));
32
+ const n = ge.exec(e)[1], s = n?.substring(0, n.indexOf(":"));
34
33
  if (s)
35
34
  return "arbitrary.." + s;
36
35
  }
@@ -121,10 +120,10 @@ const ae = "-", Le = (e) => {
121
120
  }
122
121
  v === "[" ? i++ : v === "]" ? i-- : v === "(" ? u++ : v === ")" && u--;
123
122
  }
124
- const w = m.length === 0 ? c : c.substring(p), H = Ze(w), N = H !== w, j = h && h > p ? h - p : void 0;
123
+ const w = m.length === 0 ? c : c.substring(p), H = Ne(w), F = H !== w, j = h && h > p ? h - p : void 0;
125
124
  return {
126
125
  modifiers: m,
127
- hasImportantModifier: N,
126
+ hasImportantModifier: F,
128
127
  baseClassName: H,
129
128
  maybePostfixModifierPosition: j
130
129
  };
@@ -147,7 +146,7 @@ const ae = "-", Le = (e) => {
147
146
  });
148
147
  }
149
148
  return t;
150
- }, Ze = (e) => e.endsWith(se) ? e.substring(0, e.length - 1) : e.startsWith(se) ? e.substring(1) : e, Fe = (e) => {
149
+ }, Ne = (e) => e.endsWith(se) ? e.substring(0, e.length - 1) : e.startsWith(se) ? e.substring(1) : e, Ze = (e) => {
151
150
  const n = Object.fromEntries(e.orderSensitiveModifiers.map((t) => [t, !0]));
152
151
  return (t) => {
153
152
  if (t.length <= 1)
@@ -158,10 +157,10 @@ const ae = "-", Le = (e) => {
158
157
  i[0] === "[" || n[i] ? (c.push(...m.sort(), i), m = []) : m.push(i);
159
158
  }), c.push(...m.sort()), c;
160
159
  };
161
- }, Ne = (e) => ({
160
+ }, Fe = (e) => ({
162
161
  cache: Pe(e.cacheSize),
163
162
  parseClassName: Te(e),
164
- sortModifiers: Fe(e),
163
+ sortModifiers: Ze(e),
165
164
  ...Le(e)
166
165
  }), je = /\s+/, Oe = (e, n) => {
167
166
  const {
@@ -174,7 +173,7 @@ const ae = "-", Le = (e) => {
174
173
  for (let h = u.length - 1; h >= 0; h -= 1) {
175
174
  const w = u[h], {
176
175
  isExternal: H,
177
- modifiers: N,
176
+ modifiers: F,
178
177
  hasImportantModifier: j,
179
178
  baseClassName: y,
180
179
  maybePostfixModifierPosition: v
@@ -195,7 +194,7 @@ const ae = "-", Le = (e) => {
195
194
  }
196
195
  R = !1;
197
196
  }
198
- const W = m(N).join(":"), O = j ? W + se : W, I = O + A;
197
+ const W = m(F).join(":"), O = j ? W + se : W, I = O + A;
199
198
  if (i.includes(I))
200
199
  continue;
201
200
  i.push(I);
@@ -226,7 +225,7 @@ function _e(e, ...n) {
226
225
  let s, t, c, m = i;
227
226
  function i(p) {
228
227
  const h = n.reduce((w, H) => H(w), e());
229
- return s = Ne(h), t = s.cache.get, c = s.cache.set, m = u, u(p);
228
+ return s = Fe(h), t = s.cache.get, c = s.cache.set, m = u, u(p);
230
229
  }
231
230
  function u(p) {
232
231
  const h = t(p);
@@ -247,14 +246,14 @@ const g = (e) => {
247
246
  // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
248
247
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
249
248
  Ue.test(e) && !qe.test(e)
250
- ), ze = () => !1, Qe = (e) => Je.test(e), Ye = (e) => Xe.test(e), eo = (e) => !o(e) && !r(e), oo = (e) => Z(e, He, ze), o = (e) => ye.test(e), E = (e) => Z(e, Se, Ke), re = (e) => Z(e, ao, d), he = (e) => Z(e, Me, ze), ro = (e) => Z(e, Ce, Ye), D = (e) => Z(e, Ae, Qe), r = (e) => ve.test(e), _ = (e) => F(e, Se), to = (e) => F(e, io), we = (e) => F(e, Me), so = (e) => F(e, He), no = (e) => F(e, Ce), K = (e) => F(e, Ae, !0), Z = (e, n, s) => {
249
+ ), ze = () => !1, Qe = (e) => Je.test(e), Ye = (e) => Xe.test(e), eo = (e) => !o(e) && !r(e), oo = (e) => N(e, He, ze), o = (e) => ye.test(e), E = (e) => N(e, Se, Ke), re = (e) => N(e, ao, d), he = (e) => N(e, Me, ze), ro = (e) => N(e, Ce, Ye), D = (e) => N(e, Ae, Qe), r = (e) => ve.test(e), _ = (e) => Z(e, Se), to = (e) => Z(e, io), we = (e) => Z(e, Me), so = (e) => Z(e, He), no = (e) => Z(e, Ce), K = (e) => Z(e, Ae, !0), N = (e, n, s) => {
251
250
  const t = ye.exec(e);
252
251
  return t ? t[1] ? n(t[1]) : s(t[2]) : !1;
253
- }, F = (e, n, s = !1) => {
252
+ }, Z = (e, n, s = !1) => {
254
253
  const t = ve.exec(e);
255
254
  return t ? t[1] ? n(t[1]) : s : !1;
256
255
  }, Me = (e) => e === "position" || e === "percentage", Ce = (e) => e === "image" || e === "url", He = (e) => e === "length" || e === "size" || e === "bg-size", Se = (e) => e === "length", ao = (e) => e === "number", io = (e) => e === "family-name", Ae = (e) => e === "shadow", lo = () => {
257
- const e = g("color"), n = g("font"), s = g("text"), t = g("font-weight"), c = g("tracking"), m = g("leading"), i = g("breakpoint"), u = g("container"), p = g("spacing"), h = g("radius"), w = g("shadow"), H = g("inset-shadow"), N = g("text-shadow"), j = g("drop-shadow"), y = g("blur"), v = g("perspective"), R = g("aspect"), A = g("ease"), W = g("animate"), O = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], I = () => [
256
+ const e = g("color"), n = g("font"), s = g("text"), t = g("font-weight"), c = g("tracking"), m = g("leading"), i = g("breakpoint"), u = g("container"), p = g("spacing"), h = g("radius"), w = g("shadow"), H = g("inset-shadow"), F = g("text-shadow"), j = g("drop-shadow"), y = g("blur"), v = g("perspective"), R = g("aspect"), A = g("ease"), W = g("animate"), O = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], I = () => [
258
257
  "center",
259
258
  "top",
260
259
  "bottom",
@@ -1728,7 +1727,7 @@ const g = (e) => {
1728
1727
  * @see https://tailwindcss.com/docs/text-shadow
1729
1728
  */
1730
1729
  "text-shadow": [{
1731
- "text-shadow": ["none", N, K, D]
1730
+ "text-shadow": ["none", F, K, D]
1732
1731
  }],
1733
1732
  /**
1734
1733
  * Text Shadow Color
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@local-logic/maps",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "This is a maps implementation allowing for the display of Local Logic data on a map.",
5
5
  "author": "Local Logic",
6
6
  "license": "ISC",
@@ -72,7 +72,7 @@
72
72
  "tailwindcss": "^3.4.17",
73
73
  "tsconfig": "*",
74
74
  "typescript": "^5.9.2",
75
- "vite": "^6.3.6",
75
+ "vite": "^7.1.11",
76
76
  "vite-plugin-dts": "^4.5.4",
77
77
  "vite-plugin-svgr": "^4.3.0",
78
78
  "vitest": "^3.2.4"
@@ -1,139 +0,0 @@
1
- import { jsx as u, Fragment as b } from "react/jsx-runtime";
2
- import * as $ from "react";
3
- import { useContext as S, useRef as k, useState as C, useMemo as m, useEffect as w, cloneElement as j } from "react";
4
- import { b as x, d as s } from "./scale-control-Cflgzbvb.js";
5
- import { g as I } from "./utils-DJ13veBM.js";
6
- function g(t, e) {
7
- if (!t)
8
- throw new Error(e);
9
- }
10
- let M = 0;
11
- function U(t, e, n) {
12
- if (t.style && t.style._loaded) {
13
- const a = { ...n };
14
- return delete a.id, delete a.children, t.addSource(e, a), t.getSource(e);
15
- }
16
- return null;
17
- }
18
- function z(t, e, n) {
19
- g(e.id === n.id, "source id changed"), g(e.type === n.type, "source type changed");
20
- let a = "", i = 0;
21
- for (const l in e)
22
- l !== "children" && l !== "id" && !s(n[l], e[l]) && (a = l, i++);
23
- if (!i)
24
- return;
25
- const r = e.type;
26
- r === "geojson" ? t.setData(e.data) : r === "image" ? t.updateImage({
27
- url: e.url,
28
- coordinates: e.coordinates
29
- }) : "setCoordinates" in t && i === 1 && a === "coordinates" ? t.setCoordinates(e.coordinates) : "setUrl" in t && a === "url" ? t.setUrl(e.url) : "setTiles" in t && a === "tiles" ? t.setTiles(e.tiles) : console.warn(`Unable to update <Source> prop: ${a}`);
30
- }
31
- function A(t) {
32
- const e = S(x).map.getMap(), n = k(t), [, a] = C(0), i = m(() => t.id || `jsx-source-${M++}`, []);
33
- w(() => {
34
- if (e) {
35
- const l = () => setTimeout(() => a((y) => y + 1), 0);
36
- return e.on("styledata", l), l(), () => {
37
- var y;
38
- if (e.off("styledata", l), e.style && e.style._loaded && e.getSource(i)) {
39
- const f = (y = e.getStyle()) == null ? void 0 : y.layers;
40
- if (f)
41
- for (const d of f)
42
- d.source === i && e.removeLayer(d.id);
43
- e.removeSource(i);
44
- }
45
- };
46
- }
47
- }, [e]);
48
- let r = e && e.style && e.getSource(i);
49
- return r ? z(r, t, n.current) : r = U(e, i, t), n.current = t, r && $.Children.map(t.children, (l) => l && j(l, {
50
- source: i
51
- })) || null;
52
- }
53
- function E(t, e, n, a) {
54
- if (g(n.id === a.id, "layer id changed"), g(n.type === a.type, "layer type changed"), n.type === "custom" || a.type === "custom")
55
- return;
56
- const { layout: i = {}, paint: r = {}, filter: l, minzoom: y, maxzoom: f, beforeId: d } = n;
57
- if (d !== a.beforeId && t.moveLayer(e, d), i !== a.layout) {
58
- const c = a.layout || {};
59
- for (const o in i)
60
- s(i[o], c[o]) || t.setLayoutProperty(e, o, i[o]);
61
- for (const o in c)
62
- i.hasOwnProperty(o) || t.setLayoutProperty(e, o, void 0);
63
- }
64
- if (r !== a.paint) {
65
- const c = a.paint || {};
66
- for (const o in r)
67
- s(r[o], c[o]) || t.setPaintProperty(e, o, r[o]);
68
- for (const o in c)
69
- r.hasOwnProperty(o) || t.setPaintProperty(e, o, void 0);
70
- }
71
- s(l, a.filter) || t.setFilter(e, l), (y !== a.minzoom || f !== a.maxzoom) && t.setLayerZoomRange(e, y, f);
72
- }
73
- function F(t, e, n) {
74
- if (t.style && t.style._loaded && (!("source" in n) || t.getSource(n.source))) {
75
- const a = { ...n, id: e };
76
- delete a.beforeId, t.addLayer(a, n.beforeId);
77
- }
78
- }
79
- let R = 0;
80
- function L(t) {
81
- const e = S(x).map.getMap(), n = k(t), [, a] = C(0), i = m(() => t.id || `jsx-layer-${R++}`, []);
82
- if (w(() => {
83
- if (e) {
84
- const l = () => a((y) => y + 1);
85
- return e.on("styledata", l), l(), () => {
86
- e.off("styledata", l), e.style && e.style._loaded && e.getLayer(i) && e.removeLayer(i);
87
- };
88
- }
89
- }, [e]), e && e.style && e.getLayer(i))
90
- try {
91
- E(e, i, t, n.current);
92
- } catch (l) {
93
- console.warn(l);
94
- }
95
- else
96
- F(e, i, t);
97
- return n.current = t, null;
98
- }
99
- function h(t, e, n) {
100
- switch (t) {
101
- case "fill":
102
- return {
103
- "fill-color": e,
104
- "fill-opacity": 0.25
105
- };
106
- case "line":
107
- return {
108
- "line-color": e,
109
- "line-width": n === "LineString" ? 6 : 2
110
- };
111
- default:
112
- return {};
113
- }
114
- }
115
- function O({ sources: t }) {
116
- const e = m(() => !Array.isArray(t) || t.length === 0 ? [] : t.map((n) => ({
117
- ...n,
118
- geoJson: n.geometry ? I(n.geometry, n.type) : null
119
- })), [t]);
120
- return (e == null ? void 0 : e.length) === 0 ? null : /* @__PURE__ */ u(b, { children: e == null ? void 0 : e.map((n) => /* @__PURE__ */ u("div", { children: n.geoJson && /* @__PURE__ */ u(A, { id: n.key, type: "geojson", data: n.geoJson, children: n.layer && (Array.isArray(n.layer) ? n.layer.map((a, i) => /* @__PURE__ */ u(
121
- L,
122
- {
123
- id: `${n.key}-${i}`,
124
- type: a.type,
125
- paint: h(a.type, a.color, n.type)
126
- },
127
- `${n.key}-${i}`
128
- )) : /* @__PURE__ */ u(
129
- L,
130
- {
131
- id: n.key,
132
- type: n.layer.type,
133
- paint: h(n.layer.type, n.layer.color, n.type)
134
- }
135
- )) }, n.key) }, n.key)) });
136
- }
137
- export {
138
- O as default
139
- };
@@ -1,34 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { useEffect as a } from "react";
3
- import { P as i } from "./logo-control-C5ZdRec5.js";
4
- import { u as c } from "./index-AcZakyxd.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
- };
@@ -1,56 +0,0 @@
1
- import { jsxs as M, jsx as p } from "react/jsx-runtime";
2
- import { a as u } from "./logo-control-C5ZdRec5.js";
3
- import "react";
4
- import { u as _, M as b } from "./index-AcZakyxd.js";
5
- import { C as h, c as k, M as I } from "./index-6JzOJU8O.js";
6
- function N({
7
- clusters: t,
8
- colors: e,
9
- clusterIcon: m,
10
- onClick: a,
11
- doesSuperclusterContainActiveMarker: s
12
- }) {
13
- const { activeMarker: r, zoom: f } = _(), g = (i) => (o) => {
14
- o.originalEvent.stopPropagation(), !i.properties.disableClick && (a == null || a(i));
15
- };
16
- return t == null ? void 0 : t.map((i, o) => {
17
- const n = i.geometry.coordinates[0], d = i.geometry.coordinates[1];
18
- return /* @__PURE__ */ M(
19
- u,
20
- {
21
- anchor: "bottom",
22
- longitude: n,
23
- latitude: d,
24
- onClick: g(i),
25
- children: [
26
- i.properties.cluster && i.properties.cluster_id && /* @__PURE__ */ p(
27
- h,
28
- {
29
- colors: e,
30
- icon: m,
31
- isActive: s(i.properties.cluster_id)
32
- }
33
- ),
34
- !i.properties.cluster && /* @__PURE__ */ p(
35
- "div",
36
- {
37
- className: k,
38
- style: i.properties.defaultColor ? {} : {
39
- "--background": e == null ? void 0 : e.background,
40
- "--fill": e == null ? void 0 : e.fill
41
- },
42
- "data-is-cluster": !!i.properties.cluster,
43
- "data-is-zoomed-out": f < b,
44
- "data-is-active": (r == null ? void 0 : r.id) === i.properties.id,
45
- children: /* @__PURE__ */ p(I, { icon: i.properties.icon })
46
- }
47
- )
48
- ]
49
- },
50
- `map-marker-${n}-${d}-${o}`
51
- );
52
- });
53
- }
54
- export {
55
- N as default
56
- };
@@ -1,79 +0,0 @@
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-C5ZdRec5.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-AcZakyxd.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
- };
@@ -1,57 +0,0 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import { u as M, a as k } from "./index.modern-fpUBOYPT.js";
3
- import { u as I, M as O } from "./index-AcZakyxd.js";
4
- import { C as _, c as b, M as h } from "./index-6JzOJU8O.js";
5
- function C({
6
- clusters: a,
7
- colors: i,
8
- clusterIcon: d,
9
- onClick: t,
10
- doesSuperclusterContainActiveMarker: m
11
- }) {
12
- M();
13
- const { activeMarker: r, zoom: s } = I(), f = (e) => () => {
14
- e.properties.disableClick || t == null || t(e);
15
- };
16
- return a == null ? void 0 : a.map((e, g) => {
17
- const n = e.geometry.coordinates[0], p = e.geometry.coordinates[1];
18
- return /* @__PURE__ */ u(
19
- k,
20
- {
21
- position: {
22
- lat: p,
23
- lng: n
24
- },
25
- onClick: f(e),
26
- children: [
27
- e.properties.cluster && /* @__PURE__ */ o(
28
- _,
29
- {
30
- colors: i,
31
- icon: d,
32
- isActive: m(e.properties.cluster_id)
33
- }
34
- ),
35
- !e.properties.cluster && /* @__PURE__ */ o(
36
- "div",
37
- {
38
- className: b,
39
- style: e.properties.defaultColor ? {} : {
40
- "--background": i == null ? void 0 : i.background,
41
- "--fill": i == null ? void 0 : i.fill
42
- },
43
- "data-is-cluster": !!e.properties.cluster,
44
- "data-is-zoomed-out": s - 1 < O + 1,
45
- "data-is-active": (r == null ? void 0 : r.id) === e.properties.id,
46
- children: /* @__PURE__ */ o(h, { icon: e.properties.icon })
47
- }
48
- )
49
- ]
50
- },
51
- `map-marker-${n}-${p}-${g}`
52
- );
53
- });
54
- }
55
- export {
56
- C as default
57
- };
@@ -1,43 +0,0 @@
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-fpUBOYPT.js";
4
- import { u as y } from "./index-AcZakyxd.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
- };