@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.
- package/README.md +91 -2
- package/dist/components/app.d.ts +1 -1
- package/dist/components/app.d.ts.map +1 -1
- package/dist/components/feature-details-content/feature-details-content.d.ts +1 -1
- package/dist/components/feature-details-content/feature-details-content.d.ts.map +1 -1
- package/dist/components/feature-details-content/index.d.ts +1 -1
- package/dist/components/feature-details-content/share-feature-link-modal.d.ts +1 -1
- package/dist/components/feature-details-content/share-feature-link-modal.d.ts.map +1 -1
- package/dist/components/feature-list/context.d.ts +12 -4
- package/dist/components/feature-list/context.d.ts.map +1 -1
- package/dist/components/feature-list/context.js.map +1 -1
- package/dist/components/feature-list/empty-message.d.ts +1 -1
- package/dist/components/feature-list/empty-message.d.ts.map +1 -1
- package/dist/components/feature-list/filter.d.ts +1 -1
- package/dist/components/feature-list/filter.d.ts.map +1 -1
- package/dist/components/feature-list/footer.d.ts +1 -1
- package/dist/components/feature-list/footer.d.ts.map +1 -1
- package/dist/components/feature-list/hooks/useAutoloadFeatureSource.d.ts.map +1 -1
- package/dist/components/feature-list/hooks/useAutoloadFeatureSource.js +12 -3
- package/dist/components/feature-list/hooks/useAutoloadFeatureSource.js.map +1 -1
- package/dist/components/feature-list/index.d.ts +3 -2
- package/dist/components/feature-list/index.d.ts.map +1 -1
- package/dist/components/feature-list/index.js +30 -42
- package/dist/components/feature-list/index.js.map +1 -1
- package/dist/components/feature-list/pagination.d.ts +1 -1
- package/dist/components/feature-list/pagination.d.ts.map +1 -1
- package/dist/components/feature-list/query-input.d.ts +1 -1
- package/dist/components/feature-list/query-input.d.ts.map +1 -1
- package/dist/components/feature-list/tag-switcher-control.d.ts +4 -0
- package/dist/components/feature-list/tag-switcher-control.d.ts.map +1 -0
- package/dist/components/feature-list/tag-switcher-control.js +10 -0
- package/dist/components/feature-list/tag-switcher-control.js.map +1 -0
- package/dist/components/feature-list-cycling/button.d.ts +1 -1
- package/dist/components/feature-list-cycling/button.d.ts.map +1 -1
- package/dist/components/feature-list-cycling/dot.d.ts +1 -1
- package/dist/components/feature-list-cycling/dot.d.ts.map +1 -1
- package/dist/components/feature-list-cycling/feature-list-cycling.d.ts +1 -1
- package/dist/components/feature-list-cycling/feature-list-cycling.d.ts.map +1 -1
- package/dist/components/feature-list-cycling/index.d.ts +1 -1
- package/dist/components/feature-list-item/icon.d.ts +8 -6
- package/dist/components/feature-list-item/icon.d.ts.map +1 -1
- package/dist/components/feature-list-item/icon.js +5 -13
- package/dist/components/feature-list-item/icon.js.map +1 -1
- package/dist/components/feature-list-item/index.d.ts +1 -1
- package/dist/components/feature-list-item/index.d.ts.map +1 -1
- package/dist/components/feature-list-sorting/feature-list-sorting.d.ts +1 -1
- package/dist/components/feature-list-sorting/feature-list-sorting.d.ts.map +1 -1
- package/dist/components/feature-list-sorting/feature-list-sorting.js +3 -12
- package/dist/components/feature-list-sorting/feature-list-sorting.js.map +1 -1
- package/dist/components/feature-list-sorting/index.d.ts +1 -1
- package/dist/components/feature-list-sorting/status-indicator.d.ts +1 -1
- package/dist/components/feature-list-sorting/status-indicator.d.ts.map +1 -1
- package/dist/components/feature-select-button.d.ts +1 -1
- package/dist/components/feature-select-button.d.ts.map +1 -1
- package/dist/components/feature-selection-info/close-button.d.ts +1 -1
- package/dist/components/feature-selection-info/close-button.d.ts.map +1 -1
- package/dist/components/feature-selection-info/container.d.ts +1 -1
- package/dist/components/feature-selection-info/container.d.ts.map +1 -1
- package/dist/components/feature-selection-info/header.d.ts +1 -1
- package/dist/components/feature-selection-info/header.d.ts.map +1 -1
- package/dist/components/feature-selection-info/index.d.ts +1 -1
- package/dist/components/feature-selection-info/index.d.ts.map +1 -1
- package/dist/components/feature-selection-info/with-sticky-header.d.ts +1 -1
- package/dist/components/feature-selection-info/with-sticky-header.d.ts.map +1 -1
- package/dist/components/feature-selection-info/without-sticky-header.d.ts +1 -1
- package/dist/components/feature-selection-info/without-sticky-header.d.ts.map +1 -1
- package/dist/components/filter-toggle-control/FilterToggleControl.d.ts +12 -0
- package/dist/components/filter-toggle-control/FilterToggleControl.d.ts.map +1 -0
- package/dist/components/filter-toggle-control/FilterToggleControl.js +20 -0
- package/dist/components/filter-toggle-control/FilterToggleControl.js.map +1 -0
- package/dist/components/helping/app-channel.d.ts +1 -1
- package/dist/components/helping/app-channel.d.ts.map +1 -1
- package/dist/components/helping/app-context.d.ts +1 -1
- package/dist/components/helping/app-context.d.ts.map +1 -1
- package/dist/components/instance.d.ts +1 -1
- package/dist/components/instance.d.ts.map +1 -1
- package/dist/components/layer-switcher/GroupedLayerSwitcher.d.ts +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.d.ts +1 -1
- package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts +3 -2
- package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcherContainer.js +2 -2
- package/dist/components/layer-switcher/LayerSwitcherContainer.js.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts +1 -1
- package/dist/components/layer-switcher/index.d.ts +1 -1
- package/dist/components/layer-switcher/index.js.map +1 -1
- package/dist/components/layout/additional-container/content.d.ts +1 -1
- package/dist/components/layout/additional-container/content.d.ts.map +1 -1
- package/dist/components/layout/additional-container/index.d.ts +1 -1
- package/dist/components/layout/additional-container/index.d.ts.map +1 -1
- package/dist/components/layout/additional-container/marginal.d.ts +1 -1
- package/dist/components/layout/additional-container/marginal.d.ts.map +1 -1
- package/dist/components/layout/main-container.d.ts +1 -1
- package/dist/components/layout/main-container.d.ts.map +1 -1
- package/dist/components/layout/map-row.d.ts +1 -1
- package/dist/components/layout/map-row.d.ts.map +1 -1
- package/dist/components/layout/title-bar.d.ts +1 -1
- package/dist/components/layout/title-bar.d.ts.map +1 -1
- package/dist/components/layout/wrapper.d.ts +1 -1
- package/dist/components/layout/wrapper.d.ts.map +1 -1
- package/dist/components/link-share.d.ts +1 -1
- package/dist/components/link-share.d.ts.map +1 -1
- package/dist/components/main-panel/container.d.ts +1 -1
- package/dist/components/main-panel/container.d.ts.map +1 -1
- package/dist/components/main-panel/context.d.ts +1 -1
- package/dist/components/main-panel/context.d.ts.map +1 -1
- package/dist/components/main-panel/index.d.ts +1 -1
- package/dist/components/main-panel/index.d.ts.map +1 -1
- package/dist/components/main-panel/list-toggle-button.d.ts +1 -1
- package/dist/components/main-panel/list-toggle-button.d.ts.map +1 -1
- package/dist/components/map-overlay/attribution-entries.d.ts +1 -1
- package/dist/components/map-overlay/attribution-entries.d.ts.map +1 -1
- package/dist/components/map-overlay/attribution.d.ts +1 -1
- package/dist/components/map-overlay/attribution.d.ts.map +1 -1
- package/dist/components/map-overlay/combined-buttons.d.ts +1 -1
- package/dist/components/map-overlay/combined-buttons.d.ts.map +1 -1
- package/dist/components/map-overlay/index.d.ts +1 -1
- package/dist/components/map-overlay/index.d.ts.map +1 -1
- package/dist/components/map-overlay/info-overlay-left.d.ts +1 -1
- package/dist/components/map-overlay/info-overlay-left.d.ts.map +1 -1
- package/dist/components/map-overlay/info-overlay-modal.d.ts +1 -1
- package/dist/components/map-overlay/info-overlay-modal.d.ts.map +1 -1
- package/dist/components/map-overlay/info-overlay-right.d.ts +1 -1
- package/dist/components/map-overlay/info-overlay-right.d.ts.map +1 -1
- package/dist/components/map-overlay/layer-switcher-overlay.d.ts +1 -1
- package/dist/components/map-overlay/layer-switcher-overlay.d.ts.map +1 -1
- package/dist/components/map-overlay/legend.d.ts +1 -1
- package/dist/components/map-overlay/legend.d.ts.map +1 -1
- package/dist/components/map-overlay/logo.d.ts +1 -1
- package/dist/components/map-overlay/logo.d.ts.map +1 -1
- package/dist/components/map-overlay/measure-distance-button.d.ts +1 -1
- package/dist/components/map-overlay/measure-distance-button.d.ts.map +1 -1
- package/dist/components/map-overlay/measure-distance-overlay.d.ts +1 -1
- package/dist/components/map-overlay/measure-distance-overlay.d.ts.map +1 -1
- package/dist/components/map-overlay/search-overlay.d.ts +1 -1
- package/dist/components/map-overlay/search-overlay.d.ts.map +1 -1
- package/dist/components/map-overlay/share-position-link-button.d.ts +1 -1
- package/dist/components/map-overlay/share-position-link-button.d.ts.map +1 -1
- package/dist/components/map-overlay/tool-overlay.d.ts +1 -1
- package/dist/components/map-overlay/tool-overlay.d.ts.map +1 -1
- package/dist/components/map-overlay/zoom-buttons.d.ts +1 -1
- package/dist/components/map-overlay/zoom-buttons.d.ts.map +1 -1
- package/dist/components/map-synced-interlay/index.d.ts +1 -1
- package/dist/components/map-synced-interlay/map-synced-interlay.d.ts +1 -1
- package/dist/components/map-synced-interlay/map-synced-interlay.d.ts.map +1 -1
- package/dist/components/map-synced-interlay/tooltip.d.ts +1 -1
- package/dist/components/map-synced-interlay/tooltip.d.ts.map +1 -1
- package/dist/components/map-wrapper.d.ts +3 -3
- package/dist/components/map-wrapper.d.ts.map +1 -1
- package/dist/components/map-wrapper.js +4 -7
- package/dist/components/map-wrapper.js.map +1 -1
- package/dist/components/map.d.ts +1 -1
- package/dist/components/map.d.ts.map +1 -1
- package/dist/components/mapsight-icon/mapsight-icon.d.ts +10 -0
- package/dist/components/mapsight-icon/mapsight-icon.d.ts.map +1 -0
- package/dist/components/mapsight-icon/mapsight-icon.js +33 -0
- package/dist/components/mapsight-icon/mapsight-icon.js.map +1 -0
- package/dist/components/modal.d.ts +1 -1
- package/dist/components/modal.d.ts.map +1 -1
- package/dist/components/query-input-with-label.d.ts +1 -1
- package/dist/components/query-input-with-label.d.ts.map +1 -1
- package/dist/components/search/index.d.ts +1 -1
- package/dist/components/search/index.d.ts.map +1 -1
- package/dist/components/search/result-entry.d.ts +1 -1
- package/dist/components/search/result-entry.d.ts.map +1 -1
- package/dist/components/search/result.d.ts +1 -1
- package/dist/components/search/result.d.ts.map +1 -1
- package/dist/components/switcher/GroupedSwitcher.d.ts +1 -1
- package/dist/components/switcher/GroupedSwitcher.d.ts.map +1 -1
- package/dist/components/switcher/Switcher.d.ts +1 -1
- package/dist/components/switcher/Switcher.d.ts.map +1 -1
- package/dist/components/switcher/SwitcherButton.d.ts +1 -1
- package/dist/components/switcher/SwitcherButton.d.ts.map +1 -1
- package/dist/components/switcher/SwitcherEntry.d.ts +1 -1
- package/dist/components/switcher/SwitcherEntry.d.ts.map +1 -1
- package/dist/components/switcher/SwitcherHeader.d.ts +1 -1
- package/dist/components/switcher/SwitcherHeader.d.ts.map +1 -1
- package/dist/components/switcher/SwitcherStatusIcon.d.ts +1 -1
- package/dist/components/switcher/SwitcherStatusIcon.d.ts.map +1 -1
- package/dist/components/tag-switcher/TagSwitcher.d.ts +1 -1
- package/dist/components/tag-switcher/TagSwitcher.d.ts.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts +1 -1
- package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts +1 -1
- package/dist/components/tag-switcher/index.d.ts +1 -1
- package/dist/components/time-filter.d.ts +1 -1
- package/dist/components/time-filter.d.ts.map +1 -1
- package/dist/components/view-toggle-button/desktop-button.d.ts +1 -1
- package/dist/components/view-toggle-button/desktop-button.d.ts.map +1 -1
- package/dist/components/view-toggle-button/index.d.ts +1 -1
- package/dist/components/view-toggle-button/mobile-button.d.ts +1 -1
- package/dist/components/view-toggle-button/mobile-button.d.ts.map +1 -1
- package/dist/components/view-toggle-button/view-toggle-button.d.ts +1 -1
- package/dist/components/view-toggle-button/view-toggle-button.d.ts.map +1 -1
- package/dist/components/view-toggle-button/viewport-button.d.ts +1 -1
- package/dist/components/view-toggle-button/viewport-button.d.ts.map +1 -1
- package/dist/config/feature/sources.d.ts +8 -5
- package/dist/config/feature/sources.d.ts.map +1 -1
- package/dist/config/feature/sources.js +10 -0
- package/dist/config/feature/sources.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/map/featureInteractions.js.map +1 -1
- package/dist/config/map/layers.d.ts +16 -13
- package/dist/config/map/layers.d.ts.map +1 -1
- package/dist/config/map/layers.js.map +1 -1
- package/dist/config/schema/index.d.ts +195 -0
- package/dist/config/schema/index.d.ts.map +1 -0
- package/dist/config/schema/index.js +26 -0
- package/dist/config/schema/index.js.map +1 -0
- package/dist/config/schema/validate.d.ts +8 -0
- package/dist/config/schema/validate.d.ts.map +1 -0
- package/dist/config/schema/validate.js +7 -0
- package/dist/config/schema/validate.js.map +1 -0
- package/dist/controllers/defaults.d.ts.map +1 -1
- package/dist/controllers/defaults.js +5 -0
- package/dist/controllers/defaults.js.map +1 -1
- package/dist/filters/tag-filter.d.ts +7 -0
- package/dist/filters/tag-filter.d.ts.map +1 -1
- package/dist/filters/tag-filter.js +10 -0
- package/dist/filters/tag-filter.js.map +1 -1
- package/dist/filters/time-filter.d.ts +9 -0
- package/dist/filters/time-filter.d.ts.map +1 -1
- package/dist/filters/time-filter.js +10 -0
- package/dist/filters/time-filter.js.map +1 -1
- package/dist/helpers/i18n/de.d.ts.map +1 -1
- package/dist/helpers/i18n/de.js +1 -0
- package/dist/helpers/i18n/de.js.map +1 -1
- package/dist/helpers/i18n/en.d.ts.map +1 -1
- package/dist/helpers/i18n/en.js +1 -0
- package/dist/helpers/i18n/en.js.map +1 -1
- package/dist/helpers/sort-features-by-distance.d.ts +2 -7
- package/dist/helpers/sort-features-by-distance.d.ts.map +1 -1
- package/dist/helpers/sort-features-by-distance.js +27 -39
- package/dist/helpers/sort-features-by-distance.js.map +1 -1
- package/dist/hooks/useMapsightIcon.d.ts +8 -0
- package/dist/hooks/useMapsightIcon.d.ts.map +1 -0
- package/dist/hooks/useMapsightIcon.js +50 -0
- package/dist/hooks/useMapsightIcon.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/browser-defaults.d.ts +2 -0
- package/dist/plugins/browser-defaults.d.ts.map +1 -1
- package/dist/plugins/browser-defaults.js +5 -0
- package/dist/plugins/browser-defaults.js.map +1 -1
- package/dist/plugins/common/combined-visible-layers.d.ts +15 -0
- package/dist/plugins/common/combined-visible-layers.d.ts.map +1 -0
- package/dist/plugins/common/combined-visible-layers.js +63 -0
- package/dist/plugins/common/combined-visible-layers.js.map +1 -0
- package/dist/plugins/common/runtime-icon-style.d.ts +12 -0
- package/dist/plugins/common/runtime-icon-style.d.ts.map +1 -0
- package/dist/plugins/common/runtime-icon-style.js +58 -0
- package/dist/plugins/common/runtime-icon-style.js.map +1 -0
- package/dist/react-modal-app-element.d.ts +6 -0
- package/dist/react-modal-app-element.d.ts.map +1 -0
- package/dist/react-modal-app-element.js +9 -0
- package/dist/react-modal-app-element.js.map +1 -0
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/store/actions.js +6 -1
- package/dist/store/actions.js.map +1 -1
- package/dist/store/reducers.d.ts +8 -6
- package/dist/store/reducers.d.ts.map +1 -1
- package/dist/store/selectors.d.ts +10 -17
- package/dist/store/selectors.d.ts.map +1 -1
- package/dist/store/selectors.js +9 -1
- package/dist/store/selectors.js.map +1 -1
- package/dist/types.d.ts +19 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +24 -8
- package/src/scss/blocks/_features-sorting.scss +0 -13
- package/src/scss/blocks/_filter-button.scss +23 -0
- package/src/scss/blocks/_filter-toggle-control.scss +15 -0
- package/src/scss/default.scss +1 -0
- package/src/img/mapsight-ui/check-empty.svg +0 -1
- package/src/img/mapsight-ui/check.svg +0 -2
- package/src/img/mapsight-ui/close-list.svg +0 -1
- package/src/img/mapsight-ui/close.svg +0 -1
- package/src/img/mapsight-ui/error.svg +0 -1
- package/src/img/mapsight-ui/fullscreen-close.svg +0 -1
- package/src/img/mapsight-ui/fullscreen.svg +0 -1
- package/src/img/mapsight-ui/geo-active.svg +0 -1
- package/src/img/mapsight-ui/geo-error.svg +0 -1
- package/src/img/mapsight-ui/geo-inactive.svg +0 -1
- package/src/img/mapsight-ui/info.svg +0 -1
- package/src/img/mapsight-ui/layers.svg +0 -1
- package/src/img/mapsight-ui/loading.svg +0 -1
- package/src/img/mapsight-ui/map.svg +0 -1
- package/src/img/mapsight-ui/measure-distance.svg +0 -7
- package/src/img/mapsight-ui/open-list.svg +0 -1
- package/src/img/mapsight-ui/place-marker.svg +0 -4
- package/src/img/mapsight-ui/print.svg +0 -4
- package/src/img/mapsight-ui/reset-active.svg +0 -1
- package/src/img/mapsight-ui/reset.svg +0 -1
- package/src/img/mapsight-ui/search.svg +0 -1
- package/src/img/mapsight-ui/sharing.svg +0 -7
- package/src/img/mapsight-ui/sort-active.svg +0 -1
- package/src/img/mapsight-ui/sort.svg +0 -1
- package/src/img/mapsight-ui/watermark.svg +0 -1
- package/src/img/mapsight-ui/zoom-in.svg +0 -3
- package/src/img/mapsight-ui/zoom-out.svg +0 -3
- package/src/js/components/app.tsx +0 -232
- package/src/js/components/close-overlay-button.tsx +0 -27
- package/src/js/components/feature-details-content/feature-details-content-inner.tsx +0 -116
- package/src/js/components/feature-details-content/feature-details-content.jsx +0 -185
- package/src/js/components/feature-details-content/index.js +0 -16
- package/src/js/components/feature-details-content/share-feature-link-modal.jsx +0 -56
- package/src/js/components/feature-list/content.jsx +0 -42
- package/src/js/components/feature-list/context.tsx +0 -47
- package/src/js/components/feature-list/empty-message.jsx +0 -15
- package/src/js/components/feature-list/filter.jsx +0 -35
- package/src/js/components/feature-list/footer.jsx +0 -5
- package/src/js/components/feature-list/grouped-content.jsx +0 -74
- package/src/js/components/feature-list/header.jsx +0 -7
- package/src/js/components/feature-list/hooks/useAutoloadFeatureSource.ts +0 -25
- package/src/js/components/feature-list/hooks/useFeatureListFeatureSource.ts +0 -22
- package/src/js/components/feature-list/hooks/useFeatureListItemGroups.ts +0 -127
- package/src/js/components/feature-list/hooks/useFeatureListState.ts +0 -98
- package/src/js/components/feature-list/hooks/useKeyboardNavigation.js +0 -112
- package/src/js/components/feature-list/hooks/useMakeHeaderSticky.js +0 -40
- package/src/js/components/feature-list/hooks/usePaginatedFilteredFeatures.ts +0 -129
- package/src/js/components/feature-list/hooks/useRestoreDocumentScroll.js +0 -12
- package/src/js/components/feature-list/hooks/useSelectFeature.js +0 -88
- package/src/js/components/feature-list/index.jsx +0 -278
- package/src/js/components/feature-list/pagination.tsx +0 -57
- package/src/js/components/feature-list/query-input.jsx +0 -14
- package/src/js/components/feature-list-cycling/button.jsx +0 -13
- package/src/js/components/feature-list-cycling/dot.jsx +0 -43
- package/src/js/components/feature-list-cycling/feature-list-cycling.jsx +0 -153
- package/src/js/components/feature-list-cycling/index.js +0 -82
- package/src/js/components/feature-list-item/head.jsx +0 -131
- package/src/js/components/feature-list-item/hooks/useFeatureListItemScrollAndFocus.js +0 -51
- package/src/js/components/feature-list-item/hooks/useFeatureListItemState.ts +0 -75
- package/src/js/components/feature-list-item/icon.jsx +0 -35
- package/src/js/components/feature-list-item/index.jsx +0 -168
- package/src/js/components/feature-list-sorting/feature-list-sorting.tsx +0 -144
- package/src/js/components/feature-list-sorting/index.js +0 -22
- package/src/js/components/feature-list-sorting/status-indicator.jsx +0 -10
- package/src/js/components/feature-select-button.jsx +0 -70
- package/src/js/components/feature-selection-info/close-button.jsx +0 -64
- package/src/js/components/feature-selection-info/container.jsx +0 -9
- package/src/js/components/feature-selection-info/header.tsx +0 -27
- package/src/js/components/feature-selection-info/index.tsx +0 -81
- package/src/js/components/feature-selection-info/with-sticky-header.tsx +0 -76
- package/src/js/components/feature-selection-info/without-sticky-header.jsx +0 -19
- package/src/js/components/feature-selection-info/wrapper.jsx +0 -43
- package/src/js/components/helping/app-channel.tsx +0 -99
- package/src/js/components/helping/app-context.tsx +0 -32
- package/src/js/components/helping/visibility-wrapper.jsx +0 -23
- package/src/js/components/instance.tsx +0 -48
- package/src/js/components/layer-switcher/GroupedLayerSwitcher.js +0 -47
- package/src/js/components/layer-switcher/LayerSwitcher.ts +0 -34
- package/src/js/components/layer-switcher/LayerSwitcherContainer.tsx +0 -88
- package/src/js/components/layer-switcher/LayerSwitcherEntry.ts +0 -152
- package/src/js/components/layer-switcher/index.ts +0 -42
- package/src/js/components/layout/additional-container/content.jsx +0 -10
- package/src/js/components/layout/additional-container/index.jsx +0 -5
- package/src/js/components/layout/additional-container/marginal.jsx +0 -10
- package/src/js/components/layout/main-container.jsx +0 -5
- package/src/js/components/layout/map-row.jsx +0 -5
- package/src/js/components/layout/title-bar.tsx +0 -25
- package/src/js/components/layout/wrapper.jsx +0 -28
- package/src/js/components/link-share.jsx +0 -78
- package/src/js/components/main-panel/container.tsx +0 -23
- package/src/js/components/main-panel/context.tsx +0 -71
- package/src/js/components/main-panel/index.tsx +0 -46
- package/src/js/components/main-panel/list-toggle-button.jsx +0 -43
- package/src/js/components/map-overlay/area.jsx +0 -17
- package/src/js/components/map-overlay/attribution-entries.tsx +0 -33
- package/src/js/components/map-overlay/attribution.tsx +0 -25
- package/src/js/components/map-overlay/combined-buttons.jsx +0 -5
- package/src/js/components/map-overlay/index.jsx +0 -5
- package/src/js/components/map-overlay/info-overlay-left.jsx +0 -51
- package/src/js/components/map-overlay/info-overlay-modal.tsx +0 -49
- package/src/js/components/map-overlay/info-overlay-right.jsx +0 -46
- package/src/js/components/map-overlay/layer-switcher-overlay.tsx +0 -100
- package/src/js/components/map-overlay/legend.tsx +0 -22
- package/src/js/components/map-overlay/logo.jsx +0 -11
- package/src/js/components/map-overlay/measure-distance-button.tsx +0 -116
- package/src/js/components/map-overlay/measure-distance-overlay.jsx +0 -56
- package/src/js/components/map-overlay/mini-legend.jsx +0 -103
- package/src/js/components/map-overlay/region-selector.jsx +0 -63
- package/src/js/components/map-overlay/search-overlay.jsx +0 -79
- package/src/js/components/map-overlay/share-position-link-button.tsx +0 -144
- package/src/js/components/map-overlay/tool-overlay.tsx +0 -28
- package/src/js/components/map-overlay/user-geo-location-button.jsx +0 -89
- package/src/js/components/map-overlay/zoom-button.jsx +0 -98
- package/src/js/components/map-overlay/zoom-buttons.jsx +0 -26
- package/src/js/components/map-synced-interlay/index.ts +0 -15
- package/src/js/components/map-synced-interlay/map-synced-interlay.jsx +0 -22
- package/src/js/components/map-synced-interlay/tooltip-content.tsx +0 -22
- package/src/js/components/map-synced-interlay/tooltip.tsx +0 -199
- package/src/js/components/map-wrapper.tsx +0 -65
- package/src/js/components/map.tsx +0 -55
- package/src/js/components/modal.tsx +0 -40
- package/src/js/components/query-input-with-label.tsx +0 -71
- package/src/js/components/query-input.tsx +0 -81
- package/src/js/components/search/index.jsx +0 -83
- package/src/js/components/search/query-input.jsx +0 -20
- package/src/js/components/search/result-entry.jsx +0 -63
- package/src/js/components/search/result.jsx +0 -71
- package/src/js/components/switcher/GroupedSwitcher.jsx +0 -42
- package/src/js/components/switcher/Switcher.jsx +0 -54
- package/src/js/components/switcher/SwitcherButton.jsx +0 -23
- package/src/js/components/switcher/SwitcherEntry.tsx +0 -164
- package/src/js/components/switcher/SwitcherHeader.jsx +0 -58
- package/src/js/components/switcher/SwitcherStatusIcon.jsx +0 -36
- package/src/js/components/tag-switcher/TagSwitcher.tsx +0 -56
- package/src/js/components/tag-switcher/createTagSwitcherEntry.ts +0 -39
- package/src/js/components/tag-switcher/createTagSwitcherHeader.ts +0 -47
- package/src/js/components/tag-switcher/index.ts +0 -17
- package/src/js/components/time-filter.jsx +0 -187
- package/src/js/components/view-toggle-button/desktop-button.jsx +0 -13
- package/src/js/components/view-toggle-button/index.ts +0 -42
- package/src/js/components/view-toggle-button/mobile-button.tsx +0 -13
- package/src/js/components/view-toggle-button/view-toggle-button.jsx +0 -74
- package/src/js/components/view-toggle-button/viewport-button.tsx +0 -13
- package/src/js/config/constants/app.ts +0 -16
- package/src/js/config/constants/controllers.ts +0 -11
- package/src/js/config/feature/selections.ts +0 -13
- package/src/js/config/feature/sources.ts +0 -77
- package/src/js/config/index.ts +0 -133
- package/src/js/config/map/featureInteractions.ts +0 -53
- package/src/js/config/map/interactions.ts +0 -15
- package/src/js/config/map/layers.ts +0 -190
- package/src/js/controllers/defaults.ts +0 -36
- package/src/js/embed/browser.ts +0 -89
- package/src/js/embed/node.ts +0 -57
- package/src/js/filters/tag-filter.ts +0 -135
- package/src/js/filters/time-filter.ts +0 -53
- package/src/js/helpers/components.ts +0 -66
- package/src/js/helpers/create-action-watcher.ts +0 -35
- package/src/js/helpers/events.ts +0 -11
- package/src/js/helpers/get-feature-property.ts +0 -14
- package/src/js/helpers/i18n/de.ts +0 -145
- package/src/js/helpers/i18n/en.ts +0 -140
- package/src/js/helpers/i18n/index.ts +0 -41
- package/src/js/helpers/makeReplaceableComponent.ts +0 -0
- package/src/js/helpers/mod-classes.ts +0 -47
- package/src/js/helpers/react.ts +0 -14
- package/src/js/helpers/scroll-to-element-top.ts +0 -16
- package/src/js/helpers/sort-features-by-distance.ts +0 -102
- package/src/js/helpers/sticky.js +0 -143
- package/src/js/hooks/useCallbackRef.ts +0 -14
- package/src/js/hooks/useControllableState.ts +0 -50
- package/src/js/hooks/useDebounce.ts +0 -32
- package/src/js/hooks/useHandleEscapeKeyDown.ts +0 -27
- package/src/js/hooks/useMapsightPanel.ts +0 -40
- package/src/js/hooks/useMountable.ts +0 -47
- package/src/js/hooks/usePrevious.ts +0 -15
- package/src/js/hooks/useStickyHeader.ts +0 -50
- package/src/js/hooks/useUpdateMapSizeCallback.ts +0 -32
- package/src/js/hooks/useUpdateMapSizeOnRender.ts +0 -16
- package/src/js/hooks/useUpdateMapSizeOnTransitionEnd.ts +0 -40
- package/src/js/hooks/useUpdateMapSizeOnViewChange.ts +0 -36
- package/src/js/index.ts +0 -320
- package/src/js/plugins/browser/app-title.ts +0 -36
- package/src/js/plugins/browser/debug.ts +0 -37
- package/src/js/plugins/browser/feature-deep-link.ts +0 -223
- package/src/js/plugins/browser/local-storage.ts +0 -79
- package/src/js/plugins/browser/native-fullscreen.ts +0 -81
- package/src/js/plugins/browser/no-scroll.ts +0 -91
- package/src/js/plugins/browser/partial-content-changed-event.ts +0 -23
- package/src/js/plugins/browser/piwik-track-feature-selection-event.ts +0 -75
- package/src/js/plugins/browser/piwik-track-fullscreen-toggle-event.ts +0 -46
- package/src/js/plugins/browser/search.ts +0 -42
- package/src/js/plugins/browser/share-position-link.ts +0 -463
- package/src/js/plugins/browser/toggle-mobile-views.ts +0 -60
- package/src/js/plugins/browser/user-geolocation.ts +0 -142
- package/src/js/plugins/browser/views.ts +0 -141
- package/src/js/plugins/browser-defaults.ts +0 -101
- package/src/js/plugins/common/feature-selection-details-url.ts +0 -135
- package/src/js/plugins/common/lang.ts +0 -17
- package/src/js/plugins/common/measure-distance.ts +0 -223
- package/src/js/plugins/common/ol-proxy.ts +0 -68
- package/src/js/plugins/common/render-await-feature-details-loaded.ts +0 -154
- package/src/js/plugins/common/render-await-list-feature-sources-loaded.ts +0 -109
- package/src/js/plugins/server/feature-deep-link.ts +0 -67
- package/src/js/plugins/server-defaults.ts +0 -36
- package/src/js/renderer/browser-dom.tsx +0 -27
- package/src/js/renderer/server-string.tsx +0 -17
- package/src/js/server-handler.js +0 -39
- package/src/js/store/actions.ts +0 -662
- package/src/js/store/reducers.ts +0 -491
- package/src/js/store/selectors.ts +0 -483
- package/src/js/types.ts +0 -405
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deselectAll,
|
|
3
|
-
selectExclusively,
|
|
4
|
-
} from "@mapsight/core/lib/feature-selections/actions";
|
|
5
|
-
import {useCallback} from "react";
|
|
6
|
-
import {useDispatch} from "react-redux";
|
|
7
|
-
|
|
8
|
-
import {FEATURE_SELECTIONS} from "../../config/constants/controllers";
|
|
9
|
-
import {FEATURE_SELECTION_HIGHLIGHT} from "../../config/feature/selections";
|
|
10
|
-
|
|
11
|
-
import getFeatureProperty from "../../helpers/get-feature-property";
|
|
12
|
-
|
|
13
|
-
import FeatureSelectButton from "../feature-select-button";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param {React.PropsWithChildren<object>} props props, see below
|
|
17
|
-
* @param {import('../../types').MapsightUiFeature} props.feature feature
|
|
18
|
-
* @param {boolean} props.isSelected isSelected
|
|
19
|
-
* @param {boolean} props.isHighlighted isHighlighted
|
|
20
|
-
* @param {boolean} props.highlightOnMouse highlightOnMouse
|
|
21
|
-
* @param {boolean} props.selectOnClick selectOnClick
|
|
22
|
-
* @param {boolean} props.deselectOnClick deselectOnClick
|
|
23
|
-
* @param {(featureId: import('../../types').MapsightUiFeatureId, options?: {keyboard: boolean}) => void} props.selectFeature selectFeature
|
|
24
|
-
* @param {(featureId: import('../../types').MapsightUiFeatureId, options?: {keyboard: boolean}) => void} props.deselectFeatures deselectFeatures
|
|
25
|
-
* @param {React.HTMLProps<HTMLButtonElement> | React.HTMLProps<HTMLAnchorElement>} [props.attributes] attributes
|
|
26
|
-
* @returns {React.ReactElement} element
|
|
27
|
-
*/
|
|
28
|
-
function FeatureListItemHead({
|
|
29
|
-
children,
|
|
30
|
-
feature,
|
|
31
|
-
isSelected,
|
|
32
|
-
isHighlighted,
|
|
33
|
-
highlightOnMouse,
|
|
34
|
-
selectOnClick,
|
|
35
|
-
deselectOnClick,
|
|
36
|
-
selectFeature,
|
|
37
|
-
deselectFeatures,
|
|
38
|
-
className = "",
|
|
39
|
-
...attributes
|
|
40
|
-
}) {
|
|
41
|
-
const permanentLink = getFeatureProperty(feature, "permanentLink");
|
|
42
|
-
|
|
43
|
-
const dispatch = useDispatch();
|
|
44
|
-
const onFeatureHighlight = useCallback(
|
|
45
|
-
() =>
|
|
46
|
-
dispatch(
|
|
47
|
-
selectExclusively(
|
|
48
|
-
FEATURE_SELECTIONS,
|
|
49
|
-
FEATURE_SELECTION_HIGHLIGHT,
|
|
50
|
-
feature.id,
|
|
51
|
-
),
|
|
52
|
-
),
|
|
53
|
-
[dispatch, feature.id],
|
|
54
|
-
);
|
|
55
|
-
const onFeatureUnHighlight = useCallback(
|
|
56
|
-
() =>
|
|
57
|
-
dispatch(
|
|
58
|
-
deselectAll(FEATURE_SELECTIONS, FEATURE_SELECTION_HIGHLIGHT),
|
|
59
|
-
),
|
|
60
|
-
[dispatch],
|
|
61
|
-
);
|
|
62
|
-
if (highlightOnMouse) {
|
|
63
|
-
attributes.onMouseEnter = !isSelected ? onFeatureHighlight : undefined;
|
|
64
|
-
attributes.onMouseLeave = isHighlighted
|
|
65
|
-
? onFeatureUnHighlight
|
|
66
|
-
: undefined;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/*
|
|
70
|
-
* We support a range of interactive behaviours
|
|
71
|
-
* 1. Has some on-page click handler => <button> or <a role=button> (if it also has a permalink)
|
|
72
|
-
* 2. Does not have on-page click behaviour, but permalink => link <a>
|
|
73
|
-
* 3. Does have neither on-page click behaviour nor permalink, but should highlight on mouse => <span> with hover handlers
|
|
74
|
-
* 4. Not interactive at all => <span>
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
// 1
|
|
78
|
-
if (feature.id && (selectOnClick || deselectOnClick)) {
|
|
79
|
-
return (
|
|
80
|
-
<FeatureSelectButton
|
|
81
|
-
tabIndex={-1}
|
|
82
|
-
className={`${className} [ ms3-list__button ms3-list__button--selectable ]`}
|
|
83
|
-
{...attributes}
|
|
84
|
-
featureId={feature.id}
|
|
85
|
-
isSelected={isSelected}
|
|
86
|
-
selectOnClick={selectOnClick}
|
|
87
|
-
deselectOnClick={deselectOnClick}
|
|
88
|
-
onSelect={selectFeature}
|
|
89
|
-
onDeselect={deselectFeatures}
|
|
90
|
-
permanentLink={permanentLink}
|
|
91
|
-
>
|
|
92
|
-
{children}
|
|
93
|
-
</FeatureSelectButton>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// 2.
|
|
98
|
-
if (permanentLink) {
|
|
99
|
-
return (
|
|
100
|
-
<a
|
|
101
|
-
tabIndex={-1}
|
|
102
|
-
href={permanentLink}
|
|
103
|
-
className={`${className} [ ms3-list__link ]`}
|
|
104
|
-
{...attributes}
|
|
105
|
-
>
|
|
106
|
-
{children}
|
|
107
|
-
</a>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// 3.
|
|
112
|
-
if (highlightOnMouse) {
|
|
113
|
-
return (
|
|
114
|
-
<span
|
|
115
|
-
className={`${className} [ ms3-list__button ]`}
|
|
116
|
-
{...attributes}
|
|
117
|
-
>
|
|
118
|
-
{children}
|
|
119
|
-
</span>
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// 4.
|
|
124
|
-
return (
|
|
125
|
-
<span className={className} {...attributes}>
|
|
126
|
-
{children}
|
|
127
|
-
</span>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export default FeatureListItemHead;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {useEffect} from "react";
|
|
2
|
-
|
|
3
|
-
import usePrevious from "../../../hooks/usePrevious";
|
|
4
|
-
|
|
5
|
-
export default function useFeatureListItemScrollAndFocus(
|
|
6
|
-
ref,
|
|
7
|
-
showDetails,
|
|
8
|
-
isPreselectedOnly,
|
|
9
|
-
{scrollOnSelection, scrollOnPreselection, enableKeyboardControl},
|
|
10
|
-
) {
|
|
11
|
-
const lastShowDetails = usePrevious(showDetails);
|
|
12
|
-
const lastIsPreselectedOnly = usePrevious(isPreselectedOnly);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (typeof window === "undefined" || ref.current === null) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/*
|
|
20
|
-
* There are two cases where we want to scroll to the item
|
|
21
|
-
* 1. On selection, if enabled and if details are expanded
|
|
22
|
-
* 2. On preselection, if enabled and only if not already selected
|
|
23
|
-
*
|
|
24
|
-
* Case 2 may occur if the project code preselects the feature without also
|
|
25
|
-
* immediately selecting it. In that case we may also want to focus the
|
|
26
|
-
* item, if enabled.
|
|
27
|
-
*/
|
|
28
|
-
let shouldScroll = false;
|
|
29
|
-
if (scrollOnSelection && showDetails && !lastShowDetails) {
|
|
30
|
-
// case 1: scroll on selection with details
|
|
31
|
-
shouldScroll = true;
|
|
32
|
-
} else if (
|
|
33
|
-
scrollOnPreselection &&
|
|
34
|
-
isPreselectedOnly &&
|
|
35
|
-
!lastIsPreselectedOnly
|
|
36
|
-
) {
|
|
37
|
-
// case 2: scroll on preselection
|
|
38
|
-
shouldScroll = true;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (shouldScroll) {
|
|
42
|
-
console.log("list item scroll");
|
|
43
|
-
ref.current.scrollIntoView({block: "start", behavior: "smooth"});
|
|
44
|
-
|
|
45
|
-
if (enableKeyboardControl) {
|
|
46
|
-
console.log("list item focus");
|
|
47
|
-
ref.current.focus({preventScroll: true});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {useMemo} from "react";
|
|
2
|
-
import {useSelector} from "react-redux";
|
|
3
|
-
|
|
4
|
-
import {getFilteredFeatures} from "@mapsight/core/lib/feature-selections/selectors";
|
|
5
|
-
|
|
6
|
-
import {isViewMobile, viewSelector} from "../../../store/selectors";
|
|
7
|
-
import type {MapsightUiFeature} from "../../../types";
|
|
8
|
-
import {useFeatureListContext} from "../../feature-list/context";
|
|
9
|
-
|
|
10
|
-
export default function useFeatureListItemState(feature: MapsightUiFeature) {
|
|
11
|
-
const view = useSelector(viewSelector);
|
|
12
|
-
const isMobile = isViewMobile(view);
|
|
13
|
-
const {
|
|
14
|
-
listUiOptions: {
|
|
15
|
-
selectionBehavior,
|
|
16
|
-
showSelectedOnly,
|
|
17
|
-
detailsInList,
|
|
18
|
-
selectOnClick,
|
|
19
|
-
deselectOnClick,
|
|
20
|
-
highlightOnMouse,
|
|
21
|
-
},
|
|
22
|
-
state: {selectSelection, preselectSelection, highlightSelection},
|
|
23
|
-
} = useFeatureListContext();
|
|
24
|
-
|
|
25
|
-
const selectSelectionFeatures = useMemo(
|
|
26
|
-
() => getFilteredFeatures(selectSelection) || [],
|
|
27
|
-
[selectSelection],
|
|
28
|
-
);
|
|
29
|
-
const hasSelection = selectSelectionFeatures?.length > 0;
|
|
30
|
-
const isSelected = useMemo(
|
|
31
|
-
() => selectSelectionFeatures.includes(feature.id),
|
|
32
|
-
[feature.id, selectSelectionFeatures],
|
|
33
|
-
);
|
|
34
|
-
const isPreselected = useMemo(
|
|
35
|
-
() => getFilteredFeatures(preselectSelection)?.includes(feature.id),
|
|
36
|
-
[feature.id, preselectSelection],
|
|
37
|
-
);
|
|
38
|
-
const isHighlighted = useMemo(
|
|
39
|
-
() => getFilteredFeatures(highlightSelection)?.includes(feature.id),
|
|
40
|
-
[feature.id, highlightSelection],
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
return useMemo(
|
|
44
|
-
() => ({
|
|
45
|
-
selectOnClick: selectOnClick,
|
|
46
|
-
deselectOnClick: deselectOnClick,
|
|
47
|
-
highlightOnMouse: highlightOnMouse,
|
|
48
|
-
view: view,
|
|
49
|
-
isMobile: isMobile,
|
|
50
|
-
hidden: showSelectedOnly && hasSelection && !isSelected,
|
|
51
|
-
hasSelection: hasSelection,
|
|
52
|
-
isSelected: isSelected,
|
|
53
|
-
isHighlighted: isHighlighted,
|
|
54
|
-
isPreselected: isPreselected,
|
|
55
|
-
showDetails: isSelected && (isMobile || detailsInList),
|
|
56
|
-
scrollOnSelection:
|
|
57
|
-
selectionBehavior?.[view] === "expandInList" &&
|
|
58
|
-
!showSelectedOnly,
|
|
59
|
-
}),
|
|
60
|
-
[
|
|
61
|
-
deselectOnClick,
|
|
62
|
-
detailsInList,
|
|
63
|
-
hasSelection,
|
|
64
|
-
highlightOnMouse,
|
|
65
|
-
isHighlighted,
|
|
66
|
-
isMobile,
|
|
67
|
-
isPreselected,
|
|
68
|
-
isSelected,
|
|
69
|
-
selectOnClick,
|
|
70
|
-
showSelectedOnly,
|
|
71
|
-
selectionBehavior,
|
|
72
|
-
view,
|
|
73
|
-
],
|
|
74
|
-
);
|
|
75
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {memo} from "react";
|
|
2
|
-
|
|
3
|
-
import {siteConfig} from "../../config";
|
|
4
|
-
|
|
5
|
-
function MapsightIcon({id}) {
|
|
6
|
-
if (!id) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// TODO make these paths configurable
|
|
11
|
-
const iconFileName = `${id}-plain.png`;
|
|
12
|
-
const iconSrc1x = `${siteConfig.imagesUrl}mapsight-icons/${iconFileName}`;
|
|
13
|
-
const iconSrcSet =
|
|
14
|
-
`${siteConfig.imagesUrl}mapsight-icons/${iconFileName} 1x, ` +
|
|
15
|
-
`${siteConfig.imagesUrl}mapsight-icons-2x/${iconFileName} 2x`;
|
|
16
|
-
|
|
17
|
-
return <img src={iconSrc1x} srcSet={iconSrcSet} alt="" />;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function FeatureListIcon({selectable, mapsightIconId, as: T, ...attributes}) {
|
|
21
|
-
let className = `ms3-list__icon ms3-list__icon--id-${
|
|
22
|
-
mapsightIconId || "-"
|
|
23
|
-
}`;
|
|
24
|
-
if (selectable) {
|
|
25
|
-
className += " ms3-list__icon--selectable";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<T className={className} aria-hidden={true} {...attributes}>
|
|
30
|
-
<MapsightIcon id={mapsightIconId} />
|
|
31
|
-
</T>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default memo(FeatureListIcon);
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import {Fragment, useRef} from "react";
|
|
2
|
-
|
|
3
|
-
import getFeatureProperty from "../../helpers/get-feature-property";
|
|
4
|
-
import FeatureDetailsContent from "../feature-details-content";
|
|
5
|
-
|
|
6
|
-
import FeatureListItemHead from "./head";
|
|
7
|
-
import useFeatureListItemScrollAndFocus from "./hooks/useFeatureListItemScrollAndFocus";
|
|
8
|
-
import useFeatureListItemState from "./hooks/useFeatureListItemState";
|
|
9
|
-
|
|
10
|
-
import FeatureListIcon from "./icon";
|
|
11
|
-
|
|
12
|
-
function getMainContentForFeature(feature) {
|
|
13
|
-
const listName = getFeatureProperty(feature, "listName");
|
|
14
|
-
const name = getFeatureProperty(feature, "name");
|
|
15
|
-
return listName || name;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function FeatureListItem({
|
|
19
|
-
as: T = "div",
|
|
20
|
-
partAs: PartT = "span",
|
|
21
|
-
headAs: HeadT = FeatureListItemHead,
|
|
22
|
-
contentAs: ContentT = Fragment,
|
|
23
|
-
showFeatureListInfo,
|
|
24
|
-
feature,
|
|
25
|
-
selectFeature,
|
|
26
|
-
deselectFeatures,
|
|
27
|
-
enableKeyboardControl,
|
|
28
|
-
}) {
|
|
29
|
-
const {
|
|
30
|
-
selectOnClick,
|
|
31
|
-
deselectOnClick,
|
|
32
|
-
highlightOnMouse,
|
|
33
|
-
hidden,
|
|
34
|
-
isSelected,
|
|
35
|
-
isPreselected,
|
|
36
|
-
isHighlighted,
|
|
37
|
-
showDetails,
|
|
38
|
-
scrollOnSelection,
|
|
39
|
-
scrollOnPreselection,
|
|
40
|
-
} = useFeatureListItemState(feature);
|
|
41
|
-
|
|
42
|
-
/** @type {React.MutableRefObject<HTMLElement | null>} */
|
|
43
|
-
const ref = useRef(null);
|
|
44
|
-
|
|
45
|
-
useFeatureListItemScrollAndFocus(
|
|
46
|
-
ref,
|
|
47
|
-
showDetails,
|
|
48
|
-
isPreselected && !isSelected,
|
|
49
|
-
{
|
|
50
|
-
scrollOnSelection: scrollOnSelection,
|
|
51
|
-
scrollOnPreselection: scrollOnPreselection,
|
|
52
|
-
enableKeyboardControl: enableKeyboardControl,
|
|
53
|
-
},
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
if (hidden) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// if render type is not a native element but presumably a React component,
|
|
61
|
-
// pass some extra props to be used by said component
|
|
62
|
-
const isWrapperComponent = typeof T !== "string";
|
|
63
|
-
|
|
64
|
-
const wrapperProps = {
|
|
65
|
-
...(isWrapperComponent
|
|
66
|
-
? {
|
|
67
|
-
/* TODO: Which props? */
|
|
68
|
-
}
|
|
69
|
-
: null),
|
|
70
|
-
ref: ref,
|
|
71
|
-
className:
|
|
72
|
-
"ms3-list__item " +
|
|
73
|
-
(isSelected ? " ms3-list__item--selected" : "") +
|
|
74
|
-
(isPreselected ? " ms3-list__item--preselected" : "") +
|
|
75
|
-
(isHighlighted ? " ms3-list__item--highlight" : "") +
|
|
76
|
-
(showDetails ? " ms3-list__item--has-details" : "") +
|
|
77
|
-
(showFeatureListInfo ? " ms3-list__item--has-info" : "") +
|
|
78
|
-
(ref.current?.className.includes("focus-visible")
|
|
79
|
-
? " focus-visible"
|
|
80
|
-
: ""),
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
let info = null;
|
|
84
|
-
if (showFeatureListInfo) {
|
|
85
|
-
info = (
|
|
86
|
-
<PartT
|
|
87
|
-
className="ms3-list__info"
|
|
88
|
-
dangerouslySetInnerHTML={{
|
|
89
|
-
__html: getFeatureProperty(feature, "listInformation"),
|
|
90
|
-
}}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const showInfoInHead = selectOnClick === true;
|
|
96
|
-
|
|
97
|
-
let head;
|
|
98
|
-
let headHtml;
|
|
99
|
-
if (HeadT) {
|
|
100
|
-
// NOTE(PG): Legacy code to support list HTML from the source. Should
|
|
101
|
-
// probably be deprecated and replaced by a custom component
|
|
102
|
-
headHtml = getFeatureProperty(feature, "overrideListHtml");
|
|
103
|
-
|
|
104
|
-
if (!headHtml) {
|
|
105
|
-
head = (
|
|
106
|
-
<Fragment>
|
|
107
|
-
<FeatureListIcon
|
|
108
|
-
as="span"
|
|
109
|
-
mapsightIconId={getFeatureProperty(
|
|
110
|
-
feature,
|
|
111
|
-
"mapsightIconId",
|
|
112
|
-
)}
|
|
113
|
-
/>
|
|
114
|
-
<PartT
|
|
115
|
-
className={`ms3-list__main${
|
|
116
|
-
selectOnClick || deselectOnClick
|
|
117
|
-
? " ms3-list__main--selectable"
|
|
118
|
-
: ""
|
|
119
|
-
}`}
|
|
120
|
-
>
|
|
121
|
-
{getMainContentForFeature(feature)}
|
|
122
|
-
</PartT>
|
|
123
|
-
{showInfoInHead && info}
|
|
124
|
-
</Fragment>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
let details = null;
|
|
130
|
-
if (showDetails) {
|
|
131
|
-
details = (
|
|
132
|
-
<PartT className="ms3-list__details">
|
|
133
|
-
<FeatureDetailsContent feature={feature} />
|
|
134
|
-
</PartT>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<T {...wrapperProps}>
|
|
140
|
-
{HeadT && (
|
|
141
|
-
<HeadT
|
|
142
|
-
feature={feature}
|
|
143
|
-
isSelected={isSelected}
|
|
144
|
-
isHighlighted={isHighlighted}
|
|
145
|
-
highlightOnMouse={highlightOnMouse}
|
|
146
|
-
selectOnClick={selectOnClick}
|
|
147
|
-
deselectOnClick={deselectOnClick}
|
|
148
|
-
selectFeature={selectFeature}
|
|
149
|
-
deselectFeatures={deselectFeatures}
|
|
150
|
-
dangerouslySetInnerHTML={
|
|
151
|
-
headHtml ? {__html: headHtml} : undefined
|
|
152
|
-
}
|
|
153
|
-
className="ms3-list__item__head"
|
|
154
|
-
>
|
|
155
|
-
{head}
|
|
156
|
-
</HeadT>
|
|
157
|
-
)}
|
|
158
|
-
{ContentT && (
|
|
159
|
-
<ContentT>
|
|
160
|
-
{!showInfoInHead && info}
|
|
161
|
-
{details}
|
|
162
|
-
</ContentT>
|
|
163
|
-
)}
|
|
164
|
-
</T>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export default FeatureListItem;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type {ChangeEvent, ReactElement} from "react";
|
|
2
|
-
import {memo, useCallback, useState} from "react";
|
|
3
|
-
|
|
4
|
-
import {FocusTrap} from "focus-trap-react";
|
|
5
|
-
|
|
6
|
-
import {hasGeolocationSupport} from "@mapsight/core/lib/helpers";
|
|
7
|
-
|
|
8
|
-
import {translate} from "../../helpers/i18n";
|
|
9
|
-
import StatusIndicator from "./status-indicator";
|
|
10
|
-
|
|
11
|
-
export type MapsightUiPlace = {title: string; x: number; y: number; z?: number};
|
|
12
|
-
export type MapsightUiPlaceGroup = {
|
|
13
|
-
type: "group";
|
|
14
|
-
title: string;
|
|
15
|
-
entries: MapsightUiPlacesData;
|
|
16
|
-
};
|
|
17
|
-
export type MapsightUiPlacesData = Record<
|
|
18
|
-
string,
|
|
19
|
-
MapsightUiPlace | MapsightUiPlaceGroup
|
|
20
|
-
>;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param places places
|
|
24
|
-
* @param keyPath key path
|
|
25
|
-
* @returns option elements
|
|
26
|
-
*/
|
|
27
|
-
function renderOptions(
|
|
28
|
-
places: MapsightUiPlacesData,
|
|
29
|
-
keyPath: Array<string> = [],
|
|
30
|
-
): Array<ReactElement> {
|
|
31
|
-
return Object.entries(places).map(([key, place]) => {
|
|
32
|
-
const keyArr = [...keyPath, key];
|
|
33
|
-
const keyStr = keyArr.join(",");
|
|
34
|
-
|
|
35
|
-
if ("type" in place && place.type === "group") {
|
|
36
|
-
return (
|
|
37
|
-
<optgroup label={place.title} key={keyStr}>
|
|
38
|
-
{renderOptions(place.entries, keyArr)}
|
|
39
|
-
</optgroup>
|
|
40
|
-
);
|
|
41
|
-
} else {
|
|
42
|
-
return (
|
|
43
|
-
<option value={keyStr} key={keyStr}>
|
|
44
|
-
{place.title}
|
|
45
|
-
</option>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* NOTICE: using onChange instead of onBlur as the change occurs just below this input and should be clear */
|
|
52
|
-
function FeatureSorter({
|
|
53
|
-
places,
|
|
54
|
-
sorting,
|
|
55
|
-
geolocationStatus,
|
|
56
|
-
onChange,
|
|
57
|
-
requestGeolocation,
|
|
58
|
-
}: {
|
|
59
|
-
places: MapsightUiPlacesData;
|
|
60
|
-
sorting: string;
|
|
61
|
-
geolocationStatus: string;
|
|
62
|
-
onChange: (value: string) => void;
|
|
63
|
-
requestGeolocation: () => void;
|
|
64
|
-
}) {
|
|
65
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
66
|
-
|
|
67
|
-
const handleClose = useCallback(() => setIsOpen(false), []);
|
|
68
|
-
const toggleOpen = useCallback(() => setIsOpen((prev) => !prev), []);
|
|
69
|
-
|
|
70
|
-
const onSelectChange = useCallback(
|
|
71
|
-
(e: ChangeEvent<HTMLSelectElement>) => {
|
|
72
|
-
const newValue = e.target.value;
|
|
73
|
-
|
|
74
|
-
if (newValue === "geolocation") {
|
|
75
|
-
requestGeolocation();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
onChange(newValue);
|
|
79
|
-
},
|
|
80
|
-
[onChange, requestGeolocation],
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<div
|
|
85
|
-
className={`ms3-features-sorting ms3-features-sorting--${
|
|
86
|
-
isOpen ? "active" : "inactive"
|
|
87
|
-
}`}
|
|
88
|
-
>
|
|
89
|
-
<button
|
|
90
|
-
type="button"
|
|
91
|
-
className={
|
|
92
|
-
"ms3-filter-button " +
|
|
93
|
-
(isOpen
|
|
94
|
-
? " ms3-filter-button--icon-sort-active"
|
|
95
|
-
: " ms3-filter-button--icon-sort")
|
|
96
|
-
}
|
|
97
|
-
onClick={toggleOpen}
|
|
98
|
-
title={translate("ui.feature-list.sorting.announcements")}
|
|
99
|
-
>
|
|
100
|
-
<i>{isOpen ? translate("close") : translate("open")}</i>
|
|
101
|
-
</button>
|
|
102
|
-
|
|
103
|
-
<div>
|
|
104
|
-
{isOpen && (
|
|
105
|
-
<FocusTrap
|
|
106
|
-
focusTrapOptions={{
|
|
107
|
-
clickOutsideDeactivates: true,
|
|
108
|
-
onDeactivate: handleClose,
|
|
109
|
-
}}
|
|
110
|
-
>
|
|
111
|
-
<div className="ms3-features-sorting__panel">
|
|
112
|
-
{translate("ui.feature-list.sorting.byDistance")}
|
|
113
|
-
|
|
114
|
-
<select
|
|
115
|
-
value={sorting || ""}
|
|
116
|
-
onChange={onSelectChange}
|
|
117
|
-
>
|
|
118
|
-
<option value="">
|
|
119
|
-
{translate(
|
|
120
|
-
"ui.feature-list.sorting.choose",
|
|
121
|
-
)}
|
|
122
|
-
</option>
|
|
123
|
-
|
|
124
|
-
{hasGeolocationSupport && (
|
|
125
|
-
<option value="geolocation">
|
|
126
|
-
{translate(
|
|
127
|
-
"ui.feature-list.sorting.own",
|
|
128
|
-
)}
|
|
129
|
-
</option>
|
|
130
|
-
)}
|
|
131
|
-
|
|
132
|
-
{renderOptions(places)}
|
|
133
|
-
</select>
|
|
134
|
-
|
|
135
|
-
<StatusIndicator status={geolocationStatus} />
|
|
136
|
-
</div>
|
|
137
|
-
</FocusTrap>
|
|
138
|
-
)}
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export default memo(FeatureSorter);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {getGeolocation} from "@mapsight/core/lib/user-geolocation/actions";
|
|
4
|
-
import {geolocationStatusSelector} from "@mapsight/core/lib/user-geolocation/selectors";
|
|
5
|
-
|
|
6
|
-
import {USER_GEOLOCATION} from "../../config/constants/controllers";
|
|
7
|
-
import {sortList} from "../../store/actions";
|
|
8
|
-
import {listSortingSelector, placesSelector} from "../../store/selectors";
|
|
9
|
-
import FeatureSorter from "./feature-list-sorting";
|
|
10
|
-
|
|
11
|
-
export default connect(
|
|
12
|
-
(state) => ({
|
|
13
|
-
sorting: listSortingSelector(state),
|
|
14
|
-
places: placesSelector(state),
|
|
15
|
-
geolocationStatus: geolocationStatusSelector(state[USER_GEOLOCATION]),
|
|
16
|
-
}),
|
|
17
|
-
// dispatch map:
|
|
18
|
-
{
|
|
19
|
-
onChange: sortList,
|
|
20
|
-
requestGeolocation: getGeolocation,
|
|
21
|
-
},
|
|
22
|
-
)(FeatureSorter);
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {useCallback} from "react";
|
|
2
|
-
|
|
3
|
-
function FeatureSelectButton({
|
|
4
|
-
featureId,
|
|
5
|
-
onSelect = null,
|
|
6
|
-
onDeselect = null,
|
|
7
|
-
permanentLink = undefined,
|
|
8
|
-
isSelected = false,
|
|
9
|
-
selectOnClick = true,
|
|
10
|
-
deselectOnClick = true,
|
|
11
|
-
...attributes
|
|
12
|
-
}) {
|
|
13
|
-
const handleClick = useCallback(
|
|
14
|
-
(e) => {
|
|
15
|
-
if (permanentLink) {
|
|
16
|
-
if (e.which === 2 || e.metaKey) {
|
|
17
|
-
// Continue as normal for external links and cmd clicks etc
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
e.preventDefault();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (isSelected && deselectOnClick) {
|
|
24
|
-
if (onDeselect) {
|
|
25
|
-
onDeselect(featureId);
|
|
26
|
-
}
|
|
27
|
-
} else if (selectOnClick && onSelect) {
|
|
28
|
-
onSelect(featureId, {keyboard: false});
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
[
|
|
32
|
-
permanentLink,
|
|
33
|
-
isSelected,
|
|
34
|
-
deselectOnClick,
|
|
35
|
-
selectOnClick,
|
|
36
|
-
onDeselect,
|
|
37
|
-
featureId,
|
|
38
|
-
onSelect,
|
|
39
|
-
],
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const handleKeyDown = useCallback(
|
|
43
|
-
(e) => {
|
|
44
|
-
if (e.key === "Enter") {
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
|
|
47
|
-
if (selectOnClick && onSelect) {
|
|
48
|
-
onSelect(featureId, {keyboard: true});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
[selectOnClick, onSelect, featureId],
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
Object.assign(attributes, {
|
|
56
|
-
onClick: handleClick,
|
|
57
|
-
onKeyDown: handleKeyDown,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
if (permanentLink) {
|
|
61
|
-
return (
|
|
62
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
63
|
-
<a href={permanentLink} role="button" {...attributes} />
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return <button type="button" {...attributes} />;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default FeatureSelectButton;
|