@opengeoweb/store 14.2.1 → 14.3.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/index.esm.js CHANGED
@@ -5800,6 +5800,72 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
5800
5800
  defaultOverlayer: defaultOverlayer
5801
5801
  });
5802
5802
  }, selectorMemoizationOptions);
5803
+ var getMultiMapInitialProps = function getMultiMapInitialProps(store, panelId) {
5804
+ var _syncGroupsSelectors$;
5805
+ var allIds = getAllMapIds(store);
5806
+ var prefix = "".concat(panelId, "_");
5807
+ var childMapIds = allIds.filter(function (id) {
5808
+ return id.startsWith(prefix);
5809
+ }).sort(function (first, last) {
5810
+ var ai = Number(first.split('_').pop());
5811
+ var bi = Number(last.split('_').pop());
5812
+ return ai - bi;
5813
+ });
5814
+ var childPresets = childMapIds.map(function (id) {
5815
+ return getMapPreset(store, id);
5816
+ });
5817
+ var shouldShowZoomControls = childMapIds.length > 0 ? isZoomControlsVisible(store, childMapIds[0]) : undefined;
5818
+ var syncGroupsIds = (_syncGroupsSelectors$ = getAllTargetGroupsForSource(store, panelId)) !== null && _syncGroupsSelectors$ !== void 0 ? _syncGroupsSelectors$ : [];
5819
+ return {
5820
+ mapPreset: childPresets,
5821
+ syncGroupsIds: syncGroupsIds,
5822
+ shouldShowZoomControls: shouldShowZoomControls
5823
+ };
5824
+ };
5825
+ var getHarmonieInitialProps = function getHarmonieInitialProps(store, panelId, viewInitialProps) {
5826
+ var _mapPreset$layers, _contentLayers$;
5827
+ var relatedSyncGroupIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
5828
+ var fromView = viewInitialProps === null || viewInitialProps === void 0 ? void 0 : viewInitialProps.layers;
5829
+ if (fromView !== null && fromView !== void 0 && fromView.topRow && fromView !== null && fromView !== void 0 && fromView.bottomRow) {
5830
+ var _fromView$topRowSyncG, _fromView$bottomRowSy;
5831
+ return {
5832
+ layers: _objectSpread2(_objectSpread2({}, fromView), {}, {
5833
+ topRowSyncGroups: (_fromView$topRowSyncG = fromView.topRowSyncGroups) !== null && _fromView$topRowSyncG !== void 0 ? _fromView$topRowSyncG : relatedSyncGroupIds,
5834
+ bottomRowSyncGroups: (_fromView$bottomRowSy = fromView.bottomRowSyncGroups) !== null && _fromView$bottomRowSy !== void 0 ? _fromView$bottomRowSy : relatedSyncGroupIds
5835
+ })
5836
+ };
5837
+ }
5838
+ var mapPreset = getMapPreset(store, panelId);
5839
+ var layers = (_mapPreset$layers = mapPreset === null || mapPreset === void 0 ? void 0 : mapPreset.layers) !== null && _mapPreset$layers !== void 0 ? _mapPreset$layers : [];
5840
+ var contentLayers = layers.filter(function (la) {
5841
+ return !!la && la.name;
5842
+ });
5843
+ var topRow = contentLayers[0];
5844
+ var bottomRow = (_contentLayers$ = contentLayers[1]) !== null && _contentLayers$ !== void 0 ? _contentLayers$ : contentLayers[0];
5845
+ if (!topRow) {
5846
+ return {};
5847
+ }
5848
+ return {
5849
+ layers: {
5850
+ topRow: topRow,
5851
+ bottomRow: bottomRow,
5852
+ topRowSyncGroups: relatedSyncGroupIds,
5853
+ bottomRowSyncGroups: relatedSyncGroupIds
5854
+ }
5855
+ };
5856
+ };
5857
+ var getTimeSliderInitialProps = function getTimeSliderInitialProps(store, panelId, viewInitialProps) {
5858
+ var _viewInitialProps$sli, _syncGroupsSelectors$2;
5859
+ var fromView = viewInitialProps === null || viewInitialProps === void 0 || (_viewInitialProps$sli = viewInitialProps.sliderPreset) === null || _viewInitialProps$sli === void 0 ? void 0 : _viewInitialProps$sli.mapId;
5860
+ var mapId = fromView !== null && fromView !== void 0 ? fromView : panelId;
5861
+ var syncGroupsIds = (_syncGroupsSelectors$2 = getAllTargetGroupsForSource(store, panelId)) !== null && _syncGroupsSelectors$2 !== void 0 ? _syncGroupsSelectors$2 : [];
5862
+ return {
5863
+ sliderPreset: {
5864
+ mapId: mapId
5865
+ },
5866
+ syncGroupsIds: syncGroupsIds
5867
+ };
5868
+ };
5803
5869
  /**
5804
5870
  * Gets all enabled layerIds for map
5805
5871
  *
@@ -5955,6 +6021,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
5955
6021
  getDockedLayerManagerSize: getDockedLayerManagerSize,
5956
6022
  getFirstMap: getFirstMap,
5957
6023
  getFirstMapId: getFirstMapId,
6024
+ getHarmonieInitialProps: getHarmonieInitialProps,
5958
6025
  getIsEnabledLayersForMapDimension: getIsEnabledLayersForMapDimension,
5959
6026
  getIsLayerActiveLayer: getIsLayerActiveLayer,
5960
6027
  getIsMapPresent: getIsMapPresent,
@@ -5984,10 +6051,12 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
5984
6051
  getMapTimeSliderWidth: getMapTimeSliderWidth,
5985
6052
  getMapTimeStep: getMapTimeStep,
5986
6053
  getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
6054
+ getMultiMapInitialProps: getMultiMapInitialProps,
5987
6055
  getPinLocation: getPinLocation,
5988
6056
  getSelectedOverlayerByMapId: getSelectedOverlayerByMapId,
5989
6057
  getSelectedTime: getSelectedTime,
5990
6058
  getSrs: getSrs,
6059
+ getTimeSliderInitialProps: getTimeSliderInitialProps,
5991
6060
  getdefaultMapSettings: getdefaultMapSettings,
5992
6061
  getdefaultMapSettingsLayers: getdefaultMapSettingsLayers,
5993
6062
  isAnimating: isAnimating,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/store",
3
- "version": "14.2.1",
3
+ "version": "14.3.0",
4
4
  "description": "GeoWeb Store library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,15 +8,15 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/shared": "14.2.1",
11
+ "@opengeoweb/shared": "14.3.0",
12
12
  "react-redux": "^9.2.0",
13
13
  "@reduxjs/toolkit": "^2.6.1",
14
- "@opengeoweb/webmap-react": "14.2.1",
15
- "@opengeoweb/webmap": "14.2.1",
14
+ "@opengeoweb/webmap-react": "14.3.0",
15
+ "@opengeoweb/webmap": "14.3.0",
16
16
  "immer": "^10.0.3",
17
17
  "lodash": "^4.17.21",
18
- "@opengeoweb/metronome": "14.2.1",
19
- "@opengeoweb/time-slider": "14.2.1",
18
+ "@opengeoweb/metronome": "14.3.0",
19
+ "@opengeoweb/time-slider": "14.3.0",
20
20
  "react-router-dom": "^6.23.1",
21
21
  "ol": "^10.4.0",
22
22
  "@turf/turf": "^7.2.0",
@@ -1,7 +1,7 @@
1
1
  import type { Bbox, MapPreset, WebMap, WebMapState } from './types';
2
2
  import type { CoreAppStore } from '../../types';
3
3
  import { uiTypes } from '../../ui';
4
- import type { Dimension, Layer, ReduxLayer, TimeSliderStartCenterEndTime, WebMapAnimationList } from '../types';
4
+ import type { Dimension, HarmonieInitialPropsResult, InitialTimeSliderProps, Layer, MultiMapInitialProps, ReduxLayer, TimeSliderStartCenterEndTime, WebMapAnimationList } from '../types';
5
5
  /**
6
6
  * Gets the map state by mapId
7
7
  *
@@ -2616,6 +2616,9 @@ export declare const getMapPreset: ((state: CoreAppStore & uiTypes.UIModuleState
2616
2616
  memoize: typeof import("reselect").weakMapMemoize;
2617
2617
  argsMemoize: typeof import("reselect").weakMapMemoize;
2618
2618
  };
2619
+ export declare const getMultiMapInitialProps: (store: CoreAppStore, panelId: string) => MultiMapInitialProps;
2620
+ export declare const getHarmonieInitialProps: (store: CoreAppStore, panelId: string, viewInitialProps?: unknown, relatedSyncGroupIds?: string[]) => HarmonieInitialPropsResult;
2621
+ export declare const getTimeSliderInitialProps: (store: CoreAppStore, panelId: string, viewInitialProps?: unknown) => InitialTimeSliderProps;
2619
2622
  /**
2620
2623
  * Gets all enabled layerIds for map
2621
2624
  *
@@ -250,3 +250,27 @@ export interface TimeSliderStartCenterEndTime {
250
250
  end: number;
251
251
  step: number;
252
252
  }
253
+ export interface MultiMapInitialProps {
254
+ mapPreset: MapPreset[];
255
+ syncGroupsIds: string[];
256
+ shouldShowZoomControls?: boolean;
257
+ }
258
+ export interface InitialHarmTempAndPrecipProps {
259
+ layers: {
260
+ topRow: Layer;
261
+ bottomRow: Layer;
262
+ topRowSyncGroups?: string[];
263
+ bottomRowSyncGroups?: string[];
264
+ };
265
+ multiLegend?: boolean;
266
+ }
267
+ export interface HarmonieInitialPropsResult {
268
+ layers?: InitialHarmTempAndPrecipProps['layers'];
269
+ multiLegend?: boolean;
270
+ }
271
+ export interface InitialTimeSliderProps {
272
+ sliderPreset: {
273
+ mapId: string;
274
+ };
275
+ syncGroupsIds: string[];
276
+ }