nmrium 1.8.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 (525) 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 +17 -9
  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/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
  102. package/lib/component/EventsTrackers/KeysListenerTracker.js +6 -0
  103. package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
  104. package/lib/component/assignment/utilities/getAssignments.js +1 -2
  105. package/lib/component/assignment/utilities/getAssignments.js.map +1 -1
  106. package/lib/component/context/KeyModifierContext.d.ts +3 -2
  107. package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
  108. package/lib/component/context/KeyModifierContext.js +7 -4
  109. package/lib/component/context/KeyModifierContext.js.map +1 -1
  110. package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
  111. package/lib/component/elements/ActionsButtonsPopover.js +17 -3
  112. package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
  113. package/lib/component/elements/AssignmentsCell.d.ts.map +1 -1
  114. package/lib/component/elements/AssignmentsCell.js.map +1 -1
  115. package/lib/component/elements/Button.d.ts.map +1 -1
  116. package/lib/component/elements/Button.js.map +1 -1
  117. package/lib/component/elements/CheckController.d.ts.map +1 -1
  118. package/lib/component/elements/CheckController.js.map +1 -1
  119. package/lib/component/elements/ContextMenuBluePrint.d.ts.map +1 -1
  120. package/lib/component/elements/ContextMenuBluePrint.js.map +1 -1
  121. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  122. package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
  123. package/lib/component/elements/DraggableDialog.js.map +1 -1
  124. package/lib/component/elements/Input.d.ts.map +1 -1
  125. package/lib/component/elements/Input.js.map +1 -1
  126. package/lib/component/elements/Input2.d.ts.map +1 -1
  127. package/lib/component/elements/Input2.js.map +1 -1
  128. package/lib/component/elements/Input2Controller.d.ts.map +1 -1
  129. package/lib/component/elements/Input2Controller.js.map +1 -1
  130. package/lib/component/elements/Label.d.ts.map +1 -1
  131. package/lib/component/elements/Label.js.map +1 -1
  132. package/lib/component/elements/NumberInput2.d.ts.map +1 -1
  133. package/lib/component/elements/NumberInput2.js.map +1 -1
  134. package/lib/component/elements/NumberInput2Controller.d.ts.map +1 -1
  135. package/lib/component/elements/NumberInput2Controller.js.map +1 -1
  136. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +1 -1
  137. package/lib/component/elements/ReactTable/ReactTable.js.map +1 -1
  138. package/lib/component/elements/ReadOnly.d.ts.map +1 -1
  139. package/lib/component/elements/ReadOnly.js.map +1 -1
  140. package/lib/component/elements/Sections.js.map +1 -1
  141. package/lib/component/elements/Select.d.ts.map +1 -1
  142. package/lib/component/elements/Select.js.map +1 -1
  143. package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
  144. package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
  145. package/lib/component/elements/export/ExportContent.js.map +1 -1
  146. package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
  147. package/lib/component/elements/print/PrintContent.js.map +1 -1
  148. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.d.ts.map +1 -1
  149. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +2 -4
  150. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js.map +1 -1
  151. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts.map +1 -1
  152. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +2 -4
  153. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js.map +1 -1
  154. package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
  155. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -4
  156. package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
  157. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
  158. package/lib/component/hooks/useActiveSpectrumStyleOptions.js.map +1 -1
  159. package/lib/component/hooks/useActiveSpectrumZonesViewState.d.ts.map +1 -1
  160. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +2 -4
  161. package/lib/component/hooks/useActiveSpectrumZonesViewState.js.map +1 -1
  162. package/lib/component/hooks/useExport.js +1 -1
  163. package/lib/component/hooks/useExport.js.map +1 -1
  164. package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
  165. package/lib/component/hooks/useSaveSettings.js +28 -47
  166. package/lib/component/hooks/useSaveSettings.js.map +1 -1
  167. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +2 -1
  168. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
  169. package/lib/component/hooks/useSetActiveSpectrumAction.js +2 -2
  170. package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
  171. package/lib/component/hooks/useSpectrumWithDataSource.js +1 -1
  172. package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
  173. package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
  174. package/lib/component/hooks/useWorkspaceAction.d.ts.map +1 -1
  175. package/lib/component/hooks/useWorkspaceAction.js +3 -0
  176. package/lib/component/hooks/useWorkspaceAction.js.map +1 -1
  177. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  178. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  179. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  180. package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
  181. package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
  182. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  183. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  184. package/lib/component/modal/setting/GeneralSettings.d.ts.map +1 -1
  185. package/lib/component/modal/setting/GeneralSettings.js +5 -1
  186. package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
  187. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
  188. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
  189. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  190. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  191. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
  192. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  193. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +16 -14
  194. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  195. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
  196. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +27 -18
  197. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
  198. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -1
  199. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +0 -3
  200. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -1
  201. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  202. package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
  203. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  204. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  205. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  206. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  207. package/lib/component/panels/RangesPanel/RangesTableRow.js +5 -20
  208. package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
  209. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts.map +1 -1
  210. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
  211. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +9 -0
  212. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -0
  213. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +19 -0
  214. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -0
  215. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
  216. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
  217. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  218. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
  219. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  220. package/lib/component/panels/accordionItems.d.ts.map +1 -1
  221. package/lib/component/panels/accordionItems.js.map +1 -1
  222. package/lib/component/panels/databasePanel/DatabaseInfo.d.ts +5 -0
  223. package/lib/component/panels/databasePanel/DatabaseInfo.d.ts.map +1 -0
  224. package/lib/component/panels/databasePanel/DatabaseInfo.js +29 -0
  225. package/lib/component/panels/databasePanel/DatabaseInfo.js.map +1 -0
  226. package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
  227. package/lib/component/panels/databasePanel/DatabaseTable.js +21 -3
  228. package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
  229. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts.map +1 -1
  230. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  231. package/lib/component/panels/informationPanel/InformationEditionModal.js +1 -1
  232. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  233. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
  234. package/lib/component/panels/predictionPanel/PredictionPanel.js +13 -9
  235. package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
  236. package/lib/component/reducer/Reducer.js +7 -7
  237. package/lib/component/reducer/Reducer.js.map +1 -1
  238. package/lib/component/reducer/actions/AssignmentsActions.d.ts.map +1 -1
  239. package/lib/component/reducer/actions/AssignmentsActions.js +9 -9
  240. package/lib/component/reducer/actions/AssignmentsActions.js.map +1 -1
  241. package/lib/component/reducer/actions/CorrelationsActions.d.ts.map +1 -1
  242. package/lib/component/reducer/actions/CorrelationsActions.js +21 -21
  243. package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
  244. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  245. package/lib/component/reducer/actions/DatabaseActions.js +5 -3
  246. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  247. package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
  248. package/lib/component/reducer/actions/DomainActions.js +10 -18
  249. package/lib/component/reducer/actions/DomainActions.js.map +1 -1
  250. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  251. package/lib/component/reducer/actions/FiltersActions.js +28 -44
  252. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  253. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  254. package/lib/component/reducer/actions/InsetActions.js +9 -18
  255. package/lib/component/reducer/actions/InsetActions.js.map +1 -1
  256. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  257. package/lib/component/reducer/actions/IntegralsActions.d.ts.map +1 -1
  258. package/lib/component/reducer/actions/IntegralsActions.js +43 -48
  259. package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
  260. package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
  261. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  262. package/lib/component/reducer/actions/MoleculeActions.js +64 -10
  263. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  264. package/lib/component/reducer/actions/PeaksActions.d.ts.map +1 -1
  265. package/lib/component/reducer/actions/PeaksActions.js +110 -121
  266. package/lib/component/reducer/actions/PeaksActions.js.map +1 -1
  267. package/lib/component/reducer/actions/PreferencesActions.d.ts.map +1 -1
  268. package/lib/component/reducer/actions/PreferencesActions.js +2 -1
  269. package/lib/component/reducer/actions/PreferencesActions.js.map +1 -1
  270. package/lib/component/reducer/actions/RangesActions.d.ts +18 -18
  271. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  272. package/lib/component/reducer/actions/RangesActions.js +148 -171
  273. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  274. package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
  275. package/lib/component/reducer/actions/SpectraActions.js +29 -31
  276. package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
  277. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  278. package/lib/component/reducer/actions/ToolsActions.js +10 -11
  279. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  280. package/lib/component/reducer/actions/ZonesActions.d.ts +8 -9
  281. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  282. package/lib/component/reducer/actions/ZonesActions.js +123 -151
  283. package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
  284. package/lib/component/reducer/helper/get2DRange.d.ts +3 -1
  285. package/lib/component/reducer/helper/get2DRange.d.ts.map +1 -1
  286. package/lib/component/reducer/helper/get2DRange.js.map +1 -1
  287. package/lib/component/reducer/helper/getSpectrum.js +1 -1
  288. package/lib/component/reducer/helper/getSpectrum.js.map +1 -1
  289. package/lib/component/reducer/helper/setIntegralsViewProperty.js +1 -1
  290. package/lib/component/reducer/helper/setIntegralsViewProperty.js.map +1 -1
  291. package/lib/component/reducer/helper/setRangesViewProperty.js +1 -1
  292. package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
  293. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
  294. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
  295. package/lib/component/toolbar/ToolBar.d.ts.map +1 -1
  296. package/lib/component/toolbar/ToolBar.js +5 -1
  297. package/lib/component/toolbar/ToolBar.js.map +1 -1
  298. package/lib/component/toolbar/ToolTypes.js +1 -1
  299. package/lib/component/toolbar/ToolTypes.js.map +1 -1
  300. package/lib/component/useWatchForm.d.ts.map +1 -1
  301. package/lib/component/useWatchForm.js.map +1 -1
  302. package/lib/component/utility/filterDatabaseInfoEntry.d.ts +3 -0
  303. package/lib/component/utility/filterDatabaseInfoEntry.d.ts.map +1 -0
  304. package/lib/component/utility/filterDatabaseInfoEntry.js +9 -0
  305. package/lib/component/utility/filterDatabaseInfoEntry.js.map +1 -0
  306. package/lib/component/utility/stackOverlappingLabels.d.ts +1 -1
  307. package/lib/component/utility/stackOverlappingLabels.d.ts.map +1 -1
  308. package/lib/component/utility/stackOverlappingLabels.js.map +1 -1
  309. package/lib/component/workspaces/prediction.js +1 -1
  310. package/lib/component/workspaces/prediction.js.map +1 -1
  311. package/lib/component/workspaces/simulation.js +1 -1
  312. package/lib/component/workspaces/simulation.js.map +1 -1
  313. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  314. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  315. package/lib/data/SpectraManager.d.ts.map +1 -1
  316. package/lib/data/SpectraManager.js.map +1 -1
  317. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
  318. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +0 -3
  319. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
  320. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +8 -1
  321. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
  322. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -2
  323. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
  324. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
  325. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +3 -3
  326. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +4 -14
  327. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
  328. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
  329. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
  330. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
  331. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +2 -1
  332. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
  333. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  334. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +3 -5
  335. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts.map +1 -1
  336. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +3 -5
  337. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js.map +1 -1
  338. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +2 -1
  339. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts.map +1 -1
  340. package/lib/data/data2d/Spectrum2D/zones/detectZones.js.map +1 -1
  341. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +7 -63
  342. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  343. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +9 -14
  344. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js.map +1 -1
  345. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -10
  346. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts.map +1 -1
  347. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +23 -43
  348. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
  349. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -54
  350. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  351. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +1 -1
  352. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js.map +1 -1
  353. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  354. package/lib/data/molecules/Molecule.js.map +1 -1
  355. package/lib/data/molecules/MoleculeManager.d.ts +2 -1
  356. package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
  357. package/lib/data/molecules/MoleculeManager.js +30 -3
  358. package/lib/data/molecules/MoleculeManager.js.map +1 -1
  359. package/lib/data/types/data1d/RangeDetectionResult.d.ts.map +1 -1
  360. package/lib/data/utilities/FindUtilities.d.ts.map +1 -1
  361. package/lib/data/utilities/FindUtilities.js +11 -11
  362. package/lib/data/utilities/FindUtilities.js.map +1 -1
  363. package/lib/utils/clipboard/clipboardComponents.d.ts.map +1 -1
  364. package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
  365. package/lib/utils/clipboard/clipboardHooks.d.ts +2 -2
  366. package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
  367. package/lib/utils/clipboard/clipboardHooks.js +8 -2
  368. package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
  369. package/lib/versionInfo.d.ts.map +1 -1
  370. package/lib/versionInfo.js +1 -1
  371. package/lib/versionInfo.js.map +1 -1
  372. package/package.json +28 -25
  373. package/src/component/1d/ApodizationLine.tsx +1 -1
  374. package/src/component/1d/BrushTracker1D.tsx +10 -10
  375. package/src/component/1d/FooterBanner.tsx +2 -2
  376. package/src/component/1d/LinesSeries.tsx +2 -2
  377. package/src/component/1d/SVGContent1D.tsx +6 -2
  378. package/src/component/1d/SimilarityTree.tsx +3 -2
  379. package/src/component/1d/inset/InsetProvider.tsx +4 -2
  380. package/src/component/1d/integral/IntegralResizable.tsx +2 -1
  381. package/src/component/1d/matrix/Boxplot.tsx +3 -3
  382. package/src/component/1d/multiAnalysis/AnalysisRange.tsx +2 -1
  383. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +24 -23
  384. package/src/component/1d/multiplicityTree/generateTreeNodes.ts +10 -1
  385. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +4 -2
  386. package/src/component/1d/peaks/PeakEditionManager.tsx +8 -3
  387. package/src/component/1d/peaks/Peaks.tsx +5 -1
  388. package/src/component/1d/ranges/AssignmentLabel.tsx +8 -5
  389. package/src/component/1d/ranges/Atoms.tsx +2 -2
  390. package/src/component/1d/ranges/Range.tsx +42 -74
  391. package/src/component/1d/ranges/Ranges.tsx +33 -28
  392. package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +93 -0
  393. package/src/component/1d/tool/BaseLineZones.tsx +2 -1
  394. package/src/component/1d/utilities/intersectionResolver.ts +3 -4
  395. package/src/component/1d-2d/FieldEdition.tsx +2 -2
  396. package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
  397. package/src/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.tsx +1 -1
  398. package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +1 -1
  399. package/src/component/2d/BrushTracker2D.tsx +50 -55
  400. package/src/component/2d/FooterBanner.tsx +80 -105
  401. package/src/component/2d/SVGContent2D.tsx +2 -3
  402. package/src/component/2d/SlicingView.tsx +1 -1
  403. package/src/component/2d/Viewer2D.tsx +2 -2
  404. package/src/component/2d/ft/FTContainer.tsx +4 -5
  405. package/src/component/2d/tools/XYLabelPointer.tsx +12 -11
  406. package/src/component/2d/useTracesSpectra.ts +26 -13
  407. package/src/component/2d/utilities/extractSpectrumSignals.ts +2 -2
  408. package/src/component/2d/zones/Signal.tsx +1 -1
  409. package/src/component/2d/zones/SignalsGuideLines.tsx +21 -19
  410. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +4 -4
  411. package/src/component/EventsTrackers/BrushTracker.tsx +24 -17
  412. package/src/component/EventsTrackers/KeysListenerTracker.tsx +6 -0
  413. package/src/component/assignment/utilities/getAssignments.ts +1 -2
  414. package/src/component/context/KeyModifierContext.tsx +13 -5
  415. package/src/component/elements/ActionsButtonsPopover.tsx +25 -8
  416. package/src/component/elements/AssignmentsCell.tsx +1 -2
  417. package/src/component/elements/Button.tsx +3 -2
  418. package/src/component/elements/CheckController.tsx +2 -1
  419. package/src/component/elements/ContextMenuBluePrint.tsx +2 -1
  420. package/src/component/elements/D3Axis.tsx +3 -3
  421. package/src/component/elements/DraggableDialog.tsx +2 -1
  422. package/src/component/elements/Input.tsx +4 -2
  423. package/src/component/elements/Input2.tsx +1 -2
  424. package/src/component/elements/Input2Controller.tsx +2 -1
  425. package/src/component/elements/Label.tsx +2 -1
  426. package/src/component/elements/NumberInput2.tsx +4 -2
  427. package/src/component/elements/NumberInput2Controller.tsx +3 -1
  428. package/src/component/elements/ReactTable/ReactTable.tsx +1 -3
  429. package/src/component/elements/ReadOnly.tsx +4 -2
  430. package/src/component/elements/Sections.tsx +5 -4
  431. package/src/component/elements/Select.tsx +4 -2
  432. package/src/component/elements/ToolbarPopoverItem.tsx +3 -3
  433. package/src/component/elements/export/ExportContent.tsx +1 -2
  434. package/src/component/elements/print/PrintContent.tsx +1 -2
  435. package/src/component/hooks/useActiveSpectrumIntegralsViewState.ts +2 -6
  436. package/src/component/hooks/useActiveSpectrumPeaksViewState.ts +2 -6
  437. package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -6
  438. package/src/component/hooks/useActiveSpectrumStyleOptions.ts +2 -2
  439. package/src/component/hooks/useActiveSpectrumZonesViewState.ts +2 -6
  440. package/src/component/hooks/useExport.tsx +1 -1
  441. package/src/component/hooks/useSaveSettings.tsx +68 -81
  442. package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
  443. package/src/component/hooks/useSpectrumWithDataSource.ts +1 -1
  444. package/src/component/hooks/useWorkspaceAction.ts +5 -0
  445. package/src/component/modal/ImportPublicationStringModal.tsx +1 -2
  446. package/src/component/modal/MultipletAnalysisModal.tsx +1 -1
  447. package/src/component/modal/changeSum/ChangeSumModal.tsx +4 -2
  448. package/src/component/modal/metaImportation/MetaImportationModal.tsx +1 -2
  449. package/src/component/modal/setting/GeneralSettings.tsx +7 -2
  450. package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +1 -1
  451. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -2
  452. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +24 -18
  453. package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +32 -16
  454. package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +0 -4
  455. package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -1
  456. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -8
  457. package/src/component/panels/RangesPanel/RangesTableRow.tsx +14 -47
  458. package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -2
  459. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +40 -0
  460. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +1 -2
  461. package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
  462. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -6
  463. package/src/component/panels/accordionItems.tsx +4 -2
  464. package/src/component/panels/databasePanel/DatabaseInfo.tsx +43 -0
  465. package/src/component/panels/databasePanel/DatabaseTable.tsx +33 -1
  466. package/src/component/panels/extra/preferences/NucleusPreferences.tsx +2 -2
  467. package/src/component/panels/informationPanel/InformationEditionModal.tsx +6 -2
  468. package/src/component/panels/predictionPanel/PredictionPanel.tsx +17 -9
  469. package/src/component/reducer/Reducer.ts +8 -8
  470. package/src/component/reducer/actions/AssignmentsActions.ts +8 -13
  471. package/src/component/reducer/actions/CorrelationsActions.ts +21 -22
  472. package/src/component/reducer/actions/DatabaseActions.ts +5 -3
  473. package/src/component/reducer/actions/DomainActions.ts +16 -22
  474. package/src/component/reducer/actions/FiltersActions.ts +34 -58
  475. package/src/component/reducer/actions/InsetActions.ts +9 -19
  476. package/src/component/reducer/actions/IntegralsActions.ts +48 -59
  477. package/src/component/reducer/actions/MoleculeActions.ts +94 -14
  478. package/src/component/reducer/actions/PeaksActions.ts +112 -136
  479. package/src/component/reducer/actions/PreferencesActions.ts +4 -3
  480. package/src/component/reducer/actions/RangesActions.ts +196 -244
  481. package/src/component/reducer/actions/SpectraActions.ts +40 -45
  482. package/src/component/reducer/actions/ToolsActions.ts +9 -13
  483. package/src/component/reducer/actions/ZonesActions.ts +158 -218
  484. package/src/component/reducer/helper/get2DRange.ts +4 -1
  485. package/src/component/reducer/helper/getSpectrum.ts +1 -1
  486. package/src/component/reducer/helper/setIntegralsViewProperty.ts +1 -1
  487. package/src/component/reducer/helper/setRangesViewProperty.ts +1 -1
  488. package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +1 -1
  489. package/src/component/toolbar/ToolBar.tsx +6 -1
  490. package/src/component/toolbar/ToolTypes.ts +1 -1
  491. package/src/component/useWatchForm.tsx +2 -1
  492. package/src/component/utility/filterDatabaseInfoEntry.ts +10 -0
  493. package/src/component/utility/stackOverlappingLabels.ts +4 -1
  494. package/src/component/workspaces/prediction.ts +1 -1
  495. package/src/component/workspaces/simulation.ts +1 -1
  496. package/src/component/workspaces/workspaceDefaultProperties.ts +1 -1
  497. package/src/data/SpectraManager.ts +0 -2
  498. package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +0 -4
  499. package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +15 -5
  500. package/src/data/data1d/Spectrum1D/ranges/changeRangeSignal.ts +5 -5
  501. package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +5 -14
  502. package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +2 -1
  503. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +2 -2
  504. package/src/data/data2d/Spectrum2D/zones/changeZoneSignal.ts +3 -5
  505. package/src/data/data2d/Spectrum2D/zones/detectZones.ts +3 -2
  506. package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +19 -16
  507. package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +35 -56
  508. package/src/data/data2d/Spectrum2D/zones/initiateZones.ts +1 -1
  509. package/src/data/molecules/Molecule.ts +2 -1
  510. package/src/data/molecules/MoleculeManager.ts +40 -4
  511. package/src/data/types/data1d/RangeDetectionResult.ts +4 -2
  512. package/src/data/utilities/FindUtilities.ts +9 -8
  513. package/src/utils/clipboard/clipboardComponents.tsx +2 -1
  514. package/src/utils/clipboard/clipboardHooks.ts +12 -6
  515. package/src/versionInfo.ts +1 -1
  516. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +0 -8
  517. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts.map +0 -1
  518. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +0 -17
  519. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js.map +0 -1
  520. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -17
  521. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts.map +0 -1
  522. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +0 -40
  523. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +0 -1
  524. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.tsx +0 -36
  525. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +0 -89
@@ -1,124 +1,111 @@
1
- import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
2
- import styled from '@emotion/styled';
3
- import { yupResolver } from '@hookform/resolvers/yup';
1
+ import { Button, Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
2
+ import { revalidateLogic } from '@tanstack/react-form';
4
3
  import type { Workspace } from '@zakodium/nmrium-core';
5
4
  import { useRef } from 'react';
6
- import { useForm } from 'react-hook-form';
7
- import { useOnOff } from 'react-science/ui';
8
- import * as Yup from 'yup';
5
+ import { useForm as useReactScienceForm, useOnOff } from 'react-science/ui';
6
+ import { z } from 'zod/v4';
9
7
 
10
8
  import { usePreferences } from '../context/PreferencesContext.js';
11
9
  import { useToaster } from '../context/ToasterContext.js';
12
- import ActionButtons from '../elements/ActionButtons.js';
13
- import { Input2Controller } from '../elements/Input2Controller.js';
14
10
 
15
11
  import { useWorkspaceAction } from './useWorkspaceAction.js';
16
12
 
17
- const schema = Yup.object().shape({
18
- workspaceName: Yup.string().required(),
13
+ const schema = z.object({
14
+ workspaceName: z
15
+ .string()
16
+ .trim()
17
+ .min(1, { error: 'Workspace name must have at least one character' }),
19
18
  });
20
19
 
21
- function WorkspaceAddForm(props: any) {
22
- const { className, message, control, onEnter } = props;
23
-
24
- return (
25
- <div className={className}>
26
- <p style={{ paddingBottom: '10px' }}>{message}</p>
27
- <Input2Controller
28
- control={control}
29
- name="workspaceName"
30
- placeholder="Enter workspace Name"
31
- style={{
32
- width: '90%',
33
- borderRadius: '5px',
34
- }}
35
- autoFocus
36
- size="large"
37
- onKeyDown={(event) => {
38
- if (event.key === 'Enter') {
39
- onEnter();
40
- }
41
- }}
42
- />
43
- </div>
44
- );
45
- }
46
-
47
20
  export function useSaveSettings() {
48
21
  const toaster = useToaster();
49
22
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
50
23
  const settingsRef = useRef<Workspace>();
51
24
  const { current } = usePreferences();
52
- const { handleSubmit, control, reset } = useForm({
53
- defaultValues: { workspaceName: '' },
54
- resolver: yupResolver(schema),
55
- });
25
+
56
26
  const { saveWorkspace, addNewWorkspace } = useWorkspaceAction();
57
- function handleAddNewWorkspace({ workspaceName }: { workspaceName: string }) {
58
- addNewWorkspace(workspaceName, settingsRef.current);
59
27
 
60
- closeDialog();
61
- toaster.show({
62
- message: 'Preferences saved successfully',
63
- intent: 'success',
64
- });
65
- }
28
+ const form = useReactScienceForm({
29
+ defaultValues: { workspaceName: '' },
30
+ validationLogic: revalidateLogic({ modeAfterSubmission: 'change' }),
31
+ validators: { onDynamic: schema },
32
+ onSubmit: ({ value }) => {
33
+ const { workspaceName } = value;
34
+ addNewWorkspace(workspaceName, settingsRef.current);
35
+ closeDialog();
36
+
37
+ toaster.show({
38
+ message: 'Preferences saved successfully',
39
+ intent: 'success',
40
+ });
41
+ },
42
+ });
66
43
 
67
44
  function saveSettings(values?: Partial<Workspace>) {
68
45
  settingsRef.current = values as Workspace;
69
46
  if (current.source !== 'user') {
70
- reset({ workspaceName: '' });
47
+ form.reset();
71
48
  openDialog();
72
49
  } else {
73
50
  saveWorkspace(values);
74
-
75
51
  closeDialog();
76
52
  }
77
53
  }
54
+
78
55
  return {
79
56
  saveSettings,
80
57
  SaveSettingsModal: () => {
81
58
  return (
82
59
  <Dialog
60
+ style={{ width: 500 }}
83
61
  onClose={closeDialog}
84
62
  isOpen={isOpenDialog}
85
63
  title="Save workspace"
86
64
  role="dialog"
87
65
  >
88
- <DialogContent>
89
- <Title>
90
- Please enter a new user workspace name in order to save your
91
- changes locally
92
- </Title>
93
- <WorkspaceAddForm
94
- onEnter={() => {
95
- void handleSubmit(handleAddNewWorkspace)();
96
- }}
97
- control={control}
98
- />
99
- </DialogContent>
100
- <DialogFooter>
101
- <ActionButtons
102
- style={{ flexDirection: 'row-reverse', margin: 0 }}
103
- onCancel={closeDialog}
104
- doneLabel="Save workspace"
105
- onDone={() => void handleSubmit(handleAddNewWorkspace)()}
66
+ <form
67
+ noValidate
68
+ onSubmit={(event) => {
69
+ event.preventDefault();
70
+ void form.handleSubmit();
71
+ }}
72
+ >
73
+ <DialogBody>
74
+ <form.AppField name="workspaceName">
75
+ {(field) => (
76
+ <field.Input
77
+ layout="inline"
78
+ autoFocus
79
+ label="New Workspace name"
80
+ placeholder="Enter workspace name"
81
+ helpText="Please enter a new user workspace name in order to save your changes locally"
82
+ required
83
+ />
84
+ )}
85
+ </form.AppField>
86
+ </DialogBody>
87
+
88
+ <DialogFooter
89
+ actions={
90
+ <>
91
+ <Button
92
+ intent="danger"
93
+ variant="outlined"
94
+ onClick={() => closeDialog()}
95
+ >
96
+ Cancel
97
+ </Button>
98
+ <form.AppForm>
99
+ <form.SubmitButton intent="success">
100
+ Save workspace
101
+ </form.SubmitButton>
102
+ </form.AppForm>
103
+ </>
104
+ }
106
105
  />
107
- </DialogFooter>
106
+ </form>
108
107
  </Dialog>
109
108
  );
110
109
  },
111
110
  };
112
111
  }
113
-
114
- const DialogContent = styled(DialogBody)`
115
- background-color: white;
116
- text-align: center;
117
- `;
118
-
119
- const Title = styled.p`
120
- font-size: 1em;
121
- font-weight: bold;
122
- padding: 0 30px;
123
- text-align: left;
124
- `;
@@ -1,12 +1,13 @@
1
1
  import { useDispatch } from '../context/DispatchContext.js';
2
+ import type { EventModifierKeys } from '../context/KeyModifierContext.js';
2
3
  import { getModifiers } from '../context/KeyModifierContext.js';
3
4
 
4
5
  export function useSetActiveSpectrumAction() {
5
6
  const dispatch = useDispatch();
6
7
 
7
- function setActiveSpectrum(e: MouseEvent, id: string) {
8
+ function setActiveSpectrum(event: EventModifierKeys, id: string) {
8
9
  setTimeout(() => {
9
- const { ctrlKey, shiftKey } = getModifiers(e);
10
+ const { ctrlKey, shiftKey } = getModifiers(event);
10
11
  const modifier = `shift[${shiftKey ? 'true' : 'false'}]_ctrl[${
11
12
  ctrlKey ? 'true' : 'false'
12
13
  }]`;
@@ -27,7 +27,7 @@ export function useSpectrumWithDataSource(
27
27
  return getSpectrum(dataSource, inset.spectrumKey, defaultValue);
28
28
  }
29
29
 
30
- if (dataSource && activeSpectrum?.id && activeSpectrum?.selected) {
30
+ if (dataSource && activeSpectrum?.selected) {
31
31
  return getSpectrum(dataSource, activeSpectrum.id, defaultValue);
32
32
  }
33
33
 
@@ -64,10 +64,13 @@ export function useWorkspaceAction() {
64
64
 
65
65
  function removeWorkspace(key: string) {
66
66
  const settings = readSettings();
67
+ let isActiveWorkspace = false;
68
+
67
69
  if (settings) {
68
70
  // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
69
71
  delete settings.workspaces[key];
70
72
  if (key === settings.currentWorkspace) {
73
+ isActiveWorkspace = true;
71
74
  settings.currentWorkspace = 'default';
72
75
  }
73
76
 
@@ -79,6 +82,8 @@ export function useWorkspaceAction() {
79
82
  workspace: key,
80
83
  },
81
84
  });
85
+
86
+ return isActiveWorkspace;
82
87
  }
83
88
 
84
89
  function saveWorkspace(data?: Partial<Workspace>) {
@@ -17,8 +17,7 @@ interface InnerImportPublicationStringModalProps {
17
17
  onClose: () => void;
18
18
  }
19
19
 
20
- interface ImportPublicationStringModalProps
21
- extends InnerImportPublicationStringModalProps {
20
+ interface ImportPublicationStringModalProps extends InnerImportPublicationStringModalProps {
22
21
  isOpen: boolean;
23
22
  }
24
23
 
@@ -151,7 +151,7 @@ function InnerMultipleAnalysis(props: InnerMultipleAnalysisProps) {
151
151
  frequency: info.originFrequency,
152
152
  minimalResolution: 0.1,
153
153
  critFoundJ: 0.75,
154
- maxTestedJ: 17,
154
+ maxTestedJ: 25,
155
155
  minTestedJ: 1,
156
156
  checkSymmetryFirst: false,
157
157
  takeBestPartMultiplet: true,
@@ -5,8 +5,10 @@ import { Toolbar, useOnOff } from 'react-science/ui';
5
5
  import type { ChangeSumModalContentsProps } from './ChangeSumModalContents.js';
6
6
  import { ChangeSumModalContents } from './ChangeSumModalContents.js';
7
7
 
8
- interface ChangeSumModalProps
9
- extends Omit<ChangeSumModalContentsProps, 'onClose'> {
8
+ interface ChangeSumModalProps extends Omit<
9
+ ChangeSumModalContentsProps,
10
+ 'onClose'
11
+ > {
10
12
  currentSum: number | null;
11
13
  sumType: string;
12
14
  disabled?: boolean;
@@ -93,8 +93,7 @@ interface InnerMetaImportationModalPropsProps {
93
93
  file?: File;
94
94
  onCloseDialog: () => void;
95
95
  }
96
- interface MetaImportationModalPropsProps
97
- extends InnerMetaImportationModalPropsProps {
96
+ interface MetaImportationModalPropsProps extends InnerMetaImportationModalPropsProps {
98
97
  isOpen: boolean;
99
98
  }
100
99
 
@@ -148,6 +148,7 @@ function InnerGeneralSettingsModal(props: InnerGeneralSettingsModalProps) {
148
148
  workspaces,
149
149
  ...preferences
150
150
  } = usePreferences();
151
+
151
152
  const { addNewWorkspace, removeWorkspace, setActiveWorkspace } =
152
153
  useWorkspaceAction();
153
154
  const baseWorkspaces = useWorkspacesList();
@@ -172,7 +173,11 @@ function InnerGeneralSettingsModal(props: InnerGeneralSettingsModalProps) {
172
173
  }
173
174
 
174
175
  function deleteWorkSpaceHandler(key: any) {
175
- removeWorkspace(key);
176
+ const isActiveWorkspace = removeWorkspace(key);
177
+ if (!isActiveWorkspace) {
178
+ return;
179
+ }
180
+ reset(workspaces.default);
176
181
  }
177
182
 
178
183
  function ChangeWorkspaceHandler(option: DropDownListItem) {
@@ -351,7 +356,7 @@ function WorkSpaceActionsButtons(props: any) {
351
356
  reset(workSpaceDisplayPreferences);
352
357
  }
353
358
 
354
- function handlePasteWorkspace(text: string | undefined) {
359
+ function handlePasteWorkspace(text: string | null) {
355
360
  if (!text) return;
356
361
 
357
362
  try {
@@ -121,7 +121,7 @@ const LIST: ListItem[] = [
121
121
  name: 'exclusionZones',
122
122
  },
123
123
  {
124
- label: 'Multiple spectra analysis',
124
+ label: 'Multiple spectra integration',
125
125
  name: 'multipleSpectraAnalysis',
126
126
  },
127
127
  {
@@ -23,8 +23,10 @@ import type { IntegralPanelInnerProps } from './IntegralPanel.js';
23
23
 
24
24
  const selectStyle = { width: '100%', border: 'none' };
25
25
 
26
- interface IntegralTableProps
27
- extends Pick<IntegralPanelInnerProps, 'activeTab'> {
26
+ interface IntegralTableProps extends Pick<
27
+ IntegralPanelInnerProps,
28
+ 'activeTab'
29
+ > {
28
30
  data: Integral[];
29
31
  info: Info1D;
30
32
  }
@@ -20,7 +20,10 @@ import type {
20
20
  MoleculesView,
21
21
  StateMoleculeExtended,
22
22
  } from '../../../data/molecules/Molecule.js';
23
- import { getMolecules } from '../../../data/molecules/MoleculeManager.js';
23
+ import {
24
+ getMolecules,
25
+ parseErrorMessage,
26
+ } from '../../../data/molecules/MoleculeManager.js';
24
27
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents.js';
25
28
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks.js';
26
29
  import { useDispatch } from '../../context/DispatchContext.js';
@@ -85,7 +88,7 @@ interface MoleculePanelHeaderProps {
85
88
  onOpenMoleculeEditor: () => void;
86
89
  renderSource?: 'moleculePanel' | 'predictionPanel';
87
90
  onClickPreferences?: () => void;
88
- onClickPastMolecule?: () => void;
91
+ onClickPasteMolecule?: () => void;
89
92
  children?: ReactNode;
90
93
  }
91
94
 
@@ -98,7 +101,7 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
98
101
  onOpenMoleculeEditor,
99
102
  renderSource = 'moleculePanel',
100
103
  onClickPreferences,
101
- onClickPastMolecule,
104
+ onClickPasteMolecule,
102
105
  children,
103
106
  } = props;
104
107
  const { rootRef } = useGlobal();
@@ -115,6 +118,7 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
115
118
  fileName: 'molFile',
116
119
  });
117
120
  }, [rootRef, currentIndex]);
121
+ const topicMolecule = useTopicMolecule();
118
122
 
119
123
  const saveAsPNGHandler = useCallback(async () => {
120
124
  if (!rootRef) return;
@@ -191,7 +195,7 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
191
195
  );
192
196
 
193
197
  function handlePasteMoleculeAction() {
194
- onClickPastMolecule?.();
198
+ onClickPasteMolecule?.();
195
199
  void readText().then(handlePasteMolecule);
196
200
  }
197
201
 
@@ -200,7 +204,8 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
200
204
  * @param text - text from clipboard
201
205
  * @returns
202
206
  */
203
- async function handlePasteMolecule(text: string | undefined) {
207
+
208
+ async function handlePasteMolecule(text: string | null) {
204
209
  if (!text) return;
205
210
  try {
206
211
  const molecules = getMolecules(text);
@@ -208,11 +213,10 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
208
213
  type: 'ADD_MOLECULES',
209
214
  payload: { molecules, defaultMoleculeSettings },
210
215
  });
211
- } catch {
216
+ } catch (error: any) {
212
217
  toaster.show({
213
218
  intent: 'danger',
214
- message:
215
- 'Failed to parse SMILES or molfile. Please paste a valid format',
219
+ message: error?.message || parseErrorMessage,
216
220
  });
217
221
  } finally {
218
222
  cleanShouldFallback();
@@ -220,14 +224,18 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
220
224
  }
221
225
 
222
226
  const handleDelete = useCallback(() => {
223
- if (molecules[currentIndex]?.id) {
224
- onMoleculeIndexChange?.(0);
225
- dispatch({
226
- type: 'DELETE_MOLECULE',
227
- payload: { id: molecules[currentIndex].id },
228
- });
227
+ const id = molecules[currentIndex]?.id;
228
+
229
+ if (!id) {
230
+ return;
229
231
  }
230
- }, [molecules, currentIndex, onMoleculeIndexChange, dispatch]);
232
+
233
+ onMoleculeIndexChange?.(0);
234
+ dispatch({
235
+ type: 'DELETE_MOLECULE',
236
+ payload: { id, diaIDs: topicMolecule[id].diaIDsAndInfo },
237
+ });
238
+ }, [molecules, currentIndex, topicMolecule, onMoleculeIndexChange, dispatch]);
231
239
 
232
240
  function floatMoleculeHandler() {
233
241
  dispatch({
@@ -236,8 +244,6 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
236
244
  });
237
245
  }
238
246
 
239
- const topicMolecule = useTopicMolecule();
240
-
241
247
  function expandMoleculeHydrogens(expand?: boolean) {
242
248
  const molecule = molecules[currentIndex];
243
249
 
@@ -378,7 +384,7 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
378
384
  onDismiss={cleanShouldFallback}
379
385
  onReadText={handlePasteMolecule}
380
386
  text={text}
381
- label="Molfile"
387
+ label="Enter here a molfile or SMILES"
382
388
  />
383
389
  </PanelHeader>
384
390
  );
@@ -7,7 +7,7 @@ import { isSpectrum1D } from '../../../../data/data1d/Spectrum1D/isSpectrum1D.ts
7
7
  import { isSpectrum2D } from '../../../../data/data2d/Spectrum2D/isSpectrum2D.ts';
8
8
  import { ConcatenationString } from '../../../../data/utilities/Concatenation.ts';
9
9
  import checkModifierKeyActivated from '../../../../data/utilities/checkModifierKeyActivated.ts';
10
- import { useTracesSpectra } from '../../../2d/useTracesSpectra.ts';
10
+ import { getTracesSpectra } from '../../../2d/useTracesSpectra.ts';
11
11
  import type {
12
12
  Assignments,
13
13
  Axis,
@@ -71,6 +71,25 @@ function getSignalsDiaIDs(
71
71
  ]);
72
72
  }
73
73
 
74
+ function use1DSpectraTraces() {
75
+ const {
76
+ data,
77
+ view: {
78
+ spectra: { activeSpectra, activeTab },
79
+ },
80
+ } = useChartData();
81
+
82
+ return useMemo(() => {
83
+ const nuclei = activeTab.split(',');
84
+ try {
85
+ const traces = getTracesSpectra({ nuclei, spectra: data, activeSpectra });
86
+ return Object.values(traces).filter((spectrum) => spectrum !== null);
87
+ } catch {
88
+ return [];
89
+ }
90
+ }, [activeTab, data, activeSpectra]);
91
+ }
92
+
74
93
  export default function useAtomAssignment() {
75
94
  const {
76
95
  data: spectra,
@@ -79,7 +98,7 @@ export default function useAtomAssignment() {
79
98
  },
80
99
  } = useChartData();
81
100
  const spectrum = useSpectrum();
82
- const tracesSpectra = useTracesSpectra();
101
+ const tracesSpectra = use1DSpectraTraces();
83
102
 
84
103
  const toaster = useToaster();
85
104
  const dispatch = useDispatch();
@@ -108,7 +127,7 @@ export default function useAtomAssignment() {
108
127
 
109
128
  if (isSpectrum2D(spectrum) && spectrumID) {
110
129
  const traceSpectrum = tracesSpectra.find(
111
- (traceSpectrum) => traceSpectrum.id === spectrumID,
130
+ (traceSpectrum) => traceSpectrum?.id === spectrumID,
112
131
  );
113
132
  if (traceSpectrum) {
114
133
  currentSpectrum = traceSpectrum;
@@ -150,16 +169,15 @@ export default function useAtomAssignment() {
150
169
 
151
170
  let diaIDs: string[] = [];
152
171
 
153
- if (assignKeys?.length === 1) {
154
- diaIDs = range?.diaIDs || [];
155
- } else {
156
- const [, { index: signalIndex }] = assignKeys;
157
- diaIDs = range?.signals[signalIndex]?.diaIDs || [];
158
- }
172
+ //TODO: Refactor TargetAssignKeys after completing the 2D assignment and remove assignKeys.length !== 2 condition
173
+ if (assignKeys.length !== 2) return;
174
+ const [, { index: signalIndex }] = assignKeys;
175
+ diaIDs = range?.signals[signalIndex]?.diaIDs || [];
176
+
159
177
  const uniqueDiaIDs = getUniqueDiaIDs(diaIDs, atom);
160
178
 
161
179
  dispatch({
162
- type: 'ASSIGN_RANGE',
180
+ type: 'ASSIGN_1D_SIGNAL',
163
181
  payload: {
164
182
  nbAtoms: uniqueDiaIDs.nbAtoms,
165
183
  diaIDs: uniqueDiaIDs.diaIDs,
@@ -183,12 +201,10 @@ export default function useAtomAssignment() {
183
201
 
184
202
  let diaIDs: string[] = [];
185
203
 
186
- if (assignKeys?.length === 1) {
187
- diaIDs = zone[axis]?.diaIDs || [];
188
- } else {
189
- const [, { index: signalIndex }] = assignKeys;
190
- diaIDs = zone?.signals[signalIndex][axis]?.diaIDs || [];
191
- }
204
+ //TODO: Refactor TargetAssignKeys after completing the 2D assignment and remove assignKeys.length !== 2 condition
205
+ if (assignKeys.length !== 2) return;
206
+ const [, { index: signalIndex }] = assignKeys;
207
+ diaIDs = zone?.signals[signalIndex][axis]?.diaIDs || [];
192
208
 
193
209
  const uniqueDiaIDs = getUniqueDiaIDs(diaIDs, atom);
194
210
  dispatch({
@@ -33,10 +33,6 @@ export function getAssignIds(
33
33
  for (let i = 0; i < data.length; i++) {
34
34
  const datum = data[i];
35
35
 
36
- if (datum.id === id) {
37
- return [{ target, index: i, key: datum.id }];
38
- }
39
-
40
36
  const signalIndex = datum.signals.findIndex((signal) => signal.id === id);
41
37
  if (signalIndex !== -1) {
42
38
  const { id } = datum.signals[signalIndex];
@@ -88,7 +88,7 @@ function RangesTablePanelInner({
88
88
 
89
89
  const unlinkRangeHandler = useCallback(() => {
90
90
  dispatch({
91
- type: 'UNLINK_RANGE',
91
+ type: 'UNASSIGN_1D_SIGNAL',
92
92
  payload: {
93
93
  signalIndex: -1,
94
94
  },
@@ -132,14 +132,9 @@ function RangesTable(props: RangesTableProps) {
132
132
  {preferences.coupling.show && <th>J (Hz)</th>}
133
133
 
134
134
  {preferences.showAssignment && (
135
- <>
136
- <th title="Assign multiplets">
137
- <FaLink style={{ fontSize: 10, margin: 'auto' }} />
138
- </th>
139
- <th title="Assign ranges" style={{ minWidth: '50px' }}>
140
- Σ
141
- </th>
142
- </>
135
+ <th title="Assign multiplets">
136
+ <FaLink style={{ fontSize: 10, margin: 'auto' }} />
137
+ </th>
143
138
  )}
144
139
  {preferences.showKind && <th>Kind</th>}
145
140
  {showActions && <th>{''}</th>}