@mapsight/ui 7.0.3 → 7.1.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/dist/components/app.d.ts +2 -2
- package/dist/components/app.d.ts.map +1 -1
- package/dist/components/app.js +7 -7
- package/dist/components/app.js.map +1 -1
- package/dist/components/feature-details-content/feature-details-content.js +2 -2
- package/dist/components/feature-details-content/feature-details-content.js.map +1 -1
- package/dist/components/feature-details-content/index.d.ts +3 -5
- package/dist/components/feature-details-content/index.js +6 -7
- package/dist/components/feature-details-content/index.js.map +1 -1
- package/dist/components/feature-list/filter.js +2 -2
- package/dist/components/feature-list/filter.js.map +1 -1
- package/dist/components/feature-list/hooks/useFeatureListState.d.ts.map +1 -1
- package/dist/components/feature-list/hooks/useFeatureListState.js +7 -2
- package/dist/components/feature-list/hooks/useFeatureListState.js.map +1 -1
- package/dist/components/feature-list/hooks/useRestoreDocumentScroll.js +1 -1
- package/dist/components/feature-list/hooks/useRestoreDocumentScroll.js.map +1 -1
- package/dist/components/feature-list/hooks/useSelectFeature.js +6 -6
- package/dist/components/feature-list/hooks/useSelectFeature.js.map +1 -1
- package/dist/components/feature-list/index.js +4 -4
- package/dist/components/feature-list/index.js.map +1 -1
- package/dist/components/feature-list-cycling/index.d.ts +3 -5
- package/dist/components/feature-list-cycling/index.js +1 -1
- package/dist/components/feature-list-cycling/index.js.map +1 -1
- package/dist/components/feature-list-sorting/index.d.ts +4 -16
- package/dist/components/feature-list-sorting/index.d.ts.map +1 -1
- package/dist/components/feature-list-sorting/index.js +6 -7
- package/dist/components/feature-list-sorting/index.js.map +1 -1
- package/dist/components/feature-selection-info/index.js +2 -2
- package/dist/components/feature-selection-info/index.js.map +1 -1
- package/dist/components/feature-selection-info/with-sticky-header.d.ts +10 -7
- package/dist/components/feature-selection-info/with-sticky-header.d.ts.map +1 -1
- package/dist/components/feature-selection-info/with-sticky-header.js +4 -4
- package/dist/components/feature-selection-info/with-sticky-header.js.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/layer-switcher/GroupedLayerSwitcher.js +1 -1
- package/dist/components/layer-switcher/GroupedLayerSwitcher.js.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.d.ts +12 -11
- package/dist/components/layer-switcher/LayerSwitcher.d.ts.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.js +1 -1
- package/dist/components/layer-switcher/LayerSwitcher.js.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts +15 -0
- package/dist/components/layer-switcher/LayerSwitcherContainer.d.ts.map +1 -0
- package/dist/components/layer-switcher/{LayerSwticherContainer.js → LayerSwitcherContainer.js} +5 -9
- package/dist/components/layer-switcher/LayerSwitcherContainer.js.map +1 -0
- package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts +28 -12
- package/dist/components/layer-switcher/LayerSwitcherEntry.d.ts.map +1 -1
- package/dist/components/layer-switcher/LayerSwitcherEntry.js +33 -35
- package/dist/components/layer-switcher/LayerSwitcherEntry.js.map +1 -1
- package/dist/components/layer-switcher/index.d.ts +9 -2
- package/dist/components/layer-switcher/index.d.ts.map +1 -1
- package/dist/components/layer-switcher/index.js +12 -21
- package/dist/components/layer-switcher/index.js.map +1 -1
- package/dist/components/layout/wrapper.js +1 -1
- package/dist/components/layout/wrapper.js.map +1 -1
- package/dist/components/main-panel/context.d.ts +6 -5
- package/dist/components/main-panel/context.d.ts.map +1 -1
- package/dist/components/main-panel/context.js +5 -13
- package/dist/components/main-panel/context.js.map +1 -1
- package/dist/components/main-panel/list-toggle-button.js +2 -2
- package/dist/components/main-panel/list-toggle-button.js.map +1 -1
- package/dist/components/map-overlay/attribution.js +1 -1
- package/dist/components/map-overlay/attribution.js.map +1 -1
- package/dist/components/map-overlay/info-overlay-left.js +2 -2
- package/dist/components/map-overlay/info-overlay-left.js.map +1 -1
- package/dist/components/map-overlay/info-overlay-right.js +2 -2
- package/dist/components/map-overlay/info-overlay-right.js.map +1 -1
- package/dist/components/map-overlay/legend.js +1 -1
- package/dist/components/map-overlay/legend.js.map +1 -1
- package/dist/components/map-overlay/measure-distance-button.js +1 -1
- package/dist/components/map-overlay/measure-distance-button.js.map +1 -1
- package/dist/components/map-overlay/mini-legend.js +2 -2
- package/dist/components/map-overlay/mini-legend.js.map +1 -1
- package/dist/components/map-overlay/region-selector.js +2 -2
- package/dist/components/map-overlay/region-selector.js.map +1 -1
- package/dist/components/map-overlay/search-overlay.js +1 -1
- package/dist/components/map-overlay/search-overlay.js.map +1 -1
- package/dist/components/map-overlay/share-position-link-button.js +1 -1
- package/dist/components/map-overlay/share-position-link-button.js.map +1 -1
- package/dist/components/map-synced-interlay/index.d.ts +2 -5
- package/dist/components/map-synced-interlay/index.d.ts.map +1 -1
- package/dist/components/map-synced-interlay/index.js +5 -6
- package/dist/components/map-synced-interlay/index.js.map +1 -1
- package/dist/components/map-synced-interlay/map-synced-interlay.js +1 -1
- package/dist/components/map-synced-interlay/map-synced-interlay.js.map +1 -1
- package/dist/components/map-synced-interlay/tooltip.js +1 -1
- package/dist/components/map-synced-interlay/tooltip.js.map +1 -1
- package/dist/components/map.d.ts +6 -5
- package/dist/components/map.d.ts.map +1 -1
- package/dist/components/map.js +15 -5
- package/dist/components/map.js.map +1 -1
- package/dist/components/search/index.js +2 -2
- package/dist/components/search/index.js.map +1 -1
- package/dist/components/search/result-entry.js +1 -1
- package/dist/components/search/result-entry.js.map +1 -1
- package/dist/components/search/result.js +1 -1
- package/dist/components/search/result.js.map +1 -1
- package/dist/components/switcher/SwitcherEntry.d.ts +21 -3
- package/dist/components/switcher/SwitcherEntry.d.ts.map +1 -1
- package/dist/components/switcher/SwitcherEntry.js +8 -9
- package/dist/components/switcher/SwitcherEntry.js.map +1 -1
- package/dist/components/tag-switcher/TagSwitcher.d.ts +2 -2
- package/dist/components/tag-switcher/TagSwitcher.d.ts.map +1 -1
- package/dist/components/tag-switcher/TagSwitcher.js.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts +13 -11
- package/dist/components/tag-switcher/createTagSwitcherEntry.d.ts.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherEntry.js +6 -12
- package/dist/components/tag-switcher/createTagSwitcherEntry.js.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts +12 -10
- package/dist/components/tag-switcher/createTagSwitcherHeader.d.ts.map +1 -1
- package/dist/components/tag-switcher/createTagSwitcherHeader.js +5 -5
- package/dist/components/tag-switcher/createTagSwitcherHeader.js.map +1 -1
- package/dist/components/tag-switcher/index.d.ts +2 -5
- package/dist/components/tag-switcher/index.d.ts.map +1 -1
- package/dist/components/tag-switcher/index.js +6 -7
- package/dist/components/tag-switcher/index.js.map +1 -1
- package/dist/components/view-toggle-button/index.d.ts +6 -5
- package/dist/components/view-toggle-button/index.d.ts.map +1 -1
- package/dist/components/view-toggle-button/index.js +8 -8
- package/dist/components/view-toggle-button/index.js.map +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/mobile-button.js.map +1 -1
- package/dist/components/view-toggle-button/view-toggle-button.js +1 -1
- package/dist/components/view-toggle-button/view-toggle-button.js.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/components/view-toggle-button/viewport-button.js.map +1 -1
- package/dist/helpers/components.d.ts +1 -1
- package/dist/helpers/components.d.ts.map +1 -1
- package/dist/helpers/create-action-watcher.d.ts +1 -1
- package/dist/helpers/create-action-watcher.d.ts.map +1 -1
- package/dist/helpers/create-action-watcher.js +1 -1
- package/dist/helpers/create-action-watcher.js.map +1 -1
- package/dist/hooks/useMountable.d.ts +2 -2
- package/dist/hooks/useMountable.d.ts.map +1 -1
- package/dist/hooks/useMountable.js +6 -0
- package/dist/hooks/useMountable.js.map +1 -1
- package/dist/hooks/useStickyHeader.d.ts +3 -3
- package/dist/hooks/useStickyHeader.d.ts.map +1 -1
- package/dist/hooks/useStickyHeader.js +3 -3
- package/dist/hooks/useStickyHeader.js.map +1 -1
- package/dist/hooks/useUpdateMapSizeCallback.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeCallback.d.ts.map +1 -1
- package/dist/hooks/useUpdateMapSizeOnRender.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeOnRender.d.ts.map +1 -1
- package/dist/hooks/useUpdateMapSizeOnTransitionEnd.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeOnTransitionEnd.d.ts.map +1 -1
- package/dist/hooks/useUpdateMapSizeOnViewChange.d.ts +1 -1
- package/dist/hooks/useUpdateMapSizeOnViewChange.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/browser/app-title.d.ts +1 -1
- package/dist/plugins/browser/app-title.d.ts.map +1 -1
- package/dist/plugins/browser/feature-deep-link.d.ts +1 -1
- package/dist/plugins/browser/feature-deep-link.d.ts.map +1 -1
- package/dist/plugins/browser/feature-deep-link.js.map +1 -1
- package/dist/plugins/browser/local-storage.d.ts +1 -1
- package/dist/plugins/browser/local-storage.d.ts.map +1 -1
- package/dist/plugins/browser/native-fullscreen.d.ts +2 -2
- package/dist/plugins/browser/native-fullscreen.d.ts.map +1 -1
- package/dist/plugins/browser/no-scroll.d.ts +3 -4
- package/dist/plugins/browser/no-scroll.d.ts.map +1 -1
- package/dist/plugins/browser/no-scroll.js.map +1 -1
- package/dist/plugins/browser/partial-content-changed-event.d.ts +1 -1
- package/dist/plugins/browser/partial-content-changed-event.d.ts.map +1 -1
- package/dist/plugins/browser/piwik-track-feature-selection-event.d.ts +1 -1
- package/dist/plugins/browser/piwik-track-feature-selection-event.d.ts.map +1 -1
- package/dist/plugins/browser/piwik-track-fullscreen-toggle-event.d.ts +1 -1
- package/dist/plugins/browser/piwik-track-fullscreen-toggle-event.d.ts.map +1 -1
- package/dist/plugins/browser/search.d.ts +1 -1
- package/dist/plugins/browser/search.d.ts.map +1 -1
- package/dist/plugins/browser/share-position-link.d.ts +1 -1
- package/dist/plugins/browser/share-position-link.d.ts.map +1 -1
- package/dist/plugins/browser/share-position-link.js +1 -1
- package/dist/plugins/browser/share-position-link.js.map +1 -1
- package/dist/plugins/browser/toggle-mobile-views.d.ts +1 -1
- package/dist/plugins/browser/toggle-mobile-views.d.ts.map +1 -1
- package/dist/plugins/browser/user-geolocation.d.ts +1 -1
- package/dist/plugins/browser/user-geolocation.d.ts.map +1 -1
- package/dist/plugins/browser/user-geolocation.js +7 -6
- package/dist/plugins/browser/user-geolocation.js.map +1 -1
- package/dist/plugins/browser/views.d.ts +1 -1
- package/dist/plugins/browser/views.d.ts.map +1 -1
- package/dist/plugins/browser-defaults.d.ts +13 -13
- package/dist/plugins/browser-defaults.d.ts.map +1 -1
- package/dist/plugins/browser-defaults.js +13 -13
- package/dist/plugins/browser-defaults.js.map +1 -1
- package/dist/plugins/common/feature-selection-details-url.d.ts +1 -1
- package/dist/plugins/common/feature-selection-details-url.d.ts.map +1 -1
- package/dist/plugins/common/measure-distance.d.ts +1 -1
- package/dist/plugins/common/measure-distance.d.ts.map +1 -1
- package/dist/plugins/common/measure-distance.js +1 -1
- package/dist/plugins/common/measure-distance.js.map +1 -1
- package/dist/plugins/common/ol-proxy.d.ts +1 -1
- package/dist/plugins/common/ol-proxy.d.ts.map +1 -1
- package/dist/plugins/common/render-await-feature-details-loaded.d.ts +1 -1
- package/dist/plugins/common/render-await-feature-details-loaded.d.ts.map +1 -1
- package/dist/plugins/common/render-await-feature-details-loaded.js +2 -1
- package/dist/plugins/common/render-await-feature-details-loaded.js.map +1 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.d.ts +1 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.d.ts.map +1 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.js +2 -1
- package/dist/plugins/common/render-await-list-feature-sources-loaded.js.map +1 -1
- package/dist/plugins/server/feature-deep-link.d.ts +1 -1
- package/dist/plugins/server/feature-deep-link.d.ts.map +1 -1
- package/dist/plugins/server-defaults.d.ts +4 -4
- package/dist/plugins/server-defaults.d.ts.map +1 -1
- package/dist/plugins/server-defaults.js +4 -4
- package/dist/plugins/server-defaults.js.map +1 -1
- package/dist/renderer/browser-dom.d.ts.map +1 -1
- package/dist/renderer/browser-dom.js +6 -2
- package/dist/renderer/browser-dom.js.map +1 -1
- package/dist/renderer/server-string.js +2 -2
- package/dist/renderer/server-string.js.map +1 -1
- package/dist/store/actions.d.ts +4 -2
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/store/actions.js +1 -1
- package/dist/store/actions.js.map +1 -1
- package/dist/store/reducers.d.ts +222 -9
- package/dist/store/reducers.d.ts.map +1 -1
- package/dist/store/reducers.js +1 -1
- package/dist/store/reducers.js.map +1 -1
- package/dist/store/selectors.d.ts +274 -243
- package/dist/store/selectors.d.ts.map +1 -1
- package/dist/store/selectors.js +49 -68
- package/dist/store/selectors.js.map +1 -1
- package/dist/types.d.ts +50 -35
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -8
- package/src/js/components/{app.jsx → app.tsx} +9 -14
- package/src/js/components/feature-details-content/feature-details-content.jsx +2 -2
- package/src/js/components/feature-details-content/index.js +7 -11
- package/src/js/components/feature-list/filter.jsx +2 -2
- package/src/js/components/feature-list/hooks/useAutoloadFeatureSource.ts +1 -1
- package/src/js/components/feature-list/hooks/useFeatureListState.ts +17 -9
- package/src/js/components/feature-list/hooks/useRestoreDocumentScroll.js +1 -1
- package/src/js/components/feature-list/hooks/useSelectFeature.js +6 -6
- package/src/js/components/feature-list/index.jsx +4 -4
- package/src/js/components/feature-list-cycling/index.js +1 -1
- package/src/js/components/feature-list-sorting/index.js +6 -9
- package/src/js/components/feature-selection-info/index.tsx +3 -3
- package/src/js/components/feature-selection-info/{with-sticky-header.jsx → with-sticky-header.tsx} +23 -8
- package/src/js/components/helping/app-context.tsx +1 -1
- package/src/js/components/layer-switcher/GroupedLayerSwitcher.js +1 -1
- package/src/js/components/layer-switcher/{LayerSwitcher.js → LayerSwitcher.ts} +11 -4
- package/src/js/components/layer-switcher/{LayerSwticherContainer.jsx → LayerSwitcherContainer.tsx} +22 -14
- package/src/js/components/layer-switcher/LayerSwitcherEntry.ts +152 -0
- package/src/js/components/layer-switcher/index.ts +42 -0
- package/src/js/components/layout/wrapper.jsx +1 -1
- package/src/js/components/main-panel/context.tsx +71 -0
- package/src/js/components/main-panel/list-toggle-button.jsx +2 -2
- package/src/js/components/map-overlay/attribution.tsx +1 -1
- package/src/js/components/map-overlay/info-overlay-left.jsx +2 -2
- package/src/js/components/map-overlay/info-overlay-right.jsx +2 -2
- package/src/js/components/map-overlay/legend.tsx +1 -1
- package/src/js/components/map-overlay/measure-distance-button.tsx +1 -1
- package/src/js/components/map-overlay/mini-legend.jsx +2 -2
- package/src/js/components/map-overlay/region-selector.jsx +2 -2
- package/src/js/components/map-overlay/search-overlay.jsx +1 -1
- package/src/js/components/map-overlay/share-position-link-button.tsx +1 -1
- package/src/js/components/map-synced-interlay/index.ts +15 -0
- package/src/js/components/map-synced-interlay/map-synced-interlay.jsx +1 -1
- package/src/js/components/map-synced-interlay/tooltip.tsx +1 -1
- package/src/js/components/map.tsx +55 -0
- package/src/js/components/search/index.jsx +2 -2
- package/src/js/components/search/result-entry.jsx +1 -1
- package/src/js/components/search/result.jsx +1 -1
- package/src/js/components/switcher/{SwitcherEntry.jsx → SwitcherEntry.tsx} +47 -26
- package/src/js/components/tag-switcher/{TagSwitcher.jsx → TagSwitcher.tsx} +1 -2
- package/src/js/components/tag-switcher/{createTagSwitcherEntry.js → createTagSwitcherEntry.ts} +14 -16
- package/src/js/components/tag-switcher/createTagSwitcherHeader.ts +47 -0
- package/src/js/components/tag-switcher/index.ts +17 -0
- package/src/js/components/view-toggle-button/{index.js → index.ts} +13 -10
- package/src/js/components/view-toggle-button/view-toggle-button.jsx +1 -1
- package/src/js/helpers/components.ts +1 -1
- package/src/js/helpers/create-action-watcher.ts +3 -3
- package/src/js/hooks/useMountable.ts +10 -1
- package/src/js/hooks/useStickyHeader.ts +7 -8
- package/src/js/hooks/useUpdateMapSizeCallback.ts +1 -1
- package/src/js/hooks/useUpdateMapSizeOnRender.ts +1 -1
- package/src/js/hooks/useUpdateMapSizeOnTransitionEnd.ts +1 -1
- package/src/js/hooks/useUpdateMapSizeOnViewChange.ts +1 -1
- package/src/js/index.ts +4 -3
- package/src/js/plugins/browser/app-title.ts +1 -1
- package/src/js/plugins/browser/feature-deep-link.ts +4 -3
- package/src/js/plugins/browser/local-storage.ts +1 -1
- package/src/js/plugins/browser/native-fullscreen.ts +2 -2
- package/src/js/plugins/browser/no-scroll.ts +3 -2
- package/src/js/plugins/browser/partial-content-changed-event.ts +1 -1
- package/src/js/plugins/browser/piwik-track-feature-selection-event.ts +1 -1
- package/src/js/plugins/browser/piwik-track-fullscreen-toggle-event.ts +1 -1
- package/src/js/plugins/browser/search.ts +1 -1
- package/src/js/plugins/browser/share-position-link.ts +2 -2
- package/src/js/plugins/browser/toggle-mobile-views.ts +1 -1
- package/src/js/plugins/browser/user-geolocation.ts +20 -12
- package/src/js/plugins/browser/views.ts +1 -1
- package/src/js/plugins/browser-defaults.ts +14 -14
- package/src/js/plugins/common/feature-selection-details-url.ts +1 -1
- package/src/js/plugins/common/measure-distance.ts +4 -4
- package/src/js/plugins/common/ol-proxy.ts +1 -1
- package/src/js/plugins/common/render-await-feature-details-loaded.ts +3 -2
- package/src/js/plugins/common/render-await-list-feature-sources-loaded.ts +3 -2
- package/src/js/plugins/server/feature-deep-link.ts +1 -1
- package/src/js/plugins/server-defaults.ts +5 -5
- package/src/js/renderer/browser-dom.tsx +8 -4
- package/src/js/renderer/server-string.tsx +2 -2
- package/src/js/store/actions.ts +24 -10
- package/src/js/store/reducers.ts +3 -3
- package/src/js/store/selectors.ts +192 -158
- package/src/js/types.ts +65 -41
- package/dist/components/layer-switcher/LayerSwticherContainer.d.ts +0 -4
- package/dist/components/layer-switcher/LayerSwticherContainer.d.ts.map +0 -1
- package/dist/components/layer-switcher/LayerSwticherContainer.js.map +0 -1
- package/src/js/components/layer-switcher/LayerSwitcherEntry.js +0 -132
- package/src/js/components/layer-switcher/index.js +0 -47
- package/src/js/components/main-panel/context.jsx +0 -62
- package/src/js/components/map-synced-interlay/index.js +0 -17
- package/src/js/components/map.jsx +0 -37
- package/src/js/components/tag-switcher/createTagSwitcherHeader.js +0 -34
- package/src/js/components/tag-switcher/index.js +0 -20
- package/src/js/global.d.ts +0 -7
- /package/src/js/components/view-toggle-button/{mobile-button.jsx → mobile-button.tsx} +0 -0
- /package/src/js/components/view-toggle-button/{viewport-button.jsx → viewport-button.tsx} +0 -0
package/src/js/types.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {ElementType, HTMLAttributes} from "react";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
AnyAction,
|
|
5
|
+
Reducer,
|
|
6
|
+
Store,
|
|
7
|
+
StoreEnhancer,
|
|
8
|
+
ThunkAction,
|
|
9
|
+
} from "@reduxjs/toolkit";
|
|
10
|
+
import type {BatchAction} from "redux-batched-actions";
|
|
2
11
|
|
|
3
12
|
import type {BaseController} from "@mapsight/core/lib/base/controller";
|
|
13
|
+
import type {FeatureSourceState} from "@mapsight/core/lib/feature-sources/types";
|
|
4
14
|
import type {EnhancedStore, Feature, State} from "@mapsight/core/types";
|
|
5
15
|
|
|
6
16
|
import type {MapsightStyleFunction} from "@mapsight/lib-ol/style/styleFunction";
|
|
7
17
|
|
|
8
|
-
import type {MapsightUiPlacesData} from "./components/feature-list-sorting/feature-list-sorting
|
|
9
|
-
import type {View} from "./config/constants/app
|
|
18
|
+
import type {MapsightUiPlacesData} from "./components/feature-list-sorting/feature-list-sorting";
|
|
19
|
+
import type {View} from "./config/constants/app";
|
|
20
|
+
import type {TAG_FILTER, TIME_FILTER} from "./config/constants/controllers";
|
|
10
21
|
import type {MapsightUiComponents} from "./helpers/components";
|
|
22
|
+
import type {FETCH_JSON_STATUS, FETCH_TEXT_STATUS} from "./store/actions";
|
|
23
|
+
import type {RootStateSlice} from "./store/selectors";
|
|
11
24
|
|
|
12
25
|
// helper type https://stackoverflow.com/a/61132308
|
|
13
26
|
export type DeepPartial<T> = T extends object
|
|
@@ -16,7 +29,7 @@ export type DeepPartial<T> = T extends object
|
|
|
16
29
|
}
|
|
17
30
|
: T;
|
|
18
31
|
|
|
19
|
-
export type MapsightUiStore = EnhancedStore<
|
|
32
|
+
export type MapsightUiStore = EnhancedStore<RootStateSlice>;
|
|
20
33
|
|
|
21
34
|
/**
|
|
22
35
|
* We keep a context object for each mapsight ui instance holding all the information
|
|
@@ -138,16 +151,39 @@ export type MapsightUiAsyncRenderFunction<R> = (
|
|
|
138
151
|
|
|
139
152
|
export type MapsightUiView = View;
|
|
140
153
|
|
|
154
|
+
export type LayerSwitcherConfigState = {
|
|
155
|
+
setFeatureSourceId: string[] | true | undefined;
|
|
156
|
+
grouped: boolean;
|
|
157
|
+
layerIdsSelector: (state: object) => string[];
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type FetchTextState = {
|
|
161
|
+
url: string | null;
|
|
162
|
+
status: FETCH_TEXT_STATUS;
|
|
163
|
+
data: string | null;
|
|
164
|
+
error: string | null;
|
|
165
|
+
lastUpdate: number | null;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export type FetchJsonState<TData = unknown> = {
|
|
169
|
+
url: string | null;
|
|
170
|
+
status: FETCH_JSON_STATUS;
|
|
171
|
+
data: TData | null;
|
|
172
|
+
error: string | null;
|
|
173
|
+
lastUpdate: number | null;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export type RegionState = {
|
|
177
|
+
label: string;
|
|
178
|
+
bounds: [number, number, number, number];
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type RegionsState = Record<string, RegionState>;
|
|
182
|
+
|
|
141
183
|
export type FullUiState = {
|
|
142
184
|
isFullscreen: boolean;
|
|
143
185
|
|
|
144
|
-
regions:
|
|
145
|
-
string,
|
|
146
|
-
{
|
|
147
|
-
label: string;
|
|
148
|
-
bounds: [number, number, number, number];
|
|
149
|
-
}
|
|
150
|
-
>;
|
|
186
|
+
regions: RegionsState;
|
|
151
187
|
selectedRegion: string;
|
|
152
188
|
|
|
153
189
|
places: MapsightUiPlacesData;
|
|
@@ -164,12 +200,8 @@ export type FullUiState = {
|
|
|
164
200
|
|
|
165
201
|
searchInMap: boolean;
|
|
166
202
|
searchQuery: string;
|
|
167
|
-
searchResult: {
|
|
168
|
-
url: string;
|
|
203
|
+
searchResult: FeatureSourceState & {
|
|
169
204
|
status: "error" | "loading" | "success" | null;
|
|
170
|
-
data: unknown;
|
|
171
|
-
error: unknown;
|
|
172
|
-
lastUpdate: number | null;
|
|
173
205
|
};
|
|
174
206
|
searchResultSelectionFeatures: MapsightUiFeature[];
|
|
175
207
|
|
|
@@ -227,14 +259,8 @@ export type FullUiState = {
|
|
|
227
259
|
internal: boolean;
|
|
228
260
|
external: boolean;
|
|
229
261
|
};
|
|
230
|
-
internal:
|
|
231
|
-
|
|
232
|
-
layerIdsSelector: (state: object) => string[];
|
|
233
|
-
};
|
|
234
|
-
external: {
|
|
235
|
-
grouped: boolean;
|
|
236
|
-
layerIdsSelector: (state: object) => string[];
|
|
237
|
-
};
|
|
262
|
+
internal: LayerSwitcherConfigState;
|
|
263
|
+
external: LayerSwitcherConfigState;
|
|
238
264
|
};
|
|
239
265
|
tagSwitcher: {
|
|
240
266
|
show: boolean;
|
|
@@ -246,10 +272,10 @@ export type FullUiState = {
|
|
|
246
272
|
map: {
|
|
247
273
|
show: boolean;
|
|
248
274
|
};
|
|
249
|
-
|
|
275
|
+
[TIME_FILTER]: {
|
|
250
276
|
show: boolean;
|
|
251
277
|
};
|
|
252
|
-
|
|
278
|
+
[TAG_FILTER]: {
|
|
253
279
|
show: boolean;
|
|
254
280
|
featureSourceId: string;
|
|
255
281
|
};
|
|
@@ -275,10 +301,11 @@ export type MapsightUiReHydrationState = {
|
|
|
275
301
|
};
|
|
276
302
|
|
|
277
303
|
// TODO: Move these to @mapsight/core types
|
|
278
|
-
export type MapsightCoreAction =
|
|
304
|
+
export type MapsightCoreAction = AnyAction &
|
|
279
305
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
280
|
-
|
|
281
|
-
|
|
306
|
+
ThunkAction<any, any, any, any> &
|
|
307
|
+
BatchAction;
|
|
308
|
+
|
|
282
309
|
export type MapsightCoreState =
|
|
283
310
|
| string
|
|
284
311
|
| number
|
|
@@ -287,13 +314,13 @@ export type MapsightCoreState =
|
|
|
287
314
|
export type MapsightCoreReducer<
|
|
288
315
|
T extends MapsightCoreState = MapsightCoreState,
|
|
289
316
|
U extends MapsightCoreAction = MapsightCoreAction,
|
|
290
|
-
> =
|
|
317
|
+
> = Reducer<T, U>;
|
|
291
318
|
|
|
292
319
|
export type MapsightUiAppReducer = MapsightCoreReducer<UiState>;
|
|
293
320
|
|
|
294
321
|
export type CreateOptions = {
|
|
295
322
|
// store
|
|
296
|
-
storeEnhancer?:
|
|
323
|
+
storeEnhancer?: StoreEnhancer;
|
|
297
324
|
reducers?: {
|
|
298
325
|
[x: string]: undefined | MapsightCoreReducer;
|
|
299
326
|
app?: MapsightUiAppReducer;
|
|
@@ -302,10 +329,7 @@ export type CreateOptions = {
|
|
|
302
329
|
|
|
303
330
|
// functionality
|
|
304
331
|
plugins?: PluginDefinition[];
|
|
305
|
-
controllers?: Record<
|
|
306
|
-
string,
|
|
307
|
-
import("@mapsight/core/lib/base/controller").BaseController
|
|
308
|
-
>;
|
|
332
|
+
controllers?: Record<string, BaseController>;
|
|
309
333
|
|
|
310
334
|
// rendering
|
|
311
335
|
components?: MapsightUiComponents;
|
|
@@ -364,14 +388,14 @@ export type MainPanelContextState = {
|
|
|
364
388
|
export type MainPanelContextValue = MainPanelContextOptions &
|
|
365
389
|
MainPanelContextState;
|
|
366
390
|
|
|
367
|
-
export type FeatureListProps<T extends
|
|
391
|
+
export type FeatureListProps<T extends ElementType = "div"> = {
|
|
368
392
|
additionalClasses?: string | null;
|
|
369
393
|
as?: T;
|
|
370
|
-
attributes?:
|
|
371
|
-
headerAs?: null |
|
|
372
|
-
contentAs?: null |
|
|
373
|
-
footerAs?: null |
|
|
374
|
-
itemAs?:
|
|
394
|
+
attributes?: HTMLAttributes<T>;
|
|
395
|
+
headerAs?: null | ElementType;
|
|
396
|
+
contentAs?: null | ElementType;
|
|
397
|
+
footerAs?: null | ElementType;
|
|
398
|
+
itemAs?: ElementType;
|
|
375
399
|
enableKeyboardControl?: boolean;
|
|
376
400
|
autoloadFeatureSource?: boolean;
|
|
377
401
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayerSwticherContainer.d.ts","sourceRoot":"","sources":["../../../src/js/components/layer-switcher/LayerSwticherContainer.jsx"],"names":[],"mappings":";;AAoBA,6FAyDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayerSwticherContainer.js","sourceRoot":"","sources":["../../../src/js/components/layer-switcher/LayerSwticherContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,EACN,kCAAkC,EAClC,oCAAoC,EACpC,sCAAsC,EACtC,sCAAsC,EACtC,sBAAsB,EACtB,wBAAwB,GACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AAExC,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAE7C,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,0GAA0G;AAC1G,yEAAyE;AACzE,6FAA6F;AAE7F,SAAS,sBAAsB,CAAC,KAAK;IACpC,MAAM,EACL,EAAE,EAAE,CAAC,GAAG,KAAK,EACb,aAAa,GAAG,8BAA8B,EAAE,+BAA+B;IAC/E,OAAO,EACP,gBAAgB,GAAG,kCAAkC,EACrD,sBAAsB,EACtB,OAAO,GAAG,KAAK,EACf,GAAG,UAAU,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,gBAAgB,GAAG,WAAW,CACnC,CAAC,EAAE,EAAE,EAAE,CAAC,CAEP,KAAC,kBAAkB,IAElB,OAAO,EAAE,EAAE,EACX,aAAa,EAAE,sBAAsB,CAAC,EAAE,CAAC,EACzC,cAAc,EAAE,sCAAsC,CAAC,EAAE,CAAC,EAC1D,uBAAuB,EAAE,wBAAwB,CAAC,EAAE,CAAC,EACrD,qBAAqB,EAAE,oCAAoC,CAAC,EAAE,CAAC,EAC/D,uBAAuB,EAAE,sCAAsC,CAC9D,EAAE,CACF,EACD,sBAAsB,EAAE,sBAAsB,IATzC,EAAE,CAUN,CACF,EACD,CAAC,sBAAsB,CAAC,CACxB,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC;IAEhE,OAAO,CACN,MAAC,CAAC,IACD,SAAS,EAAE,GAAG,aAAa,IAAI,aAAa,KAC3C,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WACvB,EAAE,aAEF,KAAC,QAAQ,IACR,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,gBAAgB,KACzB,UAAU,GACb,EAED,OAAO,IAAI,CACX,iBACC,SAAS,EAAC,8DAA8D,EACxE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,YAEhB,eAAM,SAAS,EAAC,oBAAoB,YAClC,SAAS,CAAC,2CAA2C,CAAC,GACjD,GACC,CACT,IACE,CACJ,CAAC;AACH,CAAC;AAED,eAAe,IAAI,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {createStructuredSelector} from "reselect";
|
|
4
|
-
|
|
5
|
-
import {set as makeSetAction} from "@mapsight/core/lib/base/actions";
|
|
6
|
-
import {getFeatureSourceStatus} from "@mapsight/core/lib/feature-sources/selectors";
|
|
7
|
-
import {setLayerVisibility} from "@mapsight/core/lib/map/actions";
|
|
8
|
-
|
|
9
|
-
import getPath from "@mapsight/lib-js/object/getPath";
|
|
10
|
-
|
|
11
|
-
import {MAP} from "../../config/constants/controllers";
|
|
12
|
-
import SwitcherEntry from "../switcher/SwitcherEntry";
|
|
13
|
-
|
|
14
|
-
function getActiveProps({
|
|
15
|
-
setFeatureSourceIdPath,
|
|
16
|
-
currentlySetFeatureSourceId,
|
|
17
|
-
featureSourceId,
|
|
18
|
-
dispatch,
|
|
19
|
-
layerId,
|
|
20
|
-
visibility,
|
|
21
|
-
locked,
|
|
22
|
-
}) {
|
|
23
|
-
if (setFeatureSourceIdPath) {
|
|
24
|
-
const isCurrentFeatureSource =
|
|
25
|
-
currentlySetFeatureSourceId === featureSourceId;
|
|
26
|
-
|
|
27
|
-
// this will match in intermediate state; use batching?
|
|
28
|
-
//if (!visibility && isFeatureSourceCurrent) {
|
|
29
|
-
// throw new Error('illegal state');
|
|
30
|
-
//}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
activeCheckbox: !!visibility,
|
|
34
|
-
activeText: isCurrentFeatureSource,
|
|
35
|
-
toggleActiveCheckbox: function toggleActiveCheckbox() {
|
|
36
|
-
dispatch(setLayerVisibility(MAP, layerId, !visibility));
|
|
37
|
-
if (isCurrentFeatureSource) {
|
|
38
|
-
dispatch(makeSetAction(setFeatureSourceIdPath, undefined));
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
toggleActiveText: function toggleActiveText() {
|
|
42
|
-
dispatch(
|
|
43
|
-
makeSetAction(setFeatureSourceIdPath, featureSourceId),
|
|
44
|
-
);
|
|
45
|
-
dispatch(setLayerVisibility(MAP, layerId, true));
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
active: !!visibility,
|
|
52
|
-
toggleActive: function toggleActive() {
|
|
53
|
-
if (!locked) {
|
|
54
|
-
dispatch(setLayerVisibility(MAP, layerId, !visibility));
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const LayerSwitcherEntry = connect(
|
|
61
|
-
// mapStateToProps:
|
|
62
|
-
(
|
|
63
|
-
state,
|
|
64
|
-
{
|
|
65
|
-
titleSelector,
|
|
66
|
-
lockedSelector,
|
|
67
|
-
layerVisibilitySelector,
|
|
68
|
-
featureSourceSelector,
|
|
69
|
-
featureSourceIdSelector,
|
|
70
|
-
setFeatureSourceIdPath,
|
|
71
|
-
},
|
|
72
|
-
) =>
|
|
73
|
-
createStructuredSelector({
|
|
74
|
-
title: (myState) => titleSelector(myState[MAP]),
|
|
75
|
-
locked: (myState) => lockedSelector(myState[MAP]),
|
|
76
|
-
visibility: (myState) => layerVisibilitySelector(myState[MAP]),
|
|
77
|
-
featureSource: (myState) =>
|
|
78
|
-
featureSourceSelector(myState[MAP], myState),
|
|
79
|
-
featureSourceId: (myState) =>
|
|
80
|
-
featureSourceIdSelector(myState[MAP], myState),
|
|
81
|
-
currentlySetFeatureSourceId: (myState) =>
|
|
82
|
-
Array.isArray(setFeatureSourceIdPath) &&
|
|
83
|
-
getPath(myState, setFeatureSourceIdPath),
|
|
84
|
-
}),
|
|
85
|
-
// mapDispatchToProps:
|
|
86
|
-
null,
|
|
87
|
-
// mergeProps:
|
|
88
|
-
(
|
|
89
|
-
// state props
|
|
90
|
-
{
|
|
91
|
-
visibility,
|
|
92
|
-
title,
|
|
93
|
-
locked,
|
|
94
|
-
featureSource,
|
|
95
|
-
featureSourceId,
|
|
96
|
-
currentlySetFeatureSourceId,
|
|
97
|
-
},
|
|
98
|
-
// dispatch props
|
|
99
|
-
{dispatch},
|
|
100
|
-
// own props
|
|
101
|
-
{
|
|
102
|
-
// used for active props:
|
|
103
|
-
layerId,
|
|
104
|
-
setFeatureSourceIdPath,
|
|
105
|
-
|
|
106
|
-
// Need to list the selectors here so they do not get passed as attribute props to the element but get filtered:
|
|
107
|
-
lockedSelector: _lockedSelector,
|
|
108
|
-
titleSelector: _titleSelector,
|
|
109
|
-
layerVisibilitySelector: _layerVisibilitySelector,
|
|
110
|
-
featureSourceSelector: _featureSourceSelector,
|
|
111
|
-
featureSourceIdSelector: _featureSourceIdSelector,
|
|
112
|
-
|
|
113
|
-
...attributes
|
|
114
|
-
},
|
|
115
|
-
) => ({
|
|
116
|
-
title: title,
|
|
117
|
-
status: getFeatureSourceStatus(featureSource),
|
|
118
|
-
locked: locked,
|
|
119
|
-
...getActiveProps({
|
|
120
|
-
visibility: visibility,
|
|
121
|
-
featureSourceId: featureSourceId,
|
|
122
|
-
currentlySetFeatureSourceId: currentlySetFeatureSourceId,
|
|
123
|
-
locked: locked,
|
|
124
|
-
dispatch: dispatch,
|
|
125
|
-
layerId: layerId,
|
|
126
|
-
setFeatureSourceIdPath: setFeatureSourceIdPath,
|
|
127
|
-
}),
|
|
128
|
-
...attributes,
|
|
129
|
-
}),
|
|
130
|
-
)(SwitcherEntry);
|
|
131
|
-
|
|
132
|
-
export default LayerSwitcherEntry;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {createStructuredSelector} from "reselect";
|
|
4
|
-
|
|
5
|
-
import {FEATURE_LIST} from "../../config/constants/controllers";
|
|
6
|
-
import {layerSwitcherConfigInternalSelector} from "../../store/selectors.ts";
|
|
7
|
-
import LayerSwitcherContainer from "./LayerSwticherContainer";
|
|
8
|
-
|
|
9
|
-
const TRUE_SET_FEATURE_SOURCE_PATH = [FEATURE_LIST, "featureSource"];
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param {object} props properties
|
|
13
|
-
* @param {Function} props.onClose callback when closed
|
|
14
|
-
* @param {(state: object) => object} [props.configSelector] config selector, default = layerSwitcherConfigInternalSelector
|
|
15
|
-
*/
|
|
16
|
-
export default connect(
|
|
17
|
-
createStructuredSelector({
|
|
18
|
-
layerIdsSelector: (
|
|
19
|
-
state,
|
|
20
|
-
{configSelector = layerSwitcherConfigInternalSelector},
|
|
21
|
-
) => configSelector(state).layerIdsSelector,
|
|
22
|
-
grouped: (
|
|
23
|
-
state,
|
|
24
|
-
{configSelector = layerSwitcherConfigInternalSelector},
|
|
25
|
-
) => configSelector(state).grouped,
|
|
26
|
-
setFeatureSourceIdPath: function setFeatureSourceIdPath(
|
|
27
|
-
state,
|
|
28
|
-
{configSelector = layerSwitcherConfigInternalSelector},
|
|
29
|
-
) {
|
|
30
|
-
const config = configSelector(state);
|
|
31
|
-
if (config.setFeatureSourceId === true) {
|
|
32
|
-
return TRUE_SET_FEATURE_SOURCE_PATH;
|
|
33
|
-
} else {
|
|
34
|
-
return config.setFeatureSourceId;
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
|
-
null,
|
|
39
|
-
(
|
|
40
|
-
stateProps,
|
|
41
|
-
dispatchProps,
|
|
42
|
-
{configSelector: _configSelector, ...ownProps},
|
|
43
|
-
) => ({
|
|
44
|
-
...ownProps,
|
|
45
|
-
...stateProps,
|
|
46
|
-
}),
|
|
47
|
-
)(LayerSwitcherContainer);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {createContext, useContext, useMemo} from "react";
|
|
2
|
-
import {useSelector} from "react-redux";
|
|
3
|
-
|
|
4
|
-
import {createMainPanelContentTypeSelector} from "../../store/selectors.ts";
|
|
5
|
-
|
|
6
|
-
/** @type {import('react').Context<import('../../types').MainPanelContextValue>} */
|
|
7
|
-
const MainPanelContext = createContext(
|
|
8
|
-
/** @type {import('../../types').MainPanelContextValue} */ {
|
|
9
|
-
showSelectionInfo: false,
|
|
10
|
-
showList: false,
|
|
11
|
-
collapsible: false,
|
|
12
|
-
panelPosition: "left",
|
|
13
|
-
|
|
14
|
-
feature: null,
|
|
15
|
-
contentType: null,
|
|
16
|
-
collapsed: false,
|
|
17
|
-
},
|
|
18
|
-
);
|
|
19
|
-
MainPanelContext.displayName = "MainPanelContext";
|
|
20
|
-
|
|
21
|
-
/** @returns {import('../../types').MainPanelContextValue} main panel context */
|
|
22
|
-
export function useMainPanelContext() {
|
|
23
|
-
return useContext(MainPanelContext);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param {Pick<import('../../types').MainPanelContextOptions, 'showSelectionInfo'| 'showList' | 'collapsible'>} options main panel options
|
|
28
|
-
* @returns {import('../../types').MainPanelContextState} main panel state
|
|
29
|
-
*/
|
|
30
|
-
function useMainPanelState({showSelectionInfo, showList, collapsible}) {
|
|
31
|
-
const selector = useMemo(
|
|
32
|
-
() =>
|
|
33
|
-
createMainPanelContentTypeSelector({
|
|
34
|
-
showSelectionInfo: showSelectionInfo,
|
|
35
|
-
showList: showList,
|
|
36
|
-
collapsible: collapsible,
|
|
37
|
-
}),
|
|
38
|
-
[showSelectionInfo, showList, collapsible],
|
|
39
|
-
);
|
|
40
|
-
return useSelector(selector);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function MainPanelContextProvider(
|
|
44
|
-
/** @type {import('../../types').MainPanelContextOptions & {children: import('react').ReactChildren}} */ {
|
|
45
|
-
showSelectionInfo = false,
|
|
46
|
-
showList = false,
|
|
47
|
-
collapsible = false,
|
|
48
|
-
panelPosition = "left",
|
|
49
|
-
children,
|
|
50
|
-
},
|
|
51
|
-
) {
|
|
52
|
-
const options = {
|
|
53
|
-
showSelectionInfo: showSelectionInfo,
|
|
54
|
-
showList: showList,
|
|
55
|
-
collapsible: collapsible,
|
|
56
|
-
panelPosition: panelPosition,
|
|
57
|
-
};
|
|
58
|
-
const state = useMainPanelState(options);
|
|
59
|
-
const value = {...options, ...state};
|
|
60
|
-
|
|
61
|
-
return <MainPanelContext.Provider value={value}>{children}</MainPanelContext.Provider>;
|
|
62
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {createStructuredSelector} from "reselect";
|
|
4
|
-
|
|
5
|
-
import {mapSizeSelector} from "@mapsight/core/lib/map/selectors";
|
|
6
|
-
|
|
7
|
-
import {MAP} from "../../config/constants/controllers";
|
|
8
|
-
import {viewSelector} from "../../store/selectors.ts";
|
|
9
|
-
import MapSyncedInterlay from "./map-synced-interlay";
|
|
10
|
-
|
|
11
|
-
export default connect(
|
|
12
|
-
createStructuredSelector({
|
|
13
|
-
view: viewSelector,
|
|
14
|
-
size: (state) => mapSizeSelector(state[MAP]),
|
|
15
|
-
//pendingUpdateSize: state => state[MAP].pendingUpdateSize || false,
|
|
16
|
-
}),
|
|
17
|
-
)(MapSyncedInterlay);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {memo, useEffect, useRef} from "react";
|
|
2
|
-
import {useStore} from "react-redux";
|
|
3
|
-
import {MAP} from "../config/constants/controllers";
|
|
4
|
-
|
|
5
|
-
import {translate} from "../helpers/i18n";
|
|
6
|
-
import useMountable from "../hooks/useMountable";
|
|
7
|
-
|
|
8
|
-
function MapsightMap({
|
|
9
|
-
controllerName = MAP,
|
|
10
|
-
enableKeyboardControl = true,
|
|
11
|
-
...attributes
|
|
12
|
-
}) {
|
|
13
|
-
const store = useStore();
|
|
14
|
-
const ref = useRef();
|
|
15
|
-
|
|
16
|
-
const handleMount = useMountable(store.getController(controllerName));
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
handleMount(ref.current);
|
|
19
|
-
}, [ref, handleMount]);
|
|
20
|
-
|
|
21
|
-
if (enableKeyboardControl) {
|
|
22
|
-
attributes.tabIndex = 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div className="ms3-map-target" ref={ref} {...attributes}>
|
|
27
|
-
<span className="ms3-visuallyhidden">
|
|
28
|
-
{translate("ui.map.visuallyhidden")}
|
|
29
|
-
</span>
|
|
30
|
-
<div className="ol-viewport">
|
|
31
|
-
<canvas className="ol-unselectable" />
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default memo(MapsightMap);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {createStructuredSelector} from "reselect";
|
|
4
|
-
|
|
5
|
-
import {setTagGroupVisible} from "../../store/actions.ts";
|
|
6
|
-
import {createTagGroupVisibleSelector} from "../../store/selectors.ts";
|
|
7
|
-
import SwitcherHeader from "../switcher/SwitcherHeader";
|
|
8
|
-
|
|
9
|
-
export default function createTagSwitcherHeader(featureSourceId, tagGroup) {
|
|
10
|
-
return connect(
|
|
11
|
-
createStructuredSelector({
|
|
12
|
-
visibility: createTagGroupVisibleSelector(
|
|
13
|
-
featureSourceId,
|
|
14
|
-
tagGroup,
|
|
15
|
-
),
|
|
16
|
-
}),
|
|
17
|
-
null,
|
|
18
|
-
({visibility}, {dispatch}, {toggleable = false, ...ownProps}) => ({
|
|
19
|
-
label: tagGroup,
|
|
20
|
-
active: !toggleable || visibility,
|
|
21
|
-
toggleActive: toggleable
|
|
22
|
-
? () =>
|
|
23
|
-
dispatch(
|
|
24
|
-
setTagGroupVisible(
|
|
25
|
-
featureSourceId,
|
|
26
|
-
tagGroup,
|
|
27
|
-
!visibility,
|
|
28
|
-
),
|
|
29
|
-
)
|
|
30
|
-
: undefined,
|
|
31
|
-
...ownProps,
|
|
32
|
-
}),
|
|
33
|
-
)(SwitcherHeader);
|
|
34
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {connect} from "react-redux";
|
|
2
|
-
|
|
3
|
-
import {createStructuredSelector} from "reselect";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
tagSwitcherFeatureSourceIdSelector,
|
|
7
|
-
tagSwitcherSortTags,
|
|
8
|
-
tagSwitcherTagsSelector,
|
|
9
|
-
tagSwitcherToggleableGroups,
|
|
10
|
-
} from "../../store/selectors.ts";
|
|
11
|
-
import TagSwitcher from "./TagSwitcher";
|
|
12
|
-
|
|
13
|
-
export default connect(
|
|
14
|
-
createStructuredSelector({
|
|
15
|
-
featureSourceId: tagSwitcherFeatureSourceIdSelector,
|
|
16
|
-
groupedTagData: tagSwitcherTagsSelector,
|
|
17
|
-
toggleableGroups: tagSwitcherToggleableGroups,
|
|
18
|
-
sortTags: tagSwitcherSortTags,
|
|
19
|
-
}),
|
|
20
|
-
)(TagSwitcher);
|
package/src/js/global.d.ts
DELETED
|
File without changes
|
|
File without changes
|