nmrium 0.51.0 → 0.53.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 (119) hide show
  1. package/lib/component/1d/LinesSeries.js +1 -1
  2. package/lib/component/1d/ranges/AssignmentLabel.d.ts +7 -0
  3. package/lib/component/1d/ranges/AssignmentLabel.js +10 -0
  4. package/lib/component/1d/ranges/Range.js +2 -1
  5. package/lib/component/EventsTrackers/KeysListenerTracker.js +3 -3
  6. package/lib/component/context/DispatchContext.d.ts +1 -1
  7. package/lib/component/elements/EditableColumn.js +3 -3
  8. package/lib/component/elements/Label.js +1 -1
  9. package/lib/component/header/ApodizationOptionsPanel.js +1 -1
  10. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -1
  11. package/lib/component/header/BaseLineCorrectionPanel.js +2 -2
  12. package/lib/component/header/Header.js +1 -1
  13. package/lib/component/header/PhaseCorrectionPanel.js +1 -1
  14. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +2 -2
  15. package/lib/component/header/RangesPickingOptionPanel.js +1 -1
  16. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  17. package/lib/component/header/Zones2DOptionPanel.js +6 -2
  18. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +1 -0
  19. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
  20. package/lib/component/hooks/useToolsFunctions.d.ts +1 -1
  21. package/lib/component/hooks/useToolsFunctions.js +10 -4
  22. package/lib/component/main/NMRiumStateProvider.js +1 -1
  23. package/lib/component/modal/AboutPredictionModal.js +1 -1
  24. package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
  25. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  26. package/lib/component/modal/ImportPublicationStringModal.d.ts +5 -3
  27. package/lib/component/modal/ImportPublicationStringModal.js +7 -4
  28. package/lib/component/modal/LoadJCAMPModal.js +1 -1
  29. package/lib/component/modal/LogsHistoryModal.js +1 -1
  30. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  31. package/lib/component/modal/SaveAsModal.js +2 -2
  32. package/lib/component/modal/editZone/EditPathLengthFormik.js +2 -2
  33. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  34. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  35. package/lib/component/modal/setting/GeneralSettings.js +2 -2
  36. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
  37. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
  38. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +1 -1
  39. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +1 -1
  40. package/lib/component/panels/Panels.js +5 -5
  41. package/lib/component/panels/RangesPanel/RangesHeader.js +21 -7
  42. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  43. package/lib/component/panels/RangesPanel/RangesPreferences.js +9 -3
  44. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  45. package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -1
  46. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +7 -0
  47. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +16 -0
  48. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.d.ts +5 -0
  49. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPanelHeader.js +8 -8
  50. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.js +1 -1
  51. package/lib/component/panels/SpectraPanel/SpectraTabs.d.ts +1 -0
  52. package/lib/component/panels/{SpectrumsPanel/SpectrumsTabs.js → SpectraPanel/SpectraTabs.js} +6 -6
  53. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.js +2 -2
  54. package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
  55. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  56. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +1 -1
  57. package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +2 -2
  58. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
  59. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
  60. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -2
  61. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
  62. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +8 -1
  63. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +1 -1
  64. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +2 -2
  65. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +1 -1
  66. package/lib/component/reducer/IgnoreActions.js +1 -1
  67. package/lib/component/reducer/Reducer.d.ts +1 -0
  68. package/lib/component/reducer/Reducer.js +19 -16
  69. package/lib/component/reducer/actions/DomainActions.js +3 -3
  70. package/lib/component/reducer/actions/FiltersActions.js +337 -317
  71. package/lib/component/reducer/actions/LoadActions.js +1 -1
  72. package/lib/component/reducer/actions/PreferencesActions.js +2 -2
  73. package/lib/component/reducer/actions/RangesActions.d.ts +7 -2
  74. package/lib/component/reducer/actions/RangesActions.js +16 -2
  75. package/lib/component/reducer/actions/ToolsActions.d.ts +3 -3
  76. package/lib/component/reducer/actions/ToolsActions.js +21 -28
  77. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -0
  78. package/lib/component/reducer/actions/ZonesActions.js +5 -1
  79. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +6 -4
  80. package/lib/component/toolbar/ToolBar.js +16 -16
  81. package/lib/component/toolbar/toolbarMenu.js +4 -4
  82. package/lib/component/utility/export.js +1 -1
  83. package/lib/constants.js +5 -5
  84. package/lib/data/data2d/Spectrum2D/getSlice.js +1 -1
  85. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -0
  86. package/lib/versionInfo.js +1 -1
  87. package/package.json +16 -15
  88. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.d.ts +0 -5
  89. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.d.ts +0 -1
  90. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.d.ts +0 -0
  91. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.js +0 -0
  92. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.d.ts +0 -0
  93. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.d.ts +0 -0
  94. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.d.ts +0 -0
  95. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.js +0 -0
  96. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.d.ts +0 -0
  97. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.js +0 -0
  98. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.d.ts +0 -0
  99. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.js +0 -0
  100. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.d.ts +0 -0
  101. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.js +0 -0
  102. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.d.ts +0 -0
  103. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.js +0 -0
  104. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.d.ts +0 -0
  105. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.js +0 -0
  106. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.d.ts +0 -0
  107. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.js +0 -0
  108. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.d.ts +0 -0
  109. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.js +0 -0
  110. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.d.ts +0 -0
  111. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.js +0 -0
  112. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.d.ts +0 -0
  113. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.js +0 -0
  114. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.d.ts +0 -0
  115. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.js +0 -0
  116. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.d.ts +0 -0
  117. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.js +0 -0
  118. /package/lib/component/reducer/actions/{SpectrumsActions.d.ts → SpectraActions.d.ts} +0 -0
  119. /package/lib/component/reducer/actions/{SpectrumsActions.js → SpectraActions.js} +0 -0
@@ -27,7 +27,7 @@ function LinesSeries() {
27
27
  const innerHeight = height - margin.bottom - SPECTRA_BOTTOM_MARGIN;
28
28
  const spectra = (data?.filter((d) => isSpectrum1D(d) && d.display.isVisible && xDomains[d.id]) || []);
29
29
  const { setActiveSpectrum } = useSetActiveSpectrumAction();
30
- return (_jsxs("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "spectrums", children: [spectra.map((d, i) => (_jsxs("g", { children: [_jsx(Line, { display: d.display, id: d.id, data: get1DDataXY(d), index: i }), verticalAlign === 'stack' && selectedTool === 'zoom' && (_jsx("rect", { css: style, y: innerHeight - shiftY * i - BOX_SIZE / 2, x: margin.left, width: `${innerWidth}px`, height: `${BOX_SIZE}px`, onClick: (e) => {
30
+ return (_jsxs("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "spectra", children: [spectra.map((d, i) => (_jsxs("g", { children: [_jsx(Line, { display: d.display, id: d.id, data: get1DDataXY(d), index: i }), verticalAlign === 'stack' && selectedTool === 'zoom' && (_jsx("rect", { css: style, y: innerHeight - shiftY * i - BOX_SIZE / 2, x: margin.left, width: `${innerWidth}px`, height: `${BOX_SIZE}px`, onClick: (e) => {
31
31
  setActiveSpectrum(e, d.id);
32
32
  }, "data-no-export": "true" }))] }, d.id))), activeSpectra?.map((activeSpectrum) => (_jsx("use", { href: `#${activeSpectrum.id}` }, activeSpectrum.id)))] }));
33
33
  }
@@ -0,0 +1,7 @@
1
+ import { Range } from 'nmr-processing';
2
+ interface AssignmentLabelProps {
3
+ range: Range;
4
+ x: number;
5
+ }
6
+ export declare function AssignmentLabel(props: AssignmentLabelProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useActiveSpectrumRangesViewState } from '../../hooks/useActiveSpectrumRangesViewState';
3
+ const marginTop = 55;
4
+ export function AssignmentLabel(props) {
5
+ const { range, x } = props;
6
+ const { showAssignmentsLabels } = useActiveSpectrumRangesViewState();
7
+ if (!range.assignment || !showAssignmentsLabels)
8
+ return null;
9
+ return (_jsx("text", { x: x - 5, y: marginTop, fontSize: "12px", fill: "black", textAnchor: "end", children: range.assignment }));
10
+ }
@@ -15,6 +15,7 @@ import { IntegralIndicator } from '../integral/IntegralIndicator';
15
15
  import { useScaleX } from '../utilities/scale';
16
16
  import { AssignmentActionsButtons } from './AssignmentActionsButtons';
17
17
  import { Atoms } from './Atoms';
18
+ import { AssignmentLabel } from './AssignmentLabel';
18
19
  const style = css `
19
20
  .target {
20
21
  visibility: hidden;
@@ -78,6 +79,6 @@ function Range({ range, selectedTool, relativeFormat }) {
78
79
  return (_jsxs("g", { "data-testid": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, ...(!assignmentRange.isActive && { css: style }), children: [_jsx(ResizerWithScale, { from: from, to: to, onEnd: handleOnStopResizing, disabled: !isResizingActive, children: ({ x1, x2 }, isActive) => {
79
80
  const width = x2 - x1;
80
81
  return (_jsxs("g", { children: [isAssigned && !isHighlighted && !isActive && (_jsx("rect", { width: width, height: "10px", fill: "#ffd700", opacity: "0.35", "data-no-export": "true" })), _jsx("rect", { width: width, height: "100%", fill: isHighlighted || isActive ? '#ff6f0057' : 'transparent', "data-no-export": "true" }), showIntegralsValues && (_jsx(IntegralIndicator, { value: integration, format: relativeFormat, width: width, opacity: isNotSignal ? 0.5 : 1 }))] }));
81
- } }), _jsx(Atoms, { range: range, x: startX }), _jsx(AssignmentActionsButtons, { isActive: !!(assignmentRange.isActive || rangeDiaIDs), x: startX, onAssign: assignHandler, onUnAssign: () => unAssignHandler() })] }, id));
82
+ } }), _jsx(AssignmentLabel, { range: range, x: startX }), _jsx(Atoms, { range: range, x: startX }), _jsx(AssignmentActionsButtons, { isActive: !!(assignmentRange.isActive || rangeDiaIDs), x: startX, onAssign: assignHandler, onUnAssign: () => unAssignHandler() })] }, id));
82
83
  }
83
84
  export default Range;
@@ -24,7 +24,7 @@ function KeysListenerTracker(props) {
24
24
  const modal = useModal();
25
25
  const openLoader = useLoader();
26
26
  const [isSaveModalOpened, openSaveAsDialog, closeSaveAsDialog] = useOnOff(false);
27
- const { handleChangeOption, handleFullZoomOut, alignSpectrumsVerticallyHandler, changeDisplayViewModeHandler, } = useToolsFunctions();
27
+ const { handleChangeOption, handleFullZoomOut, alignSpectraVerticallyHandler, changeDisplayViewModeHandler, } = useToolsFunctions();
28
28
  const { saveToClipboardHandler, saveAsJSONHandler } = useExport();
29
29
  const isToolVisible = useCheckToolsVisibility();
30
30
  const { highlight, remove } = useHighlightData();
@@ -354,7 +354,7 @@ function KeysListenerTracker(props) {
354
354
  }
355
355
  case 'c': {
356
356
  if (allow1DTool && isToolVisible('spectraCenterAlignments')) {
357
- alignSpectrumsVerticallyHandler();
357
+ alignSpectraVerticallyHandler();
358
358
  }
359
359
  break;
360
360
  }
@@ -410,7 +410,7 @@ function KeysListenerTracker(props) {
410
410
  toaster.show({ message: error.message, intent: 'danger' });
411
411
  }
412
412
  }, [
413
- alignSpectrumsVerticallyHandler,
413
+ alignSpectraVerticallyHandler,
414
414
  allow1DTool,
415
415
  changeDisplayViewModeHandler,
416
416
  dispatch,
@@ -11,8 +11,8 @@ import { MoleculeActions } from '../reducer/actions/MoleculeActions';
11
11
  import { PeaksActions } from '../reducer/actions/PeaksActions';
12
12
  import { PreferencesActions } from '../reducer/actions/PreferencesActions';
13
13
  import { RangesActions } from '../reducer/actions/RangesActions';
14
+ import { SpectrumActions } from '../reducer/actions/SpectraActions';
14
15
  import { SpectraAnalysisActions } from '../reducer/actions/SpectraAnalysisAction';
15
- import { SpectrumActions } from '../reducer/actions/SpectrumsActions';
16
16
  import { ToolsActions } from '../reducer/actions/ToolsActions';
17
17
  import { ZonesActions } from '../reducer/actions/ZonesActions';
18
18
  import { ActionType } from '../reducer/types/ActionType';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useEffect, useImperativeHandle, useState, } from 'react';
3
3
  import Input from './Input';
4
4
  function extractNumber(val, type) {
@@ -59,14 +59,14 @@ const EditableColumn = forwardRef(function EditableColumn(props, ref) {
59
59
  ? { whiteSpace: 'nowrap', overflow: 'hidden', display: 'inline-flex' }
60
60
  : {}),
61
61
  ...style,
62
- }, className: "editable-column-input", onDoubleClick: startEditHandler, children: [!enabled && (_jsx("span", { style: {
62
+ }, className: "editable-column-input", onDoubleClick: startEditHandler, children: [!enabled && (_jsxs("span", { style: {
63
63
  display: 'table-cell',
64
64
  verticalAlign: 'middle',
65
65
  width: '100%',
66
66
  ...(textOverFlowEllipses
67
67
  ? { textOverflow: 'ellipsis', overflow: 'hidden' }
68
68
  : {}),
69
- }, children: value })), enabled && (_jsx("div", { style: { display: 'table-cell', verticalAlign: 'middle' }, children: _jsx(Input, { style: {
69
+ }, children: [value, " \u00A0"] })), enabled && (_jsx("div", { style: { display: 'table-cell', verticalAlign: 'middle' }, children: _jsx(Input, { style: {
70
70
  inputWrapper: {
71
71
  ...(!isValid && { borderColor: 'red' }),
72
72
  width: '100%',
@@ -4,7 +4,7 @@ import { css } from '@emotion/react';
4
4
  import Button from './Button';
5
5
  export default function Label(props) {
6
6
  const { title, shortTitle, className = '', children, style, description, renderTitle, ...otherProps } = props;
7
- return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', ...style?.container }, children: [_jsxs("label", { className: className, style: {
7
+ return (_jsxs("label", { style: { display: 'flex', alignItems: 'center', ...style?.container }, ...otherProps, children: [_jsxs("span", { className: className, style: {
8
8
  fontSize: '12px',
9
9
  color: '#232323',
10
10
  paddingRight: '10px',
@@ -62,7 +62,7 @@ function ApodizationOptionsInnerPanel(props) {
62
62
  if (props.filter) {
63
63
  formData = { ...initialValues, ...props.filter.value, livePreview: true };
64
64
  }
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, step: 0.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, step: 0.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, step: 0.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 })] })) }) }));
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, step: 0.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, step: 0.1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Line broadening center [0 - 1]:", shortTitle: "LB center:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "lineBroadeningCenter", min: 0, max: 1, step: 0.1, style: inputStyle, debounceTime: 250 }) }), _jsx(Label, { title: "Live preview", 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 })] })) }) }));
66
66
  }
67
67
  const MemoizedApodizationPanel = memo(ApodizationOptionsInnerPanel);
68
68
  export default function ApodizationOptionsPanel() {
@@ -61,6 +61,6 @@ function AutoPeakPickingOptionPanel() {
61
61
  });
62
62
  }
63
63
  }
64
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { initialValues: INIT_VALUES, onSubmit: handlePeakPicking, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Direction : ", shortTitle: "", style: headerLabelStyle, children: _jsx(FormikSelect, { name: "direction", items: LookFor, style: { width: '85px' } }) }), _jsx(Label, { title: "Max Number Of Peaks :", shortTitle: "Peaks number :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "maxNumberOfPeaks", style: inputStyle, min: 0, step: 1 }) }), _jsx(Label, { title: "Noise factor :", shortTitle: "Noise :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "noiseFactor", style: inputStyle, min: 0 }) }), _jsx(Label, { title: "Min Max Ratio :", shortTitle: "Ratio :", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "minMaxRatio", style: inputStyle, step: 0.01, min: 0 }) }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Apply" })] })) }) }));
64
+ return (_jsx(HeaderContainer, { children: _jsx(Formik, { initialValues: INIT_VALUES, onSubmit: handlePeakPicking, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Direction:", shortTitle: "", style: headerLabelStyle, children: _jsx(FormikSelect, { name: "direction", items: LookFor, style: { width: '85px' } }) }), _jsx(Label, { title: "Max number of peaks:", shortTitle: "Max peaks:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "maxNumberOfPeaks", style: inputStyle, min: 0, step: 1 }) }), _jsx(Label, { title: "Noise factor:", shortTitle: "Noise:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "noiseFactor", style: inputStyle, min: 0 }) }), _jsx(Label, { title: "Min/max Ratio:", shortTitle: "Ratio:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "minMaxRatio", style: inputStyle, step: 0.01, min: 0 }) }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Apply" })] })) }) }));
65
65
  }
66
66
  export default memo(AutoPeakPickingOptionPanel);
@@ -107,8 +107,8 @@ function BaseLineCorrectionInnerPanel(props) {
107
107
  setAlgorithm(selectedAlgorithm);
108
108
  }
109
109
  const form = formData(algorithm, props?.filter?.value || {});
110
- 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 &&
111
- ['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 })] })) })] }));
110
+ 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: "Max iterations:", 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 &&
111
+ ['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", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "livePreview" }) }), _jsx(FormikOnChange, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), _jsx(ActionButtons, { onDone: submitForm, onCancel: handleCancelFilter })] })) })] }));
112
112
  }
113
113
  const MemoizedBaseLineCorrectionPanel = memo(BaseLineCorrectionInnerPanel);
114
114
  export default function BaseLineCorrectionPanel() {
@@ -105,7 +105,7 @@ function HeaderInner(props) {
105
105
  alignItems: 'center',
106
106
  }, children: [_jsx("div", { children: _jsx(Toolbar, { children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
107
107
  alignItems: 'center',
108
- }, children: [!hideWorkspaces && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), !hideGeneralSettings && _jsx(SaveButton, {}), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { children: [!general?.hideHelp && (_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), icon: _jsx(FaQuestionCircle, {}) })), _jsx(Toolbar.Item, { id: "user-manual", title: "NMRium channel", onClick: () => window.open('https://www.youtube.com/@nmrium', '_blank'), icon: _jsx(FaFilm, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !fullscreen.isFullScreen && !general?.hideMaximize && (_jsx(Toolbar.Item, { id: "full-screen", onClick: fullscreen.toggle, title: "Full Screen", className: "windowButton", icon: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
108
+ }, children: [!hideWorkspaces && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), !hideGeneralSettings && _jsx(SaveButton, {}), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { children: [!general?.hideHelp && (_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), icon: _jsx(FaQuestionCircle, {}) })), _jsx(Toolbar.Item, { id: "user-manual", title: "NMRium channel", onClick: () => window.open('https://www.youtube.com/@nmrium', '_blank'), icon: _jsx(FaFilm, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !fullscreen.isFullScreen && !general?.hideMaximize && (_jsx(Toolbar.Item, { id: "full-screen", onClick: fullscreen.toggle, title: "Full screen", className: "windowButton", icon: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
109
109
  }
110
110
  function SaveButton() {
111
111
  const { workspace, workspaces, originalWorkspaces } = usePreferences();
@@ -133,5 +133,5 @@ export default function PhaseCorrectionPanel() {
133
133
  type: 'RESET_SELECTED_TOOL',
134
134
  });
135
135
  }
136
- return (_jsxs(HeaderContainer, { children: [_jsx("div", { style: { padding: '0 5px' }, children: _jsx(Select, { items: algorithms, filterable: false, itemsEqual: "value", ...defaultSelectProps, children: _jsx(Button, { text: phaseCorrectionTypeItem?.label, rightIcon: "double-caret-vertical" }) }) }), phaseCorrectionTypeItem?.value === 'manual' && (_jsxs(_Fragment, { children: [_jsx(Label, { title: "PH0 :", style: headerLabelStyle, children: _jsx(Input, { name: "ph0", style: inputStyle, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), _jsx(Label, { title: "PH1 :", style: headerLabelStyle, children: _jsx(Input, { name: "ph1", style: inputStyle, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), _jsx(InputRange, { ref: ph0Ref, name: "ph0", label: "Change PH0 (click and drag)", shortLabel: "Ph0", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(InputRange, { ref: ph1Ref, name: "ph1", label: "Change PH1 (click and drag)", shortLabel: "Ph1", style: { width: '20%' }, onChange: handleRangeChange })] })), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
136
+ return (_jsxs(HeaderContainer, { children: [_jsx("div", { style: { padding: '0 5px' }, children: _jsx(Select, { items: algorithms, filterable: false, itemsEqual: "value", ...defaultSelectProps, children: _jsx(Button, { text: phaseCorrectionTypeItem?.label, rightIcon: "double-caret-vertical" }) }) }), phaseCorrectionTypeItem?.value === 'manual' && (_jsxs(_Fragment, { children: [_jsx(Label, { title: "PH0:", style: headerLabelStyle, children: _jsx(Input, { name: "ph0", style: inputStyle, onChange: handleInput, value: value.ph0, type: "number", debounceTime: 250 }) }), _jsx(Label, { title: "PH1:", style: headerLabelStyle, children: _jsx(Input, { name: "ph1", style: inputStyle, onChange: handleInput, value: value.ph1, type: "number", debounceTime: 250 }) }), _jsx(InputRange, { ref: ph0Ref, name: "ph0", label: "Change PH0 (click and drag)", shortLabel: "Ph0", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(InputRange, { ref: ph1Ref, name: "ph1", label: "Change PH1 (click and drag)", shortLabel: "Ph1", style: { width: '20%' }, onChange: handleRangeChange })] })), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
137
137
  }
@@ -147,9 +147,9 @@ export default function PhaseCorrectionTwoDimensionsPanel() {
147
147
  function handleToggleAddTraceToBothDirections() {
148
148
  dispatch({ type: 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS' });
149
149
  }
150
- return (_jsxs(HeaderContainer, { style: { padding: '0 5px' }, children: [_jsx(Label, { title: "Direction :", style: headerLabelStyle, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { css: css `
150
+ return (_jsxs(HeaderContainer, { style: { padding: '0 5px' }, children: [_jsx(Label, { title: "Direction:", style: headerLabelStyle, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { css: css `
151
151
  border: 1px solid #f7f7f7;
152
152
  `, title: "Horizontal", icon: _jsx(FaRulerHorizontal, {}), active: activeTraceDirection === 'horizontal', onClick: () => onChangeHandler('horizontal') }), _jsx(Toolbar.Item, { css: css `
153
153
  border: 1px solid #f7f7f7;
154
- `, title: "Vertical", icon: _jsx(FaRulerVertical, {}), active: activeTraceDirection === 'vertical', onClick: () => onChangeHandler('vertical') })] }) }), _jsx("div", { style: { paddingRight: '5px' }, children: _jsx(Toolbar, { children: _jsx(Toolbar.Item, { title: "Add the trace in both directions", icon: _jsx(MdLooksTwo, {}), active: addTracesToBothDirections, onClick: handleToggleAddTraceToBothDirections }) }) }), _jsx(Label, { title: "PH0 :", style: headerLabelStyle, children: _jsx(Input, { name: "ph0", style: inputStyle, onChange: handleInput, value: value[activeTraceDirection].ph0, type: "number", debounceTime: 250 }) }), _jsx(Label, { title: "PH1 :", style: headerLabelStyle, children: _jsx(Input, { name: "ph1", style: inputStyle, onChange: handleInput, value: value[activeTraceDirection].ph1, type: "number", debounceTime: 250 }) }), _jsx(InputRange, { ref: ph0Ref, name: "ph0", label: "Change PH0 (click and drag)", shortLabel: "Ph0", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(InputRange, { ref: ph1Ref, name: "ph1", label: "Change PH1 (click and drag)", shortLabel: "Ph1", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
154
+ `, title: "Vertical", icon: _jsx(FaRulerVertical, {}), active: activeTraceDirection === 'vertical', onClick: () => onChangeHandler('vertical') })] }) }), _jsx("div", { style: { paddingRight: '5px' }, children: _jsx(Toolbar, { children: _jsx(Toolbar.Item, { title: "Add the trace in both directions", icon: _jsx(MdLooksTwo, {}), active: addTracesToBothDirections, onClick: handleToggleAddTraceToBothDirections }) }) }), _jsx(Label, { title: "PH0:", style: headerLabelStyle, children: _jsx(Input, { name: "ph0", style: inputStyle, onChange: handleInput, value: value[activeTraceDirection].ph0, type: "number", debounceTime: 250 }) }), _jsx(Label, { title: "PH1:", style: headerLabelStyle, children: _jsx(Input, { name: "ph1", style: inputStyle, onChange: handleInput, value: value[activeTraceDirection].ph1, type: "number", debounceTime: 250 }) }), _jsx(InputRange, { ref: ph0Ref, name: "ph0", label: "Change PH0 (click and drag)", shortLabel: "Ph0", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(InputRange, { ref: ph1Ref, name: "ph1", label: "Change PH1 (click and drag)", shortLabel: "Ph1", style: { width: '20%' }, onChange: handleRangeChange }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
155
155
  }
@@ -35,7 +35,7 @@ function RangesPickingOptionPanel() {
35
35
  });
36
36
  }
37
37
  }
38
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: handleRangesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Detect negative:", htmlFor: "lookNegative", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "lookNegative" }) }), _jsx(Label, { title: "Min Max Ratio:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "minMaxRatio", style: {
38
+ return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: handleRangesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Detect negative", style: headerLabelStyle, children: _jsx(FormikCheckBox, { name: "lookNegative" }) }), _jsx(Label, { title: "Min/max ratio:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "minMaxRatio", style: {
39
39
  input: {
40
40
  width: '70px',
41
41
  textAlign: 'center',
@@ -63,7 +63,7 @@ function ZeroFillingOptionsInnerPanel(props) {
63
63
  type: 'RESET_SELECTED_TOOL',
64
64
  });
65
65
  }
66
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: { nbPoints: size, livePreview: true }, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Size: ", style: headerLabelStyle, children: _jsx(FormikSelect, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, name: "nbPoints" }) }), _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 })] })) }) }));
66
+ return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: { nbPoints: size, livePreview: true }, children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Size:", style: headerLabelStyle, children: _jsx(FormikSelect, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, name: "nbPoints" }) }), _jsx(Label, { title: "Live preview", 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 })] })) }) }));
67
67
  }
68
68
  const MemoizedZeroFillingOptionsPanel = memo(ZeroFillingOptionsInnerPanel);
69
69
  export default function ZeroFillingOptionsPanel() {
@@ -14,6 +14,7 @@ const validationSchema = Yup.object().shape({
14
14
  });
15
15
  const initialValues = {
16
16
  zonesNoiseFactor: 1,
17
+ zonesMinMaxRatio: 0.03,
17
18
  };
18
19
  function Zones2DOptionPanel() {
19
20
  const dispatch = useDispatch();
@@ -26,9 +27,12 @@ function Zones2DOptionPanel() {
26
27
  const handleChangeNoiseFactory = useCallback((values) => {
27
28
  dispatch({ type: 'CHANGE_ZONES_NOISE_FACTOR', payload: values });
28
29
  }, [dispatch]);
29
- return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: handleZonesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Noise factor :", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "zonesNoiseFactor", style: {
30
+ return (_jsx(HeaderContainer, { children: _jsx(Formik, { onSubmit: handleZonesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Noise factor:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "zonesNoiseFactor", style: {
30
31
  input: { width: '50px', textAlign: 'center' },
31
32
  inputWrapper: { height: '100%' },
32
- }, min: 0, step: 1 }) }), _jsx(FormikOnChange, { enableValidation: true, onChange: handleChangeNoiseFactory }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Auto Zones Picking" })] })) }) }));
33
+ }, min: 0, step: 1 }) }), _jsx(Label, { title: "Min/max ratio:", style: headerLabelStyle, children: _jsx(FormikInput, { type: "number", name: "zonesMinMaxRatio", style: {
34
+ input: { width: '50px', textAlign: 'center' },
35
+ inputWrapper: { height: '100%' },
36
+ }, min: 0, step: 0.01 }) }), _jsx(FormikOnChange, { enableValidation: true, onChange: handleChangeNoiseFactory }), _jsx(Button.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Auto Zones Picking" })] })) }) }));
33
37
  }
34
38
  export default Zones2DOptionPanel;
@@ -8,6 +8,7 @@ export const defaultRangesViewState = {
8
8
  showJGraph: false,
9
9
  displayingMode: 'spread',
10
10
  integralsScaleRatio: 1,
11
+ showAssignmentsLabels: false,
11
12
  };
12
13
  export function useActiveSpectrumRangesViewState() {
13
14
  const activeSpectrum = useActiveSpectrum();
@@ -4,6 +4,7 @@ export const defaultZonesViewState = {
4
4
  showPeaks: true,
5
5
  showSignals: true,
6
6
  showZones: true,
7
+ showAssignmentsLabels: false,
7
8
  };
8
9
  export function useActiveSpectrumZonesViewState() {
9
10
  const activeSpectrum = useActiveSpectrum();
@@ -3,6 +3,6 @@ export default function useToolsFunctions(): {
3
3
  handleFullZoomOut: () => void;
4
4
  changeDisplayViewModeHandler: () => void;
5
5
  changeSpectrumViewHandler: () => void;
6
- alignSpectrumsVerticallyHandler: () => void;
6
+ alignSpectraVerticallyHandler: () => void;
7
7
  isRealSpectrumShown: boolean;
8
8
  };
@@ -2,6 +2,7 @@ import lodashDebounce from 'lodash/debounce';
2
2
  import lodashMap from 'lodash/map';
3
3
  import { useCallback, useRef, useState } from 'react';
4
4
  import { useToggleAccordion } from 'react-science/ui';
5
+ import { useChartData } from '../context/ChartContext';
5
6
  import { useDispatch } from '../context/DispatchContext';
6
7
  import { usePreferences } from '../context/PreferencesContext';
7
8
  import { useToaster } from '../context/ToasterContext';
@@ -14,7 +15,12 @@ export default function useToolsFunctions() {
14
15
  const [isRealSpectrumShown, setIsRealSpectrumShown] = useState(false);
15
16
  const debounceClickEventsRef = useRef({ clicks: [] });
16
17
  const { current: { general: { invert }, }, } = usePreferences();
18
+ const { toolOptions: { selectedTool: previousSelectedTool }, } = useChartData();
17
19
  const handleChangeOption = useCallback((selectedTool) => {
20
+ //avoid reselecting the tool if it's already selected
21
+ if (selectedTool === previousSelectedTool) {
22
+ return;
23
+ }
18
24
  if ([
19
25
  options.peakPicking.id,
20
26
  options.integral.id,
@@ -33,7 +39,7 @@ export default function useToolsFunctions() {
33
39
  type: 'SET_SELECTED_TOOL',
34
40
  payload: { selectedTool: selectedTool || options.zoom.id },
35
41
  });
36
- }, [dispatch, invert, openPanel, toaster]);
42
+ }, [dispatch, invert, openPanel, previousSelectedTool, toaster]);
37
43
  const handleFullZoomOut = useCallback(() => {
38
44
  if (debounceClickEventsRef.current.clicks.length === 0) {
39
45
  dispatch({
@@ -66,9 +72,9 @@ export default function useToolsFunctions() {
66
72
  });
67
73
  setIsRealSpectrumShown(!isRealSpectrumShown);
68
74
  }, [dispatch, isRealSpectrumShown]);
69
- const alignSpectrumsVerticallyHandler = useCallback(() => {
75
+ const alignSpectraVerticallyHandler = useCallback(() => {
70
76
  dispatch({
71
- type: 'SET_SPECTRUMS_VERTICAL_ALIGN',
77
+ type: 'SET_SPECTRA_VERTICAL_ALIGN',
72
78
  });
73
79
  }, [dispatch]);
74
80
  return {
@@ -76,7 +82,7 @@ export default function useToolsFunctions() {
76
82
  handleFullZoomOut,
77
83
  changeDisplayViewModeHandler,
78
84
  changeSpectrumViewHandler,
79
- alignSpectrumsVerticallyHandler,
85
+ alignSpectraVerticallyHandler,
80
86
  isRealSpectrumShown,
81
87
  };
82
88
  }
@@ -65,7 +65,7 @@ export default function NMRiumStateProvider(props) {
65
65
  .catch((error) => {
66
66
  dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
67
67
  // eslint-disable-next-line no-alert
68
- alert(error.message);
68
+ window.alert(error.message);
69
69
  reportError(error);
70
70
  });
71
71
  }
@@ -40,6 +40,6 @@ const styles = css `
40
40
  `;
41
41
  function AboutPredictionModal() {
42
42
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
43
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaInfo, {}), onClick: openDialog, title: "About Prediction" }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About Prediction", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Damiano Banfi and Luc Patiny", ' ', _jsx("a", { href: "http://dx.doi.org/10.2533/chimia.2008.280", target: "_blank", rel: "noreferrer", children: "www.nmrdb.org: Resurrecting and processing NMR spectra on-line" }), ' ', _jsx("i", { children: "Chimia" }), ", ", _jsx("b", { children: "2008" }), ", 62(4), 280-281."] }), _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "1" }), "H NMR prediction is possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:"] }), _jsxs("ul", { children: [_jsxs("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', _jsx("i", { children: "J. Chem. Inf. Model." }), " ", _jsx("b", { children: "2007" }), ", 47(6), 2089-2097."] }), _jsxs("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", _jsx("i", { children: "Analytical Chemistry" }), ", ", _jsx("b", { children: "2002" }), ", 74(1), 80-90."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), _jsx("ul", { children: _jsxs("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', _jsx("a", { href: "http://dx.doi.org/10.1021/ci0341363", target: "_blank", rel: "noreferrer", children: "NMRShiftDB Constructing a Free Chemical Information System with Open-Source Components" }), ' ', _jsx("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', _jsx("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }));
43
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaInfo, {}), onClick: openDialog, title: "About prediction" }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About prediction", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Damiano Banfi and Luc Patiny", ' ', _jsx("a", { href: "http://dx.doi.org/10.2533/chimia.2008.280", target: "_blank", rel: "noreferrer", children: "www.nmrdb.org: Resurrecting and processing NMR spectra on-line" }), ' ', _jsx("i", { children: "Chimia" }), ", ", _jsx("b", { children: "2008" }), ", 62(4), 280-281."] }), _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "1" }), "H NMR prediction is possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:"] }), _jsxs("ul", { children: [_jsxs("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', _jsx("i", { children: "J. Chem. Inf. Model." }), " ", _jsx("b", { children: "2007" }), ", 47(6), 2089-2097."] }), _jsxs("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", _jsx("i", { children: "Analytical Chemistry" }), ", ", _jsx("b", { children: "2002" }), ", 74(1), 80-90."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), _jsx("ul", { children: _jsxs("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', _jsx("a", { href: "http://dx.doi.org/10.1021/ci0341363", target: "_blank", rel: "noreferrer", children: "NMRShiftDB Constructing a Free Chemical Information System with Open-Source Components" }), ' ', _jsx("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', _jsx("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }));
44
44
  }
45
45
  export default AboutPredictionModal;
@@ -40,6 +40,6 @@ const styles = css `
40
40
  `;
41
41
  function AboutSpectrumSimulationModal() {
42
42
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
43
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { onClick: openDialog, title: "About Prediction", icon: _jsx(FaInfo, {}) }) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About spectrum simulation", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsx("ul", { children: _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }));
43
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { onClick: openDialog, title: "About prediction", icon: _jsx(FaInfo, {}) }) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About spectrum simulation", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsx("ul", { children: _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }));
44
44
  }
45
45
  export default AboutSpectrumSimulationModal;
@@ -79,6 +79,6 @@ function EditPeakShapeModal({ onClose = () => null, peak, peaksPreferences, }) {
79
79
  }, [dispatch, onClose, peak.id]);
80
80
  const values = getValues(peak, kind);
81
81
  const valuePPM = formatNumber(peak.x, peaksPreferences.deltaPPM.format);
82
- return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsxs("span", { children: [`Peak Shape Edition ( ${valuePPM} PPM)`, " "] }), _jsx(CloseButton, { title: "Close", onClick: () => onClose?.(), className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: values, validationSchema: validation(kind), onSubmit: changePeakShapeHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "kind : ", style: labelStyle, children: _jsx(Select, { items: KINDS, style: { margin: 0, height: 30 }, value: kind, onChange: (kind) => setKind(kind) }) }), _jsx(Label, { title: "fwhm: ", style: labelStyle, children: _jsx(FormikInput, { name: "fwhm", style: inputStyle }) }), kind === 'pseudoVoigt' && (_jsx(Label, { title: "mu: ", style: labelStyle, children: _jsx(FormikInput, { name: "mu", style: inputStyle }) }))] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
82
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsxs("span", { children: [`Peak Shape Edition ( ${valuePPM} PPM)`, " "] }), _jsx(CloseButton, { title: "Close", onClick: () => onClose?.(), className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: values, validationSchema: validation(kind), onSubmit: changePeakShapeHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Kind:", style: labelStyle, children: _jsx(Select, { items: KINDS, style: { margin: 0, height: 30 }, value: kind, onChange: (kind) => setKind(kind) }) }), _jsx(Label, { title: "FWHM:", style: labelStyle, children: _jsx(FormikInput, { name: "fwhm", style: inputStyle }) }), kind === 'pseudoVoigt' && (_jsx(Label, { title: "Mu:", style: labelStyle, children: _jsx(FormikInput, { name: "mu", style: inputStyle }) }))] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
83
83
  }
84
84
  export default EditPeakShapeModal;
@@ -1,6 +1,8 @@
1
- interface ImportPublicationStringModalProps {
1
+ interface InnerImportPublicationStringModalProps {
2
2
  onClose: () => void;
3
+ }
4
+ interface ImportPublicationStringModalProps extends InnerImportPublicationStringModalProps {
3
5
  isOpen: boolean;
4
6
  }
5
- declare function ImportPublicationStringModal(props: ImportPublicationStringModalProps): import("react/jsx-runtime").JSX.Element | undefined;
6
- export default ImportPublicationStringModal;
7
+ export declare function ImportPublicationStringModal(props: ImportPublicationStringModalProps): import("react/jsx-runtime").JSX.Element | undefined;
8
+ export {};
@@ -29,8 +29,14 @@ function handleRowStyle(data) {
29
29
  const INITIAL_VALUES = {
30
30
  publicationText: '1H NMR (CDCl3, 400MHz) δ 10.58 (b, 1H), 7.40 (d, 1H, J = 8.0 Hz), 6.19 (d, 1H, J = 7.6 Hz), 4.88 (s, 1H), 2.17 (s, 3H), 1.02 (s, 9H), 1.01 (s, 9H), 0.89 (s, 9H)',
31
31
  };
32
- function ImportPublicationStringModal(props) {
32
+ export function ImportPublicationStringModal(props) {
33
33
  const { onClose, isOpen } = props;
34
+ if (!isOpen)
35
+ return;
36
+ return _jsx(InnerImportPublicationStringModal, { onClose: onClose });
37
+ }
38
+ function InnerImportPublicationStringModal(props) {
39
+ const { onClose } = props;
34
40
  const formRef = useRef();
35
41
  const dispatch = useDispatch();
36
42
  const toaster = useToaster();
@@ -59,8 +65,6 @@ function ImportPublicationStringModal(props) {
59
65
  const debounceChanges = useMemo(() => debounce((value) => {
60
66
  resurrect(value, { logger: loggerRef.current });
61
67
  }, 250), []);
62
- if (!isOpen)
63
- return;
64
68
  function publicationStringHandler({ publicationText }) {
65
69
  void (async () => {
66
70
  const hideLoading = toaster.showLoading({
@@ -103,4 +107,3 @@ function ImportPublicationStringModal(props) {
103
107
  padding: '15px',
104
108
  }, name: "publicationText", className: "text-area", placeholder: "Enter publication string", onChange: handleOnChange })] }), _jsx(GroupPane, { text: "Logs", children: _jsx(ReactTable, { columns: COLUMNS, data: logs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle, style: { height: '120px' } }) })] }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), disabled: isNotValid || !isValid, children: "Generate spectrum" }) }) })] })) }) }));
105
109
  }
106
- export default ImportPublicationStringModal;
@@ -62,7 +62,7 @@ export function LoadJCAMPModal({ onCloseDialog, isOpen }) {
62
62
  onCloseDialog?.();
63
63
  }
64
64
  }
65
- return (_jsxs(Dialog, { isOpen: true, onClose: onCloseDialog, title: "Load JCAMP Dialog", style: { minWidth: '400px' }, children: [_jsx(DialogBody, { css: css `
65
+ return (_jsxs(Dialog, { isOpen: true, onClose: onCloseDialog, title: "Load JCAMP", style: { minWidth: '400px' }, children: [_jsx(DialogBody, { css: css `
66
66
  background-color: white;
67
67
  `, children: _jsx(Formik, { initialValues: { url: '' }, validationSchema: loadFormValidation, onSubmit: loadJCAMPHandler, innerRef: ref, children: _jsx(Label, { title: "URL", style: labelStyle, children: _jsx(FormikError, { name: "url", style: { container: { flex: 1 } }, children: _jsx(FormikInput, { name: "url", type: "string", style: {
68
68
  input: {
@@ -107,7 +107,7 @@ export function LogsHistoryModal(props) {
107
107
  markAsRead();
108
108
  closeDialog();
109
109
  onClose?.();
110
- }, title: "Logs History", style: { width: '50vw', height: '50vh' }, children: [_jsx(DialogBody, { css: css `
110
+ }, title: "Logs history", style: { width: '50vw', height: '50vh' }, children: [_jsx(DialogBody, { css: css `
111
111
  background-color: white;
112
112
  `, children: _jsx(ReactTable, { columns: COLUMNS, data: sortedLogs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle }) }), _jsx(DialogFooter, { children: _jsx(Button.Danger, { onClick: () => logger.clear(), fill: "outline", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(FaRegTrashAlt, {}), _jsx("span", { style: { paddingLeft: '5px' }, children: "Clear Logs" })] }) }) })] })] }));
113
113
  }
@@ -74,7 +74,7 @@ const loaderStyles = css `
74
74
  }
75
75
  `;
76
76
  export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, onClose, isOpen, }) {
77
- return (_jsx(Dialog, { isOpen: isOpen, onClose: () => onClose(), title: "Analyse Multiplet", style: { width: 900, height: 400 }, children: _jsx(DialogBody, { css: styles, children: _jsx(InnerMultipleAnalysis, { data,
77
+ return (_jsx(Dialog, { isOpen: isOpen, onClose: () => onClose(), title: "Analyse multiplet", style: { width: 900, height: 400 }, children: _jsx(DialogBody, { css: styles, children: _jsx(InnerMultipleAnalysis, { data,
78
78
  activeSpectrum,
79
79
  scaleX,
80
80
  startX,
@@ -64,8 +64,8 @@ function SaveAsModal(props) {
64
64
  `, children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name: fileName }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
65
65
  inputWrapper: { width: '100%' },
66
66
  input: { padding: '5px', textAlign: 'left' },
67
- } }) }), _jsx(Label, { style: labelStyle, title: "Compressed", htmlFor: "compressed", children: _jsx(FormikCheckBox, { name: "compressed" }) }), _jsx(Label, { style: labelStyle, title: "Pretty Format", htmlFor: "pretty", children: _jsx(FormikCheckBox, { name: "pretty" }) }), _jsx(Label, { style: labelStyle, title: "Include view", htmlFor: "include.view", children: _jsx(FormikCheckBox, { name: "include.view" }) }), _jsx(Label, { style: labelStyle, title: "Include settings", htmlFor: "include.settings", children: _jsx(FormikCheckBox, { name: "include.settings" }) }), _jsx(Label, { style: labelStyle, title: "Include Data", children: _jsx("div", { css: styles, children: _jsxs("div", { children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
67
+ } }) }), _jsx(Label, { style: labelStyle, title: "Compressed", children: _jsx(FormikCheckBox, { name: "compressed" }) }), _jsx(Label, { style: labelStyle, title: "Pretty format", children: _jsx(FormikCheckBox, { name: "pretty" }) }), _jsx(Label, { style: labelStyle, title: "Include view", children: _jsx(FormikCheckBox, { name: "include.view" }) }), _jsx(Label, { style: labelStyle, title: "Include settings", children: _jsx(FormikCheckBox, { name: "include.settings" }) }), _jsx(Label, { style: labelStyle, title: "Include data", children: _jsx("div", { css: styles, children: _jsxs("div", { children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw data"] }), _jsxs("label", { style: {
68
68
  color: source ? 'black' : 'lightgray',
69
- }, children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.DATA_SOURCE, disabled: !source }), "Data Source"] }), _jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.NO_DATA }), "No Data"] })] }) }) })] }) }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onCloseDialog?.() }) })] }));
69
+ }, children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.DATA_SOURCE, disabled: !source }), "Data source"] }), _jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.NO_DATA }), "No data"] })] }) }) })] }) }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onCloseDialog?.() }) })] }));
70
70
  }
71
71
  export default SaveAsModal;
@@ -47,14 +47,14 @@ const editPathLengthsStyles = css `
47
47
  `;
48
48
  function EditPathLengthFormik({ signalIndex }) {
49
49
  const { errors, values, } = useFormikContext();
50
- return (_jsxs("div", { css: editPathLengthsStyles, children: [_jsx("p", { children: "Setting of the minimum and maximum path length (J coupling)." }), _jsxs("div", { className: "input-container", children: [_jsx(Label, { title: "Min: ", children: _jsx(FormikNumberInput, { name: `signals[${signalIndex}].j.pathLength.from`, defaultValue: values.signals[signalIndex].j?.pathLength?.from ||
50
+ return (_jsxs("div", { css: editPathLengthsStyles, children: [_jsx("p", { children: "Setting of the minimum and maximum path length (J coupling)." }), _jsxs("div", { className: "input-container", children: [_jsx(Label, { title: "Min:", children: _jsx(FormikNumberInput, { name: `signals[${signalIndex}].j.pathLength.from`, defaultValue: values.signals[signalIndex].j?.pathLength?.from ||
51
51
  DefaultPathLengths[values.experimentType]?.from ||
52
52
  1, style: {
53
53
  color: errors.signals?.[signalIndex].j?.pathLength?.from
54
54
  ? 'red'
55
55
  : 'black',
56
56
  }, min: 1, max: values.signals[signalIndex].j?.pathLength?.to ||
57
- DefaultPathLengths[values.experimentType]?.to, pattern: "[1-9]+" }) }), _jsx(Label, { title: "Max: ", children: _jsx(FormikNumberInput, { name: `signals[${signalIndex}].j.pathLength.to`, defaultValue: values.signals[signalIndex].j?.pathLength?.to ||
57
+ DefaultPathLengths[values.experimentType]?.to, pattern: "[1-9]+" }) }), _jsx(Label, { title: "Max:", children: _jsx(FormikNumberInput, { name: `signals[${signalIndex}].j.pathLength.to`, defaultValue: values.signals[signalIndex].j?.pathLength?.to ||
58
58
  DefaultPathLengths[values.experimentType]?.to ||
59
59
  1, style: {
60
60
  color: errors.signals?.[signalIndex].j?.pathLength?.to
@@ -96,6 +96,6 @@ function EditZoneModal({ onSaveEditZoneModal = () => null, onCloseEditZoneModal
96
96
  }),
97
97
  };
98
98
  }, [rowData.signals, rowData.tableMetaInfo.experiment]);
99
- return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), title: "Save and Exit" }), _jsx(CloseButton, { title: "Close", onClick: handleOnClose })] }), _jsx(SignalsForm, {})] }) }) }));
99
+ return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), title: "Save and exit" }), _jsx(CloseButton, { title: "Close", onClick: handleOnClose })] }), _jsx(SignalsForm, {})] }) }) }));
100
100
  }
101
101
  export default EditZoneModal;
@@ -66,7 +66,7 @@ export function MetaImportationModal(props) {
66
66
  const { isOpen, onCloseDialog, file } = props;
67
67
  if (!isOpen)
68
68
  return null;
69
- return (_jsx(Dialog, { isOpen: true, title: "Import Meta Information", style: { width: 900, height: 600 }, onClose: onCloseDialog, children: _jsx(InnerMetaImportationModal, { onCloseDialog, file }) }));
69
+ return (_jsx(Dialog, { isOpen: true, title: "Import meta information", style: { width: 900, height: 600 }, onClose: onCloseDialog, children: _jsx(InnerMetaImportationModal, { onCloseDialog, file }) }));
70
70
  }
71
71
  function InnerMetaImportationModal({ file, onCloseDialog, }) {
72
72
  const toaster = useToaster();
@@ -204,7 +204,7 @@ function GeneralSettingsModal({ height }) {
204
204
  function handlePastWorkspaceAction() {
205
205
  void readText().then(handlePastWorkspace);
206
206
  }
207
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General Settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
207
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
208
208
  cursor: 'default',
209
209
  paddingTop: '10px',
210
210
  boxShadow: 'none',
@@ -218,7 +218,7 @@ function GeneralSettingsModal({ height }) {
218
218
  }, children: _jsx(FaPaste, {}) })] }) }), _jsx(DialogBody, { css: css `
219
219
  padding: 0;
220
220
  background-color: white;
221
- `, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { title: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { title: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { title: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { title: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { title: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), _jsx(Tab, { title: "Import filters", tabid: "importation-filters", children: _jsx("div", { className: "inner-content", children: _jsx(ImportationFiltersTabContent, {}) }) }), _jsx(Tab, { title: "Title Block", tabid: "title-block", children: _jsx("div", { className: "inner-content", children: _jsx(InfoBlockTabContent, {}) }) }), _jsx(Tab, { title: "On Load Processing", tabid: "on-load-processing", children: _jsx("div", { className: "inner-content", children: _jsx(OnLoadProcessingTabContent, {}) }) }), _jsx(Tab, { title: "Spectra colors", tabid: "spectra-colors", children: _jsx("div", { className: "inner-content", children: _jsx(SpectraColorsTabContent, {}) }) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
221
+ `, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { title: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { title: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { title: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { title: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { title: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), _jsx(Tab, { title: "Import filters", tabid: "importation-filters", children: _jsx("div", { className: "inner-content", children: _jsx(ImportationFiltersTabContent, {}) }) }), _jsx(Tab, { title: "Title block", tabid: "title-block", children: _jsx("div", { className: "inner-content", children: _jsx(InfoBlockTabContent, {}) }) }), _jsx(Tab, { title: "Auto processing", tabid: "on-load-processing", children: _jsx("div", { className: "inner-content", children: _jsx(OnLoadProcessingTabContent, {}) }) }), _jsx(Tab, { title: "Spectra colors", tabid: "spectra-colors", children: _jsx("div", { className: "inner-content", children: _jsx(SpectraColorsTabContent, {}) }) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
222
222
  closeDialog?.();
223
223
  } }), _jsx(Button.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), _jsx(SaveSettingsModal, {}), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePastWorkspace, text: text, label: "Workspace" })] }));
224
224
  }
@@ -33,6 +33,6 @@ const LOGS_LEVELS = Object.keys(LOGGER_LEVELS).map((level) => ({
33
33
  value: level,
34
34
  }));
35
35
  function GeneralTabContent() {
36
- return (_jsxs(_Fragment, { children: [_jsxs(GroupPane, { text: "General", children: [_jsx(Label, { title: "Opacity of dimmed spectra [ 0 - 1 ]", style: labelStyle, children: _jsx(FormikInput, { name: "general.dimmedSpectraOpacity", checkValue: (value) => Number(value) >= 0 && Number(value) <= 1, type: "number", step: 0.1, min: 0, max: 1, style: { inputWrapper: { width: 60 } } }) }), _jsx(Label, { title: "Invert actions", htmlFor: "general.invert", style: labelStyle, children: _jsx(FormikCheckBox, { name: "general.invert", style: { container: { justifyContent: 'flex-start' } } }) })] }), _jsx(GroupPane, { text: "Experimental features", children: _jsx(Label, { title: "Enable experimental features", htmlFor: "display.general.experimentalFeatures.display", style: labelStyle, children: _jsx(FormikCheckBox, { name: "display.general.experimentalFeatures.display", style: { container: { justifyContent: 'flex-start' } } }) }) }), _jsx(GroupPane, { text: "Rendering", children: _jsx(Label, { title: "Spectra rendering ", style: labelStyle, children: _jsx(FormikSelect, { items: SHAPE_RENDERING, name: "general.spectraRendering", style: { width: '150px' } }) }) }), _jsxs(GroupPane, { text: "Logging settings", children: [_jsx(Label, { title: "Level ", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.loggingLevel", style: { width: '100px' } }) }), _jsx(Label, { title: "Popup logging level ", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.popupLoggingLevel", style: { width: '100px' } }) })] })] }));
36
+ return (_jsxs(_Fragment, { children: [_jsxs(GroupPane, { text: "General", children: [_jsx(Label, { title: "Opacity of dimmed spectra [0 - 1]", style: labelStyle, children: _jsx(FormikInput, { name: "general.dimmedSpectraOpacity", checkValue: (value) => Number(value) >= 0 && Number(value) <= 1, type: "number", step: 0.1, min: 0, max: 1, style: { inputWrapper: { width: 60 } } }) }), _jsx(Label, { title: "Invert actions", style: labelStyle, children: _jsx(FormikCheckBox, { name: "general.invert", style: { container: { justifyContent: 'flex-start' } } }) })] }), _jsx(GroupPane, { text: "Experimental features", children: _jsx(Label, { title: "Enable experimental features", style: labelStyle, children: _jsx(FormikCheckBox, { name: "display.general.experimentalFeatures.display", style: { container: { justifyContent: 'flex-start' } } }) }) }), _jsx(GroupPane, { text: "Rendering", children: _jsx(Label, { title: "Spectra rendering", style: labelStyle, children: _jsx(FormikSelect, { items: SHAPE_RENDERING, name: "general.spectraRendering", style: { width: '150px' } }) }) }), _jsxs(GroupPane, { text: "Logging settings", children: [_jsx(Label, { title: "Level", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.loggingLevel", style: { width: '100px' } }) }), _jsx(Label, { title: "Popup logging level", style: labelStyle, children: _jsx(FormikSelect, { items: LOGS_LEVELS, name: "general.popupLoggingLevel", style: { width: '100px' } }) })] })] }));
37
37
  }
38
38
  export default GeneralTabContent;