nmrium 0.49.0 → 0.50.1

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 (121) hide show
  1. package/README.md +7 -7
  2. package/lib/component/1d/Chart1D.js +3 -1
  3. package/lib/component/1d/LinesSeries.js +1 -1
  4. package/lib/component/1d/SimilarityTree.d.ts +1 -0
  5. package/lib/component/1d/SimilarityTree.js +60 -0
  6. package/lib/component/1d/Viewer1D.js +9 -11
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -7
  8. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +114 -125
  9. package/lib/component/1d/multiplicityTree/MultiplicityTrees.d.ts +1 -0
  10. package/lib/component/1d/multiplicityTree/MultiplicityTrees.js +23 -0
  11. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +18 -0
  12. package/lib/component/1d/multiplicityTree/generateTreeNodes.js +66 -0
  13. package/lib/component/1d/ranges/Range.d.ts +1 -1
  14. package/lib/component/1d/ranges/Range.js +8 -9
  15. package/lib/component/elements/CloseButton.d.ts +2 -10
  16. package/lib/component/elements/CloseButton.js +3 -20
  17. package/lib/component/elements/CounterLabel.d.ts +3 -3
  18. package/lib/component/elements/CounterLabel.js +3 -4
  19. package/lib/component/elements/PreferencesButton.d.ts +2 -4
  20. package/lib/component/elements/PreferencesButton.js +3 -3
  21. package/lib/component/elements/ReactTable/ReactTable.js +5 -2
  22. package/lib/component/elements/SaveButton.d.ts +2 -11
  23. package/lib/component/elements/SaveButton.js +4 -19
  24. package/lib/component/elements/ToolBarButton.d.ts +2 -0
  25. package/lib/component/elements/ToolBarButton.js +5 -0
  26. package/lib/component/elements/ToolbarPopoverItem.d.ts +11 -0
  27. package/lib/component/elements/ToolbarPopoverItem.js +10 -0
  28. package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +2 -1
  29. package/lib/component/elements/popup/Modal/ConfirmDialog.js +11 -8
  30. package/lib/component/hooks/useSaveSettings.js +3 -2
  31. package/lib/component/main/InnerNMRiumContents.js +1 -1
  32. package/lib/component/modal/AboutPredictionModal.js +4 -8
  33. package/lib/component/modal/AboutSpectrumSimulationModal.js +4 -8
  34. package/lib/component/modal/CopyClipboardModal.js +2 -2
  35. package/lib/component/modal/EditPeakShapeModal.js +2 -2
  36. package/lib/component/modal/ExportAsJcampModal.d.ts +1 -1
  37. package/lib/component/modal/ExportAsJcampModal.js +7 -3
  38. package/lib/component/modal/ImportPublicationStringModal.js +15 -11
  39. package/lib/component/modal/LoadJCAMPModal.js +12 -9
  40. package/lib/component/modal/LogsHistoryModal.d.ts +1 -1
  41. package/lib/component/modal/LogsHistoryModal.js +9 -4
  42. package/lib/component/modal/MoleculeStructureEditorModal.js +10 -3
  43. package/lib/component/modal/MultipletAnalysisModal.js +8 -8
  44. package/lib/component/modal/PredictSpectraModal.js +6 -5
  45. package/lib/component/modal/SaveAsModal.js +2 -2
  46. package/lib/component/modal/aboutUs/AboutUsModal.js +11 -26
  47. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +4 -3
  48. package/lib/component/modal/changeSum/ChangeSumModal.js +10 -3
  49. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +1 -3
  50. package/lib/component/modal/changeSum/ChangeSumModalContents.js +9 -6
  51. package/lib/component/modal/editRange/EditRangeModal.js +8 -6
  52. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -0
  53. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +13 -10
  54. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  55. package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -0
  56. package/lib/component/modal/editZone/EditZoneModal.js +3 -3
  57. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -2
  58. package/lib/component/modal/setting/GeneralSettings.js +17 -38
  59. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +2 -4
  60. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +16 -2
  61. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +22 -25
  62. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +16 -3
  63. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +5 -5
  64. package/lib/component/panels/PeaksPanel/PeaksPanel.js +43 -13
  65. package/lib/component/panels/RangesPanel/RangesHeader.d.ts +1 -1
  66. package/lib/component/panels/RangesPanel/RangesHeader.js +71 -34
  67. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +46 -5
  68. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +40 -9
  69. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +2 -2
  70. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +2 -2
  71. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  72. package/lib/component/panels/SummaryPanel/SummaryPanel.js +30 -19
  73. package/lib/component/panels/ZonesPanel/ZonesPanel.js +28 -28
  74. package/lib/component/panels/databasePanel/DatabasePanel.js +6 -6
  75. package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +4 -6
  76. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +13 -14
  77. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +7 -8
  78. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
  79. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  80. package/lib/component/panels/header/DefaultPanelHeader.d.ts +10 -6
  81. package/lib/component/panels/header/DefaultPanelHeader.js +30 -9
  82. package/lib/component/panels/header/PanelHeader.js +0 -1
  83. package/lib/component/panels/header/PreferencesHeader.d.ts +2 -4
  84. package/lib/component/panels/header/PreferencesHeader.js +9 -23
  85. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -2
  86. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +39 -10
  87. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +5 -1
  88. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +3 -3
  89. package/lib/component/reducer/Reducer.js +3 -0
  90. package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
  91. package/lib/component/reducer/actions/DatabaseActions.js +5 -1
  92. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  93. package/lib/component/toolbar/ToolBar.js +237 -9
  94. package/lib/component/toolbar/toolbarMenu.d.ts +4 -0
  95. package/lib/component/toolbar/toolbarMenu.js +77 -0
  96. package/lib/component/utility/booleanToString.d.ts +6 -0
  97. package/lib/component/utility/booleanToString.js +4 -0
  98. package/lib/utils/clipboard/clipboardComponents.d.ts +2 -2
  99. package/lib/utils/clipboard/clipboardComponents.js +8 -3
  100. package/lib/versionInfo.js +1 -1
  101. package/package.json +17 -16
  102. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +0 -8
  103. package/lib/component/1d/multiplicityTree/LevelNode.js +0 -8
  104. package/lib/component/1d/multiplicityTree/StringNode.d.ts +0 -11
  105. package/lib/component/1d/multiplicityTree/StringNode.js +0 -7
  106. package/lib/component/1d/multiplicityTree/TreeColors.d.ts +0 -1
  107. package/lib/component/1d/multiplicityTree/TreeColors.js +0 -1
  108. package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +0 -21
  109. package/lib/component/1d/multiplicityTree/TreeNodes.js +0 -23
  110. package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +0 -11
  111. package/lib/component/1d/multiplicityTree/buildTreeNode.js +0 -57
  112. package/lib/component/elements/DeleteButton.d.ts +0 -8
  113. package/lib/component/elements/DeleteButton.js +0 -6
  114. package/lib/component/elements/DropdownMenu.d.ts +0 -9
  115. package/lib/component/elements/DropdownMenu.js +0 -7
  116. package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +0 -10
  117. package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +0 -10
  118. package/lib/component/toolbar/BasicToolBar.d.ts +0 -1
  119. package/lib/component/toolbar/BasicToolBar.js +0 -165
  120. package/lib/component/toolbar/FunctionToolBar.d.ts +0 -3
  121. package/lib/component/toolbar/FunctionToolBar.js +0 -148
@@ -1,13 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { xGetFromToIndex, xyToXYObject } from 'ml-spectra-processing';
5
6
  import { analyseMultiplet } from 'multiplet-analysis';
6
7
  import { useState, useEffect } from 'react';
7
8
  import { Plot, LineSeries, Axis } from 'react-plot';
8
- import { Modal } from 'react-science/ui';
9
9
  import { isSpectrum2D } from '../../data/data2d/Spectrum2D';
10
10
  const styles = css `
11
+ background-color: white;
12
+
11
13
  button:focus {
12
14
  outline: none;
13
15
  }
@@ -49,8 +51,6 @@ const loaderStyles = css `
49
51
  justify-content: center;
50
52
  flex-direction: column;
51
53
  user-select: none;
52
- width: 900px;
53
- height: 400px;
54
54
 
55
55
  svg {
56
56
  animation-name: spin-animation;
@@ -74,11 +74,11 @@ const loaderStyles = css `
74
74
  }
75
75
  `;
76
76
  export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, onClose, isOpen, }) {
77
- return (_jsx(Modal, { hasCloseButton: true, isOpen: isOpen, onRequestClose: onClose, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Analyse Multiplet" }) }) }), _jsx(Modal.Body, { children: _jsx(InnerMultipleAnalysis, { data,
78
- activeSpectrum,
79
- scaleX,
80
- startX,
81
- endX }) })] }) }));
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
+ activeSpectrum,
79
+ scaleX,
80
+ startX,
81
+ endX }) }) }));
82
82
  }
83
83
  function InnerMultipleAnalysis(props) {
84
84
  const [calcStart, setCalcStartStatus] = useState(false);
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
- import { Checkbox } from '@blueprintjs/core';
3
+ import { Checkbox, Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
4
4
  import { css } from '@emotion/react';
5
5
  import { SvgNmrFt } from 'cheminfo-font';
6
6
  import { useCallback, useRef, useState, useMemo } from 'react';
7
- import { Modal, useOnOff } from 'react-science/ui';
7
+ import { Toolbar, useOnOff } from 'react-science/ui';
8
8
  import { getDefaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
9
9
  import { useChartData } from '../context/ChartContext';
10
10
  import { useDispatch } from '../context/DispatchContext';
@@ -13,8 +13,9 @@ import Button from '../elements/Button';
13
13
  import { useAlert } from '../elements/popup/Alert';
14
14
  import PredictionPreferences from '../panels/predictionPanel/PredictionOptionsPanel';
15
15
  import { useStateWithLocalStorage } from '../utility/LocalStorage';
16
- import { ModalStyles } from './ModalStyle';
17
16
  const styles = css `
17
+ background-color: white;
18
+
18
19
  .inner-content {
19
20
  flex: 1;
20
21
  }
@@ -104,9 +105,9 @@ export function PredictSpectraModal({ onClose = () => null, molecule, }) {
104
105
  setPredictionPreferences,
105
106
  closeDialog,
106
107
  ]);
107
- return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: openDialog, toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: _jsx(SvgNmrFt, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
108
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { icon: _jsx(SvgNmrFt, {}), title: "Predict spectra", onClick: openDialog }) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: () => {
108
109
  onClose();
109
110
  closeDialog();
110
- }, width: 600, maxWidth: 1000, children: _jsxs("div", { css: [ModalStyles, styles], children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Prediction of NMR spectrum" }) }) }), _jsxs("div", { className: "inner-content", children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: (value) => setApproved(value.target.checked), checked: isApproved, label: "I confirm that the chemical structure is not confidential." }) })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }) })] }));
111
+ }, style: { width: 600, maxWidth: 1000 }, title: "Prediction of NMR spectrum", children: [_jsxs(DialogBody, { css: styles, children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: (value) => setApproved(value.target.checked), checked: isApproved, label: "I confirm that the chemical structure is not confidential." }) })] }), _jsx(DialogFooter, { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] })] }));
111
112
  }
112
113
  export default PredictSpectraModal;
@@ -6,7 +6,7 @@ import { useCallback, useRef } from 'react';
6
6
  import { DataExportOptions } from '../../data/SpectraManager';
7
7
  import { useChartData } from '../context/ChartContext';
8
8
  import ActionButtons from '../elements/ActionButtons';
9
- import CloseButton from '../elements/CloseButton';
9
+ import { CloseButton } from '../elements/CloseButton';
10
10
  import Label from '../elements/Label';
11
11
  import FormikCheckBox from '../elements/formik/FormikCheckBox';
12
12
  import FormikInput from '../elements/formik/FormikInput';
@@ -61,7 +61,7 @@ function SaveAsModal({ onClose, onSave, name }) {
61
61
  onSave(values);
62
62
  onClose?.();
63
63
  }, [onClose, onSave]);
64
- return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
64
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { title: "Close", onClick: () => onClose?.(), className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, 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
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", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { className: "data-export-group", children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
@@ -1,14 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { SvgLogoNmrium } from 'cheminfo-font';
5
- import { Modal, Toolbar, useOnOff } from 'react-science/ui';
6
+ import { Toolbar, useOnOff } from 'react-science/ui';
6
7
  import versionInfo from '../../../versionInfo';
7
8
  import Logo from '../../elements/Logo';
8
9
  import AboutUsZakodium from './AboutUsZakodium';
9
10
  const styles = css `
10
- width: 40vw;
11
- min-width: 500px;
11
+ display: flex;
12
+ flex-direction: column;
13
+ user-select: none;
14
+ background-color: white;
12
15
 
13
16
  button:focus {
14
17
  outline: none;
@@ -64,32 +67,14 @@ const styles = css `
64
67
  height: 1px;
65
68
  margin: 10px 0;
66
69
  }
67
-
68
- .header {
69
- span {
70
- color: #464646;
71
- font-size: 15px;
72
- flex: 1;
73
- user-select: none;
74
- }
75
-
76
- button {
77
- background-color: transparent;
78
- border: none;
79
-
80
- svg {
81
- height: 16px;
82
- }
83
- }
84
- }
85
-
86
- display: flex;
87
- flex-direction: column;
88
- user-select: none;
89
70
  `;
90
71
  function AboutUsModal() {
91
72
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
92
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", title: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About NMRium" }) }) }), _jsxs("div", { className: "container", children: [_jsxs("div", { className: "center-container", children: [_jsx(Logo, { width: 160, height: 50 }), "Version ", _jsx(VersionInfo, {}), _jsx("span", { className: "separator" }), _jsx("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), _jsx("div", { className: "center-container", children: _jsx("span", { className: "separator" }) }), _jsx("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), _jsxs("div", { className: "center-container", children: [_jsx("span", { className: "separator" }), _jsx("span", { className: "title", children: "Funding is provided by" }), _jsx("span", { className: "separator" })] }), _jsx("div", { className: "content", children: _jsxs("ul", { children: [_jsx("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), _jsx("li", { children: _jsx(AboutUsZakodium, {}) }), _jsx("li", { children: "Universidad del Valle (Cali, Colombia)." })] }) })] })] }) })] }));
73
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", title: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: {
74
+ maxWidth: 1000,
75
+ width: '40vw',
76
+ minWidth: '500px',
77
+ }, title: "About NMRium", children: _jsx(DialogBody, { css: styles, children: _jsxs("div", { className: "container", children: [_jsxs("div", { className: "center-container", children: [_jsx(Logo, { width: 160, height: 50 }), "Version ", _jsx(VersionInfo, {}), _jsx("span", { className: "separator" }), _jsx("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), _jsx("div", { className: "center-container", children: _jsx("span", { className: "separator" }) }), _jsx("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), _jsxs("div", { className: "center-container", children: [_jsx("span", { className: "separator" }), _jsx("span", { className: "title", children: "Funding is provided by" }), _jsx("span", { className: "separator" })] }), _jsx("div", { className: "content", children: _jsxs("ul", { children: [_jsx("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), _jsx("li", { children: _jsx(AboutUsZakodium, {}) }), _jsx("li", { children: "Universidad del Valle (Cali, Colombia)." }), _jsx("li", { children: "This project has received funding from the European Union\u2019s Horizon 2020 research and innovation programme under grant agreement No 957189. The project is part of BATTERY 2030+, the large-scale European research initiative for inventing the sustainable batteries of the future." })] }) }), _jsx("span", { className: "separator" })] }) }) })] }));
93
78
  }
94
79
  export default AboutUsModal;
95
80
  function VersionInfo() {
@@ -1,6 +1,7 @@
1
- import { ReactNode } from 'react';
2
1
  import { ChangeSumModalContentsProps } from './ChangeSumModalContents';
3
2
  export interface ChangeSumModalProps extends Omit<ChangeSumModalContentsProps, 'onClose'> {
4
- renderButton: (onClick: () => void) => ReactNode;
3
+ currentSum: number | null;
4
+ sumType: string;
5
+ disabled?: boolean;
5
6
  }
6
- export default function ChangeSumModal({ renderButton, ...otherProps }: ChangeSumModalProps): import("react/jsx-runtime").JSX.Element;
7
+ export default function ChangeSumModal(props: ChangeSumModalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,14 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Modal, useOnOff } from 'react-science/ui';
2
+ import { Dialog } from '@blueprintjs/core';
3
+ import { SvgNmrSum } from 'cheminfo-font';
4
+ import { Toolbar, useOnOff } from 'react-science/ui';
3
5
  import { ChangeSumModalContents, } from './ChangeSumModalContents';
4
- export default function ChangeSumModal({ renderButton, ...otherProps }) {
6
+ export default function ChangeSumModal(props) {
7
+ const { disabled = false, currentSum, sumType, ...otherProps } = props;
5
8
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
6
- return (_jsxs(_Fragment, { children: [renderButton(openDialog), _jsx(Modal, { isOpen: isOpenDialog, onRequestClose: closeDialog, width: 500, height: 400, children: _jsx(ChangeSumModalContents, { ...otherProps, onClose: closeDialog }) })] }));
9
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { disabled: disabled, icon: _jsx(SvgNmrSum, {}), title: currentSum
10
+ ? `Change ${sumType} sum (${currentSum.toFixed(2)})`
11
+ : `Change ${sumType} sum`, onClick: openDialog }), isOpenDialog && (_jsx(Dialog, { isOpen: true, onClose: closeDialog, style: { width: 500, height: 400 }, title: currentSum
12
+ ? `Set new ${sumType} sum (Current: ${currentSum.toFixed(2)})`
13
+ : `Set new ${sumType} Sum`, children: _jsx(ChangeSumModalContents, { ...otherProps, onClose: closeDialog }) }))] }));
7
14
  }
@@ -8,11 +8,9 @@ type SaveInput = {
8
8
  sumAuto: true;
9
9
  };
10
10
  export interface ChangeSumModalContentsProps {
11
- currentSum: number | null;
12
- sumType: string;
13
11
  sumOptions: SumOptions;
14
12
  onSave: (saveInput: SaveInput) => void;
15
13
  onClose: () => void;
16
14
  }
17
- export declare function ChangeSumModalContents(props: ChangeSumModalContentsProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function ChangeSumModalContents(props: ChangeSumModalContentsProps): import("@emotion/react/jsx-runtime").JSX.Element;
18
16
  export {};
@@ -1,8 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { DialogBody, DialogFooter } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
2
5
  import styled from '@emotion/styled';
3
6
  import { Formik } from 'formik';
4
7
  import { useEffect, useRef, useState } from 'react';
5
- import { Modal } from 'react-science/ui';
6
8
  import * as Yup from 'yup';
7
9
  import { usePreferences } from '../../context/PreferencesContext';
8
10
  import Button from '../../elements/Button';
@@ -41,7 +43,7 @@ const ManualContainer = styled.div `
41
43
  }
42
44
  `;
43
45
  export function ChangeSumModalContents(props) {
44
- const { currentSum, sumType, sumOptions, onSave, onClose } = props;
46
+ const { sumOptions, onSave, onClose } = props;
45
47
  const { current: { display: { panels }, }, } = usePreferences();
46
48
  const [setOption, setActiveOption] = useState('auto');
47
49
  const formRef = useRef(null);
@@ -88,7 +90,8 @@ export function ChangeSumModalContents(props) {
88
90
  onClose();
89
91
  }
90
92
  const isStructurePanelVisible = panels?.structuresPanel?.display || false;
91
- return (_jsxs(_Fragment, { children: [_jsx(Modal.Header, { children: currentSum
92
- ? `Set new ${sumType} sum (Current: ${currentSum.toFixed(2)})`
93
- : `Set new ${sumType} Sum` }), _jsx(Modal.Body, { children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: "auto", children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: "manual", children: _jsx(ManualContainer, { children: _jsx(FormikInput, { name: "sum", type: "number", placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx(Modal.Footer, { children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), style: { width: 80 }, children: "Set" }) })] }));
93
+ return (_jsxs(_Fragment, { children: [_jsx(DialogBody, { css: css `
94
+ padding: 0;
95
+ background-color: white;
96
+ `, children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: "auto", children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: "manual", children: _jsx(ManualContainer, { children: _jsx(FormikInput, { name: "sum", type: "number", placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx(DialogFooter, { children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), style: { width: 80 }, children: "Set" }) })] }));
94
97
  }
@@ -9,8 +9,8 @@ import { FaSearchPlus } from 'react-icons/fa';
9
9
  import { useChartData } from '../../context/ChartContext';
10
10
  import { useDispatch } from '../../context/DispatchContext';
11
11
  import Button from '../../elements/Button';
12
- import CloseButton from '../../elements/CloseButton';
13
- import SaveButton from '../../elements/SaveButton';
12
+ import { CloseButton } from '../../elements/CloseButton';
13
+ import { SaveButton } from '../../elements/SaveButton';
14
14
  import FormikOnChange from '../../elements/formik/FormikOnChange';
15
15
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
16
16
  import useSpectrum from '../../hooks/useSpectrum';
@@ -19,8 +19,7 @@ import { formatNumber } from '../../utility/formatNumber';
19
19
  import SignalsForm from './forms/components/SignalsForm';
20
20
  import editRangeFormValidation from './forms/validation/EditRangeValidation';
21
21
  const styles = css `
22
- width: 600px;
23
- height: 500px;
22
+ min-height: 500px;
24
23
  padding: 5px;
25
24
 
26
25
  button:focus {
@@ -28,7 +27,6 @@ const styles = css `
28
27
  }
29
28
 
30
29
  .header {
31
- height: 24px;
32
30
  border-bottom: 1px solid #f0f0f0;
33
31
  display: flex;
34
32
  align-items: center;
@@ -51,6 +49,10 @@ const styles = css `
51
49
  }
52
50
  }
53
51
  }
52
+
53
+ .tabs .tab-list {
54
+ overflow-x: auto;
55
+ }
54
56
  `;
55
57
  function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
56
58
  const formRef = useRef(null);
@@ -152,7 +154,7 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
152
154
  if (!rangesPreferences || !range) {
153
155
  return;
154
156
  }
155
- return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and Exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsForm, { range: range, preferences: rangesPreferences }), _jsx(FormikOnChange, { onChange: changeHandler })] }) })] }));
157
+ return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), title: "Save and Exit" }), _jsx(CloseButton, { title: "Close", onClick: handleOnClose })] }), _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsForm, { range: range, preferences: rangesPreferences }), _jsx(FormikOnChange, { onChange: changeHandler })] }) })] }));
156
158
  }
157
159
  function useRange(rangeId) {
158
160
  const { ranges } = useSpectrum({
@@ -71,6 +71,7 @@ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
71
71
  input: {
72
72
  width: '250px',
73
73
  height: '30px',
74
+ padding: '0.25rem 0.5rem',
74
75
  },
75
76
  }, checkErrorAfterInputTouched: false }), _jsx(Button.Done, { style: {
76
77
  marginLeft: '5px',
@@ -43,18 +43,21 @@ function CouplingsTable({ push, remove, onFocus, onBlur, }) {
43
43
  }
44
44
  }, [setFieldValue]);
45
45
  const couplingsList = lodashGet(values, `signals[${values.activeTab}].js`, []);
46
- return (_jsxs("div", { children: [_jsxs(Button.Done, { fill: "outline", style: { marginBottom: '10px' }, onClick: () => push({
46
+ return (_jsxs("div", { children: [_jsxs(Button.Done, { fill: "outline", style: { overflow: 'auto' }, onClick: () => push({
47
47
  multiplicity: translateMultiplet('m'),
48
48
  coupling: '',
49
- }), children: [_jsx(FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), _jsx("table", { css: CouplingsTableStyle, children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("th", { children: "#" }), _jsx("th", { children: "Multiplicity" }), _jsx("th", { children: "J (Hz)" }), _jsx("th", { children: '' })] }), couplingsList.map((_coupling, i) => (_jsxs("tr", { children: [_jsx("td", { children: i + 1 }), _jsx("td", { children: _jsx(FormikSelect, { className: "select-box", name: `signals.${values.activeTab}.js.${i}.multiplicity`, items: Multiplets, itemValueField: "label", onChange: (value) => {
50
- multiplicityChangeHandler(value, `signals.${values.activeTab}.js.${i}.coupling`);
51
- } }) }), _jsx("td", { children: _jsx(FormikInput, { name: `signals.${values.activeTab}.js.${i}.coupling`, type: "number", placeholder: 'J (Hz)', disabled: !hasCouplingConstant(_coupling.multiplicity), onFocus: onFocus, onBlur: onBlur, style: {
52
- input: {
53
- width: '100%',
49
+ }), children: [_jsx(FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), _jsx("div", { style: { maxHeight: '300px', overflow: 'auto' }, children: _jsxs("table", { css: CouplingsTableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "#" }), _jsx("th", { children: "Multiplicity" }), _jsx("th", { children: "J (Hz)" }), _jsx("th", { children: '' })] }) }), _jsx("tbody", { style: { overflow: 'auto' }, children: couplingsList.map((_coupling, i) => (_jsxs("tr", { children: [_jsx("td", { children: i + 1 }), _jsx("td", { children: _jsx(FormikSelect, { className: "select-box", name: `signals.${values.activeTab}.js.${i}.multiplicity`, items: Multiplets, itemValueField: "label", onChange: (value) => {
50
+ multiplicityChangeHandler(value, `signals.${values.activeTab}.js.${i}.coupling`);
51
+ }, style: {
54
52
  height: '26px',
55
- },
56
- }, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx("div", { style: { display: 'flex' }, children: _jsx(Button.Danger, { fill: "clear", onClick: () => {
57
- remove(i);
58
- }, children: _jsx(FaRegTrashAlt, { title: "Delete coupling" }) }) }) })] }, `editCouplings${values.activeTab}${i}`)))] }) })] }));
53
+ } }) }), _jsx("td", { children: _jsx(FormikInput, { name: `signals.${values.activeTab}.js.${i}.coupling`, type: "number", placeholder: 'J (Hz)', disabled: !hasCouplingConstant(_coupling.multiplicity), onFocus: onFocus, onBlur: onBlur, style: {
54
+ input: {
55
+ width: '100%',
56
+ height: '26px',
57
+ padding: '0.25rem 0.5rem',
58
+ },
59
+ }, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx("div", { style: { display: 'flex' }, children: _jsx(Button.Danger, { fill: "clear", onClick: () => {
60
+ remove(i);
61
+ }, children: _jsx(FaRegTrashAlt, { title: "Delete coupling" }) }) }) })] }, `editCouplings${values.activeTab}${i}`))) })] }) })] }));
59
62
  }
60
63
  export default memo(CouplingsTable);
@@ -13,6 +13,6 @@ const style = {
13
13
  };
14
14
  function SignalFormTab({ onFocus, onBlur }) {
15
15
  const { values } = useFormikContext();
16
- return (_jsx("div", { style: style, children: _jsx(FieldArray, { name: `signals.${values.activeTab}.js`, render: ({ push, remove }) => (_jsx("div", { children: _jsx(CouplingsTable, { push: push, remove: remove, onFocus: onFocus, onBlur: onBlur }) })) }) }));
16
+ return (_jsx("div", { style: style, children: _jsx(FieldArray, { name: `signals.${values.activeTab}.js`, render: ({ push, remove }) => (_jsx(CouplingsTable, { push: push, remove: remove, onFocus: onFocus, onBlur: onBlur })) }) }));
17
17
  }
18
18
  export default memo(SignalFormTab);
@@ -105,6 +105,7 @@ function SignalsForm({ range, preferences }) {
105
105
  padding: '0 1.5rem',
106
106
  fontSize: '12px',
107
107
  color: '#28ba62',
108
+ textWrap: 'nowrap',
108
109
  }, children: [_jsx(FaPlus, { style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block' }, children: "New Signal" })] })), children: _jsx(AddSignalFormTab, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef, preferences: preferences }) }, "addSignalTab"));
109
110
  return [...signalTabs, addSignalTab];
110
111
  }, [handleOnFocus, preferences, range, tabContainsErrors, values.signals]);
@@ -6,8 +6,8 @@ import { useCallback, useEffect, useMemo, useRef } from 'react';
6
6
  import { FaSearchPlus } from 'react-icons/fa';
7
7
  import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
8
8
  import Button from '../../elements/Button';
9
- import CloseButton from '../../elements/CloseButton';
10
- import SaveButton from '../../elements/SaveButton';
9
+ import { CloseButton } from '../../elements/CloseButton';
10
+ import { SaveButton } from '../../elements/SaveButton';
11
11
  import SignalsForm from './SignalsForm';
12
12
  import zoneFormValidation from './validation/EditZoneValidation';
13
13
  import isDefaultPathLength from './validation/isDefaultPathLength';
@@ -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(), popupTitle: "Save and Exit" }), _jsx(CloseButton, { 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;
@@ -8,7 +8,7 @@ import { isMetaFile, linkMetaWithSpectra, parseMetaFile, TargetPathError, mapErr
8
8
  import { useChartData } from '../../context/ChartContext';
9
9
  import { useDispatch } from '../../context/DispatchContext';
10
10
  import Button from '../../elements/Button';
11
- import CloseButton from '../../elements/CloseButton';
11
+ import { CloseButton } from '../../elements/CloseButton';
12
12
  import Label from '../../elements/Label';
13
13
  import ReactTable from '../../elements/ReactTable/ReactTable';
14
14
  import FormikInput from '../../elements/formik/FormikInput';
@@ -168,7 +168,7 @@ function MetaImportationModal({ onClose, file }) {
168
168
  });
169
169
  onClose?.();
170
170
  }
171
- return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, emptyDescription: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
171
+ return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { title: "Close", onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, emptyDescription: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
172
172
  source: null,
173
173
  target: '',
174
174
  }, onSubmit: handleLinkSpectra, validationSchema: validationSchema, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Source field", style: { label: { width: '100px' } }, children: _jsx(FormikSelect, { name: "source", items: mapColumnToSelectItems(parseResult?.meta.fields || []), style: {
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody, DialogFooter, Classes } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { Formik } from 'formik';
5
6
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
7
  import { FaBolt, FaPaste, FaRegCopy, FaWrench } from 'react-icons/fa';
7
- import { Modal, Toolbar, useOnOff } from 'react-science/ui';
8
+ import { Toolbar, useOnOff } from 'react-science/ui';
8
9
  import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
9
10
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
10
11
  import { usePreferences, useWorkspacesList, } from '../../context/PreferencesContext';
@@ -30,16 +31,6 @@ import SpectraColorsTabContent from './settings-tabs/SpectraColorsTabContent';
30
31
  import ToolsTabContent from './settings-tabs/ToolsTabContent';
31
32
  import { validation } from './settingsValidation';
32
33
  const styles = css `
33
- width: 50vw;
34
- min-width: 800px;
35
-
36
- .main-content {
37
- width: 100%;
38
- flex: 1;
39
- overflow: auto;
40
- border: none;
41
- }
42
-
43
34
  .tab-content {
44
35
  width: 100%;
45
36
  }
@@ -63,18 +54,6 @@ const styles = css `
63
54
  padding: 3px;
64
55
  }
65
56
 
66
- .close-bt {
67
- border: none;
68
- color: red;
69
- background-color: transparent;
70
- outline: none;
71
- position: absolute;
72
- right: 10px;
73
- top: 2px;
74
- width: 30px;
75
- height: 30px;
76
- }
77
-
78
57
  .checkbox-label {
79
58
  min-width: 300px;
80
59
  display: inline-block;
@@ -222,21 +201,21 @@ function GeneralSettingsModal({ height }) {
222
201
  function handlePastWorkspaceAction() {
223
202
  void readText().then(handlePastWorkspace);
224
203
  }
225
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: [_jsx(Modal.Header, { children: _jsxs("div", { style: {
226
- display: 'flex',
227
- flexDirection: 'column',
228
- }, children: [_jsx("span", { children: "General Settings" }), _jsxs("div", { style: {
229
- display: 'flex',
230
- alignItems: 'center',
231
- cursor: 'default',
232
- paddingTop: '10px',
233
- }, children: [_jsx(Label, { title: "Workspace", children: _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences.workspace.current, onSelect: ChangeWorkspaceHandler }) }), _jsx(Button.Action, { size: "xSmall", onClick: handleReset, toolTip: "Reset workspace preferences", tooltipOrientation: "horizontal", style: {
234
- marginLeft: '10px',
235
- }, disabled: isRestDisabled, children: _jsx(FaBolt, {}) }), _jsx(Button.Done, { size: "xSmall", fill: "outline", onClick: handleCopyWorkspace, toolTip: "Copy workspace preferences", tooltipOrientation: "horizontal", style: {
236
- marginLeft: '10px',
237
- }, children: _jsx(FaRegCopy, {}) }), _jsx(Button.Action, { size: "xSmall", fill: "outline", onClick: handlePastWorkspaceAction, toolTip: "Past workspace preferences", tooltipOrientation: "horizontal", style: {
238
- marginLeft: '10px',
239
- }, children: _jsx(FaPaste, {}) })] })] }) }), _jsx(Modal.Body, { 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(Modal.Footer, { 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: () => {
204
+ 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: {
205
+ cursor: 'default',
206
+ paddingTop: '10px',
207
+ boxShadow: 'none',
208
+ backgroundColor: '#f8f8f8',
209
+ }, children: [_jsx(Label, { title: "Workspace", children: _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences.workspace.current, onSelect: ChangeWorkspaceHandler }) }), _jsx(Button.Action, { size: "xSmall", onClick: handleReset, toolTip: "Reset workspace preferences", tooltipOrientation: "horizontal", style: {
210
+ marginLeft: '10px',
211
+ }, disabled: isRestDisabled, children: _jsx(FaBolt, {}) }), _jsx(Button.Done, { size: "xSmall", fill: "outline", onClick: handleCopyWorkspace, toolTip: "Copy workspace preferences", tooltipOrientation: "horizontal", style: {
212
+ marginLeft: '10px',
213
+ }, children: _jsx(FaRegCopy, {}) }), _jsx(Button.Action, { size: "xSmall", fill: "outline", onClick: handlePastWorkspaceAction, toolTip: "Past workspace preferences", tooltipOrientation: "horizontal", style: {
214
+ marginLeft: '10px',
215
+ }, children: _jsx(FaPaste, {}) })] }) }), _jsx(DialogBody, { css: css `
216
+ padding: 0;
217
+ background-color: white;
218
+ `, 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: () => {
240
219
  closeDialog?.();
241
220
  } }), _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" })] }));
242
221
  }
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Tab, Tabs } from '@blueprintjs/core';
2
3
  import { useFormikContext } from 'formik';
3
- import { useState } from 'react';
4
- import { Tabs } from 'react-science/ui';
5
4
  import { CheckBoxCell } from '../../../elements/CheckBoxCell';
6
5
  import IsotopesViewer from '../../../elements/IsotopesViewer';
7
6
  import Label from '../../../elements/Label';
@@ -14,14 +13,13 @@ function OnLoadProcessingTabContent() {
14
13
  }
15
14
  function AutoProcessingFilters() {
16
15
  const { values } = useFormikContext();
17
- const [activeTab, setActiveTab] = useState('1H');
18
16
  const autoProcessingFilters = values?.onLoadProcessing?.filters || {};
19
17
  const tabItems = Object.keys(autoProcessingFilters).map((nucleus) => ({
20
18
  id: nucleus,
21
19
  title: _jsx(IsotopesViewer, { value: nucleus }),
22
20
  content: (_jsx(FiltersTable, { data: autoProcessingFilters[nucleus], nucleus: nucleus })),
23
21
  }));
24
- return (_jsx("div", { style: { width: '100%', overflow: 'hidden' }, children: _jsx(Tabs, { items: tabItems, opened: activeTab, onClick: (id) => setActiveTab(id) }) }));
22
+ return (_jsx("div", { style: { width: '100%', overflow: 'hidden' }, children: _jsx(Tabs, { children: tabItems.map((item) => (_jsx(Tab, { id: item.id, title: item.title, panel: item.content }, item.id))) }) }));
25
23
  }
26
24
  function FiltersTable({ data, nucleus }) {
27
25
  const COLUMNS = [
@@ -4,7 +4,6 @@ import { SvgNmrAssignment2 } from 'cheminfo-font';
4
4
  import { FaBolt } from 'react-icons/fa';
5
5
  import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/isSpectrum1D';
6
6
  import { useChartData } from '../../context/ChartContext';
7
- import Button from '../../elements/Button';
8
7
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
9
8
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
10
9
  import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
@@ -22,6 +21,21 @@ function useCheckEnableAutomaticAssignments() {
22
21
  function AutomaticAssignment() {
23
22
  const { getAssignments, assignments, restAssignments } = useAutoAssignments();
24
23
  const enabled = useCheckEnableAutomaticAssignments();
25
- return (_jsxs("div", { css: tablePanelStyle, children: [_jsxs(DefaultPanelHeader, { showSettingButton: false, canDelete: false, children: [_jsx(SpectraAutomaticPickingButton, {}), _jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Automatic assignment", onClick: getAssignments, disabled: !enabled, children: _jsx(SvgNmrAssignment2, {}) }), _jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Reset assignment", onClick: restAssignments, children: _jsx(FaBolt, {}) })] }), _jsx("div", { className: "inner-container", children: _jsx(AutomaticAssignmentTable, { data: assignments }) })] }));
24
+ return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { leftButtons: [
25
+ {
26
+ component: _jsx(SpectraAutomaticPickingButton, {}),
27
+ },
28
+ {
29
+ icon: _jsx(SvgNmrAssignment2, {}),
30
+ title: 'Automatic assignment',
31
+ onClick: getAssignments,
32
+ disabled: !enabled,
33
+ },
34
+ {
35
+ icon: _jsx(FaBolt, {}),
36
+ title: 'Reset assignment',
37
+ onClick: restAssignments,
38
+ },
39
+ ] }), _jsx("div", { className: "inner-container", children: _jsx(AutomaticAssignmentTable, { data: assignments }) })] }));
26
40
  }
27
41
  export default AutomaticAssignment;