nmrium 0.29.0 → 0.30.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 (409) hide show
  1. package/README.md +12 -2
  2. package/lib/component/1d/ApodizationLine.d.ts +3 -0
  3. package/lib/component/1d/ApodizationLine.js +47 -0
  4. package/lib/component/1d/Chart1D.js +4 -2
  5. package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
  6. package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
  7. package/lib/component/1d/IntegralResizable.js +5 -4
  8. package/lib/component/1d/LinesSeries.js +6 -6
  9. package/lib/component/1d/Viewer1D.js +7 -12
  10. package/lib/component/1d/database/DatabaseElements.js +2 -2
  11. package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
  12. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
  13. package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
  14. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -4
  15. package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
  16. package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
  17. package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
  18. package/lib/component/1d/peaks/PeakAnnotations.js +26 -0
  19. package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
  20. package/lib/component/1d/peaks/PeaksShapes.js +35 -0
  21. package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
  22. package/lib/component/1d/peaks/usePeakShapesPath.js +45 -0
  23. package/lib/component/1d/ranges/Range.js +4 -4
  24. package/lib/component/2d/FooterBanner.js +2 -2
  25. package/lib/component/2d/Viewer2D.js +2 -2
  26. package/lib/component/2d/zones/Signal.d.ts +3 -2
  27. package/lib/component/2d/zones/Signal.js +3 -3
  28. package/lib/component/2d/zones/Zone.d.ts +1 -1
  29. package/lib/component/2d/zones/Zone.js +4 -4
  30. package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
  31. package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
  32. package/lib/component/context/GlobalContext.d.ts +1 -1
  33. package/lib/component/context/GlobalContext.js +3 -3
  34. package/lib/component/elements/ActiveButton.d.ts +17 -0
  35. package/lib/component/elements/ActiveButton.js +28 -0
  36. package/lib/component/elements/Button.d.ts +6 -6
  37. package/lib/component/elements/Button.js +5 -5
  38. package/lib/component/elements/ButtonToolTip.js +1 -1
  39. package/lib/component/elements/CheckBox.d.ts +2 -6
  40. package/lib/component/elements/CheckBox.js +4 -6
  41. package/lib/component/elements/Input.d.ts +5 -4
  42. package/lib/component/elements/Input.js +1 -1
  43. package/lib/component/elements/Label.d.ts +8 -6
  44. package/lib/component/elements/Label.js +3 -3
  45. package/lib/component/elements/MoleculeSelection.d.ts +2 -2
  46. package/lib/component/elements/MoleculeSelection.js +1 -1
  47. package/lib/component/elements/NextPrev.js +1 -1
  48. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
  49. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
  50. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
  51. package/lib/component/elements/Select.d.ts +7 -11
  52. package/lib/component/elements/Select.js +6 -8
  53. package/lib/component/elements/Tab/Tab.js +1 -1
  54. package/lib/component/elements/Table/Table.d.ts +1 -2
  55. package/lib/component/elements/Table/Table.js +2 -2
  56. package/lib/component/elements/ToggleButton.d.ts +1 -2
  57. package/lib/component/elements/ToggleButton.js +3 -2
  58. package/lib/component/elements/accordion/AccordionItem.js +2 -2
  59. package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
  60. package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
  61. package/lib/component/elements/formik/FormikOnChange.js +11 -5
  62. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  63. package/lib/component/elements/resizer/DivResizer.js +3 -3
  64. package/lib/component/elements/resizer/Resizer.d.ts +1 -0
  65. package/lib/component/elements/resizer/SVGResizer.js +3 -3
  66. package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
  67. package/lib/component/header/ApodizationOptionsPanel.js +81 -0
  68. package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
  69. package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
  70. package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
  71. package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
  72. package/lib/component/header/Header.js +5 -2
  73. package/lib/component/header/HeaderContainer.d.ts +7 -0
  74. package/lib/component/header/HeaderContainer.js +10 -0
  75. package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
  76. package/lib/component/header/RangesPickingOptionPanel.js +19 -21
  77. package/lib/component/header/ZeroFillingOptionsPanel.js +49 -46
  78. package/lib/component/header/Zones2DOptionPanel.js +11 -13
  79. package/lib/component/highlight/index.d.ts +27 -10
  80. package/lib/component/highlight/index.js +19 -17
  81. package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
  82. package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
  83. package/lib/component/hooks/useFilter.d.ts +1 -0
  84. package/lib/component/hooks/useFilter.js +7 -0
  85. package/lib/component/hooks/useToolsFunctions.js +1 -1
  86. package/lib/component/loader/DropZone.js +1 -1
  87. package/lib/component/modal/AlignSpectraModal.js +1 -2
  88. package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
  89. package/lib/component/modal/EditPeakShapeModal.js +85 -0
  90. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
  91. package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
  92. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
  93. package/lib/component/modal/PredictSpectraModal.js +1 -1
  94. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
  95. package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
  96. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  97. package/lib/component/modal/editRange/EditRangeModal.js +2 -2
  98. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
  99. package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
  100. package/lib/component/modal/setting/DisplayTabContent.js +1 -1
  101. package/lib/component/modal/setting/FormattingTabContent.js +2 -2
  102. package/lib/component/modal/setting/GeneralSettings.js +1 -1
  103. package/lib/component/modal/setting/ToolsTabContent.js +13 -13
  104. package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
  105. package/lib/component/modal/setting/WorkspaceItem.js +2 -2
  106. package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  107. package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
  108. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
  109. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
  110. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
  111. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
  112. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
  113. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
  114. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
  115. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
  116. package/lib/component/panels/Panels.js +3 -3
  117. package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
  118. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
  119. package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
  120. package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
  121. package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
  122. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  123. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
  124. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
  125. package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
  126. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
  127. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  128. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
  129. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
  130. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
  131. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
  132. package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -2
  133. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  134. package/lib/component/panels/databasePanel/DatabasePanel.js +4 -12
  135. package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
  136. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
  137. package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
  138. package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
  139. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  140. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
  141. package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
  142. package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
  143. package/lib/component/reducer/IgnoreActions.js +4 -0
  144. package/lib/component/reducer/Reducer.d.ts +37 -6
  145. package/lib/component/reducer/Reducer.js +25 -5
  146. package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
  147. package/lib/component/reducer/actions/FiltersActions.js +165 -29
  148. package/lib/component/reducer/actions/IntegralsActions.js +2 -2
  149. package/lib/component/reducer/actions/MoleculeActions.js +27 -14
  150. package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
  151. package/lib/component/reducer/actions/PeaksActions.js +38 -5
  152. package/lib/component/reducer/actions/RangesActions.js +2 -2
  153. package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
  154. package/lib/component/reducer/actions/ToolsActions.js +9 -72
  155. package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
  156. package/lib/component/reducer/helper/getStrongestPeak.js +14 -0
  157. package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
  158. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
  159. package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
  160. package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
  161. package/lib/component/reducer/types/Types.d.ts +7 -0
  162. package/lib/component/reducer/types/Types.js +7 -0
  163. package/lib/component/tool/BrushX.js +1 -1
  164. package/lib/component/tool/BrushXY.js +4 -3
  165. package/lib/component/tool/CrossLinePointer.js +5 -4
  166. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
  167. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +14 -6
  168. package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
  169. package/lib/component/tool/FloatMoleculeStructures/index.js +13 -6
  170. package/lib/component/toolbar/BasicToolBar.js +3 -8
  171. package/lib/component/toolbar/FunctionToolBar.js +11 -23
  172. package/lib/component/toolbar/ToolTypes.d.ts +7 -1
  173. package/lib/component/toolbar/ToolTypes.js +119 -9
  174. package/lib/component/utility/util/nmredata/addZones.js +3 -3
  175. package/lib/component/workspaces/Workspace.d.ts +4 -1
  176. package/lib/component/workspaces/basic.js +12 -11
  177. package/lib/component/workspaces/embedded.js +14 -13
  178. package/lib/component/workspaces/exercise.js +4 -6
  179. package/lib/component/workspaces/prediction.js +14 -13
  180. package/lib/component/workspaces/process1D.js +20 -19
  181. package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
  182. package/lib/constants.js +1 -1
  183. package/lib/data/Filters.d.ts +2 -2
  184. package/lib/data/Filters.js +2 -2
  185. package/lib/data/FiltersManager.js +3 -3
  186. package/lib/data/PredictionManager.d.ts +0 -1
  187. package/lib/data/PredictionManager.js +15 -15
  188. package/lib/data/SpectraManager.d.ts +2 -1
  189. package/lib/data/SpectraManager.js +2 -8
  190. package/lib/data/constants/SignalsKinds.d.ts +0 -1
  191. package/lib/data/constants/SignalsKinds.js +0 -8
  192. package/lib/data/data1d/Data1DManager.js +5 -5
  193. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
  194. package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
  195. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
  196. package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
  197. package/lib/data/data1d/Spectrum1D/index.js +2 -1
  198. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  199. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
  200. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +4 -2
  201. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
  202. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
  203. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
  204. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
  205. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
  206. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -0
  207. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
  208. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
  209. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
  210. package/lib/data/data1d/database.js +4 -6
  211. package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
  212. package/lib/data/data1d/filter1d/apodization.js +63 -0
  213. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
  214. package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
  215. package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
  216. package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
  217. package/lib/data/data2d/Processing2D.d.ts +3 -3
  218. package/lib/data/data2d/Processing2D.js +3 -2
  219. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
  220. package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
  221. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
  222. package/lib/data/migration/MigrationManager.d.ts +1 -1
  223. package/lib/data/migration/MigrationManager.js +3 -1
  224. package/lib/data/migration/migrateToVersion3.d.ts +1 -0
  225. package/lib/data/migration/migrateToVersion3.js +55 -0
  226. package/lib/data/molecules/Molecule.d.ts +15 -6
  227. package/lib/data/molecules/Molecule.js +5 -8
  228. package/lib/data/molecules/MoleculeManager.d.ts +4 -4
  229. package/lib/data/molecules/MoleculeManager.js +5 -5
  230. package/lib/data/types/data1d/SumOptions.d.ts +1 -1
  231. package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
  232. package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
  233. package/lib/data/utilities/isInRange.d.ts +7 -0
  234. package/lib/data/utilities/isInRange.js +4 -0
  235. package/lib/types/NMRiumDataReturn.d.ts +2 -2
  236. package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
  237. package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
  238. package/lib/versionInfo.js +1 -1
  239. package/lib-cjs/component/1d/ApodizationLine.js +75 -0
  240. package/lib-cjs/component/1d/Chart1D.js +4 -2
  241. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
  242. package/lib-cjs/component/1d/IntegralResizable.js +4 -3
  243. package/lib-cjs/component/1d/LinesSeries.js +5 -5
  244. package/lib-cjs/component/1d/Viewer1D.js +7 -12
  245. package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
  246. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
  247. package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  248. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
  249. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +1 -2
  250. package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
  251. package/lib-cjs/component/1d/peaks/PeakAnnotations.js +31 -0
  252. package/lib-cjs/component/1d/peaks/PeaksShapes.js +40 -0
  253. package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +49 -0
  254. package/lib-cjs/component/1d/ranges/Range.js +3 -3
  255. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  256. package/lib-cjs/component/2d/Viewer2D.js +2 -2
  257. package/lib-cjs/component/2d/zones/Signal.js +3 -3
  258. package/lib-cjs/component/2d/zones/Zone.js +3 -3
  259. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
  260. package/lib-cjs/component/context/GlobalContext.js +4 -4
  261. package/lib-cjs/component/elements/ActiveButton.js +33 -0
  262. package/lib-cjs/component/elements/Button.js +5 -5
  263. package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
  264. package/lib-cjs/component/elements/CheckBox.js +3 -5
  265. package/lib-cjs/component/elements/Input.js +1 -1
  266. package/lib-cjs/component/elements/Label.js +3 -3
  267. package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
  268. package/lib-cjs/component/elements/NextPrev.js +1 -1
  269. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  270. package/lib-cjs/component/elements/Select.js +6 -8
  271. package/lib-cjs/component/elements/Tab/Tab.js +1 -1
  272. package/lib-cjs/component/elements/Table/Table.js +2 -2
  273. package/lib-cjs/component/elements/ToggleButton.js +3 -2
  274. package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
  275. package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
  276. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  277. package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
  278. package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
  279. package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
  280. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
  281. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
  282. package/lib-cjs/component/header/Header.js +5 -2
  283. package/lib-cjs/component/header/HeaderContainer.js +14 -0
  284. package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
  285. package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
  286. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +70 -44
  287. package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
  288. package/lib-cjs/component/highlight/index.js +20 -18
  289. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
  290. package/lib-cjs/component/hooks/useFilter.js +14 -0
  291. package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
  292. package/lib-cjs/component/loader/DropZone.js +1 -1
  293. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  294. package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
  295. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
  296. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
  297. package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
  298. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
  299. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  300. package/lib-cjs/component/modal/editRange/EditRangeModal.js +2 -2
  301. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
  302. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
  303. package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
  304. package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
  305. package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
  306. package/lib-cjs/component/modal/setting/ToolsTabContent.js +13 -13
  307. package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
  308. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  309. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
  310. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
  311. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
  312. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
  313. package/lib-cjs/component/panels/Panels.js +3 -3
  314. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
  315. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
  316. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
  317. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +1 -1
  318. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
  319. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  320. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
  321. package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
  322. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
  323. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  324. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
  325. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
  326. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
  327. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +1 -2
  328. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  329. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +4 -12
  330. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
  331. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
  332. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
  333. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
  334. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  335. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
  336. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
  337. package/lib-cjs/component/reducer/IgnoreActions.js +4 -0
  338. package/lib-cjs/component/reducer/Reducer.js +25 -8
  339. package/lib-cjs/component/reducer/actions/FiltersActions.js +170 -29
  340. package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -2
  341. package/lib-cjs/component/reducer/actions/MoleculeActions.js +27 -14
  342. package/lib-cjs/component/reducer/actions/PeaksActions.js +40 -4
  343. package/lib-cjs/component/reducer/actions/RangesActions.js +2 -2
  344. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +1 -1
  345. package/lib-cjs/component/reducer/actions/ToolsActions.js +8 -71
  346. package/lib-cjs/component/reducer/helper/getStrongestPeak.js +18 -0
  347. package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
  348. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
  349. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
  350. package/lib-cjs/component/reducer/types/Types.js +10 -3
  351. package/lib-cjs/component/tool/BrushX.js +1 -1
  352. package/lib-cjs/component/tool/BrushXY.js +4 -3
  353. package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
  354. package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +12 -4
  355. package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +13 -6
  356. package/lib-cjs/component/toolbar/BasicToolBar.js +3 -8
  357. package/lib-cjs/component/toolbar/FunctionToolBar.js +10 -22
  358. package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
  359. package/lib-cjs/component/utility/util/nmredata/addZones.js +3 -6
  360. package/lib-cjs/component/workspaces/basic.js +12 -11
  361. package/lib-cjs/component/workspaces/embedded.js +14 -13
  362. package/lib-cjs/component/workspaces/exercise.js +4 -6
  363. package/lib-cjs/component/workspaces/prediction.js +14 -13
  364. package/lib-cjs/component/workspaces/process1D.js +20 -19
  365. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
  366. package/lib-cjs/constants.js +1 -1
  367. package/lib-cjs/data/Filters.js +3 -3
  368. package/lib-cjs/data/FiltersManager.js +3 -6
  369. package/lib-cjs/data/PredictionManager.js +15 -15
  370. package/lib-cjs/data/SpectraManager.js +2 -8
  371. package/lib-cjs/data/constants/SignalsKinds.js +0 -8
  372. package/lib-cjs/data/data1d/Data1DManager.js +5 -5
  373. package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
  374. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
  375. package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
  376. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  377. package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
  378. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +4 -2
  379. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
  380. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
  381. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
  382. package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -0
  383. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
  384. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
  385. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
  386. package/lib-cjs/data/data1d/database.js +4 -6
  387. package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
  388. package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
  389. package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
  390. package/lib-cjs/data/data2d/Processing2D.js +3 -2
  391. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
  392. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
  393. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
  394. package/lib-cjs/data/migration/MigrationManager.js +3 -1
  395. package/lib-cjs/data/migration/migrateToVersion3.js +58 -0
  396. package/lib-cjs/data/molecules/Molecule.js +5 -8
  397. package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
  398. package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
  399. package/lib-cjs/data/utilities/isInRange.js +7 -0
  400. package/lib-cjs/versionInfo.js +1 -1
  401. package/package.json +32 -31
  402. package/lib/component/1d/PeakAnnotations.js +0 -41
  403. package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
  404. package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
  405. package/lib/data/utilities/generateID.d.ts +0 -1
  406. package/lib/data/utilities/generateID.js +0 -9
  407. package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
  408. package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
  409. package/lib-cjs/data/utilities/generateID.js +0 -12
@@ -5,11 +5,11 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
5
5
  const LIST = [
6
6
  {
7
7
  label: 'Zoom in',
8
- name: 'toolBarButtons.zoomTool',
8
+ name: 'toolBarButtons.zoom',
9
9
  },
10
10
  {
11
11
  label: 'Zoom out',
12
- name: 'toolBarButtons.zoomOutTool',
12
+ name: 'toolBarButtons.zoomOut',
13
13
  },
14
14
  {
15
15
  label: 'Import',
@@ -33,47 +33,47 @@ const LIST = [
33
33
  },
34
34
  {
35
35
  label: 'Peak picking',
36
- name: 'toolBarButtons.peakTool',
36
+ name: 'toolBarButtons.peakPicking',
37
37
  },
38
38
  {
39
39
  label: 'Integral',
40
- name: 'toolBarButtons.integralTool',
40
+ name: 'toolBarButtons.integral',
41
41
  },
42
42
  {
43
43
  label: 'Zone Picking',
44
- name: 'toolBarButtons.zonePickingTool',
44
+ name: 'toolBarButtons.zonePicking',
45
45
  },
46
46
  {
47
47
  label: 'Range picking',
48
- name: 'toolBarButtons.rangePickingTool',
48
+ name: 'toolBarButtons.rangePicking',
49
49
  },
50
50
  {
51
51
  label: 'Slicing',
52
- name: 'toolBarButtons.slicingTool',
52
+ name: 'toolBarButtons.slicing',
53
53
  },
54
54
  {
55
55
  label: 'Zero filling',
56
- name: 'toolBarButtons.zeroFillingTool',
56
+ name: 'toolBarButtons.zeroFilling',
57
57
  },
58
58
  {
59
59
  label: 'Fourier transform',
60
- name: 'toolBarButtons.FFTTool',
60
+ name: 'toolBarButtons.fastFourierTransform',
61
61
  },
62
62
  {
63
63
  label: 'Phase correction',
64
- name: 'toolBarButtons.phaseCorrectionTool',
64
+ name: 'toolBarButtons.phaseCorrection',
65
65
  },
66
66
  {
67
67
  label: 'Baseline correction',
68
- name: 'toolBarButtons.baselineCorrectionTool',
68
+ name: 'toolBarButtons.baselineCorrection',
69
69
  },
70
70
  {
71
71
  label: 'Exclusion zones',
72
- name: 'toolBarButtons.exclusionZonesTool',
72
+ name: 'toolBarButtons.exclusionZones',
73
73
  },
74
74
  {
75
75
  label: 'Multiple spectra analysis',
76
- name: 'toolBarButtons.multipleSpectraAnalysisTool',
76
+ name: 'toolBarButtons.multipleSpectraAnalysis',
77
77
  },
78
78
  ];
79
79
  function ToolsTabContent() {
@@ -1,6 +1,6 @@
1
- declare const WorkspaceItem: ({ item, onSave, onDelete }: {
1
+ declare function WorkspaceItem({ item, onSave, onDelete }: {
2
2
  item: any;
3
3
  onSave: any;
4
4
  onDelete: any;
5
- }) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ }): import("@emotion/react/jsx-runtime").JSX.Element;
6
6
  export default WorkspaceItem;
@@ -40,7 +40,7 @@ const styles = css `
40
40
  padding: 5px;
41
41
  }
42
42
  `;
43
- const WorkspaceItem = ({ item, onSave, onDelete }) => {
43
+ function WorkspaceItem({ item, onSave, onDelete }) {
44
44
  const [name, setName] = useState('');
45
45
  const addWorkspaceHandler = useCallback((e) => {
46
46
  e.stopPropagation();
@@ -55,5 +55,5 @@ const WorkspaceItem = ({ item, onSave, onDelete }) => {
55
55
  setName(e.target.value);
56
56
  }, []);
57
57
  return (_jsx("div", { css: styles, children: item.key === 'new' ? (_jsxs("div", { className: "new-container", children: [_jsx("input", { value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx("button", { type: "button", className: "save-button", onClick: addWorkspaceHandler, disabled: !name, children: "save" })] })) : (_jsxs("div", { className: "container", children: [_jsx("span", { children: item.label }), !workspaces[item.key] && (_jsx("button", { type: "button", className: "delete-button", onClick: deleteWorkspaceHandler, children: "Delete" }))] })) }));
58
- };
58
+ }
59
59
  export default WorkspaceItem;
@@ -59,7 +59,7 @@ function IntegralTable({ activeTab, data }) {
59
59
  sortType: 'basic',
60
60
  resizable: true,
61
61
  accessor: (row) => row.kind,
62
- Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), data: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
62
+ Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
63
63
  },
64
64
  {
65
65
  index: 7,
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { Molecule } from '../../../data/molecules/Molecule';
2
+ import { StateMoleculeExtended } from '../../../data/molecules/Molecule';
3
3
  interface MoleculeHeaderProps {
4
- currentMolecule: Molecule;
5
- molecules: Molecule[];
4
+ currentMolecule: StateMoleculeExtended;
5
+ molecules: StateMoleculeExtended[];
6
6
  }
7
7
  export default function MoleculeHeader(props: MoleculeHeaderProps): JSX.Element;
8
8
  export {};
@@ -30,9 +30,9 @@ export default function MoleculeHeader(props) {
30
30
  const number = extractNumber(value);
31
31
  return value && !reservedNumbers.includes(Number(number));
32
32
  }, [molecules]);
33
- const saveLabelHandler = useCallback((key, event) => {
33
+ const saveLabelHandler = useCallback((id, event) => {
34
34
  const label = event.target.value;
35
- dispatch({ type: CHANGE_MOLECULE_LABEL, payload: { label, key } });
35
+ dispatch({ type: CHANGE_MOLECULE_LABEL, payload: { label, id } });
36
36
  }, [dispatch]);
37
- return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.key, event) })] }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
37
+ return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event) })] }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
38
38
  }
@@ -1,10 +1,11 @@
1
- import { ReactElement } from 'react';
2
- import { Molecule } from '../../../data/molecules/Molecule';
1
+ import { ReactElement, CSSProperties } from 'react';
2
+ import { StateMoleculeExtended } from '../../../data/molecules/Molecule';
3
3
  import { MoleculeHeaderActionsOptions } from './MoleculePanelHeader';
4
4
  interface MoleculePanelProps {
5
- onMoleculeChange?: (molecule: Molecule) => void;
5
+ onMoleculeChange?: (molecule: StateMoleculeExtended) => void;
6
6
  children?: ReactElement;
7
7
  actionsOptions?: MoleculeHeaderActionsOptions;
8
+ emptyTextStyle?: CSSProperties;
8
9
  }
9
- export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, emptyTextStyle, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import OCL from 'openchemlib/full';
5
- import { useState, useCallback, useEffect, memo } from 'react';
5
+ import { useState, useCallback, useEffect, memo, } from 'react';
6
6
  import { ResponsiveChart } from 'react-d3-utils';
7
7
  import OCLnmr from 'react-ocl-nmr';
8
8
  import { useChartData } from '../../context/ChartContext';
@@ -28,6 +28,7 @@ const styles = {
28
28
  }),
29
29
  molecule: css({
30
30
  flex: 1,
31
+ minHeight: '100px',
31
32
  }),
32
33
  slider: css({
33
34
  display: 'flex',
@@ -42,7 +43,7 @@ const styles = {
42
43
  height: '100%',
43
44
  }),
44
45
  };
45
- function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, }) {
46
+ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, floatingMolecules, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, emptyTextStyle, }) {
46
47
  const [currentIndex, setCurrentIndex] = useState(0);
47
48
  const [molecules, setMolecules] = useState([]);
48
49
  const dispatch = useDispatch();
@@ -62,17 +63,17 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
62
63
  onMoleculeChange?.(molecules[currentIndex] || null);
63
64
  }, [currentIndex, molecules, onMoleculeChange]);
64
65
  const handleReplaceMolecule = useCallback((molecule, molfile) => {
65
- const { key, label, isFloat } = molecule;
66
+ const { id, label } = molecule;
66
67
  dispatch({
67
68
  type: SET_MOLECULE,
68
- payload: { molfile, key, label, isFloat },
69
+ payload: { molfile, id, label },
69
70
  });
70
71
  }, [dispatch]);
71
72
  const moleculeIndexHandler = useCallback((index) => {
72
73
  setCurrentIndex(index);
73
74
  }, []);
74
- return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), _jsxs("div", { css: styles.innerPanel, children: [_jsx("div", { css: styles.molecule, children: _jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
75
- return molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsx(MoleculeHeader, { currentMolecule: mol, molecules: molecules }), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditor(mol), style: {
75
+ return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, floatingMolecules: floatingMolecules, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), _jsxs("div", { css: styles.innerPanel, children: [_jsx("div", { css: styles.molecule, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
76
+ return (_jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsx(MoleculeHeader, { currentMolecule: mol, molecules: molecules }), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditor(mol), style: {
76
77
  backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
77
78
  }, children: _jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height - 60, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
78
79
  currentDiaIDsToHighlight.length > 0
@@ -80,23 +81,25 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
80
81
  : '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
81
82
  currentDiaIDsToHighlight.length > 0
82
83
  ? currentDiaIDsToHighlight
83
- : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }) })] }, mol.key)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: _jsx("span", { children: "Click to draw molecule" }) }));
84
- } }) }) }), children] })] }));
84
+ : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }) })] }, mol.id)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: _jsx("span", { style: emptyTextStyle, children: "Click to draw molecule" }) })) }));
85
+ } }) }), children] })] }));
85
86
  }
86
87
  const MemoizedMoleculePanel = memo(MoleculePanelInner);
87
88
  const emptyData = { ranges: {}, zones: {} };
88
- export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }) {
89
- const { molecules, displayerMode, activeTab } = useChartData();
89
+ export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, emptyTextStyle, }) {
90
+ const { molecules, view: { floatingMolecules }, displayerMode, activeTab, } = useChartData();
90
91
  const data = useSpectrum(emptyData);
91
92
  const ranges = data?.ranges || {};
92
93
  const zones = data?.zones || {};
93
94
  return (_jsx(MemoizedMoleculePanel, { ...{
94
95
  molecules,
96
+ floatingMolecules,
95
97
  displayerMode,
96
98
  activeTab,
97
99
  ranges,
98
100
  zones,
99
101
  onMoleculeChange,
100
102
  actionsOptions,
103
+ emptyTextStyle,
101
104
  }, children: children }));
102
105
  }
@@ -1,3 +1,4 @@
1
+ import { FloatingMolecules, StateMoleculeExtended } from '../../../data/molecules/Molecule';
1
2
  export interface MoleculeHeaderActionsOptions {
2
3
  hidePast?: boolean;
3
4
  hideAdd?: boolean;
@@ -7,10 +8,11 @@ export interface MoleculeHeaderActionsOptions {
7
8
  }
8
9
  interface MoleculePanelHeaderProps {
9
10
  currentIndex: number;
10
- molecules: Array<any>;
11
+ molecules: Array<StateMoleculeExtended>;
12
+ floatingMolecules: Array<FloatingMolecules>;
11
13
  onMoleculeIndexChange: (index: number) => void;
12
14
  onOpenMoleculeEditor: () => void;
13
15
  actionsOptions?: MoleculeHeaderActionsOptions;
14
16
  }
15
- export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange, onOpenMoleculeEditor, actionsOptions, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
17
+ export default function MoleculePanelHeader({ currentIndex, molecules, floatingMolecules, onMoleculeIndexChange, onOpenMoleculeEditor, actionsOptions, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
16
18
  export {};
@@ -8,9 +8,9 @@ import { IoOpenOutline } from 'react-icons/io5';
8
8
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
9
9
  import { useDispatch } from '../../context/DispatchContext';
10
10
  import { useGlobal } from '../../context/GlobalContext';
11
+ import ActiveButton from '../../elements/ActiveButton';
11
12
  import ButtonToolTip from '../../elements/ButtonToolTip';
12
13
  import MenuButton from '../../elements/MenuButton';
13
- import ToggleButton from '../../elements/ToggleButton';
14
14
  import ToolTip from '../../elements/ToolTip/ToolTip';
15
15
  import { useAlert } from '../../elements/popup/Alert';
16
16
  import { positions, useModal } from '../../elements/popup/Modal';
@@ -58,7 +58,7 @@ const MOL_EXPORT_MENU = [
58
58
  label: 'Export as SVG',
59
59
  },
60
60
  ];
61
- export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
61
+ export default function MoleculePanelHeader({ currentIndex, molecules, floatingMolecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
62
62
  const { rootRef } = useGlobal();
63
63
  const alert = useAlert();
64
64
  const dispatch = useDispatch();
@@ -108,11 +108,11 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
108
108
  });
109
109
  }, [dispatch]);
110
110
  const handleDelete = useCallback(() => {
111
- if (molecules[currentIndex]?.key) {
111
+ if (molecules[currentIndex]?.id) {
112
112
  onMoleculeIndexChange(0);
113
113
  dispatch({
114
114
  type: DELETE_MOLECULE,
115
- payload: { key: molecules[currentIndex].key, assignmentData },
115
+ payload: { id: molecules[currentIndex].id, assignmentData },
116
116
  });
117
117
  }
118
118
  }, [
@@ -132,10 +132,10 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
132
132
  const floatMoleculeHandler = useCallback(() => {
133
133
  dispatch({
134
134
  type: FLOAT_MOLECULE_OVER_SPECTRUM,
135
- payload: { key: molecules[currentIndex].key },
135
+ payload: { id: molecules[currentIndex].id },
136
136
  });
137
137
  }, [currentIndex, dispatch, molecules]);
138
- return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, "data-test-id": "panel-structures-button-add", children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && molecules && molecules.length > 0 && (_jsx(ButtonToolTip, { popupTitle: "Predict Spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), molecules?.[currentIndex] && (_jsx(ToggleButton, { defaultValue: molecules[currentIndex].isFloat, popupTitle: "Float Molecule", popupPlacement: "left", onClick: floatMoleculeHandler, children: _jsx(IoOpenOutline, {}) }, molecules[currentIndex].isFloat)), _jsxs("p", { children: [molecules &&
138
+ return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && molecules && molecules.length > 0 && (_jsx(ButtonToolTip, { popupTitle: "Predict Spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), molecules?.[currentIndex] && (_jsx(ActiveButton, { value: floatingMolecules.find(({ id }) => id === molecules[currentIndex].id)?.visible || false, popupTitle: "Float Molecule", popupPlacement: "left", onClick: floatMoleculeHandler, children: _jsx(IoOpenOutline, {}) }, molecules[currentIndex].id)), _jsxs("p", { children: [molecules &&
139
139
  molecules.length > 0 &&
140
140
  `${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
141
141
  }
@@ -1,7 +1,7 @@
1
1
  import { Range } from '../../../data/types/data1d';
2
2
  import { Zone } from '../../../data/types/data2d';
3
3
  import { AssignmentContext, Axis } from '../../assignment/AssignmentsContext';
4
- interface Atom {
4
+ export interface Atom {
5
5
  oclID: string;
6
6
  atomLabel: string;
7
7
  nbAtoms: number;
@@ -31,4 +31,3 @@ export declare function findDatumAndSignalIndex(data: (Range | Zone)[], id: stri
31
31
  export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: any, data: any): string[];
32
32
  export declare function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext): string[];
33
33
  export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData): (number | string[])[];
34
- export {};
@@ -1,11 +1,13 @@
1
+ import { MouseEvent } from 'react';
2
+ import { Atom } from './Utilities';
1
3
  export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }: {
2
4
  displayerMode: any;
3
5
  activeTab: any;
4
6
  zones: any;
5
7
  ranges: any;
6
8
  }): {
7
- handleOnAtomHover: (atom: any) => void;
8
- handleOnClickAtom: (atom: any, event: any) => void;
9
+ handleOnAtomHover: (atom: Atom) => void;
10
+ handleOnClickAtom: (atom: Atom, event: MouseEvent) => void;
9
11
  currentDiaIDsToHighlight: string[];
10
- assignedDiaIDsMerged: any[];
12
+ assignedDiaIDsMerged: string[];
11
13
  };
@@ -5,7 +5,7 @@ import { useAssignment, useAssignmentData, } from '../../assignment/AssignmentsC
5
5
  import { filterForIDsWithAssignment } from '../../assignment/utilities/filterForIDsWithAssignment';
6
6
  import { useDispatch } from '../../context/DispatchContext';
7
7
  import { useAlert } from '../../elements/popup/Alert';
8
- import { HighlightedSource, useHighlightData } from '../../highlight';
8
+ import { HighlightEventSource, useHighlightData } from '../../highlight';
9
9
  import { DISPLAYER_MODE } from '../../reducer/core/Constants';
10
10
  import { SET_DIAID_RANGE, SET_DIAID_ZONE } from '../../reducer/types/Types';
11
11
  import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
@@ -24,7 +24,10 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
24
24
  if (onAtomHoverAction === 'show') {
25
25
  highlightData.dispatch({
26
26
  type: 'SHOW',
27
- payload: { convertedHighlights: onAtomHoverHighlights },
27
+ payload: {
28
+ convertedHighlights: onAtomHoverHighlights,
29
+ sourceData: { type: HighlightEventSource.ATOM },
30
+ },
28
31
  });
29
32
  }
30
33
  else if (onAtomHoverAction === 'hide') {
@@ -51,7 +54,10 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
51
54
  return [];
52
55
  }, [displayerMode, ranges, zones]);
53
56
  const assignedDiaIDs = useMemo(() => {
54
- const assignedDiaID = { x: [], y: [] };
57
+ const assignedDiaID = {
58
+ x: [],
59
+ y: [],
60
+ };
55
61
  const assignment = assignments.data.assignments;
56
62
  for (let id in assignment) {
57
63
  if (assignment[id].x) {
@@ -74,7 +80,9 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
74
80
  const { datum } = findDatumAndSignalIndex(data, highlightID);
75
81
  const type = highlightData.highlight.sourceData?.type;
76
82
  if (datum &&
77
- (type === HighlightedSource.ZONE || type === HighlightedSource.RANGE)) {
83
+ (type === HighlightEventSource.ZONE ||
84
+ type === HighlightEventSource.RANGE ||
85
+ type === HighlightEventSource.ATOM)) {
78
86
  // we are on range/zone level only, so add the belonging signal IDs to highlight too
79
87
  highlights = highlights.concat(datum.signals
80
88
  .map((signal) => filterForIDsWithAssignment(assignments, [signal.id]).length > 0
@@ -84,7 +84,7 @@ const accordionItems = [
84
84
  mode: null,
85
85
  },
86
86
  {
87
- title: 'Structures',
87
+ title: 'Chemical structures',
88
88
  component: _jsx(MoleculePanel, {}),
89
89
  hidePreferenceKey: 'structuresPanel',
90
90
  mode: null,
@@ -112,8 +112,8 @@ export const TOOLS_PANELS_ACCORDION = {
112
112
  null: 'Spectra',
113
113
  peakPicking: 'Peaks',
114
114
  integral: 'Integrals',
115
- rangesPicking: 'Ranges',
116
- zone2D: 'Zones',
115
+ rangePicking: 'Ranges',
116
+ zonePicking: 'Zones',
117
117
  multipleSpectraAnalysis: 'Multiple Spectra Analysis',
118
118
  };
119
119
  function usePanelPreferences() {
@@ -1,25 +1,35 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
+ import { SvgNmrFt } from 'cheminfo-font';
5
+ import SvgPeaks from 'cheminfo-font/lib-react-cjs/lib-react-tsx/nmr/Peaks';
4
6
  import { useCallback, useMemo, useState, useRef, memo } from 'react';
7
+ import { FaThinkPeaks } from 'react-icons/fa';
8
+ import isInRange from '../../../data/utilities/isInRange';
5
9
  import { useChartData } from '../../context/ChartContext';
6
10
  import { useDispatch } from '../../context/DispatchContext';
7
11
  import { usePreferences } from '../../context/PreferencesContext';
12
+ import Button from '../../elements/Button';
13
+ import ToggleButton from '../../elements/ToggleButton';
14
+ import { useAlert } from '../../elements/popup/Alert';
8
15
  import { useModal } from '../../elements/popup/Modal';
16
+ import useCheckExperimentalFeature from '../../hooks/useCheckExperimentalFeature';
9
17
  import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
10
18
  import useSpectrum from '../../hooks/useSpectrum';
11
- import { DELETE_PEAK_NOTATION } from '../../reducer/types/Types';
19
+ import { DELETE_PEAK_NOTATION, OPTIMIZE_PEAKS, TOGGLE_PEAKS_SHAPES, } from '../../reducer/types/Types';
12
20
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
13
21
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
14
22
  import PreferencesHeader from '../header/PreferencesHeader';
15
23
  import PeaksPreferences from './PeaksPreferences';
16
24
  import PeaksTable from './PeaksTable';
17
- function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
25
+ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksOptions, }) {
18
26
  const [filterIsActive, setFilterIsActive] = useState(false);
19
27
  const [isFlipped, setFlipStatus] = useState(false);
20
28
  const format = useFormatNumberByNucleus(info.nucleus);
21
29
  const dispatch = useDispatch();
22
30
  const modal = useModal();
31
+ const alert = useAlert();
32
+ const isExperimental = useCheckExperimentalFeature();
23
33
  const settingRef = useRef();
24
34
  const yesHandler = useCallback(() => {
25
35
  dispatch({ type: DELETE_PEAK_NOTATION, data: null });
@@ -41,33 +51,41 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
41
51
  setFilterIsActive(!filterIsActive);
42
52
  }, [filterIsActive]);
43
53
  const filteredPeaks = useMemo(() => {
44
- function isInRange(value) {
45
- const factor = 100000;
46
- return (value * factor >= xDomain[0] * factor &&
47
- value * factor <= xDomain[1] * factor);
48
- }
49
54
  if (peaks?.values) {
55
+ const [from, to] = xDomain;
50
56
  const _peaks = filterIsActive
51
- ? peaks.values.filter((peak) => isInRange(peak.x))
57
+ ? peaks.values.filter((peak) => isInRange(peak.x, { from, to }))
52
58
  : peaks.values;
53
59
  return _peaks
54
60
  .map((peak) => {
55
- const value = Number(format(peak.x));
61
+ const { x, y, width, ...peakProperties } = peak;
62
+ const value = Number(format(x));
56
63
  return {
57
- value,
58
- valueHz: info?.originFrequency
59
- ? Number(value) * info.originFrequency
60
- : '',
61
- id: peak.id,
62
- intensity: peak.y,
63
- peakWidth: peak.width ? peak.width : '',
64
- isConstantlyHighlighted: isInRange(value),
64
+ ...peakProperties,
65
+ x,
66
+ xHz: info?.originFrequency ? value * info.originFrequency : '',
67
+ y,
68
+ width: width ? width : '',
69
+ isConstantlyHighlighted: isInRange(value, { from, to }),
65
70
  };
66
71
  })
67
- .sort((prev, next) => prev.value - next.value);
72
+ .sort((prev, next) => prev.x - next.x);
68
73
  }
69
74
  return [];
70
75
  }, [filterIsActive, format, info, peaks, xDomain]);
76
+ const optimizePeaksHandler = () => {
77
+ const [from, to] = xDomain;
78
+ const filterPeaks = peaks.values.filter((peak) => isInRange(peak.x, { from, to }));
79
+ if (filterPeaks.length <= 4) {
80
+ dispatch({ type: OPTIMIZE_PEAKS, payload: { peaks: filterPeaks } });
81
+ }
82
+ else {
83
+ alert.error('optimization can be done on no more than 4 peaks');
84
+ }
85
+ };
86
+ const togglePeaksShapesHandler = (key) => {
87
+ dispatch({ type: TOGGLE_PEAKS_SHAPES, payload: { key } });
88
+ };
71
89
  return (_jsxs("div", { css: [
72
90
  tablePanelStyle,
73
91
  isFlipped &&
@@ -79,13 +97,20 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
79
97
  }
80
98
  }
81
99
  `,
82
- ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(PeaksTable, { data: filteredPeaks, activeTab: activeTab })) : (_jsx(PeaksPreferences, { ref: settingRef })) })] }));
100
+ ], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: isExperimental && (_jsxs(_Fragment, { children: [_jsx(ToggleButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksOptions.showPeaksShapes
101
+ ? 'Hide peaks shapes'
102
+ : 'Show peaks shapes', popupPlacement: "right", onClick: () => togglePeaksShapesHandler('showPeaksShapes'), disabled: !peaks?.values || peaks.values.length === 0, children: _jsx(SvgPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ToggleButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksOptions.showPeaksSum
103
+ ? 'Hide peaks sum'
104
+ : 'Show peaks sum', popupPlacement: "right", onClick: () => togglePeaksShapesHandler('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, children: _jsx(SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(Button.Done, { fill: "clear", onClick: optimizePeaksHandler, style: { width: '24px', padding: 0 }, children: _jsx("div", { style: {
105
+ display: 'flex',
106
+ justifyContent: 'center',
107
+ }, children: _jsx(FaThinkPeaks, {}) }) })] })) })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(PeaksTable, { data: filteredPeaks, activeTab: activeTab })) : (_jsx(PeaksPreferences, { ref: settingRef })) })] }));
83
108
  }
84
109
  const MemoizedPeaksPanel = memo(PeaksPanelInner);
85
110
  const emptyData = { peaks: null, info: {} };
86
111
  export default function PeaksPanel() {
87
- const { xDomain, activeTab } = useChartData();
112
+ const { xDomain, activeTab, toolOptions: { data: { peaksOptions }, }, } = useChartData();
88
113
  const { peaks, info } = useSpectrum(emptyData);
89
114
  const preferences = usePreferences();
90
- return (_jsx(MemoizedPeaksPanel, { ...{ peaks, info, xDomain, activeTab, preferences } }));
115
+ return (_jsx(MemoizedPeaksPanel, { ...{ peaks, info, xDomain, activeTab, preferences, peaksOptions } }));
91
116
  }
@@ -39,6 +39,23 @@ const formatFields = [
39
39
  checkControllerName: 'intensity.show',
40
40
  formatControllerName: 'intensity.format',
41
41
  },
42
+ {
43
+ id: 6,
44
+ label: 'kind :',
45
+ checkControllerName: 'fwhm.show',
46
+ },
47
+ {
48
+ id: 7,
49
+ label: 'fwhm :',
50
+ checkControllerName: 'fwhm.show',
51
+ formatControllerName: 'fwhm.format',
52
+ },
53
+ {
54
+ id: 8,
55
+ label: 'mu :',
56
+ checkControllerName: 'mu.show',
57
+ formatControllerName: 'mu.format',
58
+ },
42
59
  ];
43
60
  function PeaksPreferences(props, ref) {
44
61
  const alert = useAlert();