nmrium 0.36.0 → 0.38.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 (411) hide show
  1. package/lib/component/1d/FooterBanner.js +1 -1
  2. package/lib/component/1d/Viewer1D.js +26 -21
  3. package/lib/component/1d/integral/Integral.d.ts +2 -6
  4. package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
  5. package/lib/component/1d/integral/IntegralResizable.js +2 -3
  6. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  8. package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
  9. package/lib/component/1d/ranges/Range.js +9 -8
  10. package/lib/component/1d/ranges/Ranges.js +5 -7
  11. package/lib/component/1d/tool/BaseLineZones.js +1 -2
  12. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  13. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  14. package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
  15. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  16. package/lib/component/2d/Chart2D.js +1 -1
  17. package/lib/component/2d/Viewer2D.js +10 -9
  18. package/lib/component/2d/fid/FidCanvas.js +4 -6
  19. package/lib/component/2d/ft/Contours.js +1 -7
  20. package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
  21. package/lib/component/2d/utilities/scale.d.ts +2 -1
  22. package/lib/component/2d/utilities/scale.js +1 -1
  23. package/lib/component/2d/zones/Zones.js +1 -1
  24. package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
  25. package/lib/component/NMRium.d.ts +2 -0
  26. package/lib/component/NMRium.js +22 -15
  27. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  28. package/lib/component/context/DispatchContext.d.ts +23 -3
  29. package/lib/component/context/DispatchContext.js +1 -1
  30. package/lib/component/context/LoggerContext.js +1 -1
  31. package/lib/component/elements/Button.js +7 -9
  32. package/lib/component/elements/IsotopesViewer.js +1 -1
  33. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  34. package/lib/component/elements/RemoveAssignmentsButton.d.ts +4 -0
  35. package/lib/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +14 -1
  36. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  37. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  38. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  39. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  40. package/lib/component/elements/formik/FormikInput.js +1 -1
  41. package/lib/component/elements/formik/FormikSelect.js +2 -2
  42. package/lib/component/elements/formik/FormikSlider.js +1 -1
  43. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  44. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  45. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  46. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  47. package/lib/component/header/Header.js +5 -7
  48. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  49. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  50. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  51. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  52. package/lib/component/hooks/useExport.js +1 -0
  53. package/lib/component/hooks/useToolsFunctions.js +8 -10
  54. package/lib/component/loader/DropZone.js +4 -5
  55. package/lib/component/loader/NoData.js +1 -1
  56. package/lib/component/modal/AboutPredictionModal.d.ts +2 -0
  57. package/lib/component/modal/AboutPredictionModal.js +49 -0
  58. package/lib/component/modal/AlignSpectraModal.js +1 -2
  59. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  60. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  61. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  62. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  63. package/lib/component/modal/PredictSpectraModal.js +24 -21
  64. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  65. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  66. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  67. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  68. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  69. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  70. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  71. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  72. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  73. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  74. package/lib/component/panels/InformationPanel.js +6 -6
  75. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  76. package/lib/component/panels/IntegralsPanel/IntegralTable.js +27 -23
  77. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
  78. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  79. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  80. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  81. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  82. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  83. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -0
  84. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  85. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  86. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  87. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  88. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  89. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  90. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  91. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  92. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  93. package/lib/component/panels/Panels.js +1 -1
  94. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  95. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  96. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  97. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  98. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +0 -1
  99. package/lib/component/panels/RangesPanel/RangesTableRow.js +0 -11
  100. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
  101. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  102. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
  103. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  104. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  105. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  106. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  107. package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
  108. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  109. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  110. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  111. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
  112. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  113. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  114. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  115. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  116. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  117. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -21
  118. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  119. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +4 -5
  120. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -16
  121. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +3 -7
  122. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
  123. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  124. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  125. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +4 -5
  126. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -19
  127. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +3 -7
  128. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
  129. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  130. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  131. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  132. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -22
  133. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  134. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  135. package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
  136. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  137. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  138. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  139. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  140. package/lib/component/panels/predictionPanel/PredictionPanel.js +10 -6
  141. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  142. package/lib/component/reducer/IgnoreActions.js +35 -32
  143. package/lib/component/reducer/Reducer.d.ts +8 -5
  144. package/lib/component/reducer/Reducer.js +199 -221
  145. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  146. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  147. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  148. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  149. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  150. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  151. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  152. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  153. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  154. package/lib/component/reducer/actions/DomainActions.js +13 -19
  155. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  156. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  157. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  158. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  159. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  160. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  161. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  162. package/lib/component/reducer/actions/LoadActions.js +65 -57
  163. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  164. package/lib/component/reducer/actions/MoleculeActions.js +53 -20
  165. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  166. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  167. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  168. package/lib/component/reducer/actions/PreferencesActions.js +22 -7
  169. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  170. package/lib/component/reducer/actions/RangesActions.js +80 -65
  171. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  172. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  173. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  174. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  175. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  176. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  177. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  178. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  179. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  180. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  181. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  182. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
  183. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  184. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  185. package/lib/component/reducer/types/ActionType.js +1 -0
  186. package/lib/component/toolbar/BasicToolBar.js +6 -9
  187. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  188. package/lib/component/toolbar/ToolBar.js +1 -1
  189. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  190. package/lib/component/utility/Events.d.ts +4 -4
  191. package/lib/component/utility/Events.js +2 -2
  192. package/lib/component/utility/GroupByInfoKey.js +1 -1
  193. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  194. package/lib/component/workspaces/Workspace.d.ts +2 -1
  195. package/lib/component/workspaces/exercise.js +31 -0
  196. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  197. package/lib/data/PredictionManager.d.ts +5 -8
  198. package/lib/data/PredictionManager.js +3 -3
  199. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  200. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  201. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  202. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  203. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  204. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  205. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  206. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  207. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  208. package/lib/data/data2d/Processing2D.d.ts +3 -3
  209. package/lib/data/data2d/Spectrum2D/contours.d.ts +1 -4
  210. package/lib/data/data2d/Spectrum2D/contours.js +0 -1
  211. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  212. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  213. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  214. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  215. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  216. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  217. package/lib/data/matrixGeneration.js +4 -2
  218. package/lib/data/molecules/Molecule.d.ts +3 -3
  219. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  220. package/lib/data/molecules/MoleculeManager.js +1 -1
  221. package/lib/data/utilities/ZoneUtilities.js +0 -1
  222. package/lib/data/utilities/generateColor.js +1 -1
  223. package/lib/data/utilities/isNumber.d.ts +1 -0
  224. package/lib/data/utilities/isNumber.js +3 -0
  225. package/lib/types/NMRiumGeneralPreferences.d.ts +1 -0
  226. package/lib/versionInfo.js +1 -1
  227. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  228. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  229. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  230. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  231. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  232. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  233. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  234. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  235. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  236. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  237. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  238. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  239. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  240. package/lib-cjs/component/2d/Chart2D.js +1 -1
  241. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  242. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  243. package/lib-cjs/component/2d/ft/Contours.js +1 -7
  244. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  245. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  246. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  247. package/lib-cjs/component/NMRium.js +19 -12
  248. package/lib-cjs/component/context/DispatchContext.js +1 -1
  249. package/lib-cjs/component/context/LoggerContext.js +1 -1
  250. package/lib-cjs/component/elements/Button.js +7 -9
  251. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  252. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  253. package/lib-cjs/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +15 -2
  254. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  255. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  256. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  257. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  258. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  259. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  260. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  261. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  262. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  263. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  264. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  265. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  266. package/lib-cjs/component/header/Header.js +5 -7
  267. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  268. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  269. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  270. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  271. package/lib-cjs/component/highlight/index.js +1 -1
  272. package/lib-cjs/component/hooks/useExport.js +1 -0
  273. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  274. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  275. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  276. package/lib-cjs/component/loader/DropZone.js +4 -5
  277. package/lib-cjs/component/loader/NoData.js +1 -1
  278. package/lib-cjs/component/modal/AboutPredictionModal.js +54 -0
  279. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  280. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  281. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  282. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  283. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  284. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  285. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  286. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  287. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  288. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  289. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  290. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  291. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  292. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  293. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  294. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  295. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  296. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  297. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +27 -23
  298. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -4
  299. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  300. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  301. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  302. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  303. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  304. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  305. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  306. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  307. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  308. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  309. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  310. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  311. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  312. package/lib-cjs/component/panels/Panels.js +1 -1
  313. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  314. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  315. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  316. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  317. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +0 -12
  318. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
  319. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  320. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
  321. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  322. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  323. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  324. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
  325. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  326. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  327. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  328. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
  329. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  330. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  331. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  332. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  333. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  334. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  335. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -19
  336. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
  337. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  338. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -22
  339. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
  340. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  341. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  342. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -21
  343. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  344. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
  345. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  346. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  347. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  348. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  349. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +10 -6
  350. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  351. package/lib-cjs/component/reducer/Reducer.js +199 -221
  352. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  353. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  354. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  355. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  356. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  357. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  358. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  359. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  360. package/lib-cjs/component/reducer/actions/LoadActions.js +68 -60
  361. package/lib-cjs/component/reducer/actions/MoleculeActions.js +56 -23
  362. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  363. package/lib-cjs/component/reducer/actions/PreferencesActions.js +24 -9
  364. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  365. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  366. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  367. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  368. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  369. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  370. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  371. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
  372. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  373. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  374. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  375. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  376. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  377. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  378. package/lib-cjs/component/workspaces/exercise.js +31 -0
  379. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
  380. package/lib-cjs/data/PredictionManager.js +3 -3
  381. package/lib-cjs/data/SpectraManager.js +1 -1
  382. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  383. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  384. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  385. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  386. package/lib-cjs/data/data2d/Spectrum2D/contours.js +0 -1
  387. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  388. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  389. package/lib-cjs/data/matrixGeneration.js +4 -2
  390. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  391. package/lib-cjs/data/utilities/ZoneUtilities.js +0 -1
  392. package/lib-cjs/data/utilities/generateColor.js +1 -1
  393. package/lib-cjs/data/utilities/isNumber.js +7 -0
  394. package/lib-cjs/versionInfo.js +1 -1
  395. package/package.json +35 -34
  396. package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +0 -3
  397. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  398. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  399. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  400. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  401. package/lib/component/reducer/types/Types.d.ts +0 -132
  402. package/lib/component/reducer/types/Types.js +0 -126
  403. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  404. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  405. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  406. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  407. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  408. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  409. package/lib-cjs/component/reducer/types/Types.js +0 -131
  410. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  411. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
4
4
  /** @jsxImportSource @emotion/react */
5
5
  const react_1 = require("react");
6
+ const RemoveAssignmentsButton_1 = require("../../../elements/RemoveAssignmentsButton");
6
7
  const highlight_1 = require("../../../highlight");
7
- const RangesTableRow_1 = require("../RangesTableRow");
8
- const RemoveAssignmentsButton_1 = require("./RemoveAssignmentsButton");
9
8
  const columnStyle = {
10
9
  padding: 0,
11
10
  textAlign: 'center',
@@ -39,6 +38,6 @@ function RangeAssignmentsColumn({ row, assignment, highlight, onLink, onUnlink,
39
38
  return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, style: {
40
39
  ...columnStyle,
41
40
  ...rowSpanTags.style,
42
- }, ...onHover, ...{ onClick: (e) => onLink?.(e, assignment) }, css: !assignment.isActive && RangesTableRow_1.AssignmentColumnCssStyle, children: (totalNumberOfAtoms > 0 || assignment.isActive) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', (0, jsx_runtime_1.jsx)("span", { style: getStyle(flag, isCompletelyAssigned), children: diaIDs?.length || 0 }), ' ) ', (0, jsx_runtime_1.jsx)(RemoveAssignmentsButton_1.RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, true) })] })) }));
41
+ }, ...onHover, onClick: (e) => onLink?.(e, assignment), css: !assignment.isActive && RemoveAssignmentsButton_1.removeAssignmentCssStyle, children: (totalNumberOfAtoms > 0 || assignment.isActive) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', (0, jsx_runtime_1.jsx)("span", { style: getStyle(flag, isCompletelyAssigned), children: diaIDs?.length || 0 }), ' ) ', (0, jsx_runtime_1.jsx)(RemoveAssignmentsButton_1.RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, true) })] })) }));
43
42
  }
44
43
  exports.default = (0, react_1.memo)(RangeAssignmentsColumn);
@@ -7,7 +7,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const RangeUtilities_1 = require("../../../../data/utilities/RangeUtilities");
8
8
  const DispatchContext_1 = require("../../../context/DispatchContext");
9
9
  const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
10
- const Types_1 = require("../../../reducer/types/Types");
11
10
  const formatNumber_1 = require("../../../utility/formatNumber");
12
11
  function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
13
12
  const dispatch = (0, DispatchContext_1.useDispatch)();
@@ -16,9 +15,10 @@ function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
16
15
  const integralVal = flag ? formattedValue : `[ ${formattedValue} ]`;
17
16
  function saveHandler(event) {
18
17
  dispatch({
19
- type: Types_1.CHANGE_RANGE_RELATIVE,
18
+ type: 'CHANGE_RANGE_RELATIVE',
20
19
  payload: {
21
- data: { value: event.target.value, id: row.id },
20
+ value: event.target.value,
21
+ id: row.id,
22
22
  },
23
23
  });
24
24
  }
@@ -7,8 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
7
7
  /** @jsxImportSource @emotion/react */
8
8
  const get_1 = __importDefault(require("lodash/get"));
9
9
  const react_1 = require("react");
10
- const RangesTableRow_1 = require("../RangesTableRow");
11
- const RemoveAssignmentsButton_1 = require("./RemoveAssignmentsButton");
10
+ const RemoveAssignmentsButton_1 = require("../../../elements/RemoveAssignmentsButton");
12
11
  function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onLink, onUnlink, }) {
13
12
  const diaIDs = (0, get_1.default)(row, 'tableMetaInfo.signal.diaIDs', []);
14
13
  const tdCss = assignment.isActive || highlight.isActive
@@ -20,6 +19,6 @@ function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onLink,
20
19
  function assignHandler(e) {
21
20
  onLink?.(e, assignment);
22
21
  }
23
- return ((0, jsx_runtime_1.jsx)("td", { ...onHover, onClick: assignHandler, style: { padding: '0', ...tdCss }, css: !assignment.isActive && RangesTableRow_1.AssignmentColumnCssStyle, children: (diaIDs?.length > 0 || assignment.isActive) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: diaIDs?.length || 0 }), (0, jsx_runtime_1.jsx)(RemoveAssignmentsButton_1.RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, false) })] })) }));
22
+ return ((0, jsx_runtime_1.jsx)("td", { ...onHover, onClick: assignHandler, style: { padding: '0', ...tdCss }, css: !assignment.isActive && RemoveAssignmentsButton_1.removeAssignmentCssStyle, children: (diaIDs?.length > 0 || assignment.isActive) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: diaIDs?.length || 0 }), (0, jsx_runtime_1.jsx)(RemoveAssignmentsButton_1.RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, false) })] })) }));
24
23
  }
25
24
  exports.default = (0, react_1.memo)(SignalAssignmentsColumn);
@@ -7,14 +7,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const nmr_processing_1 = require("nmr-processing");
8
8
  const DispatchContext_1 = require("../../../context/DispatchContext");
9
9
  const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
10
- const Types_1 = require("../../../reducer/types/Types");
11
10
  const formatNumber_1 = require("../../../utility/formatNumber");
12
11
  function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
13
12
  const dispatch = (0, DispatchContext_1.useDispatch)();
14
13
  const signal = row.tableMetaInfo.signal;
15
14
  function saveHandler(event) {
16
15
  dispatch({
17
- type: Types_1.CHANGE_RANGE_SIGNAL_VALUE,
16
+ type: 'CHANGE_RANGE_SIGNAL_VALUE',
18
17
  payload: {
19
18
  value: event.target.value,
20
19
  rangeID: row.id,
@@ -10,8 +10,6 @@ const DispatchContext_1 = require("../../../context/DispatchContext");
10
10
  const Modal_1 = require("../../../elements/popup/Modal");
11
11
  const options_1 = require("../../../elements/popup/options");
12
12
  const EditRangeModal_1 = __importDefault(require("../../../modal/editRange/EditRangeModal"));
13
- const Types_1 = require("../../../reducer/types/Types");
14
- const ToolTypes_1 = require("../../../toolbar/ToolTypes");
15
13
  function useEditRangeModal(range) {
16
14
  const dispatch = (0, DispatchContext_1.useDispatch)();
17
15
  const modal = (0, Modal_1.useModal)();
@@ -22,37 +20,41 @@ function useEditRangeModal(range) {
22
20
  const { from, to } = _range;
23
21
  const margin = Math.abs(from - to);
24
22
  dispatch({
25
- type: Types_1.SET_X_DOMAIN,
26
- xDomain: [from - margin, to + margin],
23
+ type: 'SET_X_DOMAIN',
24
+ payload: {
25
+ xDomain: [from - margin, to + margin],
26
+ },
27
27
  });
28
28
  }
29
29
  }, [dispatch, range]);
30
30
  const deleteRange = (0, react_1.useCallback)((id, resetSelectTool = false) => {
31
31
  if (range || id) {
32
32
  dispatch({
33
- type: Types_1.DELETE_RANGE,
33
+ type: 'DELETE_RANGE',
34
34
  payload: {
35
- data: { id: id || range?.id, assignmentData },
35
+ id: id || range?.id,
36
+ assignmentData,
36
37
  resetSelectTool,
37
38
  },
38
39
  });
39
40
  }
40
41
  }, [assignmentData, dispatch, range]);
41
- const changeRangeSignalKind = (0, react_1.useCallback)((value) => {
42
+ const changeRangeSignalKind = (0, react_1.useCallback)((kind) => {
42
43
  if (range) {
43
44
  dispatch({
44
- type: Types_1.CHANGE_RANGE_SIGNAL_KIND,
45
+ type: 'CHANGE_RANGE_SIGNAL_KIND',
45
46
  payload: {
46
- data: { rowData: range, value },
47
+ range,
48
+ kind,
47
49
  },
48
50
  });
49
51
  }
50
52
  }, [dispatch, range]);
51
- const saveEditRangeHandler = (0, react_1.useCallback)((editedRowData, automaticCloseModal = true) => {
53
+ const saveEditRangeHandler = (0, react_1.useCallback)((editedRange, automaticCloseModal = true) => {
52
54
  dispatch({
53
- type: Types_1.SAVE_EDITED_RANGE,
55
+ type: 'SAVE_EDITED_RANGE',
54
56
  payload: {
55
- editedRowData,
57
+ range: editedRange,
56
58
  assignmentData,
57
59
  },
58
60
  });
@@ -71,8 +73,8 @@ function useEditRangeModal(range) {
71
73
  }, [deleteRange, modal, saveEditRangeHandler]);
72
74
  const editRange = (0, react_1.useCallback)((isManual = false) => {
73
75
  dispatch({
74
- type: Types_1.SET_SELECTED_TOOL,
75
- payload: { selectedTool: ToolTypes_1.options.editRange.id },
76
+ type: 'SET_SELECTED_TOOL',
77
+ payload: { selectedTool: 'editRange' },
76
78
  });
77
79
  modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
78
80
  position: options_1.positions.MIDDLE_RIGHT,
@@ -16,7 +16,6 @@ const Modal_1 = require("../../elements/popup/Modal");
16
16
  const useActiveSpectra_1 = require("../../hooks/useActiveSpectra");
17
17
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
18
18
  const Constants_1 = require("../../reducer/core/Constants");
19
- const Types_1 = require("../../reducer/types/Types");
20
19
  const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
21
20
  const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
22
21
  const SpectraAutomaticPickingButton_1 = require("../header/SpectraAutomaticPickingButton");
@@ -44,7 +43,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
44
43
  {
45
44
  text: 'Yes',
46
45
  handler: () => {
47
- dispatch({ type: Types_1.DELETE_SPECTRA });
46
+ dispatch({ type: 'DELETE_SPECTRA', payload: {} });
48
47
  },
49
48
  },
50
49
  { text: 'No' },
@@ -53,34 +52,37 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
53
52
  }, [activeSpectra?.length, dispatch, modal]);
54
53
  function showAllSpectrumsHandler() {
55
54
  dispatch({
56
- type: Types_1.CHANGE_VISIBILITY,
55
+ type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
57
56
  payload: { nucleus: activeTab, flag: true },
58
57
  });
59
58
  }
60
59
  function hideAllSpectrumsHandler() {
61
60
  dispatch({
62
- type: Types_1.CHANGE_VISIBILITY,
61
+ type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
63
62
  payload: { nucleus: activeTab, flag: false },
64
63
  });
65
64
  }
66
65
  function addMissingProjectionHandler() {
67
66
  const missingNucleus = getMissingProjection(data, activeTab);
68
67
  if (missingNucleus.length > 0) {
69
- dispatch({ type: Types_1.ADD_MISSING_PROJECTION, nucleus: missingNucleus });
68
+ dispatch({
69
+ type: 'ADD_MISSING_PROJECTION',
70
+ payload: { nucleus: missingNucleus },
71
+ });
70
72
  }
71
73
  else {
72
74
  alert.error('Nothing to calculate');
73
75
  }
74
76
  }
75
77
  function setSameTopHandler() {
76
- dispatch({ type: Types_1.SET_SPECTRA_SAME_TOP });
78
+ dispatch({ type: 'SET_SPECTRA_SAME_TOP' });
77
79
  }
78
80
  function resetScaleHandler() {
79
- dispatch({ type: Types_1.RESET_SPECTRA_SCALE });
81
+ dispatch({ type: 'RESET_SPECTRA_SCALE' });
80
82
  }
81
83
  function recolorSpectraHandler() {
82
84
  dispatch({
83
- type: Types_1.RECOLOR_SPECTRA_COLOR,
85
+ type: 'RECOLOR_SPECTRA_COLOR',
84
86
  payload: {},
85
87
  });
86
88
  }
@@ -92,13 +94,11 @@ function SpectrumsTabs({ onSettingClick, }) {
92
94
  const { data, view: { spectra: { activeTab }, }, displayerMode, } = (0, ChartContext_1.useChartData)();
93
95
  const spectrum = (0, useSpectrum_1.default)();
94
96
  const activeSpectra = (0, useActiveSpectra_1.useActiveSpectra)();
95
- return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { ...{
96
- data,
97
- activeSpectrum: spectrum,
98
- activeSpectra,
99
- activeTab,
100
- displayerMode,
101
- onSettingClick,
102
- } }));
97
+ return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { data,
98
+ activeSpectrum: spectrum,
99
+ activeSpectra,
100
+ activeTab,
101
+ displayerMode,
102
+ onSettingClick }));
103
103
  }
104
104
  exports.default = SpectrumsTabs;
@@ -35,7 +35,7 @@ function SpectraPreferences(props, ref) {
35
35
  }), []);
36
36
  const handleAdd = (0, react_1.useCallback)((nucleus, index) => {
37
37
  const data = formRef.current.values;
38
- let columns = data.nuclei[nucleus].columns;
38
+ let columns = data.nuclei[nucleus]?.columns || [];
39
39
  columns = [
40
40
  ...columns.slice(0, index),
41
41
  {
@@ -58,7 +58,7 @@ function SpectraPreferences(props, ref) {
58
58
  }, []);
59
59
  const handleDelete = (0, react_1.useCallback)((nucleus, index) => {
60
60
  const data = formRef.current.values;
61
- const columns = data.nuclei[nucleus].columns.filter((_, columnIndex) => columnIndex !== index);
61
+ const columns = data.nuclei[nucleus]?.columns.filter((_, columnIndex) => columnIndex !== index);
62
62
  formRef.current.setValues({
63
63
  ...data,
64
64
  nuclei: {
@@ -15,14 +15,13 @@ const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTab
15
15
  const Alert_1 = require("../../elements/popup/Alert");
16
16
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
17
17
  const ExportAsJcampModal_1 = __importDefault(require("../../modal/ExportAsJcampModal"));
18
- const Types_1 = require("../../reducer/types/Types");
19
18
  const export_1 = require("../../utility/export");
20
19
  const ColorIndicator_1 = __importDefault(require("./base/ColorIndicator"));
21
20
  const ShowHideSpectrumButton_1 = __importDefault(require("./base/ShowHideSpectrumButton"));
22
21
  const SpectrumName_1 = require("./base/SpectrumName");
23
22
  function formatValueAsHTML(value) {
24
23
  if (value) {
25
- value = value.replace(/(?<value>\d+)/g, '<sub>$<value></sub>');
24
+ value = value.replaceAll(/(?<value>\d+)/g, '<sub>$<value></sub>');
26
25
  }
27
26
  return value;
28
27
  }
@@ -151,7 +150,7 @@ function SpectraTable(props) {
151
150
  }
152
151
  case SpectraContextMenuOptionsKeys.Delete: {
153
152
  setTimeout(() => {
154
- dispatch({ type: Types_1.DELETE_SPECTRA, id: spectrum.id });
153
+ dispatch({ type: 'DELETE_SPECTRA', payload: { id: spectrum.id } });
155
154
  }, 0);
156
155
  break;
157
156
  }
@@ -201,7 +200,7 @@ function SpectraTable(props) {
201
200
  }, [COLUMNS, spectraPreferences.columns]);
202
201
  function handleSortEnd(data) {
203
202
  dispatch({
204
- type: Types_1.ORDER_SPECTRA,
203
+ type: 'ORDER_SPECTRA',
205
204
  payload: {
206
205
  data,
207
206
  },
@@ -224,7 +223,10 @@ const ColumnHeader = ({ label, col, }) => {
224
223
  const dispatch = (0, DispatchContext_1.useDispatch)();
225
224
  function selectHandler() {
226
225
  if (col?.jpath) {
227
- dispatch({ type: Types_1.RECOLOR_SPECTRA_COLOR, payload: { jpath: col?.jpath } });
226
+ dispatch({
227
+ type: 'RECOLOR_SPECTRA_COLOR',
228
+ payload: { jpath: col?.jpath },
229
+ });
228
230
  }
229
231
  }
230
232
  return ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "contextMenu", options: options, onSelect: selectHandler, children: (0, jsx_runtime_1.jsx)("div", { style: {
@@ -12,7 +12,6 @@ const DispatchContext_1 = require("../../context/DispatchContext");
12
12
  const IsotopesViewer_1 = __importDefault(require("../../elements/IsotopesViewer"));
13
13
  const Tab_1 = __importDefault(require("../../elements/Tab/Tab"));
14
14
  const Tabs_1 = __importDefault(require("../../elements/Tab/Tabs"));
15
- const Types_1 = require("../../reducer/types/Types");
16
15
  const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
17
16
  const SpectraTable_1 = require("./SpectraTable");
18
17
  const SpectrumSetting_1 = __importDefault(require("./base/setting/SpectrumSetting"));
@@ -28,7 +27,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
28
27
  return groupByNucleus(data, true);
29
28
  }, [data]);
30
29
  function onTabChangeHandler(tab) {
31
- dispatch({ type: Types_1.SET_ACTIVE_TAB, tab: tab.tabid });
30
+ dispatch({ type: 'SET_ACTIVE_TAB', payload: { tab: tab.tabid } });
32
31
  }
33
32
  const openSettingHandler = (0, react_2.useCallback)((event, selectedSpectrum) => {
34
33
  event.stopPropagation();
@@ -41,7 +40,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
41
40
  }, []);
42
41
  const handleChangeVisibility = (0, react_2.useCallback)((d, key) => {
43
42
  dispatch({
44
- type: Types_1.CHANGE_VISIBILITY,
43
+ type: 'CHANGE_SPECTRUM_VISIBILITY',
45
44
  payload: {
46
45
  id: d.id,
47
46
  key,
@@ -52,7 +51,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
52
51
  setTimeout(() => {
53
52
  const modifier = `shift[${e.shiftKey ? 'true' : 'false'}]_ctrl[${e.ctrlKey ? 'true' : 'false'}]`;
54
53
  dispatch({
55
- type: Types_1.CHANGE_ACTIVE_SPECTRUM,
54
+ type: 'CHANGE_ACTIVE_SPECTRUM',
56
55
  payload: { modifier, id: spectrum.id },
57
56
  });
58
57
  }, 0);
@@ -70,6 +69,6 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
70
69
  const MemoizedSpectra = (0, react_2.memo)(SpectrumsTabsInner);
71
70
  function SpectrumsTabs() {
72
71
  const { data, view: { spectra: { activeTab, activeSpectra }, }, } = (0, ChartContext_1.useChartData)();
73
- return (0, jsx_runtime_1.jsx)(MemoizedSpectra, { ...{ data, activeSpectra, activeTab } });
72
+ return (0, jsx_runtime_1.jsx)(MemoizedSpectra, { data, activeSpectra, activeTab });
74
73
  }
75
74
  exports.default = SpectrumsTabs;
@@ -20,13 +20,9 @@ function getStyle(display, key) {
20
20
  };
21
21
  }
22
22
  function ShowHideSpectrumButton({ data, onChangeVisibility, }) {
23
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(DisplayButtons1D, { ...{
24
- data,
25
- onChangeVisibility,
26
- } }), (0, jsx_runtime_1.jsx)(DisplayButtons2D, { ...{
27
- data,
28
- onChangeVisibility,
29
- } })] }));
23
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(DisplayButtons1D, { data,
24
+ onChangeVisibility }), (0, jsx_runtime_1.jsx)(DisplayButtons2D, { data,
25
+ onChangeVisibility })] }));
30
26
  }
31
27
  exports.default = ShowHideSpectrumButton;
32
28
  function DisplayButtons1D(props) {
@@ -60,6 +60,6 @@ function SpectraColumnsManager({ nucleus, onAdd, onDelete, datalist, mapOnChange
60
60
  },
61
61
  },
62
62
  ], [datalist, mapOnChangeValue, mapValue, nucleus, onAdd, onDelete]);
63
- return ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: nucleiPreferences.nuclei[nucleus].columns, columns: COLUMNS }));
63
+ return ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: nucleiPreferences.nuclei[nucleus]?.columns || [], columns: COLUMNS }));
64
64
  }
65
65
  exports.SpectraColumnsManager = SpectraColumnsManager;
@@ -8,7 +8,6 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  const react_1 = require("@emotion/react");
9
9
  const react_2 = require("react");
10
10
  const DispatchContext_1 = require("../../../../context/DispatchContext");
11
- const Types_1 = require("../../../../reducer/types/Types");
12
11
  const Spectrum1DSetting_1 = __importDefault(require("./Spectrum1DSetting"));
13
12
  const Spectrum2DSetting_1 = __importDefault(require("./Spectrum2DSetting"));
14
13
  const style = (0, react_1.css) `
@@ -73,7 +72,10 @@ function SpectrumSetting({ position, data, onClose }) {
73
72
  const dispatch = (0, DispatchContext_1.useDispatch)();
74
73
  const { id, info } = data;
75
74
  const submitHandler = (0, react_2.useCallback)((values) => {
76
- dispatch({ type: Types_1.CHANGE_SPECTRUM_SETTING, id, display: values });
75
+ dispatch({
76
+ type: 'CHANGE_SPECTRUM_SETTING',
77
+ payload: { id, display: values },
78
+ });
77
79
  }, [dispatch, id]);
78
80
  const clickHandler = (0, react_2.useCallback)((e) => {
79
81
  if (e.target === e.currentTarget) {
@@ -22,8 +22,8 @@ exports.processSnapPlot = processSnapPlot;
22
22
  function getLine(value, data, options) {
23
23
  const { log10, abs } = Math;
24
24
  const { yLogBase } = options;
25
- const first = data.length > 0 ? data[0].x : 0;
26
- const last = data.length > 0 ? data[data.length - 1].x : 0;
25
+ const first = data.at(0)?.x ?? 0;
26
+ const last = data.at(-1)?.x ?? 0;
27
27
  const inLogScale = log10(abs(value)) / log10(yLogBase);
28
28
  return [
29
29
  { x: first, y: inLogScale },
@@ -176,19 +176,15 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
176
176
  }, [contextRef]);
177
177
  const { title, ...otherTableDataProps } = tableDataProps;
178
178
  const t = title || '';
179
- return ((0, jsx_runtime_1.jsxs)("tr", { style: styleRow, children: [(0, jsx_runtime_1.jsxs)("td", { title: t, ...{
180
- ...otherTableDataProps,
181
- style: { ...tableDataProps.style, styleLabel },
182
- }, onContextMenu: (e) => {
179
+ return ((0, jsx_runtime_1.jsxs)("tr", { style: styleRow, children: [(0, jsx_runtime_1.jsxs)("td", { title: t, ...otherTableDataProps,
180
+ style: { ...tableDataProps.style, styleLabel }, onContextMenu: (e) => {
183
181
  if (contextMenu.length > 0) {
184
182
  contextMenuHandler(e);
185
183
  }
186
184
  }, children: [(0, nmr_correlation_1.getLabel)(correlations, correlation), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu })] }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: (0, nmr_correlation_1.getCorrelationDelta)(correlation)
187
185
  ? (0, nmr_correlation_1.getCorrelationDelta)(correlation)?.toFixed(2)
188
- : '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...{
189
- ...otherTableDataProps,
190
- style: { ...tableDataProps.style, borderRight: '1px solid' },
191
- }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
186
+ : '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
187
+ style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
192
188
  .map((hybrid) => `sp${hybrid}`)
193
189
  .join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
194
190
  }
@@ -17,7 +17,6 @@ const Select_1 = __importDefault(require("../../elements/Select"));
17
17
  const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
18
18
  const Modal_1 = require("../../elements/popup/Modal");
19
19
  const Constants_1 = require("../../reducer/core/Constants");
20
- const Types_1 = require("../../reducer/types/Types");
21
20
  const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
22
21
  const CorrelationTable_1 = __importDefault(require("./CorrelationTable/CorrelationTable"));
23
22
  const Overview_1 = __importDefault(require("./Overview"));
@@ -144,7 +143,7 @@ function SummaryPanel() {
144
143
  ]);
145
144
  const handleOnSetMolecularFormula = (0, react_2.useCallback)((mf) => {
146
145
  dispatch({
147
- type: Types_1.SET_CORRELATIONS_MF,
146
+ type: 'SET_CORRELATIONS_MF',
148
147
  payload: {
149
148
  mf,
150
149
  },
@@ -152,7 +151,7 @@ function SummaryPanel() {
152
151
  }, [dispatch]);
153
152
  const handleOnSetShiftTolerance = (0, react_2.useCallback)((tolerance) => {
154
153
  dispatch({
155
- type: Types_1.SET_CORRELATIONS_TOLERANCE,
154
+ type: 'SET_CORRELATIONS_TOLERANCE',
156
155
  payload: {
157
156
  tolerance,
158
157
  },
@@ -187,7 +186,7 @@ function SummaryPanel() {
187
186
  }, [filteredCorrelationsData, selectedAdditionalColumnsAtomType]);
188
187
  const editEquivalencesSaveHandler = (0, react_2.useCallback)((correlation, value) => {
189
188
  dispatch({
190
- type: Types_1.SET_CORRELATION,
189
+ type: 'SET_CORRELATION',
191
190
  payload: {
192
191
  id: correlation.id,
193
192
  correlation: {
@@ -200,7 +199,7 @@ function SummaryPanel() {
200
199
  }, [dispatch]);
201
200
  const editNumericValuesSaveHandler = (0, react_2.useCallback)(({ correlation, values, key, }) => {
202
201
  dispatch({
203
- type: Types_1.SET_CORRELATION,
202
+ type: 'SET_CORRELATION',
204
203
  payload: {
205
204
  id: correlation.id,
206
205
  correlation: {
@@ -216,7 +215,7 @@ function SummaryPanel() {
216
215
  }, [dispatch]);
217
216
  const setCorrelationsHandler = (0, react_2.useCallback)((correlations, options) => {
218
217
  dispatch({
219
- type: Types_1.SET_CORRELATIONS,
218
+ type: 'SET_CORRELATIONS',
220
219
  payload: {
221
220
  correlations,
222
221
  options,
@@ -225,7 +224,7 @@ function SummaryPanel() {
225
224
  }, [dispatch]);
226
225
  const deleteCorrelationHandler = (0, react_2.useCallback)((correlation) => {
227
226
  dispatch({
228
- type: Types_1.DELETE_CORRELATION,
227
+ type: 'DELETE_CORRELATION',
229
228
  payload: {
230
229
  correlation,
231
230
  assignmentData,
@@ -239,29 +238,33 @@ function SummaryPanel() {
239
238
  const spectrum = (0, FindUtilities_1.findSpectrum)(spectraData, link.experimentID, false);
240
239
  const range = (0, FindUtilities_1.findRange)(spectrum, link.signal.id);
241
240
  const signal = (0, FindUtilities_1.findSignal1D)(spectrum, link.signal.id);
242
- dispatch({
243
- type: Types_1.DELETE_1D_SIGNAL,
244
- payload: {
245
- spectrum,
246
- range,
247
- signal,
248
- assignmentData,
249
- },
250
- });
241
+ if (spectrum && range && signal) {
242
+ dispatch({
243
+ type: 'DELETE_1D_SIGNAL',
244
+ payload: {
245
+ spectrum,
246
+ range,
247
+ signal,
248
+ assignmentData,
249
+ },
250
+ });
251
+ }
251
252
  }
252
253
  else if (linkDim === 2) {
253
254
  const spectrum = (0, FindUtilities_1.findSpectrum)(spectraData, link.experimentID, false);
254
255
  const zone = (0, FindUtilities_1.findZone)(spectrum, link.signal.id);
255
256
  const signal = (0, FindUtilities_1.findSignal2D)(spectrum, link.signal.id);
256
- dispatch({
257
- type: Types_1.DELETE_2D_SIGNAL,
258
- payload: {
259
- spectrum,
260
- zone,
261
- signal,
262
- assignmentData,
263
- },
264
- });
257
+ if (zone && signal) {
258
+ dispatch({
259
+ type: 'DELETE_2D_SIGNAL',
260
+ payload: {
261
+ spectrum,
262
+ zone,
263
+ signal,
264
+ assignmentData,
265
+ },
266
+ });
267
+ }
265
268
  }
266
269
  }, [assignmentData, dispatch, spectraData]);
267
270
  const changeSignalPathLengthHandler = (0, react_2.useCallback)((link) => {
@@ -270,15 +273,17 @@ function SummaryPanel() {
270
273
  const spectrum = (0, FindUtilities_1.findSpectrum)(spectraData, link.experimentID, false);
271
274
  const zone = (0, FindUtilities_1.findZone)(spectrum, link.signal.id);
272
275
  const signal = (0, FindUtilities_1.findSignal2D)(spectrum, link.signal.id);
273
- dispatch({
274
- type: Types_1.SET_2D_SIGNAL_PATH_LENGTH,
275
- payload: {
276
- spectrum,
277
- zone,
278
- signal,
279
- pathLength: link.signal.j?.pathLength,
280
- },
281
- });
276
+ if (zone && signal) {
277
+ dispatch({
278
+ type: 'SET_2D_SIGNAL_PATH_LENGTH',
279
+ payload: {
280
+ spectrum,
281
+ zone,
282
+ signal,
283
+ pathLength: link.signal.j?.pathLength,
284
+ },
285
+ });
286
+ }
282
287
  }
283
288
  }, [dispatch, spectraData]);
284
289
  const editCorrelationTableCellHandler = (0, react_2.useCallback)((editedCorrelations, action, link, options) => {
@@ -267,7 +267,7 @@ function cloneCorrelationAndSetPathLength(correlation, editedLink, axis) {
267
267
  function convertValuesString(valuesString, key) {
268
268
  valuesString = valuesString
269
269
  .toLowerCase()
270
- .replace(/\s+/g, '')
270
+ .replaceAll(/\s+/g, '')
271
271
  .split(',')
272
272
  .map((token) => (token === 'sp' ? 'sp1' : token))
273
273
  .join(',');