@mapsight/ui 7.1.0 → 7.2.0

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 (484) hide show
  1. package/README.md +91 -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/index.d.ts +3 -2
  22. package/dist/components/feature-list/index.d.ts.map +1 -1
  23. package/dist/components/feature-list/index.js +30 -42
  24. package/dist/components/feature-list/index.js.map +1 -1
  25. package/dist/components/feature-list/pagination.d.ts +1 -1
  26. package/dist/components/feature-list/pagination.d.ts.map +1 -1
  27. package/dist/components/feature-list/query-input.d.ts +1 -1
  28. package/dist/components/feature-list/query-input.d.ts.map +1 -1
  29. package/dist/components/feature-list/tag-switcher-control.d.ts +4 -0
  30. package/dist/components/feature-list/tag-switcher-control.d.ts.map +1 -0
  31. package/dist/components/feature-list/tag-switcher-control.js +10 -0
  32. package/dist/components/feature-list/tag-switcher-control.js.map +1 -0
  33. package/dist/components/feature-list-cycling/button.d.ts +1 -1
  34. package/dist/components/feature-list-cycling/button.d.ts.map +1 -1
  35. package/dist/components/feature-list-cycling/dot.d.ts +1 -1
  36. package/dist/components/feature-list-cycling/dot.d.ts.map +1 -1
  37. package/dist/components/feature-list-cycling/feature-list-cycling.d.ts +1 -1
  38. package/dist/components/feature-list-cycling/feature-list-cycling.d.ts.map +1 -1
  39. package/dist/components/feature-list-cycling/index.d.ts +1 -1
  40. package/dist/components/feature-list-item/icon.d.ts +8 -6
  41. package/dist/components/feature-list-item/icon.d.ts.map +1 -1
  42. package/dist/components/feature-list-item/icon.js +5 -13
  43. package/dist/components/feature-list-item/icon.js.map +1 -1
  44. package/dist/components/feature-list-item/index.d.ts +1 -1
  45. package/dist/components/feature-list-item/index.d.ts.map +1 -1
  46. package/dist/components/feature-list-sorting/feature-list-sorting.d.ts +1 -1
  47. package/dist/components/feature-list-sorting/feature-list-sorting.d.ts.map +1 -1
  48. package/dist/components/feature-list-sorting/feature-list-sorting.js +3 -12
  49. package/dist/components/feature-list-sorting/feature-list-sorting.js.map +1 -1
  50. package/dist/components/feature-list-sorting/index.d.ts +1 -1
  51. package/dist/components/feature-list-sorting/status-indicator.d.ts +1 -1
  52. package/dist/components/feature-list-sorting/status-indicator.d.ts.map +1 -1
  53. package/dist/components/feature-select-button.d.ts +1 -1
  54. package/dist/components/feature-select-button.d.ts.map +1 -1
  55. package/dist/components/feature-selection-info/close-button.d.ts +1 -1
  56. package/dist/components/feature-selection-info/close-button.d.ts.map +1 -1
  57. package/dist/components/feature-selection-info/container.d.ts +1 -1
  58. package/dist/components/feature-selection-info/container.d.ts.map +1 -1
  59. package/dist/components/feature-selection-info/header.d.ts +1 -1
  60. package/dist/components/feature-selection-info/header.d.ts.map +1 -1
  61. package/dist/components/feature-selection-info/index.d.ts +1 -1
  62. package/dist/components/feature-selection-info/index.d.ts.map +1 -1
  63. package/dist/components/feature-selection-info/with-sticky-header.d.ts +1 -1
  64. package/dist/components/feature-selection-info/with-sticky-header.d.ts.map +1 -1
  65. package/dist/components/feature-selection-info/without-sticky-header.d.ts +1 -1
  66. package/dist/components/feature-selection-info/without-sticky-header.d.ts.map +1 -1
  67. package/dist/components/filter-toggle-control/FilterToggleControl.d.ts +12 -0
  68. package/dist/components/filter-toggle-control/FilterToggleControl.d.ts.map +1 -0
  69. package/dist/components/filter-toggle-control/FilterToggleControl.js +20 -0
  70. package/dist/components/filter-toggle-control/FilterToggleControl.js.map +1 -0
  71. package/dist/components/helping/app-channel.d.ts +1 -1
  72. package/dist/components/helping/app-channel.d.ts.map +1 -1
  73. package/dist/components/helping/app-context.d.ts +1 -1
  74. package/dist/components/helping/app-context.d.ts.map +1 -1
  75. package/dist/components/instance.d.ts +1 -1
  76. package/dist/components/instance.d.ts.map +1 -1
  77. package/dist/components/layer-switcher/GroupedLayerSwitcher.d.ts +1 -1
  78. package/dist/components/layer-switcher/LayerSwitcher.d.ts +1 -1
  79. package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts +3 -2
  80. package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts.map +1 -1
  81. package/dist/components/layer-switcher/LayerSwitcherContainer.js +2 -2
  82. package/dist/components/layer-switcher/LayerSwitcherContainer.js.map +1 -1
  83. package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts +1 -1
  84. package/dist/components/layer-switcher/index.d.ts +1 -1
  85. package/dist/components/layer-switcher/index.js.map +1 -1
  86. package/dist/components/layout/additional-container/content.d.ts +1 -1
  87. package/dist/components/layout/additional-container/content.d.ts.map +1 -1
  88. package/dist/components/layout/additional-container/index.d.ts +1 -1
  89. package/dist/components/layout/additional-container/index.d.ts.map +1 -1
  90. package/dist/components/layout/additional-container/marginal.d.ts +1 -1
  91. package/dist/components/layout/additional-container/marginal.d.ts.map +1 -1
  92. package/dist/components/layout/main-container.d.ts +1 -1
  93. package/dist/components/layout/main-container.d.ts.map +1 -1
  94. package/dist/components/layout/map-row.d.ts +1 -1
  95. package/dist/components/layout/map-row.d.ts.map +1 -1
  96. package/dist/components/layout/title-bar.d.ts +1 -1
  97. package/dist/components/layout/title-bar.d.ts.map +1 -1
  98. package/dist/components/layout/wrapper.d.ts +1 -1
  99. package/dist/components/layout/wrapper.d.ts.map +1 -1
  100. package/dist/components/link-share.d.ts +1 -1
  101. package/dist/components/link-share.d.ts.map +1 -1
  102. package/dist/components/main-panel/container.d.ts +1 -1
  103. package/dist/components/main-panel/container.d.ts.map +1 -1
  104. package/dist/components/main-panel/context.d.ts +1 -1
  105. package/dist/components/main-panel/context.d.ts.map +1 -1
  106. package/dist/components/main-panel/index.d.ts +1 -1
  107. package/dist/components/main-panel/index.d.ts.map +1 -1
  108. package/dist/components/main-panel/list-toggle-button.d.ts +1 -1
  109. package/dist/components/main-panel/list-toggle-button.d.ts.map +1 -1
  110. package/dist/components/map-overlay/attribution-entries.d.ts +1 -1
  111. package/dist/components/map-overlay/attribution-entries.d.ts.map +1 -1
  112. package/dist/components/map-overlay/attribution.d.ts +1 -1
  113. package/dist/components/map-overlay/attribution.d.ts.map +1 -1
  114. package/dist/components/map-overlay/combined-buttons.d.ts +1 -1
  115. package/dist/components/map-overlay/combined-buttons.d.ts.map +1 -1
  116. package/dist/components/map-overlay/index.d.ts +1 -1
  117. package/dist/components/map-overlay/index.d.ts.map +1 -1
  118. package/dist/components/map-overlay/info-overlay-left.d.ts +1 -1
  119. package/dist/components/map-overlay/info-overlay-left.d.ts.map +1 -1
  120. package/dist/components/map-overlay/info-overlay-modal.d.ts +1 -1
  121. package/dist/components/map-overlay/info-overlay-modal.d.ts.map +1 -1
  122. package/dist/components/map-overlay/info-overlay-right.d.ts +1 -1
  123. package/dist/components/map-overlay/info-overlay-right.d.ts.map +1 -1
  124. package/dist/components/map-overlay/layer-switcher-overlay.d.ts +1 -1
  125. package/dist/components/map-overlay/layer-switcher-overlay.d.ts.map +1 -1
  126. package/dist/components/map-overlay/legend.d.ts +1 -1
  127. package/dist/components/map-overlay/legend.d.ts.map +1 -1
  128. package/dist/components/map-overlay/logo.d.ts +1 -1
  129. package/dist/components/map-overlay/logo.d.ts.map +1 -1
  130. package/dist/components/map-overlay/measure-distance-button.d.ts +1 -1
  131. package/dist/components/map-overlay/measure-distance-button.d.ts.map +1 -1
  132. package/dist/components/map-overlay/measure-distance-overlay.d.ts +1 -1
  133. package/dist/components/map-overlay/measure-distance-overlay.d.ts.map +1 -1
  134. package/dist/components/map-overlay/search-overlay.d.ts +1 -1
  135. package/dist/components/map-overlay/search-overlay.d.ts.map +1 -1
  136. package/dist/components/map-overlay/share-position-link-button.d.ts +1 -1
  137. package/dist/components/map-overlay/share-position-link-button.d.ts.map +1 -1
  138. package/dist/components/map-overlay/tool-overlay.d.ts +1 -1
  139. package/dist/components/map-overlay/tool-overlay.d.ts.map +1 -1
  140. package/dist/components/map-overlay/zoom-buttons.d.ts +1 -1
  141. package/dist/components/map-overlay/zoom-buttons.d.ts.map +1 -1
  142. package/dist/components/map-synced-interlay/index.d.ts +1 -1
  143. package/dist/components/map-synced-interlay/map-synced-interlay.d.ts +1 -1
  144. package/dist/components/map-synced-interlay/map-synced-interlay.d.ts.map +1 -1
  145. package/dist/components/map-synced-interlay/tooltip.d.ts +1 -1
  146. package/dist/components/map-synced-interlay/tooltip.d.ts.map +1 -1
  147. package/dist/components/map-wrapper.d.ts +3 -3
  148. package/dist/components/map-wrapper.d.ts.map +1 -1
  149. package/dist/components/map-wrapper.js +4 -7
  150. package/dist/components/map-wrapper.js.map +1 -1
  151. package/dist/components/map.d.ts +1 -1
  152. package/dist/components/map.d.ts.map +1 -1
  153. package/dist/components/mapsight-icon/mapsight-icon.d.ts +10 -0
  154. package/dist/components/mapsight-icon/mapsight-icon.d.ts.map +1 -0
  155. package/dist/components/mapsight-icon/mapsight-icon.js +33 -0
  156. package/dist/components/mapsight-icon/mapsight-icon.js.map +1 -0
  157. package/dist/components/modal.d.ts +1 -1
  158. package/dist/components/modal.d.ts.map +1 -1
  159. package/dist/components/query-input-with-label.d.ts +1 -1
  160. package/dist/components/query-input-with-label.d.ts.map +1 -1
  161. package/dist/components/search/index.d.ts +1 -1
  162. package/dist/components/search/index.d.ts.map +1 -1
  163. package/dist/components/search/result-entry.d.ts +1 -1
  164. package/dist/components/search/result-entry.d.ts.map +1 -1
  165. package/dist/components/search/result.d.ts +1 -1
  166. package/dist/components/search/result.d.ts.map +1 -1
  167. package/dist/components/switcher/GroupedSwitcher.d.ts +1 -1
  168. package/dist/components/switcher/GroupedSwitcher.d.ts.map +1 -1
  169. package/dist/components/switcher/Switcher.d.ts +1 -1
  170. package/dist/components/switcher/Switcher.d.ts.map +1 -1
  171. package/dist/components/switcher/SwitcherButton.d.ts +1 -1
  172. package/dist/components/switcher/SwitcherButton.d.ts.map +1 -1
  173. package/dist/components/switcher/SwitcherEntry.d.ts +1 -1
  174. package/dist/components/switcher/SwitcherEntry.d.ts.map +1 -1
  175. package/dist/components/switcher/SwitcherHeader.d.ts +1 -1
  176. package/dist/components/switcher/SwitcherHeader.d.ts.map +1 -1
  177. package/dist/components/switcher/SwitcherStatusIcon.d.ts +1 -1
  178. package/dist/components/switcher/SwitcherStatusIcon.d.ts.map +1 -1
  179. package/dist/components/tag-switcher/TagSwitcher.d.ts +1 -1
  180. package/dist/components/tag-switcher/TagSwitcher.d.ts.map +1 -1
  181. package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts +1 -1
  182. package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts +1 -1
  183. package/dist/components/tag-switcher/index.d.ts +1 -1
  184. package/dist/components/time-filter.d.ts +1 -1
  185. package/dist/components/time-filter.d.ts.map +1 -1
  186. package/dist/components/view-toggle-button/desktop-button.d.ts +1 -1
  187. package/dist/components/view-toggle-button/desktop-button.d.ts.map +1 -1
  188. package/dist/components/view-toggle-button/index.d.ts +1 -1
  189. package/dist/components/view-toggle-button/mobile-button.d.ts +1 -1
  190. package/dist/components/view-toggle-button/mobile-button.d.ts.map +1 -1
  191. package/dist/components/view-toggle-button/view-toggle-button.d.ts +1 -1
  192. package/dist/components/view-toggle-button/view-toggle-button.d.ts.map +1 -1
  193. package/dist/components/view-toggle-button/viewport-button.d.ts +1 -1
  194. package/dist/components/view-toggle-button/viewport-button.d.ts.map +1 -1
  195. package/dist/config/feature/sources.d.ts +8 -5
  196. package/dist/config/feature/sources.d.ts.map +1 -1
  197. package/dist/config/feature/sources.js +10 -0
  198. package/dist/config/feature/sources.js.map +1 -1
  199. package/dist/config/index.d.ts +1 -1
  200. package/dist/config/map/featureInteractions.js.map +1 -1
  201. package/dist/config/map/layers.d.ts +16 -13
  202. package/dist/config/map/layers.d.ts.map +1 -1
  203. package/dist/config/map/layers.js.map +1 -1
  204. package/dist/config/schema/index.d.ts +195 -0
  205. package/dist/config/schema/index.d.ts.map +1 -0
  206. package/dist/config/schema/index.js +26 -0
  207. package/dist/config/schema/index.js.map +1 -0
  208. package/dist/config/schema/validate.d.ts +8 -0
  209. package/dist/config/schema/validate.d.ts.map +1 -0
  210. package/dist/config/schema/validate.js +7 -0
  211. package/dist/config/schema/validate.js.map +1 -0
  212. package/dist/controllers/defaults.d.ts.map +1 -1
  213. package/dist/controllers/defaults.js +5 -0
  214. package/dist/controllers/defaults.js.map +1 -1
  215. package/dist/filters/tag-filter.d.ts +7 -0
  216. package/dist/filters/tag-filter.d.ts.map +1 -1
  217. package/dist/filters/tag-filter.js +10 -0
  218. package/dist/filters/tag-filter.js.map +1 -1
  219. package/dist/filters/time-filter.d.ts +9 -0
  220. package/dist/filters/time-filter.d.ts.map +1 -1
  221. package/dist/filters/time-filter.js +10 -0
  222. package/dist/filters/time-filter.js.map +1 -1
  223. package/dist/helpers/i18n/de.d.ts.map +1 -1
  224. package/dist/helpers/i18n/de.js +1 -0
  225. package/dist/helpers/i18n/de.js.map +1 -1
  226. package/dist/helpers/i18n/en.d.ts.map +1 -1
  227. package/dist/helpers/i18n/en.js +1 -0
  228. package/dist/helpers/i18n/en.js.map +1 -1
  229. package/dist/helpers/sort-features-by-distance.d.ts +2 -7
  230. package/dist/helpers/sort-features-by-distance.d.ts.map +1 -1
  231. package/dist/helpers/sort-features-by-distance.js +27 -39
  232. package/dist/helpers/sort-features-by-distance.js.map +1 -1
  233. package/dist/hooks/useMapsightIcon.d.ts +8 -0
  234. package/dist/hooks/useMapsightIcon.d.ts.map +1 -0
  235. package/dist/hooks/useMapsightIcon.js +50 -0
  236. package/dist/hooks/useMapsightIcon.js.map +1 -0
  237. package/dist/index.d.ts +2 -2
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +12 -2
  240. package/dist/index.js.map +1 -1
  241. package/dist/plugins/browser-defaults.d.ts +2 -0
  242. package/dist/plugins/browser-defaults.d.ts.map +1 -1
  243. package/dist/plugins/browser-defaults.js +5 -0
  244. package/dist/plugins/browser-defaults.js.map +1 -1
  245. package/dist/plugins/common/combined-visible-layers.d.ts +15 -0
  246. package/dist/plugins/common/combined-visible-layers.d.ts.map +1 -0
  247. package/dist/plugins/common/combined-visible-layers.js +63 -0
  248. package/dist/plugins/common/combined-visible-layers.js.map +1 -0
  249. package/dist/plugins/common/runtime-icon-style.d.ts +12 -0
  250. package/dist/plugins/common/runtime-icon-style.d.ts.map +1 -0
  251. package/dist/plugins/common/runtime-icon-style.js +58 -0
  252. package/dist/plugins/common/runtime-icon-style.js.map +1 -0
  253. package/dist/react-modal-app-element.d.ts +6 -0
  254. package/dist/react-modal-app-element.d.ts.map +1 -0
  255. package/dist/react-modal-app-element.js +9 -0
  256. package/dist/react-modal-app-element.js.map +1 -0
  257. package/dist/store/actions.d.ts.map +1 -1
  258. package/dist/store/actions.js +6 -1
  259. package/dist/store/actions.js.map +1 -1
  260. package/dist/store/reducers.d.ts +8 -6
  261. package/dist/store/reducers.d.ts.map +1 -1
  262. package/dist/store/selectors.d.ts +10 -17
  263. package/dist/store/selectors.d.ts.map +1 -1
  264. package/dist/store/selectors.js +9 -1
  265. package/dist/store/selectors.js.map +1 -1
  266. package/dist/types.d.ts +19 -5
  267. package/dist/types.d.ts.map +1 -1
  268. package/package.json +24 -8
  269. package/src/scss/blocks/_features-sorting.scss +0 -13
  270. package/src/scss/blocks/_filter-button.scss +23 -0
  271. package/src/scss/blocks/_filter-toggle-control.scss +15 -0
  272. package/src/scss/default.scss +1 -0
  273. package/src/img/mapsight-ui/check-empty.svg +0 -1
  274. package/src/img/mapsight-ui/check.svg +0 -2
  275. package/src/img/mapsight-ui/close-list.svg +0 -1
  276. package/src/img/mapsight-ui/close.svg +0 -1
  277. package/src/img/mapsight-ui/error.svg +0 -1
  278. package/src/img/mapsight-ui/fullscreen-close.svg +0 -1
  279. package/src/img/mapsight-ui/fullscreen.svg +0 -1
  280. package/src/img/mapsight-ui/geo-active.svg +0 -1
  281. package/src/img/mapsight-ui/geo-error.svg +0 -1
  282. package/src/img/mapsight-ui/geo-inactive.svg +0 -1
  283. package/src/img/mapsight-ui/info.svg +0 -1
  284. package/src/img/mapsight-ui/layers.svg +0 -1
  285. package/src/img/mapsight-ui/loading.svg +0 -1
  286. package/src/img/mapsight-ui/map.svg +0 -1
  287. package/src/img/mapsight-ui/measure-distance.svg +0 -7
  288. package/src/img/mapsight-ui/open-list.svg +0 -1
  289. package/src/img/mapsight-ui/place-marker.svg +0 -4
  290. package/src/img/mapsight-ui/print.svg +0 -4
  291. package/src/img/mapsight-ui/reset-active.svg +0 -1
  292. package/src/img/mapsight-ui/reset.svg +0 -1
  293. package/src/img/mapsight-ui/search.svg +0 -1
  294. package/src/img/mapsight-ui/sharing.svg +0 -7
  295. package/src/img/mapsight-ui/sort-active.svg +0 -1
  296. package/src/img/mapsight-ui/sort.svg +0 -1
  297. package/src/img/mapsight-ui/watermark.svg +0 -1
  298. package/src/img/mapsight-ui/zoom-in.svg +0 -3
  299. package/src/img/mapsight-ui/zoom-out.svg +0 -3
  300. package/src/js/components/app.tsx +0 -232
  301. package/src/js/components/close-overlay-button.tsx +0 -27
  302. package/src/js/components/feature-details-content/feature-details-content-inner.tsx +0 -116
  303. package/src/js/components/feature-details-content/feature-details-content.jsx +0 -185
  304. package/src/js/components/feature-details-content/index.js +0 -16
  305. package/src/js/components/feature-details-content/share-feature-link-modal.jsx +0 -56
  306. package/src/js/components/feature-list/content.jsx +0 -42
  307. package/src/js/components/feature-list/context.tsx +0 -47
  308. package/src/js/components/feature-list/empty-message.jsx +0 -15
  309. package/src/js/components/feature-list/filter.jsx +0 -35
  310. package/src/js/components/feature-list/footer.jsx +0 -5
  311. package/src/js/components/feature-list/grouped-content.jsx +0 -74
  312. package/src/js/components/feature-list/header.jsx +0 -7
  313. package/src/js/components/feature-list/hooks/useAutoloadFeatureSource.ts +0 -25
  314. package/src/js/components/feature-list/hooks/useFeatureListFeatureSource.ts +0 -22
  315. package/src/js/components/feature-list/hooks/useFeatureListItemGroups.ts +0 -127
  316. package/src/js/components/feature-list/hooks/useFeatureListState.ts +0 -98
  317. package/src/js/components/feature-list/hooks/useKeyboardNavigation.js +0 -112
  318. package/src/js/components/feature-list/hooks/useMakeHeaderSticky.js +0 -40
  319. package/src/js/components/feature-list/hooks/usePaginatedFilteredFeatures.ts +0 -129
  320. package/src/js/components/feature-list/hooks/useRestoreDocumentScroll.js +0 -12
  321. package/src/js/components/feature-list/hooks/useSelectFeature.js +0 -88
  322. package/src/js/components/feature-list/index.jsx +0 -278
  323. package/src/js/components/feature-list/pagination.tsx +0 -57
  324. package/src/js/components/feature-list/query-input.jsx +0 -14
  325. package/src/js/components/feature-list-cycling/button.jsx +0 -13
  326. package/src/js/components/feature-list-cycling/dot.jsx +0 -43
  327. package/src/js/components/feature-list-cycling/feature-list-cycling.jsx +0 -153
  328. package/src/js/components/feature-list-cycling/index.js +0 -82
  329. package/src/js/components/feature-list-item/head.jsx +0 -131
  330. package/src/js/components/feature-list-item/hooks/useFeatureListItemScrollAndFocus.js +0 -51
  331. package/src/js/components/feature-list-item/hooks/useFeatureListItemState.ts +0 -75
  332. package/src/js/components/feature-list-item/icon.jsx +0 -35
  333. package/src/js/components/feature-list-item/index.jsx +0 -168
  334. package/src/js/components/feature-list-sorting/feature-list-sorting.tsx +0 -144
  335. package/src/js/components/feature-list-sorting/index.js +0 -22
  336. package/src/js/components/feature-list-sorting/status-indicator.jsx +0 -10
  337. package/src/js/components/feature-select-button.jsx +0 -70
  338. package/src/js/components/feature-selection-info/close-button.jsx +0 -64
  339. package/src/js/components/feature-selection-info/container.jsx +0 -9
  340. package/src/js/components/feature-selection-info/header.tsx +0 -27
  341. package/src/js/components/feature-selection-info/index.tsx +0 -81
  342. package/src/js/components/feature-selection-info/with-sticky-header.tsx +0 -76
  343. package/src/js/components/feature-selection-info/without-sticky-header.jsx +0 -19
  344. package/src/js/components/feature-selection-info/wrapper.jsx +0 -43
  345. package/src/js/components/helping/app-channel.tsx +0 -99
  346. package/src/js/components/helping/app-context.tsx +0 -32
  347. package/src/js/components/helping/visibility-wrapper.jsx +0 -23
  348. package/src/js/components/instance.tsx +0 -48
  349. package/src/js/components/layer-switcher/GroupedLayerSwitcher.js +0 -47
  350. package/src/js/components/layer-switcher/LayerSwitcher.ts +0 -34
  351. package/src/js/components/layer-switcher/LayerSwitcherContainer.tsx +0 -88
  352. package/src/js/components/layer-switcher/LayerSwitcherEntry.ts +0 -152
  353. package/src/js/components/layer-switcher/index.ts +0 -42
  354. package/src/js/components/layout/additional-container/content.jsx +0 -10
  355. package/src/js/components/layout/additional-container/index.jsx +0 -5
  356. package/src/js/components/layout/additional-container/marginal.jsx +0 -10
  357. package/src/js/components/layout/main-container.jsx +0 -5
  358. package/src/js/components/layout/map-row.jsx +0 -5
  359. package/src/js/components/layout/title-bar.tsx +0 -25
  360. package/src/js/components/layout/wrapper.jsx +0 -28
  361. package/src/js/components/link-share.jsx +0 -78
  362. package/src/js/components/main-panel/container.tsx +0 -23
  363. package/src/js/components/main-panel/context.tsx +0 -71
  364. package/src/js/components/main-panel/index.tsx +0 -46
  365. package/src/js/components/main-panel/list-toggle-button.jsx +0 -43
  366. package/src/js/components/map-overlay/area.jsx +0 -17
  367. package/src/js/components/map-overlay/attribution-entries.tsx +0 -33
  368. package/src/js/components/map-overlay/attribution.tsx +0 -25
  369. package/src/js/components/map-overlay/combined-buttons.jsx +0 -5
  370. package/src/js/components/map-overlay/index.jsx +0 -5
  371. package/src/js/components/map-overlay/info-overlay-left.jsx +0 -51
  372. package/src/js/components/map-overlay/info-overlay-modal.tsx +0 -49
  373. package/src/js/components/map-overlay/info-overlay-right.jsx +0 -46
  374. package/src/js/components/map-overlay/layer-switcher-overlay.tsx +0 -100
  375. package/src/js/components/map-overlay/legend.tsx +0 -22
  376. package/src/js/components/map-overlay/logo.jsx +0 -11
  377. package/src/js/components/map-overlay/measure-distance-button.tsx +0 -116
  378. package/src/js/components/map-overlay/measure-distance-overlay.jsx +0 -56
  379. package/src/js/components/map-overlay/mini-legend.jsx +0 -103
  380. package/src/js/components/map-overlay/region-selector.jsx +0 -63
  381. package/src/js/components/map-overlay/search-overlay.jsx +0 -79
  382. package/src/js/components/map-overlay/share-position-link-button.tsx +0 -144
  383. package/src/js/components/map-overlay/tool-overlay.tsx +0 -28
  384. package/src/js/components/map-overlay/user-geo-location-button.jsx +0 -89
  385. package/src/js/components/map-overlay/zoom-button.jsx +0 -98
  386. package/src/js/components/map-overlay/zoom-buttons.jsx +0 -26
  387. package/src/js/components/map-synced-interlay/index.ts +0 -15
  388. package/src/js/components/map-synced-interlay/map-synced-interlay.jsx +0 -22
  389. package/src/js/components/map-synced-interlay/tooltip-content.tsx +0 -22
  390. package/src/js/components/map-synced-interlay/tooltip.tsx +0 -199
  391. package/src/js/components/map-wrapper.tsx +0 -65
  392. package/src/js/components/map.tsx +0 -55
  393. package/src/js/components/modal.tsx +0 -40
  394. package/src/js/components/query-input-with-label.tsx +0 -71
  395. package/src/js/components/query-input.tsx +0 -81
  396. package/src/js/components/search/index.jsx +0 -83
  397. package/src/js/components/search/query-input.jsx +0 -20
  398. package/src/js/components/search/result-entry.jsx +0 -63
  399. package/src/js/components/search/result.jsx +0 -71
  400. package/src/js/components/switcher/GroupedSwitcher.jsx +0 -42
  401. package/src/js/components/switcher/Switcher.jsx +0 -54
  402. package/src/js/components/switcher/SwitcherButton.jsx +0 -23
  403. package/src/js/components/switcher/SwitcherEntry.tsx +0 -164
  404. package/src/js/components/switcher/SwitcherHeader.jsx +0 -58
  405. package/src/js/components/switcher/SwitcherStatusIcon.jsx +0 -36
  406. package/src/js/components/tag-switcher/TagSwitcher.tsx +0 -56
  407. package/src/js/components/tag-switcher/createTagSwitcherEntry.ts +0 -39
  408. package/src/js/components/tag-switcher/createTagSwitcherHeader.ts +0 -47
  409. package/src/js/components/tag-switcher/index.ts +0 -17
  410. package/src/js/components/time-filter.jsx +0 -187
  411. package/src/js/components/view-toggle-button/desktop-button.jsx +0 -13
  412. package/src/js/components/view-toggle-button/index.ts +0 -42
  413. package/src/js/components/view-toggle-button/mobile-button.tsx +0 -13
  414. package/src/js/components/view-toggle-button/view-toggle-button.jsx +0 -74
  415. package/src/js/components/view-toggle-button/viewport-button.tsx +0 -13
  416. package/src/js/config/constants/app.ts +0 -16
  417. package/src/js/config/constants/controllers.ts +0 -11
  418. package/src/js/config/feature/selections.ts +0 -13
  419. package/src/js/config/feature/sources.ts +0 -77
  420. package/src/js/config/index.ts +0 -133
  421. package/src/js/config/map/featureInteractions.ts +0 -53
  422. package/src/js/config/map/interactions.ts +0 -15
  423. package/src/js/config/map/layers.ts +0 -190
  424. package/src/js/controllers/defaults.ts +0 -36
  425. package/src/js/embed/browser.ts +0 -89
  426. package/src/js/embed/node.ts +0 -57
  427. package/src/js/filters/tag-filter.ts +0 -135
  428. package/src/js/filters/time-filter.ts +0 -53
  429. package/src/js/helpers/components.ts +0 -66
  430. package/src/js/helpers/create-action-watcher.ts +0 -35
  431. package/src/js/helpers/events.ts +0 -11
  432. package/src/js/helpers/get-feature-property.ts +0 -14
  433. package/src/js/helpers/i18n/de.ts +0 -145
  434. package/src/js/helpers/i18n/en.ts +0 -140
  435. package/src/js/helpers/i18n/index.ts +0 -41
  436. package/src/js/helpers/makeReplaceableComponent.ts +0 -0
  437. package/src/js/helpers/mod-classes.ts +0 -47
  438. package/src/js/helpers/react.ts +0 -14
  439. package/src/js/helpers/scroll-to-element-top.ts +0 -16
  440. package/src/js/helpers/sort-features-by-distance.ts +0 -102
  441. package/src/js/helpers/sticky.js +0 -143
  442. package/src/js/hooks/useCallbackRef.ts +0 -14
  443. package/src/js/hooks/useControllableState.ts +0 -50
  444. package/src/js/hooks/useDebounce.ts +0 -32
  445. package/src/js/hooks/useHandleEscapeKeyDown.ts +0 -27
  446. package/src/js/hooks/useMapsightPanel.ts +0 -40
  447. package/src/js/hooks/useMountable.ts +0 -47
  448. package/src/js/hooks/usePrevious.ts +0 -15
  449. package/src/js/hooks/useStickyHeader.ts +0 -50
  450. package/src/js/hooks/useUpdateMapSizeCallback.ts +0 -32
  451. package/src/js/hooks/useUpdateMapSizeOnRender.ts +0 -16
  452. package/src/js/hooks/useUpdateMapSizeOnTransitionEnd.ts +0 -40
  453. package/src/js/hooks/useUpdateMapSizeOnViewChange.ts +0 -36
  454. package/src/js/index.ts +0 -320
  455. package/src/js/plugins/browser/app-title.ts +0 -36
  456. package/src/js/plugins/browser/debug.ts +0 -37
  457. package/src/js/plugins/browser/feature-deep-link.ts +0 -223
  458. package/src/js/plugins/browser/local-storage.ts +0 -79
  459. package/src/js/plugins/browser/native-fullscreen.ts +0 -81
  460. package/src/js/plugins/browser/no-scroll.ts +0 -91
  461. package/src/js/plugins/browser/partial-content-changed-event.ts +0 -23
  462. package/src/js/plugins/browser/piwik-track-feature-selection-event.ts +0 -75
  463. package/src/js/plugins/browser/piwik-track-fullscreen-toggle-event.ts +0 -46
  464. package/src/js/plugins/browser/search.ts +0 -42
  465. package/src/js/plugins/browser/share-position-link.ts +0 -463
  466. package/src/js/plugins/browser/toggle-mobile-views.ts +0 -60
  467. package/src/js/plugins/browser/user-geolocation.ts +0 -142
  468. package/src/js/plugins/browser/views.ts +0 -141
  469. package/src/js/plugins/browser-defaults.ts +0 -101
  470. package/src/js/plugins/common/feature-selection-details-url.ts +0 -135
  471. package/src/js/plugins/common/lang.ts +0 -17
  472. package/src/js/plugins/common/measure-distance.ts +0 -223
  473. package/src/js/plugins/common/ol-proxy.ts +0 -68
  474. package/src/js/plugins/common/render-await-feature-details-loaded.ts +0 -154
  475. package/src/js/plugins/common/render-await-list-feature-sources-loaded.ts +0 -109
  476. package/src/js/plugins/server/feature-deep-link.ts +0 -67
  477. package/src/js/plugins/server-defaults.ts +0 -36
  478. package/src/js/renderer/browser-dom.tsx +0 -27
  479. package/src/js/renderer/server-string.tsx +0 -17
  480. package/src/js/server-handler.js +0 -39
  481. package/src/js/store/actions.ts +0 -662
  482. package/src/js/store/reducers.ts +0 -491
  483. package/src/js/store/selectors.ts +0 -483
  484. 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
- }