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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { fileCollectionFromFileList } from 'filelist-utils';
|
|
2
|
+
import { read as readDropFiles } from 'nmr-load-save';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { isMetaFile, parseMetaFile } from '../../data/parseMeta';
|
|
5
|
+
import { useDispatch } from '../context/DispatchContext';
|
|
6
|
+
import { useLogger } from '../context/LoggerContext';
|
|
7
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
8
|
+
import { useToaster } from '../context/ToasterContext';
|
|
9
|
+
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
10
|
+
export function useLoadFiles(onOpenMetaInformation) {
|
|
11
|
+
const dispatch = useDispatch();
|
|
12
|
+
const { dispatch: dispatchPreferences, current: workspacePreferences } = usePreferences();
|
|
13
|
+
const preferences = usePreferences();
|
|
14
|
+
const toaster = useToaster();
|
|
15
|
+
const { logger } = useLogger();
|
|
16
|
+
const experimentalFeatures = useCheckExperimentalFeature();
|
|
17
|
+
return useCallback((files) => {
|
|
18
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: true } });
|
|
19
|
+
async function loadFiles(files) {
|
|
20
|
+
if (onOpenMetaInformation &&
|
|
21
|
+
files.length === 1 &&
|
|
22
|
+
isMetaFile(files[0])) {
|
|
23
|
+
onOpenMetaInformation(files[0]);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const fileCollection = await fileCollectionFromFileList(files);
|
|
27
|
+
const metaFile = Object.values(fileCollection.files).find((file) => isMetaFile(file));
|
|
28
|
+
let parseMetaFileResult = null;
|
|
29
|
+
if (metaFile) {
|
|
30
|
+
parseMetaFileResult = await parseMetaFile(metaFile);
|
|
31
|
+
}
|
|
32
|
+
const { nmrLoaders: sourceSelector } = preferences.current;
|
|
33
|
+
const { onLoadProcessing, spectraColors } = workspacePreferences;
|
|
34
|
+
const { nmriumState, containsNmrium } = await readDropFiles(fileCollection, {
|
|
35
|
+
sourceSelector,
|
|
36
|
+
logger: logger.child({ context: 'nmr-processing' }),
|
|
37
|
+
onLoadProcessing,
|
|
38
|
+
experimentalFeatures,
|
|
39
|
+
});
|
|
40
|
+
if (nmriumState?.settings) {
|
|
41
|
+
dispatchPreferences({
|
|
42
|
+
type: 'SET_WORKSPACE',
|
|
43
|
+
payload: {
|
|
44
|
+
data: nmriumState.settings,
|
|
45
|
+
workspaceSource: 'nmriumFile',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
dispatch({
|
|
50
|
+
type: 'LOAD_DROP_FILES',
|
|
51
|
+
payload: {
|
|
52
|
+
nmriumState,
|
|
53
|
+
containsNmrium,
|
|
54
|
+
parseMetaFileResult,
|
|
55
|
+
spectraColors,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
loadFiles(files)
|
|
61
|
+
.catch((error) => {
|
|
62
|
+
toaster.show({ message: error.message, intent: 'danger' });
|
|
63
|
+
logger.error(error);
|
|
64
|
+
})
|
|
65
|
+
.finally(() => {
|
|
66
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
67
|
+
});
|
|
68
|
+
}, [
|
|
69
|
+
dispatch,
|
|
70
|
+
dispatchPreferences,
|
|
71
|
+
experimentalFeatures,
|
|
72
|
+
logger,
|
|
73
|
+
onOpenMetaInformation,
|
|
74
|
+
preferences,
|
|
75
|
+
toaster,
|
|
76
|
+
workspacePreferences,
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ForwardedRef } from 'react';
|
|
2
|
-
import type { NMRiumProps
|
|
2
|
+
import type { NMRiumProps } from './NMRium';
|
|
3
|
+
import { NMRiumRefAPI } from './NMRiumRefAPI';
|
|
3
4
|
type InnerNMRiumProps = Omit<NMRiumProps, 'onError'> & {
|
|
4
|
-
|
|
5
|
+
apiRef: ForwardedRef<NMRiumRefAPI>;
|
|
5
6
|
};
|
|
6
|
-
export declare function InnerNMRium({ data: nmriumData, workspace, customWorkspaces, preferences, getSpinner, onChange, emptyText,
|
|
7
|
+
export declare function InnerNMRium({ data: nmriumData, workspace, customWorkspaces, preferences, getSpinner, onChange, emptyText, apiRef, }: InnerNMRiumProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useReducer, useRef
|
|
2
|
+
import { useEffect, useReducer, useRef } from 'react';
|
|
3
3
|
import { useFullscreen } from 'react-science/ui';
|
|
4
4
|
import { AssignmentProvider } from '../assignment';
|
|
5
5
|
import { GlobalProvider } from '../context/GlobalContext';
|
|
@@ -8,14 +8,14 @@ import { LoggerProvider } from '../context/LoggerContext';
|
|
|
8
8
|
import { PreferencesProvider } from '../context/PreferencesContext';
|
|
9
9
|
import { ToasterProvider } from '../context/ToasterContext';
|
|
10
10
|
import { TopicMoleculeProvider } from '../context/TopicMoleculeContext';
|
|
11
|
-
import {
|
|
11
|
+
import { AlertProvider } from '../elements/Alert';
|
|
12
|
+
import { DialogProvider } from '../elements/DialogManager';
|
|
12
13
|
import { HighlightProvider } from '../highlight';
|
|
13
14
|
import { defaultGetSpinner, SpinnerProvider } from '../loader/SpinnerContext';
|
|
14
15
|
import preferencesReducer, { preferencesInitialState, initPreferencesState, readSettings, } from '../reducer/preferences/preferencesReducer';
|
|
15
|
-
import { getBlob } from '../utility/export';
|
|
16
16
|
import { InnerNMRiumContents } from './InnerNMRiumContents';
|
|
17
17
|
import NMRiumStateProvider from './NMRiumStateProvider';
|
|
18
|
-
export function InnerNMRium({ data: nmriumData, workspace, customWorkspaces, preferences, getSpinner = defaultGetSpinner, onChange, emptyText,
|
|
18
|
+
export function InnerNMRium({ data: nmriumData, workspace, customWorkspaces, preferences, getSpinner = defaultGetSpinner, onChange, emptyText, apiRef, }) {
|
|
19
19
|
const rootRef = useRef(null);
|
|
20
20
|
const elementsWrapperRef = useRef(null);
|
|
21
21
|
const viewerRef = useRef(null);
|
|
@@ -38,14 +38,9 @@ export function InnerNMRium({ data: nmriumData, workspace, customWorkspaces, pre
|
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
40
|
}, [customWorkspaces, preferences, workspace]);
|
|
41
|
-
useImperativeHandle(innerRef, () => ({
|
|
42
|
-
getSpectraViewerAsBlob: () => {
|
|
43
|
-
return rootRef?.current ? getBlob(rootRef.current, 'nmrSVG') : null;
|
|
44
|
-
},
|
|
45
|
-
}), []);
|
|
46
41
|
return (_jsx("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, translate: "no", children: _jsx(GlobalProvider, { value: {
|
|
47
42
|
rootRef: rootRef.current,
|
|
48
43
|
elementsWrapperRef: elementsWrapperRef.current,
|
|
49
44
|
viewerRef: viewerRef.current,
|
|
50
|
-
}, children: _jsx(PreferencesProvider, { value: preferencesState, children: _jsx(LoggerProvider, { children: _jsx(KeyModifiersProvider, { children: _jsx(ToasterProvider, { children: _jsx(NMRiumStateProvider, { onChange: onChange, nmriumData: nmriumData, children: _jsx(TopicMoleculeProvider, { children: _jsx(
|
|
45
|
+
}, children: _jsx(PreferencesProvider, { value: preferencesState, children: _jsx(LoggerProvider, { children: _jsx(KeyModifiersProvider, { children: _jsx(ToasterProvider, { children: _jsx(NMRiumStateProvider, { onChange: onChange, nmriumData: nmriumData, children: _jsx(TopicMoleculeProvider, { children: _jsx(DialogProvider, { children: _jsx(AlertProvider, { children: _jsx(HighlightProvider, { children: _jsx(AssignmentProvider, { children: _jsx(SpinnerProvider, { value: getSpinner, children: _jsx(InnerNMRiumContents, { emptyText: emptyText, mainDivRef: mainDivRef, elementsWrapperRef: elementsWrapperRef, rootRef: rootRef, viewerRef: viewerRef, apiRef: apiRef }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
51
46
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { RefObject } from 'react';
|
|
3
|
-
import { NMRiumProps } from '.';
|
|
2
|
+
import { ForwardedRef, RefObject } from 'react';
|
|
3
|
+
import { NMRiumProps, NMRiumRefAPI } from '.';
|
|
4
4
|
interface InnerNMRiumContentsProps {
|
|
5
5
|
emptyText: NMRiumProps['emptyText'];
|
|
6
6
|
mainDivRef: RefObject<HTMLDivElement>;
|
|
7
7
|
elementsWrapperRef: RefObject<HTMLDivElement>;
|
|
8
8
|
rootRef: RefObject<HTMLDivElement>;
|
|
9
9
|
viewerRef: RefObject<HTMLDivElement>;
|
|
10
|
+
apiRef: ForwardedRef<NMRiumRefAPI>;
|
|
10
11
|
}
|
|
11
12
|
export declare function InnerNMRiumContents(props: InnerNMRiumContentsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { Global, css } from '@emotion/react';
|
|
4
|
-
import { useCallback } from 'react';
|
|
4
|
+
import { useCallback, } from 'react';
|
|
5
5
|
import { useFullscreen } from 'react-science/ui';
|
|
6
6
|
import checkModifierKeyActivated from '../../data/utilities/checkModifierKeyActivated';
|
|
7
|
-
import Viewer1D from '../1d/Viewer1D';
|
|
8
|
-
import FloatMoleculeStructures from '../1d-2d/components/FloatMoleculeStructures';
|
|
9
|
-
import Viewer2D from '../2d/Viewer2D';
|
|
10
7
|
import KeysListenerTracker from '../EventsTrackers/KeysListenerTracker';
|
|
11
|
-
import {
|
|
8
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
9
|
+
import { PrintContent } from '../elements/print/PrintContent';
|
|
12
10
|
import Header from '../header/Header';
|
|
13
11
|
import DropZone from '../loader/DropZone';
|
|
14
12
|
import Panels from '../panels/Panels';
|
|
15
13
|
import ToolBar from '../toolbar/ToolBar';
|
|
14
|
+
import { useNMRiumRefAPI } from './NMRiumRefAPI';
|
|
15
|
+
import { NMRiumViewer } from './NMRiumViewer';
|
|
16
16
|
import { SplitPaneWrapper } from './SplitPaneWrapper';
|
|
17
17
|
import { StateError } from './StateError';
|
|
18
18
|
const viewerContainerStyle = css `
|
|
@@ -63,40 +63,49 @@ const containerStyles = css `
|
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
65
65
|
export function InnerNMRiumContents(props) {
|
|
66
|
-
const { emptyText, mainDivRef, elementsWrapperRef, rootRef, viewerRef } = props;
|
|
67
|
-
const { displayerMode } = useChartData();
|
|
66
|
+
const { emptyText, mainDivRef, elementsWrapperRef, rootRef, viewerRef, apiRef, } = props;
|
|
68
67
|
const { isFullScreen } = useFullscreen();
|
|
69
68
|
const preventContextMenuHandler = useCallback((e) => {
|
|
70
69
|
if (!checkModifierKeyActivated(e)) {
|
|
71
70
|
e.preventDefault();
|
|
72
71
|
}
|
|
73
72
|
}, []);
|
|
73
|
+
useNMRiumRefAPI(apiRef, rootRef);
|
|
74
74
|
return (_jsxs(_Fragment, { children: [_jsx(StateError, {}), _jsx(Global, { styles: css `
|
|
75
75
|
.actions-buttons-popover {
|
|
76
76
|
border-radius: 10px;
|
|
77
77
|
padding: 5px;
|
|
78
78
|
background-color: white;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
|
|
81
|
+
.popover-tab {
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
box-shadow: none;
|
|
84
|
+
}
|
|
85
|
+
` }), _jsxs("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: [_jsx(DropZone, { children: _jsxs("div", { style: {
|
|
86
|
+
display: 'flex',
|
|
87
|
+
flexDirection: 'column',
|
|
88
|
+
backgroundColor: 'white',
|
|
89
|
+
width: '100%',
|
|
90
|
+
}, children: [_jsx(Header, {}), _jsxs("div", { style: {
|
|
91
|
+
display: 'flex',
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
height: '100%',
|
|
94
|
+
}, children: [_jsx(ToolBar, {}), _jsxs(SplitPaneWrapper, { children: [_jsxs("div", { css: viewerContainerStyle, children: [_jsx(KeysListenerTracker, { mainDivRef: mainDivRef }), _jsx(NMRiumViewer, { emptyText: emptyText, viewerRef: viewerRef })] }), _jsx(Panels, {})] }), _jsx("div", { ref: elementsWrapperRef, id: "main-wrapper", style: {
|
|
95
|
+
position: 'absolute',
|
|
96
|
+
pointerEvents: 'none',
|
|
97
|
+
zIndex: 10,
|
|
98
|
+
left: 0,
|
|
99
|
+
right: 0,
|
|
100
|
+
top: 0,
|
|
101
|
+
bottom: 0,
|
|
102
|
+
} }, String(isFullScreen))] })] }) }), _jsx("div", {}), _jsx(PrintWrapper, { children: _jsx(NMRiumViewer, { emptyText: emptyText, viewerRef: viewerRef }) })] })] }));
|
|
103
|
+
}
|
|
104
|
+
function PrintWrapper(props) {
|
|
105
|
+
const { children } = props;
|
|
106
|
+
const { current: { printPageOptions }, dispatch, } = usePreferences();
|
|
107
|
+
function handleSavePrintOptions(options) {
|
|
108
|
+
dispatch({ type: 'CHANGE_PRINT_PAGE_SETTINGS', payload: options });
|
|
109
|
+
}
|
|
110
|
+
return (_jsx(PrintContent, { defaultPrintPageOptions: printPageOptions, onPrint: handleSavePrintOptions, children: children }));
|
|
102
111
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CustomWorkspaces, WorkspacePreferences as NMRiumPreferences } from 'nmr-load-save';
|
|
2
2
|
import { ReactElement, ReactNode } from 'react';
|
|
3
3
|
import { ErrorBoundaryPropsWithComponent } from 'react-error-boundary';
|
|
4
|
-
import {
|
|
4
|
+
import { NMRiumRefAPI } from './NMRiumRefAPI';
|
|
5
5
|
import { NMRiumChangeCb, NMRiumData, NMRiumWorkspace } from './types';
|
|
6
6
|
export interface NMRiumProps {
|
|
7
7
|
data?: NMRiumData;
|
|
@@ -17,7 +17,4 @@ export interface NMRiumProps {
|
|
|
17
17
|
*/
|
|
18
18
|
getSpinner?: () => ReactElement;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
21
|
-
getSpectraViewerAsBlob: () => BlobObject | null;
|
|
22
|
-
}
|
|
23
|
-
export declare const NMRium: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<NMRiumProps & import("react").RefAttributes<NMRiumRef>>>;
|
|
20
|
+
export declare const NMRium: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<NMRiumProps & import("react").RefAttributes<NMRiumRefAPI>>>;
|
|
@@ -6,7 +6,7 @@ import ErrorOverlay from './ErrorOverlay';
|
|
|
6
6
|
import { InnerNMRium } from './InnerNMRium';
|
|
7
7
|
const NMRiumBase = forwardRef(function NMRium(props, ref) {
|
|
8
8
|
const { noErrorBoundary = false, onError, ...otherProps } = props;
|
|
9
|
-
const innerNmrium = _jsx(InnerNMRium, { ...otherProps,
|
|
9
|
+
const innerNmrium = _jsx(InnerNMRium, { ...otherProps, apiRef: ref });
|
|
10
10
|
const children = noErrorBoundary ? (innerNmrium) : (_jsx(ErrorBoundary, { FallbackComponent: ErrorOverlay, onError: onError, children: innerNmrium }));
|
|
11
11
|
return (_jsx(FullScreenProvider, { children: _jsx(RootLayout, { style: { width: '100%' }, children: children }) }));
|
|
12
12
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ForwardedRef, RefObject } from 'react';
|
|
2
|
+
import { BlobObject } from '../utility/export';
|
|
3
|
+
export interface NMRiumRefAPI {
|
|
4
|
+
getSpectraViewerAsBlob: () => BlobObject | null;
|
|
5
|
+
loadFiles: (files: File[]) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useNMRiumRefAPI(ref: ForwardedRef<NMRiumRefAPI>, rootRef: RefObject<HTMLDivElement>): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useImperativeHandle } from 'react';
|
|
2
|
+
import { useLoadFiles } from '../loader/useLoadFiles';
|
|
3
|
+
import { getBlob } from '../utility/export';
|
|
4
|
+
export function useNMRiumRefAPI(ref, rootRef) {
|
|
5
|
+
const loadFiles = useLoadFiles();
|
|
6
|
+
useImperativeHandle(ref, () => ({
|
|
7
|
+
getSpectraViewerAsBlob: () => {
|
|
8
|
+
return rootRef.current ? getBlob(rootRef.current, 'nmrSVG') : null;
|
|
9
|
+
},
|
|
10
|
+
loadFiles,
|
|
11
|
+
}), [rootRef, loadFiles]);
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSProperties, RefObject } from 'react';
|
|
2
|
+
import { NMRiumProps } from './NMRium';
|
|
3
|
+
interface NMRiumViewerProps {
|
|
4
|
+
emptyText: NMRiumProps['emptyText'];
|
|
5
|
+
viewerRef: RefObject<HTMLDivElement>;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
onRender?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function NMRiumViewer(props: NMRiumViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useDeferredValue, useEffect } from 'react';
|
|
3
|
+
import Viewer1D from '../1d/Viewer1D';
|
|
4
|
+
import FloatMoleculeStructures from '../1d-2d/components/FloatMoleculeStructures';
|
|
5
|
+
import Viewer2D from '../2d/Viewer2D';
|
|
6
|
+
import { useChartData } from '../context/ChartContext';
|
|
7
|
+
export function NMRiumViewer(props) {
|
|
8
|
+
const { emptyText, viewerRef, onRender, style = {} } = props;
|
|
9
|
+
const { displayerMode, width, height } = useChartData();
|
|
10
|
+
const renderDimension = useDeferredValue({ width, height });
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
function handleRenderComplete() {
|
|
13
|
+
if (typeof onRender !== 'function') {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
if (renderDimension.width !== width ||
|
|
18
|
+
renderDimension.height !== height) {
|
|
19
|
+
onRender();
|
|
20
|
+
}
|
|
21
|
+
}, 0);
|
|
22
|
+
}
|
|
23
|
+
const animationFrameId = requestAnimationFrame(handleRenderComplete);
|
|
24
|
+
return () => {
|
|
25
|
+
cancelAnimationFrame(animationFrameId);
|
|
26
|
+
};
|
|
27
|
+
}, [onRender, width, height, renderDimension.width, renderDimension.height]);
|
|
28
|
+
return (_jsxs("div", { id: "nmrium-viewer", "data-testid": "viewer", ref: viewerRef, style: {
|
|
29
|
+
width: '100%',
|
|
30
|
+
height: '100%',
|
|
31
|
+
position: 'relative',
|
|
32
|
+
backgroundColor: 'white',
|
|
33
|
+
...style,
|
|
34
|
+
}, children: [_jsx(FloatMoleculeStructures, {}), displayerMode === '1D' ? (_jsx(Viewer1D, { emptyText: emptyText })) : (_jsx(Viewer2D, { emptyText: emptyText }))] }));
|
|
35
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface CopyClipboardModalProps {
|
|
2
|
-
text
|
|
2
|
+
text?: string;
|
|
3
|
+
title: string;
|
|
3
4
|
onClose: () => void;
|
|
4
5
|
onCopyClick: (text: string) => void;
|
|
5
6
|
}
|
|
6
|
-
declare function CopyClipboardModal(
|
|
7
|
+
declare function CopyClipboardModal(props: CopyClipboardModalProps): import("@emotion/react/jsx-runtime").JSX.Element | undefined;
|
|
7
8
|
export default CopyClipboardModal;
|
|
@@ -1,39 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Button, Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
5
|
+
import styled from '@emotion/styled';
|
|
4
6
|
import { FaCopy } from 'react-icons/fa';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.inner-container {
|
|
11
|
-
padding: 5px;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 180px;
|
|
14
|
-
border: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.main-buttons-container {
|
|
18
|
-
padding: 5px 0;
|
|
19
|
-
border-bottom: 0.55px solid #ebebeb;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
button {
|
|
25
|
-
background-color: transparent;
|
|
26
|
-
border: none;
|
|
27
|
-
padding: 0 5px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
button:disabled {
|
|
31
|
-
opacity: 0.6;
|
|
32
|
-
}
|
|
7
|
+
const Body = styled.div `
|
|
8
|
+
padding: 5px;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 180px;
|
|
11
|
+
border: none;
|
|
33
12
|
`;
|
|
34
|
-
function CopyClipboardModal(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
function CopyClipboardModal(props) {
|
|
14
|
+
const { text, ...otherProps } = props;
|
|
15
|
+
if (!text)
|
|
16
|
+
return;
|
|
17
|
+
return _jsx(InnerCopyClipboardModal, { text: text, ...otherProps });
|
|
18
|
+
}
|
|
19
|
+
function InnerCopyClipboardModal(props) {
|
|
20
|
+
const { text, title, onClose, onCopyClick } = props;
|
|
21
|
+
return (_jsxs(Dialog, { isOpen: true, title: title, onClose: onClose, children: [_jsx(DialogBody, { css: css `
|
|
22
|
+
background-color: white;
|
|
23
|
+
`, children: _jsx(Body, { dangerouslySetInnerHTML: { __html: text } }) }), _jsx(DialogFooter, { children: _jsx(Button, { onClick: () => onCopyClick(text), intent: "success", icon: _jsx(FaCopy, {}) }) })] }));
|
|
38
24
|
}
|
|
39
25
|
export default CopyClipboardModal;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { PeaksNucleusPreferences } from 'nmr-load-save';
|
|
2
1
|
import { Peak1D } from 'nmr-processing';
|
|
3
2
|
interface EditPeakShapeModalProps {
|
|
4
|
-
|
|
5
|
-
peak
|
|
6
|
-
peaksPreferences: PeaksNucleusPreferences;
|
|
3
|
+
onCloseDialog: () => void;
|
|
4
|
+
peak?: Peak1D;
|
|
7
5
|
}
|
|
8
|
-
declare function EditPeakShapeModal(
|
|
9
|
-
export
|
|
6
|
+
export declare function EditPeakShapeModal(props: EditPeakShapeModalProps): import("@emotion/react/jsx-runtime").JSX.Element | undefined;
|
|
7
|
+
export {};
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, 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 { useState } from 'react';
|
|
7
|
+
import { useForm } from 'react-hook-form';
|
|
6
8
|
import * as Yup from 'yup';
|
|
9
|
+
import { useChartData } from '../context/ChartContext';
|
|
7
10
|
import { useDispatch } from '../context/DispatchContext';
|
|
8
11
|
import ActionButtons from '../elements/ActionButtons';
|
|
9
|
-
import { CloseButton } from '../elements/CloseButton';
|
|
10
12
|
import Label from '../elements/Label';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
+
import { NumberInput2Controller } from '../elements/NumberInput2Controller';
|
|
14
|
+
import { Select2 } from '../elements/Select2';
|
|
15
|
+
import { usePanelPreferences } from '../hooks/usePanelPreferences';
|
|
13
16
|
import { formatNumber } from '../utility/formatNumber';
|
|
14
|
-
|
|
15
|
-
const styles = css `
|
|
16
|
-
width: 400px;
|
|
17
|
-
min-height: 250px;
|
|
18
|
-
|
|
19
|
-
.inner-content {
|
|
20
|
-
flex: 1;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
const getKindDefaultValues = (kind) => {
|
|
17
|
+
function getKindDefaultValues(kind) {
|
|
24
18
|
return {
|
|
25
19
|
kind,
|
|
26
20
|
fwhm: 500,
|
|
27
21
|
...(kind === 'pseudoVoigt' && { mu: 0.5 }),
|
|
28
22
|
};
|
|
29
|
-
}
|
|
30
|
-
|
|
23
|
+
}
|
|
24
|
+
function getValues(peak, kind) {
|
|
31
25
|
const { shape } = peak;
|
|
32
26
|
const shapeData = (shape?.kind || '').toLocaleLowerCase() !== kind
|
|
33
27
|
? {
|
|
@@ -36,11 +30,13 @@ const getValues = (peak, kind) => {
|
|
|
36
30
|
}
|
|
37
31
|
: shape;
|
|
38
32
|
return shapeData;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
33
|
+
}
|
|
34
|
+
function validation(kind) {
|
|
35
|
+
return Yup.object().shape({
|
|
36
|
+
fwhm: Yup.number().required(),
|
|
37
|
+
...(kind === 'pseudoVoigt' && { mu: Yup.number().required() }),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
44
40
|
const KINDS = [
|
|
45
41
|
{
|
|
46
42
|
value: 'gaussian',
|
|
@@ -60,12 +56,23 @@ const labelStyle = {
|
|
|
60
56
|
label: { flex: 3, fontSize: '14px', fontWeight: 'normal' },
|
|
61
57
|
wrapper: { flex: 7, display: 'flex' },
|
|
62
58
|
};
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
export function EditPeakShapeModal(props) {
|
|
60
|
+
const { peak, ...otherProps } = props;
|
|
61
|
+
if (!peak)
|
|
62
|
+
return;
|
|
63
|
+
return _jsx(InnerEditPeakShapeModal, { peak: peak, ...otherProps });
|
|
64
|
+
}
|
|
65
|
+
function InnerEditPeakShapeModal(props) {
|
|
66
|
+
const { peak, onCloseDialog } = props;
|
|
65
67
|
const dispatch = useDispatch();
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
68
|
+
const { view: { spectra: { activeTab }, }, } = useChartData();
|
|
69
|
+
const peaksPreferences = usePanelPreferences('peaks', activeTab);
|
|
70
|
+
const [kind, setKind] = useState(peak.shape?.kind || 'gaussian');
|
|
71
|
+
const { handleSubmit, control, reset } = useForm({
|
|
72
|
+
defaultValues: getValues(peak, kind),
|
|
73
|
+
resolver: yupResolver(validation(kind)),
|
|
74
|
+
});
|
|
75
|
+
function changePeakShapeHandler(values) {
|
|
69
76
|
dispatch({
|
|
70
77
|
type: 'CHANGE_PEAK_SHAPE',
|
|
71
78
|
payload: {
|
|
@@ -75,10 +82,15 @@ function EditPeakShapeModal({ onClose = () => null, peak, peaksPreferences, }) {
|
|
|
75
82
|
},
|
|
76
83
|
},
|
|
77
84
|
});
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
85
|
+
onCloseDialog();
|
|
86
|
+
}
|
|
87
|
+
function handleChangeKind({ value }) {
|
|
88
|
+
reset(getValues(peak, value));
|
|
89
|
+
setKind(value);
|
|
90
|
+
}
|
|
81
91
|
const valuePPM = formatNumber(peak.x, peaksPreferences.deltaPPM.format);
|
|
82
|
-
return (_jsxs(
|
|
92
|
+
return (_jsxs(Dialog, { isOpen: true, style: { width: 400 }, onClose: onCloseDialog, title: `Peak Shape Edition ( ${valuePPM} PPM )`, children: [_jsx(DialogBody, { css: css `
|
|
93
|
+
background-color: white;
|
|
94
|
+
padding: 1.5em 3em;
|
|
95
|
+
`, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Kind:", style: labelStyle, children: _jsx(Select2, { items: KINDS, selectedItemValue: kind, onItemSelect: handleChangeKind }) }), _jsx(Label, { title: "FWHM:", style: labelStyle, children: _jsx(NumberInput2Controller, { min: 0, control: control, name: "fwhm" }) }), kind === 'pseudoVoigt' && (_jsx(Label, { title: "Mu:", style: labelStyle, children: _jsx(NumberInput2Controller, { min: 0, control: control, name: "mu" }) }))] }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => handleSubmit(changePeakShapeHandler)(), doneLabel: "Save", onCancel: () => onCloseDialog?.() }) })] }));
|
|
83
96
|
}
|
|
84
|
-
export default EditPeakShapeModal;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Spectrum } from 'nmr-load-save';
|
|
2
|
-
interface
|
|
2
|
+
interface InnerExportAsJCAMPProps {
|
|
3
3
|
closeDialog: () => void;
|
|
4
|
-
spectrum
|
|
4
|
+
spectrum?: Spectrum;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
interface ExportAsJCAMPProps extends InnerExportAsJCAMPProps {
|
|
7
|
+
exportActiveSpectrum?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function ExportAsJcampModal(props: ExportAsJCAMPProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
7
10
|
export default ExportAsJcampModal;
|