@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,64 +0,0 @@
|
|
|
1
|
-
import {removeFrom} from "@mapsight/core/lib/base/actions";
|
|
2
|
-
import {useCallback} from "react";
|
|
3
|
-
import {useDispatch} from "react-redux";
|
|
4
|
-
import {FEATURE_SELECTIONS} from "../../config/constants/controllers";
|
|
5
|
-
import {FEATURE_SELECTION_SELECT} from "../../config/feature/selections";
|
|
6
|
-
|
|
7
|
-
import {translate} from "../../helpers/i18n";
|
|
8
|
-
import {
|
|
9
|
-
APP_EVENT_FOCUS_FEATURE_LIST,
|
|
10
|
-
useAppChannelDispatchEvent,
|
|
11
|
-
} from "../helping/app-channel";
|
|
12
|
-
|
|
13
|
-
function CloseButton({
|
|
14
|
-
feature,
|
|
15
|
-
enableKeyboardControl,
|
|
16
|
-
className = "",
|
|
17
|
-
...attrs
|
|
18
|
-
}) {
|
|
19
|
-
const dispatch = useDispatch();
|
|
20
|
-
const removeSelection = useCallback(() => {
|
|
21
|
-
console.log("click close fSI");
|
|
22
|
-
dispatch(
|
|
23
|
-
removeFrom(
|
|
24
|
-
[FEATURE_SELECTIONS, FEATURE_SELECTION_SELECT, "features"],
|
|
25
|
-
feature?.id,
|
|
26
|
-
),
|
|
27
|
-
);
|
|
28
|
-
}, [dispatch, feature?.id]);
|
|
29
|
-
|
|
30
|
-
const appChannelDispatch = useAppChannelDispatchEvent();
|
|
31
|
-
const handleCloseByKeyboard = useCallback(
|
|
32
|
-
/** @param {KeyboardEvent} ev ev */ (ev) => {
|
|
33
|
-
if (enableKeyboardControl) {
|
|
34
|
-
console.log("keyboard close fSI");
|
|
35
|
-
if (
|
|
36
|
-
ev.key === "Enter" ||
|
|
37
|
-
ev.key === "Spacebar" ||
|
|
38
|
-
ev.key === " "
|
|
39
|
-
) {
|
|
40
|
-
appChannelDispatch(new Event(APP_EVENT_FOCUS_FEATURE_LIST));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
[enableKeyboardControl, appChannelDispatch],
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<button
|
|
49
|
-
type="button"
|
|
50
|
-
className={`ms3-button ms3-feature-selection-info__close-button ${className}`}
|
|
51
|
-
onClick={removeSelection}
|
|
52
|
-
onKeyDown={handleCloseByKeyboard}
|
|
53
|
-
// TODO: ARIA
|
|
54
|
-
//aria-controls={}
|
|
55
|
-
{...attrs}
|
|
56
|
-
>
|
|
57
|
-
<span className="ms3-visuallyhidden">
|
|
58
|
-
{translate("ui.feature-selection-info.close")}
|
|
59
|
-
</span>
|
|
60
|
-
</button>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default CloseButton;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {memo} from "react";
|
|
2
|
-
|
|
3
|
-
import {makeReplaceableComponent} from "../../helpers/components";
|
|
4
|
-
import getFeatureProperty from "../../helpers/get-feature-property";
|
|
5
|
-
import type {MapsightUiFeature} from "../../types";
|
|
6
|
-
|
|
7
|
-
export type Props = {
|
|
8
|
-
feature: MapsightUiFeature;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const Header = memo(function FeatureSelectionInfoHeader({feature}: Props) {
|
|
12
|
-
const name = getFeatureProperty(feature, "name") as string;
|
|
13
|
-
return (
|
|
14
|
-
<header className="ms3-feature-selection-info__header">
|
|
15
|
-
<h3 className="ms3-feature-selection-info__headline">{name}</h3>
|
|
16
|
-
</header>
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export default makeReplaceableComponent("FeatureSelectionInfoHeader", Header);
|
|
21
|
-
export {Header as NonReplaceableHeader};
|
|
22
|
-
|
|
23
|
-
declare module "../../helpers/components" {
|
|
24
|
-
interface ComponentProps {
|
|
25
|
-
FeatureSelectionInfoHeader: Props;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {useCallback} from "react";
|
|
2
|
-
import {useDispatch, useSelector} from "react-redux";
|
|
3
|
-
|
|
4
|
-
import {FocusTrap} from "focus-trap-react";
|
|
5
|
-
|
|
6
|
-
import {removeFrom} from "@mapsight/core/lib/base/actions";
|
|
7
|
-
|
|
8
|
-
import {FEATURE_SELECTIONS} from "../../config/constants/controllers";
|
|
9
|
-
import {FEATURE_SELECTION_SELECT} from "../../config/feature/selections";
|
|
10
|
-
import {featureSelectionInfoUiOptionsSelector} from "../../store/selectors";
|
|
11
|
-
import type {MapsightUiFeature} from "../../types";
|
|
12
|
-
import FeatureDetailsContent from "../feature-details-content";
|
|
13
|
-
import CloseButton from "./close-button";
|
|
14
|
-
import Header from "./header";
|
|
15
|
-
import WithStickyHeader from "./with-sticky-header";
|
|
16
|
-
import WithoutStickyHeader from "./without-sticky-header";
|
|
17
|
-
import Wrapper from "./wrapper";
|
|
18
|
-
|
|
19
|
-
export default function FeatureSelectionInfo({
|
|
20
|
-
feature,
|
|
21
|
-
enableKeyboardControl,
|
|
22
|
-
}: {
|
|
23
|
-
feature: MapsightUiFeature | null;
|
|
24
|
-
enableKeyboardControl: boolean;
|
|
25
|
-
}) {
|
|
26
|
-
const dispatch = useDispatch();
|
|
27
|
-
const hasStickyHeader = useSelector(
|
|
28
|
-
featureSelectionInfoUiOptionsSelector,
|
|
29
|
-
).stickyHeader;
|
|
30
|
-
const renderWrapper = useCallback(
|
|
31
|
-
(attrs) => (
|
|
32
|
-
<Wrapper
|
|
33
|
-
feature={feature}
|
|
34
|
-
enableKeyboardControl={enableKeyboardControl}
|
|
35
|
-
{...attrs}
|
|
36
|
-
/>
|
|
37
|
-
),
|
|
38
|
-
[enableKeyboardControl, feature],
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const removeSelection = useCallback(() => {
|
|
42
|
-
dispatch(
|
|
43
|
-
removeFrom(
|
|
44
|
-
[FEATURE_SELECTIONS, FEATURE_SELECTION_SELECT, "features"],
|
|
45
|
-
feature?.id,
|
|
46
|
-
),
|
|
47
|
-
);
|
|
48
|
-
}, [dispatch, feature?.id]);
|
|
49
|
-
|
|
50
|
-
if (!feature) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const T = hasStickyHeader ? WithStickyHeader : WithoutStickyHeader;
|
|
55
|
-
return (
|
|
56
|
-
<FocusTrap
|
|
57
|
-
active={enableKeyboardControl}
|
|
58
|
-
focusTrapOptions={{
|
|
59
|
-
clickOutsideDeactivates: true,
|
|
60
|
-
onDeactivate: removeSelection,
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
<T
|
|
64
|
-
feature={feature}
|
|
65
|
-
close={
|
|
66
|
-
<CloseButton
|
|
67
|
-
feature={feature}
|
|
68
|
-
enableKeyboardControl={enableKeyboardControl}
|
|
69
|
-
/>
|
|
70
|
-
}
|
|
71
|
-
header={<Header feature={feature} />}
|
|
72
|
-
content={
|
|
73
|
-
<div className="ms3-feature-selection-info__content">
|
|
74
|
-
<FeatureDetailsContent feature={feature} />
|
|
75
|
-
</div>
|
|
76
|
-
}
|
|
77
|
-
renderWrapper={renderWrapper}
|
|
78
|
-
/>
|
|
79
|
-
</FocusTrap>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type {ReactNode} from "react";
|
|
2
|
-
import {useSelector} from "react-redux";
|
|
3
|
-
|
|
4
|
-
import useStickyHeader from "../../hooks/useStickyHeader";
|
|
5
|
-
import {featureSelectionInfoUiOptionsSelector} from "../../store/selectors";
|
|
6
|
-
import type {MapsightUiFeature} from "../../types";
|
|
7
|
-
import Container from "./container";
|
|
8
|
-
|
|
9
|
-
const stopEventPropagation = (e) => e.stopPropagation();
|
|
10
|
-
|
|
11
|
-
type WithStickyHeaderProps = {
|
|
12
|
-
header: ReactNode;
|
|
13
|
-
feature: MapsightUiFeature;
|
|
14
|
-
content: ReactNode;
|
|
15
|
-
close: ReactNode;
|
|
16
|
-
renderWrapper: (props: any) => ReactNode;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function WithStickyHeader({
|
|
20
|
-
header,
|
|
21
|
-
content,
|
|
22
|
-
feature,
|
|
23
|
-
close,
|
|
24
|
-
renderWrapper,
|
|
25
|
-
}: WithStickyHeaderProps) {
|
|
26
|
-
const {stuckHeaderHeight} = useSelector(
|
|
27
|
-
featureSelectionInfoUiOptionsSelector,
|
|
28
|
-
);
|
|
29
|
-
const {isHeaderStuck, stickyHeaderRef, stickyScrollAreaRef, onScroll} =
|
|
30
|
-
useStickyHeader<HTMLDivElement>({
|
|
31
|
-
stuckHeaderHeight,
|
|
32
|
-
resetDeps: [feature.id],
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const stuckClass = (prefix) =>
|
|
36
|
-
prefix + " " + (isHeaderStuck ? prefix + "--stuck" : "");
|
|
37
|
-
const stuckHeaderClasses = `ms3-sticky-header__header ${
|
|
38
|
-
isHeaderStuck
|
|
39
|
-
? "ms3-sticky-header__header--stuck"
|
|
40
|
-
: "ms3-sticky-header__header--stuck-placeholder"
|
|
41
|
-
}`;
|
|
42
|
-
const stickyHeaderClasses = `ms3-sticky-header__header ${
|
|
43
|
-
isHeaderStuck
|
|
44
|
-
? "ms3-sticky-header__header--sticky-placeholder"
|
|
45
|
-
: "ms3-sticky-header__header--sticky"
|
|
46
|
-
}`;
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<Container className={stuckClass("ms3-sticky-header__container")}>
|
|
50
|
-
<div aria-hidden="true" className={stuckHeaderClasses}>
|
|
51
|
-
{header}
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
{renderWrapper({
|
|
55
|
-
ref: stickyScrollAreaRef,
|
|
56
|
-
className: stuckClass("ms3-sticky-header__scroll-area"),
|
|
57
|
-
onTouchMove: stopEventPropagation,
|
|
58
|
-
onScroll: onScroll,
|
|
59
|
-
children: (
|
|
60
|
-
<>
|
|
61
|
-
{close}
|
|
62
|
-
<div
|
|
63
|
-
className={stickyHeaderClasses}
|
|
64
|
-
ref={stickyHeaderRef}
|
|
65
|
-
>
|
|
66
|
-
{header}
|
|
67
|
-
</div>
|
|
68
|
-
{content}
|
|
69
|
-
</>
|
|
70
|
-
),
|
|
71
|
-
})}
|
|
72
|
-
</Container>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default WithStickyHeader;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import Container from "./container";
|
|
2
|
-
|
|
3
|
-
function WithoutStickyHeader({renderWrapper, header, content, close}) {
|
|
4
|
-
return (
|
|
5
|
-
<Container>
|
|
6
|
-
{renderWrapper({
|
|
7
|
-
children: (
|
|
8
|
-
<>
|
|
9
|
-
{close}
|
|
10
|
-
{header}
|
|
11
|
-
{content}
|
|
12
|
-
</>
|
|
13
|
-
),
|
|
14
|
-
})}
|
|
15
|
-
</Container>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default WithoutStickyHeader;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {forwardRef, useEffect, useRef} from "react";
|
|
2
|
-
|
|
3
|
-
import usePrevious from "../../hooks/usePrevious";
|
|
4
|
-
|
|
5
|
-
function useAutofocus(enabled, ref, feature) {
|
|
6
|
-
const previousFeature = usePrevious(feature);
|
|
7
|
-
const previousRef = usePrevious(ref.current);
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (!enabled || !feature || !ref.current) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Autofocus on mount or if feature is selected
|
|
15
|
-
if (
|
|
16
|
-
feature &&
|
|
17
|
-
(ref.current !== previousRef || feature !== previousFeature)
|
|
18
|
-
) {
|
|
19
|
-
//ref.current.scrollIntoView({block: 'start', behavior: 'smooth'});
|
|
20
|
-
ref.current.focus({preventScroll: true});
|
|
21
|
-
}
|
|
22
|
-
}, [enabled, feature, previousFeature, previousRef, ref]);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const Wrapper = forwardRef(function Wrapper(
|
|
26
|
-
{enableKeyboardControl, feature, className = "", ...attrs},
|
|
27
|
-
forwardedRef,
|
|
28
|
-
) {
|
|
29
|
-
const ownRef = useRef();
|
|
30
|
-
const ref = forwardedRef || ownRef;
|
|
31
|
-
useAutofocus(enableKeyboardControl, ref, feature);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={`ms3-feature-selection-info__wrapper ms3-scroll-target ${className}`}
|
|
37
|
-
tabIndex={enableKeyboardControl ? -1 : undefined}
|
|
38
|
-
{...attrs}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export default Wrapper;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ReactNode,
|
|
3
|
-
createContext,
|
|
4
|
-
useCallback,
|
|
5
|
-
useContext,
|
|
6
|
-
useEffect,
|
|
7
|
-
useMemo,
|
|
8
|
-
} from "react";
|
|
9
|
-
|
|
10
|
-
import type {AppChannelListenerDefinition} from "../../types";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* App-wide event channel
|
|
14
|
-
*/
|
|
15
|
-
const AppChannelContext = createContext<EventTarget | null>(null);
|
|
16
|
-
AppChannelContext.displayName = "AppChannelContext";
|
|
17
|
-
|
|
18
|
-
export const APP_EVENT_PARTIAL_CONTENT_CHANGED = "partialContentChanged";
|
|
19
|
-
export const APP_EVENT_FOCUS_MAP = "focusMap";
|
|
20
|
-
export const APP_EVENT_FOCUS_FEATURE_LIST = "focusFeatureList";
|
|
21
|
-
export const APP_EVENT_SCROLL_TO_MAP = "scrollToMap";
|
|
22
|
-
export const APP_EVENT_SCROLL_TO_FEATURE_LIST = "scrollToFeatureList";
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @returns {EventTarget} app channel
|
|
26
|
-
*/
|
|
27
|
-
function createAppChannel() {
|
|
28
|
-
return new EventTarget();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function AppChannelProvider({
|
|
32
|
-
children,
|
|
33
|
-
listeners = [],
|
|
34
|
-
}: {
|
|
35
|
-
children?: ReactNode;
|
|
36
|
-
listeners?: AppChannelListenerDefinition[];
|
|
37
|
-
}) {
|
|
38
|
-
const appChannel = useMemo(() => createAppChannel(), []);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
listeners.forEach(([eventName, eventListener]) => {
|
|
42
|
-
appChannel.addEventListener(eventName, eventListener);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
return () => {
|
|
46
|
-
listeners.forEach(([eventName, eventListener]) => {
|
|
47
|
-
appChannel.removeEventListener(eventName, eventListener);
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
}, [appChannel, listeners]);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<AppChannelContext.Provider value={appChannel}>
|
|
54
|
-
{children}
|
|
55
|
-
</AppChannelContext.Provider>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* App-wide event channel
|
|
61
|
-
*
|
|
62
|
-
* @returns {EventTarget} app channel
|
|
63
|
-
*/
|
|
64
|
-
function useAppChannel() {
|
|
65
|
-
return useContext(AppChannelContext);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @returns {(Event) => void} dispatch function for the app channel
|
|
70
|
-
*/
|
|
71
|
-
export function useAppChannelDispatchEvent() {
|
|
72
|
-
const appChannel = useAppChannel();
|
|
73
|
-
|
|
74
|
-
return useCallback(
|
|
75
|
-
(event) => {
|
|
76
|
-
console.info("@mapsight/ui: app channel event", event.type, event);
|
|
77
|
-
appChannel?.dispatchEvent(event);
|
|
78
|
-
},
|
|
79
|
-
[appChannel],
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Adds and removes event listener to the app channel
|
|
85
|
-
*
|
|
86
|
-
* @param {string} event event name
|
|
87
|
-
* @param {EventListener} eventListener event listener
|
|
88
|
-
*/
|
|
89
|
-
export function useAppChannelEventListener(event, eventListener) {
|
|
90
|
-
const appChannel = useAppChannel();
|
|
91
|
-
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
appChannel?.addEventListener(event, eventListener);
|
|
94
|
-
|
|
95
|
-
return () => {
|
|
96
|
-
appChannel?.removeEventListener(event, eventListener);
|
|
97
|
-
};
|
|
98
|
-
}, [appChannel, event, eventListener]);
|
|
99
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {Provider as ReduxProvider} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import type {Store} from "@reduxjs/toolkit";
|
|
4
|
-
|
|
5
|
-
import type {MapsightUiComponents} from "../../helpers/components";
|
|
6
|
-
import {ComponentsContext} from "../../helpers/components";
|
|
7
|
-
import type {AppChannelListenerDefinition} from "../../types";
|
|
8
|
-
import {AppChannelProvider} from "./app-channel";
|
|
9
|
-
|
|
10
|
-
function AppContext({
|
|
11
|
-
store,
|
|
12
|
-
components = {},
|
|
13
|
-
appChannelListeners = [],
|
|
14
|
-
children,
|
|
15
|
-
}: {
|
|
16
|
-
store: Store;
|
|
17
|
-
components?: MapsightUiComponents;
|
|
18
|
-
appChannelListeners?: AppChannelListenerDefinition[];
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
}) {
|
|
21
|
-
return (
|
|
22
|
-
<ReduxProvider store={store}>
|
|
23
|
-
<AppChannelProvider listeners={appChannelListeners}>
|
|
24
|
-
<ComponentsContext.Provider value={components}>
|
|
25
|
-
{children}
|
|
26
|
-
</ComponentsContext.Provider>
|
|
27
|
-
</AppChannelProvider>
|
|
28
|
-
</ReduxProvider>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default AppContext;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {Fragment, memo} from "react";
|
|
2
|
-
import {useSelector} from "react-redux";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* VisibilityWrapper
|
|
6
|
-
*
|
|
7
|
-
* @param {{
|
|
8
|
-
* visibleSelector: (state: any) => boolean,
|
|
9
|
-
* children: React.ReactNode
|
|
10
|
-
* }} props props
|
|
11
|
-
* @returns {React.ReactElement | null} element
|
|
12
|
-
*/
|
|
13
|
-
function VisibilityWrapper({children, visibleSelector}) {
|
|
14
|
-
const visible = useSelector(visibleSelector);
|
|
15
|
-
if (visible) {
|
|
16
|
-
// we're using `Fragment` here to convert `ReactNode` to a `ReactElement`
|
|
17
|
-
return <Fragment>{children}</Fragment>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default memo(VisibilityWrapper);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type {PropsWithChildren} from "react";
|
|
4
|
-
import {useMemo} from "react";
|
|
5
|
-
|
|
6
|
-
import type {EnhancedStore, State} from "@mapsight/core/types";
|
|
7
|
-
|
|
8
|
-
import type {MapsightStyleFunction} from "@mapsight/lib-ol/style/styleFunction";
|
|
9
|
-
|
|
10
|
-
import {create} from "../index";
|
|
11
|
-
import type {CreateOptions} from "../types";
|
|
12
|
-
import AppContext from "./helping/app-context";
|
|
13
|
-
|
|
14
|
-
function MapsightUi({
|
|
15
|
-
children,
|
|
16
|
-
styleFunction,
|
|
17
|
-
baseMapsightConfig,
|
|
18
|
-
createOptions,
|
|
19
|
-
}: PropsWithChildren<{
|
|
20
|
-
styleFunction: MapsightStyleFunction;
|
|
21
|
-
baseMapsightConfig: Partial<State>;
|
|
22
|
-
createOptions: CreateOptions;
|
|
23
|
-
}>) {
|
|
24
|
-
const context = useMemo(
|
|
25
|
-
() =>
|
|
26
|
-
create(
|
|
27
|
-
null, // FIXME allow passing null?!
|
|
28
|
-
styleFunction,
|
|
29
|
-
baseMapsightConfig,
|
|
30
|
-
createOptions,
|
|
31
|
-
),
|
|
32
|
-
[baseMapsightConfig, createOptions, styleFunction],
|
|
33
|
-
);
|
|
34
|
-
const {components = {}, appChannelListeners = []} = createOptions;
|
|
35
|
-
const {store} = context;
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<AppContext
|
|
39
|
-
components={components}
|
|
40
|
-
store={store as EnhancedStore}
|
|
41
|
-
appChannelListeners={appChannelListeners}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
</AppContext>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default MapsightUi;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {connect, shallowEqual} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {createSelector} from "@reduxjs/toolkit";
|
|
4
|
-
|
|
5
|
-
import {MAP} from "../../config/constants/controllers";
|
|
6
|
-
import GroupedSwitcher from "../switcher/GroupedSwitcher";
|
|
7
|
-
|
|
8
|
-
function getGroupedIdsForIds(ids, layersState) {
|
|
9
|
-
const groupedLayerIds = {};
|
|
10
|
-
const withoutGroupLayerIds = [];
|
|
11
|
-
ids.forEach((layerId) => {
|
|
12
|
-
const group = layersState[layerId].metaData.group;
|
|
13
|
-
|
|
14
|
-
if (!group) {
|
|
15
|
-
withoutGroupLayerIds.push(layerId);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
groupedLayerIds[group] = groupedLayerIds[group] || [];
|
|
20
|
-
groupedLayerIds[group].push(layerId);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
ungroupedIds: withoutGroupLayerIds,
|
|
25
|
-
groupedIds: groupedLayerIds,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const GroupedLayerSwitcher = connect(
|
|
30
|
-
createSelector(
|
|
31
|
-
(state, {layerIdsSelector}) => layerIdsSelector(state[MAP]),
|
|
32
|
-
(state) => state[MAP].layers,
|
|
33
|
-
getGroupedIdsForIds,
|
|
34
|
-
),
|
|
35
|
-
null,
|
|
36
|
-
(
|
|
37
|
-
stateProps,
|
|
38
|
-
dispatchProps,
|
|
39
|
-
{layerIdsSelector: _layerIdsSelector, ...ownProps},
|
|
40
|
-
) => ({
|
|
41
|
-
...ownProps,
|
|
42
|
-
...stateProps,
|
|
43
|
-
}),
|
|
44
|
-
{areStatesEqual: shallowEqual},
|
|
45
|
-
)(GroupedSwitcher);
|
|
46
|
-
|
|
47
|
-
export default GroupedLayerSwitcher;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import type {MapState} from "@mapsight/core/lib/map/types";
|
|
4
|
-
import type {State} from "@mapsight/core/types";
|
|
5
|
-
|
|
6
|
-
import {MAP} from "../../config/constants/controllers";
|
|
7
|
-
import Switcher from "../switcher/Switcher";
|
|
8
|
-
|
|
9
|
-
const selector = (
|
|
10
|
-
state: State,
|
|
11
|
-
{layerIdsSelector}: {layerIdsSelector: (state: MapState) => string[]},
|
|
12
|
-
) =>
|
|
13
|
-
({
|
|
14
|
-
ids: layerIdsSelector(state[MAP] as MapState),
|
|
15
|
-
}) as const;
|
|
16
|
-
|
|
17
|
-
export default connect(
|
|
18
|
-
selector,
|
|
19
|
-
null,
|
|
20
|
-
(
|
|
21
|
-
stateProps,
|
|
22
|
-
_,
|
|
23
|
-
{
|
|
24
|
-
// Need to list the selectors here so they do not get passed as attribute props to the element but get filtered:
|
|
25
|
-
layerIdsSelector: _layerIdsSelector,
|
|
26
|
-
|
|
27
|
-
...attributes
|
|
28
|
-
},
|
|
29
|
-
) => ({
|
|
30
|
-
// We do not want to pass dispatch to the switcher, so we explicitly do not map it!
|
|
31
|
-
...stateProps,
|
|
32
|
-
...attributes,
|
|
33
|
-
}),
|
|
34
|
-
)(Switcher);
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type {ElementType} from "react";
|
|
2
|
-
import {memo, useCallback} from "react";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
layerIdsIntegratedSwitcherSelector,
|
|
6
|
-
makeFeatureSourceFromLayerIdSelector,
|
|
7
|
-
makeFeatureSourceIdFromLayerIdSelector,
|
|
8
|
-
makeLayerLockedInLayerSwitcherSelector,
|
|
9
|
-
makeLayerTitleSelector,
|
|
10
|
-
makeLayerVisibleSelector,
|
|
11
|
-
} from "@mapsight/core/lib/map/selectors";
|
|
12
|
-
import type {MapState} from "@mapsight/core/lib/map/types";
|
|
13
|
-
|
|
14
|
-
import {translate} from "../../helpers/i18n";
|
|
15
|
-
import GroupedLayerSwitcher from "./GroupedLayerSwitcher";
|
|
16
|
-
import LayerSwitcher from "./LayerSwitcher";
|
|
17
|
-
import LayerSwitcherEntry from "./LayerSwitcherEntry";
|
|
18
|
-
|
|
19
|
-
// TODO das berechnen der LayerListen (abhängig von grouped und layerIdSelector) in einen Selector packen,
|
|
20
|
-
// damit diese Berechnung nur bei Änderungen am store berechnet neu wird
|
|
21
|
-
// TODO für das visible eine eigenes connect, damit der Tree nicht dauernd neu berechnet wird
|
|
22
|
-
|
|
23
|
-
export type LayerSwitcherContainerProps = {
|
|
24
|
-
as?: ElementType;
|
|
25
|
-
baseClassName?: string;
|
|
26
|
-
onClose?: () => void;
|
|
27
|
-
layerIdsSelector?: (state: MapState) => string[];
|
|
28
|
-
grouped?: boolean;
|
|
29
|
-
setFeatureSourceIdPath?: unknown;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
function LayerSwitcherContainer({
|
|
33
|
-
as: T = "div",
|
|
34
|
-
baseClassName = "ms3-layer-switcher-container", // TODO: Use generic class name
|
|
35
|
-
onClose,
|
|
36
|
-
layerIdsSelector = layerIdsIntegratedSwitcherSelector,
|
|
37
|
-
grouped = false,
|
|
38
|
-
setFeatureSourceIdPath: _,
|
|
39
|
-
...attributes
|
|
40
|
-
}: LayerSwitcherContainerProps) {
|
|
41
|
-
const renderLayerEntry = useCallback(
|
|
42
|
-
(id) => (
|
|
43
|
-
// TODO: memo comp instance & selectors
|
|
44
|
-
<LayerSwitcherEntry
|
|
45
|
-
key={id}
|
|
46
|
-
layerId={id}
|
|
47
|
-
titleSelector={makeLayerTitleSelector(id)}
|
|
48
|
-
lockedSelector={makeLayerLockedInLayerSwitcherSelector(id)}
|
|
49
|
-
layerVisibilitySelector={makeLayerVisibleSelector(id)}
|
|
50
|
-
featureSourceSelector={makeFeatureSourceFromLayerIdSelector(id)}
|
|
51
|
-
featureSourceIdSelector={makeFeatureSourceIdFromLayerIdSelector(
|
|
52
|
-
id,
|
|
53
|
-
)}
|
|
54
|
-
/>
|
|
55
|
-
),
|
|
56
|
-
[],
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
const Switcher = grouped ? GroupedLayerSwitcher : LayerSwitcher;
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<T
|
|
63
|
-
className={`${baseClassName} ${baseClassName}--${
|
|
64
|
-
grouped ? "grouped" : "ungrouped"
|
|
65
|
-
}`}
|
|
66
|
-
>
|
|
67
|
-
<Switcher
|
|
68
|
-
layerIdsSelector={layerIdsSelector}
|
|
69
|
-
renderEntry={renderLayerEntry}
|
|
70
|
-
{...attributes}
|
|
71
|
-
/>
|
|
72
|
-
|
|
73
|
-
{onClose && (
|
|
74
|
-
<button
|
|
75
|
-
className="ms3-layer-switcher__close-button [ ms3-dialog-close-button ]"
|
|
76
|
-
type="button"
|
|
77
|
-
onClick={onClose}
|
|
78
|
-
>
|
|
79
|
-
<span className="ms3-visuallyhidden">
|
|
80
|
-
{translate("ui.map-overlay.layer-switcher.closeLayers")}
|
|
81
|
-
</span>
|
|
82
|
-
</button>
|
|
83
|
-
)}
|
|
84
|
-
</T>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export default memo(LayerSwitcherContainer);
|