nmrium 0.37.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 (371) 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 -1
  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.js +15 -7
  26. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  27. package/lib/component/context/DispatchContext.d.ts +23 -3
  28. package/lib/component/context/DispatchContext.js +1 -1
  29. package/lib/component/context/LoggerContext.js +1 -1
  30. package/lib/component/elements/Button.js +7 -9
  31. package/lib/component/elements/IsotopesViewer.js +1 -1
  32. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  33. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  34. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  35. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  36. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  37. package/lib/component/elements/formik/FormikInput.js +1 -1
  38. package/lib/component/elements/formik/FormikSelect.js +2 -2
  39. package/lib/component/elements/formik/FormikSlider.js +1 -1
  40. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  41. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  42. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  43. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  44. package/lib/component/header/Header.js +4 -6
  45. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  46. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  47. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  48. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  49. package/lib/component/hooks/useExport.js +1 -0
  50. package/lib/component/hooks/useToolsFunctions.js +8 -10
  51. package/lib/component/loader/DropZone.js +4 -5
  52. package/lib/component/loader/NoData.js +1 -1
  53. package/lib/component/modal/AlignSpectraModal.js +1 -2
  54. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  55. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  56. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  57. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  58. package/lib/component/modal/PredictSpectraModal.js +24 -21
  59. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  60. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  61. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  62. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  63. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  64. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  65. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  66. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  67. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  68. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  69. package/lib/component/panels/InformationPanel.js +6 -6
  70. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  71. package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  72. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  73. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  74. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  75. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  76. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  77. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
  78. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  79. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  80. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  81. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  82. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  83. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  84. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  85. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  86. package/lib/component/panels/Panels.js +1 -1
  87. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  88. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  89. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  90. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  91. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  92. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  93. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  94. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  95. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  96. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  97. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  98. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  99. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  100. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  101. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  102. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  103. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  104. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  105. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
  106. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  107. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
  108. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  109. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
  110. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  111. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  112. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
  113. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  114. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
  115. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  116. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  117. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  118. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  119. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  120. package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
  121. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  122. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  123. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  124. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  125. package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
  126. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  127. package/lib/component/reducer/IgnoreActions.js +35 -32
  128. package/lib/component/reducer/Reducer.d.ts +8 -5
  129. package/lib/component/reducer/Reducer.js +199 -221
  130. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  131. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  132. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  133. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  134. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  135. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  136. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  137. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  138. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  139. package/lib/component/reducer/actions/DomainActions.js +13 -19
  140. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  141. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  142. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  143. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  144. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  145. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  146. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  147. package/lib/component/reducer/actions/LoadActions.js +52 -52
  148. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  149. package/lib/component/reducer/actions/MoleculeActions.js +27 -18
  150. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  151. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  152. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  153. package/lib/component/reducer/actions/PreferencesActions.js +5 -3
  154. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  155. package/lib/component/reducer/actions/RangesActions.js +80 -65
  156. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  157. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  158. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  159. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  160. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  161. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  162. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  163. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  164. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  165. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  166. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  167. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  168. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  169. package/lib/component/reducer/types/ActionType.js +1 -0
  170. package/lib/component/toolbar/BasicToolBar.js +6 -9
  171. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  172. package/lib/component/toolbar/ToolBar.js +1 -1
  173. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  174. package/lib/component/utility/Events.d.ts +4 -4
  175. package/lib/component/utility/Events.js +2 -2
  176. package/lib/component/utility/GroupByInfoKey.js +1 -1
  177. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  178. package/lib/data/PredictionManager.d.ts +5 -8
  179. package/lib/data/PredictionManager.js +3 -3
  180. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  181. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  182. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  183. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  184. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  185. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  186. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  187. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  188. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  189. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  190. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  191. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  192. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  193. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  194. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  195. package/lib/data/matrixGeneration.js +4 -2
  196. package/lib/data/molecules/Molecule.d.ts +3 -3
  197. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  198. package/lib/data/molecules/MoleculeManager.js +1 -1
  199. package/lib/data/utilities/generateColor.js +1 -1
  200. package/lib/data/utilities/isNumber.d.ts +1 -0
  201. package/lib/data/utilities/isNumber.js +3 -0
  202. package/lib/versionInfo.js +1 -1
  203. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  204. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  205. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  206. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  207. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  208. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  209. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  210. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  211. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  212. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  213. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  214. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  215. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  216. package/lib-cjs/component/2d/Chart2D.js +1 -1
  217. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  218. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  219. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  220. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  221. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  222. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  223. package/lib-cjs/component/NMRium.js +15 -7
  224. package/lib-cjs/component/context/DispatchContext.js +1 -1
  225. package/lib-cjs/component/context/LoggerContext.js +1 -1
  226. package/lib-cjs/component/elements/Button.js +7 -9
  227. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  228. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  229. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  230. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  231. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  232. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  233. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  234. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  235. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  236. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  237. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  238. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  239. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  240. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  241. package/lib-cjs/component/header/Header.js +4 -6
  242. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  243. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  244. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  245. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  246. package/lib-cjs/component/highlight/index.js +1 -1
  247. package/lib-cjs/component/hooks/useExport.js +1 -0
  248. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  249. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  250. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  251. package/lib-cjs/component/loader/DropZone.js +4 -5
  252. package/lib-cjs/component/loader/NoData.js +1 -1
  253. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  254. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  255. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  256. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  257. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  258. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  259. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  260. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  261. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  262. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  263. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  264. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  265. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  266. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  267. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  268. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  269. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  270. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  271. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  272. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  273. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  274. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  275. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  276. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  277. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
  278. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  279. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  280. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  281. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  282. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  283. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  284. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  285. package/lib-cjs/component/panels/Panels.js +1 -1
  286. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  287. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  288. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  289. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  290. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  291. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  292. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  293. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  294. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  295. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  296. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  297. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  298. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  299. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  300. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  301. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  302. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  303. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  304. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  305. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  306. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  307. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  308. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  309. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  310. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
  311. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  312. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  313. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  314. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  315. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
  316. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  317. package/lib-cjs/component/reducer/Reducer.js +199 -221
  318. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  319. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  320. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  321. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  322. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  323. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  324. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  325. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  326. package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
  327. package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
  328. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  329. package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
  330. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  331. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  332. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  333. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  334. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  335. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  336. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  337. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  338. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  339. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  340. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  341. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  342. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  343. package/lib-cjs/data/PredictionManager.js +3 -3
  344. package/lib-cjs/data/SpectraManager.js +1 -1
  345. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  346. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  347. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  348. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  349. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  350. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  351. package/lib-cjs/data/matrixGeneration.js +4 -2
  352. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  353. package/lib-cjs/data/utilities/generateColor.js +1 -1
  354. package/lib-cjs/data/utilities/isNumber.js +7 -0
  355. package/lib-cjs/versionInfo.js +1 -1
  356. package/package.json +24 -23
  357. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  358. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  359. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  360. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  361. package/lib/component/reducer/types/Types.d.ts +0 -132
  362. package/lib/component/reducer/types/Types.js +0 -126
  363. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  364. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  365. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  366. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  367. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  368. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  369. package/lib-cjs/component/reducer/types/Types.js +0 -131
  370. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  371. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -12,7 +12,6 @@ import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
12
12
  import useExport from '../hooks/useExport';
13
13
  import useToolsFunctions from '../hooks/useToolsFunctions';
14
14
  import { DISPLAYER_MODE } from '../reducer/core/Constants';
15
- import { SET_KEY_PREFERENCES, APPLY_KEY_PREFERENCES, DELETE_INTEGRAL, DELETE_PEAK_NOTATION, DELETE_RANGE, DELETE_2D_ZONE, DELETE_EXCLUSION_ZONE, CHANGE_ACTIVE_SPECTRUM, } from '../reducer/types/Types';
16
15
  import { options } from '../toolbar/ToolTypes';
17
16
  function KeysListenerTracker() {
18
17
  const { keysPreferences, displayerMode, overDisplayer, data, view: { spectra: { activeTab }, }, } = useChartData();
@@ -34,8 +33,10 @@ function KeysListenerTracker() {
34
33
  switch (type) {
35
34
  case HighlightEventSource.INTEGRAL: {
36
35
  dispatch({
37
- type: DELETE_INTEGRAL,
38
- integralID: id,
36
+ type: 'DELETE_INTEGRAL',
37
+ payload: {
38
+ id,
39
+ },
39
40
  });
40
41
  // remove keys from the highlighted list after delete
41
42
  remove();
@@ -43,8 +44,10 @@ function KeysListenerTracker() {
43
44
  }
44
45
  case HighlightEventSource.PEAK: {
45
46
  dispatch({
46
- type: DELETE_PEAK_NOTATION,
47
- data: { id },
47
+ type: 'DELETE_PEAK',
48
+ payload: {
49
+ id,
50
+ },
48
51
  });
49
52
  // remove keys from the highlighted list after delete
50
53
  remove();
@@ -52,12 +55,10 @@ function KeysListenerTracker() {
52
55
  }
53
56
  case HighlightEventSource.RANGE: {
54
57
  dispatch({
55
- type: DELETE_RANGE,
58
+ type: 'DELETE_RANGE',
56
59
  payload: {
57
- data: {
58
- id,
59
- assignmentData,
60
- },
60
+ id,
61
+ assignmentData,
61
62
  },
62
63
  });
63
64
  // remove keys from the highlighted list after delete
@@ -66,7 +67,7 @@ function KeysListenerTracker() {
66
67
  }
67
68
  case HighlightEventSource.ZONE: {
68
69
  dispatch({
69
- type: DELETE_2D_ZONE,
70
+ type: 'DELETE_2D_ZONE',
70
71
  payload: {
71
72
  id,
72
73
  assignmentData,
@@ -83,7 +84,7 @@ function KeysListenerTracker() {
83
84
  handler: async () => {
84
85
  const hideLoading = await alert.showLoading('Delete all spectra exclusion zones in progress');
85
86
  dispatch({
86
- type: DELETE_EXCLUSION_ZONE,
87
+ type: 'DELETE_EXCLUSION_ZONE',
87
88
  payload: {
88
89
  zone,
89
90
  },
@@ -96,10 +97,10 @@ function KeysListenerTracker() {
96
97
  handler: async () => {
97
98
  const hideLoading = await alert.showLoading('Delete exclusion zones in progress');
98
99
  dispatch({
99
- type: DELETE_EXCLUSION_ZONE,
100
+ type: 'DELETE_EXCLUSION_ZONE',
100
101
  payload: {
101
102
  zone,
102
- spectrumID,
103
+ spectrumId: spectrumID,
103
104
  },
104
105
  });
105
106
  hideLoading();
@@ -162,22 +163,28 @@ function KeysListenerTracker() {
162
163
  if (data && data.length > 0 && num >= 1 && num <= 9) {
163
164
  if (e.shiftKey) {
164
165
  dispatch({
165
- type: SET_KEY_PREFERENCES,
166
- keyCode: num,
166
+ type: 'SET_KEY_PREFERENCES',
167
+ payload: {
168
+ keyCode: num,
169
+ },
167
170
  });
168
171
  alert.show(`Configuration Reset, press '${num}' again to reload it.`);
169
172
  }
170
173
  else if (!checkModifierKeyActivated(e)) {
171
174
  if (keysPreferences?.[num]) {
172
175
  dispatch({
173
- type: APPLY_KEY_PREFERENCES,
174
- keyCode: num,
176
+ type: 'APPLY_KEY_PREFERENCES',
177
+ payload: {
178
+ keyCode: num,
179
+ },
175
180
  });
176
181
  }
177
182
  else {
178
183
  dispatch({
179
- type: SET_KEY_PREFERENCES,
180
- keyCode: num,
184
+ type: 'SET_KEY_PREFERENCES',
185
+ payload: {
186
+ keyCode: num,
187
+ },
181
188
  });
182
189
  alert.show(`Configuration saved, press '${num}' again to reload it.`);
183
190
  }
@@ -274,7 +281,7 @@ function KeysListenerTracker() {
274
281
  break;
275
282
  case 'a': {
276
283
  dispatch({
277
- type: CHANGE_ACTIVE_SPECTRUM,
284
+ type: 'CHANGE_ACTIVE_SPECTRUM',
278
285
  payload: {},
279
286
  });
280
287
  e.preventDefault();
@@ -31,7 +31,6 @@ import checkActionType from './reducer/IgnoreActions';
31
31
  import { spectrumReducer, initialState, dispatchMiddleware, initState, } from './reducer/Reducer';
32
32
  import { DISPLAYER_MODE } from './reducer/core/Constants';
33
33
  import preferencesReducer, { preferencesInitialState, initPreferencesState, } from './reducer/preferences/preferencesReducer';
34
- import { INITIATE, SET_LOADING_FLAG, SET_MOUSE_OVER_DISPLAYER, } from './reducer/types/Types';
35
34
  import ToolBar from './toolbar/ToolBar';
36
35
  import { getBlob } from './utility/export';
37
36
  const viewerContainerStyle = css `
@@ -148,14 +147,17 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
148
147
  },
149
148
  }), []);
150
149
  useEffect(() => {
151
- dispatchMiddleWare({ type: SET_LOADING_FLAG, isLoading: true });
150
+ dispatchMiddleWare({
151
+ type: 'SET_LOADING_FLAG',
152
+ payload: { isLoading: true },
153
+ });
152
154
  if (dataProp) {
153
155
  void readNMRiumObject(dataProp)
154
- .then((nmriumObject) => {
155
- dispatchMiddleWare({ type: INITIATE, payload: nmriumObject });
156
+ .then((nmriumState) => {
157
+ dispatchMiddleWare({ type: 'INITIATE', payload: { nmriumState } });
156
158
  })
157
159
  .catch((error) => {
158
- dispatch({ type: SET_LOADING_FLAG, isLoading: false });
160
+ dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
159
161
  // eslint-disable-next-line no-alert
160
162
  alert(error.message);
161
163
  reportError(error);
@@ -174,10 +176,16 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
174
176
  return;
175
177
  }
176
178
  function mouseEnterHandler() {
177
- dispatchMiddleWare({ type: SET_MOUSE_OVER_DISPLAYER, payload: true });
179
+ dispatchMiddleWare({
180
+ type: 'SET_MOUSE_OVER_DISPLAYER',
181
+ payload: { isMouseOverDisplayer: true },
182
+ });
178
183
  }
179
184
  function mouseLeaveHandler() {
180
- dispatchMiddleWare({ type: SET_MOUSE_OVER_DISPLAYER, payload: false });
185
+ dispatchMiddleWare({
186
+ type: 'SET_MOUSE_OVER_DISPLAYER',
187
+ payload: { isMouseOverDisplayer: false },
188
+ });
181
189
  }
182
190
  div.addEventListener('mouseenter', mouseEnterHandler);
183
191
  div.addEventListener('mouseleave', mouseLeaveHandler);
@@ -1,5 +1,5 @@
1
1
  import { Data1D, Data2D } from 'nmr-load-save';
2
- import { ActionType } from '../reducer/types/Types';
2
+ import { ActionType } from '../reducer/types/ActionType';
3
3
  import { AssignmentDimension, AssignmentState, Axis } from './AssignmentsContext';
4
4
  export type InitiateAction = ActionType<'INITIATE_ASSIGNMENTS', {
5
5
  spectra: (Data1D | Data2D)[];
@@ -1,4 +1,24 @@
1
1
  /// <reference types="react" />
2
- export declare const dispatchContext: import("react").Context<any>;
3
- export declare const DispatchProvider: import("react").Provider<any>;
4
- export declare function useDispatch(): any;
2
+ import { AssignmentsActions } from '../reducer/actions/AssignmentsActions';
3
+ import { CorrelationsActions } from '../reducer/actions/CorrelationsActions';
4
+ import { DatabaseActions } from '../reducer/actions/DatabaseActions';
5
+ import { DimensionsActions } from '../reducer/actions/DimensionsActions';
6
+ import { DomainActions } from '../reducer/actions/DomainActions';
7
+ import { FiltersActions } from '../reducer/actions/FiltersActions';
8
+ import { GlobalActions } from '../reducer/actions/GlobalActions';
9
+ import { IntegralsActions } from '../reducer/actions/IntegralsActions';
10
+ import { LoadActions } from '../reducer/actions/LoadActions';
11
+ import { MoleculeActions } from '../reducer/actions/MoleculeActions';
12
+ import { PeaksActions } from '../reducer/actions/PeaksActions';
13
+ import { PreferencesActions } from '../reducer/actions/PreferencesActions';
14
+ import { RangesActions } from '../reducer/actions/RangesActions';
15
+ import { SpectraAnalysisActions } from '../reducer/actions/SpectraAnalysisAction';
16
+ import { SpectrumActions } from '../reducer/actions/SpectrumsActions';
17
+ import { ToolsActions } from '../reducer/actions/ToolsActions';
18
+ import { ZonesActions } from '../reducer/actions/ZonesActions';
19
+ import { ActionType } from '../reducer/types/ActionType';
20
+ export type Action = ToolsActions | SpectrumActions | SpectraAnalysisActions | GlobalActions | LoadActions | IntegralsActions | RangesActions | DatabaseActions | DimensionsActions | AssignmentsActions | DomainActions | PreferencesActions | PeaksActions | MoleculeActions | ZonesActions | FiltersActions | CorrelationsActions | ActionType<'INITIALIZE_NMRIUM'>;
21
+ export type Dispatch = (action: Action) => void;
22
+ export declare const dispatchContext: import("react").Context<Dispatch>;
23
+ export declare const DispatchProvider: import("react").Provider<Dispatch>;
24
+ export declare function useDispatch(): Dispatch;
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from 'react';
2
- export const dispatchContext = createContext({});
2
+ export const dispatchContext = createContext(() => null);
3
3
  export const DispatchProvider = dispatchContext.Provider;
4
4
  export function useDispatch() {
5
5
  return useContext(dispatchContext);
@@ -26,7 +26,7 @@ export function LoggerProvider({ children }) {
26
26
  }, [loggingLevel]);
27
27
  const markAsRead = useCallback(() => {
28
28
  if (logsHistory.length > 0) {
29
- const id = logsHistory[logsHistory.length - 1].id;
29
+ const id = logsHistory.at(-1).id;
30
30
  setLastLogId(id);
31
31
  }
32
32
  }, [logsHistory]);
@@ -210,14 +210,12 @@ Button.Info = function ButtonInfo(props) {
210
210
  };
211
211
  Button.BarButton = function BarButton(props) {
212
212
  const { ...otherProps } = props;
213
- return (_jsx(Button, { ...{
214
- backgroundColor: { base: 'white', hover: '#f7f7f7', active: '#e7e7e7' },
215
- color: {
216
- base: 'black',
217
- hover: 'black',
218
- },
219
- style: { padding: '0.25rem' },
220
- ...otherProps,
221
- } }));
213
+ return (_jsx(Button, { backgroundColor: { base: 'white', hover: '#f7f7f7', active: '#e7e7e7' },
214
+ color: {
215
+ base: 'black',
216
+ hover: 'black',
217
+ },
218
+ style: { padding: '0.25rem' },
219
+ ...otherProps }));
222
220
  };
223
221
  export default Button;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  function renderIsotope(value) {
3
- return value.replace(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>');
3
+ return value.replaceAll(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>');
4
4
  }
5
5
  function IsotopesViewer({ value = '', ...othersProps }) {
6
6
  return (_jsx("div", { ...othersProps,
@@ -85,8 +85,7 @@ const ReactTableInner = forwardRef(function ReactTableInner(props, ref) {
85
85
  const rowsData = enableVirtualScroll
86
86
  ? rows.slice(virtualBoundary.rows.start, end)
87
87
  : rows;
88
- const index = rowsData[rowsData.length - 1]?.original[indexKey] ||
89
- rowsData[rowsData.length - 1]?.index;
88
+ const index = rowsData.at(-1)?.original[indexKey] || rowsData.at(-1)?.index;
90
89
  const total = totalCount ? totalCount : data.length;
91
90
  const startColumn = columns[virtualBoundary.columns.start].Header;
92
91
  return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: ref, className: "table-container", style: {
@@ -12,7 +12,7 @@ function FormikCheckBox(props) {
12
12
  const changeHandler = useCallback((e) => {
13
13
  e.persist();
14
14
  onChange(e);
15
- setFieldValue(name, reverse ? value : !value);
15
+ void setFieldValue(name, reverse ? value : !value);
16
16
  }, [name, onChange, reverse, setFieldValue, value]);
17
17
  return (_jsxs("div", { className: `${className} check-${value}`, style: style.container || {}, children: [label && (_jsx("label", { htmlFor: name, className: "checkbox-label", style: style.label || {}, children: label })), _jsx(CheckBox, { ...resProps, name: name, checked: value, onChange: changeHandler, style: style.checkbox || {} })] }));
18
18
  }
@@ -8,7 +8,7 @@ function FormikColorPicker(props) {
8
8
  const { values, setFieldValue } = useFormikContext();
9
9
  const colorChangeHandler = useCallback((color) => {
10
10
  onColorChange(color);
11
- setFieldValue(name, color.hex);
11
+ void setFieldValue(name, color.hex);
12
12
  }, [name, onColorChange, setFieldValue]);
13
13
  return (_jsx(ColorInput, { ...colorPickerProps, name: name, onColorChange: colorChangeHandler, value: lodashGet(values, name) }));
14
14
  }
@@ -8,7 +8,7 @@ function FormikColorPicker(props) {
8
8
  const { onColorChange = () => null, name } = props;
9
9
  const { values, setFieldValue } = useFormikContext();
10
10
  function colorChangeHandler(color) {
11
- setFieldValue(name, `${color.hex}${Math.round(color.rgb.a * 255).toString(16)}`, false);
11
+ void setFieldValue(name, `${color.hex}${Math.round(color.rgb.a * 255).toString(16)}`, false);
12
12
  onColorChange(color);
13
13
  }
14
14
  return (_jsx(ColorPicker, { color: { hex: lodashGet(values, name, '#000') }, presetColors: COLORS, onChangeComplete: colorChangeHandler, style: { boxShadow: 'none' } }));
@@ -27,7 +27,7 @@ function FormikColumnFormatField(props) {
27
27
  handleChange(e);
28
28
  }, [handleChange]);
29
29
  const checkChangeHandler = useCallback((e) => {
30
- setFieldValue(e.target.name, e.target.checked);
30
+ void setFieldValue(e.target.name, e.target.checked);
31
31
  }, [setFieldValue]);
32
32
  return (_jsxs("div", { style: styles.row, children: [_jsx("span", { style: styles.inputLabel, children: label }), _jsxs("div", { style: {
33
33
  flex: 4,
@@ -11,7 +11,7 @@ function FormikInput(props) {
11
11
  function changeHandler(e) {
12
12
  onChange(e);
13
13
  if (mapOnChangeValue) {
14
- setFieldValue(name, mapOnChangeValue(e.target.value));
14
+ void setFieldValue(name, mapOnChangeValue(e.target.value));
15
15
  }
16
16
  else {
17
17
  handleChange(e);
@@ -8,11 +8,11 @@ const FormikSelect = function FormikSelect(props) {
8
8
  const { values, errors, touched, setFieldValue } = useFormikContext();
9
9
  const changeHandler = useCallback((value) => {
10
10
  onChange(value);
11
- setFieldValue(name, value);
11
+ void setFieldValue(name, value);
12
12
  }, [name, onChange, setFieldValue]);
13
13
  useEffect(() => {
14
14
  if (value) {
15
- setFieldValue(name, value);
15
+ void setFieldValue(name, value);
16
16
  }
17
17
  }, [name, setFieldValue, value]);
18
18
  let isInvalid = lodashGet(errors, name);
@@ -8,7 +8,7 @@ function FormikSlider(props) {
8
8
  const { name, debounceTime = 0 } = props;
9
9
  const { values, setFieldValue } = useFormikContext();
10
10
  const debounceOnChange = useRef(debounce((value) => {
11
- setFieldValue(name, value);
11
+ void setFieldValue(name, value);
12
12
  }, debounceTime)).current;
13
13
  return (_jsx(ReactSlider, { className: "horizontal-slider", thumbClassName: "thumb", trackClassName: "track", defaultValue: lodashGet(values, name, [0, 100]), onAfterChange: (value) => debounceOnChange(value), renderThumb: (props, state) => (_jsx("div", { ...props, children: _jsx("span", { children: state.valueNow }) })), pearling: true, minDistance: 10 }));
14
14
  }
@@ -11,13 +11,13 @@ function FormikTextarea(props) {
11
11
  }, [handleChange, onChange]);
12
12
  useEffect(() => {
13
13
  if (value) {
14
- setFieldValue(name, value);
14
+ void setFieldValue(name, value);
15
15
  }
16
16
  }, [name, setFieldValue, value]);
17
17
  const isInvalid = useMemo(() => {
18
18
  return lodashGet(errors, name);
19
19
  }, [errors, name]);
20
- return (_jsx("textarea", { ...{ name, className, placeholder }, value: value || lodashGet(values, name), onChange: changeHandler, style: {
20
+ return (_jsx("textarea", { name, className, placeholder, value: value || lodashGet(values, name), onChange: changeHandler, style: {
21
21
  ...style,
22
22
  ...(isInvalid && {
23
23
  borderColor: 'red',
@@ -3,7 +3,7 @@ import { Formik } from 'formik';
3
3
  import { useRef, memo } from 'react';
4
4
  import * as Yup from 'yup';
5
5
  import * as Filters from '../../data/Filters';
6
- import { defaultApodizationOptions } from '../../data/data1d/filter1d/apodization';
6
+ import { defaultApodizationOptions, } from '../../data/data1d/filter1d/apodization';
7
7
  import { useDispatch } from '../context/DispatchContext';
8
8
  import ActionButtons from '../elements/ActionButtons';
9
9
  import Label from '../elements/Label';
@@ -11,7 +11,6 @@ import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
11
  import FormikInput from '../elements/formik/FormikInput';
12
12
  import FormikOnChange from '../elements/formik/FormikOnChange';
13
13
  import { useFilter } from '../hooks/useFilter';
14
- import { APPLY_APODIZATION_FILTER, CALCULATE_APODIZATION_FILTER, RESET_SELECTED_TOOL, } from '../reducer/types/Types';
15
14
  import { headerLabelStyle } from './Header';
16
15
  import { HeaderContainer } from './HeaderContainer';
17
16
  const inputStyle = {
@@ -33,20 +32,20 @@ function ApodizationOptionsInnerPanel(props) {
33
32
  const { livePreview, ...filterOptions } = values;
34
33
  if (livePreview && triggerSource === 'onChange') {
35
34
  dispatch({
36
- type: CALCULATE_APODIZATION_FILTER,
35
+ type: 'CALCULATE_APODIZATION_FILTER',
37
36
  payload: filterOptions,
38
37
  });
39
38
  }
40
39
  else if (triggerSource === 'apply') {
41
40
  dispatch({
42
- type: APPLY_APODIZATION_FILTER,
41
+ type: 'APPLY_APODIZATION_FILTER',
43
42
  payload: filterOptions,
44
43
  });
45
44
  }
46
45
  }
47
46
  function handleCancelFilter() {
48
47
  dispatch({
49
- type: RESET_SELECTED_TOOL,
48
+ type: 'RESET_SELECTED_TOOL',
50
49
  });
51
50
  }
52
51
  let formData = initialValues;
@@ -7,7 +7,6 @@ import Button from '../elements/Button';
7
7
  import Label from '../elements/Label';
8
8
  import FormikNumberInput from '../elements/formik/FormikNumberInput';
9
9
  import FormikSelect from '../elements/formik/FormikSelect';
10
- import { AUTO_PEAK_PICKING } from '../reducer/types/Types';
11
10
  import { headerLabelStyle } from './Header';
12
11
  import { HeaderContainer } from './HeaderContainer';
13
12
  const inputStyle = {
@@ -42,7 +41,7 @@ function AutoPeakPickingOptionPanel() {
42
41
  const dispatch = useDispatch();
43
42
  const handlePeakPicking = useCallback((values) => {
44
43
  dispatch({
45
- type: AUTO_PEAK_PICKING,
44
+ type: 'AUTO_PEAK_PICKING',
46
45
  payload: values,
47
46
  });
48
47
  }, [dispatch]);
@@ -11,7 +11,6 @@ import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
11
  import FormikInput from '../elements/formik/FormikInput';
12
12
  import FormikOnChange from '../elements/formik/FormikOnChange';
13
13
  import { useFilter } from '../hooks/useFilter';
14
- import { RESET_SELECTED_TOOL, APPLY_BASE_LINE_CORRECTION_FILTER, CALCULATE_BASE_LINE_CORRECTION_FILTER, } from '../reducer/types/Types';
15
14
  import { headerLabelStyle } from './Header';
16
15
  import { HeaderContainer } from './HeaderContainer';
17
16
  const getAlgorithmsList = () => {
@@ -69,14 +68,14 @@ function BaseLineCorrectionInnerPanel(props) {
69
68
  const handleApplyFilter = (values, triggerSource = 'apply') => {
70
69
  dispatch({
71
70
  type: triggerSource === 'onChange'
72
- ? CALCULATE_BASE_LINE_CORRECTION_FILTER
73
- : APPLY_BASE_LINE_CORRECTION_FILTER,
74
- options: values,
71
+ ? 'CALCULATE_BASE_LINE_CORRECTION_FILTER'
72
+ : 'APPLY_BASE_LINE_CORRECTION_FILTER',
73
+ payload: values,
75
74
  });
76
75
  };
77
76
  const handleCancelFilter = () => {
78
77
  dispatch({
79
- type: RESET_SELECTED_TOOL,
78
+ type: 'RESET_SELECTED_TOOL',
80
79
  });
81
80
  };
82
81
  function handleChangeAlgorithm(selectedAlgorithm) {
@@ -119,10 +119,8 @@ function SaveButton() {
119
119
  const MemoizedHeader = memo(HeaderInner);
120
120
  export default function HeaderWrapper({ isFullscreen, onMaximize }) {
121
121
  const { toolOptions: { selectedOptionPanel }, height, } = useChartData();
122
- return (_jsx(MemoizedHeader, { ...{
123
- selectedOptionPanel,
124
- isFullscreen,
125
- onMaximize,
126
- height,
127
- } }));
122
+ return (_jsx(MemoizedHeader, { selectedOptionPanel,
123
+ isFullscreen,
124
+ onMaximize,
125
+ height }));
128
126
  }
@@ -10,7 +10,6 @@ import Label from '../elements/Label';
10
10
  import Select from '../elements/Select';
11
11
  import { useFilter } from '../hooks/useFilter';
12
12
  import useSpectrum from '../hooks/useSpectrum';
13
- import { APPLY_MANUAL_PHASE_CORRECTION_FILTER, APPLY_AUTO_PHASE_CORRECTION_FILTER, CALCULATE_MANUAL_PHASE_CORRECTION_FILTER, RESET_SELECTED_TOOL, APPLY_ABSOLUTE_FILTER, } from '../reducer/types/Types';
14
13
  import { headerLabelStyle } from './Header';
15
14
  import { HeaderContainer } from './HeaderContainer';
16
15
  const selectStyle = {
@@ -74,20 +73,20 @@ export default function PhaseCorrectionPanel() {
74
73
  switch (phaseCorrectionType) {
75
74
  case phaseCorrectionTypes.automatic: {
76
75
  dispatch({
77
- type: APPLY_AUTO_PHASE_CORRECTION_FILTER,
76
+ type: 'APPLY_AUTO_PHASE_CORRECTION_FILTER',
78
77
  });
79
78
  break;
80
79
  }
81
80
  case phaseCorrectionTypes.manual: {
82
81
  dispatch({
83
- type: APPLY_MANUAL_PHASE_CORRECTION_FILTER,
84
- value,
82
+ type: 'APPLY_MANUAL_PHASE_CORRECTION_FILTER',
83
+ payload: value,
85
84
  });
86
85
  break;
87
86
  }
88
87
  case phaseCorrectionTypes.absolute: {
89
88
  dispatch({
90
- type: APPLY_ABSOLUTE_FILTER,
89
+ type: 'APPLY_ABSOLUTE_FILTER',
91
90
  });
92
91
  break;
93
92
  }
@@ -103,8 +102,8 @@ export default function PhaseCorrectionPanel() {
103
102
  diff0 - (diff1 * (data.re.length - pivot?.index)) / data.re.length;
104
103
  }
105
104
  dispatch({
106
- type: CALCULATE_MANUAL_PHASE_CORRECTION_FILTER,
107
- value: newValues,
105
+ type: 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER',
106
+ payload: newValues,
108
107
  });
109
108
  }, [data.re, dispatch, pivot?.index]);
110
109
  const updateInputRangeInitialValue = useCallback((value) => {
@@ -133,7 +132,7 @@ export default function PhaseCorrectionPanel() {
133
132
  }, [calcPhaseCorrectionHandler, updateInputRangeInitialValue]);
134
133
  const handleCancelFilter = useCallback(() => {
135
134
  dispatch({
136
- type: RESET_SELECTED_TOOL,
135
+ type: 'RESET_SELECTED_TOOL',
137
136
  });
138
137
  }, [dispatch]);
139
138
  const onChangeHandler = useCallback((val) => {
@@ -7,7 +7,6 @@ import Button from '../elements/Button';
7
7
  import Label from '../elements/Label';
8
8
  import FormikCheckBox from '../elements/formik/FormikCheckBox';
9
9
  import FormikNumberInput from '../elements/formik/FormikNumberInput';
10
- import { AUTO_RANGES_DETECTION } from '../reducer/types/Types';
11
10
  import { headerLabelStyle } from './Header';
12
11
  import { HeaderContainer } from './HeaderContainer';
13
12
  const validationSchema = Yup.object().shape({
@@ -21,7 +20,7 @@ function RangesPickingOptionPanel() {
21
20
  const dispatch = useDispatch();
22
21
  const handleRangesPicking = useCallback((values) => {
23
22
  dispatch({
24
- type: AUTO_RANGES_DETECTION,
23
+ type: 'AUTO_RANGES_DETECTION',
25
24
  payload: values,
26
25
  });
27
26
  }, [dispatch]);
@@ -9,8 +9,6 @@ import Label from '../elements/Label';
9
9
  import Select from '../elements/Select';
10
10
  import { useFilter } from '../hooks/useFilter';
11
11
  import useSpectrum from '../hooks/useSpectrum';
12
- import { APPLY_ZERO_FILLING_FILTER, CALCULATE_ZERO_FILLING_FILTER, RESET_SELECTED_TOOL, } from '../reducer/types/Types';
13
- import { options } from '../toolbar/ToolTypes';
14
12
  import { headerLabelStyle } from './Header';
15
13
  import { HeaderContainer } from './HeaderContainer';
16
14
  const Sizes = generateNumbersPowerOfX(8, 21);
@@ -31,7 +29,7 @@ function ZeroFillingOptionsInnerPanel(props) {
31
29
  const [size, setSize] = useState(props.size);
32
30
  function handleApplyFilter() {
33
31
  dispatch({
34
- type: APPLY_ZERO_FILLING_FILTER,
32
+ type: 'APPLY_ZERO_FILLING_FILTER',
35
33
  payload: {
36
34
  nbPoints: size,
37
35
  },
@@ -39,12 +37,12 @@ function ZeroFillingOptionsInnerPanel(props) {
39
37
  }
40
38
  function handleCancelFilter() {
41
39
  dispatch({
42
- type: RESET_SELECTED_TOOL,
40
+ type: 'RESET_SELECTED_TOOL',
43
41
  });
44
42
  }
45
43
  function dispatchLiveChanges(nbPoints) {
46
44
  dispatch({
47
- type: CALCULATE_ZERO_FILLING_FILTER,
45
+ type: 'CALCULATE_ZERO_FILLING_FILTER',
48
46
  payload: {
49
47
  nbPoints,
50
48
  },
@@ -63,12 +61,6 @@ function ZeroFillingOptionsInnerPanel(props) {
63
61
  function checkChangeHandler(event) {
64
62
  const checked = event.target.checked;
65
63
  setLivePreview(checked);
66
- if (!checked) {
67
- //disable filter Live preview
68
- dispatch({
69
- payload: { selectedTool: options.zeroFilling.id },
70
- });
71
- }
72
64
  }
73
65
  return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Size: ", style: headerLabelStyle, children: _jsx(Select, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), _jsx(Label, { title: "Live preview ", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(CheckBox, { name: "livePreview", defaultChecked: true, onChange: checkChangeHandler }) }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
74
66
  }
@@ -7,26 +7,25 @@ import Button from '../elements/Button';
7
7
  import Label from '../elements/Label';
8
8
  import FormikNumberInput from '../elements/formik/FormikNumberInput';
9
9
  import FormikOnChange from '../elements/formik/FormikOnChange';
10
- import { AUTO_ZONES_DETECTION, CHANGE_ZONES_NOISE_FACTOR, } from '../reducer/types/Types';
11
10
  import { headerLabelStyle } from './Header';
12
11
  import { HeaderContainer } from './HeaderContainer';
13
12
  const validationSchema = Yup.object().shape({
14
- thresholdFactor: Yup.number().min(0).required(),
13
+ zonesNoiseFactor: Yup.number().min(0).required(),
15
14
  });
16
15
  const initialValues = {
17
- thresholdFactor: 1,
16
+ zonesNoiseFactor: 1,
18
17
  };
19
18
  function Zones2DOptionPanel() {
20
19
  const dispatch = useDispatch();
21
20
  const handleZonesPicking = useCallback((values) => {
22
21
  dispatch({
23
- type: AUTO_ZONES_DETECTION,
22
+ type: 'AUTO_ZONES_DETECTION',
24
23
  payload: values,
25
24
  });
26
25
  }, [dispatch]);
27
26
  const handleChangeNoiseFactory = useCallback((values) => {
28
- dispatch({ type: CHANGE_ZONES_NOISE_FACTOR, payload: values });
27
+ dispatch({ type: 'CHANGE_ZONES_NOISE_FACTOR', payload: values });
29
28
  }, [dispatch]);
30
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: handleZonesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Noise factor :", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikNumberInput, { name: "thresholdFactor", style: { width: '50px' }, min: 0 }) }), _jsx(FormikOnChange, { enableValidation: true, onChange: handleChangeNoiseFactory }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Auto Zones Picking" })] })) }) }));
29
+ return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: handleZonesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Noise factor :", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikNumberInput, { name: "zonesNoiseFactor", style: { width: '50px' }, min: 0 }) }), _jsx(FormikOnChange, { enableValidation: true, onChange: handleChangeNoiseFactory }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Auto Zones Picking" })] })) }) }));
31
30
  }
32
31
  export default Zones2DOptionPanel;
@@ -33,6 +33,7 @@ export default function useExport() {
33
33
  const fileName = state.data[0]?.info?.name;
34
34
  const exportedData = toJSON(state, preferencesState, {
35
35
  exportTarget: 'nmrium',
36
+ view: true,
36
37
  });
37
38
  await exportAsJSON(exportedData, fileName, spaceIndent, isCompressed);
38
39
  hideLoading();