@opengeoweb/soundings 15.1.0 → 15.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/index.esm.js CHANGED
@@ -17,8 +17,8 @@ import { timesliderTranslations, TIME_SLIDER_NAMESPACE, BackwardForwardStepButto
17
17
  import { useResizable } from 'react-resizable-layout';
18
18
  import { useQueries } from '@tanstack/react-query';
19
19
  import { getHeaders, handleResponse } from '@opengeoweb/api';
20
- import { createSlice, createSelector, combineReducers, configureStore } from '@reduxjs/toolkit';
21
- import { FixedSizeList } from 'react-window';
20
+ import { createSlice, createAction, createSelector, combineReducers, configureStore } from '@reduxjs/toolkit';
21
+ import { List as List$1 } from 'react-window';
22
22
 
23
23
  var en = {
24
24
  sources: "Sources",
@@ -31,6 +31,7 @@ var en = {
31
31
  "diagram-SKEWT": "Skew-T",
32
32
  "diagram-BIJVOET": "Bijvoet",
33
33
  "diagram-EMAGRAM": "Emagram",
34
+ "coming-soon": "Coming soon",
34
35
  "soundings-toggle-location-markers-label": "Markers",
35
36
  "soundings-toggle-location-markers-tooltip": "Show/hide location markers"
36
37
  };
@@ -45,6 +46,7 @@ var no = {
45
46
  "diagram-SKEWT": "Skew-T",
46
47
  "diagram-BIJVOET": "Bijvoet",
47
48
  "diagram-EMAGRAM": "Emagram",
49
+ "coming-soon": "Kommer snart",
48
50
  "soundings-toggle-location-markers-label": "ikke oversatt",
49
51
  "soundings-toggle-location-markers-tooltip": "ikke oversatt"
50
52
  };
@@ -59,6 +61,7 @@ var nl = {
59
61
  "diagram-SKEWT": "Skew-T",
60
62
  "diagram-BIJVOET": "Bijvoet",
61
63
  "diagram-EMAGRAM": "Emagram",
64
+ "coming-soon": "Binnenkort beschikbaar",
62
65
  "soundings-toggle-location-markers-label": "Kaart locaties",
63
66
  "soundings-toggle-location-markers-tooltip": "Toon/Verberg locatie punten"
64
67
  };
@@ -73,6 +76,7 @@ var fi = {
73
76
  "diagram-SKEWT": "Skew-T",
74
77
  "diagram-BIJVOET": "Bijvoet",
75
78
  "diagram-EMAGRAM": "Emagram",
79
+ "coming-soon": "Tulossa pian",
76
80
  "soundings-toggle-location-markers-label": "Merkit",
77
81
  "soundings-toggle-location-markers-tooltip": "Näytä/piilota kohdemerkit"
78
82
  };
@@ -925,7 +929,7 @@ const drawIsothermsBijvoet = ({
925
929
  const pathString = lineGenerator(points);
926
930
  const strID = `${temp}-isotherm-BIJVOET`;
927
931
  svg.append('path').attr('id', strID).attr('d', pathString).style('fill', 'none').style('stroke-width', temp % 10 === 0 ? 2 : 1).style('stroke', temp === 0 ? '#D27D2D' : 'orange').style('stroke-opacity', 0.5).attr('clip-path', `url(#clip-${d3GraphId}-BIJVOETd3)`);
928
- if (temp % 10 === 0 && points[0] && points[0][1] === height) {
932
+ if (temp % 10 === 0 && points[0]?.[1] === height) {
929
933
  svg.append('text').text(temp).attr('text-anchor', 'middle').attr('x', `${points[0][0]}px`).attr('y', `${height + 12}px`).attr('fill', temp === 0 ? '#D27D2D' : 'orange').attr('font-size', '10px');
930
934
  }
931
935
  }
@@ -2047,7 +2051,8 @@ const SoundingsAccordion = React.forwardRef(({
2047
2051
  children,
2048
2052
  setSoundingsIsClosed,
2049
2053
  setPreviousHeight,
2050
- size
2054
+ size,
2055
+ isDisplayed
2051
2056
  }, aspectRatioRef) => {
2052
2057
  const containerRef = React.useRef(null);
2053
2058
  const widthRef = React.useRef(null);
@@ -2164,6 +2169,7 @@ const SoundingsAccordion = React.forwardRef(({
2164
2169
  };
2165
2170
  }, [autoSizing, minWidth, setContainerWidth]);
2166
2171
  const cardStyleWhenAuto = {
2172
+ display: isDisplayed ? 'block' : 'none',
2167
2173
  width: 'auto',
2168
2174
  flex: '1 1 100%',
2169
2175
  minWidth: 0,
@@ -2171,12 +2177,14 @@ const SoundingsAccordion = React.forwardRef(({
2171
2177
  boxSizing: 'border-box'
2172
2178
  };
2173
2179
  const cardStyleWhenLocked = {
2180
+ display: isDisplayed ? 'block' : 'none',
2174
2181
  width: containerWidth,
2175
2182
  flex: '0 1 auto',
2176
2183
  minWidth,
2177
2184
  maxWidth: maxWidth || '100%',
2178
2185
  boxSizing: 'border-box'
2179
2186
  };
2187
+ //
2180
2188
  return jsx(Card, {
2181
2189
  className: "sortable-item",
2182
2190
  "data-autosizing": autoSizing ? 'true' : 'false',
@@ -2291,7 +2299,7 @@ const SortableAccordions = ({
2291
2299
  }) => {
2292
2300
  const [soundingsIsClosed, setSoundingsIsClosed] = React.useState(false);
2293
2301
  const [previousHeight, setPreviousHeight] = React.useState(size);
2294
- const createPanel = React.useCallback(id => {
2302
+ const createPanel = React.useCallback((id, isDisplayed) => {
2295
2303
  const normalizedId = id.toLowerCase().replace(/\s+/g, '');
2296
2304
  switch (normalizedId) {
2297
2305
  case 'soundings':
@@ -2301,6 +2309,7 @@ const SortableAccordions = ({
2301
2309
  diagramType: chosenDiagramType,
2302
2310
  setDiagramType: setChosenDiagramType
2303
2311
  }),
2312
+ isDisplayed: isDisplayed,
2304
2313
  name: "Soundings",
2305
2314
  ref: viewRef,
2306
2315
  setPreviousHeight: setPreviousHeight,
@@ -2324,6 +2333,7 @@ const SortableAccordions = ({
2324
2333
  });
2325
2334
  case 'windbarbs':
2326
2335
  return jsx(SoundingsAccordion, {
2336
+ isDisplayed: isDisplayed,
2327
2337
  maxWidth: 200,
2328
2338
  name: "Wind Barbs",
2329
2339
  children: jsx(WindBarbs, {
@@ -2378,16 +2388,18 @@ const SortableAccordions = ({
2378
2388
  width: '100%'
2379
2389
  },
2380
2390
  tag: "div",
2381
- children: soundingPanelsInOrder.filter(entry => entry.isDisplayed).flatMap(({
2382
- id
2391
+ children: soundingPanelsInOrder.flatMap(({
2392
+ id,
2393
+ isDisplayed
2383
2394
  }) => {
2384
- const panel = createPanel(id);
2395
+ const panel = createPanel(id, isDisplayed);
2385
2396
  if (!panel) {
2386
2397
  return [];
2387
2398
  }
2388
2399
  return panel ? jsx(React.Fragment, {
2389
2400
  children: React.cloneElement(panel, {
2390
2401
  accordionId: id,
2402
+ isDisplayed,
2391
2403
  handleButtonComponent: jsx(IconButton, {
2392
2404
  "aria-label": "drag-handle",
2393
2405
  className: "drag-handle",
@@ -3061,6 +3073,48 @@ const useGetCollectionLocations = (collections, enabled) => {
3061
3073
  });
3062
3074
  };
3063
3075
 
3076
+ /* *
3077
+ * Licensed under the Apache License, Version 2.0 (the "License");
3078
+ * you may not use this file except in compliance with the License.
3079
+ * You may obtain a copy of the License at
3080
+ *
3081
+ * http://www.apache.org/licenses/LICENSE-2.0
3082
+ *
3083
+ * Unless required by applicable law or agreed to in writing, software
3084
+ * distributed under the License is distributed on an "AS IS" BASIS,
3085
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3086
+ * See the License for the specific language governing permissions and
3087
+ * limitations under the License.
3088
+ *
3089
+ * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3090
+ * Copyright 2025 - Finnish Meteorological Institute (FMI)
3091
+ * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
3092
+ * */
3093
+ const emptyPanelIds = [];
3094
+ const toStringArray = value => {
3095
+ if (!Array.isArray(value)) {
3096
+ return emptyPanelIds;
3097
+ }
3098
+ return value.filter(item => typeof item === 'string');
3099
+ };
3100
+ const getRegisteredPanelIds = state => {
3101
+ if (!state) {
3102
+ return emptyPanelIds;
3103
+ }
3104
+ const registeredPanelIds = toStringArray(state.registeredPanelIds);
3105
+ if (registeredPanelIds.length > 0) {
3106
+ return registeredPanelIds;
3107
+ }
3108
+ return Object.keys(state.byId);
3109
+ };
3110
+ const isRegisteredPanelId = (state, panelId) => {
3111
+ if (!panelId) {
3112
+ return false;
3113
+ }
3114
+ return getRegisteredPanelIds(state).includes(panelId);
3115
+ };
3116
+ const getPanelIdFromAction = action => action.payload?.panelId;
3117
+
3064
3118
  /* *
3065
3119
  * Licensed under the Apache License, Version 2.0 (the "License");
3066
3120
  * you may not use this file except in compliance with the License.
@@ -3100,12 +3154,21 @@ const initialSoundingsState = {
3100
3154
  },
3101
3155
  shouldHideLocationMarkers: false
3102
3156
  };
3157
+ const initialState = {
3158
+ byId: {},
3159
+ registeredPanelIds: [],
3160
+ soundingsCollections: []
3161
+ };
3103
3162
  const slice = createSlice({
3104
3163
  initialState: initialSoundingsState,
3105
3164
  name: 'soundings',
3106
3165
  reducers: {
3166
+ registerSoundingsPanel: (draft, _payloadAction) => {
3167
+ },
3107
3168
  registerSoundingsPreset: (draft, payloadAction) => {
3108
- const preset = payloadAction.payload;
3169
+ const {
3170
+ preset
3171
+ } = payloadAction.payload;
3109
3172
  if (preset) {
3110
3173
  draft.selectedSources = preset.selectedSources ?? {};
3111
3174
  draft.selectedLocations = preset.selectedLocations ?? {};
@@ -3151,7 +3214,7 @@ const slice = createSlice({
3151
3214
  const {
3152
3215
  order,
3153
3216
  entities
3154
- } = payloadAction.payload;
3217
+ } = payloadAction.payload.panels;
3155
3218
  draft.soundingPanels.order = order;
3156
3219
  draft.soundingPanels.entities = entities;
3157
3220
  },
@@ -3160,13 +3223,86 @@ const slice = createSlice({
3160
3223
  newOrderOfIds
3161
3224
  } = payloadAction.payload;
3162
3225
  draft.soundingPanels.order = newOrderOfIds;
3226
+ },
3227
+ toggleSoundingPanelVisibility: (draft, payloadAction) => {
3228
+ const {
3229
+ id
3230
+ } = payloadAction.payload;
3231
+ const panel = draft.soundingPanels.entities[id];
3232
+ if (panel) {
3233
+ panel.isDisplayed = !panel.isDisplayed;
3234
+ }
3163
3235
  }
3164
3236
  }
3165
3237
  });
3166
- const {
3167
- reducer: soundingsReducer,
3168
- actions: soundingsActions
3169
- } = slice;
3238
+ const setSoundingsCollections = createAction('soundings/setCollections');
3239
+ const soundingsActions = {
3240
+ ...slice.actions,
3241
+ setSoundingsCollections
3242
+ };
3243
+ const shouldHandlePanelAction = (state, action) => {
3244
+ return isRegisteredPanelId(state, getPanelIdFromAction(action));
3245
+ };
3246
+ const normalizeSoundingsState = state => {
3247
+ if ('byId' in state) {
3248
+ return state;
3249
+ }
3250
+ return {
3251
+ ...initialState,
3252
+ byId: {
3253
+ ...initialState.byId,
3254
+ default: state
3255
+ },
3256
+ registeredPanelIds: ['default']
3257
+ };
3258
+ };
3259
+ const soundingsReducer = (state, action) => {
3260
+ const normalizedState = normalizeSoundingsState(state ?? initialState);
3261
+ if (action.type === setSoundingsCollections.type) {
3262
+ const collections = action.payload;
3263
+ if (collections === normalizedState.soundingsCollections) {
3264
+ return normalizedState;
3265
+ }
3266
+ return {
3267
+ ...normalizedState,
3268
+ soundingsCollections: collections
3269
+ };
3270
+ }
3271
+ if (action.type === slice.actions.registerSoundingsPanel.type) {
3272
+ const {
3273
+ panelId
3274
+ } = action.payload;
3275
+ if (!panelId) {
3276
+ return normalizedState;
3277
+ }
3278
+ if (normalizedState.registeredPanelIds?.includes(panelId)) {
3279
+ return normalizedState;
3280
+ }
3281
+ return {
3282
+ ...normalizedState,
3283
+ registeredPanelIds: [...(normalizedState.registeredPanelIds ?? []), panelId]
3284
+ };
3285
+ }
3286
+ if (!shouldHandlePanelAction(normalizedState, action)) {
3287
+ return normalizedState;
3288
+ }
3289
+ const panelId = getPanelIdFromAction(action);
3290
+ if (!panelId) {
3291
+ return normalizedState;
3292
+ }
3293
+ const currentPanelState = normalizedState.byId[panelId];
3294
+ const nextPanelState = slice.reducer(currentPanelState ?? initialSoundingsState, action);
3295
+ if (nextPanelState === currentPanelState) {
3296
+ return normalizedState;
3297
+ }
3298
+ return {
3299
+ ...normalizedState,
3300
+ byId: {
3301
+ ...normalizedState.byId,
3302
+ [panelId]: nextPanelState
3303
+ }
3304
+ };
3305
+ };
3170
3306
 
3171
3307
  /* *
3172
3308
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -3185,7 +3321,16 @@ const {
3185
3321
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
3186
3322
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
3187
3323
  * */
3188
- const getSoundingsStore = store => store?.soundings || initialSoundingsState;
3324
+ const emptySoundingsCollections = [];
3325
+ const getSoundingsStore = (store, panelId) => {
3326
+ const soundingsState = store?.soundings;
3327
+ if (!panelId || !isRegisteredPanelId(soundingsState, panelId)) {
3328
+ return initialSoundingsState;
3329
+ }
3330
+ const panelStore = soundingsState?.byId[panelId];
3331
+ return panelStore ?? initialSoundingsState;
3332
+ };
3333
+ const getSoundingsCollections = store => store?.soundings?.soundingsCollections || emptySoundingsCollections;
3189
3334
  const getSourceSelections = createSelector(getSoundingsStore, store => {
3190
3335
  return store.selectedSources;
3191
3336
  }, selectorMemoizationOptions);
@@ -3238,14 +3383,15 @@ const getSoundingsPreset = createSelector(getSoundingsStore, soundingsStore => {
3238
3383
  selectedSources: filteredSources
3239
3384
  };
3240
3385
  }, selectorMemoizationOptions);
3386
+ const EMPTY_SOUDINGS_PANELS = {
3387
+ order: [],
3388
+ entities: {}
3389
+ };
3241
3390
  const getSoundingPanelsInOrder = createSelector(getSoundingsStore, store => {
3242
3391
  const {
3243
3392
  order = [],
3244
3393
  entities = {}
3245
- } = store.soundingPanels || {
3246
- order: [],
3247
- entities: {}
3248
- };
3394
+ } = store.soundingPanels || EMPTY_SOUDINGS_PANELS;
3249
3395
  return order.map(id => entities[id]);
3250
3396
  }, selectorMemoizationOptions);
3251
3397
 
@@ -3259,6 +3405,7 @@ var selectors = /*#__PURE__*/Object.freeze({
3259
3405
  getSelectedTime: getSelectedTime,
3260
3406
  getShouldHideLocationMarkers: getShouldHideLocationMarkers,
3261
3407
  getSoundingPanelsInOrder: getSoundingPanelsInOrder,
3408
+ getSoundingsCollections: getSoundingsCollections,
3262
3409
  getSoundingsPreset: getSoundingsPreset,
3263
3410
  getSourceSelections: getSourceSelections
3264
3411
  });
@@ -3413,14 +3560,19 @@ const MenuBarConnect = ({
3413
3560
  source
3414
3561
  }) => {
3415
3562
  const dispatch = useDispatch();
3563
+ React.useEffect(() => {
3564
+ dispatch(soundingsActions.registerSoundingsPanel({
3565
+ panelId: viewId
3566
+ }));
3567
+ }, [dispatch, viewId]);
3416
3568
  const currentActiveMapIdSources = useSelector(store => uiSelectors.getDialogMapId(store, uiTypes.DialogTypes.SoundingsSources));
3417
3569
  const currentActiveMapIdLocations = useSelector(store => uiSelectors.getDialogMapId(store, uiTypes.DialogTypes.SoundingsLocations));
3418
3570
  const currentActiveMapIdsoundingsManager = useSelector(store => uiSelectors.getDialogMapId(store, uiTypes.DialogTypes.SoundingsManager));
3419
3571
  const isSourcesOpenInStore = useSelector(store => uiSelectors.getisDialogOpen(store, uiTypes.DialogTypes.SoundingsSources));
3420
3572
  const isLocationsOpenInStore = useSelector(store => uiSelectors.getisDialogOpen(store, uiTypes.DialogTypes.SoundingsLocations));
3421
3573
  const isSoundingsManagerOpenInStore = useSelector(store => uiSelectors.getisDialogOpen(store, uiTypes.DialogTypes.SoundingsManager));
3422
- const sourcesAmount = useSelector(getSelectedSourcesAmount);
3423
- const shouldHideLocationMarkers = useSelector(getShouldHideLocationMarkers);
3574
+ const sourcesAmount = useSelector(state => getSelectedSourcesAmount(state, viewId));
3575
+ const shouldHideLocationMarkers = useSelector(state => getShouldHideLocationMarkers(state, viewId));
3424
3576
  const toggleLocationMarkers = React.useCallback(shouldHide => {
3425
3577
  dispatch(soundingsActions.toggleLocationMarkers({
3426
3578
  shouldHideLocationMarkers: shouldHide,
@@ -3450,7 +3602,7 @@ const MenuBarConnect = ({
3450
3602
  const isOpen = {
3451
3603
  [MenuOptions.sources]: currentActiveMapIdSources === viewId && isSourcesOpenInStore,
3452
3604
  [MenuOptions.locations]: currentActiveMapIdLocations === viewId && isLocationsOpenInStore,
3453
- [MenuOptions.soundingsManager]: isSoundingsManagerOpenInStore
3605
+ [MenuOptions.soundingsManager]: currentActiveMapIdsoundingsManager === viewId && isSoundingsManagerOpenInStore
3454
3606
  };
3455
3607
  return jsx(SoundingsMenuBar, {
3456
3608
  handleClick: handleClick,
@@ -3600,8 +3752,8 @@ const roundToClosestTimestep = (timeToRound, availableSteps) => {
3600
3752
  const SoundingsTimeSliderConnect = ({
3601
3753
  viewId
3602
3754
  }) => {
3603
- const selectedTime = useSelector(getSelectedTime);
3604
- const sourceSelections = useSelector(getSelectedSources);
3755
+ const selectedTime = useSelector(state => getSelectedTime(state, viewId));
3756
+ const sourceSelections = useSelector(state => getSelectedSources(state, viewId));
3605
3757
  const dispatch = useDispatch();
3606
3758
  const updateSelectedTime = React.useCallback((selectedTime, isInitialCorrection = false) => {
3607
3759
  dispatch(soundingsActions.updateSelectedTime({
@@ -3673,12 +3825,18 @@ const SoundingsConnect = ({
3673
3825
  const initialLocationsRef = React.useRef({});
3674
3826
  const previousLocationsRef = React.useRef({});
3675
3827
  React.useLayoutEffect(() => {
3828
+ dispatch(soundingsActions.registerSoundingsPanel({
3829
+ panelId: viewId
3830
+ }));
3676
3831
  if (soundingsPreset && !isEqual(soundingsPreset, soundingsPresetRef.current)) {
3677
3832
  soundingsPresetRef.current = soundingsPreset;
3678
3833
  presetJustLoadedRef.current = true;
3679
3834
  initialLocationsRef.current = soundingsPreset.selectedLocations || {};
3680
3835
  previousLocationsRef.current = {};
3681
- dispatch(soundingsActions.registerSoundingsPreset(soundingsPreset));
3836
+ dispatch(soundingsActions.registerSoundingsPreset({
3837
+ panelId: viewId,
3838
+ preset: soundingsPreset
3839
+ }));
3682
3840
  setTimeout(() => {
3683
3841
  presetJustLoadedRef.current = false;
3684
3842
  initialLocationsRef.current = {};
@@ -3689,11 +3847,11 @@ const SoundingsConnect = ({
3689
3847
  previousLocationsRef.current = {};
3690
3848
  }
3691
3849
  }, [dispatch, soundingsPreset, viewId]);
3692
- const selectedTime = useSelector(getSelectedTime);
3693
- const sourceSelections = useSelector(getSelectedSources, shallowEqual);
3694
- const locationSelections = useSelector(getLocationSelections, shallowEqual);
3695
- const diagramType = useSelector(getDiagramType);
3696
- const shouldHideLocationMarkers = useSelector(getShouldHideLocationMarkers);
3850
+ const selectedTime = useSelector(state => getSelectedTime(state, viewId));
3851
+ const sourceSelections = useSelector(state => getSelectedSources(state, viewId), shallowEqual);
3852
+ const locationSelections = useSelector(state => getLocationSelections(state, viewId), shallowEqual);
3853
+ const diagramType = useSelector(state => getDiagramType(state, viewId));
3854
+ const shouldHideLocationMarkers = useSelector(state => getShouldHideLocationMarkers(state, viewId));
3697
3855
  const setChosenDiagramType = React.useCallback(diagramType => {
3698
3856
  dispatch(soundingsActions.updateDiagramType({
3699
3857
  diagramType,
@@ -3925,10 +4083,11 @@ const SoundingsConnect = ({
3925
4083
  data,
3926
4084
  isPending
3927
4085
  } = useMultipleSources(sourceSelections, locationSelections, selectedTime);
3928
- const soundingPanelsInOrder = useSelector(store => getSoundingPanelsInOrder(store));
4086
+ const soundingPanelsInOrder = useSelector(store => getSoundingPanelsInOrder(store, viewId));
3929
4087
  const changeOrder = newOrder => {
3930
4088
  const orderedIds = newOrder.map(collection => collection.id);
3931
4089
  dispatch(soundingsActions.changeSoundingPanelOrder({
4090
+ panelId: viewId,
3932
4091
  newOrderOfIds: orderedIds
3933
4092
  }));
3934
4093
  };
@@ -4182,10 +4341,17 @@ const SoundingsSourceDialogConnect = ({
4182
4341
  origin: SoundingsActionOrigin.soundingsComponent
4183
4342
  }));
4184
4343
  }, [dispatch, panelId]);
4185
- const sourceSelections = useSelector(getSourceSelections);
4344
+ const soundingsCollectionsFromStore = useSelector(state => getSoundingsCollections(state));
4345
+ const collections = soundingsCollections ?? soundingsCollectionsFromStore;
4346
+ const sourceSelections = useSelector(state => getSourceSelections(state, panelId));
4186
4347
  // Set mappings for each collection
4187
4348
  React.useEffect(() => {
4188
- soundingsCollections?.forEach(collection => {
4349
+ if (soundingsCollections && soundingsCollections.length > 0) {
4350
+ dispatch(soundingsActions.setSoundingsCollections(soundingsCollections));
4351
+ }
4352
+ }, [dispatch, soundingsCollections]);
4353
+ React.useEffect(() => {
4354
+ collections?.forEach(collection => {
4189
4355
  const currentSelection = sourceSelections[collection.id];
4190
4356
  if (currentSelection?.url && currentSelection?.parameterMappings) {
4191
4357
  return;
@@ -4201,16 +4367,17 @@ const SoundingsSourceDialogConnect = ({
4201
4367
  dispatch(soundingsActions.updateSelectedSource({
4202
4368
  sourceId: collection.id,
4203
4369
  value: newValue,
4370
+ panelId,
4204
4371
  origin: SoundingsActionOrigin.soundingsManager
4205
4372
  }));
4206
4373
  });
4207
4374
  // eslint-disable-next-line react-hooks/exhaustive-deps
4208
- }, [dispatch, soundingsCollections, panelId]);
4375
+ }, [dispatch, collections, panelId]);
4209
4376
  const {
4210
4377
  data,
4211
4378
  isPending,
4212
4379
  error
4213
- } = useGetCollectionsInstances(soundingsCollections, isDialogOpen);
4380
+ } = useGetCollectionsInstances(collections, isDialogOpen);
4214
4381
  return jsx(SoundingsSourceMenu, {
4215
4382
  error: error,
4216
4383
  handleClose: onCloseDialog,
@@ -4224,6 +4391,44 @@ const SoundingsSourceDialogConnect = ({
4224
4391
  });
4225
4392
  };
4226
4393
 
4394
+ const RowComponent = ({
4395
+ index,
4396
+ style,
4397
+ service,
4398
+ isChecked,
4399
+ updateSelectedLocation
4400
+ }) => {
4401
+ const location = service.features[index];
4402
+ return jsx("div", {
4403
+ style: style,
4404
+ children: jsx(ListItem, {
4405
+ disableGutters: true,
4406
+ disablePadding: true,
4407
+ children: jsxs(ListItemButton, {
4408
+ dense: true,
4409
+ onClick: () => {
4410
+ updateSelectedLocation(service.id, isChecked(service.id, location.id) ? undefined : location.id);
4411
+ },
4412
+ children: [jsx(ListItemIcon, {
4413
+ children: jsx(Checkbox, {
4414
+ checked: isChecked(service.id, location.id),
4415
+ disableRipple: true,
4416
+ edge: "start",
4417
+ slotProps: {
4418
+ input: {
4419
+ 'aria-labelledby': location.id
4420
+ }
4421
+ },
4422
+ tabIndex: -1
4423
+ })
4424
+ }), jsx(ListItemText, {
4425
+ id: location.id,
4426
+ primary: location.properties.name
4427
+ })]
4428
+ })
4429
+ })
4430
+ }, `${service.id}-${location.id}`);
4431
+ };
4227
4432
  const LocationsMenu = ({
4228
4433
  services,
4229
4434
  selectedSourcesAmount,
@@ -4315,45 +4520,18 @@ const LocationsMenu = ({
4315
4520
  }
4316
4521
  },
4317
4522
  title: service.name,
4318
- children: jsx(FixedSizeList, {
4319
- height: 320,
4320
- itemCount: service.features.length,
4321
- itemSize: 40,
4322
- width: "100%",
4323
- children: ({
4324
- index,
4325
- style
4326
- }) => {
4327
- const location = service.features[index];
4328
- return jsx("div", {
4329
- style: style,
4330
- children: jsx(ListItem, {
4331
- disableGutters: true,
4332
- disablePadding: true,
4333
- children: jsxs(ListItemButton, {
4334
- dense: true,
4335
- onClick: () => {
4336
- updateSelectedLocation(service.id, isChecked(service.id, location.id) ? undefined : location.id);
4337
- },
4338
- children: [jsx(ListItemIcon, {
4339
- children: jsx(Checkbox, {
4340
- checked: isChecked(service.id, location.id),
4341
- disableRipple: true,
4342
- edge: "start",
4343
- slotProps: {
4344
- input: {
4345
- 'aria-labelledby': location.id
4346
- }
4347
- },
4348
- tabIndex: -1
4349
- })
4350
- }), jsx(ListItemText, {
4351
- id: location.id,
4352
- primary: location.properties.name
4353
- })]
4354
- })
4355
- })
4356
- }, `${service.id}-${location.id}`);
4523
+ children: jsx(List$1, {
4524
+ rowComponent: RowComponent,
4525
+ rowCount: service.features.length,
4526
+ rowHeight: 40,
4527
+ rowProps: {
4528
+ service,
4529
+ isChecked,
4530
+ updateSelectedLocation
4531
+ },
4532
+ style: {
4533
+ height: 320,
4534
+ width: '100%'
4357
4535
  }
4358
4536
  })
4359
4537
  })
@@ -4372,14 +4550,22 @@ const LocationsMenuConnect = ({
4372
4550
  dialogOrder,
4373
4551
  setDialogOrder
4374
4552
  } = useSetupDialog(uiTypes.DialogTypes.SoundingsLocations);
4375
- const locationSelections = useSelector(getLocationSelections);
4376
- const selectedSourceIds = useSelector(getSelectedSourcesIds);
4377
- const sourcesAmount = useSelector(getSelectedSourcesAmount);
4553
+ const panelId = useSelector(store => uiSelectors.getDialogMapId(store, uiTypes.DialogTypes.SoundingsLocations));
4554
+ const locationSelections = useSelector(state => getLocationSelections(state, panelId));
4555
+ const selectedSourceIds = useSelector(state => getSelectedSourcesIds(state, panelId));
4556
+ const sourcesAmount = useSelector(state => getSelectedSourcesAmount(state, panelId));
4557
+ const soundingsCollectionsFromStore = useSelector(state => getSoundingsCollections(state));
4558
+ const collections = soundingsCollections ?? soundingsCollectionsFromStore;
4559
+ React.useEffect(() => {
4560
+ if (soundingsCollections && soundingsCollections.length > 0) {
4561
+ dispatch(soundingsActions.setSoundingsCollections(soundingsCollections));
4562
+ }
4563
+ }, [dispatch, soundingsCollections]);
4378
4564
  const {
4379
4565
  data,
4380
4566
  isPending,
4381
4567
  error
4382
- } = useGetCollectionLocations(soundingsCollections, isDialogOpen);
4568
+ } = useGetCollectionLocations(collections, isDialogOpen);
4383
4569
  const services = useMemo(() => {
4384
4570
  return data?.filter(service => selectedSourceIds.includes(service.id)) || [];
4385
4571
  }, [data, selectedSourceIds]);
@@ -4396,7 +4582,8 @@ const LocationsMenuConnect = ({
4396
4582
  updateSelectedLocation: (sourceId, locationId) => {
4397
4583
  dispatch(soundingsActions.updateSelectedLocation({
4398
4584
  sourceId,
4399
- location: locationId
4585
+ location: locationId,
4586
+ panelId
4400
4587
  }));
4401
4588
  }
4402
4589
  });
@@ -4425,8 +4612,10 @@ var preset = {
4425
4612
  };
4426
4613
 
4427
4614
  const SoundingManagerListItem = ({
4615
+ id,
4428
4616
  name,
4429
- isDisplayed
4617
+ isDisplayed,
4618
+ onToggleVisibility
4430
4619
  }) => {
4431
4620
  return jsx(Card, {
4432
4621
  className: "sortable-item",
@@ -4460,7 +4649,16 @@ const SoundingManagerListItem = ({
4460
4649
  display: 'flex',
4461
4650
  alignItems: 'center'
4462
4651
  },
4463
- children: isDisplayed ? jsx(Visibility, {}) : jsx(VisibilityOff, {})
4652
+ children: jsx(IconButton, {
4653
+ "aria-label": "toggle-visibility",
4654
+ onClick: () => onToggleVisibility(id),
4655
+ size: "small",
4656
+ sx: {
4657
+ width: '24px',
4658
+ height: '24px'
4659
+ },
4660
+ children: isDisplayed ? jsx(Visibility, {}) : jsx(VisibilityOff, {})
4661
+ })
4464
4662
  }), jsxs(Box, {
4465
4663
  sx: {
4466
4664
  paddingRight: '8px',
@@ -4478,7 +4676,8 @@ const SoundingsManager = ({
4478
4676
  onMouseDown,
4479
4677
  order,
4480
4678
  soundingPanelsInOrder,
4481
- onOrderChange
4679
+ onOrderChange,
4680
+ onToggleVisibility
4482
4681
  }) => {
4483
4682
  const sortableList = React.useMemo(() => soundingPanelsInOrder.map(collection => ({
4484
4683
  ...collection
@@ -4506,8 +4705,10 @@ const SoundingsManager = ({
4506
4705
  name,
4507
4706
  isDisplayed
4508
4707
  }) => jsx(SoundingManagerListItem, {
4708
+ id: id,
4509
4709
  isDisplayed: isDisplayed,
4510
- name: name
4710
+ name: name,
4711
+ onToggleVisibility: onToggleVisibility
4511
4712
  }, id))
4512
4713
  })
4513
4714
  });
@@ -4521,22 +4722,33 @@ const SoundingsManagerConnect = () => {
4521
4722
  setDialogOrder
4522
4723
  } = useSetupDialog(uiTypes.DialogTypes.SoundingsManager);
4523
4724
  const dispatch = useDispatch();
4725
+ const panelId = useSelector(store => uiSelectors.getDialogMapId(store, uiTypes.DialogTypes.SoundingsManager));
4524
4726
  React.useEffect(() => {
4525
4727
  const data = preset.SoundingManagerDummyPreset;
4526
- dispatch(soundingsActions.addSoundingPanelsFromPreset(data));
4527
- }, [dispatch]);
4528
- const soundingPanelsInOrder = useSelector(store => getSoundingPanelsInOrder(store));
4728
+ dispatch(soundingsActions.addSoundingPanelsFromPreset({
4729
+ panelId,
4730
+ panels: data
4731
+ }));
4732
+ }, [dispatch, panelId]);
4733
+ const soundingPanelsInOrder = useSelector(store => getSoundingPanelsInOrder(store, panelId));
4529
4734
  const changeOrder = newOrder => {
4530
4735
  const orderedIds = newOrder.map(collection => collection.id);
4531
4736
  dispatch(soundingsActions.changeSoundingPanelOrder({
4737
+ panelId,
4532
4738
  newOrderOfIds: orderedIds
4533
4739
  }));
4534
4740
  };
4741
+ const toggleVisibility = id => {
4742
+ dispatch(soundingsActions.toggleSoundingPanelVisibility({
4743
+ id
4744
+ }));
4745
+ };
4535
4746
  return jsx(SoundingsManager, {
4536
4747
  isOpen: isDialogOpen,
4537
4748
  onClose: onCloseDialog,
4538
4749
  onMouseDown: setDialogOrder,
4539
4750
  onOrderChange: changeOrder,
4751
+ onToggleVisibility: toggleVisibility,
4540
4752
  order: dialogOrder,
4541
4753
  soundingPanelsInOrder: soundingPanelsInOrder
4542
4754
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/soundings",
3
- "version": "15.1.0",
3
+ "version": "15.2.0",
4
4
  "description": "GeoWeb soundings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,24 +8,24 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/api": "15.1.0",
11
+ "@opengeoweb/api": "15.2.0",
12
12
  "@tanstack/react-query": "^5.85.5",
13
13
  "react": "^18.3.1",
14
14
  "d3": "^7.9.0",
15
15
  "react-i18next": "^15.1.1",
16
16
  "i18next": "^25.0.1",
17
- "@opengeoweb/shared": "15.1.0",
17
+ "@opengeoweb/shared": "15.2.0",
18
18
  "@mui/material": "^7.0.1",
19
- "@opengeoweb/store": "15.1.0",
19
+ "@opengeoweb/store": "15.2.0",
20
20
  "react-redux": "^9.2.0",
21
- "@opengeoweb/theme": "15.1.0",
21
+ "@opengeoweb/theme": "15.2.0",
22
22
  "@reduxjs/toolkit": "^2.6.1",
23
- "@opengeoweb/time-slider": "15.1.0",
24
- "react-window": "^1.8.10",
25
- "@opengeoweb/webmap": "15.1.0",
23
+ "@opengeoweb/time-slider": "15.2.0",
24
+ "react-window": "^2.2.6",
25
+ "@opengeoweb/webmap": "15.2.0",
26
26
  "lodash": "^4.17.21",
27
27
  "@types/geojson": "^7946.0.14",
28
- "@opengeoweb/webmap-react": "15.1.0",
28
+ "@opengeoweb/webmap-react": "15.2.0",
29
29
  "react-resizable-layout": "^0.7.3",
30
30
  "react-sortablejs": "^6.1.4"
31
31
  },
package/src/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './lib/store/store';
7
7
  export * from './lib/utils/i18n';
8
8
  export * as SoundingsTypes from './lib/store/types';
9
9
  export { SoundingsActionOrigin } from './lib/store/types';
10
+ export type { SoundingsRootState } from './lib/store/types';
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import type { SoundingsCollection } from '@opengeoweb/shared';
2
3
  interface Props {
3
- soundingsCollections: SoundingsCollection[];
4
+ soundingsCollections?: SoundingsCollection[];
4
5
  }
5
6
  export declare const LocationsMenuConnect: ({ soundingsCollections, }: Props) => React.ReactElement;
6
7
  export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface SoundingPanelPlaceholderProps {
3
+ panelName: string;
4
+ }
5
+ export declare const SoundingPanelPlaceholder: React.FC<SoundingPanelPlaceholderProps>;
@@ -0,0 +1 @@
1
+ export * from './SoundingPanelPlaceholder';
@@ -10,5 +10,6 @@ export interface SoundingsAccordionProps {
10
10
  setSoundingsIsClosed?: (isClosed: boolean) => void;
11
11
  setPreviousHeight?: (size: number) => void;
12
12
  size?: number;
13
+ isDisplayed?: boolean;
13
14
  }
14
15
  export declare const SoundingsAccordion: React.ForwardRefExoticComponent<SoundingsAccordionProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,6 @@
1
- export declare const SoundingManagerListItem: ({ name, isDisplayed, }: {
1
+ export declare const SoundingManagerListItem: ({ id, name, isDisplayed, onToggleVisibility, }: {
2
+ id: string;
2
3
  name: string;
3
4
  isDisplayed: boolean;
5
+ onToggleVisibility: (id: string) => void;
4
6
  }) => React.ReactElement;
@@ -11,6 +11,7 @@ interface SoundingsManagerProps {
11
11
  name: string;
12
12
  isDisplayed: boolean;
13
13
  }[]) => void;
14
+ onToggleVisibility: (id: string) => void;
14
15
  }
15
- export declare const SoundingsManager: ({ isOpen, onClose, onMouseDown, order, soundingPanelsInOrder, onOrderChange, }: SoundingsManagerProps) => React.ReactElement;
16
+ export declare const SoundingsManager: ({ isOpen, onClose, onMouseDown, order, soundingPanelsInOrder, onOrderChange, onToggleVisibility, }: SoundingsManagerProps) => React.ReactElement;
16
17
  export {};
@@ -1,15 +1,24 @@
1
- import type { Draft, PayloadAction } from '@reduxjs/toolkit';
2
- import type { SoundingPanels, SoundingsStore, UpdateLocationPayload, UpdateSourcePayload, UpdateTimePayload, UpdateDiagramTypePayload, ToggleLocationMarkersPayload } from './types';
1
+ import type { Reducer } from '@reduxjs/toolkit';
2
+ import type { SoundingsCollection } from '@opengeoweb/shared';
3
+ import type { SoundingsStore, RegisterSoundingsPresetPayload, UpdateLocationPayload, UpdateSourcePayload, UpdateTimePayload, UpdateDiagramTypePayload, ToggleLocationMarkersPayload, AddSoundingPanelsPayload, ChangeSoundingPanelOrderPayload, SoundingsState } from './types';
3
4
  export declare const initialSoundingsState: SoundingsStore;
4
- export declare const soundingsReducer: import("redux").Reducer<SoundingsStore>, soundingsActions: import("@reduxjs/toolkit").CaseReducerActions<{
5
- registerSoundingsPreset: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<SoundingsStore>) => void;
6
- updateSelectedSource: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateSourcePayload>) => void;
7
- updateSelectedLocation: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateLocationPayload>) => void;
8
- updateSelectedTime: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateTimePayload>) => void;
9
- updateDiagramType: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateDiagramTypePayload>) => void;
10
- toggleLocationMarkers: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<ToggleLocationMarkersPayload>) => void;
11
- addSoundingPanelsFromPreset: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<SoundingPanels>) => void;
12
- changeSoundingPanelOrder: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<{
13
- newOrderOfIds: string[];
14
- }>) => void;
15
- }, "soundings">;
5
+ export declare const soundingsActions: {
6
+ setSoundingsCollections: import("@reduxjs/toolkit").ActionCreatorWithPayload<SoundingsCollection[], string>;
7
+ registerSoundingsPanel: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
+ panelId: string;
9
+ }, "soundings/registerSoundingsPanel">;
10
+ registerSoundingsPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<RegisterSoundingsPresetPayload, "soundings/registerSoundingsPreset">;
11
+ updateSelectedSource: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateSourcePayload, "soundings/updateSelectedSource">;
12
+ updateSelectedLocation: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateLocationPayload, "soundings/updateSelectedLocation">;
13
+ updateSelectedTime: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateTimePayload, "soundings/updateSelectedTime">;
14
+ updateDiagramType: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateDiagramTypePayload, "soundings/updateDiagramType">;
15
+ toggleLocationMarkers: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleLocationMarkersPayload, "soundings/toggleLocationMarkers">;
16
+ addSoundingPanelsFromPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<AddSoundingPanelsPayload, "soundings/addSoundingPanelsFromPreset">;
17
+ changeSoundingPanelOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChangeSoundingPanelOrderPayload, "soundings/changeSoundingPanelOrder">;
18
+ toggleSoundingPanelVisibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
19
+ id: string;
20
+ panelId?: string;
21
+ origin?: string;
22
+ }, "soundings/toggleSoundingPanelVisibility">;
23
+ };
24
+ export declare const soundingsReducer: Reducer<SoundingsState>;
@@ -1,6 +1,7 @@
1
- import type { SourceSelection } from '@opengeoweb/shared';
1
+ import type { SoundingsCollection, SourceSelection } from '@opengeoweb/shared';
2
2
  import type { SoundingsModuleState, SoundingsStore, SourceType } from './types';
3
- export declare const getSourceSelections: ((state: SoundingsModuleState) => Record<string, SourceSelection>) & {
3
+ export declare const getSoundingsCollections: (store: SoundingsModuleState) => SoundingsCollection[];
4
+ export declare const getSourceSelections: ((state: SoundingsModuleState, panelId?: string | undefined) => Record<string, SourceSelection>) & {
4
5
  clearCache: () => void;
5
6
  resultsCount: () => number;
6
7
  resetResultsCount: () => void;
@@ -12,7 +13,7 @@ export declare const getSourceSelections: ((state: SoundingsModuleState) => Reco
12
13
  resetResultsCount: () => void;
13
14
  };
14
15
  lastResult: () => Record<string, SourceSelection>;
15
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
16
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
16
17
  recomputations: () => number;
17
18
  resetRecomputations: () => void;
18
19
  dependencyRecomputations: () => number;
@@ -21,7 +22,7 @@ export declare const getSourceSelections: ((state: SoundingsModuleState) => Reco
21
22
  memoize: typeof import("reselect").weakMapMemoize;
22
23
  argsMemoize: typeof import("reselect").weakMapMemoize;
23
24
  };
24
- export declare const getLocationSelections: ((state: SoundingsModuleState) => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>) & {
25
+ export declare const getLocationSelections: ((state: SoundingsModuleState, panelId?: string | undefined) => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>) & {
25
26
  clearCache: () => void;
26
27
  resultsCount: () => number;
27
28
  resetResultsCount: () => void;
@@ -33,7 +34,7 @@ export declare const getLocationSelections: ((state: SoundingsModuleState) => Re
33
34
  resetResultsCount: () => void;
34
35
  };
35
36
  lastResult: () => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>;
36
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
37
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
37
38
  recomputations: () => number;
38
39
  resetRecomputations: () => void;
39
40
  dependencyRecomputations: () => number;
@@ -42,7 +43,7 @@ export declare const getLocationSelections: ((state: SoundingsModuleState) => Re
42
43
  memoize: typeof import("reselect").weakMapMemoize;
43
44
  argsMemoize: typeof import("reselect").weakMapMemoize;
44
45
  };
45
- export declare const getSelectedTime: ((state: SoundingsModuleState) => string) & {
46
+ export declare const getSelectedTime: ((state: SoundingsModuleState, panelId?: string | undefined) => string) & {
46
47
  clearCache: () => void;
47
48
  resultsCount: () => number;
48
49
  resetResultsCount: () => void;
@@ -54,7 +55,7 @@ export declare const getSelectedTime: ((state: SoundingsModuleState) => string)
54
55
  resetResultsCount: () => void;
55
56
  };
56
57
  lastResult: () => string;
57
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
58
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
58
59
  recomputations: () => number;
59
60
  resetRecomputations: () => void;
60
61
  dependencyRecomputations: () => number;
@@ -63,7 +64,7 @@ export declare const getSelectedTime: ((state: SoundingsModuleState) => string)
63
64
  memoize: typeof import("reselect").weakMapMemoize;
64
65
  argsMemoize: typeof import("reselect").weakMapMemoize;
65
66
  };
66
- export declare const getDiagramType: ((state: SoundingsModuleState) => "SKEWT" | "BIJVOET" | "EMAGRAM") & {
67
+ export declare const getDiagramType: ((state: SoundingsModuleState, panelId?: string | undefined) => "SKEWT" | "BIJVOET" | "EMAGRAM") & {
67
68
  clearCache: () => void;
68
69
  resultsCount: () => number;
69
70
  resetResultsCount: () => void;
@@ -75,7 +76,7 @@ export declare const getDiagramType: ((state: SoundingsModuleState) => "SKEWT" |
75
76
  resetResultsCount: () => void;
76
77
  };
77
78
  lastResult: () => "SKEWT" | "BIJVOET" | "EMAGRAM";
78
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
79
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
79
80
  recomputations: () => number;
80
81
  resetRecomputations: () => void;
81
82
  dependencyRecomputations: () => number;
@@ -84,7 +85,7 @@ export declare const getDiagramType: ((state: SoundingsModuleState) => "SKEWT" |
84
85
  memoize: typeof import("reselect").weakMapMemoize;
85
86
  argsMemoize: typeof import("reselect").weakMapMemoize;
86
87
  };
87
- export declare const getShouldHideLocationMarkers: ((state: SoundingsModuleState) => boolean) & {
88
+ export declare const getShouldHideLocationMarkers: ((state: SoundingsModuleState, panelId?: string | undefined) => boolean) & {
88
89
  clearCache: () => void;
89
90
  resultsCount: () => number;
90
91
  resetResultsCount: () => void;
@@ -96,7 +97,7 @@ export declare const getShouldHideLocationMarkers: ((state: SoundingsModuleState
96
97
  resetResultsCount: () => void;
97
98
  };
98
99
  lastResult: () => boolean;
99
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
100
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
100
101
  recomputations: () => number;
101
102
  resetRecomputations: () => void;
102
103
  dependencyRecomputations: () => number;
@@ -105,7 +106,7 @@ export declare const getShouldHideLocationMarkers: ((state: SoundingsModuleState
105
106
  memoize: typeof import("reselect").weakMapMemoize;
106
107
  argsMemoize: typeof import("reselect").weakMapMemoize;
107
108
  };
108
- export declare const getSelectedSources: ((state: SoundingsModuleState) => SourceType[]) & {
109
+ export declare const getSelectedSources: ((state: SoundingsModuleState, panelId?: string | undefined) => SourceType[]) & {
109
110
  clearCache: () => void;
110
111
  resultsCount: () => number;
111
112
  resetResultsCount: () => void;
@@ -117,7 +118,7 @@ export declare const getSelectedSources: ((state: SoundingsModuleState) => Sourc
117
118
  resetResultsCount: () => void;
118
119
  };
119
120
  lastResult: () => SourceType[];
120
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
121
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
121
122
  recomputations: () => number;
122
123
  resetRecomputations: () => void;
123
124
  dependencyRecomputations: () => number;
@@ -126,7 +127,7 @@ export declare const getSelectedSources: ((state: SoundingsModuleState) => Sourc
126
127
  memoize: typeof import("reselect").weakMapMemoize;
127
128
  argsMemoize: typeof import("reselect").weakMapMemoize;
128
129
  };
129
- export declare const getSelectedSourcesAmount: ((state: SoundingsModuleState) => number) & {
130
+ export declare const getSelectedSourcesAmount: ((state: SoundingsModuleState, panelId?: string | undefined) => number) & {
130
131
  clearCache: () => void;
131
132
  resultsCount: () => number;
132
133
  resetResultsCount: () => void;
@@ -138,7 +139,7 @@ export declare const getSelectedSourcesAmount: ((state: SoundingsModuleState) =>
138
139
  resetResultsCount: () => void;
139
140
  };
140
141
  lastResult: () => number;
141
- dependencies: [((state: SoundingsModuleState) => SourceType[]) & {
142
+ dependencies: [((state: SoundingsModuleState, panelId?: string | undefined) => SourceType[]) & {
142
143
  clearCache: () => void;
143
144
  resultsCount: () => number;
144
145
  resetResultsCount: () => void;
@@ -150,7 +151,7 @@ export declare const getSelectedSourcesAmount: ((state: SoundingsModuleState) =>
150
151
  resetResultsCount: () => void;
151
152
  };
152
153
  lastResult: () => SourceType[];
153
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
154
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
154
155
  recomputations: () => number;
155
156
  resetRecomputations: () => void;
156
157
  dependencyRecomputations: () => number;
@@ -167,7 +168,7 @@ export declare const getSelectedSourcesAmount: ((state: SoundingsModuleState) =>
167
168
  memoize: typeof import("reselect").weakMapMemoize;
168
169
  argsMemoize: typeof import("reselect").weakMapMemoize;
169
170
  };
170
- export declare const getSelectedSourcesIds: ((state: SoundingsModuleState) => string[]) & {
171
+ export declare const getSelectedSourcesIds: ((state: SoundingsModuleState, panelId?: string | undefined) => string[]) & {
171
172
  clearCache: () => void;
172
173
  resultsCount: () => number;
173
174
  resetResultsCount: () => void;
@@ -179,7 +180,7 @@ export declare const getSelectedSourcesIds: ((state: SoundingsModuleState) => st
179
180
  resetResultsCount: () => void;
180
181
  };
181
182
  lastResult: () => string[];
182
- dependencies: [((state: SoundingsModuleState) => SourceType[]) & {
183
+ dependencies: [((state: SoundingsModuleState, panelId?: string | undefined) => SourceType[]) & {
183
184
  clearCache: () => void;
184
185
  resultsCount: () => number;
185
186
  resetResultsCount: () => void;
@@ -191,7 +192,7 @@ export declare const getSelectedSourcesIds: ((state: SoundingsModuleState) => st
191
192
  resetResultsCount: () => void;
192
193
  };
193
194
  lastResult: () => SourceType[];
194
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
195
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
195
196
  recomputations: () => number;
196
197
  resetRecomputations: () => void;
197
198
  dependencyRecomputations: () => number;
@@ -208,7 +209,7 @@ export declare const getSelectedSourcesIds: ((state: SoundingsModuleState) => st
208
209
  memoize: typeof import("reselect").weakMapMemoize;
209
210
  argsMemoize: typeof import("reselect").weakMapMemoize;
210
211
  };
211
- export declare const getSoundingsPreset: ((state: SoundingsModuleState) => SoundingsStore) & {
212
+ export declare const getSoundingsPreset: ((state: SoundingsModuleState, panelId?: string | undefined) => SoundingsStore) & {
212
213
  clearCache: () => void;
213
214
  resultsCount: () => number;
214
215
  resetResultsCount: () => void;
@@ -220,7 +221,7 @@ export declare const getSoundingsPreset: ((state: SoundingsModuleState) => Sound
220
221
  resetResultsCount: () => void;
221
222
  };
222
223
  lastResult: () => SoundingsStore;
223
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
224
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
224
225
  recomputations: () => number;
225
226
  resetRecomputations: () => void;
226
227
  dependencyRecomputations: () => number;
@@ -229,7 +230,7 @@ export declare const getSoundingsPreset: ((state: SoundingsModuleState) => Sound
229
230
  memoize: typeof import("reselect").weakMapMemoize;
230
231
  argsMemoize: typeof import("reselect").weakMapMemoize;
231
232
  };
232
- export declare const getSoundingPanelsInOrder: ((state: SoundingsModuleState) => import("./types").SoundingPanel[]) & {
233
+ export declare const getSoundingPanelsInOrder: ((state: SoundingsModuleState, panelId?: string | undefined) => import("./types").SoundingPanel[]) & {
233
234
  clearCache: () => void;
234
235
  resultsCount: () => number;
235
236
  resetResultsCount: () => void;
@@ -241,7 +242,7 @@ export declare const getSoundingPanelsInOrder: ((state: SoundingsModuleState) =>
241
242
  resetResultsCount: () => void;
242
243
  };
243
244
  lastResult: () => import("./types").SoundingPanel[];
244
- dependencies: [(store: SoundingsModuleState) => SoundingsStore];
245
+ dependencies: [(store: SoundingsModuleState, panelId?: string) => SoundingsStore];
245
246
  recomputations: () => number;
246
247
  resetRecomputations: () => void;
247
248
  dependencyRecomputations: () => number;
@@ -18,6 +18,6 @@ export declare const soundingsReducersMap: {
18
18
  }, import("redux").UnknownAction, Partial<{
19
19
  auth: import("dist/libs/store/src/store/common/auth/types").AuthStore | undefined;
20
20
  }>>;
21
- soundings: import("redux").Reducer<import("./types").SoundingsStore>;
21
+ soundings: import("redux").Reducer<import("./types").SoundingsState>;
22
22
  };
23
23
  export declare const createMockStore: (mockState?: SoundingsModuleState | WebMapStateModuleState | UIModuleState) => Store;
@@ -1,4 +1,5 @@
1
- import type { Coordinates, SourceSelection } from '@opengeoweb/shared';
1
+ import type { Coordinates, SoundingsCollection, SourceSelection } from '@opengeoweb/shared';
2
+ import type { CoreAppStore } from '@opengeoweb/store';
2
3
  export declare enum SoundingsActionOrigin {
3
4
  soundingsManager = "soundingsManager",
4
5
  soundingsComponent = "soundingsComponent"
@@ -32,6 +33,16 @@ export interface UpdateDiagramTypePayload extends SoundingsPayload {
32
33
  export interface ToggleLocationMarkersPayload extends SoundingsPayload {
33
34
  shouldHideLocationMarkers: boolean;
34
35
  }
36
+ export interface RegisterSoundingsPresetPayload extends SoundingsPayload {
37
+ preset: SoundingsStore;
38
+ }
39
+ export interface AddSoundingPanelsPayload extends SoundingsPayload {
40
+ panels: SoundingPanels;
41
+ }
42
+ export interface ChangeSoundingPanelOrderPayload extends SoundingsPayload {
43
+ newOrderOfIds: string[];
44
+ }
45
+ export type SoundingsRootState = CoreAppStore & SoundingsModuleState;
35
46
  export interface SoundingPanel {
36
47
  id: string;
37
48
  name: string;
@@ -54,6 +65,11 @@ export interface SoundingsStore {
54
65
  /** Whether to hide location markers on the map */
55
66
  shouldHideLocationMarkers?: boolean;
56
67
  }
68
+ export interface SoundingsState {
69
+ byId: Record<string, SoundingsStore>;
70
+ registeredPanelIds?: string[];
71
+ soundingsCollections: SoundingsCollection[];
72
+ }
57
73
  export interface SoundingsModuleState {
58
- soundings?: SoundingsStore;
74
+ soundings?: SoundingsState;
59
75
  }
@@ -0,0 +1,10 @@
1
+ import type { SoundingsModuleState } from './types';
2
+ type PanelStateLike = SoundingsModuleState['soundings'];
3
+ export declare const getRegisteredPanelIds: (state: PanelStateLike | undefined) => string[];
4
+ export declare const isRegisteredPanelId: (state: PanelStateLike | undefined, panelId?: string) => boolean;
5
+ export declare const getPanelIdFromAction: (action: {
6
+ payload?: {
7
+ panelId?: string;
8
+ };
9
+ }) => string | undefined;
10
+ export {};