@opengeoweb/store 10.2.1-spike-ol.3 → 11.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 +962 -1315
- package/package.json +11 -31
- package/src/store/generic/syncGroups/types.d.ts +6 -7
- package/src/store/index.d.ts +1 -1
- package/src/store/map/index.d.ts +1 -1
- package/src/store/map/layer/types.d.ts +1 -1
- package/src/store/map/map/selectors.d.ts +1 -6
- package/src/store/map/map/types.d.ts +0 -6
- package/src/store/map/service/types.d.ts +4 -4
- package/src/store/store.d.ts +19 -2
- package/src/store/unifyReducerMaps.d.ts +3 -0
- package/src/store/map/map/olMapListenerAnimationUtils.d.ts +0 -46
- package/src/store/mapStore/openlayers/listener.d.ts +0 -2
- package/src/store/mapStore/openlayers/listener.spec.d.ts +0 -1
- package/src/store/mapStore/openlayers/syncGroupViewStore.d.ts +0 -26
- /package/src/store/{map/map/olMapListenerAnimationUtils.spec.d.ts → unifyReducermaps.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,40 +8,20 @@
|
|
|
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.3",
|
|
15
|
-
"@mui/x-date-pickers": "7.26.0",
|
|
11
|
+
"@opengeoweb/shared": "*",
|
|
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.62.7",
|
|
22
|
-
"@tanstack/react-query": "5.62.7",
|
|
23
|
-
"@testing-library/react": "16.0.1",
|
|
24
|
-
"@testing-library/user-event": "14.5.2",
|
|
25
|
-
"@turf/turf": "^7.2.0",
|
|
26
|
-
"axios": "1.7.9",
|
|
27
|
-
"date-fns": "4.1.0",
|
|
28
|
-
"dompurify": "3.2.4",
|
|
29
|
-
"i18next": "23.11.5",
|
|
14
|
+
"@opengeoweb/webmap-react": "*",
|
|
15
|
+
"@opengeoweb/webmap": "*",
|
|
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
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"proj4": "2.15.0",
|
|
37
|
-
"re-resizable": "6.10.3",
|
|
38
|
-
"react": "18.3.1",
|
|
39
|
-
"react-draggable": "4.4.6",
|
|
40
|
-
"react-i18next": "15.1.1",
|
|
41
|
-
"react-redux": "^8.1.3",
|
|
42
|
-
"react-resize-detector": "9.1.1",
|
|
18
|
+
"@opengeoweb/metronome": "*",
|
|
19
|
+
"@opengeoweb/timeslider": "*",
|
|
43
20
|
"react-router-dom": "^6.23.1",
|
|
44
|
-
"
|
|
21
|
+
"@turf/turf": "^7.2.0"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "18"
|
|
45
25
|
},
|
|
46
26
|
"module": "./index.esm.js",
|
|
47
27
|
"type": "module",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { SystemScope } from '@opengeoweb/shared';
|
|
1
2
|
import { LoadingIndicatorModuleState } from '../loadingIndicator/types';
|
|
2
3
|
import type { GenericActionPayload } from '../types';
|
|
3
|
-
import { SYNCGROUPS_TYPE_SETBBOX,
|
|
4
|
+
import { SYNCGROUPS_TYPE_SETBBOX, SYNCGROUPS_TYPE_SETLAYERACTIONS, SYNCGROUPS_TYPE_SETTIME } from './constants';
|
|
4
5
|
export interface Group {
|
|
5
6
|
id: string;
|
|
6
7
|
selected: string[];
|
|
@@ -47,7 +48,6 @@ export interface LinkedState {
|
|
|
47
48
|
links: Record<string, string[]>;
|
|
48
49
|
sharedData: Record<string, PotentialData>;
|
|
49
50
|
}
|
|
50
|
-
type Origin = 'user' | 'system';
|
|
51
51
|
export type SynchronizationSourcePayLoadByType = Record<string, GenericActionPayload>;
|
|
52
52
|
export interface SynchronizationSource {
|
|
53
53
|
types: SyncType[];
|
|
@@ -88,12 +88,12 @@ export interface SyncGroupTarget {
|
|
|
88
88
|
[key: string]: unknown;
|
|
89
89
|
}
|
|
90
90
|
export interface SyncGroupAddTargetPayload extends SyncGroupTarget {
|
|
91
|
-
origin?:
|
|
91
|
+
origin?: SystemScope;
|
|
92
92
|
}
|
|
93
93
|
export interface SyncGroupRemoveTargetPayload {
|
|
94
94
|
groupId: string;
|
|
95
95
|
targetId: string;
|
|
96
|
-
origin?:
|
|
96
|
+
origin?: SystemScope;
|
|
97
97
|
}
|
|
98
98
|
export interface SyncGroupLinkTargetPayload extends SyncGroupTarget {
|
|
99
99
|
linked: boolean;
|
|
@@ -102,7 +102,7 @@ export interface SyncGroupAddGroupPayload {
|
|
|
102
102
|
groupId: string;
|
|
103
103
|
title: string;
|
|
104
104
|
type: SyncType;
|
|
105
|
-
origin?:
|
|
105
|
+
origin?: SystemScope;
|
|
106
106
|
}
|
|
107
107
|
export interface SyncGroupRemoveGroupPayload {
|
|
108
108
|
groupId: string;
|
|
@@ -112,7 +112,7 @@ export interface SyncGroupSetViewStatePayload {
|
|
|
112
112
|
}
|
|
113
113
|
export interface SyncGroupToggleIsTimeScrollingEnabled {
|
|
114
114
|
isTimeScrollingEnabled: boolean;
|
|
115
|
-
origin?:
|
|
115
|
+
origin?: SystemScope;
|
|
116
116
|
}
|
|
117
117
|
export declare const SyncGroupTypeList: string[];
|
|
118
118
|
export declare enum SyncGroupActionOrigin {
|
|
@@ -136,4 +136,3 @@ export interface AddSharedData {
|
|
|
136
136
|
export interface DeleteSharedData {
|
|
137
137
|
panelId: string;
|
|
138
138
|
}
|
|
139
|
-
export {};
|
package/src/store/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ export * from './ui';
|
|
|
3
3
|
export * from './generic';
|
|
4
4
|
export { genericListener } from './generic/listener';
|
|
5
5
|
export { mapListener } from './map/map/listener';
|
|
6
|
-
export { openlayersListener } from './mapStore/openlayers/listener';
|
|
7
6
|
export { serviceListener } from './map/service/listener';
|
|
8
7
|
export { routerListener } from './router/listener';
|
|
9
8
|
export { drawingToolListener } from './drawingTool/listener';
|
|
10
9
|
export { layersListener } from './map/layer/listeners';
|
|
11
10
|
export { metronomeListener } from './map/map/metronomeListener';
|
|
11
|
+
export { unifyReducerMaps, type ReducerMap } from './unifyReducerMaps';
|
|
12
12
|
export * from './router';
|
|
13
13
|
export * from './drawingTool';
|
|
14
14
|
export * from './types';
|
package/src/store/map/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './service';
|
|
2
2
|
export * from './map';
|
|
3
3
|
export * from './layer';
|
|
4
|
-
export type { WebMapStateModuleState, MapPreset, MapPresetInitialProps,
|
|
4
|
+
export type { WebMapStateModuleState, MapPreset, MapPresetInitialProps, } from './types';
|
|
5
5
|
export * as storeTestSettings from './storeTestSettings';
|
|
@@ -129,7 +129,7 @@ export interface SetAvailableBaseLayersPayload extends AddAvailableBaseLayersPay
|
|
|
129
129
|
mapId: string;
|
|
130
130
|
}
|
|
131
131
|
export interface ErrorLayerPayload extends LayerPayload {
|
|
132
|
-
error:
|
|
132
|
+
error: string;
|
|
133
133
|
}
|
|
134
134
|
export interface UpdateLayerInfo extends Action {
|
|
135
135
|
type: `layerReducer/onUpdateLayerInformation`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Bbox, MapPreset, WebMap, WebMapState } from './types';
|
|
2
2
|
import type { CoreAppStore } from '../../types';
|
|
3
|
-
import type { Dimension, Layer, ReduxLayer,
|
|
3
|
+
import type { Dimension, Layer, ReduxLayer, WebMapAnimationList } from '../types';
|
|
4
4
|
import type { uiTypes } from '../../ui';
|
|
5
5
|
/**
|
|
6
6
|
* Gets the map state by mapId
|
|
@@ -429,11 +429,6 @@ export declare const getMapTimeSliderCenterTime: ((state: CoreAppStore, mapId: s
|
|
|
429
429
|
}> & {
|
|
430
430
|
clearCache: () => void;
|
|
431
431
|
};
|
|
432
|
-
export declare const getMapTimeSliderStartCenterEndAndStep: ((state: CoreAppStore, mapId: string) => TimeSliderStartCenterEndTime) & import("reselect").OutputSelectorFields<(args_0: WebMap | undefined) => TimeSliderStartCenterEndTime, {
|
|
433
|
-
clearCache: () => void;
|
|
434
|
-
}> & {
|
|
435
|
-
clearCache: () => void;
|
|
436
|
-
};
|
|
437
432
|
/**
|
|
438
433
|
* Returns the number of seconds per pixel on the time slider
|
|
439
434
|
*
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
import { SystemScope } from '@opengeoweb/shared';
|
|
1
2
|
import { LayerProps } from '@opengeoweb/webmap';
|
|
2
3
|
export interface InitialService {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
url: string;
|
|
6
|
-
scope?:
|
|
7
|
+
scope?: SystemScope;
|
|
7
8
|
abstract?: string;
|
|
8
9
|
}
|
|
9
10
|
export type NoIdService = Omit<InitialService, 'id'>;
|
|
10
11
|
export type UserAddedServices = Record<string, NoIdService>;
|
|
11
12
|
export type Services = Record<string, ReduxService>;
|
|
12
|
-
export type ServiceScope = 'user' | 'system';
|
|
13
13
|
export interface ReduxService {
|
|
14
14
|
id?: string;
|
|
15
15
|
name?: string;
|
|
16
16
|
serviceUrl?: string;
|
|
17
17
|
active?: boolean;
|
|
18
18
|
layers?: ServiceLayer[];
|
|
19
|
-
scope?:
|
|
19
|
+
scope?: SystemScope;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
Used in the services object of webmap to keep a list of available layers in the service
|
|
@@ -32,7 +32,7 @@ export interface SetLayersForServicePayload {
|
|
|
32
32
|
serviceUrl: string;
|
|
33
33
|
abstract?: string;
|
|
34
34
|
layers: ServiceLayer[];
|
|
35
|
-
scope:
|
|
35
|
+
scope: SystemScope;
|
|
36
36
|
isUpdating?: boolean;
|
|
37
37
|
}
|
|
38
38
|
export interface MapStoreRemoveServicePayload {
|
package/src/store/store.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { DevToolsEnhancerOptions, EnhancerArray, ListenerMiddleware, StoreEnhancer } from '@reduxjs/toolkit';
|
|
1
2
|
import { ToolkitStore } from '@reduxjs/toolkit/dist/configureStore';
|
|
3
|
+
import { ExtractDispatchExtensions } from '@reduxjs/toolkit/dist/tsHelpers';
|
|
2
4
|
import { WebMapStateModuleState } from './map';
|
|
3
5
|
import { SynchronizationGroupModuleState } from './generic/syncGroups/types';
|
|
4
6
|
import { LoadingIndicatorModuleState } from './generic/loadingIndicator/types';
|
|
5
7
|
import { UIModuleState } from './ui/types';
|
|
6
8
|
import { DrawtoolModuleStore } from './drawingTool/reducer';
|
|
9
|
+
import { ReducerMap } from './unifyReducerMaps';
|
|
7
10
|
export declare const storeReducerMap: {
|
|
8
11
|
webmap: import("redux").Reducer<import("./map/types").WebMapState>;
|
|
9
12
|
services: import("redux").Reducer<import("./map/types").ServiceState>;
|
|
@@ -14,6 +17,20 @@ export declare const storeReducerMap: {
|
|
|
14
17
|
drawingtools: import("redux").Reducer<import("./drawingTool/reducer").DrawingToolState>;
|
|
15
18
|
router: import("redux").Reducer<{}>;
|
|
16
19
|
};
|
|
17
|
-
export declare const storeMiddlewares: (
|
|
20
|
+
export declare const storeMiddlewares: (ListenerMiddleware<import("./types").CoreAppStore, import("@reduxjs/toolkit").ThunkDispatch<import("./types").CoreAppStore, unknown, import("redux").AnyAction>, unknown> | ListenerMiddleware<import("./router/types").RouterModuleStore, import("@reduxjs/toolkit").ThunkDispatch<import("./router/types").RouterModuleStore, unknown, import("redux").AnyAction>, unknown>)[];
|
|
18
21
|
export declare const createMockStore: (mockState?: WebMapStateModuleState | SynchronizationGroupModuleState | LoadingIndicatorModuleState | UIModuleState | DrawtoolModuleStore) => ToolkitStore;
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* This creates an OpenGeoWeb redux store for redux connected components
|
|
24
|
+
*
|
|
25
|
+
* @param preloadedState Initial state for your application
|
|
26
|
+
* @param extraReducers Additional reducers, you can pass your own reducers. See apps/geoweb/src/app/store.ts for how it is used in GeoWeb.
|
|
27
|
+
* @param extraMiddleWares Additional middlewares
|
|
28
|
+
* @param extraEnhancer Custom enhancers
|
|
29
|
+
* @param enableDevTools Set to true to enable redux devtools.
|
|
30
|
+
* @returns A redux store you can use with the core components
|
|
31
|
+
*/
|
|
32
|
+
export declare const configureOpenGeoWebStore: (preloadedState?: object, extraReducers?: ReducerMap, extraMiddleWares?: ListenerMiddleware[], extraEnhancers?: EnhancerArray<[
|
|
33
|
+
StoreEnhancer<{
|
|
34
|
+
dispatch: ExtractDispatchExtensions<unknown>;
|
|
35
|
+
}>
|
|
36
|
+
]>, enableDevTools?: boolean | DevToolsEnhancerOptions) => ToolkitStore;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Dispatch, ListenerEffectAPI } from '@reduxjs/toolkit';
|
|
2
|
-
import { ReduxLayer } from '../types';
|
|
3
|
-
import { CoreAppStore } from '../../types';
|
|
4
|
-
/**
|
|
5
|
-
* Returns the next step for given timerId.
|
|
6
|
-
* @param timerId The timer id
|
|
7
|
-
* @param numberOfStepsInAnimation Animation length in steps
|
|
8
|
-
* @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare const getNextStep: (timerId: string, numberOfStepsInAnimation: number, numStepsToGoForward?: number) => number;
|
|
12
|
-
/**
|
|
13
|
-
* Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
|
|
14
|
-
* @param timerId The timer id
|
|
15
|
-
* @param numberOfStepsInAnimation Number of steps in the animation
|
|
16
|
-
* @param dwell The number of steps to wait at the end of the animation sequence before to continue
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
export declare const handleTimerDwell: (timerId: string, numberOfStepsInAnimation: number, dwell?: number) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Set step for the timerId
|
|
22
|
-
* @param timerId
|
|
23
|
-
* @param timerStep
|
|
24
|
-
*/
|
|
25
|
-
export declare const setStep: (timerId: string, timerStep: number) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the current step for the timer
|
|
28
|
-
* @param timerId
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export declare const getCurrentStep: (timerId: string) => number;
|
|
32
|
-
/**
|
|
33
|
-
* Checks if the next step is available for all provided layers
|
|
34
|
-
* @param reduxLayers
|
|
35
|
-
* @param nextTimeString
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
export declare const isNextStepAvailable: (reduxLayers: ReduxLayer[], nextTimeString: string) => boolean;
|
|
39
|
-
/**
|
|
40
|
-
* This handler is triggered by the metronome. An array of timerIds is given as argument.
|
|
41
|
-
* It will update the animation loop of multiple maps and sliders
|
|
42
|
-
* It will prefetch images for maps
|
|
43
|
-
* @param timerIds string[] array of timerIds
|
|
44
|
-
* @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
|
|
45
|
-
*/
|
|
46
|
-
export declare const olMetronomeHandler: (timerIds: string[], listenerApi: ListenerEffectAPI<CoreAppStore, Dispatch, unknown>) => void;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { WebMapStateModuleState } from '../../map/types';
|
|
2
|
-
export declare const openlayersListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<WebMapStateModuleState, import("@reduxjs/toolkit").ThunkDispatch<WebMapStateModuleState, unknown, import("redux").AnyAction>, unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Observable, View } from 'ol';
|
|
2
|
-
export declare const copyView: (view: View) => View;
|
|
3
|
-
/**
|
|
4
|
-
* The StoredView objects keep references to OpenLayers View objects that may be shared
|
|
5
|
-
* between multiple maps (when maps are pan/zoom synced).
|
|
6
|
-
* This file then offers and API for each map to retrieve the StoredView object
|
|
7
|
-
* that is relevant for the current workspace configuration.
|
|
8
|
-
*
|
|
9
|
-
* React is functional, but OpenLayers is object oriented.
|
|
10
|
-
* This component sits in between the two and thus you can make an argument for either style.
|
|
11
|
-
* Object oriented was chosen since:
|
|
12
|
-
* - This allows us to use OpenLayers's Observable as a base class to provide event handling,
|
|
13
|
-
* which is useful for the implementation.
|
|
14
|
-
* - For this mechanism to work smoothly with OpenLayers,
|
|
15
|
-
* we need to pass the exact same View object reference for all maps that are synchronized. Redux stores cannot be used in this context and prop drilling and/or context providers would likely lead to more invasive implementations.
|
|
16
|
-
*/
|
|
17
|
-
export declare class StoredView extends Observable {
|
|
18
|
-
name: string;
|
|
19
|
-
view: View;
|
|
20
|
-
constructor(name: string, view: View);
|
|
21
|
-
setView(view: View): void;
|
|
22
|
-
}
|
|
23
|
-
export declare const clearSyncGroupViewStore: () => void;
|
|
24
|
-
export declare const getViewObjectForMapId: (id: string) => StoredView;
|
|
25
|
-
export declare const createViewObjectForNewMap: (createFromId: string, newId: string) => void;
|
|
26
|
-
export declare const getViewObjectForSyncGroup: (id: string) => StoredView;
|
/package/src/store/{map/map/olMapListenerAnimationUtils.spec.d.ts → unifyReducermaps.spec.d.ts}
RENAMED
|
File without changes
|