@opengeoweb/soundings 20.0.0 → 20.0.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/dist/index.esm.js CHANGED
@@ -148,7 +148,7 @@ var REFERENCE_PRESSURE = 1000 * 100; // 1000hPa = 100000Pa
148
148
  var EARTH_MEAN_RADIUS = 6371; // [km]
149
149
  var MAX_PROXIMITY_RADIUS = 100; // [km]
150
150
  var SAME_POINT_DISTANCE_KM = 0.05;
151
- var SOUNDINGS_CONTAINER_BREAKPOINT_PX = '720px';
151
+ var SOUNDINGS_CONTAINER_BREAKPOINT_PX = '740px';
152
152
  var SOUNDINGS_CONTAINER_NAME = 'soundings-container';
153
153
 
154
154
  /* *
@@ -3311,6 +3311,7 @@ var SoundingsMenuBar = function SoundingsMenuBar(_ref) {
3311
3311
  isOpen = _ref.isOpen,
3312
3312
  _ref$selectedSourcesA = _ref.selectedSourcesAmount,
3313
3313
  selectedSourcesAmount = _ref$selectedSourcesA === void 0 ? 0 : _ref$selectedSourcesA,
3314
+ selectedLocationName = _ref.selectedLocationName,
3314
3315
  shouldHideMarkers = _ref.shouldHideMarkers,
3315
3316
  toggleMarkers = _ref.toggleMarkers,
3316
3317
  isLegendVisible = _ref.isLegendVisible,
@@ -3321,7 +3322,6 @@ var SoundingsMenuBar = function SoundingsMenuBar(_ref) {
3321
3322
  direction: "row",
3322
3323
  spacing: 1,
3323
3324
  sx: (_sx = {
3324
- marginBottom: '4px',
3325
3325
  overflowX: 'auto'
3326
3326
  }, _sx["@container " + SOUNDINGS_CONTAINER_NAME + " (min-width: " + SOUNDINGS_CONTAINER_BREAKPOINT_PX + ")"] = {
3327
3327
  overflowX: 'initial'
@@ -3351,7 +3351,7 @@ var SoundingsMenuBar = function SoundingsMenuBar(_ref) {
3351
3351
  }), jsx(SoundingsTopRowButton, {
3352
3352
  "data-testid": "soundingsLocationsButton",
3353
3353
  icon: jsx(Location, {}),
3354
- longText: t('locations'),
3354
+ longText: selectedLocationName || t('locations'),
3355
3355
  onClick: function onClick() {
3356
3356
  return handleClick(MenuOptions.locations);
3357
3357
  },
@@ -3393,7 +3393,8 @@ var SoundingsMenuBar = function SoundingsMenuBar(_ref) {
3393
3393
  var MenuBarConnect = function MenuBarConnect(_ref) {
3394
3394
  var _isOpen;
3395
3395
  var viewId = _ref.viewId,
3396
- source = _ref.source;
3396
+ source = _ref.source,
3397
+ selectedLocationName = _ref.selectedLocationName;
3397
3398
  var dispatch = useDispatch();
3398
3399
  React.useEffect(function () {
3399
3400
  dispatch(soundingsActions.registerSoundingsView({
@@ -3484,6 +3485,7 @@ var MenuBarConnect = function MenuBarConnect(_ref) {
3484
3485
  handleClick: handleClick,
3485
3486
  isLegendVisible: isLegendVisible,
3486
3487
  isOpen: isOpen,
3488
+ selectedLocationName: selectedLocationName,
3487
3489
  selectedSourcesAmount: sourcesAmount,
3488
3490
  shouldHideMarkers: shouldHideLocationMarkers,
3489
3491
  toggleLegend: toggleLegend,
@@ -6835,6 +6837,17 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
6835
6837
  });
6836
6838
  return result;
6837
6839
  }, [sourceSelections, locationSelections, locationData]);
6840
+ /** Name of a directly picked location (map marker or Locations menu). Stays
6841
+ * undefined for free position clicks, where a location can only be resolved
6842
+ * as a nearby fallback for sources without position query support.
6843
+ */
6844
+ var selectedLocationName = useMemo(function () {
6845
+ var directlySelectedSource = sourceSelections.find(function (source) {
6846
+ var selection = locationSelections == null ? void 0 : locationSelections[source.collectionId];
6847
+ return typeof selection === 'string' && highlightedFeaturesBySource[source.collectionId] !== selection;
6848
+ });
6849
+ return directlySelectedSource ? sourceLocationNames[directlySelectedSource.collectionId] : undefined;
6850
+ }, [sourceSelections, locationSelections, highlightedFeaturesBySource, sourceLocationNames]);
6838
6851
  var sourceResolvedInstanceIds = useMemo(function () {
6839
6852
  var result = {};
6840
6853
  resolvedSourceSelections.forEach(function (source) {
@@ -7336,10 +7349,8 @@ var SoundingsConnect = function SoundingsConnect(_ref) {
7336
7349
  containerName: SOUNDINGS_CONTAINER_NAME
7337
7350
  },
7338
7351
  children: [jsx(Box, {
7339
- sx: {
7340
- paddingLeft: 1
7341
- },
7342
7352
  children: jsx(MenuBarConnect, {
7353
+ selectedLocationName: selectedLocationName,
7343
7354
  viewId: viewId
7344
7355
  })
7345
7356
  }), jsx(Card, {
@@ -9,10 +9,11 @@ interface SoundingsMenuBarProps {
9
9
  handleClick: (menuType: MenuOptions) => void;
10
10
  isOpen: Record<MenuOptions, boolean>;
11
11
  selectedSourcesAmount?: number;
12
+ selectedLocationName?: string;
12
13
  shouldHideMarkers: boolean;
13
14
  toggleMarkers: (shouldHideMarkers: boolean) => void;
14
15
  isLegendVisible: boolean;
15
16
  toggleLegend: () => void;
16
17
  }
17
- export declare const SoundingsMenuBar: ({ handleClick, isOpen, selectedSourcesAmount, shouldHideMarkers, toggleMarkers, isLegendVisible, toggleLegend, }: SoundingsMenuBarProps) => React.ReactElement;
18
+ export declare const SoundingsMenuBar: ({ handleClick, isOpen, selectedSourcesAmount, selectedLocationName, shouldHideMarkers, toggleMarkers, isLegendVisible, toggleLegend, }: SoundingsMenuBarProps) => React.ReactElement;
18
19
  export {};
@@ -3,6 +3,7 @@ import { uiTypes } from '@opengeoweb/store';
3
3
  interface MenuBarConnectProps {
4
4
  viewId: string;
5
5
  source?: uiTypes.Source;
6
+ selectedLocationName?: string;
6
7
  }
7
- export declare const MenuBarConnect: ({ viewId, source, }: MenuBarConnectProps) => React.ReactElement;
8
+ export declare const MenuBarConnect: ({ viewId, source, selectedLocationName, }: MenuBarConnectProps) => React.ReactElement;
8
9
  export {};
@@ -18,5 +18,5 @@ export declare const REFERENCE_PRESSURE: number;
18
18
  export declare const EARTH_MEAN_RADIUS = 6371;
19
19
  export declare const MAX_PROXIMITY_RADIUS = 100;
20
20
  export declare const SAME_POINT_DISTANCE_KM = 0.05;
21
- export declare const SOUNDINGS_CONTAINER_BREAKPOINT_PX = "720px";
21
+ export declare const SOUNDINGS_CONTAINER_BREAKPOINT_PX = "740px";
22
22
  export declare const SOUNDINGS_CONTAINER_NAME = "soundings-container";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/soundings",
3
- "version": "20.0.0",
3
+ "version": "20.0.1",
4
4
  "description": "GeoWeb soundings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,24 +20,24 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/api": "20.0.0",
24
- "@opengeoweb/authentication": "20.0.0",
23
+ "@opengeoweb/api": "20.0.1",
24
+ "@opengeoweb/authentication": "20.0.1",
25
25
  "@tanstack/react-query": "^5.85.5",
26
26
  "d3": "^7.9.0",
27
27
  "react-i18next": "^15.1.1",
28
28
  "i18next": "^25.0.1",
29
- "@opengeoweb/shared": "20.0.0",
29
+ "@opengeoweb/shared": "20.0.1",
30
30
  "@mui/material": "^9.0.1",
31
- "@opengeoweb/store": "20.0.0",
31
+ "@opengeoweb/store": "20.0.1",
32
32
  "react-redux": "^9.2.0",
33
- "@opengeoweb/theme": "20.0.0",
33
+ "@opengeoweb/theme": "20.0.1",
34
34
  "@reduxjs/toolkit": "^2.6.1",
35
- "@opengeoweb/time-slider": "20.0.0",
35
+ "@opengeoweb/time-slider": "20.0.1",
36
36
  "react-window": "^2.2.6",
37
- "@opengeoweb/webmap": "20.0.0",
37
+ "@opengeoweb/webmap": "20.0.1",
38
38
  "lodash": "^4.18.1",
39
39
  "@types/geojson": "^7946.0.14",
40
- "@opengeoweb/webmap-react": "20.0.0",
40
+ "@opengeoweb/webmap-react": "20.0.1",
41
41
  "react-resizable-layout": "^0.7.3",
42
42
  "react-sortablejs": "^6.1.4"
43
43
  },