nmrium 1.1.0 → 1.2.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.
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/FloatPublicationString.js +2 -2
- package/lib/component/1d/FloatingRanges.js +3 -3
- package/lib/component/1d/FloatingRanges.js.map +1 -1
- package/lib/component/1d/FooterBanner.js +1 -1
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/PredictionErrorsNotations.js +2 -2
- package/lib/component/1d/inset/DraggableInset.js +2 -2
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js.map +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.d.ts.map +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +3 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js +1 -1
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -2
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.js +1 -1
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts.map +1 -1
- package/lib/component/2d/zones/Signal.js +1 -1
- package/lib/component/2d/zones/Signal.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +2 -2
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/Zone.d.ts.map +1 -1
- package/lib/component/2d/zones/Zone.js +3 -1
- package/lib/component/2d/zones/Zone.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +4 -4
- package/lib/component/elements/Alert.js +2 -2
- package/lib/component/elements/AssignmentsCell.js +1 -1
- package/lib/component/elements/Button.js +10 -10
- package/lib/component/elements/Button.js.map +1 -1
- package/lib/component/elements/DraggableDialog.js +3 -3
- package/lib/component/elements/EditableColumn.js +3 -3
- package/lib/component/elements/EmptyText.js +2 -2
- package/lib/component/elements/Footer.js +9 -9
- package/lib/component/elements/Footer.js.map +1 -1
- package/lib/component/elements/MoleculeSelection.js +19 -19
- package/lib/component/elements/MoleculeSelection.js.map +1 -1
- package/lib/component/elements/NextPrev.js +15 -15
- package/lib/component/elements/NextPrev.js.map +1 -1
- package/lib/component/elements/ReactTable/BaseReactTable.js +6 -6
- package/lib/component/elements/ReadOnly.js +8 -8
- package/lib/component/elements/ReadOnly.js.map +1 -1
- package/lib/component/elements/Sections.js +29 -29
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/Select.js +10 -10
- package/lib/component/elements/Select.js.map +1 -1
- package/lib/component/elements/StyledDialogBody.js +1 -1
- package/lib/component/elements/StyledDialogBody.js.map +1 -1
- package/lib/component/elements/Tab/DeleteButton.js +5 -5
- package/lib/component/elements/Tab/Tabs.js +5 -5
- package/lib/component/elements/dropDownButton/DropDownList.js +6 -6
- package/lib/component/elements/export/ExportManager.d.ts.map +1 -1
- package/lib/component/elements/export/ExportManager.js +12 -1
- package/lib/component/elements/export/ExportManager.js.map +1 -1
- package/lib/component/elements/resizer/SVGResizer.js +1 -1
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +25 -10
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/useFilter.d.ts.map +1 -1
- package/lib/component/hooks/useFilter.js +4 -5
- package/lib/component/hooks/useFilter.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +2 -2
- package/lib/component/loader/DefaultSpinnerComponent.js +9 -9
- package/lib/component/loader/DropZone.js +8 -8
- package/lib/component/main/ErrorOverlay.js +4 -4
- package/lib/component/main/InnerNMRiumContents.js +3 -3
- package/lib/component/main/NMRiumViewer.d.ts.map +1 -1
- package/lib/component/main/NMRiumViewer.js +13 -2
- package/lib/component/main/NMRiumViewer.js.map +1 -1
- package/lib/component/modal/AboutPredictionModal.js +2 -2
- package/lib/component/modal/AboutSpectrumSimulationModal.js +2 -2
- package/lib/component/modal/MultipletAnalysisModal.js +12 -12
- package/lib/component/modal/PredictSpectraModal.js +4 -4
- package/lib/component/modal/PublicationStringModal.js +2 -2
- package/lib/component/modal/aboutUs/AboutUsModal.js +3 -3
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.js +5 -5
- package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +5 -5
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PanelsBar.js +3 -3
- package/lib/component/panels/PanelsBar.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +6 -6
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +9 -9
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +5 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +11 -11
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +7 -7
- package/lib/component/panels/SummaryPanel/Overview.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -5
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.js +6 -6
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +32 -5
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/InnerFilterHeader.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +4 -4
- package/lib/component/panels/predictionPanel/PredictionPanel.js +6 -6
- package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +69 -38
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/workspaces/assignment.d.ts.map +1 -1
- package/lib/component/workspaces/assignment.js +1 -0
- package/lib/component/workspaces/assignment.js.map +1 -1
- package/lib/component/workspaces/basic.d.ts.map +1 -1
- package/lib/component/workspaces/basic.js +1 -0
- package/lib/component/workspaces/basic.js.map +1 -1
- package/lib/component/workspaces/embedded.d.ts.map +1 -1
- package/lib/component/workspaces/embedded.js +1 -0
- package/lib/component/workspaces/embedded.js.map +1 -1
- package/lib/component/workspaces/exercise.d.ts.map +1 -1
- package/lib/component/workspaces/exercise.js +1 -0
- package/lib/component/workspaces/exercise.js.map +1 -1
- package/lib/component/workspaces/prediction.d.ts.map +1 -1
- package/lib/component/workspaces/prediction.js +1 -0
- package/lib/component/workspaces/prediction.js.map +1 -1
- package/lib/component/workspaces/process1D.d.ts.map +1 -1
- package/lib/component/workspaces/process1D.js +1 -0
- package/lib/component/workspaces/process1D.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +7 -21
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/utilities/generateColor.d.ts.map +1 -1
- package/lib/data/utilities/generateColor.js +1 -1
- package/lib/data/utilities/generateColor.js.map +1 -1
- package/lib/data/utilities/isNumber.js +1 -1
- package/lib/data/utilities/isNumber.js.map +1 -1
- package/lib/utils/clipboard/clipboardComponents.js +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +41 -36
- package/src/component/1d/ExclusionZoneAnnotation.tsx +1 -1
- package/src/component/1d/FloatPublicationString.tsx +2 -2
- package/src/component/1d/FloatingRanges.tsx +3 -3
- package/src/component/1d/FooterBanner.tsx +1 -1
- package/src/component/1d/LinesSeries.tsx +1 -1
- package/src/component/1d/PredictionErrorsNotations.tsx +2 -2
- package/src/component/1d/inset/DraggableInset.tsx +2 -2
- package/src/component/1d/multiAnalysis/AnalysisRange.tsx +1 -1
- package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +3 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +1 -1
- package/src/component/1d/peaks/Peaks.tsx +2 -6
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +3 -3
- package/src/component/1d-2d/tools/BrushXY.tsx +2 -2
- package/src/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.tsx +1 -1
- package/src/component/2d/SignalDeltaLine.tsx +1 -1
- package/src/component/2d/zones/Signal.tsx +2 -1
- package/src/component/2d/zones/SignalsGuideLines.tsx +2 -2
- package/src/component/2d/zones/Zone.tsx +2 -1
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
- package/src/component/elements/ActionsButtonsPopover.tsx +4 -4
- package/src/component/elements/Alert.tsx +2 -2
- package/src/component/elements/AssignmentsCell.tsx +1 -1
- package/src/component/elements/Button.tsx +10 -10
- package/src/component/elements/DraggableDialog.tsx +3 -3
- package/src/component/elements/EditableColumn.tsx +3 -3
- package/src/component/elements/EmptyText.tsx +2 -2
- package/src/component/elements/Footer.tsx +9 -9
- package/src/component/elements/MoleculeSelection.tsx +19 -19
- package/src/component/elements/NextPrev.tsx +15 -15
- package/src/component/elements/ReactTable/BaseReactTable.tsx +6 -6
- package/src/component/elements/ReadOnly.tsx +8 -8
- package/src/component/elements/Sections.tsx +29 -29
- package/src/component/elements/Select.tsx +10 -10
- package/src/component/elements/StyledDialogBody.tsx +1 -1
- package/src/component/elements/Tab/DeleteButton.tsx +5 -5
- package/src/component/elements/Tab/Tabs.tsx +5 -5
- package/src/component/elements/dropDownButton/DropDownList.tsx +6 -6
- package/src/component/elements/export/ExportManager.tsx +13 -3
- package/src/component/elements/resizer/SVGResizer.tsx +1 -1
- package/src/component/header/Header.tsx +1 -1
- package/src/component/hooks/useExport.tsx +21 -10
- package/src/component/hooks/useFilter.ts +4 -6
- package/src/component/hooks/useSaveSettings.tsx +2 -2
- package/src/component/loader/DefaultSpinnerComponent.tsx +9 -9
- package/src/component/loader/DropZone.tsx +8 -8
- package/src/component/main/ErrorOverlay.tsx +4 -4
- package/src/component/main/InnerNMRiumContents.tsx +3 -3
- package/src/component/main/NMRiumViewer.tsx +16 -2
- package/src/component/modal/AboutPredictionModal.tsx +2 -2
- package/src/component/modal/AboutSpectrumSimulationModal.tsx +2 -2
- package/src/component/modal/MultipletAnalysisModal.tsx +12 -12
- package/src/component/modal/PredictSpectraModal.tsx +4 -4
- package/src/component/modal/PublicationStringModal.tsx +2 -2
- package/src/component/modal/aboutUs/AboutUsModal.tsx +3 -3
- package/src/component/modal/changeSum/ChangeSumModalContents.tsx +1 -1
- package/src/component/modal/changeSum/SelectMolecule.tsx +5 -5
- package/src/component/modal/setting/GeneralSettings.tsx +5 -5
- package/src/component/panels/Panels.tsx +2 -2
- package/src/component/panels/PanelsBar.tsx +3 -3
- package/src/component/panels/RangesPanel/RangesTable.tsx +6 -6
- package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -1
- package/src/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.tsx +9 -9
- package/src/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.tsx +5 -5
- package/src/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.tsx +11 -11
- package/src/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.tsx +7 -7
- package/src/component/panels/SummaryPanel/Overview.tsx +1 -1
- package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -5
- package/src/component/panels/ZonesPanel/ZonesTable.tsx +6 -6
- package/src/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.tsx +1 -0
- package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +37 -5
- package/src/component/panels/filtersPanel/Filters/InnerFilterHeader.tsx +1 -1
- package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -0
- package/src/component/panels/multipleAnalysisPanel/AlignSpectra.tsx +4 -4
- package/src/component/panels/predictionPanel/PredictionPanel.tsx +6 -6
- package/src/component/panels/predictionPanel/PredictionSimpleOptions.tsx +1 -1
- package/src/component/reducer/actions/FiltersActions.ts +197 -91
- package/src/component/reducer/actions/ToolsActions.ts +5 -4
- package/src/component/workspaces/assignment.ts +1 -0
- package/src/component/workspaces/basic.ts +1 -0
- package/src/component/workspaces/embedded.ts +1 -0
- package/src/component/workspaces/exercise.ts +1 -0
- package/src/component/workspaces/prediction.ts +1 -0
- package/src/component/workspaces/process1D.ts +1 -0
- package/src/component/workspaces/workspaceDefaultProperties.ts +1 -0
- package/src/data/PredictionManager.ts +8 -23
- package/src/data/SpectraManager.ts +1 -1
- package/src/data/data1d/Spectrum1D/ranges/resurrectSpectrum.ts +1 -1
- package/src/data/utilities/generateColor.ts +5 -3
- package/src/data/utilities/isNumber.ts +1 -1
- package/src/utils/clipboard/clipboardComponents.tsx +1 -1
- package/src/versionInfo.ts +1 -1
|
@@ -3,15 +3,15 @@ import type { CSSProperties } from 'react';
|
|
|
3
3
|
import { FaTimes } from 'react-icons/fa';
|
|
4
4
|
|
|
5
5
|
const BaseButton = styled.button`
|
|
6
|
-
|
|
7
|
-
width: 16px;
|
|
8
|
-
height: 16px;
|
|
6
|
+
align-items: center;
|
|
9
7
|
background-color: transparent;
|
|
10
8
|
border: none;
|
|
11
|
-
|
|
9
|
+
border-radius: 50%;
|
|
12
10
|
display: flex;
|
|
13
|
-
|
|
11
|
+
height: 16px;
|
|
14
12
|
justify-content: center;
|
|
13
|
+
padding: 0;
|
|
14
|
+
width: 16px;
|
|
15
15
|
|
|
16
16
|
.icon {
|
|
17
17
|
color: #252525;
|
|
@@ -7,16 +7,16 @@ import type { TabEvents, TabProps } from './Tab.js';
|
|
|
7
7
|
import Tab from './Tab.js';
|
|
8
8
|
|
|
9
9
|
const topStyles = css`
|
|
10
|
-
height: 100%;
|
|
11
|
-
width: 100%;
|
|
12
10
|
display: flex;
|
|
13
11
|
flex-direction: column;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
14
|
|
|
15
15
|
.tab-list {
|
|
16
16
|
border-bottom: 1px solid #ccc;
|
|
17
|
-
padding-left: 0;
|
|
18
|
-
margin: 0;
|
|
19
17
|
display: inline-flex;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding-left: 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.tab-list li:first-of-type {
|
|
@@ -52,8 +52,8 @@ const leftStyles = css`
|
|
|
52
52
|
|
|
53
53
|
.tab-list {
|
|
54
54
|
border-right: 1px solid #ccc;
|
|
55
|
-
padding-left: 0;
|
|
56
55
|
margin: 0;
|
|
56
|
+
padding-left: 0;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.tab-list li:hover {
|
|
@@ -8,27 +8,27 @@ import type {
|
|
|
8
8
|
|
|
9
9
|
const Menu = styled.ul`
|
|
10
10
|
list-style-type: none;
|
|
11
|
-
padding: 0;
|
|
12
11
|
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
13
|
`;
|
|
14
14
|
const MenuItem = styled.li`
|
|
15
|
+
border-bottom: 0.55px solid #f9f9f9;
|
|
16
|
+
color: black;
|
|
15
17
|
text-align: center;
|
|
16
18
|
white-space: nowrap;
|
|
17
|
-
color: black;
|
|
18
|
-
border-bottom: 0.55px solid #f9f9f9;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
:last-of-type {
|
|
21
21
|
border-bottom: none;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
:hover {
|
|
25
25
|
background-color: #f6f6f6;
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
29
|
const Text = styled.span`
|
|
30
|
-
padding: 5px 20px;
|
|
31
30
|
display: block;
|
|
31
|
+
padding: 5px 20px;
|
|
32
32
|
`;
|
|
33
33
|
|
|
34
34
|
interface InnerDropDownListProps<T>
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import { useChartData } from '../../context/ChartContext.js';
|
|
12
12
|
import { usePreferences } from '../../context/PreferencesContext.js';
|
|
13
|
+
import { useToaster } from '../../context/ToasterContext.tsx';
|
|
13
14
|
import { useExportViewPort } from '../../hooks/useExport.js';
|
|
14
15
|
import { useWorkspaceExportSettings } from '../../hooks/useWorkspaceExportSettings.js';
|
|
15
16
|
|
|
@@ -67,11 +68,13 @@ interface ExportManagerControllerProps {
|
|
|
67
68
|
|
|
68
69
|
export function ExportManagerController(props: ExportManagerControllerProps) {
|
|
69
70
|
const { children } = props;
|
|
70
|
-
|
|
71
|
+
const { data, width } = useChartData();
|
|
72
|
+
const hasDataToExport = data.length > 0;
|
|
71
73
|
const [exportOptions, triggerExport] = useState<ExportOptions | null>(null);
|
|
72
74
|
const exportRef = useExportManagerAPI();
|
|
73
75
|
const workspaceExportSettings = useWorkspaceExportSettings();
|
|
74
76
|
const { dispatch } = usePreferences();
|
|
77
|
+
const toaster = useToaster();
|
|
75
78
|
useImperativeHandle(
|
|
76
79
|
exportRef,
|
|
77
80
|
() => ({
|
|
@@ -97,6 +100,15 @@ export function ExportManagerController(props: ExportManagerControllerProps) {
|
|
|
97
100
|
return null;
|
|
98
101
|
}
|
|
99
102
|
|
|
103
|
+
if (!hasDataToExport) {
|
|
104
|
+
handleCloseExportOptionsDialog();
|
|
105
|
+
toaster.show({
|
|
106
|
+
intent: 'danger',
|
|
107
|
+
message: 'No spectra available for export',
|
|
108
|
+
});
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
const { format, destination = 'file' } = exportOptions;
|
|
101
113
|
|
|
102
114
|
const handlers: ExportHandlers = {
|
|
@@ -133,8 +145,6 @@ export function ExportManagerController(props: ExportManagerControllerProps) {
|
|
|
133
145
|
void runExport();
|
|
134
146
|
}
|
|
135
147
|
|
|
136
|
-
const { width } = useChartData();
|
|
137
|
-
|
|
138
148
|
if (!exportOptions) return null;
|
|
139
149
|
|
|
140
150
|
const { format, destination = 'file' } = exportOptions;
|
|
@@ -32,9 +32,8 @@ export function useExport() {
|
|
|
32
32
|
const hideLoading = toaster.showLoading({
|
|
33
33
|
message: 'Exporting as NMRium process in progress',
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
void (async () => {
|
|
35
|
+
setTimeout(async () => {
|
|
36
|
+
try {
|
|
38
37
|
const fileName = state.data[0]?.info?.name;
|
|
39
38
|
const exportedData = toJSON(core, state, preferencesState, {
|
|
40
39
|
exportTarget: 'nmrium',
|
|
@@ -42,11 +41,16 @@ export function useExport() {
|
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
await exportAsJSON(exportedData, fileName, spaceIndent, isCompressed);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
toaster.show({
|
|
46
|
+
intent: 'danger',
|
|
47
|
+
message: `Export failed due to an unexpected error: ${(error as Error)?.message || 'Unknown error'}`,
|
|
48
|
+
});
|
|
49
|
+
reportError(error);
|
|
50
|
+
} finally {
|
|
45
51
|
hideLoading();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
reportError(error);
|
|
49
|
-
}
|
|
52
|
+
}
|
|
53
|
+
}, 0);
|
|
50
54
|
},
|
|
51
55
|
[core, preferencesState, state, toaster],
|
|
52
56
|
);
|
|
@@ -58,16 +62,23 @@ export function useExport() {
|
|
|
58
62
|
const hideLoading = toaster.showLoading({
|
|
59
63
|
message: `Exporting as ${name}.nmrium process in progress`,
|
|
60
64
|
});
|
|
61
|
-
setTimeout(() => {
|
|
62
|
-
|
|
65
|
+
setTimeout(async () => {
|
|
66
|
+
try {
|
|
63
67
|
const exportedData = toJSON(core, state, preferencesState, {
|
|
64
68
|
...include,
|
|
65
69
|
exportTarget: 'nmrium',
|
|
66
70
|
});
|
|
67
71
|
const spaceIndent = pretty ? 2 : 0;
|
|
68
72
|
await exportAsJSON(exportedData, name, spaceIndent, compressed);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
toaster.show({
|
|
75
|
+
intent: 'danger',
|
|
76
|
+
message: `Export failed due to an unexpected error: ${(error as Error)?.message || 'Unknown error'}`,
|
|
77
|
+
});
|
|
78
|
+
reportError(error);
|
|
79
|
+
} finally {
|
|
69
80
|
hideLoading();
|
|
70
|
-
}
|
|
81
|
+
}
|
|
71
82
|
}, 0);
|
|
72
83
|
}
|
|
73
84
|
|
|
@@ -7,7 +7,7 @@ import type { FilterEntry } from '../../data/types/common/FilterEntry.js';
|
|
|
7
7
|
|
|
8
8
|
import useSpectrum from './useSpectrum.js';
|
|
9
9
|
|
|
10
|
-
const emptyData = { filters:
|
|
10
|
+
const emptyData = { filters: [] };
|
|
11
11
|
type FilterReturnType<T> = T extends Filter1DEntry['name']
|
|
12
12
|
? ExtractFilterEntry<T>
|
|
13
13
|
: T extends Filter2DEntry['name']
|
|
@@ -20,12 +20,10 @@ export function useFilter<T extends FilterEntry['name']>(
|
|
|
20
20
|
const { filters } = useSpectrum(emptyData) as Spectrum1D | Spectrum2D;
|
|
21
21
|
|
|
22
22
|
return useMemo(() => {
|
|
23
|
-
|
|
23
|
+
if (!filters?.length) return null;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
return filter as FilterReturnType<T>;
|
|
27
|
-
}
|
|
25
|
+
const filter = filters.find((filter) => filter.name === filterID);
|
|
28
26
|
|
|
29
|
-
return null;
|
|
27
|
+
return (filter as FilterReturnType<T>) ?? null;
|
|
30
28
|
}, [filterID, filters]);
|
|
31
29
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
|
|
3
3
|
const Container = styled.div`
|
|
4
|
-
|
|
4
|
+
position: absolute;
|
|
5
5
|
align-items: center;
|
|
6
|
-
justify-content: center;
|
|
7
6
|
background-color: rgb(255 255 255 / 25%);
|
|
8
|
-
|
|
7
|
+
display: flex;
|
|
9
8
|
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
justify-content: center;
|
|
10
11
|
user-select: none;
|
|
11
|
-
position: absolute;
|
|
12
12
|
width: 100%;
|
|
13
13
|
|
|
14
14
|
svg {
|
|
15
|
-
animation-name: spin-animation;
|
|
16
|
-
animation-iteration-count: infinite;
|
|
17
|
-
animation-fill-mode: forwards;
|
|
18
15
|
animation-direction: inherit;
|
|
19
|
-
animation-timing-function: linear;
|
|
20
16
|
animation-duration: 1s;
|
|
21
|
-
|
|
17
|
+
animation-fill-mode: forwards;
|
|
18
|
+
animation-iteration-count: infinite;
|
|
19
|
+
animation-name: spin-animation;
|
|
20
|
+
animation-timing-function: linear;
|
|
22
21
|
height: 100px;
|
|
22
|
+
width: 100px;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@keyframes spin-animation {
|
|
@@ -12,28 +12,28 @@ import { MetaImportationModal } from '../modal/metaImportation/MetaImportationMo
|
|
|
12
12
|
import { useLoadFiles } from './useLoadFiles.js';
|
|
13
13
|
|
|
14
14
|
const DropContainer = styled.div`
|
|
15
|
-
height: 100%;
|
|
16
|
-
background-color: #b5b5b599;
|
|
17
15
|
position: absolute;
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
16
|
align-items: center;
|
|
17
|
+
background-color: #b5b5b599;
|
|
18
|
+
display: flex;
|
|
21
19
|
flex-flow: column;
|
|
20
|
+
height: 100%;
|
|
21
|
+
justify-content: center;
|
|
22
22
|
z-index: 8;
|
|
23
23
|
|
|
24
24
|
svg {
|
|
25
|
-
stroke-width: 0;
|
|
26
|
-
font-size: 3rem !important;
|
|
27
25
|
fill: white;
|
|
26
|
+
font-size: 3rem !important;
|
|
27
|
+
stroke-width: 0;
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
31
|
const DropText = styled.p`
|
|
32
|
-
color: white;
|
|
33
32
|
background-color: rgb(104 104 104);
|
|
34
|
-
padding: 1.5%;
|
|
35
33
|
border-radius: 30px;
|
|
34
|
+
color: white;
|
|
36
35
|
margin: 0;
|
|
36
|
+
padding: 1.5%;
|
|
37
37
|
`;
|
|
38
38
|
|
|
39
39
|
const Container = styled.div`
|
|
@@ -3,19 +3,19 @@ import type { FallbackProps } from 'react-error-boundary';
|
|
|
3
3
|
|
|
4
4
|
const WrongP = styled.p`
|
|
5
5
|
background-color: white;
|
|
6
|
-
padding: 20px;
|
|
7
6
|
border-radius: 10px;
|
|
8
7
|
font-size: 30px;
|
|
8
|
+
padding: 20px;
|
|
9
9
|
text-align: center;
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
const Details = styled.details`
|
|
13
|
-
margin-top: 10px;
|
|
14
|
-
white-space: pre-wrap;
|
|
15
13
|
background-color: white;
|
|
16
|
-
padding: 20px;
|
|
17
14
|
border-radius: 10px;
|
|
18
15
|
color: red;
|
|
16
|
+
margin-top: 10px;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
white-space: pre-wrap;
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
export default function ErrorOverlay(props: FallbackProps) {
|
|
@@ -26,9 +26,9 @@ import type { NMRiumProps, NMRiumRefAPI } from './index.js';
|
|
|
26
26
|
|
|
27
27
|
const NMRiumContainer = styled.div`
|
|
28
28
|
background-color: white;
|
|
29
|
-
width: 100%;
|
|
30
29
|
display: block;
|
|
31
30
|
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
32
|
|
|
33
33
|
div:focus {
|
|
34
34
|
outline: none !important;
|
|
@@ -62,8 +62,8 @@ const NMRiumContainer = styled.div`
|
|
|
62
62
|
|
|
63
63
|
.actions-buttons-popover {
|
|
64
64
|
background: transparent;
|
|
65
|
-
padding: 5px;
|
|
66
65
|
box-shadow: none;
|
|
66
|
+
padding: 5px;
|
|
67
67
|
}
|
|
68
68
|
`;
|
|
69
69
|
|
|
@@ -105,9 +105,9 @@ export function InnerNMRiumContents(props: InnerNMRiumContentsProps) {
|
|
|
105
105
|
<Global
|
|
106
106
|
styles={css`
|
|
107
107
|
.actions-buttons-popover {
|
|
108
|
+
background-color: white;
|
|
108
109
|
border-radius: 10px;
|
|
109
110
|
padding: 5px;
|
|
110
|
-
background-color: white;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.popover-tab {
|
|
@@ -10,6 +10,7 @@ import { SVGRootContainer } from '../1d-2d/components/SVGRootContainer.js';
|
|
|
10
10
|
import Viewer2D from '../2d/Viewer2D.js';
|
|
11
11
|
import { useChartData } from '../context/ChartContext.js';
|
|
12
12
|
import { useExportSettings } from '../elements/export/index.js';
|
|
13
|
+
import { usePrintPage } from '../elements/print/PrintProvider.tsx';
|
|
13
14
|
import {
|
|
14
15
|
useCheckExportStatus,
|
|
15
16
|
useViewportSize,
|
|
@@ -33,13 +34,26 @@ export function NMRiumViewer(props: NMRiumViewerProps) {
|
|
|
33
34
|
const viewPort = useViewportSize();
|
|
34
35
|
const { displayerMode } = useChartData();
|
|
35
36
|
const exportSettings = useExportSettings();
|
|
37
|
+
const printSettings = usePrintPage();
|
|
36
38
|
|
|
37
39
|
useOnRender(onRender);
|
|
38
40
|
|
|
39
41
|
const isExportingProcessStart = useCheckExportStatus();
|
|
40
42
|
|
|
41
|
-
if (isExportingProcessStart && exportSettings) {
|
|
42
|
-
|
|
43
|
+
if (isExportingProcessStart && (exportSettings || printSettings)) {
|
|
44
|
+
if (!exportSettings && !printSettings) {
|
|
45
|
+
return <text>Print/export settings are missing.</text>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const { width, height } = exportSettings || printSettings || {};
|
|
49
|
+
let exportHeight = height;
|
|
50
|
+
let exportWidth = width;
|
|
51
|
+
|
|
52
|
+
if (exportSettings) {
|
|
53
|
+
exportHeight = exportSettings.exportHeight;
|
|
54
|
+
exportWidth = exportSettings.exportWidth;
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
return (
|
|
44
58
|
<SVGRootContainer
|
|
45
59
|
enableBoxBorder={displayerMode === '2D'}
|
|
@@ -13,8 +13,8 @@ const DialogBody = styled(StyledDialogBody)`
|
|
|
13
13
|
|
|
14
14
|
p,
|
|
15
15
|
li {
|
|
16
|
-
user-select: text;
|
|
17
16
|
font-size: 1.1em;
|
|
17
|
+
user-select: text;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
a {
|
|
@@ -28,8 +28,8 @@ const DialogBody = styled(StyledDialogBody)`
|
|
|
28
28
|
|
|
29
29
|
.header span {
|
|
30
30
|
color: #464646;
|
|
31
|
-
font-size: 15px;
|
|
32
31
|
flex: 1;
|
|
32
|
+
font-size: 15px;
|
|
33
33
|
user-select: none;
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -15,8 +15,8 @@ const DialogBody = styled(StyledDialogBody)`
|
|
|
15
15
|
|
|
16
16
|
p,
|
|
17
17
|
li {
|
|
18
|
-
user-select: text;
|
|
19
18
|
font-size: 1.1em;
|
|
19
|
+
user-select: text;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
a {
|
|
@@ -30,8 +30,8 @@ const DialogBody = styled(StyledDialogBody)`
|
|
|
30
30
|
|
|
31
31
|
.header span {
|
|
32
32
|
color: #464646;
|
|
33
|
-
font-size: 15px;
|
|
34
33
|
flex: 1;
|
|
34
|
+
font-size: 15px;
|
|
35
35
|
user-select: none;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -12,46 +12,46 @@ import { useScaleChecked } from '../context/ScaleContext.js';
|
|
|
12
12
|
import { StyledDialogBody } from '../elements/StyledDialogBody.js';
|
|
13
13
|
|
|
14
14
|
const Container = styled.div`
|
|
15
|
-
padding: 10px;
|
|
16
15
|
max-height: 500px;
|
|
17
16
|
overflow-y: auto;
|
|
17
|
+
padding: 10px;
|
|
18
18
|
`;
|
|
19
19
|
|
|
20
20
|
const Row = styled.div`
|
|
21
|
-
outline: none;
|
|
22
21
|
display: flex;
|
|
23
22
|
flex-direction: row;
|
|
24
23
|
margin: 0;
|
|
24
|
+
outline: none;
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
:nth-child(odd) {
|
|
27
27
|
background: #fafafa;
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
31
|
const Multiplicity = styled.div`
|
|
32
|
-
flex: 2;
|
|
33
|
-
display: flex;
|
|
34
32
|
align-items: center;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex: 2;
|
|
35
35
|
justify-content: center;
|
|
36
36
|
padding: 0 20px;
|
|
37
37
|
`;
|
|
38
38
|
|
|
39
39
|
const LoaderContainer = styled.div`
|
|
40
|
-
display: flex;
|
|
41
40
|
align-items: center;
|
|
42
|
-
|
|
41
|
+
display: flex;
|
|
43
42
|
flex-direction: column;
|
|
43
|
+
justify-content: center;
|
|
44
44
|
user-select: none;
|
|
45
45
|
|
|
46
46
|
svg {
|
|
47
|
-
animation-name: spin-animation;
|
|
48
|
-
animation-iteration-count: infinite;
|
|
49
|
-
animation-fill-mode: forwards;
|
|
50
47
|
animation-direction: inherit;
|
|
51
|
-
animation-timing-function: linear;
|
|
52
48
|
animation-duration: 1s;
|
|
53
|
-
|
|
49
|
+
animation-fill-mode: forwards;
|
|
50
|
+
animation-iteration-count: infinite;
|
|
51
|
+
animation-name: spin-animation;
|
|
52
|
+
animation-timing-function: linear;
|
|
54
53
|
height: 100px;
|
|
54
|
+
width: 100px;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
@keyframes spin-animation {
|
|
@@ -26,15 +26,15 @@ const DialogBody = styled(StyledDialogBody)`
|
|
|
26
26
|
|
|
27
27
|
.warning {
|
|
28
28
|
color: #c40000;
|
|
29
|
-
font-weight: bold;
|
|
30
29
|
font-size: 13px;
|
|
31
|
-
|
|
30
|
+
font-weight: bold;
|
|
32
31
|
margin-top: 30px;
|
|
32
|
+
text-align: justify;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.warning-container {
|
|
36
|
-
margin-top: 5px;
|
|
37
36
|
display: flex;
|
|
37
|
+
margin-top: 5px;
|
|
38
38
|
|
|
39
39
|
input {
|
|
40
40
|
margin: 5px 5px 5px 0;
|
|
@@ -42,8 +42,8 @@ const DialogBody = styled(StyledDialogBody)`
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.header {
|
|
45
|
-
padding: 0;
|
|
46
45
|
margin: 0 30%;
|
|
46
|
+
padding: 0;
|
|
47
47
|
width: 40%;
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
@@ -16,10 +16,10 @@ import { usePanelPreferences } from '../hooks/usePanelPreferences.js';
|
|
|
16
16
|
import useSpectrum from '../hooks/useSpectrum.js';
|
|
17
17
|
|
|
18
18
|
const Body = styled.div`
|
|
19
|
+
border: 1px solid #e9e9e9;
|
|
20
|
+
min-height: 180px;
|
|
19
21
|
padding: 5px;
|
|
20
22
|
width: 100%;
|
|
21
|
-
min-height: 180px;
|
|
22
|
-
border: 1px solid #e9e9e9;
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
25
|
const labelStyle: LabelStyle = {
|
|
@@ -29,8 +29,8 @@ const CustomDialogBody = styled(StyledDialogBody)`
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
span.title {
|
|
32
|
-
font-weight: bold;
|
|
33
32
|
color: #ea580c;
|
|
33
|
+
font-weight: bold;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
span.content {
|
|
@@ -54,9 +54,9 @@ const CustomDialogBody = styled(StyledDialogBody)`
|
|
|
54
54
|
`;
|
|
55
55
|
|
|
56
56
|
const InfoBlock = styled.div`
|
|
57
|
+
align-items: center;
|
|
57
58
|
display: flex;
|
|
58
59
|
flex-direction: column;
|
|
59
|
-
align-items: center;
|
|
60
60
|
`;
|
|
61
61
|
const Container = styled.div`
|
|
62
62
|
padding: 20px;
|
|
@@ -64,9 +64,9 @@ const Container = styled.div`
|
|
|
64
64
|
|
|
65
65
|
const Separator = styled.span`
|
|
66
66
|
border-bottom: 1px solid gray;
|
|
67
|
-
width: 15px;
|
|
68
67
|
height: 1px;
|
|
69
68
|
margin: 10px 0;
|
|
69
|
+
width: 15px;
|
|
70
70
|
`;
|
|
71
71
|
|
|
72
72
|
function AboutUsModal() {
|
|
@@ -14,27 +14,27 @@ const Container = styled.div`
|
|
|
14
14
|
flex-grow: 1;
|
|
15
15
|
`;
|
|
16
16
|
const SelectionContainer = styled.div`
|
|
17
|
-
width: 450px;
|
|
18
17
|
display: block;
|
|
19
18
|
margin: 0 auto;
|
|
19
|
+
width: 450px;
|
|
20
20
|
`;
|
|
21
21
|
const Title = styled.p`
|
|
22
22
|
padding: 0 10px;
|
|
23
|
-
width: 100%;
|
|
24
23
|
text-align: center;
|
|
24
|
+
width: 100%;
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
const SumValue = styled.p`
|
|
28
28
|
margin-top: 15px;
|
|
29
29
|
padding: 0 10px;
|
|
30
|
-
width: 100%;
|
|
31
30
|
text-align: center;
|
|
31
|
+
width: 100%;
|
|
32
32
|
`;
|
|
33
33
|
const EmptyText = styled.p<{ color: CSSProperties['color'] }>`
|
|
34
|
-
|
|
34
|
+
color: ${({ color }) => color};
|
|
35
35
|
padding: 20%;
|
|
36
36
|
text-align: center;
|
|
37
|
-
|
|
37
|
+
width: 100%;
|
|
38
38
|
`;
|
|
39
39
|
|
|
40
40
|
export default function SelectMolecule<
|
|
@@ -46,11 +46,11 @@ import ToolsTabContent from './settings-tabs/ToolsTabContent.js';
|
|
|
46
46
|
import { validation } from './settingsValidation.js';
|
|
47
47
|
|
|
48
48
|
export const Section = styled.div`
|
|
49
|
+
border-bottom: 0.55px solid #f9f9f9;
|
|
50
|
+
color: #2ca8ff;
|
|
49
51
|
display: flex;
|
|
50
52
|
font-size: 13px;
|
|
51
|
-
color: #2ca8ff;
|
|
52
53
|
margin-bottom: 10px;
|
|
53
|
-
border-bottom: 0.55px solid #f9f9f9;
|
|
54
54
|
padding: 6px 2px;
|
|
55
55
|
`;
|
|
56
56
|
|
|
@@ -62,10 +62,10 @@ const StyledTabs = styled(Tabs)`
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
div[role='tabpanel'] {
|
|
65
|
-
width: 100%;
|
|
66
|
-
padding: 0.8rem;
|
|
67
|
-
overflow: auto;
|
|
68
65
|
max-height: 100%;
|
|
66
|
+
overflow: auto;
|
|
67
|
+
padding: 0.8rem;
|
|
68
|
+
width: 100%;
|
|
69
69
|
}
|
|
70
70
|
`;
|
|
71
71
|
|
|
@@ -16,9 +16,9 @@ import { useTogglePanel } from './hooks/useTogglePanel.js';
|
|
|
16
16
|
import { InformationEditionModal } from './informationPanel/InformationEditionModal.js';
|
|
17
17
|
|
|
18
18
|
const Container = styled.div`
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
19
|
flex: 1 1 0%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
width: 100%;
|
|
22
22
|
`;
|
|
23
23
|
interface PanelStateContext {
|
|
24
24
|
openSplitPane: () => void;
|