@terraware/web-components 4.2.13 → 4.2.14-rc.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.
Files changed (302) hide show
  1. package/components/AntSwitch/index.js +8 -14
  2. package/components/Autocomplete/Autocomplete.js +67 -70
  3. package/components/Badge/index.js +16 -20
  4. package/components/BusySpinner/index.js +30 -35
  5. package/components/Button/Button.js +23 -27
  6. package/components/Button/button.test.js +8 -10
  7. package/components/Checkbox.js +10 -19
  8. package/components/Confirm/index.js +44 -51
  9. package/components/DatePicker/DatePicker.js +116 -117
  10. package/components/DialogBox/DialogBox.js +76 -66
  11. package/components/Divisor.js +15 -20
  12. package/components/Dropdown.js +54 -61
  13. package/components/EditableTable/index.js +129 -135
  14. package/components/ErrorBox/ErrorBox.js +37 -36
  15. package/components/FileChooser/index.js +73 -77
  16. package/components/FormBottomBar/index.js +63 -69
  17. package/components/Icon/Icon.js +14 -21
  18. package/components/Icon/icons/index.js +251 -257
  19. package/components/IconTooltip/index.js +29 -34
  20. package/components/Map/MapBox.js +199 -220
  21. package/components/Map/MapContainer.js +14 -18
  22. package/components/Map/MapDateSliderControl.js +44 -46
  23. package/components/Map/MapDrawer.js +32 -33
  24. package/components/Map/MapLegend.js +96 -95
  25. package/components/Map/MapViewStyleControl.js +38 -48
  26. package/components/Map/ReactMapboxWrapper.js +2 -9
  27. package/components/Map/index.js +47 -55
  28. package/components/Map/types.js +2 -8
  29. package/components/Map/useMaintainLayerOrder.js +4 -11
  30. package/components/Markdown/index.js +14 -21
  31. package/components/Message/Message.js +59 -51
  32. package/components/MultiSelect/MultiSelect.test.js +22 -24
  33. package/components/MultiSelect/index.js +73 -69
  34. package/components/Navbar/NavFooter.js +8 -13
  35. package/components/Navbar/NavItem.js +43 -37
  36. package/components/Navbar/NavSection.js +13 -17
  37. package/components/Navbar/Navbar.js +35 -38
  38. package/components/Navbar/SubNavbar.js +8 -13
  39. package/components/Note.js +14 -19
  40. package/components/OverlayModal/OverlayModal.js +36 -37
  41. package/components/PageForm/index.js +30 -35
  42. package/components/PhotoChooser/index.js +93 -98
  43. package/components/Pill/index.js +29 -31
  44. package/components/PillList/index.js +16 -22
  45. package/components/PlacementWrapper/index.js +20 -25
  46. package/components/PopoverMenu/Popover.js +33 -37
  47. package/components/PopoverMenu/index.js +41 -46
  48. package/components/PopoverMultiSelect/index.js +18 -21
  49. package/components/ProgressCircle/ProgressCircle.js +23 -26
  50. package/components/RadioButton.js +7 -14
  51. package/components/Select/Select.js +8 -13
  52. package/components/Select/SelectT.js +110 -108
  53. package/components/Separator/index.js +8 -14
  54. package/components/Size.js +1 -5
  55. package/components/Slider/index.js +7 -13
  56. package/components/SummaryBox.js +36 -39
  57. package/components/Tabs/index.js +75 -77
  58. package/components/TextTruncated/index.js +64 -65
  59. package/components/Textfield/Textfield.js +100 -95
  60. package/components/Textfield/TruncatedTextArea.js +44 -46
  61. package/components/TimelineSlider/TimelineMarker.js +24 -28
  62. package/components/TimelineSlider/TimelineRail.js +5 -11
  63. package/components/TimelineSlider/index.js +47 -51
  64. package/components/Tooltip/Tooltip.js +21 -26
  65. package/components/ViewPhotosDialog/index.js +58 -62
  66. package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
  67. package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
  68. package/components/VirtualWalkthrough/Annotation.js +197 -0
  69. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
  70. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
  71. package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
  72. package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
  73. package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
  74. package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
  75. package/components/VirtualWalkthrough/Application.d.ts +9 -0
  76. package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
  77. package/components/VirtualWalkthrough/Application.js +32 -0
  78. package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
  79. package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
  80. package/components/VirtualWalkthrough/AutoRotator.js +217 -0
  81. package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
  82. package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
  83. package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
  84. package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
  85. package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
  86. package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
  87. package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
  88. package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
  89. package/components/VirtualWalkthrough/CameraInfo.js +88 -0
  90. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
  91. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
  92. package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
  93. package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
  94. package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
  95. package/components/VirtualWalkthrough/GradientSky.js +73 -0
  96. package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
  97. package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
  98. package/components/VirtualWalkthrough/SplatControls.js +252 -0
  99. package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
  100. package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
  101. package/components/VirtualWalkthrough/SplatCrop.js +18 -0
  102. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
  103. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
  104. package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
  105. package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
  106. package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
  107. package/components/VirtualWalkthrough/SplatModel.js +60 -0
  108. package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
  109. package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
  110. package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
  111. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
  112. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
  113. package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
  114. package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
  115. package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
  116. package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
  117. package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts +27 -0
  118. package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts.map +1 -0
  119. package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +282 -0
  120. package/components/VirtualWalkthrough/annotation-styles.css +5 -0
  121. package/components/VirtualWalkthrough/application-styles.css +4 -0
  122. package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
  123. package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
  124. package/components/VirtualWalkthrough/boundary-ring.js +125 -0
  125. package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
  126. package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
  127. package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
  128. package/components/VirtualWalkthrough/groundPlane.js +47 -0
  129. package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
  130. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
  131. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
  132. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
  133. package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
  134. package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
  135. package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
  136. package/components/svg/BlobbyGrayIconImage.js +36 -41
  137. package/components/svg/BlobbyGrayIconImport.js +36 -41
  138. package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
  139. package/components/svg/BlobbyIconCloudChecked.js +161 -158
  140. package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
  141. package/components/svg/BlobbyIconFolder.js +161 -158
  142. package/components/svg/BlobbyIconGraphReport.js +161 -158
  143. package/components/svg/BlobbyIconHappy.js +161 -158
  144. package/components/svg/BlobbyIconHeartMonitor.js +161 -158
  145. package/components/svg/BlobbyIconLeaf.js +161 -158
  146. package/components/svg/BlobbyIconLibrary.js +161 -158
  147. package/components/svg/BlobbyIconNursery.js +163 -160
  148. package/components/svg/BlobbyIconOrganization.js +161 -158
  149. package/components/svg/BlobbyIconParchment.js +161 -158
  150. package/components/svg/BlobbyIconPeople.js +161 -158
  151. package/components/svg/BlobbyIconSeedBank.js +161 -158
  152. package/components/svg/BlobbyIconSeedling.js +161 -158
  153. package/components/svg/BlobbyIconSeeds.js +161 -158
  154. package/components/svg/BlobbyIconSite.js +164 -161
  155. package/components/svg/BlobbyIconSparkles.js +161 -158
  156. package/components/svg/BlobbyIconWrench.js +161 -158
  157. package/components/svg/Bug.js +18 -27
  158. package/components/svg/Calendar.js +18 -27
  159. package/components/svg/CaretDown.js +18 -27
  160. package/components/svg/CaretLeft.js +18 -27
  161. package/components/svg/CaretRight.js +18 -27
  162. package/components/svg/CaretUp.js +18 -27
  163. package/components/svg/ChevronDown.js +18 -27
  164. package/components/svg/ChevronUp.js +18 -27
  165. package/components/svg/Close.js +18 -27
  166. package/components/svg/Critical.js +18 -27
  167. package/components/svg/Edit.js +161 -158
  168. package/components/svg/Error.js +18 -27
  169. package/components/svg/Filter.js +18 -27
  170. package/components/svg/Folder.js +18 -27
  171. package/components/svg/Help.js +18 -27
  172. package/components/svg/Home.js +18 -27
  173. package/components/svg/IconAdd.js +18 -27
  174. package/components/svg/IconArrowRight.js +19 -28
  175. package/components/svg/IconBusinessNetwork.js +18 -27
  176. package/components/svg/IconCalendar.js +18 -27
  177. package/components/svg/IconCancel.js +18 -27
  178. package/components/svg/IconChargingBattery.js +18 -27
  179. package/components/svg/IconChecklist.js +19 -28
  180. package/components/svg/IconCheckmark.js +18 -27
  181. package/components/svg/IconCoinInHand.js +18 -27
  182. package/components/svg/IconColumns.js +18 -27
  183. package/components/svg/IconComment.js +18 -27
  184. package/components/svg/IconDashboard.js +18 -27
  185. package/components/svg/IconDataMigration.js +18 -27
  186. package/components/svg/IconDocument.js +19 -28
  187. package/components/svg/IconDownloadFromTheCloud.js +19 -28
  188. package/components/svg/IconEdit.js +19 -28
  189. package/components/svg/IconExpand.js +19 -28
  190. package/components/svg/IconExport.js +18 -27
  191. package/components/svg/IconExternalLink.js +18 -27
  192. package/components/svg/IconEye.js +18 -27
  193. package/components/svg/IconEyeOff.js +18 -27
  194. package/components/svg/IconFile.js +18 -27
  195. package/components/svg/IconFolder.js +18 -27
  196. package/components/svg/IconFullScreen.js +18 -27
  197. package/components/svg/IconFutures.js +18 -27
  198. package/components/svg/IconGraphReport.js +18 -27
  199. package/components/svg/IconHeartMonitor.js +18 -27
  200. package/components/svg/IconHelp.js +19 -28
  201. package/components/svg/IconHistory.js +18 -27
  202. package/components/svg/IconImport.js +18 -27
  203. package/components/svg/IconIndex.js +18 -27
  204. package/components/svg/IconLayers.js +18 -27
  205. package/components/svg/IconLibrary.js +18 -27
  206. package/components/svg/IconList.js +18 -27
  207. package/components/svg/IconLivePlant.js +18 -27
  208. package/components/svg/IconLocations.js +18 -27
  209. package/components/svg/IconMail.js +18 -27
  210. package/components/svg/IconManager.js +18 -27
  211. package/components/svg/IconMarker.js +18 -27
  212. package/components/svg/IconMenu.js +18 -27
  213. package/components/svg/IconMenuHorizontal.js +18 -27
  214. package/components/svg/IconModule.js +18 -27
  215. package/components/svg/IconMyLocation.js +18 -27
  216. package/components/svg/IconNote.js +19 -28
  217. package/components/svg/IconNursery.js +18 -27
  218. package/components/svg/IconOrg.js +18 -27
  219. package/components/svg/IconParchment.js +18 -27
  220. package/components/svg/IconPhoto.js +18 -27
  221. package/components/svg/IconPlantsFilled.js +18 -27
  222. package/components/svg/IconRedo.js +18 -27
  223. package/components/svg/IconRestorationSite.js +18 -27
  224. package/components/svg/IconSeedBank.js +18 -27
  225. package/components/svg/IconSeedling.js +18 -27
  226. package/components/svg/IconSettings.js +18 -27
  227. package/components/svg/IconSlice.js +18 -27
  228. package/components/svg/IconSubmit.js +18 -27
  229. package/components/svg/IconSubtract.js +19 -28
  230. package/components/svg/IconSynced.js +18 -27
  231. package/components/svg/IconTrashCan.js +18 -27
  232. package/components/svg/IconTreasureMap.js +18 -27
  233. package/components/svg/IconUnavailable.js +18 -27
  234. package/components/svg/IconUndo.js +18 -27
  235. package/components/svg/IconVariable.js +18 -27
  236. package/components/svg/IconVideo.js +19 -28
  237. package/components/svg/IconWifi.js +18 -27
  238. package/components/svg/Info.js +18 -27
  239. package/components/svg/Key.js +18 -27
  240. package/components/svg/Leaf.js +18 -27
  241. package/components/svg/Lock.js +18 -27
  242. package/components/svg/Logo.js +40 -45
  243. package/components/svg/MenuVertical.js +18 -27
  244. package/components/svg/Notification.js +18 -27
  245. package/components/svg/Person.js +18 -27
  246. package/components/svg/Plus.js +18 -27
  247. package/components/svg/RestorationSite.js +18 -27
  248. package/components/svg/Search.js +18 -27
  249. package/components/svg/Seeds.js +18 -27
  250. package/components/svg/Site.js +18 -27
  251. package/components/svg/Sparkles.js +18 -27
  252. package/components/svg/Species.js +18 -27
  253. package/components/svg/Species2.js +161 -158
  254. package/components/svg/Spinner.js +27 -36
  255. package/components/svg/Star.js +18 -27
  256. package/components/svg/Success.js +18 -27
  257. package/components/svg/SuccessFilled.js +18 -27
  258. package/components/svg/TerrawareLogoDesktop.js +44 -49
  259. package/components/svg/TerrawareLogoMobile.js +20 -29
  260. package/components/svg/Touchscreen.js +18 -27
  261. package/components/svg/UploadCloud.js +161 -158
  262. package/components/svg/Warning.js +18 -27
  263. package/components/svg/WelcomeClipboard.js +130 -135
  264. package/components/svg/index.js +127 -895
  265. package/components/table/EnhancedTableToolbar.js +45 -47
  266. package/components/table/EnhancedTableToolbarV2.js +18 -26
  267. package/components/table/TableCellRenderer.js +137 -143
  268. package/components/table/TableHeader.js +45 -47
  269. package/components/table/TableHeaderItem.js +65 -64
  270. package/components/table/density.js +3 -11
  271. package/components/table/index.js +225 -218
  272. package/components/table/sort.js +8 -18
  273. package/components/table/sort.test.js +6 -8
  274. package/components/table/types.js +1 -5
  275. package/components/types/index.js +1 -5
  276. package/hooks/useBoolean.d.ts +4 -0
  277. package/hooks/useBoolean.d.ts.map +1 -0
  278. package/hooks/useBoolean.js +12 -0
  279. package/hooks/useCameraPosition.d.ts +8 -0
  280. package/hooks/useCameraPosition.d.ts.map +1 -0
  281. package/hooks/useCameraPosition.js +33 -0
  282. package/hooks/useDevicePerformance.d.ts +9 -0
  283. package/hooks/useDevicePerformance.d.ts.map +1 -0
  284. package/hooks/useDevicePerformance.js +16 -0
  285. package/index.js +57 -398
  286. package/license-report.html +1 -1
  287. package/package.json +10 -3
  288. package/style-dictionary-dist/TerrawareTheme.js +1 -7
  289. package/theme.js +7 -14
  290. package/utils/color.d.ts +2 -0
  291. package/utils/color.d.ts.map +1 -0
  292. package/utils/color.js +14 -0
  293. package/utils/date.js +13 -24
  294. package/utils/date.test.js +40 -43
  295. package/utils/index.js +5 -53
  296. package/utils/preventDefaultEvent.js +1 -7
  297. package/utils/text.js +2 -9
  298. package/utils/text.test.js +9 -11
  299. package/utils/useDeviceInfo.js +10 -16
  300. package/virtualWalkthrough.d.ts +34 -0
  301. package/virtualWalkthrough.d.ts.map +1 -0
  302. package/virtualWalkthrough.js +30 -0
@@ -1,21 +1,14 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _mapbox = require("react-map-gl/mapbox");
11
- var _material = require("@mui/material");
12
- require("mapbox-gl/dist/mapbox-gl.css");
13
- var _utils = require("../../utils");
14
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
15
- var _MapViewStyleControl = _interopRequireDefault(require("./MapViewStyleControl"));
16
- var _ReactMapboxWrapper = _interopRequireDefault(require("./ReactMapboxWrapper"));
17
- var _types = require("./types");
18
- var _useMaintainLayerOrder = require("./useMaintainLayerOrder");
1
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
+ import { FullscreenControl, Layer, Marker, NavigationControl, Source } from 'react-map-gl/mapbox';
3
+ import { Box, useTheme } from '@mui/material';
4
+ import 'mapbox-gl/dist/mapbox-gl.css';
5
+ import { useDeviceInfo } from '../../utils';
6
+ import Icon from '../Icon/Icon';
7
+ import MapViewStyleControl from './MapViewStyleControl';
8
+ import ReactMapbox from './ReactMapboxWrapper';
9
+ import { stylesUrl } from './types';
10
+ import { useMaintainLayerOrder } from './useMaintainLayerOrder';
11
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
12
  const MapBox = props => {
20
13
  const {
21
14
  clusterRadius,
@@ -41,16 +34,16 @@ const MapBox = props => {
41
34
  setMapViewStyle,
42
35
  token
43
36
  } = props;
44
- const theme = (0, _material.useTheme)();
45
- const mapRef = (0, _react.useRef)(null);
37
+ const theme = useTheme();
38
+ const mapRef = useRef(null);
46
39
  const {
47
40
  isDesktop
48
- } = (0, _utils.useDeviceInfo)();
49
- const [cursor, setCursor] = (0, _react.useState)('auto');
50
- const [hoverFeatureId, setHoverFeatureId] = (0, _react.useState)();
51
- const [zoom, setZoom] = (0, _react.useState)();
52
- const loadImages = (0, _react.useCallback)(map => {
53
- mapImageUrls === null || mapImageUrls === void 0 ? void 0 : mapImageUrls.forEach(url => {
41
+ } = useDeviceInfo();
42
+ const [cursor, setCursor] = useState('auto');
43
+ const [hoverFeatureId, setHoverFeatureId] = useState();
44
+ const [zoom, setZoom] = useState();
45
+ const loadImages = useCallback(map => {
46
+ mapImageUrls?.forEach(url => {
54
47
  if (!map.hasImage(url)) {
55
48
  map.loadImage(url, (error, image) => {
56
49
  if (image) {
@@ -62,17 +55,17 @@ const MapBox = props => {
62
55
  }
63
56
  });
64
57
  }, [mapImageUrls]);
65
- const mapRefCallback = (0, _react.useCallback)(map => {
58
+ const mapRefCallback = useCallback(map => {
66
59
  if (map !== null) {
67
60
  mapRef.current = map;
68
61
  setZoom(map.getZoom());
69
62
  loadImages(map);
70
63
  }
71
64
  }, []);
72
- const onMove = (0, _react.useCallback)(view => {
65
+ const onMove = useCallback(view => {
73
66
  setZoom(view.viewState.zoom);
74
67
  }, []);
75
- const clusterMarkers = (0, _react.useCallback)((map, markers) => {
68
+ const clusterMarkers = useCallback((map, markers) => {
76
69
  if (!map || map.getZoom() > 15) {
77
70
  // Too zoomed in. Return all marker as is
78
71
  return markers.map(marker => [marker]);
@@ -94,7 +87,7 @@ const MapBox = props => {
94
87
  const dx = markerPixels[marker.id].x - markerPixels[otherMarker.id].x;
95
88
  const dy = markerPixels[marker.id].y - markerPixels[otherMarker.id].y;
96
89
  const dist = Math.sqrt(dx * dx + dy * dy);
97
- if (dist <= (clusterRadius !== null && clusterRadius !== void 0 ? clusterRadius : 40)) {
90
+ if (dist <= (clusterRadius ?? 40)) {
98
91
  cluster.push(otherMarker);
99
92
  visited.add(otherMarker.id);
100
93
  }
@@ -107,22 +100,20 @@ const MapBox = props => {
107
100
  }, [clusterRadius]);
108
101
 
109
102
  // Find all layers with at least some clickable elements
110
- const interactiveLayerIds = (0, _react.useMemo)(() => {
111
- var _featureGroups$filter;
112
- return featureGroups === null || featureGroups === void 0 ? void 0 : (_featureGroups$filter = featureGroups.filter(group => group.features.some(feature => feature.onClick !== undefined))) === null || _featureGroups$filter === void 0 ? void 0 : _featureGroups$filter.map(group => group.layerId);
103
+ const interactiveLayerIds = useMemo(() => {
104
+ return featureGroups?.filter(group => group.features.some(feature => feature.onClick !== undefined))?.map(group => group.layerId);
113
105
  }, [featureGroups]);
114
- const geojson = (0, _react.useMemo)(() => {
115
- const features = featureGroups === null || featureGroups === void 0 ? void 0 : featureGroups.flatMap(group => {
106
+ const geojson = useMemo(() => {
107
+ const features = featureGroups?.flatMap(group => {
116
108
  return group.features.map(feature => {
117
- var _feature$priority, _feature$selected;
118
109
  const properties = {
119
110
  id: feature.featureId,
120
111
  clickable: feature.onClick !== undefined,
121
112
  label: feature.label,
122
- layerFeatureId: "".concat(group.layerId, "/").concat(feature.featureId),
113
+ layerFeatureId: `${group.layerId}/${feature.featureId}`,
123
114
  layerId: group.layerId,
124
- priority: (_feature$priority = feature.priority) !== null && _feature$priority !== void 0 ? _feature$priority : 0,
125
- selected: (_feature$selected = feature.selected) !== null && _feature$selected !== void 0 ? _feature$selected : false
115
+ priority: feature.priority ?? 0,
116
+ selected: feature.selected ?? false
126
117
  };
127
118
  return {
128
119
  type: 'Feature',
@@ -140,11 +131,10 @@ const MapBox = props => {
140
131
  borderLayers,
141
132
  fillLayers,
142
133
  textLayers
143
- } = (0, _react.useMemo)(() => {
144
- const _borderLayers = featureGroups === null || featureGroups === void 0 ? void 0 : featureGroups.map(group => {
145
- return /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
146
- key: "".concat(group.layerId, "-border"),
147
- id: "".concat(group.layerId, "-border"),
134
+ } = useMemo(() => {
135
+ const _borderLayers = featureGroups?.map(group => {
136
+ return /*#__PURE__*/_jsx(Layer, {
137
+ id: `${group.layerId}-border`,
148
138
  source: 'mapData',
149
139
  type: "line",
150
140
  paint: {
@@ -152,11 +142,10 @@ const MapBox = props => {
152
142
  'line-width': 2
153
143
  },
154
144
  filter: ['==', ['get', 'layerId'], group.layerId]
155
- });
145
+ }, `${group.layerId}-border`);
156
146
  });
157
- const _fillLayers = featureGroups === null || featureGroups === void 0 ? void 0 : featureGroups.map(group => {
158
- var _group$style$opacity;
159
- const opacity = Math.min(0.4, (_group$style$opacity = group.style.opacity) !== null && _group$style$opacity !== void 0 ? _group$style$opacity : 0.2);
147
+ const _fillLayers = featureGroups?.map(group => {
148
+ const opacity = Math.min(0.4, group.style.opacity ?? 0.2);
160
149
  const selectedOpacity = opacity * 2;
161
150
  const hoverOpacity = opacity * 1.5;
162
151
  const hoverAndSelectedOpacity = opacity * 2.5;
@@ -164,78 +153,74 @@ const MapBox = props => {
164
153
  const clickableFilter = ['==', ['get', 'clickable'], true];
165
154
  const selectedFilter = ['==', ['get', 'selected'], true];
166
155
  const notSelectedFilter = ['==', ['get', 'selected'], false];
167
- const hoverFilter = ['==', ['get', 'id'], hoverFeatureId !== null && hoverFeatureId !== void 0 ? hoverFeatureId : null];
168
- const notHoverFilter = ['!=', ['get', 'id'], hoverFeatureId !== null && hoverFeatureId !== void 0 ? hoverFeatureId : null];
169
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
170
- key: group.layerId,
171
- id: group.layerId,
172
- source: 'mapData',
173
- type: 'fill',
174
- paint: {
175
- 'fill-opacity': 0
176
- },
177
- filter: ['all', groupFilter, clickableFilter]
178
- }), /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
179
- key: "".concat(group.layerId, "-unselected"),
180
- id: "".concat(group.layerId, "-unselected"),
181
- source: 'mapData',
182
- type: 'fill',
183
- paint: group.style.fillPatternUrl ? {
184
- 'fill-pattern': group.style.fillPatternUrl,
185
- 'fill-opacity': opacity
186
- } : {
187
- 'fill-color': group.style.fillColor,
188
- 'fill-opacity': opacity
189
- },
190
- filter: ['all', groupFilter, notSelectedFilter, notHoverFilter]
191
- }), /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
192
- key: "".concat(group.layerId, "-selected"),
193
- id: "".concat(group.layerId, "-selected"),
194
- slot: 'bottom',
195
- source: 'mapData',
196
- type: 'fill',
197
- paint: group.style.fillPatternUrl ? {
198
- 'fill-pattern': group.style.fillPatternUrl,
199
- 'fill-opacity': selectedOpacity
200
- } : {
201
- 'fill-color': group.style.fillColor,
202
- 'fill-opacity': selectedOpacity
203
- },
204
- filter: ['all', groupFilter, selectedFilter, notHoverFilter]
205
- }), /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
206
- key: "".concat(group.layerId, "-hover"),
207
- id: "".concat(group.layerId, "-hover"),
208
- source: 'mapData',
209
- type: 'fill',
210
- paint: group.style.fillPatternUrl ? {
211
- 'fill-pattern': group.style.fillPatternUrl,
212
- 'fill-opacity': hoverOpacity
213
- } : {
214
- 'fill-color': group.style.fillColor,
215
- 'fill-opacity': hoverOpacity
216
- },
217
- filter: ['all', groupFilter, hoverFilter, notSelectedFilter]
218
- }), /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
219
- key: "".concat(group.layerId, "-selected-hover"),
220
- id: "".concat(group.layerId, "-selected-hover"),
221
- source: 'mapData',
222
- type: 'fill',
223
- paint: group.style.fillPatternUrl ? {
224
- 'fill-pattern': group.style.fillPatternUrl,
225
- 'fill-opacity': hoverAndSelectedOpacity
226
- } : {
227
- 'fill-color': group.style.fillColor,
228
- 'fill-opacity': hoverAndSelectedOpacity
229
- },
230
- filter: ['all', groupFilter, hoverFilter, selectedFilter]
231
- }));
156
+ const hoverFilter = ['==', ['get', 'id'], hoverFeatureId ?? null];
157
+ const notHoverFilter = ['!=', ['get', 'id'], hoverFeatureId ?? null];
158
+ return /*#__PURE__*/_jsxs(_Fragment, {
159
+ children: [/*#__PURE__*/_jsx(Layer, {
160
+ id: group.layerId,
161
+ source: 'mapData',
162
+ type: 'fill',
163
+ paint: {
164
+ 'fill-opacity': 0
165
+ },
166
+ filter: ['all', groupFilter, clickableFilter]
167
+ }, group.layerId), /*#__PURE__*/_jsx(Layer, {
168
+ id: `${group.layerId}-unselected`,
169
+ source: 'mapData',
170
+ type: 'fill',
171
+ paint: group.style.fillPatternUrl ? {
172
+ 'fill-pattern': group.style.fillPatternUrl,
173
+ 'fill-opacity': opacity
174
+ } : {
175
+ 'fill-color': group.style.fillColor,
176
+ 'fill-opacity': opacity
177
+ },
178
+ filter: ['all', groupFilter, notSelectedFilter, notHoverFilter]
179
+ }, `${group.layerId}-unselected`), /*#__PURE__*/_jsx(Layer, {
180
+ id: `${group.layerId}-selected`,
181
+ slot: 'bottom',
182
+ source: 'mapData',
183
+ type: 'fill',
184
+ paint: group.style.fillPatternUrl ? {
185
+ 'fill-pattern': group.style.fillPatternUrl,
186
+ 'fill-opacity': selectedOpacity
187
+ } : {
188
+ 'fill-color': group.style.fillColor,
189
+ 'fill-opacity': selectedOpacity
190
+ },
191
+ filter: ['all', groupFilter, selectedFilter, notHoverFilter]
192
+ }, `${group.layerId}-selected`), /*#__PURE__*/_jsx(Layer, {
193
+ id: `${group.layerId}-hover`,
194
+ source: 'mapData',
195
+ type: 'fill',
196
+ paint: group.style.fillPatternUrl ? {
197
+ 'fill-pattern': group.style.fillPatternUrl,
198
+ 'fill-opacity': hoverOpacity
199
+ } : {
200
+ 'fill-color': group.style.fillColor,
201
+ 'fill-opacity': hoverOpacity
202
+ },
203
+ filter: ['all', groupFilter, hoverFilter, notSelectedFilter]
204
+ }, `${group.layerId}-hover`), /*#__PURE__*/_jsx(Layer, {
205
+ id: `${group.layerId}-selected-hover`,
206
+ source: 'mapData',
207
+ type: 'fill',
208
+ paint: group.style.fillPatternUrl ? {
209
+ 'fill-pattern': group.style.fillPatternUrl,
210
+ 'fill-opacity': hoverAndSelectedOpacity
211
+ } : {
212
+ 'fill-color': group.style.fillColor,
213
+ 'fill-opacity': hoverAndSelectedOpacity
214
+ },
215
+ filter: ['all', groupFilter, hoverFilter, selectedFilter]
216
+ }, `${group.layerId}-selected-hover`)]
217
+ });
232
218
  });
233
- const _textLayers = featureGroups === null || featureGroups === void 0 ? void 0 : featureGroups.map(group => {
219
+ const _textLayers = featureGroups?.map(group => {
234
220
  const groupFilter = ['==', ['get', 'layerId'], group.layerId];
235
221
  const labelFilter = ['has', 'label'];
236
- return /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
237
- key: "".concat(group.layerId, "-label"),
238
- id: "".concat(group.layerId, "-label"),
222
+ return /*#__PURE__*/_jsx(Layer, {
223
+ id: `${group.layerId}-label`,
239
224
  source: 'mapData',
240
225
  type: 'symbol',
241
226
  layout: {
@@ -250,108 +235,101 @@ const MapBox = props => {
250
235
  'text-color': '#ffffff'
251
236
  },
252
237
  filter: ['all', groupFilter, labelFilter]
253
- });
238
+ }, `${group.layerId}-label`);
254
239
  });
255
240
  return {
256
- borderLayers: _borderLayers !== null && _borderLayers !== void 0 ? _borderLayers : [],
257
- fillLayers: _fillLayers !== null && _fillLayers !== void 0 ? _fillLayers : [],
258
- textLayers: _textLayers !== null && _textLayers !== void 0 ? _textLayers : []
241
+ borderLayers: _borderLayers ?? [],
242
+ fillLayers: _fillLayers ?? [],
243
+ textLayers: _textLayers ?? []
259
244
  };
260
245
  }, [featureGroups, hoverFeatureId]);
261
- const highlightLayers = (0, _react.useMemo)(() => {
262
- var _highlightGroups$flat;
263
- return (_highlightGroups$flat = highlightGroups === null || highlightGroups === void 0 ? void 0 : highlightGroups.flatMap(group => {
246
+ const highlightLayers = useMemo(() => {
247
+ return highlightGroups?.flatMap(group => {
264
248
  return group.highlights.map((highlight, index) => {
265
- var _highlight$style$opac, _highlight$style$opac2;
266
- const highlightFeatureIds = highlight.featureIds.map(_ref => {
267
- let {
268
- layerId,
269
- featureId
270
- } = _ref;
271
- return "".concat(layerId, "/").concat(featureId);
272
- });
273
- return /*#__PURE__*/_react.default.createElement(_mapbox.Layer, {
274
- key: "highlight-".concat(group.highlightId, "-").concat(index),
275
- id: "highlight-".concat(group.highlightId, "-").concat(index),
249
+ const highlightFeatureIds = highlight.featureIds.map(({
250
+ layerId,
251
+ featureId
252
+ }) => `${layerId}/${featureId}`);
253
+ return /*#__PURE__*/_jsx(Layer, {
254
+ id: `highlight-${group.highlightId}-${index}`,
276
255
  source: 'mapData',
277
256
  type: 'fill',
278
257
  paint: highlight.style.fillPatternUrl ? {
279
258
  'fill-pattern': highlight.style.fillPatternUrl,
280
- 'fill-opacity': (_highlight$style$opac = highlight.style.opacity) !== null && _highlight$style$opac !== void 0 ? _highlight$style$opac : 0.5
259
+ 'fill-opacity': highlight.style.opacity ?? 0.5
281
260
  } : {
282
261
  'fill-color': highlight.style.fillColor,
283
- 'fill-opacity': (_highlight$style$opac2 = highlight.style.opacity) !== null && _highlight$style$opac2 !== void 0 ? _highlight$style$opac2 : 0.5
262
+ 'fill-opacity': highlight.style.opacity ?? 0.5
284
263
  },
285
264
  filter: ['all', ['has', 'layerFeatureId'], ['match', ['get', 'layerFeatureId'], highlightFeatureIds, true, false]]
286
- });
265
+ }, `highlight-${group.highlightId}-${index}`);
287
266
  });
288
- })) !== null && _highlightGroups$flat !== void 0 ? _highlightGroups$flat : [];
267
+ }) ?? [];
289
268
  }, [highlightGroups]);
290
- const markersComponents = (0, _react.useMemo)(() => {
291
- return markerGroups === null || markerGroups === void 0 ? void 0 : markerGroups.flatMap(markerGroup => {
269
+ const markersComponents = useMemo(() => {
270
+ return markerGroups?.flatMap(markerGroup => {
292
271
  // cluster markers here
293
272
  const clusteredMarkers = clusterMarkers(mapRef.current, markerGroup.markers);
294
273
  return clusteredMarkers.map((markers, i) => {
295
274
  if (markers.length === 1) {
296
275
  const marker = markers[0];
297
- return /*#__PURE__*/_react.default.createElement(_mapbox.Marker, {
276
+ return /*#__PURE__*/_jsx(Marker, {
298
277
  className: "map-marker",
299
- key: "marker-".concat(i),
300
278
  longitude: marker.longitude,
301
279
  latitude: marker.latitude,
302
280
  anchor: "center",
303
281
  onClick: event => {
304
- var _marker$onClick;
305
- (_marker$onClick = marker.onClick) === null || _marker$onClick === void 0 ? void 0 : _marker$onClick.call(marker);
282
+ marker.onClick?.();
306
283
  event.originalEvent.stopPropagation();
307
284
  },
308
285
  style: {
309
286
  backgroundColor: marker.selected ? markerGroup.style.iconColor : theme.palette.TwClrBg
310
- }
311
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
312
- fillColor: marker.selected ? theme.palette.TwClrBg : markerGroup.style.iconColor,
313
- name: markerGroup.style.iconName,
314
- size: 'small'
315
- }));
287
+ },
288
+ children: /*#__PURE__*/_jsx(Icon, {
289
+ fillColor: marker.selected ? theme.palette.TwClrBg : markerGroup.style.iconColor,
290
+ name: markerGroup.style.iconName,
291
+ size: 'small'
292
+ })
293
+ }, `marker-${i}`);
316
294
  } else if (markers.length > 1) {
317
295
  const latSum = markers.reduce((sum, marker) => sum + marker.latitude, 0);
318
296
  const lngSum = markers.reduce((sum, marker) => sum + marker.longitude, 0);
319
297
  const latAvg = latSum / markers.length;
320
298
  const lngAvg = lngSum / markers.length;
321
299
  const selected = markers.some(marker => marker.selected);
322
- return /*#__PURE__*/_react.default.createElement(_mapbox.Marker, {
300
+ return /*#__PURE__*/_jsxs(Marker, {
323
301
  className: "map-marker map-marker--cluster",
324
- key: "marker-".concat(i),
325
302
  longitude: lngAvg,
326
303
  latitude: latAvg,
327
304
  anchor: "center",
328
305
  onClick: event => {
329
- var _mapRef$current;
330
- (_mapRef$current = mapRef.current) === null || _mapRef$current === void 0 ? void 0 : _mapRef$current.easeTo({
306
+ mapRef.current?.easeTo({
331
307
  center: {
332
308
  lat: latAvg,
333
309
  lon: lngAvg
334
310
  },
335
- zoom: (zoom !== null && zoom !== void 0 ? zoom : 10) + 1,
311
+ zoom: (zoom ?? 10) + 1,
336
312
  duration: 500
337
313
  });
338
314
  event.originalEvent.stopPropagation();
339
315
  },
340
316
  style: {
341
317
  backgroundColor: selected ? markerGroup.style.iconColor : theme.palette.TwClrBg
342
- }
343
- }, /*#__PURE__*/_react.default.createElement("p", {
344
- className: "count"
345
- }, markers.length), /*#__PURE__*/_react.default.createElement(_Icon.default, {
346
- fillColor: selected ? theme.palette.TwClrBg : markerGroup.style.iconColor,
347
- name: markerGroup.style.iconName,
348
- size: 'small'
349
- }));
318
+ },
319
+ children: [/*#__PURE__*/_jsx("p", {
320
+ className: "count",
321
+ children: markers.length
322
+ }), /*#__PURE__*/_jsx(Icon, {
323
+ fillColor: selected ? theme.palette.TwClrBg : markerGroup.style.iconColor,
324
+ name: markerGroup.style.iconName,
325
+ size: 'small'
326
+ })]
327
+ }, `marker-${i}`);
350
328
  }
351
329
  });
352
330
  });
353
331
  }, [markerGroups, theme, zoom]);
354
- const onMouseMove = (0, _react.useCallback)(event => {
332
+ const onMouseMove = useCallback(event => {
355
333
  if (event.features && event.features.length) {
356
334
  const properties = event.features.map(feature => feature.properties).filter(featureProperties => featureProperties && featureProperties.id !== undefined && featureProperties.priority !== undefined && featureProperties.clickable);
357
335
  if (properties.length) {
@@ -364,18 +342,17 @@ const MapBox = props => {
364
342
  }
365
343
  setHoverFeatureId(undefined);
366
344
  }, []);
367
- (0, _react.useEffect)(() => {
345
+ useEffect(() => {
368
346
  if (!mapRef.current) {
369
347
  return;
370
348
  }
371
349
  const observer = new ResizeObserver(() => {
372
- var _mapRef$current2;
373
- (_mapRef$current2 = mapRef.current) === null || _mapRef$current2 === void 0 ? void 0 : _mapRef$current2.resize();
350
+ mapRef.current?.resize();
374
351
  });
375
352
  observer.observe(mapRef.current.getContainer());
376
353
  return () => observer.disconnect();
377
354
  }, []);
378
- (0, _react.useEffect)(() => {
355
+ useEffect(() => {
379
356
  if (!mapRef.current) {
380
357
  return;
381
358
  }
@@ -383,17 +360,16 @@ const MapBox = props => {
383
360
  }, [drawerOpen]);
384
361
 
385
362
  // Hovering interactive layers
386
- const onMouseEnter = (0, _react.useCallback)(() => setCursor(cursorInteract !== null && cursorInteract !== void 0 ? cursorInteract : 'pointer'), [cursorInteract]);
387
- const onMouseLeave = (0, _react.useCallback)(() => setCursor('auto'), []);
363
+ const onMouseEnter = useCallback(() => setCursor(cursorInteract ?? 'pointer'), [cursorInteract]);
364
+ const onMouseLeave = useCallback(() => setCursor('auto'), []);
388
365
 
389
366
  // Entering and exiting canvases
390
- const onMouseOver = (0, _react.useCallback)(() => setCursor(cursorMap !== null && cursorMap !== void 0 ? cursorMap : 'auto'), [cursorMap]);
391
- const onMouseOut = (0, _react.useCallback)(() => setCursor('auto'), []);
367
+ const onMouseOver = useCallback(() => setCursor(cursorMap ?? 'auto'), [cursorMap]);
368
+ const onMouseOut = useCallback(() => setCursor('auto'), []);
392
369
 
393
370
  // On layer click
394
- const onMapClick = (0, _react.useCallback)(event => {
395
- var _event$features;
396
- if (featureGroups && (_event$features = event.features) !== null && _event$features !== void 0 && _event$features.length) {
371
+ const onMapClick = useCallback(event => {
372
+ if (featureGroups && event.features?.length) {
397
373
  const properties = event.features.map(feature => feature.properties).filter(featureProperties => featureProperties && featureProperties.id !== undefined && featureProperties.priority !== undefined && featureProperties.clickable);
398
374
  if (properties.length) {
399
375
  const topPriorityFeature = properties.reduce((top, current) => {
@@ -411,19 +387,18 @@ const MapBox = props => {
411
387
  onClickCanvas(event);
412
388
  }
413
389
  }, [featureGroups, onClickCanvas]);
414
- const orderedLayerIds = (0, _react.useMemo)(() => {
390
+ const orderedLayerIds = useMemo(() => {
415
391
  return [...fillLayers.map(layer => layer.props.id), ...highlightLayers.map(layer => layer.props.id), ...borderLayers.map(layer => layer.props.id), ...textLayers.map(layer => layer.props.id)];
416
392
  }, [borderLayers, fillLayers, highlightLayers, textLayers]);
417
- (0, _useMaintainLayerOrder.useMaintainLayerOrder)(mapRef, orderedLayerIds);
418
- return /*#__PURE__*/_react.default.createElement(_ReactMapboxWrapper.default, {
419
- key: mapId,
393
+ useMaintainLayerOrder(mapRef, orderedLayerIds);
394
+ return /*#__PURE__*/_jsxs(ReactMapbox, {
420
395
  attributionControl: false,
421
396
  cursor: cursor,
422
397
  doubleClickZoom: !disableZoom && !disableDoubleClickZoom,
423
398
  interactiveLayerIds: interactiveLayerIds,
424
399
  initialViewState: initialViewState,
425
400
  mapboxAccessToken: token,
426
- mapStyle: _types.stylesUrl[mapViewStyle],
401
+ mapStyle: stylesUrl[mapViewStyle],
427
402
  ref: mapRefCallback,
428
403
  scrollZoom: !disableZoom,
429
404
  style: {
@@ -437,43 +412,47 @@ const MapBox = props => {
437
412
  onMouseLeave: onMouseLeave,
438
413
  onMouseOver: onMouseOver,
439
414
  onMouseOut: onMouseOut,
440
- onMouseMove: onMouseMove
441
- }, isDesktop && !hideFullScreenControl && /*#__PURE__*/_react.default.createElement(_mapbox.FullscreenControl, {
442
- position: "top-left",
443
- containerId: containerId
444
- }), !hideZoomControl && /*#__PURE__*/_react.default.createElement(_mapbox.NavigationControl, {
445
- showCompass: false,
446
- style: {
447
- marginRight: theme.spacing(2),
448
- marginBottom: theme.spacing(2)
449
- },
450
- position: "bottom-right"
451
- }), !hideMapViewStyleControl && /*#__PURE__*/_react.default.createElement(_MapViewStyleControl.default, {
452
- containerId: containerId,
453
- mapViewStyle: mapViewStyle,
454
- setMapViewStyle: setMapViewStyle
455
- }), controlTopRight && /*#__PURE__*/_react.default.createElement(_material.Box, {
456
- sx: {
457
- height: 'max-content',
458
- position: 'absolute',
459
- right: theme.spacing(2),
460
- top: theme.spacing(2),
461
- width: 'max-content',
462
- zIndex: 1000
463
- }
464
- }, controlTopRight), controlBottomLeft && /*#__PURE__*/_react.default.createElement(_material.Box, {
465
- style: {
466
- height: 'max-content',
467
- position: 'absolute',
468
- left: theme.spacing(2),
469
- bottom: theme.spacing(4),
470
- width: 'max-content',
471
- zIndex: 1000
472
- }
473
- }, controlBottomLeft), geojson && /*#__PURE__*/_react.default.createElement(_mapbox.Source, {
474
- id: "mapData",
475
- type: "geojson",
476
- data: geojson
477
- }, fillLayers, highlightLayers, borderLayers, textLayers), markersComponents);
415
+ onMouseMove: onMouseMove,
416
+ children: [isDesktop && !hideFullScreenControl && /*#__PURE__*/_jsx(FullscreenControl, {
417
+ position: "top-left",
418
+ containerId: containerId
419
+ }), !hideZoomControl && /*#__PURE__*/_jsx(NavigationControl, {
420
+ showCompass: false,
421
+ style: {
422
+ marginRight: theme.spacing(2),
423
+ marginBottom: theme.spacing(2)
424
+ },
425
+ position: "bottom-right"
426
+ }), !hideMapViewStyleControl && /*#__PURE__*/_jsx(MapViewStyleControl, {
427
+ containerId: containerId,
428
+ mapViewStyle: mapViewStyle,
429
+ setMapViewStyle: setMapViewStyle
430
+ }), controlTopRight && /*#__PURE__*/_jsx(Box, {
431
+ sx: {
432
+ height: 'max-content',
433
+ position: 'absolute',
434
+ right: theme.spacing(2),
435
+ top: theme.spacing(2),
436
+ width: 'max-content',
437
+ zIndex: 1000
438
+ },
439
+ children: controlTopRight
440
+ }), controlBottomLeft && /*#__PURE__*/_jsx(Box, {
441
+ style: {
442
+ height: 'max-content',
443
+ position: 'absolute',
444
+ left: theme.spacing(2),
445
+ bottom: theme.spacing(4),
446
+ width: 'max-content',
447
+ zIndex: 1000
448
+ },
449
+ children: controlBottomLeft
450
+ }), geojson && /*#__PURE__*/_jsxs(Source, {
451
+ id: "mapData",
452
+ type: "geojson",
453
+ data: geojson,
454
+ children: [fillLayers, highlightLayers, borderLayers, textLayers]
455
+ }), markersComponents]
456
+ }, mapId);
478
457
  };
479
- var _default = exports.default = MapBox;
458
+ export default MapBox;
@@ -1,13 +1,7 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _utils = require("../../utils");
10
- require("./styles.scss");
1
+ import React, { useMemo } from 'react';
2
+ import { useDeviceInfo } from '../../utils';
3
+ import './styles.scss';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
5
  const MapContainer = props => {
12
6
  const {
13
7
  containerId,
@@ -18,13 +12,15 @@ const MapContainer = props => {
18
12
  } = props;
19
13
  const {
20
14
  isDesktop
21
- } = (0, _utils.useDeviceInfo)();
22
- const drawerOnly = (0, _react.useMemo)(() => !isDesktop && drawerOpen, [drawerOpen, isDesktop]);
23
- return /*#__PURE__*/_react.default.createElement("div", {
15
+ } = useDeviceInfo();
16
+ const drawerOnly = useMemo(() => !isDesktop && drawerOpen, [drawerOpen, isDesktop]);
17
+ return /*#__PURE__*/_jsxs("div", {
24
18
  id: containerId,
25
- className: "map-container map-container".concat(isDesktop ? '--desktop' : "--mobile".concat(drawerOpen ? '-drawer-open' : ''))
26
- }, /*#__PURE__*/_react.default.createElement("div", {
27
- className: "map-holder".concat(drawerOnly ? ' map-holder--hidden' : '')
28
- }, map), drawerOpen && drawer, !drawerOnly && legend);
19
+ className: `map-container map-container${isDesktop ? '--desktop' : `--mobile${drawerOpen ? '-drawer-open' : ''}`}`,
20
+ children: [/*#__PURE__*/_jsx("div", {
21
+ className: `map-holder${drawerOnly ? ' map-holder--hidden' : ''}`,
22
+ children: map
23
+ }), drawerOpen && drawer, !drawerOnly && legend]
24
+ });
29
25
  };
30
- var _default = exports.default = MapContainer;
26
+ export default MapContainer;