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
@@ -4,7 +4,6 @@ import { useRef, useState } from 'react';
4
4
  import { useChartData } from '../../context/ChartContext';
5
5
  import { useDispatch } from '../../context/DispatchContext';
6
6
  import { useAlert } from '../../elements/popup/Alert';
7
- import { SET_AUTOMATIC_ASSIGNMENTS } from '../../reducer/types/Types';
8
7
  import { assert } from '../../utility/assert';
9
8
  function mapSpectra(data) {
10
9
  return data.map((spectrum) => {
@@ -28,10 +27,12 @@ export function useAutoAssignments() {
28
27
  const alert = useAlert();
29
28
  const [assignments, setAssignments] = useState([]);
30
29
  function restAssignments() {
31
- dispatch({
32
- type: SET_AUTOMATIC_ASSIGNMENTS,
33
- payload: { assignments: originData.current },
34
- });
30
+ if (originData.current) {
31
+ dispatch({
32
+ type: 'SET_AUTOMATIC_ASSIGNMENTS',
33
+ payload: { assignments: originData.current },
34
+ });
35
+ }
35
36
  }
36
37
  function getAssignments() {
37
38
  void (async () => {
@@ -47,7 +48,7 @@ export function useAutoAssignments() {
47
48
  }, { minScore: 0 });
48
49
  if (result[0]?.assignment) {
49
50
  dispatch({
50
- type: SET_AUTOMATIC_ASSIGNMENTS,
51
+ type: 'SET_AUTOMATIC_ASSIGNMENTS',
51
52
  payload: { assignments: result[0].assignment },
52
53
  });
53
54
  }
@@ -72,12 +72,12 @@ const columns = [
72
72
  }, children: `${row.original.value}` })),
73
73
  },
74
74
  ];
75
- function InformationPanelInner({ info, meta, metaInfo, }) {
75
+ function InformationPanelInner({ info, meta, customInfo, }) {
76
76
  const [searchKey, setSearchKey] = useState();
77
77
  const [panelsStatus, openPanel] = useState({
78
78
  info: true,
79
79
  meta: true,
80
- metaInfo: true,
80
+ customInfo: true,
81
81
  });
82
82
  function handleSearch(e) {
83
83
  const searchKey = e.target.value.toLowerCase();
@@ -85,7 +85,7 @@ function InformationPanelInner({ info, meta, metaInfo, }) {
85
85
  }
86
86
  const matchesInfo = filter(searchKey, info);
87
87
  const matchesMeta = filter(searchKey, meta);
88
- const matchesMetaInfo = filter(searchKey, metaInfo);
88
+ const matchesMetaInfo = filter(searchKey, customInfo);
89
89
  function handleOpen(key) {
90
90
  openPanel((prevPanelsStatus) => ({
91
91
  ...prevPanelsStatus,
@@ -95,11 +95,11 @@ function InformationPanelInner({ info, meta, metaInfo, }) {
95
95
  return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx(Input, { placeholder: "Search for parameter...", onChange: handleSearch, debounceTime: 250, style: {
96
96
  inputWrapper: { width: '100%' },
97
97
  input: { textAlign: 'left', padding: '5px' },
98
- } }) }), _jsxs("div", { style: styles.tableContainer, children: [_jsx(InformationTable, { data: matchesInfo, columns: columns, title: "Spectrum information", onClick: () => handleOpen('info'), isOpen: panelsStatus.info }), _jsx(InformationTable, { data: matchesMeta, columns: columns, title: "Other parameters", onClick: () => handleOpen('meta'), isOpen: panelsStatus.meta }), _jsx(InformationTable, { data: matchesMetaInfo, columns: columns, title: "Meta Info parameters", onClick: () => handleOpen('metaInfo'), isOpen: panelsStatus.metaInfo })] })] }));
98
+ } }) }), _jsxs("div", { style: styles.tableContainer, children: [_jsx(InformationTable, { data: matchesMetaInfo, columns: columns, title: "Custom information", onClick: () => handleOpen('customInfo'), isOpen: panelsStatus.customInfo }), _jsx(InformationTable, { data: matchesInfo, columns: columns, title: "Spectrum information", onClick: () => handleOpen('info'), isOpen: panelsStatus.info }), _jsx(InformationTable, { data: matchesMeta, columns: columns, title: "Other spectrum parameters", onClick: () => handleOpen('meta'), isOpen: panelsStatus.meta })] })] }));
99
99
  }
100
100
  const MemoizedInformationPanel = memo(InformationPanelInner);
101
101
  const emptyData = { info: {}, meta: {} };
102
102
  export default function InformationPanel() {
103
- const { info, meta, metaInfo } = useSpectrum(emptyData);
104
- return _jsx(MemoizedInformationPanel, { ...{ info, meta, metaInfo } });
103
+ const { info, meta, customInfo } = useSpectrum(emptyData);
104
+ return _jsx(MemoizedInformationPanel, { info, meta, customInfo });
105
105
  }
@@ -7,12 +7,11 @@ import { useCallback, useMemo, useState, useRef, memo } from 'react';
7
7
  import { ImLink } from 'react-icons/im';
8
8
  import { useChartData } from '../../context/ChartContext';
9
9
  import { useDispatch } from '../../context/DispatchContext';
10
- import ToggleButton from '../../elements/ToggleButton';
10
+ import ActiveButton from '../../elements/ActiveButton';
11
11
  import ToolTip from '../../elements/ToolTip/ToolTip';
12
12
  import { useModal } from '../../elements/popup/Modal';
13
13
  import useSpectrum from '../../hooks/useSpectrum';
14
14
  import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
15
- import { DELETE_INTEGRAL, CHANGE_INTEGRAL_SUM, CHANGE_INTEGRALS_SUM_FLAG, } from '../../reducer/types/Types';
16
15
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
17
16
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
18
17
  import PreferencesHeader from '../header/PreferencesHeader';
@@ -26,12 +25,6 @@ const style = css `
26
25
  align-items: center;
27
26
  justify-content: center;
28
27
  }
29
-
30
- .fix-integral-toggle-btn {
31
- svg {
32
- font-size: 12px !important;
33
- }
34
- }
35
28
  `;
36
29
  function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
37
30
  const [filterIsActive, setFilterIsActive] = useState(false);
@@ -40,7 +33,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
40
33
  const [isFlipped, setFlipStatus] = useState(false);
41
34
  const settingRef = useRef();
42
35
  const yesHandler = useCallback(() => {
43
- dispatch({ type: DELETE_INTEGRAL, integralID: null });
36
+ dispatch({ type: 'DELETE_INTEGRAL', payload: {} });
44
37
  }, [dispatch]);
45
38
  const handleDeleteAll = useCallback(() => {
46
39
  modal.showConfirmDialog({
@@ -48,8 +41,8 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
48
41
  buttons: [{ text: 'Yes', handler: yesHandler }, { text: 'No' }],
49
42
  });
50
43
  }, [modal, yesHandler]);
51
- const changeIntegralSumHandler = useCallback((value) => {
52
- dispatch({ type: CHANGE_INTEGRAL_SUM, value });
44
+ const changeIntegralSumHandler = useCallback((options) => {
45
+ dispatch({ type: 'CHANGE_INTEGRAL_SUM', payload: { options } });
53
46
  modal.close();
54
47
  }, [dispatch, modal]);
55
48
  const currentSum = useMemo(() => {
@@ -70,8 +63,8 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
70
63
  const handleOnFilter = useCallback(() => {
71
64
  setFilterIsActive(!filterIsActive);
72
65
  }, [filterIsActive]);
73
- const toggleConstantSumHandler = useCallback((flag) => {
74
- dispatch({ type: CHANGE_INTEGRALS_SUM_FLAG, payload: flag });
66
+ const toggleConstantSumHandler = useCallback(() => {
67
+ dispatch({ type: 'CHANGE_INTEGRALS_SUM_FLAG' });
75
68
  }, [dispatch]);
76
69
  const filteredData = useMemo(() => {
77
70
  function isInRange(from, to) {
@@ -105,17 +98,15 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
105
98
  `,
106
99
  ], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: integrals?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: currentSum
107
100
  ? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
108
- : 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(ToggleButton, { className: "fix-integral-toggle-btn", popupTitle: "Fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: _jsx(ImLink, {}) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab })) : (_jsx(IntegralsPreferences, { ref: settingRef })) })] }));
101
+ : 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, value: integrals?.options?.isSumConstant || false, children: _jsx(ImLink, {}) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab })) : (_jsx(IntegralsPreferences, { ref: settingRef })) })] }));
109
102
  }
110
103
  const MemoizedIntegralPanel = memo(IntegralPanelInner);
111
104
  const emptyData = { integrals: {}, info: {} };
112
105
  export default function IntegralPanel() {
113
106
  const { xDomain, view: { spectra: { activeTab }, }, } = useChartData();
114
107
  const { integrals, info } = useSpectrum(emptyData);
115
- return (_jsx(MemoizedIntegralPanel, { ...{
116
- integrals,
117
- info,
118
- xDomain,
119
- activeTab,
120
- } }));
108
+ return (_jsx(MemoizedIntegralPanel, { integrals,
109
+ info,
110
+ xDomain,
111
+ activeTab }));
121
112
  }
@@ -10,7 +10,6 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
10
10
  import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn';
11
11
  import Select from '../../elements/Select';
12
12
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
13
- import { DELETE_INTEGRAL, CHANGE_INTEGRAL_DATA, CHANGE_INTEGRAL_RELATIVE, } from '../../reducer/types/Types';
14
13
  import { formatNumber } from '../../utility/formatNumber';
15
14
  import NoTableData from '../extra/placeholder/NoTableData';
16
15
  const selectStyle = { width: '100%', border: 'none' };
@@ -19,17 +18,19 @@ function IntegralTable({ activeTab, data }) {
19
18
  const deleteIntegralHandler = useCallback((e, row) => {
20
19
  e.preventDefault();
21
20
  e.stopPropagation();
22
- const params = row.original;
21
+ const { id } = row.original;
23
22
  dispatch({
24
- type: DELETE_INTEGRAL,
25
- integralID: params.id,
23
+ type: 'DELETE_INTEGRAL',
24
+ payload: {
25
+ id,
26
+ },
26
27
  });
27
28
  }, [dispatch]);
28
29
  const changeIntegralDataHandler = useCallback((value, row) => {
29
- const data = { ...row.original, kind: value };
30
+ const integral = { ...row.original, kind: value };
30
31
  dispatch({
31
- type: CHANGE_INTEGRAL_DATA,
32
- payload: { data },
32
+ type: 'CHANGE_INTEGRAL',
33
+ payload: { integral },
33
34
  });
34
35
  }, [dispatch]);
35
36
  const initialColumns = useMemo(() => [
@@ -37,42 +38,31 @@ function IntegralTable({ activeTab, data }) {
37
38
  index: 1,
38
39
  Header: '#',
39
40
  accessor: (_, index) => index + 1,
40
- width: 10,
41
+ style: { width: '30px', maxWidth: '30px' },
41
42
  },
42
43
  {
43
44
  index: 2,
44
45
  Header: 'From',
45
46
  sortType: 'basic',
46
- resizable: true,
47
47
  accessor: (row) => row.from.toFixed(2),
48
48
  },
49
49
  {
50
50
  index: 3,
51
51
  Header: 'To',
52
52
  sortType: 'basic',
53
- resizable: true,
54
53
  accessor: (row) => row.to.toFixed(2),
55
54
  },
56
- {
57
- index: 6,
58
- Header: 'Kind',
59
- sortType: 'basic',
60
- resizable: true,
61
- accessor: 'kind',
62
- Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
63
- },
64
55
  {
65
56
  index: 7,
66
57
  style: { width: '1%', maxWidth: '24px', minWidth: '24px' },
67
58
  id: 'delete-button',
68
59
  Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: _jsx(FaRegTrashAlt, {}) })),
69
60
  },
70
- ], [changeIntegralDataHandler, deleteIntegralHandler]);
61
+ ], [deleteIntegralHandler]);
71
62
  const saveRelativeHandler = useCallback((event, row) => {
72
- const data = { value: event.target.value, id: row.id };
73
63
  dispatch({
74
- type: CHANGE_INTEGRAL_RELATIVE,
75
- payload: { data },
64
+ type: 'CHANGE_INTEGRAL_RELATIVE',
65
+ payload: { value: event.target.value, id: row.id },
76
66
  });
77
67
  }, [dispatch]);
78
68
  const integralsPreferences = usePanelPreferences('integrals', activeTab);
@@ -103,7 +93,21 @@ function IntegralTable({ activeTab, data }) {
103
93
  return (_jsx(EditableColumn, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
104
94
  },
105
95
  },
106
- ], [activeTab, integralsPreferences, saveRelativeHandler]);
96
+ {
97
+ index: 6,
98
+ Header: 'Kind',
99
+ sortType: 'basic',
100
+ resizable: true,
101
+ accessor: 'kind',
102
+ showWhen: 'showKind',
103
+ Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
104
+ },
105
+ ], [
106
+ activeTab,
107
+ changeIntegralDataHandler,
108
+ integralsPreferences,
109
+ saveRelativeHandler,
110
+ ]);
107
111
  const tableColumns = useMemo(() => {
108
112
  let columns = [...initialColumns];
109
113
  for (const col of COLUMNS) {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Formik } from 'formik';
3
- import { useEffect, useCallback, useImperativeHandle, useRef, memo, forwardRef, useMemo, } from 'react';
3
+ import { useCallback, useImperativeHandle, useRef, memo, forwardRef, useMemo, } from 'react';
4
4
  import { usePreferences } from '../../context/PreferencesContext';
5
5
  import Label from '../../elements/Label';
6
6
  import FormikColorInput from '../../elements/formik/FormikColorInput';
@@ -23,6 +23,12 @@ const formatFields = [
23
23
  checkControllerName: 'relative.show',
24
24
  formatControllerName: 'relative.format',
25
25
  },
26
+ {
27
+ id: 3,
28
+ label: 'Kind :',
29
+ checkControllerName: 'showKind',
30
+ hideFormatField: true,
31
+ },
26
32
  ];
27
33
  function IntegralsPreferences(props, ref) {
28
34
  const preferences = usePreferences();
@@ -30,9 +36,6 @@ function IntegralsPreferences(props, ref) {
30
36
  const nuclei = useMemo(() => getUniqueNuclei(nucleus), [nucleus]);
31
37
  const preferencesByNuclei = usePanelPreferencesByNuclei('integrals', nuclei);
32
38
  const formRef = useRef();
33
- useEffect(() => {
34
- formRef.current.setValues(preferencesByNuclei);
35
- }, [preferencesByNuclei]);
36
39
  const saveHandler = useCallback((values) => {
37
40
  preferences.dispatch({
38
41
  type: 'SET_PANELS_PREFERENCES',
@@ -44,7 +47,7 @@ function IntegralsPreferences(props, ref) {
44
47
  formRef.current.submitForm();
45
48
  },
46
49
  }));
47
- return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(FormikColorInput, { name: `nuclei.${n}.color` }), _jsx(Label, { title: "stroke width :", style: {
50
+ return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(FormikColorInput, { name: `nuclei.${n}.color` }), _jsx(Label, { title: "stroke width :", style: {
48
51
  label: {
49
52
  fontSize: '11px',
50
53
  fontWeight: 'bold',
@@ -18,7 +18,7 @@ export function ExclusionsZonesTable() {
18
18
  return null;
19
19
  }
20
20
  function handleDelete(index) {
21
- setFieldValue('exclusionsZones', values.exclusionsZones.filter((_, i) => i !== index));
21
+ void setFieldValue('exclusionsZones', values.exclusionsZones.filter((_, i) => i !== index));
22
22
  }
23
23
  const exclusionsZonesColumns = [
24
24
  {
@@ -22,7 +22,7 @@ export function FiltersOptions() {
22
22
  return values.filters.map((filter, index) => {
23
23
  return (_jsx(GroupPane
24
24
  // eslint-disable-next-line react/no-array-index-key
25
- , { text: `${index + 1} - ${normalCase(filter.name)} options`, style: { ...GroupPanelStyle, container: { padding: 0 } }, renderHeader: (text) => (_jsx(FiltersPanelGroupHeader, { ...{ index, text, name: filter.name } })), children: _jsx(Fields, { filter: filter, basePath: `filters.${index}` }) }, `${index}`));
25
+ , { text: `${index + 1} - ${normalCase(filter.name)} options`, style: { ...GroupPanelStyle, container: { padding: 0 } }, renderHeader: (text) => (_jsx(FiltersPanelGroupHeader, { index, text, name: filter.name })), children: _jsx(Fields, { filter: filter, basePath: `filters.${index}` }) }, `${index}`));
26
26
  });
27
27
  }
28
28
  function Fields(props) {
@@ -82,11 +82,11 @@ function FiltersPanelGroupHeader({ index, name }) {
82
82
  function handelSelectFilter(value, index) {
83
83
  const filters = values.filters.slice(0);
84
84
  filters.splice(index, 1, value);
85
- setFieldValue('filters', filters);
85
+ void setFieldValue('filters', filters);
86
86
  }
87
87
  function handleAdd(index) {
88
88
  if (values.filters) {
89
- setFieldValue('filters', [
89
+ void setFieldValue('filters', [
90
90
  ...values.filters.slice(0, index),
91
91
  DEFAULT_MATRIX_FILTERS[0],
92
92
  ...values.filters.slice(index),
@@ -94,7 +94,7 @@ function FiltersPanelGroupHeader({ index, name }) {
94
94
  }
95
95
  }
96
96
  function handleDelete(index) {
97
- setFieldValue('filters', values.filters.filter((_, i) => i !== index));
97
+ void setFieldValue('filters', values.filters.filter((_, i) => i !== index));
98
98
  }
99
99
  return (_jsxs("div", { className: "section-header", style: { display: 'flex', padding: '5px 0px' }, children: [_jsxs("p", { style: { flex: 1, ...GroupPanelStyle.header }, children: [index + 1, "-"] }), _jsx(Select, { value: name, items: DEFAULT_MATRIX_FILTERS, onChange: (value) => handelSelectFilter(value, index), style: { width: '100%' }, returnValue: false, itemTextField: "name", itemValueField: "name", textRender: (text) => normalCase(text) }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx(Button.Danger, { fill: "outline", onClick: () => handleDelete(index), children: _jsx(FaTimes, {}) }), _jsx(Button.Done, { fill: "outline", onClick: () => handleAdd(index + 1), style: { marginLeft: '5px' }, children: _jsx(FaPlus, {}) })] })] }));
100
100
  }
@@ -18,7 +18,6 @@ import FormikInput from '../../elements/formik/FormikInput';
18
18
  import FormikOnChange from '../../elements/formik/FormikOnChange';
19
19
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
20
20
  import useToolsFunctions from '../../hooks/useToolsFunctions';
21
- import { APPLY_SIGNAL_PROCESSING_FILTER } from '../../reducer/types/Types';
22
21
  import { options } from '../../toolbar/ToolTypes';
23
22
  import { exportAsMatrix } from '../../utility/export';
24
23
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
@@ -67,7 +66,7 @@ function MatrixGenerationPanel() {
67
66
  exportAsMatrix(data, 'Spectra Matrix');
68
67
  }
69
68
  function handleSave(options) {
70
- dispatch({ type: APPLY_SIGNAL_PROCESSING_FILTER, payload: { options } });
69
+ dispatch({ type: 'APPLY_SIGNAL_PROCESSING_FILTER', payload: { options } });
71
70
  }
72
71
  function handleOnChange(options) {
73
72
  preferences.dispatch({
@@ -4,7 +4,6 @@ import { MF } from 'react-mf';
4
4
  import { extractLabelsNumbers, extractNumber, } from '../../../data/molecules/MoleculeManager';
5
5
  import { useDispatch } from '../../context/DispatchContext';
6
6
  import EditableColumn from '../../elements/EditableColumn';
7
- import { CHANGE_MOLECULE_LABEL } from '../../reducer/types/Types';
8
7
  const styles = {
9
8
  toolbar: {
10
9
  display: 'flex',
@@ -32,7 +31,7 @@ export default function MoleculeHeader(props) {
32
31
  }, [molecules]);
33
32
  const saveLabelHandler = useCallback((id, event) => {
34
33
  const label = event.target.value;
35
- dispatch({ type: CHANGE_MOLECULE_LABEL, payload: { label, id } });
34
+ dispatch({ type: 'CHANGE_MOLECULE_LABEL', payload: { label, id } });
36
35
  }, [dispatch]);
37
36
  return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event), textOverFlowEllipses: true })] }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
38
37
  }
@@ -10,7 +10,6 @@ import { useDispatch } from '../../context/DispatchContext';
10
10
  import NextPrev from '../../elements/NextPrev';
11
11
  import useSpectrum from '../../hooks/useSpectrum';
12
12
  import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal';
13
- import { SET_MOLECULE } from '../../reducer/types/Types';
14
13
  import MoleculeHeader from './MoleculeHeader';
15
14
  import MoleculePanelHeader from './MoleculePanelHeader';
16
15
  import useAtomAssignment from './useAtomAssignment';
@@ -65,7 +64,7 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, molecules
65
64
  const handleReplaceMolecule = useCallback((molecule, molfile) => {
66
65
  const { id, label } = molecule;
67
66
  dispatch({
68
- type: SET_MOLECULE,
67
+ type: 'SET_MOLECULE',
69
68
  payload: { molfile, id, label },
70
69
  });
71
70
  }, [dispatch]);
@@ -91,15 +90,13 @@ export default function MoleculePanel({ onMoleculeChange, children, actionsOptio
91
90
  const data = useSpectrum(emptyData);
92
91
  const ranges = data?.ranges || {};
93
92
  const zones = data?.zones || {};
94
- return (_jsx(MemoizedMoleculePanel, { ...{
95
- molecules,
96
- moleculesView,
97
- displayerMode,
98
- activeTab,
99
- ranges,
100
- zones,
101
- onMoleculeChange,
102
- actionsOptions,
103
- emptyTextStyle,
104
- }, children: children }));
93
+ return (_jsx(MemoizedMoleculePanel, { molecules,
94
+ moleculesView,
95
+ displayerMode,
96
+ activeTab,
97
+ ranges,
98
+ zones,
99
+ onMoleculeChange,
100
+ actionsOptions,
101
+ emptyTextStyle, children: children }));
105
102
  }
@@ -5,6 +5,7 @@ export interface MoleculeHeaderActionsOptions {
5
5
  hideExport?: boolean;
6
6
  hideDelete?: boolean;
7
7
  hidePredict?: boolean;
8
+ showAboutPredict?: boolean;
8
9
  }
9
10
  interface MoleculePanelHeaderProps {
10
11
  currentIndex: number;
@@ -15,14 +15,14 @@ import MenuButton from '../../elements/MenuButton';
15
15
  import ToolTip from '../../elements/ToolTip/ToolTip';
16
16
  import { useAlert } from '../../elements/popup/Alert';
17
17
  import { positions, useModal } from '../../elements/popup/Modal';
18
+ import AboutPredictionModal from '../../modal/AboutPredictionModal';
18
19
  import PredictSpectraModal from '../../modal/PredictSpectraModal';
19
- import { ADD_MOLECULE, DELETE_MOLECULE, FLOAT_MOLECULE_OVER_SPECTRUM, TOGGLE_MOLECULE_ATOM_NUMBER, } from '../../reducer/types/Types';
20
20
  import { copyPNGToClipboard, copyTextToClipboard, exportAsSVG, } from '../../utility/export';
21
21
  const toolbarStyle = css `
22
22
  display: flex;
23
23
  flex-direction: row;
24
24
  border-bottom: 0.55px solid rgb(240 240 240);
25
- padding: 0 5px;
25
+ padding: 2px 5px;
26
26
 
27
27
  button svg {
28
28
  fill: #4e4e4e;
@@ -130,14 +130,14 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
130
130
  ]);
131
131
  const handlePaste = useCallback(() => {
132
132
  void navigator.clipboard.readText().then((molfile) => {
133
- dispatch({ type: ADD_MOLECULE, molfile });
133
+ dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
134
134
  });
135
135
  }, [dispatch]);
136
136
  const handleDelete = useCallback(() => {
137
137
  if (molecules[currentIndex]?.id) {
138
138
  onMoleculeIndexChange(0);
139
139
  dispatch({
140
- type: DELETE_MOLECULE,
140
+ type: 'DELETE_MOLECULE',
141
141
  payload: { id: molecules[currentIndex].id, assignmentData },
142
142
  });
143
143
  }
@@ -157,18 +157,18 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
157
157
  }, [modal, molecules, currentIndex]);
158
158
  function floatMoleculeHandler() {
159
159
  dispatch({
160
- type: FLOAT_MOLECULE_OVER_SPECTRUM,
160
+ type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
161
161
  payload: { id: moleculeKey },
162
162
  });
163
163
  }
164
164
  function showAtomNumbersHandler() {
165
165
  dispatch({
166
- type: TOGGLE_MOLECULE_ATOM_NUMBER,
166
+ type: 'TOGGLE_MOLECULE_ATOM_NUMBER',
167
167
  payload: { id: moleculeKey },
168
168
  });
169
169
  }
170
170
  const hasMolecules = molecules && molecules.length > 0;
171
- return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && hasMolecules && (_jsx(ButtonToolTip, { popupTitle: "Predict spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), _jsx(ActiveButton, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: _jsx(IoOpenOutline, {}) }), _jsx(ActiveButton, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: _jsx("p", { style: atomLabelStyle, children: "#" }) }), _jsxs("p", { children: [molecules &&
171
+ return (_jsxs("div", { css: toolbarStyle, children: [actionsOptions?.showAboutPredict && _jsx(AboutPredictionModal, {}), !actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && hasMolecules && (_jsx(ButtonToolTip, { popupTitle: "Predict spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), _jsx(ActiveButton, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: _jsx(IoOpenOutline, {}) }), _jsx(ActiveButton, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: _jsx("p", { style: atomLabelStyle, children: "#" }) }), _jsxs("p", { children: [molecules &&
172
172
  molecules.length > 0 &&
173
173
  `${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
174
174
  }
@@ -29,4 +29,7 @@ export declare function findDatumAndSignalIndex(data: (Range | Zone)[], id: stri
29
29
  };
30
30
  export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: any, data: any): string[];
31
31
  export declare function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext): string[];
32
- export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData): (number | string[])[];
32
+ export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData): {
33
+ diaIDs: string[];
34
+ nbAtoms: number;
35
+ };
@@ -1,6 +1,6 @@
1
1
  function getElements(activeTab) {
2
2
  const nuclei = activeTab.split(',');
3
- return nuclei.map((nucleus) => nucleus.replace(/\d/g, ''));
3
+ return nuclei.map((nucleus) => nucleus.replaceAll(/\d/g, ''));
4
4
  }
5
5
  /**
6
6
  * Returns the OCL id(s) and number of atoms of an atom when hovering over
@@ -99,5 +99,5 @@ export function toggleDiaIDs(diaIDs, atomInformation) {
99
99
  _diaIDs.push(oclID);
100
100
  }
101
101
  }
102
- return [_diaIDs, tempNbAtoms];
102
+ return { diaIDs: _diaIDs, nbAtoms: tempNbAtoms };
103
103
  }
@@ -7,7 +7,6 @@ import { useDispatch } from '../../context/DispatchContext';
7
7
  import { useAlert } from '../../elements/popup/Alert';
8
8
  import { HighlightEventSource, useHighlightData } from '../../highlight';
9
9
  import { DISPLAYER_MODE } from '../../reducer/core/Constants';
10
- import { SET_DIAID_RANGE, SET_DIAID_ZONE } from '../../reducer/types/Types';
11
10
  import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
12
11
  export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
13
12
  const alert = useAlert();
@@ -127,13 +126,13 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
127
126
  else {
128
127
  _diaIDs = range?.signals[signalIndex]?.diaIDs || [];
129
128
  }
130
- const [_diaID, nbAtoms] = toggleAssignment(_diaIDs, atomInformation);
129
+ const { diaIDs, nbAtoms } = toggleAssignment(_diaIDs, atomInformation);
131
130
  dispatch({
132
- type: SET_DIAID_RANGE,
131
+ type: 'SET_DIAID_RANGE',
133
132
  payload: {
134
133
  nbAtoms,
135
- rangeData: datum,
136
- diaIDs: _diaID,
134
+ range,
135
+ diaIDs,
137
136
  signalIndex,
138
137
  },
139
138
  });
@@ -147,13 +146,13 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
147
146
  else {
148
147
  _diaIDs = zone?.signals[signalIndex][axis]?.diaIDs || [];
149
148
  }
150
- const [_diaID, nbAtoms] = toggleAssignment(_diaIDs, atomInformation);
149
+ const { diaIDs, nbAtoms } = toggleAssignment(_diaIDs, atomInformation);
151
150
  dispatch({
152
- type: SET_DIAID_ZONE,
151
+ type: 'SET_ZONE_DIAID',
153
152
  payload: {
154
153
  nbAtoms,
155
- zoneData: datum,
156
- diaIDs: _diaID,
154
+ zone,
155
+ diaIDs,
157
156
  axis,
158
157
  signalIndex,
159
158
  },
@@ -14,7 +14,6 @@ import { positions, useAlert } from '../../elements/popup/Alert';
14
14
  import { useModal } from '../../elements/popup/Modal';
15
15
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
16
16
  import AlignSpectraModal from '../../modal/AlignSpectraModal';
17
- import { RESET_SELECTED_TOOL, TOGGLE_SPECTRA_LEGEND, } from '../../reducer/types/Types';
18
17
  import { copyTextToClipboard } from '../../utility/export';
19
18
  import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
20
19
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
@@ -41,10 +40,10 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, })
41
40
  setFlipStatus(false);
42
41
  }, []);
43
42
  const showTrackerHandler = useCallback(() => {
44
- dispatch({ type: TOGGLE_SPECTRA_LEGEND });
43
+ dispatch({ type: 'TOGGLE_SPECTRA_LEGEND' });
45
44
  }, [dispatch]);
46
45
  const openAlignSpectra = useCallback(() => {
47
- dispatch({ type: RESET_SELECTED_TOOL });
46
+ dispatch({ type: 'RESET_SELECTED_TOOL' });
48
47
  modal.show(_jsx(AlignSpectraModal, { nucleus: activeTab }), {
49
48
  isBackgroundBlur: false,
50
49
  position: positions.TOP_CENTER,
@@ -80,5 +79,5 @@ export default function MultipleSpectraAnalysisPanel() {
80
79
  if (!activeTab) {
81
80
  return _jsx("div", {});
82
81
  }
83
- return (_jsx(MemoizedMultipleSpectraAnalysisPanel, { ...{ activeTab, displayerKey, spectra, showLegend } }));
82
+ return (_jsx(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerKey, spectra, showLegend }));
84
83
  }
@@ -6,7 +6,6 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
6
6
  import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn';
7
7
  import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
8
8
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
9
- import { ORDER_MULTIPLE_SPECTRA_ANALYSIS } from '../../reducer/types/Types';
10
9
  import evaluate from '../../utility/Evaluate';
11
10
  import NoTableData from '../extra/placeholder/NoTableData';
12
11
  import AnalysisCell from './base/AnalysisCell';
@@ -80,7 +79,7 @@ function MultipleSpectraAnalysisTable({ data, activeTab, resortSpectra, }) {
80
79
  function handleSortEnd(data) {
81
80
  if (resortSpectra) {
82
81
  dispatch({
83
- type: ORDER_MULTIPLE_SPECTRA_ANALYSIS,
82
+ type: 'ORDER_MULTIPLE_SPECTRA_ANALYSIS',
84
83
  payload: {
85
84
  data,
86
85
  },
@@ -10,7 +10,7 @@ const inputStyle = { input: { width: '100%', fontSize: '1.15em' } };
10
10
  export function AnalysisTablePreferences() {
11
11
  const { values: { analysisOptions: { columns }, }, setFieldValue, } = useFormikContext();
12
12
  const addNewColumn = useCallback((index, columns) => {
13
- setFieldValue('analysisOptions.columns', [
13
+ void setFieldValue('analysisOptions.columns', [
14
14
  ...columns,
15
15
  {
16
16
  tempKey: '',
@@ -22,7 +22,7 @@ export function AnalysisTablePreferences() {
22
22
  ]);
23
23
  }, [setFieldValue]);
24
24
  const handleDelete = useCallback((index, columns) => {
25
- setFieldValue('analysisOptions.columns', columns.filter((_, colIndex) => colIndex !== index));
25
+ void setFieldValue('analysisOptions.columns', columns.filter((_, colIndex) => colIndex !== index));
26
26
  }, [setFieldValue]);
27
27
  const COLUMNS = useMemo(() => {
28
28
  return [