@opengeoweb/core 10.0.0 → 10.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.
Files changed (26) hide show
  1. package/README.md +2 -2
  2. package/index.esm.js +1056 -764
  3. package/package.json +6 -2
  4. package/src/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +2 -3
  5. package/src/lib/components/MapViewConnect/MapViewConnect.d.ts +11 -3
  6. package/src/lib/components/Providers/Providers.d.ts +0 -2
  7. package/src/lib/components/Search/MyMapLocation.d.ts +5 -6
  8. package/src/lib/components/Search/SearchDialog.d.ts +4 -1
  9. package/src/lib/components/Search/{SearchControl.stories.d.ts → SearchDialog.stories.d.ts} +4 -4
  10. package/src/lib/components/Search/SearchDialogConnect.d.ts +5 -0
  11. package/src/lib/components/Search/SearchDialogConnect.spec.d.ts +1 -0
  12. package/src/lib/components/Search/SearchDialogConnect.stories.d.ts +7 -0
  13. package/src/lib/components/Search/index.d.ts +1 -1
  14. package/src/lib/components/Search/types.d.ts +13 -0
  15. package/src/lib/components/Search/utils.d.ts +6 -0
  16. package/src/lib/components/SyncGroups/SimpleTimeSliderConnect.d.ts +2 -2
  17. package/src/lib/components/TimeSliderConnect/TimeSliderButtonsConnect/AutoUpdateButtonConnect.d.ts +2 -2
  18. package/src/lib/components/TimeSliderConnect/TimeSliderButtonsConnect/PlayButtonConnect.d.ts +4 -4
  19. package/src/lib/components/TimeSliderConnect/TimeSliderCurrentTimeBoxConnect.d.ts +1 -1
  20. package/src/lib/utils/defaultConfigurations.d.ts +3 -3
  21. package/src/lib/utils/location-api/api.d.ts +3 -0
  22. package/src/lib/utils/location-api/fakeApi.d.ts +40 -0
  23. package/src/lib/utils/location-api/hooks.d.ts +9 -0
  24. package/src/lib/utils/testUtils.d.ts +2 -2
  25. package/src/lib/components/Search/SearchControlConnect.d.ts +0 -5
  26. /package/src/lib/components/{Search/SearchControlConnect.spec.d.ts → MultiMapViewConnect/HarmoniePresets/HarmonieTempAndPrecipPreset.spec.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/core",
3
- "version": "10.0.0",
3
+ "version": "10.2.0",
4
4
  "description": "GeoWeb Core library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -29,7 +29,11 @@
29
29
  "react-i18next": "^15.1.1",
30
30
  "dompurify": "^3.0.6",
31
31
  "@mui/material": "^6.1.1",
32
- "@sentry/react": "^8.34.0"
32
+ "@sentry/react": "^8.34.0",
33
+ "@tanstack/react-query": "^5.62.7",
34
+ "@opengeoweb/authentication": "*",
35
+ "@opengeoweb/api": "*",
36
+ "msw": "^1.3.3"
33
37
  },
34
38
  "peerDependencies": {
35
39
  "react": "18",
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { mapTypes, layerTypes } from '@opengeoweb/store';
3
3
  import type { serviceTypes } from '@opengeoweb/store';
4
- type LayerRowProps = Omit<LayerRowUnstyledProps, 'className'>;
5
4
  interface LayerRowUnstyledProps {
6
5
  layerId?: string;
7
6
  layer?: layerTypes.Layer;
@@ -58,10 +57,10 @@ interface LayerRowUnstyledProps {
58
57
  isEnabled?: boolean;
59
58
  dragHandle?: React.ReactElement;
60
59
  isLayerMissing?: boolean;
61
- className: string;
60
+ className?: string;
62
61
  collapsedColumns?: Record<string, boolean>;
63
62
  }
64
- declare const LayerRow: import("@emotion/styled").StyledComponent<LayerRowProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
63
+ declare const LayerRow: import("@emotion/styled").StyledComponent<LayerRowUnstyledProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
65
64
  isEnabled?: boolean | undefined;
66
65
  }, {}, {}>;
67
66
  export default LayerRow;
@@ -1,11 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import { MapViewProps } from '@opengeoweb/webmap-react';
3
+ export interface MapControls {
4
+ mapControlsPositionTop?: number;
5
+ search?: boolean;
6
+ zoomControls?: boolean;
7
+ layerManagerAndLegend?: boolean;
8
+ multiLegend?: boolean;
9
+ dimensionSelect?: boolean;
10
+ getFeatureInfo?: boolean;
11
+ additionalMapControls?: React.ReactNode;
12
+ }
3
13
  export interface MapViewConnectProps extends MapViewProps {
4
14
  mapId: string;
5
15
  displayTimeInMap?: boolean;
6
- controls?: {
7
- zoomControls?: boolean;
8
- };
16
+ controls?: MapControls;
9
17
  showScaleBar?: boolean;
10
18
  children?: React.ReactNode;
11
19
  showLayerInfo?: boolean;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '@mui/material';
3
- import { ThemeProviderProps } from '@opengeoweb/theme';
4
3
  import { Store } from '@reduxjs/toolkit';
5
4
  interface CoreThemeProviderProps {
6
5
  children?: React.ReactNode;
@@ -15,7 +14,6 @@ interface CoreTranslationWrapperProps {
15
14
  * @returns
16
15
  */
17
16
  export declare const CoreThemeProvider: React.FC<CoreThemeProviderProps>;
18
- export declare const ThemeWrapperWithModules: React.FC<ThemeProviderProps>;
19
17
  interface CoreThemeStoreProviderProps extends CoreThemeProviderProps {
20
18
  store: Store;
21
19
  }
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
+ import { LocationDetail } from './types';
2
3
  export interface MyMapLocationProps {
3
- mapId: string | undefined;
4
- isLoading: boolean;
5
- hasFailed: boolean;
6
- setIsLoading: (value: boolean) => void;
7
- setHasFailed: (value: boolean) => void;
4
+ mapId?: string;
5
+ isSelected?: boolean;
6
+ onUpdateMyLocation?: (location?: LocationDetail) => void;
8
7
  }
9
- export declare const MY_LOCATION = "MyLocation";
8
+ export declare const MY_LOCATION = "My location";
10
9
  export declare const MyMapLocation: React.FC<MyMapLocationProps>;
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
+ import { LocationDetail } from './types';
2
3
  export interface SearchDialogProps {
3
4
  isOpen: boolean;
4
- onClose: () => void;
5
5
  mapId?: string;
6
+ onSelectLocation?: (location?: LocationDetail) => void;
7
+ onUpdateMyLocation?: (location?: LocationDetail) => void;
8
+ isMyLocationSelected?: boolean;
6
9
  }
7
10
  export declare const SearchDialog: React.FC<SearchDialogProps>;
@@ -3,11 +3,11 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const SearchControlConnectStoryLight: {
6
+ export declare const SearchDialogLight: {
7
7
  (): React.ReactElement;
8
- storyName: string;
8
+ tags: string[];
9
9
  };
10
- export declare const SearchControlConnectStoryDark: {
10
+ export declare const SearchDialogDark: {
11
11
  (): React.ReactElement;
12
- storyName: string;
12
+ tags: string[];
13
13
  };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface SearchDialogConnectProps {
3
+ mapId?: string;
4
+ }
5
+ export declare const SearchDialogConnect: React.FC<SearchDialogConnectProps>;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const SearchDialogConnectLight: () => React.ReactElement;
7
+ export declare const SearchDialogConnectDark: () => React.ReactElement;
@@ -1,4 +1,4 @@
1
1
  export { SearchControlButtonConnect } from './SearchControlButtonConnect';
2
- export { SearchControlConnect } from './SearchControlConnect';
2
+ export { SearchDialogConnect } from './SearchDialogConnect';
3
3
  export { SearchDialog } from './SearchDialog';
4
4
  export { MyMapLocation } from './MyMapLocation';
@@ -0,0 +1,13 @@
1
+ export interface LocationDetail {
2
+ id: string;
3
+ name: string;
4
+ source: string;
5
+ lat: number;
6
+ lon: number;
7
+ geometry?: GeoJSON.GeoJSON;
8
+ }
9
+ export interface LocationListResult {
10
+ id: string;
11
+ name: string;
12
+ source: string;
13
+ }
@@ -0,0 +1,6 @@
1
+ import { MapDrawDrawFunctionArgs } from '@opengeoweb/webmap-react';
2
+ import { LocationDetail } from './types';
3
+ export declare const myLocationDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
4
+ export declare const selectedLocationDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
5
+ export declare const hoverDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
6
+ export declare const useDrawOnMap: (mapId: string, drawFunction: (args: MapDrawDrawFunctionArgs) => void) => [(location?: LocationDetail) => void];
@@ -2,14 +2,14 @@ import React from 'react';
2
2
  import { genericActions } from '@opengeoweb/store';
3
3
  interface SimpleTimeSliderConnectComponentProps {
4
4
  id: string;
5
- timeValue?: string;
5
+ timeValue?: string | null;
6
6
  setTime?: typeof genericActions.setTime;
7
7
  syncGroupAddSource?: typeof genericActions.syncGroupAddSource;
8
8
  syncGroupRemoveSource?: typeof genericActions.syncGroupRemoveSource;
9
9
  }
10
10
  export declare const SimpleTimeSliderConnect: import("react-redux").ConnectedComponent<React.FC<SimpleTimeSliderConnectComponentProps>, {
11
11
  id: string;
12
- timeValue?: string | undefined;
12
+ timeValue?: string | null | undefined;
13
13
  setTime?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/types").SetTimePayload, string> | undefined;
14
14
  syncGroupAddSource?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/synchronizationGroups/types").SyncGroupsAddSourcePayload, "synchronizationGroupsReducer/syncGroupAddSource"> | undefined;
15
15
  syncGroupRemoveSource?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/synchronizationGroups/types").SyncGroupRemoveSourcePayload, "synchronizationGroupsReducer/syncGroupRemoveSource"> | undefined;
@@ -8,7 +8,7 @@ interface ConnectedAutoUpdateButtonProps {
8
8
  export declare const AutoUpdateButtonConnect: import("react-redux").ConnectedComponent<import("react-redux").ConnectedComponent<({ mapId, isAutoUpdating, toggleAutoUpdate, }: ConnectedAutoUpdateButtonProps) => import("react/jsx-runtime").JSX.Element, {
9
9
  mapId: string;
10
10
  isAutoUpdating?: boolean | undefined;
11
- toggleAutoUpdate?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").ToggleAutoUpdatePayload, "mapReducer/toggleAutoUpdate"> | undefined;
11
+ toggleAutoUpdate?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").ToggleAutoUpdatePayload, "mapReducer/toggleAutoUpdate"> | undefined;
12
12
  context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
13
13
  store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
14
14
  }>, {
@@ -16,6 +16,6 @@ export declare const AutoUpdateButtonConnect: import("react-redux").ConnectedCom
16
16
  context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
17
17
  store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
18
18
  isAutoUpdating?: boolean | undefined;
19
- toggleAutoUpdate?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").ToggleAutoUpdatePayload, "mapReducer/toggleAutoUpdate"> | undefined;
19
+ toggleAutoUpdate?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").ToggleAutoUpdatePayload, "mapReducer/toggleAutoUpdate"> | undefined;
20
20
  }>;
21
21
  export {};
@@ -22,8 +22,8 @@ declare const connectRedux: import("react-redux").InferableComponentEnhancerWith
22
22
  id: string;
23
23
  };
24
24
  } & {
25
- mapStartAnimation: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").SetMapAnimationStartPayload, "mapReducer/mapStartAnimation">;
26
- mapStopAnimation: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").SetMapAnimationStopPayload, "mapReducer/mapStopAnimation">;
25
+ mapStartAnimation: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").SetMapAnimationStartPayload, "mapReducer/mapStartAnimation">;
26
+ mapStopAnimation: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").SetMapAnimationStopPayload, "mapReducer/mapStopAnimation">;
27
27
  }, PlayButtonConnectProps>;
28
28
  type Props = PlayButtonConnectProps & ConnectedProps<typeof connectRedux>;
29
29
  export declare const PlayButtonConnect: import("react-redux").ConnectedComponent<({ mapId, isDisabled, timeStep, linkedMapAnimationInfo, mapStartAnimation, mapStopAnimation, }: Props) => import("react/jsx-runtime").JSX.Element, {
@@ -32,8 +32,8 @@ export declare const PlayButtonConnect: import("react-redux").ConnectedComponent
32
32
  isAnimating?: boolean | undefined;
33
33
  animationStartTime?: string | undefined;
34
34
  animationEndTime?: string | undefined;
35
- mapStartAnimation?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").SetMapAnimationStartPayload, "mapReducer/mapStartAnimation"> | undefined;
36
- mapStopAnimation?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").SetMapAnimationStopPayload, "mapReducer/mapStopAnimation"> | undefined;
35
+ mapStartAnimation?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").SetMapAnimationStartPayload, "mapReducer/mapStartAnimation"> | undefined;
36
+ mapStopAnimation?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").SetMapAnimationStopPayload, "mapReducer/mapStopAnimation"> | undefined;
37
37
  timeStep?: number | undefined;
38
38
  linkedMapAnimationInfo?: {
39
39
  isAnimating: boolean;
@@ -22,7 +22,7 @@ export declare const TimeSliderCurrentTimeBoxConnect: import("react-redux").Conn
22
22
  secondsPerPx?: number | undefined;
23
23
  span?: number | undefined;
24
24
  isAutoUpdating?: boolean | undefined;
25
- setCenterTime?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/mapStore/types").SetTimeSliderCenterTimePayload, "mapReducer/setTimeSliderCenterTime"> | undefined;
25
+ setCenterTime?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/map/types").SetTimeSliderCenterTimePayload, "mapReducer/setTimeSliderCenterTime"> | undefined;
26
26
  context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
27
27
  store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
28
28
  }>;
@@ -1,3 +1,3 @@
1
- export declare const availableDefaultBaseLayers: import("dist/libs/store/src/store/mapStore/types").Layer[];
2
- export declare const preloadedDefaultBaseServices: import("dist/libs/store/src/store/mapStore/types").InitialService[] | undefined;
3
- export declare const preloadedDefaultMapServices: import("dist/libs/store/src/store/mapStore/types").InitialService[] | undefined;
1
+ export declare const availableDefaultBaseLayers: import("dist/libs/store/src/store/map/types").Layer[];
2
+ export declare const preloadedDefaultBaseServices: import("dist/libs/store/src/store/map/types").InitialService[] | undefined;
3
+ export declare const preloadedDefaultMapServices: import("dist/libs/store/src/store/map/types").InitialService[] | undefined;
@@ -0,0 +1,3 @@
1
+ import { LocationListResult, LocationDetail } from '../../components/Search/types';
2
+ export declare const getLocationList: (search: string) => Promise<LocationListResult[]>;
3
+ export declare const getLocationDetail: (id: string, source: string) => Promise<LocationDetail>;
@@ -0,0 +1,40 @@
1
+ export declare const fakeLocationList: {
2
+ id: string;
3
+ name: string;
4
+ source: string;
5
+ }[];
6
+ export declare const fakeLocationDetailList: ({
7
+ id: string;
8
+ name: string;
9
+ source: string;
10
+ lon: number;
11
+ lat: number;
12
+ geometry?: undefined;
13
+ } | {
14
+ lat: number;
15
+ lon: number;
16
+ source: string;
17
+ id: string;
18
+ name: string;
19
+ geometry: {
20
+ type: string;
21
+ geometry: {
22
+ type: string;
23
+ coordinates: number[];
24
+ };
25
+ };
26
+ } | {
27
+ lat: number;
28
+ lon: number;
29
+ source: string;
30
+ id: string;
31
+ name: string;
32
+ geometry: {
33
+ type: string;
34
+ geometry: {
35
+ type: string;
36
+ coordinates: number[][][];
37
+ };
38
+ };
39
+ })[];
40
+ export declare const locationApiEndpoints: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultBodyType>>[];
@@ -0,0 +1,9 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { LocationDetail, LocationListResult } from '../../components/Search/types';
3
+ export declare const useLocationList: (search: string) => UseQueryResult<LocationListResult[]>;
4
+ interface DetailProps {
5
+ id: string;
6
+ source: string;
7
+ }
8
+ export declare const useLocationDetail: ({ id, source, }: DetailProps) => UseQueryResult<LocationDetail>;
9
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { snackbarTypes } from '@opengeoweb/snackbar';
2
2
  import { WebMapStateModuleState, syncGroupsTypes, uiTypes } from '@opengeoweb/store';
3
3
  import { Store } from '@reduxjs/toolkit';
4
- export declare const mockStateMapWithDimensions: (layer: import("dist/libs/store/src/store/mapStore/types").Layer, mapId: string) => WebMapStateModuleState;
4
+ export declare const mockStateMapWithDimensions: (layer: import("dist/libs/store/src/store/map/types").Layer, mapId: string) => WebMapStateModuleState;
5
5
  export declare const mockStateMapWithDimensionsWithoutLayers: (mapId: string) => WebMapStateModuleState;
6
- export declare const createMockStore: (mockState: WebMapStateModuleState & snackbarTypes.SnackbarModuleStore & syncGroupsTypes.SynchronizationGroupModuleState & uiTypes.UIModuleState) => Store;
6
+ export declare const createMockStore: (mockState?: WebMapStateModuleState & snackbarTypes.SnackbarModuleStore & syncGroupsTypes.SynchronizationGroupModuleState & uiTypes.UIModuleState) => Store;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export interface SearchControlConnectProps {
3
- mapId?: string;
4
- }
5
- export declare const SearchControlConnect: React.FC<SearchControlConnectProps>;