@opengeoweb/core 2.3.0 → 2.4.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 (28) hide show
  1. package/index.esm.js +528 -530
  2. package/index.umd.js +541 -522
  3. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +1 -0
  4. package/lib/components/LayerManager/LayerContainerRow/{LayerManagerButton.spec.d.ts → LayerRow/LayerRowConnect.spec.d.ts} +0 -0
  5. package/lib/components/LayerManager/LayerManagerUtils.d.ts +2 -2
  6. package/lib/components/SyncGroups/SyncGroupViewer.d.ts +2 -0
  7. package/lib/components/SyncGroups/SyncGroupViewerConnect.d.ts +1 -6
  8. package/lib/components/SyncGroups/selector.d.ts +4 -4
  9. package/lib/components/TimeSlider/TimeSliderButtons/PlayButton/PlayButtonConnect.d.ts +1 -0
  10. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +2 -0
  11. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendRenderFunctions.d.ts +1 -1
  12. package/lib/components/TooltipSelect/TooltipSelect.d.ts +0 -1
  13. package/lib/store/generic/selectors.d.ts +1 -0
  14. package/lib/store/generic/synchronizationGroups/actions.d.ts +2 -1
  15. package/lib/store/generic/synchronizationGroups/constants.d.ts +1 -0
  16. package/lib/store/generic/synchronizationGroups/sagas.d.ts +1 -0
  17. package/lib/store/generic/synchronizationGroups/selectors.d.ts +13 -0
  18. package/lib/store/generic/synchronizationGroups/types.d.ts +11 -2
  19. package/lib/store/mapStore/map/selectors.d.ts +30 -0
  20. package/lib/store/ui/types.d.ts +1 -1
  21. package/lib/utils/testUtils.d.ts +2 -1
  22. package/package.json +5 -5
  23. package/lib/components/LayerManager/LayerContainerRow/LayerManagerButton.d.ts +0 -13
  24. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.d.ts +0 -8
  25. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.spec.d.ts +0 -1
  26. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.d.ts +0 -8
  27. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.spec.d.ts +0 -1
  28. package/lib/components/LayerManager/LayerContainerRow/LayerRow/styles.d.ts +0 -5
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('moment'), require('lodash'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('@mui/styles/makeStyles'), require('react-redux'), require('@opengeoweb/shared'), require('@mui/icons-material'), require('react-sortablejs'), require('@mui/styles/createStyles'), require('@mui/styles/withStyles'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'lodash', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', '@mui/styles/makeStyles', 'react-redux', '@opengeoweb/shared', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global._, global.React, global.produce, global.effects, global.webmap, global.material, global.makeStyles, global.reactRedux, global.shared, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
5
- })(this, (function (exports, reselect, moment, _, React, produce, effects, webmap, material, makeStyles, reactRedux, shared, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, reduxDynamicModules, reduxDynamicModulesSaga, theme) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('moment'), require('lodash'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('react-redux'), require('@mui/styles/makeStyles'), require('@opengeoweb/shared'), require('@mui/icons-material'), require('react-sortablejs'), require('@mui/styles/createStyles'), require('@mui/styles/withStyles'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'lodash', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', 'react-redux', '@mui/styles/makeStyles', '@opengeoweb/shared', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global._, global.React, global.produce, global.effects, global.webmap, global.material, global.reactRedux, global.makeStyles, global.shared, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
5
+ })(this, (function (exports, reselect, moment, _, React, produce, effects, webmap, material, reactRedux, makeStyles, shared, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, reduxDynamicModules, reduxDynamicModulesSaga, theme) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -1307,6 +1307,103 @@
1307
1307
  return [];
1308
1308
  }, selectorMemoizationOptions);
1309
1309
 
1310
+ /* *
1311
+ * Licensed under the Apache License, Version 2.0 (the "License");
1312
+ * you may not use this file except in compliance with the License.
1313
+ * You may obtain a copy of the License at
1314
+ *
1315
+ * http://www.apache.org/licenses/LICENSE-2.0
1316
+ *
1317
+ * Unless required by applicable law or agreed to in writing, software
1318
+ * distributed under the License is distributed on an "AS IS" BASIS,
1319
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320
+ * See the License for the specific language governing permissions and
1321
+ * limitations under the License.
1322
+ *
1323
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1324
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1325
+ * */
1326
+
1327
+ /* Action constants for sources */
1328
+ var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
1329
+ var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
1330
+ /* Action constants for groups */
1331
+
1332
+ var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
1333
+ var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
1334
+ var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
1335
+ var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
1336
+ var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
1337
+ var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
1338
+ /* Type constants */
1339
+
1340
+ var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
1341
+ var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
1342
+ var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
1343
+ var SYNCGROUPS_SET_VIEW_STATE = 'SYNCGROUPS_SET_VIEW_STATE';
1344
+
1345
+ var constants$1 = /*#__PURE__*/Object.freeze({
1346
+ __proto__: null,
1347
+ SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
1348
+ SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
1349
+ SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
1350
+ SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
1351
+ SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
1352
+ SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
1353
+ SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
1354
+ SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
1355
+ SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
1356
+ SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
1357
+ SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS,
1358
+ SYNCGROUPS_SET_VIEW_STATE: SYNCGROUPS_SET_VIEW_STATE
1359
+ });
1360
+
1361
+ /* *
1362
+ * Licensed under the Apache License, Version 2.0 (the "License");
1363
+ * you may not use this file except in compliance with the License.
1364
+ * You may obtain a copy of the License at
1365
+ *
1366
+ * http://www.apache.org/licenses/LICENSE-2.0
1367
+ *
1368
+ * Unless required by applicable law or agreed to in writing, software
1369
+ * distributed under the License is distributed on an "AS IS" BASIS,
1370
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1371
+ * See the License for the specific language governing permissions and
1372
+ * limitations under the License.
1373
+ *
1374
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1375
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1376
+ * */
1377
+
1378
+ var synchronizationGroupStore = function synchronizationGroupStore(store) {
1379
+ return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
1380
+ };
1381
+
1382
+ var getSynchronizationGroupStore = reselect.createSelector(synchronizationGroupStore, function (store) {
1383
+ return store;
1384
+ });
1385
+ /**
1386
+ * Returns the synchronization source by id
1387
+ * @param store The app store
1388
+ * @param id The source id to find
1389
+ */
1390
+
1391
+ var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
1392
+ if (state && state.sources) {
1393
+ var sources = state.sources;
1394
+
1395
+ if (sources.byId[id]) {
1396
+ return sources.byId[id];
1397
+ }
1398
+ }
1399
+
1400
+ return null;
1401
+ };
1402
+
1403
+ var getTime = reselect.createSelector(getSyncSourceBySourceId, function (store) {
1404
+ return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
1405
+ });
1406
+
1310
1407
  /*! *****************************************************************************
1311
1408
  Copyright (c) Microsoft Corporation.
1312
1409
 
@@ -2248,6 +2345,34 @@
2248
2345
  var isAnimating = reselect.createSelector(getMapById, function (store) {
2249
2346
  return store ? store.isAnimating : false;
2250
2347
  });
2348
+ /**
2349
+ * Gets if any linked map is animating
2350
+ *
2351
+ * Example: linkedMapIsAnimating = linkedMapAnimationInfo(store, 'mapid_1')
2352
+ * @param {object} store store: object - store object
2353
+ * @param {string} mapId mapId: string - Id of the map
2354
+ * @returns {object} returnType: object - object containing isAnimating boolean and id string
2355
+ */
2356
+
2357
+ var linkedMapAnimationInfo = reselect.createSelector(function (store, mapId) {
2358
+ var animationInfo = {
2359
+ isAnimating: isAnimating(store, mapId),
2360
+ id: mapId
2361
+ };
2362
+ getSynchronizationGroupStore(store).groups.allIds.forEach(function (groupId) {
2363
+ if (getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id] && getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id].linked) {
2364
+ getSynchronizationGroupStore(store).groups.byId[groupId].targets.allIds.forEach(function (id) {
2365
+ if (isAnimating(store, id) === true) {
2366
+ animationInfo.isAnimating = true;
2367
+ animationInfo.id = id;
2368
+ }
2369
+ });
2370
+ }
2371
+ });
2372
+ return animationInfo;
2373
+ }, function (animationInfo) {
2374
+ return animationInfo;
2375
+ });
2251
2376
  /**
2252
2377
  * Gets start time of animation
2253
2378
  *
@@ -2707,6 +2832,7 @@
2707
2832
  getSrs: getSrs,
2708
2833
  getBbox: getBbox,
2709
2834
  isAnimating: isAnimating,
2835
+ linkedMapAnimationInfo: linkedMapAnimationInfo,
2710
2836
  getAnimationStartTime: getAnimationStartTime,
2711
2837
  getAnimationEndTime: getAnimationEndTime,
2712
2838
  isAutoUpdating: isAutoUpdating,
@@ -2772,7 +2898,7 @@
2772
2898
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2773
2899
  * */
2774
2900
 
2775
- var constants$1 = /*#__PURE__*/Object.freeze({
2901
+ var constants = /*#__PURE__*/Object.freeze({
2776
2902
  __proto__: null,
2777
2903
  WEBMAP_REGISTER_MAP: WEBMAP_REGISTER_MAP,
2778
2904
  WEBMAP_UNREGISTER_MAP: WEBMAP_UNREGISTER_MAP,
@@ -3094,55 +3220,6 @@
3094
3220
  var GENERIC_SETTIME = 'GENERIC_SETTIME';
3095
3221
  var GENERIC_SETBBOX = 'GENERIC_SETBBOX';
3096
3222
 
3097
- /* *
3098
- * Licensed under the Apache License, Version 2.0 (the "License");
3099
- * you may not use this file except in compliance with the License.
3100
- * You may obtain a copy of the License at
3101
- *
3102
- * http://www.apache.org/licenses/LICENSE-2.0
3103
- *
3104
- * Unless required by applicable law or agreed to in writing, software
3105
- * distributed under the License is distributed on an "AS IS" BASIS,
3106
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3107
- * See the License for the specific language governing permissions and
3108
- * limitations under the License.
3109
- *
3110
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3111
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
3112
- * */
3113
-
3114
- /* Action constants for sources */
3115
- var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
3116
- var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
3117
- /* Action constants for groups */
3118
-
3119
- var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
3120
- var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
3121
- var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
3122
- var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
3123
- var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
3124
- var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
3125
- /* Type constants */
3126
-
3127
- var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
3128
- var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
3129
- var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
3130
-
3131
- var constants = /*#__PURE__*/Object.freeze({
3132
- __proto__: null,
3133
- SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
3134
- SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
3135
- SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
3136
- SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
3137
- SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
3138
- SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
3139
- SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
3140
- SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
3141
- SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
3142
- SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
3143
- SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS
3144
- });
3145
-
3146
3223
  /* *
3147
3224
  * Licensed under the Apache License, Version 2.0 (the "License");
3148
3225
  * you may not use this file except in compliance with the License.
@@ -3288,6 +3365,12 @@
3288
3365
  type: SYNCGROUPS_CLEAR
3289
3366
  };
3290
3367
  };
3368
+ var syncGroupSetViewState = function syncGroupSetViewState(payload) {
3369
+ return {
3370
+ type: SYNCGROUPS_SET_VIEW_STATE,
3371
+ payload: payload
3372
+ };
3373
+ };
3291
3374
 
3292
3375
  var actions$1 = /*#__PURE__*/Object.freeze({
3293
3376
  __proto__: null,
@@ -3298,7 +3381,8 @@
3298
3381
  syncGroupLinkTarget: syncGroupLinkTarget,
3299
3382
  syncGroupAddGroup: syncGroupAddGroup,
3300
3383
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3301
- syncGroupClear: syncGroupClear
3384
+ syncGroupClear: syncGroupClear,
3385
+ syncGroupSetViewState: syncGroupSetViewState
3302
3386
  });
3303
3387
 
3304
3388
  /* *
@@ -3368,7 +3452,8 @@
3368
3452
  syncGroupLinkTarget: syncGroupLinkTarget,
3369
3453
  syncGroupAddGroup: syncGroupAddGroup,
3370
3454
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3371
- syncGroupClear: syncGroupClear
3455
+ syncGroupClear: syncGroupClear,
3456
+ syncGroupSetViewState: syncGroupSetViewState
3372
3457
  });
3373
3458
 
3374
3459
  /* *
@@ -3984,6 +4069,20 @@
3984
4069
  groups: {
3985
4070
  byId: {},
3986
4071
  allIds: []
4072
+ },
4073
+ viewState: {
4074
+ timeslider: {
4075
+ groups: [],
4076
+ sourcesById: []
4077
+ },
4078
+ zoompane: {
4079
+ groups: [],
4080
+ sourcesById: []
4081
+ },
4082
+ level: {
4083
+ groups: [],
4084
+ sourcesById: []
4085
+ }
3987
4086
  }
3988
4087
  };
3989
4088
  var reducer$4 = function reducer(state, action) {
@@ -4204,6 +4303,12 @@
4204
4303
  case SYNCGROUPS_CLEAR:
4205
4304
  return initialState$4;
4206
4305
 
4306
+ case SYNCGROUPS_SET_VIEW_STATE:
4307
+ return produce__default["default"](state, function (draft) {
4308
+ var viewState = action.payload.viewState;
4309
+ draft.viewState = viewState;
4310
+ });
4311
+
4207
4312
  default:
4208
4313
  return state;
4209
4314
  }
@@ -4317,6 +4422,9 @@
4317
4422
  }, []);
4318
4423
  return groups;
4319
4424
  };
4425
+ var syncGroupGetViewState = reselect.createSelector(syncGroupStore, function (store) {
4426
+ return store.viewState;
4427
+ });
4320
4428
 
4321
4429
  /* *
4322
4430
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -5081,6 +5189,105 @@
5081
5189
  });
5082
5190
  }
5083
5191
 
5192
+ /* *
5193
+ * Licensed under the Apache License, Version 2.0 (the "License");
5194
+ * you may not use this file except in compliance with the License.
5195
+ * You may obtain a copy of the License at
5196
+ *
5197
+ * http://www.apache.org/licenses/LICENSE-2.0
5198
+ *
5199
+ * Unless required by applicable law or agreed to in writing, software
5200
+ * distributed under the License is distributed on an "AS IS" BASIS,
5201
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5202
+ * See the License for the specific language governing permissions and
5203
+ * limitations under the License.
5204
+ *
5205
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5206
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
5207
+ * */
5208
+ var emptyState = {
5209
+ timeslider: {
5210
+ groups: [],
5211
+ sourcesById: []
5212
+ },
5213
+ zoompane: {
5214
+ groups: [],
5215
+ sourcesById: []
5216
+ },
5217
+ level: {
5218
+ groups: [],
5219
+ sourcesById: []
5220
+ }
5221
+ };
5222
+ var groupTypes = [{
5223
+ title: 'Timeslider',
5224
+ syncType: 'SYNCGROUPS_TYPE_SETTIME',
5225
+ groupType: 'timeslider'
5226
+ }, {
5227
+ title: 'Zoompane',
5228
+ syncType: 'SYNCGROUPS_TYPE_SETBBOX',
5229
+ groupType: 'zoompane'
5230
+ }];
5231
+ /*
5232
+ _____ Creates viewState _____
5233
+ - Runs Each time viewState is created:
5234
+ - Fill arrays inside initialState with objects containing new values from Redux
5235
+ */
5236
+
5237
+ var createSyncGroupViewState = function createSyncGroupViewState(groups, sources) {
5238
+ var initialState = produce__default["default"](emptyState, function (draft) {
5239
+ /*
5240
+ _____ 1. Fill groups _____
5241
+ 1. Goes through all groups by ID
5242
+ 2. Collects original timeslider or zoompane values into an array
5243
+ 3. Sorts and adds selected sources to ViewState based on ID type
5244
+ */
5245
+ Object.keys(groups.byId).forEach(function (id) {
5246
+ var _a;
5247
+
5248
+ var groupType = (_a = groupTypes.find(function (object) {
5249
+ return object.syncType === groups.byId[id].type;
5250
+ })) === null || _a === void 0 ? void 0 : _a.groupType;
5251
+
5252
+ if (groupType) {
5253
+ draft[groupType].groups.push({
5254
+ id: id,
5255
+ selected: groups.byId[id].targets.allIds
5256
+ });
5257
+ }
5258
+ });
5259
+ /*
5260
+ _____ 2. Fill sourcesById _____
5261
+ 1. Loop though sources and add source to each group type
5262
+ */
5263
+
5264
+ Object.keys(sources.byId).forEach(function (id) {
5265
+ groupTypes.forEach(function (_a) {
5266
+ var syncType = _a.syncType,
5267
+ groupType = _a.groupType;
5268
+
5269
+ if (sources.byId[id].types.includes(syncType)) {
5270
+ draft[groupType].sourcesById.push({
5271
+ id: id,
5272
+ name: id
5273
+ });
5274
+ }
5275
+ });
5276
+ });
5277
+ });
5278
+ return initialState;
5279
+ };
5280
+
5281
+ var groups = function groups(store) {
5282
+ return store.syncronizationGroupStore.groups;
5283
+ };
5284
+
5285
+ var sources = function sources(store) {
5286
+ return store.syncronizationGroupStore.sources;
5287
+ };
5288
+
5289
+ var createSyncGroupViewStateSelector = reselect.createSelector(groups, sources, createSyncGroupViewState);
5290
+
5084
5291
  /* *
5085
5292
  * Licensed under the Apache License, Version 2.0 (the "License");
5086
5293
  * you may not use this file except in compliance with the License.
@@ -5230,6 +5437,32 @@
5230
5437
  }
5231
5438
  });
5232
5439
  }
5440
+ function updateViewStateSaga() {
5441
+ var viewState;
5442
+ return __generator(this, function (_a) {
5443
+ switch (_a.label) {
5444
+ case 0:
5445
+ return [4
5446
+ /*yield*/
5447
+ , effects.select(createSyncGroupViewStateSelector)];
5448
+
5449
+ case 1:
5450
+ viewState = _a.sent();
5451
+ return [4
5452
+ /*yield*/
5453
+ , effects.put(syncGroupSetViewState({
5454
+ viewState: viewState
5455
+ }))];
5456
+
5457
+ case 2:
5458
+ _a.sent();
5459
+
5460
+ return [2
5461
+ /*return*/
5462
+ ];
5463
+ }
5464
+ });
5465
+ }
5233
5466
 
5234
5467
  function rootSaga$3() {
5235
5468
  return __generator(this, function (_a) {
@@ -5249,6 +5482,55 @@
5249
5482
  case 2:
5250
5483
  _a.sent();
5251
5484
 
5485
+ return [4
5486
+ /*yield*/
5487
+ , effects.takeLatest(SYNCGROUPS_ADD_GROUP, updateViewStateSaga)];
5488
+
5489
+ case 3:
5490
+ _a.sent();
5491
+
5492
+ return [4
5493
+ /*yield*/
5494
+ , effects.takeLatest(SYNCGROUPS_REMOVE_GROUP, updateViewStateSaga)];
5495
+
5496
+ case 4:
5497
+ _a.sent();
5498
+
5499
+ return [4
5500
+ /*yield*/
5501
+ , effects.takeLatest(SYNCGROUPS_ADD_SOURCE, updateViewStateSaga)];
5502
+
5503
+ case 5:
5504
+ _a.sent();
5505
+
5506
+ return [4
5507
+ /*yield*/
5508
+ , effects.takeLatest(SYNCGROUPS_REMOVE_SOURCE, updateViewStateSaga)];
5509
+
5510
+ case 6:
5511
+ _a.sent();
5512
+
5513
+ return [4
5514
+ /*yield*/
5515
+ , effects.takeLatest(SYNCGROUPS_ADD_TARGET, updateViewStateSaga)];
5516
+
5517
+ case 7:
5518
+ _a.sent();
5519
+
5520
+ return [4
5521
+ /*yield*/
5522
+ , effects.takeLatest(SYNCGROUPS_REMOVE_TARGET, updateViewStateSaga)];
5523
+
5524
+ case 8:
5525
+ _a.sent();
5526
+
5527
+ return [4
5528
+ /*yield*/
5529
+ , effects.takeLatest(SYNCGROUPS_TOGGLE_LINK_TARGET, updateViewStateSaga)];
5530
+
5531
+ case 9:
5532
+ _a.sent();
5533
+
5252
5534
  return [2
5253
5535
  /*return*/
5254
5536
  ];
@@ -5296,40 +5578,6 @@
5296
5578
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5297
5579
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
5298
5580
  * */
5299
- var useStyles$B = makeStyles__default["default"](function (theme) {
5300
- return {
5301
- select: {
5302
- '& ul': {
5303
- backgroundColor: theme.palette.geowebColors.background.surface
5304
- },
5305
- '& li': {
5306
- fontSize: 16,
5307
- padding: 12,
5308
- '&:hover': {
5309
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
5310
- },
5311
- '&.Mui-selected': {
5312
- color: theme.palette.common.white,
5313
- backgroundColor: theme.palette.geowebColors.buttons.primary.active.fill,
5314
- boxShadow: "none",
5315
- '&:hover': {
5316
- color: theme.palette.common.white,
5317
- backgroundColor: theme.palette.geowebColors.buttons.primary.mouseOver.fill
5318
- }
5319
- },
5320
- '&:after': {
5321
- background: 'none!important'
5322
- },
5323
- // (optional) header
5324
- '&.Mui-disabled': {
5325
- fontSize: 12,
5326
- opacity: 0.67,
5327
- padding: '0 12px'
5328
- }
5329
- }
5330
- }
5331
- };
5332
- });
5333
5581
 
5334
5582
  var TooltipSelect = function TooltipSelect(_a) {
5335
5583
  var tooltip = _a.tooltip,
@@ -5354,8 +5602,6 @@
5354
5602
  tooltipOpen = _g[0],
5355
5603
  setTooltipOpen = _g[1];
5356
5604
 
5357
- var classes = useStyles$B();
5358
-
5359
5605
  var preventDefault = function preventDefault(event) {
5360
5606
  event.preventDefault();
5361
5607
  event.stopPropagation();
@@ -5420,8 +5666,46 @@
5420
5666
  onBlur: onBlur,
5421
5667
  onWheel: onWheel,
5422
5668
  MenuProps: {
5423
- classes: {
5424
- paper: classes.select
5669
+ BackdropProps: {
5670
+ sx: {
5671
+ '&.MuiBackdrop-root': {
5672
+ backgroundColor: 'transparent'
5673
+ }
5674
+ }
5675
+ },
5676
+ sx: {
5677
+ '& ul': {
5678
+ backgroundColor: 'geowebColors.background.surface'
5679
+ },
5680
+ '& li': {
5681
+ fontSize: '16px',
5682
+ padding: '12px',
5683
+ '&:hover': {
5684
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
5685
+ },
5686
+ '&.Mui-selected': {
5687
+ color: 'geowebColors.buttons.tool.active.color',
5688
+ backgroundColor: 'geowebColors.buttons.tool.active.fill',
5689
+ boxShadow: "none",
5690
+ '&:hover': {
5691
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5692
+ },
5693
+ '&:focus': {
5694
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5695
+ }
5696
+ },
5697
+ '&:after': {
5698
+ background: 'none!important'
5699
+ },
5700
+ '&.Mui-disabled': {
5701
+ fontSize: '12px',
5702
+ opacity: 0.67,
5703
+ padding: '0px 12px',
5704
+ '&.MuiMenuItem-root': {
5705
+ minHeight: '30px!important'
5706
+ }
5707
+ }
5708
+ }
5425
5709
  }
5426
5710
  }
5427
5711
  }, otherProps)));
@@ -5470,7 +5754,7 @@
5470
5754
  var index = /*#__PURE__*/Object.freeze({
5471
5755
  __proto__: null,
5472
5756
  actions: actions$1,
5473
- constants: constants,
5757
+ constants: constants$1,
5474
5758
  types: types,
5475
5759
  initialState: initialState$4
5476
5760
  });
@@ -8255,7 +8539,7 @@
8255
8539
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8256
8540
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8257
8541
  * */
8258
- var useStyles$A = makeStyles__default["default"]({
8542
+ var useStyles$x = makeStyles__default["default"]({
8259
8543
  buttonDiv: {
8260
8544
  position: 'relative'
8261
8545
  },
@@ -8291,7 +8575,7 @@
8291
8575
  handleClose = _a.handleClose,
8292
8576
  _e = _a.layerType,
8293
8577
  layerType = _e === void 0 ? LayerType.mapLayer : _e;
8294
- var classes = useStyles$A();
8578
+ var classes = useStyles$x();
8295
8579
 
8296
8580
  var _f = __read(React__namespace.useState(''), 2),
8297
8581
  serviceURL = _f[0],
@@ -8560,6 +8844,9 @@
8560
8844
  column6: {
8561
8845
  width: iconButtonSize * 2,
8562
8846
  display: 'inline-flex'
8847
+ },
8848
+ columns35: {
8849
+ width: "calc((100% - " + iconButtonSize * totalButtons + "px) * 0.75)"
8563
8850
  }
8564
8851
  });
8565
8852
  var LayerManagerColumnsSmall = makeStyles__default["default"]({
@@ -8581,6 +8868,9 @@
8581
8868
  column6: {
8582
8869
  width: iconButtonSize * 2,
8583
8870
  display: 'inline-flex'
8871
+ },
8872
+ columns35: {
8873
+ display: 'none'
8584
8874
  }
8585
8875
  });
8586
8876
  var LayerManagerWidth;
@@ -8665,7 +8955,7 @@
8665
8955
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8666
8956
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8667
8957
  * */
8668
- var useStyles$z = makeStyles__default["default"]({
8958
+ var useStyles$w = makeStyles__default["default"]({
8669
8959
  row: {
8670
8960
  height: '32px'
8671
8961
  },
@@ -8689,7 +8979,7 @@
8689
8979
  layerManagerWidth = _a.layerManagerWidth,
8690
8980
  _e = _a.layerSelect,
8691
8981
  layerSelect = _e === void 0 ? false : _e;
8692
- var classes = useStyles$z();
8982
+ var classes = useStyles$w();
8693
8983
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8694
8984
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
8695
8985
  container: true,
@@ -8766,18 +9056,18 @@
8766
9056
  borderColor: 'transparent!important'
8767
9057
  },
8768
9058
  '&:hover .MuiSelect-select': {
8769
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9059
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8770
9060
  },
8771
9061
  '&.Mui-focused .MuiSelect-select': {
8772
9062
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8773
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9063
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8774
9064
  },
8775
9065
  '&:hover&.MuiButton-root': {
8776
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9066
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8777
9067
  },
8778
9068
  '&:focus&.MuiButton-root': {
8779
9069
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8780
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9070
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8781
9071
  },
8782
9072
  '& .MuiSvgIcon-root': {
8783
9073
  transition: 'none',
@@ -8913,7 +9203,7 @@
8913
9203
  }
8914
9204
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8915
9205
  disabled: true
8916
- }, "Select dimension"), layerDimensions.map(function (dimension) {
9206
+ }, "Dimension"), layerDimensions.map(function (dimension) {
8917
9207
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8918
9208
  key: dimension.name,
8919
9209
  value: dimension.name
@@ -8936,202 +9226,15 @@
8936
9226
  },
8937
9227
  style: {
8938
9228
  maxWidth: '50%'
8939
- }
8940
- }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8941
- disabled: true
8942
- }, "Select dimension value. (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
8943
- return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
8944
- key: dimValue,
8945
- value: dimValue
8946
- }, "" + dimValue, /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, "\xA0", /*#__PURE__*/React__namespace.createElement("i", null, "" + activeDim.units)));
8947
- }))));
8948
- };
8949
-
8950
- /* *
8951
- * Licensed under the Apache License, Version 2.0 (the "License");
8952
- * you may not use this file except in compliance with the License.
8953
- * You may obtain a copy of the License at
8954
- *
8955
- * http://www.apache.org/licenses/LICENSE-2.0
8956
- *
8957
- * Unless required by applicable law or agreed to in writing, software
8958
- * distributed under the License is distributed on an "AS IS" BASIS,
8959
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8960
- * See the License for the specific language governing permissions and
8961
- * limitations under the License.
8962
- *
8963
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8964
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8965
- * */
8966
- var useStyles$y = makeStyles__default["default"](function (theme) {
8967
- return createStyles__default["default"]({
8968
- button: {
8969
- height: 28,
8970
- width: 28,
8971
- borderRadius: 5,
8972
- marginTop: 2,
8973
- color: function color(_a) {
8974
- var isActive = _a.isActive,
8975
- isAccessible = _a.isAccessible,
8976
- isEnabled = _a.isEnabled;
8977
-
8978
- if (!isEnabled) {
8979
- return theme.palette.geowebColors.buttons.flat.disabled.color;
8980
- }
8981
-
8982
- if (isAccessible) {
8983
- return theme.palette.geowebColors.greys.accessible;
8984
- }
8985
-
8986
- if (isActive) {
8987
- return theme.palette.common.white;
8988
- }
8989
-
8990
- return theme.palette.geowebColors.buttons.flat["default"].color;
8991
- },
8992
- backgroundColor: function backgroundColor(_a) {
8993
- var isActive = _a.isActive;
8994
- return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
8995
- },
8996
- '&:focus': {
8997
- backgroundColor: function backgroundColor(_a) {
8998
- var isActive = _a.isActive;
8999
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
9000
- },
9001
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
9002
- borderRadius: 0
9003
- },
9004
- '&:hover': {
9005
- backgroundColor: function backgroundColor(_a) {
9006
- var isActive = _a.isActive;
9007
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
9008
- }
9009
- }
9010
- },
9011
- popper: {
9012
- pointerEvents: 'none'
9013
- }
9014
- });
9015
- });
9016
-
9017
- var LayerManagerButton = function LayerManagerButton(_a) {
9018
- var _b = _a.tooltipTitle,
9019
- tooltipTitle = _b === void 0 ? '' : _b,
9020
- _c = _a.onClick,
9021
- onClick = _c === void 0 ? function () {} : _c,
9022
- _d = _a.isActive,
9023
- isActive = _d === void 0 ? false : _d,
9024
- _e = _a.isEnabled,
9025
- isEnabled = _e === void 0 ? true : _e,
9026
- icon = _a.icon,
9027
- testId = _a.testId,
9028
- _f = _a.isAccessible,
9029
- isAccessible = _f === void 0 ? false : _f,
9030
- className = _a.className,
9031
- props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
9032
-
9033
- var classes = useStyles$y({
9034
- isActive: isActive,
9035
- isEnabled: isEnabled,
9036
- isAccessible: isAccessible
9037
- });
9038
-
9039
- var handleClick = function handleClick(event) {
9040
- onClick(event);
9041
- };
9042
-
9043
- return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
9044
- title: tooltipTitle,
9045
- placement: "top",
9046
- classes: {
9047
- popper: classes.popper
9048
- }
9049
- }, /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
9050
- size: "small",
9051
- onClick: handleClick,
9052
- "data-testid": testId,
9053
- className: classes.button + " " + className,
9054
- disableFocusRipple: true
9055
- }, props), icon));
9056
- };
9057
-
9058
- /* *
9059
- * Licensed under the Apache License, Version 2.0 (the "License");
9060
- * you may not use this file except in compliance with the License.
9061
- * You may obtain a copy of the License at
9062
- *
9063
- * http://www.apache.org/licenses/LICENSE-2.0
9064
- *
9065
- * Unless required by applicable law or agreed to in writing, software
9066
- * distributed under the License is distributed on an "AS IS" BASIS,
9067
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9068
- * See the License for the specific language governing permissions and
9069
- * limitations under the License.
9070
- *
9071
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9072
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9073
- * */
9074
- var useStyles$x = makeStyles__default["default"](function (theme) {
9075
- return createStyles__default["default"]({
9076
- checkbox: {
9077
- color: 'inherit',
9078
- padding: 4,
9079
- borderRadius: 5,
9080
- '&.Mui-focusVisible': {
9081
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9082
- },
9083
- '&:hover': {
9084
- backgroundColor: 'transparent!important'
9085
- },
9086
- '&.Mui-checked': {
9087
- color: 'inherit'
9088
- }
9089
- }
9090
- });
9091
- });
9092
-
9093
- var EnableLayer = function EnableLayer(_a) {
9094
- var isEnabled = _a.isEnabled,
9095
- title = _a.title,
9096
- onChangeEnableLayer = _a.onChangeEnableLayer;
9097
- var classes = useStyles$x(isEnabled);
9098
-
9099
- var onClick = function onClick() {
9100
- onChangeEnableLayer(!isEnabled);
9101
- };
9102
-
9103
- var visibilityIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
9104
- width: 24,
9105
- height: 24,
9106
- fill: "transparent"
9107
- }), /*#__PURE__*/React__namespace.createElement("path", {
9108
- d: "M14.4980749,15.8618431 C15.8661433,15.0851043 16.779689,13.6936347 16.779689,12.1014551 C16.779689,10.5092755 15.8661433,9.11870594 14.4980749,8.34106705 C17.6257313,9.18620931 19.3529176,11.4300215 19.8092405,12.1014551 C19.3529176,12.7719886 17.6266313,15.0167008 14.4980749,15.8618431 L14.4980749,15.8618431 Z M4.18985949,12.1014551 C4.64618231,11.4300215 6.37336867,9.18710936 9.49922496,8.3419671 C8.13295665,9.11870594 7.21851093,10.5101755 7.21851093,12.1014551 C7.21851093,13.6936347 8.13295665,15.0842042 9.49922496,15.8618431 C6.37336867,15.0167008 4.64618231,12.7728886 4.18985949,12.1014551 L4.18985949,12.1014551 Z M11.99955,13.8583429 C10.9950998,13.8583429 10.180559,13.0717036 10.180559,12.1014551 C10.180559,11.1312066 10.9950998,10.3445672 11.99955,10.3445672 C13.0031002,10.3445672 13.8176409,11.1312066 13.8176409,12.1014551 C13.8176409,13.0717036 13.0031002,13.8583429 11.99955,13.8583429 L11.99955,13.8583429 Z M20.7983899,11.7666383 C20.6813841,11.5713286 17.8696435,7 11.99955,7 C6.12945647,7 3.31681584,11.5713286 3.19980999,11.7666383 L3,12.1014551 L3.19980999,12.4362718 C3.31681584,12.6306815 6.12945647,17.2020101 11.99955,17.2020101 C17.8696435,17.2020101 20.6813841,12.6306815 20.7983899,12.4362718 L21,12.1014551 L20.7983899,11.7666383 Z"
9109
- }));
9110
- var visibilityOffIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
9111
- style: {
9112
- marginTop: 2
9113
- }
9114
- }, /*#__PURE__*/React__namespace.createElement("rect", {
9115
- width: 24,
9116
- height: 24,
9117
- fill: "transparent"
9118
- }), /*#__PURE__*/React__namespace.createElement("path", {
9119
- d: "M12 15.309c-.755 0-1.45-.088-2.092-.236l.798-.797c.41.124.844.192 1.294.192 2.453 0 4.442-1.988 4.442-4.44 0-.495-.085-.907-.234-1.255l.03-.03c1.72.906 2.781 2.167 3.218 2.766-.724.992-3.151 3.8-7.456 3.8zm-7.456-3.8c.442-.607 1.522-1.89 3.276-2.796-.166.36-.261.79-.261 1.315 0 1.228.499 2.34 1.305 3.144l-1.102 1.104c-1.72-.906-2.78-2.169-3.218-2.767zm5.646-3.524c.818 0 1.482.665 1.482 1.483 0 .818-.664 1.481-1.482 1.481s-1.482-.663-1.482-1.481c0-.818.664-1.483 1.482-1.483zm10.608 3.19c-.073-.125-1.245-2.026-3.603-3.388l2.009-2.01c.406-.406.406-1.065 0-1.473-.407-.405-1.066-.405-1.473 0l-2.58 2.582c-.93-.295-1.98-.478-3.151-.478-5.87 0-8.681 4.57-8.798 4.766L3 11.51l.202.335c.073.124 1.244 2.025 3.603 3.387l-2.009 2.01c-.406.406-.406 1.065 0 1.472.204.203.47.305.737.305.266 0 .532-.102.736-.305l2.58-2.58c.93.293 1.98.476 3.151.476 5.87 0 8.681-4.57 8.798-4.765l.202-.335-.202-.335z"
9120
- }));
9121
- return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9122
- tooltipTitle: title,
9123
- onClick: onClick,
9124
- icon: /*#__PURE__*/React__namespace.createElement(material.Checkbox, {
9125
- className: classes.checkbox,
9126
- icon: visibilityOffIcon,
9127
- checkedIcon: visibilityIcon,
9128
- checked: isEnabled,
9129
- disableFocusRipple: true,
9130
- tabIndex: -1
9131
- }),
9132
- testId: "enableLayer",
9133
- isEnabled: isEnabled
9134
- });
9229
+ }
9230
+ }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9231
+ disabled: true
9232
+ }, "Dimension value (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
9233
+ return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9234
+ key: dimValue,
9235
+ value: dimValue
9236
+ }, "" + dimValue, /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, "\xA0", /*#__PURE__*/React__namespace.createElement("i", null, "" + activeDim.units)));
9237
+ }))));
9135
9238
  };
9136
9239
 
9137
9240
  /* *
@@ -9150,7 +9253,7 @@
9150
9253
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9151
9254
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9152
9255
  * */
9153
- var useStyles$w = makeStyles__default["default"](function (theme) {
9256
+ var useStyles$v = makeStyles__default["default"](function (theme) {
9154
9257
  return createStyles__default["default"]({
9155
9258
  dropdownEmpty: {
9156
9259
  paddingLeft: 8,
@@ -9200,7 +9303,7 @@
9200
9303
  layers = _b === void 0 ? [] : _b,
9201
9304
  _c = _a.isEnabled,
9202
9305
  isEnabled = _c === void 0 ? true : _c;
9203
- var classes = useStyles$w();
9306
+ var classes = useStyles$v();
9204
9307
  var containerClass = useTooltipContainerStyles(isEnabled);
9205
9308
 
9206
9309
  if (!layers || !layers.length) {
@@ -9246,7 +9349,7 @@
9246
9349
  requiresCtrlToChange: true
9247
9350
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9248
9351
  disabled: true
9249
- }, "Select layer"), extendedLayers.map(function (layerFromServiceLayers) {
9352
+ }, "Layer"), extendedLayers.map(function (layerFromServiceLayers) {
9250
9353
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9251
9354
  key: layerFromServiceLayers.name,
9252
9355
  value: layerFromServiceLayers.name,
@@ -9271,7 +9374,7 @@
9271
9374
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9272
9375
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9273
9376
  * */
9274
- var useStyles$v = makeStyles__default["default"](function (theme) {
9377
+ var useStyles$u = makeStyles__default["default"](function (theme) {
9275
9378
  return {
9276
9379
  opacityDiv: {
9277
9380
  height: 'calc(100% - 5px)',
@@ -9332,7 +9435,7 @@
9332
9435
  onLayerChangeOpacity = _a.onLayerChangeOpacity,
9333
9436
  _b = _a.isEnabled,
9334
9437
  isEnabled = _b === void 0 ? true : _b;
9335
- var classes = useStyles$v();
9438
+ var classes = useStyles$u();
9336
9439
  var sliderClasses = shared.sliderStyles();
9337
9440
  var containerClass = useTooltipContainerStyles(isEnabled);
9338
9441
 
@@ -9534,7 +9637,7 @@
9534
9637
  requiresCtrlToChange: true
9535
9638
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9536
9639
  disabled: true
9537
- }, "Select style"), styles.map(function (styleFromlayer) {
9640
+ }, "Style"), styles.map(function (styleFromlayer) {
9538
9641
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9539
9642
  key: styleFromlayer.name,
9540
9643
  value: styleFromlayer.name
@@ -9542,48 +9645,6 @@
9542
9645
  }));
9543
9646
  };
9544
9647
 
9545
- /* *
9546
- * Licensed under the Apache License, Version 2.0 (the "License");
9547
- * you may not use this file except in compliance with the License.
9548
- * You may obtain a copy of the License at
9549
- *
9550
- * http://www.apache.org/licenses/LICENSE-2.0
9551
- *
9552
- * Unless required by applicable law or agreed to in writing, software
9553
- * distributed under the License is distributed on an "AS IS" BASIS,
9554
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9555
- * See the License for the specific language governing permissions and
9556
- * limitations under the License.
9557
- *
9558
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9559
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9560
- * */
9561
- var useStyles$u = makeStyles__default["default"](function () {
9562
- return createStyles__default["default"]({
9563
- icon: {
9564
- width: 20,
9565
- height: 20
9566
- }
9567
- });
9568
- });
9569
-
9570
- var DeleteButton = function DeleteButton(_a) {
9571
- var tooltipTitle = _a.tooltipTitle,
9572
- onClickDelete = _a.onClickDelete,
9573
- _b = _a.isEnabled,
9574
- isEnabled = _b === void 0 ? true : _b;
9575
- var classes = useStyles$u();
9576
- return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9577
- tooltipTitle: tooltipTitle,
9578
- onClick: onClickDelete,
9579
- icon: /*#__PURE__*/React__namespace.createElement(iconsMaterial.Delete, {
9580
- className: classes.icon
9581
- }),
9582
- testId: "deleteButton",
9583
- isEnabled: isEnabled
9584
- });
9585
- };
9586
-
9587
9648
  /* *
9588
9649
  * Licensed under the Apache License, Version 2.0 (the "License");
9589
9650
  * you may not use this file except in compliance with the License.
@@ -9604,13 +9665,18 @@
9604
9665
  return createStyles__default["default"]({
9605
9666
  svgIcon: {
9606
9667
  fill: function fill(_a) {
9607
- var isActive = _a.isActive;
9668
+ var isActive = _a.isActive,
9669
+ isEnabled = _a.isEnabled;
9608
9670
 
9609
9671
  if (isActive) {
9610
9672
  return theme.palette.common.white;
9611
9673
  }
9612
9674
 
9613
- return theme.palette.geowebColors.buttons.flat["default"].color;
9675
+ if (isEnabled) {
9676
+ return theme.palette.geowebColors.buttons.flat["default"].color;
9677
+ }
9678
+
9679
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
9614
9680
  }
9615
9681
  }
9616
9682
  });
@@ -9652,7 +9718,7 @@
9652
9718
  }))));
9653
9719
  };
9654
9720
 
9655
- return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9721
+ return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
9656
9722
  tooltipTitle: tooltipTitle,
9657
9723
  onClick: onClickActivate,
9658
9724
  icon: /*#__PURE__*/React__namespace.createElement(Icon, null),
@@ -9711,6 +9777,8 @@
9711
9777
  } : _b,
9712
9778
  _c = _a.isEnabled,
9713
9779
  isEnabled = _c === void 0 ? true : _c,
9780
+ _d = _a.isLayerMissing,
9781
+ isLayerMissing = _d === void 0 ? false : _d,
9714
9782
  onLayerEnable = _a.onLayerEnable,
9715
9783
  onLayerChangeName = _a.onLayerChangeName,
9716
9784
  onLayerChangeStyle = _a.onLayerChangeStyle,
@@ -9744,7 +9812,7 @@
9744
9812
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9745
9813
  item: true,
9746
9814
  className: columnSizes.column1
9747
- }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(EnableLayer, {
9815
+ }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.EnableButton, {
9748
9816
  isEnabled: layer.enabled,
9749
9817
  title: layer.name,
9750
9818
  onChangeEnableLayer: function onChangeEnableLayer() {
@@ -9767,7 +9835,13 @@
9767
9835
  name: name
9768
9836
  });
9769
9837
  }
9770
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9838
+ })), isLayerMissing ? /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9839
+ item: true,
9840
+ className: "" + columnSizes.columns35
9841
+ }, /*#__PURE__*/React__default["default"].createElement(shared.AlertBanner, {
9842
+ title: "This layer could not be loaded: does not exist on the server.",
9843
+ isCompact: true
9844
+ })) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9771
9845
  item: true,
9772
9846
  className: "" + columnSizes.column3
9773
9847
  }, layerStylesLayout || /*#__PURE__*/React__default["default"].createElement(RenderStyles, {
@@ -9810,10 +9884,10 @@
9810
9884
  dimension: dimension
9811
9885
  });
9812
9886
  }
9813
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9887
+ }))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
9814
9888
  item: true,
9815
9889
  className: columnSizes.column6
9816
- }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(DeleteButton, {
9890
+ }, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerDeleteButton, {
9817
9891
  tooltipTitle: "Remove layer",
9818
9892
  onClickDelete: function onClickDelete() {
9819
9893
  onLayerDelete({
@@ -9863,7 +9937,7 @@
9863
9937
  var isLayerEnabled = reactRedux.useSelector(function (store) {
9864
9938
  return getLayerEnabled(store, layerId);
9865
9939
  });
9866
- return /*#__PURE__*/React__namespace.createElement(DeleteButton, {
9940
+ return /*#__PURE__*/React__namespace.createElement(shared.ManagerDeleteButton, {
9867
9941
  tooltipTitle: "Remove layer",
9868
9942
  onClickDelete: function onClickDelete() {
9869
9943
  layerDelete$1({
@@ -9907,7 +9981,7 @@
9907
9981
  enabled: enabled
9908
9982
  }));
9909
9983
  }, [dispatch]);
9910
- return /*#__PURE__*/React__namespace.createElement(EnableLayer, {
9984
+ return /*#__PURE__*/React__namespace.createElement(shared.EnableButton, {
9911
9985
  isEnabled: isEnabled,
9912
9986
  title: "Toggle this layer's visibility",
9913
9987
  onChangeEnableLayer: function onChangeEnableLayer(enable) {
@@ -10251,10 +10325,23 @@
10251
10325
  var isEnabled = reactRedux.useSelector(function (store) {
10252
10326
  return getLayerEnabled(store, layerId);
10253
10327
  });
10328
+ var layerName = reactRedux.useSelector(function (store) {
10329
+ return getLayerName(store, layerId);
10330
+ });
10331
+ var layerService = reactRedux.useSelector(function (store) {
10332
+ return getLayerService(store, layerId);
10333
+ });
10334
+ var layers = reactRedux.useSelector(function (store) {
10335
+ return getLayersFromService$1(store, layerService);
10336
+ });
10337
+ var isLayerMissing = layers && layers.length > 0 && !layers.some(function (l) {
10338
+ return l.name === layerName;
10339
+ });
10254
10340
  return /*#__PURE__*/React__namespace.createElement(LayerRow, {
10255
10341
  isEnabled: isEnabled,
10256
10342
  mapId: mapId,
10257
10343
  layerId: layerId,
10344
+ isLayerMissing: isLayerMissing,
10258
10345
  layerEnableLayout: /*#__PURE__*/React__namespace.createElement(EnableLayerConnect, {
10259
10346
  layerId: layerId
10260
10347
  }),
@@ -10314,7 +10401,7 @@
10314
10401
  _d = _a.hideTooltip,
10315
10402
  hideTooltip = _d === void 0 ? false : _d;
10316
10403
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
10317
- return /*#__PURE__*/React__default["default"].createElement(LayerManagerButton, {
10404
+ return /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
10318
10405
  tooltipTitle: tooltipTitle,
10319
10406
  icon: /*#__PURE__*/React__default["default"].createElement(iconsMaterial.DragIndicator, null),
10320
10407
  testId: "dragHandle" + (index !== undefined ? "-" + index : ''),
@@ -10516,7 +10603,7 @@
10516
10603
  }
10517
10604
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
10518
10605
  disabled: true
10519
- }, "Select base layer"), availableBaseLayers.map(function (baseLayer) {
10606
+ }, "Base layer"), availableBaseLayers.map(function (baseLayer) {
10520
10607
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
10521
10608
  key: baseLayer.id,
10522
10609
  value: baseLayer.id
@@ -15422,13 +15509,15 @@
15422
15509
  }
15423
15510
  };
15424
15511
 
15425
- var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale) {
15512
+ var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale) {
15426
15513
  var ctx = context;
15427
15514
  var _a = theme.palette.geowebColors.timeSlider,
15428
15515
  timelineTimelineSurface = _a.timelineTimelineSurface,
15429
15516
  timelineNightTime = _a.timelineNightTime;
15430
15517
  ctx.fillStyle = timelineTimelineSurface.fill;
15431
15518
  ctx.fillRect(0, 0, canvasWidth, height);
15519
+ ctx.fillStyle = theme.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
15520
+ ctx.fillRect(animationStartPx, 0, Math.max(animationEndPx - animationStartPx, 0), height);
15432
15521
  var colorChangeUnit = getColorChangeTimestepUnit(scale);
15433
15522
 
15434
15523
  var _b = __read(getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, colorChangeUnit), 2),
@@ -15522,7 +15611,7 @@
15522
15611
  drawLeftSideDateText(ctx, theme, dateText, height);
15523
15612
  };
15524
15613
 
15525
- var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix) {
15614
+ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix, animationStartTime, animationEndTime) {
15526
15615
  var ctx = context;
15527
15616
 
15528
15617
  var _a = __read([0, canvasWidth].map(function (px) {
@@ -15531,7 +15620,13 @@
15531
15620
  visibleTimeStart = _a[0],
15532
15621
  visibleTimeEnd = _a[1];
15533
15622
 
15534
- drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale);
15623
+ var _b = __read([animationStartTime, animationEndTime].map(function (time) {
15624
+ return timestampToPixel(time, centerTime, canvasWidth, secondsPerPx);
15625
+ }), 2),
15626
+ animationStartPx = _b[0],
15627
+ animationEndPx = _b[1];
15628
+
15629
+ drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale);
15535
15630
  drawTimeScale(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale, dataScaleToSecondsPerPx);
15536
15631
  drawNeedle(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, selectedTimeUnix);
15537
15632
  drawCurrentTime(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, currentTimeUnix);
@@ -15962,6 +16057,8 @@
15962
16057
  currentTime = _a.currentTime,
15963
16058
  dataStartTime = _a.dataStartTime,
15964
16059
  dataEndTime = _a.dataEndTime,
16060
+ animationStartTime = _a.animationStartTime,
16061
+ animationEndTime = _a.animationEndTime,
15965
16062
  isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
15966
16063
  timeStep = _a.timeStep,
15967
16064
  onSetNewDate = _a.onSetNewDate,
@@ -15985,6 +16082,18 @@
15985
16082
  isNewSelectionTimeRequested = _g[0],
15986
16083
  setNewSelectionTimeRequested = _g[1];
15987
16084
 
16085
+ var _h = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
16086
+ localAnimationStartTime = _h[0],
16087
+ setLocalAnimationStartTime = _h[1];
16088
+
16089
+ var _j = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
16090
+ localAnimationEndTime = _j[0],
16091
+ setLocalAnimationEndTime = _j[1];
16092
+
16093
+ React__namespace.useEffect(function () {
16094
+ setLocalAnimationStartTime(animationStartTime && moment__default["default"].utc(animationStartTime).unix());
16095
+ setLocalAnimationEndTime(animationEndTime && moment__default["default"].utc(animationEndTime).unix());
16096
+ }, [animationStartTime, animationEndTime]);
15988
16097
  React__namespace.useEffect(function () {
15989
16098
  var handleKeyDown = function handleKeyDown(event) {
15990
16099
  if (event.key === 'Home') {
@@ -16082,7 +16191,7 @@
16082
16191
  }
16083
16192
  },
16084
16193
  onRenderCanvas: function onRenderCanvas(ctx, width, height) {
16085
- renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime);
16194
+ renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime, localAnimationStartTime, localAnimationEndTime);
16086
16195
  }
16087
16196
  }));
16088
16197
  };
@@ -16374,6 +16483,9 @@
16374
16483
  var svgIconPath = new Path2D('M8.843 1.029c-.56 0-.814.362-.814.699 0 .179.065.36.19.54l3.06 4.34c.065.093.14.171.221.234v8.373c-.082.064-.156.142-.22.234L8.219 19.79c-.125.18-.19.361-.19.54 0 .337.255.699.814.699h6.373c.56 0 .813-.361.813-.7 0-.178-.064-.36-.19-.538l-3.06-4.343c-.08-.112-.174-.204-.278-.273V6.883c.104-.069.199-.16.278-.273l3.06-4.343c.126-.179.19-.36.19-.539 0-.338-.254-.7-.813-.7z');
16375
16484
  ctx.fillStyle = playerTimeMarkers.fill;
16376
16485
  ctx.fill(svgIconPath);
16486
+ ctx.strokeStyle = theme.palette.geowebColors.timeSlider.playerNeedlePlayer.rgba;
16487
+ ctx.lineWidth = 1;
16488
+ ctx.stroke(svgIconPath);
16377
16489
  ctx.restore();
16378
16490
  };
16379
16491
 
@@ -17168,10 +17280,10 @@
17168
17280
  var animationIntervalDefault = 5;
17169
17281
  var connectRedux$3 = reactRedux.connect(function (store, props) {
17170
17282
  return {
17171
- isAnimating: isAnimating(store, props.mapId),
17172
17283
  animationStartTime: getAnimationStartTime(store, props.mapId),
17173
17284
  animationEndTime: getAnimationEndTime(store, props.mapId),
17174
- timeStep: getMapTimeStep(store, props.mapId)
17285
+ timeStep: getMapTimeStep(store, props.mapId),
17286
+ linkedMapAnimationInfo: linkedMapAnimationInfo(store, props.mapId)
17175
17287
  };
17176
17288
  }, {
17177
17289
  mapStartAnimation: mapStartAnimation,
@@ -17179,19 +17291,19 @@
17179
17291
  });
17180
17292
  var PlayButtonConnect = connectRedux$3(function (_a) {
17181
17293
  var mapId = _a.mapId,
17182
- isAnimating = _a.isAnimating,
17183
17294
  animationStartTime = _a.animationStartTime,
17184
17295
  animationEndTime = _a.animationEndTime,
17185
17296
  isDisabled = _a.isDisabled,
17186
17297
  timeStep = _a.timeStep,
17298
+ linkedMapAnimationInfo = _a.linkedMapAnimationInfo,
17187
17299
  mapStartAnimation = _a.mapStartAnimation,
17188
17300
  mapStopAnimation = _a.mapStopAnimation;
17189
17301
  var animationInterval = timeStep || animationIntervalDefault;
17190
17302
 
17191
17303
  var onTogglePlay = function onTogglePlay() {
17192
- if (isAnimating) {
17304
+ if (linkedMapAnimationInfo.isAnimating) {
17193
17305
  mapStopAnimation({
17194
- mapId: mapId
17306
+ mapId: linkedMapAnimationInfo.id
17195
17307
  });
17196
17308
  } else {
17197
17309
  mapStartAnimation({
@@ -17204,7 +17316,7 @@
17204
17316
  };
17205
17317
 
17206
17318
  return /*#__PURE__*/React__default["default"].createElement(PlayButton, {
17207
- isAnimating: isAnimating,
17319
+ isAnimating: linkedMapAnimationInfo.isAnimating,
17208
17320
  isDisabled: isDisabled,
17209
17321
  onTogglePlayButton: function onTogglePlayButton() {
17210
17322
  onTogglePlay();
@@ -17261,52 +17373,6 @@
17261
17373
  });
17262
17374
  };
17263
17375
 
17264
- /* *
17265
- * Licensed under the Apache License, Version 2.0 (the "License");
17266
- * you may not use this file except in compliance with the License.
17267
- * You may obtain a copy of the License at
17268
- *
17269
- * http://www.apache.org/licenses/LICENSE-2.0
17270
- *
17271
- * Unless required by applicable law or agreed to in writing, software
17272
- * distributed under the License is distributed on an "AS IS" BASIS,
17273
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17274
- * See the License for the specific language governing permissions and
17275
- * limitations under the License.
17276
- *
17277
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17278
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17279
- * */
17280
-
17281
- var synchronizationGroupStore = function synchronizationGroupStore(store) {
17282
- return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
17283
- };
17284
-
17285
- var getSynchronizationGroupStore = reselect.createSelector(synchronizationGroupStore, function (store) {
17286
- return store;
17287
- });
17288
- /**
17289
- * Returns the synchronization source by id
17290
- * @param store The app store
17291
- * @param id The source id to find
17292
- */
17293
-
17294
- var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
17295
- if (state && state.sources) {
17296
- var sources = state.sources;
17297
-
17298
- if (sources.byId[id]) {
17299
- return sources.byId[id];
17300
- }
17301
- }
17302
-
17303
- return null;
17304
- };
17305
-
17306
- var getTime = reselect.createSelector(getSyncSourceBySourceId, function (store) {
17307
- return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
17308
- });
17309
-
17310
17376
  /* *
17311
17377
  * Licensed under the Apache License, Version 2.0 (the "License");
17312
17378
  * you may not use this file except in compliance with the License.
@@ -17334,7 +17400,9 @@
17334
17400
  isAnimating: isAnimating(store, props.mapId),
17335
17401
  timeStep: getMapTimeStep(store, props.mapId),
17336
17402
  isTimeSliderHoverOn: isTimeSliderHoverOn(store, props.mapId),
17337
- timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId)
17403
+ timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
17404
+ animationStartTime: getAnimationStartTime(store, props.mapId),
17405
+ animationEndTime: getAnimationEndTime(store, props.mapId)
17338
17406
  };
17339
17407
  }, {
17340
17408
  stopMapAnimation: mapStopAnimation,
@@ -17357,6 +17425,8 @@
17357
17425
  isAnimating = _a.isAnimating,
17358
17426
  timeStep = _a.timeStep,
17359
17427
  isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
17428
+ animationStartTime = _a.animationStartTime,
17429
+ animationEndTime = _a.animationEndTime,
17360
17430
  stopMapAnimation = _a.stopMapAnimation,
17361
17431
  setTime = _a.setTime,
17362
17432
  syncGroupAddSource = _a.syncGroupAddSource,
@@ -17391,6 +17461,8 @@
17391
17461
  isTimeSliderHoverOn: isTimeSliderHoverOn,
17392
17462
  dataStartTime: dataStartTime,
17393
17463
  dataEndTime: dataEndTime,
17464
+ animationStartTime: animationStartTime,
17465
+ animationEndTime: animationEndTime,
17394
17466
  timeStep: timeStep,
17395
17467
  onSetNewDate: function onSetNewDate(newDate) {
17396
17468
  if (isAnimating) {
@@ -23324,103 +23396,6 @@
23324
23396
  });
23325
23397
  });
23326
23398
 
23327
- /* *
23328
- * Licensed under the Apache License, Version 2.0 (the "License");
23329
- * you may not use this file except in compliance with the License.
23330
- * You may obtain a copy of the License at
23331
- *
23332
- * http://www.apache.org/licenses/LICENSE-2.0
23333
- *
23334
- * Unless required by applicable law or agreed to in writing, software
23335
- * distributed under the License is distributed on an "AS IS" BASIS,
23336
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23337
- * See the License for the specific language governing permissions and
23338
- * limitations under the License.
23339
- *
23340
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23341
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
23342
- * */
23343
- var emptyState = {
23344
- timeslider: {
23345
- groups: [],
23346
- sourcesById: []
23347
- },
23348
- zoompane: {
23349
- groups: [],
23350
- sourcesById: []
23351
- },
23352
- level: {
23353
- groups: [],
23354
- sourcesById: []
23355
- }
23356
- };
23357
- var groupTypes = [{
23358
- title: 'Timeslider',
23359
- syncType: 'SYNCGROUPS_TYPE_SETTIME',
23360
- groupType: 'timeslider'
23361
- }, {
23362
- title: 'Zoompane',
23363
- syncType: 'SYNCGROUPS_TYPE_SETBBOX',
23364
- groupType: 'zoompane'
23365
- }];
23366
- /*
23367
- _____ Creates viewState _____
23368
- - Runs Each time viewState is created:
23369
- - Fill arrays inside initialState with objects containing new values from Redux
23370
- */
23371
-
23372
- var createSyncGroupViewState = function createSyncGroupViewState(syncState) {
23373
- var initialState = produce__default["default"](emptyState, function (draft) {
23374
- /*
23375
- _____ 1. Fill groups _____
23376
- 1. Goes through all groups by ID
23377
- 2. Collects original timeslider or zoompane values into an array
23378
- 3. Sorts and adds selected sources to ViewState based on ID type
23379
- */
23380
- Object.keys(syncState.groups.byId).forEach(function (id) {
23381
- var _a;
23382
-
23383
- var groupType = (_a = groupTypes.find(function (object) {
23384
- return object.syncType === syncState.groups.byId[id].type;
23385
- })) === null || _a === void 0 ? void 0 : _a.groupType;
23386
-
23387
- if (groupType) {
23388
- draft[groupType].groups.push({
23389
- id: id,
23390
- selected: syncState.groups.byId[id].targets.allIds
23391
- });
23392
- }
23393
- });
23394
- /*
23395
- _____ 2. Fill sourcesById _____
23396
- 1. Loop though sources and add source to each group type
23397
- */
23398
-
23399
- Object.keys(syncState.sources.byId).forEach(function (id) {
23400
- groupTypes.forEach(function (_a) {
23401
- var syncType = _a.syncType,
23402
- groupType = _a.groupType;
23403
-
23404
- if (syncState.sources.byId[id].types.includes(syncType)) {
23405
- draft[groupType].sourcesById.push({
23406
- id: id,
23407
- name: id
23408
- });
23409
- }
23410
- });
23411
- });
23412
- });
23413
- return initialState;
23414
- }; // TODO
23415
- // Improve selector to reduce unnecessary re-rendering
23416
- // https://gitlab.com/opengeoweb/opengeoweb/-/issues/1333
23417
-
23418
- var syncState = function syncState(store) {
23419
- return store.syncronizationGroupStore;
23420
- };
23421
-
23422
- var createSyncGroupViewStateSelector = reselect.createSelector(syncState, createSyncGroupViewState);
23423
-
23424
23399
  /* *
23425
23400
  * Licensed under the Apache License, Version 2.0 (the "License");
23426
23401
  * you may not use this file except in compliance with the License.
@@ -23444,7 +23419,10 @@
23444
23419
  syncGroupAddTarget = _a.syncGroupAddTarget,
23445
23420
  syncGroupRemoveTarget = _a.syncGroupRemoveTarget,
23446
23421
  syncGroupAddGroup = _a.syncGroupAddGroup,
23447
- syncGroupRemoveGroup = _a.syncGroupRemoveGroup;
23422
+ syncGroupRemoveGroup = _a.syncGroupRemoveGroup,
23423
+ onMouseDown = _a.onMouseDown,
23424
+ _b = _a.order,
23425
+ order = _b === void 0 ? 0 : _b;
23448
23426
  /*
23449
23427
  _____ Handle Toggle _____
23450
23428
  - Handles checking, unchecking and toggling between in groups
@@ -23549,7 +23527,9 @@
23549
23527
  headerSize: "medium",
23550
23528
  isOpen: isOpen,
23551
23529
  onClose: onClose,
23552
- "data-testid": "syncGroupViewer"
23530
+ "data-testid": "syncGroupViewer",
23531
+ onMouseDown: onMouseDown,
23532
+ order: order
23553
23533
  }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(SyncGroupList, {
23554
23534
  viewStateData: syncGroupViewState.zoompane,
23555
23535
  title: "ZoomPane",
@@ -23605,14 +23585,12 @@
23605
23585
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23606
23586
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
23607
23587
  * */
23608
- var SyncGroupViewerConnect = function SyncGroupViewerConnect(_a) {
23609
- var onClose = _a.onClose,
23610
- isOpen = _a.isOpen;
23588
+ var SyncGroupViewerConnect = function SyncGroupViewerConnect() {
23611
23589
  var dispatch = reactRedux.useDispatch(); // TODO
23612
23590
  // Improve the selector to prevent re-renders
23613
23591
  // For example dusting anination syncgroups should not re-render
23614
23592
 
23615
- var viewState = reactRedux.useSelector(createSyncGroupViewStateSelector);
23593
+ var viewState = reactRedux.useSelector(syncGroupGetViewState);
23616
23594
  var syncGroupAddGroup$1 = React__namespace.useCallback(function (payload) {
23617
23595
  return dispatch(syncGroupAddGroup(payload));
23618
23596
  }, [dispatch]);
@@ -23625,14 +23603,55 @@
23625
23603
  var syncGroupRemoveTarget$1 = React__namespace.useCallback(function (payload) {
23626
23604
  return dispatch(syncGroupRemoveTarget(payload));
23627
23605
  }, [dispatch]);
23606
+ var isOpenInStore = reactRedux.useSelector(function (store) {
23607
+ return getisDialogOpen(store, 'syncGroups');
23608
+ });
23609
+ var onClose = React__namespace.useCallback(function () {
23610
+ return dispatch(setToggleOpenDialog({
23611
+ type: 'syncGroups',
23612
+ setOpen: false
23613
+ }));
23614
+ }, [dispatch]);
23615
+ var uiOrder = reactRedux.useSelector(function (store) {
23616
+ return getDialogOrder(store, 'syncGroups');
23617
+ });
23618
+ var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
23619
+ return getDialogIsOrderedOnTop(store, 'syncGroups');
23620
+ });
23621
+ var registerDialog$1 = React__namespace.useCallback(function () {
23622
+ return dispatch(registerDialog({
23623
+ type: 'syncGroups',
23624
+ setOpen: false
23625
+ }));
23626
+ }, [dispatch]);
23627
+ var unregisterDialog$1 = React__namespace.useCallback(function () {
23628
+ return dispatch(unregisterDialog({
23629
+ type: 'syncGroups'
23630
+ }));
23631
+ }, [dispatch]);
23632
+ var onOrderDialog = React__namespace.useCallback(function () {
23633
+ if (!uiIsOrderedOnTop) {
23634
+ dispatch(orderDialog({
23635
+ type: 'syncGroups'
23636
+ }));
23637
+ }
23638
+ }, [dispatch, uiIsOrderedOnTop]);
23639
+ React__namespace.useEffect(function () {
23640
+ registerDialog$1();
23641
+ return function () {
23642
+ unregisterDialog$1();
23643
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
23644
+ }, []);
23628
23645
  return /*#__PURE__*/React__namespace.createElement(SyncGroupViewer, {
23629
23646
  onClose: onClose,
23630
- isOpen: isOpen,
23647
+ isOpen: isOpenInStore,
23631
23648
  syncGroupViewState: viewState,
23632
23649
  syncGroupAddTarget: syncGroupAddTarget$1,
23633
23650
  syncGroupRemoveTarget: syncGroupRemoveTarget$1,
23634
23651
  syncGroupAddGroup: syncGroupAddGroup$1,
23635
- syncGroupRemoveGroup: syncGroupRemoveGroup$1
23652
+ syncGroupRemoveGroup: syncGroupRemoveGroup$1,
23653
+ order: uiOrder,
23654
+ onMouseDown: onOrderDialog
23636
23655
  });
23637
23656
  };
23638
23657
 
@@ -23877,7 +23896,7 @@
23877
23896
  exports.layerReducer = reducer$6;
23878
23897
  exports.makeMapPreset = makeMapPreset;
23879
23898
  exports.mapActions = actions$3;
23880
- exports.mapConstants = constants$1;
23899
+ exports.mapConstants = constants;
23881
23900
  exports.mapModuleConfig = moduleConfig;
23882
23901
  exports.mapSelectors = selectors$1;
23883
23902
  exports.mapTypes = types$2;