nmrium 0.21.0 → 0.24.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 (682) hide show
  1. package/README.md +4 -0
  2. package/lib/component/1d/Chart1D.js +1 -1
  3. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  4. package/lib/component/1d/ExclusionZonesAnnotations.js +3 -4
  5. package/lib/component/1d/FooterBanner.js +7 -8
  6. package/lib/component/1d/Integral.js +3 -8
  7. package/lib/component/1d/IntegralResizable.js +1 -1
  8. package/lib/component/1d/IntegralsSeries.js +2 -2
  9. package/lib/component/1d/LinesSeries.js +1 -1
  10. package/lib/component/1d/PeakAnnotation.js +3 -3
  11. package/lib/component/1d/PeakAnnotations.js +1 -1
  12. package/lib/component/1d/Resizable.js +2 -2
  13. package/lib/component/1d/ResurrectedDatabaseRanges.js +1 -1
  14. package/lib/component/1d/SpectraTracker.js +3 -3
  15. package/lib/component/1d/Viewer1D.js +9 -9
  16. package/lib/component/1d/XAxis.js +1 -1
  17. package/lib/component/1d/YAxis.js +1 -1
  18. package/lib/component/1d/jCouplingGraph/JGraph.js +3 -4
  19. package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
  20. package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  21. package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  22. package/lib/component/1d/jCouplingGraph/JsCouplings.js +2 -2
  23. package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  24. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  25. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
  26. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
  27. package/lib/component/1d/multiplicityTree/TreeNodes.js +2 -2
  28. package/lib/component/1d/ranges/Range.js +2 -2
  29. package/lib/component/1d/ranges/RangeIntegral.js +2 -6
  30. package/lib/component/1d/ranges/Ranges.js +2 -2
  31. package/lib/component/1d/tool/BaseLineZones.js +1 -1
  32. package/lib/component/1d/tool/PeakPointer.js +1 -1
  33. package/lib/component/1d/tool/VerticalIndicator.js +1 -1
  34. package/lib/component/1d/tool/XLabelPointer.js +1 -1
  35. package/lib/component/1d/utilities/scale.d.ts +1 -1
  36. package/lib/component/1d/utilities/scale.js +7 -6
  37. package/lib/component/2d/Chart2D.js +2 -2
  38. package/lib/component/2d/Contours.js +6 -6
  39. package/lib/component/2d/FooterBanner.js +3 -3
  40. package/lib/component/2d/Left1DChart.js +1 -1
  41. package/lib/component/2d/SignalDeltaLine.js +1 -1
  42. package/lib/component/2d/Top1DChart.js +1 -1
  43. package/lib/component/2d/Viewer2D.js +8 -8
  44. package/lib/component/2d/XAxis.js +1 -1
  45. package/lib/component/2d/YAxis.js +1 -1
  46. package/lib/component/2d/tools/XYLabelPointer.js +1 -1
  47. package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +1 -1
  48. package/lib/component/2d/tools/slicing/SlicingView.js +1 -1
  49. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  50. package/lib/component/2d/zones/IndicationLines.js +1 -1
  51. package/lib/component/2d/zones/Signal.js +2 -2
  52. package/lib/component/2d/zones/SignalCrosshair.js +1 -1
  53. package/lib/component/2d/zones/Zone.js +1 -1
  54. package/lib/component/2d/zones/Zones.js +2 -2
  55. package/lib/component/ErrorOverlay.js +1 -1
  56. package/lib/component/EventsTrackers/BrushTracker.js +1 -1
  57. package/lib/component/EventsTrackers/MouseTracker.js +1 -1
  58. package/lib/component/NMRium.d.ts +36 -36
  59. package/lib/component/NMRium.js +10 -16
  60. package/lib/component/assignment/index.js +1 -1
  61. package/lib/component/context/PreferencesContext.d.ts +84 -2
  62. package/lib/component/context/PreferencesContext.js +30 -5
  63. package/lib/component/elements/Button.js +1 -1
  64. package/lib/component/elements/ButtonToolTip.js +1 -1
  65. package/lib/component/elements/CheckBox.js +1 -1
  66. package/lib/component/elements/CloseButton.js +1 -1
  67. package/lib/component/elements/ColorInput.js +1 -1
  68. package/lib/component/elements/ContextMenu.js +1 -1
  69. package/lib/component/elements/DeleteButton.js +1 -1
  70. package/lib/component/elements/EditableColumn.d.ts +1 -1
  71. package/lib/component/elements/EditableColumn.js +1 -1
  72. package/lib/component/elements/Input.js +1 -1
  73. package/lib/component/elements/InputRange.js +1 -1
  74. package/lib/component/elements/IsotopesViewer.js +1 -1
  75. package/lib/component/elements/Label.js +1 -1
  76. package/lib/component/elements/Logo.js +1 -1
  77. package/lib/component/elements/MenuButton.js +3 -3
  78. package/lib/component/elements/MolecularFormulaInput.js +1 -1
  79. package/lib/component/elements/MoleculeSelection.js +1 -1
  80. package/lib/component/elements/NextPrev.js +2 -2
  81. package/lib/component/elements/NumberInput.js +1 -1
  82. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
  83. package/lib/component/elements/ReactTable/ReactTable.js +3 -3
  84. package/lib/component/elements/ReactTable/ReactTableExpandable.js +3 -3
  85. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  86. package/lib/component/elements/SaveButton.js +1 -1
  87. package/lib/component/elements/Select.js +1 -1
  88. package/lib/component/elements/Tab/DeleteButton.js +1 -1
  89. package/lib/component/elements/Tab/Tab.js +3 -3
  90. package/lib/component/elements/Tab/Tabs.js +2 -2
  91. package/lib/component/elements/Table/Table.js +1 -1
  92. package/lib/component/elements/Table/TableBody.js +1 -1
  93. package/lib/component/elements/Table/TableCell.js +1 -1
  94. package/lib/component/elements/Table/TableHead.js +1 -1
  95. package/lib/component/elements/Table/TableRow.js +1 -1
  96. package/lib/component/elements/ToggleButton.js +1 -1
  97. package/lib/component/elements/ToolTip/ToolTip.js +2 -2
  98. package/lib/component/elements/ToolbarMenu.js +3 -3
  99. package/lib/component/elements/accordion/Accordion.js +1 -1
  100. package/lib/component/elements/accordion/AccordionItem.js +2 -2
  101. package/lib/component/elements/dropDownButton/DropDownButton.d.ts +20 -1
  102. package/lib/component/elements/dropDownButton/DropDownButton.js +32 -34
  103. package/lib/component/elements/dropDownButton/DropDownList.d.ts +2 -9
  104. package/lib/component/elements/dropDownButton/DropDownList.js +39 -25
  105. package/lib/component/elements/formik/ErrorMessage.js +2 -2
  106. package/lib/component/elements/formik/FormikCheckBox.d.ts +1 -0
  107. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  108. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  109. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  110. package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
  111. package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
  112. package/lib/component/elements/formik/FormikForm.js +1 -1
  113. package/lib/component/elements/formik/FormikInput.js +1 -1
  114. package/lib/component/elements/formik/FormikNumberInput.js +1 -1
  115. package/lib/component/elements/formik/FormikSelect.js +1 -1
  116. package/lib/component/elements/formik/FormikSlider.js +1 -1
  117. package/lib/component/elements/formik/FormikTextarea.js +1 -1
  118. package/lib/component/elements/formik/Input.js +1 -1
  119. package/lib/component/elements/formik/SelectBox.js +1 -1
  120. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
  121. package/lib/component/elements/popup/Alert/ProgressIndicator.js +1 -1
  122. package/lib/component/elements/popup/Alert/Provider.js +3 -3
  123. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  124. package/lib/component/elements/popup/Modal/Modal.js +1 -1
  125. package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
  126. package/lib/component/elements/popup/Modal/Provider.js +3 -3
  127. package/lib/component/elements/popup/Transition.js +1 -1
  128. package/lib/component/elements/popup/Wrapper.js +1 -1
  129. package/lib/component/elements/toggle/ToggleButton.js +1 -1
  130. package/lib/component/elements/toggle/ToggleButtonGroup.js +1 -1
  131. package/lib/component/header/AutoPeakPickingOptionPanel.js +3 -3
  132. package/lib/component/header/BaseLineCorrectionPanel.js +1 -1
  133. package/lib/component/header/Header.js +30 -20
  134. package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -2
  135. package/lib/component/header/RangesPickingOptionPanel.js +2 -2
  136. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  137. package/lib/component/header/Zones2DOptionPanel.js +1 -1
  138. package/lib/component/highlight/index.js +1 -1
  139. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  140. package/lib/component/hooks/useCheckExperimentalFeature.js +5 -4
  141. package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
  142. package/lib/component/hooks/useExport.js +15 -13
  143. package/lib/component/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
  144. package/lib/component/hooks/useIntegralPath.js +53 -0
  145. package/lib/component/hooks/useTableSortBy.d.ts +2 -1
  146. package/lib/component/hooks/useTableSortBy.js +27 -16
  147. package/lib/component/hooks/useToolsFunctions.js +4 -5
  148. package/lib/component/hooks/useXScale.d.ts +2 -0
  149. package/lib/component/hooks/useXScale.js +7 -0
  150. package/lib/component/loader/DefaultSpinnerComponent.js +1 -1
  151. package/lib/component/loader/DropZone.js +2 -2
  152. package/lib/component/loader/NoData.js +1 -3
  153. package/lib/component/loader/Spinner.js +1 -1
  154. package/lib/component/loader/SpinnerContext.js +1 -1
  155. package/lib/component/modal/AboutUsModal.js +4 -4
  156. package/lib/component/modal/AlignSpectraModal.js +1 -1
  157. package/lib/component/modal/CopyClipboardModal.js +2 -2
  158. package/lib/component/modal/ExportAsMatrixModal.js +1 -1
  159. package/lib/component/modal/ImportPublicationStringModal.js +13 -11
  160. package/lib/component/modal/LoadJCAMPModal.js +1 -1
  161. package/lib/component/modal/ModalStyle.js +1 -1
  162. package/lib/component/modal/MoleculeStructureEditorModal.js +1 -1
  163. package/lib/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
  164. package/lib/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
  165. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +4 -4
  166. package/lib/component/modal/MultipletAnalysisModal.js +5 -5
  167. package/lib/component/modal/PredictSpectraModal.d.ts +0 -28
  168. package/lib/component/modal/PredictSpectraModal.js +31 -54
  169. package/lib/component/modal/SaveAsModal.js +2 -2
  170. package/lib/component/modal/changeSum/ChangeSumModal.js +8 -7
  171. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  172. package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -1
  173. package/lib/component/modal/editRange/EditRangeModal.js +13 -9
  174. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +33 -40
  175. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
  176. package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  177. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  178. package/lib/component/modal/editRange/forms/components/SignalsForm.js +5 -5
  179. package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
  180. package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
  181. package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
  182. package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
  183. package/lib/component/modal/editZone/EditZoneModal.js +98 -0
  184. package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
  185. package/lib/component/modal/editZone/SignalFormTab.js +6 -0
  186. package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
  187. package/lib/component/modal/editZone/SignalsForm.js +62 -0
  188. package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
  189. package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
  190. package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
  191. package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
  192. package/lib/component/modal/setting/ControllersTabContent.js +1 -1
  193. package/lib/component/modal/setting/DisplayTabContent.d.ts +2 -2
  194. package/lib/component/modal/setting/DisplayTabContent.js +52 -14
  195. package/lib/component/modal/setting/FormattingTabContent.js +3 -3
  196. package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
  197. package/lib/component/modal/setting/GeneralSettings.js +69 -76
  198. package/lib/component/modal/setting/WorkspaceItem.d.ts +6 -0
  199. package/lib/component/modal/setting/WorkspaceItem.js +59 -0
  200. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
  201. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
  202. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
  203. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
  204. package/lib/component/panels/InformationPanel.js +4 -4
  205. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
  206. package/lib/component/panels/IntegralsPanel/IntegralTable.js +6 -6
  207. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
  208. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  209. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +10 -1
  210. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +28 -18
  211. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +9 -1
  212. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  213. package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  214. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  215. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
  216. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +3 -3
  217. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
  218. package/lib/component/panels/Panels.d.ts +1 -1
  219. package/lib/component/panels/Panels.js +60 -45
  220. package/lib/component/panels/PeaksPanel/PeaksPanel.js +2 -2
  221. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
  222. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -4
  223. package/lib/component/panels/RangesPanel/RangesHeader.js +16 -14
  224. package/lib/component/panels/RangesPanel/RangesPanel.js +5 -6
  225. package/lib/component/panels/RangesPanel/RangesPreferences.js +4 -5
  226. package/lib/component/panels/RangesPanel/RangesTable.js +3 -3
  227. package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -1
  228. package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
  229. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -6
  230. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +6 -66
  231. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  232. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  233. package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
  234. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  235. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  236. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  237. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +7 -0
  238. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +74 -0
  239. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +7 -0
  240. package/lib/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
  241. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
  242. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
  243. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
  244. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
  245. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
  246. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  247. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
  248. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
  249. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
  250. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
  251. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
  252. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
  253. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +10 -5
  254. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +11 -6
  255. package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
  256. package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
  257. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
  258. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +5 -6
  259. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
  260. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +23 -27
  261. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
  262. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
  263. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
  264. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
  265. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +1 -1
  266. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
  267. package/lib/component/panels/SummaryPanel/Overview.js +2 -2
  268. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  269. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  270. package/lib/component/panels/SummaryPanel/SummaryPanel.js +42 -45
  271. package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
  272. package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
  273. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
  274. package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
  275. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
  276. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
  277. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  278. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  279. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  280. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
  281. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
  282. package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -8
  283. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
  284. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
  285. package/lib/component/panels/ZonesPanel/ZonesTable.js +7 -4
  286. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
  287. package/lib/component/panels/databasePanel/DatabasePanel.js +3 -3
  288. package/lib/component/panels/databasePanel/DatabasePreferences.js +3 -4
  289. package/lib/component/panels/databasePanel/DatabaseTable.js +4 -4
  290. package/lib/component/panels/extra/placeholder/NoTableData.js +1 -1
  291. package/lib/component/panels/filtersPanel/FilterPanel.js +2 -2
  292. package/lib/component/panels/filtersPanel/FiltersTable.js +19 -15
  293. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  294. package/lib/component/panels/header/PreferencesHeader.js +1 -1
  295. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +6 -0
  296. package/lib/component/panels/predictionPanel/PredictionOptions.js +90 -0
  297. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +2 -0
  298. package/lib/component/panels/predictionPanel/PredictionPanel.js +35 -0
  299. package/lib/component/reducer/IgnoreActions.js +2 -1
  300. package/lib/component/reducer/Reducer.d.ts +16 -23
  301. package/lib/component/reducer/Reducer.js +14 -11
  302. package/lib/component/reducer/actions/DatabaseActions.js +1 -1
  303. package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
  304. package/lib/component/reducer/actions/DomainActions.js +20 -1
  305. package/lib/component/reducer/actions/FiltersActions.js +1 -1
  306. package/lib/component/reducer/actions/IntegralsActions.js +2 -0
  307. package/lib/component/reducer/actions/LoadActions.d.ts +2 -2
  308. package/lib/component/reducer/actions/LoadActions.js +42 -9
  309. package/lib/component/reducer/actions/MoleculeActions.js +5 -1
  310. package/lib/component/reducer/actions/PreferencesActions.js +0 -2
  311. package/lib/component/reducer/actions/RangesActions.js +3 -1
  312. package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
  313. package/lib/component/reducer/actions/ToolsActions.js +31 -27
  314. package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
  315. package/lib/component/reducer/actions/ZonesActions.js +33 -2
  316. package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
  317. package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
  318. package/lib/component/reducer/preferencesReducer.d.ts +182 -42
  319. package/lib/component/reducer/preferencesReducer.js +198 -80
  320. package/lib/component/reducer/types/Types.d.ts +9 -1
  321. package/lib/component/reducer/types/Types.js +3 -1
  322. package/lib/component/tool/BrushX.js +1 -1
  323. package/lib/component/tool/BrushXY.js +1 -1
  324. package/lib/component/tool/CrossLinePointer.js +1 -1
  325. package/lib/component/toolbar/BasicToolBar.js +23 -27
  326. package/lib/component/toolbar/FunctionToolBar.js +17 -18
  327. package/lib/component/toolbar/HistoryToolBar.js +1 -1
  328. package/lib/component/toolbar/ToolBar.js +2 -2
  329. package/lib/component/utility/FormatNumber.js +1 -1
  330. package/lib/component/workspaces/Workspace.d.ts +17 -0
  331. package/lib/component/workspaces/basic.js +29 -33
  332. package/lib/component/workspaces/exercise.d.ts +2 -0
  333. package/lib/component/workspaces/exercise.js +49 -0
  334. package/lib/component/workspaces/index.d.ts +3 -2
  335. package/lib/component/workspaces/index.js +3 -2
  336. package/lib/component/workspaces/prediction.d.ts +2 -0
  337. package/lib/component/workspaces/prediction.js +26 -0
  338. package/lib/component/workspaces/process1D.js +21 -31
  339. package/lib/data/PredictionManager.d.ts +36 -3
  340. package/lib/data/PredictionManager.js +62 -17
  341. package/lib/data/constants/DefaultPathLengths.d.ts +6 -0
  342. package/lib/data/constants/DefaultPathLengths.js +8 -0
  343. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
  344. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
  345. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +11 -20
  346. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
  347. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
  348. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
  349. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
  350. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
  351. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
  352. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
  353. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
  354. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
  355. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
  356. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -3
  357. package/lib/data/utilities/getAtom.js +1 -1
  358. package/lib/data/utilities/getColor.d.ts +1 -0
  359. package/lib/data/utilities/getColor.js +1 -1
  360. package/lib/types/PanelPreferencesType.d.ts +10 -0
  361. package/lib/types/PanelPreferencesType.js +1 -0
  362. package/lib/versionInfo.js +1 -1
  363. package/lib-cjs/component/1d/Chart1D.js +1 -1
  364. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +1 -1
  365. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +8 -5
  366. package/lib-cjs/component/1d/FooterBanner.js +7 -8
  367. package/lib-cjs/component/1d/Integral.js +3 -8
  368. package/lib-cjs/component/1d/IntegralResizable.js +1 -1
  369. package/lib-cjs/component/1d/IntegralsSeries.js +2 -2
  370. package/lib-cjs/component/1d/Line.js +5 -1
  371. package/lib-cjs/component/1d/LinesSeries.js +1 -1
  372. package/lib-cjs/component/1d/PeakAnnotation.js +3 -3
  373. package/lib-cjs/component/1d/PeakAnnotations.js +1 -1
  374. package/lib-cjs/component/1d/Resizable.js +2 -2
  375. package/lib-cjs/component/1d/ResurrectedDatabaseRanges.js +1 -1
  376. package/lib-cjs/component/1d/SpectraTracker.js +3 -3
  377. package/lib-cjs/component/1d/Viewer1D.js +14 -10
  378. package/lib-cjs/component/1d/XAxis.js +6 -2
  379. package/lib-cjs/component/1d/YAxis.js +6 -2
  380. package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +3 -4
  381. package/lib-cjs/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
  382. package/lib-cjs/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  383. package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  384. package/lib-cjs/component/1d/jCouplingGraph/JsCouplings.js +2 -2
  385. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  386. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  387. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
  388. package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
  389. package/lib-cjs/component/1d/multiplicityTree/TreeNodes.js +2 -2
  390. package/lib-cjs/component/1d/ranges/Range.js +2 -2
  391. package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
  392. package/lib-cjs/component/1d/ranges/Ranges.js +2 -2
  393. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -1
  394. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  395. package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
  396. package/lib-cjs/component/1d/tool/XLabelPointer.js +1 -1
  397. package/lib-cjs/component/1d/utilities/scale.js +7 -6
  398. package/lib-cjs/component/2d/Chart2D.js +2 -2
  399. package/lib-cjs/component/2d/Contours.js +6 -6
  400. package/lib-cjs/component/2d/FooterBanner.js +3 -3
  401. package/lib-cjs/component/2d/Left1DChart.js +6 -2
  402. package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
  403. package/lib-cjs/component/2d/Top1DChart.js +6 -2
  404. package/lib-cjs/component/2d/Viewer2D.js +12 -8
  405. package/lib-cjs/component/2d/XAxis.js +6 -2
  406. package/lib-cjs/component/2d/YAxis.js +6 -2
  407. package/lib-cjs/component/2d/tools/XYLabelPointer.js +1 -1
  408. package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +6 -2
  409. package/lib-cjs/component/2d/tools/slicing/SlicingView.js +1 -1
  410. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +6 -2
  411. package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
  412. package/lib-cjs/component/2d/zones/Signal.js +2 -2
  413. package/lib-cjs/component/2d/zones/SignalCrosshair.js +1 -1
  414. package/lib-cjs/component/2d/zones/Zone.js +1 -1
  415. package/lib-cjs/component/2d/zones/Zones.js +2 -2
  416. package/lib-cjs/component/ErrorOverlay.js +1 -1
  417. package/lib-cjs/component/EventsTrackers/BrushTracker.js +1 -1
  418. package/lib-cjs/component/EventsTrackers/MouseTracker.js +1 -1
  419. package/lib-cjs/component/NMRium.js +14 -17
  420. package/lib-cjs/component/assignment/index.js +1 -1
  421. package/lib-cjs/component/context/PreferencesContext.js +33 -4
  422. package/lib-cjs/component/elements/Button.js +1 -1
  423. package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
  424. package/lib-cjs/component/elements/CheckBox.js +1 -1
  425. package/lib-cjs/component/elements/CloseButton.js +1 -1
  426. package/lib-cjs/component/elements/ColorInput.js +1 -1
  427. package/lib-cjs/component/elements/ContextMenu.js +1 -1
  428. package/lib-cjs/component/elements/DeleteButton.js +1 -1
  429. package/lib-cjs/component/elements/EditableColumn.js +1 -1
  430. package/lib-cjs/component/elements/Input.js +1 -1
  431. package/lib-cjs/component/elements/InputRange.js +1 -1
  432. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  433. package/lib-cjs/component/elements/Label.js +1 -1
  434. package/lib-cjs/component/elements/Logo.js +1 -1
  435. package/lib-cjs/component/elements/MenuButton.js +3 -3
  436. package/lib-cjs/component/elements/MolecularFormulaInput.js +1 -1
  437. package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
  438. package/lib-cjs/component/elements/NextPrev.js +2 -2
  439. package/lib-cjs/component/elements/NumberInput.js +1 -1
  440. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
  441. package/lib-cjs/component/elements/ReactTable/ReactTable.js +8 -4
  442. package/lib-cjs/component/elements/ReactTable/ReactTableExpandable.js +3 -3
  443. package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  444. package/lib-cjs/component/elements/SaveButton.js +1 -1
  445. package/lib-cjs/component/elements/Select.js +1 -1
  446. package/lib-cjs/component/elements/Tab/DeleteButton.js +1 -1
  447. package/lib-cjs/component/elements/Tab/Tab.js +3 -3
  448. package/lib-cjs/component/elements/Tab/Tabs.js +2 -2
  449. package/lib-cjs/component/elements/Table/Table.js +1 -1
  450. package/lib-cjs/component/elements/Table/TableBody.js +1 -1
  451. package/lib-cjs/component/elements/Table/TableCell.js +1 -1
  452. package/lib-cjs/component/elements/Table/TableHead.js +1 -1
  453. package/lib-cjs/component/elements/Table/TableRow.js +1 -1
  454. package/lib-cjs/component/elements/ToggleButton.js +1 -1
  455. package/lib-cjs/component/elements/ToolTip/ToolTip.js +2 -2
  456. package/lib-cjs/component/elements/ToolbarMenu.js +3 -3
  457. package/lib-cjs/component/elements/accordion/Accordion.js +1 -1
  458. package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
  459. package/lib-cjs/component/elements/dropDownButton/DropDownButton.js +32 -34
  460. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +39 -25
  461. package/lib-cjs/component/elements/formik/ErrorMessage.js +2 -2
  462. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  463. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  464. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  465. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
  466. package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
  467. package/lib-cjs/component/elements/formik/FormikForm.js +1 -1
  468. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  469. package/lib-cjs/component/elements/formik/FormikNumberInput.js +1 -1
  470. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  471. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  472. package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
  473. package/lib-cjs/component/elements/formik/Input.js +1 -1
  474. package/lib-cjs/component/elements/formik/SelectBox.js +1 -1
  475. package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
  476. package/lib-cjs/component/elements/popup/Alert/ProgressIndicator.js +1 -1
  477. package/lib-cjs/component/elements/popup/Alert/Provider.js +3 -3
  478. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  479. package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
  480. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
  481. package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -3
  482. package/lib-cjs/component/elements/popup/Transition.js +1 -1
  483. package/lib-cjs/component/elements/popup/Wrapper.js +1 -1
  484. package/lib-cjs/component/elements/toggle/ToggleButton.js +1 -1
  485. package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +1 -1
  486. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -3
  487. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -2
  488. package/lib-cjs/component/header/Header.js +29 -19
  489. package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +7 -3
  490. package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -2
  491. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
  492. package/lib-cjs/component/header/Zones2DOptionPanel.js +1 -1
  493. package/lib-cjs/component/highlight/index.js +1 -1
  494. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  495. package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -4
  496. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +1 -1
  497. package/lib-cjs/component/hooks/useExport.js +15 -13
  498. package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
  499. package/lib-cjs/component/hooks/useTableSortBy.js +27 -16
  500. package/lib-cjs/component/hooks/useToolsFunctions.js +4 -5
  501. package/lib-cjs/component/hooks/useXScale.js +11 -0
  502. package/lib-cjs/component/loader/DefaultSpinnerComponent.js +1 -1
  503. package/lib-cjs/component/loader/DropZone.js +2 -2
  504. package/lib-cjs/component/loader/NoData.js +1 -3
  505. package/lib-cjs/component/loader/Spinner.js +1 -1
  506. package/lib-cjs/component/loader/SpinnerContext.js +1 -1
  507. package/lib-cjs/component/modal/AboutUsModal.js +4 -4
  508. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
  509. package/lib-cjs/component/modal/CopyClipboardModal.js +2 -2
  510. package/lib-cjs/component/modal/ExportAsMatrixModal.js +1 -1
  511. package/lib-cjs/component/modal/ImportPublicationStringModal.js +18 -12
  512. package/lib-cjs/component/modal/LoadJCAMPModal.js +1 -1
  513. package/lib-cjs/component/modal/ModalStyle.js +1 -1
  514. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +1 -1
  515. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
  516. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
  517. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +9 -5
  518. package/lib-cjs/component/modal/MultipletAnalysisModal.js +5 -5
  519. package/lib-cjs/component/modal/PredictSpectraModal.js +36 -55
  520. package/lib-cjs/component/modal/SaveAsModal.js +2 -2
  521. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +13 -8
  522. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  523. package/lib-cjs/component/modal/editRange/EditRangeModal.js +13 -9
  524. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +38 -41
  525. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
  526. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  527. package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  528. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +5 -5
  529. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +6 -2
  530. package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
  531. package/lib-cjs/component/modal/editZone/EditZoneModal.js +103 -0
  532. package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
  533. package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
  534. package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +42 -0
  535. package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
  536. package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
  537. package/lib-cjs/component/modal/setting/DisplayTabContent.js +51 -13
  538. package/lib-cjs/component/modal/setting/FormattingTabContent.js +3 -3
  539. package/lib-cjs/component/modal/setting/GeneralSettings.js +72 -75
  540. package/lib-cjs/component/modal/setting/WorkspaceItem.js +64 -0
  541. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
  542. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
  543. package/lib-cjs/component/panels/InformationPanel.js +4 -4
  544. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
  545. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +6 -6
  546. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
  547. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  548. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +28 -18
  549. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  550. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  551. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  552. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
  553. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +8 -4
  554. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
  555. package/lib-cjs/component/panels/Panels.js +61 -46
  556. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +2 -2
  557. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
  558. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +9 -5
  559. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +16 -14
  560. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +5 -6
  561. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -5
  562. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -3
  563. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -1
  564. package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
  565. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +5 -65
  566. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  567. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  568. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
  569. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  570. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  571. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  572. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +80 -0
  573. package/lib-cjs/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
  574. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
  575. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
  576. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
  577. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
  578. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
  579. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  580. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
  581. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
  582. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
  583. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
  584. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
  585. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
  586. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +10 -5
  587. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +11 -6
  588. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
  589. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +5 -6
  590. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +23 -27
  591. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
  592. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +47 -30
  593. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
  594. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
  595. package/lib-cjs/component/panels/SummaryPanel/Overview.js +2 -2
  596. package/lib-cjs/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  597. package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  598. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +41 -44
  599. package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
  600. package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
  601. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
  602. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  603. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  604. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  605. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
  606. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
  607. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +13 -8
  608. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
  609. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +7 -4
  610. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
  611. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -3
  612. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -4
  613. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +4 -4
  614. package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +1 -1
  615. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +2 -2
  616. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +19 -15
  617. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +2 -2
  618. package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
  619. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +118 -0
  620. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +41 -0
  621. package/lib-cjs/component/reducer/IgnoreActions.js +7 -2
  622. package/lib-cjs/component/reducer/Reducer.js +21 -13
  623. package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
  624. package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
  625. package/lib-cjs/component/reducer/actions/FiltersActions.js +6 -2
  626. package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
  627. package/lib-cjs/component/reducer/actions/LoadActions.js +47 -10
  628. package/lib-cjs/component/reducer/actions/MoleculeActions.js +10 -2
  629. package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
  630. package/lib-cjs/component/reducer/actions/RangesActions.js +7 -1
  631. package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -1
  632. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +7 -3
  633. package/lib-cjs/component/reducer/actions/ToolsActions.js +43 -35
  634. package/lib-cjs/component/reducer/actions/ZonesActions.js +40 -3
  635. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
  636. package/lib-cjs/component/reducer/preferencesReducer.js +197 -78
  637. package/lib-cjs/component/reducer/types/Types.js +6 -4
  638. package/lib-cjs/component/tool/BrushX.js +1 -1
  639. package/lib-cjs/component/tool/BrushXY.js +1 -1
  640. package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
  641. package/lib-cjs/component/toolbar/BasicToolBar.js +23 -27
  642. package/lib-cjs/component/toolbar/FunctionToolBar.js +22 -19
  643. package/lib-cjs/component/toolbar/HistoryToolBar.js +1 -1
  644. package/lib-cjs/component/toolbar/ToolBar.js +2 -2
  645. package/lib-cjs/component/toolbar/ToolTypes.js +5 -1
  646. package/lib-cjs/component/utility/FormatNumber.js +1 -1
  647. package/lib-cjs/component/workspaces/basic.js +29 -33
  648. package/lib-cjs/component/workspaces/exercise.js +52 -0
  649. package/lib-cjs/component/workspaces/index.js +3 -2
  650. package/lib-cjs/component/workspaces/prediction.js +29 -0
  651. package/lib-cjs/component/workspaces/process1D.js +21 -31
  652. package/lib-cjs/data/Filters.js +5 -1
  653. package/lib-cjs/data/FiltersManager.js +5 -1
  654. package/lib-cjs/data/PredictionManager.js +62 -17
  655. package/lib-cjs/data/SpectraManager.js +5 -1
  656. package/lib-cjs/data/constants/DefaultPathLengths.js +10 -0
  657. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
  658. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +16 -21
  659. package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
  660. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
  661. package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
  662. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
  663. package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
  664. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
  665. package/lib-cjs/data/data1d/Spectrum1D/shift/getShiftX.js +5 -1
  666. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +7 -4
  667. package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +5 -1
  668. package/lib-cjs/data/utilities/getAtom.js +1 -1
  669. package/lib-cjs/data/utilities/getColor.js +2 -1
  670. package/lib-cjs/types/PanelPreferencesType.js +2 -0
  671. package/lib-cjs/versionInfo.js +1 -1
  672. package/package.json +21 -21
  673. package/lib/component/1d/utilities/useIntegralPath.js +0 -63
  674. package/lib/component/panels/RangesPanel/useMapRanges.d.ts +0 -6
  675. package/lib/component/panels/SummaryPanel/Utilities.d.ts +0 -25
  676. package/lib/component/reducer/actions/Zoom.d.ts +0 -16
  677. package/lib/component/reducer/actions/Zoom.js +0 -92
  678. package/lib/component/workspaces/exercise1D.d.ts +0 -2
  679. package/lib/component/workspaces/exercise1D.js +0 -45
  680. package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
  681. package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
  682. package/lib-cjs/component/workspaces/exercise1D.js +0 -48
@@ -6,7 +6,6 @@ import FormikColumnFormatField from '../../elements/formik/FormikColumnFormatFie
6
6
  import FormikForm from '../../elements/formik/FormikForm';
7
7
  import { useAlert } from '../../elements/popup/Alert';
8
8
  import useNucleus from '../../hooks/useNucleus';
9
- import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
10
9
  import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
11
10
  import { peaksDefaultValues } from '../extra/preferences/defaultValues';
12
11
  const styles = {
@@ -90,7 +89,7 @@ function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
90
89
  acc[nucleusLabel] = peaksDefaultValues;
91
90
  return acc;
92
91
  }, {});
93
- const peaksPreferences = getValueByKeyPath(preferences, `formatting.panels.peaks`);
92
+ const peaksPreferences = getValueByKeyPath(preferences.current, `formatting.panels.peaks`);
94
93
  formRef.current.setValues(peaksPreferences ? peaksPreferences : defaultValues);
95
94
  }
96
95
  }, [nucleus, preferences]);
@@ -99,7 +98,7 @@ function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
99
98
  }, [updateValues]);
100
99
  const saveHandler = useCallback((values) => {
101
100
  preferences.dispatch({
102
- type: SET_PANELS_PREFERENCES,
101
+ type: 'SET_PANELS_PREFERENCES',
103
102
  payload: { key: 'peaks', value: values },
104
103
  });
105
104
  alert.success('Peaks preferences saved successfully');
@@ -109,13 +108,13 @@ function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
109
108
  formRef.current.submitForm();
110
109
  },
111
110
  }), []);
112
- return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
111
+ return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }) }));
113
112
  }
114
113
  const MemoizedPeaksPreferences = memo(PeaksPreferencesInner);
115
114
  // TODO: remove this hacky use of ref.
116
115
  function PeaksPreferences(props, ref) {
117
116
  const nucleus = useNucleus();
118
117
  const preferences = usePreferences();
119
- return (_jsx(MemoizedPeaksPreferences, { innerRef: ref, ...{ nucleus, preferences } }, void 0));
118
+ return (_jsx(MemoizedPeaksPreferences, { innerRef: ref, ...{ nucleus, preferences } }));
120
119
  }
121
120
  export default forwardRef(PeaksPreferences);
@@ -22,7 +22,7 @@ function PeaksTable({ activeTab, preferences, data, info }) {
22
22
  data: { id: params.id, xIndex: params.xIndex },
23
23
  });
24
24
  }, [dispatch]);
25
- const peaksPreferences = useMemo(() => getValue(preferences, `formatting.panels.peaks.[${activeTab}]`, peaksDefaultValues), [activeTab, preferences]);
25
+ const peaksPreferences = useMemo(() => getValue(preferences.current, `formatting.panels.peaks.[${activeTab}]`, peaksDefaultValues), [activeTab, preferences]);
26
26
  const saveDeltaPPMRefsHandler = useCallback((event, row) => {
27
27
  const shiftValue = parseFloat(event.target.value) - parseFloat(row.value);
28
28
  dispatch({ type: SHIFT_SPECTRUM, shiftValue });
@@ -46,7 +46,7 @@ function PeaksTable({ activeTab, preferences, data, info }) {
46
46
  index: 3,
47
47
  Header: 'δ (ppm)',
48
48
  accessor: (row) => format(row.value),
49
- Cell: ({ row }) => (_jsx(EditableColumn, { value: format(row.original.value), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number" }, void 0)),
49
+ Cell: ({ row }) => (_jsx(EditableColumn, { value: format(row.original.value), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number" })),
50
50
  },
51
51
  {
52
52
  showWhen: 'showDeltaHz',
@@ -78,7 +78,7 @@ function PeaksTable({ activeTab, preferences, data, info }) {
78
78
  minWidth: '24px',
79
79
  },
80
80
  id: 'delete-button',
81
- Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deletePeakHandler(e, row), children: _jsx(FaRegTrashAlt, {}, void 0) }, void 0)),
81
+ Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deletePeakHandler(e, row), children: _jsx(FaRegTrashAlt, {}) })),
82
82
  },
83
83
  ], [deletePeakHandler]);
84
84
  const tableColumns = useMemo(() => {
@@ -91,6 +91,6 @@ function PeaksTable({ activeTab, preferences, data, info }) {
91
91
  }
92
92
  return columns.sort((object1, object2) => object1.index - object2.index);
93
93
  }, [COLUMNS, initialColumns, peaksPreferences]);
94
- return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: tableColumns, approxItemHeight: 20, enableVirtualScroll: true }, void 0)) : (_jsx(NoTableData, {}, void 0));
94
+ return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: tableColumns, approxItemHeight: 20, enableVirtualScroll: true })) : (_jsx(NoTableData, {}));
95
95
  }
96
96
  export default memo(PeaksTable);
@@ -52,7 +52,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
52
52
  const showChangeRangesSumModal = useCallback(() => {
53
53
  modal.show(_jsx(ChangeSumModal, { onClose: () => modal.close(), onSave: changeRangesSumHandler, header: currentSum
54
54
  ? `Set new Ranges Sum (Current: ${Number(currentSum).toFixed(2)})`
55
- : 'Set new Ranges Sum', sumOptions: ranges?.options }, void 0));
55
+ : 'Set new Ranges Sum', sumOptions: ranges?.options }));
56
56
  }, [changeRangesSumHandler, currentSum, modal, ranges?.options]);
57
57
  const removeAssignments = useCallback(() => {
58
58
  onUnlink();
@@ -89,18 +89,20 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
89
89
  const handleShowJGraph = useCallback(() => {
90
90
  dispatch({ type: SHOW_J_GRAPH });
91
91
  }, [dispatch]);
92
- const saveToClipboardHandler = useCallback(async (value) => {
93
- const success = await copyHTMLToClipboard(value);
94
- if (success) {
95
- alert.success('Data copied to clipboard');
96
- }
97
- else {
98
- alert.error('copy to clipboard failed');
99
- }
92
+ const saveToClipboardHandler = useCallback((value) => {
93
+ void (async () => {
94
+ const success = await copyHTMLToClipboard(value);
95
+ if (success) {
96
+ alert.success('Data copied to clipboard');
97
+ }
98
+ else {
99
+ alert.error('copy to clipboard failed');
100
+ }
101
+ })();
100
102
  }, [alert]);
101
103
  const saveAsHTMLHandler = useCallback(() => {
102
104
  const { originFrequency: observedFrequency, nucleus } = info;
103
- const format = lodashGet(preferences, `formatting.nucleusByKey[${nucleus.toLowerCase()}]`);
105
+ const format = lodashGet(preferences.current, `formatting.nucleusByKey[${nucleus.toLowerCase()}]`);
104
106
  const nbDecimalDelta = getNumberOfDecimals(format.ppm);
105
107
  const nbDecimalJ = getNumberOfDecimals(format.hz);
106
108
  const result = rangesToACS(ranges.values, {
@@ -109,7 +111,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
109
111
  nbDecimalJ,
110
112
  observedFrequency, //400
111
113
  });
112
- modal.show(_jsx(CopyClipboardModal, { text: result, onCopyClick: saveToClipboardHandler, onClose: () => modal.close() }, void 0), {});
114
+ modal.show(_jsx(CopyClipboardModal, { text: result, onCopyClick: saveToClipboardHandler, onClose: () => modal.close() }), {});
113
115
  }, [info, modal, preferences, ranges.values, saveToClipboardHandler]);
114
116
  const changeSumConstantFlagHandler = useCallback((flag) => {
115
117
  dispatch({
@@ -117,10 +119,10 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
117
119
  payload: flag,
118
120
  });
119
121
  }, [dispatch]);
120
- return (_jsx("div", { css: style, children: _jsxs(DefaultPanelHeader, { counter: ranges?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", children: _jsx(FaFileExport, {}, void 0) }, void 0), _jsx(Button, { popupTitle: currentSum
122
+ return (_jsx("div", { css: style, children: _jsxs(DefaultPanelHeader, { counter: ranges?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", children: _jsx(FaFileExport, {}) }), _jsx(Button, { popupTitle: currentSum
121
123
  ? `Change Ranges Sum (${Number(currentSum).toFixed(2)})`
122
- : 'Change Ranges Sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: _jsx(SvgNmrSum, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Remove all Assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges || !ranges.values || ranges.values.length === 0, className: "btn icon", children: _jsx(FaUnlink, {}, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: showMultiplicityTrees
124
+ : 'Change Ranges Sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: _jsx(SvgNmrSum, {}) }), _jsx(Button, { popupTitle: "Remove all Assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges || !ranges.values || ranges.values.length === 0, className: "btn icon", children: _jsx(FaUnlink, {}) }), _jsx(ToggleButton, { popupTitle: showMultiplicityTrees
123
125
  ? 'Hide Multiplicity Trees in Spectrum'
124
- : 'Show Multiplicity Trees in Spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, defaultValue: showRangesIntegrals, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }, void 0) }, void 0), _jsx(ToggleButton, { className: "icon", popupTitle: "fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: _jsx(ImLink, {}, void 0) }, void 0)] }, void 0) }, void 0));
126
+ : 'Show Multiplicity Trees in Spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ToggleButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ToggleButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, defaultValue: showRangesIntegrals, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ToggleButton, { className: "icon", popupTitle: "fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: _jsx(ImLink, {}) })] }) }));
125
127
  }
126
128
  export default RangesHeader;
@@ -71,8 +71,8 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
71
71
  to,
72
72
  });
73
73
  const dataToClipboard = {
74
- x: x.slice(fromIndex, toIndex),
75
- y: re.slice(fromIndex, toIndex),
74
+ x: Array.from(x.slice(fromIndex, toIndex)),
75
+ y: Array.from(re.slice(fromIndex, toIndex)),
76
76
  ...value,
77
77
  };
78
78
  const success = await copyTextToClipboard(JSON.stringify(dataToClipboard, undefined, 2));
@@ -85,8 +85,7 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
85
85
  }
86
86
  }, [data, alert]);
87
87
  const rangesPreferences = useMemo(() => {
88
- const _preferences = lodashGet(preferences, `formatting.panels.ranges.[${activeTab}]`) ||
89
- getRangeDefaultValues(activeTab);
88
+ const _preferences = lodashGet(preferences.current, `formatting.panels.ranges.[${activeTab}]`) || getRangeDefaultValues(activeTab);
90
89
  return _preferences;
91
90
  }, [activeTab, preferences]);
92
91
  const contextMenu = useMemo(() => [
@@ -122,7 +121,7 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
122
121
  showMultiplicityTrees,
123
122
  showJGraph,
124
123
  isFilterActive,
125
- }, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length }, void 0)), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? (_jsx(RangesTable, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, context: contextMenu, preferences: rangesPreferences }, void 0)) : (_jsx(NoTableData, {}, void 0)) }, void 0)) : (_jsx(RangesPreferences, { ref: settingRef }, void 0)) }, void 0)] }, void 0) }, void 0));
124
+ }, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? (_jsx(RangesTable, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, context: contextMenu, preferences: rangesPreferences })) : (_jsx(NoTableData, {})) })) : (_jsx(RangesPreferences, { ref: settingRef })) })] }) }));
126
125
  }
127
126
  const MemoizedRangesTablePanel = memo(RangesTablePanelInner);
128
127
  const emptyData = { ranges: {}, data: {}, info: {} };
@@ -143,5 +142,5 @@ export default function RangesTablePanel() {
143
142
  xDomain,
144
143
  activeTab,
145
144
  molecules,
146
- } }, void 0));
145
+ } }));
147
146
  }
@@ -8,7 +8,6 @@ import FormikForm from '../../elements/formik/FormikForm';
8
8
  import FormikInput from '../../elements/formik/FormikInput';
9
9
  import { useAlert } from '../../elements/popup/Alert';
10
10
  import useNucleus from '../../hooks/useNucleus';
11
- import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
12
11
  import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
13
12
  import { getRangeDefaultValues } from '../extra/preferences/defaultValues';
14
13
  const styles = {
@@ -78,7 +77,7 @@ function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
78
77
  acc[nucleusLabel] = getRangeDefaultValues(nucleusLabel);
79
78
  return acc;
80
79
  }, {});
81
- const rangesPreferences = getValueByKeyPath(preferences, `formatting.panels.ranges`);
80
+ const rangesPreferences = getValueByKeyPath(preferences.current, `formatting.panels.ranges`);
82
81
  formRef.current.setValues(rangesPreferences ? rangesPreferences : defaultValues);
83
82
  }
84
83
  }, [nucleus, preferences]);
@@ -87,7 +86,7 @@ function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
87
86
  }, [updateValues]);
88
87
  const saveHandler = useCallback((values) => {
89
88
  preferences.dispatch({
90
- type: SET_PANELS_PREFERENCES,
89
+ type: 'SET_PANELS_PREFERENCES',
91
90
  payload: { key: 'ranges', value: values },
92
91
  });
93
92
  alert.success('ranges preferences saved successfully');
@@ -97,7 +96,7 @@ function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
97
96
  formRef.current.submitForm();
98
97
  },
99
98
  }), []);
100
- return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), _jsx(Label, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: _jsx(FormikInput, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
99
+ return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), _jsx(Label, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: _jsx(FormikInput, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }) })] }, nucleusLabel))) }) }));
101
100
  }
102
101
  const MemoizedRangesPreferences = memo(RangesPreferencesInner);
103
102
  // TODO: remove this hacky use of ref.
@@ -107,6 +106,6 @@ function RangesPreferences(prop, ref) {
107
106
  return (_jsx(MemoizedRangesPreferences, { innerRef: ref, ...{
108
107
  preferences,
109
108
  nucleus,
110
- } }, void 0));
109
+ } }));
111
110
  }
112
111
  export default forwardRef(RangesPreferences);
@@ -8,7 +8,7 @@ import checkModifierKeyActivated from '../../../data/utilities/checkModifierKeyA
8
8
  import ContextMenu from '../../elements/ContextMenu';
9
9
  import useTableSortBy from '../../hooks/useTableSortBy';
10
10
  import RangesTableRow from './RangesTableRow';
11
- import useMapRanges from './useMapRanges';
11
+ import useMapRanges from './hooks/useMapRanges';
12
12
  const tableStyle = css `
13
13
  border-spacing: 0;
14
14
  border: 1px solid #dedede;
@@ -62,8 +62,8 @@ function RangesTable({ tableData, onUnlink, context, activeTab, preferences }) {
62
62
  contextRef.current.handleContextMenu(e, rowData);
63
63
  }
64
64
  }, [contextRef]);
65
- return (_jsxs(Fragment, { children: [_jsxs("table", { css: tableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "#" }, void 0), isVisible('showFrom') ? (_jsxs("th", { id: "from", ...onSort, children: ["From", isSortedDesc('from').content] }, void 0)) : null, isVisible('showTo') ? (_jsxs("th", { id: "to", ...onSort, children: ["To ", isSortedDesc('to').content] }, void 0)) : null, _jsx("th", { children: "\u03B4 (ppm) " }, void 0), isVisible('showRelative') ? (_jsxs("th", { id: "integral", ...onSort, children: ["Rel. ", element, " ", isSortedDesc('integral').content] }, void 0)) : null, isVisible('showAbsolute') ? _jsx("th", { children: "Absolute" }, void 0) : null, _jsx("th", { children: "Mult." }, void 0), _jsx("th", { children: "J (Hz)" }, void 0), _jsx("th", { children: _jsx(FaLink, { style: { fontSize: 10 } }, void 0) }, void 0), _jsx("th", { children: "\u03A3" }, void 0), _jsx("th", { children: "Kind" }, void 0), _jsx("th", { children: '' }, void 0)] }, void 0) }, void 0), _jsx("tbody", { children: data?.map((range) => {
65
+ return (_jsxs(Fragment, { children: [_jsxs("table", { css: tableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "#" }), isVisible('showFrom') ? (_jsxs("th", { id: "from", ...onSort, children: ["From", isSortedDesc('from').content] })) : null, isVisible('showTo') ? (_jsxs("th", { id: "to", ...onSort, children: ["To ", isSortedDesc('to').content] })) : null, _jsx("th", { children: "\u03B4 (ppm) " }), isVisible('showRelative') ? (_jsxs("th", { id: "integration", ...onSort, children: ["Rel. ", element, " ", isSortedDesc('integration').content] })) : null, isVisible('showAbsolute') ? _jsx("th", { children: "Absolute" }) : null, _jsx("th", { children: "Mult." }), _jsx("th", { children: "J (Hz)" }), _jsx("th", { children: _jsx(FaLink, { style: { fontSize: 10 } }) }), _jsx("th", { children: "\u03A3" }), _jsx("th", { children: "Kind" }), _jsx("th", { children: '' })] }) }), _jsx("tbody", { children: data?.map((range) => {
66
66
  return (_jsx(RangesTableRow, { rowData: range, onUnlink: onUnlink, onContextMenu: (e, rowData) => contextMenuHandler(e, rowData), preferences: preferences }, range.rowKey));
67
- }) }, void 0)] }, void 0), _jsx(ContextMenu, { ref: contextRef, context: context }, void 0)] }, void 0));
67
+ }) })] }), _jsx(ContextMenu, { ref: contextRef, context: context })] }));
68
68
  }
69
69
  export default RangesTable;
@@ -109,6 +109,6 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, }) {
109
109
  ? ConstantlyHighlightedRowStyle
110
110
  : null;
111
111
  }, [assignmentRange.isActive, highlightRange.isActive, rowData]);
112
- return (_jsxs("tr", { onContextMenu: (e) => onContextMenu(e, rowData), css: trCss, children: [_jsx("td", { ...rowSpanTags, ...onHoverRange, children: rowData.tableMetaInfo.rowIndex + 1 }, void 0), isColumnVisible(preferences, 'showFrom') && (_jsx(RangeColumn, { value: rowData.from, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('showFrom', undefined) }, void 0)), isColumnVisible(preferences, 'showTo') && (_jsx(RangeColumn, { value: rowData.to, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('toFormat', undefined) }, void 0)), _jsx(SignalDeltaColumn, { rowData: rowData, onHoverSignal: onHoverSignal, preferences: preferences }, void 0), isColumnVisible(preferences, 'showRelative') && (_jsx(RelativeColumn, { rowData: rowData, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('relativeFormat', undefined) }, void 0)), isColumnVisible(preferences, 'showAbsolute') && (_jsx(AbsoluteColumn, { value: rowData.absolute, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('absoluteFormat', undefined) }, void 0)), _jsx("td", { ...onHoverSignal, children: lodashGet(rowData, 'tableMetaInfo.signal.multiplicity', '') }, void 0), _jsx(CouplingColumn, { rowData: rowData, onHoverSignal: onHoverSignal }, void 0), _jsx(SignalAssignmentsColumn, { rowData: rowData, assignment: assignmentSignal, highlight: highlightSignal, onHover: onHoverSignal, unlinkVisibility: unlinkSignalButtonVisibility, onUnlinkVisibilityChange: (flag) => showUnlinkSignalButton(flag), onLink: linkHandler, onUnlink: unlinkHandler }, void 0), _jsx(RangeAssignmentsColumn, { rowData: rowData, assignment: assignmentRange, highlight: highlightRangeAssignmentsColumn, onHover: onHoverRangeAssignmentsColumn, unlinkVisibility: unlinkRangeButtonVisibility, onUnlinkVisibilityChange: (flag) => showUnlinkRangeButton(flag), onLink: linkHandler, onUnlink: unlinkHandler, rowSpanTags: rowSpanTags, highlightData: highlightData }, void 0), _jsx(ActionsColumn, { rowData: rowData, onHoverSignal: onHoverSignal, onHoverRange: onHoverRange, rowSpanTags: rowSpanTags }, void 0)] }, void 0));
112
+ return (_jsxs("tr", { onContextMenu: (e) => onContextMenu(e, rowData), css: trCss, children: [_jsx("td", { ...rowSpanTags, ...onHoverRange, children: rowData.tableMetaInfo.rowIndex + 1 }), isColumnVisible(preferences, 'showFrom') && (_jsx(RangeColumn, { value: rowData.from, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('showFrom', undefined) })), isColumnVisible(preferences, 'showTo') && (_jsx(RangeColumn, { value: rowData.to, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('toFormat', undefined) })), _jsx(SignalDeltaColumn, { rowData: rowData, onHoverSignal: onHoverSignal, preferences: preferences }), isColumnVisible(preferences, 'showRelative') && (_jsx(RelativeColumn, { rowData: rowData, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('relativeFormat', undefined) })), isColumnVisible(preferences, 'showAbsolute') && (_jsx(AbsoluteColumn, { value: rowData.absolute, rowSpanTags: rowSpanTags, onHoverRange: onHoverRange, format: getFormat('absoluteFormat', undefined) })), _jsx("td", { ...onHoverSignal, children: lodashGet(rowData, 'tableMetaInfo.signal.multiplicity', '') }), _jsx(CouplingColumn, { rowData: rowData, onHoverSignal: onHoverSignal }), _jsx(SignalAssignmentsColumn, { rowData: rowData, assignment: assignmentSignal, highlight: highlightSignal, onHover: onHoverSignal, unlinkVisibility: unlinkSignalButtonVisibility, onUnlinkVisibilityChange: (flag) => showUnlinkSignalButton(flag), onLink: linkHandler, onUnlink: unlinkHandler }), _jsx(RangeAssignmentsColumn, { rowData: rowData, assignment: assignmentRange, highlight: highlightRangeAssignmentsColumn, onHover: onHoverRangeAssignmentsColumn, unlinkVisibility: unlinkRangeButtonVisibility, onUnlinkVisibilityChange: (flag) => showUnlinkRangeButton(flag), onLink: linkHandler, onUnlink: unlinkHandler, rowSpanTags: rowSpanTags, highlightData: highlightData }), _jsx(ActionsColumn, { rowData: rowData, onHoverSignal: onHoverSignal, onHoverRange: onHoverRange, rowSpanTags: rowSpanTags })] }));
113
113
  }
114
114
  export default RangesTableRow;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import FormatNumber from '../../../utility/FormatNumber';
3
3
  function AbsoluteColumn({ rowSpanTags, value, onHoverRange, format, }) {
4
- return (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: FormatNumber(value, format) }, void 0));
4
+ return (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: FormatNumber(value, format) }));
5
5
  }
6
6
  export default AbsoluteColumn;
@@ -1,11 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
+ import { RangeData } from '../hooks/useMapRanges';
2
3
  interface ActionsColumnProps {
3
- rowData: {
4
- id: number;
5
- from: number;
6
- to: number;
7
- tableMetaInfo: any;
8
- };
4
+ rowData: RangeData;
9
5
  rowSpanTags: {
10
6
  rowSpan: any;
11
7
  style: CSSProperties;
@@ -1,20 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
- import { Fragment, useCallback } from 'react';
4
+ import { Fragment } from 'react';
5
5
  import { FaRegTrashAlt, FaSearchPlus, FaEdit } from 'react-icons/fa';
6
6
  import { SignalKinds } from '../../../../data/constants/SignalsKinds';
7
- import { useAssignmentData } from '../../../assignment';
8
- import { useDispatch } from '../../../context/DispatchContext';
9
7
  import Select from '../../../elements/Select';
10
- import { useModal, positions, transitions, } from '../../../elements/popup/Modal';
11
- import EditRangeModal from '../../../modal/editRange/EditRangeModal';
12
- import { SET_X_DOMAIN, RESET_SELECTED_TOOL, SET_SELECTED_TOOL, CHANGE_RANGE_SIGNAL_KIND, SAVE_EDITED_RANGE, DELETE_RANGE, } from '../../../reducer/types/Types';
13
- import { options } from '../../../toolbar/ToolTypes';
8
+ import useEditRangeModal from '../hooks/useEditRangeModal';
14
9
  const styles = css `
15
10
  width: 66px;
16
11
  padding: 0 !important;
17
- button {
12
+ button {import useEditRangeModal from './../../../hooks/useEditRangeModal';
13
+
18
14
  background-color: transparent;
19
15
  border: none;
20
16
  padding: 5px;
@@ -31,63 +27,7 @@ const selectBoxStyle = {
31
27
  height: '20px',
32
28
  };
33
29
  function ActionsColumn({ rowData, onHoverSignal, rowSpanTags, }) {
34
- const dispatch = useDispatch();
35
- const modal = useModal();
36
- const assignmentData = useAssignmentData();
37
- const zoomRangeHandler = useCallback(() => {
38
- const margin = Math.abs(rowData.from - rowData.to);
39
- dispatch({
40
- type: SET_X_DOMAIN,
41
- xDomain: [rowData.from - margin, rowData.to + margin],
42
- });
43
- }, [dispatch, rowData.from, rowData.to]);
44
- const deleteRangeHandler = useCallback(() => {
45
- dispatch({
46
- type: DELETE_RANGE,
47
- payload: {
48
- data: { id: rowData.id, assignmentData },
49
- },
50
- });
51
- }, [assignmentData, dispatch, rowData.id]);
52
- const changeRangeSignalKindHandler = useCallback((value) => {
53
- dispatch({
54
- type: CHANGE_RANGE_SIGNAL_KIND,
55
- payload: {
56
- data: { rowData, value },
57
- },
58
- });
59
- }, [dispatch, rowData]);
60
- const saveEditRangeHandler = useCallback((editedRowData) => {
61
- dispatch({
62
- type: SAVE_EDITED_RANGE,
63
- payload: {
64
- editedRowData,
65
- assignmentData,
66
- },
67
- });
68
- }, [assignmentData, dispatch]);
69
- const closeEditRangeHandler = useCallback(() => {
70
- dispatch({ type: RESET_SELECTED_TOOL });
71
- modal.close();
72
- }, [dispatch, modal]);
73
- const openEditRangeHandler = useCallback(() => {
74
- dispatch({
75
- type: SET_SELECTED_TOOL,
76
- payload: { selectedTool: options.editRange.id, tempRange: rowData },
77
- });
78
- modal.show(_jsx(EditRangeModal, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRangeHandler, range: rowData }, void 0), {
79
- position: positions.MIDDLE_RIGHT,
80
- transition: transitions.SCALE,
81
- isBackgroundBlur: false,
82
- });
83
- }, [
84
- closeEditRangeHandler,
85
- dispatch,
86
- modal,
87
- rowData,
88
- saveEditRangeHandler,
89
- zoomRangeHandler,
90
- ]);
91
- return (_jsxs(Fragment, { children: [_jsx("td", { ...onHoverSignal, children: _jsx(Select, { onChange: changeRangeSignalKindHandler, data: SignalKinds, defaultValue: rowData.tableMetaInfo.signal.kind, style: selectBoxStyle }, void 0) }, void 0), _jsxs("td", { ...rowSpanTags, css: styles, children: [_jsx("button", { type: "button", className: "delete-button", onClick: deleteRangeHandler, children: _jsx(FaRegTrashAlt, {}, void 0) }, void 0), _jsx("button", { type: "button", className: "zoom-button", onClick: zoomRangeHandler, children: _jsx(FaSearchPlus, { title: "Zoom to range in spectrum" }, void 0) }, void 0), _jsx("button", { type: "button", className: "edit-button", onClick: openEditRangeHandler, children: _jsx(FaEdit, { color: "blue" }, void 0) }, void 0)] }, void 0)] }, void 0));
30
+ const { editRange, deleteRange, changeRangeSignalKind, zoomRange } = useEditRangeModal(rowData);
31
+ return (_jsxs(Fragment, { children: [_jsx("td", { ...onHoverSignal, children: _jsx(Select, { onChange: changeRangeSignalKind, data: SignalKinds, defaultValue: rowData.tableMetaInfo.signal.kind, style: selectBoxStyle }) }), _jsxs("td", { ...rowSpanTags, css: styles, children: [_jsx("button", { type: "button", className: "delete-button", onClick: deleteRange, children: _jsx(FaRegTrashAlt, {}) }), _jsx("button", { type: "button", className: "zoom-button", onClick: zoomRange, children: _jsx(FaSearchPlus, { title: "Zoom to range in spectrum" }) }), _jsx("button", { type: "button", className: "edit-button", onClick: editRange, children: _jsx(FaEdit, { color: "blue" }) })] })] }));
92
32
  }
93
33
  export default ActionsColumn;
@@ -4,6 +4,6 @@ function CouplingColumn({ rowData, onHoverSignal }) {
4
4
  const result = lodashGet(rowData, 'tableMetaInfo.signal.js');
5
5
  return (_jsx("td", { ...onHoverSignal, children: result
6
6
  ?.map((coupling) => !isNaN(coupling.coupling) ? coupling.coupling.toFixed(1) : '')
7
- .join(',') }, void 0));
7
+ .join(',') }));
8
8
  }
9
9
  export default CouplingColumn;
@@ -31,10 +31,10 @@ function RangeAssignmentsColumn({ rowData, assignment, highlight, onUnlinkVisibi
31
31
  highlight.isActive,
32
32
  highlightData.highlight.sourceData?.type,
33
33
  ]);
34
- return (_jsx("td", { ...rowSpanTags, ...onHover, ...{ onClick: (e) => onLink?.(e, assignment) }, children: rowData.nbAtoms !== undefined && rowData.nbAtoms > 0 ? (rowData.diaIDs && rowData.diaIDs.length > 0 ? (_jsxs("div", { onMouseEnter: () => visibilityChangeHandler(true), onMouseLeave: () => visibilityChangeHandler(false), children: [rowData.nbAtoms, " ", ' ( ', _jsx("span", { style: spanCss, children: diaIDs.length }, void 0), ' ) ', _jsx("sup", { children: _jsx("button", { type: "button", style: {
34
+ return (_jsx("td", { ...rowSpanTags, ...onHover, ...{ onClick: (e) => onLink?.(e, assignment) }, children: rowData.nbAtoms !== undefined && rowData.nbAtoms > 0 ? (rowData.diaIDs && rowData.diaIDs.length > 0 ? (_jsxs("div", { onMouseEnter: () => visibilityChangeHandler(true), onMouseLeave: () => visibilityChangeHandler(false), children: [rowData.nbAtoms, " ", ' ( ', _jsx("span", { style: spanCss, children: diaIDs.length }), ' ) ', _jsx("sup", { children: _jsx("button", { type: "button", style: {
35
35
  visibility: unlinkVisibility ? 'visible' : 'hidden',
36
36
  padding: 0,
37
37
  margin: 0,
38
- }, onClick: (e) => onUnlink?.(e, true), children: _jsx(FaMinusCircle, { color: "red" }, void 0) }, void 0) }, void 0)] }, void 0)) : assignment.isActive ? (_jsxs("div", { children: [`${rowData.nbAtoms} (`, _jsx("span", { style: spanStyle, children: "0" }, void 0), ')'] }, void 0)) : (rowData.nbAtoms)) : assignment.isActive ? (_jsxs("div", { children: ['0 (', _jsx("span", { style: spanStyle, children: "0" }, void 0), ')'] }, void 0)) : ('') }, void 0));
38
+ }, onClick: (e) => onUnlink?.(e, true), children: _jsx(FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive ? (_jsxs("div", { children: [`${rowData.nbAtoms} (`, _jsx("span", { style: spanStyle, children: "0" }), ')'] })) : (rowData.nbAtoms)) : assignment.isActive ? (_jsxs("div", { children: ['0 (', _jsx("span", { style: spanStyle, children: "0" }), ')'] })) : ('') }));
39
39
  }
40
40
  export default memo(RangeAssignmentsColumn);
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import FormatNumber from '../../../utility/FormatNumber';
4
4
  function RangeColumn({ value, rowSpanTags, onHoverRange, format, }) {
5
- return (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: FormatNumber(value, format) }, void 0));
5
+ return (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: FormatNumber(value, format) }));
6
6
  }
7
7
  export default memo(RangeColumn);
@@ -20,6 +20,6 @@ function RelativeColumn({ rowData, rowSpanTags, onHoverRange, format }) {
20
20
  },
21
21
  });
22
22
  }, [dispatch, rowData.id]);
23
- return (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: _jsx(EditableColumn, { value: integralVal, onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } }, void 0) }, void 0));
23
+ return (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: _jsx(EditableColumn, { value: integralVal, onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } }) }));
24
24
  }
25
25
  export default RelativeColumn;
@@ -24,6 +24,6 @@ function SignalAssignmentsColumn({ rowData, onHover, assignment, highlight, onUn
24
24
  visibility: unlinkVisibility ? 'visible' : 'hidden',
25
25
  padding: 0,
26
26
  margin: 0,
27
- }, onClick: (e) => onUnlink?.(e, false), children: _jsx(FaMinusCircle, { color: "red" }, void 0) }, void 0) }, void 0)] }, void 0)) : assignment.isActive ? ('0') : ('') }, void 0));
27
+ }, onClick: (e) => onUnlink?.(e, false), children: _jsx(FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive ? ('0') : ('') }));
28
28
  }
29
29
  export default memo(SignalAssignmentsColumn);
@@ -20,7 +20,7 @@ function SignalDeltaColumn({ rowData, onHoverSignal, preferences, }) {
20
20
  });
21
21
  }, [dispatch, rowData.id, signal.id]);
22
22
  if (!signal)
23
- return _jsx("td", { children: '' }, void 0);
24
- return (_jsx("td", { ...onHoverSignal, children: !checkMultiplicity(signal.multiplicity, ['m']) ? (`${format(rowData.from, 'fromFormat')} - ${format(rowData.to, 'toFormat')}`) : (_jsx(EditableColumn, { value: signal.delta.toFixed(3), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } }, void 0)) }, void 0));
23
+ return _jsx("td", { children: '' });
24
+ return (_jsx("td", { ...onHoverSignal, children: !checkMultiplicity(signal.multiplicity, ['m']) ? (`${format(rowData.from, 'fromFormat')} - ${format(rowData.to, 'toFormat')}`) : (_jsx(EditableColumn, { value: signal.delta.toFixed(3), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } })) }));
25
25
  }
26
26
  export default SignalDeltaColumn;
@@ -0,0 +1,7 @@
1
+ import { RangeData } from './useMapRanges';
2
+ export default function useEditRangeModal(range: RangeData): {
3
+ editRange: () => void;
4
+ deleteRange: () => void;
5
+ zoomRange: () => void;
6
+ changeRangeSignalKind: (value: any) => void;
7
+ };
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useMemo } from 'react';
3
+ import { useAssignmentData } from '../../../assignment';
4
+ import { useDispatch } from '../../../context/DispatchContext';
5
+ import { useModal } from '../../../elements/popup/Modal';
6
+ import { positions, transitions } from '../../../elements/popup/options';
7
+ import EditRangeModal from '../../../modal/editRange/EditRangeModal';
8
+ import { CHANGE_RANGE_SIGNAL_KIND, DELETE_RANGE, RESET_SELECTED_TOOL, SAVE_EDITED_RANGE, SET_SELECTED_TOOL, SET_X_DOMAIN, } from '../../../reducer/types/Types';
9
+ import { options } from '../../../toolbar/ToolTypes';
10
+ export default function useEditRangeModal(range) {
11
+ const dispatch = useDispatch();
12
+ const modal = useModal();
13
+ const assignmentData = useAssignmentData();
14
+ const zoomRange = useCallback(() => {
15
+ const margin = Math.abs(range.from - range.to);
16
+ dispatch({
17
+ type: SET_X_DOMAIN,
18
+ xDomain: [range.from - margin, range.to + margin],
19
+ });
20
+ }, [dispatch, range.from, range.to]);
21
+ const deleteRange = useCallback(() => {
22
+ dispatch({
23
+ type: DELETE_RANGE,
24
+ payload: {
25
+ data: { id: range.id, assignmentData },
26
+ },
27
+ });
28
+ }, [assignmentData, dispatch, range.id]);
29
+ const changeRangeSignalKind = useCallback((value) => {
30
+ dispatch({
31
+ type: CHANGE_RANGE_SIGNAL_KIND,
32
+ payload: {
33
+ data: { rowData: range, value },
34
+ },
35
+ });
36
+ }, [dispatch, range]);
37
+ const saveEditRangeHandler = useCallback((editedRowData) => {
38
+ dispatch({
39
+ type: SAVE_EDITED_RANGE,
40
+ payload: {
41
+ editedRowData,
42
+ assignmentData,
43
+ },
44
+ });
45
+ }, [assignmentData, dispatch]);
46
+ const closeEditRangeHandler = useCallback(() => {
47
+ dispatch({ type: RESET_SELECTED_TOOL });
48
+ modal.close();
49
+ }, [dispatch, modal]);
50
+ const editRange = useCallback(() => {
51
+ dispatch({
52
+ type: SET_SELECTED_TOOL,
53
+ payload: { selectedTool: options.editRange.id, tempRange: range },
54
+ });
55
+ modal.show(_jsx(EditRangeModal, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: range }), {
56
+ position: positions.MIDDLE_RIGHT,
57
+ transition: transitions.SCALE,
58
+ isBackgroundBlur: false,
59
+ });
60
+ }, [
61
+ closeEditRangeHandler,
62
+ dispatch,
63
+ modal,
64
+ range,
65
+ saveEditRangeHandler,
66
+ zoomRange,
67
+ ]);
68
+ return useMemo(() => ({
69
+ editRange,
70
+ deleteRange,
71
+ zoomRange,
72
+ changeRangeSignalKind,
73
+ }), [changeRangeSignalKind, deleteRange, editRange, zoomRange]);
74
+ }
@@ -0,0 +1,7 @@
1
+ import { Range } from '../../../../data/types/data1d';
2
+ export interface RangeData extends Range {
3
+ rowKey: string;
4
+ tableMetaInfo: any;
5
+ }
6
+ declare function useMapRanges(data: any): RangeData[];
7
+ export default useMapRanges;
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import generateID from '../../../data/utilities/generateID';
2
+ import generateID from '../../../../data/utilities/generateID';
3
3
  function useMapRanges(data) {
4
4
  return useMemo(() => {
5
5
  const _rangesData = [];
@@ -65,21 +65,23 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMod
65
65
  const resetScaleHandler = useCallback(() => {
66
66
  dispatch({ type: RESET_SPECTRA_SCALE });
67
67
  }, [dispatch]);
68
- const automaticPickingHandler = useCallback(async () => {
69
- const hideLoading = await alert.showLoading('Automatic Ranges/Zones detection for all spectra in progress');
70
- setTimeout(() => {
71
- dispatch({ type: AUTO_RANGES_SPECTRA_PICKING });
72
- dispatch({ type: AUTO_ZONES_SPECTRA_PICKING });
73
- hideLoading();
74
- }, 0);
68
+ const automaticPickingHandler = useCallback(() => {
69
+ void (async () => {
70
+ const hideLoading = await alert.showLoading('Automatic Ranges/Zones detection for all spectra in progress');
71
+ setTimeout(() => {
72
+ dispatch({ type: AUTO_RANGES_SPECTRA_PICKING });
73
+ dispatch({ type: AUTO_ZONES_SPECTRA_PICKING });
74
+ hideLoading();
75
+ }, 0);
76
+ })();
75
77
  }, [dispatch, alert]);
76
- return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [_jsx(Button, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: _jsx(FaEyeSlash, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: _jsx(FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && (_jsx(Button, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D && spectrums.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: _jsx(SvgNmrResetScale, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Same Top", onClick: setSameTopHandler, children: _jsx(SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && isAutomaticPickingVisible && (_jsx(Button, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: _jsx(SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
78
+ return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [_jsx(Button, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: _jsx(FaEyeSlash, {}) }), _jsx(Button, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: _jsx(FaEye, {}) }), activeSpectrum && activeTab && activeTab.split(',').length > 1 && (_jsx(Button, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}) })), displayerMode === DISPLAYER_MODE.DM_1D && spectrums.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: _jsx(SvgNmrResetScale, {}) }), _jsx(Button, { popupTitle: "Same Top", onClick: setSameTopHandler, children: _jsx(SvgNmrSameTop, {}) })] })), data && data.length > 0 && isAutomaticPickingVisible && (_jsx(Button, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: _jsx(SvgNmrRangePicking, {}) }))] }));
77
79
  }
78
80
  const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
79
81
  export default function SpectrumsTabs({ spectrums }) {
80
82
  const { data, activeSpectrum, activeTab, displayerMode } = useChartData();
81
83
  const isToolVisible = useCheckToolsVisibility();
82
- const isAutomaticPickingVisible = isToolVisible('hideAutoRangesTool');
84
+ const isAutomaticPickingVisible = isToolVisible('autoRangesTool');
83
85
  return (_jsx(MemoizedSpectraPanelHeader, { ...{
84
86
  data,
85
87
  activeSpectrum,
@@ -87,5 +89,5 @@ export default function SpectrumsTabs({ spectrums }) {
87
89
  displayerMode,
88
90
  spectrums,
89
91
  isAutomaticPickingVisible,
90
- } }, void 0));
92
+ } }));
91
93
  }