nmrium 1.0.0 → 1.2.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 (246) hide show
  1. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  2. package/lib/component/1d/FloatPublicationString.js +2 -2
  3. package/lib/component/1d/FloatingRanges.js +3 -3
  4. package/lib/component/1d/FloatingRanges.js.map +1 -1
  5. package/lib/component/1d/FooterBanner.js +1 -1
  6. package/lib/component/1d/LinesSeries.js +1 -1
  7. package/lib/component/1d/PredictionErrorsNotations.js +2 -2
  8. package/lib/component/1d/inset/DraggableInset.js +2 -2
  9. package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  10. package/lib/component/1d/multiAnalysis/AnalysisRange.js.map +1 -1
  11. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.d.ts +1 -1
  12. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.d.ts.map +1 -1
  13. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +3 -1
  14. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js.map +1 -1
  15. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +1 -1
  16. package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
  17. package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
  18. package/lib/component/1d/peaks/Peaks.js +1 -1
  19. package/lib/component/1d/peaks/Peaks.js.map +1 -1
  20. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -3
  21. package/lib/component/1d-2d/tools/BrushXY.js +2 -2
  22. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.js +1 -1
  23. package/lib/component/2d/SignalDeltaLine.js +1 -1
  24. package/lib/component/2d/zones/Signal.d.ts.map +1 -1
  25. package/lib/component/2d/zones/Signal.js +1 -1
  26. package/lib/component/2d/zones/Signal.js.map +1 -1
  27. package/lib/component/2d/zones/SignalsGuideLines.js +2 -2
  28. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  29. package/lib/component/2d/zones/Zone.d.ts.map +1 -1
  30. package/lib/component/2d/zones/Zone.js +3 -1
  31. package/lib/component/2d/zones/Zone.js.map +1 -1
  32. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
  33. package/lib/component/elements/ActionsButtonsPopover.js +4 -4
  34. package/lib/component/elements/Alert.js +2 -2
  35. package/lib/component/elements/AssignmentsCell.js +1 -1
  36. package/lib/component/elements/Button.js +10 -10
  37. package/lib/component/elements/Button.js.map +1 -1
  38. package/lib/component/elements/DraggableDialog.js +3 -3
  39. package/lib/component/elements/EditableColumn.js +3 -3
  40. package/lib/component/elements/EmptyText.js +2 -2
  41. package/lib/component/elements/Footer.js +9 -9
  42. package/lib/component/elements/Footer.js.map +1 -1
  43. package/lib/component/elements/MoleculeSelection.js +19 -19
  44. package/lib/component/elements/MoleculeSelection.js.map +1 -1
  45. package/lib/component/elements/NextPrev.js +15 -15
  46. package/lib/component/elements/NextPrev.js.map +1 -1
  47. package/lib/component/elements/ReactTable/BaseReactTable.js +6 -6
  48. package/lib/component/elements/ReadOnly.js +8 -8
  49. package/lib/component/elements/ReadOnly.js.map +1 -1
  50. package/lib/component/elements/Sections.js +29 -29
  51. package/lib/component/elements/Sections.js.map +1 -1
  52. package/lib/component/elements/Select.js +10 -10
  53. package/lib/component/elements/Select.js.map +1 -1
  54. package/lib/component/elements/StyledDialogBody.js +1 -1
  55. package/lib/component/elements/StyledDialogBody.js.map +1 -1
  56. package/lib/component/elements/Tab/DeleteButton.js +5 -5
  57. package/lib/component/elements/Tab/Tabs.js +5 -5
  58. package/lib/component/elements/dropDownButton/DropDownList.js +6 -6
  59. package/lib/component/elements/export/ExportManager.d.ts.map +1 -1
  60. package/lib/component/elements/export/ExportManager.js +12 -1
  61. package/lib/component/elements/export/ExportManager.js.map +1 -1
  62. package/lib/component/elements/resizer/SVGResizer.js +1 -1
  63. package/lib/component/header/Header.d.ts.map +1 -1
  64. package/lib/component/header/Header.js +11 -1
  65. package/lib/component/header/Header.js.map +1 -1
  66. package/lib/component/hooks/useExport.d.ts.map +1 -1
  67. package/lib/component/hooks/useExport.js +25 -10
  68. package/lib/component/hooks/useExport.js.map +1 -1
  69. package/lib/component/hooks/useFilter.d.ts.map +1 -1
  70. package/lib/component/hooks/useFilter.js +4 -5
  71. package/lib/component/hooks/useFilter.js.map +1 -1
  72. package/lib/component/hooks/useSaveSettings.js +2 -2
  73. package/lib/component/loader/DefaultSpinnerComponent.js +9 -9
  74. package/lib/component/loader/DropZone.js +8 -8
  75. package/lib/component/main/ErrorOverlay.js +4 -4
  76. package/lib/component/main/InnerNMRiumContents.js +3 -3
  77. package/lib/component/modal/AboutPredictionModal.js +2 -2
  78. package/lib/component/modal/AboutSpectrumSimulationModal.js +2 -2
  79. package/lib/component/modal/MultipletAnalysisModal.js +12 -12
  80. package/lib/component/modal/PredictSpectraModal.js +4 -4
  81. package/lib/component/modal/PublicationStringModal.js +2 -2
  82. package/lib/component/modal/aboutUs/AboutUsModal.js +3 -3
  83. package/lib/component/modal/changeSum/ChangeSumModalContents.js +1 -1
  84. package/lib/component/modal/changeSum/SelectMolecule.js +5 -5
  85. package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
  86. package/lib/component/modal/setting/GeneralSettings.js +5 -5
  87. package/lib/component/panels/Panels.js +2 -2
  88. package/lib/component/panels/PanelsBar.js +3 -3
  89. package/lib/component/panels/PanelsBar.js.map +1 -1
  90. package/lib/component/panels/RangesPanel/RangesTable.js +6 -6
  91. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  92. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +9 -9
  93. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +5 -5
  94. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +11 -11
  95. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +7 -7
  96. package/lib/component/panels/SummaryPanel/Overview.js +1 -1
  97. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
  98. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -5
  99. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  100. package/lib/component/panels/ZonesPanel/ZonesTable.js +6 -6
  101. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
  102. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +11 -3
  103. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
  104. package/lib/component/panels/filtersPanel/Filters/InnerFilterHeader.js +1 -1
  105. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +4 -4
  106. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +1 -1
  107. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js.map +1 -1
  108. package/lib/component/panels/predictionPanel/PredictionPanel.js +6 -6
  109. package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
  110. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
  111. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  112. package/lib/component/reducer/actions/FiltersActions.js +54 -28
  113. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  114. package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
  115. package/lib/component/toolbar/ToolTypes.js +0 -6
  116. package/lib/component/toolbar/ToolTypes.js.map +1 -1
  117. package/lib/component/utility/renderCoreSlot.d.ts +4 -0
  118. package/lib/component/utility/renderCoreSlot.d.ts.map +1 -0
  119. package/lib/component/utility/renderCoreSlot.js +5 -0
  120. package/lib/component/utility/renderCoreSlot.js.map +1 -0
  121. package/lib/component/workspaces/assignment.d.ts.map +1 -1
  122. package/lib/component/workspaces/assignment.js +1 -0
  123. package/lib/component/workspaces/assignment.js.map +1 -1
  124. package/lib/component/workspaces/basic.d.ts.map +1 -1
  125. package/lib/component/workspaces/basic.js +1 -0
  126. package/lib/component/workspaces/basic.js.map +1 -1
  127. package/lib/component/workspaces/embedded.d.ts.map +1 -1
  128. package/lib/component/workspaces/embedded.js +1 -0
  129. package/lib/component/workspaces/embedded.js.map +1 -1
  130. package/lib/component/workspaces/exercise.d.ts.map +1 -1
  131. package/lib/component/workspaces/exercise.js +1 -0
  132. package/lib/component/workspaces/exercise.js.map +1 -1
  133. package/lib/component/workspaces/prediction.d.ts.map +1 -1
  134. package/lib/component/workspaces/prediction.js +1 -0
  135. package/lib/component/workspaces/prediction.js.map +1 -1
  136. package/lib/component/workspaces/process1D.d.ts.map +1 -1
  137. package/lib/component/workspaces/process1D.js +1 -0
  138. package/lib/component/workspaces/process1D.js.map +1 -1
  139. package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
  140. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  141. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  142. package/lib/data/PredictionManager.d.ts.map +1 -1
  143. package/lib/data/PredictionManager.js +7 -21
  144. package/lib/data/PredictionManager.js.map +1 -1
  145. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +1 -1
  146. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js.map +1 -1
  147. package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +1 -1
  148. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  149. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  150. package/lib/data/utilities/generateColor.d.ts.map +1 -1
  151. package/lib/data/utilities/generateColor.js +1 -1
  152. package/lib/data/utilities/generateColor.js.map +1 -1
  153. package/lib/data/utilities/isNumber.js +1 -1
  154. package/lib/data/utilities/isNumber.js.map +1 -1
  155. package/lib/utils/clipboard/clipboardComponents.js +1 -1
  156. package/lib/versionInfo.js +1 -1
  157. package/package.json +41 -36
  158. package/src/component/1d/ExclusionZoneAnnotation.tsx +1 -1
  159. package/src/component/1d/FloatPublicationString.tsx +2 -2
  160. package/src/component/1d/FloatingRanges.tsx +3 -3
  161. package/src/component/1d/FooterBanner.tsx +1 -1
  162. package/src/component/1d/LinesSeries.tsx +1 -1
  163. package/src/component/1d/PredictionErrorsNotations.tsx +2 -2
  164. package/src/component/1d/inset/DraggableInset.tsx +2 -2
  165. package/src/component/1d/multiAnalysis/AnalysisRange.tsx +1 -1
  166. package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +3 -1
  167. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +1 -1
  168. package/src/component/1d/peaks/Peaks.tsx +2 -6
  169. package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +3 -3
  170. package/src/component/1d-2d/tools/BrushXY.tsx +2 -2
  171. package/src/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.tsx +1 -1
  172. package/src/component/2d/SignalDeltaLine.tsx +1 -1
  173. package/src/component/2d/zones/Signal.tsx +2 -1
  174. package/src/component/2d/zones/SignalsGuideLines.tsx +2 -2
  175. package/src/component/2d/zones/Zone.tsx +2 -1
  176. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
  177. package/src/component/elements/ActionsButtonsPopover.tsx +4 -4
  178. package/src/component/elements/Alert.tsx +2 -2
  179. package/src/component/elements/AssignmentsCell.tsx +1 -1
  180. package/src/component/elements/Button.tsx +10 -10
  181. package/src/component/elements/DraggableDialog.tsx +3 -3
  182. package/src/component/elements/EditableColumn.tsx +3 -3
  183. package/src/component/elements/EmptyText.tsx +2 -2
  184. package/src/component/elements/Footer.tsx +9 -9
  185. package/src/component/elements/MoleculeSelection.tsx +19 -19
  186. package/src/component/elements/NextPrev.tsx +15 -15
  187. package/src/component/elements/ReactTable/BaseReactTable.tsx +6 -6
  188. package/src/component/elements/ReadOnly.tsx +8 -8
  189. package/src/component/elements/Sections.tsx +29 -29
  190. package/src/component/elements/Select.tsx +10 -10
  191. package/src/component/elements/StyledDialogBody.tsx +1 -1
  192. package/src/component/elements/Tab/DeleteButton.tsx +5 -5
  193. package/src/component/elements/Tab/Tabs.tsx +5 -5
  194. package/src/component/elements/dropDownButton/DropDownList.tsx +6 -6
  195. package/src/component/elements/export/ExportManager.tsx +13 -3
  196. package/src/component/elements/resizer/SVGResizer.tsx +1 -1
  197. package/src/component/header/Header.tsx +15 -0
  198. package/src/component/hooks/useExport.tsx +21 -10
  199. package/src/component/hooks/useFilter.ts +4 -6
  200. package/src/component/hooks/useSaveSettings.tsx +2 -2
  201. package/src/component/loader/DefaultSpinnerComponent.tsx +9 -9
  202. package/src/component/loader/DropZone.tsx +8 -8
  203. package/src/component/main/ErrorOverlay.tsx +4 -4
  204. package/src/component/main/InnerNMRiumContents.tsx +3 -3
  205. package/src/component/modal/AboutPredictionModal.tsx +2 -2
  206. package/src/component/modal/AboutSpectrumSimulationModal.tsx +2 -2
  207. package/src/component/modal/MultipletAnalysisModal.tsx +12 -12
  208. package/src/component/modal/PredictSpectraModal.tsx +4 -4
  209. package/src/component/modal/PublicationStringModal.tsx +2 -2
  210. package/src/component/modal/aboutUs/AboutUsModal.tsx +3 -3
  211. package/src/component/modal/changeSum/ChangeSumModalContents.tsx +1 -1
  212. package/src/component/modal/changeSum/SelectMolecule.tsx +5 -5
  213. package/src/component/modal/setting/GeneralSettings.tsx +5 -5
  214. package/src/component/panels/Panels.tsx +2 -2
  215. package/src/component/panels/PanelsBar.tsx +3 -3
  216. package/src/component/panels/RangesPanel/RangesTable.tsx +6 -6
  217. package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -1
  218. package/src/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.tsx +9 -9
  219. package/src/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.tsx +5 -5
  220. package/src/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.tsx +11 -11
  221. package/src/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.tsx +7 -7
  222. package/src/component/panels/SummaryPanel/Overview.tsx +1 -1
  223. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -5
  224. package/src/component/panels/ZonesPanel/ZonesTable.tsx +6 -6
  225. package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +12 -3
  226. package/src/component/panels/filtersPanel/Filters/InnerFilterHeader.tsx +1 -1
  227. package/src/component/panels/multipleAnalysisPanel/AlignSpectra.tsx +4 -4
  228. package/src/component/panels/predictionPanel/PredictionOptionsPanel.tsx +1 -1
  229. package/src/component/panels/predictionPanel/PredictionPanel.tsx +6 -6
  230. package/src/component/panels/predictionPanel/PredictionSimpleOptions.tsx +1 -1
  231. package/src/component/reducer/actions/FiltersActions.ts +162 -81
  232. package/src/component/toolbar/ToolTypes.ts +0 -6
  233. package/src/component/utility/renderCoreSlot.tsx +11 -0
  234. package/src/component/workspaces/assignment.ts +1 -0
  235. package/src/component/workspaces/basic.ts +1 -0
  236. package/src/component/workspaces/embedded.ts +1 -0
  237. package/src/component/workspaces/exercise.ts +1 -0
  238. package/src/component/workspaces/prediction.ts +1 -0
  239. package/src/component/workspaces/process1D.ts +1 -0
  240. package/src/component/workspaces/workspaceDefaultProperties.ts +1 -0
  241. package/src/data/PredictionManager.ts +8 -23
  242. package/src/data/data1d/Spectrum1D/ranges/resurrectSpectrum.ts +1 -1
  243. package/src/data/utilities/generateColor.ts +5 -3
  244. package/src/data/utilities/isNumber.ts +1 -1
  245. package/src/utils/clipboard/clipboardComponents.tsx +1 -1
  246. package/src/versionInfo.ts +1 -1
@@ -7,16 +7,16 @@ import type { TabEvents, TabProps } from './Tab.js';
7
7
  import Tab from './Tab.js';
8
8
 
9
9
  const topStyles = css`
10
- height: 100%;
11
- width: 100%;
12
10
  display: flex;
13
11
  flex-direction: column;
12
+ height: 100%;
13
+ width: 100%;
14
14
 
15
15
  .tab-list {
16
16
  border-bottom: 1px solid #ccc;
17
- padding-left: 0;
18
- margin: 0;
19
17
  display: inline-flex;
18
+ margin: 0;
19
+ padding-left: 0;
20
20
  }
21
21
 
22
22
  .tab-list li:first-of-type {
@@ -52,8 +52,8 @@ const leftStyles = css`
52
52
 
53
53
  .tab-list {
54
54
  border-right: 1px solid #ccc;
55
- padding-left: 0;
56
55
  margin: 0;
56
+ padding-left: 0;
57
57
  }
58
58
 
59
59
  .tab-list li:hover {
@@ -8,27 +8,27 @@ import type {
8
8
 
9
9
  const Menu = styled.ul`
10
10
  list-style-type: none;
11
- padding: 0;
12
11
  margin: 0;
12
+ padding: 0;
13
13
  `;
14
14
  const MenuItem = styled.li`
15
+ border-bottom: 0.55px solid #f9f9f9;
16
+ color: black;
15
17
  text-align: center;
16
18
  white-space: nowrap;
17
- color: black;
18
- border-bottom: 0.55px solid #f9f9f9;
19
19
 
20
- &:last-of-type {
20
+ :last-of-type {
21
21
  border-bottom: none;
22
22
  }
23
23
 
24
- &:hover {
24
+ :hover {
25
25
  background-color: #f6f6f6;
26
26
  }
27
27
  `;
28
28
 
29
29
  const Text = styled.span`
30
- padding: 5px 20px;
31
30
  display: block;
31
+ padding: 5px 20px;
32
32
  `;
33
33
 
34
34
  interface InnerDropDownListProps<T>
@@ -10,6 +10,7 @@ import {
10
10
 
11
11
  import { useChartData } from '../../context/ChartContext.js';
12
12
  import { usePreferences } from '../../context/PreferencesContext.js';
13
+ import { useToaster } from '../../context/ToasterContext.tsx';
13
14
  import { useExportViewPort } from '../../hooks/useExport.js';
14
15
  import { useWorkspaceExportSettings } from '../../hooks/useWorkspaceExportSettings.js';
15
16
 
@@ -67,11 +68,13 @@ interface ExportManagerControllerProps {
67
68
 
68
69
  export function ExportManagerController(props: ExportManagerControllerProps) {
69
70
  const { children } = props;
70
-
71
+ const { data, width } = useChartData();
72
+ const hasDataToExport = data.length > 0;
71
73
  const [exportOptions, triggerExport] = useState<ExportOptions | null>(null);
72
74
  const exportRef = useExportManagerAPI();
73
75
  const workspaceExportSettings = useWorkspaceExportSettings();
74
76
  const { dispatch } = usePreferences();
77
+ const toaster = useToaster();
75
78
  useImperativeHandle(
76
79
  exportRef,
77
80
  () => ({
@@ -97,6 +100,15 @@ export function ExportManagerController(props: ExportManagerControllerProps) {
97
100
  return null;
98
101
  }
99
102
 
103
+ if (!hasDataToExport) {
104
+ handleCloseExportOptionsDialog();
105
+ toaster.show({
106
+ intent: 'danger',
107
+ message: 'No spectra available for export',
108
+ });
109
+ return null;
110
+ }
111
+
100
112
  const { format, destination = 'file' } = exportOptions;
101
113
 
102
114
  const handlers: ExportHandlers = {
@@ -133,8 +145,6 @@ export function ExportManagerController(props: ExportManagerControllerProps) {
133
145
  void runExport();
134
146
  }
135
147
 
136
- const { width } = useChartData();
137
-
138
148
  if (!exportOptions) return null;
139
149
 
140
150
  const { format, destination = 'file' } = exportOptions;
@@ -23,7 +23,7 @@ const style: Record<'anchor' | 'innerContainer', CSSProperties> = {
23
23
  };
24
24
 
25
25
  const Group = styled.g`
26
- &:hover {
26
+ :hover {
27
27
  rect:last-child {
28
28
  fill: red !important;
29
29
  }
@@ -1,3 +1,4 @@
1
+ import styled from '@emotion/styled';
1
2
  import { memo, useMemo } from 'react';
2
3
  import {
3
4
  FaFilm,
@@ -9,6 +10,7 @@ import { Toolbar, useFullscreen } from 'react-science/ui';
9
10
 
10
11
  import { docsBaseUrl } from '../../constants.js';
11
12
  import { useChartData } from '../context/ChartContext.js';
13
+ import { useCore } from '../context/CoreContext.js';
12
14
  import {
13
15
  usePreferences,
14
16
  useWorkspacesList,
@@ -26,6 +28,7 @@ import AboutUsModal from '../modal/aboutUs/AboutUsModal.js';
26
28
  import GeneralSettingsModal from '../modal/setting/GeneralSettings.js';
27
29
  import WorkspaceItem from '../modal/setting/WorkspaceItem.js';
28
30
  import { options } from '../toolbar/ToolTypes.js';
31
+ import { renderCoreSlot } from '../utility/renderCoreSlot.js';
29
32
 
30
33
  import { AutoPeakPickingOptionPanel } from './AutoPeakPickingOptionPanel.js';
31
34
  import { HeaderWrapper } from './HeaderWrapper.js';
@@ -60,6 +63,7 @@ interface HeaderInnerProps {
60
63
 
61
64
  function HeaderInner(props: HeaderInnerProps) {
62
65
  const { selectedOptionPanel, height } = props;
66
+ const core = useCore();
63
67
 
64
68
  const {
65
69
  current: {
@@ -144,6 +148,10 @@ function HeaderInner(props: HeaderInnerProps) {
144
148
  alignItems: 'center',
145
149
  }}
146
150
  >
151
+ <PluginTopBarRight>
152
+ {renderCoreSlot(core, 'topbar.right')}
153
+ </PluginTopBarRight>
154
+
147
155
  {!hideWorkspaces && (
148
156
  <DropDownButton
149
157
  data={workspacesList}
@@ -242,3 +250,10 @@ export function Header() {
242
250
  />
243
251
  );
244
252
  }
253
+
254
+ const PluginTopBarRight = styled.div`
255
+ align-items: center;
256
+ display: flex;
257
+ gap: 5px;
258
+ margin-right: 5px;
259
+ `;
@@ -32,9 +32,8 @@ export function useExport() {
32
32
  const hideLoading = toaster.showLoading({
33
33
  message: 'Exporting as NMRium process in progress',
34
34
  });
35
-
36
- try {
37
- void (async () => {
35
+ setTimeout(async () => {
36
+ try {
38
37
  const fileName = state.data[0]?.info?.name;
39
38
  const exportedData = toJSON(core, state, preferencesState, {
40
39
  exportTarget: 'nmrium',
@@ -42,11 +41,16 @@ export function useExport() {
42
41
  });
43
42
 
44
43
  await exportAsJSON(exportedData, fileName, spaceIndent, isCompressed);
44
+ } catch (error) {
45
+ toaster.show({
46
+ intent: 'danger',
47
+ message: `Export failed due to an unexpected error: ${(error as Error)?.message || 'Unknown error'}`,
48
+ });
49
+ reportError(error);
50
+ } finally {
45
51
  hideLoading();
46
- })();
47
- } catch (error) {
48
- reportError(error);
49
- }
52
+ }
53
+ }, 0);
50
54
  },
51
55
  [core, preferencesState, state, toaster],
52
56
  );
@@ -58,16 +62,23 @@ export function useExport() {
58
62
  const hideLoading = toaster.showLoading({
59
63
  message: `Exporting as ${name}.nmrium process in progress`,
60
64
  });
61
- setTimeout(() => {
62
- void (async () => {
65
+ setTimeout(async () => {
66
+ try {
63
67
  const exportedData = toJSON(core, state, preferencesState, {
64
68
  ...include,
65
69
  exportTarget: 'nmrium',
66
70
  });
67
71
  const spaceIndent = pretty ? 2 : 0;
68
72
  await exportAsJSON(exportedData, name, spaceIndent, compressed);
73
+ } catch (error) {
74
+ toaster.show({
75
+ intent: 'danger',
76
+ message: `Export failed due to an unexpected error: ${(error as Error)?.message || 'Unknown error'}`,
77
+ });
78
+ reportError(error);
79
+ } finally {
69
80
  hideLoading();
70
- })();
81
+ }
71
82
  }, 0);
72
83
  }
73
84
 
@@ -7,7 +7,7 @@ import type { FilterEntry } from '../../data/types/common/FilterEntry.js';
7
7
 
8
8
  import useSpectrum from './useSpectrum.js';
9
9
 
10
- const emptyData = { filters: {} };
10
+ const emptyData = { filters: [] };
11
11
  type FilterReturnType<T> = T extends Filter1DEntry['name']
12
12
  ? ExtractFilterEntry<T>
13
13
  : T extends Filter2DEntry['name']
@@ -20,12 +20,10 @@ export function useFilter<T extends FilterEntry['name']>(
20
20
  const { filters } = useSpectrum(emptyData) as Spectrum1D | Spectrum2D;
21
21
 
22
22
  return useMemo(() => {
23
- const filter = filters.find((filter) => filter.name === filterID);
23
+ if (!filters?.length) return null;
24
24
 
25
- if (filter) {
26
- return filter as FilterReturnType<T>;
27
- }
25
+ const filter = filters.find((filter) => filter.name === filterID);
28
26
 
29
- return null;
27
+ return (filter as FilterReturnType<T>) ?? null;
30
28
  }, [filterID, filters]);
31
29
  }
@@ -125,8 +125,8 @@ const DialogContent = styled(DialogBody)`
125
125
  `;
126
126
 
127
127
  const Title = styled.p`
128
- padding: 0 30px;
128
+ font-size: 1em;
129
129
  font-weight: bold;
130
+ padding: 0 30px;
130
131
  text-align: left;
131
- font-size: 1em;
132
132
  `;
@@ -1,25 +1,25 @@
1
1
  import styled from '@emotion/styled';
2
2
 
3
3
  const Container = styled.div`
4
- display: flex;
4
+ position: absolute;
5
5
  align-items: center;
6
- justify-content: center;
7
6
  background-color: rgb(255 255 255 / 25%);
8
- height: 100%;
7
+ display: flex;
9
8
  flex-direction: column;
9
+ height: 100%;
10
+ justify-content: center;
10
11
  user-select: none;
11
- position: absolute;
12
12
  width: 100%;
13
13
 
14
14
  svg {
15
- animation-name: spin-animation;
16
- animation-iteration-count: infinite;
17
- animation-fill-mode: forwards;
18
15
  animation-direction: inherit;
19
- animation-timing-function: linear;
20
16
  animation-duration: 1s;
21
- width: 100px;
17
+ animation-fill-mode: forwards;
18
+ animation-iteration-count: infinite;
19
+ animation-name: spin-animation;
20
+ animation-timing-function: linear;
22
21
  height: 100px;
22
+ width: 100px;
23
23
  }
24
24
 
25
25
  @keyframes spin-animation {
@@ -12,28 +12,28 @@ import { MetaImportationModal } from '../modal/metaImportation/MetaImportationMo
12
12
  import { useLoadFiles } from './useLoadFiles.js';
13
13
 
14
14
  const DropContainer = styled.div`
15
- height: 100%;
16
- background-color: #b5b5b599;
17
15
  position: absolute;
18
- display: flex;
19
- justify-content: center;
20
16
  align-items: center;
17
+ background-color: #b5b5b599;
18
+ display: flex;
21
19
  flex-flow: column;
20
+ height: 100%;
21
+ justify-content: center;
22
22
  z-index: 8;
23
23
 
24
24
  svg {
25
- stroke-width: 0;
26
- font-size: 3rem !important;
27
25
  fill: white;
26
+ font-size: 3rem !important;
27
+ stroke-width: 0;
28
28
  }
29
29
  `;
30
30
 
31
31
  const DropText = styled.p`
32
- color: white;
33
32
  background-color: rgb(104 104 104);
34
- padding: 1.5%;
35
33
  border-radius: 30px;
34
+ color: white;
36
35
  margin: 0;
36
+ padding: 1.5%;
37
37
  `;
38
38
 
39
39
  const Container = styled.div`
@@ -3,19 +3,19 @@ import type { FallbackProps } from 'react-error-boundary';
3
3
 
4
4
  const WrongP = styled.p`
5
5
  background-color: white;
6
- padding: 20px;
7
6
  border-radius: 10px;
8
7
  font-size: 30px;
8
+ padding: 20px;
9
9
  text-align: center;
10
10
  `;
11
11
 
12
12
  const Details = styled.details`
13
- margin-top: 10px;
14
- white-space: pre-wrap;
15
13
  background-color: white;
16
- padding: 20px;
17
14
  border-radius: 10px;
18
15
  color: red;
16
+ margin-top: 10px;
17
+ padding: 20px;
18
+ white-space: pre-wrap;
19
19
  `;
20
20
 
21
21
  export default function ErrorOverlay(props: FallbackProps) {
@@ -26,9 +26,9 @@ import type { NMRiumProps, NMRiumRefAPI } from './index.js';
26
26
 
27
27
  const NMRiumContainer = styled.div`
28
28
  background-color: white;
29
- width: 100%;
30
29
  display: block;
31
30
  height: 100%;
31
+ width: 100%;
32
32
 
33
33
  div:focus {
34
34
  outline: none !important;
@@ -62,8 +62,8 @@ const NMRiumContainer = styled.div`
62
62
 
63
63
  .actions-buttons-popover {
64
64
  background: transparent;
65
- padding: 5px;
66
65
  box-shadow: none;
66
+ padding: 5px;
67
67
  }
68
68
  `;
69
69
 
@@ -105,9 +105,9 @@ export function InnerNMRiumContents(props: InnerNMRiumContentsProps) {
105
105
  <Global
106
106
  styles={css`
107
107
  .actions-buttons-popover {
108
+ background-color: white;
108
109
  border-radius: 10px;
109
110
  padding: 5px;
110
- background-color: white;
111
111
  }
112
112
 
113
113
  .popover-tab {
@@ -13,8 +13,8 @@ const DialogBody = styled(StyledDialogBody)`
13
13
 
14
14
  p,
15
15
  li {
16
- user-select: text;
17
16
  font-size: 1.1em;
17
+ user-select: text;
18
18
  }
19
19
 
20
20
  a {
@@ -28,8 +28,8 @@ const DialogBody = styled(StyledDialogBody)`
28
28
 
29
29
  .header span {
30
30
  color: #464646;
31
- font-size: 15px;
32
31
  flex: 1;
32
+ font-size: 15px;
33
33
  user-select: none;
34
34
  }
35
35
 
@@ -15,8 +15,8 @@ const DialogBody = styled(StyledDialogBody)`
15
15
 
16
16
  p,
17
17
  li {
18
- user-select: text;
19
18
  font-size: 1.1em;
19
+ user-select: text;
20
20
  }
21
21
 
22
22
  a {
@@ -30,8 +30,8 @@ const DialogBody = styled(StyledDialogBody)`
30
30
 
31
31
  .header span {
32
32
  color: #464646;
33
- font-size: 15px;
34
33
  flex: 1;
34
+ font-size: 15px;
35
35
  user-select: none;
36
36
  }
37
37
 
@@ -12,46 +12,46 @@ import { useScaleChecked } from '../context/ScaleContext.js';
12
12
  import { StyledDialogBody } from '../elements/StyledDialogBody.js';
13
13
 
14
14
  const Container = styled.div`
15
- padding: 10px;
16
15
  max-height: 500px;
17
16
  overflow-y: auto;
17
+ padding: 10px;
18
18
  `;
19
19
 
20
20
  const Row = styled.div`
21
- outline: none;
22
21
  display: flex;
23
22
  flex-direction: row;
24
23
  margin: 0;
24
+ outline: none;
25
25
 
26
- &:nth-child(odd) {
26
+ :nth-child(odd) {
27
27
  background: #fafafa;
28
28
  }
29
29
  `;
30
30
 
31
31
  const Multiplicity = styled.div`
32
- flex: 2;
33
- display: flex;
34
32
  align-items: center;
33
+ display: flex;
34
+ flex: 2;
35
35
  justify-content: center;
36
36
  padding: 0 20px;
37
37
  `;
38
38
 
39
39
  const LoaderContainer = styled.div`
40
- display: flex;
41
40
  align-items: center;
42
- justify-content: center;
41
+ display: flex;
43
42
  flex-direction: column;
43
+ justify-content: center;
44
44
  user-select: none;
45
45
 
46
46
  svg {
47
- animation-name: spin-animation;
48
- animation-iteration-count: infinite;
49
- animation-fill-mode: forwards;
50
47
  animation-direction: inherit;
51
- animation-timing-function: linear;
52
48
  animation-duration: 1s;
53
- width: 100px;
49
+ animation-fill-mode: forwards;
50
+ animation-iteration-count: infinite;
51
+ animation-name: spin-animation;
52
+ animation-timing-function: linear;
54
53
  height: 100px;
54
+ width: 100px;
55
55
  }
56
56
 
57
57
  @keyframes spin-animation {
@@ -26,15 +26,15 @@ const DialogBody = styled(StyledDialogBody)`
26
26
 
27
27
  .warning {
28
28
  color: #c40000;
29
- font-weight: bold;
30
29
  font-size: 13px;
31
- text-align: justify;
30
+ font-weight: bold;
32
31
  margin-top: 30px;
32
+ text-align: justify;
33
33
  }
34
34
 
35
35
  .warning-container {
36
- margin-top: 5px;
37
36
  display: flex;
37
+ margin-top: 5px;
38
38
 
39
39
  input {
40
40
  margin: 5px 5px 5px 0;
@@ -42,8 +42,8 @@ const DialogBody = styled(StyledDialogBody)`
42
42
  }
43
43
 
44
44
  .header {
45
- padding: 0;
46
45
  margin: 0 30%;
46
+ padding: 0;
47
47
  width: 40%;
48
48
  }
49
49
  `;
@@ -16,10 +16,10 @@ import { usePanelPreferences } from '../hooks/usePanelPreferences.js';
16
16
  import useSpectrum from '../hooks/useSpectrum.js';
17
17
 
18
18
  const Body = styled.div`
19
+ border: 1px solid #e9e9e9;
20
+ min-height: 180px;
19
21
  padding: 5px;
20
22
  width: 100%;
21
- min-height: 180px;
22
- border: 1px solid #e9e9e9;
23
23
  `;
24
24
 
25
25
  const labelStyle: LabelStyle = {
@@ -29,8 +29,8 @@ const CustomDialogBody = styled(StyledDialogBody)`
29
29
  }
30
30
 
31
31
  span.title {
32
- font-weight: bold;
33
32
  color: #ea580c;
33
+ font-weight: bold;
34
34
  }
35
35
 
36
36
  span.content {
@@ -54,9 +54,9 @@ const CustomDialogBody = styled(StyledDialogBody)`
54
54
  `;
55
55
 
56
56
  const InfoBlock = styled.div`
57
+ align-items: center;
57
58
  display: flex;
58
59
  flex-direction: column;
59
- align-items: center;
60
60
  `;
61
61
  const Container = styled.div`
62
62
  padding: 20px;
@@ -64,9 +64,9 @@ const Container = styled.div`
64
64
 
65
65
  const Separator = styled.span`
66
66
  border-bottom: 1px solid gray;
67
- width: 15px;
68
67
  height: 1px;
69
68
  margin: 10px 0;
69
+ width: 15px;
70
70
  `;
71
71
 
72
72
  function AboutUsModal() {
@@ -44,9 +44,9 @@ type SaveInput =
44
44
  };
45
45
 
46
46
  const ManualContainer = styled.div`
47
- padding: 30px 5px;
48
47
  display: flex;
49
48
  justify-content: center;
49
+ padding: 30px 5px;
50
50
  `;
51
51
 
52
52
  interface SumOption {
@@ -14,27 +14,27 @@ const Container = styled.div`
14
14
  flex-grow: 1;
15
15
  `;
16
16
  const SelectionContainer = styled.div`
17
- width: 450px;
18
17
  display: block;
19
18
  margin: 0 auto;
19
+ width: 450px;
20
20
  `;
21
21
  const Title = styled.p`
22
22
  padding: 0 10px;
23
- width: 100%;
24
23
  text-align: center;
24
+ width: 100%;
25
25
  `;
26
26
 
27
27
  const SumValue = styled.p`
28
28
  margin-top: 15px;
29
29
  padding: 0 10px;
30
- width: 100%;
31
30
  text-align: center;
31
+ width: 100%;
32
32
  `;
33
33
  const EmptyText = styled.p<{ color: CSSProperties['color'] }>`
34
- width: 100%;
34
+ color: ${({ color }) => color};
35
35
  padding: 20%;
36
36
  text-align: center;
37
- color: ${({ color }) => color};
37
+ width: 100%;
38
38
  `;
39
39
 
40
40
  export default function SelectMolecule<
@@ -46,11 +46,11 @@ import ToolsTabContent from './settings-tabs/ToolsTabContent.js';
46
46
  import { validation } from './settingsValidation.js';
47
47
 
48
48
  export const Section = styled.div`
49
+ border-bottom: 0.55px solid #f9f9f9;
50
+ color: #2ca8ff;
49
51
  display: flex;
50
52
  font-size: 13px;
51
- color: #2ca8ff;
52
53
  margin-bottom: 10px;
53
- border-bottom: 0.55px solid #f9f9f9;
54
54
  padding: 6px 2px;
55
55
  `;
56
56
 
@@ -62,10 +62,10 @@ const StyledTabs = styled(Tabs)`
62
62
  }
63
63
 
64
64
  div[role='tabpanel'] {
65
- width: 100%;
66
- padding: 0.8rem;
67
- overflow: auto;
68
65
  max-height: 100%;
66
+ overflow: auto;
67
+ padding: 0.8rem;
68
+ width: 100%;
69
69
  }
70
70
  `;
71
71
 
@@ -16,9 +16,9 @@ import { useTogglePanel } from './hooks/useTogglePanel.js';
16
16
  import { InformationEditionModal } from './informationPanel/InformationEditionModal.js';
17
17
 
18
18
  const Container = styled.div`
19
- width: 100%;
20
- height: 100%;
21
19
  flex: 1 1 0%;
20
+ height: 100%;
21
+ width: 100%;
22
22
  `;
23
23
  interface PanelStateContext {
24
24
  openSplitPane: () => void;
@@ -13,12 +13,12 @@ import { useGetPanelOptions } from './hooks/useGetPanelOptions.js';
13
13
  import { useTogglePanel } from './hooks/useTogglePanel.js';
14
14
 
15
15
  const PanelsBarContainer = styled(ButtonGroup)`
16
+ background-color: ${Colors.WHITE};
17
+ border-left: 1px solid ${Colors.LIGHT_GRAY4};
16
18
  flex-wrap: nowrap;
17
- height: 100%;
18
19
  gap: 4px;
20
+ height: 100%;
19
21
  padding: 4px;
20
- border-left: 1px solid ${Colors.LIGHT_GRAY4};
21
- background-color: ${Colors.WHITE};
22
22
  `;
23
23
 
24
24
  function useHiddenItemsMenu(