nmrium 1.9.0 → 1.10.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 (472) hide show
  1. package/lib/component/1d/ApodizationLine.js +1 -1
  2. package/lib/component/1d/ApodizationLine.js.map +1 -1
  3. package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
  4. package/lib/component/1d/BrushTracker1D.js.map +1 -1
  5. package/lib/component/1d/FooterBanner.js.map +1 -1
  6. package/lib/component/1d/LinesSeries.js +2 -2
  7. package/lib/component/1d/LinesSeries.js.map +1 -1
  8. package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
  9. package/lib/component/1d/SVGContent1D.js +2 -1
  10. package/lib/component/1d/SVGContent1D.js.map +1 -1
  11. package/lib/component/1d/SimilarityTree.d.ts.map +1 -1
  12. package/lib/component/1d/SimilarityTree.js.map +1 -1
  13. package/lib/component/1d/inset/InsetProvider.d.ts.map +1 -1
  14. package/lib/component/1d/inset/InsetProvider.js.map +1 -1
  15. package/lib/component/1d/integral/IntegralResizable.d.ts.map +1 -1
  16. package/lib/component/1d/integral/IntegralResizable.js.map +1 -1
  17. package/lib/component/1d/matrix/Boxplot.js.map +1 -1
  18. package/lib/component/1d/multiAnalysis/AnalysisRange.d.ts.map +1 -1
  19. package/lib/component/1d/multiAnalysis/AnalysisRange.js.map +1 -1
  20. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
  21. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +13 -20
  22. package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
  23. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +1 -0
  24. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts.map +1 -1
  25. package/lib/component/1d/multiplicityTree/generateTreeNodes.js +2 -1
  26. package/lib/component/1d/multiplicityTree/generateTreeNodes.js.map +1 -1
  27. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
  28. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
  29. package/lib/component/1d/peaks/PeakEditionManager.d.ts.map +1 -1
  30. package/lib/component/1d/peaks/PeakEditionManager.js +2 -2
  31. package/lib/component/1d/peaks/PeakEditionManager.js.map +1 -1
  32. package/lib/component/1d/peaks/Peaks.d.ts +4 -1
  33. package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
  34. package/lib/component/1d/peaks/Peaks.js.map +1 -1
  35. package/lib/component/1d/ranges/AssignmentLabel.d.ts +2 -1
  36. package/lib/component/1d/ranges/AssignmentLabel.d.ts.map +1 -1
  37. package/lib/component/1d/ranges/AssignmentLabel.js +6 -4
  38. package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
  39. package/lib/component/1d/ranges/Atoms.js +2 -2
  40. package/lib/component/1d/ranges/Atoms.js.map +1 -1
  41. package/lib/component/1d/ranges/Range.d.ts +2 -1
  42. package/lib/component/1d/ranges/Range.d.ts.map +1 -1
  43. package/lib/component/1d/ranges/Range.js +28 -56
  44. package/lib/component/1d/ranges/Range.js.map +1 -1
  45. package/lib/component/1d/ranges/Ranges.d.ts.map +1 -1
  46. package/lib/component/1d/ranges/Ranges.js +19 -13
  47. package/lib/component/1d/ranges/Ranges.js.map +1 -1
  48. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts +14 -0
  49. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts.map +1 -0
  50. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js +67 -0
  51. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js.map +1 -0
  52. package/lib/component/1d/tool/BaseLineZones.d.ts.map +1 -1
  53. package/lib/component/1d/tool/BaseLineZones.js.map +1 -1
  54. package/lib/component/1d/utilities/intersectionResolver.d.ts.map +1 -1
  55. package/lib/component/1d/utilities/intersectionResolver.js.map +1 -1
  56. package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
  57. package/lib/component/1d-2d/FieldEdition.js.map +1 -1
  58. package/lib/component/2d/1d-tracer/VerticalSliceChart.js.map +1 -1
  59. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
  60. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js.map +1 -1
  61. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +1 -1
  62. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js.map +1 -1
  63. package/lib/component/2d/BrushTracker2D.d.ts.map +1 -1
  64. package/lib/component/2d/BrushTracker2D.js +41 -46
  65. package/lib/component/2d/BrushTracker2D.js.map +1 -1
  66. package/lib/component/2d/FooterBanner.d.ts +2 -2
  67. package/lib/component/2d/FooterBanner.d.ts.map +1 -1
  68. package/lib/component/2d/FooterBanner.js +63 -97
  69. package/lib/component/2d/FooterBanner.js.map +1 -1
  70. package/lib/component/2d/SVGContent2D.d.ts +2 -2
  71. package/lib/component/2d/SVGContent2D.d.ts.map +1 -1
  72. package/lib/component/2d/SVGContent2D.js.map +1 -1
  73. package/lib/component/2d/SlicingView.js +1 -1
  74. package/lib/component/2d/SlicingView.js.map +1 -1
  75. package/lib/component/2d/Viewer2D.js +1 -1
  76. package/lib/component/2d/Viewer2D.js.map +1 -1
  77. package/lib/component/2d/ft/FTContainer.d.ts +2 -2
  78. package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
  79. package/lib/component/2d/ft/FTContainer.js +1 -1
  80. package/lib/component/2d/ft/FTContainer.js.map +1 -1
  81. package/lib/component/2d/tools/XYLabelPointer.d.ts +2 -2
  82. package/lib/component/2d/tools/XYLabelPointer.d.ts.map +1 -1
  83. package/lib/component/2d/tools/XYLabelPointer.js +10 -9
  84. package/lib/component/2d/tools/XYLabelPointer.js.map +1 -1
  85. package/lib/component/2d/useTracesSpectra.d.ts +3 -2
  86. package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
  87. package/lib/component/2d/useTracesSpectra.js +16 -10
  88. package/lib/component/2d/useTracesSpectra.js.map +1 -1
  89. package/lib/component/2d/utilities/extractSpectrumSignals.js +2 -2
  90. package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
  91. package/lib/component/2d/zones/Signal.js.map +1 -1
  92. package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
  93. package/lib/component/2d/zones/SignalsGuideLines.js +15 -13
  94. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  95. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
  96. package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
  97. package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -6
  98. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  99. package/lib/component/EventsTrackers/BrushTracker.js +2 -0
  100. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  101. package/lib/component/assignment/utilities/getAssignments.js +1 -2
  102. package/lib/component/assignment/utilities/getAssignments.js.map +1 -1
  103. package/lib/component/context/KeyModifierContext.d.ts +3 -2
  104. package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
  105. package/lib/component/context/KeyModifierContext.js +7 -4
  106. package/lib/component/context/KeyModifierContext.js.map +1 -1
  107. package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
  108. package/lib/component/elements/ActionsButtonsPopover.js +17 -3
  109. package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
  110. package/lib/component/elements/AssignmentsCell.d.ts.map +1 -1
  111. package/lib/component/elements/AssignmentsCell.js.map +1 -1
  112. package/lib/component/elements/Button.d.ts.map +1 -1
  113. package/lib/component/elements/Button.js.map +1 -1
  114. package/lib/component/elements/CheckController.d.ts.map +1 -1
  115. package/lib/component/elements/CheckController.js.map +1 -1
  116. package/lib/component/elements/ContextMenuBluePrint.d.ts.map +1 -1
  117. package/lib/component/elements/ContextMenuBluePrint.js.map +1 -1
  118. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  119. package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
  120. package/lib/component/elements/DraggableDialog.js.map +1 -1
  121. package/lib/component/elements/Input.d.ts.map +1 -1
  122. package/lib/component/elements/Input.js.map +1 -1
  123. package/lib/component/elements/Input2.d.ts.map +1 -1
  124. package/lib/component/elements/Input2.js.map +1 -1
  125. package/lib/component/elements/Input2Controller.d.ts.map +1 -1
  126. package/lib/component/elements/Input2Controller.js.map +1 -1
  127. package/lib/component/elements/Label.d.ts.map +1 -1
  128. package/lib/component/elements/Label.js.map +1 -1
  129. package/lib/component/elements/NumberInput2.d.ts.map +1 -1
  130. package/lib/component/elements/NumberInput2.js.map +1 -1
  131. package/lib/component/elements/NumberInput2Controller.d.ts.map +1 -1
  132. package/lib/component/elements/NumberInput2Controller.js.map +1 -1
  133. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +1 -1
  134. package/lib/component/elements/ReactTable/ReactTable.js.map +1 -1
  135. package/lib/component/elements/ReadOnly.d.ts.map +1 -1
  136. package/lib/component/elements/ReadOnly.js.map +1 -1
  137. package/lib/component/elements/Sections.js.map +1 -1
  138. package/lib/component/elements/Select.d.ts.map +1 -1
  139. package/lib/component/elements/Select.js.map +1 -1
  140. package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
  141. package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
  142. package/lib/component/elements/export/ExportContent.js.map +1 -1
  143. package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
  144. package/lib/component/elements/print/PrintContent.js.map +1 -1
  145. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.d.ts.map +1 -1
  146. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +2 -4
  147. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js.map +1 -1
  148. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts.map +1 -1
  149. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +2 -4
  150. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js.map +1 -1
  151. package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
  152. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -4
  153. package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
  154. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
  155. package/lib/component/hooks/useActiveSpectrumStyleOptions.js.map +1 -1
  156. package/lib/component/hooks/useActiveSpectrumZonesViewState.d.ts.map +1 -1
  157. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +2 -4
  158. package/lib/component/hooks/useActiveSpectrumZonesViewState.js.map +1 -1
  159. package/lib/component/hooks/useExport.js +1 -1
  160. package/lib/component/hooks/useExport.js.map +1 -1
  161. package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
  162. package/lib/component/hooks/useSaveSettings.js +28 -47
  163. package/lib/component/hooks/useSaveSettings.js.map +1 -1
  164. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +2 -1
  165. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
  166. package/lib/component/hooks/useSetActiveSpectrumAction.js +2 -2
  167. package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
  168. package/lib/component/hooks/useSpectrumWithDataSource.js +1 -1
  169. package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
  170. package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
  171. package/lib/component/hooks/useWorkspaceAction.d.ts.map +1 -1
  172. package/lib/component/hooks/useWorkspaceAction.js +3 -0
  173. package/lib/component/hooks/useWorkspaceAction.js.map +1 -1
  174. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  175. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  176. package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
  177. package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
  178. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  179. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  180. package/lib/component/modal/setting/GeneralSettings.d.ts.map +1 -1
  181. package/lib/component/modal/setting/GeneralSettings.js +5 -1
  182. package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
  183. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  184. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  185. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
  186. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  187. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +14 -10
  188. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  189. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
  190. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +27 -18
  191. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
  192. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -1
  193. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +0 -3
  194. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -1
  195. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  196. package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
  197. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  198. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  199. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  200. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  201. package/lib/component/panels/RangesPanel/RangesTableRow.js +5 -20
  202. package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
  203. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts.map +1 -1
  204. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
  205. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +9 -0
  206. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -0
  207. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +19 -0
  208. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -0
  209. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
  210. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
  211. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  212. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
  213. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  214. package/lib/component/panels/accordionItems.d.ts.map +1 -1
  215. package/lib/component/panels/accordionItems.js.map +1 -1
  216. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts.map +1 -1
  217. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  218. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  219. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
  220. package/lib/component/panels/predictionPanel/PredictionPanel.js +13 -9
  221. package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
  222. package/lib/component/reducer/Reducer.js +7 -7
  223. package/lib/component/reducer/Reducer.js.map +1 -1
  224. package/lib/component/reducer/actions/AssignmentsActions.d.ts.map +1 -1
  225. package/lib/component/reducer/actions/AssignmentsActions.js +9 -9
  226. package/lib/component/reducer/actions/AssignmentsActions.js.map +1 -1
  227. package/lib/component/reducer/actions/CorrelationsActions.d.ts.map +1 -1
  228. package/lib/component/reducer/actions/CorrelationsActions.js +21 -21
  229. package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
  230. package/lib/component/reducer/actions/DatabaseActions.js +1 -1
  231. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  232. package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
  233. package/lib/component/reducer/actions/DomainActions.js +10 -18
  234. package/lib/component/reducer/actions/DomainActions.js.map +1 -1
  235. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  236. package/lib/component/reducer/actions/FiltersActions.js +28 -44
  237. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  238. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  239. package/lib/component/reducer/actions/InsetActions.js +9 -18
  240. package/lib/component/reducer/actions/InsetActions.js.map +1 -1
  241. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  242. package/lib/component/reducer/actions/IntegralsActions.d.ts.map +1 -1
  243. package/lib/component/reducer/actions/IntegralsActions.js +43 -48
  244. package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
  245. package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
  246. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  247. package/lib/component/reducer/actions/MoleculeActions.js +64 -10
  248. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  249. package/lib/component/reducer/actions/PeaksActions.d.ts.map +1 -1
  250. package/lib/component/reducer/actions/PeaksActions.js +110 -121
  251. package/lib/component/reducer/actions/PeaksActions.js.map +1 -1
  252. package/lib/component/reducer/actions/PreferencesActions.d.ts.map +1 -1
  253. package/lib/component/reducer/actions/PreferencesActions.js +2 -1
  254. package/lib/component/reducer/actions/PreferencesActions.js.map +1 -1
  255. package/lib/component/reducer/actions/RangesActions.d.ts +18 -18
  256. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  257. package/lib/component/reducer/actions/RangesActions.js +148 -171
  258. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  259. package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
  260. package/lib/component/reducer/actions/SpectraActions.js +29 -31
  261. package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
  262. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  263. package/lib/component/reducer/actions/ToolsActions.js +10 -11
  264. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  265. package/lib/component/reducer/actions/ZonesActions.d.ts +8 -9
  266. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  267. package/lib/component/reducer/actions/ZonesActions.js +123 -151
  268. package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
  269. package/lib/component/reducer/helper/get2DRange.d.ts +3 -1
  270. package/lib/component/reducer/helper/get2DRange.d.ts.map +1 -1
  271. package/lib/component/reducer/helper/get2DRange.js.map +1 -1
  272. package/lib/component/reducer/helper/getSpectrum.js +1 -1
  273. package/lib/component/reducer/helper/getSpectrum.js.map +1 -1
  274. package/lib/component/reducer/helper/setIntegralsViewProperty.js +1 -1
  275. package/lib/component/reducer/helper/setIntegralsViewProperty.js.map +1 -1
  276. package/lib/component/reducer/helper/setRangesViewProperty.js +1 -1
  277. package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
  278. package/lib/component/useWatchForm.d.ts.map +1 -1
  279. package/lib/component/useWatchForm.js.map +1 -1
  280. package/lib/component/utility/stackOverlappingLabels.d.ts +1 -1
  281. package/lib/component/utility/stackOverlappingLabels.d.ts.map +1 -1
  282. package/lib/component/utility/stackOverlappingLabels.js.map +1 -1
  283. package/lib/data/SpectraManager.d.ts.map +1 -1
  284. package/lib/data/SpectraManager.js.map +1 -1
  285. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
  286. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +0 -3
  287. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
  288. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +8 -1
  289. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
  290. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -2
  291. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
  292. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
  293. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +3 -3
  294. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +4 -14
  295. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
  296. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
  297. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
  298. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  299. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +3 -5
  300. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts.map +1 -1
  301. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +3 -5
  302. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js.map +1 -1
  303. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +2 -1
  304. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts.map +1 -1
  305. package/lib/data/data2d/Spectrum2D/zones/detectZones.js.map +1 -1
  306. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +7 -63
  307. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  308. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +9 -14
  309. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js.map +1 -1
  310. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -10
  311. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts.map +1 -1
  312. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +23 -43
  313. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
  314. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -54
  315. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  316. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +1 -1
  317. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js.map +1 -1
  318. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  319. package/lib/data/molecules/Molecule.js.map +1 -1
  320. package/lib/data/types/data1d/RangeDetectionResult.d.ts.map +1 -1
  321. package/lib/data/utilities/FindUtilities.d.ts.map +1 -1
  322. package/lib/data/utilities/FindUtilities.js +11 -11
  323. package/lib/data/utilities/FindUtilities.js.map +1 -1
  324. package/lib/utils/clipboard/clipboardComponents.d.ts.map +1 -1
  325. package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
  326. package/lib/utils/clipboard/clipboardHooks.d.ts +2 -2
  327. package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
  328. package/lib/utils/clipboard/clipboardHooks.js +10 -4
  329. package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
  330. package/lib/versionInfo.d.ts.map +1 -1
  331. package/lib/versionInfo.js +1 -1
  332. package/lib/versionInfo.js.map +1 -1
  333. package/package.json +24 -22
  334. package/src/component/1d/ApodizationLine.tsx +1 -1
  335. package/src/component/1d/BrushTracker1D.tsx +10 -10
  336. package/src/component/1d/FooterBanner.tsx +2 -2
  337. package/src/component/1d/LinesSeries.tsx +2 -2
  338. package/src/component/1d/SVGContent1D.tsx +6 -2
  339. package/src/component/1d/SimilarityTree.tsx +3 -2
  340. package/src/component/1d/inset/InsetProvider.tsx +4 -2
  341. package/src/component/1d/integral/IntegralResizable.tsx +2 -1
  342. package/src/component/1d/matrix/Boxplot.tsx +3 -3
  343. package/src/component/1d/multiAnalysis/AnalysisRange.tsx +2 -1
  344. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +24 -23
  345. package/src/component/1d/multiplicityTree/generateTreeNodes.ts +10 -1
  346. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +4 -2
  347. package/src/component/1d/peaks/PeakEditionManager.tsx +8 -3
  348. package/src/component/1d/peaks/Peaks.tsx +5 -1
  349. package/src/component/1d/ranges/AssignmentLabel.tsx +8 -5
  350. package/src/component/1d/ranges/Atoms.tsx +2 -2
  351. package/src/component/1d/ranges/Range.tsx +42 -74
  352. package/src/component/1d/ranges/Ranges.tsx +33 -28
  353. package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +93 -0
  354. package/src/component/1d/tool/BaseLineZones.tsx +2 -1
  355. package/src/component/1d/utilities/intersectionResolver.ts +3 -4
  356. package/src/component/1d-2d/FieldEdition.tsx +2 -2
  357. package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
  358. package/src/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.tsx +1 -1
  359. package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +1 -1
  360. package/src/component/2d/BrushTracker2D.tsx +50 -55
  361. package/src/component/2d/FooterBanner.tsx +80 -105
  362. package/src/component/2d/SVGContent2D.tsx +2 -3
  363. package/src/component/2d/SlicingView.tsx +1 -1
  364. package/src/component/2d/Viewer2D.tsx +2 -2
  365. package/src/component/2d/ft/FTContainer.tsx +4 -5
  366. package/src/component/2d/tools/XYLabelPointer.tsx +12 -11
  367. package/src/component/2d/useTracesSpectra.ts +25 -14
  368. package/src/component/2d/utilities/extractSpectrumSignals.ts +2 -2
  369. package/src/component/2d/zones/Signal.tsx +1 -1
  370. package/src/component/2d/zones/SignalsGuideLines.tsx +21 -19
  371. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +4 -4
  372. package/src/component/EventsTrackers/BrushTracker.tsx +24 -17
  373. package/src/component/assignment/utilities/getAssignments.ts +1 -2
  374. package/src/component/context/KeyModifierContext.tsx +13 -5
  375. package/src/component/elements/ActionsButtonsPopover.tsx +25 -8
  376. package/src/component/elements/AssignmentsCell.tsx +1 -2
  377. package/src/component/elements/Button.tsx +3 -2
  378. package/src/component/elements/CheckController.tsx +2 -1
  379. package/src/component/elements/ContextMenuBluePrint.tsx +2 -1
  380. package/src/component/elements/D3Axis.tsx +3 -3
  381. package/src/component/elements/DraggableDialog.tsx +2 -1
  382. package/src/component/elements/Input.tsx +4 -2
  383. package/src/component/elements/Input2.tsx +1 -2
  384. package/src/component/elements/Input2Controller.tsx +2 -1
  385. package/src/component/elements/Label.tsx +2 -1
  386. package/src/component/elements/NumberInput2.tsx +4 -2
  387. package/src/component/elements/NumberInput2Controller.tsx +3 -1
  388. package/src/component/elements/ReactTable/ReactTable.tsx +1 -3
  389. package/src/component/elements/ReadOnly.tsx +4 -2
  390. package/src/component/elements/Sections.tsx +5 -4
  391. package/src/component/elements/Select.tsx +4 -2
  392. package/src/component/elements/ToolbarPopoverItem.tsx +3 -3
  393. package/src/component/elements/export/ExportContent.tsx +1 -2
  394. package/src/component/elements/print/PrintContent.tsx +1 -2
  395. package/src/component/hooks/useActiveSpectrumIntegralsViewState.ts +2 -6
  396. package/src/component/hooks/useActiveSpectrumPeaksViewState.ts +2 -6
  397. package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -6
  398. package/src/component/hooks/useActiveSpectrumStyleOptions.ts +2 -2
  399. package/src/component/hooks/useActiveSpectrumZonesViewState.ts +2 -6
  400. package/src/component/hooks/useExport.tsx +1 -1
  401. package/src/component/hooks/useSaveSettings.tsx +68 -81
  402. package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
  403. package/src/component/hooks/useSpectrumWithDataSource.ts +1 -1
  404. package/src/component/hooks/useWorkspaceAction.ts +5 -0
  405. package/src/component/modal/ImportPublicationStringModal.tsx +1 -2
  406. package/src/component/modal/changeSum/ChangeSumModal.tsx +4 -2
  407. package/src/component/modal/metaImportation/MetaImportationModal.tsx +1 -2
  408. package/src/component/modal/setting/GeneralSettings.tsx +7 -2
  409. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -2
  410. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +17 -13
  411. package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +32 -16
  412. package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +0 -4
  413. package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -1
  414. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -8
  415. package/src/component/panels/RangesPanel/RangesTableRow.tsx +14 -47
  416. package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -2
  417. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +40 -0
  418. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +1 -2
  419. package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
  420. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -6
  421. package/src/component/panels/accordionItems.tsx +4 -2
  422. package/src/component/panels/extra/preferences/NucleusPreferences.tsx +2 -2
  423. package/src/component/panels/informationPanel/InformationEditionModal.tsx +4 -2
  424. package/src/component/panels/predictionPanel/PredictionPanel.tsx +17 -9
  425. package/src/component/reducer/Reducer.ts +8 -8
  426. package/src/component/reducer/actions/AssignmentsActions.ts +8 -13
  427. package/src/component/reducer/actions/CorrelationsActions.ts +21 -22
  428. package/src/component/reducer/actions/DatabaseActions.ts +1 -1
  429. package/src/component/reducer/actions/DomainActions.ts +16 -22
  430. package/src/component/reducer/actions/FiltersActions.ts +34 -58
  431. package/src/component/reducer/actions/InsetActions.ts +9 -19
  432. package/src/component/reducer/actions/IntegralsActions.ts +48 -59
  433. package/src/component/reducer/actions/MoleculeActions.ts +94 -14
  434. package/src/component/reducer/actions/PeaksActions.ts +112 -136
  435. package/src/component/reducer/actions/PreferencesActions.ts +4 -3
  436. package/src/component/reducer/actions/RangesActions.ts +196 -244
  437. package/src/component/reducer/actions/SpectraActions.ts +40 -45
  438. package/src/component/reducer/actions/ToolsActions.ts +9 -13
  439. package/src/component/reducer/actions/ZonesActions.ts +158 -218
  440. package/src/component/reducer/helper/get2DRange.ts +4 -1
  441. package/src/component/reducer/helper/getSpectrum.ts +1 -1
  442. package/src/component/reducer/helper/setIntegralsViewProperty.ts +1 -1
  443. package/src/component/reducer/helper/setRangesViewProperty.ts +1 -1
  444. package/src/component/useWatchForm.tsx +2 -1
  445. package/src/component/utility/stackOverlappingLabels.ts +4 -1
  446. package/src/data/SpectraManager.ts +0 -2
  447. package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +0 -4
  448. package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +15 -5
  449. package/src/data/data1d/Spectrum1D/ranges/changeRangeSignal.ts +5 -5
  450. package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +5 -14
  451. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +2 -2
  452. package/src/data/data2d/Spectrum2D/zones/changeZoneSignal.ts +3 -5
  453. package/src/data/data2d/Spectrum2D/zones/detectZones.ts +3 -2
  454. package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +19 -16
  455. package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +35 -56
  456. package/src/data/data2d/Spectrum2D/zones/initiateZones.ts +1 -1
  457. package/src/data/molecules/Molecule.ts +2 -1
  458. package/src/data/types/data1d/RangeDetectionResult.ts +4 -2
  459. package/src/data/utilities/FindUtilities.ts +9 -8
  460. package/src/utils/clipboard/clipboardComponents.tsx +2 -1
  461. package/src/utils/clipboard/clipboardHooks.ts +14 -8
  462. package/src/versionInfo.ts +1 -1
  463. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +0 -8
  464. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts.map +0 -1
  465. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +0 -17
  466. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js.map +0 -1
  467. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -17
  468. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts.map +0 -1
  469. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +0 -40
  470. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +0 -1
  471. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.tsx +0 -36
  472. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +0 -89
@@ -12,15 +12,14 @@ import { filterAssignedIDs } from '../../assignment/utilities/filterAssignedIDs.
12
12
  import { useDispatch } from '../../context/DispatchContext.js';
13
13
  import { ContextMenu } from '../../elements/ContextMenuBluePrint.js';
14
14
  import type { TableContextMenuProps } from '../../elements/ReactTable/ReactTable.js';
15
- import { useHighlight, useHighlightData } from '../../highlight/index.js';
15
+ import { useHighlight } from '../../highlight/index.js';
16
16
 
17
17
  import AbsoluteColumn from './TableColumns/AbsoluteColumn.js';
18
18
  import ActionsColumn from './TableColumns/ActionsColumn.js';
19
19
  import CouplingColumn from './TableColumns/CouplingColumn.js';
20
- import { RangeAssignmentColumn } from './TableColumns/RangeAssignmentColumn.js';
21
- import RangeAssignmentsColumn from './TableColumns/RangeAssignmentsColumn.js';
22
20
  import RangeColumn from './TableColumns/RangeColumn.js';
23
21
  import RelativeColumn from './TableColumns/RelativeColumn.js';
22
+ import { SignalAssignmentColumn } from './TableColumns/SignalAssignmentColumn.tsx';
24
23
  import SignalAssignmentsColumn from './TableColumns/SignalAssignmentsColumn.js';
25
24
  import SignalDeltaColumn from './TableColumns/SignalDeltaColumn.js';
26
25
  import SignalDeltaHzColumn from './TableColumns/SignalDeltaHzColumn.js';
@@ -83,10 +82,6 @@ function RangesTableRow({
83
82
  ),
84
83
  { type: 'RANGE' },
85
84
  );
86
- const highlightRangeAssignmentsColumn = useHighlight(
87
- assignmentRange.assignedDiaIds?.x || [],
88
- { type: 'RANGE' },
89
- );
90
85
  const signalKey = rowData?.tableMetaInfo?.id || '';
91
86
  const assignmentSignal = useAssignment(signalKey);
92
87
 
@@ -96,8 +91,6 @@ function RangesTableRow({
96
91
  : [],
97
92
  { type: 'SIGNAL' },
98
93
  );
99
- const highlightData = useHighlightData();
100
-
101
94
  const rowSpanTags: any = useMemo(() => {
102
95
  return {
103
96
  rowSpan: rowData.tableMetaInfo.rowSpan,
@@ -118,7 +111,7 @@ function RangesTableRow({
118
111
  const signalIndex = isOnRangeLevel ? -1 : tableMetaInfo.signalIndex;
119
112
 
120
113
  dispatch({
121
- type: 'UNLINK_RANGE',
114
+ type: 'UNASSIGN_1D_SIGNAL',
122
115
  payload: {
123
116
  rangeKey,
124
117
  signalIndex,
@@ -150,19 +143,6 @@ function RangesTableRow({
150
143
  };
151
144
  }, [assignmentRange, highlightRange]);
152
145
 
153
- const onHoverRangeAssignmentsColumn = useMemo(() => {
154
- return {
155
- onMouseEnter: () => {
156
- assignmentRange.highlight('x');
157
- highlightRangeAssignmentsColumn.show();
158
- },
159
- onMouseLeave: () => {
160
- assignmentRange.clearHighlight();
161
- highlightRangeAssignmentsColumn.hide();
162
- },
163
- };
164
- }, [assignmentRange, highlightRangeAssignmentsColumn]);
165
-
166
146
  const onHoverSignal = useMemo(() => {
167
147
  return {
168
148
  onMouseEnter: () => {
@@ -201,10 +181,10 @@ function RangesTableRow({
201
181
  </td>
202
182
  )}
203
183
  {preferences.showAssignmentLabel && (
204
- <RangeAssignmentColumn
184
+ <SignalAssignmentColumn
205
185
  row={rowData}
206
- onHover={onHoverRange}
207
- rowSpanTags={rowSpanTags}
186
+ highlight={highlightSignal}
187
+ onHover={onHoverSignal}
208
188
  />
209
189
  )}
210
190
 
@@ -274,27 +254,14 @@ function RangesTableRow({
274
254
  />
275
255
  )}
276
256
  {preferences.showAssignment && (
277
- <>
278
- <SignalAssignmentsColumn
279
- row={rowData}
280
- assignment={assignmentSignal}
281
- highlight={highlightSignal}
282
- onHover={onHoverSignal}
283
- onLink={linkHandler}
284
- onUnlink={unlinkHandler}
285
- />
286
-
287
- <RangeAssignmentsColumn
288
- row={rowData}
289
- assignment={assignmentRange}
290
- highlight={highlightRangeAssignmentsColumn}
291
- onHover={onHoverRangeAssignmentsColumn}
292
- onLink={linkHandler}
293
- onUnlink={unlinkHandler}
294
- rowSpanTags={rowSpanTags}
295
- highlightData={highlightData}
296
- />
297
- </>
257
+ <SignalAssignmentsColumn
258
+ row={rowData}
259
+ assignment={assignmentSignal}
260
+ highlight={highlightSignal}
261
+ onHover={onHoverSignal}
262
+ onLink={linkHandler}
263
+ onUnlink={unlinkHandler}
264
+ />
298
265
  )}
299
266
  <ActionsColumn
300
267
  row={rowData}
@@ -29,8 +29,7 @@ const ActionsCell = styled.td`
29
29
  `;
30
30
 
31
31
  interface ActionsColumnProps
32
- extends Omit<BaseRangeColumnProps, 'format'>,
33
- RowSpanTags {
32
+ extends Omit<BaseRangeColumnProps, 'format'>, RowSpanTags {
34
33
  onHoverSignal?: OnHoverEvent['onHover'];
35
34
  onHoverRange?: OnHoverEvent['onHover'];
36
35
  showKind: boolean;
@@ -0,0 +1,40 @@
1
+ import { useDispatch } from '../../../context/DispatchContext.tsx';
2
+ import { EditableColumn } from '../../../elements/EditableColumn.tsx';
3
+ import type { BaseRangeColumnProps, OnHoverEvent } from '../RangesTableRow.tsx';
4
+
5
+ interface SignalAssignmentColumnProps
6
+ extends Omit<BaseRangeColumnProps, 'format'>, OnHoverEvent {
7
+ highlight: {
8
+ isActive: boolean;
9
+ };
10
+ }
11
+
12
+ export function SignalAssignmentColumn({
13
+ row,
14
+ onHover,
15
+ }: SignalAssignmentColumnProps) {
16
+ const dispatch = useDispatch();
17
+ const signal = row?.tableMetaInfo?.signal;
18
+
19
+ function saveHandler(event: any) {
20
+ dispatch({
21
+ type: 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
22
+ payload: {
23
+ value: event.target.value,
24
+ rangeId: row.id,
25
+ signalId: signal.id,
26
+ },
27
+ });
28
+ }
29
+
30
+ return (
31
+ <td {...onHover}>
32
+ <EditableColumn
33
+ value={signal?.assignment || ''}
34
+ onSave={saveHandler}
35
+ style={{ padding: '0.1rem 0.4rem' }}
36
+ type="text"
37
+ />
38
+ </td>
39
+ );
40
+ }
@@ -6,8 +6,7 @@ import { AssignmentsCell } from '../../../elements/AssignmentsCell.js';
6
6
  import type { BaseRangeColumnProps, OnHoverEvent } from '../RangesTableRow.js';
7
7
 
8
8
  interface SignalAssignmentsColumnProps
9
- extends Omit<BaseRangeColumnProps, 'format'>,
10
- OnHoverEvent {
9
+ extends Omit<BaseRangeColumnProps, 'format'>, OnHoverEvent {
11
10
  assignment: AssignmentsData;
12
11
  highlight: {
13
12
  isActive: boolean;
@@ -19,8 +19,8 @@ function SignalDeltaColumn({
19
19
  type: 'CHANGE_RANGE_SIGNAL_VALUE',
20
20
  payload: {
21
21
  value: event.target.value,
22
- rangeID: row.id,
23
- signalID: signal.id,
22
+ rangeId: row.id,
23
+ signalId: signal.id,
24
24
  },
25
25
  });
26
26
  }
@@ -369,9 +369,9 @@ function SummaryPanel() {
369
369
  dispatch({
370
370
  type: 'DELETE_1D_SIGNAL',
371
371
  payload: {
372
- spectrum,
372
+ spectrumId: spectrum.id,
373
373
  range,
374
- signal,
374
+ signalId: signal.id,
375
375
  },
376
376
  });
377
377
  }
@@ -388,9 +388,9 @@ function SummaryPanel() {
388
388
  dispatch({
389
389
  type: 'DELETE_2D_SIGNAL',
390
390
  payload: {
391
- spectrum,
391
+ spectrumId: spectrum.id,
392
392
  zone,
393
- signal,
393
+ signalId: signal.id,
394
394
  },
395
395
  });
396
396
  }
@@ -414,9 +414,9 @@ function SummaryPanel() {
414
414
  dispatch({
415
415
  type: 'SET_2D_SIGNAL_PATH_LENGTH',
416
416
  payload: {
417
- spectrum,
417
+ spectrumId: spectrum.id,
418
418
  zone,
419
- signal,
419
+ signalId: signal.id,
420
420
  pathLength: link.signal.j?.pathLength,
421
421
  },
422
422
  });
@@ -30,8 +30,10 @@ import MultipleSpectraAnalysisPanel from './multipleAnalysisPanel/MultipleSpectr
30
30
  import PredictionPane from './predictionPanel/PredictionPanel.js';
31
31
  import SpectrumSimulation from './spectrumSimulation/SpectrumSimulation.js';
32
32
 
33
- export interface AccordionItem
34
- extends Omit<AccordionItemProps, 'children' | 'defaultOpened'> {
33
+ export interface AccordionItem extends Omit<
34
+ AccordionItemProps,
35
+ 'children' | 'defaultOpened'
36
+ > {
35
37
  id: keyof NMRiumPanelPreferences;
36
38
  component: ReactElement;
37
39
  style?: CSSProperties;
@@ -12,8 +12,8 @@ export type NucleusPreferenceField = Omit<FormatFieldProps, 'control'> & {
12
12
 
13
13
  interface NucleusPreferencesProps<
14
14
  TFieldValues extends FieldValues = FieldValues,
15
- > extends NucleusGroupProps,
16
- Pick<ControllerProps<TFieldValues>, 'control'> {
15
+ >
16
+ extends NucleusGroupProps, Pick<ControllerProps<TFieldValues>, 'control'> {
17
17
  fields: NucleusPreferenceField[];
18
18
  nucleusTitle?: string;
19
19
  }
@@ -50,8 +50,10 @@ interface InformationEditionModalProps {
50
50
  isOpen: boolean;
51
51
  }
52
52
 
53
- interface InnerInformationPanelProps
54
- extends Omit<InformationEditionModalProps, 'isOpen'> {
53
+ interface InnerInformationPanelProps extends Omit<
54
+ InformationEditionModalProps,
55
+ 'isOpen'
56
+ > {
55
57
  metaInfo: MetaInfoItem[];
56
58
  }
57
59
 
@@ -53,6 +53,7 @@ export default function PredictionPanel() {
53
53
  const dispatch = useDispatch();
54
54
  const toaster = useToaster();
55
55
  const { logger } = useLogger();
56
+
56
57
  const [currentIndex, setCurrentIndex] = useState(0);
57
58
  const [molfile, setMolfile] = useState<string | null>(null);
58
59
  const [isFlipped, setFlipStatus] = useState(false);
@@ -60,21 +61,28 @@ export default function PredictionPanel() {
60
61
  const { open: openAccordionPanel } = useAccordionControls();
61
62
  const predictionPreferences = usePanelPreferences('prediction');
62
63
  const { modal, openMoleculeEditor } = useMoleculeEditor(true);
63
- const refreshSlider = useRef<boolean>(false);
64
+ const refreshSlider = useRef<boolean>(true);
64
65
 
65
66
  const [initialMolfile] = useState(molfile ?? '');
66
67
 
67
68
  useEffect(() => {
68
69
  if (
69
- Array.isArray(molecules) &&
70
- molecules.length > 0 &&
71
- refreshSlider.current
70
+ !Array.isArray(molecules) ||
71
+ molecules.length === 0 ||
72
+ !refreshSlider.current
72
73
  ) {
73
- const newIndex = molecules.length - 1;
74
- setCurrentIndex(newIndex);
75
- setMolfile(molecules[newIndex].molfile);
76
- refreshSlider.current = false;
74
+ return;
77
75
  }
76
+
77
+ const lastIndex = molecules.length - 1;
78
+ const lastMolfile = molecules[lastIndex]?.molfile ?? null;
79
+
80
+ if (!lastMolfile) return;
81
+
82
+ setCurrentIndex(lastIndex);
83
+ setMolfile(lastMolfile);
84
+
85
+ refreshSlider.current = false;
78
86
  }, [molecules]);
79
87
 
80
88
  function changeHandler(event: CanvasEditorOnChangeMolecule) {
@@ -169,7 +177,7 @@ export default function PredictionPanel() {
169
177
  renderSource="predictionPanel"
170
178
  onClickPreferences={settingsPanelHandler}
171
179
  onOpenMoleculeEditor={() => openMoleculeEditor()}
172
- onClickPastMolecule={() => {
180
+ onClickPasteMolecule={() => {
173
181
  refreshSlider.current = true;
174
182
  }}
175
183
  >
@@ -715,10 +715,10 @@ function innerSpectrumReducer(draft: Draft<State>, action: Action) {
715
715
  return RangesActions.handleChangeRangeSignalKind(draft, action);
716
716
  case 'SAVE_EDITED_RANGE':
717
717
  return RangesActions.handleSaveEditedRange(draft, action);
718
- case 'UNLINK_RANGE':
719
- return RangesActions.handleUnlinkRange(draft, action);
720
- case 'ASSIGN_RANGE':
721
- return RangesActions.handleAssignRange(draft, action);
718
+ case 'UNASSIGN_1D_SIGNAL':
719
+ return RangesActions.handleUnAssign1DSignal(draft, action);
720
+ case 'ASSIGN_1D_SIGNAL':
721
+ return RangesActions.handleAssign1DSignal(draft, action);
722
722
  case 'UPDATE_RANGE':
723
723
  return RangesActions.handleUpdateRange(draft, action);
724
724
  case 'TOGGLE_RANGES_VIEW_PROPERTY':
@@ -731,8 +731,8 @@ function innerSpectrumReducer(draft: Draft<State>, action: Action) {
731
731
  return RangesActions.handleChangePeaksDisplayingMode(draft);
732
732
  case 'DELETE_RANGE_PEAK':
733
733
  return RangesActions.handleDeleteRangePeak(draft, action);
734
- case 'CHANGE_RANGE_ASSIGNMENT_LABEL':
735
- return RangesActions.handleChangeRangeAssignmentLabel(draft, action);
734
+ case 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL':
735
+ return RangesActions.handleChange1DSignalAssignmentLabel(draft, action);
736
736
  case 'CHANGE_RANGES_VIEW_FLOATING_BOX_BOUNDING':
737
737
  return RangesActions.handleChangeRangesViewFloatingBoxBounding(
738
738
  draft,
@@ -842,7 +842,7 @@ function innerSpectrumReducer(draft: Draft<State>, action: Action) {
842
842
  export const spectrumReducer: Reducer<State, Action> =
843
843
  produce(innerSpectrumReducer);
844
844
 
845
- function getDebugState(draft: any) {
845
+ function getDebugState(draft: Draft<State>) {
846
846
  const state = original(draft);
847
847
  const string = JSON.stringify(state, (key, value: any) => {
848
848
  if (ArrayBuffer.isView(value)) {
@@ -854,7 +854,7 @@ function getDebugState(draft: any) {
854
854
  return value;
855
855
  });
856
856
  if (string.length > 800000) {
857
- // fallback, better to have something as a string t han nothing
857
+ // fallback, better to have something as a string than nothing
858
858
  return string.slice(0, 800000);
859
859
  }
860
860
  return JSON.parse(string);
@@ -1,9 +1,11 @@
1
1
  import type { Range, Zone } from '@zakodium/nmr-types';
2
- import type { Spectrum1D, Spectrum2D } from '@zakodium/nmrium-core';
3
2
  import type { Draft } from 'immer';
4
3
  import type { SpectraData1D, SpectraData2D } from 'nmr-processing';
5
4
 
5
+ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.ts';
6
+ import { isSpectrum2D } from '../../../data/data2d/Spectrum2D/index.ts';
6
7
  import type { State } from '../Reducer.js';
8
+ import { getSpectrum } from '../helper/getSpectrum.ts';
7
9
  import type { ActionType } from '../types/ActionType.js';
8
10
 
9
11
  type SetAutomaticAssignmentsAction = ActionType<
@@ -20,18 +22,11 @@ function handleSetAutomaticAssignments(
20
22
  const assignments = action.payload.assignments;
21
23
 
22
24
  for (const datum of assignments) {
23
- const index = draft.data.findIndex((spectrum) => spectrum.id === datum.id);
24
- if (index !== -1) {
25
- const dimension = draft.data[index].info.dimension;
26
- if (dimension === 1) {
27
- (draft.data[index] as Spectrum1D).ranges.values = (
28
- datum as SpectraData1D
29
- ).ranges as Range[];
30
- } else if (dimension === 2) {
31
- (draft.data[index] as Spectrum2D).zones.values = (
32
- datum as SpectraData2D
33
- ).zones as Zone[];
34
- }
25
+ const spectrum = getSpectrum(draft, datum.id);
26
+ if (isSpectrum1D(spectrum)) {
27
+ spectrum.ranges.values = (datum as SpectraData1D).ranges as Range[];
28
+ } else if (isSpectrum2D(spectrum)) {
29
+ spectrum.zones.values = (datum as SpectraData2D).zones as Zone[];
35
30
  }
36
31
  }
37
32
  }
@@ -1,4 +1,3 @@
1
- import type { Spectrum1D, Spectrum2D } from '@zakodium/nmrium-core';
2
1
  import type { Draft } from 'immer';
3
2
  import { original } from 'immer';
4
3
  import lodashCloneDeep from 'lodash/cloneDeep.js';
@@ -11,6 +10,8 @@ import type {
11
10
  } from 'nmr-correlation';
12
11
  import { buildCorrelationData, setCorrelation } from 'nmr-correlation';
13
12
 
13
+ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.ts';
14
+ import { isSpectrum2D } from '../../../data/data2d/Spectrum2D/index.ts';
14
15
  import {
15
16
  findRange,
16
17
  findSignal1D,
@@ -143,27 +144,25 @@ function handleDeleteCorrelation(
143
144
  // delete all signals linked to the correlation
144
145
  for (const link of correlation.links) {
145
146
  const spectrum = findSpectrum(draft.data, link.experimentID, false);
146
- if (spectrum) {
147
- if (spectrum.info.dimension === 1) {
148
- const range = findRange(spectrum as Spectrum1D, link.signal.id);
149
- const signal = findSignal1D(spectrum as Spectrum1D, link.signal.id);
150
- if (range && signal) {
151
- deleteSignal1D(draft, {
152
- spectrum,
153
- range,
154
- signal,
155
- });
156
- }
157
- } else if (spectrum.info.dimension === 2) {
158
- const zone = findZone(spectrum as Spectrum2D, link.signal.id);
159
- const signal = findSignal2D(spectrum as Spectrum2D, link.signal.id);
160
- if (zone && signal) {
161
- deleteSignal2D(draft, {
162
- spectrum,
163
- zone,
164
- signal,
165
- });
166
- }
147
+ if (isSpectrum1D(spectrum)) {
148
+ const range = findRange(spectrum, link.signal.id);
149
+ const signal = findSignal1D(spectrum, link.signal.id);
150
+ if (range && signal) {
151
+ deleteSignal1D(draft, {
152
+ spectrumId: spectrum.id,
153
+ range,
154
+ signalId: signal.id,
155
+ });
156
+ }
157
+ } else if (isSpectrum2D(spectrum)) {
158
+ const zone = findZone(spectrum, link.signal.id);
159
+ const signal = findSignal2D(spectrum, link.signal.id);
160
+ if (zone && signal) {
161
+ deleteSignal2D(draft, {
162
+ spectrumId: spectrum.id,
163
+ zone,
164
+ signalId: signal.id,
165
+ });
167
166
  }
168
167
  }
169
168
  }
@@ -88,7 +88,7 @@ function handleResurrectSpectrum(
88
88
  let options: { from?: number; to?: number } = {};
89
89
  let info: Partial<Info1D> = { solvent, name: names[0], nucleus };
90
90
 
91
- if (activeSpectrum && isSpectrum1D(activeSpectrum)) {
91
+ if (isSpectrum1D(activeSpectrum)) {
92
92
  const {
93
93
  data: { x },
94
94
  info: spectrumInfo,
@@ -8,7 +8,10 @@ import type { NmrData2DFt } from 'cheminfo-types';
8
8
  import { extent } from 'd3-array';
9
9
  import type { Draft } from 'immer';
10
10
 
11
- import { get1DDataXY } from '../../../data/data1d/Spectrum1D/index.js';
11
+ import {
12
+ get1DDataXY,
13
+ isSpectrum1D,
14
+ } from '../../../data/data1d/Spectrum1D/index.js';
12
15
  import {
13
16
  isFid1DSpectrum,
14
17
  isFt1DSpectrum,
@@ -23,7 +26,7 @@ import type { State } from '../Reducer.js';
23
26
  import { rescaleToSameTop } from '../helper/Zoom1DManager.js';
24
27
  import { addToBrushHistory } from '../helper/ZoomHistoryManager.js';
25
28
  import { getActiveSpectra } from '../helper/getActiveSpectra.js';
26
- import { getActiveSpectrum } from '../helper/getActiveSpectrum.js';
29
+ import { getSpectrum } from '../helper/getSpectrum.ts';
27
30
  import type { ActionType } from '../types/ActionType.js';
28
31
 
29
32
  type NumberExtent = [number, number];
@@ -66,19 +69,13 @@ function getActiveData(draft: Draft<State>): Spectrum1D[] {
66
69
  let data = draft.data.filter(
67
70
  (datum) =>
68
71
  nucleusToString(datum.info.nucleus) === draft.view.spectra.activeTab &&
69
- datum.info.dimension === 1,
72
+ isSpectrum1D(datum),
70
73
  );
71
74
 
72
- const activeSpectrum = getActiveSpectrum(draft);
73
-
74
- if (activeSpectrum?.id) {
75
- const activeSpectrumIndex = data.findIndex(
76
- (datum) => datum.id === activeSpectrum?.id,
77
- );
78
- if (activeSpectrumIndex !== -1) {
79
- const isFid = isFid1DSpectrum(data[activeSpectrumIndex]);
80
- data = data.filter((datum) => datum.info.isFid === isFid);
81
- }
75
+ const spectrum = getSpectrum(draft);
76
+ if (spectrum) {
77
+ const isFid = isFid1DSpectrum(spectrum);
78
+ data = data.filter((datum) => datum.info.isFid === isFid);
82
79
  } else {
83
80
  data = data.filter((datum) => isFt1DSpectrum(datum));
84
81
  }
@@ -153,11 +150,9 @@ function get2DDomain(state: State) {
153
150
  } = state;
154
151
 
155
152
  const nucleus = activeTab.split(',');
156
- const activeSpectrum = getActiveSpectrum(state);
157
- const spectrum =
158
- data.find((datum) => datum.id === activeSpectrum?.id) || null;
153
+ const spectrum = getSpectrum(state);
159
154
 
160
- if (spectrum && isSpectrum2D(spectrum)) {
155
+ if (isSpectrum2D(spectrum)) {
161
156
  if (isFid2DData(spectrum.data)) {
162
157
  const { minX, maxX, minY, maxY } = spectrum.data.re;
163
158
  xArray = [minX, maxX];
@@ -188,6 +183,7 @@ function get2DDomain(state: State) {
188
183
  }
189
184
  }
190
185
  }
186
+
191
187
  const spectraIDs = new Set();
192
188
 
193
189
  for (const n of nucleus) {
@@ -196,11 +192,9 @@ function get2DDomain(state: State) {
196
192
  spectraIDs.add(spectra[0].id);
197
193
  }
198
194
  }
199
- const filteredData = data
200
- .filter((d) => spectraIDs.has(d.id) && d.info.dimension === 1)
201
- .map((datum) => {
202
- return datum as Spectrum1D;
203
- });
195
+ const filteredData = data.filter(
196
+ (d) => spectraIDs.has(d.id) && isSpectrum1D(d),
197
+ ) as Spectrum1D[];
204
198
 
205
199
  try {
206
200
  for (const d of filteredData) {