nmrium 0.58.0 → 0.60.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.
- package/lib/component/1d/LinesSeries.js +17 -5
- package/lib/component/1d/Viewer1D.js +10 -4
- package/lib/component/1d/integral/IntegralResizable.js +2 -2
- package/lib/component/1d/matrix/useMatrix.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib/component/1d/ranges/Atoms.js +6 -4
- package/lib/component/1d/ranges/Range.js +4 -2
- package/lib/component/1d/tool/PivotIndicator.d.ts +1 -0
- package/lib/component/1d/tool/{VerticalIndicator.js → PivotIndicator.js} +8 -4
- package/lib/component/1d-2d/tools/BrushXY.js +0 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.js +0 -1
- package/lib/component/2d/Viewer2D.js +7 -3
- package/lib/component/2d/tools/PivotIndicator.d.ts +1 -2
- package/lib/component/2d/tools/PivotIndicator.js +2 -3
- package/lib/component/2d/zones/Zone.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +8 -8
- package/lib/component/context/ChartContext.js +12 -1
- package/lib/component/context/ShareDataContext.d.ts +1 -1
- package/lib/component/context/ShareDataContext.js +2 -4
- package/lib/component/context/ToasterContext.d.ts +1 -0
- package/lib/component/context/ToasterContext.js +12 -3
- package/lib/component/elements/ActionsButtonsPopover.js +1 -3
- package/lib/component/elements/Alert.d.ts +20 -0
- package/lib/component/elements/Alert.js +80 -0
- package/lib/component/elements/ContextMenuBluePrint.d.ts +7 -2
- package/lib/component/elements/ContextMenuBluePrint.js +9 -3
- package/lib/component/elements/DialogManager.d.ts +34 -0
- package/lib/component/elements/DialogManager.js +96 -0
- package/lib/component/elements/DraggableDialog.d.ts +13 -0
- package/lib/component/elements/DraggableDialog.js +156 -0
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +0 -3
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +1 -1
- package/lib/component/elements/Select2.d.ts +12 -7
- package/lib/component/elements/Select2.js +5 -4
- package/lib/component/elements/Select2Controller.d.ts +2 -2
- package/lib/component/elements/Select2Controller.js +5 -5
- package/lib/component/elements/TabTitle.d.ts +9 -0
- package/lib/component/elements/TabTitle.js +18 -0
- package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -6
- package/lib/component/elements/ToolbarPopoverItem.js +13 -5
- package/lib/component/elements/print/PrintContent.d.ts +17 -0
- package/lib/component/elements/print/PrintContent.js +281 -0
- package/lib/component/elements/print/PrintProvider.d.ts +12 -0
- package/lib/component/elements/print/PrintProvider.js +28 -0
- package/lib/component/elements/print/index.d.ts +2 -0
- package/lib/component/elements/print/index.js +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +3 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +18 -22
- package/lib/component/hooks/useToggleSpectraVisibility.d.ts +14 -9
- package/lib/component/hooks/useToggleSpectraVisibility.js +45 -16
- package/lib/component/loader/DropZone.js +3 -67
- package/lib/component/loader/useLoadFiles.d.ts +1 -0
- package/lib/component/loader/useLoadFiles.js +78 -0
- package/lib/component/main/InnerNMRium.d.ts +4 -3
- package/lib/component/main/InnerNMRium.js +5 -10
- package/lib/component/main/InnerNMRiumContents.d.ts +3 -2
- package/lib/component/main/InnerNMRiumContents.js +38 -29
- package/lib/component/main/NMRium.d.ts +2 -5
- package/lib/component/main/NMRium.js +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +7 -0
- package/lib/component/main/NMRiumRefAPI.js +12 -0
- package/lib/component/main/NMRiumViewer.d.ts +10 -0
- package/lib/component/main/NMRiumViewer.js +35 -0
- package/lib/component/main/index.d.ts +1 -0
- package/lib/component/modal/CopyClipboardModal.d.ts +3 -2
- package/lib/component/modal/CopyClipboardModal.js +18 -32
- package/lib/component/modal/EditPeakShapeModal.d.ts +4 -6
- package/lib/component/modal/EditPeakShapeModal.js +45 -33
- package/lib/component/modal/ExportAsJcampModal.d.ts +6 -3
- package/lib/component/modal/ExportAsJcampModal.js +69 -35
- package/lib/component/modal/ImportPublicationStringModal.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -10
- package/lib/component/modal/editRange/EditRangeModal.js +26 -54
- package/lib/component/modal/editZone/EditZoneModal.d.ts +3 -8
- package/lib/component/modal/editZone/EditZoneModal.js +74 -91
- package/lib/component/modal/editZone/SignalsForm.d.ts +1 -2
- package/lib/component/modal/editZone/SignalsForm.js +33 -50
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +1 -2
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +3 -5
- package/lib/component/modal/setting/GeneralSettings.js +4 -2
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.d.ts +1 -0
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +89 -0
- package/lib/component/modal/setting/settingsValidation.js +15 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +5 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -3
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +8 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +7 -13
- package/lib/component/panels/RangesPanel/RangesHeader.js +52 -15
- package/lib/component/panels/RangesPanel/RangesTable.js +6 -3
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +21 -3
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +6 -5
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +41 -64
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +13 -6
- package/lib/component/panels/SpectraPanel/SpectraTable.js +63 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.d.ts +1 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +33 -41
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +68 -53
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +70 -58
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.d.ts +13 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +17 -81
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +3 -0
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +8 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +62 -43
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +16 -8
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/hooks/useZoneActions.d.ts +5 -0
- package/lib/component/panels/ZonesPanel/hooks/useZoneActions.js +40 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +7 -8
- package/lib/component/panels/filtersPanel/FilterPanel.js +9 -6
- package/lib/component/panels/filtersPanel/FiltersTable.js +12 -10
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +1 -0
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +10 -12
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -13
- package/lib/component/reducer/actions/DatabaseActions.js +52 -34
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/FiltersActions.js +9 -4
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -0
- package/lib/component/reducer/actions/RangesActions.js +9 -4
- package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
- package/lib/component/reducer/actions/SpectraActions.js +53 -43
- package/lib/component/reducer/actions/ToolsActions.js +0 -17
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.d.ts +3 -0
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +16 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.js +6 -0
- package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +0 -4
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +1 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -2
- package/lib/component/reducer/preferences/preferencesReducer.js +4 -1
- package/lib/component/toolbar/ToolBar.js +33 -14
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +0 -14
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/SpectraManager.d.ts +7 -10
- package/lib/data/SpectraManager.js +51 -30
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/SumManager.js +2 -10
- package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +10 -16
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -7
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +10 -16
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +10 -16
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +65 -0
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +21 -49
- package/lib/data/utilities/getCustomColor.d.ts +1 -1
- package/lib/data/utilities/removeByPaths.d.ts +3 -0
- package/lib/data/utilities/removeByPaths.js +33 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +34 -34
- package/lib/component/1d/tool/VerticalIndicator.d.ts +0 -2
- package/lib/component/elements/ContextMenu.d.ts +0 -9
- package/lib/component/elements/ContextMenu.js +0 -116
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +0 -21
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +0 -68
- package/lib/component/elements/popup/Modal/Context.d.ts +0 -2
- package/lib/component/elements/popup/Modal/Context.js +0 -6
- package/lib/component/elements/popup/Modal/Modal.d.ts +0 -9
- package/lib/component/elements/popup/Modal/Modal.js +0 -42
- package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -6
- package/lib/component/elements/popup/Modal/ModalContent.js +0 -27
- package/lib/component/elements/popup/Modal/Provider.d.ts +0 -11
- package/lib/component/elements/popup/Modal/Provider.js +0 -172
- package/lib/component/elements/popup/Modal/index.d.ts +0 -4
- package/lib/component/elements/popup/Modal/index.js +0 -4
- package/lib/component/elements/popup/Transition.d.ts +0 -14
- package/lib/component/elements/popup/Transition.js +0 -35
- package/lib/component/elements/popup/Wrapper.d.ts +0 -8
- package/lib/component/elements/popup/Wrapper.js +0 -83
- package/lib/component/elements/popup/options.d.ts +0 -28
- package/lib/component/elements/popup/options.js +0 -25
- package/lib/component/elements/popup/utility.d.ts +0 -2
- package/lib/component/elements/popup/utility.js +0 -13
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +0 -5
- package/lib/component/modal/editZone/EditPathLengthFormik.js +0 -67
- package/lib/component/modal/editZone/SignalFormTab.d.ts +0 -5
- package/lib/component/modal/editZone/SignalFormTab.js +0 -6
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +0 -14
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +0 -14
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +0 -11
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +0 -29
|
@@ -2,52 +2,82 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
import { Formik } from 'formik';
|
|
6
5
|
import { useRef } from 'react';
|
|
7
|
-
import {
|
|
6
|
+
import { exportAsJcamp } from '../../data/SpectraManager';
|
|
8
7
|
import { useToaster } from '../context/ToasterContext';
|
|
9
8
|
import ActionButtons from '../elements/ActionButtons';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
import Label from '../elements/Label';
|
|
10
|
+
import { Select2 } from '../elements/Select2';
|
|
11
|
+
import useSpectrum from '../hooks/useSpectrum';
|
|
12
|
+
const originalFidExportDataTypes = [
|
|
13
|
+
{
|
|
14
|
+
label: 'Original FID',
|
|
15
|
+
value: 'originalFid',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
const originalFtDataTypes = [
|
|
19
|
+
{
|
|
20
|
+
label: 'Original FT real',
|
|
21
|
+
value: 'originalFtReal',
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
{
|
|
24
|
+
label: 'Original FT real and imaginary',
|
|
25
|
+
value: 'originalFtRealImaginary',
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
];
|
|
28
|
+
const processedDataTypes = [
|
|
29
|
+
{
|
|
30
|
+
label: 'Processed real',
|
|
31
|
+
value: 'processedReal',
|
|
31
32
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
{
|
|
34
|
+
label: 'Processed real and imaginary',
|
|
35
|
+
value: 'processedRealImaginary',
|
|
35
36
|
},
|
|
37
|
+
];
|
|
38
|
+
const labelStyle = {
|
|
39
|
+
wrapper: { display: 'flex', height: '100%', flex: 1 },
|
|
40
|
+
container: { alignItems: 'flex-start' },
|
|
41
|
+
label: { paddingTop: '5px', width: 80 },
|
|
36
42
|
};
|
|
37
|
-
const DATA_STAGES = Object.keys(DataExportStage).map((key) => ({
|
|
38
|
-
label: key,
|
|
39
|
-
value: DataExportStage[key],
|
|
40
|
-
}));
|
|
41
43
|
function ExportAsJcampModal(props) {
|
|
44
|
+
const { spectrum, exportActiveSpectrum = false } = props;
|
|
45
|
+
const activeSpectrum = useSpectrum();
|
|
46
|
+
if (!exportActiveSpectrum && !spectrum) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
if (exportActiveSpectrum && !activeSpectrum)
|
|
50
|
+
return null;
|
|
51
|
+
const currentSpectrum = exportActiveSpectrum ? activeSpectrum : spectrum;
|
|
52
|
+
if (!currentSpectrum)
|
|
53
|
+
return null;
|
|
54
|
+
return _jsx(InnerExportAsJcampModal, { spectrum: currentSpectrum, ...props });
|
|
55
|
+
}
|
|
56
|
+
function getExportDataTypes(spectrum) {
|
|
57
|
+
const { originalInfo, filters } = spectrum;
|
|
58
|
+
const menuItems = [];
|
|
59
|
+
if (originalInfo?.isFt) {
|
|
60
|
+
menuItems.push(...originalFtDataTypes);
|
|
61
|
+
}
|
|
62
|
+
if (originalInfo?.isFid) {
|
|
63
|
+
menuItems.push(...originalFidExportDataTypes);
|
|
64
|
+
}
|
|
65
|
+
if (filters?.length > 0) {
|
|
66
|
+
menuItems.push(...processedDataTypes);
|
|
67
|
+
}
|
|
68
|
+
return menuItems;
|
|
69
|
+
}
|
|
70
|
+
function InnerExportAsJcampModal(props) {
|
|
42
71
|
const { closeDialog, spectrum } = props;
|
|
43
|
-
const refForm = useRef(null);
|
|
44
72
|
const toaster = useToaster();
|
|
45
|
-
|
|
73
|
+
const exportDataTypes = getExportDataTypes(spectrum);
|
|
74
|
+
const exportDataAsRef = useRef(exportDataTypes[0].value);
|
|
75
|
+
function submitHandler() {
|
|
46
76
|
const hideLoading = toaster.showLoading({
|
|
47
77
|
message: 'export as JCAMP-DX in progress',
|
|
48
78
|
});
|
|
49
79
|
try {
|
|
50
|
-
exportAsJcamp(spectrum,
|
|
80
|
+
exportAsJcamp(spectrum, exportDataAsRef.current);
|
|
51
81
|
}
|
|
52
82
|
catch (error) {
|
|
53
83
|
toaster.show({ message: error.message, intent: 'danger' });
|
|
@@ -57,10 +87,14 @@ function ExportAsJcampModal(props) {
|
|
|
57
87
|
hideLoading();
|
|
58
88
|
}
|
|
59
89
|
}
|
|
60
|
-
|
|
90
|
+
function handleChangeExportDataType(data) {
|
|
91
|
+
exportDataAsRef.current = data.value;
|
|
92
|
+
}
|
|
93
|
+
return (_jsxs(Dialog, { isOpen: true, style: { width: 400 }, onClose: closeDialog, title: "Export as JCAMP", children: [_jsx(DialogBody, { css: css `
|
|
61
94
|
background-color: white;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
95
|
+
padding: 1.5em 3em;
|
|
96
|
+
`, children: _jsx(Label, { title: "Data", style: labelStyle, children: _jsx(Select2, { defaultSelectedItem: exportDataTypes[0], onItemSelect: handleChangeExportDataType, items: exportDataTypes }) }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: submitHandler, doneLabel: "export", onCancel: () => {
|
|
97
|
+
closeDialog?.();
|
|
98
|
+
} }) })] }));
|
|
65
99
|
}
|
|
66
100
|
export default ExportAsJcampModal;
|
|
@@ -27,7 +27,7 @@ function handleRowStyle(data) {
|
|
|
27
27
|
return { base: { backgroundColor } };
|
|
28
28
|
}
|
|
29
29
|
const INITIAL_VALUES = {
|
|
30
|
-
publicationText: '1H NMR (CDCl3, 400MHz) δ
|
|
30
|
+
publicationText: '1H NMR (CDCl3, 400MHz) δ 1 (s, 1H), 2 (d, 1H, J=7), 3 (t, 1H, J=7), 4 (q, 1H, J=7), 5 (quint, 1H, J=7), 6 (hex, 1H, J=7), 7 (hept, 1H, J=7), 8 (dd, 1H, J=7, J=4)',
|
|
31
31
|
};
|
|
32
32
|
export function ImportPublicationStringModal(props) {
|
|
33
33
|
const { onClose, isOpen } = props;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
onSave: (value: any) => Promise<void> | null | void;
|
|
4
|
-
onClose?: () => void;
|
|
5
|
-
onRest: (originalRange: Range) => void;
|
|
6
|
-
onZoom: (value: any) => void;
|
|
7
|
-
rangeId: string;
|
|
8
|
-
}
|
|
9
|
-
declare function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }: EditRangeModalProps): import("@emotion/react/jsx-runtime").JSX.Element | undefined;
|
|
10
|
-
export default EditRangeModal;
|
|
1
|
+
import { DialogProps } from '../../elements/DialogManager';
|
|
2
|
+
export declare function EditRangeModal(props: DialogProps<string>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,81 +1,53 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Button, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
5
|
import { v4 } from '@lukeed/uuid';
|
|
5
6
|
import { Formik } from 'formik';
|
|
6
7
|
import { splitPatterns, translateMultiplet } from 'nmr-processing';
|
|
7
|
-
import { useMemo, useCallback, useRef
|
|
8
|
+
import { useMemo, useCallback, useRef } from 'react';
|
|
8
9
|
import { FaSearchPlus } from 'react-icons/fa';
|
|
9
10
|
import { useChartData } from '../../context/ChartContext';
|
|
10
11
|
import { useDispatch } from '../../context/DispatchContext';
|
|
11
|
-
import
|
|
12
|
-
import { CloseButton } from '../../elements/CloseButton';
|
|
13
|
-
import { SaveButton } from '../../elements/SaveButton';
|
|
12
|
+
import { DraggableDialog } from '../../elements/DraggableDialog';
|
|
14
13
|
import FormikOnChange from '../../elements/formik/FormikOnChange';
|
|
15
14
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
16
15
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
16
|
+
import useEditRangeModal from '../../panels/RangesPanel/hooks/useEditRangeModal';
|
|
17
17
|
import { hasCouplingConstant } from '../../panels/extra/utilities/MultiplicityUtilities';
|
|
18
18
|
import { formatNumber } from '../../utility/formatNumber';
|
|
19
19
|
import SignalsContent from './forms/components/SignalsContent';
|
|
20
20
|
import editRangeFormValidation from './forms/validation/EditRangeValidation';
|
|
21
21
|
const styles = css `
|
|
22
|
-
|
|
23
|
-
padding: 5px;
|
|
24
|
-
|
|
25
|
-
button:focus {
|
|
26
|
-
outline: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.header {
|
|
30
|
-
border-bottom: 1px solid #f0f0f0;
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
|
|
34
|
-
.title {
|
|
35
|
-
color: #464646;
|
|
36
|
-
font-size: 15px;
|
|
37
|
-
flex: 1;
|
|
38
|
-
border-left: 1px solid #ececec;
|
|
39
|
-
padding-left: 6px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
button {
|
|
43
|
-
background-color: transparent;
|
|
44
|
-
border: none;
|
|
45
|
-
padding: 5px;
|
|
46
|
-
|
|
47
|
-
svg {
|
|
48
|
-
height: 16px;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
22
|
+
background-color: white;
|
|
52
23
|
|
|
53
24
|
.tabs .tab-list {
|
|
54
25
|
overflow-x: auto;
|
|
55
26
|
}
|
|
56
27
|
`;
|
|
57
|
-
function EditRangeModal(
|
|
28
|
+
export function EditRangeModal(props) {
|
|
29
|
+
const { reset, saveEditRange, zoomRange } = useEditRangeModal();
|
|
30
|
+
const { dialogData: rangeID, onCloseDialog } = props;
|
|
31
|
+
return (_jsx(InnerEditRangeModal, { onRest: (range) => {
|
|
32
|
+
onCloseDialog();
|
|
33
|
+
reset(range);
|
|
34
|
+
}, onSave: (range) => {
|
|
35
|
+
onCloseDialog();
|
|
36
|
+
saveEditRange(range);
|
|
37
|
+
}, onZoom: zoomRange, rangeID: rangeID }));
|
|
38
|
+
}
|
|
39
|
+
function InnerEditRangeModal(props) {
|
|
40
|
+
const { onSave, onZoom, onRest, rangeID } = props;
|
|
58
41
|
const formRef = useRef(null);
|
|
59
42
|
const { view: { spectra: { activeTab }, }, } = useChartData();
|
|
60
43
|
const dispatch = useDispatch();
|
|
61
|
-
const range = useRange(
|
|
44
|
+
const range = useRange(rangeID);
|
|
62
45
|
const originalRangeRef = useRef(range);
|
|
63
46
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
64
|
-
|
|
47
|
+
function handleOnZoom() {
|
|
65
48
|
onZoom(range);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
dispatch({
|
|
69
|
-
type: 'SET_SELECTED_TOOL',
|
|
70
|
-
payload: {
|
|
71
|
-
selectedTool: 'zoom',
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
if (!range) {
|
|
75
|
-
onClose?.();
|
|
76
|
-
}
|
|
77
|
-
}, [activeTab, dispatch, onClose, range]);
|
|
78
|
-
const handleOnClose = useCallback(() => {
|
|
49
|
+
}
|
|
50
|
+
function handleOnClose() {
|
|
79
51
|
dispatch({
|
|
80
52
|
type: 'SET_SELECTED_TOOL',
|
|
81
53
|
payload: {
|
|
@@ -83,7 +55,7 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
|
83
55
|
},
|
|
84
56
|
});
|
|
85
57
|
onRest(originalRangeRef.current);
|
|
86
|
-
}
|
|
58
|
+
}
|
|
87
59
|
const getCouplings = useCallback((couplings) => couplings
|
|
88
60
|
.filter((coupling) => coupling.coupling !== '')
|
|
89
61
|
.map((coupling) => {
|
|
@@ -154,7 +126,8 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
|
154
126
|
if (!rangesPreferences || !range) {
|
|
155
127
|
return;
|
|
156
128
|
}
|
|
157
|
-
|
|
129
|
+
const title = ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm`;
|
|
130
|
+
return (_jsxs(DraggableDialog, { hasBackdrop: false, canOutsideClickClose: false, style: { width: 700 }, title: title, isOpen: true, headerLeftElement: _jsx(Button, { intent: "success", style: { marginRight: '5px', borderRadius: '5px' }, icon: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }), minimal: true, onClick: handleOnZoom }), onClose: handleOnClose, placement: "top-right", children: [_jsx(DialogBody, { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsContent, { range: range }), _jsx(FormikOnChange, { onChange: changeHandler })] }) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button, { intent: "success", onClick: () => formRef.current.submitForm(), children: "Save and Exit" }) }) })] }));
|
|
158
131
|
}
|
|
159
132
|
function useRange(rangeId) {
|
|
160
133
|
const { ranges } = useSpectrum({
|
|
@@ -163,4 +136,3 @@ function useRange(rangeId) {
|
|
|
163
136
|
const index = ranges.values.findIndex((rangeRecord) => rangeRecord.id === rangeId);
|
|
164
137
|
return ranges.values[index];
|
|
165
138
|
}
|
|
166
|
-
export default EditRangeModal;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onZoomEditZoneModal: (value: any) => void;
|
|
5
|
-
rowData: any;
|
|
6
|
-
}
|
|
7
|
-
declare function EditZoneModal({ onSaveEditZoneModal, onCloseEditZoneModal, onZoomEditZoneModal, rowData, }: EditZoneModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default EditZoneModal;
|
|
1
|
+
import { DialogProps } from '../../elements/DialogManager';
|
|
2
|
+
import { ZoneData } from '../../panels/ZonesPanel/hooks/useMapZones';
|
|
3
|
+
export declare function EditZoneModal(props: DialogProps<ZoneData>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,101 +1,84 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Button, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
6
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
6
7
|
import { FaSearchPlus } from 'react-icons/fa';
|
|
8
|
+
import * as Yup from 'yup';
|
|
7
9
|
import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
color: #464646;
|
|
31
|
-
font-size: 15px;
|
|
32
|
-
flex: 1;
|
|
33
|
-
border-left: 1px solid #ececec;
|
|
34
|
-
padding-left: 6px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
button {
|
|
38
|
-
background-color: transparent;
|
|
39
|
-
border: none;
|
|
40
|
-
padding: 5px;
|
|
41
|
-
|
|
42
|
-
svg {
|
|
43
|
-
height: 16px;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.container {
|
|
49
|
-
display: flex;
|
|
50
|
-
margin: 30px 5px;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
function EditZoneModal({ onSaveEditZoneModal = () => null, onCloseEditZoneModal = () => null, onZoomEditZoneModal = () => null, rowData, }) {
|
|
54
|
-
const formRef = useRef(null);
|
|
55
|
-
const handleOnZoom = useCallback(() => {
|
|
56
|
-
onZoomEditZoneModal(rowData);
|
|
57
|
-
}, [onZoomEditZoneModal, rowData]);
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
handleOnZoom();
|
|
60
|
-
}, [handleOnZoom]);
|
|
61
|
-
const handleOnClose = useCallback(() => {
|
|
62
|
-
onCloseEditZoneModal();
|
|
63
|
-
}, [onCloseEditZoneModal]);
|
|
64
|
-
const handleOnSave = useCallback((formValues) => {
|
|
10
|
+
import { DraggableDialog } from '../../elements/DraggableDialog';
|
|
11
|
+
import { useZoneActions } from '../../panels/ZonesPanel/hooks/useZoneActions';
|
|
12
|
+
import { SignalsForm } from './SignalsForm';
|
|
13
|
+
import { isDefaultPathLength } from './validation/isDefaultPathLength';
|
|
14
|
+
const signalSchema = Yup.object().shape({
|
|
15
|
+
j: Yup.object().shape({
|
|
16
|
+
pathLength: Yup.object().shape({
|
|
17
|
+
from: Yup.number().required().positive().integer(),
|
|
18
|
+
to: Yup.number().required().positive().integer(),
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
const zoneFormValidation = Yup.object().shape({
|
|
23
|
+
activeTab: Yup.string(),
|
|
24
|
+
signals: Yup.array()
|
|
25
|
+
.of(signalSchema)
|
|
26
|
+
.min(1, 'There must be at least one signal in a zone!'),
|
|
27
|
+
});
|
|
28
|
+
export function EditZoneModal(props) {
|
|
29
|
+
const { dialogData: zone, onCloseDialog } = props;
|
|
30
|
+
const { saveZone, zoomToZone } = useZoneActions();
|
|
31
|
+
function handleSave(values) {
|
|
65
32
|
void (async () => {
|
|
66
|
-
const
|
|
67
|
-
...
|
|
68
|
-
signals:
|
|
69
|
-
if (isDefaultPathLength(signal.j?.pathLength, rowData.tableMetaInfo.experiment)) {
|
|
70
|
-
delete signal.j?.pathLength;
|
|
71
|
-
if (signal.j && Object.keys(signal.j).length === 0) {
|
|
72
|
-
delete signal.j;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return signal;
|
|
76
|
-
}),
|
|
33
|
+
const zoneData = {
|
|
34
|
+
...zone,
|
|
35
|
+
signals: mapSignalsBeforeSave(values?.signals, zone.tableMetaInfo.experiment),
|
|
77
36
|
};
|
|
78
|
-
|
|
79
|
-
|
|
37
|
+
saveZone(zoneData);
|
|
38
|
+
onCloseDialog();
|
|
80
39
|
})();
|
|
81
|
-
}
|
|
82
|
-
const
|
|
83
|
-
|
|
40
|
+
}
|
|
41
|
+
const methods = useForm({
|
|
42
|
+
defaultValues: {
|
|
84
43
|
activeTab: '0',
|
|
85
|
-
signals:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
44
|
+
signals: mapSignals(zone),
|
|
45
|
+
},
|
|
46
|
+
resolver: yupResolver(zoneFormValidation),
|
|
47
|
+
});
|
|
48
|
+
const { handleSubmit } = methods;
|
|
49
|
+
return (_jsxs(DraggableDialog, { hasBackdrop: false, canOutsideClickClose: false, style: { width: 700 }, title: "Zone and Signal edition", isOpen: true, headerLeftElement: _jsx(Button, { intent: "success", style: { marginRight: '5px', borderRadius: '5px' }, icon: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }), minimal: true, onClick: () => zoomToZone(zone) }), onClose: onCloseDialog, placement: "top-right", children: [_jsx(DialogBody, { css: css `
|
|
50
|
+
background-color: white;
|
|
51
|
+
`, children: _jsx(FormProvider, { ...methods, children: _jsx(SignalsForm, {}) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button, { intent: "success", onClick: () => handleSubmit(handleSave)(), children: "Save and Exit" }) }) })] }));
|
|
52
|
+
}
|
|
53
|
+
function mapSignalsBeforeSave(signals, experiment) {
|
|
54
|
+
const outputSignals = [];
|
|
55
|
+
for (const signal of signals) {
|
|
56
|
+
if (isDefaultPathLength(signal.j?.pathLength, experiment)) {
|
|
57
|
+
delete signal.j?.pathLength;
|
|
58
|
+
if (signal.j && Object.keys(signal.j).length === 0) {
|
|
59
|
+
delete signal.j;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
outputSignals.push(signal);
|
|
63
|
+
}
|
|
64
|
+
return outputSignals;
|
|
65
|
+
}
|
|
66
|
+
function mapSignals(zone) {
|
|
67
|
+
const outputSignals = [];
|
|
68
|
+
const { signals, tableMetaInfo: { experiment }, } = zone;
|
|
69
|
+
const { from = 1, to = 1 } = DefaultPathLengths?.[experiment] || {};
|
|
70
|
+
for (const signal of signals) {
|
|
71
|
+
const mappedSignal = {
|
|
72
|
+
...signal,
|
|
73
|
+
j: {
|
|
74
|
+
pathLength: {
|
|
75
|
+
from,
|
|
76
|
+
to,
|
|
77
|
+
},
|
|
78
|
+
...signal.j,
|
|
79
|
+
},
|
|
97
80
|
};
|
|
98
|
-
|
|
99
|
-
|
|
81
|
+
outputSignals.push(mappedSignal);
|
|
82
|
+
}
|
|
83
|
+
return outputSignals;
|
|
100
84
|
}
|
|
101
|
-
export default EditZoneModal;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare function SignalsForm(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
-
export default SignalsForm;
|
|
1
|
+
export declare function SignalsForm(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
display: 'flex',
|
|
36
|
-
flexDirection: 'column',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
fontSize: '11px',
|
|
39
|
-
}, children: [_jsxs("span", { children: ["\uD835\uDEC5", _jsx("sub", { children: signal.x.nucleus }), ": ", signal.x.delta.toFixed(2)] }), _jsxs("span", { children: ["\uD835\uDEC5", _jsx("sub", { children: signal.y.nucleus }), ": ", signal.y.delta.toFixed(2)] })] })), children: _jsx(SignalFormTab, { signalIndex: i }) }, `signalForm_zone${i}`)))
|
|
40
|
-
: [];
|
|
41
|
-
return signalTabs;
|
|
42
|
-
}, [tabContainsErrors, values.signals]);
|
|
43
|
-
const tapClickHandler = useCallback(({ tabid }) => {
|
|
44
|
-
setFieldValue('activeTab', tabid);
|
|
45
|
-
}, [setFieldValue]);
|
|
46
|
-
const handleDeleteSignal = useCallback(({ tabid }) => {
|
|
47
|
-
const _signals = values.signals.filter((_signal, i) => i !== Number(tabid));
|
|
48
|
-
setFieldValue('signals', _signals);
|
|
49
|
-
}, [setFieldValue, values.signals]);
|
|
50
|
-
return (_jsxs("div", { children: [_jsx("div", { css: textStyles }), _jsx(Tabs, { activeTab: values.activeTab, onClick: tapClickHandler, onDelete: handleDeleteSignal, children: signalFormTabs })] }));
|
|
3
|
+
import { Tab, Tabs } from '@blueprintjs/core';
|
|
4
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
+
import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
|
|
6
|
+
import IsotopesViewer from '../../elements/IsotopesViewer';
|
|
7
|
+
import Label from '../../elements/Label';
|
|
8
|
+
import { NumberInput2Controller } from '../../elements/NumberInput2Controller';
|
|
9
|
+
import { TabTitle } from '../../elements/TabTitle';
|
|
10
|
+
export function SignalsForm() {
|
|
11
|
+
const { setValue, formState: { errors }, } = useFormContext();
|
|
12
|
+
const { signals = [], activeTab, experimentType } = useWatch();
|
|
13
|
+
function handleTapChange(tabID) {
|
|
14
|
+
setValue('activeTab', tabID);
|
|
15
|
+
}
|
|
16
|
+
function handleDeleteSignal(index) {
|
|
17
|
+
const filteredSignals = signals.filter((_signal, i) => i !== index);
|
|
18
|
+
setValue('signals', filteredSignals);
|
|
19
|
+
}
|
|
20
|
+
return (_jsx("div", { children: _jsx(Tabs, { selectedTabId: activeTab, onChange: handleTapChange, children: signals.map((signal, index) => {
|
|
21
|
+
return (_jsx(Tab
|
|
22
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
23
|
+
, { id: `${index}`, style: { ...(errors?.signals?.[index] && { color: 'red' }) }, panel: _jsx(SignalTab, { index: index, experimentType: experimentType }), children: _jsx(TabTitle, { onDelete: () => handleDeleteSignal(index), children: _jsx(Title, { signal: signal }) }) }, `zone-signal-${index}`));
|
|
24
|
+
}) }) }));
|
|
25
|
+
}
|
|
26
|
+
function SignalTab(props) {
|
|
27
|
+
const { index, experimentType } = props;
|
|
28
|
+
const { control } = useFormContext();
|
|
29
|
+
const { from = 1, to = 1 } = DefaultPathLengths?.[experimentType] || {};
|
|
30
|
+
return (_jsxs("div", { children: [_jsx("p", { children: "Setting of the minimum and maximum path length (J coupling)." }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row' }, children: [_jsx(Label, { title: "Min:", children: _jsx(NumberInput2Controller, { name: `signals[${index}].j.pathLength.from`, control: control, defaultValue: from, min: 1, max: to, step: 1, majorStepSize: 1, minorStepSize: 1 }) }), _jsx(Label, { title: "Max:", style: { container: { paddingLeft: '5px' } }, children: _jsx(NumberInput2Controller, { name: `signals[${index}].j.pathLength.to`, control: control, defaultValue: to, min: from, step: 1, majorStepSize: 1, minorStepSize: 1 }) })] })] }));
|
|
31
|
+
}
|
|
32
|
+
function Title({ signal }) {
|
|
33
|
+
const { x, y } = signal;
|
|
34
|
+
return (_jsxs(_Fragment, { children: ["\uD835\uDEC5", _jsx(IsotopesViewer, { value: x.nucleus, style: { display: 'inline-block' } }), ":", x.delta.toFixed(2), " , \uD835\uDEC5", _jsx(IsotopesViewer, { value: y.nucleus, style: { display: 'inline-block' } }), ":", y.delta.toFixed(2)] }));
|
|
51
35
|
}
|
|
52
|
-
export default SignalsForm;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import DefaultPathLengths from '../../../../data/constants/DefaultPathLengths';
|
|
2
|
-
function isDefaultPathLength(pathLength, experimentType) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
pathLength.to === DefaultPathLengths[experimentType].to);
|
|
2
|
+
export function isDefaultPathLength(pathLength, experimentType) {
|
|
3
|
+
const { from, to } = DefaultPathLengths?.[experimentType] || {};
|
|
4
|
+
return pathLength.from === from && pathLength.to === to;
|
|
6
5
|
}
|
|
7
|
-
export default isDefaultPathLength;
|
|
@@ -22,6 +22,7 @@ import PredefinedWorkspaces from '../../workspaces';
|
|
|
22
22
|
import WorkspaceItem from './WorkspaceItem';
|
|
23
23
|
import DatabasesTabContent from './settings-tabs/DatabasesTabContent';
|
|
24
24
|
import DisplayTabContent from './settings-tabs/DisplayTabContent';
|
|
25
|
+
import { ExternalAPIsTabContent } from './settings-tabs/ExternalAPIsTabContent';
|
|
25
26
|
import GeneralTabContent from './settings-tabs/GeneralTabContent';
|
|
26
27
|
import ImportationFiltersTabContent from './settings-tabs/ImportationFiltersTabContent';
|
|
27
28
|
import InfoBlockTabContent from './settings-tabs/InfoBlockTabContent';
|
|
@@ -65,7 +66,7 @@ function InnerGeneralSettingsModal(props) {
|
|
|
65
66
|
defaultValues: currentWorkspace,
|
|
66
67
|
resolver: yupResolver(validation),
|
|
67
68
|
});
|
|
68
|
-
const { reset, getValues } = methods;
|
|
69
|
+
const { reset, getValues, watch } = methods;
|
|
69
70
|
const workspacesList = useMemo(() => {
|
|
70
71
|
return baseWorkspaces.concat([
|
|
71
72
|
{
|
|
@@ -103,6 +104,7 @@ function InnerGeneralSettingsModal(props) {
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
}, [dispatch, preferences.workspace, workspaces, reset]);
|
|
107
|
+
const isExperimentalFeatures = watch('display.general.experimentalFeatures.display') || false;
|
|
106
108
|
useEffect(() => {
|
|
107
109
|
if (pastRef.current) {
|
|
108
110
|
setWorkspaceSetting(pastRef.current);
|
|
@@ -130,7 +132,7 @@ function InnerGeneralSettingsModal(props) {
|
|
|
130
132
|
overflow: auto;
|
|
131
133
|
max-height: 100%;
|
|
132
134
|
}
|
|
133
|
-
`, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Nuclei", id: "nuclei", panel: _jsx(NucleiTabContent, {}) }), _jsx(Tab, { title: "Panels", id: "display", panel: _jsx(DisplayTabContent, {}) }), _jsx(Tab, { title: "Tools", id: "tools", panel: _jsx(ToolsTabContent, {}) }), _jsx(Tab, { title: "Databases", id: "databases", panel: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }), _jsx(Tab, { title: "Import filters", id: "importation-filters", panel: _jsx(ImportationFiltersTabContent, {}) }), _jsx(Tab, { title: "Title block", id: "title-block", panel: _jsx(InfoBlockTabContent, {}) }), _jsx(Tab, { title: "Auto processing", id: "on-load-processing", panel: _jsx(OnLoadProcessingTabContent, {}) }), _jsx(Tab, { title: "Spectra colors", id: "spectra-colors", panel: _jsx(SpectraColorsTabContent, {}) })] }) }) }), _jsx(DialogFooter, { children: _jsx(DialogActionButtons, { onCloseDialog: onCloseDialog, onSave: onSave }) })] }) }));
|
|
135
|
+
`, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Nuclei", id: "nuclei", panel: _jsx(NucleiTabContent, {}) }), _jsx(Tab, { title: "Panels", id: "display", panel: _jsx(DisplayTabContent, {}) }), _jsx(Tab, { title: "Tools", id: "tools", panel: _jsx(ToolsTabContent, {}) }), _jsx(Tab, { title: "Databases", id: "databases", panel: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }), _jsx(Tab, { title: "Import filters", id: "importation-filters", panel: _jsx(ImportationFiltersTabContent, {}) }), _jsx(Tab, { title: "Title block", id: "title-block", panel: _jsx(InfoBlockTabContent, {}) }), _jsx(Tab, { title: "Auto processing", id: "on-load-processing", panel: _jsx(OnLoadProcessingTabContent, {}) }), _jsx(Tab, { title: "Spectra colors", id: "spectra-colors", panel: _jsx(SpectraColorsTabContent, {}) }), isExperimentalFeatures && (_jsx(Tab, { title: "External APIs", id: "external-apis", panel: _jsx(ExternalAPIsTabContent, {}) }))] }) }) }), _jsx(DialogFooter, { children: _jsx(DialogActionButtons, { onCloseDialog: onCloseDialog, onSave: onSave }) })] }) }));
|
|
134
136
|
}
|
|
135
137
|
function WorkSpaceActionsButtons(props) {
|
|
136
138
|
const { readText, rawWriteWithType, shouldFallback, cleanShouldFallback, text, } = useClipboard();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ExternalAPIsTabContent(): import("react/jsx-runtime").JSX.Element;
|