@corpsmap/corpsmap 3.2.77 → 3.2.78

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/lib/dev.js CHANGED
@@ -83711,7 +83711,7 @@ function requireDeprecate () {
83711
83711
  return deprecate_1;
83712
83712
  }
83713
83713
 
83714
- var v4$2 = {exports: {}};
83714
+ var v4$1 = {exports: {}};
83715
83715
 
83716
83716
  var rng$1 = {exports: {}};
83717
83717
 
@@ -83782,12 +83782,12 @@ function requireBytesToUuid () {
83782
83782
  return bytesToUuid$1.exports;
83783
83783
  }
83784
83784
 
83785
- v4$2.exports;
83785
+ v4$1.exports;
83786
83786
 
83787
83787
  var hasRequiredV4$1;
83788
83788
 
83789
83789
  function requireV4$1 () {
83790
- if (hasRequiredV4$1) return v4$2.exports;
83790
+ if (hasRequiredV4$1) return v4$1.exports;
83791
83791
  hasRequiredV4$1 = 1;
83792
83792
  (function (module, exports) {
83793
83793
 
@@ -83830,8 +83830,8 @@ function requireV4$1 () {
83830
83830
  var _default = v4;
83831
83831
  exports.default = _default;
83832
83832
  module.exports = exports.default;
83833
- } (v4$2, v4$2.exports));
83834
- return v4$2.exports;
83833
+ } (v4$1, v4$1.exports));
83834
+ return v4$1.exports;
83835
83835
  }
83836
83836
 
83837
83837
  var v4_1;
@@ -83852,7 +83852,6 @@ function requireV4 () {
83852
83852
  }
83853
83853
 
83854
83854
  var v4Exports = requireV4();
83855
- var v4$1 = /*@__PURE__*/getDefaultExportFromCjs(v4Exports);
83856
83855
 
83857
83856
  var scaleToZoomLevel;
83858
83857
  var hasRequiredScaleToZoomLevel;
@@ -83890,7 +83889,7 @@ var scaleToMapZoom = /*@__PURE__*/getDefaultExportFromCjs(scaleToZoomLevelExport
83890
83889
 
83891
83890
  var createNode = function createNode(options, map) {
83892
83891
  if (!options.type) options.type = options.serviceType || "Folder";
83893
- if (!options.uid) options.uid = v4$1();
83892
+ if (!options.uid) options.uid = v4Exports.v4();
83894
83893
  if (!options.minzoom) options.minzoom = scaleToMapZoom(options.maxscale, 0);
83895
83894
  if (!options.maxzoom) options.maxzoom = scaleToMapZoom(options.minscale, 20);
83896
83895
  var node = {
@@ -112603,7 +112602,7 @@ var modalWindowBundle = createContainerBundle({
112603
112602
  });
112604
112603
 
112605
112604
  var notificationBundle = {
112606
- name: 'notifications',
112605
+ name: "notifications",
112607
112606
  getReducer: function getReducer() {
112608
112607
  var initialData = {};
112609
112608
  return function () {
@@ -112612,13 +112611,13 @@ var notificationBundle = {
112612
112611
  type = _ref.type,
112613
112612
  payload = _ref.payload;
112614
112613
  if (payload && payload.notification) {
112615
- var uid = v4$1();
112614
+ var uid = v4Exports.v4();
112616
112615
  payload.notification.uid = uid;
112617
112616
  return Object.assign({}, state, _defineProperty$1({}, uid, payload.notification));
112618
112617
  }
112619
112618
  switch (type) {
112620
- case 'NOTIFICATIONS_FIRED':
112621
- case 'NOTIFICATIONS_DISMISSED':
112619
+ case "NOTIFICATIONS_FIRED":
112620
+ case "NOTIFICATIONS_DISMISSED":
112622
112621
  return Object.assign({}, state, payload);
112623
112622
  default:
112624
112623
  return state;
@@ -112629,10 +112628,10 @@ var notificationBundle = {
112629
112628
  return function (_ref2) {
112630
112629
  var dispatch = _ref2.dispatch;
112631
112630
  _ref2.store;
112632
- var uid = v4$1();
112631
+ var uid = v4Exports.v4();
112633
112632
  options.uid = uid;
112634
112633
  dispatch({
112635
- type: 'NOTIFICATIONS_FIRED',
112634
+ type: "NOTIFICATIONS_FIRED",
112636
112635
  payload: _defineProperty$1({}, uid, options)
112637
112636
  });
112638
112637
  };
@@ -112644,7 +112643,7 @@ var notificationBundle = {
112644
112643
  var state = store.selectNotifications();
112645
112644
  delete state[uid];
112646
112645
  dispatch({
112647
- type: 'NOTIFICATIONS_DISMISSED',
112646
+ type: "NOTIFICATIONS_DISMISSED",
112648
112647
  payload: state
112649
112648
  });
112650
112649
  };
@@ -113045,7 +113044,7 @@ var southRegionBundle = {
113045
113044
  var dispatch = _ref2.dispatch,
113046
113045
  store = _ref2.store;
113047
113046
  var children = store.selectSouthRegionChildrenObj();
113048
- var uid = v4$1();
113047
+ var uid = v4Exports.v4();
113049
113048
  options.uid = uid;
113050
113049
  dispatch({
113051
113050
  type: "SOUTH_REGION_OPENED",
@@ -113847,7 +113846,7 @@ var config = {
113847
113846
  };
113848
113847
 
113849
113848
  var name = "@corpsmap/corpsmap";
113850
- var version = "3.2.77";
113849
+ var version = "3.2.78";
113851
113850
  var description = "CorpsMap as React Components";
113852
113851
  var main = "index.js";
113853
113852
  var scripts = {
package/lib/prod.js CHANGED
@@ -82306,7 +82306,7 @@ function requireDeprecate () {
82306
82306
  return deprecate_1;
82307
82307
  }
82308
82308
 
82309
- var v4$2 = {exports: {}};
82309
+ var v4$1 = {exports: {}};
82310
82310
 
82311
82311
  var rng$1 = {exports: {}};
82312
82312
 
@@ -82377,12 +82377,12 @@ function requireBytesToUuid () {
82377
82377
  return bytesToUuid$1.exports;
82378
82378
  }
82379
82379
 
82380
- v4$2.exports;
82380
+ v4$1.exports;
82381
82381
 
82382
82382
  var hasRequiredV4$1;
82383
82383
 
82384
82384
  function requireV4$1 () {
82385
- if (hasRequiredV4$1) return v4$2.exports;
82385
+ if (hasRequiredV4$1) return v4$1.exports;
82386
82386
  hasRequiredV4$1 = 1;
82387
82387
  (function (module, exports) {
82388
82388
 
@@ -82425,8 +82425,8 @@ function requireV4$1 () {
82425
82425
  var _default = v4;
82426
82426
  exports.default = _default;
82427
82427
  module.exports = exports.default;
82428
- } (v4$2, v4$2.exports));
82429
- return v4$2.exports;
82428
+ } (v4$1, v4$1.exports));
82429
+ return v4$1.exports;
82430
82430
  }
82431
82431
 
82432
82432
  var v4_1;
@@ -82447,7 +82447,6 @@ function requireV4 () {
82447
82447
  }
82448
82448
 
82449
82449
  var v4Exports = requireV4();
82450
- var v4$1 = /*@__PURE__*/getDefaultExportFromCjs(v4Exports);
82451
82450
 
82452
82451
  var scaleToZoomLevel;
82453
82452
  var hasRequiredScaleToZoomLevel;
@@ -82485,7 +82484,7 @@ var scaleToMapZoom = /*@__PURE__*/getDefaultExportFromCjs(scaleToZoomLevelExport
82485
82484
 
82486
82485
  var createNode = function createNode(options, map) {
82487
82486
  if (!options.type) options.type = options.serviceType || "Folder";
82488
- if (!options.uid) options.uid = v4$1();
82487
+ if (!options.uid) options.uid = v4Exports.v4();
82489
82488
  if (!options.minzoom) options.minzoom = scaleToMapZoom(options.maxscale, 0);
82490
82489
  if (!options.maxzoom) options.maxzoom = scaleToMapZoom(options.minscale, 20);
82491
82490
  var node = {
@@ -111198,7 +111197,7 @@ var modalWindowBundle = createContainerBundle({
111198
111197
  });
111199
111198
 
111200
111199
  var notificationBundle = {
111201
- name: 'notifications',
111200
+ name: "notifications",
111202
111201
  getReducer: function getReducer() {
111203
111202
  var initialData = {};
111204
111203
  return function () {
@@ -111207,13 +111206,13 @@ var notificationBundle = {
111207
111206
  type = _ref.type,
111208
111207
  payload = _ref.payload;
111209
111208
  if (payload && payload.notification) {
111210
- var uid = v4$1();
111209
+ var uid = v4Exports.v4();
111211
111210
  payload.notification.uid = uid;
111212
111211
  return Object.assign({}, state, _defineProperty$1({}, uid, payload.notification));
111213
111212
  }
111214
111213
  switch (type) {
111215
- case 'NOTIFICATIONS_FIRED':
111216
- case 'NOTIFICATIONS_DISMISSED':
111214
+ case "NOTIFICATIONS_FIRED":
111215
+ case "NOTIFICATIONS_DISMISSED":
111217
111216
  return Object.assign({}, state, payload);
111218
111217
  default:
111219
111218
  return state;
@@ -111224,10 +111223,10 @@ var notificationBundle = {
111224
111223
  return function (_ref2) {
111225
111224
  var dispatch = _ref2.dispatch;
111226
111225
  _ref2.store;
111227
- var uid = v4$1();
111226
+ var uid = v4Exports.v4();
111228
111227
  options.uid = uid;
111229
111228
  dispatch({
111230
- type: 'NOTIFICATIONS_FIRED',
111229
+ type: "NOTIFICATIONS_FIRED",
111231
111230
  payload: _defineProperty$1({}, uid, options)
111232
111231
  });
111233
111232
  };
@@ -111239,7 +111238,7 @@ var notificationBundle = {
111239
111238
  var state = store.selectNotifications();
111240
111239
  delete state[uid];
111241
111240
  dispatch({
111242
- type: 'NOTIFICATIONS_DISMISSED',
111241
+ type: "NOTIFICATIONS_DISMISSED",
111243
111242
  payload: state
111244
111243
  });
111245
111244
  };
@@ -111640,7 +111639,7 @@ var southRegionBundle = {
111640
111639
  var dispatch = _ref2.dispatch,
111641
111640
  store = _ref2.store;
111642
111641
  var children = store.selectSouthRegionChildrenObj();
111643
- var uid = v4$1();
111642
+ var uid = v4Exports.v4();
111644
111643
  options.uid = uid;
111645
111644
  dispatch({
111646
111645
  type: "SOUTH_REGION_OPENED",
@@ -112442,7 +112441,7 @@ var config = {
112442
112441
  };
112443
112442
 
112444
112443
  var name = "@corpsmap/corpsmap";
112445
- var version = "3.2.77";
112444
+ var version = "3.2.78";
112446
112445
  var description = "CorpsMap as React Components";
112447
112446
  var main = "index.js";
112448
112447
  var scripts = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.2.77",
3
+ "version": "3.2.78",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  import { getLayer } from "../openlayers-utils/layer-utilities";
2
- import v4 from "uuid/v4";
2
+ import { v4 } from "uuid/v4";
3
3
  import { createSelector } from "redux-bundler";
4
4
  import scaleToMapZoom from "../utils/scale-to-zoom-level";
5
5
 
@@ -109,7 +109,7 @@ export default {
109
109
  favoriteLayers: [],
110
110
  userDefaultLayers: [],
111
111
  overrideSortLayerOrder: false,
112
- sortOrderStatus: false
112
+ sortOrderStatus: false,
113
113
  };
114
114
 
115
115
  return (state = initialData, { type, payload }) => {
@@ -133,7 +133,7 @@ export default {
133
133
  resetNeeded: false,
134
134
  });
135
135
  }
136
-
136
+
137
137
  if (type === "LAYERS_ORDER_OVERRIDE_SORT_ORDER") {
138
138
  return Object.assign({}, state, payload);
139
139
  }
@@ -196,21 +196,24 @@ export default {
196
196
  Object.keys(layers).forEach((uid) => {
197
197
  const lyr = layers[uid];
198
198
  lyr.passFilter = false;
199
- const hasString = lyr.displayName.toUpperCase().indexOf(filterString.toUpperCase()) !== -1;
200
-
199
+ const hasString =
200
+ lyr.displayName.toUpperCase().indexOf(filterString.toUpperCase()) !==
201
+ -1;
201
202
 
202
203
  if (lyr.groupTag && lyr.groupTag.length > 0) {
203
204
  lyr.groupTag.forEach((tag) => {
204
- const hasTag = tag && tag.toUpperCase().indexOf(filterString.toUpperCase()) !== -1;
205
+ const hasTag =
206
+ tag &&
207
+ tag.toUpperCase().indexOf(filterString.toUpperCase()) !== -1;
205
208
  if (hasTag) {
206
209
  lyr.passFilter = true;
207
- }
208
- })
209
- }
210
+ }
211
+ });
212
+ }
210
213
 
211
214
  if (hasString) {
212
215
  lyr.passFilter = true;
213
- }
216
+ }
214
217
  });
215
218
 
216
219
  Object.keys(layers).forEach((uid) => {
@@ -534,16 +537,15 @@ export default {
534
537
  type: "LAYERS_LIST_UPDATED",
535
538
  payload: Object.assign({}, layers),
536
539
  });
537
-
538
- if(node.visible && node.layerFunction && node.layerParams) {
540
+
541
+ if (node.visible && node.layerFunction && node.layerParams) {
539
542
  const params = node.layerParams;
540
543
  const layerFunction = node.layerFunction;
541
544
  const storeFunction = store[layerFunction];
542
- if(storeFunction) {
545
+ if (storeFunction) {
543
546
  storeFunction(params);
544
547
  }
545
548
  }
546
-
547
549
  },
548
550
 
549
551
  doLayerSetLabels:
@@ -612,10 +614,9 @@ export default {
612
614
  function setOrder(node) {
613
615
  let sortOrder = o--;
614
616
  if (node.mapLayer) {
615
- if(overrideSortOrder) {
617
+ if (overrideSortOrder) {
616
618
  node.mapLayer.setZIndex(node.sortOrder);
617
- }
618
- else {
619
+ } else {
619
620
  node.sortOrder = sortOrder;
620
621
  node.mapLayer.setZIndex(sortOrder);
621
622
  }
@@ -704,25 +705,29 @@ export default {
704
705
  payload: Object.assign({}, layers),
705
706
  });
706
707
  },
707
-
708
- doOverrideSortOrder: (setting) => ({ dispatch }) => {
709
- dispatch({
710
- type: "LAYERS_ORDER_OVERRIDE_SORT_ORDER",
711
- payload: {
712
- overrideSortLayerOrder: setting,
713
- },
714
- });
715
- },
716
- doShowLayerSortOrder: (bool) => ({ dispatch }) => {
717
- if(bool){
708
+
709
+ doOverrideSortOrder:
710
+ (setting) =>
711
+ ({ dispatch }) => {
718
712
  dispatch({
719
- type: "SORT_ORDER_NOW_SHOWING",
713
+ type: "LAYERS_ORDER_OVERRIDE_SORT_ORDER",
720
714
  payload: {
721
- sortOrderStatus: true,
715
+ overrideSortLayerOrder: setting,
722
716
  },
723
717
  });
724
- }
725
- },
718
+ },
719
+ doShowLayerSortOrder:
720
+ (bool) =>
721
+ ({ dispatch }) => {
722
+ if (bool) {
723
+ dispatch({
724
+ type: "SORT_ORDER_NOW_SHOWING",
725
+ payload: {
726
+ sortOrderStatus: true,
727
+ },
728
+ });
729
+ }
730
+ },
726
731
  selectSortOrderStatus: (state) => {
727
732
  return state.layers.sortOrderStatus;
728
733
  },
@@ -797,7 +802,7 @@ export default {
797
802
  selectLayerShowFilter: (state) => {
798
803
  return state.layers.showFilter;
799
804
  },
800
-
805
+
801
806
  selectOverrideSortOrder: (state) => {
802
807
  return state.layers.overrideSortLayerOrder;
803
808
  },
@@ -1,51 +1,55 @@
1
- import v4 from 'uuid/v4';
1
+ import { v4 } from "uuid/v4";
2
2
 
3
3
  export default {
4
- name: 'notifications',
4
+ name: "notifications",
5
5
 
6
- getReducer(){
7
- const initialData = {}
6
+ getReducer() {
7
+ const initialData = {};
8
8
 
9
9
  return (state = initialData, { type, payload }) => {
10
- if(payload && payload.notification){
10
+ if (payload && payload.notification) {
11
11
  const uid = v4();
12
12
  payload.notification.uid = uid;
13
13
  return Object.assign({}, state, {
14
- [uid]: payload.notification
15
- })
14
+ [uid]: payload.notification,
15
+ });
16
16
  }
17
17
 
18
- switch(type){
19
- case 'NOTIFICATIONS_FIRED':
20
- case 'NOTIFICATIONS_DISMISSED':
18
+ switch (type) {
19
+ case "NOTIFICATIONS_FIRED":
20
+ case "NOTIFICATIONS_DISMISSED":
21
21
  return Object.assign({}, state, payload);
22
22
  default:
23
23
  return state;
24
24
  }
25
- }
25
+ };
26
26
  },
27
27
 
28
- doNotificationsFire: (options) => ({ dispatch, store }) => {
29
- const uid = v4();
30
- options.uid = uid;
31
- dispatch({
32
- type: 'NOTIFICATIONS_FIRED',
33
- payload: {
34
- [uid]: options
35
- }
36
- })
37
- },
28
+ doNotificationsFire:
29
+ (options) =>
30
+ ({ dispatch, store }) => {
31
+ const uid = v4();
32
+ options.uid = uid;
33
+ dispatch({
34
+ type: "NOTIFICATIONS_FIRED",
35
+ payload: {
36
+ [uid]: options,
37
+ },
38
+ });
39
+ },
38
40
 
39
- doNotificationsDismiss: (uid) => ({ dispatch, store }) => {
40
- const state = store.selectNotifications();
41
- delete state[uid];
42
- dispatch({
43
- type: 'NOTIFICATIONS_DISMISSED',
44
- payload: state
45
- })
46
- },
41
+ doNotificationsDismiss:
42
+ (uid) =>
43
+ ({ dispatch, store }) => {
44
+ const state = store.selectNotifications();
45
+ delete state[uid];
46
+ dispatch({
47
+ type: "NOTIFICATIONS_DISMISSED",
48
+ payload: state,
49
+ });
50
+ },
47
51
 
48
52
  selectNotifications: (state) => {
49
53
  return state.notifications;
50
- }
51
- }
54
+ },
55
+ };
@@ -1,4 +1,4 @@
1
- import v4 from "uuid/v4";
1
+ import { v4 } from "uuid/v4";
2
2
  import { createSelector } from "redux-bundler";
3
3
 
4
4
  export default {
@@ -23,51 +23,59 @@ export default {
23
23
  };
24
24
  },
25
25
 
26
- doSouthRegionOpen: (options) => ({ dispatch, store }) => {
27
- const children = store.selectSouthRegionChildrenObj();
28
- const uid = v4();
29
- options.uid = uid;
30
- dispatch({
31
- type: "SOUTH_REGION_OPENED",
32
- payload: {
33
- children: { ...children, [uid]: options },
34
- },
35
- });
36
- },
37
- doSouthRegionClose: () => ({ dispatch, store }) => {
38
- dispatch({
39
- type: "SOUTH_REGION_CLOSED",
40
- payload: {
41
- children: {},
42
- },
43
- });
44
- },
26
+ doSouthRegionOpen:
27
+ (options) =>
28
+ ({ dispatch, store }) => {
29
+ const children = store.selectSouthRegionChildrenObj();
30
+ const uid = v4();
31
+ options.uid = uid;
32
+ dispatch({
33
+ type: "SOUTH_REGION_OPENED",
34
+ payload: {
35
+ children: { ...children, [uid]: options },
36
+ },
37
+ });
38
+ },
39
+ doSouthRegionClose:
40
+ () =>
41
+ ({ dispatch, store }) => {
42
+ dispatch({
43
+ type: "SOUTH_REGION_CLOSED",
44
+ payload: {
45
+ children: {},
46
+ },
47
+ });
48
+ },
45
49
 
46
- doSouthRegionCloseTab: (uid) => ({ dispatch, store }) => {
47
- const children = store.selectSouthRegionChildrenObj();
48
- delete children[uid];
49
- dispatch({
50
- type: "SOUTH_REGION_TAB_CLOSED",
51
- payload: {
52
- children: { ...children },
53
- _shouldTryToCloseRegion: true,
54
- },
55
- });
56
- },
50
+ doSouthRegionCloseTab:
51
+ (uid) =>
52
+ ({ dispatch, store }) => {
53
+ const children = store.selectSouthRegionChildrenObj();
54
+ delete children[uid];
55
+ dispatch({
56
+ type: "SOUTH_REGION_TAB_CLOSED",
57
+ payload: {
58
+ children: { ...children },
59
+ _shouldTryToCloseRegion: true,
60
+ },
61
+ });
62
+ },
57
63
 
58
- doSouthRegionTryClose: () => ({ dispatch, store }) => {
59
- dispatch({
60
- type: "SOUTH_REGION_TRY_CLOSE",
61
- payload: { _shouldTryToCloseRegion: false },
62
- });
63
- const children = store.selectSouthRegionChildren();
64
- if (!children.length) store.doSouthRegionClose();
65
- },
64
+ doSouthRegionTryClose:
65
+ () =>
66
+ ({ dispatch, store }) => {
67
+ dispatch({
68
+ type: "SOUTH_REGION_TRY_CLOSE",
69
+ payload: { _shouldTryToCloseRegion: false },
70
+ });
71
+ const children = store.selectSouthRegionChildren();
72
+ if (!children.length) store.doSouthRegionClose();
73
+ },
66
74
 
67
75
  selectSouthRegionChildrenObj: (state) => {
68
76
  return state.southRegion.children;
69
77
  },
70
-
78
+
71
79
  selectSouthRegionChildren: createSelector(
72
80
  "selectSouthRegionChildrenObj",
73
81
  (children) => {
@@ -84,5 +92,4 @@ export default {
84
92
  if (state.southRegion._shouldTryToCloseRegion)
85
93
  return { actionCreator: "doSouthRegionTryClose" };
86
94
  },
87
-
88
95
  };
@@ -1,290 +1,349 @@
1
- import v4 from 'uuid/v4';
1
+ import { v4 } from "uuid/v4";
2
2
 
3
3
  export default {
4
- name: 'ui',
5
-
4
+ name: "ui",
5
+
6
6
  getReducer: () => {
7
7
  const initialData = {
8
- northConfig:{
9
- height: window.innerHeight
8
+ northConfig: {
9
+ height: window.innerHeight,
10
10
  },
11
- southConfig:{
11
+ southConfig: {
12
12
  height: 0,
13
- children: []
13
+ children: [],
14
14
  },
15
- primaryPanelConfig:{
15
+ primaryPanelConfig: {
16
16
  openedBy: null,
17
17
  width: 420,
18
18
  children: [],
19
- options: null
19
+ options: null,
20
20
  },
21
- secondaryPanelConfig:{
21
+ secondaryPanelConfig: {
22
22
  open: false,
23
23
  width: 300,
24
24
  children: [],
25
- options: null
25
+ options: null,
26
26
  },
27
- modalConfig:{
27
+ modalConfig: {
28
28
  children: [],
29
29
  options: null,
30
- openedBy: null
30
+ openedBy: null,
31
31
  },
32
- basicToolbarConfig:{
33
- activeTool: null
32
+ basicToolbarConfig: {
33
+ activeTool: null,
34
34
  },
35
- theme: 'bg-blue-chambray',
36
- shouldUpdateWindowSize: false
37
- }
35
+ theme: "bg-blue-chambray",
36
+ shouldUpdateWindowSize: false,
37
+ };
38
38
 
39
39
  return (state = initialData, { type, payload }) => {
40
-
41
- if(type === 'WINDOW_RESIZE'){
42
- return Object.assign({}, state, {
43
- shouldUpdateWindowSize: true
40
+ if (type === "WINDOW_RESIZE") {
41
+ return Object.assign({}, state, {
42
+ shouldUpdateWindowSize: true,
44
43
  });
45
44
  }
46
45
 
47
- if(type.indexOf('UI_UPDATE_WINDOW_SIZE_') !== -1){
46
+ if (type.indexOf("UI_UPDATE_WINDOW_SIZE_") !== -1) {
48
47
  return Object.assign({}, state, payload);
49
48
  }
50
49
 
51
- if(type === 'UI_RESIZED_NORTH_SOUTH'){
50
+ if (type === "UI_RESIZED_NORTH_SOUTH") {
52
51
  const northConfig = {
53
- height: payload.hNorth
54
- }
52
+ height: payload.hNorth,
53
+ };
55
54
  const southConfig = {
56
55
  height: payload.hSouth,
57
56
  children: state.southConfig.children,
58
- options: state.southConfig.options
59
- }
57
+ options: state.southConfig.options,
58
+ };
60
59
  return Object.assign({}, state, {
61
60
  northConfig: northConfig,
62
- southConfig: southConfig
63
- })
61
+ southConfig: southConfig,
62
+ });
64
63
  }
65
64
 
66
- if(type === 'UI_OPENED_SOUTH_PANEL'){
65
+ if (type === "UI_OPENED_SOUTH_PANEL") {
67
66
  const northConfig = {
68
- height: window.innerHeight / 2
69
- }
67
+ height: window.innerHeight / 2,
68
+ };
70
69
  const southConfig = {
71
70
  height: window.innerHeight / 2,
72
- children: payload.children
73
- }
71
+ children: payload.children,
72
+ };
74
73
  return Object.assign({}, state, {
75
74
  northConfig: northConfig,
76
- southConfig: southConfig
77
- })
75
+ southConfig: southConfig,
76
+ });
78
77
  }
79
78
 
80
- if(type === 'UI_CLOSED_SOUTH_PANEL'){
79
+ if (type === "UI_CLOSED_SOUTH_PANEL") {
81
80
  const northConfig = {
82
- height: window.innerHeight
83
- }
81
+ height: window.innerHeight,
82
+ };
84
83
  const southConfig = {
85
84
  height: 0,
86
- children: []
87
- }
85
+ children: [],
86
+ };
88
87
  return Object.assign({}, state, {
89
88
  northConfig: northConfig,
90
- southConfig: southConfig
91
- })
89
+ southConfig: southConfig,
90
+ });
92
91
  }
93
92
 
94
- if(type === 'UI_CLOSED_SOUTH_TAB'){
93
+ if (type === "UI_CLOSED_SOUTH_TAB") {
95
94
  const southConfig = {
96
- children: payload.children
97
- }
95
+ children: payload.children,
96
+ };
98
97
  return Object.assign({}, state, {
99
- southConfig: southConfig
100
- })
98
+ southConfig: southConfig,
99
+ });
101
100
  }
102
101
 
103
- if(type === 'UI_OPENED_MODAL_WINDOW'){
102
+ if (type === "UI_OPENED_MODAL_WINDOW") {
104
103
  const modalConfig = {
105
104
  children: payload.children,
106
105
  options: payload.options,
107
- openedBy: payload.openedBy
108
- }
106
+ openedBy: payload.openedBy,
107
+ };
109
108
  return Object.assign({}, state, {
110
- modalConfig: modalConfig
111
- })
109
+ modalConfig: modalConfig,
110
+ });
112
111
  }
113
112
 
114
- if(type === 'UI_CLOSED_MODAL_WINDOW'){
113
+ if (type === "UI_CLOSED_MODAL_WINDOW") {
115
114
  const modalConfig = {
116
115
  children: [],
117
116
  options: null,
118
- openedBy: null
119
- }
117
+ openedBy: null,
118
+ };
120
119
  return Object.assign({}, state, {
121
- modalConfig: modalConfig
122
- })
120
+ modalConfig: modalConfig,
121
+ });
123
122
  }
124
123
 
125
- if(type === 'UI_OPENED_PRIMARY_PANEL'){
124
+ if (type === "UI_OPENED_PRIMARY_PANEL") {
126
125
  const primaryPanelConfig = {
127
126
  openedBy: payload.openedBy,
128
127
  width: state.primaryPanelConfig.width,
129
128
  children: payload.children,
130
- options: payload.options
131
- }
129
+ options: payload.options,
130
+ };
132
131
  return Object.assign({}, state, {
133
- primaryPanelConfig: primaryPanelConfig
134
- })
132
+ primaryPanelConfig: primaryPanelConfig,
133
+ });
135
134
  }
136
135
 
137
- if(type === 'UI_CLOSED_PRIMARY_PANEL'){
136
+ if (type === "UI_CLOSED_PRIMARY_PANEL") {
138
137
  const primaryPanelConfig = {
139
138
  openedBy: null,
140
139
  width: state.primaryPanelConfig.width,
141
140
  left: state.primaryPanelConfig.left,
142
141
  children: [],
143
- options: null
144
- }
142
+ options: null,
143
+ };
145
144
  return Object.assign({}, state, {
146
- primaryPanelConfig: primaryPanelConfig
147
- })
145
+ primaryPanelConfig: primaryPanelConfig,
146
+ });
148
147
  }
149
148
 
150
- if(type === 'UI_RESIZED_PRIMARY_PANEL'){
149
+ if (type === "UI_RESIZED_PRIMARY_PANEL") {
151
150
  const primaryPanelConfig = {
152
151
  open: state.primaryPanelConfig.open,
153
152
  width: payload.width,
154
153
  left: state.primaryPanelConfig.left,
155
154
  children: state.primaryPanelConfig.children,
156
155
  options: state.primaryPanelConfig.options,
157
- openedBy: state.primaryPanelConfig.openedBy
158
- }
156
+ openedBy: state.primaryPanelConfig.openedBy,
157
+ };
159
158
  const secondaryPanelConfig = {
160
159
  open: state.secondaryPanelConfig.open,
161
160
  width: state.secondaryPanelConfig.width,
162
161
  left: payload.width,
163
162
  children: state.secondaryPanelConfig.children,
164
163
  options: state.secondaryPanelConfig.options,
165
- openedBy: state.secondaryPanelConfig.openedBy
166
- }
164
+ openedBy: state.secondaryPanelConfig.openedBy,
165
+ };
167
166
  return Object.assign({}, state, {
168
167
  primaryPanelConfig: primaryPanelConfig,
169
- secondaryPanelConfig: secondaryPanelConfig
170
- })
168
+ secondaryPanelConfig: secondaryPanelConfig,
169
+ });
171
170
  }
172
171
 
173
- if(type === 'UI_ACTIVATE_BASIC_TOOL'){
172
+ if (type === "UI_ACTIVATE_BASIC_TOOL") {
174
173
  const basicToolbarConfig = {
175
- activeTool: payload
176
- }
174
+ activeTool: payload,
175
+ };
177
176
  return Object.assign({}, state, {
178
- basicToolbarConfig: basicToolbarConfig
179
- })
177
+ basicToolbarConfig: basicToolbarConfig,
178
+ });
180
179
  }
181
180
 
182
- if(type === 'UI_DEACTIVATE_BASIC_TOOL'){
181
+ if (type === "UI_DEACTIVATE_BASIC_TOOL") {
183
182
  const basicToolbarConfig = {
184
- activeTool: null
185
- }
183
+ activeTool: null,
184
+ };
186
185
  return Object.assign({}, state, {
187
- basicToolbarConfig: basicToolbarConfig
188
- })
186
+ basicToolbarConfig: basicToolbarConfig,
187
+ });
189
188
  }
190
189
 
191
- if(type === 'UI_THEME_CHANGED'){
190
+ if (type === "UI_THEME_CHANGED") {
192
191
  return Object.assign({}, state, {
193
- theme: payload
194
- })
192
+ theme: payload,
193
+ });
195
194
  }
196
195
 
197
196
  return state;
198
- }
197
+ };
199
198
  },
200
199
 
201
200
  // ACTION CREATORS
202
- doUiUpdateWindowSize: () => ({ dispatch, store }) => {
203
- dispatch({ type: 'UI_UPDATE_WINDOW_SIZE_START', payload: { shouldUpdateWindowSize: false }});
204
- const h = store.selectViewportHeight();
205
- const northConfig = store.selectNorthConfig();
206
- const southConfig = store.selectSouthConfig();
207
- const northPortion = northConfig.height / (northConfig.height + southConfig.height);
208
- const southPortion = southConfig.height / (northConfig.height + southConfig.height);
209
- const newPayload = {
210
- northConfig: Object.assign({}, northConfig, { height: h * northPortion }),
211
- southConfig: Object.assign({}, southConfig, { height: h * southPortion })
212
- }
213
- dispatch({ type: 'UI_UPDATE_WINDOW_SIZE_COMPLETE', payload: newPayload});
214
- store.doMapUpdateSize();
215
- },
216
-
217
- doMapUpdateSize: () => ({ dispatch, store }) => {
218
- const map = store.selectMap();
219
- window.setTimeout(() => { map.updateSize(); }, 100);
220
- },
221
-
222
- doSouthRegionOpen: ({ component, options, openedBy, displayName }) => ({ dispatch, store }) => {
223
- const existingChildren = store.selectSouthRegionChildren();
224
- const uid = v4();
225
- dispatch({type:'UI_OPENED_SOUTH_PANEL', payload:{
226
- children: existingChildren.concat([{ component, options, openedBy, displayName, uid }])
227
- }});
228
- store.doMapUpdateSize();
229
- },
230
-
231
- doCloseSouthTab: (child) => ({ dispatch, store }) => {
232
- const children = store.selectSouthRegionChildren().slice();
233
- const idx = children.indexOf(child);
234
- children.splice(idx, 1);
235
- dispatch({type:'UI_CLOSED_SOUTH_TAB', payload: { children: children }});
236
- if(children.length === 0) return store.doCloseSouthRegion();
237
- },
238
-
239
- doCloseSouthRegion: () => ({ dispatch, store }) => {
240
- dispatch({type:'UI_CLOSED_SOUTH_PANEL'});
241
- store.doMapUpdateSize();
242
- },
243
-
244
- doModalOpen: ({ children, options, openedBy }) => ({ dispatch }) => {
245
- dispatch({type:'UI_OPENED_MODAL_WINDOW', payload: {children, options, openedBy }});
246
- },
247
-
248
- doModalClose: () => ({ dispatch }) => {
249
- dispatch({type:'UI_CLOSED_MODAL_WINDOW'});
250
- },
251
-
252
- doPrimaryPanelOpen: ({ children, options, openedBy }) => ({ dispatch }) => {
253
- dispatch({type:'UI_OPENED_PRIMARY_PANEL', payload:{ children, options, openedBy }});
254
- },
255
-
256
- doPrimaryPanelClose: () => ({ dispatch }) => {
257
- dispatch({type:'UI_CLOSED_PRIMARY_PANEL'});
258
- },
259
-
260
- doOpenSecondaryPanel: ({ children, options, openedBy }) => ({ dispatch }) => {
261
- dispatch({type:'UI_OPENED_SECONDARY_PANEL', payload:{ children, options, openedBy }});
262
- },
263
-
264
- doCloseSecondaryPanel: () => ({ dispatch }) => {
265
- dispatch({type:'UI_CLOSED_SECONDARY_PANEL'});
266
- },
267
-
268
- doSetTheme: (newTheme) => ({ dispatch }) => {
269
- dispatch({type:'UI_THEME_CHANGED', payload: newTheme});
270
- },
271
-
272
- doResizeSouthRegion: ({ hNorth, hSouth }) => ({ dispatch, store }) => {
273
- dispatch({type:'UI_RESIZED_NORTH_SOUTH', payload:{ hNorth, hSouth }});
274
- store.doMapUpdateSize()
275
- },
276
-
277
- doPrimaryPanelResize: ({ width }) => ({ dispatch }) => {
278
- dispatch({type:'UI_RESIZED_PRIMARY_PANEL', payload:{ width }});
279
- },
280
-
281
- doBasicToolbarActivate: ({ activeTool }) => ({ dispatch }) => {
282
- dispatch({type:'UI_ACTIVATE_BASIC_TOOL', payload: activeTool });
283
- },
284
-
285
- doBasicToolbarDeactivate: () => ({ dispatch }) => {
286
- dispatch({type:'UI_DEACTIVATE_BASIC_TOOL'});
287
- },
201
+ doUiUpdateWindowSize:
202
+ () =>
203
+ ({ dispatch, store }) => {
204
+ dispatch({
205
+ type: "UI_UPDATE_WINDOW_SIZE_START",
206
+ payload: { shouldUpdateWindowSize: false },
207
+ });
208
+ const h = store.selectViewportHeight();
209
+ const northConfig = store.selectNorthConfig();
210
+ const southConfig = store.selectSouthConfig();
211
+ const northPortion =
212
+ northConfig.height / (northConfig.height + southConfig.height);
213
+ const southPortion =
214
+ southConfig.height / (northConfig.height + southConfig.height);
215
+ const newPayload = {
216
+ northConfig: Object.assign({}, northConfig, {
217
+ height: h * northPortion,
218
+ }),
219
+ southConfig: Object.assign({}, southConfig, {
220
+ height: h * southPortion,
221
+ }),
222
+ };
223
+ dispatch({ type: "UI_UPDATE_WINDOW_SIZE_COMPLETE", payload: newPayload });
224
+ store.doMapUpdateSize();
225
+ },
226
+
227
+ doMapUpdateSize:
228
+ () =>
229
+ ({ dispatch, store }) => {
230
+ const map = store.selectMap();
231
+ window.setTimeout(() => {
232
+ map.updateSize();
233
+ }, 100);
234
+ },
235
+
236
+ doSouthRegionOpen:
237
+ ({ component, options, openedBy, displayName }) =>
238
+ ({ dispatch, store }) => {
239
+ const existingChildren = store.selectSouthRegionChildren();
240
+ const uid = v4();
241
+ dispatch({
242
+ type: "UI_OPENED_SOUTH_PANEL",
243
+ payload: {
244
+ children: existingChildren.concat([
245
+ { component, options, openedBy, displayName, uid },
246
+ ]),
247
+ },
248
+ });
249
+ store.doMapUpdateSize();
250
+ },
251
+
252
+ doCloseSouthTab:
253
+ (child) =>
254
+ ({ dispatch, store }) => {
255
+ const children = store.selectSouthRegionChildren().slice();
256
+ const idx = children.indexOf(child);
257
+ children.splice(idx, 1);
258
+ dispatch({
259
+ type: "UI_CLOSED_SOUTH_TAB",
260
+ payload: { children: children },
261
+ });
262
+ if (children.length === 0) return store.doCloseSouthRegion();
263
+ },
264
+
265
+ doCloseSouthRegion:
266
+ () =>
267
+ ({ dispatch, store }) => {
268
+ dispatch({ type: "UI_CLOSED_SOUTH_PANEL" });
269
+ store.doMapUpdateSize();
270
+ },
271
+
272
+ doModalOpen:
273
+ ({ children, options, openedBy }) =>
274
+ ({ dispatch }) => {
275
+ dispatch({
276
+ type: "UI_OPENED_MODAL_WINDOW",
277
+ payload: { children, options, openedBy },
278
+ });
279
+ },
280
+
281
+ doModalClose:
282
+ () =>
283
+ ({ dispatch }) => {
284
+ dispatch({ type: "UI_CLOSED_MODAL_WINDOW" });
285
+ },
286
+
287
+ doPrimaryPanelOpen:
288
+ ({ children, options, openedBy }) =>
289
+ ({ dispatch }) => {
290
+ dispatch({
291
+ type: "UI_OPENED_PRIMARY_PANEL",
292
+ payload: { children, options, openedBy },
293
+ });
294
+ },
295
+
296
+ doPrimaryPanelClose:
297
+ () =>
298
+ ({ dispatch }) => {
299
+ dispatch({ type: "UI_CLOSED_PRIMARY_PANEL" });
300
+ },
301
+
302
+ doOpenSecondaryPanel:
303
+ ({ children, options, openedBy }) =>
304
+ ({ dispatch }) => {
305
+ dispatch({
306
+ type: "UI_OPENED_SECONDARY_PANEL",
307
+ payload: { children, options, openedBy },
308
+ });
309
+ },
310
+
311
+ doCloseSecondaryPanel:
312
+ () =>
313
+ ({ dispatch }) => {
314
+ dispatch({ type: "UI_CLOSED_SECONDARY_PANEL" });
315
+ },
316
+
317
+ doSetTheme:
318
+ (newTheme) =>
319
+ ({ dispatch }) => {
320
+ dispatch({ type: "UI_THEME_CHANGED", payload: newTheme });
321
+ },
322
+
323
+ doResizeSouthRegion:
324
+ ({ hNorth, hSouth }) =>
325
+ ({ dispatch, store }) => {
326
+ dispatch({ type: "UI_RESIZED_NORTH_SOUTH", payload: { hNorth, hSouth } });
327
+ store.doMapUpdateSize();
328
+ },
329
+
330
+ doPrimaryPanelResize:
331
+ ({ width }) =>
332
+ ({ dispatch }) => {
333
+ dispatch({ type: "UI_RESIZED_PRIMARY_PANEL", payload: { width } });
334
+ },
335
+
336
+ doBasicToolbarActivate:
337
+ ({ activeTool }) =>
338
+ ({ dispatch }) => {
339
+ dispatch({ type: "UI_ACTIVATE_BASIC_TOOL", payload: activeTool });
340
+ },
341
+
342
+ doBasicToolbarDeactivate:
343
+ () =>
344
+ ({ dispatch }) => {
345
+ dispatch({ type: "UI_DEACTIVATE_BASIC_TOOL" });
346
+ },
288
347
 
289
348
  // SELECTORS
290
349
  selectNorthConfig: (state) => {
@@ -340,6 +399,7 @@ export default {
340
399
  },
341
400
 
342
401
  reactShouldUpdateWindowSize: (state) => {
343
- if(state.ui.shouldUpdateWindowSize) return { actionCreator: 'doUiUpdateWindowSize' };
344
- }
345
- }
402
+ if (state.ui.shouldUpdateWindowSize)
403
+ return { actionCreator: "doUiUpdateWindowSize" };
404
+ },
405
+ };