@local-logic/sdks-app 1.2.3 → 1.3.1
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.
- package/dist/assets/index-legacy.008d8ab5.js +40 -0
- package/dist/assets/index-legacy.74694904.js +1 -0
- package/dist/assets/index-legacy.ad6dd738.js +8 -0
- package/dist/assets/{index-legacy.07116093.js → index-legacy.f7e0f85f.js} +1 -1
- package/dist/assets/{index.c1827e8f.js → index.1e974327.js} +9 -9
- package/dist/assets/{index.1b45b39b.js → index.3a10cc5f.js} +80 -75
- package/dist/assets/index.465d1ec4.js +242 -0
- package/dist/assets/index.c6852ed8.js +1109 -0
- package/dist/assets/{polyfills-legacy.d3683099.js → polyfills-legacy.9624f473.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/types/components/Search/index.d.ts +3 -3
- package/dist/types/components/Search/index.d.ts.map +1 -1
- package/dist/types/components/Search/index.js +26 -20
- package/dist/types/components/Search/index.js.map +1 -1
- package/dist/types/components/Search/styles.d.ts +2 -2
- package/dist/types/components/Search/styles.js +3 -3
- package/dist/types/sdks/DataExplorer/components/Map/index.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Map/index.js +1 -1
- package/dist/types/sdks/DataExplorer/components/Map/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/CommuteCalculator/index.js +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.js +1 -2
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.d.ts +1 -0
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.js +4 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.d.ts +14 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.js +44 -3
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.d.ts +3 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.js +23 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.d.ts +16 -0
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.d.ts.map +1 -0
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.js +53 -0
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.js.map +1 -0
- package/dist/types/sdks/LocalContent/Map/Markers/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/index.js +6 -52
- package/dist/types/sdks/LocalContent/Map/Markers/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/index.js +6 -0
- package/dist/types/sdks/LocalContent/Map/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/index.js +5 -2
- package/dist/types/sdks/LocalContent/index.js.map +1 -1
- package/dist/types/services/storage/browserStorage.d.ts +46 -0
- package/dist/types/services/storage/browserStorage.d.ts.map +1 -0
- package/dist/types/services/storage/browserStorage.js +56 -0
- package/dist/types/services/storage/browserStorage.js.map +1 -0
- package/dist/types/services/storage/commuteHistory.d.ts +46 -0
- package/dist/types/services/storage/commuteHistory.d.ts.map +1 -0
- package/dist/types/services/storage/commuteHistory.js +54 -0
- package/dist/types/services/storage/commuteHistory.js.map +1 -0
- package/package.json +4 -3
- package/dist/assets/auto-track-legacy.541af3f5.js +0 -1
- package/dist/assets/auto-track.10e7c441.js +0 -1
- package/dist/assets/index-legacy.4d95875e.js +0 -40
- package/dist/assets/index-legacy.60d9e590.js +0 -1
- package/dist/assets/index-legacy.690811dc.js +0 -1
- package/dist/assets/index-legacy.89760bd0.js +0 -1
- package/dist/assets/index-legacy.a4b02181.js +0 -1
- package/dist/assets/index-legacy.be4ae81b.js +0 -672
- package/dist/assets/index-legacy.d24a67f5.js +0 -1
- package/dist/assets/index-legacy.d281a40b.js +0 -1
- package/dist/assets/index-legacy.d7f5a5d6.js +0 -1
- package/dist/assets/index.0c5b062b.js +0 -1345
- package/dist/assets/index.1787c8e5.js +0 -1
- package/dist/assets/index.24a102e7.js +0 -1
- package/dist/assets/index.27821d72.js +0 -1155
- package/dist/assets/index.7dae5d4e.js +0 -1
- package/dist/assets/index.99863166.js +0 -221
- package/dist/assets/index.ca339fe1.js +0 -1
- package/dist/assets/index.e50321f4.js +0 -1
- package/dist/assets/index.umd-legacy.84ee2b87.js +0 -1
- package/dist/assets/index.umd.703b7a5f.js +0 -1
- package/dist/assets/is-plan-event-enabled-legacy.0a339854.js +0 -1
- package/dist/assets/is-plan-event-enabled.681b46ca.js +0 -1
package/dist/index.html
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<link rel="manifest" href="data:application/manifest+json;base64,eyJuYW1lIjoiIiwic2hvcnRfbmFtZSI6IiIsImljb25zIjpbeyJzcmMiOiIvYW5kcm9pZC1jaHJvbWUtMTkyeDE5Mi5wbmciLCJzaXplcyI6IjE5MngxOTIiLCJ0eXBlIjoiaW1hZ2UvcG5nIn0seyJzcmMiOiIvYW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmciLCJzaXplcyI6IjUxMng1MTIiLCJ0eXBlIjoiaW1hZ2UvcG5nIn1dLCJ0aGVtZV9jb2xvciI6IiNmZmZmZmYiLCJiYWNrZ3JvdW5kX2NvbG9yIjoiI2ZmZmZmZiIsImRpc3BsYXkiOiJzdGFuZGFsb25lIn0=" />
|
|
24
24
|
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0" />
|
|
25
25
|
<title>Local Logic</title>
|
|
26
|
-
<script type="module" crossorigin src="/sdks-app/v1/assets/index.
|
|
26
|
+
<script type="module" crossorigin src="/sdks-app/v1/assets/index.c6852ed8.js"></script>
|
|
27
27
|
<script type="module">try{import.meta.url;import("_").catch(()=>1);}catch(e){}window.__vite_is_modern_browser=true;</script>
|
|
28
28
|
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy build because dynamic import or import.meta.url is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
|
|
29
29
|
</head>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div id="root"></div>
|
|
33
33
|
|
|
34
34
|
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
|
|
35
|
-
<script nomodule crossorigin id="vite-legacy-polyfill" src="/sdks-app/v1/assets/polyfills-legacy.
|
|
36
|
-
<script nomodule crossorigin id="vite-legacy-entry" data-src="/sdks-app/v1/assets/index-legacy.
|
|
35
|
+
<script nomodule crossorigin id="vite-legacy-polyfill" src="/sdks-app/v1/assets/polyfills-legacy.9624f473.js"></script>
|
|
36
|
+
<script nomodule crossorigin id="vite-legacy-entry" data-src="/sdks-app/v1/assets/index-legacy.008d8ab5.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
|
37
37
|
</body>
|
|
38
38
|
</html>
|
|
@@ -6,11 +6,11 @@ interface SearchProps {
|
|
|
6
6
|
latitude: number;
|
|
7
7
|
longitude: number;
|
|
8
8
|
}) => void;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
renderListAbove?: boolean;
|
|
10
|
+
renderListAbovePosition?: number;
|
|
11
11
|
onSelect?: () => void;
|
|
12
12
|
onBlur?: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const Search: ({ label, onSearch, onSelect, placeholder,
|
|
14
|
+
declare const Search: ({ label, onSearch, onSelect, placeholder, renderListAbove, renderListAbovePosition, }: SearchProps) => JSX.Element;
|
|
15
15
|
export default Search;
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Search/index.tsx"],"names":[],"mappings":";AAWA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,0FAOT,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Search/index.tsx"],"names":[],"mappings":";AAWA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,0FAOT,WAAW,gBA6Hb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import React, { useState, useEffect,
|
|
1
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
2
2
|
import { motion } from "framer-motion";
|
|
3
3
|
import { Input } from "@local-logic/ui";
|
|
4
4
|
import useDebounce from "~/hooks/useDebounce";
|
|
5
5
|
import AnimateHeight from "~/components/AnimateHeight";
|
|
6
|
-
import
|
|
6
|
+
import commuteHistory from "~/services/storage/commuteHistory";
|
|
7
7
|
import { useGeocodes } from "./useGeocodes";
|
|
8
8
|
import { useSuggestions } from "./useSuggestions";
|
|
9
9
|
import * as S from "./styles";
|
|
10
|
-
const Search = ({ label, onSearch, onSelect, placeholder,
|
|
11
|
-
const searchContainerRef = useRef(null);
|
|
10
|
+
const Search = ({ label, onSearch, onSelect, placeholder, renderListAbove = true, renderListAbovePosition = 0, }) => {
|
|
12
11
|
const [query, setQuery] = useState("");
|
|
13
12
|
const [locationId, setLocationId] = useState("");
|
|
14
13
|
const { data: geocodes, isLoading: geocodesLoading } = useGeocodes(locationId);
|
|
15
14
|
const debouncedQuery = useDebounce(query, 300);
|
|
16
15
|
const [showResults, setShowResults] = useState(true);
|
|
17
|
-
const { data
|
|
18
|
-
|
|
16
|
+
const { data } = useSuggestions(debouncedQuery, `${geocodes === null || geocodes === void 0 ? void 0 : geocodes.Location.DisplayPosition.Latitude},${geocodes === null || geocodes === void 0 ? void 0 : geocodes.Location.DisplayPosition.Longitude}`);
|
|
17
|
+
const suggestionResults = useMemo(() => !query ? commuteHistory.getSuggestionHistory() : (data === null || data === void 0 ? void 0 : data.suggestions) || [], [query, data === null || data === void 0 ? void 0 : data.suggestions]);
|
|
19
18
|
useEffect(() => {
|
|
20
19
|
if (!geocodes || geocodesLoading) {
|
|
21
20
|
return;
|
|
@@ -26,30 +25,37 @@ const Search = ({ label, onSearch, onSelect, placeholder, renderListBelow = true
|
|
|
26
25
|
});
|
|
27
26
|
setShowResults(false);
|
|
28
27
|
}, [geocodes]);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
const formatAddress = ({ houseNumber, street, city, state, country, postalCode, }) => {
|
|
29
|
+
const streetAddress = houseNumber ||
|
|
30
|
+
(street && `${houseNumber ? `${houseNumber} ` : ""}${street}`);
|
|
31
|
+
return ([streetAddress, city, state, country, postalCode].reduceRight((previous, current) => {
|
|
32
|
+
if (previous && current) {
|
|
33
|
+
return `${current}, ${previous}`;
|
|
34
|
+
}
|
|
35
|
+
return current || previous || "";
|
|
36
|
+
}) || "");
|
|
35
37
|
};
|
|
36
|
-
const handleItemClick = ({ locationId: lid, address }) => {
|
|
38
|
+
const handleItemClick = ({ locationId: lid, address, }) => {
|
|
39
|
+
if (!lid || !address) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
37
42
|
setLocationId(lid);
|
|
38
|
-
setQuery(
|
|
43
|
+
setQuery(formatAddress(address));
|
|
44
|
+
commuteHistory.push({ locationId: lid, address });
|
|
39
45
|
};
|
|
40
46
|
const textWithHighlighting = (address, highlight) => {
|
|
41
|
-
const text =
|
|
47
|
+
const text = formatAddress(address);
|
|
42
48
|
const parts = text.split(new RegExp(`(${highlight})`, "gi"));
|
|
43
49
|
return parts.map((part, i) => part.toLowerCase() === highlight.toLowerCase() ? (React.createElement("strong", { key: i }, part)) : (React.createElement("span", { key: i }, part)));
|
|
44
50
|
};
|
|
45
|
-
return (React.createElement(S.Search, {
|
|
46
|
-
React.createElement(Input, { autofocus: true, value: query, label: label, placeholder: placeholder, onChange: (e) => {
|
|
51
|
+
return (React.createElement(S.Search, { onSelect: onSelect },
|
|
52
|
+
React.createElement(Input, { autofocus: true, value: query, label: label, placeholder: placeholder, onFocus: () => setShowResults(true), onBlur: () => setShowResults(false), onChange: (e) => {
|
|
47
53
|
setQuery(e.currentTarget.value);
|
|
48
54
|
setShowResults(true);
|
|
49
55
|
} }),
|
|
50
|
-
React.createElement(S.SearchList, {
|
|
51
|
-
React.createElement(AnimateHeight, { open: showResults && !!
|
|
52
|
-
React.createElement(S.SearchListUl, null,
|
|
56
|
+
React.createElement(S.SearchList, { renderListAbove: renderListAbove, renderListAbovePosition: renderListAbovePosition },
|
|
57
|
+
React.createElement(AnimateHeight, { open: showResults && !!suggestionResults.length },
|
|
58
|
+
React.createElement(S.SearchListUl, null, suggestionResults.map((suggestion, i) => (React.createElement(S.SearchListItem, { key: suggestion.locationId },
|
|
53
59
|
React.createElement(S.ItemButton, { onClick: () => handleItemClick(suggestion) },
|
|
54
60
|
React.createElement(motion.div, { animate: { y: [10, 0], opacity: [0, 1] }, transition: {
|
|
55
61
|
delay: (i + 1) * 0.03,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Search/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Search/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD,OAAO,cAAc,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE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E,EAAE,CAAC,CACxC,oBAAC,CAAC,CAAC,cAAc,IAAC,GAAG,EAAE,UAAU,CAAC,UAAU;oBAC1C,oBAAC,CAAC,CAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC;wBACtD,oBAAC,MAAM,CAAC,GAAG,IACT,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EACxC,UAAU,EAAE;gCACV,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;gCACrB,IAAI,EAAE,QAAQ;gCACd,QAAQ,EAAE,GAAG;6BACd,IAEA,oBAAoB,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CACrC,CACA,CACE,CACpB,CAAC,CACa,CACH,CACH,CACN,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface SearchProps {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
renderListAbove?: boolean;
|
|
3
|
+
renderListAbovePosition?: number;
|
|
4
4
|
}
|
|
5
5
|
export declare const Search: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
6
|
export declare const SearchList: import("styled-components").StyledComponent<"div", any, SearchProps, never>;
|
|
@@ -11,12 +11,12 @@ export const SearchList = styled.div `
|
|
|
11
11
|
transform: translateY(-3px);
|
|
12
12
|
background-color: ${theme["--ll-color-background"]};
|
|
13
13
|
border-radius: ${theme["--ll-border-radius-small"]};
|
|
14
|
-
z-index:
|
|
14
|
+
z-index: 3;
|
|
15
15
|
|
|
16
|
-
${({
|
|
16
|
+
${({ renderListAbove, renderListAbovePosition }) => renderListAbove &&
|
|
17
17
|
css `
|
|
18
18
|
top: inherit;
|
|
19
|
-
bottom: ${
|
|
19
|
+
bottom: ${renderListAbovePosition}px;
|
|
20
20
|
`}
|
|
21
21
|
`;
|
|
22
22
|
export const ItemButton = styled.button `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/DataExplorer/components/Map/index.tsx"],"names":[],"mappings":";AAYA,QAAA,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/DataExplorer/components/Map/index.tsx"],"names":[],"mappings":";AAYA,QAAA,MAAM,GAAG,mBA+GR,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -29,7 +29,7 @@ const Map = () => {
|
|
|
29
29
|
width: "100%",
|
|
30
30
|
};
|
|
31
31
|
return (React.createElement("div", null,
|
|
32
|
-
React.createElement(Search, { placeholder: translations.SEARCH_MAP, onSearch: (e) => {
|
|
32
|
+
React.createElement(Search, { placeholder: translations.SEARCH_MAP, renderListAbove: false, onSearch: (e) => {
|
|
33
33
|
var _a;
|
|
34
34
|
setDataExplorerState({
|
|
35
35
|
location: { lat: e.latitude, lng: e.longitude },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/sdks/DataExplorer/components/Map/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,EAAU,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAqB,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,E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AC,CAAC,EAAE,EAAE;oBACf,IAAI,SAAS,EAAE;wBACb,oBAAoB,CAAC;4BACnB,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;yBACnD,CAAC,CAAC;qBACJ;oBAED,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBACjC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC,EACD,WAAW,EAAE,GAAG,EAAE;oBAChB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC5B,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;oBACd,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC;gBAC7B,CAAC;gBAED,oBAAC,CAAC,CAAC,iBAAiB;oBAClB,oBAAC,IAAI,IAAC,QAAQ,QAAC,MAAM,EAAC,MAAM;;wBACrB,GAAG;wBACP,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,MAAM;;wBACxD,GAAG;wBACP,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,MAAM,CACxD,CACa;gBACtB,oBAAC,iBAAiB,IAChB,WAAW,QACX,KAAK,EAAE;wBACL,SAAS,EAAE,EAAE;wBACb,WAAW,EAAE,EAAE;qBAChB,GACD;gBACF,oBAAC,GAAG,IAAC,MAAM,kBAAI,IAAI,EAAE,KAAK,IAAK,iBAAiB,CAAC,QAAQ,IAAM,CACzD,CACO,CACb,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/sdks/DataExplorer/components/Map/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAA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IAChB,WAAW,QACX,KAAK,EAAE;wBACL,SAAS,EAAE,EAAE;wBACb,WAAW,EAAE,EAAE;qBAChB,GACD;gBACF,oBAAC,GAAG,IAAC,MAAM,kBAAI,IAAI,EAAE,KAAK,IAAK,iBAAiB,CAAC,QAAQ,IAAM,CACzD,CACO,CACb,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -87,7 +87,7 @@ const CommuteCalculator = ({ className, onClose }) => {
|
|
|
87
87
|
return (React.createElement(S.CommuteCalcContainer, { className: className },
|
|
88
88
|
React.createElement(S.IconButton, { size: "medium", color: "neutral", onClick: onClose, SVGElement: CloseSVG }),
|
|
89
89
|
React.createElement(S.CommuteSearch, null,
|
|
90
|
-
React.createElement(Search, { label: translations.CALCULATE_COMMUTE, placeholder: translations.SEARCH_MAP,
|
|
90
|
+
React.createElement(Search, { label: translations.CALCULATE_COMMUTE, placeholder: translations.SEARCH_MAP, renderListAbove: isMobile, renderListAbovePosition: 30, onSearch: (e) => {
|
|
91
91
|
setDestination({ lat: e.latitude, lng: e.longitude });
|
|
92
92
|
} }),
|
|
93
93
|
React.createElement(Select.Root, { value: transportMode, onValueChange: (v) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/index.tsx"],"names":[],"mappings":";AASA,QAAA,MAAM,gBAAgB,mBAiDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { Button } from "@local-logic/ui";
|
|
3
2
|
import useIsMobile from "~/hooks/useIsMobile";
|
|
4
3
|
import DirectionsIcon from "~/assets/icons/directions.svg";
|
|
5
4
|
import { useLangauges } from "~/context/languageProvider";
|
|
@@ -23,7 +22,7 @@ const CommuteContainer = () => {
|
|
|
23
22
|
return (React.createElement(React.Fragment, null, showCommuteCalc ? (React.createElement(S.MobileCommuteContainer, null,
|
|
24
23
|
React.createElement(S.CommuteCalculatorMobile, { onClose: closeCommute }))) : (React.createElement(S.MobileCommuteToggle, { size: "large", SVGElement: DirectionsIcon, onClick: openCommute }))));
|
|
25
24
|
}
|
|
26
|
-
return (React.createElement(S.DesktopCommuteContainer, null, showCommuteCalc ? (React.createElement(S.CommuteCalculator, { onClose: closeCommute })) : (React.createElement(
|
|
25
|
+
return (React.createElement(S.DesktopCommuteContainer, null, showCommuteCalc ? (React.createElement(S.CommuteCalculator, { onClose: closeCommute })) : (React.createElement(S.DesktopButton, { onClick: openCommute, startAdornment: (React.createElement(DirectionsIcon, null)) }, translations.CALCULATE_COMMUTE))));
|
|
27
26
|
};
|
|
28
27
|
export default CommuteContainer;
|
|
29
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAqB,MAAM,4BAA4B,CAAC;AAG7E,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,gBAAgB,GAAG,GA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AAe,gBAAgB,CAAC"}
|
|
@@ -4,4 +4,5 @@ export declare const DesktopCommuteContainer: import("styled-components").Styled
|
|
|
4
4
|
export declare const MobileCommuteToggle: import("styled-components").StyledComponent<({ SVGElement, disabled, onClick, size, type, color, isLoading, className, }: import("@local-logic/ui").IconButtonProps) => JSX.Element, any, {}, never>;
|
|
5
5
|
export declare const CommuteCalculator: import("styled-components").StyledComponent<({ className, onClose }: import("./CommuteCalculator").CommuteCalculatorProps) => JSX.Element, any, {}, never>;
|
|
6
6
|
export declare const CommuteCalculatorMobile: import("styled-components").StyledComponent<({ className, onClose }: import("./CommuteCalculator").CommuteCalculatorProps) => JSX.Element, any, {}, never>;
|
|
7
|
+
export declare const DesktopButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@local-logic/ui").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
7
8
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/styles.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,sBAAsB,oEAMlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,oEAMnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sMAK/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,4JAAe,CAAC;AAE9C,eAAO,MAAM,uBAAuB,4JAInC,CAAC"}
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/styles.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,sBAAsB,oEAMlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,oEAMnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sMAK/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,4JAAe,CAAC;AAE9C,eAAO,MAAM,uBAAuB,4JAInC,CAAC;AAEF,eAAO,MAAM,aAAa,kMAEzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { theme, IconButton } from "@local-logic/ui";
|
|
1
|
+
import { theme, IconButton, Button } from "@local-logic/ui";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import CS from "./CommuteCalculator";
|
|
4
4
|
export const MobileCommuteContainer = styled.div `
|
|
@@ -27,4 +27,7 @@ export const CommuteCalculatorMobile = styled(CS) `
|
|
|
27
27
|
${theme["--ll-border-radius-small"]} 0 0;
|
|
28
28
|
border: 0;
|
|
29
29
|
`;
|
|
30
|
+
export const DesktopButton = styled(Button) `
|
|
31
|
+
box-shadow: ${theme["--ll-shadow-small"]};
|
|
32
|
+
`;
|
|
30
33
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/CommuteContainer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAErC,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM/C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;SAExC,KAAK,CAAC,qBAAqB,CAAC;WAC1B,KAAK,CAAC,qBAAqB,CAAC;;;CAGtC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;gBACrC,KAAK,CAAC,oBAAoB,CAAC;;YAE/B,KAAK,CAAC,qBAAqB,CAAC;WAC7B,KAAK,CAAC,qBAAqB,CAAC;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;mBAC9B,KAAK,CAAC,0BAA0B,CAAC;MAC9C,KAAK,CAAC,0BAA0B,CAAC;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;gBAC3B,KAAK,CAAC,mBAAmB,CAAC;CACzC,CAAC"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import Supercluster from "supercluster";
|
|
3
|
+
import { School, POI } from "@local-logic/client";
|
|
4
|
+
import { UseMeasureRect } from "~/hooks/useMeasure";
|
|
3
5
|
interface ClusterProps {
|
|
4
6
|
cluster: Supercluster.PointFeature<Supercluster.ClusterProperties & Supercluster.AnyProps>;
|
|
7
|
+
supercluster: Supercluster<{
|
|
8
|
+
poi: POI | School;
|
|
9
|
+
type: string;
|
|
10
|
+
}, Supercluster.AnyProps> | undefined;
|
|
5
11
|
pointsCount: number;
|
|
12
|
+
zoom: number;
|
|
13
|
+
rect: UseMeasureRect;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
isMapMoving: boolean;
|
|
16
|
+
hoveredPOI: POI | School | undefined;
|
|
17
|
+
activePOI: POI | School | undefined;
|
|
18
|
+
setActivePOI: (poi: POI | School | undefined) => void;
|
|
6
19
|
onClick?: (cluster: Supercluster.PointFeature<Supercluster.ClusterProperties & Supercluster.AnyProps>) => void;
|
|
7
20
|
}
|
|
8
|
-
declare const Cluster: ({ cluster, pointsCount, onClick }: ClusterProps) => JSX.Element;
|
|
21
|
+
declare const Cluster: ({ cluster, supercluster, pointsCount, onClick, zoom, activePOI, hoveredPOI, setActivePOI, rect, isMobile, isMapMoving, }: ClusterProps) => JSX.Element;
|
|
9
22
|
export default Cluster;
|
|
10
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/index.tsx"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/index.tsx"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAapD,UAAU,YAAY;IACpB,OAAO,EAAE,YAAY,CAAC,YAAY,CAChC,YAAY,CAAC,iBAAiB,GAAG,YAAY,CAAC,QAAQ,CACvD,CAAC;IACF,YAAY,EACR,YAAY,CACV;QACE,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,EACD,YAAY,CAAC,QAAQ,CACtB,GACD,SAAS,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CACR,OAAO,EAAE,YAAY,CAAC,YAAY,CAChC,YAAY,CAAC,iBAAiB,GAAG,YAAY,CAAC,QAAQ,CACvD,KACE,IAAI,CAAC;CACX;AAID,QAAA,MAAM,OAAO,6HAYV,YAAY,gBAmFd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,9 +1,50 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useMemo, useState } from "react";
|
|
2
|
+
import { baseStyles, Popover } from "@local-logic/ui";
|
|
2
3
|
import * as S from "./styles";
|
|
3
|
-
|
|
4
|
+
import Marker from "../Marker";
|
|
5
|
+
const hoverVariants = {
|
|
6
|
+
default: {
|
|
7
|
+
scale: 1.0,
|
|
8
|
+
},
|
|
9
|
+
hovered: {
|
|
10
|
+
scale: 1.2,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const clusterListThreshold = 17;
|
|
14
|
+
const Cluster = ({ cluster, supercluster, pointsCount, onClick, zoom, activePOI, hoveredPOI, setActivePOI, rect, isMobile, isMapMoving, }) => {
|
|
15
|
+
const [showClusterDialog, setShowClusterDialog] = useState(false);
|
|
4
16
|
const clusterPointCount = cluster.properties.point_count;
|
|
5
17
|
const diameter = 20 + (clusterPointCount / pointsCount) * 25;
|
|
6
|
-
|
|
18
|
+
const onClickHandler = () => {
|
|
19
|
+
if (zoom > clusterListThreshold) {
|
|
20
|
+
setShowClusterDialog(true);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (onClick) {
|
|
24
|
+
onClick(cluster);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const onOpenChangeHandler = (e) => {
|
|
28
|
+
if (zoom <= clusterListThreshold) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setShowClusterDialog(e);
|
|
32
|
+
};
|
|
33
|
+
const clusterChildren = useMemo(() => supercluster === null || supercluster === void 0 ? void 0 : supercluster.getChildren(cluster.id).map((c) => c.properties).filter((c) => !!c), [supercluster, cluster]);
|
|
34
|
+
const clusterChild = clusterChildren === null || clusterChildren === void 0 ? void 0 : clusterChildren.find((c) => !!activePOI && c.poi === activePOI);
|
|
35
|
+
if (clusterChild) {
|
|
36
|
+
return (React.createElement(Marker, { rect: rect, poi: clusterChild.poi, poiType: clusterChild.type, isMobile: isMobile, activePOI: activePOI, hoveredPOI: hoveredPOI, isMapMoving: isMapMoving, setActivePOI: setActivePOI }));
|
|
37
|
+
}
|
|
38
|
+
return (React.createElement(Popover.Root, { open: isMapMoving ? false : showClusterDialog, onOpenChange: onOpenChangeHandler },
|
|
39
|
+
React.createElement(Popover.Trigger, null,
|
|
40
|
+
React.createElement(S.Cluster, { diameter: diameter, onClick: onClickHandler, variants: hoverVariants, animate: showClusterDialog ? "hovered" : "default", whileHover: {
|
|
41
|
+
scale: 1.2,
|
|
42
|
+
}, transition: baseStyles.transitions.default }, cluster.properties.point_count)),
|
|
43
|
+
React.createElement(Popover.Content, { side: "top" },
|
|
44
|
+
React.createElement(S.ClusterList, null, clusterChildren === null || clusterChildren === void 0 ? void 0 : clusterChildren.map((c, i) => {
|
|
45
|
+
var _a;
|
|
46
|
+
return (React.createElement(S.ClusterListItem, { key: i, onClick: () => setActivePOI(c.poi) }, (_a = c.poi) === null || _a === void 0 ? void 0 : _a.name));
|
|
47
|
+
})))));
|
|
7
48
|
};
|
|
8
49
|
export default Cluster;
|
|
9
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAA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,CAAC,EAAE,EAAE;;gBAAC,OAAA,CAC9B,oBAAC,CAAC,CAAC,eAAe,IAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,IAC1D,MAAA,CAAC,CAAC,GAAG,0CAAE,IAAI,CACM,CACrB,CAAA;aAAA,CAAC,CACY,CACA,CACL,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const Cluster: import("styled-components").StyledComponent<"
|
|
1
|
+
export declare const Cluster: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {
|
|
2
2
|
diameter: number;
|
|
3
3
|
}, never>;
|
|
4
|
+
export declare const ClusterList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
5
|
+
export declare const ClusterListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
4
6
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;cAAkC,MAAM;SAmB3D,CAAC;AAEF,eAAO,MAAM,WAAW,mEAIvB,CAAC;AAEF,eAAO,MAAM,eAAe,mEAe3B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { theme } from "@local-logic/ui";
|
|
2
|
+
import { motion } from "framer-motion";
|
|
2
3
|
import styled from "styled-components";
|
|
3
|
-
export const Cluster = styled.div `
|
|
4
|
+
export const Cluster = styled(motion.div) `
|
|
4
5
|
border-radius: 50%;
|
|
5
6
|
background: linear-gradient(
|
|
6
7
|
to top,
|
|
@@ -20,4 +21,25 @@ export const Cluster = styled.div `
|
|
|
20
21
|
box-shadow: ${theme["--ll-shadow-small"]};
|
|
21
22
|
cursor: default;
|
|
22
23
|
`;
|
|
24
|
+
export const ClusterList = styled.ul `
|
|
25
|
+
list-style: none;
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
`;
|
|
29
|
+
export const ClusterListItem = styled.li `
|
|
30
|
+
font-family: ${theme["--ll-font-family"]};
|
|
31
|
+
padding: ${theme["--ll-spacing-x-small"]};
|
|
32
|
+
background-color: ${theme["--ll-color-background"]};
|
|
33
|
+
border-radius: ${theme["--ll-border-radius-small"]};
|
|
34
|
+
border: 1px solid ${theme["--ll-color-border"]};
|
|
35
|
+
cursor: default;
|
|
36
|
+
|
|
37
|
+
&:not(:last-child) {
|
|
38
|
+
margin-bottom: ${theme["--ll-spacing-xx-small"]};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
background-color: ${theme["--ll-color-surface"]};
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
23
45
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAsB;;;;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Cluster/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAsB;;;;MAIzD,KAAK,CAAC,6BAA6B,CAAC;MACpC,KAAK,CAAC,oBAAoB,CAAC;;WAEtB,KAAK,CAAC,uBAAuB,CAAC;YAC7B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ;WAC3B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ;;;;;iBAKpB,KAAK,CAAC,kBAAkB,CAAC;eAC3B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,GAAG,GAAG;;gBAE/B,KAAK,CAAC,mBAAmB,CAAC;;CAEzC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAA;;;;CAInC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA;iBACvB,KAAK,CAAC,kBAAkB,CAAC;aAC7B,KAAK,CAAC,sBAAsB,CAAC;sBACpB,KAAK,CAAC,uBAAuB,CAAC;mBACjC,KAAK,CAAC,0BAA0B,CAAC;sBAC9B,KAAK,CAAC,mBAAmB,CAAC;;;;qBAI3B,KAAK,CAAC,uBAAuB,CAAC;;;;wBAI3B,KAAK,CAAC,oBAAoB,CAAC;;CAElD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UseMeasureRect } from "~/hooks/useMeasure";
|
|
3
|
+
import { POIs, Schools, School, POI } from "@local-logic/client";
|
|
4
|
+
interface POIMarkerProps {
|
|
5
|
+
poi: POI | School;
|
|
6
|
+
poiType: keyof POIs | keyof Schools;
|
|
7
|
+
activePOI: POI | School | undefined;
|
|
8
|
+
hoveredPOI: POI | School | undefined;
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
isMapMoving: boolean;
|
|
11
|
+
rect: UseMeasureRect;
|
|
12
|
+
setActivePOI: (poi: POI | School | undefined) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Marker: ({ poi, poiType, rect, activePOI, hoveredPOI, isMapMoving, setActivePOI, isMobile, }: POIMarkerProps) => JSX.Element;
|
|
15
|
+
export default Marker;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Marker/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAEjE,UAAU,cAAc;IACtB,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC;IACpC,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACvD;AAED,QAAA,MAAM,MAAM,wFAST,cAAc,gBAyDhB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { gridUnit } from "@local-logic/ui";
|
|
3
|
+
import { Marker as M } from "react-map-gl";
|
|
4
|
+
import { POIMarker } from "@local-logic/elements-react";
|
|
5
|
+
const Marker = ({ poi, poiType, rect, activePOI, hoveredPOI, isMapMoving, setActivePOI, isMobile, }) => {
|
|
6
|
+
const isOpen = activePOI === poi;
|
|
7
|
+
const isHovered = hoveredPOI === poi;
|
|
8
|
+
const mediumSizedPois = [
|
|
9
|
+
"rapid_transit_stations",
|
|
10
|
+
];
|
|
11
|
+
return (React.createElement(M, { latitude: poi.lat, longitude: poi.lng, style: { zIndex: isOpen ? 1 : 0 } },
|
|
12
|
+
React.createElement(POIMarker.Root, { options: {
|
|
13
|
+
type: poiType,
|
|
14
|
+
poi,
|
|
15
|
+
isOpen: isMapMoving ? false : isOpen,
|
|
16
|
+
isHovered,
|
|
17
|
+
side: "top",
|
|
18
|
+
size: mediumSizedPois.includes(poiType)
|
|
19
|
+
? "medium"
|
|
20
|
+
: "small",
|
|
21
|
+
collisionPadding: isMobile
|
|
22
|
+
? {
|
|
23
|
+
top: rect.height + 32,
|
|
24
|
+
bottom: gridUnit * 2,
|
|
25
|
+
left: gridUnit * 2,
|
|
26
|
+
right: gridUnit * 2,
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
left: rect.width + 32,
|
|
30
|
+
right: gridUnit * 2,
|
|
31
|
+
top: gridUnit * 2,
|
|
32
|
+
bottom: gridUnit * 2,
|
|
33
|
+
},
|
|
34
|
+
}, onChange: (e) => {
|
|
35
|
+
if (e.type === "open-change") {
|
|
36
|
+
if (e.data) {
|
|
37
|
+
// setTimeout used to solve issue where switching between
|
|
38
|
+
// POIs would cause the new POI dialog to immediately
|
|
39
|
+
// close.
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
setActivePOI(poi);
|
|
42
|
+
}, 0);
|
|
43
|
+
}
|
|
44
|
+
else if (isOpen) {
|
|
45
|
+
setActivePOI(undefined);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} },
|
|
49
|
+
React.createElement(POIMarker.Marker, null),
|
|
50
|
+
React.createElement(POIMarker.Content, null))));
|
|
51
|
+
};
|
|
52
|
+
export default Marker;
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/sdks/LocalContent/Map/Markers/Marker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAcxD,MAAM,MAAM,GAAG,CAAC,EACd,GAAG,EACH,OAAO,EACP,IAAI,EACJ,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,GACO,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,SAAS,KAAK,GAAG,CAAC;IACjC,MAAM,SAAS,GAAG,UAAU,KAAK,GAAG,CAAC;IACrC,MAAM,eAAe,GAAmC;QACtD,wBAAwB;KACzB,CAAC;IAEF,OAAO,CACL,oBAAC,CAAC,IACA,QAAQ,EAAE,GAAG,CAAC,GAAG,EACjB,SAAS,EAAE,GAAG,CAAC,GAAG,EAClB,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QAEjC,oBAAC,SAAS,CAAC,IAAI,IACb,OAAO,EAAE;gBACP,IAAI,EAAE,OAAqC;gBAC3C,GAAG;gBACH,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;gBACpC,SAAS;gBACT,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,OAAqC,CAAC;oBACnE,CAAC,CAAC,QAAQ;oBACV,CAAC,CAAC,OAAO;gBACX,gBAAgB,EAAE,QAAQ;oBACxB,CAAC,CAAC;wBACE,GAAG,EAAE,IAAI,CAAC,MAAM,GAAG,EAAE;wBACrB,MAAM,EAAE,QAAQ,GAAG,CAAC;wBACpB,IAAI,EAAE,QAAQ,GAAG,CAAC;wBAClB,KAAK,EAAE,QAAQ,GAAG,CAAC;qBACpB;oBACH,CAAC,CAAC;wBACE,IAAI,EAAE,IAAI,CAAC,KAAK,GAAG,EAAE;wBACrB,KAAK,EAAE,QAAQ,GAAG,CAAC;wBACnB,GAAG,EAAE,QAAQ,GAAG,CAAC;wBACjB,MAAM,EAAE,QAAQ,GAAG,CAAC;qBACrB;aACN,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;oBAC5B,IAAI,CAAC,CAAC,IAAI,EAAE;wBACV,yDAAyD;wBACzD,qDAAqD;wBACrD,SAAS;wBACT,UAAU,CAAC,GAAG,EAAE;4BACd,YAAY,CAAC,GAAG,CAAC,CAAC;wBACpB,CAAC,EAAE,CAAC,CAAC,CAAC;qBACP;yBAAM,IAAI,MAAM,EAAE;wBACjB,YAAY,CAAC,SAAS,CAAC,CAAC;qBACzB;iBACF;YACH,CAAC;YAED,oBAAC,SAAS,CAAC,MAAM,OAAG;YACpB,oBAAC,SAAS,CAAC,OAAO,OAAG,CACN,CACf,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/Markers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdks/LocalContent/Map/Markers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAQ,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAiB,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUpD,UAAU,YAAY;IACpB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACnD,MAAM,EAAE,OAAO,CACb,KAAK,EACL;QACE,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,CACF,EAAE,CAAC;IACJ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACvD;AAMD,QAAA,MAAM,OAAO,0HAWR,YAAY,iBA8EhB,CAAC;AAIF,eAAe,OAAO,CAAC"}
|