nmrium 0.42.0 → 0.43.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 (217) hide show
  1. package/lib/component/1d/ApodizationLine.js +1 -1
  2. package/lib/component/1d/Chart1D.js +3 -2
  3. package/lib/component/1d/Line.js +1 -1
  4. package/lib/component/1d/Viewer1D.js +15 -3
  5. package/lib/component/1d/integral/IntegralResizable.js +4 -3
  6. package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  7. package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
  8. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
  9. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
  10. package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
  11. package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
  12. package/lib/component/1d/peaks/Peaks.d.ts +1 -0
  13. package/lib/component/1d/peaks/Peaks.js +22 -0
  14. package/lib/component/1d/ranges/Range.js +3 -1
  15. package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
  16. package/lib/component/1d/tool/BaseLineZones.js +11 -31
  17. package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
  18. package/lib/component/1d/utilities/intersectionResolver.js +71 -0
  19. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -2
  20. package/lib/component/2d/SlicingView.js +1 -1
  21. package/lib/component/2d/ft/Contours.js +1 -1
  22. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
  23. package/lib/component/EventsTrackers/KeysListenerTracker.js +47 -6
  24. package/lib/component/assignment/index.d.ts +6 -1
  25. package/lib/component/assignment/index.js +5 -1
  26. package/lib/component/context/DispatchContext.d.ts +1 -2
  27. package/lib/component/context/KeyModifierContext.d.ts +13 -0
  28. package/lib/component/context/KeyModifierContext.js +39 -0
  29. package/lib/component/context/PreferencesContext.d.ts +39 -39
  30. package/lib/component/elements/Button.js +2 -0
  31. package/lib/component/elements/NumberInput.d.ts +1 -0
  32. package/lib/component/elements/NumberInput.js +10 -3
  33. package/lib/component/elements/formik/FormikOnChange.js +1 -1
  34. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  35. package/lib/component/header/ApodizationOptionsPanel.js +23 -14
  36. package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
  37. package/lib/component/header/Header.d.ts +10 -3
  38. package/lib/component/header/Header.js +5 -5
  39. package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
  40. package/lib/component/highlight/index.d.ts +1 -0
  41. package/lib/component/highlight/index.js +1 -0
  42. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  43. package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
  44. package/lib/component/hooks/useResizerStatus.d.ts +2 -0
  45. package/lib/component/hooks/useResizerStatus.js +7 -0
  46. package/lib/component/hooks/useSpectrum.js +1 -1
  47. package/lib/component/main/ErrorOverlay.js +20 -0
  48. package/lib/component/main/InnerNMRium.d.ts +7 -0
  49. package/lib/component/main/InnerNMRium.js +52 -0
  50. package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
  51. package/lib/component/main/InnerNMRiumContents.js +89 -0
  52. package/lib/component/main/NMRium.d.ts +23 -0
  53. package/lib/component/main/NMRium.js +13 -0
  54. package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
  55. package/lib/component/main/NMRiumStateProvider.js +74 -0
  56. package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  57. package/lib/component/main/StateError.d.ts +4 -0
  58. package/lib/component/main/StateError.js +16 -0
  59. package/lib/component/main/index.d.ts +3 -0
  60. package/lib/component/main/index.js +3 -0
  61. package/lib/component/main/types.d.ts +18 -0
  62. package/lib/component/main/types.js +2 -0
  63. package/lib/component/modal/PredictSpectraModal.js +1 -1
  64. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
  65. package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
  66. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
  67. package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
  68. package/lib/component/modal/setting/GeneralSettings.js +2 -2
  69. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  70. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
  71. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  72. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
  73. package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
  74. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +3 -3
  75. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
  76. package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
  77. package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
  78. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  79. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
  80. package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
  81. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  82. package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
  83. package/lib/component/panels/header/DefaultPanelHeader.js +9 -5
  84. package/lib/component/panels/predictionPanel/PredictionPanel.js +1 -1
  85. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  86. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  87. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  88. package/lib/component/reducer/IgnoreActions.js +0 -1
  89. package/lib/component/reducer/Reducer.d.ts +1 -6
  90. package/lib/component/reducer/Reducer.js +30 -6
  91. package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
  92. package/lib/component/reducer/actions/FiltersActions.js +96 -28
  93. package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
  94. package/lib/component/reducer/actions/IntegralsActions.js +44 -20
  95. package/lib/component/reducer/actions/MoleculeActions.js +1 -1
  96. package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
  97. package/lib/component/reducer/actions/PeaksActions.js +19 -1
  98. package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
  99. package/lib/component/reducer/actions/RangesActions.js +31 -3
  100. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  101. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
  102. package/lib/component/toolbar/FunctionToolBar.js +13 -3
  103. package/lib/component/toolbar/ToolTypes.d.ts +1 -0
  104. package/lib/component/toolbar/ToolTypes.js +36 -0
  105. package/lib/component/utility/export.js +7 -4
  106. package/lib/component/utility/filterType.d.ts +3 -0
  107. package/lib/component/utility/filterType.js +1 -0
  108. package/lib/component/workspaces/basic.js +2 -0
  109. package/lib/component/workspaces/embedded.js +2 -0
  110. package/lib/component/workspaces/exercise.js +2 -0
  111. package/lib/component/workspaces/prediction.js +9 -0
  112. package/lib/component/workspaces/process1D.js +2 -0
  113. package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
  114. package/lib/data/PredictionManager.d.ts +3 -3
  115. package/lib/data/PredictionManager.js +10 -10
  116. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
  117. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
  118. package/lib/data/molecules/Molecule.js +2 -2
  119. package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
  120. package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
  121. package/lib/versionInfo.js +1 -1
  122. package/lib-cjs/component/1d/ApodizationLine.js +1 -1
  123. package/lib-cjs/component/1d/Chart1D.js +3 -2
  124. package/lib-cjs/component/1d/Line.js +1 -1
  125. package/lib-cjs/component/1d/Viewer1D.js +15 -3
  126. package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
  127. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  128. package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
  129. package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
  130. package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
  131. package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
  132. package/lib-cjs/component/1d/ranges/Range.js +3 -1
  133. package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
  134. package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
  135. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -2
  136. package/lib-cjs/component/2d/SlicingView.js +1 -1
  137. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  138. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +46 -5
  139. package/lib-cjs/component/assignment/index.js +5 -1
  140. package/lib-cjs/component/context/KeyModifierContext.js +44 -0
  141. package/lib-cjs/component/elements/Button.js +2 -0
  142. package/lib-cjs/component/elements/NumberInput.js +12 -2
  143. package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
  144. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  145. package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
  146. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
  147. package/lib-cjs/component/header/Header.js +5 -5
  148. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
  149. package/lib-cjs/component/highlight/index.js +1 -0
  150. package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  151. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
  152. package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
  153. package/lib-cjs/component/hooks/useSpectrum.js +1 -1
  154. package/lib-cjs/component/main/ErrorOverlay.js +26 -0
  155. package/lib-cjs/component/main/InnerNMRium.js +82 -0
  156. package/lib-cjs/component/main/InnerNMRiumContents.js +96 -0
  157. package/lib-cjs/component/main/NMRium.js +19 -0
  158. package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
  159. package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  160. package/lib-cjs/component/main/StateError.js +20 -0
  161. package/lib-cjs/component/main/index.js +21 -0
  162. package/lib-cjs/component/main/types.js +3 -0
  163. package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
  164. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
  165. package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
  166. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
  167. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
  168. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  169. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
  170. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
  171. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
  172. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
  173. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  174. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +27 -3
  175. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
  176. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  177. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +11 -5
  178. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +1 -1
  179. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  180. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  181. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  182. package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
  183. package/lib-cjs/component/reducer/Reducer.js +29 -5
  184. package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
  185. package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
  186. package/lib-cjs/component/reducer/actions/MoleculeActions.js +1 -1
  187. package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
  188. package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
  189. package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
  190. package/lib-cjs/component/toolbar/ToolTypes.js +36 -0
  191. package/lib-cjs/component/utility/export.js +7 -4
  192. package/lib-cjs/component/utility/filterType.js +2 -0
  193. package/lib-cjs/component/workspaces/basic.js +2 -0
  194. package/lib-cjs/component/workspaces/embedded.js +2 -0
  195. package/lib-cjs/component/workspaces/exercise.js +2 -0
  196. package/lib-cjs/component/workspaces/prediction.js +9 -0
  197. package/lib-cjs/component/workspaces/process1D.js +2 -0
  198. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
  199. package/lib-cjs/data/PredictionManager.js +9 -9
  200. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
  201. package/lib-cjs/data/molecules/Molecule.js +2 -2
  202. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
  203. package/lib-cjs/versionInfo.js +1 -1
  204. package/package.json +26 -25
  205. package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
  206. package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
  207. package/lib/component/ErrorOverlay.js +0 -27
  208. package/lib/component/NMRium.d.ts +0 -42
  209. package/lib/component/NMRium.js +0 -237
  210. package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
  211. package/lib/component/reducer/actions/GlobalActions.js +0 -4
  212. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
  213. package/lib-cjs/component/ErrorOverlay.js +0 -30
  214. package/lib-cjs/component/NMRium.js +0 -267
  215. package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
  216. /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
  217. /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { useCallback, useEffect, useMemo } from 'react';
1
+ import { useCallback, useEffect, useMemo, useRef } from 'react';
2
2
  import checkModifierKeyActivated from '../../data/utilities/checkModifierKeyActivated';
3
3
  import { useAssignmentData } from '../assignment/AssignmentsContext';
4
4
  import { useChartData } from '../context/ChartContext';
@@ -13,8 +13,9 @@ import useExport from '../hooks/useExport';
13
13
  import useToolsFunctions from '../hooks/useToolsFunctions';
14
14
  import { DISPLAYER_MODE } from '../reducer/core/Constants';
15
15
  import { options } from '../toolbar/ToolTypes';
16
- function KeysListenerTracker() {
17
- const { keysPreferences, displayerMode, overDisplayer, data, view: { spectra: { activeTab }, }, } = useChartData();
16
+ function KeysListenerTracker(props) {
17
+ const { mainDivRef } = props;
18
+ const { keysPreferences, displayerMode, data, view: { spectra: { activeTab }, }, } = useChartData();
18
19
  const dispatch = useDispatch();
19
20
  const { dispatch: dispatchPreferences } = usePreferences();
20
21
  const alert = useAlert();
@@ -24,6 +25,25 @@ function KeysListenerTracker() {
24
25
  const { saveToClipboardHandler, saveAsJSONHandler, saveAsHandler } = useExport();
25
26
  const isToolVisible = useCheckToolsVisibility();
26
27
  const { highlight, remove } = useHighlightData();
28
+ const mouseIsOverDisplayer = useRef(false);
29
+ useEffect(() => {
30
+ const div = mainDivRef.current;
31
+ if (!div) {
32
+ return;
33
+ }
34
+ function mouseEnterHandler() {
35
+ mouseIsOverDisplayer.current = true;
36
+ }
37
+ function mouseLeaveHandler() {
38
+ mouseIsOverDisplayer.current = false;
39
+ }
40
+ div.addEventListener('mouseenter', mouseEnterHandler);
41
+ div.addEventListener('mouseleave', mouseLeaveHandler);
42
+ return () => {
43
+ div.removeEventListener('mouseenter', mouseEnterHandler);
44
+ div.removeEventListener('mouseleave', mouseLeaveHandler);
45
+ };
46
+ }, [mainDivRef]);
27
47
  const assignmentData = useAssignmentData();
28
48
  const allow1DTool = useMemo(() => {
29
49
  return displayerMode === DISPLAYER_MODE.DM_1D && data && data.length > 0;
@@ -170,6 +190,15 @@ function KeysListenerTracker() {
170
190
  }
171
191
  break;
172
192
  }
193
+ case HighlightEventSource.BASELINE_ZONE: {
194
+ const { id } = extra || {};
195
+ if (id) {
196
+ dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
197
+ // remove keys from the highlighted list after delete
198
+ remove();
199
+ }
200
+ break;
201
+ }
173
202
  default:
174
203
  break;
175
204
  }
@@ -223,7 +252,6 @@ function KeysListenerTracker() {
223
252
  handleFullZoomOut();
224
253
  }
225
254
  break;
226
- case 'z':
227
255
  case 'Escape':
228
256
  if (isToolVisible('zoom')) {
229
257
  handleChangeOption(options.zoom.id);
@@ -238,6 +266,12 @@ function KeysListenerTracker() {
238
266
  }
239
267
  break;
240
268
  }
269
+ case 'z': {
270
+ if (isToolVisible('zeroFilling')) {
271
+ handleChangeOption(options.zeroFilling.id);
272
+ }
273
+ break;
274
+ }
241
275
  case 'a': {
242
276
  if (isToolVisible('apodization')) {
243
277
  handleChangeOption(options.apodization.id);
@@ -247,6 +281,14 @@ function KeysListenerTracker() {
247
281
  }
248
282
  break;
249
283
  }
284
+ case 't': {
285
+ if (isToolVisible('fft')) {
286
+ dispatch({
287
+ type: 'APPLY_FFT_FILTER',
288
+ });
289
+ }
290
+ break;
291
+ }
250
292
  case 'b': {
251
293
  if (isToolVisible('baselineCorrection')) {
252
294
  handleChangeOption(options.baselineCorrection.id);
@@ -343,7 +385,7 @@ function KeysListenerTracker() {
343
385
  saveToClipboardHandler,
344
386
  ]);
345
387
  const handleOnKeyDown = useCallback((e) => {
346
- if (checkNotInputField(e) && overDisplayer) {
388
+ if (checkNotInputField(e) && mouseIsOverDisplayer.current) {
347
389
  const num = Number(e.code.slice(-1)) || 0;
348
390
  if (num > 0) {
349
391
  keysPreferencesListenerHandler(e, num);
@@ -361,7 +403,6 @@ function KeysListenerTracker() {
361
403
  deleteHandler,
362
404
  highlight,
363
405
  keysPreferencesListenerHandler,
364
- overDisplayer,
365
406
  toolsListenerHandler,
366
407
  ]);
367
408
  useEffect(() => {
@@ -1 +1,6 @@
1
- export declare function AssignmentProvider(props: any): import("react/jsx-runtime").JSX.Element;
1
+ import { ReactNode } from 'react';
2
+ interface AssignmentProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function AssignmentProvider(props: AssignmentProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,15 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useReducer, useMemo, useEffect } from 'react';
3
+ import { useChartData } from '../context/ChartContext';
3
4
  import { assignmentState, assignmentContext, } from './AssignmentsContext';
4
5
  import assignmentReducer from './AssignmentsReducer';
5
6
  export function AssignmentProvider(props) {
6
- const { spectraData: spectra, children } = props;
7
+ const { children } = props;
8
+ const { data: spectra } = useChartData();
7
9
  const [data, dispatch] = useReducer(assignmentReducer, assignmentState);
8
10
  const state = useMemo(() => ({ data, dispatch }), [data]);
9
11
  useEffect(() => {
10
12
  if (spectra) {
11
13
  dispatch({
12
14
  type: 'INITIATE_ASSIGNMENTS',
15
+ // TODO: Fix this type error. It's been here for a long time because this component wasn't typed.
16
+ // @ts-expect-error This should be fixed.
13
17
  payload: { spectra },
14
18
  });
15
19
  }
@@ -5,7 +5,6 @@ import { DatabaseActions } from '../reducer/actions/DatabaseActions';
5
5
  import { DimensionsActions } from '../reducer/actions/DimensionsActions';
6
6
  import { DomainActions } from '../reducer/actions/DomainActions';
7
7
  import { FiltersActions } from '../reducer/actions/FiltersActions';
8
- import { GlobalActions } from '../reducer/actions/GlobalActions';
9
8
  import { IntegralsActions } from '../reducer/actions/IntegralsActions';
10
9
  import { LoadActions } from '../reducer/actions/LoadActions';
11
10
  import { MoleculeActions } from '../reducer/actions/MoleculeActions';
@@ -17,7 +16,7 @@ import { SpectrumActions } from '../reducer/actions/SpectrumsActions';
17
16
  import { ToolsActions } from '../reducer/actions/ToolsActions';
18
17
  import { ZonesActions } from '../reducer/actions/ZonesActions';
19
18
  import { ActionType } from '../reducer/types/ActionType';
20
- export type Action = ToolsActions | SpectrumActions | SpectraAnalysisActions | GlobalActions | LoadActions | IntegralsActions | RangesActions | DatabaseActions | DimensionsActions | AssignmentsActions | DomainActions | PreferencesActions | PeaksActions | MoleculeActions | ZonesActions | FiltersActions | CorrelationsActions | ActionType<'INITIALIZE_NMRIUM'>;
19
+ export type Action = ToolsActions | SpectrumActions | SpectraAnalysisActions | LoadActions | IntegralsActions | RangesActions | DatabaseActions | DimensionsActions | AssignmentsActions | DomainActions | PreferencesActions | PeaksActions | MoleculeActions | ZonesActions | FiltersActions | CorrelationsActions | ActionType<'INITIALIZE_NMRIUM'>;
21
20
  export type Dispatch = (action: Action) => void;
22
21
  export declare const dispatchContext: import("react").Context<Dispatch>;
23
22
  export declare const DispatchProvider: import("react").Provider<Dispatch>;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ interface KeyModifiers {
3
+ ctrlKey: boolean;
4
+ shiftKey: boolean;
5
+ altKey: boolean;
6
+ }
7
+ export declare const KeyModifierContext: import("react").Context<KeyModifiers>;
8
+ export declare function useKeyModifiers(): KeyModifiers;
9
+ interface KeyModifierProviderProps {
10
+ children: ReactNode;
11
+ }
12
+ export declare function KeyModifiersProvider({ children }: KeyModifierProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useState, } from 'react';
3
+ const defaultKeyModifiersState = {
4
+ ctrlKey: false,
5
+ shiftKey: false,
6
+ altKey: false,
7
+ };
8
+ export const KeyModifierContext = createContext(defaultKeyModifiersState);
9
+ export function useKeyModifiers() {
10
+ const context = useContext(KeyModifierContext);
11
+ if (!context) {
12
+ throw new Error('key modifiers context was not found');
13
+ }
14
+ return context;
15
+ }
16
+ const isMac = navigator !== undefined && navigator.userAgent.toLowerCase().includes('mac');
17
+ function getModifiers(event) {
18
+ const { shiftKey, altKey, metaKey } = event;
19
+ const ctrlKey = isMac ? metaKey : event.ctrlKey;
20
+ return { ctrlKey, shiftKey, altKey };
21
+ }
22
+ export function KeyModifiersProvider({ children }) {
23
+ const [modifiers, setModifiers] = useState(defaultKeyModifiersState);
24
+ useEffect(() => {
25
+ function handleKeyDown(event) {
26
+ setModifiers(getModifiers(event));
27
+ }
28
+ function handleKeyUp(event) {
29
+ setModifiers(getModifiers(event));
30
+ }
31
+ document.addEventListener('keydown', handleKeyDown);
32
+ document.addEventListener('keyup', handleKeyUp);
33
+ return () => {
34
+ document.removeEventListener('keydown', handleKeyDown);
35
+ document.removeEventListener('keyup', handleKeyUp);
36
+ };
37
+ }, []);
38
+ return (_jsx(KeyModifierContext.Provider, { value: modifiers, children: children }));
39
+ }
@@ -13,11 +13,40 @@ export declare function usePreferences(): {
13
13
  workspaces: import("../reducer/preferences/preferencesReducer").WorkspacesWithSource;
14
14
  originalWorkspaces: import("../reducer/preferences/preferencesReducer").WorkspacesWithSource;
15
15
  dispatch: (action?: ({
16
+ type: "INIT_PREFERENCES";
17
+ payload: {
18
+ display: import("nmr-load-save").WorkspacePreferences;
19
+ workspace: import("../main/types").NMRiumWorkspace;
20
+ customWorkspaces: Record<string, import("nmr-load-save").Workspace>;
21
+ dispatch: any;
22
+ };
23
+ } | ({
24
+ type: "SET_PREFERENCES";
25
+ payload: Partial<import("nmr-load-save").Workspace>;
26
+ } | {
27
+ type: "SET_PREFERENCES";
28
+ }) | {
29
+ type: "SET_PANELS_PREFERENCES";
30
+ payload: {
31
+ key: string;
32
+ value: string;
33
+ };
34
+ } | import("../reducer/preferences/preferencesReducer").SetWorkspaceAction | {
35
+ type: "REMOVE_WORKSPACE" | "SET_ACTIVE_WORKSPACE";
36
+ payload: {
37
+ workspace: string;
38
+ };
39
+ } | {
16
40
  type: "ADD_WORKSPACE";
17
41
  payload: {
18
42
  workspaceKey: string;
19
43
  data?: Omit<import("nmr-load-save").Workspace, "label" | "version"> | undefined;
20
44
  };
45
+ } | {
46
+ type: "APPLY_General_PREFERENCES";
47
+ payload: {
48
+ data: Omit<import("nmr-load-save").Workspace, "label" | "version">;
49
+ };
21
50
  } | {
22
51
  type: "ANALYZE_SPECTRA";
23
52
  payload: {
@@ -46,9 +75,10 @@ export declare function usePreferences(): {
46
75
  data: import("nmr-load-save").MultipleSpectraAnalysisPreferences;
47
76
  };
48
77
  } | {
49
- type: "APPLY_General_PREFERENCES";
78
+ type: "SET_MATRIX_GENERATION_OPTIONS";
50
79
  payload: {
51
- data: Omit<import("nmr-load-save").Workspace, "label" | "version">;
80
+ nucleus: string;
81
+ options: import("../../data/types/data1d/MatrixOptions").MatrixOptions;
52
82
  };
53
83
  } | {
54
84
  type: "ADD_MATRIX_GENERATION_EXCLUSION_ZONE";
@@ -63,41 +93,6 @@ export declare function usePreferences(): {
63
93
  };
64
94
  nucleus: string;
65
95
  };
66
- } | {
67
- type: "REMOVE_WORKSPACE" | "SET_ACTIVE_WORKSPACE";
68
- payload: {
69
- workspace: string;
70
- };
71
- } | {
72
- type: "SET_VERTICAL_SPLITTER_POSITION";
73
- payload: {
74
- value: import("react-science/ui").SplitPaneSize;
75
- };
76
- } | import("../reducer/preferences/preferencesReducer").SetWorkspaceAction | {
77
- type: "INIT_PREFERENCES";
78
- payload: {
79
- display: import("nmr-load-save").WorkspacePreferences;
80
- workspace: import("../NMRium").NMRiumWorkspace;
81
- customWorkspaces: Record<string, import("nmr-load-save").Workspace>;
82
- dispatch: any;
83
- };
84
- } | ({
85
- type: "SET_PREFERENCES";
86
- payload: Partial<import("nmr-load-save").Workspace>;
87
- } | {
88
- type: "SET_PREFERENCES";
89
- }) | {
90
- type: "SET_PANELS_PREFERENCES";
91
- payload: {
92
- key: string;
93
- value: string;
94
- };
95
- } | {
96
- type: "SET_MATRIX_GENERATION_OPTIONS";
97
- payload: {
98
- nucleus: string;
99
- options: import("../../data/types/data1d/MatrixOptions").MatrixOptions;
100
- };
101
96
  } | {
102
97
  type: "DELETE_MATRIX_GENERATION_EXCLUSION_ZONE";
103
98
  payload: {
@@ -108,10 +103,15 @@ export declare function usePreferences(): {
108
103
  };
109
104
  nucleus: string;
110
105
  };
106
+ } | {
107
+ type: "SET_VERTICAL_SPLITTER_POSITION";
108
+ payload: {
109
+ value: import("react-science/ui").SplitPaneSize;
110
+ };
111
111
  }) | undefined) => void;
112
112
  workspace: {
113
- current: import("../NMRium").NMRiumWorkspace;
114
- base: import("../NMRium").NMRiumWorkspace | null;
113
+ current: import("../main/types").NMRiumWorkspace;
114
+ base: import("../main/types").NMRiumWorkspace | null;
115
115
  };
116
116
  };
117
117
  export declare function useWorkspacesList(): any[];
@@ -1,4 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ //TODO resolve the eslint rules
3
+ /* eslint-disable react/no-unused-prop-types */
2
4
  /** @jsxImportSource @emotion/react */
3
5
  import { css } from '@emotion/react';
4
6
  import { FaInfoCircle } from 'react-icons/fa';
@@ -7,6 +7,7 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
7
7
  max?: any;
8
8
  value?: number;
9
9
  style?: CSSProperties;
10
+ autoSelect?: boolean;
10
11
  }
11
12
  declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
12
13
  export default NumberInput;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
2
+ import { forwardRef, useEffect } from 'react';
3
+ import useCombinedRefs from '../hooks/useCombinedRefs';
3
4
  const inputStyle = {
4
5
  height: '100%',
5
6
  width: '100px',
@@ -7,7 +8,13 @@ const inputStyle = {
7
8
  border: '0.55px solid #c7c7c7',
8
9
  textAlign: 'center',
9
10
  };
10
- const NumberInput = forwardRef(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', ...otherProps }, ref) => {
11
- return (_jsx("input", { ref: ref, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max, ...otherProps }));
11
+ const NumberInput = forwardRef(({ name, value: valueProp, style = {}, onChange, pattern = '^\\d*.\\d*$', step = 'any', min = 'any', max = 'any', autoSelect = false, ...otherProps }, ref) => {
12
+ const combinedRef = useCombinedRefs([ref]);
13
+ useEffect(() => {
14
+ if (autoSelect) {
15
+ combinedRef?.current?.select();
16
+ }
17
+ }, [autoSelect, combinedRef]);
18
+ return (_jsx("input", { ref: combinedRef, name: name, style: { ...inputStyle, ...style }, type: "number", pattern: pattern, value: valueProp, step: step, onChange: onChange, min: min, max: max, ...otherProps }));
12
19
  });
13
20
  export default NumberInput;
@@ -16,7 +16,7 @@ const FormikOnChange = (props) => {
16
16
  debounceOnChange.current(values);
17
17
  }
18
18
  else {
19
- setTouched(errors);
19
+ void setTouched(errors);
20
20
  }
21
21
  }
22
22
  else {
@@ -60,6 +60,6 @@ function ConfirmationDialog({ style = {}, buttons = [], onClose, message, render
60
60
  onClose();
61
61
  }
62
62
  }, [onClose]);
63
- return (_jsxs("div", { style: style, css: styles, "data-test-id": id, children: [render ? (render({ message, className: 'message' })) : (_jsx("p", { className: "message", children: message })), _jsx("div", { className: "buttons-container", children: buttons.map((option) => (_jsx("button", { type: "button", onClick: (e) => optionsHandler(e, option), style: option.style && option.style, children: option.text }, option.text))) })] }));
63
+ return (_jsxs("div", { style: style, css: styles, "data-testid": id, children: [render ? (render({ message, className: 'message' })) : (_jsx("p", { className: "message", children: message })), _jsx("div", { className: "buttons-container", children: buttons.map((option) => (_jsx("button", { type: "button", onClick: (e) => optionsHandler(e, option), style: option.style && option.style, children: option.text }, option.text))) })] }));
64
64
  }
65
65
  export default ConfirmationDialog;
@@ -28,21 +28,30 @@ const initialValues = {
28
28
  };
29
29
  function ApodizationOptionsInnerPanel(props) {
30
30
  const dispatch = useDispatch();
31
- const formRef = useRef(null);
31
+ const previousPreviewRef = useRef(initialValues.livePreview);
32
32
  function handleApplyFilter(values, triggerSource = 'apply') {
33
- const { livePreview, ...filterOptions } = values;
34
- if (livePreview && triggerSource === 'onChange') {
35
- dispatch({
36
- type: 'CALCULATE_APODIZATION_FILTER',
37
- payload: filterOptions,
38
- });
39
- }
40
- else if (triggerSource === 'apply') {
41
- dispatch({
42
- type: 'APPLY_APODIZATION_FILTER',
43
- payload: filterOptions,
44
- });
33
+ const { livePreview, ...options } = values;
34
+ switch (triggerSource) {
35
+ case 'onChange': {
36
+ if (livePreview || previousPreviewRef.current !== livePreview) {
37
+ dispatch({
38
+ type: 'CALCULATE_APODIZATION_FILTER',
39
+ payload: { livePreview, options },
40
+ });
41
+ }
42
+ break;
43
+ }
44
+ case 'apply': {
45
+ dispatch({
46
+ type: 'APPLY_APODIZATION_FILTER',
47
+ payload: { options },
48
+ });
49
+ break;
50
+ }
51
+ default:
52
+ break;
45
53
  }
54
+ previousPreviewRef.current = livePreview;
46
55
  }
47
56
  function handleCancelFilter() {
48
57
  dispatch({
@@ -53,7 +62,7 @@ function ApodizationOptionsInnerPanel(props) {
53
62
  if (props.filter) {
54
63
  formData = { ...initialValues, ...props.filter.value, livePreview: true };
55
64
  }
56
- return (_jsxs(HeaderContainer, { children: [_jsx(Formik, { innerRef: formRef, onSubmit: (values) => handleApplyFilter(values), initialValues: formData, validationSchema: validationSchema, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Line broadening : ", shortTitle: "LB :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Gauss broadening :", shortTitle: "GB :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "gaussBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "lineBroadeningCenter [0 - 1] : ", shortTitle: "LB Center :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true })] }) }), _jsx(ActionButtons, { onDone: () => formRef.current?.submitForm(), onCancel: handleCancelFilter })] }));
65
+ return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: formData, validationSchema: validationSchema, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Line broadening : ", shortTitle: "LB :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Gauss broadening :", shortTitle: "GB :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "gaussBroadening", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "lineBroadeningCenter [0 - 1] : ", shortTitle: "LB Center :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) }) }));
57
66
  }
58
67
  const MemoizedApodizationPanel = memo(ApodizationOptionsInnerPanel);
59
68
  export default function ApodizationOptionsPanel() {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Formik } from 'formik';
3
3
  import { Filters } from 'nmr-processing';
4
- import { useRef, useState, memo } from 'react';
4
+ import { useState, memo, useRef } from 'react';
5
5
  import * as Yup from 'yup';
6
6
  import { useDispatch } from '../context/DispatchContext';
7
7
  import ActionButtons from '../elements/ActionButtons';
@@ -65,16 +65,37 @@ const formData = (algorithm, filterValues) => {
65
65
  };
66
66
  function BaseLineCorrectionInnerPanel(props) {
67
67
  const dispatch = useDispatch();
68
- const formRef = useRef(null);
68
+ const previousPreviewRef = useRef(true);
69
69
  const { algorithm: baseAlgorithm = 'polynomial' } = props?.filter?.value || {};
70
70
  const [algorithm, setAlgorithm] = useState(baseAlgorithm);
71
71
  const handleApplyFilter = (values, triggerSource = 'apply') => {
72
- dispatch({
73
- type: triggerSource === 'onChange'
74
- ? 'CALCULATE_BASE_LINE_CORRECTION_FILTER'
75
- : 'APPLY_BASE_LINE_CORRECTION_FILTER',
76
- payload: values,
77
- });
72
+ const { livePreview, ...options } = values;
73
+ switch (triggerSource) {
74
+ case 'onChange': {
75
+ if (livePreview || previousPreviewRef !== livePreview) {
76
+ dispatch({
77
+ type: 'CALCULATE_BASE_LINE_CORRECTION_FILTER',
78
+ payload: {
79
+ options,
80
+ livePreview,
81
+ },
82
+ });
83
+ }
84
+ break;
85
+ }
86
+ case 'apply': {
87
+ dispatch({
88
+ type: 'APPLY_BASE_LINE_CORRECTION_FILTER',
89
+ payload: {
90
+ options,
91
+ },
92
+ });
93
+ break;
94
+ }
95
+ default:
96
+ break;
97
+ }
98
+ previousPreviewRef.current = livePreview;
78
99
  };
79
100
  const handleCancelFilter = () => {
80
101
  dispatch({
@@ -85,8 +106,8 @@ function BaseLineCorrectionInnerPanel(props) {
85
106
  setAlgorithm(selectedAlgorithm);
86
107
  }
87
108
  const form = formData(algorithm, props?.filter?.value || {});
88
- return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Algorithm: ", style: headerLabelStyle, children: _jsx(Select, { items: getAlgorithmsList(), value: algorithm, onChange: handleChangeAlgorithm }) }), _jsx(Formik, { innerRef: formRef, onSubmit: (values) => handleApplyFilter(values), initialValues: form.values, validationSchema: form.validation, enableReinitialize: true, children: _jsxs(_Fragment, { children: [algorithm && algorithm === 'airpls' && (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(Label, { title: "maxIterations:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "maxIterations", debounceTime: 250, style: inputStyle }) }), _jsx(Label, { title: "tolerance:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "tolerance", debounceTime: 250, style: inputStyle }) })] })), algorithm &&
89
- ['autoPolynomial', 'polynomial'].includes(algorithm) && (_jsx(Label, { title: "degree [ 1 - 6 ]:", shortTitle: "degree :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "degree", min: 1, max: 6, style: inputStyle, debounceTime: 250 }) })), _jsx(Label, { title: "live preview ", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true })] }) }), _jsx(ActionButtons, { onDone: () => formRef.current?.submitForm(), onCancel: handleCancelFilter })] }));
109
+ return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Algorithm: ", style: headerLabelStyle, children: _jsx(Select, { items: getAlgorithmsList(), value: algorithm, onChange: handleChangeAlgorithm }) }), _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: form.values, validationSchema: form.validation, enableReinitialize: true, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [algorithm && algorithm === 'airpls' && (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(Label, { title: "maxIterations:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "maxIterations", debounceTime: 250, style: inputStyle }) }), _jsx(Label, { title: "tolerance:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "tolerance", debounceTime: 250, style: inputStyle }) })] })), algorithm &&
110
+ ['autoPolynomial', 'polynomial'].includes(algorithm) && (_jsx(Label, { title: "degree [ 1 - 6 ]:", shortTitle: "degree :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "degree", min: 1, max: 6, style: inputStyle, debounceTime: 250 }) })), _jsx(Label, { title: "live preview ", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) })] }));
90
111
  }
91
112
  const MemoizedBaseLineCorrectionPanel = memo(BaseLineCorrectionInnerPanel);
92
113
  export default function BaseLineCorrectionPanel() {
@@ -1,6 +1,13 @@
1
1
  import { LabelStyle } from '../elements/Label';
2
2
  export declare const headerLabelStyle: LabelStyle;
3
- export default function HeaderWrapper({ isFullscreen, onMaximize }: {
4
- isFullscreen: any;
5
- onMaximize: any;
3
+ interface HeaderInnerProps {
4
+ onEnableFullscreen: () => void;
5
+ isFullscreenEnabled: boolean;
6
+ selectedOptionPanel: string | null;
7
+ height: number;
8
+ }
9
+ export default function HeaderWrapper({ isFullscreenEnabled, onEnableFullscreen, }: {
10
+ isFullscreenEnabled: HeaderInnerProps['isFullscreenEnabled'];
11
+ onEnableFullscreen: HeaderInnerProps['onEnableFullscreen'];
6
12
  }): import("@emotion/react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -61,7 +61,7 @@ const styles = css `
61
61
  }
62
62
  `;
63
63
  function HeaderInner(props) {
64
- const { isFullscreen, onMaximize = () => null, selectedOptionPanel, height, } = props;
64
+ const { isFullscreenEnabled, onEnableFullscreen, selectedOptionPanel, height, } = props;
65
65
  const { current: { display: { general }, }, workspace, dispatch, } = usePreferences();
66
66
  const workspacesList = useWorkspacesList();
67
67
  const hideGeneralSettings = !!(general?.hideGeneralSettings && workspace.base);
@@ -100,7 +100,7 @@ function HeaderInner(props) {
100
100
  alignItems: 'center',
101
101
  }, children: [_jsx("div", { children: _jsx(Toolbar, { orientation: "horizontal", children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
102
102
  alignItems: 'center',
103
- }, children: [!hideGeneralSettings && (_jsxs(_Fragment, { children: [_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), _jsx(SaveButton, {})] })), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreen && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onMaximize, title: "Full Screen", className: "windowButton", children: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
103
+ }, children: [!hideGeneralSettings && (_jsxs(_Fragment, { children: [_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), _jsx(SaveButton, {})] })), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreenEnabled && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onEnableFullscreen, title: "Full Screen", className: "windowButton", children: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
104
104
  }
105
105
  function SaveButton() {
106
106
  const { workspace, workspaces, originalWorkspaces } = usePreferences();
@@ -117,10 +117,10 @@ function SaveButton() {
117
117
  }), toolTip: "Save workspace locally in the browser", children: _jsx(FaRegSave, {}) }), _jsx(SaveSettingsModal, {})] }));
118
118
  }
119
119
  const MemoizedHeader = memo(HeaderInner);
120
- export default function HeaderWrapper({ isFullscreen, onMaximize }) {
120
+ export default function HeaderWrapper({ isFullscreenEnabled, onEnableFullscreen, }) {
121
121
  const { toolOptions: { selectedOptionPanel }, height, } = useChartData();
122
122
  return (_jsx(MemoizedHeader, { selectedOptionPanel,
123
- isFullscreen,
124
- onMaximize,
123
+ isFullscreenEnabled,
124
+ onEnableFullscreen,
125
125
  height }));
126
126
  }