@opengeoweb/store 12.0.0 → 12.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/index.esm.js +44 -22
- package/package.json +12 -30
- package/src/store/generic/selectors.d.ts +9 -6
- package/src/store/ui/types.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -912,7 +912,7 @@ var createMap = function createMap(_ref) {
|
|
|
912
912
|
_ref$isTimestepAuto = _ref.isTimestepAuto,
|
|
913
913
|
isTimestepAuto = _ref$isTimestepAuto === void 0 ? true : _ref$isTimestepAuto,
|
|
914
914
|
_ref$isTimeSpanAuto = _ref.isTimeSpanAuto,
|
|
915
|
-
isTimeSpanAuto = _ref$isTimeSpanAuto === void 0 ?
|
|
915
|
+
isTimeSpanAuto = _ref$isTimeSpanAuto === void 0 ? true : _ref$isTimeSpanAuto,
|
|
916
916
|
_ref$isTimeSliderHove = _ref.isTimeSliderHoverOn,
|
|
917
917
|
isTimeSliderHoverOn = _ref$isTimeSliderHove === void 0 ? false : _ref$isTimeSliderHove,
|
|
918
918
|
_ref$isTimeSliderVisi = _ref.isTimeSliderVisible,
|
|
@@ -1968,7 +1968,7 @@ var slice$6 = createSlice({
|
|
|
1968
1968
|
});
|
|
1969
1969
|
/* Find all other layers with the same name and service, and update these at once (atomic update) */
|
|
1970
1970
|
var layersToUpdate = Object.values(draft.byId).filter(function (otherLayer) {
|
|
1971
|
-
return otherLayer.name === layer.name && otherLayer.service === layer.service && otherLayer.id;
|
|
1971
|
+
return (otherLayer === null || otherLayer === void 0 ? void 0 : otherLayer.name) === (layer === null || layer === void 0 ? void 0 : layer.name) && (otherLayer === null || otherLayer === void 0 ? void 0 : otherLayer.service) === (layer === null || layer === void 0 ? void 0 : layer.service) && (otherLayer === null || otherLayer === void 0 ? void 0 : otherLayer.id);
|
|
1972
1972
|
});
|
|
1973
1973
|
layersToUpdate.forEach(function (layerToUpdate) {
|
|
1974
1974
|
var _reduxLayer$dimension;
|
|
@@ -1988,8 +1988,8 @@ var slice$6 = createSlice({
|
|
|
1988
1988
|
var wmDimension = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.getDimension(newLayerDimension.name);
|
|
1989
1989
|
/* This will set the new range of start/stop values for this dimension, making getClosestValue work properly */
|
|
1990
1990
|
wmDimension === null || wmDimension === void 0 || wmDimension.reInitializeValues(newLayerDimension.values);
|
|
1991
|
-
var existingDimension = reduxDimensions.find(function (
|
|
1992
|
-
return
|
|
1991
|
+
var existingDimension = reduxDimensions.find(function (dim) {
|
|
1992
|
+
return dim.name === newLayerDimension.name;
|
|
1993
1993
|
});
|
|
1994
1994
|
if (existingDimension) {
|
|
1995
1995
|
if (existingDimension.name === 'reference_time' && reduxLayer.useLatestReferenceTime && newLayerDimension.maxValue) {
|
|
@@ -3685,6 +3685,7 @@ var DialogTypes;
|
|
|
3685
3685
|
DialogTypes["TimeSeriesSelect"] = "timeSeriesSelect";
|
|
3686
3686
|
DialogTypes["TimeSeriesManager"] = "timeSeriesManager";
|
|
3687
3687
|
DialogTypes["TimeseriesInfo"] = "timeseriesInfo";
|
|
3688
|
+
DialogTypes["TimeseriesLocationInfo"] = "timeseriesLocationInfo";
|
|
3688
3689
|
DialogTypes["KeywordFilter"] = "keywordFilter";
|
|
3689
3690
|
DialogTypes["DimensionSelectEnsembleMember"] = "dimensionSelect-ensemble_member";
|
|
3690
3691
|
DialogTypes["DimensionSelectElevation"] = "dimensionSelect-elevation";
|
|
@@ -4538,11 +4539,11 @@ var getLinkedMaps = createSelector([selectLinkedState, function (store, panelId)
|
|
|
4538
4539
|
return linkedState.links[panelId] || [];
|
|
4539
4540
|
}, selectorMemoizationOptions);
|
|
4540
4541
|
var getLinkedFeatureProviders = function getLinkedFeatureProviders(linkedState, mapId) {
|
|
4541
|
-
return Object.keys(linkedState.links).filter(function (panelId) {
|
|
4542
|
+
return linkedState ? Object.keys(linkedState.links).filter(function (panelId) {
|
|
4542
4543
|
return linkedState.links[panelId].find(function (id) {
|
|
4543
4544
|
return id === mapId;
|
|
4544
4545
|
});
|
|
4545
|
-
});
|
|
4546
|
+
}) : [];
|
|
4546
4547
|
};
|
|
4547
4548
|
var selectSharedData = createSelector([selectLinkedState, function (store, panelId) {
|
|
4548
4549
|
return panelId;
|
|
@@ -4614,37 +4615,59 @@ function (state, mapId) {
|
|
|
4614
4615
|
return feature.id === selectedFeatureId;
|
|
4615
4616
|
});
|
|
4616
4617
|
if (selectedFeature && selectedFeature.geometry.type === 'Point') {
|
|
4617
|
-
var _selectedFeature$prop, _selectedFeature$prop2
|
|
4618
|
+
var _selectedFeature$prop, _selectedFeature$prop2;
|
|
4618
4619
|
var coordinates = selectedFeature.geometry.coordinates;
|
|
4619
4620
|
return {
|
|
4620
4621
|
lat: coordinates[1],
|
|
4621
4622
|
lon: coordinates[0],
|
|
4622
4623
|
id: selectedFeature.id,
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
name: (_selectedFeature$prop3 = selectedFeature.properties) === null || _selectedFeature$prop3 === void 0 ? void 0 : _selectedFeature$prop3.name
|
|
4624
|
+
name: (_selectedFeature$prop = selectedFeature.properties) === null || _selectedFeature$prop === void 0 ? void 0 : _selectedFeature$prop.name,
|
|
4625
|
+
occurrences: (_selectedFeature$prop2 = selectedFeature.properties) === null || _selectedFeature$prop2 === void 0 ? void 0 : _selectedFeature$prop2.occurrences
|
|
4626
4626
|
};
|
|
4627
4627
|
}
|
|
4628
4628
|
if (selectedFeature) {
|
|
4629
|
-
var _selectedFeature$
|
|
4629
|
+
var _selectedFeature$prop3, _selectedFeature$prop4;
|
|
4630
4630
|
var center = turf.center(selectedFeature);
|
|
4631
4631
|
return {
|
|
4632
4632
|
lat: center.geometry.coordinates[1],
|
|
4633
4633
|
lon: center.geometry.coordinates[0],
|
|
4634
4634
|
id: selectedFeature.id,
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
name: (_selectedFeature$prop6 = selectedFeature.properties) === null || _selectedFeature$prop6 === void 0 ? void 0 : _selectedFeature$prop6.name
|
|
4635
|
+
name: (_selectedFeature$prop3 = selectedFeature.properties) === null || _selectedFeature$prop3 === void 0 ? void 0 : _selectedFeature$prop3.name,
|
|
4636
|
+
occurrences: (_selectedFeature$prop4 = selectedFeature.properties) === null || _selectedFeature$prop4 === void 0 ? void 0 : _selectedFeature$prop4.occurrences
|
|
4638
4637
|
};
|
|
4639
4638
|
}
|
|
4640
4639
|
return null;
|
|
4641
4640
|
});
|
|
4641
|
+
var getSelectedFeatureAsGeoJSON = createSelector([function (state, mapId) {
|
|
4642
|
+
var _state$linkedState2;
|
|
4643
|
+
var sharedData = (_state$linkedState2 = state.linkedState) === null || _state$linkedState2 === void 0 ? void 0 : _state$linkedState2.sharedData[mapId];
|
|
4644
|
+
var _ref3 = sharedData || {},
|
|
4645
|
+
_ref3$features = _ref3.features,
|
|
4646
|
+
features = _ref3$features === void 0 ? [] : _ref3$features,
|
|
4647
|
+
selectedFeatureId = _ref3.selectedFeatureId;
|
|
4648
|
+
return {
|
|
4649
|
+
features: features,
|
|
4650
|
+
selectedFeatureId: selectedFeatureId
|
|
4651
|
+
};
|
|
4652
|
+
}], function (_ref4) {
|
|
4653
|
+
var features = _ref4.features,
|
|
4654
|
+
selectedFeatureId = _ref4.selectedFeatureId;
|
|
4655
|
+
if (features && selectedFeatureId) {
|
|
4656
|
+
var _features$2;
|
|
4657
|
+
var selectedFeature = (_features$2 = features[0]) === null || _features$2 === void 0 ? void 0 : _features$2.geoJSON.features.find(function (feature) {
|
|
4658
|
+
return feature.id === selectedFeatureId;
|
|
4659
|
+
});
|
|
4660
|
+
return selectedFeature;
|
|
4661
|
+
}
|
|
4662
|
+
return null;
|
|
4663
|
+
});
|
|
4642
4664
|
|
|
4643
4665
|
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
4644
4666
|
__proto__: null,
|
|
4645
4667
|
getLinkedFeatureProviders: getLinkedFeatureProviders,
|
|
4646
4668
|
getLinkedMaps: getLinkedMaps,
|
|
4647
4669
|
getSelectedFeature: getSelectedFeature,
|
|
4670
|
+
getSelectedFeatureAsGeoJSON: getSelectedFeatureAsGeoJSON,
|
|
4648
4671
|
getSynchronizationGroupStore: getSynchronizationGroupStore,
|
|
4649
4672
|
getTime: getTime,
|
|
4650
4673
|
selectLinkedFeatures: selectLinkedFeatures,
|
|
@@ -5136,11 +5159,12 @@ var isAnimating = createSelector(getMapById, function (store) {
|
|
|
5136
5159
|
* @returns {object} returnType: object - object containing isAnimating boolean and id string
|
|
5137
5160
|
*/
|
|
5138
5161
|
var linkedMapAnimationInfo = createSelector(function (store, mapId) {
|
|
5162
|
+
var _genericSelectors$get;
|
|
5139
5163
|
var animationInfo = {
|
|
5140
5164
|
isAnimating: isAnimating(store, mapId),
|
|
5141
5165
|
id: mapId
|
|
5142
5166
|
};
|
|
5143
|
-
getSynchronizationGroupStore(store).groups.allIds.forEach(function (groupId) {
|
|
5167
|
+
(_genericSelectors$get = getSynchronizationGroupStore(store)) === null || _genericSelectors$get === void 0 || _genericSelectors$get.groups.allIds.forEach(function (groupId) {
|
|
5144
5168
|
if (getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id] && getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id].linked) {
|
|
5145
5169
|
getSynchronizationGroupStore(store).groups.byId[groupId].targets.allIds.forEach(function (id) {
|
|
5146
5170
|
if (isAnimating(store, id) === true) {
|
|
@@ -7032,13 +7056,11 @@ mapListener.startListening({
|
|
|
7032
7056
|
timeSliderSpan: timeSliderSpan
|
|
7033
7057
|
}));
|
|
7034
7058
|
}
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
}));
|
|
7041
|
-
}
|
|
7059
|
+
// toggle time span auto - defaults to true
|
|
7060
|
+
listenerApi.dispatch(mapActions.toggleTimeSpanAuto({
|
|
7061
|
+
mapId: mapId,
|
|
7062
|
+
timeSpanAuto: toggleTimeSpanAuto !== null && toggleTimeSpanAuto !== void 0 ? toggleTimeSpanAuto : true
|
|
7063
|
+
}));
|
|
7042
7064
|
if (shouldShowZoomControls !== undefined) {
|
|
7043
7065
|
// toggle zoom controls
|
|
7044
7066
|
listenerApi.dispatch(mapActions.toggleZoomControls({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,39 +8,21 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"
|
|
13
|
-
"@mui/material": "6.4.1",
|
|
14
|
-
"@mui/system": "6.4.6",
|
|
15
|
-
"@mui/x-date-pickers": "7.27.1",
|
|
11
|
+
"@opengeoweb/shared": "12.1.0",
|
|
12
|
+
"react-redux": "^8.1.3",
|
|
16
13
|
"@reduxjs/toolkit": "^1.9.7",
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@storybook/preview-api": "8.4.2",
|
|
20
|
-
"@storybook/react": "8.4.2",
|
|
21
|
-
"@tanstack/query-core": "5.67.1",
|
|
22
|
-
"@tanstack/react-query": "5.67.1",
|
|
23
|
-
"@testing-library/react": "16.0.1",
|
|
24
|
-
"@testing-library/user-event": "14.5.2",
|
|
25
|
-
"@turf/turf": "^7.2.0",
|
|
26
|
-
"axios": "1.8.1",
|
|
27
|
-
"date-fns": "4.1.0",
|
|
28
|
-
"dompurify": "3.2.4",
|
|
29
|
-
"i18next": "23.11.5",
|
|
14
|
+
"@opengeoweb/webmap-react": "12.1.0",
|
|
15
|
+
"@opengeoweb/webmap": "12.1.0",
|
|
30
16
|
"immer": "^10.0.3",
|
|
31
|
-
"jest-canvas-mock": "2.5.2",
|
|
32
|
-
"jest-date-mock": "1.0.10",
|
|
33
17
|
"lodash": "^4.17.21",
|
|
34
|
-
"
|
|
18
|
+
"@opengeoweb/metronome": "12.1.0",
|
|
19
|
+
"@opengeoweb/timeslider": "12.1.0",
|
|
20
|
+
"react-router-dom": "^6.23.1",
|
|
35
21
|
"ol": "^10.4.0",
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"react
|
|
40
|
-
"react-i18next": "15.1.1",
|
|
41
|
-
"react-redux": "^8.1.3",
|
|
42
|
-
"react-resize-detector": "9.1.1",
|
|
43
|
-
"react-router-dom": "^6.23.1"
|
|
22
|
+
"@turf/turf": "^7.2.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "18"
|
|
44
26
|
},
|
|
45
27
|
"module": "./index.esm.js",
|
|
46
28
|
"type": "module",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CoreAppStore } from '../types';
|
|
2
|
-
import type { LinkedState, SynchronizationGroupState, SynchronizationSource } from './syncGroups/types';
|
|
2
|
+
import type { LinkedState, PotentialData, SynchronizationGroupState, SynchronizationSource } from './syncGroups/types';
|
|
3
3
|
export declare const getSynchronizationGroupStore: ((state: CoreAppStore) => SynchronizationGroupState) & import("reselect").OutputSelectorFields<(args_0: SynchronizationGroupState) => SynchronizationGroupState, {
|
|
4
4
|
clearCache: () => void;
|
|
5
5
|
}> & {
|
|
@@ -16,7 +16,7 @@ export declare const getLinkedMaps: ((state: any, panelId: string) => string[])
|
|
|
16
16
|
clearCache: () => void;
|
|
17
17
|
};
|
|
18
18
|
export declare const getLinkedFeatureProviders: (linkedState: LinkedState, mapId: string) => string[];
|
|
19
|
-
export declare const selectSharedData: ((state: any, panelId: string) =>
|
|
19
|
+
export declare const selectSharedData: ((state: any, panelId: string) => PotentialData) & import("reselect").OutputSelectorFields<(args_0: LinkedState, args_1: string) => PotentialData, {
|
|
20
20
|
clearCache: () => void;
|
|
21
21
|
}> & {
|
|
22
22
|
clearCache: () => void;
|
|
@@ -59,9 +59,8 @@ export declare const getSelectedFeature: ((state: SynchronizationGroupState, map
|
|
|
59
59
|
lat: number;
|
|
60
60
|
lon: number;
|
|
61
61
|
id: string;
|
|
62
|
-
serviceId: any;
|
|
63
|
-
collectionId: any;
|
|
64
62
|
name: any;
|
|
63
|
+
occurrences: any;
|
|
65
64
|
} | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
66
65
|
features: {
|
|
67
66
|
id: string;
|
|
@@ -73,11 +72,15 @@ export declare const getSelectedFeature: ((state: SynchronizationGroupState, map
|
|
|
73
72
|
lat: number;
|
|
74
73
|
lon: number;
|
|
75
74
|
id: string;
|
|
76
|
-
serviceId: any;
|
|
77
|
-
collectionId: any;
|
|
78
75
|
name: any;
|
|
76
|
+
occurrences: any;
|
|
79
77
|
} | null, {
|
|
80
78
|
clearCache: () => void;
|
|
81
79
|
}> & {
|
|
82
80
|
clearCache: () => void;
|
|
83
81
|
};
|
|
82
|
+
export declare const getSelectedFeatureAsGeoJSON: ((state: SynchronizationGroupState, mapId: string) => import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties> | null | undefined) & import("reselect").OutputSelectorFields<(args_0: PotentialData) => import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties> | null | undefined, {
|
|
83
|
+
clearCache: () => void;
|
|
84
|
+
}> & {
|
|
85
|
+
clearCache: () => void;
|
|
86
|
+
};
|
package/src/store/ui/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare enum DialogTypes {
|
|
|
7
7
|
TimeSeriesSelect = "timeSeriesSelect",
|
|
8
8
|
TimeSeriesManager = "timeSeriesManager",
|
|
9
9
|
TimeseriesInfo = "timeseriesInfo",
|
|
10
|
+
TimeseriesLocationInfo = "timeseriesLocationInfo",
|
|
10
11
|
KeywordFilter = "keywordFilter",
|
|
11
12
|
DimensionSelectEnsembleMember = "dimensionSelect-ensemble_member",
|
|
12
13
|
DimensionSelectElevation = "dimensionSelect-elevation",
|