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
@@ -59,15 +59,13 @@ function InnerMultiplicityTree({ labelOptions, onUnlink, data, width: widthProp,
59
59
  onUnlink(index);
60
60
  }
61
61
  const isHighlighted = highlight.isActive || assignment.isActive;
62
- return ((0, jsx_runtime_1.jsxs)("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, ...{
63
- onMouseEnter: () => {
64
- assignment.show('x');
65
- highlight.show();
66
- },
67
- onMouseLeave: () => {
68
- assignment.hide();
69
- highlight.hide();
70
- },
62
+ return ((0, jsx_runtime_1.jsxs)("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, onMouseEnter: () => {
63
+ assignment.show('x');
64
+ highlight.show();
65
+ },
66
+ onMouseLeave: () => {
67
+ assignment.hide();
68
+ highlight.hide();
71
69
  }, pointerEvents: "bounding-box", ...(!assignment.isActive && { css: cssStyle }), children: [drawTree(data, { scaleX, labelOptions, showLabels }), (0, jsx_runtime_1.jsx)("rect", { x: startX - BOX_PADDING, y: startY - BOX_PADDING, width: width + BOX_PADDING * 2, height: height + BOX_PADDING * 2, fill: isHighlighted ? '#ff6f0057' : 'transparent', "data-no-export": "true" }), (0, jsx_runtime_1.jsx)(AssignmentActionsButtons_1.AssignmentActionsButtons, { className: "signal-target", isActive: !!(assignment.isActive || signal?.diaIDs), y: startY, x: scaleX()(signal.delta) - 30, onAssign: assignHandler, onUnAssign: unAssignHandler, borderRadius: 16 })] }));
72
70
  }
73
71
  function MultiplicityTree(props) {
@@ -7,7 +7,6 @@ const react_2 = require("react");
7
7
  const DispatchContext_1 = require("../../context/DispatchContext");
8
8
  const highlight_1 = require("../../highlight");
9
9
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
10
- const Types_1 = require("../../reducer/types/Types");
11
10
  const formatNumber_1 = require("../../utility/formatNumber");
12
11
  const styles = (0, react_1.css) `
13
12
  input {
@@ -55,7 +54,7 @@ value, color, nucleus, }) {
55
54
  extra: { id },
56
55
  });
57
56
  const dispatch = (0, DispatchContext_1.useDispatch)();
58
- const handleOnPeakChange = (0, react_2.useCallback)((e) => dispatch({ type: Types_1.SHIFT_SPECTRUM, shiftValue: e.shiftValue }), [dispatch]);
57
+ const handleOnPeakChange = (0, react_2.useCallback)((e) => dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift: e.shiftValue } }), [dispatch]);
59
58
  (0, react_2.useLayoutEffect)(() => {
60
59
  const textBox = refText.current?.getBBox();
61
60
  setContainerSize({
@@ -15,7 +15,6 @@ const GlobalContext_1 = require("../../context/GlobalContext");
15
15
  const ScaleContext_1 = require("../../context/ScaleContext");
16
16
  const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
17
17
  const highlight_1 = require("../../highlight");
18
- const Types_1 = require("../../reducer/types/Types");
19
18
  const ToolTypes_1 = require("../../toolbar/ToolTypes");
20
19
  const IntegralIndicator_1 = require("../integral/IntegralIndicator");
21
20
  const MultiplicityTree_1 = require("../multiplicityTree/MultiplicityTree");
@@ -42,11 +41,13 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
42
41
  const isBlockedByEditing = selectedTool && selectedTool === ToolTypes_1.options.editRange.id;
43
42
  function handleOnStopResizing(position) {
44
43
  dispatch({
45
- type: Types_1.RESIZE_RANGE,
46
- data: {
47
- ...range,
48
- from: scaleX().invert(position.x2),
49
- to: scaleX().invert(position.x1),
44
+ type: 'RESIZE_RANGE',
45
+ payload: {
46
+ range: {
47
+ ...range,
48
+ from: scaleX().invert(position.x2),
49
+ to: scaleX().invert(position.x1),
50
+ },
50
51
  },
51
52
  });
52
53
  }
@@ -60,9 +61,9 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
60
61
  }
61
62
  function unAssignHandler(signalIndex = -1) {
62
63
  dispatch({
63
- type: Types_1.UNLINK_RANGE,
64
+ type: 'UNLINK_RANGE',
64
65
  payload: {
65
- rangeData: range,
66
+ range,
66
67
  assignmentData,
67
68
  signalIndex,
68
69
  },
@@ -28,12 +28,10 @@ function Ranges() {
28
28
  if (!spectrum?.display?.isVisible) {
29
29
  return null;
30
30
  }
31
- return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ranges: spectrum.ranges, ...{
32
- showMultiplicityTrees,
33
- showRangesIntegrals,
34
- selectedTool,
35
- displayerKey,
36
- relativeFormat: rangesPreferences.relative.format,
37
- } }));
31
+ return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ranges: spectrum.ranges, showMultiplicityTrees,
32
+ showRangesIntegrals,
33
+ selectedTool,
34
+ displayerKey,
35
+ relativeFormat: rangesPreferences.relative.format }));
38
36
  }
39
37
  exports.default = Ranges;
@@ -10,7 +10,6 @@ const ChartContext_1 = require("../../context/ChartContext");
10
10
  const DispatchContext_1 = require("../../context/DispatchContext");
11
11
  const ScaleContext_1 = require("../../context/ScaleContext");
12
12
  const DeleteButton_1 = __importDefault(require("../../elements/DeleteButton"));
13
- const Types_1 = require("../../reducer/types/Types");
14
13
  const styles = (0, react_1.css) `
15
14
  pointer-events: bounding-box;
16
15
  user-select: 'none';
@@ -36,7 +35,7 @@ function BaseLineZones() {
36
35
  const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
37
36
  const dispatch = (0, DispatchContext_1.useDispatch)();
38
37
  const deleteRangeHandler = (id) => {
39
- dispatch({ type: Types_1.DELETE_BASE_LINE_ZONE, id });
38
+ dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
40
39
  };
41
40
  const baseLineZones = toolOptions.data.baselineCorrection.zones;
42
41
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: baseLineZones.length > 0 && ((0, jsx_runtime_1.jsx)("g", { children: baseLineZones.map((zone) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [(0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), (0, jsx_runtime_1.jsx)("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
@@ -15,7 +15,6 @@ const DispatchContext_1 = require("../../../context/DispatchContext");
15
15
  const GlobalContext_1 = require("../../../context/GlobalContext");
16
16
  const MoleculeStructureEditorModal_1 = require("../../../modal/MoleculeStructureEditorModal");
17
17
  const useAtomAssignment_1 = __importDefault(require("../../../panels/MoleculesPanel/useAtomAssignment"));
18
- const Types_1 = require("../../../reducer/types/Types");
19
18
  const ActionsButton_1 = __importDefault(require("./ActionsButton"));
20
19
  const style = (0, react_1.css) `
21
20
  border: 1px solid transparent;
@@ -46,7 +45,7 @@ function DraggableStructure(props) {
46
45
  const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = (0, useAtomAssignment_1.default)({ zones, ranges, activeTab, displayerMode });
47
46
  function floatMoleculeHandler() {
48
47
  dispatch({
49
- type: Types_1.FLOAT_MOLECULE_OVER_SPECTRUM,
48
+ type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
50
49
  payload: { id: molecule.id },
51
50
  });
52
51
  }
@@ -58,8 +57,8 @@ function DraggableStructure(props) {
58
57
  bounding.height += height;
59
58
  }
60
59
  dispatch({
61
- type: Types_1.CHANGE_FLOAT_MOLECULE_POSITION,
62
- payload: { id: molecule.id, bounding },
60
+ type: 'CHANGE_FLOAT_MOLECULE_POSITION',
61
+ payload: { id: molecule.id, bounding: bounding },
63
62
  });
64
63
  }
65
64
  if (!viewerRef)
@@ -71,7 +70,7 @@ function DraggableStructure(props) {
71
70
  ? currentDiaIDsToHighlight
72
71
  : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: (molfile) => {
73
72
  dispatch({
74
- type: Types_1.SET_MOLECULE,
73
+ type: 'SET_MOLECULE',
75
74
  payload: {
76
75
  molfile,
77
76
  id: molecule.id,
@@ -20,15 +20,13 @@ function FloatMoleculeStructuresInner(props) {
20
20
  .map(([id, moleculeView], index) => {
21
21
  const molecule = molecules.find((m) => m.id === id);
22
22
  (0, assert_1.assert)(molecule !== undefined, 'molecule should be defined');
23
- return ((0, jsx_runtime_1.jsx)(DraggableStructure_1.DraggableStructure, { ...{
24
- zones,
25
- ranges,
26
- activeTab,
27
- displayerMode,
28
- moleculeView,
29
- molecule,
30
- index,
31
- } }, id));
23
+ return ((0, jsx_runtime_1.jsx)(DraggableStructure_1.DraggableStructure, { zones,
24
+ ranges,
25
+ activeTab,
26
+ displayerMode,
27
+ moleculeView,
28
+ molecule,
29
+ index }, id));
32
30
  }) }));
33
31
  }
34
32
  exports.FloatMoleculeStructuresInner = FloatMoleculeStructuresInner;
@@ -39,13 +37,11 @@ function FloatMoleculeStructures() {
39
37
  const data = (0, useSpectrum_1.default)(emptyData);
40
38
  const ranges = data?.ranges || {};
41
39
  const zones = data?.zones || {};
42
- return ((0, jsx_runtime_1.jsx)(MemoizedFloatMoleculeStructures, { ...{
43
- moleculesView,
44
- molecules,
45
- displayerMode,
46
- activeTab,
47
- ranges,
48
- zones,
49
- } }));
40
+ return ((0, jsx_runtime_1.jsx)(MemoizedFloatMoleculeStructures, { moleculesView,
41
+ molecules,
42
+ displayerMode,
43
+ activeTab,
44
+ ranges,
45
+ zones }));
50
46
  }
51
47
  exports.default = FloatMoleculeStructures;
@@ -44,7 +44,7 @@ function Left1DChart({ margin: marginValue = 10, data: spectrum, }) {
44
44
  const { x, re: y } = spectrum.data;
45
45
  const pathPoints = xyReduce({ x, y });
46
46
  const pathBuilder = new PathBuilder_1.PathBuilder();
47
- pathBuilder.moveTo(scaleY(pathPoints.y[pathPoints.y.length - 1]), scaleX(pathPoints.x.length - 1));
47
+ pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
48
48
  for (let i = pathPoints.x.length - 2; i >= 0; i--) {
49
49
  pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
50
50
  }
@@ -41,7 +41,7 @@ function VerticalSliceChart({ margin: marginValue = 10, data, reverseScale = fal
41
41
  const scaleY = (0, SliceScale_1.getYScale)(height, y, marginValue);
42
42
  const pathPoints = xyReduce({ x, y });
43
43
  const pathBuilder = new PathBuilder_1.PathBuilder();
44
- pathBuilder.moveTo(scaleY(pathPoints.y[pathPoints.y.length - 1]), scaleX(pathPoints.x.length - 1));
44
+ pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
45
45
  for (let i = pathPoints.x.length - 2; i >= 0; i--) {
46
46
  pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
47
47
  }
@@ -21,6 +21,6 @@ const MemoizedChart2D = (0, react_1.memo)(chart2DInner);
21
21
  function Chart2D({ spectra }) {
22
22
  const { width, height, margin, displayerKey } = (0, ChartContext_1.useChartData)();
23
23
  const { current: { general: { spectraRendering }, }, } = (0, PreferencesContext_1.usePreferences)();
24
- return ((0, jsx_runtime_1.jsx)(MemoizedChart2D, { ...{ spectra, width, height, margin, displayerKey, spectraRendering } }));
24
+ return ((0, jsx_runtime_1.jsx)(MemoizedChart2D, { spectra, width, height, margin, displayerKey, spectraRendering }));
25
25
  }
26
26
  exports.default = Chart2D;
@@ -37,7 +37,6 @@ const MouseTracker_1 = require("../EventsTrackers/MouseTracker");
37
37
  const ChartContext_1 = require("../context/ChartContext");
38
38
  const DispatchContext_1 = require("../context/DispatchContext");
39
39
  const Spinner_1 = __importDefault(require("../loader/Spinner"));
40
- const Types_1 = require("../reducer/types/Types");
41
40
  const ToolTypes_1 = require("../toolbar/ToolTypes");
42
41
  const assert_1 = require("../utility/assert");
43
42
  const Chart2D_1 = __importDefault(require("./Chart2D"));
@@ -75,7 +74,7 @@ function Viewer2D({ emptyText = undefined }) {
75
74
  else if (brushData.shiftKey) {
76
75
  switch (selectedTool) {
77
76
  case ToolTypes_1.options.zonePicking.id:
78
- dispatch({ type: Types_1.ADD_2D_ZONE, ...brushData });
77
+ dispatch({ type: 'ADD_2D_ZONE', payload: brushData });
79
78
  break;
80
79
  default:
81
80
  break;
@@ -86,9 +85,11 @@ function Viewer2D({ emptyText = undefined }) {
86
85
  default:
87
86
  if (selectedTool != null) {
88
87
  return dispatch({
89
- type: Types_1.BRUSH_END,
90
- ...brushData,
91
- trackID: (0, DimensionLayout_1.getLayoutID)(DIMENSION, brushData),
88
+ type: 'BRUSH_END',
89
+ payload: {
90
+ ...brushData,
91
+ trackID: (0, DimensionLayout_1.getLayoutID)(DIMENSION, brushData),
92
+ },
92
93
  });
93
94
  }
94
95
  }
@@ -99,7 +100,7 @@ function Viewer2D({ emptyText = undefined }) {
99
100
  const { x: startX, y: startY } = e;
100
101
  const trackID = (0, DimensionLayout_1.getLayoutID)(DIMENSION, { startX, startY });
101
102
  if (trackID) {
102
- dispatch({ type: Types_1.FULL_ZOOM_OUT, trackID });
103
+ dispatch({ type: 'FULL_ZOOM_OUT', payload: { trackID } });
103
104
  }
104
105
  }, [DIMENSION, dispatch]);
105
106
  const handleZoom = (event) => {
@@ -107,10 +108,10 @@ function Viewer2D({ emptyText = undefined }) {
107
108
  const trackID = (0, DimensionLayout_1.getLayoutID)(DIMENSION, { startX, startY });
108
109
  if (trackID) {
109
110
  if (trackID === 'CENTER_2D') {
110
- dispatch({ type: Types_1.SET_2D_LEVEL, ...event });
111
+ dispatch({ type: 'SET_2D_LEVEL', payload: event });
111
112
  }
112
113
  else {
113
- dispatch({ type: Types_1.SET_ZOOM, event, trackID });
114
+ dispatch({ type: 'SET_ZOOM', payload: { event, trackID } });
114
115
  }
115
116
  }
116
117
  };
@@ -134,7 +135,7 @@ function ViewerResponsiveWrapper(props) {
134
135
  const dispatch = (0, DispatchContext_1.useDispatch)();
135
136
  const { width, height, children } = props;
136
137
  (0, react_1.useEffect)(() => {
137
- dispatch({ type: Types_1.SET_DIMENSIONS, width, height });
138
+ dispatch({ type: 'SET_DIMENSIONS', payload: { width, height } });
138
139
  }, [width, height, dispatch]);
139
140
  return children;
140
141
  }
@@ -73,12 +73,10 @@ function FidCanvas() {
73
73
  return null;
74
74
  const w = Math.max(canvasWidth, imageData.width);
75
75
  const h = Math.max(canvasHeight, imageData.height);
76
- return ((0, jsx_runtime_1.jsx)("foreignObject", { ...{
77
- width: canvasWidth,
78
- height: canvasHeight,
79
- x: `${left}`,
80
- y: `${top}`,
81
- }, children: (0, jsx_runtime_1.jsx)("canvas", { ref: canvasRef, ...{ width: w, height: h }, style: {
76
+ return ((0, jsx_runtime_1.jsx)("foreignObject", { width: canvasWidth,
77
+ height: canvasHeight,
78
+ x: `${left}`,
79
+ y: `${top}`, children: (0, jsx_runtime_1.jsx)("canvas", { ref: canvasRef, width: w, height: h, style: {
82
80
  backgroundColor: 'white',
83
81
  } }) }));
84
82
  }
@@ -32,12 +32,6 @@ function usePath(spectrum, contours) {
32
32
  }
33
33
  }
34
34
  }
35
- else {
36
- pathBuilder.moveTo(_scaleX(element[0].x + shift.x), _scaleY(element[0].y + shift.y));
37
- for (let j = 1; j < element.length; j++) {
38
- pathBuilder.lineTo(_scaleX(element[j].x + shift.x), _scaleY(element[j].y + shift.y));
39
- }
40
- }
41
35
  }
42
36
  pathBuilder.closePath();
43
37
  return pathBuilder.toString();
@@ -82,6 +76,6 @@ function Contours() {
82
76
  const spectra2d = (0, react_1.useMemo)(() => {
83
77
  return (0, getSpectraByNucleus_1.getSpectraByNucleus)(activeTab, spectra).filter((datum) => datum.info.isFt);
84
78
  }, [activeTab, spectra]);
85
- return (0, jsx_runtime_1.jsx)(MemoizedContours, { ...{ spectra: spectra2d, displayerKey } });
79
+ return (0, jsx_runtime_1.jsx)(MemoizedContours, { spectra: spectra2d, displayerKey });
86
80
  }
87
81
  exports.default = Contours;
@@ -19,7 +19,7 @@ function get2DYScale(props, reverse = false) {
19
19
  }
20
20
  exports.get2DYScale = get2DYScale;
21
21
  function get1DXScale(props, layout) {
22
- if (![DimensionLayout_1.LAYOUT.TOP_1D, DimensionLayout_1.LAYOUT.LEFT_1D].includes(layout)) {
22
+ if (!['TOP_1D', 'LEFT_1D'].includes(layout)) {
23
23
  throw new Error(`layout is required and must be ${DimensionLayout_1.LAYOUT.TOP_1D} or ${DimensionLayout_1.LAYOUT.LEFT_1D} `);
24
24
  }
25
25
  switch (layout) {
@@ -26,6 +26,6 @@ function Zones() {
26
26
  peaks: showPeaks,
27
27
  };
28
28
  }, [id, zoneState]);
29
- return (0, jsx_runtime_1.jsx)(MemoizedZones, { ...{ zones, display, displayerKey, isVisible } });
29
+ return (0, jsx_runtime_1.jsx)(MemoizedZones, { zones, display, displayerKey, isVisible });
30
30
  }
31
31
  exports.default = Zones;
@@ -17,7 +17,6 @@ const useCheckToolsVisibility_1 = require("../hooks/useCheckToolsVisibility");
17
17
  const useExport_1 = __importDefault(require("../hooks/useExport"));
18
18
  const useToolsFunctions_1 = __importDefault(require("../hooks/useToolsFunctions"));
19
19
  const Constants_1 = require("../reducer/core/Constants");
20
- const Types_1 = require("../reducer/types/Types");
21
20
  const ToolTypes_1 = require("../toolbar/ToolTypes");
22
21
  function KeysListenerTracker() {
23
22
  const { keysPreferences, displayerMode, overDisplayer, data, view: { spectra: { activeTab }, }, } = (0, ChartContext_1.useChartData)();
@@ -39,8 +38,10 @@ function KeysListenerTracker() {
39
38
  switch (type) {
40
39
  case index_1.HighlightEventSource.INTEGRAL: {
41
40
  dispatch({
42
- type: Types_1.DELETE_INTEGRAL,
43
- integralID: id,
41
+ type: 'DELETE_INTEGRAL',
42
+ payload: {
43
+ id,
44
+ },
44
45
  });
45
46
  // remove keys from the highlighted list after delete
46
47
  remove();
@@ -48,8 +49,10 @@ function KeysListenerTracker() {
48
49
  }
49
50
  case index_1.HighlightEventSource.PEAK: {
50
51
  dispatch({
51
- type: Types_1.DELETE_PEAK_NOTATION,
52
- data: { id },
52
+ type: 'DELETE_PEAK',
53
+ payload: {
54
+ id,
55
+ },
53
56
  });
54
57
  // remove keys from the highlighted list after delete
55
58
  remove();
@@ -57,12 +60,10 @@ function KeysListenerTracker() {
57
60
  }
58
61
  case index_1.HighlightEventSource.RANGE: {
59
62
  dispatch({
60
- type: Types_1.DELETE_RANGE,
63
+ type: 'DELETE_RANGE',
61
64
  payload: {
62
- data: {
63
- id,
64
- assignmentData,
65
- },
65
+ id,
66
+ assignmentData,
66
67
  },
67
68
  });
68
69
  // remove keys from the highlighted list after delete
@@ -71,7 +72,7 @@ function KeysListenerTracker() {
71
72
  }
72
73
  case index_1.HighlightEventSource.ZONE: {
73
74
  dispatch({
74
- type: Types_1.DELETE_2D_ZONE,
75
+ type: 'DELETE_2D_ZONE',
75
76
  payload: {
76
77
  id,
77
78
  assignmentData,
@@ -88,7 +89,7 @@ function KeysListenerTracker() {
88
89
  handler: async () => {
89
90
  const hideLoading = await alert.showLoading('Delete all spectra exclusion zones in progress');
90
91
  dispatch({
91
- type: Types_1.DELETE_EXCLUSION_ZONE,
92
+ type: 'DELETE_EXCLUSION_ZONE',
92
93
  payload: {
93
94
  zone,
94
95
  },
@@ -101,10 +102,10 @@ function KeysListenerTracker() {
101
102
  handler: async () => {
102
103
  const hideLoading = await alert.showLoading('Delete exclusion zones in progress');
103
104
  dispatch({
104
- type: Types_1.DELETE_EXCLUSION_ZONE,
105
+ type: 'DELETE_EXCLUSION_ZONE',
105
106
  payload: {
106
107
  zone,
107
- spectrumID,
108
+ spectrumId: spectrumID,
108
109
  },
109
110
  });
110
111
  hideLoading();
@@ -167,22 +168,28 @@ function KeysListenerTracker() {
167
168
  if (data && data.length > 0 && num >= 1 && num <= 9) {
168
169
  if (e.shiftKey) {
169
170
  dispatch({
170
- type: Types_1.SET_KEY_PREFERENCES,
171
- keyCode: num,
171
+ type: 'SET_KEY_PREFERENCES',
172
+ payload: {
173
+ keyCode: num,
174
+ },
172
175
  });
173
176
  alert.show(`Configuration Reset, press '${num}' again to reload it.`);
174
177
  }
175
178
  else if (!(0, checkModifierKeyActivated_1.default)(e)) {
176
179
  if (keysPreferences?.[num]) {
177
180
  dispatch({
178
- type: Types_1.APPLY_KEY_PREFERENCES,
179
- keyCode: num,
181
+ type: 'APPLY_KEY_PREFERENCES',
182
+ payload: {
183
+ keyCode: num,
184
+ },
180
185
  });
181
186
  }
182
187
  else {
183
188
  dispatch({
184
- type: Types_1.SET_KEY_PREFERENCES,
185
- keyCode: num,
189
+ type: 'SET_KEY_PREFERENCES',
190
+ payload: {
191
+ keyCode: num,
192
+ },
186
193
  });
187
194
  alert.show(`Configuration saved, press '${num}' again to reload it.`);
188
195
  }
@@ -279,7 +286,7 @@ function KeysListenerTracker() {
279
286
  break;
280
287
  case 'a': {
281
288
  dispatch({
282
- type: Types_1.CHANGE_ACTIVE_SPECTRUM,
289
+ type: 'CHANGE_ACTIVE_SPECTRUM',
283
290
  payload: {},
284
291
  });
285
292
  e.preventDefault();
@@ -60,7 +60,6 @@ const IgnoreActions_1 = __importDefault(require("./reducer/IgnoreActions"));
60
60
  const Reducer_1 = require("./reducer/Reducer");
61
61
  const Constants_1 = require("./reducer/core/Constants");
62
62
  const preferencesReducer_1 = __importStar(require("./reducer/preferences/preferencesReducer"));
63
- const Types_1 = require("./reducer/types/Types");
64
63
  const ToolBar_1 = __importDefault(require("./toolbar/ToolBar"));
65
64
  const export_1 = require("./utility/export");
66
65
  const viewerContainerStyle = (0, react_1.css) `
@@ -110,21 +109,20 @@ const defaultData = {
110
109
  spectra: [],
111
110
  };
112
111
  const NMRium = (0, react_2.forwardRef)(function NMRium(props, ref) {
113
- return ((0, jsx_runtime_1.jsx)(ui_1.RootLayout, { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, children: (0, jsx_runtime_1.jsx)(InnerNMRium, { ...props, innerRef: ref }) }) }));
112
+ const { onError, ...otherProps } = props;
113
+ return ((0, jsx_runtime_1.jsx)(ui_1.RootLayout, { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, onError: onError, children: (0, jsx_runtime_1.jsx)(InnerNMRium, { ...otherProps, innerRef: ref }) }) }));
114
114
  });
115
115
  function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces, preferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onChange, emptyText, innerRef, }) {
116
116
  const rootRef = (0, react_2.useRef)(null);
117
117
  const elementsWrapperRef = (0, react_2.useRef)(null);
118
118
  const viewerRef = (0, react_2.useRef)(null);
119
- const [show, toggle] = (0, react_use_1.useToggle)(false);
119
+ const [show, , setOff, toggle] = (0, ui_1.useOnOff)(false);
120
120
  const handleChange = (0, react_2.useRef)(onChange);
121
121
  (0, react_2.useEffect)(() => {
122
122
  handleChange.current = onChange;
123
123
  }, [onChange]);
124
124
  const isFullscreen = (0, react_use_1.useFullscreen)(rootRef, show, {
125
- onClose: () => {
126
- toggle(false);
127
- },
125
+ onClose: setOff,
128
126
  });
129
127
  const [state, dispatch] = (0, react_2.useReducer)(Reducer_1.spectrumReducer, Reducer_1.initialState, Reducer_1.initState);
130
128
  const [preferencesState, dispatchPreferences] = (0, react_2.useReducer)(preferencesReducer_1.default, preferencesReducer_1.preferencesInitialState, preferencesReducer_1.initPreferencesState);
@@ -179,14 +177,17 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
179
177
  },
180
178
  }), []);
181
179
  (0, react_2.useEffect)(() => {
182
- dispatchMiddleWare({ type: Types_1.SET_LOADING_FLAG, isLoading: true });
180
+ dispatchMiddleWare({
181
+ type: 'SET_LOADING_FLAG',
182
+ payload: { isLoading: true },
183
+ });
183
184
  if (dataProp) {
184
185
  void (0, nmr_load_save_1.readNMRiumObject)(dataProp)
185
- .then((nmriumObject) => {
186
- dispatchMiddleWare({ type: Types_1.INITIATE, payload: nmriumObject });
186
+ .then((nmriumState) => {
187
+ dispatchMiddleWare({ type: 'INITIATE', payload: { nmriumState } });
187
188
  })
188
189
  .catch((error) => {
189
- dispatch({ type: Types_1.SET_LOADING_FLAG, isLoading: false });
190
+ dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
190
191
  // eslint-disable-next-line no-alert
191
192
  alert(error.message);
192
193
  reportError(error);
@@ -205,10 +206,16 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
205
206
  return;
206
207
  }
207
208
  function mouseEnterHandler() {
208
- dispatchMiddleWare({ type: Types_1.SET_MOUSE_OVER_DISPLAYER, payload: true });
209
+ dispatchMiddleWare({
210
+ type: 'SET_MOUSE_OVER_DISPLAYER',
211
+ payload: { isMouseOverDisplayer: true },
212
+ });
209
213
  }
210
214
  function mouseLeaveHandler() {
211
- dispatchMiddleWare({ type: Types_1.SET_MOUSE_OVER_DISPLAYER, payload: false });
215
+ dispatchMiddleWare({
216
+ type: 'SET_MOUSE_OVER_DISPLAYER',
217
+ payload: { isMouseOverDisplayer: false },
218
+ });
212
219
  }
213
220
  div.addEventListener('mouseenter', mouseEnterHandler);
214
221
  div.addEventListener('mouseleave', mouseLeaveHandler);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useDispatch = exports.DispatchProvider = exports.dispatchContext = void 0;
4
4
  const react_1 = require("react");
5
- exports.dispatchContext = (0, react_1.createContext)({});
5
+ exports.dispatchContext = (0, react_1.createContext)(() => null);
6
6
  exports.DispatchProvider = exports.dispatchContext.Provider;
7
7
  function useDispatch() {
8
8
  return (0, react_1.useContext)(exports.dispatchContext);
@@ -30,7 +30,7 @@ function LoggerProvider({ children }) {
30
30
  }, [loggingLevel]);
31
31
  const markAsRead = (0, react_1.useCallback)(() => {
32
32
  if (logsHistory.length > 0) {
33
- const id = logsHistory[logsHistory.length - 1].id;
33
+ const id = logsHistory.at(-1).id;
34
34
  setLastLogId(id);
35
35
  }
36
36
  }, [logsHistory]);
@@ -212,14 +212,12 @@ Button.Info = function ButtonInfo(props) {
212
212
  };
213
213
  Button.BarButton = function BarButton(props) {
214
214
  const { ...otherProps } = props;
215
- return ((0, jsx_runtime_1.jsx)(Button, { ...{
216
- backgroundColor: { base: 'white', hover: '#f7f7f7', active: '#e7e7e7' },
217
- color: {
218
- base: 'black',
219
- hover: 'black',
220
- },
221
- style: { padding: '0.25rem' },
222
- ...otherProps,
223
- } }));
215
+ return ((0, jsx_runtime_1.jsx)(Button, { backgroundColor: { base: 'white', hover: '#f7f7f7', active: '#e7e7e7' },
216
+ color: {
217
+ base: 'black',
218
+ hover: 'black',
219
+ },
220
+ style: { padding: '0.25rem' },
221
+ ...otherProps }));
224
222
  };
225
223
  exports.default = Button;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  function renderIsotope(value) {
5
- return value.replace(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>');
5
+ return value.replaceAll(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>');
6
6
  }
7
7
  function IsotopesViewer({ value = '', ...othersProps }) {
8
8
  return ((0, jsx_runtime_1.jsx)("div", { ...othersProps,
@@ -113,8 +113,7 @@ const ReactTableInner = (0, react_1.forwardRef)(function ReactTableInner(props,
113
113
  const rowsData = enableVirtualScroll
114
114
  ? rows.slice(virtualBoundary.rows.start, end)
115
115
  : rows;
116
- const index = rowsData[rowsData.length - 1]?.original[indexKey] ||
117
- rowsData[rowsData.length - 1]?.index;
116
+ const index = rowsData.at(-1)?.original[indexKey] || rowsData.at(-1)?.index;
118
117
  const total = totalCount ? totalCount : data.length;
119
118
  const startColumn = columns[virtualBoundary.columns.start].Header;
120
119
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { ref: ref, className: "table-container", style: {
@@ -1,8 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RemoveAssignmentsButton = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
3
+ exports.RemoveAssignmentsButton = exports.removeAssignmentCssStyle = void 0;
4
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
+ /** @jsxImportSource @emotion/react */
6
+ const react_1 = require("@emotion/react");
5
7
  const fa_1 = require("react-icons/fa");
8
+ exports.removeAssignmentCssStyle = (0, react_1.css) `
9
+ .remove-assignment {
10
+ visibility: hidden;
11
+ }
12
+
13
+ &:hover {
14
+ .remove-assignment {
15
+ visibility: visible;
16
+ }
17
+ }
18
+ `;
6
19
  function RemoveAssignmentsButton({ onClick }) {
7
20
  return ((0, jsx_runtime_1.jsx)("sup", { className: "remove-assignment", children: (0, jsx_runtime_1.jsx)("button", { type: "button", style: {
8
21
  padding: 0,