@opengeoweb/store 13.0.0 → 13.2.1

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
@@ -1978,9 +1978,21 @@ var slice$6 = createSlice({
1978
1978
  return dim.name === newLayerDimension.name;
1979
1979
  });
1980
1980
  if (existingDimension) {
1981
- var _newLayerDimension$va;
1982
- if (existingDimension.name === 'reference_time' && reduxLayer.useLatestReferenceTime && newLayerDimension.maxValue) {
1983
- existingDimension.currentValue = newLayerDimension.maxValue;
1981
+ var _newLayerDimension$va2;
1982
+ if (existingDimension.name === 'reference_time' && reduxLayer.useLatestReferenceTime) {
1983
+ var _existingDimension$va, _newLayerDimension$va;
1984
+ // update currentvalue to corresponding LATEST value
1985
+ // LATEST, LATEST-1, LATEST-2, LATEST-3
1986
+ var existingValues = (_existingDimension$va = existingDimension.values) === null || _existingDimension$va === void 0 ? void 0 : _existingDimension$va.split(',');
1987
+ var newValues = (_newLayerDimension$va = newLayerDimension.values) === null || _newLayerDimension$va === void 0 ? void 0 : _newLayerDimension$va.split(',');
1988
+ if (existingValues && newValues) {
1989
+ var match = [1, 2, 3, 4].find(function (offset) {
1990
+ return existingDimension.currentValue === existingValues.at(-offset) && newValues.at(-offset) !== undefined;
1991
+ });
1992
+ if (match) {
1993
+ existingDimension.currentValue = newValues.at(-match);
1994
+ }
1995
+ }
1984
1996
  }
1985
1997
  /* If found update only minValue, maxValue and values */
1986
1998
  existingDimension.maxValue = newLayerDimension.maxValue;
@@ -1990,7 +2002,7 @@ var slice$6 = createSlice({
1990
2002
  existingDimension.units = newLayerDimension.units;
1991
2003
  }
1992
2004
  /* For non time dimensions also update the current value, but only if the currentValue does not exist in the new dimension values */
1993
- var listOfValues = (_newLayerDimension$va = newLayerDimension.values) === null || _newLayerDimension$va === void 0 ? void 0 : _newLayerDimension$va.split(',');
2005
+ var listOfValues = (_newLayerDimension$va2 = newLayerDimension.values) === null || _newLayerDimension$va2 === void 0 ? void 0 : _newLayerDimension$va2.split(',');
1994
2006
  if (existingDimension.name !== 'time' && existingDimension.name !== 'reference_time' && !(listOfValues !== null && listOfValues !== void 0 && listOfValues.includes(existingDimension.currentValue))) {
1995
2007
  existingDimension.currentValue = newLayerDimension.currentValue;
1996
2008
  }
@@ -4935,12 +4947,13 @@ var loadingIndicatorActions = slice$2.actions,
4935
4947
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
4936
4948
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
4937
4949
  * */
4950
+ var EMPTY_LOADING_INDICATOR = {
4951
+ entities: {},
4952
+ ids: []
4953
+ };
4938
4954
  var _loadingIndicatorAdap = loadingIndicatorAdapter.getSelectors(function (state) {
4939
4955
  var _state$loadingIndicat;
4940
- return (_state$loadingIndicat = state === null || state === void 0 ? void 0 : state.loadingIndicator) !== null && _state$loadingIndicat !== void 0 ? _state$loadingIndicat : {
4941
- entities: {},
4942
- ids: []
4943
- };
4956
+ return (_state$loadingIndicat = state === null || state === void 0 ? void 0 : state.loadingIndicator) !== null && _state$loadingIndicat !== void 0 ? _state$loadingIndicat : EMPTY_LOADING_INDICATOR;
4944
4957
  }),
4945
4958
  selectLoadingIndicatorById = _loadingIndicatorAdap.selectById;
4946
4959
  var isGetMapLoading = createSelector(selectLoadingIndicatorById, function (loadingIndicator) {
@@ -4975,6 +4988,27 @@ var genericActions = _objectSpread2(_objectSpread2({}, syncGroupsActions), {}, {
4975
4988
  setBbox: setBbox
4976
4989
  });
4977
4990
 
4991
+ /* *
4992
+ * Licensed under the Apache License, Version 2.0 (the "License");
4993
+ * you may not use this file except in compliance with the License.
4994
+ * You may obtain a copy of the License at
4995
+ *
4996
+ * http://www.apache.org/licenses/LICENSE-2.0
4997
+ *
4998
+ * Unless required by applicable law or agreed to in writing, software
4999
+ * distributed under the License is distributed on an "AS IS" BASIS,
5000
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5001
+ * See the License for the specific language governing permissions and
5002
+ * limitations under the License.
5003
+ *
5004
+ * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5005
+ * Copyright 2025 - Finnish Meteorological Institute (FMI)
5006
+ * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
5007
+ * */
5008
+ var IS_LEGEND_OPEN_BY_DEFAULT = false;
5009
+ var SECONDS_IN_DAY = 86400;
5010
+ var SECONDS_IN_HOUR = 3600;
5011
+
4978
5012
  var _excluded$2 = ["mapId"];
4979
5013
  var getMapStore = function getMapStore(store) {
4980
5014
  return store && store.webmap;
@@ -5419,7 +5453,7 @@ var getMapTimeSliderCenterTime = function getMapTimeSliderCenterTime(store, mapI
5419
5453
  };
5420
5454
  var getMapTimeSliderStartCenterEndAndStep = createSelector(getMapById, function (store) {
5421
5455
  var _store$timeStep2;
5422
- var timeSliderWidth = ((store === null || store === void 0 ? void 0 : store.timeSliderWidth) || 0) * 60;
5456
+ var timeSliderWidth = (store === null || store === void 0 ? void 0 : store.timeSliderSpan) || SECONDS_IN_DAY;
5423
5457
  var center = store ? store.timeSliderCenterTime : dateUtils.unix(dateUtils.utc());
5424
5458
  var start = center ? center - timeSliderWidth / 2 : undefined;
5425
5459
  var end = center ? center + timeSliderWidth / 2 : undefined;
@@ -5668,9 +5702,9 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
5668
5702
  _ref3.mapId;
5669
5703
  var layer = _objectWithoutProperties(_ref3, _excluded$2);
5670
5704
  if (layer.dimensions !== undefined) {
5671
- // Filter out (reference) time dimension as these should not be part of the preset for now
5705
+ // Filter out time dimension as this should not be part of the preset for now
5672
5706
  var dimensions = layer.dimensions.filter(function (dimension) {
5673
- return dimension.name !== 'time' && dimension.name !== 'reference_time';
5707
+ return dimension.name !== 'time';
5674
5708
  });
5675
5709
  return _objectSpread2(_objectSpread2({}, layer), {}, {
5676
5710
  dimensions: dimensions
@@ -5942,25 +5976,6 @@ var enums = /*#__PURE__*/Object.freeze({
5942
5976
  get MapActionOrigin () { return MapActionOrigin; }
5943
5977
  });
5944
5978
 
5945
- /* *
5946
- * Licensed under the Apache License, Version 2.0 (the "License");
5947
- * you may not use this file except in compliance with the License.
5948
- * You may obtain a copy of the License at
5949
- *
5950
- * http://www.apache.org/licenses/LICENSE-2.0
5951
- *
5952
- * Unless required by applicable law or agreed to in writing, software
5953
- * distributed under the License is distributed on an "AS IS" BASIS,
5954
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5955
- * See the License for the specific language governing permissions and
5956
- * limitations under the License.
5957
- *
5958
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5959
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
5960
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5961
- * */
5962
- var IS_LEGEND_OPEN_BY_DEFAULT = false;
5963
-
5964
5979
  var filterLayers = function filterLayers() {
5965
5980
  var layers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5966
5981
  var layerParser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (layer) {
@@ -8081,12 +8096,13 @@ var getDrawingtoolStore = function getDrawingtoolStore(store) {
8081
8096
  }
8082
8097
  return null;
8083
8098
  };
8099
+ var EMPTY_DRAWING_TOOL_STATE = {
8100
+ entities: {},
8101
+ ids: []
8102
+ };
8084
8103
  var _drawAdapter$getSelec = drawAdapter.getSelectors(function (state) {
8085
8104
  var _state$drawingtools;
8086
- return (_state$drawingtools = state === null || state === void 0 ? void 0 : state.drawingtools) !== null && _state$drawingtools !== void 0 ? _state$drawingtools : {
8087
- entities: {},
8088
- ids: []
8089
- };
8105
+ return (_state$drawingtools = state === null || state === void 0 ? void 0 : state.drawingtools) !== null && _state$drawingtools !== void 0 ? _state$drawingtools : EMPTY_DRAWING_TOOL_STATE;
8090
8106
  }),
8091
8107
  selectDrawToolById = _drawAdapter$getSelec.selectById,
8092
8108
  selectAllDrawingTools = _drawAdapter$getSelec.selectAll;
@@ -8987,4 +9003,4 @@ var configureOpenGeoWebStore = function configureOpenGeoWebStore() {
8987
9003
  });
8988
9004
  };
8989
9005
 
8990
- export { IS_LEGEND_OPEN_BY_DEFAULT, configureOpenGeoWebStore, createMockStore, createViewObjectForNewMap, drawingToolActions, drawingToolListener, drawingToolReducer, selectors as drawingToolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$3 as genericSelectors, types as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, getViewObjectForMapId, getViewObjectForSyncGroup, initialState$2 as initialState, layerActions, layerReducer, selectors$6 as layerSelectors, types$3 as layerTypes, utils$1 as layerUtils, layersListener, constants as linkComponentTypesConstants, loadingIndicatorActions, constants$1 as loadingIndicatorConstants, loadingIndicatorReducer, selectors$2 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, mapReducer, selectors$1 as mapSelectors, types$4 as mapTypes, mapUtils, metronomeListener, openlayersListener, routerActions, routerListener, routerReducer, utils as routerUtils, selectorMemoizationOptions, serviceActions, serviceListener, serviceReducer, selectors$7 as serviceSelectors, types$5 as serviceTypes, setUserAddedServices, storeMiddlewares, storeReducerMap, storeTestSettings, storeTestUtils, utils$3 as storeUtils, constants$2 as syncConstants, syncGroupsActions, syncGroupsListener, syncGroupsReducer, selector as syncGroupsSelector, selectors$4 as syncGroupsSelectors, types$1 as syncGroupsTypes, types$1 as types, uiActions, uiReducer, selectors$5 as uiSelectors, types$2 as uiTypes, unifyReducerMaps, useSetupDialog, useUpdateSharedData };
9006
+ export { IS_LEGEND_OPEN_BY_DEFAULT, SECONDS_IN_DAY, SECONDS_IN_HOUR, configureOpenGeoWebStore, createMockStore, createViewObjectForNewMap, drawingToolActions, drawingToolListener, drawingToolReducer, selectors as drawingToolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$3 as genericSelectors, types as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, getViewObjectForMapId, getViewObjectForSyncGroup, initialState$2 as initialState, layerActions, layerReducer, selectors$6 as layerSelectors, types$3 as layerTypes, utils$1 as layerUtils, layersListener, constants as linkComponentTypesConstants, loadingIndicatorActions, constants$1 as loadingIndicatorConstants, loadingIndicatorReducer, selectors$2 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, mapReducer, selectors$1 as mapSelectors, types$4 as mapTypes, mapUtils, metronomeListener, openlayersListener, routerActions, routerListener, routerReducer, utils as routerUtils, selectorMemoizationOptions, serviceActions, serviceListener, serviceReducer, selectors$7 as serviceSelectors, types$5 as serviceTypes, setUserAddedServices, storeMiddlewares, storeReducerMap, storeTestSettings, storeTestUtils, utils$3 as storeUtils, constants$2 as syncConstants, syncGroupsActions, syncGroupsListener, syncGroupsReducer, selector as syncGroupsSelector, selectors$4 as syncGroupsSelectors, types$1 as syncGroupsTypes, types$1 as types, uiActions, uiReducer, selectors$5 as uiSelectors, types$2 as uiTypes, unifyReducerMaps, useSetupDialog, useUpdateSharedData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/store",
3
- "version": "13.0.0",
3
+ "version": "13.2.1",
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": "13.0.0",
11
+ "@opengeoweb/shared": "13.2.1",
12
12
  "react-redux": "^9.2.0",
13
13
  "@reduxjs/toolkit": "^2.6.1",
14
- "@opengeoweb/webmap-react": "13.0.0",
15
- "@opengeoweb/webmap": "13.0.0",
14
+ "@opengeoweb/webmap-react": "13.2.1",
15
+ "@opengeoweb/webmap": "13.2.1",
16
16
  "immer": "^10.0.3",
17
17
  "lodash": "^4.17.21",
18
- "@opengeoweb/metronome": "13.0.0",
19
- "@opengeoweb/time-slider": "13.0.0",
18
+ "@opengeoweb/metronome": "13.2.1",
19
+ "@opengeoweb/time-slider": "13.2.1",
20
20
  "react-router-dom": "^6.23.1",
21
21
  "ol": "^10.4.0",
22
22
  "@turf/turf": "^7.2.0",
@@ -1 +1,3 @@
1
1
  export declare const IS_LEGEND_OPEN_BY_DEFAULT = false;
2
+ export declare const SECONDS_IN_DAY = 86400;
3
+ export declare const SECONDS_IN_HOUR = 3600;