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
@@ -0,0 +1,529 @@
1
+ import styled from '@emotion/styled';
2
+ import type { Info1D, Range, Ranges, Signal1D } from '@zakodium/nmr-types';
3
+ import type {
4
+ BaseRangesTablePreferences,
5
+ BoundingBox,
6
+ FloatingRangesTablePreferences,
7
+ } from '@zakodium/nmrium-core';
8
+ import { checkMultiplicity } from 'nmr-processing';
9
+ import { memo, useEffect, useMemo, useState } from 'react';
10
+ import { BsArrowsMove } from 'react-icons/bs';
11
+ import { FaCog, FaLink, FaTimes } from 'react-icons/fa';
12
+ import { Rnd } from 'react-rnd';
13
+
14
+ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.js';
15
+ import { isSignalRange } from '../../../data/utilities/RangeUtilities.js';
16
+ import type { SVGTableColumn } from '../../SVGTable.js';
17
+ import { SVGTable } from '../../SVGTable.js';
18
+ import { useChartData } from '../../context/ChartContext.js';
19
+ import { useDispatch } from '../../context/DispatchContext.js';
20
+ import { useGlobal } from '../../context/GlobalContext.js';
21
+ import type { ActionsButtonsPopoverProps } from '../../elements/ActionsButtonsPopover.js';
22
+ import { ActionsButtonsPopover } from '../../elements/ActionsButtonsPopover.js';
23
+ import { useActiveNucleusTab } from '../../hooks/useActiveNucleusTab.js';
24
+ import { useDialogToggle } from '../../hooks/useDialogToggle.ts';
25
+ import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
26
+ import { useSVGUnitConverter } from '../../hooks/useSVGUnitConverter.js';
27
+ import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus.js';
28
+ import { useCheckExportStatus } from '../../hooks/useViewportSize.js';
29
+ import { extractChemicalElement } from '../../utility/extractChemicalElement.js';
30
+ import { formatNumber } from '../../utility/formatNumber.js';
31
+
32
+ import { FloatingRangeTablePreferencesModal } from './FloatingRangeTablePreferencesModal.tsx';
33
+
34
+ const ReactRnd = styled(Rnd)`
35
+ border: 1px solid transparent;
36
+
37
+ :hover {
38
+ background-color: white;
39
+ border: 1px solid #ebecf1;
40
+
41
+ button {
42
+ visibility: visible;
43
+ }
44
+ }
45
+ `;
46
+ interface SpectrumRangesInfo {
47
+ ranges: Ranges['values'];
48
+ info: Info1D;
49
+ }
50
+
51
+ interface RangesTableProps {
52
+ data: SpectrumRangesInfo;
53
+ }
54
+
55
+ interface RangeItem {
56
+ id: string;
57
+ delta: string;
58
+ deltaHz: string;
59
+ multiplicity: string;
60
+ integration: string;
61
+ coupling: string;
62
+ from: string;
63
+ to: string;
64
+ absolute: string;
65
+ kind: string;
66
+ assignment: string;
67
+ nbAssignment: string;
68
+ }
69
+
70
+ function buildRangeBaseItem(
71
+ range: Range,
72
+ info: Info1D,
73
+ preferences: FloatingRangesTablePreferences,
74
+ ) {
75
+ const { id, from, to, integration, absolute } = range;
76
+ const formatHz = preferences.deltaHz.format;
77
+ return {
78
+ id,
79
+ from: formatNumber(from, preferences.from.format),
80
+ to: formatNumber(to, preferences.to.format),
81
+ absolute: formatNumber(absolute, preferences.absolute.format),
82
+ integration: isSignalRange(range)
83
+ ? formatNumber(integration, preferences.relative.format)
84
+ : `[ ${formatNumber(integration, preferences.relative.format)} ]`,
85
+ deltaText: `${formatNumber(from, preferences.from.format)} - ${formatNumber(to, preferences.to.format)}`,
86
+ deltaHzText: `${formatNumber(from * info.originFrequency, formatHz)} - ${formatNumber(to * info.originFrequency, formatHz)}`,
87
+ formatHz,
88
+ };
89
+ }
90
+
91
+ function buildSignalItem(
92
+ signal: Signal1D,
93
+ base: ReturnType<typeof buildRangeBaseItem>,
94
+ info: Info1D,
95
+ preferences: FloatingRangesTablePreferences,
96
+ ): RangeItem {
97
+ const {
98
+ multiplicity,
99
+ delta,
100
+ kind = '',
101
+ assignment = '',
102
+ js = [],
103
+ diaIDs,
104
+ } = signal;
105
+ const isNotMultiplet = !checkMultiplicity(multiplicity, ['m']);
106
+ return {
107
+ id: base.id,
108
+ from: base.from,
109
+ to: base.to,
110
+ absolute: base.absolute,
111
+ integration: base.integration,
112
+ multiplicity,
113
+ kind,
114
+ assignment,
115
+ coupling: js
116
+ .map((j) =>
117
+ !Number.isNaN(j.coupling)
118
+ ? formatNumber(j.coupling, preferences.coupling.format)
119
+ : '',
120
+ )
121
+ .join(','),
122
+ delta: isNotMultiplet
123
+ ? base.deltaText
124
+ : formatNumber(delta, preferences.deltaPPM.format),
125
+ deltaHz: isNotMultiplet
126
+ ? base.deltaHzText
127
+ : info?.originFrequency
128
+ ? formatNumber(delta * info.originFrequency, base.formatHz)
129
+ : '',
130
+ nbAssignment: diaIDs?.length ? String(diaIDs.length) : '',
131
+ };
132
+ }
133
+
134
+ function useMapRanges(data: SpectrumRangesInfo): RangeItem[] {
135
+ const { ranges, info } = data;
136
+ const activeTab = useActiveNucleusTab();
137
+ const { floatingTablePreferences: preferences } = usePanelPreferences(
138
+ 'ranges',
139
+ activeTab,
140
+ );
141
+
142
+ return ranges.flatMap((range) => {
143
+ const base = buildRangeBaseItem(range, info, preferences);
144
+ const { signals = [] } = range;
145
+
146
+ if (signals.length === 0) {
147
+ return [
148
+ {
149
+ ...base,
150
+ delta: base.deltaText,
151
+ deltaHz: '',
152
+ multiplicity: 'm',
153
+ coupling: '',
154
+ kind: '',
155
+ assignment: '',
156
+ nbAssignment: '',
157
+ },
158
+ ];
159
+ }
160
+
161
+ const result = signals.map((signal) =>
162
+ buildSignalItem(signal, base, info, preferences),
163
+ );
164
+ if (preferences.signalKinds.length === 0) {
165
+ return result;
166
+ }
167
+
168
+ return result.filter((signal) =>
169
+ preferences.signalKinds.includes(signal.kind || ''),
170
+ );
171
+ });
172
+ }
173
+
174
+ function isColumnVisible(
175
+ pref: BaseRangesTablePreferences[keyof BaseRangesTablePreferences],
176
+ ): boolean {
177
+ if (typeof pref === 'boolean') return pref;
178
+ return pref?.show;
179
+ }
180
+
181
+ function InnerSVGRangesTable(props: RangesTableProps) {
182
+ const { data } = props;
183
+ const {
184
+ view: {
185
+ spectra: { activeTab },
186
+ },
187
+ } = useChartData();
188
+ const rangesData = useMapRanges(data);
189
+ const { floatingTablePreferences } = usePanelPreferences('ranges', activeTab);
190
+
191
+ const element = extractChemicalElement(activeTab);
192
+
193
+ const columns = useMemo((): Array<SVGTableColumn<RangeItem>> => {
194
+ const allColumns: Array<
195
+ { prefKey: keyof BaseRangesTablePreferences } & SVGTableColumn<RangeItem>
196
+ > = [
197
+ {
198
+ prefKey: 'showSerialNumber',
199
+ accessorFun: (row) => row.index + 1,
200
+ header: '#',
201
+ width: 40,
202
+ },
203
+ {
204
+ prefKey: 'showAssignmentLabel',
205
+ accessorKey: 'assignment',
206
+ header: 'Assignment',
207
+ width: 120,
208
+ },
209
+ {
210
+ prefKey: 'deltaPPM',
211
+ accessorKey: 'delta',
212
+ header: 'δ (ppm)',
213
+ width: 100,
214
+ rowSpanGroupKey: 'id',
215
+ },
216
+ {
217
+ prefKey: 'deltaHz',
218
+ accessorKey: 'deltaHz',
219
+ header: 'δ (Hz)',
220
+ width: 110,
221
+ rowSpanGroupKey: 'id',
222
+ },
223
+ {
224
+ prefKey: 'from',
225
+ accessorKey: 'from',
226
+ header: `From`,
227
+ width: 60,
228
+ },
229
+ {
230
+ prefKey: 'to',
231
+ accessorKey: 'to',
232
+ header: `To`,
233
+ width: 60,
234
+ },
235
+ {
236
+ prefKey: 'relative',
237
+ accessorKey: 'integration',
238
+ header: `Rel. ${element}`,
239
+ width: 60,
240
+ rowSpanGroupKey: 'id',
241
+ },
242
+ {
243
+ prefKey: 'absolute',
244
+ accessorKey: 'absolute',
245
+ header: 'Absolute',
246
+ width: 80,
247
+ rowSpanGroupKey: 'id',
248
+ },
249
+ {
250
+ prefKey: 'showMultiplicity',
251
+ accessorKey: 'multiplicity',
252
+ header: 'Mult.',
253
+ width: 60,
254
+ rowSpanGroupKey: 'id',
255
+ },
256
+ {
257
+ prefKey: 'coupling',
258
+ accessorKey: 'coupling',
259
+ header: 'J (Hz)',
260
+ width: 120,
261
+ },
262
+
263
+ {
264
+ prefKey: 'showAssignment',
265
+ accessorKey: 'nbAssignment',
266
+ header: <FaLink x="15px" y="8px" style={{ fontSize: 10 }} />,
267
+ width: 40,
268
+ },
269
+ {
270
+ prefKey: 'showKind',
271
+ accessorKey: 'kind',
272
+ header: 'Kind',
273
+ width: 120,
274
+ },
275
+ ];
276
+
277
+ return allColumns
278
+ .filter(({ prefKey }) =>
279
+ isColumnVisible(floatingTablePreferences[prefKey]),
280
+ )
281
+ .map(({ prefKey: _, ...col }) => ({
282
+ ...col,
283
+ headerTextProps: { fontWeight: 'bold' },
284
+ cellBoxProps: { stroke: '#dedede', fill: 'white', fillOpacity: 0.8 },
285
+ headerBoxProps: { stroke: '#dedede', fill: '#E5E8EB' },
286
+ }));
287
+ }, [floatingTablePreferences, element]);
288
+ if (!data) return null;
289
+
290
+ return <SVGTable<RangeItem> data={rangesData} columns={columns} />;
291
+ }
292
+
293
+ const SVGRangesTable = memo(InnerSVGRangesTable);
294
+
295
+ interface DraggablePublicationStringProps {
296
+ data: SpectrumRangesInfo | undefined;
297
+ bonding: BoundingBox;
298
+ spectrumKey: string;
299
+ }
300
+
301
+ function DraggableRanges(props: DraggablePublicationStringProps) {
302
+ const { data, bonding: externalBounding, spectrumKey } = props;
303
+ const dispatch = useDispatch();
304
+ const { viewerRef } = useGlobal();
305
+ const [bounding, setBounding] = useState<BoundingBox>(externalBounding);
306
+ const [isMoveActive, setIsMoveActive] = useState(false);
307
+ const { percentToPixel, pixelToPercent } = useSVGUnitConverter();
308
+ const isExportProcessStart = useCheckExportStatus();
309
+ const { dialog, closeDialog, openDialog } = useDialogToggle({
310
+ settingModal: false,
311
+ });
312
+
313
+ useEffect(() => {
314
+ setBounding({ ...externalBounding });
315
+ }, [externalBounding]);
316
+
317
+ function handleResize(
318
+ internalBounding: Pick<BoundingBox, 'height' | 'width'>,
319
+ ) {
320
+ const { width = 0, height = 0 } = convertToPixel(externalBounding);
321
+ internalBounding.width += width;
322
+ internalBounding.height += height;
323
+ setBounding((prevBounding) => ({
324
+ ...prevBounding,
325
+ ...convertToPercent(internalBounding),
326
+ }));
327
+ }
328
+
329
+ function handleDrag(internalBounding: Pick<BoundingBox, 'x' | 'y'>) {
330
+ setBounding((prevBounding) => ({
331
+ ...prevBounding,
332
+ ...convertToPercent(internalBounding),
333
+ }));
334
+ }
335
+ function handleChangeInsetBounding(bounding: Partial<BoundingBox>) {
336
+ if (
337
+ typeof bounding?.width === 'number' &&
338
+ typeof bounding?.height === 'number'
339
+ ) {
340
+ const { width, height } = externalBounding;
341
+ bounding.width += width;
342
+ bounding.height += height;
343
+ }
344
+
345
+ dispatch({
346
+ type: 'CHANGE_RANGES_VIEW_FLOATING_BOX_BOUNDING',
347
+ payload: {
348
+ spectrumKey,
349
+ bounding: convertToPercent(bounding),
350
+ target: 'rangesBounding',
351
+ },
352
+ });
353
+ }
354
+
355
+ function convertToPixel(bounding: Partial<BoundingBox>) {
356
+ const { x, y, height, width } = bounding;
357
+ const output: Partial<BoundingBox> = {};
358
+
359
+ if (x) {
360
+ output.x = percentToPixel(x, 'x');
361
+ }
362
+ if (y) {
363
+ output.y = percentToPixel(y, 'y');
364
+ }
365
+ if (width) {
366
+ output.width = width;
367
+ }
368
+ if (height) {
369
+ output.height = height;
370
+ }
371
+
372
+ return output;
373
+ }
374
+ function convertToPercent(bounding: Partial<BoundingBox>) {
375
+ const { x, y, height, width } = bounding;
376
+ const output: Partial<BoundingBox> = {};
377
+
378
+ if (x) {
379
+ output.x = pixelToPercent(x, 'x');
380
+ }
381
+ if (y) {
382
+ output.y = pixelToPercent(y, 'y');
383
+ }
384
+ if (width) {
385
+ output.width = width;
386
+ }
387
+ if (height) {
388
+ output.height = height;
389
+ }
390
+
391
+ return output;
392
+ }
393
+
394
+ function handleRemove() {
395
+ dispatch({
396
+ type: 'TOGGLE_RANGES_VIEW_PROPERTY',
397
+ payload: { key: 'showRanges', spectrumKey },
398
+ });
399
+ }
400
+
401
+ const actionButtons: ActionsButtonsPopoverProps['buttons'] = [
402
+ {
403
+ icon: <BsArrowsMove />,
404
+ intent: 'none',
405
+ title: 'Move ranges table',
406
+ style: { cursor: 'move' },
407
+ className: 'handle',
408
+ },
409
+ {
410
+ icon: <FaCog />,
411
+ intent: 'none',
412
+ title: 'Table preferences',
413
+ onClick: () => {
414
+ openDialog('settingModal');
415
+ },
416
+ },
417
+ {
418
+ icon: <FaTimes />,
419
+ intent: 'danger',
420
+ title: 'Hide ranges table',
421
+ onClick: handleRemove,
422
+ },
423
+ ];
424
+ if (!viewerRef || !data || data?.ranges?.length === 0) return null;
425
+
426
+ const { x: xInPercent, y: yInPercent } = bounding;
427
+
428
+ const x = percentToPixel(xInPercent, 'x');
429
+ const y = percentToPixel(yInPercent, 'y');
430
+
431
+ if (isExportProcessStart) {
432
+ return (
433
+ <g transform={`translate(${x} ${y})`}>
434
+ <SVGRangesTable data={data} />
435
+ </g>
436
+ );
437
+ }
438
+
439
+ return (
440
+ <>
441
+ <FloatingRangeTablePreferencesModal
442
+ isOpen={dialog.settingModal}
443
+ onCloseDialog={closeDialog}
444
+ />
445
+ <ReactRnd
446
+ default={{ x, y, width: 'auto', height: 'auto' }}
447
+ position={{ x, y }}
448
+ enableResizing={false}
449
+ minWidth={100}
450
+ minHeight={50}
451
+ dragHandleClassName="handle"
452
+ enableUserSelectHack={false}
453
+ bounds={`#${viewerRef.id}`}
454
+ onDragStart={() => setIsMoveActive(true)}
455
+ onResize={(e, dir, eRef, size, position) =>
456
+ handleResize({ ...size, ...position })
457
+ }
458
+ onResizeStop={(e, dir, eRef, size, position) =>
459
+ handleChangeInsetBounding({ ...size, ...position })
460
+ }
461
+ onDrag={(e, { x, y }) => {
462
+ handleDrag({ x, y });
463
+ }}
464
+ onDragStop={(e, { x, y }) => {
465
+ handleChangeInsetBounding({ x, y });
466
+ setIsMoveActive(false);
467
+ }}
468
+ resizeHandleWrapperStyle={{ backgroundColor: 'white' }}
469
+ >
470
+ <ActionsButtonsPopover
471
+ buttons={actionButtons}
472
+ fill
473
+ positioningStrategy="fixed"
474
+ direction="row"
475
+ targetProps={{ style: { width: '100%', height: '100%' } }}
476
+ space={2}
477
+ {...(isMoveActive && { isOpen: true })}
478
+ x={x}
479
+ y={y}
480
+ >
481
+ <SVGRangesTable data={data} />
482
+ </ActionsButtonsPopover>
483
+ </ReactRnd>
484
+ </>
485
+ );
486
+ }
487
+
488
+ function useSpectraRanges() {
489
+ const spectra = useSpectraByActiveNucleus();
490
+ const output: Record<string, { ranges: Ranges['values']; info: Info1D }> = {};
491
+
492
+ for (const spectrum of spectra) {
493
+ if (!isSpectrum1D(spectrum)) {
494
+ continue;
495
+ }
496
+ const { id: spectrumKey, ranges, info } = spectrum;
497
+
498
+ if (!Array.isArray(ranges?.values) || ranges.values.length === 0) {
499
+ continue;
500
+ }
501
+
502
+ output[spectrumKey] = { ranges: ranges.values, info };
503
+ }
504
+
505
+ return output;
506
+ }
507
+
508
+ export function FloatingRanges() {
509
+ const spectraRanges = useSpectraRanges();
510
+ const {
511
+ view: { ranges },
512
+ } = useChartData();
513
+
514
+ const options = Object.entries(ranges);
515
+
516
+ return options.map(([spectrumKey, viewOptions]) => {
517
+ const { showRanges, rangesBounding } = viewOptions;
518
+ if (!showRanges) return null;
519
+
520
+ return (
521
+ <DraggableRanges
522
+ key={spectrumKey}
523
+ spectrumKey={spectrumKey}
524
+ bonding={rangesBounding}
525
+ data={spectraRanges[spectrumKey]}
526
+ />
527
+ );
528
+ });
529
+ }
@@ -100,7 +100,7 @@ export default function Ranges() {
100
100
  toolOptions: { selectedTool },
101
101
  } = useChartData();
102
102
  const spectrum = useSpectrum(emptyData) as Spectrum1D;
103
- const rangesPreferences = usePanelPreferences('ranges', activeTab);
103
+ const { tablePreferences } = usePanelPreferences('ranges', activeTab);
104
104
 
105
105
  if (
106
106
  !spectrum.ranges?.values ||
@@ -114,7 +114,7 @@ export default function Ranges() {
114
114
  <MemoizedRanges
115
115
  ranges={spectrum.ranges}
116
116
  selectedTool={selectedTool}
117
- relativeFormat={rangesPreferences.relative.format}
117
+ relativeFormat={tablePreferences.relative.format}
118
118
  />
119
119
  );
120
120
  }
@@ -1,5 +1,5 @@
1
- import type { PopoverProps } from '@blueprintjs/core';
2
- import { Popover } from '@blueprintjs/core';
1
+ import type { PopoverNextProps } from '@blueprintjs/core';
2
+ import { PopoverNext } from '@blueprintjs/core';
3
3
  import styled from '@emotion/styled';
4
4
  import { yupResolver } from '@hookform/resolvers/yup';
5
5
  import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';
@@ -10,7 +10,7 @@ import * as Yup from 'yup';
10
10
  import { Input2Controller } from '../elements/Input2Controller.js';
11
11
  import { NumberInput2Controller } from '../elements/NumberInput2Controller.js';
12
12
 
13
- const StyledPopover = styled(Popover)`
13
+ const StyledPopover = styled(PopoverNext)`
14
14
  .field-edition-popover {
15
15
  border-radius: 5px;
16
16
  }
@@ -25,7 +25,7 @@ interface FieldProps {
25
25
  }
26
26
  interface FieldEditionsProps extends FieldProps {
27
27
  children: ReactNode;
28
- PopoverProps?: PopoverProps;
28
+ PopoverProps?: PopoverNextProps;
29
29
  }
30
30
  const InputDimension = { height: 28, width: 100 };
31
31
 
@@ -101,8 +101,8 @@ export function DraggableStructure(props: DraggableStructureProps) {
101
101
  }
102
102
 
103
103
  const {
104
- handleChangeAtomAnnotation,
105
- isAnnotation,
104
+ toggleAtomAnnotation,
105
+ isActiveAnnotation,
106
106
  handleToggleMoleculeLabel,
107
107
  } = useMoleculeAnnotationCore(molecule.id, moleculeView);
108
108
 
@@ -136,15 +136,15 @@ export function DraggableStructure(props: DraggableStructureProps) {
136
136
  },
137
137
  {
138
138
  icon: <MdNumbers />,
139
- title: `${booleanToString(!isAnnotation('atom-numbers'))} atom number`,
140
- onClick: () => handleChangeAtomAnnotation('atom-numbers'),
141
- active: isAnnotation('atom-numbers'),
139
+ title: `${booleanToString(!isActiveAnnotation('atom-numbers'))} atom number`,
140
+ onClick: () => toggleAtomAnnotation('atom-numbers'),
141
+ active: isActiveAnnotation('atom-numbers'),
142
142
  },
143
143
  {
144
144
  icon: <FaRegBookmark />,
145
- title: `${booleanToString(!isAnnotation('custom-labels'))} custom labels`,
146
- onClick: () => handleChangeAtomAnnotation('custom-labels'),
147
- active: isAnnotation('custom-labels'),
145
+ title: `${booleanToString(!isActiveAnnotation('custom-labels'))} custom labels`,
146
+ onClick: () => toggleAtomAnnotation('custom-labels'),
147
+ active: isActiveAnnotation('custom-labels'),
148
148
  },
149
149
  ];
150
150
  const { x: xInPercent, y: yInPercent, width, height } = bounding;
@@ -146,14 +146,6 @@ export default function BrushXY(props: BrushXYProps) {
146
146
  },
147
147
  );
148
148
 
149
- const scaleX = axis === 'X' || axis === 'XY' ? brush.scaleX : 1;
150
- const scaleY = axis === 'Y' || axis === 'XY' ? brush.scaleY : 1;
151
-
152
- startX = axis === 'Y' ? margin.left : brush.startX || margin.left;
153
- startY = axis === 'X' ? margin.top : brush.startY || margin.top;
154
- endX = axis === 'Y' ? finalWidth : brush.endX || finalWidth;
155
- endY = axis === 'X' ? finalHeight : brush.endY || finalHeight;
156
-
157
149
  let y1;
158
150
  let x1;
159
151
 
@@ -168,6 +160,14 @@ export default function BrushXY(props: BrushXYProps) {
168
160
  x1 = Math.round((endX + startX) / 2);
169
161
  }
170
162
 
163
+ const scaleX = axis === 'X' || axis === 'XY' ? brush.scaleX : 1;
164
+ const scaleY = axis === 'Y' || axis === 'XY' ? brush.scaleY : 1;
165
+
166
+ startX = axis === 'Y' ? margin.left : brush.startX || margin.left;
167
+ startY = axis === 'X' ? margin.top : brush.startY || margin.top;
168
+ endX = axis === 'Y' ? finalWidth : brush.endX || finalWidth;
169
+ endY = axis === 'X' ? finalHeight : brush.endY || finalHeight;
170
+
171
171
  const invScaleX = 1 / scaleX;
172
172
  const invScaleY = 1 / scaleY;
173
173
  const horizontalScaleTransform = `scale(1, ${scaleY})`;
@@ -1,11 +1,14 @@
1
1
  import type { Spectrum1D } from '@zakodium/nmrium-core';
2
- import { memo } from 'react';
2
+ import { memo, useRef } from 'react';
3
3
 
4
4
  import { useChartData } from '../../context/ChartContext.js';
5
5
  import useXYReduce from '../../hooks/useXYReduce.js';
6
6
  import { PathBuilder } from '../../utility/PathBuilder.js';
7
7
  import { use1DTraceYScale, useScale2DY } from '../utilities/scale.js';
8
8
 
9
+ import { Ranges1D } from './Ranges1D.tsx';
10
+ import { Signals1D } from './Signals1D.tsx';
11
+
9
12
  interface Left1DChartProps {
10
13
  horizontalMargin?: number;
11
14
  data: Spectrum1D;
@@ -44,10 +47,12 @@ function Left1DChart({
44
47
  data: spectrum,
45
48
  }: Left1DChartProps) {
46
49
  const { height, margin, displayerKey } = useChartData();
50
+ const svgRef = useRef<SVGSVGElement>(null);
47
51
 
48
52
  const width = margin.left;
49
53
 
50
54
  const path = usePath(spectrum, { horizontalMargin, width });
55
+ const ranges = spectrum.ranges.values;
51
56
 
52
57
  const innerHeight = height - margin.bottom - margin.top;
53
58
 
@@ -55,6 +60,8 @@ function Left1DChart({
55
60
 
56
61
  return (
57
62
  <svg
63
+ ref={svgRef}
64
+ style={{ overflow: 'visible' }}
58
65
  viewBox={`0 0 ${width} ${innerHeight + margin.top}`}
59
66
  width={width}
60
67
  height={innerHeight + margin.top}
@@ -63,6 +70,9 @@ function Left1DChart({
63
70
  <clipPath id={`${displayerKey}clip-left`}>
64
71
  <rect width={width} height={innerHeight} x="0" y={margin.top} />
65
72
  </clipPath>
73
+ <clipPath id={`${displayerKey}clip-left-ranges`}>
74
+ <rect width={width + 20} height={innerHeight} x="0" y={margin.top} />
75
+ </clipPath>
66
76
  </defs>
67
77
  <g clipPath={`url(#${displayerKey}clip-left)`}>
68
78
  <path
@@ -72,6 +82,19 @@ function Left1DChart({
72
82
  d={path}
73
83
  />
74
84
  </g>
85
+ <g clipPath={`url(#${displayerKey}clip-left-ranges)`}>
86
+ <Ranges1D
87
+ ranges={ranges}
88
+ orientation="vertical"
89
+ spectrumId={spectrum.id}
90
+ />
91
+ <Signals1D
92
+ ranges={ranges}
93
+ svgRef={svgRef}
94
+ orientation="vertical"
95
+ spectrumId={spectrum.id}
96
+ />
97
+ </g>
75
98
  </svg>
76
99
  );
77
100
  }