nmrium 0.50.1 → 0.52.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 (219) hide show
  1. package/lib/component/1d/Chart1D.js +1 -1
  2. package/lib/component/1d/LinesSeries.js +2 -2
  3. package/lib/component/1d/Viewer1D.js +6 -11
  4. package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
  5. package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +6 -2
  6. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +8 -1
  7. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraceWithMouse.js +2 -21
  8. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
  9. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.d.ts +1 -1
  10. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.js +6 -17
  11. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.d.ts +6 -10
  12. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +62 -13
  13. package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.d.ts +1 -0
  14. package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.js +2 -1
  15. package/lib/component/2d/Viewer2D.js +16 -15
  16. package/lib/component/2d/ft/Contours.js +6 -3
  17. package/lib/component/2d/utilities/scale.d.ts +2 -1
  18. package/lib/component/2d/utilities/scale.js +12 -2
  19. package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -3
  20. package/lib/component/EventsTrackers/BrushTracker.js +2 -2
  21. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +1 -1
  22. package/lib/component/EventsTrackers/KeysListenerTracker.js +32 -18
  23. package/lib/component/context/DispatchContext.d.ts +1 -1
  24. package/lib/component/context/ToasterContext.d.ts +13 -0
  25. package/lib/component/context/ToasterContext.js +34 -0
  26. package/lib/component/elements/Label.js +1 -1
  27. package/lib/component/elements/Select.js +2 -2
  28. package/lib/component/elements/ToolbarPopoverItem.js +1 -1
  29. package/lib/component/header/ApodizationOptionsPanel.js +1 -1
  30. package/lib/component/header/AutoPeakPickingOptionPanel.js +7 -4
  31. package/lib/component/header/BaseLineCorrectionPanel.js +2 -2
  32. package/lib/component/header/Header.d.ts +1 -11
  33. package/lib/component/header/Header.js +5 -6
  34. package/lib/component/header/PhaseCorrectionPanel.js +24 -33
  35. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.d.ts +1 -1
  36. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +96 -42
  37. package/lib/component/header/RangesPickingOptionPanel.js +7 -4
  38. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  39. package/lib/component/header/Zones2DOptionPanel.js +6 -2
  40. package/lib/component/hooks/useDialogToggle.d.ts +5 -0
  41. package/lib/component/hooks/useDialogToggle.js +16 -0
  42. package/lib/component/hooks/useExport.d.ts +9 -1
  43. package/lib/component/hooks/useExport.js +34 -36
  44. package/lib/component/hooks/useSaveSettings.js +6 -3
  45. package/lib/component/hooks/useToolsFunctions.d.ts +1 -1
  46. package/lib/component/hooks/useToolsFunctions.js +9 -7
  47. package/lib/component/loader/DropZone.js +14 -14
  48. package/lib/component/main/InnerNMRium.js +5 -9
  49. package/lib/component/main/InnerNMRiumContents.d.ts +0 -2
  50. package/lib/component/main/InnerNMRiumContents.js +5 -3
  51. package/lib/component/main/NMRium.js +2 -2
  52. package/lib/component/modal/AboutPredictionModal.js +1 -1
  53. package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
  54. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  55. package/lib/component/modal/ExportAsJcampModal.js +15 -15
  56. package/lib/component/modal/ImportPublicationStringModal.js +5 -3
  57. package/lib/component/modal/LoadJCAMPModal.js +7 -5
  58. package/lib/component/modal/LogsHistoryModal.js +1 -1
  59. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  60. package/lib/component/modal/PredictSpectraModal.js +11 -9
  61. package/lib/component/modal/SaveAsModal.d.ts +3 -4
  62. package/lib/component/modal/SaveAsModal.js +27 -27
  63. package/lib/component/modal/editRange/EditRangeModal.js +2 -2
  64. package/lib/component/modal/editRange/forms/components/DeltaInput.d.ts +2 -3
  65. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -3
  66. package/lib/component/modal/editRange/forms/components/InfoBlock.d.ts +1 -0
  67. package/lib/component/modal/editRange/forms/components/{SignalFormInfo.js → InfoBlock.js} +2 -2
  68. package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts +5 -0
  69. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +85 -0
  70. package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +7 -0
  71. package/lib/component/modal/editRange/forms/components/SignalTab.js +24 -0
  72. package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +8 -0
  73. package/lib/component/modal/editRange/forms/components/SignalsContent.js +57 -0
  74. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts +5 -0
  75. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +133 -0
  76. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts +5 -0
  77. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +141 -0
  78. package/lib/component/modal/editZone/EditPathLengthFormik.js +2 -2
  79. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  80. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts +7 -4
  81. package/lib/component/modal/metaImportation/MetaImportationModal.js +23 -13
  82. package/lib/component/modal/metaImportation/utils/mapColumnToSelectItems.js +1 -1
  83. package/lib/component/modal/setting/GeneralSettings.js +9 -6
  84. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
  85. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
  86. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +1 -1
  87. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -4
  88. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +1 -1
  89. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -7
  90. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +6 -4
  91. package/lib/component/panels/Panels.js +5 -5
  92. package/lib/component/panels/PeaksPanel/PeaksPanel.js +6 -3
  93. package/lib/component/panels/RangesPanel/RangesHeader.js +3 -3
  94. package/lib/component/panels/RangesPanel/RangesPanel.js +5 -5
  95. package/lib/component/panels/RangesPanel/RangesPreferences.js +1 -1
  96. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.d.ts +5 -0
  97. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPanelHeader.js +11 -11
  98. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.js +12 -6
  99. package/lib/component/panels/SpectraPanel/SpectraTabs.d.ts +1 -0
  100. package/lib/component/panels/{SpectrumsPanel/SpectrumsTabs.js → SpectraPanel/SpectraTabs.js} +6 -6
  101. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.js +2 -2
  102. package/lib/component/panels/databasePanel/DatabasePanel.js +37 -19
  103. package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
  104. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +1 -1
  105. package/lib/component/panels/filtersPanel/FilterPanel.js +5 -3
  106. package/lib/component/panels/filtersPanel/FiltersTable.js +27 -23
  107. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +7 -5
  108. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +2 -2
  109. package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +5 -5
  110. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +6 -6
  111. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +5 -3
  112. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -2
  113. package/lib/component/panels/predictionPanel/PredictionPanel.js +7 -5
  114. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -1
  115. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +1 -1
  116. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -1
  117. package/lib/component/reducer/IgnoreActions.js +1 -1
  118. package/lib/component/reducer/Reducer.d.ts +3 -2
  119. package/lib/component/reducer/Reducer.js +40 -32
  120. package/lib/component/reducer/actions/DomainActions.js +3 -3
  121. package/lib/component/reducer/actions/FiltersActions.d.ts +11 -4
  122. package/lib/component/reducer/actions/FiltersActions.js +243 -91
  123. package/lib/component/reducer/actions/IntegralsActions.js +2 -2
  124. package/lib/component/reducer/actions/LoadActions.js +1 -1
  125. package/lib/component/reducer/actions/MoleculeActions.js +0 -1
  126. package/lib/component/reducer/actions/PreferencesActions.js +2 -2
  127. package/lib/component/reducer/actions/RangesActions.js +16 -6
  128. package/lib/component/reducer/actions/ToolsActions.d.ts +6 -6
  129. package/lib/component/reducer/actions/ToolsActions.js +83 -22
  130. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -0
  131. package/lib/component/reducer/actions/ZonesActions.js +5 -1
  132. package/lib/component/reducer/helper/Zoom1DManager.d.ts +4 -3
  133. package/lib/component/reducer/helper/Zoom1DManager.js +4 -4
  134. package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -5
  135. package/lib/component/reducer/helper/findStrongestPeak.d.ts +6 -0
  136. package/lib/component/reducer/helper/findStrongestPeak.js +13 -0
  137. package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.d.ts +2 -1
  138. package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.js +7 -1
  139. package/lib/component/toolbar/ToolBar.js +32 -27
  140. package/lib/component/toolbar/toolbarMenu.js +4 -4
  141. package/lib/component/utility/Events.d.ts +11 -0
  142. package/lib/component/utility/Events.js +22 -0
  143. package/lib/constants.js +5 -5
  144. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -33
  145. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -15
  146. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
  147. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  148. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  149. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +6 -4
  150. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +13 -3
  151. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +6 -0
  152. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts +13 -3
  153. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +78 -18
  154. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +2 -2
  155. package/lib/data/data1d/spectrumSimulation.d.ts +1 -1
  156. package/lib/data/data2d/Spectrum2D/contours.js +3 -3
  157. package/lib/data/data2d/Spectrum2D/getMissingProjection.js +2 -2
  158. package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
  159. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -0
  160. package/lib/data/getDefaultMatrixFilters.js +2 -2
  161. package/lib/data/matrixGeneration.js +1 -1
  162. package/lib/data/utilities/calculateSanPlot.d.ts +1 -6
  163. package/lib/versionInfo.js +1 -1
  164. package/package.json +32 -30
  165. package/lib/component/elements/popup/Alert/AlertBlock.d.ts +0 -8
  166. package/lib/component/elements/popup/Alert/AlertBlock.js +0 -30
  167. package/lib/component/elements/popup/Alert/Context.d.ts +0 -27
  168. package/lib/component/elements/popup/Alert/Context.js +0 -10
  169. package/lib/component/elements/popup/Alert/ProgressIndicator.d.ts +0 -1
  170. package/lib/component/elements/popup/Alert/ProgressIndicator.js +0 -33
  171. package/lib/component/elements/popup/Alert/Provider.d.ts +0 -19
  172. package/lib/component/elements/popup/Alert/Provider.js +0 -127
  173. package/lib/component/elements/popup/Alert/index.d.ts +0 -3
  174. package/lib/component/elements/popup/Alert/index.js +0 -3
  175. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +0 -10
  176. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +0 -81
  177. package/lib/component/modal/editRange/forms/components/CouplingsTable.d.ts +0 -13
  178. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +0 -63
  179. package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +0 -1
  180. package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +0 -8
  181. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +0 -18
  182. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +0 -10
  183. package/lib/component/modal/editRange/forms/components/SignalsForm.js +0 -114
  184. package/lib/component/modal/metaImportation/index.d.ts +0 -2
  185. package/lib/component/modal/metaImportation/index.js +0 -17
  186. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.d.ts +0 -5
  187. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.d.ts +0 -1
  188. package/lib/component/reducer/helper/getStrongestPeak.d.ts +0 -7
  189. package/lib/component/reducer/helper/getStrongestPeak.js +0 -15
  190. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.d.ts +0 -0
  191. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.js +0 -0
  192. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.d.ts +0 -0
  193. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.d.ts +0 -0
  194. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.d.ts +0 -0
  195. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.js +0 -0
  196. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.d.ts +0 -0
  197. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.js +0 -0
  198. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.d.ts +0 -0
  199. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.js +0 -0
  200. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.d.ts +0 -0
  201. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.js +0 -0
  202. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.d.ts +0 -0
  203. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.js +0 -0
  204. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.d.ts +0 -0
  205. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.js +0 -0
  206. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.d.ts +0 -0
  207. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.js +0 -0
  208. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.d.ts +0 -0
  209. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.js +0 -0
  210. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.d.ts +0 -0
  211. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.js +0 -0
  212. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.d.ts +0 -0
  213. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.js +0 -0
  214. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.d.ts +0 -0
  215. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.js +0 -0
  216. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.d.ts +0 -0
  217. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.js +0 -0
  218. /package/lib/component/reducer/actions/{SpectrumsActions.d.ts → SpectraActions.d.ts} +0 -0
  219. /package/lib/component/reducer/actions/{SpectrumsActions.js → SpectraActions.js} +0 -0
@@ -9,13 +9,13 @@ import { Toolbar, useOnOff } from 'react-science/ui';
9
9
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
10
10
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
11
11
  import { usePreferences, useWorkspacesList, } from '../../context/PreferencesContext';
12
+ import { useToaster } from '../../context/ToasterContext';
12
13
  import ActionButtons from '../../elements/ActionButtons';
13
14
  import Button from '../../elements/Button';
14
15
  import Label from '../../elements/Label';
15
16
  import Tab from '../../elements/Tab/Tab';
16
17
  import Tabs, { PositionsEnum } from '../../elements/Tab/Tabs';
17
18
  import DropDownButton from '../../elements/dropDownButton/DropDownButton';
18
- import { useAlert } from '../../elements/popup/Alert';
19
19
  import { useSaveSettings } from '../../hooks/useSaveSettings';
20
20
  import { getPreferencesByWorkspace } from '../../reducer/preferences/utilities/getPreferencesByWorkspace';
21
21
  import PredefinedWorkspaces from '../../workspaces';
@@ -86,7 +86,7 @@ function GeneralSettingsModal({ height }) {
86
86
  const [activeTab, setActiveTab] = useState('general');
87
87
  const { dispatch, current: currentWorkspace, originalWorkspaces, ...preferences } = usePreferences();
88
88
  const { saveSettings, SaveSettingsModal } = useSaveSettings();
89
- const alert = useAlert();
89
+ const toaster = useToaster();
90
90
  const refForm = useRef(null);
91
91
  const workspaces = useWorkspacesList();
92
92
  const workspaceName = preferences.workspace.current;
@@ -161,7 +161,10 @@ function GeneralSettingsModal({ height }) {
161
161
  function handleCopyWorkspace() {
162
162
  const data = { [workspaceName]: refForm.current?.values };
163
163
  void rawWriteWithType(JSON.stringify(data)).then(() => {
164
- alert.success('Workspace copied to clipboard');
164
+ toaster.show({
165
+ message: 'Workspace copied to clipboard',
166
+ intent: 'success',
167
+ });
165
168
  });
166
169
  }
167
170
  const setWorkspaceSetting = useCallback((inputWorkspace) => {
@@ -194,14 +197,14 @@ function GeneralSettingsModal({ height }) {
194
197
  setWorkspaceSetting(parseWorkspaces);
195
198
  }
196
199
  catch {
197
- alert.error('object parse error');
200
+ toaster.show({ message: 'object parse error', intent: 'danger' });
198
201
  }
199
202
  cleanShouldFallback();
200
203
  }
201
204
  function handlePastWorkspaceAction() {
202
205
  void readText().then(handlePastWorkspace);
203
206
  }
204
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General Settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
207
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
205
208
  cursor: 'default',
206
209
  paddingTop: '10px',
207
210
  boxShadow: 'none',
@@ -215,7 +218,7 @@ function GeneralSettingsModal({ height }) {
215
218
  }, children: _jsx(FaPaste, {}) })] }) }), _jsx(DialogBody, { css: css `
216
219
  padding: 0;
217
220
  background-color: white;
218
- `, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { title: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { title: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { title: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { title: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { title: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), _jsx(Tab, { title: "Import filters", tabid: "importation-filters", children: _jsx("div", { className: "inner-content", children: _jsx(ImportationFiltersTabContent, {}) }) }), _jsx(Tab, { title: "Title Block", tabid: "title-block", children: _jsx("div", { className: "inner-content", children: _jsx(InfoBlockTabContent, {}) }) }), _jsx(Tab, { title: "On Load Processing", tabid: "on-load-processing", children: _jsx("div", { className: "inner-content", children: _jsx(OnLoadProcessingTabContent, {}) }) }), _jsx(Tab, { title: "Spectra colors", tabid: "spectra-colors", children: _jsx("div", { className: "inner-content", children: _jsx(SpectraColorsTabContent, {}) }) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
221
+ `, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { title: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { title: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { title: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { title: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { title: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), _jsx(Tab, { title: "Import filters", tabid: "importation-filters", children: _jsx("div", { className: "inner-content", children: _jsx(ImportationFiltersTabContent, {}) }) }), _jsx(Tab, { title: "Title block", tabid: "title-block", children: _jsx("div", { className: "inner-content", children: _jsx(InfoBlockTabContent, {}) }) }), _jsx(Tab, { title: "Auto processing", tabid: "on-load-processing", children: _jsx("div", { className: "inner-content", children: _jsx(OnLoadProcessingTabContent, {}) }) }), _jsx(Tab, { title: "Spectra colors", tabid: "spectra-colors", children: _jsx("div", { className: "inner-content", children: _jsx(SpectraColorsTabContent, {}) }) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
219
222
  closeDialog?.();
220
223
  } }), _jsx(Button.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), _jsx(SaveSettingsModal, {}), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePastWorkspace, text: text, label: "Workspace" })] }));
221
224
  }
@@ -33,6 +33,6 @@ const LOGS_LEVELS = Object.keys(LOGGER_LEVELS).map((level) => ({
33
33
  value: level,
34
34
  }));
35
35
  function GeneralTabContent() {
36
- return (_jsxs(_Fragment, { children: [_jsxs(GroupPane, { text: "General", children: [_jsx(Label, { title: "Opacity of dimmed spectra [ 0 - 1 ]", style: labelStyle, children: _jsx(FormikInput, { name: "general.dimmedSpectraOpacity", checkValue: (value) => Number(value) >= 0 && Number(value) <= 1, type: "number", step: 0.1, min: 0, max: 1, style: { inputWrapper: { width: 60 } } }) }), _jsx(Label, { title: "Invert actions", htmlFor: "general.invert", style: labelStyle, children: _jsx(FormikCheckBox, { name: "general.invert", style: { container: { justifyContent: 'flex-start' } } }) })] }), _jsx(GroupPane, { text: "Experimental features", children: _jsx(Label, { title: "Enable experimental features", htmlFor: "display.general.experimentalFeatures.display", style: labelStyle, children: _jsx(FormikCheckBox, { name: "display.general.experimentalFeatures.display", style: { container: { justifyContent: 'flex-start' } } }) }) }), _jsx(GroupPane, { text: "Rendering", children: _jsx(Label, { title: "Spectra rendering ", style: labelStyle, children: _jsx(FormikSelect, { items: SHAPE_RENDERING, name: "general.spectraRendering", style: { width: '150px' } }) }) }), _jsxs(GroupPane, { text: "Logging settings", children: [_jsx(Label, { title: "Level ", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.loggingLevel", style: { width: '100px' } }) }), _jsx(Label, { title: "Popup logging level ", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.popupLoggingLevel", style: { width: '100px' } }) })] })] }));
36
+ return (_jsxs(_Fragment, { children: [_jsxs(GroupPane, { text: "General", children: [_jsx(Label, { title: "Opacity of dimmed spectra [0 - 1]", style: labelStyle, children: _jsx(FormikInput, { name: "general.dimmedSpectraOpacity", checkValue: (value) => Number(value) >= 0 && Number(value) <= 1, type: "number", step: 0.1, min: 0, max: 1, style: { inputWrapper: { width: 60 } } }) }), _jsx(Label, { title: "Invert actions", style: labelStyle, children: _jsx(FormikCheckBox, { name: "general.invert", style: { container: { justifyContent: 'flex-start' } } }) })] }), _jsx(GroupPane, { text: "Experimental features", children: _jsx(Label, { title: "Enable experimental features", style: labelStyle, children: _jsx(FormikCheckBox, { name: "display.general.experimentalFeatures.display", style: { container: { justifyContent: 'flex-start' } } }) }) }), _jsx(GroupPane, { text: "Rendering", children: _jsx(Label, { title: "Spectra rendering", style: labelStyle, children: _jsx(FormikSelect, { items: SHAPE_RENDERING, name: "general.spectraRendering", style: { width: '150px' } }) }) }), _jsxs(GroupPane, { text: "Logging settings", children: [_jsx(Label, { title: "Level", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.loggingLevel", style: { width: '100px' } }) }), _jsx(Label, { title: "Popup logging level", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.popupLoggingLevel", style: { width: '100px' } }) })] })] }));
37
37
  }
38
38
  export default GeneralTabContent;
@@ -86,7 +86,7 @@ function InfoBlockTabContent() {
86
86
  },
87
87
  },
88
88
  ], [addHandler, datalist, deleteHandler, paths]);
89
- return (_jsxs("div", { children: [_jsx(Label, { title: "Display spectrum info block", htmlFor: "infoBlock.visible", style: { wrapper: { padding: '10px 0' } }, children: _jsx(FormikCheckBox, { name: "infoBlock.visible" }) }), _jsx(GroupPane, { text: "Fields", renderHeader: (text) => {
89
+ return (_jsxs("div", { children: [_jsx(Label, { title: "Display spectrum info block", style: { wrapper: { padding: '10px 0' } }, children: _jsx(FormikCheckBox, { name: "infoBlock.visible" }) }), _jsx(GroupPane, { text: "Fields", renderHeader: (text) => {
90
90
  return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => addHandler(fields, 0) }));
91
91
  }, children: _jsx(ReactTable, { style: {
92
92
  'table, table td, table th': { border: 'none' },
@@ -9,7 +9,7 @@ import FormikCheckBox from '../../../elements/formik/FormikCheckBox';
9
9
  function OnLoadProcessingTabContent() {
10
10
  const { values } = useFormikContext();
11
11
  const isExperimentalFeatures = values.display?.general?.experimentalFeatures?.display || false;
12
- return (_jsxs("div", { children: [_jsx(Label, { title: "Enable auto processing", htmlFor: "onLoadProcessing.autoProcessing", style: { wrapper: { padding: '10px 0' } }, children: _jsx(FormikCheckBox, { name: "onLoadProcessing.autoProcessing" }) }), isExperimentalFeatures && _jsx(AutoProcessingFilters, {})] }));
12
+ return (_jsxs("div", { children: [_jsx(Label, { title: "Enable auto processing on load", style: { wrapper: { padding: '10px 0' } }, children: _jsx(FormikCheckBox, { name: "onLoadProcessing.autoProcessing" }) }), isExperimentalFeatures && _jsx(AutoProcessingFilters, {})] }));
13
13
  }
14
14
  function AutoProcessingFilters() {
15
15
  const { values } = useFormikContext();
@@ -3,7 +3,7 @@ import OCL from 'openchemlib/full';
3
3
  import { useRef, useState } from 'react';
4
4
  import { useChartData } from '../../context/ChartContext';
5
5
  import { useDispatch } from '../../context/DispatchContext';
6
- import { useAlert } from '../../elements/popup/Alert';
6
+ import { useToaster } from '../../context/ToasterContext';
7
7
  import { assert } from '../../utility/assert';
8
8
  function mapSpectra(data) {
9
9
  return data.map((spectrum) => {
@@ -24,7 +24,7 @@ export function useAutoAssignments() {
24
24
  const dispatch = useDispatch();
25
25
  const { data, molecules } = useChartData();
26
26
  const originData = useRef();
27
- const alert = useAlert();
27
+ const toaster = useToaster();
28
28
  const [assignments, setAssignments] = useState([]);
29
29
  function restAssignments() {
30
30
  if (originData.current) {
@@ -36,7 +36,7 @@ export function useAutoAssignments() {
36
36
  }
37
37
  function getAssignments() {
38
38
  void (async () => {
39
- const hideLoading = await alert.showLoading('Auto Assignments');
39
+ const hideLoading = toaster.showLoading({ message: 'Auto Assignments' });
40
40
  const molecule = OCL.Molecule.fromMolfile(molecules[0]?.molfile || '');
41
41
  const spectra = mapSpectra(data);
42
42
  if (!originData.current) {
@@ -53,7 +53,10 @@ export function useAutoAssignments() {
53
53
  });
54
54
  }
55
55
  else {
56
- alert.error('Could not assign molecule, please check that all the ranges are defined correctly');
56
+ toaster.show({
57
+ message: 'Could not assign molecule, please check that all the ranges are defined correctly',
58
+ intent: 'danger',
59
+ });
57
60
  }
58
61
  setAssignments(result);
59
62
  hideLoading();
@@ -72,7 +72,7 @@ function IntegralsPreferences(props, ref) {
72
72
  formRef.current.submitForm();
73
73
  },
74
74
  }));
75
- return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorPickerDropdown, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "stroke width :", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikInput, { name: `nuclei.${n}.strokeWidth`, type: "number", style: {
75
+ return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorPickerDropdown, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "Stroke width:", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikInput, { name: `nuclei.${n}.strokeWidth`, type: "number", style: {
76
76
  input: {
77
77
  textAlign: 'center',
78
78
  padding: '2px',
@@ -10,9 +10,9 @@ import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
10
10
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
11
11
  import { useDispatch } from '../../context/DispatchContext';
12
12
  import { useGlobal } from '../../context/GlobalContext';
13
+ import { useToaster } from '../../context/ToasterContext';
13
14
  import { PreferencesButton } from '../../elements/PreferencesButton';
14
15
  import { ToolbarPopoverItem, } from '../../elements/ToolbarPopoverItem';
15
- import { useAlert } from '../../elements/popup/Alert';
16
16
  import AboutPredictionModal from '../../modal/AboutPredictionModal';
17
17
  import PredictSpectraModal from '../../modal/PredictSpectraModal';
18
18
  import { copyPNGToClipboard, exportAsSVG } from '../../utility/export';
@@ -66,7 +66,7 @@ const MOL_EXPORT_MENU = [
66
66
  ];
67
67
  export default function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange, onOpenMoleculeEditor, renderSource = 'moleculePanel', onClickPreferences, onClickPastMolecule, children, }) {
68
68
  const { rootRef } = useGlobal();
69
- const alert = useAlert();
69
+ const toaster = useToaster();
70
70
  const dispatch = useDispatch();
71
71
  const assignmentData = useAssignmentData();
72
72
  const moleculeKey = molecules?.[currentIndex]?.id;
@@ -79,14 +79,20 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
79
79
  if (!rootRef)
80
80
  return;
81
81
  await copyPNGToClipboard(rootRef, `molSVG${currentIndex} `);
82
- alert.success('MOL copied as PNG to clipboard');
83
- }, [rootRef, alert, currentIndex]);
82
+ toaster.show({
83
+ message: 'MOL copied as PNG to clipboard',
84
+ intent: 'success',
85
+ });
86
+ }, [rootRef, currentIndex, toaster]);
84
87
  const { rawWriteWithType, readText, shouldFallback, cleanShouldFallback, text, } = useClipboard();
85
88
  const saveAsMolHandler = useCallback((molfile) => {
86
89
  void rawWriteWithType(molfile).then(() => {
87
- alert.success('MOLFile copied to clipboard');
90
+ toaster.show({
91
+ message: 'MOLFile copied to clipboard',
92
+ intent: 'success',
93
+ });
88
94
  });
89
- }, [alert, rawWriteWithType]);
95
+ }, [rawWriteWithType, toaster]);
90
96
  const exportHandler = useCallback((selected) => {
91
97
  const molecule = molecules?.[currentIndex];
92
98
  if (molecule) {
@@ -154,5 +160,5 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
154
160
  });
155
161
  }
156
162
  const hasMolecules = molecules && molecules.length > 0;
157
- return (_jsxs(PanelHeader, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), _jsxs(Toolbar, { children: [renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(ToolbarPopoverItem, { options: MOL_EXPORT_MENU, onClick: exportHandler, disabled: !hasMolecules, title: "Export As", icon: _jsx(FaFileExport, {}) }), _jsx(Toolbar.Item, { title: "Paste molfile", icon: _jsx(FaPaste, {}), onClick: handlePasteMolfileAction }), _jsx(Toolbar.Item, { title: "Add molecule", icon: _jsx(FaPlus, {}), onClick: onOpenMoleculeEditor })] })), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { title: "Delete molecule", icon: _jsx(FaRegTrashAlt, {}), onClick: handleDelete, disabled: !hasMolecules }), hasMolecules && (_jsx(PredictSpectraModal, { molecule: molecules[currentIndex] }))] })), _jsx(Toolbar.Item, { title: "Float molecule", icon: _jsx(IoOpenOutline, {}), onClick: floatMoleculeHandler, active: moleculesView?.[moleculeKey]?.floating.visible || false, disabled: !hasMolecules }), _jsx(Toolbar.Item, { title: "Show atom number", icon: _jsx("p", { style: styles.atomLabel, children: "#" }), onClick: showAtomNumbersHandler, active: moleculesView?.[moleculeKey]?.showAtomNumber || false, disabled: !hasMolecules })] }), _jsx("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && (_jsx("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && (_jsx(PreferencesButton, { title: "Preferences", onClick: onClickPreferences })), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
163
+ return (_jsxs(PanelHeader, { children: [_jsxs(Toolbar, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(ToolbarPopoverItem, { options: MOL_EXPORT_MENU, onClick: exportHandler, disabled: !hasMolecules, title: "Export As", icon: _jsx(FaFileExport, {}) }), _jsx(Toolbar.Item, { title: "Paste molfile", icon: _jsx(FaPaste, {}), onClick: handlePasteMolfileAction }), _jsx(Toolbar.Item, { title: "Add molecule", icon: _jsx(FaPlus, {}), onClick: onOpenMoleculeEditor })] })), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { title: "Delete molecule", icon: _jsx(FaRegTrashAlt, {}), onClick: handleDelete, disabled: !hasMolecules }), hasMolecules && (_jsx(PredictSpectraModal, { molecule: molecules[currentIndex] }))] })), _jsx(Toolbar.Item, { title: "Float molecule", icon: _jsx(IoOpenOutline, {}), onClick: floatMoleculeHandler, active: moleculesView?.[moleculeKey]?.floating.visible || false, disabled: !hasMolecules }), _jsx(Toolbar.Item, { title: "Show atom number", icon: _jsx("p", { style: styles.atomLabel, children: "#" }), onClick: showAtomNumbersHandler, active: moleculesView?.[moleculeKey]?.showAtomNumber || false, disabled: !hasMolecules })] }), _jsx("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && (_jsx("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && (_jsx(PreferencesButton, { title: "Preferences", onClick: onClickPreferences })), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
158
164
  }
@@ -4,11 +4,11 @@ import checkModifierKeyActivated from '../../../data/utilities/checkModifierKeyA
4
4
  import { useAssignment, useAssignmentData, } from '../../assignment/AssignmentsContext';
5
5
  import { filterForIDsWithAssignment } from '../../assignment/utilities/filterForIDsWithAssignment';
6
6
  import { useDispatch } from '../../context/DispatchContext';
7
- import { useAlert } from '../../elements/popup/Alert';
7
+ import { useToaster } from '../../context/ToasterContext';
8
8
  import { HighlightEventSource, useHighlightData } from '../../highlight';
9
9
  import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
10
10
  export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
11
- const alert = useAlert();
11
+ const toaster = useToaster();
12
12
  const dispatch = useDispatch();
13
13
  const highlightData = useHighlightData();
14
14
  const assignments = useAssignmentData();
@@ -159,17 +159,19 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
159
159
  activeAssignment.setActive(axis);
160
160
  }
161
161
  else {
162
- alert.info('Not assigned! Different atom type or no attached hydrogens found!');
162
+ toaster.show({
163
+ message: 'Not assigned! Different atom type or no attached hydrogens found!',
164
+ });
163
165
  }
164
166
  }
165
167
  }
166
168
  }, [
167
169
  activeAssignment,
168
- alert,
169
170
  data,
170
171
  dispatch,
171
172
  displayerMode,
172
173
  nucleus,
174
+ toaster,
173
175
  toggleAssignment,
174
176
  ]);
175
177
  const handleOnAtomHover = useCallback((diaIDAndInfo) => {
@@ -12,7 +12,7 @@ import MatrixGenerationPanel from './MatrixGenerationPanel/MatrixGenerationPanel
12
12
  import MoleculePanel from './MoleculesPanel/MoleculePanel';
13
13
  import PeaksPanel from './PeaksPanel/PeaksPanel';
14
14
  import RangesPanel from './RangesPanel/RangesPanel';
15
- import SpectrumListPanel from './SpectrumsPanel/SpectrumListPanel';
15
+ import SpectrumListPanel from './SpectraPanel/SpectrumListPanel';
16
16
  import SummaryPanel from './SummaryPanel/SummaryPanel';
17
17
  import ZonesPanel from './ZonesPanel/ZonesPanel';
18
18
  import DatabasePanel from './databasePanel/DatabasePanel';
@@ -59,13 +59,13 @@ const accordionItems = [
59
59
  mode: '1D',
60
60
  },
61
61
  {
62
- title: 'Multiple Spectra Analysis',
62
+ title: 'Multiple spectra analysis',
63
63
  component: _jsx(MultipleSpectraAnalysisPanel, {}),
64
64
  hidePreferenceKey: 'multipleSpectraAnalysisPanel',
65
65
  mode: null,
66
66
  },
67
67
  {
68
- title: 'Matrix Generation',
68
+ title: 'Matrix generation',
69
69
  component: _jsx(MatrixGenerationPanel, {}),
70
70
  hidePreferenceKey: 'matrixGenerationPanel',
71
71
  mode: '1D',
@@ -95,7 +95,7 @@ const accordionItems = [
95
95
  mode: null,
96
96
  },
97
97
  {
98
- title: 'Automatic Assignment',
98
+ title: 'Automatic assignment',
99
99
  component: _jsx(AutomaticAssignment, {}),
100
100
  hidePreferenceKey: 'automaticAssignmentPanel',
101
101
  mode: null,
@@ -107,7 +107,7 @@ const accordionItems = [
107
107
  mode: null,
108
108
  },
109
109
  {
110
- title: 'Spectrum Simulation',
110
+ title: 'Spectrum simulation',
111
111
  component: _jsx(SpectrumSimulation, {}),
112
112
  hidePreferenceKey: 'simulationPanel',
113
113
  mode: '1D',
@@ -9,7 +9,7 @@ import isInRange from '../../../data/utilities/isInRange';
9
9
  import { useChartData } from '../../context/ChartContext';
10
10
  import { useDispatch } from '../../context/DispatchContext';
11
11
  import { usePreferences } from '../../context/PreferencesContext';
12
- import { useAlert } from '../../elements/popup/Alert';
12
+ import { useToaster } from '../../context/ToasterContext';
13
13
  import { useModal } from '../../elements/popup/Modal';
14
14
  import { useActiveSpectrumPeaksViewState } from '../../hooks/useActiveSpectrumPeaksViewState';
15
15
  import useCheckExperimentalFeature from '../../hooks/useCheckExperimentalFeature';
@@ -27,7 +27,7 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
27
27
  const format = useFormatNumberByNucleus(info.nucleus);
28
28
  const dispatch = useDispatch();
29
29
  const modal = useModal();
30
- const alert = useAlert();
30
+ const toaster = useToaster();
31
31
  const isExperimental = useCheckExperimentalFeature();
32
32
  const settingRef = useRef();
33
33
  const yesHandler = useCallback(() => {
@@ -79,7 +79,10 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
79
79
  dispatch({ type: 'OPTIMIZE_PEAKS', payload: { peaks: filterPeaks } });
80
80
  }
81
81
  else {
82
- alert.error('optimization can be done on no more than 4 peaks');
82
+ toaster.show({
83
+ message: 'optimization can be done on no more than 4 peaks',
84
+ intent: 'danger',
85
+ });
83
86
  }
84
87
  };
85
88
  function toggleViewProperty(key) {
@@ -8,7 +8,7 @@ import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardCompon
8
8
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
9
9
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
10
10
  import { useDispatch } from '../../context/DispatchContext';
11
- import { useAlert } from '../../elements/popup/Alert';
11
+ import { useToaster } from '../../context/ToasterContext';
12
12
  import { useModal } from '../../elements/popup/Modal';
13
13
  import { useActiveSpectrumRangesViewState } from '../../hooks/useActiveSpectrumRangesViewState';
14
14
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
@@ -19,7 +19,7 @@ import DefaultPanelHeader from '../header/DefaultPanelHeader';
19
19
  function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClick, isFilterActive, filterCounter, activeTab, }) {
20
20
  const dispatch = useDispatch();
21
21
  const modal = useModal();
22
- const alert = useAlert();
22
+ const toaster = useToaster();
23
23
  const assignmentData = useAssignmentData();
24
24
  const currentSum = lodashGet(ranges, 'options.sum', null);
25
25
  const rangesPreferences = usePanelPreferences('ranges', activeTab);
@@ -80,7 +80,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
80
80
  }
81
81
  const { rawWriteWithType, shouldFallback, cleanShouldFallback, text } = useClipboard();
82
82
  function saveToClipboardHandler(value) {
83
- void rawWriteWithType(value, 'text/html').then(() => alert.success('Data copied to clipboard'));
83
+ void rawWriteWithType(value, 'text/html').then(() => toaster.show({ message: 'Data copied to clipboard', intent: 'success' }));
84
84
  }
85
85
  function saveAsHTMLHandler() {
86
86
  if (Array.isArray(ranges?.values) && ranges.values.length > 0) {
@@ -9,7 +9,7 @@ import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
9
9
  import { useAssignmentData } from '../../assignment/AssignmentsContext';
10
10
  import { useChartData } from '../../context/ChartContext';
11
11
  import { useDispatch } from '../../context/DispatchContext';
12
- import { useAlert } from '../../elements/popup/Alert';
12
+ import { useToaster } from '../../context/ToasterContext';
13
13
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
14
14
  import useSpectrum from '../../hooks/useSpectrum';
15
15
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
@@ -19,7 +19,7 @@ import RangesPreferences from './RangesPreferences';
19
19
  import RangesTable from './RangesTable';
20
20
  const rangesContextMenuOptions = [
21
21
  {
22
- text: 'Copy to Clipboard',
22
+ text: 'Copy to clipboard',
23
23
  icon: _jsx(FaCopy, {}),
24
24
  },
25
25
  ];
@@ -27,7 +27,7 @@ function RangesTablePanelInner({ id, ranges, data, info, xDomain, preferences, a
27
27
  const [isFilterActive, setFilterIsActive] = useState(false);
28
28
  const assignmentData = useAssignmentData();
29
29
  const dispatch = useDispatch();
30
- const alert = useAlert();
30
+ const toaster = useToaster();
31
31
  const [isFlipped, setFlipStatus] = useState(false);
32
32
  const settingRef = useRef();
33
33
  const rangesData = useMemo(() => {
@@ -81,9 +81,9 @@ function RangesTablePanelInner({ id, ranges, data, info, xDomain, preferences, a
81
81
  ...value,
82
82
  };
83
83
  await rawWriteWithType(JSON.stringify(dataToClipboard, undefined, 2));
84
- alert.show('Data copied to clipboard');
84
+ toaster.show({ message: 'Data copied to clipboard' });
85
85
  }
86
- }, [data, rawWriteWithType, alert]);
86
+ }, [data, rawWriteWithType, toaster]);
87
87
  const contextMenuSelectHandler = useCallback((option, data) => {
88
88
  void saveJSONToClipboardHandler(data);
89
89
  }, [saveJSONToClipboardHandler]);
@@ -113,6 +113,6 @@ function RangesPreferences(props, ref) {
113
113
  formRef.current.submitForm();
114
114
  },
115
115
  }), []);
116
- return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, enableReinitialize: true, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderBottom: () => (_jsx(Label, { title: "J Graph tolerance (Hz) :", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikInput, { name: `nuclei.${n}.jGraphTolerance`, type: "number", style: formatFieldInputStyle })] }) })) }, n))) }) }) }));
116
+ return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, enableReinitialize: true, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderBottom: () => (_jsx(Label, { title: "J graph tolerance (Hz):", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikInput, { name: `nuclei.${n}.jGraphTolerance`, type: "number", style: formatFieldInputStyle })] }) })) }, n))) }) }) }));
117
117
  }
118
118
  export default forwardRef(RangesPreferences);
@@ -0,0 +1,5 @@
1
+ interface SpectraPanelHeaderProps {
2
+ onSettingClick: () => void;
3
+ }
4
+ export default function SpectraTabs({ onSettingClick, }: SpectraPanelHeaderProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -5,20 +5,20 @@ import { FaCreativeCommonsSamplingPlus, FaEye, FaEyeSlash, } from 'react-icons/f
5
5
  import { IoColorPaletteOutline } from 'react-icons/io5';
6
6
  import { useChartData } from '../../context/ChartContext';
7
7
  import { useDispatch } from '../../context/DispatchContext';
8
- import { useAlert } from '../../elements/popup/Alert';
8
+ import { useToaster } from '../../context/ToasterContext';
9
9
  import { useModal } from '../../elements/popup/Modal';
10
10
  import { useActiveSpectra } from '../../hooks/useActiveSpectra';
11
11
  import useSpectrum from '../../hooks/useSpectrum';
12
12
  import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
13
13
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
14
14
  import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
15
- function getMissingProjection(SpectrumsData, activeTab) {
15
+ function getMissingProjection(spectraData, activeTab) {
16
16
  let nucleus = activeTab.split(',');
17
17
  nucleus = nucleus[0] === nucleus[1] ? [nucleus[0]] : nucleus;
18
18
  const missingNucleus = [];
19
19
  for (const n of nucleus) {
20
- const hasSpectrums = SpectrumsData.some((d) => d.info.nucleus === n);
21
- if (!hasSpectrums) {
20
+ const hasSpectra = spectraData.some((d) => d.info.nucleus === n);
21
+ if (!hasSpectra) {
22
22
  missingNucleus.push(n);
23
23
  }
24
24
  }
@@ -26,7 +26,7 @@ function getMissingProjection(SpectrumsData, activeTab) {
26
26
  }
27
27
  function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTab, displayerMode, onSettingClick, }) {
28
28
  const modal = useModal();
29
- const alert = useAlert();
29
+ const toaster = useToaster();
30
30
  const dispatch = useDispatch();
31
31
  const handleDelete = useCallback(() => {
32
32
  modal.showConfirmDialog({
@@ -42,13 +42,13 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
42
42
  ],
43
43
  });
44
44
  }, [activeSpectra?.length, dispatch, modal]);
45
- function showAllSpectrumsHandler() {
45
+ function showAllSpectraHandler() {
46
46
  dispatch({
47
47
  type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
48
48
  payload: { nucleus: activeTab, flag: true },
49
49
  });
50
50
  }
51
- function hideAllSpectrumsHandler() {
51
+ function hideAllSpectraHandler() {
52
52
  dispatch({
53
53
  type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
54
54
  payload: { nucleus: activeTab, flag: false },
@@ -63,7 +63,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
63
63
  });
64
64
  }
65
65
  else {
66
- alert.error('Nothing to calculate');
66
+ toaster.show({ message: 'Nothing to calculate', intent: 'danger' });
67
67
  }
68
68
  }
69
69
  function setSameTopHandler() {
@@ -85,13 +85,13 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
85
85
  disabled: !hasActiveSpectra,
86
86
  icon: _jsx(FaEyeSlash, {}),
87
87
  title: 'Hide selected spectra',
88
- onClick: hideAllSpectrumsHandler,
88
+ onClick: hideAllSpectraHandler,
89
89
  },
90
90
  {
91
91
  disabled: !hasActiveSpectra,
92
92
  icon: _jsx(FaEye, {}),
93
93
  title: 'Show selected spectra',
94
- onClick: showAllSpectrumsHandler,
94
+ onClick: showAllSpectraHandler,
95
95
  },
96
96
  ];
97
97
  if (displayerMode === '2D' && activeSpectrum?.info.isFt) {
@@ -125,7 +125,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
125
125
  return (_jsx(DefaultPanelHeader, { onDelete: handleDelete, total: data?.length, counter: spectraLengthPerTab, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, onSettingClick: onSettingClick, leftButtons: leftButtons }));
126
126
  }
127
127
  const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
128
- export default function SpectrumsTabs({ onSettingClick, }) {
128
+ export default function SpectraTabs({ onSettingClick, }) {
129
129
  const { data, view: { spectra: { activeTab }, }, displayerMode, } = useChartData();
130
130
  const spectrum = useSpectrum();
131
131
  const activeSpectra = useActiveSpectra();
@@ -8,9 +8,9 @@ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D';
8
8
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
9
9
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
10
10
  import { useDispatch } from '../../context/DispatchContext';
11
+ import { useToaster } from '../../context/ToasterContext';
11
12
  import { ContextMenu, } from '../../elements/ContextMenuBluePrint';
12
13
  import ReactTable from '../../elements/ReactTable/ReactTable';
13
- import { useAlert } from '../../elements/popup/Alert';
14
14
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
15
15
  import ExportAsJcampModal from '../../modal/ExportAsJcampModal';
16
16
  import ColorIndicator from './base/ColorIndicator';
@@ -49,7 +49,7 @@ var SpectraContextMenuOptionsKeys;
49
49
  })(SpectraContextMenuOptionsKeys || (SpectraContextMenuOptionsKeys = {}));
50
50
  const Spectra2DContextMenuOptions = [
51
51
  {
52
- text: 'Copy to Clipboard',
52
+ text: 'Copy to clipboard',
53
53
  icon: _jsx(FaCopy, {}),
54
54
  data: { id: SpectraContextMenuOptionsKeys.CopyToClipboard },
55
55
  },
@@ -79,7 +79,7 @@ const Spectra1DContextMenuOptions = [
79
79
  ];
80
80
  export function SpectraTable(props) {
81
81
  const { data, activeSpectra, onChangeVisibility, onOpenSettingModal, onChangeActiveSpectrum, nucleus, } = props;
82
- const alert = useAlert();
82
+ const toaster = useToaster();
83
83
  const dispatch = useDispatch();
84
84
  const spectraPreferences = usePanelPreferences('spectra', nucleus);
85
85
  const activeSpectraObj = getActiveSpectraAsObject(activeSpectra);
@@ -121,7 +121,10 @@ export function SpectraTable(props) {
121
121
  void (async () => {
122
122
  const { data, info } = spectrum;
123
123
  await rawWriteWithType(JSON.stringify({ data, info }, (_, value) => ArrayBuffer.isView(value) ? Array.from(value) : value, 2));
124
- alert.success('Data copied to clipboard');
124
+ toaster.show({
125
+ message: 'Data copied to clipboard',
126
+ intent: 'success',
127
+ });
125
128
  })();
126
129
  break;
127
130
  }
@@ -143,14 +146,17 @@ export function SpectraTable(props) {
143
146
  }
144
147
  case SpectraContextMenuOptionsKeys.CopyAsText: {
145
148
  const data = convertSpectrumToText(spectrum);
146
- void rawWriteWithType(data, 'text/plain').then(() => alert.success('Spectrum copied to clipboard'));
149
+ void rawWriteWithType(data, 'text/plain').then(() => toaster.show({
150
+ message: 'Spectrum copied to clipboard',
151
+ intent: 'success',
152
+ }));
147
153
  break;
148
154
  }
149
155
  default: {
150
156
  break;
151
157
  }
152
158
  }
153
- }, [alert, dispatch, rawWriteWithType]);
159
+ }, [dispatch, rawWriteWithType, toaster]);
154
160
  function handleActiveRow(row) {
155
161
  return activeSpectraObj?.[row?.original.id] || false;
156
162
  }
@@ -0,0 +1 @@
1
+ export default function SpectraTabs(): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -11,12 +11,12 @@ import { useSetActiveSpectrumAction } from '../../hooks/useSetActiveSpectrumActi
11
11
  import groupByInfoKey from '../../utility/GroupByInfoKey';
12
12
  import { SpectraTable } from './SpectraTable';
13
13
  import SpectrumSetting from './base/setting/SpectrumSetting';
14
- function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
14
+ function SpectraTabsInner({ data, activeSpectra, activeTab, }) {
15
15
  const [selectedSpectrumData, setSelectedSpectrum] = useState(null);
16
16
  const [settingModalPosition, setSettingModalPosition] = useState(null);
17
17
  const [isSettingModalDisplayed, setIsSettingModalDisplayed] = useState(false);
18
18
  const dispatch = useDispatch();
19
- const spectrumsGroupByNucleus = useMemo(() => {
19
+ const spectraGroupByNucleus = useMemo(() => {
20
20
  if (!data)
21
21
  return [];
22
22
  const groupByNucleus = groupByInfoKey('nucleus');
@@ -54,11 +54,11 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
54
54
  tbody tr {
55
55
  height: 20px;
56
56
  }
57
- `, children: [_jsx(Tabs, { activeTab: activeTab, onClick: onTabChangeHandler, children: spectrumsGroupByNucleus &&
58
- Object.keys(spectrumsGroupByNucleus).map((nucleus) => (_jsx(Tab, { render: ({ title }) => _jsx(IsotopesViewer, { value: title }), title: nucleus, tabid: nucleus, children: _jsx(SpectraTable, { nucleus: nucleus, data: spectrumsGroupByNucleus[nucleus], activeSpectra: activeSpectra?.[nucleus] || null, onChangeVisibility: handleChangeVisibility, onChangeActiveSpectrum: handleChangeActiveSpectrum, onOpenSettingModal: openSettingHandler }) }, nucleus))) }, activeTab), isSettingModalDisplayed ? (_jsx(SpectrumSetting, { onClose: mouseLeaveHandler, data: selectedSpectrumData, position: settingModalPosition })) : null] }));
57
+ `, children: [_jsx(Tabs, { activeTab: activeTab, onClick: onTabChangeHandler, children: spectraGroupByNucleus &&
58
+ Object.keys(spectraGroupByNucleus).map((nucleus) => (_jsx(Tab, { render: ({ title }) => _jsx(IsotopesViewer, { value: title }), title: nucleus, tabid: nucleus, children: _jsx(SpectraTable, { nucleus: nucleus, data: spectraGroupByNucleus[nucleus], activeSpectra: activeSpectra?.[nucleus] || null, onChangeVisibility: handleChangeVisibility, onChangeActiveSpectrum: handleChangeActiveSpectrum, onOpenSettingModal: openSettingHandler }) }, nucleus))) }, activeTab), isSettingModalDisplayed ? (_jsx(SpectrumSetting, { onClose: mouseLeaveHandler, data: selectedSpectrumData, position: settingModalPosition })) : null] }));
59
59
  }
60
- const MemoizedSpectra = memo(SpectrumsTabsInner);
61
- export default function SpectrumsTabs() {
60
+ const MemoizedSpectra = memo(SpectraTabsInner);
61
+ export default function SpectraTabs() {
62
62
  const { data, view: { spectra: { activeTab, activeSpectra }, }, } = useChartData();
63
63
  return _jsx(MemoizedSpectra, { data, activeSpectra, activeTab });
64
64
  }
@@ -3,7 +3,7 @@ import { memo, useState, useRef } from 'react';
3
3
  import PreferencesHeader from '../header/PreferencesHeader';
4
4
  import SpectraPanelHeader from './SpectraPanelHeader';
5
5
  import SpectraPreferences from './SpectraPreferences';
6
- import SpectrumsTabs from './SpectrumsTabs';
6
+ import SpectraTabs from './SpectraTabs';
7
7
  const styles = {
8
8
  overflow: 'hidden',
9
9
  height: '100%',
@@ -23,6 +23,6 @@ function SpectrumListPanel() {
23
23
  setFlipStatus(!isFlipped);
24
24
  }
25
25
  }
26
- return (_jsx("div", { style: styles, children: isFlipped ? (_jsxs(_Fragment, { children: [_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }), _jsx(SpectraPreferences, { ref: settingsRef })] })) : (_jsxs(_Fragment, { children: [_jsx(SpectraPanelHeader, { onSettingClick: settingsPanelHandler }), _jsx(SpectrumsTabs, {})] })) }));
26
+ return (_jsx("div", { style: styles, children: isFlipped ? (_jsxs(_Fragment, { children: [_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }), _jsx(SpectraPreferences, { ref: settingsRef })] })) : (_jsxs(_Fragment, { children: [_jsx(SpectraPanelHeader, { onSettingClick: settingsPanelHandler }), _jsx(SpectraTabs, {})] })) }));
27
27
  }
28
28
  export default memo(SpectrumListPanel);