@opengeoweb/store 20.2.0 → 21.0.0-nightly-20261030
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
|
@@ -11434,4 +11434,229 @@ var configureOpenGeoWebStore = function configureOpenGeoWebStore() {
|
|
|
11434
11434
|
});
|
|
11435
11435
|
};
|
|
11436
11436
|
|
|
11437
|
-
|
|
11437
|
+
/* *
|
|
11438
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11439
|
+
* you may not use this file except in compliance with the License.
|
|
11440
|
+
* You may obtain a copy of the License at
|
|
11441
|
+
*
|
|
11442
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11443
|
+
*
|
|
11444
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11445
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11446
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11447
|
+
* See the License for the specific language governing permissions and
|
|
11448
|
+
* limitations under the License.
|
|
11449
|
+
*
|
|
11450
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11451
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
11452
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
11453
|
+
* */
|
|
11454
|
+
var getUrlHost = function getUrlHost(url) {
|
|
11455
|
+
if (!url) {
|
|
11456
|
+
return undefined;
|
|
11457
|
+
}
|
|
11458
|
+
try {
|
|
11459
|
+
return new URL(url, window.location.href).host || undefined;
|
|
11460
|
+
} catch (_unused) {
|
|
11461
|
+
return undefined;
|
|
11462
|
+
}
|
|
11463
|
+
};
|
|
11464
|
+
var pickList = function pickList(list, pickItem) {
|
|
11465
|
+
return list === null || list === void 0 ? void 0 : list.map(pickItem);
|
|
11466
|
+
};
|
|
11467
|
+
var pickRecord = function pickRecord(record, pickValue) {
|
|
11468
|
+
return record && Object.fromEntries(Object.entries(record).filter(function (entry) {
|
|
11469
|
+
return entry[1] !== undefined;
|
|
11470
|
+
}).map(function (_ref) {
|
|
11471
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
11472
|
+
key = _ref2[0],
|
|
11473
|
+
value = _ref2[1];
|
|
11474
|
+
return [key, pickValue(value, key)];
|
|
11475
|
+
}));
|
|
11476
|
+
};
|
|
11477
|
+
var pickEntities = function pickEntities(entities, pickEntity) {
|
|
11478
|
+
return entities && {
|
|
11479
|
+
allIds: entities.allIds,
|
|
11480
|
+
byId: Object.fromEntries(entities.allIds.filter(function (id) {
|
|
11481
|
+
return entities.byId[id] !== undefined;
|
|
11482
|
+
}).map(function (id) {
|
|
11483
|
+
return [id, pickEntity(entities.byId[id], id)];
|
|
11484
|
+
}))
|
|
11485
|
+
};
|
|
11486
|
+
};
|
|
11487
|
+
var pickDimension = function pickDimension(dimension) {
|
|
11488
|
+
return {
|
|
11489
|
+
name: dimension.name,
|
|
11490
|
+
units: dimension.units,
|
|
11491
|
+
currentValue: dimension.currentValue,
|
|
11492
|
+
synced: dimension.synced
|
|
11493
|
+
};
|
|
11494
|
+
};
|
|
11495
|
+
var isObject = function isObject(value) {
|
|
11496
|
+
return value !== null && _typeof(value) === 'object';
|
|
11497
|
+
};
|
|
11498
|
+
var unifySentryStateMaps = function unifySentryStateMaps(sentryStateMaps) {
|
|
11499
|
+
var unified = {};
|
|
11500
|
+
var _iterator = _createForOfIteratorHelper(sentryStateMaps),
|
|
11501
|
+
_step;
|
|
11502
|
+
try {
|
|
11503
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
11504
|
+
var sentryStateMap = _step.value;
|
|
11505
|
+
for (var _i = 0, _Object$entries = Object.entries(sentryStateMap); _i < _Object$entries.length; _i++) {
|
|
11506
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
11507
|
+
key = _Object$entries$_i[0],
|
|
11508
|
+
picker = _Object$entries$_i[1];
|
|
11509
|
+
if (key in unified && unified[key] !== picker) {
|
|
11510
|
+
throw new Error("Sentry state picker ".concat(key, " is already defined with a different picker"));
|
|
11511
|
+
}
|
|
11512
|
+
unified[key] = picker;
|
|
11513
|
+
}
|
|
11514
|
+
}
|
|
11515
|
+
} catch (err) {
|
|
11516
|
+
_iterator.e(err);
|
|
11517
|
+
} finally {
|
|
11518
|
+
_iterator.f();
|
|
11519
|
+
}
|
|
11520
|
+
return unified;
|
|
11521
|
+
};
|
|
11522
|
+
var createSentryStatePicker = function createSentryStatePicker(sentryStateMap) {
|
|
11523
|
+
return function (state) {
|
|
11524
|
+
if (!isObject(state)) {
|
|
11525
|
+
return undefined;
|
|
11526
|
+
}
|
|
11527
|
+
return Object.fromEntries(Object.entries(sentryStateMap).flatMap(function (_ref3) {
|
|
11528
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
11529
|
+
key = _ref4[0],
|
|
11530
|
+
picker = _ref4[1];
|
|
11531
|
+
var slice = state[key];
|
|
11532
|
+
if (!picker || slice === undefined) {
|
|
11533
|
+
return [];
|
|
11534
|
+
}
|
|
11535
|
+
try {
|
|
11536
|
+
return [[key, picker(slice)]];
|
|
11537
|
+
} catch (_unused2) {
|
|
11538
|
+
return [];
|
|
11539
|
+
}
|
|
11540
|
+
}));
|
|
11541
|
+
};
|
|
11542
|
+
};
|
|
11543
|
+
|
|
11544
|
+
/* *
|
|
11545
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11546
|
+
* you may not use this file except in compliance with the License.
|
|
11547
|
+
* You may obtain a copy of the License at
|
|
11548
|
+
*
|
|
11549
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11550
|
+
*
|
|
11551
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11552
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11553
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11554
|
+
* See the License for the specific language governing permissions and
|
|
11555
|
+
* limitations under the License.
|
|
11556
|
+
*
|
|
11557
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11558
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
11559
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
11560
|
+
* */
|
|
11561
|
+
var storeSentryStateMap = {
|
|
11562
|
+
common: function common(_common) {
|
|
11563
|
+
var _common$auth;
|
|
11564
|
+
return {
|
|
11565
|
+
auth: {
|
|
11566
|
+
isLoggedIn: (_common$auth = _common.auth) === null || _common$auth === void 0 ? void 0 : _common$auth.isLoggedIn
|
|
11567
|
+
}
|
|
11568
|
+
};
|
|
11569
|
+
},
|
|
11570
|
+
webmap: function webmap(_webmap) {
|
|
11571
|
+
return pickEntities(_webmap, function (map) {
|
|
11572
|
+
return {
|
|
11573
|
+
id: map.id,
|
|
11574
|
+
srs: map.srs,
|
|
11575
|
+
isAnimating: map.isAnimating,
|
|
11576
|
+
isAutoUpdating: map.isAutoUpdating,
|
|
11577
|
+
animationStartTime: map.animationStartTime,
|
|
11578
|
+
animationEndTime: map.animationEndTime,
|
|
11579
|
+
animationDelay: map.animationDelay,
|
|
11580
|
+
timeStep: map.timeStep,
|
|
11581
|
+
isTimestepAuto: map.isTimestepAuto,
|
|
11582
|
+
mapLayers: map.mapLayers,
|
|
11583
|
+
baseLayers: map.baseLayers,
|
|
11584
|
+
overLayers: map.overLayers,
|
|
11585
|
+
featureLayers: map.featureLayers,
|
|
11586
|
+
autoUpdateLayerId: map.autoUpdateLayerId,
|
|
11587
|
+
autoTimeStepLayerId: map.autoTimeStepLayerId,
|
|
11588
|
+
dimensions: pickList(map.dimensions, pickDimension)
|
|
11589
|
+
};
|
|
11590
|
+
});
|
|
11591
|
+
},
|
|
11592
|
+
layers: function layers(_layers) {
|
|
11593
|
+
return pickEntities(_layers, function (layer) {
|
|
11594
|
+
return {
|
|
11595
|
+
id: layer.id,
|
|
11596
|
+
mapId: layer.mapId,
|
|
11597
|
+
name: layer.name,
|
|
11598
|
+
layerType: layer.layerType,
|
|
11599
|
+
service: getUrlHost(layer.service),
|
|
11600
|
+
enabled: layer.enabled,
|
|
11601
|
+
opacity: layer.opacity,
|
|
11602
|
+
style: layer.style,
|
|
11603
|
+
format: layer.format,
|
|
11604
|
+
status: layer.status,
|
|
11605
|
+
useLatestReferenceTime: layer.useLatestReferenceTime,
|
|
11606
|
+
dimensions: pickList(layer.dimensions, pickDimension)
|
|
11607
|
+
};
|
|
11608
|
+
});
|
|
11609
|
+
},
|
|
11610
|
+
services: function services(_services) {
|
|
11611
|
+
return pickEntities(_services, function (service) {
|
|
11612
|
+
return {
|
|
11613
|
+
id: service.id,
|
|
11614
|
+
serviceUrl: getUrlHost(service.serviceUrl),
|
|
11615
|
+
active: service.active,
|
|
11616
|
+
scope: service.scope,
|
|
11617
|
+
type: service.type
|
|
11618
|
+
};
|
|
11619
|
+
});
|
|
11620
|
+
},
|
|
11621
|
+
syncGroups: function syncGroups(_syncGroups) {
|
|
11622
|
+
return {
|
|
11623
|
+
isTimeScrollingEnabled: _syncGroups.isTimeScrollingEnabled,
|
|
11624
|
+
groups: pickEntities(_syncGroups.groups, function (group) {
|
|
11625
|
+
return {
|
|
11626
|
+
type: group.type,
|
|
11627
|
+
sourcePanelId: group.sourcePanelId,
|
|
11628
|
+
targets: pickEntities(group.targets, function (target) {
|
|
11629
|
+
return target;
|
|
11630
|
+
})
|
|
11631
|
+
};
|
|
11632
|
+
}),
|
|
11633
|
+
sources: pickEntities(_syncGroups.sources, function (source) {
|
|
11634
|
+
return {
|
|
11635
|
+
types: source.types,
|
|
11636
|
+
targets: pickEntities(source.targets, function (target) {
|
|
11637
|
+
return target;
|
|
11638
|
+
})
|
|
11639
|
+
};
|
|
11640
|
+
})
|
|
11641
|
+
};
|
|
11642
|
+
},
|
|
11643
|
+
ui: function ui(_ui) {
|
|
11644
|
+
return {
|
|
11645
|
+
order: _ui.order,
|
|
11646
|
+
activeWindowId: _ui.activeWindowId,
|
|
11647
|
+
dialogs: pickRecord(_ui.dialogs, function (dialog) {
|
|
11648
|
+
return {
|
|
11649
|
+
type: dialog.type,
|
|
11650
|
+
activeMapId: dialog.activeMapId,
|
|
11651
|
+
isOpen: dialog.isOpen,
|
|
11652
|
+
isLoading: dialog.isLoading,
|
|
11653
|
+
error: dialog.error,
|
|
11654
|
+
source: dialog.source,
|
|
11655
|
+
sourcePanelId: dialog.sourcePanelId
|
|
11656
|
+
};
|
|
11657
|
+
})
|
|
11658
|
+
};
|
|
11659
|
+
}
|
|
11660
|
+
};
|
|
11661
|
+
|
|
11662
|
+
export { FEATURE_GROUP_PREFIX, IS_LEGEND_OPEN_BY_DEFAULT, PUBLIC_WARNING_DRAW_TOOL_ID, SECONDS_IN_DAY, SECONDS_IN_HOUR, commonActions, commonListener, commonReducers, commonSelectors, configureOpenGeoWebStore, constructSyncSourceDisplayName, createMockStore, createSentryStatePicker, createViewObjectForNewMap, drawingToolActions, drawingToolListener, drawingToolReducer, selectors as drawingToolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$5 as genericSelectors, getFeatureGroupId, getFeatureLinksForAllPanelsFromState, getFeatureSyncLayerMetadata$1 as getFeatureSyncLayerMetadata, getFeatureSyncLayersForPanel, getLinkedFeatureSourcePanelIdsForMapId, getLinkedTargetIdsForFeatureSourcePanel, getSingularDrawtoolDrawLayerId, getTakenWarningTimelineIds, getUrlHost, getUserAddedServices, getViewObjectForMapId, getViewObjectForSyncGroup, initialState$4 as initialState, isWarningsTimelineLinkSourceAllowed, layerActions, layerReducer, selectors$4 as layerSelectors, types$2 as layerTypes, utils$1 as layerUtils, layersListener, constants$1 as linkComponentTypesConstants, loadingIndicatorActions, constants as loadingIndicatorConstants, loadingIndicatorReducer, selectors$3 as loadingIndicatorSelectors, makeFeatureSyncLayerId, mapActions, enums as mapEnums, mapListener, mapReducer, selectors$1 as mapSelectors, types$3 as mapTypes, mapUtils, metronomeListener, openlayersListener, pickDimension, pickEntities, pickList, pickRecord, routerActions, routerListener, routerReducer, utils as routerUtils, selectorMemoizationOptions, serviceActions, serviceListener, serviceReducer, selectors$7 as serviceSelectors, setUserAddedServices, storeMiddlewares, storeReducerMap, storeSentryStateMap, storeTestSettings, storeTestUtils, utils$3 as storeUtils, constants$2 as syncConstants, syncGroupsActions, syncGroupsListener, syncGroupsReducer, selector as syncGroupsSelector, selectors$6 as syncGroupsSelectors, types$1 as syncGroupsTypes, types$1 as types, uiActions, uiReducer, selectors$2 as uiSelectors, types as uiTypes, unifyReducerMaps, unifySentryStateMaps, upsertFeatureSyncLayer, useRegisterFeatureSyncSource, useSetupDialog, useSyncgroupTimeState, useUpdateFeatureSyncLayers };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SentryStateMap } from './types';
|
|
2
|
+
import type { CommonModuleState } from '../common/types';
|
|
3
|
+
import type { SynchronizationGroupModuleState } from '../generic/syncGroups/types';
|
|
4
|
+
import type { WebMapStateModuleState } from '../map/types';
|
|
5
|
+
import type { UIModuleState } from '../ui/types';
|
|
6
|
+
type StoreSentryModuleState = CommonModuleState & WebMapStateModuleState & SynchronizationGroupModuleState & UIModuleState;
|
|
7
|
+
export declare const storeSentryStateMap: SentryStateMap<StoreSentryModuleState>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SentryState<T> = T extends (infer Item)[] ? SentryState<Item>[] : T extends object ? {
|
|
2
|
+
[K in keyof T]?: SentryState<T[K]>;
|
|
3
|
+
} : T;
|
|
4
|
+
export type SentryStatePicker<S> = (slice: S) => SentryState<S> | undefined;
|
|
5
|
+
export type SentryStateMap<ModuleState> = {
|
|
6
|
+
[K in keyof ModuleState]?: SentryStatePicker<NonNullable<ModuleState[K]>>;
|
|
7
|
+
};
|
|
8
|
+
export type AnySentryStateMap = Record<string, ((slice: never) => object | undefined) | undefined>;
|
|
9
|
+
export interface SentryEntities<T> {
|
|
10
|
+
byId: Record<string, T>;
|
|
11
|
+
allIds: string[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Dimension } from '@opengeoweb/webmap';
|
|
2
|
+
import type { AnySentryStateMap, SentryEntities, SentryState } from './types';
|
|
3
|
+
export declare const getUrlHost: (url?: string) => string | undefined;
|
|
4
|
+
export declare const pickList: <T, R>(list: T[] | undefined, pickItem: (item: T) => R) => R[] | undefined;
|
|
5
|
+
export declare const pickRecord: <T, R>(record: Partial<Record<string, T>> | undefined, pickValue: (value: T, key: string) => R) => Record<string, R> | undefined;
|
|
6
|
+
export declare const pickEntities: <T>(entities: SentryEntities<T> | undefined, pickEntity: (entity: T, id: string) => SentryState<T>) => SentryState<SentryEntities<T>> | undefined;
|
|
7
|
+
export declare const pickDimension: (dimension: Dimension) => SentryState<Dimension>;
|
|
8
|
+
export declare const unifySentryStateMaps: (sentryStateMaps: AnySentryStateMap[]) => AnySentryStateMap;
|
|
9
|
+
export declare const createSentryStatePicker: (sentryStateMap: AnySentryStateMap) => (state: unknown) => object | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0-nightly-20261030",
|
|
4
4
|
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opengeoweb/shared": "
|
|
23
|
+
"@opengeoweb/shared": "21.0.0-nightly-20261030",
|
|
24
24
|
"react-redux": "^9.2.0",
|
|
25
25
|
"@reduxjs/toolkit": "^2.6.1",
|
|
26
|
-
"@opengeoweb/webmap-react": "
|
|
27
|
-
"@opengeoweb/webmap": "
|
|
26
|
+
"@opengeoweb/webmap-react": "21.0.0-nightly-20261030",
|
|
27
|
+
"@opengeoweb/webmap": "21.0.0-nightly-20261030",
|
|
28
28
|
"immer": "^10.0.3",
|
|
29
29
|
"lodash": "^4.18.1",
|
|
30
|
-
"@opengeoweb/metronome": "
|
|
31
|
-
"@opengeoweb/time-slider": "
|
|
30
|
+
"@opengeoweb/metronome": "21.0.0-nightly-20261030",
|
|
31
|
+
"@opengeoweb/time-slider": "21.0.0-nightly-20261030",
|
|
32
32
|
"ol": "^10.4.0",
|
|
33
33
|
"@turf/turf": "^7.2.0",
|
|
34
34
|
"@types/geojson": "^7946.0.14",
|