nmrium 0.22.0 → 0.24.1

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 (593) hide show
  1. package/README.md +4 -0
  2. package/lib/component/1d/Chart1D.js +1 -1
  3. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  4. package/lib/component/1d/ExclusionZonesAnnotations.js +2 -2
  5. package/lib/component/1d/FooterBanner.js +7 -8
  6. package/lib/component/1d/Integral.js +2 -2
  7. package/lib/component/1d/IntegralResizable.js +1 -1
  8. package/lib/component/1d/IntegralsSeries.js +2 -2
  9. package/lib/component/1d/LinesSeries.js +1 -1
  10. package/lib/component/1d/PeakAnnotation.js +3 -3
  11. package/lib/component/1d/PeakAnnotations.js +1 -1
  12. package/lib/component/1d/Resizable.js +2 -2
  13. package/lib/component/1d/ResurrectedDatabaseRanges.js +1 -1
  14. package/lib/component/1d/SpectraTracker.js +3 -3
  15. package/lib/component/1d/Viewer1D.js +5 -5
  16. package/lib/component/1d/XAxis.js +1 -1
  17. package/lib/component/1d/YAxis.js +1 -1
  18. package/lib/component/1d/jCouplingGraph/JGraph.js +3 -4
  19. package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
  20. package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  21. package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  22. package/lib/component/1d/jCouplingGraph/JsCouplings.js +2 -2
  23. package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  24. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  25. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
  26. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
  27. package/lib/component/1d/multiplicityTree/TreeNodes.js +2 -2
  28. package/lib/component/1d/ranges/Range.js +2 -2
  29. package/lib/component/1d/ranges/RangeIntegral.js +1 -1
  30. package/lib/component/1d/ranges/Ranges.js +2 -2
  31. package/lib/component/1d/tool/BaseLineZones.js +1 -1
  32. package/lib/component/1d/tool/PeakPointer.js +1 -1
  33. package/lib/component/1d/tool/VerticalIndicator.js +1 -1
  34. package/lib/component/1d/tool/XLabelPointer.js +1 -1
  35. package/lib/component/2d/Chart2D.js +2 -2
  36. package/lib/component/2d/Contours.js +6 -6
  37. package/lib/component/2d/FooterBanner.js +3 -3
  38. package/lib/component/2d/Left1DChart.js +1 -1
  39. package/lib/component/2d/SignalDeltaLine.js +1 -1
  40. package/lib/component/2d/Top1DChart.js +1 -1
  41. package/lib/component/2d/Viewer2D.js +3 -3
  42. package/lib/component/2d/XAxis.js +1 -1
  43. package/lib/component/2d/YAxis.js +1 -1
  44. package/lib/component/2d/tools/XYLabelPointer.js +1 -1
  45. package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +1 -1
  46. package/lib/component/2d/tools/slicing/SlicingView.js +1 -1
  47. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  48. package/lib/component/2d/zones/IndicationLines.js +1 -1
  49. package/lib/component/2d/zones/Signal.js +2 -2
  50. package/lib/component/2d/zones/SignalCrosshair.js +1 -1
  51. package/lib/component/2d/zones/Zone.js +1 -1
  52. package/lib/component/2d/zones/Zones.js +2 -2
  53. package/lib/component/ErrorOverlay.js +1 -1
  54. package/lib/component/EventsTrackers/BrushTracker.js +1 -1
  55. package/lib/component/EventsTrackers/MouseTracker.js +1 -1
  56. package/lib/component/NMRium.d.ts +34 -36
  57. package/lib/component/NMRium.js +10 -16
  58. package/lib/component/assignment/index.js +1 -1
  59. package/lib/component/context/PreferencesContext.d.ts +84 -2
  60. package/lib/component/context/PreferencesContext.js +30 -5
  61. package/lib/component/elements/Button.js +1 -1
  62. package/lib/component/elements/ButtonToolTip.js +1 -1
  63. package/lib/component/elements/CheckBox.js +1 -1
  64. package/lib/component/elements/CloseButton.js +1 -1
  65. package/lib/component/elements/ColorInput.js +1 -1
  66. package/lib/component/elements/ContextMenu.js +1 -1
  67. package/lib/component/elements/DeleteButton.js +1 -1
  68. package/lib/component/elements/EditableColumn.js +1 -1
  69. package/lib/component/elements/Input.js +1 -1
  70. package/lib/component/elements/InputRange.js +1 -1
  71. package/lib/component/elements/IsotopesViewer.js +1 -1
  72. package/lib/component/elements/Label.js +1 -1
  73. package/lib/component/elements/Logo.js +1 -1
  74. package/lib/component/elements/MenuButton.js +3 -3
  75. package/lib/component/elements/MolecularFormulaInput.js +1 -1
  76. package/lib/component/elements/MoleculeSelection.js +1 -1
  77. package/lib/component/elements/NextPrev.js +2 -2
  78. package/lib/component/elements/NumberInput.js +1 -1
  79. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
  80. package/lib/component/elements/ReactTable/ReactTable.js +3 -3
  81. package/lib/component/elements/ReactTable/ReactTableExpandable.js +3 -3
  82. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  83. package/lib/component/elements/SaveButton.js +1 -1
  84. package/lib/component/elements/Select.js +1 -1
  85. package/lib/component/elements/Tab/DeleteButton.js +1 -1
  86. package/lib/component/elements/Tab/Tab.js +3 -3
  87. package/lib/component/elements/Tab/Tabs.js +2 -2
  88. package/lib/component/elements/Table/Table.js +1 -1
  89. package/lib/component/elements/Table/TableBody.js +1 -1
  90. package/lib/component/elements/Table/TableCell.js +1 -1
  91. package/lib/component/elements/Table/TableHead.js +1 -1
  92. package/lib/component/elements/Table/TableRow.js +1 -1
  93. package/lib/component/elements/ToggleButton.js +1 -1
  94. package/lib/component/elements/ToolTip/ToolTip.js +2 -2
  95. package/lib/component/elements/ToolbarMenu.js +3 -3
  96. package/lib/component/elements/accordion/Accordion.js +1 -1
  97. package/lib/component/elements/accordion/AccordionItem.js +2 -2
  98. package/lib/component/elements/dropDownButton/DropDownButton.d.ts +20 -1
  99. package/lib/component/elements/dropDownButton/DropDownButton.js +32 -34
  100. package/lib/component/elements/dropDownButton/DropDownList.d.ts +2 -9
  101. package/lib/component/elements/dropDownButton/DropDownList.js +39 -25
  102. package/lib/component/elements/formik/ErrorMessage.js +2 -2
  103. package/lib/component/elements/formik/FormikCheckBox.d.ts +1 -0
  104. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  105. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  106. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  107. package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
  108. package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
  109. package/lib/component/elements/formik/FormikForm.js +1 -1
  110. package/lib/component/elements/formik/FormikInput.js +1 -1
  111. package/lib/component/elements/formik/FormikNumberInput.js +1 -1
  112. package/lib/component/elements/formik/FormikSelect.js +1 -1
  113. package/lib/component/elements/formik/FormikSlider.js +1 -1
  114. package/lib/component/elements/formik/FormikTextarea.js +1 -1
  115. package/lib/component/elements/formik/Input.js +1 -1
  116. package/lib/component/elements/formik/SelectBox.js +1 -1
  117. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
  118. package/lib/component/elements/popup/Alert/ProgressIndicator.js +1 -1
  119. package/lib/component/elements/popup/Alert/Provider.js +3 -3
  120. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  121. package/lib/component/elements/popup/Modal/Modal.js +1 -1
  122. package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
  123. package/lib/component/elements/popup/Modal/Provider.js +3 -3
  124. package/lib/component/elements/popup/Transition.js +1 -1
  125. package/lib/component/elements/popup/Wrapper.js +1 -1
  126. package/lib/component/elements/toggle/ToggleButton.js +1 -1
  127. package/lib/component/elements/toggle/ToggleButtonGroup.js +1 -1
  128. package/lib/component/header/AutoPeakPickingOptionPanel.js +3 -3
  129. package/lib/component/header/BaseLineCorrectionPanel.js +1 -1
  130. package/lib/component/header/Header.js +28 -14
  131. package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -2
  132. package/lib/component/header/RangesPickingOptionPanel.js +2 -2
  133. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  134. package/lib/component/header/Zones2DOptionPanel.js +1 -1
  135. package/lib/component/highlight/index.js +1 -1
  136. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  137. package/lib/component/hooks/useCheckExperimentalFeature.js +5 -4
  138. package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
  139. package/lib/component/hooks/useExport.js +15 -13
  140. package/lib/component/hooks/useTableSortBy.d.ts +2 -1
  141. package/lib/component/hooks/useTableSortBy.js +27 -16
  142. package/lib/component/loader/DefaultSpinnerComponent.js +1 -1
  143. package/lib/component/loader/DropZone.js +2 -2
  144. package/lib/component/loader/NoData.js +1 -3
  145. package/lib/component/loader/Spinner.js +1 -1
  146. package/lib/component/loader/SpinnerContext.js +1 -1
  147. package/lib/component/modal/AboutUsModal.js +4 -4
  148. package/lib/component/modal/AlignSpectraModal.js +1 -1
  149. package/lib/component/modal/CopyClipboardModal.js +2 -2
  150. package/lib/component/modal/ExportAsMatrixModal.js +1 -1
  151. package/lib/component/modal/ImportPublicationStringModal.js +13 -11
  152. package/lib/component/modal/LoadJCAMPModal.js +1 -1
  153. package/lib/component/modal/ModalStyle.js +1 -1
  154. package/lib/component/modal/MoleculeStructureEditorModal.js +1 -1
  155. package/lib/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
  156. package/lib/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
  157. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +4 -4
  158. package/lib/component/modal/MultipletAnalysisModal.js +5 -5
  159. package/lib/component/modal/PredictSpectraModal.d.ts +0 -28
  160. package/lib/component/modal/PredictSpectraModal.js +31 -54
  161. package/lib/component/modal/SaveAsModal.js +2 -2
  162. package/lib/component/modal/changeSum/ChangeSumModal.js +8 -7
  163. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  164. package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -1
  165. package/lib/component/modal/editRange/EditRangeModal.js +13 -9
  166. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +33 -40
  167. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
  168. package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  169. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  170. package/lib/component/modal/editRange/forms/components/SignalsForm.js +5 -5
  171. package/lib/component/modal/editZone/EditPathLengthFormik.js +3 -3
  172. package/lib/component/modal/editZone/EditZoneModal.js +17 -15
  173. package/lib/component/modal/editZone/SignalFormTab.js +1 -1
  174. package/lib/component/modal/editZone/SignalsForm.js +2 -2
  175. package/lib/component/modal/setting/ControllersTabContent.js +1 -1
  176. package/lib/component/modal/setting/DisplayTabContent.d.ts +2 -2
  177. package/lib/component/modal/setting/DisplayTabContent.js +52 -14
  178. package/lib/component/modal/setting/FormattingTabContent.js +3 -3
  179. package/lib/component/modal/setting/GeneralSettings.js +61 -76
  180. package/lib/component/modal/setting/WorkspaceItem.d.ts +6 -0
  181. package/lib/component/modal/setting/WorkspaceItem.js +59 -0
  182. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
  183. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +2 -2
  184. package/lib/component/panels/InformationPanel.js +4 -4
  185. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
  186. package/lib/component/panels/IntegralsPanel/IntegralTable.js +6 -6
  187. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
  188. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  189. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +10 -1
  190. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +28 -18
  191. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +9 -1
  192. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  193. package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  194. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  195. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
  196. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +3 -3
  197. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
  198. package/lib/component/panels/Panels.js +51 -32
  199. package/lib/component/panels/PeaksPanel/PeaksPanel.js +2 -2
  200. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
  201. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -4
  202. package/lib/component/panels/RangesPanel/RangesHeader.js +16 -14
  203. package/lib/component/panels/RangesPanel/RangesPanel.js +3 -4
  204. package/lib/component/panels/RangesPanel/RangesPreferences.js +4 -5
  205. package/lib/component/panels/RangesPanel/RangesTable.js +3 -3
  206. package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -1
  207. package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
  208. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -6
  209. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +6 -66
  210. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  211. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  212. package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
  213. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  214. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  215. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  216. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +7 -0
  217. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +74 -0
  218. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +7 -0
  219. package/lib/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
  220. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
  221. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
  222. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
  223. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
  224. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
  225. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  226. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
  227. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
  228. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
  229. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
  230. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
  231. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
  232. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  233. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +4 -4
  234. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +1 -1
  235. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -4
  236. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
  237. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +3 -3
  238. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +3 -3
  239. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
  240. package/lib/component/panels/SummaryPanel/Overview.js +2 -2
  241. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  242. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  243. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -4
  244. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
  245. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  246. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  247. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  248. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
  249. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
  250. package/lib/component/panels/ZonesPanel/ZonesPanel.js +4 -7
  251. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
  252. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
  253. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
  254. package/lib/component/panels/databasePanel/DatabasePanel.js +3 -3
  255. package/lib/component/panels/databasePanel/DatabasePreferences.js +3 -4
  256. package/lib/component/panels/databasePanel/DatabaseTable.js +4 -4
  257. package/lib/component/panels/extra/placeholder/NoTableData.js +1 -1
  258. package/lib/component/panels/filtersPanel/FilterPanel.js +2 -2
  259. package/lib/component/panels/filtersPanel/FiltersTable.js +19 -15
  260. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  261. package/lib/component/panels/header/PreferencesHeader.js +1 -1
  262. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +6 -0
  263. package/lib/component/panels/predictionPanel/PredictionOptions.js +90 -0
  264. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +2 -0
  265. package/lib/component/panels/predictionPanel/PredictionPanel.js +35 -0
  266. package/lib/component/reducer/Reducer.d.ts +7 -0
  267. package/lib/component/reducer/Reducer.js +7 -3
  268. package/lib/component/reducer/actions/FiltersActions.js +1 -1
  269. package/lib/component/reducer/actions/LoadActions.d.ts +2 -2
  270. package/lib/component/reducer/actions/LoadActions.js +20 -8
  271. package/lib/component/reducer/actions/MoleculeActions.js +5 -1
  272. package/lib/component/reducer/preferencesReducer.d.ts +183 -36
  273. package/lib/component/reducer/preferencesReducer.js +196 -85
  274. package/lib/component/reducer/types/Types.d.ts +6 -0
  275. package/lib/component/tool/BrushX.js +1 -1
  276. package/lib/component/tool/BrushXY.js +1 -1
  277. package/lib/component/tool/CrossLinePointer.js +1 -1
  278. package/lib/component/toolbar/BasicToolBar.js +23 -27
  279. package/lib/component/toolbar/FunctionToolBar.js +17 -18
  280. package/lib/component/toolbar/HistoryToolBar.js +1 -1
  281. package/lib/component/toolbar/ToolBar.js +2 -2
  282. package/lib/component/utility/FormatNumber.js +1 -1
  283. package/lib/component/workspaces/Workspace.d.ts +17 -0
  284. package/lib/component/workspaces/basic.js +29 -33
  285. package/lib/component/workspaces/exercise.d.ts +2 -0
  286. package/lib/component/workspaces/exercise.js +49 -0
  287. package/lib/component/workspaces/index.d.ts +3 -2
  288. package/lib/component/workspaces/index.js +3 -2
  289. package/lib/component/workspaces/prediction.d.ts +2 -0
  290. package/lib/component/workspaces/prediction.js +26 -0
  291. package/lib/component/workspaces/process1D.js +21 -31
  292. package/lib/data/PredictionManager.d.ts +36 -3
  293. package/lib/data/PredictionManager.js +62 -17
  294. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +4 -1
  295. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -3
  296. package/lib/data/utilities/getAtom.js +1 -1
  297. package/lib/data/utilities/getColor.d.ts +1 -0
  298. package/lib/data/utilities/getColor.js +1 -1
  299. package/lib/types/PanelPreferencesType.d.ts +10 -0
  300. package/lib/types/PanelPreferencesType.js +1 -0
  301. package/lib/versionInfo.js +1 -1
  302. package/lib-cjs/component/1d/Chart1D.js +1 -1
  303. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +1 -1
  304. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +7 -3
  305. package/lib-cjs/component/1d/FooterBanner.js +7 -8
  306. package/lib-cjs/component/1d/Integral.js +2 -2
  307. package/lib-cjs/component/1d/IntegralResizable.js +1 -1
  308. package/lib-cjs/component/1d/IntegralsSeries.js +2 -2
  309. package/lib-cjs/component/1d/Line.js +5 -1
  310. package/lib-cjs/component/1d/LinesSeries.js +1 -1
  311. package/lib-cjs/component/1d/PeakAnnotation.js +3 -3
  312. package/lib-cjs/component/1d/PeakAnnotations.js +1 -1
  313. package/lib-cjs/component/1d/Resizable.js +2 -2
  314. package/lib-cjs/component/1d/ResurrectedDatabaseRanges.js +1 -1
  315. package/lib-cjs/component/1d/SpectraTracker.js +3 -3
  316. package/lib-cjs/component/1d/Viewer1D.js +10 -6
  317. package/lib-cjs/component/1d/XAxis.js +6 -2
  318. package/lib-cjs/component/1d/YAxis.js +6 -2
  319. package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +3 -4
  320. package/lib-cjs/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
  321. package/lib-cjs/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  322. package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  323. package/lib-cjs/component/1d/jCouplingGraph/JsCouplings.js +2 -2
  324. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  325. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  326. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
  327. package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
  328. package/lib-cjs/component/1d/multiplicityTree/TreeNodes.js +2 -2
  329. package/lib-cjs/component/1d/ranges/Range.js +2 -2
  330. package/lib-cjs/component/1d/ranges/RangeIntegral.js +1 -1
  331. package/lib-cjs/component/1d/ranges/Ranges.js +2 -2
  332. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -1
  333. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  334. package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
  335. package/lib-cjs/component/1d/tool/XLabelPointer.js +1 -1
  336. package/lib-cjs/component/2d/Chart2D.js +2 -2
  337. package/lib-cjs/component/2d/Contours.js +6 -6
  338. package/lib-cjs/component/2d/FooterBanner.js +3 -3
  339. package/lib-cjs/component/2d/Left1DChart.js +6 -2
  340. package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
  341. package/lib-cjs/component/2d/Top1DChart.js +6 -2
  342. package/lib-cjs/component/2d/Viewer2D.js +8 -4
  343. package/lib-cjs/component/2d/XAxis.js +6 -2
  344. package/lib-cjs/component/2d/YAxis.js +6 -2
  345. package/lib-cjs/component/2d/tools/XYLabelPointer.js +1 -1
  346. package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +6 -2
  347. package/lib-cjs/component/2d/tools/slicing/SlicingView.js +1 -1
  348. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +6 -2
  349. package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
  350. package/lib-cjs/component/2d/zones/Signal.js +2 -2
  351. package/lib-cjs/component/2d/zones/SignalCrosshair.js +1 -1
  352. package/lib-cjs/component/2d/zones/Zone.js +1 -1
  353. package/lib-cjs/component/2d/zones/Zones.js +2 -2
  354. package/lib-cjs/component/ErrorOverlay.js +1 -1
  355. package/lib-cjs/component/EventsTrackers/BrushTracker.js +1 -1
  356. package/lib-cjs/component/EventsTrackers/MouseTracker.js +1 -1
  357. package/lib-cjs/component/NMRium.js +14 -17
  358. package/lib-cjs/component/assignment/index.js +1 -1
  359. package/lib-cjs/component/context/PreferencesContext.js +33 -4
  360. package/lib-cjs/component/elements/Button.js +1 -1
  361. package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
  362. package/lib-cjs/component/elements/CheckBox.js +1 -1
  363. package/lib-cjs/component/elements/CloseButton.js +1 -1
  364. package/lib-cjs/component/elements/ColorInput.js +1 -1
  365. package/lib-cjs/component/elements/ContextMenu.js +1 -1
  366. package/lib-cjs/component/elements/DeleteButton.js +1 -1
  367. package/lib-cjs/component/elements/EditableColumn.js +1 -1
  368. package/lib-cjs/component/elements/Input.js +1 -1
  369. package/lib-cjs/component/elements/InputRange.js +1 -1
  370. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  371. package/lib-cjs/component/elements/Label.js +1 -1
  372. package/lib-cjs/component/elements/Logo.js +1 -1
  373. package/lib-cjs/component/elements/MenuButton.js +3 -3
  374. package/lib-cjs/component/elements/MolecularFormulaInput.js +1 -1
  375. package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
  376. package/lib-cjs/component/elements/NextPrev.js +2 -2
  377. package/lib-cjs/component/elements/NumberInput.js +1 -1
  378. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
  379. package/lib-cjs/component/elements/ReactTable/ReactTable.js +8 -4
  380. package/lib-cjs/component/elements/ReactTable/ReactTableExpandable.js +3 -3
  381. package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  382. package/lib-cjs/component/elements/SaveButton.js +1 -1
  383. package/lib-cjs/component/elements/Select.js +1 -1
  384. package/lib-cjs/component/elements/Tab/DeleteButton.js +1 -1
  385. package/lib-cjs/component/elements/Tab/Tab.js +3 -3
  386. package/lib-cjs/component/elements/Tab/Tabs.js +2 -2
  387. package/lib-cjs/component/elements/Table/Table.js +1 -1
  388. package/lib-cjs/component/elements/Table/TableBody.js +1 -1
  389. package/lib-cjs/component/elements/Table/TableCell.js +1 -1
  390. package/lib-cjs/component/elements/Table/TableHead.js +1 -1
  391. package/lib-cjs/component/elements/Table/TableRow.js +1 -1
  392. package/lib-cjs/component/elements/ToggleButton.js +1 -1
  393. package/lib-cjs/component/elements/ToolTip/ToolTip.js +2 -2
  394. package/lib-cjs/component/elements/ToolbarMenu.js +3 -3
  395. package/lib-cjs/component/elements/accordion/Accordion.js +1 -1
  396. package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
  397. package/lib-cjs/component/elements/dropDownButton/DropDownButton.js +32 -34
  398. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +39 -25
  399. package/lib-cjs/component/elements/formik/ErrorMessage.js +2 -2
  400. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  401. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  402. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  403. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
  404. package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
  405. package/lib-cjs/component/elements/formik/FormikForm.js +1 -1
  406. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  407. package/lib-cjs/component/elements/formik/FormikNumberInput.js +1 -1
  408. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  409. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  410. package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
  411. package/lib-cjs/component/elements/formik/Input.js +1 -1
  412. package/lib-cjs/component/elements/formik/SelectBox.js +1 -1
  413. package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
  414. package/lib-cjs/component/elements/popup/Alert/ProgressIndicator.js +1 -1
  415. package/lib-cjs/component/elements/popup/Alert/Provider.js +3 -3
  416. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  417. package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
  418. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
  419. package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -3
  420. package/lib-cjs/component/elements/popup/Transition.js +1 -1
  421. package/lib-cjs/component/elements/popup/Wrapper.js +1 -1
  422. package/lib-cjs/component/elements/toggle/ToggleButton.js +1 -1
  423. package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +1 -1
  424. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -3
  425. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -2
  426. package/lib-cjs/component/header/Header.js +27 -13
  427. package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +7 -3
  428. package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -2
  429. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
  430. package/lib-cjs/component/header/Zones2DOptionPanel.js +1 -1
  431. package/lib-cjs/component/highlight/index.js +1 -1
  432. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  433. package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -4
  434. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +1 -1
  435. package/lib-cjs/component/hooks/useExport.js +15 -13
  436. package/lib-cjs/component/hooks/useTableSortBy.js +27 -16
  437. package/lib-cjs/component/loader/DefaultSpinnerComponent.js +1 -1
  438. package/lib-cjs/component/loader/DropZone.js +2 -2
  439. package/lib-cjs/component/loader/NoData.js +1 -3
  440. package/lib-cjs/component/loader/Spinner.js +1 -1
  441. package/lib-cjs/component/loader/SpinnerContext.js +1 -1
  442. package/lib-cjs/component/modal/AboutUsModal.js +4 -4
  443. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
  444. package/lib-cjs/component/modal/CopyClipboardModal.js +2 -2
  445. package/lib-cjs/component/modal/ExportAsMatrixModal.js +1 -1
  446. package/lib-cjs/component/modal/ImportPublicationStringModal.js +18 -12
  447. package/lib-cjs/component/modal/LoadJCAMPModal.js +1 -1
  448. package/lib-cjs/component/modal/ModalStyle.js +1 -1
  449. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +1 -1
  450. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
  451. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
  452. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +9 -5
  453. package/lib-cjs/component/modal/MultipletAnalysisModal.js +5 -5
  454. package/lib-cjs/component/modal/PredictSpectraModal.js +36 -55
  455. package/lib-cjs/component/modal/SaveAsModal.js +2 -2
  456. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +13 -8
  457. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  458. package/lib-cjs/component/modal/editRange/EditRangeModal.js +13 -9
  459. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +38 -41
  460. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
  461. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  462. package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  463. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +5 -5
  464. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +5 -1
  465. package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +3 -3
  466. package/lib-cjs/component/modal/editZone/EditZoneModal.js +17 -15
  467. package/lib-cjs/component/modal/editZone/SignalFormTab.js +1 -1
  468. package/lib-cjs/component/modal/editZone/SignalsForm.js +2 -2
  469. package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +5 -1
  470. package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
  471. package/lib-cjs/component/modal/setting/DisplayTabContent.js +51 -13
  472. package/lib-cjs/component/modal/setting/FormattingTabContent.js +3 -3
  473. package/lib-cjs/component/modal/setting/GeneralSettings.js +64 -75
  474. package/lib-cjs/component/modal/setting/WorkspaceItem.js +64 -0
  475. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
  476. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +2 -2
  477. package/lib-cjs/component/panels/InformationPanel.js +4 -4
  478. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
  479. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +6 -6
  480. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
  481. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  482. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +28 -18
  483. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  484. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  485. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  486. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
  487. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +8 -4
  488. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
  489. package/lib-cjs/component/panels/Panels.js +51 -32
  490. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +2 -2
  491. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
  492. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +9 -5
  493. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +16 -14
  494. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +3 -4
  495. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -5
  496. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -3
  497. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -1
  498. package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
  499. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +5 -65
  500. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  501. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  502. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
  503. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  504. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  505. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  506. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +80 -0
  507. package/lib-cjs/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
  508. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
  509. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
  510. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
  511. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
  512. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
  513. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  514. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
  515. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
  516. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
  517. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
  518. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
  519. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
  520. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  521. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +4 -4
  522. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +1 -1
  523. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -4
  524. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
  525. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +8 -4
  526. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +3 -3
  527. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
  528. package/lib-cjs/component/panels/SummaryPanel/Overview.js +2 -2
  529. package/lib-cjs/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  530. package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  531. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +4 -4
  532. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
  533. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  534. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  535. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  536. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
  537. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
  538. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +4 -7
  539. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
  540. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -2
  541. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
  542. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -3
  543. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -4
  544. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +4 -4
  545. package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +1 -1
  546. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +2 -2
  547. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +19 -15
  548. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +2 -2
  549. package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
  550. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +118 -0
  551. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +41 -0
  552. package/lib-cjs/component/reducer/IgnoreActions.js +5 -1
  553. package/lib-cjs/component/reducer/Reducer.js +14 -5
  554. package/lib-cjs/component/reducer/actions/FiltersActions.js +6 -2
  555. package/lib-cjs/component/reducer/actions/LoadActions.js +25 -9
  556. package/lib-cjs/component/reducer/actions/MoleculeActions.js +10 -2
  557. package/lib-cjs/component/reducer/actions/RangesActions.js +5 -1
  558. package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -1
  559. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +5 -1
  560. package/lib-cjs/component/reducer/actions/ToolsActions.js +5 -1
  561. package/lib-cjs/component/reducer/actions/ZonesActions.js +5 -1
  562. package/lib-cjs/component/reducer/preferencesReducer.js +195 -83
  563. package/lib-cjs/component/tool/BrushX.js +1 -1
  564. package/lib-cjs/component/tool/BrushXY.js +1 -1
  565. package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
  566. package/lib-cjs/component/toolbar/BasicToolBar.js +23 -27
  567. package/lib-cjs/component/toolbar/FunctionToolBar.js +22 -19
  568. package/lib-cjs/component/toolbar/HistoryToolBar.js +1 -1
  569. package/lib-cjs/component/toolbar/ToolBar.js +2 -2
  570. package/lib-cjs/component/toolbar/ToolTypes.js +5 -1
  571. package/lib-cjs/component/utility/FormatNumber.js +1 -1
  572. package/lib-cjs/component/workspaces/basic.js +29 -33
  573. package/lib-cjs/component/workspaces/exercise.js +52 -0
  574. package/lib-cjs/component/workspaces/index.js +3 -2
  575. package/lib-cjs/component/workspaces/prediction.js +29 -0
  576. package/lib-cjs/component/workspaces/process1D.js +21 -31
  577. package/lib-cjs/data/Filters.js +5 -1
  578. package/lib-cjs/data/FiltersManager.js +5 -1
  579. package/lib-cjs/data/PredictionManager.js +62 -17
  580. package/lib-cjs/data/SpectraManager.js +5 -1
  581. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -2
  582. package/lib-cjs/data/data1d/Spectrum1D/shift/getShiftX.js +5 -1
  583. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +7 -4
  584. package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +5 -1
  585. package/lib-cjs/data/utilities/getAtom.js +1 -1
  586. package/lib-cjs/data/utilities/getColor.js +2 -1
  587. package/lib-cjs/types/PanelPreferencesType.js +2 -0
  588. package/lib-cjs/versionInfo.js +1 -1
  589. package/package.json +21 -21
  590. package/lib/component/panels/RangesPanel/useMapRanges.d.ts +0 -6
  591. package/lib/component/workspaces/exercise1D.d.ts +0 -2
  592. package/lib/component/workspaces/exercise1D.js +0 -45
  593. package/lib-cjs/component/workspaces/exercise1D.js +0 -48
@@ -1,32 +1,20 @@
1
1
  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
- import { useCallback, useRef, useState } from 'react';
5
- import { usePreferences } from '../../context/PreferencesContext';
4
+ import { useCallback, useMemo, useRef, useState } from 'react';
5
+ import { usePreferences, useWorkspacesList, } from '../../context/PreferencesContext';
6
6
  import CloseButton from '../../elements/CloseButton';
7
7
  import Tab from '../../elements/Tab/Tab';
8
8
  import Tabs, { PositionsEnum } from '../../elements/Tab/Tabs';
9
+ import DropDownButton from '../../elements/dropDownButton/DropDownButton';
9
10
  import FormikForm from '../../elements/formik/FormikForm';
10
11
  import { useAlert } from '../../elements/popup/Alert';
11
- import { SET_PREFERENCES, RESET_PREFERENCES, } from '../../reducer/preferencesReducer';
12
+ import { ModalStyles } from '../ModalStyle';
12
13
  import ControllersTabContent from './ControllersTabContent';
13
14
  import DisplayTabContent from './DisplayTabContent';
14
15
  import FormattingTabContent from './FormattingTabContent';
16
+ import WorkspaceItem from './WorkspaceItem';
15
17
  const styles = css `
16
- overflow: auto;
17
- height: 100%;
18
- display: flex;
19
- flex-direction: column;
20
-
21
- .header {
22
- text-align: center;
23
- padding: 10px 0 10px 0px;
24
- margin: 0px;
25
- color: #005d9e;
26
- place-items: normal;
27
- text-transform: none;
28
- background-color: #fcfcfc;
29
- }
30
18
  .main-content {
31
19
  width: 100%;
32
20
  flex: 1;
@@ -38,57 +26,6 @@ const styles = css `
38
26
  width: 100%;
39
27
  }
40
28
 
41
- .inner-content {
42
- padding: 15px 30px;
43
- width: 100%;
44
- overflow: auto;
45
- }
46
-
47
- button:focus {
48
- outline: none;
49
- }
50
- button:hover {
51
- color: #007bff;
52
- }
53
- .btn:hover {
54
- background-color: #ffffff;
55
- }
56
- .btn {
57
- border: none;
58
- padding: 0 15px;
59
- background-color: #ffffff5e;
60
- border-radius: 5px;
61
- height: 25px;
62
- }
63
-
64
- .footer-container {
65
- display: flex;
66
- align-items: flex-end;
67
- justify-content: flex-end;
68
- background: rgb(242, 242, 242);
69
- background: -moz-linear-gradient(
70
- 0deg,
71
- rgba(242, 242, 242, 1) 0%,
72
- rgba(245, 245, 245, 1) 37%,
73
- rgba(255, 255, 255, 1) 90%
74
- );
75
- background: -webkit-linear-gradient(
76
- 0deg,
77
- rgba(242, 242, 242, 1) 0%,
78
- rgba(245, 245, 245, 1) 37%,
79
- rgba(255, 255, 255, 1) 90%
80
- );
81
- background: linear-gradient(
82
- 0deg,
83
- rgba(242, 242, 242, 1) 0%,
84
- rgba(245, 245, 245, 1) 37%,
85
- rgba(255, 255, 255, 1) 90%
86
- );
87
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#f2f2f2",endColorstr="#ffffff",GradientType=1);
88
- padding: 6px 15px;
89
- height: 55px;
90
- }
91
-
92
29
  .section-header {
93
30
  font-size: 13px;
94
31
  color: #2ca8ff;
@@ -135,31 +72,79 @@ const styles = css `
135
72
  width: 260px;
136
73
  }
137
74
  }
138
- .checkbox-element {
139
- margin-bottom: 5px;
75
+
76
+ .workspace-container {
77
+ display: flex;
78
+ background-color: #f4f4f4;
79
+ align-items: center;
80
+ cursor: default;
81
+ padding: 0.5em;
82
+ .dropdown {
83
+ padding: 0.4em 1em;
84
+ }
85
+ & .label {
86
+ font-size: 0.8em;
87
+ }
140
88
  }
141
89
  `;
142
90
  function GeneralSettings({ onClose }) {
143
91
  const [activeTab, setActiveTab] = useState('controllers');
144
- const preferences = usePreferences();
92
+ const { dispatch, ...preferences } = usePreferences();
145
93
  const alert = useAlert();
146
94
  const refForm = useRef();
95
+ const workspaces = useWorkspacesList();
96
+ const workspacesList = useMemo(() => {
97
+ return workspaces.concat([
98
+ {
99
+ key: 'new',
100
+ label: 'Custom workspace',
101
+ },
102
+ ]);
103
+ }, [workspaces]);
147
104
  const handleSave = useCallback(() => {
148
105
  refForm.current.submitForm();
149
106
  }, []);
150
107
  const handleReset = useCallback(() => {
151
- preferences.dispatch({ type: RESET_PREFERENCES });
108
+ dispatch({ type: 'RESET_PREFERENCES' });
152
109
  alert.success('Settings saved successfully');
153
110
  onClose?.();
154
- }, [alert, onClose, preferences]);
111
+ }, [alert, dispatch, onClose]);
155
112
  const submitHandler = useCallback((values) => {
156
- preferences.dispatch({ type: SET_PREFERENCES, payload: values });
113
+ dispatch({ type: 'SET_PREFERENCES', payload: values });
157
114
  alert.success('Settings saved successfully');
158
115
  onClose?.();
159
- }, [alert, onClose, preferences]);
116
+ }, [alert, dispatch, onClose]);
160
117
  const tabChangeHandler = useCallback((tab) => {
161
118
  setActiveTab(tab.tabid);
162
119
  }, []);
163
- return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }, void 0), _jsx(CloseButton, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}, void 0) }, void 0) }, void 0), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}, void 0) }, void 0) }, void 0), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences }, void 0) }, void 0) }, void 0)] }, void 0) }, void 0) }, void 0), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", onClick: handleReset, className: "btn", children: "Reset" }, void 0), _jsx("button", { type: "button", onClick: handleSave, className: "btn", children: "Save" }, void 0)] }, void 0)] }, void 0));
120
+ const addWorkSpaceHandler = useCallback((name) => {
121
+ dispatch({
122
+ type: 'ADD_WORKSPACE',
123
+ payload: {
124
+ workspace: name,
125
+ data: refForm.current.values,
126
+ },
127
+ });
128
+ }, [dispatch]);
129
+ const deleteWorkSpaceHandler = useCallback((key) => {
130
+ dispatch({
131
+ type: 'REMOVE_WORKSPACE',
132
+ payload: {
133
+ workspace: key,
134
+ },
135
+ });
136
+ }, [dispatch]);
137
+ const ChangeWorkspaceHandler = useCallback((option) => {
138
+ dispatch({
139
+ type: 'SET_WORKSPACE',
140
+ payload: {
141
+ workspace: option.key,
142
+ },
143
+ });
144
+ }, [dispatch]);
145
+ const renderItem = useCallback((item) => {
146
+ return (_jsx(WorkspaceItem, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
147
+ }, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
148
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences.current, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", onClick: handleSave, className: "btn", children: "Save" }), _jsx("button", { type: "button", onClick: handleReset, className: "btn", children: "Reset" })] })] }));
164
149
  }
165
150
  export default GeneralSettings;
@@ -0,0 +1,6 @@
1
+ declare const WorkspaceItem: ({ item, onSave, onDelete }: {
2
+ item: any;
3
+ onSave: any;
4
+ onDelete: any;
5
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export default WorkspaceItem;
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { css } from '@emotion/react';
4
+ import { useCallback, useState } from 'react';
5
+ import workspaces from '../../workspaces';
6
+ const styles = css `
7
+ .container {
8
+ display: flex;
9
+ span {
10
+ padding: 5px !important;
11
+ }
12
+ span {
13
+ flex: 1;
14
+ text-align: left !important;
15
+ }
16
+ }
17
+
18
+ .new-container {
19
+ background-color: #f6f6f6;
20
+ display: flex;
21
+ padding: 0.3em;
22
+
23
+ input {
24
+ padding: 0.5em;
25
+ color: black;
26
+ outline: none;
27
+ background-color: transparent !important;
28
+ }
29
+ }
30
+
31
+ .delete-button:hover {
32
+ color: white;
33
+ }
34
+
35
+ .save-button:hover {
36
+ color: green;
37
+ }
38
+ .delete-button,
39
+ .save-button {
40
+ padding: 5px;
41
+ }
42
+ `;
43
+ const WorkspaceItem = ({ item, onSave, onDelete }) => {
44
+ const [name, setName] = useState('');
45
+ const addWorkspaceHandler = useCallback((e) => {
46
+ e.stopPropagation();
47
+ setName('');
48
+ onSave(name);
49
+ }, [name, onSave]);
50
+ const deleteWorkspaceHandler = useCallback((e) => {
51
+ e.stopPropagation();
52
+ onDelete(item.key);
53
+ }, [item.key, onDelete]);
54
+ const onTextChange = useCallback((e) => {
55
+ setName(e.target.value);
56
+ }, []);
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
+ };
59
+ export default WorkspaceItem;
@@ -8,6 +8,6 @@ import DefaultPanelHeader from '../header/DefaultPanelHeader';
8
8
  function AutomaticAssignment() {
9
9
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10
10
  const automaticAssignmentHandler = useCallback(() => { }, []);
11
- return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { showSettingButton: false, canDelete: false, children: _jsx(Button, { popupTitle: "automatic assignment", onClick: automaticAssignmentHandler, children: _jsx(SvgNmrAssignment2, { style: { fontSize: '18px' } }, void 0) }, void 0) }, void 0), _jsx("div", { className: "inner-container" }, void 0)] }, void 0));
11
+ return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { showSettingButton: false, canDelete: false, children: _jsx(Button, { popupTitle: "automatic assignment", onClick: automaticAssignmentHandler, children: _jsx(SvgNmrAssignment2, { style: { fontSize: '18px' } }) }) }), _jsx("div", { className: "inner-container" })] }));
12
12
  }
13
13
  export default AutomaticAssignment;
@@ -30,9 +30,9 @@ function PeaksTable({ data }) {
30
30
  minWidth: '24px',
31
31
  },
32
32
  id: 'assign-button',
33
- Cell: ({ row }) => (_jsx("button", { type: "button", className: "assign-button", onClick: (e) => assignHandler(e, row), children: _jsx(SvgNmrAssignment, {}, void 0) }, void 0)),
33
+ Cell: ({ row }) => (_jsx("button", { type: "button", className: "assign-button", onClick: (e) => assignHandler(e, row), children: _jsx(SvgNmrAssignment, {}) })),
34
34
  },
35
35
  ], [assignHandler]);
36
- return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: COLUMNS }, void 0)) : (_jsx(NoTableData, {}, void 0));
36
+ return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: COLUMNS })) : (_jsx(NoTableData, {}));
37
37
  }
38
38
  export default memo(PeaksTable);
@@ -54,7 +54,7 @@ function InformationPanelInner({ info, meta }) {
54
54
  minWidth: 100,
55
55
  width: 20,
56
56
  maxWidth: 20,
57
- Cell: ({ row }) => (_jsx("p", { style: { padding: '5px', backgroundColor: 'white' }, children: row.original }, void 0)),
57
+ Cell: ({ row }) => (_jsx("p", { style: { padding: '5px', backgroundColor: 'white' }, children: row.original })),
58
58
  },
59
59
  {
60
60
  Header: 'Value',
@@ -67,14 +67,14 @@ function InformationPanelInner({ info, meta }) {
67
67
  fontFamily: 'monospace',
68
68
  whiteSpace: 'pre',
69
69
  overflow: 'hidden',
70
- }, children: `${information[row.original]}` }, void 0)),
70
+ }, children: `${information[row.original]}` })),
71
71
  },
72
72
  ], [information]);
73
- return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx("input", { type: "text", style: styles.searchInput, placeholder: "Search for parameter...", onChange: handleSearch, ref: searchRef }, void 0) }, void 0), _jsx("div", { style: styles.tableContainer, children: _jsx(ReactTableFlexLayout, { data: matches, columns: columns }, void 0) }, void 0)] }, void 0));
73
+ return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx("input", { type: "text", style: styles.searchInput, placeholder: "Search for parameter...", onChange: handleSearch, ref: searchRef }) }), _jsx("div", { style: styles.tableContainer, children: _jsx(ReactTableFlexLayout, { data: matches, columns: columns }) })] }));
74
74
  }
75
75
  const MemoizedInformationPanel = memo(InformationPanelInner);
76
76
  const emptyData = { info: {}, meta: {} };
77
77
  export default function InformationPanel() {
78
78
  const { info, meta } = useSpectrum(emptyData);
79
- return _jsx(MemoizedInformationPanel, { ...{ info, meta } }, void 0);
79
+ return _jsx(MemoizedInformationPanel, { ...{ info, meta } });
80
80
  }
@@ -59,7 +59,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, preferences,
59
59
  const showChangeIntegralSumModal = useCallback(() => {
60
60
  modal.show(_jsx(ChangeSumModal, { onClose: () => modal.close(), onSave: changeIntegralSumHandler, header: currentSum
61
61
  ? `Set new Integrals Sum (Current: ${Number(currentSum).toFixed(2)})`
62
- : 'Set new Integrals Sum', sumOptions: integrals?.options }, void 0));
62
+ : 'Set new Integrals Sum', sumOptions: integrals?.options }));
63
63
  }, [changeIntegralSumHandler, currentSum, integrals?.options, modal]);
64
64
  const settingsPanelHandler = useCallback(() => {
65
65
  setFlipStatus(!isFlipped);
@@ -108,7 +108,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, preferences,
108
108
  ? 'Show all integrals'
109
109
  : 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: currentSum
110
110
  ? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
111
- : 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}, void 0) }, void 0) }, void 0), _jsx(ToggleButton, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: _jsx(ImLink, {}, void 0) }, void 0)] }, void 0)), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab, preferences: preferences }, void 0)) : (_jsx(IntegralsPreferences, { ref: settingRef }, void 0)) }, void 0)] }, void 0) }, void 0));
111
+ : 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(ToggleButton, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: _jsx(ImLink, {}) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab, preferences: preferences })) : (_jsx(IntegralsPreferences, { ref: settingRef })) })] }) }));
112
112
  }
113
113
  const MemoizedIntegralPanel = memo(IntegralPanelInner);
114
114
  const emptyData = { integrals: {}, info: {} };
@@ -119,8 +119,8 @@ export default function IntegralPanel() {
119
119
  return (_jsx(MemoizedIntegralPanel, { ...{
120
120
  integrals,
121
121
  info,
122
- preferences,
122
+ preferences: preferences.current,
123
123
  xDomain,
124
124
  activeTab,
125
- } }, void 0));
125
+ } }));
126
126
  }
@@ -60,13 +60,13 @@ function IntegralTable({ activeTab, data, preferences }) {
60
60
  sortType: 'basic',
61
61
  resizable: true,
62
62
  accessor: (row) => row.kind,
63
- Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), data: SignalKinds, style: selectStyle, defaultValue: row.original.kind }, void 0)),
63
+ Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), data: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
64
64
  },
65
65
  {
66
66
  index: 7,
67
67
  style: { width: '1%', maxWidth: '24px', minWidth: '24px' },
68
68
  id: 'delete-button',
69
- Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: _jsx(FaRegTrashAlt, {}, void 0) }, void 0)),
69
+ Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: _jsx(FaRegTrashAlt, {}) })),
70
70
  },
71
71
  ], [changeIntegralDataHandler, deleteIntegralHandler]);
72
72
  const saveRelativeHandler = useCallback((event, row) => {
@@ -76,7 +76,7 @@ function IntegralTable({ activeTab, data, preferences }) {
76
76
  payload: { data },
77
77
  });
78
78
  }, [dispatch]);
79
- const integralsPreferences = useMemo(() => getValue(preferences, `formatting.panels.integrals.[${activeTab}]`, integralDefaultValues), [activeTab, preferences]);
79
+ const integralsPreferences = useMemo(() => getValue(preferences.current, `formatting.panels.integrals.[${activeTab}]`, integralDefaultValues), [activeTab, preferences]);
80
80
  const COLUMNS = useMemo(() => [
81
81
  {
82
82
  showWhen: 'showAbsolute',
@@ -90,7 +90,7 @@ function IntegralTable({ activeTab, data, preferences }) {
90
90
  id: 'relative',
91
91
  Header: () => {
92
92
  const n = activeTab?.replace(/[0-9]/g, '');
93
- return _jsx("span", { children: `Relative ${n}` }, void 0);
93
+ return _jsx("span", { children: `Relative ${n}` });
94
94
  },
95
95
  accessor: (row) => {
96
96
  return formatNumber(row.integral, lodashGet(integralsPreferences, 'relativeFormat', integralDefaultValues.relativeFormat));
@@ -99,7 +99,7 @@ function IntegralTable({ activeTab, data, preferences }) {
99
99
  const value = formatNumber(row.original.integral, lodashGet(integralsPreferences, 'relativeFormat', integralDefaultValues.relativeFormat));
100
100
  const flag = checkIntegralKind(row.original);
101
101
  const integral = flag ? value : `[ ${value} ]`;
102
- return (_jsx(EditableColumn, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }, void 0));
102
+ return (_jsx(EditableColumn, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
103
103
  },
104
104
  },
105
105
  ], [activeTab, integralsPreferences, saveRelativeHandler]);
@@ -113,6 +113,6 @@ function IntegralTable({ activeTab, data, preferences }) {
113
113
  }
114
114
  return columns.sort((object1, object2) => object1.index - object2.index);
115
115
  }, [COLUMNS, initialColumns, integralsPreferences]);
116
- return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: tableColumns }, void 0)) : (_jsx(NoTableData, {}, void 0));
116
+ return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: tableColumns })) : (_jsx(NoTableData, {}));
117
117
  }
118
118
  export default memo(IntegralTable);
@@ -8,7 +8,6 @@ import FormikForm from '../../elements/formik/FormikForm';
8
8
  import FormikNumberInput from '../../elements/formik/FormikNumberInput';
9
9
  import { useAlert } from '../../elements/popup/Alert';
10
10
  import useNucleus from '../../hooks/useNucleus';
11
- import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
12
11
  import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
13
12
  import { integralDefaultValues } from '../extra/preferences/defaultValues';
14
13
  const styles = {
@@ -65,7 +64,7 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
65
64
  const updateValues = useCallback(() => {
66
65
  if (nucleus) {
67
66
  const { color, strokeWidth, ...restProps } = integralDefaultValues;
68
- const integralPreferences = getValueByKeyPath(preferences, `formatting.panels.integrals`);
67
+ const integralPreferences = getValueByKeyPath(preferences.current, `formatting.panels.integrals`);
69
68
  let defaultValues = nucleus.reduce((acc, nucleusLabel) => {
70
69
  acc[nucleusLabel] = restProps;
71
70
  return acc;
@@ -79,7 +78,7 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
79
78
  }, [updateValues]);
80
79
  const saveHandler = useCallback((values) => {
81
80
  preferences.dispatch({
82
- type: SET_PANELS_PREFERENCES,
81
+ type: 'SET_PANELS_PREFERENCES',
83
82
  payload: { key: 'integrals', value: values },
84
83
  });
85
84
  alert.success('Integrals preferences saved successfully');
@@ -89,14 +88,14 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
89
88
  formRef.current.submitForm();
90
89
  },
91
90
  }));
92
- return (_jsx("div", { style: styles.container, children: _jsxs(FormikForm, { onSubmit: saveHandler, ref: formRef, children: [_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: "General" }, void 0), _jsx(FormikColorInput, { name: "color" }, void 0), _jsx(FormikNumberInput, { name: "strokeWidth", label: "stroke width :", style: {
91
+ return (_jsx("div", { style: styles.container, children: _jsxs(FormikForm, { onSubmit: saveHandler, ref: formRef, children: [_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: "General" }), _jsx(FormikColorInput, { name: "color" }), _jsx(FormikNumberInput, { name: "strokeWidth", label: "stroke width :", style: {
93
92
  label: { fontSize: '11px', fontWeight: 'bold', color: '#232323' },
94
93
  input: {
95
94
  width: '60%',
96
95
  textAlign: 'center',
97
96
  borderRadius: '5px',
98
97
  },
99
- }, min: 1, max: 9, pattern: "[1-9]+" }, void 0)] }, void 0), nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: _jsx(MF, { mf: nucleusLabel }, void 0) }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel)))] }, void 0) }, void 0));
98
+ }, min: 1, max: 9, pattern: "[1-9]+" })] }), nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: _jsx(MF, { mf: nucleusLabel }) }), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel)))] }) }));
100
99
  }
101
100
  const MemoizedIntegralsPreferences = memo(IntegralsPreferencesInner);
102
101
  // TODO: remove this hacky use of ref.
@@ -106,6 +105,6 @@ function IntegralsPreferences(props, ref) {
106
105
  return (_jsx(MemoizedIntegralsPreferences, { innerRef: ref, ...{
107
106
  nucleus,
108
107
  preferences,
109
- } }, void 0));
108
+ } }));
110
109
  }
111
110
  export default forwardRef(IntegralsPreferences);
@@ -15,7 +15,7 @@ function MatrixGenerationPanel() {
15
15
  const dispatch = useDispatch();
16
16
  const openFiltersModal = useCallback(() => {
17
17
  dispatch({ type: RESET_SELECTED_TOOL });
18
- modal.show(_jsx(MultipleSpectraFiltersModal, {}, void 0), {
18
+ modal.show(_jsx(MultipleSpectraFiltersModal, {}), {
19
19
  isBackgroundBlur: false,
20
20
  position: positions.TOP_CENTER,
21
21
  width: 550,
@@ -24,12 +24,12 @@ function MatrixGenerationPanel() {
24
24
  }, [modal, dispatch]);
25
25
  const openExportAsMatrixModal = useCallback(() => {
26
26
  dispatch({ type: RESET_SELECTED_TOOL });
27
- modal.show(_jsx(ExportAsMatrixModal, {}, void 0), {
27
+ modal.show(_jsx(ExportAsMatrixModal, {}), {
28
28
  isBackgroundBlur: false,
29
29
  position: positions.TOP_CENTER,
30
30
  width: 500,
31
31
  });
32
32
  }, [modal, dispatch]);
33
- return (_jsxs("div", { css: tablePanelStyle, children: [_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, children: [_jsx(Button, { popupTitle: "Add Filter", onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(Button, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: _jsx(SvgNmrExportAsMatrix, {}, void 0) }, void 0)] }, void 0), _jsx("div", { className: "inner-container" }, void 0)] }, void 0));
33
+ return (_jsxs("div", { css: tablePanelStyle, children: [_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, children: [_jsx(Button, { popupTitle: "Add Filter", onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }) }), _jsx(Button, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: _jsx(SvgNmrExportAsMatrix, {}) })] }), _jsx("div", { className: "inner-container" })] }));
34
34
  }
35
35
  export default MatrixGenerationPanel;
@@ -1 +1,10 @@
1
- export default function MoleculePanel(): import("@emotion/react/jsx-runtime").JSX.Element;
1
+ import { ReactElement } from 'react';
2
+ import { Molecule } from '../../../data/molecules/Molecule';
3
+ import { MoleculeHeaderActionsOptions } from './MoleculePanelHeader';
4
+ interface MoleculePanelProps {
5
+ onMoleculeChange?: (molecule: Molecule) => void;
6
+ children?: ReactElement;
7
+ actionsOptions?: MoleculeHeaderActionsOptions;
8
+ }
9
+ export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -18,16 +18,21 @@ import useAtomAssignment from './useAtomAssignment';
18
18
  const styles = {
19
19
  panel: css({
20
20
  display: 'flex',
21
+ overflow: 'auto',
21
22
  flexGrow: 1,
22
23
  width: '100%',
23
24
  height: '100%',
24
25
  flexDirection: 'column',
25
26
  }),
26
- molecule: css({
27
+ innerPanel: css({
27
28
  display: 'flex',
28
- flex: '1 1 0%',
29
+ flex: '1',
29
30
  flexDirection: 'column',
30
- minHeight: 0,
31
+ overflow: 'auto',
32
+ }),
33
+ molecule: css({
34
+ display: 'flex',
35
+ flex: '1',
31
36
  }),
32
37
  toolbar: css({
33
38
  display: 'flex',
@@ -52,7 +57,7 @@ const styles = {
52
57
  minHeight: 0,
53
58
  }),
54
59
  };
55
- function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, }) {
60
+ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, }) {
56
61
  const [currentIndex, setCurrentIndex] = useState(0);
57
62
  const [molecules, setMolecules] = useState([]);
58
63
  const dispatch = useDispatch();
@@ -68,11 +73,14 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
68
73
  });
69
74
  }
70
75
  }, [molecules.length, moleculesProp]);
76
+ useEffect(() => {
77
+ onMoleculeChange?.(molecules[currentIndex] || null);
78
+ }, [currentIndex, molecules, onMoleculeChange]);
71
79
  const handleReplaceMolecule = useCallback((key, molfile) => {
72
80
  dispatch({ type: SET_MOLECULE, molfile, key });
73
81
  }, [dispatch]);
74
82
  const openMoleculeEditorHandler = useCallback((moleclue = null) => {
75
- modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: moleclue }, void 0), {
83
+ modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: moleclue }), {
76
84
  position: positions.TOP_CENTER,
77
85
  width: 700,
78
86
  height: 500,
@@ -81,21 +89,21 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
81
89
  const moleculeIndexHandler = useCallback((index) => {
82
90
  setCurrentIndex(index);
83
91
  }, []);
84
- return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler }, void 0), _jsx("div", { css: styles.molecule, children: _jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsxs("span", { css: styles.toolbar, children: [_jsx(MF, { mf: mol.mf }, void 0), " - ", mol.mw?.toFixed(2)] }, void 0), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditorHandler(mol), style: {
85
- backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
86
- }, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
87
- return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol.key, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
88
- currentDiaIDsToHighlight.length > 0
89
- ? 'red'
90
- : '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
91
- currentDiaIDsToHighlight.length > 0
92
- ? currentDiaIDsToHighlight
93
- : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }, void 0));
94
- } }, void 0) }, void 0)] }, mol.key)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditorHandler(), children: _jsx("span", { children: "Click to draw molecule" }, void 0) }, void 0)) }, void 0) }, void 0)] }, void 0));
92
+ return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), 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: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsxs("span", { css: styles.toolbar, children: [_jsx(MF, { mf: mol.mf }), " - ", mol.mw?.toFixed(2)] }), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditorHandler(mol), style: {
93
+ backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
94
+ }, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
95
+ return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol.key, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
96
+ currentDiaIDsToHighlight.length > 0
97
+ ? 'red'
98
+ : '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
99
+ currentDiaIDsToHighlight.length > 0
100
+ ? currentDiaIDsToHighlight
101
+ : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }));
102
+ } }) })] }, mol.key)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditorHandler(), children: _jsx("span", { children: "Click to draw molecule" }) })) }) }), children] })] }));
95
103
  }
96
104
  const MemoizedMoleculePanel = memo(MoleculePanelInner);
97
105
  const emptyData = { ranges: {}, zones: {} };
98
- export default function MoleculePanel() {
106
+ export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }) {
99
107
  const { molecules, displayerMode, activeTab } = useChartData();
100
108
  const data = useSpectrum(emptyData);
101
109
  const ranges = data?.ranges || {};
@@ -106,5 +114,7 @@ export default function MoleculePanel() {
106
114
  activeTab,
107
115
  ranges,
108
116
  zones,
109
- } }, void 0));
117
+ onMoleculeChange,
118
+ actionsOptions,
119
+ }, children: children }));
110
120
  }
@@ -1,8 +1,16 @@
1
+ export interface MoleculeHeaderActionsOptions {
2
+ hidePast?: boolean;
3
+ hideAdd?: boolean;
4
+ hideExport?: boolean;
5
+ hideDelete?: boolean;
6
+ hidePredict?: boolean;
7
+ }
1
8
  interface MoleculePanelHeaderProps {
2
9
  currentIndex: number;
3
10
  molecules: Array<any>;
4
11
  onMoleculeIndexChange: (index: number) => void;
5
12
  onOpenMoleculeEditor: () => void;
13
+ actionsOptions?: MoleculeHeaderActionsOptions;
6
14
  }
7
- export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange, onOpenMoleculeEditor, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange, onOpenMoleculeEditor, actionsOptions, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
8
16
  export {};
@@ -41,21 +41,21 @@ const toolbarStyle = css `
41
41
  const MOL_EXPORT_MENU = [
42
42
  {
43
43
  id: 'molfile',
44
- icon: _jsx(FaCopy, {}, void 0),
44
+ icon: _jsx(FaCopy, {}),
45
45
  label: 'Copy as molfile',
46
46
  },
47
47
  {
48
48
  id: 'png',
49
- icon: _jsx(FaFileImage, {}, void 0),
49
+ icon: _jsx(FaFileImage, {}),
50
50
  label: 'Copy as PNG',
51
51
  },
52
52
  {
53
53
  id: 'svg',
54
- icon: _jsx(FaDownload, {}, void 0),
54
+ icon: _jsx(FaDownload, {}),
55
55
  label: 'Export as SVG',
56
56
  },
57
57
  ];
58
- export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, }) {
58
+ export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
59
59
  const alert = useAlert();
60
60
  const dispatch = useDispatch();
61
61
  const modal = useModal();
@@ -115,13 +115,13 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
115
115
  assignmentData,
116
116
  ]);
117
117
  const openPredictSpectraModal = useCallback(() => {
118
- modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex] }, void 0), {
118
+ modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex] }), {
119
119
  position: positions.TOP_CENTER,
120
120
  enableResizing: true,
121
121
  width: 600,
122
122
  });
123
123
  }, [modal, molecules, currentIndex]);
124
- return (_jsxs("div", { css: toolbarStyle, children: [_jsx(MenuButton, { component: _jsx(FaFileExport, {}, void 0), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler }, void 0), _jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}, void 0) }, void 0) }, void 0), _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, {}, void 0) }, void 0) }, void 0), _jsx(ToolTip, { title: "Delete Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}, void 0) }, void 0) }, void 0), molecules && molecules.length > 0 && (_jsx(ButtonToolTip, { popupTitle: "Predict Spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}, void 0) }, void 0)), _jsxs("p", { children: [molecules &&
124
+ 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, {}) })), _jsxs("p", { children: [molecules &&
125
125
  molecules.length > 0 &&
126
- `${+(currentIndex + 1)} / ${molecules.length}`, ' '] }, void 0)] }, void 0));
126
+ `${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
127
127
  }