nmrium 0.53.0 → 0.55.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 (178) hide show
  1. package/lib/component/1d/Viewer1D.js +48 -17
  2. package/lib/component/1d/XAxis.js +1 -1
  3. package/lib/component/1d/integral/IntegralsSeries.js +2 -2
  4. package/lib/component/1d/integral/Integration.d.ts +3 -1
  5. package/lib/component/1d/integral/Integration.js +3 -2
  6. package/lib/component/1d/peaks/PeakEditionManager.js +5 -3
  7. package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -0
  8. package/lib/component/1d/ranges/AssignmentActionsButtons.js +3 -3
  9. package/lib/component/1d/ranges/AssignmentLabel.d.ts +1 -1
  10. package/lib/component/1d/ranges/AssignmentLabel.js +31 -4
  11. package/lib/component/1d/ranges/Atoms.js +4 -5
  12. package/lib/component/1d/ranges/Range.js +62 -12
  13. package/lib/component/1d/ranges/Ranges.js +2 -1
  14. package/lib/component/1d/ranges/RangesIntegrals.js +11 -4
  15. package/lib/component/1d/tool/XLabelPointer.js +4 -12
  16. package/lib/component/1d-2d/FieldEdition.d.ts +13 -0
  17. package/lib/component/1d-2d/FieldEdition.js +42 -0
  18. package/lib/component/2d/Chart2D.js +5 -3
  19. package/lib/component/2d/tools/XYLabelPointer.js +3 -9
  20. package/lib/component/2d/zones/Zone.js +18 -2
  21. package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts +7 -0
  22. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +286 -0
  23. package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -1
  24. package/lib/component/context/LoggerContext.js +11 -4
  25. package/lib/component/context/ShareDataContext.d.ts +10 -0
  26. package/lib/component/context/ShareDataContext.js +22 -0
  27. package/lib/component/elements/ActionsButtonsPopover.d.ts +10 -0
  28. package/lib/component/elements/ActionsButtonsPopover.js +22 -0
  29. package/lib/component/elements/CloseButton.d.ts +1 -1
  30. package/lib/component/elements/CustomToolTip.d.ts +8 -0
  31. package/lib/component/elements/CustomToolTip.js +107 -0
  32. package/lib/component/elements/EditableColumn.js +3 -2
  33. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +7 -5
  34. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
  35. package/lib/component/elements/SVGButton.d.ts +14 -0
  36. package/lib/component/elements/SVGButton.js +6 -0
  37. package/lib/component/elements/SVGGroup.js +15 -13
  38. package/lib/component/elements/SVGText.d.ts +8 -0
  39. package/lib/component/elements/SVGText.js +24 -0
  40. package/lib/component/elements/SaveButton.d.ts +1 -1
  41. package/lib/component/elements/draggable/SVGDraggable.d.ts +2 -2
  42. package/lib/component/elements/formik/FormikError.js +2 -4
  43. package/lib/component/elements/formik/FormikInput.d.ts +2 -1
  44. package/lib/component/elements/formik/FormikInput.js +5 -4
  45. package/lib/component/header/Header.js +8 -11
  46. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +41 -10
  47. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
  48. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +1 -1
  49. package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
  50. package/lib/component/hooks/useFormatNumberByNucleus.js +8 -7
  51. package/lib/component/hooks/useIntegralPath.d.ts +2 -0
  52. package/lib/component/hooks/useIntegralPath.js +3 -1
  53. package/lib/component/hooks/usePanelPreferences.js +1 -2
  54. package/lib/component/hooks/useSaveSettings.js +7 -14
  55. package/lib/component/hooks/useTriggerNewAssignmentLabel.d.ts +4 -0
  56. package/lib/component/hooks/useTriggerNewAssignmentLabel.js +8 -0
  57. package/lib/component/hooks/useWorkspaceAction.d.ts +7 -0
  58. package/lib/component/hooks/useWorkspaceAction.js +89 -0
  59. package/lib/component/loader/DropZone.js +0 -3
  60. package/lib/component/main/InnerNMRium.js +3 -1
  61. package/lib/component/main/InnerNMRiumContents.js +14 -2
  62. package/lib/component/main/NMRiumStateProvider.js +15 -3
  63. package/lib/component/modal/AboutPredictionModal.js +1 -1
  64. package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
  65. package/lib/component/modal/CopyClipboardModal.js +1 -1
  66. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  67. package/lib/component/modal/ImportPublicationStringModal.js +11 -5
  68. package/lib/component/modal/PredictSpectraModal.js +1 -1
  69. package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
  70. package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
  71. package/lib/component/modal/editRange/EditRangeModal.js +1 -1
  72. package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  73. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +17 -12
  74. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +30 -13
  75. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +26 -16
  76. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  77. package/lib/component/modal/setting/GeneralSettings.js +18 -39
  78. package/lib/component/modal/setting/WorkspaceItem.js +1 -1
  79. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.d.ts +2 -0
  80. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +99 -0
  81. package/lib/component/modal/setting/settingsValidation.js +36 -40
  82. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
  83. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -2
  84. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +2 -2
  85. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
  86. package/lib/component/panels/PeaksPanel/PeaksPanel.js +5 -5
  87. package/lib/component/panels/RangesPanel/RangesHeader.js +11 -11
  88. package/lib/component/panels/RangesPanel/RangesPreferences.js +16 -16
  89. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  90. package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
  91. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +22 -8
  92. package/lib/component/panels/SpectraPanel/SpectraPreferences.js +13 -1
  93. package/lib/component/panels/SpectraPanel/base/setting/PlotChart.js +1 -1
  94. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.js +1 -1
  95. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
  96. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.d.ts +5 -5
  97. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +79 -89
  98. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts +5 -4
  99. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +66 -98
  100. package/lib/component/panels/SummaryPanel/SummaryPanel.js +13 -32
  101. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.d.ts +6 -0
  102. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js +16 -0
  103. package/lib/component/panels/ZonesPanel/ZonesPanel.js +22 -6
  104. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +15 -9
  105. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
  106. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
  107. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +2 -2
  108. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  109. package/lib/component/panels/header/PreferencesHeader.js +1 -1
  110. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  111. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
  112. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
  113. package/lib/component/reducer/IgnoreActions.js +1 -0
  114. package/lib/component/reducer/Reducer.js +8 -0
  115. package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
  116. package/lib/component/reducer/actions/DomainActions.js +29 -1
  117. package/lib/component/reducer/actions/FiltersActions.d.ts +3 -2
  118. package/lib/component/reducer/actions/FiltersActions.js +27 -1
  119. package/lib/component/reducer/actions/MoleculeActions.js +1 -1
  120. package/lib/component/reducer/actions/RangesActions.d.ts +2 -3
  121. package/lib/component/reducer/actions/RangesActions.js +28 -26
  122. package/lib/component/reducer/actions/SpectraActions.d.ts +5 -4
  123. package/lib/component/reducer/actions/SpectraActions.js +5 -1
  124. package/lib/component/reducer/actions/ZonesActions.d.ts +15 -2
  125. package/lib/component/reducer/actions/ZonesActions.js +47 -13
  126. package/lib/component/reducer/helper/setRangesViewProperty.d.ts +1 -0
  127. package/lib/component/reducer/helper/setRangesViewProperty.js +11 -11
  128. package/lib/component/reducer/preferences/actions/addWorkspace.js +4 -23
  129. package/lib/component/reducer/preferences/actions/analyzeSpectra.js +4 -4
  130. package/lib/component/reducer/preferences/actions/initPreferences.js +2 -4
  131. package/lib/component/reducer/preferences/actions/matrixGeneration.js +3 -3
  132. package/lib/component/reducer/preferences/actions/removeWorkspace.js +0 -5
  133. package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +0 -4
  134. package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
  135. package/lib/component/reducer/preferences/actions/setPreferences.js +2 -16
  136. package/lib/component/reducer/preferences/actions/setWorkspace.js +4 -3
  137. package/lib/component/reducer/preferences/preferencesReducer.d.ts +7 -0
  138. package/lib/component/reducer/preferences/preferencesReducer.js +21 -18
  139. package/lib/component/toolbar/ToolBar.js +115 -25
  140. package/lib/component/utility/PreferencesHelper.js +5 -4
  141. package/lib/component/utility/export.js +4 -0
  142. package/lib/component/workspaces/assignment.js +0 -1
  143. package/lib/component/workspaces/basic.js +0 -1
  144. package/lib/component/workspaces/embedded.js +0 -1
  145. package/lib/component/workspaces/exercise.js +26 -29
  146. package/lib/component/workspaces/prediction.js +171 -174
  147. package/lib/component/workspaces/process1D.js +0 -1
  148. package/lib/component/workspaces/simulation.js +35 -38
  149. package/lib/component/workspaces/workspaceDefaultProperties.js +16 -23
  150. package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +10 -3
  151. package/lib/data/data1d/Spectrum1D/get1DColor.js +28 -2
  152. package/lib/data/data1d/Spectrum1D/index.d.ts +2 -2
  153. package/lib/data/data1d/Spectrum1D/index.js +2 -2
  154. package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +50 -0
  155. package/lib/data/data1d/Spectrum1D/ranges/createRange.js +51 -0
  156. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +2 -1
  157. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +4 -2
  158. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +52 -0
  159. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.js +28 -0
  160. package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +11 -3
  161. package/lib/data/data2d/Spectrum2D/get2DColor.js +20 -4
  162. package/lib/data/data2d/Spectrum2D/getSlice.js +1 -1
  163. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -0
  164. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -0
  165. package/lib/data/utilities/generateColor.d.ts +7 -3
  166. package/lib/data/utilities/generateColor.js +5 -17
  167. package/lib/versionInfo.js +1 -1
  168. package/package.json +35 -35
  169. package/lib/component/elements/MolecularFormulaInput.d.ts +0 -6
  170. package/lib/component/elements/MolecularFormulaInput.js +0 -63
  171. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.d.ts +0 -2
  172. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +0 -80
  173. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +0 -2
  174. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +0 -10
  175. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -7
  176. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +0 -31
  177. package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +0 -3
  178. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +0 -32
@@ -7,6 +7,8 @@ import { Toolbar } from 'react-science/ui';
7
7
  import { useChartData } from '../context/ChartContext';
8
8
  import { useDispatch } from '../context/DispatchContext';
9
9
  import { useLoader } from '../context/LoaderContext';
10
+ import { usePreferences } from '../context/PreferencesContext';
11
+ import { CustomToolTip } from '../elements/CustomToolTip';
10
12
  import { ToolbarPopoverItem, } from '../elements/ToolbarPopoverItem';
11
13
  import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
12
14
  import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
@@ -48,6 +50,7 @@ export default function ToolBar() {
48
50
  const exportMenu = isExperimentalFeature
49
51
  ? EXPORT_MENU
50
52
  : EXPORT_MENU.filter((item) => item.id !== 'nmre');
53
+ const { current: { general: { invert }, }, } = usePreferences();
51
54
  const handleOnFFTFilter = useCallback(() => {
52
55
  dispatch({
53
56
  type: 'APPLY_FFT_FILTER',
@@ -105,143 +108,230 @@ export default function ToolBar() {
105
108
  const toolItems = [
106
109
  {
107
110
  id: 'zoom',
108
- title: options.zoom.label,
111
+ tooltip: {
112
+ title: options.zoom.label,
113
+ subTitles: [
114
+ { title: 'Vertical', shortcuts: ['Scroll wheel'] },
115
+ { title: 'Horizontal', shortcuts: ['SHIFT', 'Scroll wheel'] },
116
+ { title: 'Pan', shortcuts: ['Right mouse'] },
117
+ ],
118
+ },
109
119
  icon: _jsx(FaSearchPlus, {}),
110
120
  },
111
121
  {
112
122
  id: 'zoomOut',
113
- title: 'Horizontal zoom out (Press f), Horizontal and Vertical zoom out, double click (Press ff)',
123
+ tooltip: {
124
+ title: 'Zoom out',
125
+ subTitles: [
126
+ { title: 'Horizontal', shortcuts: ['f'] },
127
+ { title: 'Horizontal and Vertical', shortcuts: ['f', 'f'] },
128
+ ],
129
+ description: 'Zoom out by double-clicking the left mouse button, and fully zoom out horizontally by pressing the key "f". Alternatively, press the key "ff" to fit the spectra horizontally and vertically.',
130
+ link: 'https://docs.nmrium.org/help/zoom-and-scale',
131
+ },
114
132
  onClick: handleFullZoomOut,
115
133
  icon: _jsx(FaExpand, {}),
116
134
  },
117
135
  {
118
136
  id: 'peakPicking',
119
- title: `${options.peakPicking.label} (Press p)`,
137
+ tooltip: {
138
+ title: options.peakPicking.label,
139
+ shortcuts: ['p'],
140
+ description: 'Detect peaks manually or automatically in the spectrum.',
141
+ link: 'https://docs.nmrium.org/20_1d-spectra/peaks/peaks',
142
+ },
120
143
  icon: _jsx(SvgNmrPeakPicking, {}),
121
144
  },
122
145
  {
123
146
  id: 'integral',
124
- title: `${options.integral.label} (Press i)`,
147
+ tooltip: {
148
+ title: options.integral.label,
149
+ shortcuts: ['i'],
150
+ description: `Manually integrate the spectrum. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the integral. Resize the integrals by moving the edges. Cut an integral with ${!invert ? 'SHIFT +' : ''} click.`,
151
+ link: 'https://docs.nmrium.org/help/integrations',
152
+ },
125
153
  icon: _jsx(SvgNmrIntegrate, {}),
126
154
  },
127
155
  {
128
156
  id: 'zonePicking',
129
- title: `${options.zonePicking.label} (Press r)`,
157
+ tooltip: {
158
+ title: options.zonePicking.label,
159
+ shortcuts: ['r'],
160
+ description: `Draw 2D zones by clicking, dragging, and releasing${!invert ? 'while holding SHIFT' : ''}. Alternatively, detect zones automatically.`,
161
+ link: 'https://docs.nmrium.org/30_2d-spectra/zones/zones',
162
+ },
130
163
  icon: _jsx(FaDiceFour, {}),
131
164
  },
132
165
  {
133
166
  id: 'slicing',
134
- title: options.slicing.label,
167
+ tooltip: {
168
+ title: options.slicing.label,
169
+ description: 'Display the horizontal and vertical slices of the selected 2D spectrum at the level of the pointer.',
170
+ link: 'https://docs.nmrium.org/30_2d-spectra/slicing/slicing',
171
+ },
135
172
  icon: _jsx(PiKnifeBold, {}),
136
173
  },
137
174
  {
138
175
  id: 'rangePicking',
139
- title: `${options.rangePicking.label} (Press r)`,
176
+ tooltip: {
177
+ title: options.rangePicking.label,
178
+ shortcuts: ['r'],
179
+ description: `Define ranges and analyse multiplet automatically or manually. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the range. Ranges can be resized by moving the edges.`,
180
+ link: 'https://docs.nmrium.org/20_1d-spectra/ranges/ranges',
181
+ },
140
182
  icon: _jsx(SvgNmrRangePicking, {}),
141
183
  },
142
184
  {
143
185
  id: 'multipleSpectraAnalysis',
144
- title: options.multipleSpectraAnalysis.label,
186
+ tooltip: options.multipleSpectraAnalysis.label,
145
187
  icon: _jsx(SvgNmrMultipleAnalysis, {}),
146
188
  checkOptions: { checkSpectrumType: false },
147
189
  condition: ftCounter > 0,
148
190
  },
149
191
  {
150
192
  id: 'apodization',
151
- title: `${options.apodization.label} (Press a)`,
193
+ tooltip: {
194
+ title: options.apodization.label,
195
+ shortcuts: ['a'],
196
+ description: 'Apply mathematical function that the FID is multiplied by before Fourier Transform.',
197
+ },
152
198
  icon: _jsx(SvgNmrApodization, {}),
153
199
  },
154
200
  {
155
201
  id: 'zeroFilling',
156
- title: `${options.zeroFilling.label} (Press z)`,
202
+ tooltip: {
203
+ title: options.zeroFilling.label,
204
+ shortcuts: ['z'],
205
+ description: 'Improve spectrum quality by increasing the number of points. By default, the number of points is twice as many as in the original FID.',
206
+ link: 'https://docs.nmrium.org/20_1d-spectra/preprocessing/preprocessing#zero-filling',
207
+ },
157
208
  icon: _jsx(SvgNmrZeroFilling, {}),
158
209
  },
159
210
  {
160
211
  id: 'phaseCorrection',
161
- title: `${options.phaseCorrection.label} (Press a)`,
212
+ tooltip: {
213
+ title: options.phaseCorrection.label,
214
+ shortcuts: ['a'],
215
+ description: `Correct the spectrum phase manually or automatically. For manual phase correction, define the pivot${!invert ? ' using SHIFT +' : ''} click, then press the PH0 and PH1 button, and move the mouse horizontally.`,
216
+ link: 'https://docs.nmrium.org/20_1d-spectra/phase/phase',
217
+ },
162
218
  icon: _jsx(SvgNmrPhaseCorrection, {}),
163
219
  },
164
220
  {
165
221
  id: 'phaseCorrectionTwoDimensions',
166
- title: `${options.phaseCorrectionTwoDimensions.label} (Press a)`,
222
+ tooltip: {
223
+ title: options.phaseCorrectionTwoDimensions.label,
224
+ shortcuts: ['a'],
225
+ description: 'To phase the spectrum after the FFT.',
226
+ },
167
227
  icon: _jsx(SvgNmrPhaseCorrection, {}),
168
228
  },
169
229
  {
170
230
  id: 'baselineCorrection',
171
- title: `${options.baselineCorrection.label} (Press b)`,
231
+ tooltip: {
232
+ title: options.baselineCorrection.label,
233
+ shortcuts: ['b'],
234
+ description: `Correct the baseline of the spectrum. You should draw zones corresponding to the noise using click, drag, release${!invert ? 'while holding SHIFT' : ''}.`,
235
+ link: 'https://docs.nmrium.org/20_1d-spectra/baseline/baseline',
236
+ },
172
237
  icon: _jsx(SvgNmrBaselineCorrection, {}),
173
238
  },
174
239
  {
175
240
  id: 'exclusionZones',
176
- title: `${options.exclusionZones.label} (Press e)`,
241
+ tooltip: {
242
+ title: options.exclusionZones.label,
243
+ shortcuts: ['e'],
244
+ description: `Define exclusion zones by clicking, dragging, releasing${!invert ? ' while holding SHIFT' : ''}. This option is practical for excluding large peaks like solvents.`,
245
+ },
177
246
  icon: _jsx(SvgNmrMultipleAnalysis, {}),
178
247
  checkOptions: { checkSpectrumType: false },
179
248
  condition: ftCounter > 0,
180
249
  },
181
250
  {
182
251
  id: 'fft',
183
- title: `${options.fft.label} (Press t)`,
252
+ tooltip: {
253
+ title: options.fft.label,
254
+ shortcuts: ['t'],
255
+ description: 'Perform a Fourier transform on the FID.',
256
+ link: 'https://docs.nmrium.org/20_1d-spectra/ft/ft/',
257
+ },
184
258
  onClick: handleOnFFTFilter,
185
259
  icon: _jsx(SvgNmrFourierTransform, {}),
186
260
  },
187
261
  {
188
262
  id: 'fftDimension1',
189
- title: options.fftDimension1.label,
263
+ tooltip: options.fftDimension1.label,
190
264
  onClick: handleFFtDimension1Filter,
191
265
  icon: _jsx(SvgNmrFourierTransform, {}),
192
266
  },
193
267
  {
194
268
  id: 'fftDimension2',
195
- title: options.fftDimension2.label,
269
+ tooltip: options.fftDimension2.label,
196
270
  onClick: handleFFtDimension2Filter,
197
271
  icon: _jsx(SvgNmrFourierTransform, {}),
198
272
  },
199
273
  {
200
274
  id: 'import',
201
- title: options.import.label,
275
+ tooltip: options.import.label,
202
276
  icon: _jsx(FaFileImport, {}),
203
277
  menuItems: importMenu,
204
278
  onClick: importHandler,
205
279
  },
206
280
  {
207
281
  id: 'exportAs',
208
- title: options.exportAs.label,
282
+ tooltip: options.exportAs.label,
209
283
  icon: _jsx(FaFileExport, {}),
210
284
  menuItems: exportMenu,
211
285
  onClick: exportHandler,
212
286
  },
213
287
  {
214
288
  id: 'spectraStackAlignments',
215
- title: `${options.spectraStackAlignments.label} (Press s)`,
289
+ tooltip: {
290
+ title: options.spectraStackAlignments.label,
291
+ shortcuts: ['s'],
292
+ description: 'Toggle between stack mode and all the spectra aligned at the bottom.',
293
+ },
216
294
  icon: verticalAlign === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {})) : (_jsx(SvgNmrOverlay3, {})),
217
295
  condition: ftCounter > 1,
218
296
  onClick: changeDisplayViewModeHandler,
219
297
  },
220
298
  {
221
299
  id: 'realImaginary',
222
- title: isRealSpectrumShown ? 'Display real ' : 'Display imaginary',
300
+ tooltip: {
301
+ title: `Display ${isRealSpectrumShown ? 'real' : 'imaginary'}`,
302
+ description: 'Toggle between the imaginary and real parts of the spectrum.',
303
+ link: 'https://docs.nmrium.org/20_1d-spectra/views/views',
304
+ },
223
305
  icon: _jsx(SvgNmrRealImag, {}),
224
306
  onClick: changeSpectrumViewHandler,
225
307
  },
226
308
  {
227
309
  id: 'spectraCenterAlignments',
228
- title: `Baseline ${verticalAlign === 'bottom' ? 'center' : 'bottom'} (Press c)`,
310
+ tooltip: {
311
+ title: `Baseline ${verticalAlign === 'bottom' ? 'center' : 'bottom'}`,
312
+ shortcuts: ['c'],
313
+ description: 'Toggle between alignment of the spectra in the center or at the bottom of the display.',
314
+ },
229
315
  icon: verticalAlign === 'bottom' ? (_jsx(SvgNmrAlignCenter, {})) : (_jsx(SvgNmrAlignBottom, {})),
230
316
  condition: ftCounter > 0 || fidCounter > 0,
231
317
  onClick: alignSpectraVerticallyHandler,
232
318
  },
233
319
  ];
234
320
  return (_jsxs(_Fragment, { children: [_jsx(LoadJCAMPModal, { isOpen: dialog.loadJCAMP, onCloseDialog: closeDialog }), _jsx(ImportPublicationStringModal, { isOpen: dialog.importPublicationString, onClose: closeDialog }), _jsx(MetaImportationModal, { isOpen: dialog.metaImportation, onCloseDialog: closeDialog }), _jsx(SaveAsModal, { isOpen: dialog.saveAs, onCloseDialog: closeDialog }), _jsx(Toolbar, { vertical: true, children: toolItems.map((item) => {
235
- const { id, icon, title, checkOptions, condition } = item;
321
+ const { id, icon, tooltip, checkOptions, condition } = item;
236
322
  const show = isButtonVisible(id, checkOptions) &&
237
323
  (condition === undefined || condition);
238
324
  if (!show)
239
325
  return null;
240
326
  if (isPopoverToolItem(item)) {
241
327
  const { menuItems, onClick } = item;
242
- return (_jsx(ToolbarPopoverItem, { options: menuItems, title: title, id: id, active: selectedTool === id, icon: icon, onClick: onClick }, id));
328
+ return (_jsx(ToolbarPopoverItem, { options: menuItems, tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(CustomToolTip, { ...tooltip })), tooltipProps: {
329
+ minimal: true,
330
+ }, id: id, active: selectedTool === id, icon: icon, onClick: onClick }, id));
243
331
  }
244
332
  const { onClick } = item;
245
- return (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), title: title, id: id, active: selectedTool === id, icon: icon }, id));
333
+ return (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(CustomToolTip, { ...tooltip })), tooltipProps: {
334
+ minimal: true,
335
+ }, id: id, active: selectedTool === id, icon: icon }, id));
246
336
  }) })] }));
247
337
  }
@@ -1,8 +1,9 @@
1
- import { getLocalStorage, getValue } from './LocalStorage';
1
+ import { readSettings } from '../reducer/preferences/preferencesReducer';
2
+ import { getValue } from './LocalStorage';
2
3
  function GetPreference(preferences, key) {
3
- const localData = getLocalStorage('nmr-general-settings');
4
- const val = getValue(preferences, `formatting.panels.[${key}]`) ||
5
- getValue(localData, `formatting.panels.[${key}]`);
4
+ const localData = readSettings() || {};
5
+ const val = getValue(preferences, `panels.[${key}]`) ||
6
+ getValue(localData, `panels.[${key}]`);
6
7
  return val;
7
8
  }
8
9
  export { GetPreference };
@@ -107,6 +107,8 @@ function exportAsPng(rootRef, elementID, fileName = 'experiment') {
107
107
  }
108
108
  }
109
109
  // hack way to copy the image to the clipboard
110
+ // TODO: remove when Firefox widely supports ClipboardItem
111
+ // https://caniuse.com/mdn-api_clipboarditem
110
112
  function copyDataURLClipboardFireFox(image) {
111
113
  const img = document.createElement('img');
112
114
  img.src = image;
@@ -117,6 +119,7 @@ function copyDataURLClipboardFireFox(image) {
117
119
  const range = document.createRange();
118
120
  range.selectNode(img);
119
121
  window.getSelection()?.addRange(range);
122
+ // eslint-disable-next-line deprecation/deprecation
120
123
  document.execCommand('Copy');
121
124
  img.remove();
122
125
  }
@@ -136,6 +139,7 @@ async function copyBlobToClipboard(canvas) {
136
139
  return;
137
140
  const isSafari = /^(?<safari>(?!chrome|android).)*safari/i.test(navigator.userAgent);
138
141
  if (typeof ClipboardItem !== 'undefined') {
142
+ // eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable
139
143
  await writeImageToClipboard(b, isSafari).catch(reportError);
140
144
  }
141
145
  else {
@@ -1,5 +1,4 @@
1
1
  export const assignment = {
2
- version: 2,
3
2
  label: 'NMR spectra assignment',
4
3
  visible: true,
5
4
  display: {
@@ -1,5 +1,4 @@
1
1
  export const basic = {
2
- version: 2,
3
2
  label: 'Simple NMR analysis',
4
3
  visible: true,
5
4
  display: {
@@ -1,5 +1,4 @@
1
1
  export const embedded = {
2
- version: 1,
3
2
  label: 'Embedded',
4
3
  display: {
5
4
  general: {
@@ -1,5 +1,4 @@
1
1
  export const exercise = {
2
- version: 2,
3
2
  label: 'Exercise',
4
3
  display: {
5
4
  general: {
@@ -34,35 +33,33 @@ export const exercise = {
34
33
  spectraRendering: 'auto',
35
34
  loggingLevel: 'info',
36
35
  popupLoggingLevel: 'error',
37
- invert: false,
36
+ invert: true,
38
37
  },
39
- formatting: {
40
- nuclei: {},
41
- panels: {
42
- integrals: {
43
- nuclei: {
44
- '1H': {
45
- showSerialNumber: true,
46
- relative: { show: true, format: '0.00' },
47
- absolute: { show: false, format: '0.00' },
48
- from: { show: true, format: '0.00' },
49
- to: { show: true, format: '0.00' },
50
- color: 'black',
51
- strokeWidth: 1,
52
- showKind: false,
53
- showDeleteAction: true,
54
- },
55
- '13C': {
56
- showSerialNumber: true,
57
- relative: { show: true, format: '0.00' },
58
- absolute: { show: false, format: '0.00' },
59
- from: { show: true, format: '0.00' },
60
- to: { show: true, format: '0.00' },
61
- color: 'black',
62
- strokeWidth: 1,
63
- showKind: false,
64
- showDeleteAction: true,
65
- },
38
+ nuclei: [],
39
+ panels: {
40
+ integrals: {
41
+ nuclei: {
42
+ '1H': {
43
+ showSerialNumber: true,
44
+ relative: { show: true, format: '0.00' },
45
+ absolute: { show: false, format: '0.00' },
46
+ from: { show: true, format: '0.00' },
47
+ to: { show: true, format: '0.00' },
48
+ color: 'black',
49
+ strokeWidth: 1,
50
+ showKind: false,
51
+ showDeleteAction: true,
52
+ },
53
+ '13C': {
54
+ showSerialNumber: true,
55
+ relative: { show: true, format: '0.00' },
56
+ absolute: { show: false, format: '0.00' },
57
+ from: { show: true, format: '0.00' },
58
+ to: { show: true, format: '0.00' },
59
+ color: 'black',
60
+ strokeWidth: 1,
61
+ showKind: false,
62
+ showDeleteAction: true,
66
63
  },
67
64
  },
68
65
  },