nmrium 1.1.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 (232) 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.js +1 -1
  64. package/lib/component/hooks/useExport.d.ts.map +1 -1
  65. package/lib/component/hooks/useExport.js +25 -10
  66. package/lib/component/hooks/useExport.js.map +1 -1
  67. package/lib/component/hooks/useFilter.d.ts.map +1 -1
  68. package/lib/component/hooks/useFilter.js +4 -5
  69. package/lib/component/hooks/useFilter.js.map +1 -1
  70. package/lib/component/hooks/useSaveSettings.js +2 -2
  71. package/lib/component/loader/DefaultSpinnerComponent.js +9 -9
  72. package/lib/component/loader/DropZone.js +8 -8
  73. package/lib/component/main/ErrorOverlay.js +4 -4
  74. package/lib/component/main/InnerNMRiumContents.js +3 -3
  75. package/lib/component/modal/AboutPredictionModal.js +2 -2
  76. package/lib/component/modal/AboutSpectrumSimulationModal.js +2 -2
  77. package/lib/component/modal/MultipletAnalysisModal.js +12 -12
  78. package/lib/component/modal/PredictSpectraModal.js +4 -4
  79. package/lib/component/modal/PublicationStringModal.js +2 -2
  80. package/lib/component/modal/aboutUs/AboutUsModal.js +3 -3
  81. package/lib/component/modal/changeSum/ChangeSumModalContents.js +1 -1
  82. package/lib/component/modal/changeSum/SelectMolecule.js +5 -5
  83. package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
  84. package/lib/component/modal/setting/GeneralSettings.js +5 -5
  85. package/lib/component/panels/Panels.js +2 -2
  86. package/lib/component/panels/PanelsBar.js +3 -3
  87. package/lib/component/panels/PanelsBar.js.map +1 -1
  88. package/lib/component/panels/RangesPanel/RangesTable.js +6 -6
  89. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  90. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +9 -9
  91. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +5 -5
  92. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +11 -11
  93. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +7 -7
  94. package/lib/component/panels/SummaryPanel/Overview.js +1 -1
  95. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
  96. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -5
  97. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  98. package/lib/component/panels/ZonesPanel/ZonesTable.js +6 -6
  99. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
  100. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +11 -3
  101. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
  102. package/lib/component/panels/filtersPanel/Filters/InnerFilterHeader.js +1 -1
  103. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +4 -4
  104. package/lib/component/panels/predictionPanel/PredictionPanel.js +6 -6
  105. package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
  106. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
  107. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  108. package/lib/component/reducer/actions/FiltersActions.js +54 -28
  109. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  110. package/lib/component/workspaces/assignment.d.ts.map +1 -1
  111. package/lib/component/workspaces/assignment.js +1 -0
  112. package/lib/component/workspaces/assignment.js.map +1 -1
  113. package/lib/component/workspaces/basic.d.ts.map +1 -1
  114. package/lib/component/workspaces/basic.js +1 -0
  115. package/lib/component/workspaces/basic.js.map +1 -1
  116. package/lib/component/workspaces/embedded.d.ts.map +1 -1
  117. package/lib/component/workspaces/embedded.js +1 -0
  118. package/lib/component/workspaces/embedded.js.map +1 -1
  119. package/lib/component/workspaces/exercise.d.ts.map +1 -1
  120. package/lib/component/workspaces/exercise.js +1 -0
  121. package/lib/component/workspaces/exercise.js.map +1 -1
  122. package/lib/component/workspaces/prediction.d.ts.map +1 -1
  123. package/lib/component/workspaces/prediction.js +1 -0
  124. package/lib/component/workspaces/prediction.js.map +1 -1
  125. package/lib/component/workspaces/process1D.d.ts.map +1 -1
  126. package/lib/component/workspaces/process1D.js +1 -0
  127. package/lib/component/workspaces/process1D.js.map +1 -1
  128. package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
  129. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  130. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  131. package/lib/data/PredictionManager.d.ts.map +1 -1
  132. package/lib/data/PredictionManager.js +7 -21
  133. package/lib/data/PredictionManager.js.map +1 -1
  134. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +1 -1
  135. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js.map +1 -1
  136. package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +1 -1
  137. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  138. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  139. package/lib/data/utilities/generateColor.d.ts.map +1 -1
  140. package/lib/data/utilities/generateColor.js +1 -1
  141. package/lib/data/utilities/generateColor.js.map +1 -1
  142. package/lib/data/utilities/isNumber.js +1 -1
  143. package/lib/data/utilities/isNumber.js.map +1 -1
  144. package/lib/utils/clipboard/clipboardComponents.js +1 -1
  145. package/lib/versionInfo.js +1 -1
  146. package/package.json +41 -36
  147. package/src/component/1d/ExclusionZoneAnnotation.tsx +1 -1
  148. package/src/component/1d/FloatPublicationString.tsx +2 -2
  149. package/src/component/1d/FloatingRanges.tsx +3 -3
  150. package/src/component/1d/FooterBanner.tsx +1 -1
  151. package/src/component/1d/LinesSeries.tsx +1 -1
  152. package/src/component/1d/PredictionErrorsNotations.tsx +2 -2
  153. package/src/component/1d/inset/DraggableInset.tsx +2 -2
  154. package/src/component/1d/multiAnalysis/AnalysisRange.tsx +1 -1
  155. package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +3 -1
  156. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +1 -1
  157. package/src/component/1d/peaks/Peaks.tsx +2 -6
  158. package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +3 -3
  159. package/src/component/1d-2d/tools/BrushXY.tsx +2 -2
  160. package/src/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.tsx +1 -1
  161. package/src/component/2d/SignalDeltaLine.tsx +1 -1
  162. package/src/component/2d/zones/Signal.tsx +2 -1
  163. package/src/component/2d/zones/SignalsGuideLines.tsx +2 -2
  164. package/src/component/2d/zones/Zone.tsx +2 -1
  165. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
  166. package/src/component/elements/ActionsButtonsPopover.tsx +4 -4
  167. package/src/component/elements/Alert.tsx +2 -2
  168. package/src/component/elements/AssignmentsCell.tsx +1 -1
  169. package/src/component/elements/Button.tsx +10 -10
  170. package/src/component/elements/DraggableDialog.tsx +3 -3
  171. package/src/component/elements/EditableColumn.tsx +3 -3
  172. package/src/component/elements/EmptyText.tsx +2 -2
  173. package/src/component/elements/Footer.tsx +9 -9
  174. package/src/component/elements/MoleculeSelection.tsx +19 -19
  175. package/src/component/elements/NextPrev.tsx +15 -15
  176. package/src/component/elements/ReactTable/BaseReactTable.tsx +6 -6
  177. package/src/component/elements/ReadOnly.tsx +8 -8
  178. package/src/component/elements/Sections.tsx +29 -29
  179. package/src/component/elements/Select.tsx +10 -10
  180. package/src/component/elements/StyledDialogBody.tsx +1 -1
  181. package/src/component/elements/Tab/DeleteButton.tsx +5 -5
  182. package/src/component/elements/Tab/Tabs.tsx +5 -5
  183. package/src/component/elements/dropDownButton/DropDownList.tsx +6 -6
  184. package/src/component/elements/export/ExportManager.tsx +13 -3
  185. package/src/component/elements/resizer/SVGResizer.tsx +1 -1
  186. package/src/component/header/Header.tsx +1 -1
  187. package/src/component/hooks/useExport.tsx +21 -10
  188. package/src/component/hooks/useFilter.ts +4 -6
  189. package/src/component/hooks/useSaveSettings.tsx +2 -2
  190. package/src/component/loader/DefaultSpinnerComponent.tsx +9 -9
  191. package/src/component/loader/DropZone.tsx +8 -8
  192. package/src/component/main/ErrorOverlay.tsx +4 -4
  193. package/src/component/main/InnerNMRiumContents.tsx +3 -3
  194. package/src/component/modal/AboutPredictionModal.tsx +2 -2
  195. package/src/component/modal/AboutSpectrumSimulationModal.tsx +2 -2
  196. package/src/component/modal/MultipletAnalysisModal.tsx +12 -12
  197. package/src/component/modal/PredictSpectraModal.tsx +4 -4
  198. package/src/component/modal/PublicationStringModal.tsx +2 -2
  199. package/src/component/modal/aboutUs/AboutUsModal.tsx +3 -3
  200. package/src/component/modal/changeSum/ChangeSumModalContents.tsx +1 -1
  201. package/src/component/modal/changeSum/SelectMolecule.tsx +5 -5
  202. package/src/component/modal/setting/GeneralSettings.tsx +5 -5
  203. package/src/component/panels/Panels.tsx +2 -2
  204. package/src/component/panels/PanelsBar.tsx +3 -3
  205. package/src/component/panels/RangesPanel/RangesTable.tsx +6 -6
  206. package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -1
  207. package/src/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.tsx +9 -9
  208. package/src/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.tsx +5 -5
  209. package/src/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.tsx +11 -11
  210. package/src/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.tsx +7 -7
  211. package/src/component/panels/SummaryPanel/Overview.tsx +1 -1
  212. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -5
  213. package/src/component/panels/ZonesPanel/ZonesTable.tsx +6 -6
  214. package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +12 -3
  215. package/src/component/panels/filtersPanel/Filters/InnerFilterHeader.tsx +1 -1
  216. package/src/component/panels/multipleAnalysisPanel/AlignSpectra.tsx +4 -4
  217. package/src/component/panels/predictionPanel/PredictionPanel.tsx +6 -6
  218. package/src/component/panels/predictionPanel/PredictionSimpleOptions.tsx +1 -1
  219. package/src/component/reducer/actions/FiltersActions.ts +162 -81
  220. package/src/component/workspaces/assignment.ts +1 -0
  221. package/src/component/workspaces/basic.ts +1 -0
  222. package/src/component/workspaces/embedded.ts +1 -0
  223. package/src/component/workspaces/exercise.ts +1 -0
  224. package/src/component/workspaces/prediction.ts +1 -0
  225. package/src/component/workspaces/process1D.ts +1 -0
  226. package/src/component/workspaces/workspaceDefaultProperties.ts +1 -0
  227. package/src/data/PredictionManager.ts +8 -23
  228. package/src/data/data1d/Spectrum1D/ranges/resurrectSpectrum.ts +1 -1
  229. package/src/data/utilities/generateColor.ts +5 -3
  230. package/src/data/utilities/isNumber.ts +1 -1
  231. package/src/utils/clipboard/clipboardComponents.tsx +1 -1
  232. package/src/versionInfo.ts +1 -1
@@ -39,25 +39,25 @@ interface DropIndicatorProps {
39
39
 
40
40
  const DropIndicator = styled.div<DropIndicatorProps>`
41
41
  position: absolute;
42
- z-index: 3;
42
+ right: 0;
43
+ left: 0;
43
44
  background-color: ${Colors.BLUE3};
44
45
  height: 2px;
45
- left: 0;
46
- right: 0;
47
46
  pointer-events: none;
47
+ z-index: 3;
48
48
  ${(props) => props.edge === 'top' && 'top: -1px;'}
49
49
  ${(props) => props.edge === 'bottom' && 'bottom: -1px;'}
50
50
  `;
51
51
 
52
52
  const Preview = styled.div`
53
- padding-block: 4px;
54
- padding-inline: 8px;
55
- border-radius: 4px;
56
53
  background-color: #f4f5f7;
54
+ border-radius: 4px;
57
55
  max-width: 360px;
58
- white-space: nowrap;
59
56
  overflow: hidden;
57
+ padding-block: 4px;
58
+ padding-inline: 8px;
60
59
  text-overflow: ellipsis;
60
+ white-space: nowrap;
61
61
  `;
62
62
 
63
63
  type DraggableState =
@@ -101,12 +101,12 @@ const Container = styled.div<{
101
101
  matchContentHeight: boolean;
102
102
  }>(
103
103
  ({ isOverflow, matchContentHeight }) => `
104
- width: 100%;
105
- height: ${matchContentHeight ? 'auto' : '100%'};
104
+ border: 1px solid #ddd;
106
105
  display: flex;
107
106
  flex-direction: column;
107
+ height: ${matchContentHeight ? 'auto' : '100%'};
108
108
  overflow: ${isOverflow ? 'auto' : 'hidden'};
109
- border: 1px solid #ddd;
109
+ width: 100%;
110
110
  `,
111
111
  );
112
112
 
@@ -115,9 +115,9 @@ const SectionWrapper = styled.div<
115
115
  >(
116
116
  ({ isOpen, isOverflow, matchContentHeight }) => `
117
117
  display: flex;
118
- flex-direction: column;
119
118
  flex:none;
120
119
  flex: ${isOpen && !matchContentHeight ? (isOverflow ? '1' : isOverflow ? '1' : '1 1 1px') : 'none'};
120
+ flex-direction: column;
121
121
  `,
122
122
  );
123
123
 
@@ -129,24 +129,24 @@ const Active = styled(Tag, {
129
129
  ({ isOpen }) => `
130
130
  background-color: ${isOpen ? '#4CAF50' : '#ccc'};
131
131
  color: ${isOpen ? 'white' : 'black'};
132
- margin-right: 10px;
133
132
  flex-shrink: 0;
133
+ margin-right: 10px;
134
134
  `,
135
135
  );
136
136
 
137
137
  const TitleContainer = styled.div`
138
- display: flex;
139
138
  align-items: center;
140
- min-width: 0;
139
+ display: flex;
141
140
  flex-grow: 1;
141
+ min-width: 0;
142
142
  `;
143
143
 
144
144
  const Title = styled.div`
145
- white-space: nowrap;
146
- overflow: hidden;
147
- text-overflow: ellipsis;
148
145
  flex-grow: 1;
149
146
  font-weight: 500;
147
+ overflow: hidden;
148
+ text-overflow: ellipsis;
149
+ white-space: nowrap;
150
150
  `;
151
151
 
152
152
  const OpenIcon = styled(Icon, {
@@ -154,9 +154,9 @@ const OpenIcon = styled(Icon, {
154
154
  return propName !== 'isOpen';
155
155
  },
156
156
  })<ActiveProps>`
157
+ margin-left: 10px;
157
158
  transform: ${({ isOpen }) => (isOpen ? 'rotate(90deg)' : 'rotate(0deg)')};
158
159
  transition: transform 0.3s ease;
159
- margin-left: 10px;
160
160
  `;
161
161
 
162
162
  const ContentWrapper = styled.div<ActiveProps>(
@@ -164,46 +164,46 @@ const ContentWrapper = styled.div<ActiveProps>(
164
164
  background-color: white;
165
165
  display: ${isOpen ? 'flex' : 'none'};
166
166
  flex: ${isOpen ? (isOverflow ? '1' : '1 1 1px') : 'none'};
167
- max-height: 100%;
168
167
  flex-direction:column;
168
+ max-height: 100%;
169
169
  `,
170
170
  );
171
171
  const Content = styled.div`
172
- height: 100%;
173
- width: 100%;
174
- overflow: auto;
172
+ position: relative;
175
173
  display: flex;
176
174
  flex-direction: column;
175
+ height: 100%;
176
+ overflow: auto;
177
177
  padding: 10px;
178
- position: relative;
178
+ width: 100%;
179
179
  z-index: 0;
180
180
  `;
181
181
  const ElementsContainer = styled.div`
182
- display: flex;
183
182
  align-items: center;
183
+ display: flex;
184
184
  `;
185
185
 
186
186
  const Header = styled.div`
187
- display: flex;
188
187
  align-items: center;
188
+ background-color: #f5f5f5;
189
+ display: flex;
189
190
  justify-content: space-between;
190
191
  padding: 5px 10px;
191
- background-color: #f5f5f5;
192
192
 
193
- &:hover {
193
+ :hover {
194
194
  background-color: #e0e0e0;
195
195
  }
196
196
 
197
- &:active {
197
+ :active {
198
198
  background-color: #d0d0d0;
199
199
  }
200
200
  `;
201
201
 
202
202
  const InnerHeader = styled.div`
203
- padding: 5px;
204
203
  background-color: white;
205
204
  border-bottom: 1px solid #ddd;
206
205
  border-top: 1px solid #ddd;
206
+ padding: 5px;
207
207
  `;
208
208
 
209
209
  interface BaseSectionProps {
@@ -5,25 +5,25 @@ import { forwardRef, useCallback } from 'react';
5
5
  const arrowDownIcon = `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="960px" height="560px" viewBox="0 0 960 560" enable-background="new 0 0 960 560" xml:space="preserve"><g id="Rounded_Rectangle_33_copy_4_1_"><path d="M480,344.181L268.869,131.889c-15.756-15.859-41.3-15.859-57.054,0c-15.754,15.857-15.754,41.57,0,57.431l237.632,238.937c8.395,8.451,19.562,12.254,30.553,11.698c10.993,0.556,22.159-3.247,30.555-11.698l237.631-238.937c15.756-15.86,15.756-41.571,0-57.431s-41.299-15.859-57.051,0L480,344.181z"/></g></svg>')`;
6
6
 
7
7
  const BaseSelect = styled.select<{ width: number | string | undefined }>`
8
- padding: 0 5px;
9
- border: 0.55px solid #cacaca;
10
- font-size: 14px;
11
- width: ${({ width }) => (width ? Number(width) - 5 : 115)}px;
12
- margin: 0;
13
- height: 100%;
14
- background: ${arrowDownIcon} no-repeat right white;
8
+ align-self: center;
15
9
  appearance: none;
10
+ background: ${arrowDownIcon} no-repeat right white;
16
11
  background-position-x: calc(100% - 5px);
17
12
  background-size: 15px 15px;
13
+ border: 0.55px solid #cacaca;
18
14
  border-radius: 5px;
19
- align-self: center;
15
+ font-size: 14px;
16
+ height: 100%;
17
+ margin: 0;
18
+ padding: 0 5px;
19
+ width: ${({ width }) => (width ? Number(width) - 5 : 115)}px;
20
20
 
21
- &:focus,
21
+ :focus,
22
22
  input:focus {
23
23
  outline: none;
24
24
  }
25
25
 
26
- &:required:invalid {
26
+ :required:invalid {
27
27
  color: #666;
28
28
  }
29
29
  `;
@@ -5,7 +5,7 @@ import type { CSSProperties } from 'react';
5
5
  export const StyledDialogBody = styled(DialogBody)<
6
6
  Pick<CSSProperties, 'padding' | 'backgroundColor'>
7
7
  >`
8
- padding: ${({ padding = '15px' }) => padding};
9
8
  background-color: ${({ backgroundColor = 'white' }) => backgroundColor};
10
9
  margin: 0;
10
+ padding: ${({ padding = '15px' }) => padding};
11
11
  `;
@@ -3,15 +3,15 @@ import type { CSSProperties } from 'react';
3
3
  import { FaTimes } from 'react-icons/fa';
4
4
 
5
5
  const BaseButton = styled.button`
6
- border-radius: 50%;
7
- width: 16px;
8
- height: 16px;
6
+ align-items: center;
9
7
  background-color: transparent;
10
8
  border: none;
11
- padding: 0;
9
+ border-radius: 50%;
12
10
  display: flex;
13
- align-items: center;
11
+ height: 16px;
14
12
  justify-content: center;
13
+ padding: 0;
14
+ width: 16px;
15
15
 
16
16
  .icon {
17
17
  color: #252525;
@@ -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
  }
@@ -252,8 +252,8 @@ export function Header() {
252
252
  }
253
253
 
254
254
  const PluginTopBarRight = styled.div`
255
- display: flex;
256
255
  align-items: center;
256
+ display: flex;
257
257
  gap: 5px;
258
258
  margin-right: 5px;
259
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 {