@mapsight/ui 7.1.0 → 7.2.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 (497) hide show
  1. package/README.md +95 -2
  2. package/dist/components/app.d.ts +1 -1
  3. package/dist/components/app.d.ts.map +1 -1
  4. package/dist/components/feature-details-content/feature-details-content.d.ts +1 -1
  5. package/dist/components/feature-details-content/feature-details-content.d.ts.map +1 -1
  6. package/dist/components/feature-details-content/index.d.ts +1 -1
  7. package/dist/components/feature-details-content/share-feature-link-modal.d.ts +1 -1
  8. package/dist/components/feature-details-content/share-feature-link-modal.d.ts.map +1 -1
  9. package/dist/components/feature-list/context.d.ts +12 -4
  10. package/dist/components/feature-list/context.d.ts.map +1 -1
  11. package/dist/components/feature-list/context.js.map +1 -1
  12. package/dist/components/feature-list/empty-message.d.ts +1 -1
  13. package/dist/components/feature-list/empty-message.d.ts.map +1 -1
  14. package/dist/components/feature-list/filter.d.ts +1 -1
  15. package/dist/components/feature-list/filter.d.ts.map +1 -1
  16. package/dist/components/feature-list/footer.d.ts +1 -1
  17. package/dist/components/feature-list/footer.d.ts.map +1 -1
  18. package/dist/components/feature-list/hooks/useAutoloadFeatureSource.d.ts.map +1 -1
  19. package/dist/components/feature-list/hooks/useAutoloadFeatureSource.js +12 -3
  20. package/dist/components/feature-list/hooks/useAutoloadFeatureSource.js.map +1 -1
  21. package/dist/components/feature-list/hooks/useFeatureListItemGroups.js +1 -1
  22. package/dist/components/feature-list/hooks/useFeatureListItemGroups.js.map +1 -1
  23. package/dist/components/feature-list/index.d.ts +3 -2
  24. package/dist/components/feature-list/index.d.ts.map +1 -1
  25. package/dist/components/feature-list/index.js +33 -42
  26. package/dist/components/feature-list/index.js.map +1 -1
  27. package/dist/components/feature-list/layer-switcher-control.d.ts +4 -0
  28. package/dist/components/feature-list/layer-switcher-control.d.ts.map +1 -0
  29. package/dist/components/feature-list/layer-switcher-control.js +11 -0
  30. package/dist/components/feature-list/layer-switcher-control.js.map +1 -0
  31. package/dist/components/feature-list/pagination.d.ts +1 -1
  32. package/dist/components/feature-list/pagination.d.ts.map +1 -1
  33. package/dist/components/feature-list/query-input.d.ts +1 -1
  34. package/dist/components/feature-list/query-input.d.ts.map +1 -1
  35. package/dist/components/feature-list/tag-switcher-control.d.ts +4 -0
  36. package/dist/components/feature-list/tag-switcher-control.d.ts.map +1 -0
  37. package/dist/components/feature-list/tag-switcher-control.js +10 -0
  38. package/dist/components/feature-list/tag-switcher-control.js.map +1 -0
  39. package/dist/components/feature-list-cycling/button.d.ts +1 -1
  40. package/dist/components/feature-list-cycling/button.d.ts.map +1 -1
  41. package/dist/components/feature-list-cycling/dot.d.ts +1 -1
  42. package/dist/components/feature-list-cycling/dot.d.ts.map +1 -1
  43. package/dist/components/feature-list-cycling/feature-list-cycling.d.ts +1 -1
  44. package/dist/components/feature-list-cycling/feature-list-cycling.d.ts.map +1 -1
  45. package/dist/components/feature-list-cycling/index.d.ts +1 -1
  46. package/dist/components/feature-list-item/icon.d.ts +8 -6
  47. package/dist/components/feature-list-item/icon.d.ts.map +1 -1
  48. package/dist/components/feature-list-item/icon.js +5 -13
  49. package/dist/components/feature-list-item/icon.js.map +1 -1
  50. package/dist/components/feature-list-item/index.d.ts +1 -1
  51. package/dist/components/feature-list-item/index.d.ts.map +1 -1
  52. package/dist/components/feature-list-sorting/feature-list-sorting.d.ts +1 -1
  53. package/dist/components/feature-list-sorting/feature-list-sorting.d.ts.map +1 -1
  54. package/dist/components/feature-list-sorting/feature-list-sorting.js +3 -12
  55. package/dist/components/feature-list-sorting/feature-list-sorting.js.map +1 -1
  56. package/dist/components/feature-list-sorting/index.d.ts +1 -1
  57. package/dist/components/feature-list-sorting/status-indicator.d.ts +1 -1
  58. package/dist/components/feature-list-sorting/status-indicator.d.ts.map +1 -1
  59. package/dist/components/feature-select-button.d.ts +1 -1
  60. package/dist/components/feature-select-button.d.ts.map +1 -1
  61. package/dist/components/feature-selection-info/close-button.d.ts +1 -1
  62. package/dist/components/feature-selection-info/close-button.d.ts.map +1 -1
  63. package/dist/components/feature-selection-info/container.d.ts +1 -1
  64. package/dist/components/feature-selection-info/container.d.ts.map +1 -1
  65. package/dist/components/feature-selection-info/header.d.ts +1 -1
  66. package/dist/components/feature-selection-info/header.d.ts.map +1 -1
  67. package/dist/components/feature-selection-info/index.d.ts +1 -1
  68. package/dist/components/feature-selection-info/index.d.ts.map +1 -1
  69. package/dist/components/feature-selection-info/with-sticky-header.d.ts +1 -1
  70. package/dist/components/feature-selection-info/with-sticky-header.d.ts.map +1 -1
  71. package/dist/components/feature-selection-info/without-sticky-header.d.ts +1 -1
  72. package/dist/components/feature-selection-info/without-sticky-header.d.ts.map +1 -1
  73. package/dist/components/filter-toggle-control/FilterToggleControl.d.ts +12 -0
  74. package/dist/components/filter-toggle-control/FilterToggleControl.d.ts.map +1 -0
  75. package/dist/components/filter-toggle-control/FilterToggleControl.js +20 -0
  76. package/dist/components/filter-toggle-control/FilterToggleControl.js.map +1 -0
  77. package/dist/components/helping/app-channel.d.ts +1 -1
  78. package/dist/components/helping/app-channel.d.ts.map +1 -1
  79. package/dist/components/helping/app-context.d.ts +1 -1
  80. package/dist/components/helping/app-context.d.ts.map +1 -1
  81. package/dist/components/instance.d.ts +1 -1
  82. package/dist/components/instance.d.ts.map +1 -1
  83. package/dist/components/layer-switcher/GroupedLayerSwitcher.d.ts +1 -1
  84. package/dist/components/layer-switcher/LayerSwitcher.d.ts +1 -1
  85. package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts +4 -2
  86. package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts.map +1 -1
  87. package/dist/components/layer-switcher/LayerSwitcherContainer.js +10 -4
  88. package/dist/components/layer-switcher/LayerSwitcherContainer.js.map +1 -1
  89. package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts +1 -1
  90. package/dist/components/layer-switcher/SplitBaseLayerSwitcher.d.ts +26 -0
  91. package/dist/components/layer-switcher/SplitBaseLayerSwitcher.d.ts.map +1 -0
  92. package/dist/components/layer-switcher/SplitBaseLayerSwitcher.js +48 -0
  93. package/dist/components/layer-switcher/SplitBaseLayerSwitcher.js.map +1 -0
  94. package/dist/components/layer-switcher/index.d.ts +1 -1
  95. package/dist/components/layer-switcher/index.d.ts.map +1 -1
  96. package/dist/components/layer-switcher/index.js +1 -0
  97. package/dist/components/layer-switcher/index.js.map +1 -1
  98. package/dist/components/layout/additional-container/content.d.ts +1 -1
  99. package/dist/components/layout/additional-container/content.d.ts.map +1 -1
  100. package/dist/components/layout/additional-container/index.d.ts +1 -1
  101. package/dist/components/layout/additional-container/index.d.ts.map +1 -1
  102. package/dist/components/layout/additional-container/marginal.d.ts +1 -1
  103. package/dist/components/layout/additional-container/marginal.d.ts.map +1 -1
  104. package/dist/components/layout/main-container.d.ts +1 -1
  105. package/dist/components/layout/main-container.d.ts.map +1 -1
  106. package/dist/components/layout/map-row.d.ts +1 -1
  107. package/dist/components/layout/map-row.d.ts.map +1 -1
  108. package/dist/components/layout/title-bar.d.ts +1 -1
  109. package/dist/components/layout/title-bar.d.ts.map +1 -1
  110. package/dist/components/layout/wrapper.d.ts +1 -1
  111. package/dist/components/layout/wrapper.d.ts.map +1 -1
  112. package/dist/components/link-share.d.ts +1 -1
  113. package/dist/components/link-share.d.ts.map +1 -1
  114. package/dist/components/main-panel/container.d.ts +1 -1
  115. package/dist/components/main-panel/container.d.ts.map +1 -1
  116. package/dist/components/main-panel/context.d.ts +1 -1
  117. package/dist/components/main-panel/context.d.ts.map +1 -1
  118. package/dist/components/main-panel/index.d.ts +1 -1
  119. package/dist/components/main-panel/index.d.ts.map +1 -1
  120. package/dist/components/main-panel/list-toggle-button.d.ts +1 -1
  121. package/dist/components/main-panel/list-toggle-button.d.ts.map +1 -1
  122. package/dist/components/map-overlay/attribution-entries.d.ts +1 -1
  123. package/dist/components/map-overlay/attribution-entries.d.ts.map +1 -1
  124. package/dist/components/map-overlay/attribution.d.ts +1 -1
  125. package/dist/components/map-overlay/attribution.d.ts.map +1 -1
  126. package/dist/components/map-overlay/combined-buttons.d.ts +1 -1
  127. package/dist/components/map-overlay/combined-buttons.d.ts.map +1 -1
  128. package/dist/components/map-overlay/index.d.ts +1 -1
  129. package/dist/components/map-overlay/index.d.ts.map +1 -1
  130. package/dist/components/map-overlay/info-overlay-left.d.ts +1 -1
  131. package/dist/components/map-overlay/info-overlay-left.d.ts.map +1 -1
  132. package/dist/components/map-overlay/info-overlay-modal.d.ts +1 -1
  133. package/dist/components/map-overlay/info-overlay-modal.d.ts.map +1 -1
  134. package/dist/components/map-overlay/info-overlay-right.d.ts +1 -1
  135. package/dist/components/map-overlay/info-overlay-right.d.ts.map +1 -1
  136. package/dist/components/map-overlay/layer-switcher-overlay.d.ts +1 -1
  137. package/dist/components/map-overlay/layer-switcher-overlay.d.ts.map +1 -1
  138. package/dist/components/map-overlay/legend.d.ts +1 -1
  139. package/dist/components/map-overlay/legend.d.ts.map +1 -1
  140. package/dist/components/map-overlay/logo.d.ts +1 -1
  141. package/dist/components/map-overlay/logo.d.ts.map +1 -1
  142. package/dist/components/map-overlay/measure-distance-button.d.ts +1 -1
  143. package/dist/components/map-overlay/measure-distance-button.d.ts.map +1 -1
  144. package/dist/components/map-overlay/measure-distance-overlay.d.ts +1 -1
  145. package/dist/components/map-overlay/measure-distance-overlay.d.ts.map +1 -1
  146. package/dist/components/map-overlay/search-overlay.d.ts +1 -1
  147. package/dist/components/map-overlay/search-overlay.d.ts.map +1 -1
  148. package/dist/components/map-overlay/share-position-link-button.d.ts +1 -1
  149. package/dist/components/map-overlay/share-position-link-button.d.ts.map +1 -1
  150. package/dist/components/map-overlay/tool-overlay.d.ts +1 -1
  151. package/dist/components/map-overlay/tool-overlay.d.ts.map +1 -1
  152. package/dist/components/map-overlay/zoom-buttons.d.ts +1 -1
  153. package/dist/components/map-overlay/zoom-buttons.d.ts.map +1 -1
  154. package/dist/components/map-synced-interlay/index.d.ts +1 -1
  155. package/dist/components/map-synced-interlay/map-synced-interlay.d.ts +1 -1
  156. package/dist/components/map-synced-interlay/map-synced-interlay.d.ts.map +1 -1
  157. package/dist/components/map-synced-interlay/tooltip.d.ts +1 -1
  158. package/dist/components/map-synced-interlay/tooltip.d.ts.map +1 -1
  159. package/dist/components/map-wrapper.d.ts +3 -3
  160. package/dist/components/map-wrapper.d.ts.map +1 -1
  161. package/dist/components/map-wrapper.js +4 -7
  162. package/dist/components/map-wrapper.js.map +1 -1
  163. package/dist/components/map.d.ts +1 -1
  164. package/dist/components/map.d.ts.map +1 -1
  165. package/dist/components/mapsight-icon/mapsight-icon.d.ts +10 -0
  166. package/dist/components/mapsight-icon/mapsight-icon.d.ts.map +1 -0
  167. package/dist/components/mapsight-icon/mapsight-icon.js +33 -0
  168. package/dist/components/mapsight-icon/mapsight-icon.js.map +1 -0
  169. package/dist/components/modal.d.ts +1 -1
  170. package/dist/components/modal.d.ts.map +1 -1
  171. package/dist/components/query-input-with-label.d.ts +1 -1
  172. package/dist/components/query-input-with-label.d.ts.map +1 -1
  173. package/dist/components/search/index.d.ts +1 -1
  174. package/dist/components/search/index.d.ts.map +1 -1
  175. package/dist/components/search/result-entry.d.ts +1 -1
  176. package/dist/components/search/result-entry.d.ts.map +1 -1
  177. package/dist/components/search/result.d.ts +1 -1
  178. package/dist/components/search/result.d.ts.map +1 -1
  179. package/dist/components/switcher/GroupedSwitcher.d.ts +1 -1
  180. package/dist/components/switcher/GroupedSwitcher.d.ts.map +1 -1
  181. package/dist/components/switcher/Switcher.d.ts +1 -1
  182. package/dist/components/switcher/Switcher.d.ts.map +1 -1
  183. package/dist/components/switcher/SwitcherButton.d.ts +1 -1
  184. package/dist/components/switcher/SwitcherButton.d.ts.map +1 -1
  185. package/dist/components/switcher/SwitcherEntry.d.ts +1 -1
  186. package/dist/components/switcher/SwitcherEntry.d.ts.map +1 -1
  187. package/dist/components/switcher/SwitcherHeader.d.ts +1 -1
  188. package/dist/components/switcher/SwitcherHeader.d.ts.map +1 -1
  189. package/dist/components/switcher/SwitcherStatusIcon.d.ts +1 -1
  190. package/dist/components/switcher/SwitcherStatusIcon.d.ts.map +1 -1
  191. package/dist/components/tag-switcher/TagSwitcher.d.ts +1 -1
  192. package/dist/components/tag-switcher/TagSwitcher.d.ts.map +1 -1
  193. package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts +1 -1
  194. package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts +1 -1
  195. package/dist/components/tag-switcher/index.d.ts +1 -1
  196. package/dist/components/time-filter.d.ts +1 -1
  197. package/dist/components/time-filter.d.ts.map +1 -1
  198. package/dist/components/view-toggle-button/desktop-button.d.ts +1 -1
  199. package/dist/components/view-toggle-button/desktop-button.d.ts.map +1 -1
  200. package/dist/components/view-toggle-button/index.d.ts +1 -1
  201. package/dist/components/view-toggle-button/mobile-button.d.ts +1 -1
  202. package/dist/components/view-toggle-button/mobile-button.d.ts.map +1 -1
  203. package/dist/components/view-toggle-button/view-toggle-button.d.ts +1 -1
  204. package/dist/components/view-toggle-button/view-toggle-button.d.ts.map +1 -1
  205. package/dist/components/view-toggle-button/viewport-button.d.ts +1 -1
  206. package/dist/components/view-toggle-button/viewport-button.d.ts.map +1 -1
  207. package/dist/config/feature/sources.d.ts +8 -5
  208. package/dist/config/feature/sources.d.ts.map +1 -1
  209. package/dist/config/feature/sources.js +7 -9
  210. package/dist/config/feature/sources.js.map +1 -1
  211. package/dist/config/index.d.ts +1 -1
  212. package/dist/config/map/featureInteractions.js.map +1 -1
  213. package/dist/config/map/layers.d.ts +16 -13
  214. package/dist/config/map/layers.d.ts.map +1 -1
  215. package/dist/config/map/layers.js.map +1 -1
  216. package/dist/config/schema/index.d.ts +197 -0
  217. package/dist/config/schema/index.d.ts.map +1 -0
  218. package/dist/config/schema/index.js +26 -0
  219. package/dist/config/schema/index.js.map +1 -0
  220. package/dist/config/schema/validate.d.ts +8 -0
  221. package/dist/config/schema/validate.d.ts.map +1 -0
  222. package/dist/config/schema/validate.js +7 -0
  223. package/dist/config/schema/validate.js.map +1 -0
  224. package/dist/controllers/defaults.d.ts.map +1 -1
  225. package/dist/controllers/defaults.js +5 -0
  226. package/dist/controllers/defaults.js.map +1 -1
  227. package/dist/filters/tag-filter.d.ts +7 -0
  228. package/dist/filters/tag-filter.d.ts.map +1 -1
  229. package/dist/filters/tag-filter.js +10 -0
  230. package/dist/filters/tag-filter.js.map +1 -1
  231. package/dist/filters/time-filter.d.ts +9 -0
  232. package/dist/filters/time-filter.d.ts.map +1 -1
  233. package/dist/filters/time-filter.js +10 -0
  234. package/dist/filters/time-filter.js.map +1 -1
  235. package/dist/helpers/i18n/de.d.ts.map +1 -1
  236. package/dist/helpers/i18n/de.js +3 -0
  237. package/dist/helpers/i18n/de.js.map +1 -1
  238. package/dist/helpers/i18n/en.d.ts.map +1 -1
  239. package/dist/helpers/i18n/en.js +3 -0
  240. package/dist/helpers/i18n/en.js.map +1 -1
  241. package/dist/helpers/sort-features-by-distance.d.ts +2 -7
  242. package/dist/helpers/sort-features-by-distance.d.ts.map +1 -1
  243. package/dist/helpers/sort-features-by-distance.js +27 -39
  244. package/dist/helpers/sort-features-by-distance.js.map +1 -1
  245. package/dist/hooks/useMapsightIcon.d.ts +8 -0
  246. package/dist/hooks/useMapsightIcon.d.ts.map +1 -0
  247. package/dist/hooks/useMapsightIcon.js +50 -0
  248. package/dist/hooks/useMapsightIcon.js.map +1 -0
  249. package/dist/index.d.ts +2 -2
  250. package/dist/index.d.ts.map +1 -1
  251. package/dist/index.js +15 -2
  252. package/dist/index.js.map +1 -1
  253. package/dist/plugins/browser-defaults.d.ts +2 -0
  254. package/dist/plugins/browser-defaults.d.ts.map +1 -1
  255. package/dist/plugins/browser-defaults.js +5 -0
  256. package/dist/plugins/browser-defaults.js.map +1 -1
  257. package/dist/plugins/common/combined-visible-layers.d.ts +15 -0
  258. package/dist/plugins/common/combined-visible-layers.d.ts.map +1 -0
  259. package/dist/plugins/common/combined-visible-layers.js +63 -0
  260. package/dist/plugins/common/combined-visible-layers.js.map +1 -0
  261. package/dist/plugins/common/runtime-icon-style.d.ts +12 -0
  262. package/dist/plugins/common/runtime-icon-style.d.ts.map +1 -0
  263. package/dist/plugins/common/runtime-icon-style.js +58 -0
  264. package/dist/plugins/common/runtime-icon-style.js.map +1 -0
  265. package/dist/react-modal-app-element.d.ts +6 -0
  266. package/dist/react-modal-app-element.d.ts.map +1 -0
  267. package/dist/react-modal-app-element.js +9 -0
  268. package/dist/react-modal-app-element.js.map +1 -0
  269. package/dist/store/actions.d.ts.map +1 -1
  270. package/dist/store/actions.js +6 -1
  271. package/dist/store/actions.js.map +1 -1
  272. package/dist/store/reducers.d.ts +75 -6
  273. package/dist/store/reducers.d.ts.map +1 -1
  274. package/dist/store/selectors.d.ts +75 -17
  275. package/dist/store/selectors.d.ts.map +1 -1
  276. package/dist/store/selectors.js +9 -1
  277. package/dist/store/selectors.js.map +1 -1
  278. package/dist/types.d.ts +21 -5
  279. package/dist/types.d.ts.map +1 -1
  280. package/package.json +24 -8
  281. package/src/scss/blocks/_features-sorting.scss +0 -13
  282. package/src/scss/blocks/_filter-button.scss +39 -8
  283. package/src/scss/blocks/_filter-toggle-control.scss +15 -0
  284. package/src/scss/default.scss +1 -0
  285. package/src/scss/themes/2022-03.scss +66 -0
  286. package/src/img/mapsight-ui/check-empty.svg +0 -1
  287. package/src/img/mapsight-ui/check.svg +0 -2
  288. package/src/img/mapsight-ui/close-list.svg +0 -1
  289. package/src/img/mapsight-ui/close.svg +0 -1
  290. package/src/img/mapsight-ui/error.svg +0 -1
  291. package/src/img/mapsight-ui/fullscreen-close.svg +0 -1
  292. package/src/img/mapsight-ui/fullscreen.svg +0 -1
  293. package/src/img/mapsight-ui/geo-active.svg +0 -1
  294. package/src/img/mapsight-ui/geo-error.svg +0 -1
  295. package/src/img/mapsight-ui/geo-inactive.svg +0 -1
  296. package/src/img/mapsight-ui/info.svg +0 -1
  297. package/src/img/mapsight-ui/layers.svg +0 -1
  298. package/src/img/mapsight-ui/loading.svg +0 -1
  299. package/src/img/mapsight-ui/map.svg +0 -1
  300. package/src/img/mapsight-ui/measure-distance.svg +0 -7
  301. package/src/img/mapsight-ui/open-list.svg +0 -1
  302. package/src/img/mapsight-ui/place-marker.svg +0 -4
  303. package/src/img/mapsight-ui/print.svg +0 -4
  304. package/src/img/mapsight-ui/reset-active.svg +0 -1
  305. package/src/img/mapsight-ui/reset.svg +0 -1
  306. package/src/img/mapsight-ui/search.svg +0 -1
  307. package/src/img/mapsight-ui/sharing.svg +0 -7
  308. package/src/img/mapsight-ui/sort-active.svg +0 -1
  309. package/src/img/mapsight-ui/sort.svg +0 -1
  310. package/src/img/mapsight-ui/watermark.svg +0 -1
  311. package/src/img/mapsight-ui/zoom-in.svg +0 -3
  312. package/src/img/mapsight-ui/zoom-out.svg +0 -3
  313. package/src/js/components/app.tsx +0 -232
  314. package/src/js/components/close-overlay-button.tsx +0 -27
  315. package/src/js/components/feature-details-content/feature-details-content-inner.tsx +0 -116
  316. package/src/js/components/feature-details-content/feature-details-content.jsx +0 -185
  317. package/src/js/components/feature-details-content/index.js +0 -16
  318. package/src/js/components/feature-details-content/share-feature-link-modal.jsx +0 -56
  319. package/src/js/components/feature-list/content.jsx +0 -42
  320. package/src/js/components/feature-list/context.tsx +0 -47
  321. package/src/js/components/feature-list/empty-message.jsx +0 -15
  322. package/src/js/components/feature-list/filter.jsx +0 -35
  323. package/src/js/components/feature-list/footer.jsx +0 -5
  324. package/src/js/components/feature-list/grouped-content.jsx +0 -74
  325. package/src/js/components/feature-list/header.jsx +0 -7
  326. package/src/js/components/feature-list/hooks/useAutoloadFeatureSource.ts +0 -25
  327. package/src/js/components/feature-list/hooks/useFeatureListFeatureSource.ts +0 -22
  328. package/src/js/components/feature-list/hooks/useFeatureListItemGroups.ts +0 -127
  329. package/src/js/components/feature-list/hooks/useFeatureListState.ts +0 -98
  330. package/src/js/components/feature-list/hooks/useKeyboardNavigation.js +0 -112
  331. package/src/js/components/feature-list/hooks/useMakeHeaderSticky.js +0 -40
  332. package/src/js/components/feature-list/hooks/usePaginatedFilteredFeatures.ts +0 -129
  333. package/src/js/components/feature-list/hooks/useRestoreDocumentScroll.js +0 -12
  334. package/src/js/components/feature-list/hooks/useSelectFeature.js +0 -88
  335. package/src/js/components/feature-list/index.jsx +0 -278
  336. package/src/js/components/feature-list/pagination.tsx +0 -57
  337. package/src/js/components/feature-list/query-input.jsx +0 -14
  338. package/src/js/components/feature-list-cycling/button.jsx +0 -13
  339. package/src/js/components/feature-list-cycling/dot.jsx +0 -43
  340. package/src/js/components/feature-list-cycling/feature-list-cycling.jsx +0 -153
  341. package/src/js/components/feature-list-cycling/index.js +0 -82
  342. package/src/js/components/feature-list-item/head.jsx +0 -131
  343. package/src/js/components/feature-list-item/hooks/useFeatureListItemScrollAndFocus.js +0 -51
  344. package/src/js/components/feature-list-item/hooks/useFeatureListItemState.ts +0 -75
  345. package/src/js/components/feature-list-item/icon.jsx +0 -35
  346. package/src/js/components/feature-list-item/index.jsx +0 -168
  347. package/src/js/components/feature-list-sorting/feature-list-sorting.tsx +0 -144
  348. package/src/js/components/feature-list-sorting/index.js +0 -22
  349. package/src/js/components/feature-list-sorting/status-indicator.jsx +0 -10
  350. package/src/js/components/feature-select-button.jsx +0 -70
  351. package/src/js/components/feature-selection-info/close-button.jsx +0 -64
  352. package/src/js/components/feature-selection-info/container.jsx +0 -9
  353. package/src/js/components/feature-selection-info/header.tsx +0 -27
  354. package/src/js/components/feature-selection-info/index.tsx +0 -81
  355. package/src/js/components/feature-selection-info/with-sticky-header.tsx +0 -76
  356. package/src/js/components/feature-selection-info/without-sticky-header.jsx +0 -19
  357. package/src/js/components/feature-selection-info/wrapper.jsx +0 -43
  358. package/src/js/components/helping/app-channel.tsx +0 -99
  359. package/src/js/components/helping/app-context.tsx +0 -32
  360. package/src/js/components/helping/visibility-wrapper.jsx +0 -23
  361. package/src/js/components/instance.tsx +0 -48
  362. package/src/js/components/layer-switcher/GroupedLayerSwitcher.js +0 -47
  363. package/src/js/components/layer-switcher/LayerSwitcher.ts +0 -34
  364. package/src/js/components/layer-switcher/LayerSwitcherContainer.tsx +0 -88
  365. package/src/js/components/layer-switcher/LayerSwitcherEntry.ts +0 -152
  366. package/src/js/components/layer-switcher/index.ts +0 -42
  367. package/src/js/components/layout/additional-container/content.jsx +0 -10
  368. package/src/js/components/layout/additional-container/index.jsx +0 -5
  369. package/src/js/components/layout/additional-container/marginal.jsx +0 -10
  370. package/src/js/components/layout/main-container.jsx +0 -5
  371. package/src/js/components/layout/map-row.jsx +0 -5
  372. package/src/js/components/layout/title-bar.tsx +0 -25
  373. package/src/js/components/layout/wrapper.jsx +0 -28
  374. package/src/js/components/link-share.jsx +0 -78
  375. package/src/js/components/main-panel/container.tsx +0 -23
  376. package/src/js/components/main-panel/context.tsx +0 -71
  377. package/src/js/components/main-panel/index.tsx +0 -46
  378. package/src/js/components/main-panel/list-toggle-button.jsx +0 -43
  379. package/src/js/components/map-overlay/area.jsx +0 -17
  380. package/src/js/components/map-overlay/attribution-entries.tsx +0 -33
  381. package/src/js/components/map-overlay/attribution.tsx +0 -25
  382. package/src/js/components/map-overlay/combined-buttons.jsx +0 -5
  383. package/src/js/components/map-overlay/index.jsx +0 -5
  384. package/src/js/components/map-overlay/info-overlay-left.jsx +0 -51
  385. package/src/js/components/map-overlay/info-overlay-modal.tsx +0 -49
  386. package/src/js/components/map-overlay/info-overlay-right.jsx +0 -46
  387. package/src/js/components/map-overlay/layer-switcher-overlay.tsx +0 -100
  388. package/src/js/components/map-overlay/legend.tsx +0 -22
  389. package/src/js/components/map-overlay/logo.jsx +0 -11
  390. package/src/js/components/map-overlay/measure-distance-button.tsx +0 -116
  391. package/src/js/components/map-overlay/measure-distance-overlay.jsx +0 -56
  392. package/src/js/components/map-overlay/mini-legend.jsx +0 -103
  393. package/src/js/components/map-overlay/region-selector.jsx +0 -63
  394. package/src/js/components/map-overlay/search-overlay.jsx +0 -79
  395. package/src/js/components/map-overlay/share-position-link-button.tsx +0 -144
  396. package/src/js/components/map-overlay/tool-overlay.tsx +0 -28
  397. package/src/js/components/map-overlay/user-geo-location-button.jsx +0 -89
  398. package/src/js/components/map-overlay/zoom-button.jsx +0 -98
  399. package/src/js/components/map-overlay/zoom-buttons.jsx +0 -26
  400. package/src/js/components/map-synced-interlay/index.ts +0 -15
  401. package/src/js/components/map-synced-interlay/map-synced-interlay.jsx +0 -22
  402. package/src/js/components/map-synced-interlay/tooltip-content.tsx +0 -22
  403. package/src/js/components/map-synced-interlay/tooltip.tsx +0 -199
  404. package/src/js/components/map-wrapper.tsx +0 -65
  405. package/src/js/components/map.tsx +0 -55
  406. package/src/js/components/modal.tsx +0 -40
  407. package/src/js/components/query-input-with-label.tsx +0 -71
  408. package/src/js/components/query-input.tsx +0 -81
  409. package/src/js/components/search/index.jsx +0 -83
  410. package/src/js/components/search/query-input.jsx +0 -20
  411. package/src/js/components/search/result-entry.jsx +0 -63
  412. package/src/js/components/search/result.jsx +0 -71
  413. package/src/js/components/switcher/GroupedSwitcher.jsx +0 -42
  414. package/src/js/components/switcher/Switcher.jsx +0 -54
  415. package/src/js/components/switcher/SwitcherButton.jsx +0 -23
  416. package/src/js/components/switcher/SwitcherEntry.tsx +0 -164
  417. package/src/js/components/switcher/SwitcherHeader.jsx +0 -58
  418. package/src/js/components/switcher/SwitcherStatusIcon.jsx +0 -36
  419. package/src/js/components/tag-switcher/TagSwitcher.tsx +0 -56
  420. package/src/js/components/tag-switcher/createTagSwitcherEntry.ts +0 -39
  421. package/src/js/components/tag-switcher/createTagSwitcherHeader.ts +0 -47
  422. package/src/js/components/tag-switcher/index.ts +0 -17
  423. package/src/js/components/time-filter.jsx +0 -187
  424. package/src/js/components/view-toggle-button/desktop-button.jsx +0 -13
  425. package/src/js/components/view-toggle-button/index.ts +0 -42
  426. package/src/js/components/view-toggle-button/mobile-button.tsx +0 -13
  427. package/src/js/components/view-toggle-button/view-toggle-button.jsx +0 -74
  428. package/src/js/components/view-toggle-button/viewport-button.tsx +0 -13
  429. package/src/js/config/constants/app.ts +0 -16
  430. package/src/js/config/constants/controllers.ts +0 -11
  431. package/src/js/config/feature/selections.ts +0 -13
  432. package/src/js/config/feature/sources.ts +0 -77
  433. package/src/js/config/index.ts +0 -133
  434. package/src/js/config/map/featureInteractions.ts +0 -53
  435. package/src/js/config/map/interactions.ts +0 -15
  436. package/src/js/config/map/layers.ts +0 -190
  437. package/src/js/controllers/defaults.ts +0 -36
  438. package/src/js/embed/browser.ts +0 -89
  439. package/src/js/embed/node.ts +0 -57
  440. package/src/js/filters/tag-filter.ts +0 -135
  441. package/src/js/filters/time-filter.ts +0 -53
  442. package/src/js/helpers/components.ts +0 -66
  443. package/src/js/helpers/create-action-watcher.ts +0 -35
  444. package/src/js/helpers/events.ts +0 -11
  445. package/src/js/helpers/get-feature-property.ts +0 -14
  446. package/src/js/helpers/i18n/de.ts +0 -145
  447. package/src/js/helpers/i18n/en.ts +0 -140
  448. package/src/js/helpers/i18n/index.ts +0 -41
  449. package/src/js/helpers/makeReplaceableComponent.ts +0 -0
  450. package/src/js/helpers/mod-classes.ts +0 -47
  451. package/src/js/helpers/react.ts +0 -14
  452. package/src/js/helpers/scroll-to-element-top.ts +0 -16
  453. package/src/js/helpers/sort-features-by-distance.ts +0 -102
  454. package/src/js/helpers/sticky.js +0 -143
  455. package/src/js/hooks/useCallbackRef.ts +0 -14
  456. package/src/js/hooks/useControllableState.ts +0 -50
  457. package/src/js/hooks/useDebounce.ts +0 -32
  458. package/src/js/hooks/useHandleEscapeKeyDown.ts +0 -27
  459. package/src/js/hooks/useMapsightPanel.ts +0 -40
  460. package/src/js/hooks/useMountable.ts +0 -47
  461. package/src/js/hooks/usePrevious.ts +0 -15
  462. package/src/js/hooks/useStickyHeader.ts +0 -50
  463. package/src/js/hooks/useUpdateMapSizeCallback.ts +0 -32
  464. package/src/js/hooks/useUpdateMapSizeOnRender.ts +0 -16
  465. package/src/js/hooks/useUpdateMapSizeOnTransitionEnd.ts +0 -40
  466. package/src/js/hooks/useUpdateMapSizeOnViewChange.ts +0 -36
  467. package/src/js/index.ts +0 -320
  468. package/src/js/plugins/browser/app-title.ts +0 -36
  469. package/src/js/plugins/browser/debug.ts +0 -37
  470. package/src/js/plugins/browser/feature-deep-link.ts +0 -223
  471. package/src/js/plugins/browser/local-storage.ts +0 -79
  472. package/src/js/plugins/browser/native-fullscreen.ts +0 -81
  473. package/src/js/plugins/browser/no-scroll.ts +0 -91
  474. package/src/js/plugins/browser/partial-content-changed-event.ts +0 -23
  475. package/src/js/plugins/browser/piwik-track-feature-selection-event.ts +0 -75
  476. package/src/js/plugins/browser/piwik-track-fullscreen-toggle-event.ts +0 -46
  477. package/src/js/plugins/browser/search.ts +0 -42
  478. package/src/js/plugins/browser/share-position-link.ts +0 -463
  479. package/src/js/plugins/browser/toggle-mobile-views.ts +0 -60
  480. package/src/js/plugins/browser/user-geolocation.ts +0 -142
  481. package/src/js/plugins/browser/views.ts +0 -141
  482. package/src/js/plugins/browser-defaults.ts +0 -101
  483. package/src/js/plugins/common/feature-selection-details-url.ts +0 -135
  484. package/src/js/plugins/common/lang.ts +0 -17
  485. package/src/js/plugins/common/measure-distance.ts +0 -223
  486. package/src/js/plugins/common/ol-proxy.ts +0 -68
  487. package/src/js/plugins/common/render-await-feature-details-loaded.ts +0 -154
  488. package/src/js/plugins/common/render-await-list-feature-sources-loaded.ts +0 -109
  489. package/src/js/plugins/server/feature-deep-link.ts +0 -67
  490. package/src/js/plugins/server-defaults.ts +0 -36
  491. package/src/js/renderer/browser-dom.tsx +0 -27
  492. package/src/js/renderer/server-string.tsx +0 -17
  493. package/src/js/server-handler.js +0 -39
  494. package/src/js/store/actions.ts +0 -662
  495. package/src/js/store/reducers.ts +0 -491
  496. package/src/js/store/selectors.ts +0 -483
  497. package/src/js/types.ts +0 -405
@@ -1,662 +0,0 @@
1
- // TODO: Replace with generic tracking solution that does not rely on simplejs to be used globally
2
- import {easeOut} from "ol/easing";
3
- import type {Extent} from "ol/extent";
4
-
5
- import {batchActions} from "redux-batched-actions";
6
-
7
- import {mergeAll} from "@mapsight/core/lib/base/actions";
8
- import {deselectAll} from "@mapsight/core/lib/feature-selections/actions";
9
- import {animate as animateMap} from "@mapsight/core/lib/map/actions";
10
- import type {ActionOrThunk, State, ThunkAction} from "@mapsight/core/types";
11
-
12
- import {trackSiteSearch} from "@mapsight/lib-js/misc/piwik";
13
- import updateQueryStringParameter from "@mapsight/lib-js/string/update-query-string-parameter";
14
-
15
- import {siteConfig} from "../config";
16
- import type {View} from "../config/constants/app";
17
- import {DETAILS_CONTENT_STATE_KEY} from "../config/constants/app";
18
- import * as c from "../config/constants/controllers";
19
- import {
20
- FEATURE_SELECTION_HIGHLIGHT,
21
- FEATURE_SELECTION_PRESELECT,
22
- FEATURE_SELECTION_SELECT,
23
- } from "../config/feature/selections";
24
- import type {
25
- FetchTextState,
26
- FullUiState,
27
- MapsightUiFeatureId,
28
- UiState,
29
- } from "../types";
30
- import type {RootStateSlice} from "./selectors";
31
- import {featureDetailsUrlSelector, regionsSelector} from "./selectors";
32
-
33
- function ensureFullUrl(url: string) {
34
- let requestUrl = url.trim();
35
- if (typeof window === "undefined" && requestUrl.startsWith("/")) {
36
- requestUrl = siteConfig.baseUrl.replace(/\/*$/, "") + requestUrl;
37
- }
38
- return requestUrl;
39
- }
40
-
41
- export function resetMapsightCore(config: Partial<State>) {
42
- return batchActions([
43
- deselectAll(c.FEATURE_SELECTIONS, FEATURE_SELECTION_HIGHLIGHT),
44
- deselectAll(c.FEATURE_SELECTIONS, FEATURE_SELECTION_PRESELECT),
45
- deselectAll(c.FEATURE_SELECTIONS, FEATURE_SELECTION_SELECT),
46
- mergeAll(config),
47
- ]);
48
- }
49
-
50
- export const SET_VIEW = "SET_VIEW";
51
-
52
- export function setView(value: View) {
53
- return {
54
- type: SET_VIEW,
55
- value: value,
56
- };
57
- }
58
-
59
- export const SET_LIST_VISIBLE = "SET_LIST_VISIBLE";
60
-
61
- export function setListVisible(value: boolean) {
62
- return {
63
- type: SET_LIST_VISIBLE,
64
- value: value,
65
- };
66
- }
67
-
68
- export const SET_USER_PREFERENCE_LIST_VISIBLE = "SET_LIST_IS_VISIBLE";
69
-
70
- // Das setzt die User-Preferenz für die Listenspalte in Fullscreen
71
- // es gibt noch state[FEATURE_LIST][visible], die die Sicherbarkeit der Liste an sich steuert
72
- export function setListPreferVisible(value: boolean) {
73
- return {
74
- type: SET_USER_PREFERENCE_LIST_VISIBLE,
75
- value: value,
76
- };
77
- }
78
-
79
- export const SET_LIST_SCROLL_ON_PRESELECTION =
80
- "SET_LIST_SCROLL_ON_PRESELECTION";
81
-
82
- export function setListScrollOnPreselection(value: boolean) {
83
- return {
84
- type: SET_LIST_SCROLL_ON_PRESELECTION,
85
- value: value,
86
- };
87
- }
88
-
89
- export const SET_LIST_SELECTION_BEHAVIOR = "SET_LIST_SELECTION_BEHAVIOR";
90
-
91
- export function setListSelectionBehavior(
92
- value: Partial<FullUiState["list"]["selectionBehavior"]>,
93
- ) {
94
- return {
95
- type: SET_LIST_SELECTION_BEHAVIOR,
96
- value: value,
97
- };
98
- }
99
-
100
- export const SET_LIST_SELECTION_BEHAVIOR_SELECTION =
101
- "SET_LIST_SELECTION_BEHAVIOR_SELECTION";
102
-
103
- export function setListSelectionBehaviorSelection(
104
- value: FullUiState["list"]["selectionBehaviorSelection"],
105
- ) {
106
- return {
107
- type: SET_LIST_SELECTION_BEHAVIOR_SELECTION,
108
- value: value,
109
- };
110
- }
111
-
112
- export const SET_LIST_SELECT_ON_CLICK = "SET_LIST_SELECT_ON_CLICK";
113
-
114
- export function setListSelectOnClick(value: boolean) {
115
- return {
116
- type: SET_LIST_SELECT_ON_CLICK,
117
- value: value,
118
- };
119
- }
120
-
121
- export const SET_LIST_HIGHLIGHT_ON_MOUSE = "SET_LIST_HIGHLIGHT_ON_MOUSE";
122
-
123
- export function setListHighlightOnMouse(value: boolean) {
124
- return {
125
- type: SET_LIST_HIGHLIGHT_ON_MOUSE,
126
- value: value,
127
- };
128
- }
129
-
130
- export const SET_LIST_INTEGRATED = "SET_LIST_INTEGRATED";
131
-
132
- export function setListIntregrated(integratedList: boolean) {
133
- return {
134
- type: SET_LIST_INTEGRATED,
135
- value: integratedList,
136
- };
137
- }
138
-
139
- export const SET_LIST_FILTER_CONTROL = "SET_LIST_FILTER_CONTROL";
140
-
141
- export function setListFilterControl(showFilterControl: boolean) {
142
- return {
143
- type: SET_LIST_FILTER_CONTROL,
144
- value: showFilterControl,
145
- };
146
- }
147
-
148
- export const SET_LIST_SORT_CONTROL = "SET_LIST_SORT_CONTROL";
149
-
150
- export function setListSortControl(showSortControl: boolean) {
151
- return {
152
- type: SET_LIST_SORT_CONTROL,
153
- value: showSortControl,
154
- };
155
- }
156
-
157
- export const SET_LIST_CYCLING_CONTROL = "SET_LIST_CYCLING_CONTROL";
158
-
159
- export function setListCyclingControl(showCyclingControl: boolean) {
160
- return {
161
- type: SET_LIST_CYCLING_CONTROL,
162
- value: showCyclingControl,
163
- };
164
- }
165
-
166
- export const SET_TIME_FILTER_VISIBLE = "SET_TIME_FILTER_VISIBLE";
167
-
168
- export function setTimeFilterVisible(value: boolean) {
169
- return {
170
- type: SET_TIME_FILTER_VISIBLE,
171
- value: value,
172
- };
173
- }
174
-
175
- export const SET_TAG_FILTER_CONTROL = "SET_TAG_FILTER_CONTROL";
176
-
177
- export function setTagFilterControl(
178
- show: boolean,
179
- featureSourcesControllerName: string,
180
- featureSourceId: string,
181
- tagSwitcherOptions?: Omit<
182
- Partial<FullUiState["tagSwitcher"]>,
183
- "show" | "featureSourcesControllerName" | "featureSourceId"
184
- >,
185
- ) {
186
- return {
187
- type: SET_TAG_FILTER_CONTROL,
188
- show: show,
189
- featureSourcesControllerName: featureSourcesControllerName,
190
- featureSourceId: featureSourceId,
191
- tagSwitcherOptions: tagSwitcherOptions,
192
- };
193
- }
194
-
195
- export const SET_LIST_PAGINATION_CONTROL = "SET_LIST_PAGINATION_CONTROL";
196
-
197
- export function setListPaginationControl(show: boolean) {
198
- return {
199
- type: SET_LIST_PAGINATION_CONTROL,
200
- value: show,
201
- };
202
- }
203
-
204
- export const SET_MAP_VISIBLE = "SET_MAP_VISIBLE";
205
-
206
- export function setMapVisible(value: boolean) {
207
- return {
208
- type: SET_MAP_VISIBLE,
209
- value: value,
210
- };
211
- }
212
-
213
- export const SET_MAP_IS_OUT_OF_VIEWPORT = "SET_MAP_IS_OUT_OF_VIEWPORT";
214
-
215
- export function setMapIsOutOfViewport(value: boolean) {
216
- return {
217
- type: SET_MAP_IS_OUT_OF_VIEWPORT,
218
- value: value,
219
- };
220
- }
221
-
222
- export const TOGGLE_USER_PREFERENCE_LIST_VISIBLE = "TOGGLE_LIST_IS_VISIBLE";
223
-
224
- export function toggleUserPreferenceListVisible() {
225
- return {type: TOGGLE_USER_PREFERENCE_LIST_VISIBLE};
226
- }
227
-
228
- export const SET_PAGE_TITLE_SHOW = "SET_PAGE_TITLE_SHOW";
229
-
230
- export function setPageTitleShow(value: boolean) {
231
- return {
232
- type: SET_PAGE_TITLE_SHOW,
233
- value: value,
234
- };
235
- }
236
-
237
- export const SET_APP_TITLE = "SET_APP_TITLE";
238
-
239
- export function setAppTitle(value: FullUiState["title"]) {
240
- return {
241
- type: SET_APP_TITLE,
242
- value: value,
243
- };
244
- }
245
-
246
- export const SET_META_TAGS = "SET_META_TAGS";
247
-
248
- export function setMetaTags(value: FullUiState["metaTags"]) {
249
- return {
250
- type: SET_META_TAGS,
251
- value: value,
252
- };
253
- }
254
-
255
- export const SET_MINI_LEGEND_LAYER = "SET_MINI_LEGEND_LAYER";
256
-
257
- export function setMiniLegendLayer(layerId: string | null) {
258
- return {
259
- type: SET_MINI_LEGEND_LAYER,
260
- value: layerId,
261
- };
262
- }
263
-
264
- export const SET_VIEW_BREAKPOINTS = "SET_VIEW_BREAKPOI";
265
-
266
- export function setViewBreakpoints(value: FullUiState["viewBreakpoints"]) {
267
- return {
268
- type: SET_VIEW_BREAKPOINTS,
269
- value: value,
270
- };
271
- }
272
-
273
- export const SET_LAST_LIST_SCROLL_POSITION = "SET_LAST_LIST_SCROLL_POSITION";
274
-
275
- export function setLastListScrollPosition(
276
- scrollPosition: FullUiState["lastListScrollPosition"],
277
- ) {
278
- return {
279
- type: SET_LAST_LIST_SCROLL_POSITION,
280
- value: scrollPosition,
281
- };
282
- }
283
-
284
- export const FILTER_LIST_QUERY = "FILTER_LIST_QUERY";
285
-
286
- export function filterListQuery(query: string | null): ThunkAction {
287
- return function (dispatch) {
288
- dispatch({
289
- type: FILTER_LIST_QUERY,
290
- query: query || "",
291
- });
292
-
293
- if (query) {
294
- trackSiteSearch(query, "FilterList");
295
- }
296
- };
297
- }
298
-
299
- export const SORT_LIST = "SORT_LIST";
300
-
301
- export function sortList(sorting: FullUiState["listSorting"]) {
302
- return {
303
- type: SORT_LIST,
304
- sorting: sorting,
305
- };
306
- }
307
-
308
- export const SET_LIST_ITEMS_PER_PAGE = "SET_LIST_ITEMS_PER_PAGE";
309
-
310
- export function setListItemsPerPage(
311
- itemsPerPage: FullUiState["list"]["itemsPerPage"],
312
- ) {
313
- return {
314
- type: SET_LIST_ITEMS_PER_PAGE,
315
- value: itemsPerPage,
316
- };
317
- }
318
-
319
- export const LIST_PAGE_SET = "LIST_PAGE_SET";
320
-
321
- export function setListPage(page: FullUiState["listPage"]) {
322
- return {
323
- type: LIST_PAGE_SET,
324
- page: page,
325
- };
326
- }
327
-
328
- export function resetListPage() {
329
- return {
330
- type: LIST_PAGE_SET,
331
- page: 0,
332
- };
333
- }
334
-
335
- export const LIST_PAGE_NEXT = "LIST_PAGE_NEXT";
336
-
337
- export function nextListPage() {
338
- return {type: LIST_PAGE_NEXT};
339
- }
340
-
341
- export const LIST_PAGE_PREVIOUS = "LIST_PAGE_PREVIOUS";
342
-
343
- export function previousListPage() {
344
- return {type: LIST_PAGE_PREVIOUS};
345
- }
346
-
347
- export const FETCH_TEXT_REQUEST = "FETCH_TEXT_REQUEST";
348
- export const FETCH_TEXT_FAILURE = "FETCH_TEXT_FAILURE";
349
- export const FETCH_TEXT_SUCCESS = "FETCH_TEXT_SUCCESS";
350
- export const FETCH_TEXT_RESET = "FETCH_TEXT_RESET";
351
-
352
- export function fetchTextRequest(key: string, url: string) {
353
- return {
354
- type: FETCH_TEXT_REQUEST,
355
- key: key,
356
- url: url,
357
- };
358
- }
359
-
360
- export function fetchTextFailure(key: string, error: unknown) {
361
- return {
362
- type: FETCH_TEXT_FAILURE,
363
- key: key,
364
- error: error,
365
- };
366
- }
367
-
368
- export function fetchTextSuccess(key: string, data: unknown) {
369
- return {
370
- type: FETCH_TEXT_SUCCESS,
371
- key: key,
372
- data: data,
373
- };
374
- }
375
-
376
- export type FETCH_TEXT_STATUS =
377
- | typeof FETCH_TEXT_STATUS_LOADING
378
- | typeof FETCH_TEXT_STATUS_ERROR
379
- | typeof FETCH_TEXT_STATUS_SUCCESS;
380
-
381
- export const FETCH_TEXT_STATUS_LOADING = "loading";
382
- export const FETCH_TEXT_STATUS_ERROR = "error";
383
- export const FETCH_TEXT_STATUS_SUCCESS = "success";
384
-
385
- export function fetchText(key: string, url: string): ThunkAction {
386
- return function (dispatch, getState: () => RootStateSlice) {
387
- const selectState = () => (getState().app[key] as FetchTextState) || {};
388
-
389
- // do not fetch again if already running
390
- const state = selectState();
391
- if (state.url === url && state.status === FETCH_TEXT_STATUS_LOADING) {
392
- return;
393
- }
394
-
395
- dispatch(fetchTextRequest(key, url));
396
-
397
- // TODO: Fix this magic!
398
- const requestUrl = ensureFullUrl(url);
399
-
400
- // Do not use catch, because that will also catch
401
- // any errors in the dispatch and resulting render,
402
- // causing a loop of 'Unexpected batch number' errors.
403
- // https://github.com/facebook/react/issues/6895
404
- fetch(requestUrl)
405
- .then(
406
- (response) => response.text(),
407
- (error) => {
408
- // discard response if url changed
409
- if (selectState().url !== url) {
410
- return Promise.reject();
411
- }
412
-
413
- dispatch(fetchTextFailure(key, error));
414
-
415
- return Promise.reject();
416
- },
417
- )
418
- .then((data) => {
419
- // discard response if url changed
420
- if (selectState().url !== url) {
421
- return;
422
- }
423
-
424
- dispatch(fetchTextSuccess(key, data));
425
- })
426
- .catch((error) => {
427
- console.error(error);
428
- dispatch(fetchTextFailure(key, error));
429
- });
430
- };
431
- }
432
-
433
- export function fetchTextReset(key: string) {
434
- return {
435
- type: FETCH_TEXT_RESET,
436
- key: key,
437
- };
438
- }
439
-
440
- export const FETCH_JSON_REQUEST = "FETCH_JSON_REQUEST";
441
- export const FETCH_JSON_FAILURE = "FETCH_JSON_FAILURE";
442
- export const FETCH_JSON_SUCCESS = "FETCH_JSON_SUCCESS";
443
- export const FETCH_JSON_RESET = "FETCH_JSON_RESET";
444
-
445
- export function fetchJsonRequest(key: string, url: string) {
446
- return {
447
- type: FETCH_JSON_REQUEST,
448
- key: key,
449
- url: url,
450
- };
451
- }
452
-
453
- export function fetchJsonFailure(key: string, error: unknown) {
454
- return {
455
- type: FETCH_JSON_FAILURE,
456
- key: key,
457
- error: error,
458
- };
459
- }
460
-
461
- export function fetchJsonSuccess(key: string, data: unknown) {
462
- return {
463
- type: FETCH_JSON_SUCCESS,
464
- key: key,
465
- data: data,
466
- };
467
- }
468
-
469
- export function fetchJsonReset(key: string) {
470
- return {
471
- type: FETCH_JSON_RESET,
472
- key: key,
473
- };
474
- }
475
-
476
- export type FETCH_JSON_STATUS =
477
- | typeof FETCH_JSON_STATUS_LOADING
478
- | typeof FETCH_JSON_STATUS_ERROR
479
- | typeof FETCH_JSON_STATUS_SUCCESS;
480
-
481
- export const FETCH_JSON_STATUS_LOADING = "loading";
482
- export const FETCH_JSON_STATUS_ERROR = "error";
483
- export const FETCH_JSON_STATUS_SUCCESS = "success";
484
-
485
- export function fetchJson(key: string, url: string = key): ThunkAction {
486
- return (dispatch, getState) => {
487
- // do not fetch again if already running
488
- {
489
- const appState = getState().app as UiState;
490
- if (
491
- appState[key]?.url === url &&
492
- appState[key].status === FETCH_JSON_STATUS_LOADING
493
- ) {
494
- return;
495
- }
496
- }
497
-
498
- dispatch(fetchJsonRequest(key, url));
499
-
500
- const requestUrl = ensureFullUrl(url);
501
-
502
- // Do not use catch, because that will also catch
503
- // any errors in the dispatch and resulting render,
504
- // causing a loop of 'Unexpected batch number' errors.
505
- // https://github.com/facebook/react/issues/6895
506
- fetch(requestUrl)
507
- .then(
508
- (response) => response.text(),
509
- (error) => {
510
- // discard response if url changed
511
- const state = (getState().app as UiState)[key];
512
- if (state && state.url !== url) {
513
- return Promise.reject();
514
- }
515
-
516
- dispatch(fetchJsonFailure(key, error));
517
-
518
- return Promise.reject();
519
- },
520
- )
521
- .then((data) => {
522
- // discard response if url changed
523
- const state = (getState().app as UiState)[key];
524
- if (state && state.url !== url) {
525
- return;
526
- }
527
-
528
- try {
529
- const json = JSON.parse(data);
530
- dispatch(fetchJsonSuccess(key, json));
531
- } catch (error) {
532
- dispatch(fetchJsonFailure(key, error));
533
- }
534
- })
535
- .catch((error) => {
536
- console.error(error);
537
- dispatch(fetchJsonFailure(key, error));
538
- });
539
- };
540
- }
541
-
542
- export const SEARCH = "SEARCH";
543
-
544
- export const search = (query: string | null): ActionOrThunk =>
545
- query
546
- ? (dispatch) => {
547
- trackSiteSearch(query, "MapsightToolbarSearch"); // historical keyword (search was in a toolbar once)
548
-
549
- const searchRequestUrl = updateQueryStringParameter(
550
- siteConfig.searchUrl,
551
- siteConfig.searchQueryParameter,
552
- query,
553
- ); // FIXME Paul, is it ok, that query now gets transformed by encodeURI?
554
- dispatch({type: SEARCH, query: query});
555
- dispatch(fetchJson("searchResult", searchRequestUrl));
556
- }
557
- : {type: SEARCH, query: ""};
558
-
559
- export const SELECT_SEARCH_RESULT = "SELECT_SEARCH_RESULT";
560
-
561
- export const selectSearchResult = (feature: MapsightUiFeatureId) => ({
562
- type: SELECT_SEARCH_RESULT,
563
- feature: feature,
564
- });
565
-
566
- export const setFeatureDetailsUrl =
567
- (detailsUrl: string): ThunkAction =>
568
- (dispatch, getState: () => RootStateSlice) => {
569
- const currentUrl = featureDetailsUrlSelector(getState());
570
- if (currentUrl !== detailsUrl) {
571
- if (detailsUrl) {
572
- dispatch(fetchText(DETAILS_CONTENT_STATE_KEY, detailsUrl));
573
- } else {
574
- dispatch(fetchTextReset(DETAILS_CONTENT_STATE_KEY));
575
- }
576
- }
577
- };
578
-
579
- export const SET_TAG_VISIBLE = "SET_TAG_VISIBLE";
580
-
581
- export const setTagVisible = (
582
- featureSourceId: string,
583
- tagGroup: string,
584
- tag: string,
585
- visible: boolean,
586
- ) => ({
587
- type: SET_TAG_VISIBLE,
588
- featureSourceId: featureSourceId,
589
- tagGroup: tagGroup,
590
- tag: tag,
591
- visible: visible,
592
- });
593
-
594
- export const SET_TAG_GROUP_VISIBLE = "SET_TAG_GROUP_VISIBLE";
595
-
596
- export const setTagGroupVisible = (
597
- featureSourceId: string,
598
- tagGroup: string,
599
- visible: boolean,
600
- ) => ({
601
- type: SET_TAG_GROUP_VISIBLE,
602
- featureSourceId: featureSourceId,
603
- tagGroup: tagGroup,
604
- visible: visible,
605
- });
606
-
607
- export const HIDE_TAG_AND_TAG_GROUP = "HIDE_TAG_AND_TAG_GROUP";
608
-
609
- export const hideTagAndTagGroup = () => ({
610
- type: HIDE_TAG_AND_TAG_GROUP,
611
- });
612
-
613
- export const SET_OVERLAY_MODAL_VISIBLE = "SET_OVERLAY_MODAL_VISIBLE";
614
-
615
- export function setOverlayModalVisible(visible: boolean) {
616
- return {
617
- type: SET_OVERLAY_MODAL_VISIBLE,
618
- visible: visible,
619
- };
620
- }
621
-
622
- export const SET_SELECTED_REGION_ID = "MS_APP_SET_SELECTED_REGION_ID";
623
-
624
- export function setSelectedRegionId(regionId: string | null) {
625
- return {
626
- type: SET_SELECTED_REGION_ID,
627
- payload: regionId,
628
- };
629
- }
630
-
631
- export function setSelectedRegionIdAndAnimateMap(
632
- regionId: string | null,
633
- ): ActionOrThunk {
634
- if (regionId === null) {
635
- return setSelectedRegionId(regionId);
636
- }
637
-
638
- return (dispatch, getState: () => RootStateSlice) => {
639
- dispatch(setSelectedRegionId(regionId));
640
-
641
- // TODO: use `selectedRegionSelector`, not sure if it's safe to rely on the state
642
- // change here
643
- const regions = regionsSelector(getState());
644
-
645
- if (
646
- regions &&
647
- typeof regions === "object" &&
648
- typeof regions[regionId] === "object" &&
649
- Array.isArray(regions[regionId].bounds) &&
650
- regions[regionId].bounds.length === 4
651
- ) {
652
- dispatch(
653
- animateMap("map", {
654
- nearest: true,
655
- duration: 1000,
656
- easing: easeOut,
657
- bounds: regions[regionId].bounds as Extent,
658
- }),
659
- );
660
- }
661
- };
662
- }