nmrium 2.2.0 → 2.4.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 (414) hide show
  1. package/lib/component/1d/PredictionErrorsNotations.js +3 -3
  2. package/lib/component/1d/PredictionErrorsNotations.js.map +1 -1
  3. package/lib/component/1d/peaks/PeakEditionManager.d.ts +1 -1
  4. package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
  5. package/lib/component/1d/peaks/Peaks.js +2 -1
  6. package/lib/component/1d/peaks/Peaks.js.map +1 -1
  7. package/lib/component/1d/peaks/usePeakShapesPath.d.ts.map +1 -1
  8. package/lib/component/1d/peaks/usePeakShapesPath.js.map +1 -1
  9. package/lib/component/1d/ranges/AssignmentLabel.js +1 -1
  10. package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
  11. package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.d.ts +9 -0
  12. package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.d.ts.map +1 -0
  13. package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.js +138 -0
  14. package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.js.map +1 -0
  15. package/lib/component/1d/ranges/FloatingRanges.d.ts.map +1 -0
  16. package/lib/component/1d/ranges/FloatingRanges.js +362 -0
  17. package/lib/component/1d/ranges/FloatingRanges.js.map +1 -0
  18. package/lib/component/1d/ranges/Ranges.js +2 -2
  19. package/lib/component/1d/ranges/Ranges.js.map +1 -1
  20. package/lib/component/1d-2d/FieldEdition.d.ts +2 -2
  21. package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
  22. package/lib/component/1d-2d/FieldEdition.js +2 -2
  23. package/lib/component/1d-2d/FieldEdition.js.map +1 -1
  24. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +7 -7
  25. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
  26. package/lib/component/1d-2d/tools/BrushXY.js +6 -6
  27. package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
  28. package/lib/component/2d/1d-tracer/Left1DChart.d.ts.map +1 -1
  29. package/lib/component/2d/1d-tracer/Left1DChart.js +6 -2
  30. package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
  31. package/lib/component/2d/1d-tracer/Ranges1D.d.ts +9 -0
  32. package/lib/component/2d/1d-tracer/Ranges1D.d.ts.map +1 -0
  33. package/lib/component/2d/1d-tracer/Ranges1D.js +76 -0
  34. package/lib/component/2d/1d-tracer/Ranges1D.js.map +1 -0
  35. package/lib/component/2d/1d-tracer/Signals1D.d.ts +11 -0
  36. package/lib/component/2d/1d-tracer/Signals1D.d.ts.map +1 -0
  37. package/lib/component/2d/1d-tracer/Signals1D.js +90 -0
  38. package/lib/component/2d/1d-tracer/Signals1D.js.map +1 -0
  39. package/lib/component/2d/1d-tracer/Top1DChart.d.ts.map +1 -1
  40. package/lib/component/2d/1d-tracer/Top1DChart.js +6 -2
  41. package/lib/component/2d/1d-tracer/Top1DChart.js.map +1 -1
  42. package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
  43. package/lib/component/2d/ft/FTContainer.js.map +1 -1
  44. package/lib/component/2d/zones/SignalsGuideLines.js +1 -1
  45. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  46. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
  47. package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
  48. package/lib/component/AnchorSVG.d.ts +37 -0
  49. package/lib/component/AnchorSVG.d.ts.map +1 -0
  50. package/lib/component/AnchorSVG.js +137 -0
  51. package/lib/component/AnchorSVG.js.map +1 -0
  52. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  53. package/lib/component/EventsTrackers/BrushTracker.js +4 -0
  54. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  55. package/lib/component/SVGTable.d.ts +5 -3
  56. package/lib/component/SVGTable.d.ts.map +1 -1
  57. package/lib/component/SVGTable.js +16 -16
  58. package/lib/component/SVGTable.js.map +1 -1
  59. package/lib/component/context/KeyModifierContext.d.ts +1 -0
  60. package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
  61. package/lib/component/context/KeyModifierContext.js +4 -0
  62. package/lib/component/context/KeyModifierContext.js.map +1 -1
  63. package/lib/component/context/LoggerContext.d.ts.map +1 -1
  64. package/lib/component/context/LoggerContext.js.map +1 -1
  65. package/lib/component/context/SortSpectraContext.d.ts.map +1 -1
  66. package/lib/component/context/SortSpectraContext.js.map +1 -1
  67. package/lib/component/elements/ActionsButtonsPopover.d.ts +2 -2
  68. package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
  69. package/lib/component/elements/ActionsButtonsPopover.js +6 -9
  70. package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
  71. package/lib/component/elements/Button.d.ts.map +1 -1
  72. package/lib/component/elements/Button.js.map +1 -1
  73. package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
  74. package/lib/component/elements/DraggableDialog.js +1 -2
  75. package/lib/component/elements/DraggableDialog.js.map +1 -1
  76. package/lib/component/elements/Sections.d.ts +3 -3
  77. package/lib/component/elements/Sections.d.ts.map +1 -1
  78. package/lib/component/elements/Sections.js +1 -1
  79. package/lib/component/elements/Sections.js.map +1 -1
  80. package/lib/component/elements/TabTitle.d.ts.map +1 -1
  81. package/lib/component/elements/TabTitle.js +2 -2
  82. package/lib/component/elements/TabTitle.js.map +1 -1
  83. package/lib/component/elements/ToolbarPopoverItem.d.ts +1 -0
  84. package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
  85. package/lib/component/elements/ToolbarPopoverItem.js +10 -3
  86. package/lib/component/elements/ToolbarPopoverItem.js.map +1 -1
  87. package/lib/component/elements/dropDownButton/DropDownButton.d.ts.map +1 -1
  88. package/lib/component/elements/dropDownButton/DropDownButton.js +2 -2
  89. package/lib/component/elements/dropDownButton/DropDownButton.js.map +1 -1
  90. package/lib/component/elements/export/ExportOptionsModal.d.ts +1 -1
  91. package/lib/component/elements/export/ExportOptionsModal.d.ts.map +1 -1
  92. package/lib/component/elements/export/ExportOptionsModal.js +28 -110
  93. package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
  94. package/lib/component/elements/export/units.d.ts +0 -28
  95. package/lib/component/elements/export/units.d.ts.map +1 -1
  96. package/lib/component/elements/export/units.js +0 -5
  97. package/lib/component/elements/export/units.js.map +1 -1
  98. package/lib/component/elements/export/utilities/getExportOptions.d.ts.map +1 -1
  99. package/lib/component/elements/export/utilities/getExportOptions.js.map +1 -1
  100. package/lib/component/elements/print/pageSize.d.ts +1 -1
  101. package/lib/component/elements/print/pageSize.d.ts.map +1 -1
  102. package/lib/component/header/Header.d.ts.map +1 -1
  103. package/lib/component/header/Header.js +2 -4
  104. package/lib/component/header/Header.js.map +1 -1
  105. package/lib/component/hooks/useExport.d.ts.map +1 -1
  106. package/lib/component/hooks/useExport.js.map +1 -1
  107. package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
  108. package/lib/component/hooks/usePanelPreferences.d.ts.map +1 -1
  109. package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
  110. package/lib/component/hooks/useSaveSettings.js +3 -6
  111. package/lib/component/hooks/useSaveSettings.js.map +1 -1
  112. package/lib/component/hooks/useTextMetrics.d.ts.map +1 -1
  113. package/lib/component/hooks/useTextMetrics.js +1 -0
  114. package/lib/component/hooks/useTextMetrics.js.map +1 -1
  115. package/lib/component/main/NMRiumViewer.js +1 -1
  116. package/lib/component/main/NMRiumViewer.js.map +1 -1
  117. package/lib/component/modal/EditPeakShapeModal.js +2 -2
  118. package/lib/component/modal/EditPeakShapeModal.js.map +1 -1
  119. package/lib/component/modal/PublicationStringModal.d.ts.map +1 -1
  120. package/lib/component/modal/PublicationStringModal.js +2 -6
  121. package/lib/component/modal/PublicationStringModal.js.map +1 -1
  122. package/lib/component/modal/SaveAsModal.d.ts +2 -2
  123. package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
  124. package/lib/component/modal/SaveAsModal.js +40 -35
  125. package/lib/component/modal/SaveAsModal.js.map +1 -1
  126. package/lib/component/modal/aboutUs/AboutUsModal.d.ts.map +1 -1
  127. package/lib/component/modal/aboutUs/AboutUsModal.js +2 -4
  128. package/lib/component/modal/aboutUs/AboutUsModal.js.map +1 -1
  129. package/lib/component/modal/editRange/EditRangeModal.js +4 -3
  130. package/lib/component/modal/editRange/EditRangeModal.js.map +1 -1
  131. package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts.map +1 -1
  132. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +39 -37
  133. package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
  134. package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +29 -29
  135. package/lib/component/modal/setting/tanstack_general_settings/errors/context.js +3 -3
  136. package/lib/component/modal/setting/tanstack_general_settings/errors/context.js.map +1 -1
  137. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +29 -29
  138. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.js +2 -2
  139. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.js.map +1 -1
  140. package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
  141. package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +9 -12
  142. package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
  143. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +29 -29
  144. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +2 -2
  145. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -1
  146. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +24 -24
  147. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +29 -29
  148. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +2 -2
  149. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -1
  150. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +4 -4
  151. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +29 -29
  152. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js +2 -2
  153. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js.map +1 -1
  154. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +24 -24
  155. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +24 -24
  156. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +24 -24
  157. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts +14 -14
  158. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +2 -2
  159. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
  160. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +24 -24
  161. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +24 -24
  162. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +24 -24
  163. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +24 -24
  164. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +24 -24
  165. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +24 -24
  166. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +24 -24
  167. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts.map +1 -1
  168. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.js +3 -2
  169. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.js.map +1 -1
  170. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +24 -24
  171. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -1
  172. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js +3 -2
  173. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js.map +1 -1
  174. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +24 -24
  175. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  176. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +30 -3
  177. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  178. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
  179. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -9
  180. package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
  181. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +18 -18
  182. package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
  183. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  184. package/lib/component/panels/PeaksPanel/PeaksTable.js +17 -17
  185. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  186. package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
  187. package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
  188. package/lib/component/panels/RangesPanel/RangesPreferences.js +22 -22
  189. package/lib/component/panels/RangesPanel/RangesPreferences.js.map +1 -1
  190. package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
  191. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  192. package/lib/component/panels/RangesPanel/RangesTable.js +5 -4
  193. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  194. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  195. package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
  196. package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
  197. package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
  198. package/lib/component/panels/SpectraPanel/SpectraTable.js +5 -1
  199. package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
  200. package/lib/component/panels/SpectraPanel/base/RenderAsHTML.d.ts.map +1 -1
  201. package/lib/component/panels/SpectraPanel/base/RenderAsHTML.js +7 -4
  202. package/lib/component/panels/SpectraPanel/base/RenderAsHTML.js.map +1 -1
  203. package/lib/component/panels/SpectraPanel/base/SpectrumName.d.ts.map +1 -1
  204. package/lib/component/panels/SpectraPanel/base/SpectrumName.js +5 -1
  205. package/lib/component/panels/SpectraPanel/base/SpectrumName.js.map +1 -1
  206. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts.map +1 -1
  207. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js +2 -2
  208. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js.map +1 -1
  209. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
  210. package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -0
  211. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  212. package/lib/component/panels/filtersPanel/FilterPanel.d.ts.map +1 -1
  213. package/lib/component/panels/filtersPanel/FilterPanel.js +5 -2
  214. package/lib/component/panels/filtersPanel/FilterPanel.js.map +1 -1
  215. package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
  216. package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
  217. package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts +2 -0
  218. package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts.map +1 -0
  219. package/lib/component/panels/filtersPanel/processings_sections_panel.js +144 -0
  220. package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -0
  221. package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +3 -2
  222. package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -1
  223. package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +14 -8
  224. package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -1
  225. package/lib/component/panels/informationPanel/MixedValuesBadge.d.ts.map +1 -1
  226. package/lib/component/panels/informationPanel/MixedValuesBadge.js +2 -2
  227. package/lib/component/panels/informationPanel/MixedValuesBadge.js.map +1 -1
  228. package/lib/component/panels/informationPanel/SpectraPicker.d.ts.map +1 -1
  229. package/lib/component/panels/informationPanel/SpectraPicker.js +2 -2
  230. package/lib/component/panels/informationPanel/SpectraPicker.js.map +1 -1
  231. package/lib/component/reducer/Reducer.d.ts.map +1 -1
  232. package/lib/component/reducer/Reducer.js +2 -0
  233. package/lib/component/reducer/Reducer.js.map +1 -1
  234. package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
  235. package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
  236. package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
  237. package/lib/component/reducer/actions/DomainActions.js.map +1 -1
  238. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  239. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  240. package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
  241. package/lib/component/reducer/actions/LoadAction.js.map +1 -1
  242. package/lib/component/reducer/actions/MoleculeActions.d.ts +9 -0
  243. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  244. package/lib/component/reducer/actions/RangesActions.d.ts +11 -2
  245. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  246. package/lib/component/reducer/actions/RangesActions.js +23 -5
  247. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  248. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  249. package/lib/component/reducer/actions/ToolsActions.js +5 -17
  250. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  251. package/lib/component/reducer/helper/getTraceSpectrumID.d.ts +5 -0
  252. package/lib/component/reducer/helper/getTraceSpectrumID.d.ts.map +1 -0
  253. package/lib/component/reducer/helper/getTraceSpectrumID.js +14 -0
  254. package/lib/component/reducer/helper/getTraceSpectrumID.js.map +1 -0
  255. package/lib/component/reducer/helper/setRangesViewProperty.d.ts.map +1 -1
  256. package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
  257. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
  258. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +35 -26
  259. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
  260. package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
  261. package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
  262. package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +2 -2
  263. package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +2 -2
  264. package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts.map +1 -1
  265. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  266. package/lib/component/toolbar/nmr_toolbar.d.ts.map +1 -1
  267. package/lib/component/toolbar/nmr_toolbar.js +3 -1
  268. package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
  269. package/lib/component/utility/CoreSlot.d.ts +27 -0
  270. package/lib/component/utility/CoreSlot.d.ts.map +1 -0
  271. package/lib/component/utility/CoreSlot.js +56 -0
  272. package/lib/component/utility/CoreSlot.js.map +1 -0
  273. package/lib/component/utility/export.d.ts.map +1 -1
  274. package/lib/component/utility/export.js +1 -0
  275. package/lib/component/utility/export.js.map +1 -1
  276. package/lib/data/PredictionManager.js.map +1 -1
  277. package/lib/data/constants/signalsKinds.d.ts +1 -2
  278. package/lib/data/constants/signalsKinds.d.ts.map +1 -1
  279. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts.map +1 -1
  280. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -0
  281. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js.map +1 -1
  282. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts.map +1 -1
  283. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +35 -30
  284. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js.map +1 -1
  285. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
  286. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +1 -0
  287. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
  288. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +2 -2
  289. package/lib/data/matrixGeneration.d.ts.map +1 -1
  290. package/lib/data/matrixGeneration.js.map +1 -1
  291. package/lib/versionInfo.js +1 -1
  292. package/package.json +37 -37
  293. package/src/component/1d/PredictionErrorsNotations.tsx +5 -4
  294. package/src/component/1d/peaks/Peaks.tsx +5 -2
  295. package/src/component/1d/peaks/usePeakShapesPath.ts +0 -1
  296. package/src/component/1d/ranges/AssignmentLabel.tsx +1 -1
  297. package/src/component/1d/ranges/FloatingRangeTablePreferencesModal.tsx +238 -0
  298. package/src/component/1d/ranges/FloatingRanges.tsx +529 -0
  299. package/src/component/1d/ranges/Ranges.tsx +2 -2
  300. package/src/component/1d-2d/FieldEdition.tsx +4 -4
  301. package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +8 -8
  302. package/src/component/1d-2d/tools/BrushXY.tsx +8 -8
  303. package/src/component/2d/1d-tracer/Left1DChart.tsx +24 -1
  304. package/src/component/2d/1d-tracer/Ranges1D.tsx +134 -0
  305. package/src/component/2d/1d-tracer/Signals1D.tsx +145 -0
  306. package/src/component/2d/1d-tracer/Top1DChart.tsx +29 -2
  307. package/src/component/2d/ft/FTContainer.tsx +1 -0
  308. package/src/component/2d/zones/SignalsGuideLines.tsx +1 -1
  309. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
  310. package/src/component/AnchorSVG.tsx +370 -0
  311. package/src/component/EventsTrackers/BrushTracker.tsx +7 -2
  312. package/src/component/SVGTable.tsx +35 -33
  313. package/src/component/context/KeyModifierContext.tsx +6 -2
  314. package/src/component/context/LoggerContext.tsx +1 -7
  315. package/src/component/context/SortSpectraContext.tsx +1 -3
  316. package/src/component/elements/ActionsButtonsPopover.tsx +12 -14
  317. package/src/component/elements/Button.tsx +1 -6
  318. package/src/component/elements/DraggableDialog.tsx +1 -2
  319. package/src/component/elements/Sections.tsx +9 -7
  320. package/src/component/elements/TabTitle.tsx +7 -5
  321. package/src/component/elements/ToolbarPopoverItem.tsx +13 -2
  322. package/src/component/elements/dropDownButton/DropDownButton.tsx +7 -5
  323. package/src/component/elements/export/ExportOptionsModal.tsx +51 -280
  324. package/src/component/elements/export/units.ts +0 -6
  325. package/src/component/elements/export/utilities/getExportOptions.ts +1 -0
  326. package/src/component/elements/print/pageSize.ts +1 -1
  327. package/src/component/header/Header.tsx +2 -4
  328. package/src/component/hooks/useExport.tsx +1 -3
  329. package/src/component/hooks/usePanelPreferences.ts +4 -4
  330. package/src/component/hooks/useSaveSettings.tsx +4 -15
  331. package/src/component/hooks/useTextMetrics.ts +1 -0
  332. package/src/component/main/NMRiumViewer.tsx +1 -1
  333. package/src/component/modal/EditPeakShapeModal.tsx +2 -2
  334. package/src/component/modal/PublicationStringModal.tsx +5 -11
  335. package/src/component/modal/SaveAsModal.tsx +80 -82
  336. package/src/component/modal/aboutUs/AboutUsModal.tsx +5 -4
  337. package/src/component/modal/editRange/EditRangeModal.tsx +6 -4
  338. package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +58 -58
  339. package/src/component/modal/setting/WorkspaceItem.tsx +2 -2
  340. package/src/component/modal/setting/tanstack_general_settings/errors/context.tsx +3 -3
  341. package/src/component/modal/setting/tanstack_general_settings/errors/renderer.tsx +2 -2
  342. package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +23 -29
  343. package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +2 -2
  344. package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +2 -2
  345. package/src/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.tsx +2 -2
  346. package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +2 -2
  347. package/src/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.tsx +3 -2
  348. package/src/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.tsx +3 -2
  349. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +41 -8
  350. package/src/component/panels/PeaksPanel/PeaksPanel.tsx +1 -8
  351. package/src/component/panels/PeaksPanel/PeaksPreferences.tsx +18 -18
  352. package/src/component/panels/PeaksPanel/PeaksTable.tsx +19 -17
  353. package/src/component/panels/RangesPanel/RangesHeader.tsx +1 -2
  354. package/src/component/panels/RangesPanel/RangesPanel.tsx +2 -2
  355. package/src/component/panels/RangesPanel/RangesPreferences.tsx +22 -22
  356. package/src/component/panels/RangesPanel/RangesTable.tsx +19 -17
  357. package/src/component/panels/RangesPanel/RangesTableRow.tsx +25 -25
  358. package/src/component/panels/SpectraPanel/SpectraTable.tsx +12 -1
  359. package/src/component/panels/SpectraPanel/base/RenderAsHTML.tsx +22 -4
  360. package/src/component/panels/SpectraPanel/base/SpectrumName.tsx +15 -6
  361. package/src/component/panels/SpectraPanel/base/setting/SpectrumSetting.tsx +3 -2
  362. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +14 -16
  363. package/src/component/panels/filtersPanel/FilterPanel.tsx +10 -0
  364. package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -0
  365. package/src/component/panels/filtersPanel/processings_sections_panel.tsx +324 -0
  366. package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +17 -9
  367. package/src/component/panels/informationPanel/MixedValuesBadge.tsx +3 -2
  368. package/src/component/panels/informationPanel/SpectraPicker.tsx +12 -4
  369. package/src/component/panels/multipleAnalysisPanel/AnalysisChart.tsx +2 -2
  370. package/src/component/reducer/Reducer.ts +2 -0
  371. package/src/component/reducer/actions/CorrelationsActions.ts +1 -1
  372. package/src/component/reducer/actions/DomainActions.ts +1 -4
  373. package/src/component/reducer/actions/FiltersActions.ts +1 -2
  374. package/src/component/reducer/actions/LoadAction.ts +1 -3
  375. package/src/component/reducer/actions/RangesActions.ts +39 -5
  376. package/src/component/reducer/actions/ToolsActions.ts +5 -21
  377. package/src/component/reducer/helper/getTraceSpectrumID.tsx +25 -0
  378. package/src/component/reducer/helper/setRangesViewProperty.ts +1 -2
  379. package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +32 -19
  380. package/src/component/reducer/preferences/preferencesReducer.ts +2 -2
  381. package/src/component/reducer/preferences/utilities/initWorkspace.ts +2 -2
  382. package/src/component/reducer/preferences/utilities/mapWorkspaces.ts +2 -2
  383. package/src/component/toolbar/ToolTypes.ts +2 -2
  384. package/src/component/toolbar/nmr_toolbar.tsx +3 -2
  385. package/src/component/utility/CoreSlot.tsx +126 -0
  386. package/src/component/utility/export.ts +1 -0
  387. package/src/data/PredictionManager.ts +4 -6
  388. package/src/data/constants/signalsKinds.ts +1 -1
  389. package/src/data/data1d/Spectrum1D/peaks/autoPeakPicking.ts +1 -0
  390. package/src/data/data1d/Spectrum1D/peaks/optimizePeaks.ts +35 -30
  391. package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +1 -0
  392. package/src/data/data1d/multipleSpectraAnalysis.ts +2 -2
  393. package/src/data/matrixGeneration.ts +1 -5
  394. package/src/versionInfo.ts +1 -1
  395. package/lib/component/1d/FloatingRanges.d.ts.map +0 -1
  396. package/lib/component/1d/FloatingRanges.js +0 -263
  397. package/lib/component/1d/FloatingRanges.js.map +0 -1
  398. package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts +0 -17
  399. package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts.map +0 -1
  400. package/lib/component/elements/export/utilities/exportOptionValidationSchema.js +0 -79
  401. package/lib/component/elements/export/utilities/exportOptionValidationSchema.js.map +0 -1
  402. package/lib/component/elements/export/utilities/getModes.d.ts +0 -4
  403. package/lib/component/elements/export/utilities/getModes.d.ts.map +0 -1
  404. package/lib/component/elements/export/utilities/getModes.js +0 -11
  405. package/lib/component/elements/export/utilities/getModes.js.map +0 -1
  406. package/lib/component/utility/renderCoreSlot.d.ts +0 -11
  407. package/lib/component/utility/renderCoreSlot.d.ts.map +0 -1
  408. package/lib/component/utility/renderCoreSlot.js +0 -13
  409. package/lib/component/utility/renderCoreSlot.js.map +0 -1
  410. package/src/component/1d/FloatingRanges.tsx +0 -378
  411. package/src/component/elements/export/utilities/exportOptionValidationSchema.ts +0 -106
  412. package/src/component/elements/export/utilities/getModes.ts +0 -14
  413. package/src/component/utility/renderCoreSlot.tsx +0 -21
  414. /package/lib/component/1d/{FloatingRanges.d.ts → ranges/FloatingRanges.d.ts} +0 -0
@@ -3,8 +3,9 @@ import styled from '@emotion/styled';
3
3
  import { revalidateLogic } from '@tanstack/react-form';
4
4
  import type { Workspace } from '@zakodium/nmrium-core';
5
5
  import { ErrorBoundary } from 'react-error-boundary';
6
- import { Form, assert, useForm } from 'react-science/ui';
6
+ import { AppForm, useForm } from 'react-science/ui';
7
7
  import { match } from 'ts-pattern';
8
+ import { z } from 'zod';
8
9
 
9
10
  import { usePreferences } from '../../../context/PreferencesContext.js';
10
11
  import ErrorOverlay from '../../../main/ErrorOverlay.tsx';
@@ -60,7 +61,9 @@ interface GeneralSettingsProps extends Omit<
60
61
  onSave: (values?: Partial<Workspace>) => void;
61
62
  }
62
63
 
63
- type FormMeta = 'apply' | 'save';
64
+ const metaSchema = z.enum(['apply', 'save']);
65
+ type FormMeta = z.input<typeof metaSchema>;
66
+ const onSubmitMeta: FormMeta = 'apply';
64
67
 
65
68
  function GeneralSettings(props: GeneralSettingsProps) {
66
69
  const { close, height, onSave } = props;
@@ -74,10 +77,12 @@ function GeneralSettings(props: GeneralSettingsProps) {
74
77
  },
75
78
  validationLogic: revalidateLogic({ mode: 'change' }),
76
79
  defaultValues,
77
- // We don't want onSubmitMeta to be inferred as sting.
78
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
79
- onSubmitMeta: 'apply' as FormMeta,
80
+ onSubmitMeta,
80
81
  onSubmit: ({ value, meta }) => {
82
+ meta = metaSchema.parse(meta, {
83
+ error: () =>
84
+ 'Submit event must be attached to a submitter with "data-action" attribute with "apply" or "save" value',
85
+ });
81
86
  const mergedValues = formValueToWorkspace(value, currentWorkspace);
82
87
 
83
88
  match(meta)
@@ -97,30 +102,19 @@ function GeneralSettings(props: GeneralSettingsProps) {
97
102
  });
98
103
 
99
104
  return (
100
- <form.AppForm>
101
- <Form
102
- layout="inline"
103
- noValidate
104
- onSubmit={(event) => {
105
- event.preventDefault();
106
-
107
- const nativeEvent = event.nativeEvent as SubmitEvent;
108
- const submitter = nativeEvent.submitter as HTMLButtonElement | null;
109
- assert(submitter, 'form event should have a submitter');
110
- const action = submitter.dataset.action;
111
-
112
- void form.handleSubmit(action as FormMeta);
113
- }}
114
- >
115
- <PreventImplicitSubmit />
116
-
117
- <GeneralSettingsErrorsOpenProvider form={form}>
118
- <GeneralSettingsDialogHeader form={form} />
119
- <GeneralSettingsDialogBody form={form} height={height} />
120
- <GeneralSettingsDialogFooter form={form} onCancel={close} />
121
- </GeneralSettingsErrorsOpenProvider>
122
- </Form>
123
- </form.AppForm>
105
+ <AppForm
106
+ form={form}
107
+ layout="inline"
108
+ onSubmitMeta={(event) => event.nativeEvent.submitter?.dataset.action}
109
+ >
110
+ <PreventImplicitSubmit />
111
+
112
+ <GeneralSettingsErrorsOpenProvider form={form}>
113
+ <GeneralSettingsDialogHeader form={form} />
114
+ <GeneralSettingsDialogBody form={form} height={height} />
115
+ <GeneralSettingsDialogFooter form={form} onCancel={close} />
116
+ </GeneralSettingsErrorsOpenProvider>
117
+ </AppForm>
124
118
  );
125
119
  }
126
120
 
@@ -1,6 +1,6 @@
1
1
  import { Classes, Tab, Tabs as BPTabs } from '@blueprintjs/core';
2
2
  import styled from '@emotion/styled';
3
- import { useStore } from '@tanstack/react-form';
3
+ import { useSelector } from '@tanstack/react-store';
4
4
  import { withForm } from 'react-science/ui';
5
5
 
6
6
  import { StyledDialogBody } from '../../../elements/StyledDialogBody.js';
@@ -54,7 +54,7 @@ export const GeneralSettingsDialogBody = withForm({
54
54
  height: undefined as number | undefined,
55
55
  },
56
56
  render: function GeneralSettingsDialogBody({ height, form }) {
57
- const isExperimentalEnabled = useStore(
57
+ const isExperimentalEnabled = useSelector(
58
58
  form.store,
59
59
  (state) =>
60
60
  state.values.display.general?.experimentalFeatures?.display ?? false,
@@ -1,6 +1,6 @@
1
1
  import { Classes } from '@blueprintjs/core';
2
2
  import styled from '@emotion/styled';
3
- import { useStore } from '@tanstack/react-form';
3
+ import { useSelector } from '@tanstack/react-store';
4
4
  import { Button, withForm } from 'react-science/ui';
5
5
 
6
6
  import { useErrors } from './errors/context.tsx';
@@ -12,7 +12,7 @@ export const GeneralSettingsDialogHeader = withForm({
12
12
  defaultValues: defaultGeneralSettingsFormValues,
13
13
  render: function GeneralSettingsDialogHeader({ form }) {
14
14
  const { reset, store } = form;
15
- const formValues = useStore(store, (state) => state.values);
15
+ const formValues = useSelector(store, (state) => state.values);
16
16
 
17
17
  return (
18
18
  <DialogHeader className={Classes.DIALOG_HEADER}>
@@ -1,4 +1,4 @@
1
- import { useStore } from '@tanstack/react-form';
1
+ import { useSelector } from '@tanstack/react-store';
2
2
  import { withFieldGroup, withForm } from 'react-science/ui';
3
3
  import type { z } from 'zod';
4
4
 
@@ -9,7 +9,7 @@ import { defaultGeneralSettingsFormValues } from '../validation.ts';
9
9
  export const AutoProcessingTab = withForm({
10
10
  defaultValues: defaultGeneralSettingsFormValues,
11
11
  render: function Render({ form }) {
12
- const isExperimentalFeatures = useStore(
12
+ const isExperimentalFeatures = useSelector(
13
13
  form.store,
14
14
  (state) => state.values.display.general?.experimentalFeatures?.display,
15
15
  );
@@ -1,5 +1,5 @@
1
1
  import { Checkbox, Tag } from '@blueprintjs/core';
2
- import { useStore } from '@tanstack/react-form';
2
+ import { useSelector } from '@tanstack/react-store';
3
3
  import type { PageSizeName, Unit } from '@zakodium/nmrium-core';
4
4
  import { units } from '@zakodium/nmrium-core';
5
5
  import { memo, useMemo } from 'react';
@@ -77,7 +77,7 @@ function safeStringNumber(str: string, onInvalid: (str: string) => void) {
77
77
  export const ExportFields = withFieldGroup({
78
78
  defaultValues: defaultGeneralSettingsFormValues.export.png,
79
79
  render: function ExportFields({ group }) {
80
- const inputValues = useStore(group.store, (s) => s.values);
80
+ const inputValues = useSelector(group.store, (s) => s.values);
81
81
  const outputValues = useMemo(() => {
82
82
  return exportSettingsValidation.decode(inputValues);
83
83
  }, [inputValues]);
@@ -1,6 +1,7 @@
1
1
  import { Classes } from '@blueprintjs/core';
2
2
  import styled from '@emotion/styled';
3
- import { useField, useStore } from '@tanstack/react-form';
3
+ import { useField } from '@tanstack/react-form';
4
+ import { useSelector } from '@tanstack/react-store';
4
5
  import { useCallback, useMemo, useState } from 'react';
5
6
  import { FaRegTrashAlt } from 'react-icons/fa';
6
7
  import {
@@ -163,7 +164,7 @@ const TableFields = withForm({
163
164
  [setValue],
164
165
  );
165
166
 
166
- const fieldsData = useStore(store, (s) => s.value);
167
+ const fieldsData = useSelector(store, (s) => s.value);
167
168
 
168
169
  return (
169
170
  <TableSection
@@ -1,6 +1,7 @@
1
1
  import { Classes } from '@blueprintjs/core';
2
2
  import styled from '@emotion/styled';
3
- import { useField, useStore } from '@tanstack/react-form';
3
+ import { useField } from '@tanstack/react-form';
4
+ import { useSelector } from '@tanstack/react-store';
4
5
  import { useCallback, useMemo, useState } from 'react';
5
6
  import { FaRegTrashAlt } from 'react-icons/fa';
6
7
  import {
@@ -180,7 +181,7 @@ const TableFields = withForm({
180
181
 
181
182
  // It seems fields.setValue don't always trigger rerender
182
183
  // so fields.state.value can de-sync and cause weird behavior with DnD reorder.
183
- const fieldsData = useStore(store, (s) => s.value);
184
+ const fieldsData = useSelector(store, (s) => s.value);
184
185
 
185
186
  return (
186
187
  <TableSection
@@ -8,8 +8,10 @@ import {
8
8
  FaDownload,
9
9
  FaFileExport,
10
10
  FaFileImage,
11
+ FaMinusSquare,
11
12
  FaPaste,
12
13
  FaPlus,
14
+ FaPlusSquare,
13
15
  FaRegBookmark,
14
16
  FaRegTrashAlt,
15
17
  } from 'react-icons/fa';
@@ -112,6 +114,7 @@ const MOL_EXPORT_MENU: Array<ToolbarPopoverMenuItem<ExportDataItem>> = [
112
114
  },
113
115
  },
114
116
  ];
117
+
115
118
  interface MoleculePanelHeaderProps {
116
119
  currentIndex: number;
117
120
  molecules: StateMoleculeExtended[];
@@ -146,6 +149,9 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
146
149
  const { dialog, openDialog, closeDialog } = useDialogToggle({
147
150
  autoLabelDatabaseDialog: false,
148
151
  });
152
+ const { toggleAtomAnnotation, isActiveAnnotation, setAtomAnnotation } =
153
+ useMoleculeAnnotationCore(moleculeKey, moleculesView[moleculeKey]);
154
+
149
155
  const saveAsSVGHandler = useCallback(() => {
150
156
  if (!rootRef) return;
151
157
  exportAsSVG(`molSVG${currentIndex}`, {
@@ -318,6 +324,25 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
318
324
  payload: { id, label, molfile: molecule.toMolfileV3() },
319
325
  });
320
326
  }
327
+ function toggleProchirality(action: 'add' | 'remove') {
328
+ const molecule = molecules[currentIndex];
329
+
330
+ setAtomAnnotation('custom-labels');
331
+
332
+ if (!molecule) return;
333
+
334
+ const { id, label } = molecule;
335
+ if (action === 'add') {
336
+ topicMolecule[id].setProchiralHydrogenLabels();
337
+ } else {
338
+ topicMolecule[id].removeProchiralHydrogenLabels();
339
+ }
340
+
341
+ dispatch({
342
+ type: 'SET_MOLECULE',
343
+ payload: { id, label, molfile: topicMolecule[id].toMolfile() },
344
+ });
345
+ }
321
346
 
322
347
  function autoLabels() {
323
348
  const currentMolecule = molecules[currentIndex];
@@ -371,10 +396,18 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
371
396
  text: 'Template database',
372
397
  onClick: () => openDialog('autoLabelDatabaseDialog'),
373
398
  },
399
+ {
400
+ icon: <FaPlusSquare />,
401
+ text: 'Add prochirality',
402
+ onClick: () => toggleProchirality('add'),
403
+ },
404
+ {
405
+ icon: <FaMinusSquare />,
406
+ text: 'Remove prochirality',
407
+ onClick: () => toggleProchirality('remove'),
408
+ },
374
409
  ];
375
410
 
376
- const { handleChangeAtomAnnotation, isAnnotation } =
377
- useMoleculeAnnotationCore(moleculeKey, moleculesView[moleculeKey]);
378
411
  return (
379
412
  <PanelHeader
380
413
  onClickSettings={onClickPreferences}
@@ -422,23 +455,23 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
422
455
  )}
423
456
 
424
457
  <Toolbar.Item
425
- tooltip={`${booleanToString(!isAnnotation('atom-numbers'))} atom number`}
458
+ tooltip={`${booleanToString(!isActiveAnnotation('atom-numbers'))} atom number`}
426
459
  icon={<MdNumbers />}
427
- onClick={() => handleChangeAtomAnnotation('atom-numbers')}
428
- active={isAnnotation('atom-numbers')}
460
+ onClick={() => toggleAtomAnnotation('atom-numbers')}
461
+ active={isActiveAnnotation('atom-numbers')}
429
462
  disabled={!hasMolecules}
430
463
  />
431
464
  <Toolbar.Item
432
465
  tooltip={
433
466
  <TooltipHelpContent
434
- title={`${booleanToString(!isAnnotation('custom-labels'), { trueLabel: 'Display' })} custom atom labels`}
467
+ title={`${booleanToString(!isActiveAnnotation('custom-labels'), { trueLabel: 'Display' })} custom atom labels`}
435
468
  description="Custom atom labels can be displayed or hidden on the molecule structure"
436
469
  link="https://docs.nmrium.org/help/structure-labelling/"
437
470
  />
438
471
  }
439
472
  icon={<FaRegBookmark />}
440
- onClick={() => handleChangeAtomAnnotation('custom-labels')}
441
- active={isAnnotation('custom-labels')}
473
+ onClick={() => toggleAtomAnnotation('custom-labels')}
474
+ active={isActiveAnnotation('custom-labels')}
442
475
  disabled={!hasMolecules}
443
476
  />
444
477
  </>
@@ -111,14 +111,7 @@ function PeaksPanelInner(props: PeaksPanelInnerProps) {
111
111
  const filterPeaks = peaks.values.filter((peak) =>
112
112
  isInRange(peak.x, { from, to }),
113
113
  );
114
- if (filterPeaks.length <= 15) {
115
- dispatch({ type: 'OPTIMIZE_PEAKS', payload: { peaks: filterPeaks } });
116
- } else {
117
- toaster.show({
118
- message: 'optimization can be done on no more than 15 peaks',
119
- intent: 'danger',
120
- });
121
- }
114
+ dispatch({ type: 'OPTIMIZE_PEAKS', payload: { peaks: filterPeaks } });
122
115
  };
123
116
 
124
117
  function toggleViewProperty(key: keyof FilterType<PeaksViewState, boolean>) {
@@ -21,66 +21,66 @@ const formatFields: NucleusPreferenceField[] = [
21
21
  {
22
22
  id: 1,
23
23
  label: 'Serial number :',
24
- checkFieldName: 'showSerialNumber',
24
+ checkFieldName: 'tablePreferences.showSerialNumber',
25
25
  hideFormatField: true,
26
26
  },
27
27
  {
28
28
  id: 2,
29
29
  label: 'δ (ppm) :',
30
- checkFieldName: 'deltaPPM.show',
31
- formatFieldName: 'deltaPPM.format',
30
+ checkFieldName: 'tablePreferences.deltaPPM.show',
31
+ formatFieldName: 'tablePreferences.deltaPPM.format',
32
32
  },
33
33
  {
34
34
  id: 3,
35
35
  label: 'δ (Hz) :',
36
- checkFieldName: 'deltaHz.show',
37
- formatFieldName: 'deltaHz.format',
36
+ checkFieldName: 'tablePreferences.deltaHz.show',
37
+ formatFieldName: 'tablePreferences.deltaHz.format',
38
38
  },
39
39
  {
40
40
  id: 4,
41
41
  label: 'Peak Width (Hz)',
42
- checkFieldName: 'peakWidth.show',
43
- formatFieldName: 'peakWidth.format',
42
+ checkFieldName: 'tablePreferences.peakWidth.show',
43
+ formatFieldName: 'tablePreferences.peakWidth.format',
44
44
  },
45
45
  {
46
46
  id: 5,
47
47
  label: 'Intensity :',
48
- checkFieldName: 'intensity.show',
49
- formatFieldName: 'intensity.format',
48
+ checkFieldName: 'tablePreferences.intensity.show',
49
+ formatFieldName: 'tablePreferences.intensity.format',
50
50
  },
51
51
  {
52
52
  id: 6,
53
53
  label: 'kind :',
54
- checkFieldName: 'fwhm.show',
54
+ checkFieldName: 'tablePreferences.showKind',
55
55
  },
56
56
  {
57
57
  id: 7,
58
58
  label: 'fwhm :',
59
- checkFieldName: 'fwhm.show',
60
- formatFieldName: 'fwhm.format',
59
+ checkFieldName: 'tablePreferences.fwhm.show',
60
+ formatFieldName: 'tablePreferences.fwhm.format',
61
61
  },
62
62
  {
63
63
  id: 8,
64
64
  label: 'mu :',
65
- checkFieldName: 'mu.show',
66
- formatFieldName: 'mu.format',
65
+ checkFieldName: 'tablePreferences.mu.show',
66
+ formatFieldName: 'tablePreferences.mu.format',
67
67
  },
68
68
  {
69
69
  id: 11,
70
70
  label: 'gamma :',
71
- checkFieldName: 'gamma.show',
72
- formatFieldName: 'gamma.format',
71
+ checkFieldName: 'tablePreferences.gamma.show',
72
+ formatFieldName: 'tablePreferences.gamma.format',
73
73
  },
74
74
  {
75
75
  id: 9,
76
76
  label: 'Delete action :',
77
- checkFieldName: 'showDeleteAction',
77
+ checkFieldName: 'tablePreferences.showDeleteAction',
78
78
  hideFormatField: true,
79
79
  },
80
80
  {
81
81
  id: 10,
82
82
  label: 'Edit peak shape action :',
83
- checkFieldName: 'showEditPeakShapeAction',
83
+ checkFieldName: 'tablePreferences.showEditPeakShapeAction',
84
84
  hideFormatField: true,
85
85
  },
86
86
  ];
@@ -20,7 +20,7 @@ import type { PeakRecord } from './PeaksPanel.js';
20
20
 
21
21
  export function usePeaksTableColumns(activeTab: string) {
22
22
  const dispatch = useDispatch();
23
- const peaksPreferences = usePanelPreferences('peaks', activeTab);
23
+ const { tablePreferences } = usePanelPreferences('peaks', activeTab);
24
24
  const [peak, setEditedPeak] = useState<Peak1D | undefined>();
25
25
 
26
26
  const deletePeakHandler = useCallback(
@@ -64,7 +64,7 @@ export function usePeaksTableColumns(activeTab: string) {
64
64
  <EditableColumn
65
65
  value={formatNumber(
66
66
  row.original.x,
67
- peaksPreferences.deltaPPM.format,
67
+ tablePreferences.deltaPPM.format,
68
68
  )}
69
69
  onSave={(value) => saveDeltaPPMRefsHandler(value, row.original)}
70
70
  type="number"
@@ -78,7 +78,7 @@ export function usePeaksTableColumns(activeTab: string) {
78
78
  Header: 'δ (Hz)',
79
79
  accessor: 'xHz',
80
80
  Cell: ({ row }: CellProps<PeakRecord>) =>
81
- formatNumber(row.original.xHz, peaksPreferences.deltaHz.format),
81
+ formatNumber(row.original.xHz, tablePreferences.deltaHz.format),
82
82
  },
83
83
  {
84
84
  showWhen: 'intensity.show',
@@ -87,7 +87,7 @@ export function usePeaksTableColumns(activeTab: string) {
87
87
  style: { maxWidth: '80px' },
88
88
  accessor: 'y',
89
89
  Cell: ({ row }: CellProps<PeakRecord>) =>
90
- formatNumber(row.original.y, peaksPreferences.intensity.format),
90
+ formatNumber(row.original.y, tablePreferences.intensity.format),
91
91
  },
92
92
  {
93
93
  showWhen: 'peakWidth.show',
@@ -95,7 +95,7 @@ export function usePeaksTableColumns(activeTab: string) {
95
95
  Header: 'Width (Hz)',
96
96
  accessor: 'width',
97
97
  Cell: ({ row }: CellProps<PeakRecord>) =>
98
- formatNumber(row.original.width, peaksPreferences.peakWidth.format),
98
+ formatNumber(row.original.width, tablePreferences.peakWidth.format),
99
99
  },
100
100
  {
101
101
  showWhen: 'showKind',
@@ -110,10 +110,10 @@ export function usePeaksTableColumns(activeTab: string) {
110
110
  accessor: (row) => row?.shape?.fwhm || '',
111
111
  Cell: ({ row }: CellProps<PeakRecord>) => {
112
112
  const fwhm = row.original?.shape?.fwhm;
113
- if (fwhm) {
114
- return formatNumber(fwhm, peaksPreferences.fwhm.format);
113
+ if (typeof fwhm !== 'number') {
114
+ return '';
115
115
  }
116
- return '';
116
+ return formatNumber(fwhm, tablePreferences.fwhm.format);
117
117
  },
118
118
  },
119
119
  {
@@ -126,10 +126,10 @@ export function usePeaksTableColumns(activeTab: string) {
126
126
  const mu =
127
127
  row.original?.shape?.kind === 'pseudoVoigt' &&
128
128
  row.original?.shape?.mu;
129
- if (mu) {
130
- return formatNumber(mu, peaksPreferences.mu.format);
129
+ if (typeof mu !== 'number') {
130
+ return '';
131
131
  }
132
- return '';
132
+ return formatNumber(mu, tablePreferences.mu.format);
133
133
  },
134
134
  },
135
135
  {
@@ -143,10 +143,12 @@ export function usePeaksTableColumns(activeTab: string) {
143
143
  const gamma =
144
144
  row.original?.shape?.kind === 'generalizedLorentzian' &&
145
145
  row.original?.shape?.gamma;
146
- if (gamma) {
147
- return formatNumber(gamma, peaksPreferences.gamma.format);
146
+
147
+ if (typeof gamma !== 'number') {
148
+ return '';
148
149
  }
149
- return '';
150
+
151
+ return formatNumber(gamma, tablePreferences.gamma.format);
150
152
  },
151
153
  },
152
154
  {
@@ -170,7 +172,7 @@ export function usePeaksTableColumns(activeTab: string) {
170
172
  },
171
173
  ],
172
174
  [
173
- peaksPreferences,
175
+ tablePreferences,
174
176
  saveDeltaPPMRefsHandler,
175
177
  deletePeakHandler,
176
178
  editPeakHandler,
@@ -181,14 +183,14 @@ export function usePeaksTableColumns(activeTab: string) {
181
183
  const columns: Array<ControlCustomColumn<PeakRecord>> = [];
182
184
  for (const col of COLUMNS) {
183
185
  const { showWhen, ...colParams } = col;
184
- if (dlv(peaksPreferences, showWhen)) {
186
+ if (dlv(tablePreferences, showWhen)) {
185
187
  addCustomColumn(columns, colParams);
186
188
  }
187
189
  }
188
190
 
189
191
  columns.sort((object1, object2) => object1.index - object2.index);
190
192
  return columns;
191
- }, [COLUMNS, peaksPreferences]);
193
+ }, [COLUMNS, tablePreferences]);
192
194
 
193
195
  return { tableColumns, peak, setEditedPeak };
194
196
  }
@@ -40,8 +40,7 @@ interface ExportData {
40
40
  id: ExportRangesType;
41
41
  }
42
42
  type ExportItem =
43
- | ToolbarPopoverMenuItem<ExportData>
44
- | ToolbarPopoverMenuDivider;
43
+ ToolbarPopoverMenuItem<ExportData> | ToolbarPopoverMenuDivider;
45
44
 
46
45
  const EXPORT_MENU: ExportItem[] = [
47
46
  {
@@ -1,7 +1,7 @@
1
1
  import type { Info1D, Range, Ranges } from '@zakodium/nmr-types';
2
2
  import type {
3
3
  Spectrum1D,
4
- WorkSpacePanelPreferences,
4
+ WorkspacePanelPreferences,
5
5
  } from '@zakodium/nmrium-core';
6
6
  import type { NmrData1D } from 'cheminfo-types';
7
7
  import { xGetFromToIndex } from 'ml-spectra-processing';
@@ -37,7 +37,7 @@ interface RangesTablePanelInnerProps {
37
37
  info: Info1D;
38
38
  xDomain: number[];
39
39
  activeTab: string;
40
- preferences: WorkSpacePanelPreferences['ranges'];
40
+ preferences: WorkspacePanelPreferences['ranges'];
41
41
  }
42
42
 
43
43
  export interface RangesTableDataMetaInfo {
@@ -18,91 +18,91 @@ const formatFields: NucleusPreferenceField[] = [
18
18
  {
19
19
  id: 1,
20
20
  label: 'Serial number :',
21
- checkFieldName: 'showSerialNumber',
21
+ checkFieldName: 'tablePreferences.showSerialNumber',
22
22
  hideFormatField: true,
23
23
  },
24
24
  {
25
25
  id: 2,
26
26
  label: 'Assignment label :',
27
- checkFieldName: 'showAssignmentLabel',
27
+ checkFieldName: 'tablePreferences.showAssignmentLabel',
28
28
  hideFormatField: true,
29
29
  },
30
30
  {
31
31
  id: 3,
32
32
  label: 'From (ppm) :',
33
- checkFieldName: 'from.show',
34
- formatFieldName: 'from.format',
33
+ checkFieldName: 'tablePreferences.from.show',
34
+ formatFieldName: 'tablePreferences.from.format',
35
35
  },
36
36
  {
37
37
  id: 4,
38
38
  label: 'To (ppm) :',
39
- checkFieldName: 'to.show',
40
- formatFieldName: 'to.format',
39
+ checkFieldName: 'tablePreferences.to.show',
40
+ formatFieldName: 'tablePreferences.to.format',
41
41
  },
42
42
  {
43
43
  id: 5,
44
44
  label: 'Absolute integration :',
45
- checkFieldName: 'absolute.show',
46
- formatFieldName: 'absolute.format',
45
+ checkFieldName: 'tablePreferences.absolute.show',
46
+ formatFieldName: 'tablePreferences.absolute.format',
47
47
  },
48
48
  {
49
49
  id: 6,
50
50
  label: 'Relative integration :',
51
- checkFieldName: 'relative.show',
52
- formatFieldName: 'relative.format',
51
+ checkFieldName: 'tablePreferences.relative.show',
52
+ formatFieldName: 'tablePreferences.relative.format',
53
53
  },
54
54
  {
55
55
  id: 7,
56
56
  label: 'δ (ppm) :',
57
- checkFieldName: 'deltaPPM.show',
58
- formatFieldName: 'deltaPPM.format',
57
+ checkFieldName: 'tablePreferences.deltaPPM.show',
58
+ formatFieldName: 'tablePreferences.deltaPPM.format',
59
59
  },
60
60
  {
61
61
  id: 8,
62
62
  label: 'δ (Hz) :',
63
- checkFieldName: 'deltaHz.show',
64
- formatFieldName: 'deltaHz.format',
63
+ checkFieldName: 'tablePreferences.deltaHz.show',
64
+ formatFieldName: 'tablePreferences.deltaHz.format',
65
65
  },
66
66
  {
67
67
  id: 9,
68
68
  label: 'Coupling (Hz) :',
69
- checkFieldName: 'coupling.show',
70
- formatFieldName: 'coupling.format',
69
+ checkFieldName: 'tablePreferences.coupling.show',
70
+ formatFieldName: 'tablePreferences.coupling.format',
71
71
  },
72
72
  {
73
73
  id: 10,
74
74
  label: 'Kind :',
75
- checkFieldName: 'showKind',
75
+ checkFieldName: 'tablePreferences.showKind',
76
76
  hideFormatField: true,
77
77
  },
78
78
  {
79
79
  id: 11,
80
80
  label: 'Multiplicity :',
81
- checkFieldName: 'showMultiplicity',
81
+ checkFieldName: 'tablePreferences.showMultiplicity',
82
82
  hideFormatField: true,
83
83
  },
84
84
  {
85
85
  id: 12,
86
86
  label: 'Assignment links :',
87
- checkFieldName: 'showAssignment',
87
+ checkFieldName: 'tablePreferences.showAssignment',
88
88
  hideFormatField: true,
89
89
  },
90
90
  {
91
91
  id: 13,
92
92
  label: 'Delete action :',
93
- checkFieldName: 'showDeleteAction',
93
+ checkFieldName: 'tablePreferences.showDeleteAction',
94
94
  hideFormatField: true,
95
95
  },
96
96
  {
97
97
  id: 14,
98
98
  label: 'Zoom action :',
99
- checkFieldName: 'showZoomAction',
99
+ checkFieldName: 'tablePreferences.showZoomAction',
100
100
  hideFormatField: true,
101
101
  },
102
102
  {
103
103
  id: 15,
104
104
  label: 'Edit action :',
105
- checkFieldName: 'showEditAction',
105
+ checkFieldName: 'tablePreferences.showEditAction',
106
106
  hideFormatField: true,
107
107
  },
108
108
  ];