@complat/react-spectra-editor 1.0.0-rc2 → 1.0.0-rc20.patch-1

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 (202) hide show
  1. package/README.md +16 -0
  2. package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
  3. package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
  4. package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
  5. package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
  6. package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
  7. package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
  8. package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
  9. package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
  10. package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
  11. package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
  12. package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
  13. package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
  14. package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
  15. package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
  16. package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
  17. package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
  18. package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
  19. package/dist/__tests__/fixtures/ir_result.js +46 -0
  20. package/dist/__tests__/fixtures/ir_svg.js +8 -0
  21. package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
  22. package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
  23. package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
  24. package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
  25. package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
  26. package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
  27. package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
  28. package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
  29. package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
  30. package/dist/__tests__/fixtures/nmr_result.js +68 -0
  31. package/dist/__tests__/fixtures/nmr_svg.js +8 -0
  32. package/dist/__tests__/fixtures/phenylalanin.js +142 -0
  33. package/dist/__tests__/fixtures/qDescValue.js +65 -0
  34. package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
  35. package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
  36. package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
  37. package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
  38. package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
  39. package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
  40. package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
  41. package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
  42. package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
  43. package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
  44. package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
  45. package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
  46. package/dist/actions/curve.js +15 -14
  47. package/dist/actions/cyclic_voltammetry.js +40 -60
  48. package/dist/actions/edit_peak.js +8 -12
  49. package/dist/actions/forecast.js +16 -24
  50. package/dist/actions/integration.js +12 -18
  51. package/dist/actions/jcamp.js +16 -24
  52. package/dist/actions/layout.js +4 -6
  53. package/dist/actions/manager.js +20 -30
  54. package/dist/actions/meta.js +4 -6
  55. package/dist/actions/multiplicity.js +24 -36
  56. package/dist/actions/scan.js +12 -18
  57. package/dist/actions/shift.js +8 -12
  58. package/dist/actions/status.js +12 -18
  59. package/dist/actions/submit.js +16 -24
  60. package/dist/actions/threshold.js +20 -30
  61. package/dist/actions/ui.js +25 -31
  62. package/dist/actions/wavelength.js +4 -6
  63. package/dist/app.js +25 -23
  64. package/dist/components/cmd_bar/01_viewer.js +24 -34
  65. package/dist/components/cmd_bar/02_zoom.js +18 -28
  66. package/dist/components/cmd_bar/03_peak.js +50 -66
  67. package/dist/components/cmd_bar/04_integration.js +70 -84
  68. package/dist/components/cmd_bar/05_multiplicity.js +42 -56
  69. package/dist/components/cmd_bar/06_undo_redo.js +22 -36
  70. package/dist/components/cmd_bar/07_pecker.js +24 -34
  71. package/dist/components/cmd_bar/common.js +11 -7
  72. package/dist/components/cmd_bar/index.js +17 -23
  73. package/dist/components/cmd_bar/r01_layout.js +79 -56
  74. package/dist/components/cmd_bar/r02_scan.js +70 -87
  75. package/dist/components/cmd_bar/r03_threshold.js +54 -68
  76. package/dist/components/cmd_bar/r04_submit.js +71 -83
  77. package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
  78. package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
  79. package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
  80. package/dist/components/cmd_bar/tri_btn.js +91 -113
  81. package/dist/components/common/chem.js +2 -3
  82. package/dist/components/common/comps.js +2 -2
  83. package/dist/components/common/draw.js +30 -11
  84. package/dist/components/d3_line/index.js +154 -176
  85. package/dist/components/d3_line/line_focus.js +595 -739
  86. package/dist/components/d3_multi/index.js +153 -174
  87. package/dist/components/d3_multi/multi_focus.js +725 -850
  88. package/dist/components/d3_rect/index.js +112 -134
  89. package/dist/components/d3_rect/rect_focus.js +163 -208
  90. package/dist/components/forecast/comps.js +60 -68
  91. package/dist/components/forecast/ir_comps.js +49 -56
  92. package/dist/components/forecast/ir_viewer.js +61 -68
  93. package/dist/components/forecast/nmr_comps.js +62 -72
  94. package/dist/components/forecast/nmr_viewer.js +59 -68
  95. package/dist/components/forecast/section_loading.js +39 -63
  96. package/dist/components/forecast_viewer.js +109 -119
  97. package/dist/components/multi_jcamps_viewer.js +97 -113
  98. package/dist/components/panel/compare.js +183 -192
  99. package/dist/components/panel/cyclic_voltamery_data.js +149 -165
  100. package/dist/components/panel/graph_selection.js +143 -132
  101. package/dist/components/panel/index.js +112 -144
  102. package/dist/components/panel/info.js +125 -132
  103. package/dist/components/panel/multiplicity.js +215 -223
  104. package/dist/components/panel/multiplicity_coupling.js +108 -136
  105. package/dist/components/panel/multiplicity_select.js +43 -51
  106. package/dist/components/panel/peaks.js +130 -132
  107. package/dist/constants/action_type.js +23 -39
  108. package/dist/constants/list_layout.js +7 -4
  109. package/dist/constants/list_shift.js +117 -103
  110. package/dist/constants/list_ui.js +3 -6
  111. package/dist/constants/list_wavelength.js +7 -8
  112. package/dist/fn.js +2 -3
  113. package/dist/helpers/brush.js +49 -65
  114. package/dist/helpers/calc.js +2 -4
  115. package/dist/helpers/carbonFeatures.js +22 -20
  116. package/dist/helpers/cfg.js +49 -67
  117. package/dist/helpers/chem.js +450 -393
  118. package/dist/helpers/compass.js +92 -83
  119. package/dist/helpers/converter.js +52 -65
  120. package/dist/helpers/extractParams.js +60 -52
  121. package/dist/helpers/extractPeaksEdit.js +29 -25
  122. package/dist/helpers/focus.js +2 -6
  123. package/dist/helpers/format.js +416 -361
  124. package/dist/helpers/init.js +41 -37
  125. package/dist/helpers/integration.js +18 -21
  126. package/dist/helpers/mount.js +57 -61
  127. package/dist/helpers/multiplicity.js +19 -24
  128. package/dist/helpers/multiplicity_calc.js +39 -50
  129. package/dist/helpers/multiplicity_complat.js +21 -47
  130. package/dist/helpers/multiplicity_manual.js +49 -55
  131. package/dist/helpers/multiplicity_verify_basic.js +108 -111
  132. package/dist/helpers/shift.js +15 -23
  133. package/dist/helpers/zoom.js +7 -11
  134. package/dist/index.js +680 -630
  135. package/dist/layer_content.js +40 -43
  136. package/dist/layer_init.js +162 -184
  137. package/dist/layer_prism.js +38 -41
  138. package/dist/reducers/index.js +2 -3
  139. package/dist/reducers/reducer_curve.js +35 -26
  140. package/dist/reducers/reducer_edit_peak.js +122 -98
  141. package/dist/reducers/reducer_forecast.js +57 -44
  142. package/dist/reducers/reducer_integration.js +135 -103
  143. package/dist/reducers/reducer_jcamp.js +49 -44
  144. package/dist/reducers/reducer_layout.js +5 -6
  145. package/dist/reducers/reducer_manager.js +5 -6
  146. package/dist/reducers/reducer_meta.js +5 -6
  147. package/dist/reducers/reducer_multiplicity.js +100 -77
  148. package/dist/reducers/reducer_scan.js +17 -20
  149. package/dist/reducers/reducer_shift.js +115 -70
  150. package/dist/reducers/reducer_simulation.js +7 -8
  151. package/dist/reducers/reducer_status.js +5 -6
  152. package/dist/reducers/reducer_submit.js +12 -15
  153. package/dist/reducers/reducer_threshold.js +5 -6
  154. package/dist/reducers/reducer_ui.js +5 -6
  155. package/dist/reducers/reducer_voltammetry.js +156 -96
  156. package/dist/reducers/reducer_wavelength.js +5 -6
  157. package/dist/reducers/undo_redo_config.js +3 -5
  158. package/dist/sagas/index.js +2 -15
  159. package/dist/sagas/saga_edit_peak.js +54 -68
  160. package/dist/sagas/saga_manager.js +86 -130
  161. package/dist/sagas/saga_meta.js +25 -31
  162. package/dist/sagas/saga_multi_entities.js +40 -103
  163. package/dist/sagas/saga_multiplicity.js +336 -406
  164. package/dist/sagas/saga_ui.js +296 -475
  165. package/dist/setupTests.js +8 -0
  166. package/dist/third_party/jAnalyzer.js +66 -67
  167. package/dist/third_party/peakInterval.js +34 -34
  168. package/package.json +14 -14
  169. package/dist/components/cmd_bar/03_peak_bk.js +0 -139
  170. package/dist/components/cmd_bar/04_integration_bk.js +0 -180
  171. package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
  172. package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
  173. package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
  174. package/dist/components/d3_line/line_focus_bk.js +0 -825
  175. package/dist/components/d3_multi/index_bk.js +0 -210
  176. package/dist/components/d3_multi/multi_focus_bk.js +0 -533
  177. package/dist/components/panel/compare_bk.js +0 -256
  178. package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
  179. package/dist/components/panel/index_bk.js +0 -178
  180. package/dist/components/panel/info_bk.js +0 -235
  181. package/dist/components/panel/multiplicity_bk.js +0 -280
  182. package/dist/helpers/carbonFeatures_bk.js +0 -45
  183. package/dist/helpers/cfg_bk.js +0 -80
  184. package/dist/helpers/chem_bk.js +0 -787
  185. package/dist/helpers/compass_bk.js +0 -149
  186. package/dist/helpers/converter_bk.js +0 -96
  187. package/dist/helpers/extractPeaksEdit_bk.js +0 -53
  188. package/dist/helpers/format_bk.js +0 -497
  189. package/dist/index_bk.js +0 -640
  190. package/dist/layer_content_bk.js +0 -105
  191. package/dist/layer_init_bk.js +0 -235
  192. package/dist/layer_prism_bk.js +0 -133
  193. package/dist/reducers/reducer_edit_peak_bk.js +0 -108
  194. package/dist/reducers/reducer_integration_bk.js +0 -134
  195. package/dist/reducers/reducer_jcamp_bk.js +0 -71
  196. package/dist/reducers/reducer_multiplicity_bk.js +0 -126
  197. package/dist/reducers/reducer_shift_bk.js +0 -88
  198. package/dist/reducers/reducer_voltammetry_bk.js +0 -287
  199. package/dist/sagas/saga_edit_peak_bk.js +0 -73
  200. package/dist/sagas/saga_multi_entities_bk.js +0 -106
  201. package/dist/sagas/saga_multiplicity_bk.js +0 -351
  202. package/dist/sagas/saga_ui_bk.js +0 -453
@@ -9,7 +9,7 @@ var _action_type = require("../constants/action_type");
9
9
  var _format = _interopRequireDefault(require("../helpers/format"));
10
10
  /* eslint-disable prefer-object-spread, default-param-last */
11
11
 
12
- var initialState = {
12
+ const initialState = {
13
13
  isAscend: false,
14
14
  isIntensity: true,
15
15
  decimal: 2,
@@ -17,14 +17,12 @@ var initialState = {
17
17
  name: 'empty'
18
18
  }
19
19
  };
20
- var updateOperation = function updateOperation(action) {
21
- return {
22
- operation: action.payload || initialState.operation
23
- };
24
- };
25
- var submitReducer = function submitReducer() {
26
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
27
- var action = arguments.length > 1 ? arguments[1] : undefined;
20
+ const updateOperation = action => ({
21
+ operation: action.payload || initialState.operation
22
+ });
23
+ const submitReducer = function () {
24
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
25
+ let action = arguments.length > 1 ? arguments[1] : undefined;
28
26
  switch (action.type) {
29
27
  case _action_type.SUBMIT.TOGGLE_IS_ASCEND:
30
28
  return Object.assign({}, state, {
@@ -42,16 +40,16 @@ var submitReducer = function submitReducer() {
42
40
  });
43
41
  case _action_type.LAYOUT.UPDATE:
44
42
  {
45
- var decimal = _format.default.spectraDigit(action.payload);
43
+ const decimal = _format.default.spectraDigit(action.payload);
46
44
  return Object.assign({}, state, {
47
- decimal: decimal
45
+ decimal
48
46
  });
49
47
  }
50
48
  case _action_type.MANAGER.RESETALL:
51
49
  {
52
- var _decimal = _format.default.spectraDigit(action.payload.operation.layout);
50
+ const decimal = _format.default.spectraDigit(action.payload.operation.layout);
53
51
  return Object.assign({}, state, {
54
- decimal: _decimal,
52
+ decimal,
55
53
  isIntensity: true,
56
54
  isAscend: false
57
55
  });
@@ -60,5 +58,4 @@ var submitReducer = function submitReducer() {
60
58
  return state;
61
59
  }
62
60
  };
63
- var _default = submitReducer;
64
- exports.default = _default;
61
+ var _default = exports.default = submitReducer;
@@ -7,15 +7,15 @@ exports.default = void 0;
7
7
  var _action_type = require("../constants/action_type");
8
8
  /* eslint-disable prefer-object-spread, default-param-last */
9
9
 
10
- var initialState = {
10
+ const initialState = {
11
11
  isEdit: true,
12
12
  value: false,
13
13
  upper: false,
14
14
  lower: false
15
15
  };
16
- var thresholdReducer = function thresholdReducer() {
17
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
18
- var action = arguments.length > 1 ? arguments[1] : undefined;
16
+ const thresholdReducer = function () {
17
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
18
+ let action = arguments.length > 1 ? arguments[1] : undefined;
19
19
  switch (action.type) {
20
20
  case _action_type.THRESHOLD.UPDATE_VALUE:
21
21
  return Object.assign({}, state, {
@@ -49,5 +49,4 @@ var thresholdReducer = function thresholdReducer() {
49
49
  return state;
50
50
  }
51
51
  };
52
- var _default = thresholdReducer;
53
- exports.default = _default;
52
+ var _default = exports.default = thresholdReducer;
@@ -8,7 +8,7 @@ var _action_type = require("../constants/action_type");
8
8
  var _list_ui = require("../constants/list_ui");
9
9
  /* eslint-disable prefer-object-spread, default-param-last */
10
10
 
11
- var initialState = {
11
+ const initialState = {
12
12
  viewer: _list_ui.LIST_UI_VIEWER_TYPE.SPECTRUM,
13
13
  sweepType: _list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN,
14
14
  sweepExtent: {
@@ -17,9 +17,9 @@ var initialState = {
17
17
  },
18
18
  jcampIdx: 0
19
19
  };
20
- var uiReducer = function uiReducer() {
21
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
22
- var action = arguments.length > 1 ? arguments[1] : undefined;
20
+ const uiReducer = function () {
21
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
22
+ let action = arguments.length > 1 ? arguments[1] : undefined;
23
23
  switch (action.type) {
24
24
  case _action_type.UI.VIEWER.SET_TYPE:
25
25
  return Object.assign({}, state, {
@@ -48,5 +48,4 @@ var uiReducer = function uiReducer() {
48
48
  return state;
49
49
  }
50
50
  };
51
- var _default = uiReducer;
52
- exports.default = _default;
51
+ var _default = exports.default = uiReducer;
@@ -1,40 +1,45 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _action_type = require("../constants/action_type");
10
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /* eslint-disable prefer-object-spread, default-param-last */
12
- var initialState = {
8
+ /* eslint-disable prefer-object-spread, default-param-last */
9
+
10
+ const initialState = {
13
11
  spectraList: []
14
12
  };
15
- var initSpectra = {
13
+ const initSpectra = {
16
14
  list: [],
17
15
  selectedIdx: -1,
18
16
  isWorkMaxPeak: true,
19
17
  jcampIdx: -1
20
18
  };
21
- var addPairPeak = function addPairPeak(state, action) {
22
- var payload = action.payload;
23
- var spectraList = state.spectraList;
19
+ const addPairPeak = (state, action) => {
20
+ const {
21
+ payload
22
+ } = action;
23
+ const {
24
+ spectraList
25
+ } = state;
24
26
  if (payload !== undefined) {
25
- var spectra = spectraList[payload];
27
+ let spectra = spectraList[payload];
26
28
  if (!spectra) {
27
29
  spectra = initSpectra;
28
30
  spectraList.push(spectra);
29
31
  }
30
- var _spectra = spectra,
31
- list = _spectra.list,
32
- selectedIdx = _spectra.selectedIdx;
33
- var index = selectedIdx;
32
+ const {
33
+ list,
34
+ selectedIdx
35
+ } = spectra;
36
+ let index = selectedIdx;
34
37
  index += 1;
35
- var newList = list.map(function (item) {
38
+ const newList = list.map(item => {
36
39
  // eslint-disable-line
37
- return _objectSpread({}, item);
40
+ return {
41
+ ...item
42
+ };
38
43
  });
39
44
  newList.push({
40
45
  min: null,
@@ -45,48 +50,66 @@ var addPairPeak = function addPairPeak(state, action) {
45
50
  selectedIdx: index
46
51
  });
47
52
  return Object.assign({}, state, {
48
- spectraList: spectraList
53
+ spectraList
49
54
  });
50
55
  }
51
56
  return state;
52
57
  };
53
- var removePairPeak = function removePairPeak(state, action) {
54
- var payload = action.payload;
55
- var spectraList = state.spectraList;
58
+ const removePairPeak = (state, action) => {
59
+ const {
60
+ payload
61
+ } = action;
62
+ const {
63
+ spectraList
64
+ } = state;
56
65
  if (payload !== undefined) {
57
- var index = payload.index,
58
- jcampIdx = payload.jcampIdx;
59
- var spectra = spectraList[jcampIdx];
66
+ const {
67
+ index,
68
+ jcampIdx
69
+ } = payload;
70
+ const spectra = spectraList[jcampIdx];
60
71
  if (spectra) {
61
- var list = spectra.list;
72
+ const {
73
+ list
74
+ } = spectra;
62
75
  list.splice(index, 1);
63
76
  spectraList[jcampIdx] = Object.assign({}, spectra, {
64
- list: list,
77
+ list,
65
78
  selectedIdx: index
66
79
  });
67
80
  return Object.assign({}, state, {
68
- spectraList: spectraList
81
+ spectraList
69
82
  });
70
83
  }
71
84
  return state;
72
85
  }
73
86
  return state;
74
87
  };
75
- var addPeak = function addPeak(state, action) {
76
- var isMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
77
- var payload = action.payload;
78
- var spectraList = state.spectraList;
88
+ const addPeak = function (state, action) {
89
+ let isMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
90
+ const {
91
+ payload
92
+ } = action;
93
+ const {
94
+ spectraList
95
+ } = state;
79
96
  if (payload) {
80
- var peak = payload.peak,
81
- index = payload.index,
82
- jcampIdx = payload.jcampIdx;
83
- var spectra = spectraList[jcampIdx];
84
- var list = spectra.list;
85
- var newList = list.map(function (item) {
97
+ const {
98
+ peak,
99
+ index,
100
+ jcampIdx
101
+ } = payload;
102
+ const spectra = spectraList[jcampIdx];
103
+ const {
104
+ list
105
+ } = spectra;
106
+ const newList = list.map(item => {
86
107
  // eslint-disable-line
87
- return _objectSpread({}, item);
108
+ return {
109
+ ...item
110
+ };
88
111
  });
89
- var pairPeak = newList[index];
112
+ let pairPeak = newList[index];
90
113
  if (isMax) {
91
114
  pairPeak = Object.assign({}, pairPeak, {
92
115
  max: peak
@@ -100,25 +123,33 @@ var addPeak = function addPeak(state, action) {
100
123
  spectraList[jcampIdx] = Object.assign({}, spectra, {
101
124
  list: newList,
102
125
  selectedIdx: index,
103
- jcampIdx: jcampIdx
126
+ jcampIdx
104
127
  });
105
128
  return Object.assign({}, state, {
106
- spectraList: spectraList
129
+ spectraList
107
130
  });
108
131
  }
109
132
  return state;
110
133
  };
111
- var removePeak = function removePeak(state, action) {
112
- var isMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
113
- var payload = action.payload;
114
- var spectraList = state.spectraList;
134
+ const removePeak = function (state, action) {
135
+ let isMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
136
+ const {
137
+ payload
138
+ } = action;
139
+ const {
140
+ spectraList
141
+ } = state;
115
142
  if (payload) {
116
- var index = payload.index,
117
- jcampIdx = payload.jcampIdx;
118
- var spectra = spectraList[jcampIdx];
119
- var list = spectra.list;
120
- var newList = list;
121
- var pairPeak = newList[index];
143
+ const {
144
+ index,
145
+ jcampIdx
146
+ } = payload;
147
+ const spectra = spectraList[jcampIdx];
148
+ const {
149
+ list
150
+ } = spectra;
151
+ const newList = list;
152
+ const pairPeak = newList[index];
122
153
  if (isMax) {
123
154
  pairPeak.max = null;
124
155
  } else {
@@ -128,101 +159,131 @@ var removePeak = function removePeak(state, action) {
128
159
  spectraList[jcampIdx] = Object.assign({}, spectra, {
129
160
  list: newList,
130
161
  selectedIdx: index,
131
- jcampIdx: jcampIdx
162
+ jcampIdx
132
163
  });
133
164
  return Object.assign({}, state, {
134
- spectraList: spectraList
165
+ spectraList
135
166
  });
136
167
  }
137
168
  return state;
138
169
  };
139
- var selectPairPeak = function selectPairPeak(state, action) {
140
- var payload = action.payload;
170
+ const selectPairPeak = (state, action) => {
171
+ const {
172
+ payload
173
+ } = action;
141
174
  if (payload !== undefined) {
142
- var spectraList = state.spectraList;
143
- var index = payload.index,
144
- jcampIdx = payload.jcampIdx;
145
- var spectra = spectraList[jcampIdx];
175
+ const {
176
+ spectraList
177
+ } = state;
178
+ const {
179
+ index,
180
+ jcampIdx
181
+ } = payload;
182
+ const spectra = spectraList[jcampIdx];
146
183
  if (spectra) {
147
184
  spectraList[jcampIdx] = Object.assign({}, spectra, {
148
185
  selectedIdx: index
149
186
  });
150
187
  return Object.assign({}, state, {
151
- spectraList: spectraList
188
+ spectraList
152
189
  });
153
190
  }
154
191
  return state;
155
192
  }
156
193
  return state;
157
194
  };
158
- var setWorkWithMaxPeak = function setWorkWithMaxPeak(state, action) {
159
- var payload = action.payload;
195
+ const setWorkWithMaxPeak = (state, action) => {
196
+ const {
197
+ payload
198
+ } = action;
160
199
  if (payload !== undefined) {
161
- var spectraList = state.spectraList;
162
- var isMax = payload.isMax,
163
- jcampIdx = payload.jcampIdx;
164
- var spectra = spectraList[jcampIdx];
200
+ const {
201
+ spectraList
202
+ } = state;
203
+ const {
204
+ isMax,
205
+ jcampIdx
206
+ } = payload;
207
+ const spectra = spectraList[jcampIdx];
165
208
  if (spectra) {
166
209
  spectraList[jcampIdx] = Object.assign({}, spectra, {
167
210
  isWorkMaxPeak: isMax
168
211
  });
169
212
  return Object.assign({}, state, {
170
- spectraList: spectraList
213
+ spectraList
171
214
  });
172
215
  }
173
216
  return state;
174
217
  }
175
218
  return state;
176
219
  };
177
- var addPecker = function addPecker(state, action) {
178
- var payload = action.payload;
179
- var spectraList = state.spectraList;
220
+ const addPecker = (state, action) => {
221
+ const {
222
+ payload
223
+ } = action;
224
+ const {
225
+ spectraList
226
+ } = state;
180
227
  if (payload) {
181
- var peak = payload.peak,
182
- index = payload.index,
183
- jcampIdx = payload.jcampIdx;
184
- var spectra = spectraList[jcampIdx];
185
- var list = spectra.list;
186
- var newList = list;
187
- var pairPeak = newList[index];
228
+ const {
229
+ peak,
230
+ index,
231
+ jcampIdx
232
+ } = payload;
233
+ const spectra = spectraList[jcampIdx];
234
+ const {
235
+ list
236
+ } = spectra;
237
+ const newList = list;
238
+ const pairPeak = newList[index];
188
239
  pairPeak.pecker = peak;
189
240
  newList[index] = pairPeak;
190
241
  spectraList[jcampIdx] = Object.assign({}, spectra, {
191
242
  list: newList,
192
243
  selectedIdx: index,
193
- jcampIdx: jcampIdx
244
+ jcampIdx
194
245
  });
195
246
  return Object.assign({}, state, {
196
- spectraList: spectraList
247
+ spectraList
197
248
  });
198
249
  }
199
250
  return state;
200
251
  };
201
- var removePecker = function removePecker(state, action) {
202
- var payload = action.payload;
203
- var spectraList = state.spectraList;
252
+ const removePecker = (state, action) => {
253
+ const {
254
+ payload
255
+ } = action;
256
+ const {
257
+ spectraList
258
+ } = state;
204
259
  if (payload) {
205
- var index = payload.index,
206
- jcampIdx = payload.jcampIdx;
207
- var spectra = spectraList[jcampIdx];
208
- var list = spectra.list;
209
- var newList = list;
210
- var pairPeak = newList[index];
260
+ const {
261
+ index,
262
+ jcampIdx
263
+ } = payload;
264
+ const spectra = spectraList[jcampIdx];
265
+ const {
266
+ list
267
+ } = spectra;
268
+ const newList = list;
269
+ const pairPeak = newList[index];
211
270
  pairPeak.pecker = null;
212
271
  newList[index] = pairPeak;
213
272
  spectraList[jcampIdx] = Object.assign({}, spectra, {
214
273
  list: newList,
215
274
  selectedIdx: index,
216
- jcampIdx: jcampIdx
275
+ jcampIdx
217
276
  });
218
277
  return Object.assign({}, state, {
219
- spectraList: spectraList
278
+ spectraList
220
279
  });
221
280
  }
222
281
  return state;
223
282
  };
224
- var setRef = function setRef(state, action) {
225
- var payload = action.payload;
283
+ const setRef = (state, action) => {
284
+ const {
285
+ payload
286
+ } = action;
226
287
  // const { spectraList } = state;
227
288
  if (payload) {
228
289
  // const { index, jcampIdx } = payload;
@@ -245,9 +306,9 @@ var setRef = function setRef(state, action) {
245
306
  }
246
307
  return state;
247
308
  };
248
- var cyclicVoltaReducer = function cyclicVoltaReducer() {
249
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
250
- var action = arguments.length > 1 ? arguments[1] : undefined;
309
+ const cyclicVoltaReducer = function () {
310
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
311
+ let action = arguments.length > 1 ? arguments[1] : undefined;
251
312
  switch (action.type) {
252
313
  case _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS:
253
314
  return addPairPeak(state, action);
@@ -279,5 +340,4 @@ var cyclicVoltaReducer = function cyclicVoltaReducer() {
279
340
  return state;
280
341
  }
281
342
  };
282
- var _default = cyclicVoltaReducer;
283
- exports.default = _default;
343
+ var _default = exports.default = cyclicVoltaReducer;
@@ -8,10 +8,10 @@ var _list_wavelength = require("../constants/list_wavelength");
8
8
  var _action_type = require("../constants/action_type");
9
9
  /* eslint-disable default-param-last */
10
10
 
11
- var initialState = _list_wavelength.LIST_WAVE_LENGTH[0];
12
- var wavelengthReducer = function wavelengthReducer() {
13
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
14
- var action = arguments.length > 1 ? arguments[1] : undefined;
11
+ const initialState = _list_wavelength.LIST_WAVE_LENGTH[0];
12
+ const wavelengthReducer = function () {
13
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
14
+ let action = arguments.length > 1 ? arguments[1] : undefined;
15
15
  switch (action.type) {
16
16
  case _action_type.XRD.UPDATE_WAVE_LENGTH:
17
17
  return action.payload;
@@ -19,5 +19,4 @@ var wavelengthReducer = function wavelengthReducer() {
19
19
  return state;
20
20
  }
21
21
  };
22
- var _default = wavelengthReducer;
23
- exports.default = _default;
22
+ var _default = exports.default = wavelengthReducer;
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.undoRedoConfig = exports.undoRedoActions = void 0;
7
7
  var _reduxUndo = require("redux-undo");
8
8
  var _action_type = require("../constants/action_type");
9
- var undoRedoActions = [_action_type.EDITPEAK.ADD_POSITIVE, _action_type.EDITPEAK.ADD_NEGATIVE, _action_type.EDITPEAK.RM_POSITIVE, _action_type.EDITPEAK.RM_NEGATIVE, _action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION, _action_type.UI.SWEEP.SELECT_INTEGRATION, _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC, _action_type.INTEGRATION.RM_ONE, _action_type.INTEGRATION.SET_REF, _action_type.INTEGRATION.SET_FKR, _action_type.INTEGRATION.RESET_ALL, _action_type.INTEGRATION.CLEAR_ALL, _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC, _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC, _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC, _action_type.MULTIPLICITY.RESET_ONE_RDC, _action_type.MULTIPLICITY.UPDATE_J, _action_type.MULTIPLICITY.TYPE_SELECT_RDC, _action_type.MULTIPLICITY.ONE_CLICK, _action_type.MULTIPLICITY.ONE_CLICK_BY_UI, _action_type.MULTIPLICITY.RESET_ALL_RDC, _action_type.MULTIPLICITY.CLEAR_ALL];
10
- exports.undoRedoActions = undoRedoActions;
11
- var undoRedoConfig = {
9
+ const undoRedoActions = exports.undoRedoActions = [_action_type.EDITPEAK.ADD_POSITIVE, _action_type.EDITPEAK.ADD_NEGATIVE, _action_type.EDITPEAK.RM_POSITIVE, _action_type.EDITPEAK.RM_NEGATIVE, _action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION, _action_type.UI.SWEEP.SELECT_INTEGRATION, _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC, _action_type.INTEGRATION.RM_ONE, _action_type.INTEGRATION.SET_REF, _action_type.INTEGRATION.SET_FKR, _action_type.INTEGRATION.RESET_ALL, _action_type.INTEGRATION.CLEAR_ALL, _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC, _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC, _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC, _action_type.MULTIPLICITY.RESET_ONE_RDC, _action_type.MULTIPLICITY.UPDATE_J, _action_type.MULTIPLICITY.TYPE_SELECT_RDC, _action_type.MULTIPLICITY.ONE_CLICK, _action_type.MULTIPLICITY.ONE_CLICK_BY_UI, _action_type.MULTIPLICITY.RESET_ALL_RDC, _action_type.MULTIPLICITY.CLEAR_ALL];
10
+ const undoRedoConfig = exports.undoRedoConfig = {
12
11
  debug: false,
13
12
  limit: 10,
14
13
  ignoreInitialState: true,
15
14
  filter: (0, _reduxUndo.includeAction)(undoRedoActions),
16
15
  clearHistoryType: [_action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION],
17
16
  neverSkipReducer: [_action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION]
18
- };
19
- exports.undoRedoConfig = undoRedoConfig;
17
+ };
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _regeneratorRuntime2 = require("@babel/runtime/regenerator");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = rootSaga;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
8
  var _effects = require("redux-saga/effects");
12
9
  var _saga_edit_peak = _interopRequireDefault(require("./saga_edit_peak"));
13
10
  var _saga_manager = _interopRequireDefault(require("./saga_manager"));
@@ -15,16 +12,6 @@ var _saga_ui = _interopRequireDefault(require("./saga_ui"));
15
12
  var _saga_meta = _interopRequireDefault(require("./saga_meta"));
16
13
  var _saga_multiplicity = _interopRequireDefault(require("./saga_multiplicity"));
17
14
  var _saga_multi_entities = _interopRequireDefault(require("./saga_multi_entities"));
18
- var _marked = /*#__PURE__*/_regeneratorRuntime2.mark(rootSaga);
19
- function rootSaga() {
20
- return _regenerator.default.wrap(function rootSaga$(_context) {
21
- while (1) switch (_context.prev = _context.next) {
22
- case 0:
23
- _context.next = 2;
24
- return (0, _effects.all)([].concat((0, _toConsumableArray2.default)(_saga_edit_peak.default), (0, _toConsumableArray2.default)(_saga_manager.default), (0, _toConsumableArray2.default)(_saga_ui.default), (0, _toConsumableArray2.default)(_saga_meta.default), (0, _toConsumableArray2.default)(_saga_multiplicity.default), (0, _toConsumableArray2.default)(_saga_multi_entities.default)));
25
- case 2:
26
- case "end":
27
- return _context.stop();
28
- }
29
- }, _marked);
15
+ function* rootSaga() {
16
+ yield (0, _effects.all)([..._saga_edit_peak.default, ..._saga_manager.default, ..._saga_ui.default, ..._saga_meta.default, ..._saga_multiplicity.default, ..._saga_multi_entities.default]);
30
17
  }