@local-logic/maps 0.0.9 → 0.0.10

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 (79) hide show
  1. package/dist/IconBase.es-rM5tt24D.js +48 -0
  2. package/dist/{index-BZ2605rA.js → index-9RZYMoMG.js} +1 -1
  3. package/dist/index-BCa658u4.js +24 -0
  4. package/dist/index-BOuko7CL.js +32 -0
  5. package/dist/index-BYlamtEc.js +96 -0
  6. package/dist/{index-CPq7k7F4.js → index-BsnsAUt5.js} +1 -1
  7. package/dist/index-BtwgeEEU.js +53 -0
  8. package/dist/index-CNxLnZ8O.js +23 -0
  9. package/dist/index-CR8t37Oz.js +73 -0
  10. package/dist/index-CRQ5kxRL.js +65 -0
  11. package/dist/{index-B43MtiHH.js → index-D5uhfwEH.js} +10 -9
  12. package/dist/index-DNKXUpkv.js +65 -0
  13. package/dist/index-DgHrPgsK.js +772 -0
  14. package/dist/index-DnsF5I7I.js +62 -0
  15. package/dist/index-Do_dW76Q.js +23 -0
  16. package/dist/index-JQfyhSrg.js +50 -0
  17. package/dist/index.es.js +1 -1
  18. package/dist/{index.modern-EsUgbhzI.js → index.modern-CLRs8JwI.js} +7 -7
  19. package/dist/index.umd.js +134 -146
  20. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
  21. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
  22. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
  23. package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts +4 -0
  24. package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts.map +1 -0
  25. package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts +4 -0
  26. package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts.map +1 -0
  27. package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts +4 -0
  28. package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts.map +1 -0
  29. package/dist/src/components/Map/Root/CenterPin/index.d.ts +4 -0
  30. package/dist/src/components/Map/Root/CenterPin/index.d.ts.map +1 -0
  31. package/dist/src/components/Map/Root/CenterPin/styles.d.ts +4 -0
  32. package/dist/src/components/Map/Root/CenterPin/styles.d.ts.map +1 -0
  33. package/dist/src/components/Map/Root/CenterPin/types.d.ts +6 -0
  34. package/dist/src/components/Map/Root/CenterPin/types.d.ts.map +1 -0
  35. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts +4 -3
  36. package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts.map +1 -1
  37. package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts +2 -1
  38. package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts.map +1 -1
  39. package/dist/src/components/Map/Root/Markers/Google/index.d.ts +1 -1
  40. package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
  41. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +1 -1
  42. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
  43. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +1 -1
  44. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
  45. package/dist/src/components/Map/Root/Markers/MarkerIcon/index.d.ts +6 -0
  46. package/dist/src/components/Map/Root/Markers/MarkerIcon/index.d.ts.map +1 -0
  47. package/dist/src/components/Map/Root/Markers/index.d.ts +1 -1
  48. package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
  49. package/dist/src/components/Map/Root/Markers/styles.d.ts +2 -4
  50. package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -1
  51. package/dist/src/components/Map/Root/Markers/types.d.ts +18 -9
  52. package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
  53. package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -1
  54. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
  55. package/dist/src/components/Map/Root/constants.d.ts +3 -0
  56. package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
  57. package/dist/src/components/Map/Root/context.d.ts +2 -0
  58. package/dist/src/components/Map/Root/context.d.ts.map +1 -1
  59. package/dist/src/components/Map/Root/index.d.ts +1 -0
  60. package/dist/src/components/Map/Root/index.d.ts.map +1 -1
  61. package/dist/src/components/Map/Root/types.d.ts +10 -0
  62. package/dist/src/components/Map/Root/types.d.ts.map +1 -1
  63. package/dist/src/components/Map/index.d.ts +2 -2
  64. package/dist/src/components/Map/index.d.ts.map +1 -1
  65. package/dist/src/components/Map/index.stories.d.ts.map +1 -1
  66. package/dist/src/components/Map/storybook-data.d.ts.map +1 -1
  67. package/dist/src/index.d.ts.map +1 -1
  68. package/dist/style.css +24 -1
  69. package/dist/styles-D2MYaLhP.js +47 -0
  70. package/package.json +5 -3
  71. package/dist/index-92HhWupr.js +0 -29
  72. package/dist/index-BF2kb4Y-.js +0 -42
  73. package/dist/index-C5-_i-6M.js +0 -64
  74. package/dist/index-CXjxZmYt.js +0 -144
  75. package/dist/index-CY0to_1B.js +0 -676
  76. package/dist/index-ChwN5abO.js +0 -29
  77. package/dist/index-CrIFr9oc.js +0 -47
  78. package/dist/index-D5-2anzJ.js +0 -29
  79. package/dist/index-J1MKzGEM.js +0 -31
@@ -0,0 +1,62 @@
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import { useEffect as x } from "react";
3
+ import { u as L, a as c } from "./index.modern-CLRs8JwI.js";
4
+ import { u as b, M as d } from "./index-DgHrPgsK.js";
5
+ import { C as y, c as E, M as O } from "./index-BYlamtEc.js";
6
+ function N({
7
+ clusters: n,
8
+ colors: e,
9
+ clusterIcon: M,
10
+ markerBounds: p,
11
+ markerBoundsPadding: a,
12
+ onClick: m
13
+ }) {
14
+ const r = L(), { zoom: g } = b();
15
+ x(() => {
16
+ if (r && p) {
17
+ const [t, f, i, o] = p;
18
+ r.fitBounds({
19
+ south: t - a.bottom,
20
+ west: f - a.left,
21
+ north: i + a.top,
22
+ east: o + a.right
23
+ });
24
+ }
25
+ }, [r, p, a]);
26
+ const h = (t) => () => {
27
+ m == null || m(t);
28
+ };
29
+ return n == null ? void 0 : n.map((t, f) => {
30
+ const i = t.geometry.coordinates[0], o = t.geometry.coordinates[1];
31
+ return /* @__PURE__ */ u(
32
+ c,
33
+ {
34
+ position: {
35
+ lat: o,
36
+ lng: i
37
+ },
38
+ onClick: h(t),
39
+ children: [
40
+ t.properties.cluster && /* @__PURE__ */ s(y, { colors: e, icon: M }),
41
+ !t.properties.cluster && /* @__PURE__ */ s(
42
+ "div",
43
+ {
44
+ className: E,
45
+ style: {
46
+ "--background": e == null ? void 0 : e.background,
47
+ "--fill": e == null ? void 0 : e.fill
48
+ },
49
+ "data-is-cluster": !!t.properties.cluster,
50
+ "data-is-zoomed-out": g - 1 < d + 1,
51
+ children: /* @__PURE__ */ s(O, { icon: t.properties.icon })
52
+ }
53
+ )
54
+ ]
55
+ },
56
+ `map-marker-${i}-${o}-${f}`
57
+ );
58
+ });
59
+ }
60
+ export {
61
+ N as default
62
+ };
@@ -0,0 +1,23 @@
1
+ import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
+ import { a as e } from "./logo-control-NE-LlsRy.js";
3
+ import "react";
4
+ import { c as a, S as n, o as r, i as s } from "./styles-D2MYaLhP.js";
5
+ function d({ marker: t }) {
6
+ return /* @__PURE__ */ o(
7
+ e,
8
+ {
9
+ anchor: "bottom",
10
+ longitude: t.longitude,
11
+ latitude: t.latitude,
12
+ className: a.trim(),
13
+ children: [
14
+ /* @__PURE__ */ i(n, {}),
15
+ /* @__PURE__ */ i(r, { className: s })
16
+ ]
17
+ },
18
+ `center-pin-marker-${t.longitude}-${t.latitude}`
19
+ );
20
+ }
21
+ export {
22
+ d as default
23
+ };
@@ -0,0 +1,50 @@
1
+ import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
+ import { useEffect as d } from "react";
3
+ import { M, N as h, u as g } from "./logo-control-NE-LlsRy.js";
4
+ import { u as n, d as a, a as v } from "./index-DgHrPgsK.js";
5
+ const y = () => {
6
+ const { current: t } = g(), { setBounds: e, setZoom: r } = n(), o = () => {
7
+ t && (e(t.getBounds().toArray().flat()), r(t.getZoom()));
8
+ };
9
+ return d(() => {
10
+ t && (o(), t.on("move", () => {
11
+ o();
12
+ }));
13
+ }, [t]), null;
14
+ };
15
+ function B({ children: t }) {
16
+ const {
17
+ mapProvider: e,
18
+ center: r,
19
+ zoom: o = a.zoom,
20
+ minZoom: m,
21
+ maxZoom: p,
22
+ pitch: u = a.pitch,
23
+ bearing: l = a.bearing,
24
+ cooperativeGestures: c = a.cooperativeGestures,
25
+ zoomPosition: s
26
+ } = n();
27
+ return e.name !== "maptiler" ? null : /* @__PURE__ */ f(
28
+ M,
29
+ {
30
+ initialViewState: {
31
+ ...r,
32
+ zoom: o,
33
+ pitch: u,
34
+ bearing: l
35
+ },
36
+ cooperativeGestures: c,
37
+ minZoom: m,
38
+ maxZoom: p,
39
+ mapStyle: `https://api.maptiler.com/maps/${e.theme || v.maptiler}/style.json?key=${e.apiKey}`,
40
+ children: [
41
+ /* @__PURE__ */ i(y, {}),
42
+ s && /* @__PURE__ */ i(h, { position: s }),
43
+ t
44
+ ]
45
+ }
46
+ );
47
+ }
48
+ export {
49
+ B as default
50
+ };
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as c } from "./index-CY0to_1B.js";
1
+ import { i as c } from "./index-DgHrPgsK.js";
2
2
  export {
3
3
  c as LocalLogicMap
4
4
  };
@@ -1,4 +1,4 @@
1
- import C, { useMemo as P, useContext as z, useEffect as y, useLayoutEffect as W, forwardRef as Y, useState as A, useReducer as Q, useCallback as ee, useRef as N, useImperativeHandle as te, Children as le } from "react";
1
+ import C, { forwardRef as Y, useMemo as P, useContext as z, useEffect as y, useLayoutEffect as W, useImperativeHandle as Q, useState as A, useRef as N, useReducer as ee, useCallback as te, Children as le } from "react";
2
2
  import { createPortal as $ } from "react-dom";
3
3
  import { g as ce } from "./_commonjsHelpers-C6fGbg64.js";
4
4
  var j, J;
@@ -163,12 +163,12 @@ function be(t) {
163
163
  apiKey: o,
164
164
  version: r,
165
165
  libraries: i = []
166
- } = t, a = D(t, he), [s, u] = A(R.loadingStatus), [d, c] = Q((l, g) => l[g.name] ? l : k({}, l, {
166
+ } = t, a = D(t, he), [s, u] = A(R.loadingStatus), [d, c] = ee((l, g) => l[g.name] ? l : k({}, l, {
167
167
  [g.name]: g.value
168
168
  }), {}), p = P(() => i == null ? void 0 : i.join(","), [i]), f = P(() => JSON.stringify(k({
169
169
  apiKey: o,
170
170
  version: r
171
- }, a)), [o, r, a]), m = ee(async (l) => {
171
+ }, a)), [o, r, a]), m = te(async (l) => {
172
172
  var g;
173
173
  if (d[l])
174
174
  return d[l];
@@ -390,14 +390,14 @@ const Ae = () => {
390
390
  }, /* @__PURE__ */ C.createElement("h2", null, "Error: AuthFailure"), /* @__PURE__ */ C.createElement("p", null, "A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ", /* @__PURE__ */ C.createElement("code", null, "APIProvider.apiKey"), " prop is correct. Check the error-message in the console for further details."));
391
391
  };
392
392
  function Pe() {
393
- const [t, e] = A(null), n = ee((o) => e(o), [e]);
393
+ const [t, e] = A(null), n = te((o) => e(o), [e]);
394
394
  return [t, n];
395
395
  }
396
396
  function ie() {
397
397
  return oe() === x.LOADED;
398
398
  }
399
399
  function De() {
400
- const [, t] = Q((e) => e + 1, 0);
400
+ const [, t] = ee((e) => e + 1, 0);
401
401
  return t;
402
402
  }
403
403
  function Te(t, e) {
@@ -705,7 +705,7 @@ const ot = Y((t, e) => {
705
705
  } = t, [a, s] = We(t), u = P(() => a ? {
706
706
  marker: a
707
707
  } : null, [a]);
708
- return te(e, () => a, [a]), s ? /* @__PURE__ */ C.createElement(je.Provider, {
708
+ return Q(e, () => a, [a]), s ? /* @__PURE__ */ C.createElement(je.Provider, {
709
709
  value: u
710
710
  }, $(/* @__PURE__ */ C.createElement(Ze, {
711
711
  anchorPoint: i,
@@ -895,7 +895,7 @@ function Ye(t) {
895
895
  }
896
896
  Y((t, e) => {
897
897
  const n = Ye(t);
898
- return te(e, () => n, [n]), /* @__PURE__ */ C.createElement(C.Fragment, null);
898
+ return Q(e, () => n, [n]), /* @__PURE__ */ C.createElement(C.Fragment, null);
899
899
  });
900
900
  export {
901
901
  nt as A,